1 <script type="text/javascript" src="$baseurl/view/theme/diabook/js/jquery.autogrow.textarea.js"></script>
2 <script type="text/javascript">
3 $(document).ready(function() {
6 function tautogrow(id){
7 $("textarea#comment-edit-text-" +id).autogrow();
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);
25 function yt_iframe() {
27 $("iframe").load(function() {
28 var ifr_src = $(this).contents().find("body iframe").attr("src");
29 $("iframe").contents().find("body iframe").attr("src", ifr_src+"&wmode=transparent");
34 function scrolldown(){
35 $("html, body").animate({scrollTop:$(document).height()}, "slow");
40 $("html, body").animate({scrollTop:0}, "slow");
44 $(window).scroll(function () {
46 var footer_top = $(document).height() - 30;
47 $("div#footerbox").css("top", footer_top);
49 var scrollInfo = $(window).scrollTop();
51 if (scrollInfo <= "900"){
52 $("a#top").attr("id","down");
53 $("a#down").attr("onclick","scrolldown()");
54 $("img#scroll_top_bottom").attr("src","view/theme/diabook/icons/scroll_bottom.png");
57 if (scrollInfo > "900"){
58 $("a#down").attr("id","top");
59 $("a#top").attr("onclick","scrolltop()");
60 $("img#scroll_top_bottom").attr("src","view/theme/diabook/icons/scroll_top.png");
66 function insertFormatting(comment,BBcode,id) {
68 var tmpStr = $("#comment-edit-text-" + id).val();
69 if(tmpStr == comment) {
71 $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
72 $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
73 openMenu("comment-edit-submit-wrapper-" + id);
76 textarea = document.getElementById("comment-edit-text-" +id);
77 if (document.selection) {
79 selected = document.selection.createRange();
81 selected.text = "["+BBcode+"]" + "http://" + selected.text + "[/"+BBcode+"]";
83 selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
84 } else if (textarea.selectionStart || textarea.selectionStart == "0") {
85 var start = textarea.selectionStart;
86 var end = textarea.selectionEnd;
88 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
90 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
95 function cmtBbOpen(id) {
96 $(".comment-edit-bb-" + id).show();
98 function cmtBbClose(id) {
99 $(".comment-edit-bb-" + id).hide();