2 * AUTOMATICALLY GENERATED TEMPLATE
3 * DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN
5 *}}<script type="text/javascript" src="{{$baseurl}}/view/theme/diabook/js/jquery.autogrow.textarea.js"></script>
6 <script type="text/javascript">
8 $(document).ready(function() {
9 $("iframe").each(function(){
10 var ifr_source = $(this).attr("src");
11 var wmode = "wmode=transparent";
12 if(ifr_source.indexOf("?") != -1) {
13 var getQString = ifr_source.split("?");
14 var oldString = getQString[1];
15 var newString = getQString[0];
16 $(this).attr("src",newString+"?"+wmode+"&"+oldString);
18 else $(this).attr("src",ifr_source+"?"+wmode);
22 $("div#pause").attr("style", "position: fixed;bottom: 43px;left: 5px;");
23 $("div#pause").html("<img src='images/pause.gif' alt='pause' title='pause live-updates (ctrl+space)' style='border: 1px solid black;opacity: 0.2;'>");
24 $(document).keydown(function(event) {
25 if (!$("div#pause").html()){
26 $("div#pause").html("<img src='images/pause.gif' alt='pause' title='pause live-updates (ctrl+space)' style='border: 1px solid black;opacity: 0.2;'>");
28 $(".autocomplete").attr("style", "width: 350px;color: black;border: 1px solid #D2D2D2;background: white;cursor: pointer;text-align: left;max-height: 350px;overflow: auto;");
32 $(document).ready(function(){
33 $("#sortable_boxes").sortable({
34 update: function(event, ui) {
35 var BoxOrder = $(this).sortable("toArray").toString();
36 $.cookie("Boxorder", BoxOrder , { expires: 365, path: "/" });
40 var cookie = $.cookie("Boxorder");
42 var SavedID = cookie.split(",");
43 for (var Sitem=0, m = SavedID.length; Sitem < m; Sitem++) {
44 $("#sortable_boxes").append($("#sortable_boxes").children("#" + SavedID[Sitem]));
50 function tautogrow(id){
51 $("textarea#comment-edit-text-" +id).autogrow();
54 function open_boxsettings() {
55 $("div#boxsettings").attr("style","display: block;height:500px;width:300px;");
56 $("label").attr("style","width: 150px;");
59 function yt_iframe() {
60 $("iframe").load(function() {
61 var ifr_src = $(this).contents().find("body iframe").attr("src");
62 $("iframe").contents().find("body iframe").attr("src", ifr_src+"&wmode=transparent");
67 function scrolldown(){
68 $("html, body").animate({scrollTop:$(document).height()}, "slow");
73 $("html, body").animate({scrollTop:0}, "slow");
77 $(window).scroll(function () {
79 var footer_top = $(document).height() - 30;
80 $("div#footerbox").css("top", footer_top);
82 var scrollInfo = $(window).scrollTop();
84 if (scrollInfo <= "900"){
85 $("a#top").attr("id","down");
86 $("a#down").attr("onclick","scrolldown()");
87 $("img#scroll_top_bottom").attr("src","view/theme/diabook/icons/scroll_bottom.png");
88 $("img#scroll_top_bottom").attr("title","Scroll to bottom");
91 if (scrollInfo > "900"){
92 $("a#down").attr("id","top");
93 $("a#top").attr("onclick","scrolltop()");
94 $("img#scroll_top_bottom").attr("src","view/theme/diabook/icons/scroll_top.png");
95 $("img#scroll_top_bottom").attr("title","Back to top");
101 function insertFormatting(comment,BBcode,id) {
103 var tmpStr = $("#comment-edit-text-" + id).val();
104 if(tmpStr == comment) {
106 $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
107 $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
108 openMenu("comment-edit-submit-wrapper-" + id);
111 textarea = document.getElementById("comment-edit-text-" +id);
112 if (document.selection) {
114 selected = document.selection.createRange();
115 if (BBcode == "url"){
116 selected.text = "["+BBcode+"]" + "http://" + selected.text + "[/"+BBcode+"]";
118 selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
119 } else if (textarea.selectionStart || textarea.selectionStart == "0") {
120 var start = textarea.selectionStart;
121 var end = textarea.selectionEnd;
122 if (BBcode == "url"){
123 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
125 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
130 function cmtBbOpen(id) {
131 $(".comment-edit-bb-" + id).show();
133 function cmtBbClose(id) {
134 $(".comment-edit-bb-" + id).hide();
137 /*$(document).ready(function(){
138 var doctitle = document.title;
139 function checkNotify() {
140 if(document.getElementById("notify-update").innerHTML != "")
141 document.title = "("+document.getElementById("notify-update").innerHTML+") " + doctitle;
143 document.title = doctitle;
145 setInterval(function () {checkNotify();}, 10 * 1000);
149 var pagetitle = null;
150 $("nav").bind('nav-update', function(e,data){
151 if (pagetitle==null) pagetitle = document.title;
152 var count = $(data).find('notif').attr('count');
154 document.title = "("+count+") "+pagetitle;
156 document.title = pagetitle;