2 * AUTOMATICALLY GENERATED TEMPLATE
3 * DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN
6 <script type="text/javascript" src="{{$baseurl}}/view/theme/diabook/js/jquery.autogrow.textarea.js"></script>
7 <script type="text/javascript">
9 $(document).ready(function() {
12 $("div#pause").attr("style", "position: fixed;bottom: 43px;left: 5px;");
13 $("div#pause").html("<img src='images/pause.gif' alt='pause' title='pause live-updates (ctrl+space)' style='border: 1px solid black;opacity: 0.2;'>");
14 $(document).keydown(function(event) {
15 if (!$("div#pause").html()){
16 $("div#pause").html("<img src='images/pause.gif' alt='pause' title='pause live-updates (ctrl+space)' style='border: 1px solid black;opacity: 0.2;'>");
18 $(".autocomplete").attr("style", "width: 350px;color: black;border: 1px solid #D2D2D2;background: white;cursor: pointer;text-align: left;max-height: 350px;overflow: auto;");
22 $(document).ready(function(){
23 $("#sortable_boxes").sortable({
24 update: function(event, ui) {
25 var BoxOrder = $(this).sortable("toArray").toString();
26 $.cookie("Boxorder", BoxOrder , { expires: 365, path: "/" });
30 var cookie = $.cookie("Boxorder");
32 var SavedID = cookie.split(",");
33 for (var Sitem=0, m = SavedID.length; Sitem < m; Sitem++) {
34 $("#sortable_boxes").append($("#sortable_boxes").children("#" + SavedID[Sitem]));
40 function tautogrow(id){
41 $("textarea#comment-edit-text-" +id).autogrow();
44 function open_boxsettings() {
45 $("div#boxsettings").attr("style","display: block;height:500px;width:300px;");
46 $("label").attr("style","width: 150px;");
49 function yt_iframe() {
50 $("iframe").load(function() {
51 var ifr_src = $(this).contents().find("body iframe").attr("src");
52 $("iframe").contents().find("body iframe").attr("src", ifr_src+"&wmode=transparent");
57 function scrolldown(){
58 $("html, body").animate({scrollTop:$(document).height()}, "slow");
63 $("html, body").animate({scrollTop:0}, "slow");
67 $(window).scroll(function () {
69 var footer_top = $(document).height() - 30;
70 $("div#footerbox").css("top", footer_top);
72 var scrollInfo = $(window).scrollTop();
74 if (scrollInfo <= "900"){
75 $("a#top").attr("id","down");
76 $("a#down").attr("onclick","scrolldown()");
77 $("img#scroll_top_bottom").attr("src","view/theme/diabook/icons/scroll_bottom.png");
78 $("img#scroll_top_bottom").attr("title","Scroll to bottom");
81 if (scrollInfo > "900"){
82 $("a#down").attr("id","top");
83 $("a#top").attr("onclick","scrolltop()");
84 $("img#scroll_top_bottom").attr("src","view/theme/diabook/icons/scroll_top.png");
85 $("img#scroll_top_bottom").attr("title","Back to top");
91 function insertFormatting(comment,BBcode,id) {
93 var tmpStr = $("#comment-edit-text-" + id).val();
94 if(tmpStr == comment) {
96 $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
97 $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
98 openMenu("comment-edit-submit-wrapper-" + id);
101 textarea = document.getElementById("comment-edit-text-" +id);
102 if (document.selection) {
104 selected = document.selection.createRange();
105 if (BBcode == "url"){
106 selected.text = "["+BBcode+"]" + "http://" + selected.text + "[/"+BBcode+"]";
108 selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
109 } else if (textarea.selectionStart || textarea.selectionStart == "0") {
110 var start = textarea.selectionStart;
111 var end = textarea.selectionEnd;
112 if (BBcode == "url"){
113 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
115 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
120 function cmtBbOpen(id) {
121 $(".comment-edit-bb-" + id).show();
123 function cmtBbClose(id) {
124 $(".comment-edit-bb-" + id).hide();
127 /*$(document).ready(function(){
128 var doctitle = document.title;
129 function checkNotify() {
130 if(document.getElementById("notify-update").innerHTML != "")
131 document.title = "("+document.getElementById("notify-update").innerHTML+") " + doctitle;
133 document.title = doctitle;
135 setInterval(function () {checkNotify();}, 10 * 1000);
139 var pagetitle = null;
140 $("nav").bind('nav-update', function(e,data){
141 if (pagetitle==null) pagetitle = document.title;
142 var count = $(data).find('notif').attr('count');
144 document.title = "("+count+") "+pagetitle;
146 document.title = pagetitle;