Friendica Communications Platform (please note that this is a clone of the repository at github, issues are handled there) https://friendi.ca
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

155 lines
5.2 KiB

9 years ago
  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() {
  4. $("iframe").each(function(){
  5. var ifr_source = $(this).attr("src");
  6. var wmode = "wmode=transparent";
  7. if(ifr_source.indexOf("?") != -1) {
  8. var getQString = ifr_source.split("?");
  9. var oldString = getQString[1];
  10. var newString = getQString[0];
  11. $(this).attr("src",newString+"?"+wmode+"&"+oldString);
  12. }
  13. else $(this).attr("src",ifr_source+"?"+wmode);
  14. });
  15. $("div#pause").attr("style", "position: fixed;bottom: 43px;left: 5px;");
  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;'>");
  17. $(document).keydown(function(event) {
  18. if (!$("div#pause").html()){
  19. $("div#pause").html("<img src='images/pause.gif' alt='pause' title='pause live-updates (ctrl+space)' style='border: 1px solid black;opacity: 0.2;'>");
  20. }});
  21. $(".autocomplete").attr("style", "width: 350px;color: black;border: 1px solid #D2D2D2;background: white;cursor: pointer;text-align: left;max-height: 350px;overflow: auto;");
  22. });
  23. $(document).ready(function(){
  24. $("#sortable_boxes").sortable({
  25. update: function(event, ui) {
  26. var BoxOrder = $(this).sortable("toArray").toString();
  27. $.cookie("Boxorder", BoxOrder , { expires: 365, path: "/" });
  28. }
  29. });
  30. var cookie = $.cookie("Boxorder");
  31. if (!cookie) return;
  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]));
  35. }
  36. });
  37. function tautogrow(id){
  38. $("textarea#comment-edit-text-" +id).autogrow();
  39. };
  40. function open_boxsettings() {
  41. $("div#boxsettings").attr("style","display: block;height:500px;width:300px;");
  42. $("label").attr("style","width: 150px;");
  43. };
  44. function yt_iframe() {
  45. $("iframe").load(function() {
  46. var ifr_src = $(this).contents().find("body iframe").attr("src");
  47. $("iframe").contents().find("body iframe").attr("src", ifr_src+"&wmode=transparent");
  48. });
  49. };
  50. function scrolldown(){
  51. $("html, body").animate({scrollTop:$(document).height()}, "slow");
  52. return false;
  53. };
  54. function scrolltop(){
  55. $("html, body").animate({scrollTop:0}, "slow");
  56. return false;
  57. };
  58. $(window).scroll(function () {
  59. var footer_top = $(document).height() - 30;
  60. $("div#footerbox").css("top", footer_top);
  61. var scrollInfo = $(window).scrollTop();
  62. if (scrollInfo <= "900"){
  63. $("a#top").attr("id","down");
  64. $("a#down").attr("onclick","scrolldown()");
  65. $("img#scroll_top_bottom").attr("src","view/theme/diabook/icons/scroll_bottom.png");
  66. $("img#scroll_top_bottom").attr("title","Scroll to bottom");
  67. }
  68. if (scrollInfo > "900"){
  69. $("a#down").attr("id","top");
  70. $("a#top").attr("onclick","scrolltop()");
  71. $("img#scroll_top_bottom").attr("src","view/theme/diabook/icons/scroll_top.png");
  72. $("img#scroll_top_bottom").attr("title","Back to top");
  73. }
  74. });
  75. function insertFormatting(comment,BBcode,id) {
  76. var tmpStr = $("#comment-edit-text-" + id).val();
  77. if(tmpStr == comment) {
  78. tmpStr = "";
  79. $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
  80. $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
  81. openMenu("comment-edit-submit-wrapper-" + id);
  82. }
  83. textarea = document.getElementById("comment-edit-text-" +id);
  84. if (document.selection) {
  85. textarea.focus();
  86. selected = document.selection.createRange();
  87. if (BBcode == "url"){
  88. selected.text = "["+BBcode+"]" + "http://" + selected.text + "[/"+BBcode+"]";
  89. } else
  90. selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
  91. } else if (textarea.selectionStart || textarea.selectionStart == "0") {
  92. var start = textarea.selectionStart;
  93. var end = textarea.selectionEnd;
  94. if (BBcode == "url"){
  95. textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
  96. } else
  97. textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
  98. }
  99. return true;
  100. }
  101. function cmtBbOpen(id) {
  102. $(".comment-edit-bb-" + id).show();
  103. }
  104. function cmtBbClose(id) {
  105. $(".comment-edit-bb-" + id).hide();
  106. }
  107. /*$(document).ready(function(){
  108. var doctitle = document.title;
  109. function checkNotify() {
  110. if(document.getElementById("notify-update").innerHTML != "")
  111. document.title = "("+document.getElementById("notify-update").innerHTML+") " + doctitle;
  112. else
  113. document.title = doctitle;
  114. };
  115. setInterval(function () {checkNotify();}, 10 * 1000);
  116. })*/
  117. </script>
  118. <script>
  119. var pagetitle = null;
  120. $("nav").bind('nav-update', function(e,data){
  121. if (pagetitle==null) pagetitle = document.title;
  122. var count = $(data).find('notif').attr('count');
  123. if (count>0) {
  124. document.title = "("+count+") "+pagetitle;
  125. } else {
  126. document.title = pagetitle;
  127. }
  128. });
  129. </script>