]> git.mxchange.org Git - friendica.git/commitdiff
display live update; don't collapse comments on live update
authorZach Prezkuta <fermion@gmx.com>
Fri, 2 Nov 2012 00:31:50 +0000 (18:31 -0600)
committerZach Prezkuta <fermion@gmx.com>
Fri, 2 Nov 2012 00:31:50 +0000 (18:31 -0600)
16 files changed:
include/conversation.php
js/main.js
js/main.min.js
mod/display.php
mod/update_network.php
object/Item.php
view/head.tpl
view/theme/dispy/head.tpl
view/theme/frost-mobile/js/main.js
view/theme/frost-mobile/js/main.min.js
view/theme/frost-mobile/js/theme.js
view/theme/frost-mobile/js/theme.min.js
view/theme/frost/js/main.js
view/theme/frost/js/main.min.js
view/theme/frost/js/theme.js
view/theme/frost/js/theme.min.js

index 56d34f3d85ee87739b904739bed8acba58d48897..43d20a40144c7e1560886bf2f25c6c706bea454f 100644 (file)
@@ -436,7 +436,11 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
        else if($mode === 'display') {
                $profile_owner = $a->profile['uid'];
                $page_writeable = can_write_wall($a,$profile_owner);
-               $live_update_div = '<div id="live-display"></div>' . "\r\n";
+               if(!$update) {
+                       $live_update_div = '<div id="live-display"></div>' . "\r\n"
+                               . "<script> var profile_uid = " . $_SESSION['uid'] . ";"
+                               . " var profile_page = 1; </script>";
+               }
        }
        else if($mode === 'community') {
                $profile_owner = 0;
index bd6dfc852033948f366e951dcb11f208114ba1a9..4a75be747ad4da5011a3ef1f2e8c89b3da668312 100644 (file)
                                        if($('#live-profile').length)   { src = 'profile'; liveUpdate(); }
                                        if($('#live-community').length) { src = 'community'; liveUpdate(); }
                                        if($('#live-notes').length)     { src = 'notes'; liveUpdate(); }
-                                       if($('#live-display').length) {
+                                       if($('#live-display').length)     { src = 'display'; liveUpdate(); }
+/*                                     if($('#live-display').length) {
                                                if(liking) {
                                                        liking = 0;
                                                        window.location.href=window.location.href 
                                                }
-                                       }
+                                       }*/
                                        if($('#live-photos').length) { 
                                                if(liking) {
                                                        liking = 0;
                                        $('#' + prev).after($(this));
                                }
                                else {
+                                       // Find out if the hidden comments are open, so we can keep it that way
+                                       // if a new comment has been posted
+                                       var id = $('.hide-comments-total', this).attr('id');
+                                       if(typeof id != 'undefined') {
+                                               id = id.split('-')[3];
+                                               var commentsOpen = $("#collapsed-comments-" + id).is(":visible");
+                                       }
+
                                        $('img',this).each(function() {
                                                $(this).attr('src',$(this).attr('dst'));
                                        });
+                                       //vScroll = $(document).scrollTop();
+                                       $('html').height($('html').height());
                                        $('#' + ident).replaceWith($(this));
+
+                                       if(typeof id != 'undefined') {
+                                               if(commentsOpen) showHideComments(id);
+                                       }
+                                       $('html').height('auto');
+                                       //$(document).scrollTop(vScroll);
                                }
                                prev = ident;
                        });
 
 
 
+       function showHideComments(id) {
+               if( $("#collapsed-comments-" + id).is(":visible")) {
+                       $("#collapsed-comments-" + id).hide();
+                       $("#hide-comments-" + id).html(window.showMore);
+               }
+               else {
+                       $("#collapsed-comments-" + id).show();
+                       $("#hide-comments-" + id).html(window.showFewer);
+               }
+       }
+
+
+
        function preview_post() {
                $("#jot-preview").val("1");
                $("#jot-preview-content").show();
index f94d4dc98eecac18523381530ab4febbf44f0c91..a581e4b85cad5b3bffa4a0592232d77fd7267358 100644 (file)
@@ -1 +1 @@
-function openClose(e){document.getElementById(e).style.display=="block"?document.getElementById(e).style.display="none":document.getElementById(e).style.display="block"}function openMenu(e){document.getElementById(e).style.display="block"}function closeMenu(e){document.getElementById(e).style.display="none"}function NavUpdate(){if(!stopped){var e="ping"+(localUser!=0?"?f=&uid="+localUser:"");$.get(e,function(e){$(e).find("result").each(function(){$("nav").trigger("nav-update",this),$("#live-network").length&&(src="network",liveUpdate()),$("#live-profile").length&&(src="profile",liveUpdate()),$("#live-community").length&&(src="community",liveUpdate()),$("#live-notes").length&&(src="notes",liveUpdate()),$("#live-display").length&&liking&&(liking=0,window.location.href=window.location.href),$("#live-photos").length&&liking&&(liking=0,window.location.href=window.location.href)})})}timer=setTimeout(NavUpdate,updateInterval)}function liveUpdate(){if(src==null||stopped||!profile_uid){$(".like-rotator").hide();return}if($(".comment-edit-text-full").length||in_progress){livetime&&clearTimeout(livetime),livetime=setTimeout(liveUpdate,1e4);return}livetime!=null&&(livetime=null),prev="live-"+src,in_progress=!0;var e=netargs.length?"/"+netargs:"",t="update_"+src+e+"&p="+profile_uid+"&page="+profile_page+"&msie="+(msie?1:0);$.get(t,function(e){in_progress=!1,$(".toplevel_item",e).each(function(){var e=$(this).attr("id");$("#"+e).length==0&&profile_page==1?($("img",this).each(function(){$(this).attr("src",$(this).attr("dst"))}),$("#"+prev).after($(this))):($("img",this).each(function(){$(this).attr("src",$(this).attr("dst"))}),$("#"+e).replaceWith($(this))),prev=e}),$(".like-rotator").hide(),commentBusy&&(commentBusy=!1,$("body").css("cursor","auto")),$(".comment-edit-form  textarea").contact_autocomplete(baseurl+"/acl")})}function imgbright(e){$(e).removeClass("drophide").addClass("drop")}function imgdull(e){$(e).removeClass("drop").addClass("drophide")}function dolike(e,t){unpause(),$("#like-rotator-"+e.toString()).show(),$.get("like/"+e.toString()+"?verb="+t,NavUpdate),liking=1}function dostar(e){e=e.toString(),$("#like-rotator-"+e).show(),$.get("starred/"+e,function(t){t.match(/1/)?($("#starred-"+e).addClass("starred"),$("#starred-"+e).removeClass("unstarred"),$("#star-"+e).addClass("hidden"),$("#unstar-"+e).removeClass("hidden")):($("#starred-"+e).addClass("unstarred"),$("#starred-"+e).removeClass("starred"),$("#star-"+e).removeClass("hidden"),$("#unstar-"+e).addClass("hidden")),$("#like-rotator-"+e).hide()})}function getPosition(e){var t={x:0,y:0};if(e.pageX||e.pageY)t.x=e.pageX,t.y=e.pageY;else if(e.clientX||e.clientY)t.x=e.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)-document.documentElement.clientLeft,t.y=e.clientY+(document.documentElement.scrollTop||document.body.scrollTop)-document.documentElement.clientTop;else if(e.x||e.y)t.x=e.x,t.y=e.y;return t}function lockview(e,t){e=e||window.event,cursor=getPosition(e),lockvisible?lockviewhide():(lockvisible=!0,$.get("lockview/"+t,function(e){$("#panel").html(e),$("#panel").css({left:cursor.x+5,top:cursor.y+5}),$("#panel").show()}))}function lockviewhide(){lockvisible=!1,$("#panel").hide()}function post_comment(e){return unpause(),commentBusy=!0,$("body").css("cursor","wait"),$("#comment-preview-inp-"+e).val("0"),$.post("item",$("#comment-edit-form-"+e).serialize(),function(t){if(t.success){$("#comment-edit-wrapper-"+e).hide(),$("#comment-edit-text-"+e).val("");var n=document.getElementById("comment-edit-text-"+e);n&&commentClose(n,e),timer&&clearTimeout(timer),timer=setTimeout(NavUpdate,10)}t.reload&&(window.location.href=t.reload)},"json"),!1}function preview_comment(e){return $("#comment-preview-inp-"+e).val("1"),$("#comment-edit-preview-"+e).show(),$.post("item",$("#comment-edit-form-"+e).serialize(),function(t){t.preview&&($("#comment-edit-preview-"+e).html(t.preview),$("#comment-edit-preview-"+e+" a").click(function(){return!1}))},"json"),!0}function preview_post(){return $("#jot-preview").val("1"),$("#jot-preview-content").show(),tinyMCE.triggerSave(),$.post("item",$("#profile-jot-form").serialize(),function(e){e.preview&&($("#jot-preview-content").html(e.preview),$("#jot-preview-content a").click(function(){return!1}))},"json"),$("#jot-preview").val("0"),!0}function unpause(){totStopped=!1,stopped=!1,$("#pause").html("")}function bin2hex(e){var t,n,r=0,i=[];e+="",r=e.length;for(n=0;n<r;n++)i[n]=e.charCodeAt(n).toString(16).replace(/^([\da-f])$/,"0$1");return i.join("")}function groupChangeMember(e,t,n){$("body .fakelink").css("cursor","wait"),$.get("group/"+e+"/"+t+"?t="+n,function(e){$("#group-update-wrapper").html(e),$("body .fakelink").css("cursor","auto")})}function profChangeMember(e,t){$("body .fakelink").css("cursor","wait"),$.get("profperm/"+e+"/"+t,function(e){$("#prof-update-wrapper").html(e),$("body .fakelink").css("cursor","auto")})}function contactgroupChangeMember(e,t){$("body").css("cursor","wait"),$.get("contactgroup/"+e+"/"+t,function(e){$("body").css("cursor","auto")})}function checkboxhighlight(e){$(e).is(":checked")?$(e).addClass("checkeditem"):$(e).removeClass("checkeditem")}function notifyMarkAll(){$.get("notify/mark/all",function(e){timer&&clearTimeout(timer),timer=setTimeout(NavUpdate,1e3)})}function fcFileBrowser(e,t,n,r){var i=baseurl+"/fbrowser/"+n+"/";return tinyMCE.activeEditor.windowManager.open({file:i,title:"File Browser",width:420,height:400,resizable:"yes",inline:"yes",close_previous:"no"},{window:r,input:e}),!1}function setupFieldRichtext(){tinyMCE.init({theme:"advanced",mode:"specific_textareas",editor_selector:"fieldRichtext",plugins:"bbcode,paste, inlinepopups",theme_advanced_buttons1:"bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code",theme_advanced_buttons2:"",theme_advanced_buttons3:"",theme_advanced_toolbar_location:"top",theme_advanced_toolbar_align:"center",theme_advanced_blockformats:"blockquote,code",paste_text_sticky:!0,entity_encoding:"raw",add_unload_trigger:!1,remove_linebreaks:!1,force_p_newlines:!1,force_br_newlines:!0,forced_root_block:"",convert_urls:!1,content_css:baseurl+"/view/custom_tinymce.css",theme_advanced_path:!1,file_browser_callback:"fcFileBrowser"})}function previewTheme(e){theme=$(e).val(),$.getJSON("pretheme?f=&theme="+theme,function(e){$("#theme-preview").html('<div id="theme-desc">'+e.desc+'</div><div id="theme-version">'+e.version+'</div><div id="theme-credits">'+e.credits+'</div><a href="'+e.img+'"><img src="'+e.img+'" width="320" height="240" alt="'+theme+'" /></a>')})}var src=null,prev=null,livetime=null,msie=!1,stopped=!1,totStopped=!1,timer=null,pr=0,liking=0,in_progress=!1,langSelect=!1,commentBusy=!1,last_popup_menu=null,last_popup_button=null;$(function(){function e(){last_popup_menu&&(last_popup_menu.hide(),last_popup_button.removeClass("selected"),last_popup_menu=null,last_popup_button=null)}$.ajaxSetup({cache:!1}),msie=$.browser.msie,$(".onoff input").each(function(){val=$(this).val(),id=$(this).attr("id"),$("#"+id+"_onoff ."+(val==0?"on":"off")).addClass("hidden")}),$(".onoff > a").click(function(e){e.preventDefault();var t=$(this).siblings("input"),n=1-t.val(),r=t.attr("id");$("#"+r+"_onoff ."+(n==0?"on":"off")).addClass("hidden"),$("#"+r+"_onoff ."+(n==1?"on":"off")).removeClass("hidden"),t.val(n)}),setupFieldRichtext(),$("a[rel^=#]").click(function(t){return e(),menu=$($(this).attr("rel")),t.preventDefault(),t.stopPropagation(),menu.attr("popup")=="false"?!1:($(this).parent().toggleClass("selected"),menu.toggle(),menu.css("display")=="none"?(last_popup_menu=null,last_popup_button=null):(last_popup_menu=menu,last_popup_button=$(this).parent()),!1)}),$("html").click(function(){e()}),$("a.popupbox").fancybox({transitionIn:"elastic",transitionOut:"elastic"});var t=unescape($("#nav-notifications-template[rel=template]").html()),n=unescape($("<div>").append($("#nav-notifications-see-all").clone()).html()),r=unescape($("<div>").append($("#nav-notifications-mark-all").clone()).html()),i=unescape($("#nav-notifications-menu").html());$("nav").bind("nav-update",function(e,s){var o=$(s).find("invalid").text();o==1&&(window.location.href=window.location.href);var u=$(s).find("net").text();u==0?(u="",$("#net-update").removeClass("show")):$("#net-update").addClass("show"),$("#net-update").html(u);var a=$(s).find("home").text();a==0?(a="",$("#home-update").removeClass("show")):$("#home-update").addClass("show"),$("#home-update").html(a);var f=$(s).find("intro").text();f==0?(f="",$("#intro-update").removeClass("show")):$("#intro-update").addClass("show"),$("#intro-update").html(f);var l=$(s).find("mail").text();l==0?(l="",$("#mail-update").removeClass("show")):$("#mail-update").addClass("show"),$("#mail-update").html(l);var f=$(s).find("intro").text();f==0?(f="",$("#intro-update-li").removeClass("show")):$("#intro-update-li").addClass("show"),$("#intro-update-li").html(f);var l=$(s).find("mail").text();l==0?(l="",$("#mail-update-li").removeClass("show")):$("#mail-update-li").addClass("show"),$("#mail-update-li").html(l);var c=$(s).find("notif");c.children("note").length==0?$("#nav-notifications-menu").html(i):(nnm=$("#nav-notifications-menu"),nnm.html(n+r),c.children("note").each(function(){e=$(this),text=e.text().format("<span class='contactname'>"+e.attr("name")+"</span>"),html=t.format(e.attr("href"),e.attr("photo"),text,e.attr("date"),e.attr("seen")),nnm.append(html)})),notif=c.attr("count"),notif>0?$("#nav-notifications-linkmenu").addClass("on"):$("#nav-notifications-linkmenu").removeClass("on"),notif==0?(notif="",$("#notify-update").removeClass("show")):$("#notify-update").addClass("show"),$("#notify-update").html(notif);var h=$(s).find("sysmsgs");h.children("notice").each(function(){text=$(this).text(),$.jGrowl(text,{sticky:!0,theme:"notice"})}),h.children("info").each(function(){text=$(this).text(),$.jGrowl(text,{sticky:!1,theme:"info",life:1e4})})}),NavUpdate(),$(document).keydown(function(e){if(e.keyCode=="8"){var t=e.target||e.srcElement;if(!/input|textarea/i.test(t.nodeName))return!1}e.keyCode=="19"||e.ctrlKey&&e.which=="32"?(e.preventDefault(),stopped==0?(stopped=!0,e.ctrlKey&&(totStopped=!0),$("#pause").html('<img src="images/pause.gif" alt="pause" style="border: 1px solid black;" />')):unpause()):totStopped||unpause()})});var lockvisible=!1;String.prototype.format=function(){var e=this;for(var t=0;t<arguments.length;t++){var n=new RegExp("\\{"+t+"\\}","gi");e=e.replace(n,arguments[t])}return e},Array.prototype.remove=function(e){to=undefined,from=this.indexOf(e);var t=this.slice((to||from)+1||this.length);return this.length=from<0?this.length+from:from,this.push.apply(this,t)};
\ No newline at end of file
+function openClose(e){document.getElementById(e).style.display=="block"?document.getElementById(e).style.display="none":document.getElementById(e).style.display="block"}function openMenu(e){document.getElementById(e).style.display="block"}function closeMenu(e){document.getElementById(e).style.display="none"}function NavUpdate(){if(!stopped){var e="ping"+(localUser!=0?"?f=&uid="+localUser:"");$.get(e,function(e){$(e).find("result").each(function(){$("nav").trigger("nav-update",this),$("#live-network").length&&(src="network",liveUpdate()),$("#live-profile").length&&(src="profile",liveUpdate()),$("#live-community").length&&(src="community",liveUpdate()),$("#live-notes").length&&(src="notes",liveUpdate()),$("#live-display").length&&(src="display",liveUpdate()),$("#live-photos").length&&liking&&(liking=0,window.location.href=window.location.href)})})}timer=setTimeout(NavUpdate,updateInterval)}function liveUpdate(){if(src==null||stopped||!profile_uid){$(".like-rotator").hide();return}if($(".comment-edit-text-full").length||in_progress){livetime&&clearTimeout(livetime),livetime=setTimeout(liveUpdate,1e4);return}livetime!=null&&(livetime=null),prev="live-"+src,in_progress=!0;var e=netargs.length?"/"+netargs:"",t="update_"+src+e+"&p="+profile_uid+"&page="+profile_page+"&msie="+(msie?1:0);$.get(t,function(e){in_progress=!1,$(".toplevel_item",e).each(function(){var e=$(this).attr("id");if($("#"+e).length==0&&profile_page==1)$("img",this).each(function(){$(this).attr("src",$(this).attr("dst"))}),$("#"+prev).after($(this));else{var t=$(".hide-comments-total",this).attr("id");if(typeof t!="undefined"){t=t.split("-")[3];var n=$("#collapsed-comments-"+t).is(":visible")}$("img",this).each(function(){$(this).attr("src",$(this).attr("dst"))}),$("html").height($("html").height()),$("#"+e).replaceWith($(this)),typeof t!="undefined"&&n&&showHideComments(t),$("html").height("auto")}prev=e}),$(".like-rotator").hide(),commentBusy&&(commentBusy=!1,$("body").css("cursor","auto")),$(".comment-edit-form  textarea").contact_autocomplete(baseurl+"/acl")})}function imgbright(e){$(e).removeClass("drophide").addClass("drop")}function imgdull(e){$(e).removeClass("drop").addClass("drophide")}function dolike(e,t){unpause(),$("#like-rotator-"+e.toString()).show(),$.get("like/"+e.toString()+"?verb="+t,NavUpdate),liking=1}function dosubthread(e){unpause(),$("#like-rotator-"+e.toString()).show(),$.get("subthread/"+e.toString(),NavUpdate),liking=1}function dostar(e){e=e.toString(),$("#like-rotator-"+e).show(),$.get("starred/"+e,function(t){t.match(/1/)?($("#starred-"+e).addClass("starred"),$("#starred-"+e).removeClass("unstarred"),$("#star-"+e).addClass("hidden"),$("#unstar-"+e).removeClass("hidden")):($("#starred-"+e).addClass("unstarred"),$("#starred-"+e).removeClass("starred"),$("#star-"+e).removeClass("hidden"),$("#unstar-"+e).addClass("hidden")),$("#like-rotator-"+e).hide()})}function getPosition(e){var t={x:0,y:0};if(e.pageX||e.pageY)t.x=e.pageX,t.y=e.pageY;else if(e.clientX||e.clientY)t.x=e.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)-document.documentElement.clientLeft,t.y=e.clientY+(document.documentElement.scrollTop||document.body.scrollTop)-document.documentElement.clientTop;else if(e.x||e.y)t.x=e.x,t.y=e.y;return t}function lockview(e,t){e=e||window.event,cursor=getPosition(e),lockvisible?lockviewhide():(lockvisible=!0,$.get("lockview/"+t,function(e){$("#panel").html(e),$("#panel").css({left:cursor.x+5,top:cursor.y+5}),$("#panel").show()}))}function lockviewhide(){lockvisible=!1,$("#panel").hide()}function post_comment(e){return unpause(),commentBusy=!0,$("body").css("cursor","wait"),$("#comment-preview-inp-"+e).val("0"),$.post("item",$("#comment-edit-form-"+e).serialize(),function(t){if(t.success){$("#comment-edit-wrapper-"+e).hide(),$("#comment-edit-text-"+e).val("");var n=document.getElementById("comment-edit-text-"+e);n&&commentClose(n,e),timer&&clearTimeout(timer),timer=setTimeout(NavUpdate,10)}t.reload&&(window.location.href=t.reload)},"json"),!1}function preview_comment(e){return $("#comment-preview-inp-"+e).val("1"),$("#comment-edit-preview-"+e).show(),$.post("item",$("#comment-edit-form-"+e).serialize(),function(t){t.preview&&($("#comment-edit-preview-"+e).html(t.preview),$("#comment-edit-preview-"+e+" a").click(function(){return!1}))},"json"),!0}function showHideComments(e){$("#collapsed-comments-"+e).is(":visible")?($("#collapsed-comments-"+e).hide(),$("#hide-comments-"+e).html(window.showMore)):($("#collapsed-comments-"+e).show(),$("#hide-comments-"+e).html(window.showFewer))}function preview_post(){return $("#jot-preview").val("1"),$("#jot-preview-content").show(),tinyMCE.triggerSave(),$.post("item",$("#profile-jot-form").serialize(),function(e){e.preview&&($("#jot-preview-content").html(e.preview),$("#jot-preview-content a").click(function(){return!1}))},"json"),$("#jot-preview").val("0"),!0}function unpause(){totStopped=!1,stopped=!1,$("#pause").html("")}function bin2hex(e){var t,n,r=0,i=[];e+="",r=e.length;for(n=0;n<r;n++)i[n]=e.charCodeAt(n).toString(16).replace(/^([\da-f])$/,"0$1");return i.join("")}function groupChangeMember(e,t,n){$("body .fakelink").css("cursor","wait"),$.get("group/"+e+"/"+t+"?t="+n,function(e){$("#group-update-wrapper").html(e),$("body .fakelink").css("cursor","auto")})}function profChangeMember(e,t){$("body .fakelink").css("cursor","wait"),$.get("profperm/"+e+"/"+t,function(e){$("#prof-update-wrapper").html(e),$("body .fakelink").css("cursor","auto")})}function contactgroupChangeMember(e,t){$("body").css("cursor","wait"),$.get("contactgroup/"+e+"/"+t,function(e){$("body").css("cursor","auto")})}function checkboxhighlight(e){$(e).is(":checked")?$(e).addClass("checkeditem"):$(e).removeClass("checkeditem")}function notifyMarkAll(){$.get("notify/mark/all",function(e){timer&&clearTimeout(timer),timer=setTimeout(NavUpdate,1e3)})}function fcFileBrowser(e,t,n,r){var i=baseurl+"/fbrowser/"+n+"/";return tinyMCE.activeEditor.windowManager.open({file:i,title:"File Browser",width:420,height:400,resizable:"yes",inline:"yes",close_previous:"no"},{window:r,input:e}),!1}function setupFieldRichtext(){tinyMCE.init({theme:"advanced",mode:"specific_textareas",editor_selector:"fieldRichtext",plugins:"bbcode,paste, inlinepopups",theme_advanced_buttons1:"bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code",theme_advanced_buttons2:"",theme_advanced_buttons3:"",theme_advanced_toolbar_location:"top",theme_advanced_toolbar_align:"center",theme_advanced_blockformats:"blockquote,code",paste_text_sticky:!0,entity_encoding:"raw",add_unload_trigger:!1,remove_linebreaks:!1,force_p_newlines:!1,force_br_newlines:!0,forced_root_block:"",convert_urls:!1,content_css:baseurl+"/view/custom_tinymce.css",theme_advanced_path:!1,file_browser_callback:"fcFileBrowser"})}function previewTheme(e){theme=$(e).val(),$.getJSON("pretheme?f=&theme="+theme,function(e){$("#theme-preview").html('<div id="theme-desc">'+e.desc+'</div><div id="theme-version">'+e.version+'</div><div id="theme-credits">'+e.credits+'</div><a href="'+e.img+'"><img src="'+e.img+'" width="320" height="240" alt="'+theme+'" /></a>')})}var src=null,prev=null,livetime=null,msie=!1,stopped=!1,totStopped=!1,timer=null,pr=0,liking=0,in_progress=!1,langSelect=!1,commentBusy=!1,last_popup_menu=null,last_popup_button=null;$(function(){function e(){last_popup_menu&&(last_popup_menu.hide(),last_popup_button.removeClass("selected"),last_popup_menu=null,last_popup_button=null)}$.ajaxSetup({cache:!1}),msie=$.browser.msie,$(".onoff input").each(function(){val=$(this).val(),id=$(this).attr("id"),$("#"+id+"_onoff ."+(val==0?"on":"off")).addClass("hidden")}),$(".onoff > a").click(function(e){e.preventDefault();var t=$(this).siblings("input"),n=1-t.val(),r=t.attr("id");$("#"+r+"_onoff ."+(n==0?"on":"off")).addClass("hidden"),$("#"+r+"_onoff ."+(n==1?"on":"off")).removeClass("hidden"),t.val(n)}),setupFieldRichtext(),$("a[rel^=#]").click(function(t){return e(),menu=$($(this).attr("rel")),t.preventDefault(),t.stopPropagation(),menu.attr("popup")=="false"?!1:($(this).parent().toggleClass("selected"),menu.toggle(),menu.css("display")=="none"?(last_popup_menu=null,last_popup_button=null):(last_popup_menu=menu,last_popup_button=$(this).parent()),!1)}),$("html").click(function(){e()}),$("a.popupbox").fancybox({transitionIn:"elastic",transitionOut:"elastic"});var t=unescape($("#nav-notifications-template[rel=template]").html()),n=unescape($("<div>").append($("#nav-notifications-see-all").clone()).html()),r=unescape($("<div>").append($("#nav-notifications-mark-all").clone()).html()),i=unescape($("#nav-notifications-menu").html());$("nav").bind("nav-update",function(e,s){var o=$(s).find("invalid").text();o==1&&(window.location.href=window.location.href);var u=$(s).find("net").text();u==0?(u="",$("#net-update").removeClass("show")):$("#net-update").addClass("show"),$("#net-update").html(u);var a=$(s).find("home").text();a==0?(a="",$("#home-update").removeClass("show")):$("#home-update").addClass("show"),$("#home-update").html(a);var f=$(s).find("intro").text();f==0?(f="",$("#intro-update").removeClass("show")):$("#intro-update").addClass("show"),$("#intro-update").html(f);var l=$(s).find("mail").text();l==0?(l="",$("#mail-update").removeClass("show")):$("#mail-update").addClass("show"),$("#mail-update").html(l);var f=$(s).find("intro").text();f==0?(f="",$("#intro-update-li").removeClass("show")):$("#intro-update-li").addClass("show"),$("#intro-update-li").html(f);var l=$(s).find("mail").text();l==0?(l="",$("#mail-update-li").removeClass("show")):$("#mail-update-li").addClass("show"),$("#mail-update-li").html(l);var c=$(s).find("all-events").text();c==0?(c="",$("#allevents-update").removeClass("show")):$("#allevents-update").addClass("show"),$("#allevents-update").html(c);var h=$(s).find("all-events-today").text();h==0?$("#allevents-update").removeClass("notif-allevents-today"):$("#allevents-update").addClass("notif-allevents-today");var p=$(s).find("events").text();p==0?(p="",$("#events-update").removeClass("show")):$("#events-update").addClass("show"),$("#events-update").html(p);var d=$(s).find("events-today").text();d==0?$("#events-update").removeClass("notif-events-today"):$("#events-update").addClass("notif-events-today");var v=$(s).find("birthdays").text();v==0?(v="",$("#birthdays-update").removeClass("show")):$("#birthdays-update").addClass("show"),$("#birthdays-update").html(v);var m=$(s).find("birthdays-today").text();m==0?$("#birthdays-update").removeClass("notif-birthdays-today"):$("#birthdays-update").addClass("notif-birthdays-today");var g=$(s).find("notif");g.children("note").length==0?$("#nav-notifications-menu").html(i):(nnm=$("#nav-notifications-menu"),nnm.html(n+r),g.children("note").each(function(){e=$(this),text=e.text().format("<span class='contactname'>"+e.attr("name")+"</span>"),html=t.format(e.attr("href"),e.attr("photo"),text,e.attr("date"),e.attr("seen")),nnm.append(html)})),notif=g.attr("count"),notif>0?$("#nav-notifications-linkmenu").addClass("on"):$("#nav-notifications-linkmenu").removeClass("on"),notif==0?(notif="",$("#notify-update").removeClass("show")):$("#notify-update").addClass("show"),$("#notify-update").html(notif);var y=$(s).find("sysmsgs");y.children("notice").each(function(){text=$(this).text(),$.jGrowl(text,{sticky:!0,theme:"notice"})}),y.children("info").each(function(){text=$(this).text(),$.jGrowl(text,{sticky:!1,theme:"info",life:1e4})})}),NavUpdate(),$(document).keydown(function(e){if(e.keyCode=="8"){var t=e.target||e.srcElement;if(!/input|textarea/i.test(t.nodeName))return!1}e.keyCode=="19"||e.ctrlKey&&e.which=="32"?(e.preventDefault(),stopped==0?(stopped=!0,e.ctrlKey&&(totStopped=!0),$("#pause").html('<img src="images/pause.gif" alt="pause" style="border: 1px solid black;" />')):unpause()):totStopped||unpause()})});var lockvisible=!1;String.prototype.format=function(){var e=this;for(var t=0;t<arguments.length;t++){var n=new RegExp("\\{"+t+"\\}","gi");e=e.replace(n,arguments[t])}return e},Array.prototype.remove=function(e){to=undefined,from=this.indexOf(e);var t=this.slice((to||from)+1||this.length);return this.length=from<0?this.length+from:from,this.push.apply(this,t)};
\ No newline at end of file
index be4a0ab9f9d47552deee2ed24e4da59902d4b4c0..6305dd44e7f02d3f38b510dab91b88cf701e7610 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 
-function display_content(&$a) {
+function display_content(&$a, $update = 0) {
 
        if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
                notice( t('Public access denied.') . EOL);
@@ -19,10 +19,20 @@ function display_content(&$a) {
        $a->page['htmlhead'] .= get_markup_template('display-head.tpl');
 
 
-       $nick = (($a->argc > 1) ? $a->argv[1] : '');
+       if($update) {
+               $nick = $_REQUEST['nick'];
+       }
+       else {
+               $nick = (($a->argc > 1) ? $a->argv[1] : '');
+       }
        profile_load($a,$nick);
 
-       $item_id = (($a->argc > 2) ? intval($a->argv[2]) : 0);
+       if($update) {
+               $item_id = $_REQUEST['item_id'];
+       }
+       else {
+               $item_id = (($a->argc > 2) ? intval($a->argv[2]) : 0);
+       }
 
        if(! $item_id) {
                $a->error = 404;
@@ -97,6 +107,18 @@ function display_content(&$a) {
 
        $sql_extra = item_permissions_sql($a->profile['uid'],$remote_contact,$groups);
 
+       if($update) {
+               $r = q("SELECT id FROM item WHERE item.uid = %d
+                       AND `item`.`parent` = ( SELECT `parent` FROM `item` WHERE ( `id` = '%s' OR `uri` = '%s' ))
+                       $sql_extra AND unseen = 1",
+                       intval($a->profile['uid']),
+                       dbesc($item_id),
+                       dbesc($item_id) 
+               );
+               if(!$r)
+                       return '';
+       }
+
        $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, 
                `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
                `contact`.`network`, `contact`.`thumb`, `contact`.`self`, `contact`.`writable`, 
@@ -124,8 +146,10 @@ function display_content(&$a) {
                }
 
                $items = conv_sort($r,"`commented`");
-               
-               $o .= conversation($a,$items,'display', false);
+
+               if(!$update)
+                       $o .= "<script> var netargs = '?f=&nick=" . $nick . "&item_id=" . $item_id . "'; </script>";
+               $o .= conversation($a,$items,'display', $update);
 
        }
        else {
index 36de0722a9dcace04bb1e527a3ab977792da348b..0dfe0a73ff568297ec7b8e42b20c2917148d30c0 100644 (file)
@@ -14,25 +14,25 @@ function update_network_content(&$a) {
        echo (($_GET['msie'] == 1) ? '<div>' : '<section>');
 
 
-        $text = network_content($a,$profile_uid);
-        $pattern = "/<img([^>]*) src=\"([^\"]*)\"/";
-        $replace = "<img\${1} dst=\"\${2}\"";
-        $text = preg_replace($pattern, $replace, $text);
-
-               $replace = '<br />' . t('[Embedded content - reload page to view]') . '<br />';
-        $pattern = "/<\s*audio[^>]*>(.*?)<\s*\/\s*audio>/i";
-        $text = preg_replace($pattern, $replace, $text);
-        $pattern = "/<\s*video[^>]*>(.*?)<\s*\/\s*video>/i";
-        $text = preg_replace($pattern, $replace, $text);
-        $pattern = "/<\s*embed[^>]*>(.*?)<\s*\/\s*embed>/i";
-        $text = preg_replace($pattern, $replace, $text);
-        $pattern = "/<\s*iframe[^>]*>(.*?)<\s*\/\s*iframe>/i";
-        $text = preg_replace($pattern, $replace, $text);
-
-
-        echo str_replace("\t",'       ',$text);
+       $text = network_content($a,$profile_uid);
+       $pattern = "/<img([^>]*) src=\"([^\"]*)\"/";
+       $replace = "<img\${1} dst=\"\${2}\"";
+       $text = preg_replace($pattern, $replace, $text);
+
+       $replace = '<br />' . t('[Embedded content - reload page to view]') . '<br />';
+       $pattern = "/<\s*audio[^>]*>(.*?)<\s*\/\s*audio>/i";
+       $text = preg_replace($pattern, $replace, $text);
+       $pattern = "/<\s*video[^>]*>(.*?)<\s*\/\s*video>/i";
+       $text = preg_replace($pattern, $replace, $text);
+       $pattern = "/<\s*embed[^>]*>(.*?)<\s*\/\s*embed>/i";
+       $text = preg_replace($pattern, $replace, $text);
+       $pattern = "/<\s*iframe[^>]*>(.*?)<\s*\/\s*iframe>/i";
+       $text = preg_replace($pattern, $replace, $text);
+
+
+       echo str_replace("\t",'       ',$text);
        echo (($_GET['msie'] == 1) ? '</div>' : '</section>');
        echo "</body></html>\r\n";
        killme();
 
-}
\ No newline at end of file
+}
index b5837b6b661ee49bce4d84f544a11b37d36270e8..9ec63b4f20c3b16ac65d6d0c547be33588c2b8f0 100644 (file)
@@ -545,7 +545,8 @@ class Item extends BaseObject {
                        $comment_box = replace_macros($template,array(
                                '$return_path' => '',
                                '$threaded' => $this->is_threaded(),
-                               '$jsreload' => (($conv->get_mode() === 'display') ? $_SESSION['return_url'] : ''),
+//                             '$jsreload' => (($conv->get_mode() === 'display') ? $_SESSION['return_url'] : ''),
+                               '$jsreload' => '',
                                '$type' => (($conv->get_mode() === 'profile') ? 'wall-comment' : 'net-comment'),
                                '$id' => $this->get_id(),
                                '$parent' => $this->get_id(),
index 42bd92f4ce497d42d271c9cba19cf4f709be211b..f861060c77250eba5aaed7345cceccd712ea9184 100644 (file)
                $(obj).val('');
        }
 
-       function showHideComments(id) {
-               if( $('#collapsed-comments-' + id).is(':visible')) {
-                       $('#collapsed-comments-' + id).hide();
-                       $('#hide-comments-' + id).html('$showmore');
-               }
-               else {
-                       $('#collapsed-comments-' + id).show();
-                       $('#hide-comments-' + id).html('$showfewer');
-               }
-       }
+       window.showMore = "$showmore";
+       window.showFewer = "$showfewer";
 
        function showHideCommentBox(id) {
                if( $('#comment-edit-form-' + id).is(':visible')) {
index 3d1701b29eb42fa9a0e2b3c55cbb0cd5fa375d69..027c5d37236cae9a103315ac7ce2b669aff924c0 100644 (file)
                $(obj).val('');
        }
 
-       function showHideComments(id) {
-               if( $('#collapsed-comments-' + id).is(':visible')) {
-                       $('#collapsed-comments-' + id).hide();
-                       $('#hide-comments-' + id).html('$showmore');
-               }
-               else {
-                       $('#collapsed-comments-' + id).show();
-                       $('#hide-comments-' + id).html('$showfewer');
-               }
-       }
+       window.showMore = "$showmore";
+       window.showFewer = "$showfewer";
 
        function showHideCommentBox(id) {
                if( $('#comment-edit-form-' + id).is(':visible')) {
index 6daa19b4170ce295d8ad27f2d83808983032a5be..b751b8398f6521f51f74e5b8fa6d6be962e33808 100644 (file)
                                        if($j('#live-profile').length)   { src = 'profile'; liveUpdate(); }
                                        if($j('#live-community').length) { src = 'community'; liveUpdate(); }
                                        if($j('#live-notes').length)     { src = 'notes'; liveUpdate(); }
-                                       if($j('#live-display').length) {
+                                       if($j('#live-display').length) { src = 'display'; liveUpdate(); }
+                                       /*if($j('#live-display').length) {
                                                if(liking) {
                                                        liking = 0;
                                                        window.location.href=window.location.href 
                                                }
-                                       }
+                                       }*/
                                        if($j('#live-photos').length) {
                                                if(liking) {
                                                        liking = 0;
                                        $j('#' + prev).after($j(this));
                                }
                                else {
+                                       // Find out if the hidden comments are open, so we can keep it that way
+                                       // if a new comment has been posted
+                                       var id = $j('.hide-comments-total', this).attr('id');
+                                       if(typeof id != 'undefined') {
+                                               id = id.split('-')[3];
+                                               var commentsOpen = $j("#collapsed-comments-" + id).is(":visible");
+                                       }
+
                                        $j('img',this).each(function() {
                                                $j(this).attr('src',$j(this).attr('dst'));
                                        });
+                                       //vScroll = $j(document).scrollTop();
+                                       $j('html').height($j('html').height());
                                        $j('#' + ident).replaceWith($j(this));
+
+                                       if(typeof id != 'undefined') {
+                                               if(commentsOpen) showHideComments(id);
+                                       }
+                                       $j('html').height('auto');
+                                       //$j(document).scrollTop(vScroll);
                                }
                                prev = ident;
                        });
        }
 
 
+       function showHideComments(id) {
+               if( $j("#collapsed-comments-" + id).is(":visible")) {
+                       $j("#collapsed-comments-" + id).hide();
+                       $j("#hide-comments-" + id).html(window.showMore);
+               }
+               else {
+                       $j("#collapsed-comments-" + id).show();
+                       $j("#hide-comments-" + id).html(window.showFewer);
+               }
+       }
+
 
        function preview_post() {
                $j("#jot-preview").val("1");
index c0de3f6b9a7c0522897ea4f2135c787d5749de24..64d52ee006f225008241d27e779808e571ed6b6f 100644 (file)
@@ -1 +1 @@
-function openClose(e){document.getElementById(e).style.display=="block"?document.getElementById(e).style.display="none":document.getElementById(e).style.display="block"}function openMenu(e){document.getElementById(e).style.display="block"}function closeMenu(e){document.getElementById(e).style.display="none"}function NavUpdate(){if(!stopped){var e="ping"+(localUser!=0?"?f=&uid="+localUser:"");$j.get(e,function(e){$j(e).find("result").each(function(){$j("nav").trigger("nav-update",this),$j("#live-network").length&&(src="network",liveUpdate()),$j("#live-profile").length&&(src="profile",liveUpdate()),$j("#live-community").length&&(src="community",liveUpdate()),$j("#live-notes").length&&(src="notes",liveUpdate()),$j("#live-display").length&&liking&&(liking=0,window.location.href=window.location.href),$j("#live-photos").length&&liking&&(liking=0,window.location.href=window.location.href)})})}timer=setTimeout(NavUpdate,updateInterval)}function liveUpdate(){if(src==null||stopped||!profile_uid){$j(".like-rotator").hide();return}if($j(".comment-edit-text-full").length||in_progress){livetime&&clearTimeout(livetime),livetime=setTimeout(liveUpdate,1e4);return}livetime!=null&&(livetime=null),prev="live-"+src,in_progress=!0;var e=netargs.length?"/"+netargs:"",t="update_"+src+e+"&p="+profile_uid+"&page="+profile_page+"&msie="+(msie?1:0);$j.get(t,function(e){in_progress=!1,$j(".toplevel_item",e).each(function(){var e=$j(this).attr("id");$j("#"+e).length==0&&profile_page==1?($j("img",this).each(function(){$j(this).attr("src",$j(this).attr("dst"))}),$j("#"+prev).after($j(this))):($j("img",this).each(function(){$j(this).attr("src",$j(this).attr("dst"))}),$j("#"+e).replaceWith($j(this))),prev=e});var t=$j(".wall-item-body > img").not(function(){return this.complete}),n=t.length;n?t.load(function(){n--,n||collapseHeight()}):collapseHeight(),$j(".like-rotator").hide(),commentBusy&&(commentBusy=!1,$j("body").css("cursor","auto")),$j(".comment-edit-form  textarea").contact_autocomplete(baseurl+"/acl")})}function collapseHeight(){$j(".wall-item-body").each(function(){$j(this).height()>310&&($j(this).hasClass("divmore")||($j(this).divgrow({initialHeight:300,showBrackets:!1,speed:0}),$j(this).addClass("divmore")))})}function imgbright(e){$j(e).removeClass("drophide").addClass("drop")}function imgdull(e){$j(e).removeClass("drop").addClass("drophide")}function dolike(e,t){unpause(),$j("#like-rotator-"+e.toString()).show(),$j.get("like/"+e.toString()+"?verb="+t,NavUpdate),liking=1}function dostar(e){e=e.toString(),$j.get("starred/"+e,function(t){t.match(/1/)?($j("#starred-"+e).addClass("starred"),$j("#starred-"+e).removeClass("unstarred"),$j("#star-"+e).addClass("hidden"),$j("#unstar-"+e).removeClass("hidden")):($j("#starred-"+e).addClass("unstarred"),$j("#starred-"+e).removeClass("starred"),$j("#star-"+e).removeClass("hidden"),$j("#unstar-"+e).addClass("hidden"))})}function getPosition(e){var t={x:0,y:0};if(e.touches[0].pageX||e.touches[0].pageY)t.x=e.touches[0].pageX,t.y=e.touches[0].pageY;else if(e.touches[0].clientX||e.touches[0].clientY)t.x=e.touches[0].clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)-document.documentElement.clientLeft,t.y=e.touches[0].clientY+(document.documentElement.scrollTop||document.body.scrollTop)-document.documentElement.clientTop;else if(e.touches[0].x||e.touches[0].y)t.touches[0].x=e.touches[0].x,t.touches[0].y=e.touches[0].y;return t}function lockview(e,t){e=e||window.event,cursor=getPosition(e),lockvisible?lockviewhide():(lockvisible=!0,$j.get("lockview/"+t,function(e){$j("#panel").html(e),$j("#panel").css({left:cursor.x+5,top:cursor.y+5}),$j("#panel").show()}))}function lockviewhide(){lockvisible=!1,$j("#panel").hide()}function post_comment(e){return unpause(),commentBusy=!0,$j("body").css("cursor","wait"),$j("#comment-preview-inp-"+e).val("0"),$j.post("item",$j("#comment-edit-form-"+e).serialize(),function(t){if(t.success){$j("#comment-edit-wrapper-"+e).hide(),$j("#comment-edit-text-"+e).val("");var n=document.getElementById("comment-edit-text-"+e);n&&commentClose(n,e),timer&&clearTimeout(timer),timer=setTimeout(NavUpdate,10)}t.reload&&(window.location.href=t.reload)},"json"),!1}function preview_comment(e){return $j("#comment-preview-inp-"+e).val("1"),$j("#comment-edit-preview-"+e).show(),$j.post("item",$j("#comment-edit-form-"+e).serialize(),function(t){t.preview&&($j("#comment-edit-preview-"+e).html(t.preview),$j("#comment-edit-preview-"+e+" a").click(function(){return!1}))},"json"),!0}function preview_post(){return $j("#jot-preview").val("1"),$j("#jot-preview-content").show(),tinyMCE.triggerSave(),$j.post("item",$j("#profile-jot-form").serialize(),function(e){e.preview&&($j("#jot-preview-content").html(e.preview),$j("#jot-preview-content a").click(function(){return!1}))},"json"),$j("#jot-preview").val("0"),!0}function unpause(){totStopped=!1,stopped=!1,$j("#pause").html("")}function bin2hex(e){var t,n,r=0,i=[];e+="",r=e.length;for(n=0;n<r;n++)i[n]=e.charCodeAt(n).toString(16).replace(/^([\da-f])$/,"0$1");return i.join("")}function groupChangeMember(e,t,n){$j("body .fakelink").css("cursor","wait"),$j.get("group/"+e+"/"+t+"?t="+n,function(e){$j("#group-update-wrapper").html(e),$j("body .fakelink").css("cursor","auto")})}function profChangeMember(e,t){$j("body .fakelink").css("cursor","wait"),$j.get("profperm/"+e+"/"+t,function(e){$j("#prof-update-wrapper").html(e),$j("body .fakelink").css("cursor","auto")})}function contactgroupChangeMember(e,t){$j("body").css("cursor","wait"),$j.get("contactgroup/"+e+"/"+t,function(e){$j("body").css("cursor","auto")})}function checkboxhighlight(e){$j(e).is(":checked")?$j(e).addClass("checkeditem"):$j(e).removeClass("checkeditem")}function notifyMarkAll(){$j.get("notify/mark/all",function(e){timer&&clearTimeout(timer),timer=setTimeout(NavUpdate,1e3)})}function fcFileBrowser(e,t,n,r){var i=baseurl+"/fbrowser/"+n+"/";return tinyMCE.activeEditor.windowManager.open({file:i,title:"File Browser",width:420,height:400,resizable:"yes",inline:"yes",close_previous:"no"},{window:r,input:e}),!1}function setupFieldRichtext(){tinyMCE.init({theme:"advanced",mode:"specific_textareas",editor_selector:"fieldRichtext",plugins:"bbcode,paste, inlinepopups",theme_advanced_buttons1:"bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code",theme_advanced_buttons2:"",theme_advanced_buttons3:"",theme_advanced_toolbar_location:"top",theme_advanced_toolbar_align:"center",theme_advanced_blockformats:"blockquote,code",paste_text_sticky:!0,entity_encoding:"raw",add_unload_trigger:!1,remove_linebreaks:!1,force_p_newlines:!1,force_br_newlines:!0,forced_root_block:"",convert_urls:!1,content_css:baseurl+"/view/custom_tinymce.css",theme_advanced_path:!1,file_browser_callback:"fcFileBrowser"})}function previewTheme(e){theme=$j(e).val(),$j.getJSON("pretheme?f=&theme="+theme,function(e){$j("#theme-preview").html('<div id="theme-desc">'+e.desc+'</div><div id="theme-version">'+e.version+'</div><div id="theme-credits">'+e.credits+"</div>")})}var src=null,prev=null,livetime=null,msie=!1,stopped=!1,totStopped=!1,timer=null,pr=0,liking=0,in_progress=!1,langSelect=!1,commentBusy=!1,last_popup_menu=null,last_popup_button=null;$j(function(){function e(e){last_popup_menu&&"#"+last_popup_menu.attr("id")!==$j(e.target).attr("rel")&&(last_popup_menu.hide(),last_popup_menu.attr("id")=="nav-notifications-menu"&&$j(".main-container").show(),last_popup_button.removeClass("selected"),last_popup_menu=null,last_popup_button=null)}$j.ajaxSetup({cache:!1}),msie=$j.browser.msie,$j(".onoff input").each(function(){val=$j(this).val(),id=$j(this).attr("id"),$j("#"+id+"_onoff ."+(val==0?"on":"off")).addClass("hidden")}),$j(".onoff > a").click(function(e){e.preventDefault();var t=$j(this).siblings("input"),n=1-t.val(),r=t.attr("id");$j("#"+r+"_onoff ."+(n==0?"on":"off")).addClass("hidden"),$j("#"+r+"_onoff ."+(n==1?"on":"off")).removeClass("hidden"),t.val(n)}),$j("img[rel^=#]").click(function(t){return e(t),menu=$j($j(this).attr("rel")),t.preventDefault(),t.stopPropagation(),menu.attr("popup")=="false"?!1:(menu.css("display")=="none"?($j(this).parent().addClass("selected"),menu.show(),menu.attr("id")=="nav-notifications-menu"&&$j(".main-container").hide(),last_popup_menu=menu,last_popup_button=$j(this).parent()):($j(this).parent().removeClass("selected"),menu.hide(),menu.attr("id")=="nav-notifications-menu"&&$j(".main-container").show(),last_popup_menu=null,last_popup_button=null),!1)}),$j("html").click(function(t){e(t)});var t=unescape($j("#nav-notifications-template[rel=template]").html()),n=unescape($j("<div>").append($j("#nav-notifications-see-all").clone()).html()),r=unescape($j("<div>").append($j("#nav-notifications-mark-all").clone()).html()),i=unescape($j("#nav-notifications-menu").html());$j("nav").bind("nav-update",function(e,s){var o=$j(s).find("invalid").text();o==1&&(window.location.href=window.location.href);var u=$j(s).find("net").text();u==0?(u="",$j("#net-update").removeClass("show")):$j("#net-update").addClass("show"),$j("#net-update").html(u);var a=$j(s).find("home").text();a==0?(a="",$j("#home-update").removeClass("show")):$j("#home-update").addClass("show"),$j("#home-update").html(a);var f=$j(s).find("intro").text();f==0?(f="",$j("#intro-update").removeClass("show")):$j("#intro-update").addClass("show"),$j("#intro-update").html(f);var l=$j(s).find("mail").text();l==0?(l="",$j("#mail-update").removeClass("show")):$j("#mail-update").addClass("show"),$j("#mail-update").html(l);var f=$j(s).find("intro").text();f==0?(f="",$j("#intro-update-li").removeClass("show")):$j("#intro-update-li").addClass("show"),$j("#intro-update-li").html(f);var l=$j(s).find("mail").text();l==0?(l="",$j("#mail-update-li").removeClass("show")):$j("#mail-update-li").addClass("show"),$j("#mail-update-li").html(l);var c=$j(s).find("notif");c.children("note").length==0?$j("#nav-notifications-menu").html(i):(nnm=$j("#nav-notifications-menu"),nnm.html(n+r),c.children("note").each(function(){e=$j(this),text=e.text().format("<span class='contactname'>"+e.attr("name")+"</span>"),html=t.format(e.attr("href"),e.attr("photo"),text,e.attr("date"),e.attr("seen")),nnm.append(html)})),notif=c.attr("count"),notif>0?$j("#nav-notifications-linkmenu").addClass("on"):$j("#nav-notifications-linkmenu").removeClass("on"),notif==0?(notif="",$j("#notify-update").removeClass("show")):$j("#notify-update").addClass("show"),$j("#notify-update").html(notif);var h=$j(s).find("sysmsgs");h.children("notice").each(function(){text=$j(this).text(),$j.jGrowl(text,{sticky:!1,theme:"notice",life:1e3})}),h.children("info").each(function(){text=$j(this).text(),$j.jGrowl(text,{sticky:!1,theme:"info",life:1e3})})}),NavUpdate()});var lockvisible=!1;String.prototype.format=function(){var e=this;for(var t=0;t<arguments.length;t++){var n=new RegExp("\\{"+t+"\\}","gi");e=e.replace(n,arguments[t])}return e},Array.prototype.remove=function(e){to=undefined,from=this.indexOf(e);var t=this.slice((to||from)+1||this.length);return this.length=from<0?this.length+from:from,this.push.apply(this,t)};
\ No newline at end of file
+function openClose(e){document.getElementById(e).style.display=="block"?document.getElementById(e).style.display="none":document.getElementById(e).style.display="block"}function openMenu(e){document.getElementById(e).style.display="block"}function closeMenu(e){document.getElementById(e).style.display="none"}function NavUpdate(){if(!stopped){var e="ping"+(localUser!=0?"?f=&uid="+localUser:"");$j.get(e,function(e){$j(e).find("result").each(function(){$j("nav").trigger("nav-update",this),$j("#live-network").length&&(src="network",liveUpdate()),$j("#live-profile").length&&(src="profile",liveUpdate()),$j("#live-community").length&&(src="community",liveUpdate()),$j("#live-notes").length&&(src="notes",liveUpdate()),$j("#live-display").length&&(src="display",liveUpdate()),$j("#live-photos").length&&liking&&(liking=0,window.location.href=window.location.href)})})}timer=setTimeout(NavUpdate,updateInterval)}function liveUpdate(){if(src==null||stopped||!profile_uid){$j(".like-rotator").hide();return}if($j(".comment-edit-text-full").length||in_progress){livetime&&clearTimeout(livetime),livetime=setTimeout(liveUpdate,1e4);return}livetime!=null&&(livetime=null),prev="live-"+src,in_progress=!0;var e=netargs.length?"/"+netargs:"",t="update_"+src+e+"&p="+profile_uid+"&page="+profile_page+"&msie="+(msie?1:0);$j.get(t,function(e){in_progress=!1,$j(".toplevel_item",e).each(function(){var e=$j(this).attr("id");if($j("#"+e).length==0&&profile_page==1)$j("img",this).each(function(){$j(this).attr("src",$j(this).attr("dst"))}),$j("#"+prev).after($j(this));else{var t=$j(".hide-comments-total",this).attr("id");if(typeof t!="undefined"){t=t.split("-")[3];var n=$j("#collapsed-comments-"+t).is(":visible")}$j("img",this).each(function(){$j(this).attr("src",$j(this).attr("dst"))}),$j("html").height($j("html").height()),$j("#"+e).replaceWith($j(this)),typeof t!="undefined"&&n&&showHideComments(t),$j("html").height("auto")}prev=e});var t=$j(".wall-item-body > img").not(function(){return this.complete}),n=t.length;n?t.load(function(){n--,n||collapseHeight()}):collapseHeight(),$j(".like-rotator").hide(),commentBusy&&(commentBusy=!1,$j("body").css("cursor","auto")),$j(".comment-edit-form  textarea").contact_autocomplete(baseurl+"/acl")})}function collapseHeight(){$j(".wall-item-body").each(function(){$j(this).height()>310&&($j(this).hasClass("divmore")||($j(this).divgrow({initialHeight:300,showBrackets:!1,speed:0}),$j(this).addClass("divmore")))})}function imgbright(e){$j(e).removeClass("drophide").addClass("drop")}function imgdull(e){$j(e).removeClass("drop").addClass("drophide")}function dolike(e,t){unpause(),$j("#like-rotator-"+e.toString()).show(),$j.get("like/"+e.toString()+"?verb="+t,NavUpdate),liking=1}function dostar(e){e=e.toString(),$j.get("starred/"+e,function(t){t.match(/1/)?($j("#starred-"+e).addClass("starred"),$j("#starred-"+e).removeClass("unstarred"),$j("#star-"+e).addClass("hidden"),$j("#unstar-"+e).removeClass("hidden")):($j("#starred-"+e).addClass("unstarred"),$j("#starred-"+e).removeClass("starred"),$j("#star-"+e).removeClass("hidden"),$j("#unstar-"+e).addClass("hidden"))})}function getPosition(e){var t={x:0,y:0};if(e.touches[0].pageX||e.touches[0].pageY)t.x=e.touches[0].pageX,t.y=e.touches[0].pageY;else if(e.touches[0].clientX||e.touches[0].clientY)t.x=e.touches[0].clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)-document.documentElement.clientLeft,t.y=e.touches[0].clientY+(document.documentElement.scrollTop||document.body.scrollTop)-document.documentElement.clientTop;else if(e.touches[0].x||e.touches[0].y)t.touches[0].x=e.touches[0].x,t.touches[0].y=e.touches[0].y;return t}function lockview(e,t){e=e||window.event,cursor=getPosition(e),lockvisible?lockviewhide():(lockvisible=!0,$j.get("lockview/"+t,function(e){$j("#panel").html(e),$j("#panel").css({left:cursor.x+5,top:cursor.y+5}),$j("#panel").show()}))}function lockviewhide(){lockvisible=!1,$j("#panel").hide()}function post_comment(e){return unpause(),commentBusy=!0,$j("body").css("cursor","wait"),$j("#comment-preview-inp-"+e).val("0"),$j.post("item",$j("#comment-edit-form-"+e).serialize(),function(t){if(t.success){$j("#comment-edit-wrapper-"+e).hide(),$j("#comment-edit-text-"+e).val("");var n=document.getElementById("comment-edit-text-"+e);n&&commentClose(n,e),timer&&clearTimeout(timer),timer=setTimeout(NavUpdate,10)}t.reload&&(window.location.href=t.reload)},"json"),!1}function preview_comment(e){return $j("#comment-preview-inp-"+e).val("1"),$j("#comment-edit-preview-"+e).show(),$j.post("item",$j("#comment-edit-form-"+e).serialize(),function(t){t.preview&&($j("#comment-edit-preview-"+e).html(t.preview),$j("#comment-edit-preview-"+e+" a").click(function(){return!1}))},"json"),!0}function showHideComments(e){$j("#collapsed-comments-"+e).is(":visible")?($j("#collapsed-comments-"+e).hide(),$j("#hide-comments-"+e).html(window.showMore)):($j("#collapsed-comments-"+e).show(),$j("#hide-comments-"+e).html(window.showFewer))}function preview_post(){return $j("#jot-preview").val("1"),$j("#jot-preview-content").show(),tinyMCE.triggerSave(),$j.post("item",$j("#profile-jot-form").serialize(),function(e){e.preview&&($j("#jot-preview-content").html(e.preview),$j("#jot-preview-content a").click(function(){return!1}))},"json"),$j("#jot-preview").val("0"),!0}function unpause(){totStopped=!1,stopped=!1,$j("#pause").html("")}function bin2hex(e){var t,n,r=0,i=[];e+="",r=e.length;for(n=0;n<r;n++)i[n]=e.charCodeAt(n).toString(16).replace(/^([\da-f])$/,"0$1");return i.join("")}function groupChangeMember(e,t,n){$j("body .fakelink").css("cursor","wait"),$j.get("group/"+e+"/"+t+"?t="+n,function(e){$j("#group-update-wrapper").html(e),$j("body .fakelink").css("cursor","auto")})}function profChangeMember(e,t){$j("body .fakelink").css("cursor","wait"),$j.get("profperm/"+e+"/"+t,function(e){$j("#prof-update-wrapper").html(e),$j("body .fakelink").css("cursor","auto")})}function contactgroupChangeMember(e,t){$j("body").css("cursor","wait"),$j.get("contactgroup/"+e+"/"+t,function(e){$j("body").css("cursor","auto")})}function checkboxhighlight(e){$j(e).is(":checked")?$j(e).addClass("checkeditem"):$j(e).removeClass("checkeditem")}function notifyMarkAll(){$j.get("notify/mark/all",function(e){timer&&clearTimeout(timer),timer=setTimeout(NavUpdate,1e3)})}function fcFileBrowser(e,t,n,r){var i=baseurl+"/fbrowser/"+n+"/";return tinyMCE.activeEditor.windowManager.open({file:i,title:"File Browser",width:420,height:400,resizable:"yes",inline:"yes",close_previous:"no"},{window:r,input:e}),!1}function setupFieldRichtext(){tinyMCE.init({theme:"advanced",mode:"specific_textareas",editor_selector:"fieldRichtext",plugins:"bbcode,paste, inlinepopups",theme_advanced_buttons1:"bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code",theme_advanced_buttons2:"",theme_advanced_buttons3:"",theme_advanced_toolbar_location:"top",theme_advanced_toolbar_align:"center",theme_advanced_blockformats:"blockquote,code",paste_text_sticky:!0,entity_encoding:"raw",add_unload_trigger:!1,remove_linebreaks:!1,force_p_newlines:!1,force_br_newlines:!0,forced_root_block:"",convert_urls:!1,content_css:baseurl+"/view/custom_tinymce.css",theme_advanced_path:!1,file_browser_callback:"fcFileBrowser"})}function previewTheme(e){theme=$j(e).val(),$j.getJSON("pretheme?f=&theme="+theme,function(e){$j("#theme-preview").html('<div id="theme-desc">'+e.desc+'</div><div id="theme-version">'+e.version+'</div><div id="theme-credits">'+e.credits+"</div>")})}var src=null,prev=null,livetime=null,msie=!1,stopped=!1,totStopped=!1,timer=null,pr=0,liking=0,in_progress=!1,langSelect=!1,commentBusy=!1,last_popup_menu=null,last_popup_button=null;$j(function(){function e(e){last_popup_menu&&"#"+last_popup_menu.attr("id")!==$j(e.target).attr("rel")&&(last_popup_menu.hide(),last_popup_menu.attr("id")=="nav-notifications-menu"&&$j(".main-container").show(),last_popup_button.removeClass("selected"),last_popup_menu=null,last_popup_button=null)}$j.ajaxSetup({cache:!1}),msie=$j.browser.msie,$j(".onoff input").each(function(){val=$j(this).val(),id=$j(this).attr("id"),$j("#"+id+"_onoff ."+(val==0?"on":"off")).addClass("hidden")}),$j(".onoff > a").click(function(e){e.preventDefault();var t=$j(this).siblings("input"),n=1-t.val(),r=t.attr("id");$j("#"+r+"_onoff ."+(n==0?"on":"off")).addClass("hidden"),$j("#"+r+"_onoff ."+(n==1?"on":"off")).removeClass("hidden"),t.val(n)}),$j("img[rel^=#]").click(function(t){return e(t),menu=$j($j(this).attr("rel")),t.preventDefault(),t.stopPropagation(),menu.attr("popup")=="false"?!1:(menu.css("display")=="none"?($j(this).parent().addClass("selected"),menu.show(),menu.attr("id")=="nav-notifications-menu"&&$j(".main-container").hide(),last_popup_menu=menu,last_popup_button=$j(this).parent()):($j(this).parent().removeClass("selected"),menu.hide(),menu.attr("id")=="nav-notifications-menu"&&$j(".main-container").show(),last_popup_menu=null,last_popup_button=null),!1)}),$j("html").click(function(t){e(t)});var t=unescape($j("#nav-notifications-template[rel=template]").html()),n=unescape($j("<div>").append($j("#nav-notifications-see-all").clone()).html()),r=unescape($j("<div>").append($j("#nav-notifications-mark-all").clone()).html()),i=unescape($j("#nav-notifications-menu").html());$j("nav").bind("nav-update",function(e,s){var o=$j(s).find("invalid").text();o==1&&(window.location.href=window.location.href);var u=$j(s).find("net").text();u==0?(u="",$j("#net-update").removeClass("show")):$j("#net-update").addClass("show"),$j("#net-update").html(u);var a=$j(s).find("home").text();a==0?(a="",$j("#home-update").removeClass("show")):$j("#home-update").addClass("show"),$j("#home-update").html(a);var f=$j(s).find("intro").text();f==0?(f="",$j("#intro-update").removeClass("show")):$j("#intro-update").addClass("show"),$j("#intro-update").html(f);var l=$j(s).find("mail").text();l==0?(l="",$j("#mail-update").removeClass("show")):$j("#mail-update").addClass("show"),$j("#mail-update").html(l);var f=$j(s).find("intro").text();f==0?(f="",$j("#intro-update-li").removeClass("show")):$j("#intro-update-li").addClass("show"),$j("#intro-update-li").html(f);var l=$j(s).find("mail").text();l==0?(l="",$j("#mail-update-li").removeClass("show")):$j("#mail-update-li").addClass("show"),$j("#mail-update-li").html(l);var c=$j(s).find("notif");c.children("note").length==0?$j("#nav-notifications-menu").html(i):(nnm=$j("#nav-notifications-menu"),nnm.html(n+r),c.children("note").each(function(){e=$j(this),text=e.text().format("<span class='contactname'>"+e.attr("name")+"</span>"),html=t.format(e.attr("href"),e.attr("photo"),text,e.attr("date"),e.attr("seen")),nnm.append(html)})),notif=c.attr("count"),notif>0?$j("#nav-notifications-linkmenu").addClass("on"):$j("#nav-notifications-linkmenu").removeClass("on"),notif==0?(notif="",$j("#notify-update").removeClass("show")):$j("#notify-update").addClass("show"),$j("#notify-update").html(notif);var h=$j(s).find("sysmsgs");h.children("notice").each(function(){text=$j(this).text(),$j.jGrowl(text,{sticky:!1,theme:"notice",life:1e3})}),h.children("info").each(function(){text=$j(this).text(),$j.jGrowl(text,{sticky:!1,theme:"info",life:1e3})})}),NavUpdate()});var lockvisible=!1;String.prototype.format=function(){var e=this;for(var t=0;t<arguments.length;t++){var n=new RegExp("\\{"+t+"\\}","gi");e=e.replace(n,arguments[t])}return e},Array.prototype.remove=function(e){to=undefined,from=this.indexOf(e);var t=this.slice((to||from)+1||this.length);return this.length=from<0?this.length+from:from,this.push.apply(this,t)};
\ No newline at end of file
index 571720e7c4154fbfa97a1137cd2cf765932ee377..3c0db8fbf9ea5c5db237998368e365d6576d6445 100644 (file)
@@ -533,17 +533,6 @@ function qCommentInsert(obj,id) {
        $j(obj).val("");
 }
 
-function showHideComments(id) {
-       if( $j("#collapsed-comments-" + id).is(":visible")) {
-               $j("#collapsed-comments-" + id).hide();
-               $j("#hide-comments-" + id).html(window.showMore);
-       }
-       else {
-               $j("#collapsed-comments-" + id).show();
-               $j("#hide-comments-" + id).html(window.showFewer);
-       }
-}
-
 /*function showHideCommentBox(id) {
        if( $j('#comment-edit-form-' + id).is(':visible')) {
                $j('#comment-edit-form-' + id).hide();
index 60dad6220b14b48d38ac5b5eee609a705e5dbc69..2861ce94129840d93cf81c7e4f2f7e2368e54e54 100644 (file)
@@ -1 +1 @@
-function insertFormatting(e,t,n){var r=$j("#comment-edit-text-"+n).val();r==e&&(r="",$j("#comment-edit-text-"+n).addClass("comment-edit-text-full"),$j("#comment-edit-text-"+n).removeClass("comment-edit-text-empty"),openMenu("comment-edit-submit-wrapper-"+n),$j("#comment-edit-text-"+n).val(r)),textarea=document.getElementById("comment-edit-text-"+n);if(document.selection)textarea.focus(),selected=document.selection.createRange(),t=="url"?selected.text="["+t+"]"+"http://"+selected.text+"[/"+t+"]":selected.text="["+t+"]"+selected.text+"[/"+t+"]";else if(textarea.selectionStart||textarea.selectionStart=="0"){var i=textarea.selectionStart,s=textarea.selectionEnd;t=="url"?textarea.value=textarea.value.substring(0,i)+"["+t+"]"+"http://"+textarea.value.substring(i,s)+"[/"+t+"]"+textarea.value.substring(s,textarea.value.length):textarea.value=textarea.value.substring(0,i)+"["+t+"]"+textarea.value.substring(i,s)+"[/"+t+"]"+textarea.value.substring(s,textarea.value.length)}return!0}function cmtBbOpen(e){$j(".comment-edit-bb-"+e).show()}function cmtBbClose(e){$j(".comment-edit-bb-"+e).hide()}function initEditor(e){if(editor==0){if(plaintext=="none"){$j("#profile-jot-text").css({height:200,color:"#000"}),$j("#profile-jot-text").contact_autocomplete(baseurl+"/acl"),editor=!0,$j("a#jot-perms-icon, a#settings-default-perms-menu").click(function(){var e=$j("#profile-jot-acl-wrapper").parent();return e.css("display")=="none"?e.show():e.hide(),!1}),$j(".jothidden").show(),typeof e!="undefined"&&e();return}}else typeof e!="undefined"&&e()}function enableOnUser(){if(editor)return;$j(this).val(""),initEditor()}function wallInitEditor(){var e=window.editSelect;e!="none"?tinyMCE.init({theme:"advanced",mode:"specific_textareas",editor_selector:/(profile-jot-text|prvmail-text)/,plugins:"bbcode,paste",theme_advanced_buttons1:"bold,italic,underline,undo,redo,link,unlink,image,forecolor",theme_advanced_buttons2:"",theme_advanced_buttons3:"",theme_advanced_toolbar_location:"top",theme_advanced_toolbar_align:"center",theme_advanced_blockformats:"blockquote,code",gecko_spellcheck:!0,paste_text_sticky:!0,entity_encoding:"raw",add_unload_trigger:!1,remove_linebreaks:!1,force_p_newlines:!1,force_br_newlines:!0,forced_root_block:"",convert_urls:!1,content_css:baseurl+"/view/custom_tinymce.css",theme_advanced_path:!1,setup:function(e){e.onInit.add(function(e){e.pasteAsPlainText=!0;var t=e.editorId,n=$j("#"+t);typeof n.attr("tabindex")!="undefined"&&($j("#"+t+"_ifr").attr("tabindex",n.attr("tabindex")),n.attr("tabindex",null))})}}):$j("#prvmail-text").contact_autocomplete(baseurl+"/acl")}function initCrop(){function e(e,t){$("x1").value=e.x1,$("y1").value=e.y1,$("x2").value=e.x2,$("y2").value=e.y2,$("width").value=t.width,$("height").value=t.height}Event.observe(window,"load",function(){new Cropper.ImgWithPreview("croppa",{previewWrap:"previewWrap",minWidth:175,minHeight:175,maxWidth:640,maxHeight:640,ratioDim:{x:100,y:100},displayOnInit:!0,onEndCrop:e})})}function confirmDelete(){return confirm(window.delItem)}function commentOpen(e,t){e.value==window.commentEmptyText&&(e.value="",$j("#comment-edit-text-"+t).addClass("comment-edit-text-full"),$j("#comment-edit-text-"+t).removeClass("comment-edit-text-empty"),$j("#mod-cmnt-wrap-"+t).show(),openMenu("comment-edit-submit-wrapper-"+t))}function commentClose(e,t){e.value==""&&(e.value=window.commentEmptyText,$j("#comment-edit-text-"+t).removeClass("comment-edit-text-full"),$j("#comment-edit-text-"+t).addClass("comment-edit-text-empty"),$j("#mod-cmnt-wrap-"+t).hide(),closeMenu("comment-edit-submit-wrapper-"+t))}function commentInsert(e,t){var n=$j("#comment-edit-text-"+t).val();n==window.commentEmptyText&&(n="",$j("#comment-edit-text-"+t).addClass("comment-edit-text-full"),$j("#comment-edit-text-"+t).removeClass("comment-edit-text-empty"),openMenu("comment-edit-submit-wrapper-"+t));var r=$j(e).html();r=r.replace("&lt;","<"),r=r.replace("&gt;",">"),r=r.replace("&amp;","&"),r=r.replace("&quot;",'"'),$j("#comment-edit-text-"+t).val(n+r)}function qCommentInsert(e,t){var n=$j("#comment-edit-text-"+t).val();n==window.commentEmptyText&&(n="",$j("#comment-edit-text-"+t).addClass("comment-edit-text-full"),$j("#comment-edit-text-"+t).removeClass("comment-edit-text-empty"),openMenu("comment-edit-submit-wrapper-"+t));var r=$j(e).val();r=r.replace("&lt;","<"),r=r.replace("&gt;",">"),r=r.replace("&amp;","&"),r=r.replace("&quot;",'"'),$j("#comment-edit-text-"+t).val(n+r),$j(e).val("")}function showHideComments(e){$j("#collapsed-comments-"+e).is(":visible")?($j("#collapsed-comments-"+e).hide(),$j("#hide-comments-"+e).html(window.showMore)):($j("#collapsed-comments-"+e).show(),$j("#hide-comments-"+e).html(window.showFewer))}function jotVideoURL(){reply=prompt(window.vidURL),reply&&reply.length&&addeditortext("[video]"+reply+"[/video]")}function jotAudioURL(){reply=prompt(window.audURL),reply&&reply.length&&addeditortext("[audio]"+reply+"[/audio]")}function jotGetLocation(){reply=prompt(window.whereAreU,$j("#jot-location").val()),reply&&reply.length&&$j("#jot-location").val(reply)}function jotShare(e){$j("#jot-popup").length!=0&&$j("#jot-popup").show(),$j("#like-rotator-"+e).show(),$j.get("share/"+e,function(t){editor||$j("#profile-jot-text").val(""),initEditor(function(){addeditortext(t),$j("#like-rotator-"+e).hide(),$j(window).scrollTop(0)})})}function linkdropper(e){var t=e.dataTransfer.types.contains("text/uri-list");t&&e.preventDefault()}function showEvent(e){}function itemTag(e){reply=prompt(window.term),reply&&reply.length&&(reply=reply.replace("#",""),reply.length&&(commentBusy=!0,$j("body").css("cursor","wait"),$j.get("tagger/"+e+"?term="+reply,NavUpdate),liking=1))}function itemFiler(e){$j.get("filer/",function(t){var n=$j("#id_term_label",t).text();reply=prompt(n),reply&&reply.length&&(commentBusy=!0,$j("body").css("cursor","wait"),$j.get("filer/"+e+"?term="+reply,NavUpdate),liking=1)})}function jotClearLocation(){$j("#jot-coord").val(""),$j("#profile-nolocation-wrapper").hide()}function addeditortext(e){if(plaintext=="none"){var t=$j("#profile-jot-text").val();$j("#profile-jot-text").val(t+e)}}$j(document).ready(function(){$j("#profile-jot-text").focus(enableOnUser),$j("#profile-jot-text").click(enableOnUser);if(typeof window.AjaxUpload!="undefined")switch(window.ajaxType){case"jot-header":var e=new window.AjaxUpload("wall-image-upload",{action:"wall_upload/"+window.nickname,name:"userfile",onSubmit:function(e,t){$j("#profile-rotator").show()},onComplete:function(e,t){addeditortext(t),$j("#profile-rotator").hide()}}),t=new window.AjaxUpload("wall-file-upload",{action:"wall_attach/"+window.nickname,name:"userfile",onSubmit:function(e,t){$j("#profile-rotator").show()},onComplete:function(e,t){addeditortext(t),$j("#profile-rotator").hide()}});break;case"msg-header":var e=new window.AjaxUpload("prvmail-upload",{action:"wall_upload/"+window.nickname,name:"userfile",onSubmit:function(e,t){$j("#profile-rotator").show()},onComplete:function(e,t){tinyMCE.execCommand("mceInsertRawHTML",!1,t),$j("#profile-rotator").hide()}});break;default:}typeof window.aclInit!="undefined"&&typeof acl=="undefined"&&(acl=new ACL(baseurl+"/acl",[window.allowCID,window.allowGID,window.denyCID,window.denyGID])),window.autoCompleteType=="display-head"&&$j(".comment-wwedit-wrapper textarea").contact_autocomplete(baseurl+"/acl");if(window.aclType=="event_head"){$j("#events-calendar").fullCalendar({events:baseurl+"/events/json/",header:{left:"prev,next today",center:"title",right:"month,agendaWeek,agendaDay"},timeFormat:"H(:mm)",eventClick:function(e,t,n){showEvent(e.id)},eventRender:function(e,t,n){if(e.item["author-name"]==null)return;switch(n.name){case"month":t.find(".fc-event-title").html("<img src='{0}' style='height:10px;width:10px'>{1} : {2}".format(e.item["author-avatar"],e.item["author-name"],e.title));break;case"agendaWeek":t.find(".fc-event-title").html("<img src='{0}' style='height:12px; width:12px'>{1}<p>{2}</p><p>{3}</p>".format(e.item["author-avatar"],e.item["author-name"],e.item.desc,e.item.location));break;case"agendaDay":t.find(".fc-event-title").html("<img src='{0}' style='height:24px;width:24px'>{1}<p>{2}</p><p>{3}</p>".format(e.item["author-avatar"],e.item["author-name"],e.item.desc,e.item.location))}}});var n=location.href.replace(baseurl,"").split("/");n.length>=4&&$j("#events-calendar").fullCalendar("gotoDate",n[2],n[3]-1);var r=location.hash.split("-");r.length==2&&r[0]=="#link"&&showEvent(r[1])}(window.aclType=="settings-head"||window.aclType=="photos_head"||window.aclType=="event_head")&&$j("#contact_allow, #contact_deny, #group_allow, #group_deny").change(function(){var e;$j("#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected").each(function(){e=$j(this).text(),$j("#jot-perms-icon").removeClass("unlock").addClass("lock"),$j("#jot-public").hide()}),e==null&&($j("#jot-perms-icon").removeClass("lock").addClass("unlock"),$j("#jot-public").show())}).trigger("change");switch(window.autocompleteType){case"msg-header":var i=$j("#recip").autocomplete({serviceUrl:baseurl+"/acl",minChars:2,width:350,onSelect:function(e,t){$j("#recip-complete").val(t)}});break;case"contacts-head":var i=$j("#contacts-search").autocomplete({serviceUrl:baseurl+"/acl",minChars:2,width:350});i.setOptions({params:{type:"a"}});break;default:}$j("#event-share-checkbox").change(function(){$j("#event-share-checkbox").is(":checked")?$j("#acl-wrapper").show():$j("#acl-wrapper").hide()}).trigger("change"),$j(".popupbox").click(function(){var e=$j($j(this).attr("href")).parent();return e.css("display")=="none"?e.show():e.hide(),!1})}),$j(function(){$j("nav").bind("nav-update",function(e,t){var n=$j("#pending-update"),r=$j(t).find("register").text();r=="0"?(r="",n.hide()):n.show(),n.html(r)})});var editor=!1,textlen=0,plaintext="none",ispublic=window.isPublic;switch(window.ajaxType){case"jot-header":function jotGetLink(){reply=prompt(window.linkURL),reply&&reply.length&&(reply=bin2hex(reply),$j("#profile-rotator").show(),$j.get("parse_url?binurl="+reply,function(e){addeditortext(e),$j("#profile-rotator").hide()}))}function linkdrop(e){var t=e.dataTransfer.getData("text/uri-list");e.target.textContent=t,e.preventDefault(),t&&t.length&&(t=bin2hex(t),$j("#profile-rotator").show(),$j.get("parse_url?binurl="+t,function(e){editor||$j("#profile-jot-text").val(""),initEditor(function(){addeditortext(e),$j("#profile-rotator").hide()})}))}break;case"msg-header":case"wallmsg-header":function jotGetLink(){reply=prompt(window.linkURL),reply&&reply.length&&($j("#profile-rotator").show(),$j.get("parse_url?url="+reply,function(e){tinyMCE.execCommand("mceInsertRawHTML",!1,e),$j("#profile-rotator").hide()}))}function linkdrop(e){var t=e.dataTransfer.getData("text/uri-list");e.target.textContent=t,e.preventDefault(),t&&t.length&&($j("#profile-rotator").show(),$j.get("parse_url?url="+t,function(e){tinyMCE.execCommand("mceInsertRawHTML",!1,e),$j("#profile-rotator").hide()}))}break;default:}typeof window.geoTag=="function"&&window.geoTag();
\ No newline at end of file
+function insertFormatting(e,t,n){var r=$j("#comment-edit-text-"+n).val();r==e&&(r="",$j("#comment-edit-text-"+n).addClass("comment-edit-text-full"),$j("#comment-edit-text-"+n).removeClass("comment-edit-text-empty"),openMenu("comment-edit-submit-wrapper-"+n),$j("#comment-edit-text-"+n).val(r)),textarea=document.getElementById("comment-edit-text-"+n);if(document.selection)textarea.focus(),selected=document.selection.createRange(),t=="url"?selected.text="["+t+"]"+"http://"+selected.text+"[/"+t+"]":selected.text="["+t+"]"+selected.text+"[/"+t+"]";else if(textarea.selectionStart||textarea.selectionStart=="0"){var i=textarea.selectionStart,s=textarea.selectionEnd;t=="url"?textarea.value=textarea.value.substring(0,i)+"["+t+"]"+"http://"+textarea.value.substring(i,s)+"[/"+t+"]"+textarea.value.substring(s,textarea.value.length):textarea.value=textarea.value.substring(0,i)+"["+t+"]"+textarea.value.substring(i,s)+"[/"+t+"]"+textarea.value.substring(s,textarea.value.length)}return!0}function cmtBbOpen(e){$j(".comment-edit-bb-"+e).show()}function cmtBbClose(e){$j(".comment-edit-bb-"+e).hide()}function initEditor(e){if(editor==0){if(plaintext=="none"){$j("#profile-jot-text").css({height:200,color:"#000"}),$j("#profile-jot-text").contact_autocomplete(baseurl+"/acl"),editor=!0,$j("a#jot-perms-icon, a#settings-default-perms-menu").click(function(){var e=$j("#profile-jot-acl-wrapper").parent();return e.css("display")=="none"?e.show():e.hide(),!1}),$j(".jothidden").show(),typeof e!="undefined"&&e();return}}else typeof e!="undefined"&&e()}function enableOnUser(){if(editor)return;$j(this).val(""),initEditor()}function wallInitEditor(){var e=window.editSelect;e!="none"?tinyMCE.init({theme:"advanced",mode:"specific_textareas",editor_selector:/(profile-jot-text|prvmail-text)/,plugins:"bbcode,paste",theme_advanced_buttons1:"bold,italic,underline,undo,redo,link,unlink,image,forecolor",theme_advanced_buttons2:"",theme_advanced_buttons3:"",theme_advanced_toolbar_location:"top",theme_advanced_toolbar_align:"center",theme_advanced_blockformats:"blockquote,code",gecko_spellcheck:!0,paste_text_sticky:!0,entity_encoding:"raw",add_unload_trigger:!1,remove_linebreaks:!1,force_p_newlines:!1,force_br_newlines:!0,forced_root_block:"",convert_urls:!1,content_css:baseurl+"/view/custom_tinymce.css",theme_advanced_path:!1,setup:function(e){e.onInit.add(function(e){e.pasteAsPlainText=!0;var t=e.editorId,n=$j("#"+t);typeof n.attr("tabindex")!="undefined"&&($j("#"+t+"_ifr").attr("tabindex",n.attr("tabindex")),n.attr("tabindex",null))})}}):$j("#prvmail-text").contact_autocomplete(baseurl+"/acl")}function initCrop(){function e(e,t){$("x1").value=e.x1,$("y1").value=e.y1,$("x2").value=e.x2,$("y2").value=e.y2,$("width").value=t.width,$("height").value=t.height}Event.observe(window,"load",function(){new Cropper.ImgWithPreview("croppa",{previewWrap:"previewWrap",minWidth:175,minHeight:175,maxWidth:640,maxHeight:640,ratioDim:{x:100,y:100},displayOnInit:!0,onEndCrop:e})})}function confirmDelete(){return confirm(window.delItem)}function commentOpen(e,t){e.value==window.commentEmptyText&&(e.value="",$j("#comment-edit-text-"+t).addClass("comment-edit-text-full"),$j("#comment-edit-text-"+t).removeClass("comment-edit-text-empty"),$j("#mod-cmnt-wrap-"+t).show(),openMenu("comment-edit-submit-wrapper-"+t))}function commentClose(e,t){e.value==""&&(e.value=window.commentEmptyText,$j("#comment-edit-text-"+t).removeClass("comment-edit-text-full"),$j("#comment-edit-text-"+t).addClass("comment-edit-text-empty"),$j("#mod-cmnt-wrap-"+t).hide(),closeMenu("comment-edit-submit-wrapper-"+t))}function commentInsert(e,t){var n=$j("#comment-edit-text-"+t).val();n==window.commentEmptyText&&(n="",$j("#comment-edit-text-"+t).addClass("comment-edit-text-full"),$j("#comment-edit-text-"+t).removeClass("comment-edit-text-empty"),openMenu("comment-edit-submit-wrapper-"+t));var r=$j(e).html();r=r.replace("&lt;","<"),r=r.replace("&gt;",">"),r=r.replace("&amp;","&"),r=r.replace("&quot;",'"'),$j("#comment-edit-text-"+t).val(n+r)}function qCommentInsert(e,t){var n=$j("#comment-edit-text-"+t).val();n==window.commentEmptyText&&(n="",$j("#comment-edit-text-"+t).addClass("comment-edit-text-full"),$j("#comment-edit-text-"+t).removeClass("comment-edit-text-empty"),openMenu("comment-edit-submit-wrapper-"+t));var r=$j(e).val();r=r.replace("&lt;","<"),r=r.replace("&gt;",">"),r=r.replace("&amp;","&"),r=r.replace("&quot;",'"'),$j("#comment-edit-text-"+t).val(n+r),$j(e).val("")}function jotVideoURL(){reply=prompt(window.vidURL),reply&&reply.length&&addeditortext("[video]"+reply+"[/video]")}function jotAudioURL(){reply=prompt(window.audURL),reply&&reply.length&&addeditortext("[audio]"+reply+"[/audio]")}function jotGetLocation(){reply=prompt(window.whereAreU,$j("#jot-location").val()),reply&&reply.length&&$j("#jot-location").val(reply)}function jotShare(e){$j("#jot-popup").length!=0&&$j("#jot-popup").show(),$j("#like-rotator-"+e).show(),$j.get("share/"+e,function(t){editor||$j("#profile-jot-text").val(""),initEditor(function(){addeditortext(t),$j("#like-rotator-"+e).hide(),$j(window).scrollTop(0)})})}function linkdropper(e){var t=e.dataTransfer.types.contains("text/uri-list");t&&e.preventDefault()}function showEvent(e){}function itemTag(e){reply=prompt(window.term),reply&&reply.length&&(reply=reply.replace("#",""),reply.length&&(commentBusy=!0,$j("body").css("cursor","wait"),$j.get("tagger/"+e+"?term="+reply,NavUpdate),liking=1))}function itemFiler(e){$j.get("filer/",function(t){var n=$j("#id_term_label",t).text();reply=prompt(n),reply&&reply.length&&(commentBusy=!0,$j("body").css("cursor","wait"),$j.get("filer/"+e+"?term="+reply,NavUpdate),liking=1)})}function jotClearLocation(){$j("#jot-coord").val(""),$j("#profile-nolocation-wrapper").hide()}function addeditortext(e){if(plaintext=="none"){var t=$j("#profile-jot-text").val();$j("#profile-jot-text").val(t+e)}}$j(document).ready(function(){$j("#profile-jot-text").focus(enableOnUser),$j("#profile-jot-text").click(enableOnUser);if(typeof window.AjaxUpload!="undefined")switch(window.ajaxType){case"jot-header":var e=new window.AjaxUpload("wall-image-upload",{action:"wall_upload/"+window.nickname,name:"userfile",onSubmit:function(e,t){$j("#profile-rotator").show()},onComplete:function(e,t){addeditortext(t),$j("#profile-rotator").hide()}}),t=new window.AjaxUpload("wall-file-upload",{action:"wall_attach/"+window.nickname,name:"userfile",onSubmit:function(e,t){$j("#profile-rotator").show()},onComplete:function(e,t){addeditortext(t),$j("#profile-rotator").hide()}});break;case"msg-header":var e=new window.AjaxUpload("prvmail-upload",{action:"wall_upload/"+window.nickname,name:"userfile",onSubmit:function(e,t){$j("#profile-rotator").show()},onComplete:function(e,t){tinyMCE.execCommand("mceInsertRawHTML",!1,t),$j("#profile-rotator").hide()}});break;default:}typeof window.aclInit!="undefined"&&typeof acl=="undefined"&&(acl=new ACL(baseurl+"/acl",[window.allowCID,window.allowGID,window.denyCID,window.denyGID])),window.autoCompleteType=="display-head"&&$j(".comment-wwedit-wrapper textarea").contact_autocomplete(baseurl+"/acl");if(window.aclType=="event_head"){$j("#events-calendar").fullCalendar({events:baseurl+"/events/json/",header:{left:"prev,next today",center:"title",right:"month,agendaWeek,agendaDay"},timeFormat:"H(:mm)",eventClick:function(e,t,n){showEvent(e.id)},eventRender:function(e,t,n){if(e.item["author-name"]==null)return;switch(n.name){case"month":t.find(".fc-event-title").html("<img src='{0}' style='height:10px;width:10px'>{1} : {2}".format(e.item["author-avatar"],e.item["author-name"],e.title));break;case"agendaWeek":t.find(".fc-event-title").html("<img src='{0}' style='height:12px; width:12px'>{1}<p>{2}</p><p>{3}</p>".format(e.item["author-avatar"],e.item["author-name"],e.item.desc,e.item.location));break;case"agendaDay":t.find(".fc-event-title").html("<img src='{0}' style='height:24px;width:24px'>{1}<p>{2}</p><p>{3}</p>".format(e.item["author-avatar"],e.item["author-name"],e.item.desc,e.item.location))}}});var n=location.href.replace(baseurl,"").split("/");n.length>=4&&$j("#events-calendar").fullCalendar("gotoDate",n[2],n[3]-1);var r=location.hash.split("-");r.length==2&&r[0]=="#link"&&showEvent(r[1])}(window.aclType=="settings-head"||window.aclType=="photos_head"||window.aclType=="event_head")&&$j("#contact_allow, #contact_deny, #group_allow, #group_deny").change(function(){var e;$j("#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected").each(function(){e=$j(this).text(),$j("#jot-perms-icon").removeClass("unlock").addClass("lock"),$j("#jot-public").hide()}),e==null&&($j("#jot-perms-icon").removeClass("lock").addClass("unlock"),$j("#jot-public").show())}).trigger("change");switch(window.autocompleteType){case"msg-header":var i=$j("#recip").autocomplete({serviceUrl:baseurl+"/acl",minChars:2,width:350,onSelect:function(e,t){$j("#recip-complete").val(t)}});break;case"contacts-head":var i=$j("#contacts-search").autocomplete({serviceUrl:baseurl+"/acl",minChars:2,width:350});i.setOptions({params:{type:"a"}});break;default:}$j("#event-share-checkbox").change(function(){$j("#event-share-checkbox").is(":checked")?$j("#acl-wrapper").show():$j("#acl-wrapper").hide()}).trigger("change"),$j(".popupbox").click(function(){var e=$j($j(this).attr("href")).parent();return e.css("display")=="none"?e.show():e.hide(),!1})}),$j(function(){$j("nav").bind("nav-update",function(e,t){var n=$j("#pending-update"),r=$j(t).find("register").text();r=="0"?(r="",n.hide()):n.show(),n.html(r)})});var editor=!1,textlen=0,plaintext="none",ispublic=window.isPublic;switch(window.ajaxType){case"jot-header":function jotGetLink(){reply=prompt(window.linkURL),reply&&reply.length&&(reply=bin2hex(reply),$j("#profile-rotator").show(),$j.get("parse_url?binurl="+reply,function(e){addeditortext(e),$j("#profile-rotator").hide()}))}function linkdrop(e){var t=e.dataTransfer.getData("text/uri-list");e.target.textContent=t,e.preventDefault(),t&&t.length&&(t=bin2hex(t),$j("#profile-rotator").show(),$j.get("parse_url?binurl="+t,function(e){editor||$j("#profile-jot-text").val(""),initEditor(function(){addeditortext(e),$j("#profile-rotator").hide()})}))}break;case"msg-header":case"wallmsg-header":function jotGetLink(){reply=prompt(window.linkURL),reply&&reply.length&&($j("#profile-rotator").show(),$j.get("parse_url?url="+reply,function(e){tinyMCE.execCommand("mceInsertRawHTML",!1,e),$j("#profile-rotator").hide()}))}function linkdrop(e){var t=e.dataTransfer.getData("text/uri-list");e.target.textContent=t,e.preventDefault(),t&&t.length&&($j("#profile-rotator").show(),$j.get("parse_url?url="+t,function(e){tinyMCE.execCommand("mceInsertRawHTML",!1,e),$j("#profile-rotator").hide()}))}break;default:}typeof window.geoTag=="function"&&window.geoTag();
\ No newline at end of file
index 36d59bf1c9cbd786d9c8efa29ee917d2bb433a66..dbeb4f2ee3fc16d84a3a75bdb1a7d9443336f271 100644 (file)
                                        if($j('#live-profile').length)   { src = 'profile'; liveUpdate(); }
                                        if($j('#live-community').length) { src = 'community'; liveUpdate(); }
                                        if($j('#live-notes').length)     { src = 'notes'; liveUpdate(); }
-                                       if($j('#live-display').length) {
+                                       if($j('#live-display').length) { src = 'display'; liveUpdate(); }
+                                       /*if($j('#live-display').length) {
                                                if(liking) {
                                                        liking = 0;
                                                        window.location.href=window.location.href 
                                                }
-                                       }
+                                       }*/
                                        if($j('#live-photos').length) {
                                                if(liking) {
                                                        liking = 0;
                                        $j('#' + prev).after($j(this));
                                }
                                else {
+                                       // Find out if the hidden comments are open, so we can keep it that way
+                                       // if a new comment has been posted
+                                       var id = $j('.hide-comments-total', this).attr('id');
+                                       if(typeof id != 'undefined') {
+                                               id = id.split('-')[3];
+                                               var commentsOpen = $j("#collapsed-comments-" + id).is(":visible");
+                                       }
+
                                        $j('img',this).each(function() {
                                                $j(this).attr('src',$j(this).attr('dst'));
                                        });
+                                       //vScroll = $j(document).scrollTop();
+                                       $j('html').height($j('html').height());
                                        $j('#' + ident).replaceWith($j(this));
+
+                                       if(typeof id != 'undefined') {
+                                               if(commentsOpen) showHideComments(id);
+                                       }
+                                       $j('html').height('auto');
+                                       //$j(document).scrollTop(vScroll);
                                }
                                prev = ident;
                        });
        }
 
 
+       function showHideComments(id) {
+               if( $j("#collapsed-comments-" + id).is(":visible")) {
+                       $j("#collapsed-comments-" + id).hide();
+                       $j("#hide-comments-" + id).html(window.showMore);
+               }
+               else {
+                       $j("#collapsed-comments-" + id).show();
+                       $j("#hide-comments-" + id).html(window.showFewer);
+               }
+       }
+
 
        function preview_post() {
                $j("#jot-preview").val("1");
index 463b4a6e4e4cd7c7b047710fed241f03722af5fe..9952000d5339ab09bbf7e778454e50f169fbec7b 100644 (file)
@@ -1 +1 @@
-function openClose(e){document.getElementById(e).style.display=="block"?document.getElementById(e).style.display="none":document.getElementById(e).style.display="block"}function openMenu(e){document.getElementById(e).style.display="block"}function closeMenu(e){document.getElementById(e).style.display="none"}function NavUpdate(){if(!stopped){var e="ping"+(localUser!=0?"?f=&uid="+localUser:"");$j.get(e,function(e){$j(e).find("result").each(function(){$j("nav").trigger("nav-update",this),$j("#live-network").length&&(src="network",liveUpdate()),$j("#live-profile").length&&(src="profile",liveUpdate()),$j("#live-community").length&&(src="community",liveUpdate()),$j("#live-notes").length&&(src="notes",liveUpdate()),$j("#live-display").length&&liking&&(liking=0,window.location.href=window.location.href),$j("#live-photos").length&&liking&&(liking=0,window.location.href=window.location.href)})})}timer=setTimeout(NavUpdate,updateInterval)}function liveUpdate(){if(src==null||stopped||!profile_uid){$j(".like-rotator").hide();return}if($j(".comment-edit-text-full").length||in_progress){livetime&&clearTimeout(livetime),livetime=setTimeout(liveUpdate,1e4);return}livetime!=null&&(livetime=null),prev="live-"+src,in_progress=!0;var e=netargs.length?"/"+netargs:"",t="update_"+src+e+"&p="+profile_uid+"&page="+profile_page+"&msie="+(msie?1:0);$j.get(t,function(e){in_progress=!1,$j(".toplevel_item",e).each(function(){var e=$j(this).attr("id");$j("#"+e).length==0&&profile_page==1?($j("img",this).each(function(){$j(this).attr("src",$j(this).attr("dst"))}),$j("#"+prev).after($j(this))):($j("img",this).each(function(){$j(this).attr("src",$j(this).attr("dst"))}),$j("#"+e).replaceWith($j(this))),prev=e}),$j(".like-rotator").hide(),commentBusy&&(commentBusy=!1,$j("body").css("cursor","auto")),$j(".comment-edit-form  textarea").contact_autocomplete(baseurl+"/acl");var t=$j(".wall-item-body > img").not(function(){return this.complete}),n=t.length;n?t.load(function(){n--,n||collapseHeight()}):collapseHeight()})}function collapseHeight(){$j(".wall-item-body").each(function(){$j(this).height()>410&&($j(this).hasClass("divmore")||($j(this).divgrow({initialHeight:400,showBrackets:!1,speed:300}),$j(this).addClass("divmore")))})}function imgbright(e){$j(e).removeClass("drophide").addClass("drop")}function imgdull(e){$j(e).removeClass("drop").addClass("drophide")}function dolike(e,t){unpause(),$j("#like-rotator-"+e.toString()).show(),$j.get("like/"+e.toString()+"?verb="+t,NavUpdate),liking=1}function dostar(e){e=e.toString(),$j.get("starred/"+e,function(t){t.match(/1/)?($j("#starred-"+e).addClass("starred"),$j("#starred-"+e).removeClass("unstarred"),$j("#star-"+e).addClass("hidden"),$j("#unstar-"+e).removeClass("hidden")):($j("#starred-"+e).addClass("unstarred"),$j("#starred-"+e).removeClass("starred"),$j("#star-"+e).removeClass("hidden"),$j("#unstar-"+e).addClass("hidden"))})}function getPosition(e){var t={x:0,y:0};if(e.pageX||e.pageY)t.x=e.pageX,t.y=e.pageY;else if(e.clientX||e.clientY)t.x=e.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)-document.documentElement.clientLeft,t.y=e.clientY+(document.documentElement.scrollTop||document.body.scrollTop)-document.documentElement.clientTop;else if(e.x||e.y)t.x=e.x,t.y=e.y;return t}function lockview(e,t){e=e||window.event,cursor=getPosition(e),lockvisible?lockviewhide():(lockvisible=!0,$j.get("lockview/"+t,function(e){$j("#panel").html(e),$j("#panel").css({left:cursor.x+5,top:cursor.y+5}),$j("#panel").show()}))}function lockviewhide(){lockvisible=!1,$j("#panel").hide()}function post_comment(e){return unpause(),commentBusy=!0,$j("body").css("cursor","wait"),$j("#comment-preview-inp-"+e).val("0"),$j.post("item",$j("#comment-edit-form-"+e).serialize(),function(t){if(t.success){$j("#comment-edit-wrapper-"+e).hide(),$j("#comment-edit-text-"+e).val("");var n=document.getElementById("comment-edit-text-"+e);n&&commentClose(n,e),timer&&clearTimeout(timer),timer=setTimeout(NavUpdate,10)}t.reload&&(window.location.href=t.reload)},"json"),!1}function preview_comment(e){return $j("#comment-preview-inp-"+e).val("1"),$j("#comment-edit-preview-"+e).show(),$j.post("item",$j("#comment-edit-form-"+e).serialize(),function(t){t.preview&&($j("#comment-edit-preview-"+e).html(t.preview),$j("#comment-edit-preview-"+e+" a").click(function(){return!1}))},"json"),!0}function preview_post(){return $j("#jot-preview").val("1"),$j("#jot-preview-content").show(),tinyMCE.triggerSave(),$j.post("item",$j("#profile-jot-form").serialize(),function(e){e.preview&&($j("#jot-preview-content").html(e.preview),$j("#jot-preview-content a").click(function(){return!1}))},"json"),$j("#jot-preview").val("0"),!0}function unpause(){totStopped=!1,stopped=!1,$j("#pause").html("")}function bin2hex(e){var t,n,r=0,i=[];e+="",r=e.length;for(n=0;n<r;n++)i[n]=e.charCodeAt(n).toString(16).replace(/^([\da-f])$/,"0$1");return i.join("")}function groupChangeMember(e,t,n){$j("body .fakelink").css("cursor","wait"),$j.get("group/"+e+"/"+t+"?t="+n,function(e){$j("#group-update-wrapper").html(e),$j("body .fakelink").css("cursor","auto")})}function profChangeMember(e,t){$j("body .fakelink").css("cursor","wait"),$j.get("profperm/"+e+"/"+t,function(e){$j("#prof-update-wrapper").html(e),$j("body .fakelink").css("cursor","auto")})}function contactgroupChangeMember(e,t){$j("body").css("cursor","wait"),$j.get("contactgroup/"+e+"/"+t,function(e){$j("body").css("cursor","auto")})}function checkboxhighlight(e){$j(e).is(":checked")?$j(e).addClass("checkeditem"):$j(e).removeClass("checkeditem")}function notifyMarkAll(){$j.get("notify/mark/all",function(e){timer&&clearTimeout(timer),timer=setTimeout(NavUpdate,1e3)})}function fcFileBrowser(e,t,n,r){var i=baseurl+"/fbrowser/"+n+"/";return tinyMCE.activeEditor.windowManager.open({file:i,title:"File Browser",width:420,height:400,resizable:"yes",inline:"yes",close_previous:"no"},{window:r,input:e}),!1}function setupFieldRichtext(){tinyMCE.init({theme:"advanced",mode:"specific_textareas",editor_selector:"fieldRichtext",plugins:"bbcode,paste, inlinepopups",theme_advanced_buttons1:"bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code",theme_advanced_buttons2:"",theme_advanced_buttons3:"",theme_advanced_toolbar_location:"top",theme_advanced_toolbar_align:"center",theme_advanced_blockformats:"blockquote,code",paste_text_sticky:!0,entity_encoding:"raw",add_unload_trigger:!1,remove_linebreaks:!1,force_p_newlines:!1,force_br_newlines:!0,forced_root_block:"",convert_urls:!1,content_css:baseurl+"/view/custom_tinymce.css",theme_advanced_path:!1,file_browser_callback:"fcFileBrowser"})}function previewTheme(e){theme=$j(e).val(),$j.getJSON("pretheme?f=&theme="+theme,function(e){$j("#theme-preview").html('<div id="theme-desc">'+e.desc+'</div><div id="theme-version">'+e.version+'</div><div id="theme-credits">'+e.credits+'</div><a href="'+e.img+'"><img src="'+e.img+'" width="320" height="240" alt="'+theme+'" /></a>')})}var src=null,prev=null,livetime=null,msie=!1,stopped=!1,totStopped=!1,timer=null,pr=0,liking=0,in_progress=!1,langSelect=!1,commentBusy=!1,last_popup_menu=null,last_popup_button=null;$j(function(){function e(e){last_popup_menu&&"#"+last_popup_menu.attr("id")!==$j(e.target).attr("rel")&&(last_popup_menu.hide(),last_popup_button.removeClass("selected"),last_popup_menu=null,last_popup_button=null)}$j.ajaxSetup({cache:!1}),msie=$j.browser.msie,$j(".onoff input").each(function(){val=$j(this).val(),id=$j(this).attr("id"),$j("#"+id+"_onoff ."+(val==0?"on":"off")).addClass("hidden")}),$j(".onoff > a").click(function(e){e.preventDefault();var t=$j(this).siblings("input"),n=1-t.val(),r=t.attr("id");$j("#"+r+"_onoff ."+(n==0?"on":"off")).addClass("hidden"),$j("#"+r+"_onoff ."+(n==1?"on":"off")).removeClass("hidden"),t.val(n)}),setupFieldRichtext(),$j("a[rel^=#]").click(function(t){return e(t),menu=$j($j(this).attr("rel")),t.preventDefault(),t.stopPropagation(),menu.attr("popup")=="false"?!1:($j(this).parent().toggleClass("selected"),menu.slideToggle("fast"),menu.css("display")=="none"?(last_popup_menu=null,last_popup_button=null):(last_popup_menu=menu,last_popup_button=$j(this).parent()),!1)}),$j("html").click(function(t){e(t)}),$j("a.popupbox").fancybox({transitionIn:"none",transitionOut:"none"});var t=unescape($j("#nav-notifications-template[rel=template]").html()),n=unescape($j("<div>").append($j("#nav-notifications-see-all").clone()).html()),r=unescape($j("<div>").append($j("#nav-notifications-mark-all").clone()).html()),i=unescape($j("#nav-notifications-menu").html());$j("nav").bind("nav-update",function(e,s){var o=$j(s).find("invalid").text();o==1&&(window.location.href=window.location.href);var u=$j(s).find("net").text();u==0?(u="",$j("#net-update").removeClass("show")):$j("#net-update").addClass("show"),$j("#net-update").html(u);var a=$j(s).find("home").text();a==0?(a="",$j("#home-update").removeClass("show")):$j("#home-update").addClass("show"),$j("#home-update").html(a);var f=$j(s).find("intro").text();f==0?(f="",$j("#intro-update").removeClass("show")):$j("#intro-update").addClass("show"),$j("#intro-update").html(f);var l=$j(s).find("mail").text();l==0?(l="",$j("#mail-update").removeClass("show")):$j("#mail-update").addClass("show"),$j("#mail-update").html(l);var f=$j(s).find("intro").text();f==0?(f="",$j("#intro-update-li").removeClass("show")):$j("#intro-update-li").addClass("show"),$j("#intro-update-li").html(f);var l=$j(s).find("mail").text();l==0?(l="",$j("#mail-update-li").removeClass("show")):$j("#mail-update-li").addClass("show"),$j("#mail-update-li").html(l);var c=$j(s).find("notif");c.children("note").length==0?$j("#nav-notifications-menu").html(i):(nnm=$j("#nav-notifications-menu"),nnm.html(n+r),c.children("note").each(function(){e=$j(this),text=e.text().format("<span class='contactname'>"+e.attr("name")+"</span>"),html=t.format(e.attr("href"),e.attr("photo"),text,e.attr("date"),e.attr("seen")),nnm.append(html)})),notif=c.attr("count"),notif>0?$j("#nav-notifications-linkmenu").addClass("on"):$j("#nav-notifications-linkmenu").removeClass("on"),notif==0?(notif="",$j("#notify-update").removeClass("show")):$j("#notify-update").addClass("show"),$j("#notify-update").html(notif);var h=$j(s).find("sysmsgs");h.children("notice").each(function(){text=$j(this).text(),$j.jGrowl(text,{sticky:!1,theme:"notice",life:3e3})}),h.children("info").each(function(){text=$j(this).text(),$j.jGrowl(text,{sticky:!1,theme:"info",life:1e3})})}),NavUpdate(),$j(document).keydown(function(e){if(e.keyCode=="8"){var t=e.target||e.srcElement;if(!/input|textarea/i.test(t.nodeName))return!1}e.keyCode=="19"||e.ctrlKey&&e.which=="32"?(e.preventDefault(),stopped==0?(stopped=!0,e.ctrlKey&&(totStopped=!0),$j("#pause").html('<img src="images/pause.gif" alt="pause" style="border: 1px solid black;" />')):unpause()):totStopped||unpause()})});var lockvisible=!1;String.prototype.format=function(){var e=this;for(var t=0;t<arguments.length;t++){var n=new RegExp("\\{"+t+"\\}","gi");e=e.replace(n,arguments[t])}return e},Array.prototype.remove=function(e){to=undefined,from=this.indexOf(e);var t=this.slice((to||from)+1||this.length);return this.length=from<0?this.length+from:from,this.push.apply(this,t)};
\ No newline at end of file
+function openClose(e){document.getElementById(e).style.display=="block"?document.getElementById(e).style.display="none":document.getElementById(e).style.display="block"}function openMenu(e){document.getElementById(e).style.display="block"}function closeMenu(e){document.getElementById(e).style.display="none"}function NavUpdate(){if(!stopped){var e="ping"+(localUser!=0?"?f=&uid="+localUser:"");$j.get(e,function(e){$j(e).find("result").each(function(){$j("nav").trigger("nav-update",this),$j("#live-network").length&&(src="network",liveUpdate()),$j("#live-profile").length&&(src="profile",liveUpdate()),$j("#live-community").length&&(src="community",liveUpdate()),$j("#live-notes").length&&(src="notes",liveUpdate()),$j("#live-display").length&&(src="display",liveUpdate()),$j("#live-photos").length&&liking&&(liking=0,window.location.href=window.location.href)})})}timer=setTimeout(NavUpdate,updateInterval)}function liveUpdate(){if(src==null||stopped||!profile_uid){$j(".like-rotator").hide();return}if($j(".comment-edit-text-full").length||in_progress){livetime&&clearTimeout(livetime),livetime=setTimeout(liveUpdate,1e4);return}livetime!=null&&(livetime=null),prev="live-"+src,in_progress=!0;var e=netargs.length?"/"+netargs:"",t="update_"+src+e+"&p="+profile_uid+"&page="+profile_page+"&msie="+(msie?1:0);$j.get(t,function(e){in_progress=!1,$j(".toplevel_item",e).each(function(){var e=$j(this).attr("id");if($j("#"+e).length==0&&profile_page==1)$j("img",this).each(function(){$j(this).attr("src",$j(this).attr("dst"))}),$j("#"+prev).after($j(this));else{var t=$j(".hide-comments-total",this).attr("id");if(typeof t!="undefined"){t=t.split("-")[3];var n=$j("#collapsed-comments-"+t).is(":visible")}$j("img",this).each(function(){$j(this).attr("src",$j(this).attr("dst"))}),$j("html").height($j("html").height()),$j("#"+e).replaceWith($j(this)),typeof t!="undefined"&&n&&showHideComments(t),$j("html").height("auto")}prev=e}),$j(".like-rotator").hide(),commentBusy&&(commentBusy=!1,$j("body").css("cursor","auto")),$j(".comment-edit-form  textarea").contact_autocomplete(baseurl+"/acl");var t=$j(".wall-item-body > img").not(function(){return this.complete}),n=t.length;n?t.load(function(){n--,n||collapseHeight()}):collapseHeight()})}function collapseHeight(){$j(".wall-item-body").each(function(){$j(this).height()>410&&($j(this).hasClass("divmore")||($j(this).divgrow({initialHeight:400,showBrackets:!1,speed:300}),$j(this).addClass("divmore")))})}function imgbright(e){$j(e).removeClass("drophide").addClass("drop")}function imgdull(e){$j(e).removeClass("drop").addClass("drophide")}function dolike(e,t){unpause(),$j("#like-rotator-"+e.toString()).show(),$j.get("like/"+e.toString()+"?verb="+t,NavUpdate),liking=1}function dostar(e){e=e.toString(),$j.get("starred/"+e,function(t){t.match(/1/)?($j("#starred-"+e).addClass("starred"),$j("#starred-"+e).removeClass("unstarred"),$j("#star-"+e).addClass("hidden"),$j("#unstar-"+e).removeClass("hidden")):($j("#starred-"+e).addClass("unstarred"),$j("#starred-"+e).removeClass("starred"),$j("#star-"+e).removeClass("hidden"),$j("#unstar-"+e).addClass("hidden"))})}function getPosition(e){var t={x:0,y:0};if(e.pageX||e.pageY)t.x=e.pageX,t.y=e.pageY;else if(e.clientX||e.clientY)t.x=e.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)-document.documentElement.clientLeft,t.y=e.clientY+(document.documentElement.scrollTop||document.body.scrollTop)-document.documentElement.clientTop;else if(e.x||e.y)t.x=e.x,t.y=e.y;return t}function lockview(e,t){e=e||window.event,cursor=getPosition(e),lockvisible?lockviewhide():(lockvisible=!0,$j.get("lockview/"+t,function(e){$j("#panel").html(e),$j("#panel").css({left:cursor.x+5,top:cursor.y+5}),$j("#panel").show()}))}function lockviewhide(){lockvisible=!1,$j("#panel").hide()}function post_comment(e){return unpause(),commentBusy=!0,$j("body").css("cursor","wait"),$j("#comment-preview-inp-"+e).val("0"),$j.post("item",$j("#comment-edit-form-"+e).serialize(),function(t){if(t.success){$j("#comment-edit-wrapper-"+e).hide(),$j("#comment-edit-text-"+e).val("");var n=document.getElementById("comment-edit-text-"+e);n&&commentClose(n,e),timer&&clearTimeout(timer),timer=setTimeout(NavUpdate,10)}t.reload&&(window.location.href=t.reload)},"json"),!1}function preview_comment(e){return $j("#comment-preview-inp-"+e).val("1"),$j("#comment-edit-preview-"+e).show(),$j.post("item",$j("#comment-edit-form-"+e).serialize(),function(t){t.preview&&($j("#comment-edit-preview-"+e).html(t.preview),$j("#comment-edit-preview-"+e+" a").click(function(){return!1}))},"json"),!0}function showHideComments(e){$j("#collapsed-comments-"+e).is(":visible")?($j("#collapsed-comments-"+e).hide(),$j("#hide-comments-"+e).html(window.showMore)):($j("#collapsed-comments-"+e).show(),$j("#hide-comments-"+e).html(window.showFewer))}function preview_post(){return $j("#jot-preview").val("1"),$j("#jot-preview-content").show(),tinyMCE.triggerSave(),$j.post("item",$j("#profile-jot-form").serialize(),function(e){e.preview&&($j("#jot-preview-content").html(e.preview),$j("#jot-preview-content a").click(function(){return!1}))},"json"),$j("#jot-preview").val("0"),!0}function unpause(){totStopped=!1,stopped=!1,$j("#pause").html("")}function bin2hex(e){var t,n,r=0,i=[];e+="",r=e.length;for(n=0;n<r;n++)i[n]=e.charCodeAt(n).toString(16).replace(/^([\da-f])$/,"0$1");return i.join("")}function groupChangeMember(e,t,n){$j("body .fakelink").css("cursor","wait"),$j.get("group/"+e+"/"+t+"?t="+n,function(e){$j("#group-update-wrapper").html(e),$j("body .fakelink").css("cursor","auto")})}function profChangeMember(e,t){$j("body .fakelink").css("cursor","wait"),$j.get("profperm/"+e+"/"+t,function(e){$j("#prof-update-wrapper").html(e),$j("body .fakelink").css("cursor","auto")})}function contactgroupChangeMember(e,t){$j("body").css("cursor","wait"),$j.get("contactgroup/"+e+"/"+t,function(e){$j("body").css("cursor","auto")})}function checkboxhighlight(e){$j(e).is(":checked")?$j(e).addClass("checkeditem"):$j(e).removeClass("checkeditem")}function notifyMarkAll(){$j.get("notify/mark/all",function(e){timer&&clearTimeout(timer),timer=setTimeout(NavUpdate,1e3)})}function fcFileBrowser(e,t,n,r){var i=baseurl+"/fbrowser/"+n+"/";return tinyMCE.activeEditor.windowManager.open({file:i,title:"File Browser",width:420,height:400,resizable:"yes",inline:"yes",close_previous:"no"},{window:r,input:e}),!1}function setupFieldRichtext(){tinyMCE.init({theme:"advanced",mode:"specific_textareas",editor_selector:"fieldRichtext",plugins:"bbcode,paste, inlinepopups",theme_advanced_buttons1:"bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code",theme_advanced_buttons2:"",theme_advanced_buttons3:"",theme_advanced_toolbar_location:"top",theme_advanced_toolbar_align:"center",theme_advanced_blockformats:"blockquote,code",paste_text_sticky:!0,entity_encoding:"raw",add_unload_trigger:!1,remove_linebreaks:!1,force_p_newlines:!1,force_br_newlines:!0,forced_root_block:"",convert_urls:!1,content_css:baseurl+"/view/custom_tinymce.css",theme_advanced_path:!1,file_browser_callback:"fcFileBrowser"})}function previewTheme(e){theme=$j(e).val(),$j.getJSON("pretheme?f=&theme="+theme,function(e){$j("#theme-preview").html('<div id="theme-desc">'+e.desc+'</div><div id="theme-version">'+e.version+'</div><div id="theme-credits">'+e.credits+'</div><a href="'+e.img+'"><img src="'+e.img+'" width="320" height="240" alt="'+theme+'" /></a>')})}var src=null,prev=null,livetime=null,msie=!1,stopped=!1,totStopped=!1,timer=null,pr=0,liking=0,in_progress=!1,langSelect=!1,commentBusy=!1,last_popup_menu=null,last_popup_button=null;$j(function(){function e(e){last_popup_menu&&"#"+last_popup_menu.attr("id")!==$j(e.target).attr("rel")&&(last_popup_menu.hide(),last_popup_button.removeClass("selected"),last_popup_menu=null,last_popup_button=null)}$j.ajaxSetup({cache:!1}),msie=$j.browser.msie,$j(".onoff input").each(function(){val=$j(this).val(),id=$j(this).attr("id"),$j("#"+id+"_onoff ."+(val==0?"on":"off")).addClass("hidden")}),$j(".onoff > a").click(function(e){e.preventDefault();var t=$j(this).siblings("input"),n=1-t.val(),r=t.attr("id");$j("#"+r+"_onoff ."+(n==0?"on":"off")).addClass("hidden"),$j("#"+r+"_onoff ."+(n==1?"on":"off")).removeClass("hidden"),t.val(n)}),setupFieldRichtext(),$j("a[rel^=#]").click(function(t){return e(t),menu=$j($j(this).attr("rel")),t.preventDefault(),t.stopPropagation(),menu.attr("popup")=="false"?!1:($j(this).parent().toggleClass("selected"),menu.slideToggle("fast"),menu.css("display")=="none"?(last_popup_menu=null,last_popup_button=null):(last_popup_menu=menu,last_popup_button=$j(this).parent()),!1)}),$j("html").click(function(t){e(t)}),$j("a.popupbox").fancybox({transitionIn:"none",transitionOut:"none"});var t=unescape($j("#nav-notifications-template[rel=template]").html()),n=unescape($j("<div>").append($j("#nav-notifications-see-all").clone()).html()),r=unescape($j("<div>").append($j("#nav-notifications-mark-all").clone()).html()),i=unescape($j("#nav-notifications-menu").html());$j("nav").bind("nav-update",function(e,s){var o=$j(s).find("invalid").text();o==1&&(window.location.href=window.location.href);var u=$j(s).find("net").text();u==0?(u="",$j("#net-update").removeClass("show")):$j("#net-update").addClass("show"),$j("#net-update").html(u);var a=$j(s).find("home").text();a==0?(a="",$j("#home-update").removeClass("show")):$j("#home-update").addClass("show"),$j("#home-update").html(a);var f=$j(s).find("intro").text();f==0?(f="",$j("#intro-update").removeClass("show")):$j("#intro-update").addClass("show"),$j("#intro-update").html(f);var l=$j(s).find("mail").text();l==0?(l="",$j("#mail-update").removeClass("show")):$j("#mail-update").addClass("show"),$j("#mail-update").html(l);var f=$j(s).find("intro").text();f==0?(f="",$j("#intro-update-li").removeClass("show")):$j("#intro-update-li").addClass("show"),$j("#intro-update-li").html(f);var l=$j(s).find("mail").text();l==0?(l="",$j("#mail-update-li").removeClass("show")):$j("#mail-update-li").addClass("show"),$j("#mail-update-li").html(l);var c=$j(s).find("notif");c.children("note").length==0?$j("#nav-notifications-menu").html(i):(nnm=$j("#nav-notifications-menu"),nnm.html(n+r),c.children("note").each(function(){e=$j(this),text=e.text().format("<span class='contactname'>"+e.attr("name")+"</span>"),html=t.format(e.attr("href"),e.attr("photo"),text,e.attr("date"),e.attr("seen")),nnm.append(html)})),notif=c.attr("count"),notif>0?$j("#nav-notifications-linkmenu").addClass("on"):$j("#nav-notifications-linkmenu").removeClass("on"),notif==0?(notif="",$j("#notify-update").removeClass("show")):$j("#notify-update").addClass("show"),$j("#notify-update").html(notif);var h=$j(s).find("sysmsgs");h.children("notice").each(function(){text=$j(this).text(),$j.jGrowl(text,{sticky:!1,theme:"notice",life:3e3})}),h.children("info").each(function(){text=$j(this).text(),$j.jGrowl(text,{sticky:!1,theme:"info",life:1e3})})}),NavUpdate(),$j(document).keydown(function(e){if(e.keyCode=="8"){var t=e.target||e.srcElement;if(!/input|textarea/i.test(t.nodeName))return!1}e.keyCode=="19"||e.ctrlKey&&e.which=="32"?(e.preventDefault(),stopped==0?(stopped=!0,e.ctrlKey&&(totStopped=!0),$j("#pause").html('<img src="images/pause.gif" alt="pause" style="border: 1px solid black;" />')):unpause()):totStopped||unpause()})});var lockvisible=!1;String.prototype.format=function(){var e=this;for(var t=0;t<arguments.length;t++){var n=new RegExp("\\{"+t+"\\}","gi");e=e.replace(n,arguments[t])}return e},Array.prototype.remove=function(e){to=undefined,from=this.indexOf(e);var t=this.slice((to||from)+1||this.length);return this.length=from<0?this.length+from:from,this.push.apply(this,t)};
\ No newline at end of file
index 801b94e07f0858cb3c5b53323c1d2b304c2b3d26..197f85f1f0cbf52b5c2741b940456e1d0423fedd 100644 (file)
@@ -584,17 +584,6 @@ function qCommentInsert(obj,id) {
        $j(obj).val("");
 }
 
-function showHideComments(id) {
-       if( $j("#collapsed-comments-" + id).is(":visible")) {
-               $j("#collapsed-comments-" + id).hide();
-               $j("#hide-comments-" + id).html(window.showMore);
-       }
-       else {
-               $j("#collapsed-comments-" + id).show();
-               $j("#hide-comments-" + id).html(window.showFewer);
-       }
-}
-
 /*function showHideCommentBox(id) {
        if( $j('#comment-edit-form-' + id).is(':visible')) {
                $j('#comment-edit-form-' + id).hide();
index c04d99b5ab0ca6dfdde1d2a5f4779f2b43cc74ed..941671ae018ecad825938b870f560e53f47352d9 100644 (file)
@@ -1 +1 @@
-function showEvent(e){$j.get(baseurl+"/events/?id="+e,function(e){$j.fancybox(e)})}function initCrop(){function e(e,t){$("x1").value=e.x1,$("y1").value=e.y1,$("x2").value=e.x2,$("y2").value=e.y2,$("width").value=t.width,$("height").value=t.height}Event.observe(window,"load",function(){new Cropper.ImgWithPreview("croppa",{previewWrap:"previewWrap",minWidth:175,minHeight:175,maxWidth:640,maxHeight:640,ratioDim:{x:100,y:100},displayOnInit:!0,onEndCrop:e})})}function showNavMenu(e){window.navMenuTimeout[e+"-closing"]?(window.navMenuTimeout[e+"-closing"]=!1,clearTimeout(window.navMenuTimeout[e+"-timeout"])):(window.navMenuTimeout[e+"-opening"]=!0,window.navMenuTimeout[e+"-timeout"]=setTimeout(function(){$j(e).slideDown("fast").show(),window.navMenuTimeout[e+"-opening"]=!1},200))}function hideNavMenu(e){window.navMenuTimeout[e+"-opening"]?(window.navMenuTimeout[e+"-opening"]=!1,clearTimeout(window.navMenuTimeout[e+"-timeout"])):(window.navMenuTimeout[e+"-closing"]=!0,window.navMenuTimeout[e+"-timeout"]=setTimeout(function(){$j(e).slideUp("fast"),window.navMenuTimeout[e+"-closing"]=!1},500))}function insertFormatting(e,t,n){var r=$j("#comment-edit-text-"+n).val();r==e&&(r="",$j("#comment-edit-text-"+n).addClass("comment-edit-text-full"),$j("#comment-edit-text-"+n).removeClass("comment-edit-text-empty"),openMenu("comment-edit-submit-wrapper-"+n),$j("#comment-edit-text-"+n).val(r)),textarea=document.getElementById("comment-edit-text-"+n);if(document.selection)textarea.focus(),selected=document.selection.createRange(),t=="url"?selected.text="["+t+"]"+"http://"+selected.text+"[/"+t+"]":selected.text="["+t+"]"+selected.text+"[/"+t+"]";else if(textarea.selectionStart||textarea.selectionStart=="0"){var i=textarea.selectionStart,s=textarea.selectionEnd;t=="url"?textarea.value=textarea.value.substring(0,i)+"["+t+"]"+"http://"+textarea.value.substring(i,s)+"[/"+t+"]"+textarea.value.substring(s,textarea.value.length):textarea.value=textarea.value.substring(0,i)+"["+t+"]"+textarea.value.substring(i,s)+"[/"+t+"]"+textarea.value.substring(s,textarea.value.length)}return!0}function cmtBbOpen(e){$j("#comment-edit-bb-"+e).show()}function cmtBbClose(e){$j("#comment-edit-bb-"+e).hide()}function confirmDelete(){return confirm(window.delItem)}function commentOpen(e,t){e.value==window.commentEmptyText&&(e.value="",$j("#comment-edit-text-"+t).addClass("comment-edit-text-full"),$j("#comment-edit-text-"+t).removeClass("comment-edit-text-empty"),$j("#mod-cmnt-wrap-"+t).show(),openMenu("comment-edit-submit-wrapper-"+t))}function commentClose(e,t){e.value==""&&(e.value=window.commentEmptyText,$j("#comment-edit-text-"+t).removeClass("comment-edit-text-full"),$j("#comment-edit-text-"+t).addClass("comment-edit-text-empty"),$j("#mod-cmnt-wrap-"+t).hide(),closeMenu("comment-edit-submit-wrapper-"+t))}function commentInsert(e,t){var n=$j("#comment-edit-text-"+t).val();n==window.commentEmptyText&&(n="",$j("#comment-edit-text-"+t).addClass("comment-edit-text-full"),$j("#comment-edit-text-"+t).removeClass("comment-edit-text-empty"),openMenu("comment-edit-submit-wrapper-"+t));var r=$j(e).html();r=r.replace("&lt;","<"),r=r.replace("&gt;",">"),r=r.replace("&amp;","&"),r=r.replace("&quot;",'"'),$j("#comment-edit-text-"+t).val(n+r)}function qCommentInsert(e,t){var n=$j("#comment-edit-text-"+t).val();n==window.commentEmptyText&&(n="",$j("#comment-edit-text-"+t).addClass("comment-edit-text-full"),$j("#comment-edit-text-"+t).removeClass("comment-edit-text-empty"),openMenu("comment-edit-submit-wrapper-"+t));var r=$j(e).val();r=r.replace("&lt;","<"),r=r.replace("&gt;",">"),r=r.replace("&amp;","&"),r=r.replace("&quot;",'"'),$j("#comment-edit-text-"+t).val(n+r),$j(e).val("")}function showHideComments(e){$j("#collapsed-comments-"+e).is(":visible")?($j("#collapsed-comments-"+e).hide(),$j("#hide-comments-"+e).html(window.showMore)):($j("#collapsed-comments-"+e).show(),$j("#hide-comments-"+e).html(window.showFewer))}function enableOnUser(){if(editor)return;$j(this).val(""),initEditor()}function initEditor(e){if(editor==0){$j("#profile-jot-text-loading").show();if(plaintext=="none"){$j("#profile-jot-text-loading").hide(),$j("#profile-jot-text").css({height:200,color:"#000"}),$j("#profile-jot-text").contact_autocomplete(baseurl+"/acl"),editor=!0,$j("a#jot-perms-icon").fancybox({transitionIn:"elastic",transitionOut:"elastic"}),$j(".jothidden").show(),typeof e!="undefined"&&e();return}tinyMCE.init({theme:"advanced",mode:"specific_textareas",editor_selector:window.editSelect,auto_focus:"profile-jot-text",plugins:"bbcode,paste,autoresize, inlinepopups",theme_advanced_buttons1:"bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code",theme_advanced_buttons2:"",theme_advanced_buttons3:"",theme_advanced_toolbar_location:"top",theme_advanced_toolbar_align:"center",theme_advanced_blockformats:"blockquote,code",gecko_spellcheck:!0,paste_text_sticky:!0,entity_encoding:"raw",add_unload_trigger:!1,remove_linebreaks:!1,force_p_newlines:!1,force_br_newlines:!0,forced_root_block:"",convert_urls:!1,content_css:window.baseURL+"/view/custom_tinymce.css",theme_advanced_path:!1,file_browser_callback:"fcFileBrowser",setup:function(t){cPopup=null,t.onKeyDown.add(function(e,t){cPopup!==null&&cPopup.onkey(t)}),t.onKeyUp.add(function(e,t){var n=tinyMCE.activeEditor.getContent();match=n.match(/@([^ \n]+)$/),match!==null?(cPopup===null&&(cPopup=new ACPopup(this,baseurl+"/acl")),cPopup.ready&&match[1]!==cPopup.searchText&&cPopup.search(match[1]),cPopup.ready||(cPopup=null)):cPopup!==null&&(cPopup.close(),cPopup=null),textlen=n.length,textlen!=0&&$j("#jot-perms-icon").is(".unlock")?$j("#profile-jot-desc").html(ispublic):$j("#profile-jot-desc").html("&nbsp;"),textlen<=140&&($j("#character-counter").removeClass("red"),$j("#character-counter").removeClass("orange"),$j("#character-counter").addClass("grey")),textlen>140&&textlen<=420&&($j("#character-counter").removeClass("grey"),$j("#character-counter").removeClass("red"),$j("#character-counter").addClass("orange")),textlen>420&&($j("#character-counter").removeClass("grey"),$j("#character-counter").removeClass("orange"),$j("#character-counter").addClass("red")),$j("#character-counter").text(textlen)}),t.onInit.add(function(t){t.pasteAsPlainText=!0,$j("#profile-jot-text-loading").hide(),$j(".jothidden").show(),typeof e!="undefined"&&e()})}}),editor=!0,$j("a#jot-perms-icon").fancybox({transitionIn:"none",transitionOut:"none"})}else typeof e!="undefined"&&e()}function msgInitEditor(){plaintext!="none"?tinyMCE.init({theme:"advanced",mode:"specific_textareas",editor_selector:/(profile-jot-text|prvmail-text)/,plugins:"bbcode,paste",theme_advanced_buttons1:"bold,italic,underline,undo,redo,link,unlink,image,forecolor",theme_advanced_buttons2:"",theme_advanced_buttons3:"",theme_advanced_toolbar_location:"top",theme_advanced_toolbar_align:"center",theme_advanced_blockformats:"blockquote,code",gecko_spellcheck:!0,paste_text_sticky:!0,entity_encoding:"raw",add_unload_trigger:!1,remove_linebreaks:!1,force_p_newlines:!1,force_br_newlines:!0,forced_root_block:"",convert_urls:!1,content_css:baseurl+"/view/custom_tinymce.css",theme_advanced_path:!1,setup:function(e){e.onInit.add(function(e){e.pasteAsPlainText=!0;var t=e.editorId,n=$j("#"+t);typeof n.attr("tabindex")!="undefined"&&($j("#"+t+"_ifr").attr("tabindex",n.attr("tabindex")),n.attr("tabindex",null))})}}):$j("#prvmail-text").contact_autocomplete(baseurl+"/acl")}function profInitEditor(){tinyMCE.init({theme:"advanced",mode:window.editSelect,plugins:"bbcode,paste",theme_advanced_buttons1:"bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code",theme_advanced_buttons2:"",theme_advanced_buttons3:"",theme_advanced_toolbar_location:"top",theme_advanced_toolbar_align:"center",theme_advanced_blockformats:"blockquote,code",gecko_spellcheck:!0,paste_text_sticky:!0,entity_encoding:"raw",add_unload_trigger:!1,remove_linebreaks:!1,force_p_newlines:!1,force_br_newlines:!0,forced_root_block:"",content_css:baseurl+"/view/custom_tinymce.css",theme_advanced_path:!1,setup:function(e){e.onInit.add(function(e){e.pasteAsPlainText=!0})}})}function eventInitEditor(){tinyMCE.init({theme:"advanced",mode:"textareas",plugins:"bbcode,paste",theme_advanced_buttons1:"bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code",theme_advanced_buttons2:"",theme_advanced_buttons3:"",theme_advanced_toolbar_location:"top",theme_advanced_toolbar_align:"center",theme_advanced_blockformats:"blockquote,code",gecko_spellcheck:!0,paste_text_sticky:!0,entity_encoding:"raw",add_unload_trigger:!1,remove_linebreaks:!1,force_p_newlines:!1,force_br_newlines:!0,forced_root_block:"",content_css:baseurl+"/view/custom_tinymce.css",theme_advanced_path:!1,setup:function(e){e.onInit.add(function(e){e.pasteAsPlainText=!0})}})}function contactInitEditor(){tinyMCE.init({theme:"advanced",mode:window.editSelect,elements:"contact-edit-info",plugins:"bbcode",theme_advanced_buttons1:"bold,italic,underline,undo,redo,link,unlink,image,forecolor",theme_advanced_buttons2:"",theme_advanced_buttons3:"",theme_advanced_toolbar_location:"top",theme_advanced_toolbar_align:"center",theme_advanced_styles:"blockquote,code",gecko_spellcheck:!0,entity_encoding:"raw",add_unload_trigger:!1,remove_linebreaks:!1,force_p_newlines:!1,force_br_newlines:!0,forced_root_block:"",content_css:baseurl+"/view/custom_tinymce.css"})}function wallInitEditor(){var e=window.editSelect;e!="none"?tinyMCE.init({theme:"advanced",mode:"specific_textareas",editor_selector:/(profile-jot-text|prvmail-text)/,plugins:"bbcode,paste",theme_advanced_buttons1:"bold,italic,underline,undo,redo,link,unlink,image,forecolor",theme_advanced_buttons2:"",theme_advanced_buttons3:"",theme_advanced_toolbar_location:"top",theme_advanced_toolbar_align:"center",theme_advanced_blockformats:"blockquote,code",gecko_spellcheck:!0,paste_text_sticky:!0,entity_encoding:"raw",add_unload_trigger:!1,remove_linebreaks:!1,force_p_newlines:!1,force_br_newlines:!0,forced_root_block:"",convert_urls:!1,content_css:baseurl+"/view/custom_tinymce.css",theme_advanced_path:!1,setup:function(e){e.onInit.add(function(e){e.pasteAsPlainText=!0;var t=e.editorId,n=$j("#"+t);typeof n.attr("tabindex")!="undefined"&&($j("#"+t+"_ifr").attr("tabindex",n.attr("tabindex")),n.attr("tabindex",null))})}}):$j("#prvmail-text").contact_autocomplete(baseurl+"/acl")}function deleteCheckedItems(){var e="";$j(".item-select").each(function(){$j(this).is(":checked")&&(e.length!=0?e=e+","+$j(this).val():e=$j(this).val())}),$j.post("item",{dropitems:e},function(e){window.location.reload()})}function jotVideoURL(){reply=prompt(window.vidURL),reply&&reply.length&&addeditortext("[video]"+reply+"[/video]")}function jotAudioURL(){reply=prompt(window.audURL),reply&&reply.length&&addeditortext("[audio]"+reply+"[/audio]")}function jotGetLocation(){reply=prompt(window.whereAreU,$j("#jot-location").val()),reply&&reply.length&&$j("#jot-location").val(reply)}function jotShare(e){$j("#jot-popup").length!=0&&$j("#jot-popup").show(),$j("#like-rotator-"+e).show(),$j.get("share/"+e,function(t){editor||$j("#profile-jot-text").val(""),initEditor(function(){addeditortext(t),$j("#like-rotator-"+e).hide(),$j(window).scrollTop(0)})})}function linkdropper(e){var t=e.dataTransfer.types.contains("text/uri-list");t&&e.preventDefault()}function itemTag(e){reply=prompt(window.term),reply&&reply.length&&(reply=reply.replace("#",""),reply.length&&(commentBusy=!0,$j("body").css("cursor","wait"),$j.get("tagger/"+e+"?term="+reply,NavUpdate),liking=1))}function itemFiler(e){var t=$j("input").css("border-color");$j.get("filer/",function(n){$j.fancybox(n),$j("#id_term").keypress(function(){$j(this).css("border-color",t)}),$j("#select_term").change(function(){$j("#id_term").css("border-color",t)}),$j("#filer_save").click(function(t){return t.preventDefault(),reply=$j("#id_term").val(),reply&&reply.length?(commentBusy=!0,$j("body").css("cursor","wait"),$j.get("filer/"+e+"?term="+reply,NavUpdate),liking=1,$j.fancybox.close()):$j("#id_term").css("border-color","#FF0000"),!1})})}function jotClearLocation(){$j("#jot-coord").val(""),$j("#profile-nolocation-wrapper").hide()}function addeditortext(e){if(plaintext=="none"){var t=$j("#profile-jot-text").val();$j("#profile-jot-text").val(t+e)}else tinyMCE.execCommand("mceInsertRawHTML",!1,e)}$j(document).ready(function(){window.navMenuTimeout={"#network-menu-list-timeout":null,"#contacts-menu-list-timeout":null,"#system-menu-list-timeout":null,"#network-menu-list-opening":!1,"#contacts-menu-list-opening":!1,"#system-menu-list-opening":!1,"#network-menu-list-closing":!1,"#contacts-menu-list-closing":!1,"#system-menu-list-closing":!1},typeof window.aclInit!="undefined"&&typeof acl=="undefined"&&(acl=new ACL(baseurl+"/acl",[window.allowCID,window.allowGID,window.denyCID,window.denyGID])),$j("#profile-jot-text").focus(enableOnUser),$j("#profile-jot-text").click(enableOnUser),$j(".nav-menu-link").hover(function(){showNavMenu($j(this).attr("rel"))},function(){hideNavMenu($j(this).attr("rel"))}),$j(".group-edit-icon").hover(function(){$j(this).addClass("icon"),$j(this).removeClass("iconspacer")},function(){$j(this).removeClass("icon"),$j(this).addClass("iconspacer")}),$j(".sidebar-group-element").hover(function(){id=$j(this).attr("id"),$j("#edit-"+id).addClass("icon"),$j("#edit-"+id).removeClass("iconspacer")},function(){id=$j(this).attr("id"),$j("#edit-"+id).removeClass("icon"),$j("#edit-"+id).addClass("iconspacer")}),$j(".savedsearchdrop").hover(function(){$j(this).addClass("drop"),$j(this).addClass("icon"),$j(this).removeClass("iconspacer")},function(){$j(this).removeClass("drop"),$j(this).removeClass("icon"),$j(this).addClass("iconspacer")}),$j(".savedsearchterm").hover(function(){id=$j(this).attr("id"),$j("#drop-"+id).addClass("icon"),$j("#drop-"+id).addClass("drophide"),$j("#drop-"+id).removeClass("iconspacer")},function(){id=$j(this).attr("id"),$j("#drop-"+id).removeClass("icon"),$j("#drop-"+id).removeClass("drophide"),$j("#drop-"+id).addClass("iconspacer")}),window.autoCompleteType=="display-head"&&$j(".comment-wwedit-wrapper textarea").contact_autocomplete(baseurl+"/acl");if(window.aclType=="event_head"){$j("#events-calendar").fullCalendar({events:baseurl+"/events/json/",header:{left:"prev,next today",center:"title",right:"month,agendaWeek,agendaDay"},timeFormat:"H(:mm)",eventClick:function(e,t,n){showEvent(e.id)},eventRender:function(e,t,n){if(e.item["author-name"]==null)return;switch(n.name){case"month":t.find(".fc-event-title").html("<img src='{0}' style='height:10px;width:10px'>{1} : {2}".format(e.item["author-avatar"],e.item["author-name"],e.title));break;case"agendaWeek":t.find(".fc-event-title").html("<img src='{0}' style='height:12px; width:12px'>{1}<p>{2}</p><p>{3}</p>".format(e.item["author-avatar"],e.item["author-name"],e.item.desc,e.item.location));break;case"agendaDay":t.find(".fc-event-title").html("<img src='{0}' style='height:24px;width:24px'>{1}<p>{2}</p><p>{3}</p>".format(e.item["author-avatar"],e.item["author-name"],e.item.desc,e.item.location))}}});var e=location.href.replace(baseurl,"").split("/");e.length>=4&&$j("#events-calendar").fullCalendar("gotoDate",e[2],e[3]-1);var t=location.hash.split("-");t.length==2&&t[0]=="#link"&&showEvent(t[1])}$j("#event-share-checkbox").change(function(){$j("#event-share-checkbox").is(":checked")?$j("#acl-wrapper").show():$j("#acl-wrapper").hide()}).trigger("change"),(window.aclType=="settings-head"||window.aclType=="photos_head"||window.aclType=="event_head")&&$j("#contact_allow, #contact_deny, #group_allow, #group_deny").change(function(){var e;$j("#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected").each(function(){e=$j(this).text(),$j("#jot-perms-icon").removeClass("unlock").addClass("lock"),$j("#jot-public").hide()}),e==null&&($j("#jot-perms-icon").removeClass("lock").addClass("unlock"),$j("#jot-public").show())}).trigger("change");switch(window.autocompleteType){case"msg-header":var n=$j("#recip").autocomplete({serviceUrl:baseurl+"/acl",minChars:2,width:350,onSelect:function(e,t){$j("#recip-complete").val(t)}});break;case"contacts-head":var n=$j("#contacts-search").autocomplete({serviceUrl:baseurl+"/acl",minChars:2,width:350});n.setOptions({params:{type:"a"}});break;default:}if(typeof window.AjaxUpload!="undefined")switch(window.ajaxType){case"jot-header":var r=new window.AjaxUpload("wall-image-upload",{action:"wall_upload/"+window.nickname,name:"userfile",onSubmit:function(e,t){$j("#profile-rotator").show()},onComplete:function(e,t){addeditortext(t),$j("#profile-rotator").hide()}}),i=new window.AjaxUpload("wall-file-upload",{action:"wall_attach/"+window.nickname,name:"userfile",onSubmit:function(e,t){$j("#profile-rotator").show()},onComplete:function(e,t){addeditortext(t),$j("#profile-rotator").hide()}});break;case"msg-header":var r=new window.AjaxUpload("prvmail-upload",{action:"wall_upload/"+window.nickname,name:"userfile",onSubmit:function(e,t){$j("#profile-rotator").show()},onComplete:function(e,t){tinyMCE.execCommand("mceInsertRawHTML",!1,t),$j("#profile-rotator").hide()}});break;default:}}),$j(function(){$j("nav").bind("nav-update",function(e,t){var n=$j("#pending-update"),r=$j(t).find("register").text();r=="0"?(r="",n.hide()):n.show(),n.html(r)})}),$j(function(){$j("#cnftheme").fancybox({width:800,autoDimensions:!1,onStart:function(){var e=$j("#id_theme :selected").val(),t=$j("#id_theme_mobile :selected").val();$j("#cnftheme").attr("href",baseurl+"/admin/themes/"+e)},onComplete:function(){$j("div#fancybox-content form").submit(function(e){var t=$j(this).attr("action"),n={};return $j(this).find("input").each(function(){n[$j(this).attr("name")]=$j(this).val()}),$j(this).find("select").each(function(){n[$j(this).attr("name")]=$j(this).children(":selected").val()}),console.log(":)",t,n),$j.post(t,n,function(e){timer&&clearTimeout(timer),NavUpdate(),$j.fancybox.close()}),!1})}})}),typeof window.photoEdit!="undefined"&&$j(document).keydown(function(e){window.prevLink!=""&&e.ctrlKey&&e.keyCode==37&&(e.preventDefault(),window.location.href=window.prevLink),window.nextLink!=""&&e.ctrlKey&&e.keyCode==39&&(e.preventDefault(),window.location.href=window.nextLink)});switch(window.ajaxType){case"jot-header":function jotGetLink(){reply=prompt(window.linkURL),reply&&reply.length&&(reply=bin2hex(reply),$j("#profile-rotator").show(),$j.get("parse_url?binurl="+reply,function(e){addeditortext(e),$j("#profile-rotator").hide()}))}function linkdrop(e){var t=e.dataTransfer.getData("text/uri-list");e.target.textContent=t,e.preventDefault(),t&&t.length&&(t=bin2hex(t),$j("#profile-rotator").show(),$j.get("parse_url?binurl="+t,function(e){editor||$j("#profile-jot-text").val(""),initEditor(function(){addeditortext(e),$j("#profile-rotator").hide()})}))}break;case"msg-header":case"wallmsg-header":function jotGetLink(){reply=prompt(window.linkURL),reply&&reply.length&&($j("#profile-rotator").show(),$j.get("parse_url?url="+reply,function(e){tinyMCE.execCommand("mceInsertRawHTML",!1,e),$j("#profile-rotator").hide()}))}function linkdrop(e){var t=e.dataTransfer.getData("text/uri-list");e.target.textContent=t,e.preventDefault(),t&&t.length&&($j("#profile-rotator").show(),$j.get("parse_url?url="+t,function(e){tinyMCE.execCommand("mceInsertRawHTML",!1,e),$j("#profile-rotator").hide()}))}break;default:}var editor=!1,textlen=0,plaintext=window.editSelect,ispublic=window.isPublic;typeof window.geoTag=="function"&&window.geoTag();
\ No newline at end of file
+function showEvent(e){$j.get(baseurl+"/events/?id="+e,function(e){$j.fancybox(e)})}function initCrop(){function e(e,t){$("x1").value=e.x1,$("y1").value=e.y1,$("x2").value=e.x2,$("y2").value=e.y2,$("width").value=t.width,$("height").value=t.height}Event.observe(window,"load",function(){new Cropper.ImgWithPreview("croppa",{previewWrap:"previewWrap",minWidth:175,minHeight:175,maxWidth:640,maxHeight:640,ratioDim:{x:100,y:100},displayOnInit:!0,onEndCrop:e})})}function showNavMenu(e){window.navMenuTimeout[e+"-closing"]?(window.navMenuTimeout[e+"-closing"]=!1,clearTimeout(window.navMenuTimeout[e+"-timeout"])):(window.navMenuTimeout[e+"-opening"]=!0,window.navMenuTimeout[e+"-timeout"]=setTimeout(function(){$j(e).slideDown("fast").show(),window.navMenuTimeout[e+"-opening"]=!1},200))}function hideNavMenu(e){window.navMenuTimeout[e+"-opening"]?(window.navMenuTimeout[e+"-opening"]=!1,clearTimeout(window.navMenuTimeout[e+"-timeout"])):(window.navMenuTimeout[e+"-closing"]=!0,window.navMenuTimeout[e+"-timeout"]=setTimeout(function(){$j(e).slideUp("fast"),window.navMenuTimeout[e+"-closing"]=!1},500))}function insertFormatting(e,t,n){var r=$j("#comment-edit-text-"+n).val();r==e&&(r="",$j("#comment-edit-text-"+n).addClass("comment-edit-text-full"),$j("#comment-edit-text-"+n).removeClass("comment-edit-text-empty"),openMenu("comment-edit-submit-wrapper-"+n),$j("#comment-edit-text-"+n).val(r)),textarea=document.getElementById("comment-edit-text-"+n);if(document.selection)textarea.focus(),selected=document.selection.createRange(),t=="url"?selected.text="["+t+"]"+"http://"+selected.text+"[/"+t+"]":selected.text="["+t+"]"+selected.text+"[/"+t+"]";else if(textarea.selectionStart||textarea.selectionStart=="0"){var i=textarea.selectionStart,s=textarea.selectionEnd;t=="url"?textarea.value=textarea.value.substring(0,i)+"["+t+"]"+"http://"+textarea.value.substring(i,s)+"[/"+t+"]"+textarea.value.substring(s,textarea.value.length):textarea.value=textarea.value.substring(0,i)+"["+t+"]"+textarea.value.substring(i,s)+"[/"+t+"]"+textarea.value.substring(s,textarea.value.length)}return!0}function cmtBbOpen(e){$j("#comment-edit-bb-"+e).show()}function cmtBbClose(e){$j("#comment-edit-bb-"+e).hide()}function confirmDelete(){return confirm(window.delItem)}function commentOpen(e,t){e.value==window.commentEmptyText&&(e.value="",$j("#comment-edit-text-"+t).addClass("comment-edit-text-full"),$j("#comment-edit-text-"+t).removeClass("comment-edit-text-empty"),$j("#mod-cmnt-wrap-"+t).show(),openMenu("comment-edit-submit-wrapper-"+t))}function commentClose(e,t){e.value==""&&(e.value=window.commentEmptyText,$j("#comment-edit-text-"+t).removeClass("comment-edit-text-full"),$j("#comment-edit-text-"+t).addClass("comment-edit-text-empty"),$j("#mod-cmnt-wrap-"+t).hide(),closeMenu("comment-edit-submit-wrapper-"+t))}function commentInsert(e,t){var n=$j("#comment-edit-text-"+t).val();n==window.commentEmptyText&&(n="",$j("#comment-edit-text-"+t).addClass("comment-edit-text-full"),$j("#comment-edit-text-"+t).removeClass("comment-edit-text-empty"),openMenu("comment-edit-submit-wrapper-"+t));var r=$j(e).html();r=r.replace("&lt;","<"),r=r.replace("&gt;",">"),r=r.replace("&amp;","&"),r=r.replace("&quot;",'"'),$j("#comment-edit-text-"+t).val(n+r)}function qCommentInsert(e,t){var n=$j("#comment-edit-text-"+t).val();n==window.commentEmptyText&&(n="",$j("#comment-edit-text-"+t).addClass("comment-edit-text-full"),$j("#comment-edit-text-"+t).removeClass("comment-edit-text-empty"),openMenu("comment-edit-submit-wrapper-"+t));var r=$j(e).val();r=r.replace("&lt;","<"),r=r.replace("&gt;",">"),r=r.replace("&amp;","&"),r=r.replace("&quot;",'"'),$j("#comment-edit-text-"+t).val(n+r),$j(e).val("")}function enableOnUser(){if(editor)return;$j(this).val(""),initEditor()}function initEditor(e){if(editor==0){$j("#profile-jot-text-loading").show();if(plaintext=="none"){$j("#profile-jot-text-loading").hide(),$j("#profile-jot-text").css({height:200,color:"#000"}),$j("#profile-jot-text").contact_autocomplete(baseurl+"/acl"),editor=!0,$j("a#jot-perms-icon").fancybox({transitionIn:"elastic",transitionOut:"elastic"}),$j(".jothidden").show(),typeof e!="undefined"&&e();return}tinyMCE.init({theme:"advanced",mode:"specific_textareas",editor_selector:window.editSelect,auto_focus:"profile-jot-text",plugins:"bbcode,paste,autoresize, inlinepopups",theme_advanced_buttons1:"bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code",theme_advanced_buttons2:"",theme_advanced_buttons3:"",theme_advanced_toolbar_location:"top",theme_advanced_toolbar_align:"center",theme_advanced_blockformats:"blockquote,code",gecko_spellcheck:!0,paste_text_sticky:!0,entity_encoding:"raw",add_unload_trigger:!1,remove_linebreaks:!1,force_p_newlines:!1,force_br_newlines:!0,forced_root_block:"",convert_urls:!1,content_css:window.baseURL+"/view/custom_tinymce.css",theme_advanced_path:!1,file_browser_callback:"fcFileBrowser",setup:function(t){cPopup=null,t.onKeyDown.add(function(e,t){cPopup!==null&&cPopup.onkey(t)}),t.onKeyUp.add(function(e,t){var n=tinyMCE.activeEditor.getContent();match=n.match(/@([^ \n]+)$/),match!==null?(cPopup===null&&(cPopup=new ACPopup(this,baseurl+"/acl")),cPopup.ready&&match[1]!==cPopup.searchText&&cPopup.search(match[1]),cPopup.ready||(cPopup=null)):cPopup!==null&&(cPopup.close(),cPopup=null),textlen=n.length,textlen!=0&&$j("#jot-perms-icon").is(".unlock")?$j("#profile-jot-desc").html(ispublic):$j("#profile-jot-desc").html("&nbsp;"),textlen<=140&&($j("#character-counter").removeClass("red"),$j("#character-counter").removeClass("orange"),$j("#character-counter").addClass("grey")),textlen>140&&textlen<=420&&($j("#character-counter").removeClass("grey"),$j("#character-counter").removeClass("red"),$j("#character-counter").addClass("orange")),textlen>420&&($j("#character-counter").removeClass("grey"),$j("#character-counter").removeClass("orange"),$j("#character-counter").addClass("red")),$j("#character-counter").text(textlen)}),t.onInit.add(function(t){t.pasteAsPlainText=!0,$j("#profile-jot-text-loading").hide(),$j(".jothidden").show(),typeof e!="undefined"&&e()})}}),editor=!0,$j("a#jot-perms-icon").fancybox({transitionIn:"none",transitionOut:"none"})}else typeof e!="undefined"&&e()}function msgInitEditor(){plaintext!="none"?tinyMCE.init({theme:"advanced",mode:"specific_textareas",editor_selector:/(profile-jot-text|prvmail-text)/,plugins:"bbcode,paste",theme_advanced_buttons1:"bold,italic,underline,undo,redo,link,unlink,image,forecolor",theme_advanced_buttons2:"",theme_advanced_buttons3:"",theme_advanced_toolbar_location:"top",theme_advanced_toolbar_align:"center",theme_advanced_blockformats:"blockquote,code",gecko_spellcheck:!0,paste_text_sticky:!0,entity_encoding:"raw",add_unload_trigger:!1,remove_linebreaks:!1,force_p_newlines:!1,force_br_newlines:!0,forced_root_block:"",convert_urls:!1,content_css:baseurl+"/view/custom_tinymce.css",theme_advanced_path:!1,setup:function(e){e.onInit.add(function(e){e.pasteAsPlainText=!0;var t=e.editorId,n=$j("#"+t);typeof n.attr("tabindex")!="undefined"&&($j("#"+t+"_ifr").attr("tabindex",n.attr("tabindex")),n.attr("tabindex",null))})}}):$j("#prvmail-text").contact_autocomplete(baseurl+"/acl")}function profInitEditor(){tinyMCE.init({theme:"advanced",mode:window.editSelect,plugins:"bbcode,paste",theme_advanced_buttons1:"bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code",theme_advanced_buttons2:"",theme_advanced_buttons3:"",theme_advanced_toolbar_location:"top",theme_advanced_toolbar_align:"center",theme_advanced_blockformats:"blockquote,code",gecko_spellcheck:!0,paste_text_sticky:!0,entity_encoding:"raw",add_unload_trigger:!1,remove_linebreaks:!1,force_p_newlines:!1,force_br_newlines:!0,forced_root_block:"",content_css:baseurl+"/view/custom_tinymce.css",theme_advanced_path:!1,setup:function(e){e.onInit.add(function(e){e.pasteAsPlainText=!0})}})}function eventInitEditor(){tinyMCE.init({theme:"advanced",mode:"textareas",plugins:"bbcode,paste",theme_advanced_buttons1:"bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code",theme_advanced_buttons2:"",theme_advanced_buttons3:"",theme_advanced_toolbar_location:"top",theme_advanced_toolbar_align:"center",theme_advanced_blockformats:"blockquote,code",gecko_spellcheck:!0,paste_text_sticky:!0,entity_encoding:"raw",add_unload_trigger:!1,remove_linebreaks:!1,force_p_newlines:!1,force_br_newlines:!0,forced_root_block:"",content_css:baseurl+"/view/custom_tinymce.css",theme_advanced_path:!1,setup:function(e){e.onInit.add(function(e){e.pasteAsPlainText=!0})}})}function contactInitEditor(){tinyMCE.init({theme:"advanced",mode:window.editSelect,elements:"contact-edit-info",plugins:"bbcode",theme_advanced_buttons1:"bold,italic,underline,undo,redo,link,unlink,image,forecolor",theme_advanced_buttons2:"",theme_advanced_buttons3:"",theme_advanced_toolbar_location:"top",theme_advanced_toolbar_align:"center",theme_advanced_styles:"blockquote,code",gecko_spellcheck:!0,entity_encoding:"raw",add_unload_trigger:!1,remove_linebreaks:!1,force_p_newlines:!1,force_br_newlines:!0,forced_root_block:"",content_css:baseurl+"/view/custom_tinymce.css"})}function wallInitEditor(){var e=window.editSelect;e!="none"?tinyMCE.init({theme:"advanced",mode:"specific_textareas",editor_selector:/(profile-jot-text|prvmail-text)/,plugins:"bbcode,paste",theme_advanced_buttons1:"bold,italic,underline,undo,redo,link,unlink,image,forecolor",theme_advanced_buttons2:"",theme_advanced_buttons3:"",theme_advanced_toolbar_location:"top",theme_advanced_toolbar_align:"center",theme_advanced_blockformats:"blockquote,code",gecko_spellcheck:!0,paste_text_sticky:!0,entity_encoding:"raw",add_unload_trigger:!1,remove_linebreaks:!1,force_p_newlines:!1,force_br_newlines:!0,forced_root_block:"",convert_urls:!1,content_css:baseurl+"/view/custom_tinymce.css",theme_advanced_path:!1,setup:function(e){e.onInit.add(function(e){e.pasteAsPlainText=!0;var t=e.editorId,n=$j("#"+t);typeof n.attr("tabindex")!="undefined"&&($j("#"+t+"_ifr").attr("tabindex",n.attr("tabindex")),n.attr("tabindex",null))})}}):$j("#prvmail-text").contact_autocomplete(baseurl+"/acl")}function deleteCheckedItems(e){if(confirm(window.delItems)){var t="";$j(e).hide(),$j(e+"-rotator").show(),$j(".item-select").each(function(){$j(this).is(":checked")&&(t.length!=0?t=t+","+$j(this).val():t=$j(this).val())}),$j.post("item",{dropitems:t},function(e){window.location.reload()})}}function jotVideoURL(){reply=prompt(window.vidURL),reply&&reply.length&&addeditortext("[video]"+reply+"[/video]")}function jotAudioURL(){reply=prompt(window.audURL),reply&&reply.length&&addeditortext("[audio]"+reply+"[/audio]")}function jotGetLocation(){reply=prompt(window.whereAreU,$j("#jot-location").val()),reply&&reply.length&&$j("#jot-location").val(reply)}function jotShare(e){$j("#jot-popup").length!=0&&$j("#jot-popup").show(),$j("#like-rotator-"+e).show(),$j.get("share/"+e,function(t){editor||$j("#profile-jot-text").val(""),initEditor(function(){addeditortext(t),$j("#like-rotator-"+e).hide(),$j(window).scrollTop(0)})})}function linkdropper(e){var t=e.dataTransfer.types.contains("text/uri-list");t&&e.preventDefault()}function itemTag(e){reply=prompt(window.term),reply&&reply.length&&(reply=reply.replace("#",""),reply.length&&(commentBusy=!0,$j("body").css("cursor","wait"),$j.get("tagger/"+e+"?term="+reply,NavUpdate),liking=1))}function itemFiler(e){var t=$j("input").css("border-color");$j.get("filer/",function(n){$j.fancybox(n),$j("#id_term").keypress(function(){$j(this).css("border-color",t)}),$j("#select_term").change(function(){$j("#id_term").css("border-color",t)}),$j("#filer_save").click(function(t){return t.preventDefault(),reply=$j("#id_term").val(),reply&&reply.length?(commentBusy=!0,$j("body").css("cursor","wait"),$j.get("filer/"+e+"?term="+reply,NavUpdate),liking=1,$j.fancybox.close()):$j("#id_term").css("border-color","#FF0000"),!1})})}function jotClearLocation(){$j("#jot-coord").val(""),$j("#profile-nolocation-wrapper").hide()}function addeditortext(e){if(plaintext=="none"){var t=$j("#profile-jot-text").val();$j("#profile-jot-text").val(t+e)}else tinyMCE.execCommand("mceInsertRawHTML",!1,e)}$j(document).ready(function(){window.navMenuTimeout={"#network-menu-list-timeout":null,"#contacts-menu-list-timeout":null,"#system-menu-list-timeout":null,"#network-menu-list-opening":!1,"#contacts-menu-list-opening":!1,"#system-menu-list-opening":!1,"#network-menu-list-closing":!1,"#contacts-menu-list-closing":!1,"#system-menu-list-closing":!1},typeof window.aclInit!="undefined"&&typeof acl=="undefined"&&(acl=new ACL(baseurl+"/acl",[window.allowCID,window.allowGID,window.denyCID,window.denyGID])),$j("#profile-jot-text").focus(enableOnUser),$j("#profile-jot-text").click(enableOnUser),$j(".nav-menu-link").hover(function(){showNavMenu($j(this).attr("rel"))},function(){hideNavMenu($j(this).attr("rel"))}),$j(".group-edit-icon").hover(function(){$j(this).addClass("icon"),$j(this).removeClass("iconspacer")},function(){$j(this).removeClass("icon"),$j(this).addClass("iconspacer")}),$j(".sidebar-group-element").hover(function(){id=$j(this).attr("id"),$j("#edit-"+id).addClass("icon"),$j("#edit-"+id).removeClass("iconspacer")},function(){id=$j(this).attr("id"),$j("#edit-"+id).removeClass("icon"),$j("#edit-"+id).addClass("iconspacer")}),$j(".savedsearchdrop").hover(function(){$j(this).addClass("drop"),$j(this).addClass("icon"),$j(this).removeClass("iconspacer")},function(){$j(this).removeClass("drop"),$j(this).removeClass("icon"),$j(this).addClass("iconspacer")}),$j(".savedsearchterm").hover(function(){id=$j(this).attr("id"),$j("#drop-"+id).addClass("icon"),$j("#drop-"+id).addClass("drophide"),$j("#drop-"+id).removeClass("iconspacer")},function(){id=$j(this).attr("id"),$j("#drop-"+id).removeClass("icon"),$j("#drop-"+id).removeClass("drophide"),$j("#drop-"+id).addClass("iconspacer")}),window.autoCompleteType=="display-head"&&$j(".comment-wwedit-wrapper textarea").contact_autocomplete(baseurl+"/acl");if(window.aclType=="event_head"){$j("#events-calendar").fullCalendar({events:baseurl+"/events/json/",header:{left:"prev,next today",center:"title",right:"month,agendaWeek,agendaDay"},timeFormat:"H(:mm)",eventClick:function(e,t,n){showEvent(e.id)},eventRender:function(e,t,n){if(e.item["author-name"]==null)return;switch(n.name){case"month":t.find(".fc-event-title").html("<img src='{0}' style='height:10px;width:10px'>{1} : {2}".format(e.item["author-avatar"],e.item["author-name"],e.title));break;case"agendaWeek":t.find(".fc-event-title").html("<img src='{0}' style='height:12px; width:12px'>{1}<p>{2}</p><p>{3}</p>".format(e.item["author-avatar"],e.item["author-name"],e.item.desc,e.item.location));break;case"agendaDay":t.find(".fc-event-title").html("<img src='{0}' style='height:24px;width:24px'>{1}<p>{2}</p><p>{3}</p>".format(e.item["author-avatar"],e.item["author-name"],e.item.desc,e.item.location))}}});var e=location.href.replace(baseurl,"").split("/");e.length>=4&&$j("#events-calendar").fullCalendar("gotoDate",e[2],e[3]-1);var t=location.hash.split("-");t.length==2&&t[0]=="#link"&&showEvent(t[1])}$j("#event-share-checkbox").change(function(){$j("#event-share-checkbox").is(":checked")?$j("#acl-wrapper").show():$j("#acl-wrapper").hide()}).trigger("change"),(window.aclType=="settings-head"||window.aclType=="photos_head"||window.aclType=="event_head")&&$j("#contact_allow, #contact_deny, #group_allow, #group_deny").change(function(){var e;$j("#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected").each(function(){e=$j(this).text(),$j("#jot-perms-icon").removeClass("unlock").addClass("lock"),$j("#jot-public").hide()}),e==null&&($j("#jot-perms-icon").removeClass("lock").addClass("unlock"),$j("#jot-public").show())}).trigger("change");switch(window.autocompleteType){case"msg-header":var n=$j("#recip").autocomplete({serviceUrl:baseurl+"/acl",minChars:2,width:350,onSelect:function(e,t){$j("#recip-complete").val(t)}});break;case"contacts-head":var n=$j("#contacts-search").autocomplete({serviceUrl:baseurl+"/acl",minChars:2,width:350});n.setOptions({params:{type:"a"}});break;default:}if(typeof window.AjaxUpload!="undefined")switch(window.ajaxType){case"jot-header":var r=new window.AjaxUpload("wall-image-upload",{action:"wall_upload/"+window.nickname,name:"userfile",onSubmit:function(e,t){$j("#profile-rotator").show()},onComplete:function(e,t){addeditortext(t),$j("#profile-rotator").hide()}}),i=new window.AjaxUpload("wall-file-upload",{action:"wall_attach/"+window.nickname,name:"userfile",onSubmit:function(e,t){$j("#profile-rotator").show()},onComplete:function(e,t){addeditortext(t),$j("#profile-rotator").hide()}});break;case"msg-header":var r=new window.AjaxUpload("prvmail-upload",{action:"wall_upload/"+window.nickname,name:"userfile",onSubmit:function(e,t){$j("#profile-rotator").show()},onComplete:function(e,t){tinyMCE.execCommand("mceInsertRawHTML",!1,t),$j("#profile-rotator").hide()}});break;default:}}),$j(function(){$j("nav").bind("nav-update",function(e,t){var n=$j("#pending-update"),r=$j(t).find("register").text();r=="0"?(r="",n.hide()):n.show(),n.html(r)})}),$j(function(){$j("#cnftheme").fancybox({width:800,autoDimensions:!1,onStart:function(){var e=$j("#id_theme :selected").val(),t=$j("#id_theme_mobile :selected").val();$j("#cnftheme").attr("href",baseurl+"/admin/themes/"+e)},onComplete:function(){$j("div#fancybox-content form").submit(function(e){var t=$j(this).attr("action"),n={};return $j(this).find("input").each(function(){n[$j(this).attr("name")]=$j(this).val()}),$j(this).find("select").each(function(){n[$j(this).attr("name")]=$j(this).children(":selected").val()}),console.log(":)",t,n),$j.post(t,n,function(e){timer&&clearTimeout(timer),NavUpdate(),$j.fancybox.close()}),!1})}})}),typeof window.photoEdit!="undefined"&&$j(document).keydown(function(e){window.prevLink!=""&&e.ctrlKey&&e.keyCode==37&&(e.preventDefault(),window.location.href=window.prevLink),window.nextLink!=""&&e.ctrlKey&&e.keyCode==39&&(e.preventDefault(),window.location.href=window.nextLink)});switch(window.ajaxType){case"jot-header":function jotGetLink(){reply=prompt(window.linkURL),reply&&reply.length&&(reply=bin2hex(reply),$j("#profile-rotator").show(),$j.get("parse_url?binurl="+reply,function(e){addeditortext(e),$j("#profile-rotator").hide()}))}function linkdrop(e){var t=e.dataTransfer.getData("text/uri-list");e.target.textContent=t,e.preventDefault(),t&&t.length&&(t=bin2hex(t),$j("#profile-rotator").show(),$j.get("parse_url?binurl="+t,function(e){editor||$j("#profile-jot-text").val(""),initEditor(function(){addeditortext(e),$j("#profile-rotator").hide()})}))}break;case"msg-header":case"wallmsg-header":function jotGetLink(){reply=prompt(window.linkURL),reply&&reply.length&&($j("#profile-rotator").show(),$j.get("parse_url?url="+reply,function(e){tinyMCE.execCommand("mceInsertRawHTML",!1,e),$j("#profile-rotator").hide()}))}function linkdrop(e){var t=e.dataTransfer.getData("text/uri-list");e.target.textContent=t,e.preventDefault(),t&&t.length&&($j("#profile-rotator").show(),$j.get("parse_url?url="+t,function(e){tinyMCE.execCommand("mceInsertRawHTML",!1,e),$j("#profile-rotator").hide()}))}break;default:}var editor=!1,textlen=0,plaintext=window.editSelect,ispublic=window.isPublic;typeof window.geoTag=="function"&&window.geoTag();
\ No newline at end of file