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() {
10 $("iframe").each(function(){
11 var ifr_source = $(this).attr("src");
12 var wmode = "wmode=transparent";
13 if(ifr_source.indexOf("?") != -1) {
14 var getQString = ifr_source.split("?");
15 var oldString = getQString[1];
16 var newString = getQString[0];
17 $(this).attr("src",newString+"?"+wmode+"&"+oldString);
19 else $(this).attr("src",ifr_source+"?"+wmode);
23 $("div#pause").attr("style", "position: fixed;bottom: 43px;left: 5px;");
24 $("div#pause").html("<img src='images/pause.gif' alt='pause' title='pause live-updates (ctrl+space)' style='border: 1px solid black;opacity: 0.2;'>");
25 $(document).keydown(function(event) {
26 if (!$("div#pause").html()){
27 $("div#pause").html("<img src='images/pause.gif' alt='pause' title='pause live-updates (ctrl+space)' style='border: 1px solid black;opacity: 0.2;'>");
29 $(".autocomplete").attr("style", "width: 350px;color: black;border: 1px solid #D2D2D2;background: white;cursor: pointer;text-align: left;max-height: 350px;overflow: auto;");
33 $(document).ready(function(){
34 $("#sortable_boxes").sortable({
35 update: function(event, ui) {
36 var BoxOrder = $(this).sortable("toArray").toString();
37 $.cookie("Boxorder", BoxOrder , { expires: 365, path: "/" });
41 var cookie = $.cookie("Boxorder");
43 var SavedID = cookie.split(",");
44 for (var Sitem=0, m = SavedID.length; Sitem < m; Sitem++) {
45 $("#sortable_boxes").append($("#sortable_boxes").children("#" + SavedID[Sitem]));
51 function tautogrow(id){
52 $("textarea#comment-edit-text-" +id).autogrow();
55 function open_boxsettings() {
56 $("div#boxsettings").attr("style","display: block;height:500px;width:300px;");
57 $("label").attr("style","width: 150px;");
60 function yt_iframe() {
61 $("iframe").load(function() {
62 var ifr_src = $(this).contents().find("body iframe").attr("src");
63 $("iframe").contents().find("body iframe").attr("src", ifr_src+"&wmode=transparent");
68 function scrolldown(){
69 $("html, body").animate({scrollTop:$(document).height()}, "slow");
74 $("html, body").animate({scrollTop:0}, "slow");
78 $(window).scroll(function () {
80 var footer_top = $(document).height() - 30;
81 $("div#footerbox").css("top", footer_top);
83 var scrollInfo = $(window).scrollTop();
85 if (scrollInfo <= "900"){
86 $("a#top").attr("id","down");
87 $("a#down").attr("onclick","scrolldown()");
88 $("img#scroll_top_bottom").attr("src","view/theme/diabook/icons/scroll_bottom.png");
89 $("img#scroll_top_bottom").attr("title","Scroll to bottom");
92 if (scrollInfo > "900"){
93 $("a#down").attr("id","top");
94 $("a#top").attr("onclick","scrolltop()");
95 $("img#scroll_top_bottom").attr("src","view/theme/diabook/icons/scroll_top.png");
96 $("img#scroll_top_bottom").attr("title","Back to top");
102 function insertFormatting(comment,BBcode,id) {
104 var tmpStr = $("#comment-edit-text-" + id).val();
105 if(tmpStr == comment) {
107 $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
108 $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
109 openMenu("comment-edit-submit-wrapper-" + id);
112 textarea = document.getElementById("comment-edit-text-" +id);
113 if (document.selection) {
115 selected = document.selection.createRange();
116 if (BBcode == "url"){
117 selected.text = "["+BBcode+"]" + "http://" + selected.text + "[/"+BBcode+"]";
119 selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
120 } else if (textarea.selectionStart || textarea.selectionStart == "0") {
121 var start = textarea.selectionStart;
122 var end = textarea.selectionEnd;
123 if (BBcode == "url"){
124 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
126 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
131 function cmtBbOpen(id) {
132 $(".comment-edit-bb-" + id).show();
134 function cmtBbClose(id) {
135 $(".comment-edit-bb-" + id).hide();
138 /*$(document).ready(function(){
139 var doctitle = document.title;
140 function checkNotify() {
141 if(document.getElementById("notify-update").innerHTML != "")
142 document.title = "("+document.getElementById("notify-update").innerHTML+") " + doctitle;
144 document.title = doctitle;
146 setInterval(function () {checkNotify();}, 10 * 1000);
150 var pagetitle = null;
151 $("nav").bind('nav-update', function(e,data){
152 if (pagetitle==null) pagetitle = document.title;
153 var count = $(data).find('notif').attr('count');
155 document.title = "("+count+") "+pagetitle;
157 document.title = pagetitle;