1 <script type="text/javascript" src="$baseurl/view/theme/diabook/js/jquery.autogrow.textarea.js"></script>
2 <script type="text/javascript">
4 $(document).ready(function() {
5 $("iframe").each(function(){
6 var ifr_source = $(this).attr("src");
7 var wmode = "wmode=transparent";
8 if(ifr_source.indexOf("?") != -1) {
9 var getQString = ifr_source.split("?");
10 var oldString = getQString[1];
11 var newString = getQString[0];
12 $(this).attr("src",newString+"?"+wmode+"&"+oldString);
14 else $(this).attr("src",ifr_source+"?"+wmode);
20 $(document).ready(function(){
21 $("#sortable_boxes").sortable({
22 update: function(event, ui) {
23 var BoxOrder = $(this).sortable("toArray").toString();
24 $.cookie("Boxorder", BoxOrder , { expires: 365, path: "/" });
28 var cookie = $.cookie("Boxorder");
30 var SavedID = cookie.split(",");
31 for (var Sitem=0, m = SavedID.length; Sitem < m; Sitem++) {
32 $("#sortable_boxes").append($("#sortable_boxes").children("#" + SavedID[Sitem]));
37 function tautogrow(id){
38 $("textarea#comment-edit-text-" +id).autogrow();
41 function yt_iframe() {
42 $("iframe").load(function() {
43 var ifr_src = $(this).contents().find("body iframe").attr("src");
44 $("iframe").contents().find("body iframe").attr("src", ifr_src+"&wmode=transparent");
49 function scrolldown(){
50 $("html, body").animate({scrollTop:$(document).height()}, "slow");
55 $("html, body").animate({scrollTop:0}, "slow");
59 $(window).scroll(function () {
61 var footer_top = $(document).height() - 30;
62 $("div#footerbox").css("top", footer_top);
64 var scrollInfo = $(window).scrollTop();
66 if (scrollInfo <= "900"){
67 $("a#top").attr("id","down");
68 $("a#down").attr("onclick","scrolldown()");
69 $("img#scroll_top_bottom").attr("src","view/theme/diabook/icons/scroll_bottom.png");
70 $("img#scroll_top_bottom").attr("title","Scroll to bottom");
73 if (scrollInfo > "900"){
74 $("a#down").attr("id","top");
75 $("a#top").attr("onclick","scrolltop()");
76 $("img#scroll_top_bottom").attr("src","view/theme/diabook/icons/scroll_top.png");
77 $("img#scroll_top_bottom").attr("title","Back to top");
83 function insertFormatting(comment,BBcode,id) {
85 var tmpStr = $("#comment-edit-text-" + id).val();
86 if(tmpStr == comment) {
88 $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
89 $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
90 openMenu("comment-edit-submit-wrapper-" + id);
93 textarea = document.getElementById("comment-edit-text-" +id);
94 if (document.selection) {
96 selected = document.selection.createRange();
98 selected.text = "["+BBcode+"]" + "http://" + selected.text + "[/"+BBcode+"]";
100 selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
101 } else if (textarea.selectionStart || textarea.selectionStart == "0") {
102 var start = textarea.selectionStart;
103 var end = textarea.selectionEnd;
104 if (BBcode == "url"){
105 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
107 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
112 function cmtBbOpen(id) {
113 $(".comment-edit-bb-" + id).show();
115 function cmtBbClose(id) {
116 $(".comment-edit-bb-" + id).hide();