mirror of
https://github.com/friendica/friendica
synced 2025-05-03 12:24:10 +02:00
Modify Javascript to improve page loading times
1. Add template category 'end' that places content right before final </body> tag 2. Move most Javascript from tpl files into one cacheable file, theme.js 3. Load scripts at end of the HTML document instead of in the header 4. Minify several Javascript files Note that the second and third things were only done for Frost and Frost Mobile. Doing it for every theme means going through every .tpl for every theme and rearranging the Javascript, which is tedious.
This commit is contained in:
parent
3f39e29e6e
commit
1f09e7ad23
132 changed files with 3300 additions and 1917 deletions
|
@ -13,41 +13,41 @@ function ACL(backend_url, preset){
|
|||
that.group_uids = [];
|
||||
that.nw = 2; //items per row. should be calulated from #acl-list.width
|
||||
|
||||
that.list_content = $("#acl-list-content");
|
||||
that.item_tpl = unescape($(".acl-list-item[rel=acl-template]").html());
|
||||
that.showall = $("#acl-showall");
|
||||
that.list_content = $j("#acl-list-content");
|
||||
that.item_tpl = unescape($j(".acl-list-item[rel=acl-template]").html());
|
||||
that.showall = $j("#acl-showall");
|
||||
|
||||
if (preset.length==0) that.showall.addClass("selected");
|
||||
|
||||
/*events*/
|
||||
that.showall.click(that.on_showall);
|
||||
$(".acl-button-show").live('click', that.on_button_show);
|
||||
$(".acl-button-hide").live('click', that.on_button_hide);
|
||||
$("#acl-search").keypress(that.on_search);
|
||||
$("#acl-wrapper").parents("form").submit(that.on_submit);
|
||||
$j(".acl-button-show").live('click', that.on_button_show);
|
||||
$j(".acl-button-hide").live('click', that.on_button_hide);
|
||||
$j("#acl-search").keypress(that.on_search);
|
||||
$j("#acl-wrapper").parents("form").submit(that.on_submit);
|
||||
|
||||
/* startup! */
|
||||
that.get(0,100);
|
||||
}
|
||||
|
||||
ACL.prototype.on_submit = function(){
|
||||
aclfileds = $("#acl-fields").html("");
|
||||
$(that.allow_gid).each(function(i,v){
|
||||
aclfileds = $j("#acl-fields").html("");
|
||||
$j(that.allow_gid).each(function(i,v){
|
||||
aclfileds.append("<input type='hidden' name='group_allow[]' value='"+v+"'>");
|
||||
});
|
||||
$(that.allow_cid).each(function(i,v){
|
||||
$j(that.allow_cid).each(function(i,v){
|
||||
aclfileds.append("<input type='hidden' name='contact_allow[]' value='"+v+"'>");
|
||||
});
|
||||
$(that.deny_gid).each(function(i,v){
|
||||
$j(that.deny_gid).each(function(i,v){
|
||||
aclfileds.append("<input type='hidden' name='group_deny[]' value='"+v+"'>");
|
||||
});
|
||||
$(that.deny_cid).each(function(i,v){
|
||||
$j(that.deny_cid).each(function(i,v){
|
||||
aclfileds.append("<input type='hidden' name='contact_deny[]' value='"+v+"'>");
|
||||
});
|
||||
}
|
||||
|
||||
ACL.prototype.search = function(){
|
||||
var srcstr = $("#acl-search").val();
|
||||
var srcstr = $j("#acl-search").val();
|
||||
that.list_content.html("");
|
||||
that.get(0,100, srcstr);
|
||||
}
|
||||
|
@ -82,10 +82,10 @@ ACL.prototype.on_button_show = function(event){
|
|||
event.stopPropagation();
|
||||
|
||||
/*that.showall.removeClass("selected");
|
||||
$(this).siblings(".acl-button-hide").removeClass("selected");
|
||||
$(this).toggleClass("selected");*/
|
||||
$j(this).siblings(".acl-button-hide").removeClass("selected");
|
||||
$j(this).toggleClass("selected");*/
|
||||
|
||||
that.set_allow($(this).parent().attr('id'));
|
||||
that.set_allow($j(this).parent().attr('id'));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -95,10 +95,10 @@ ACL.prototype.on_button_hide = function(event){
|
|||
event.stopPropagation();
|
||||
|
||||
/*that.showall.removeClass("selected");
|
||||
$(this).siblings(".acl-button-show").removeClass("selected");
|
||||
$(this).toggleClass("selected");*/
|
||||
$j(this).siblings(".acl-button-show").removeClass("selected");
|
||||
$j(this).toggleClass("selected");*/
|
||||
|
||||
that.set_deny($(this).parent().attr('id'));
|
||||
that.set_deny($j(this).parent().attr('id'));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -156,32 +156,32 @@ ACL.prototype.update_view = function(){
|
|||
that.deny_gid.length==0 && that.deny_cid.length==0){
|
||||
that.showall.addClass("selected");
|
||||
/* jot acl */
|
||||
$('#jot-perms-icon').removeClass('lock').addClass('unlock');
|
||||
$('#jot-public').show();
|
||||
$('.profile-jot-net input').attr('disabled', false);
|
||||
$j('#jot-perms-icon').removeClass('lock').addClass('unlock');
|
||||
$j('#jot-public').show();
|
||||
$j('.profile-jot-net input').attr('disabled', false);
|
||||
if(typeof editor != 'undefined' && editor != false) {
|
||||
$('#profile-jot-desc').html(ispublic);
|
||||
$j('#profile-jot-desc').html(ispublic);
|
||||
}
|
||||
|
||||
} else {
|
||||
that.showall.removeClass("selected");
|
||||
/* jot acl */
|
||||
$('#jot-perms-icon').removeClass('unlock').addClass('lock');
|
||||
$('#jot-public').hide();
|
||||
$('.profile-jot-net input').attr('disabled', 'disabled');
|
||||
$('#profile-jot-desc').html(' ');
|
||||
$j('#jot-perms-icon').removeClass('unlock').addClass('lock');
|
||||
$j('#jot-public').hide();
|
||||
$j('.profile-jot-net input').attr('disabled', 'disabled');
|
||||
$j('#profile-jot-desc').html(' ');
|
||||
}
|
||||
$("#acl-list-content .acl-list-item").each(function(){
|
||||
$(this).removeClass("groupshow grouphide");
|
||||
$j("#acl-list-content .acl-list-item").each(function(){
|
||||
$j(this).removeClass("groupshow grouphide");
|
||||
});
|
||||
|
||||
$("#acl-list-content .acl-list-item").each(function(){
|
||||
itemid = $(this).attr('id');
|
||||
$j("#acl-list-content .acl-list-item").each(function(){
|
||||
itemid = $j(this).attr('id');
|
||||
type = itemid[0];
|
||||
id = parseInt(itemid.substr(1));
|
||||
|
||||
btshow = $(this).children(".acl-button-show").removeClass("selected");
|
||||
bthide = $(this).children(".acl-button-hide").removeClass("selected");
|
||||
btshow = $j(this).children(".acl-button-show").removeClass("selected");
|
||||
bthide = $j(this).children(".acl-button-hide").removeClass("selected");
|
||||
|
||||
switch(type){
|
||||
case "g":
|
||||
|
@ -197,16 +197,16 @@ ACL.prototype.update_view = function(){
|
|||
uclass="grouphide";
|
||||
}
|
||||
|
||||
$(that.group_uids[id]).each(function(i,v) {
|
||||
$j(that.group_uids[id]).each(function(i,v) {
|
||||
if(uclass == "grouphide")
|
||||
$("#c"+v).removeClass("groupshow");
|
||||
$j("#c"+v).removeClass("groupshow");
|
||||
if(uclass != "") {
|
||||
var cls = $("#c"+v).attr('class');
|
||||
var cls = $j("#c"+v).attr('class');
|
||||
if( cls == undefined)
|
||||
return true;
|
||||
var hiding = cls.indexOf('grouphide');
|
||||
if(hiding == -1)
|
||||
$("#c"+v).addClass(uclass);
|
||||
$j("#c"+v).addClass(uclass);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -234,7 +234,7 @@ ACL.prototype.get = function(start,count, search){
|
|||
search:search,
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
$j.ajax({
|
||||
type:'POST',
|
||||
url: that.url,
|
||||
data: postdata,
|
||||
|
@ -246,7 +246,7 @@ ACL.prototype.get = function(start,count, search){
|
|||
ACL.prototype.populate = function(data){
|
||||
/* var height = Math.ceil(data.tot / that.nw) * 42;
|
||||
that.list_content.height(height);*/
|
||||
$(data.items).each(function(){
|
||||
$j(data.items).each(function(){
|
||||
html = "<div class='acl-list-item {4} {5}' title='{6}' id='{2}{3}'>"+that.item_tpl+"</div>";
|
||||
html = html.format( this.photo, this.name, this.type, this.id, '', this.network, this.link );
|
||||
if (this.uids!=undefined) that.group_uids[this.id] = this.uids;
|
||||
|
|
1
view/theme/frost-mobile/js/acl.min.js
vendored
Normal file
1
view/theme/frost-mobile/js/acl.min.js
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
function ACL(e,t){that=this,that.url=e,that.kp_timer=null,t==undefined&&(t=[]),that.allow_cid=t[0]||[],that.allow_gid=t[1]||[],that.deny_cid=t[2]||[],that.deny_gid=t[3]||[],that.group_uids=[],that.nw=2,that.list_content=$j("#acl-list-content"),that.item_tpl=unescape($j(".acl-list-item[rel=acl-template]").html()),that.showall=$j("#acl-showall"),t.length==0&&that.showall.addClass("selected"),that.showall.click(that.on_showall),$j(".acl-button-show").live("click",that.on_button_show),$j(".acl-button-hide").live("click",that.on_button_hide),$j("#acl-search").keypress(that.on_search),$j("#acl-wrapper").parents("form").submit(that.on_submit),that.get(0,100)}ACL.prototype.on_submit=function(){aclfileds=$j("#acl-fields").html(""),$j(that.allow_gid).each(function(e,t){aclfileds.append("<input type='hidden' name='group_allow[]' value='"+t+"'>")}),$j(that.allow_cid).each(function(e,t){aclfileds.append("<input type='hidden' name='contact_allow[]' value='"+t+"'>")}),$j(that.deny_gid).each(function(e,t){aclfileds.append("<input type='hidden' name='group_deny[]' value='"+t+"'>")}),$j(that.deny_cid).each(function(e,t){aclfileds.append("<input type='hidden' name='contact_deny[]' value='"+t+"'>")})},ACL.prototype.search=function(){var e=$j("#acl-search").val();that.list_content.html(""),that.get(0,100,e)},ACL.prototype.on_search=function(e){that.kp_timer&&clearTimeout(that.kp_timer),that.kp_timer=setTimeout(that.search,1e3)},ACL.prototype.on_showall=function(e){return e.preventDefault(),e.stopPropagation(),that.showall.hasClass("selected")?!1:(that.showall.addClass("selected"),that.allow_cid=[],that.allow_gid=[],that.deny_cid=[],that.deny_gid=[],that.update_view(),!1)},ACL.prototype.on_button_show=function(e){return e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation(),that.set_allow($j(this).parent().attr("id")),!1},ACL.prototype.on_button_hide=function(e){return e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation(),that.set_deny($j(this).parent().attr("id")),!1},ACL.prototype.set_allow=function(e){type=e[0],id=parseInt(e.substr(1));switch(type){case"g":that.allow_gid.indexOf(id)<0?that.allow_gid.push(id):that.allow_gid.remove(id),that.deny_gid.indexOf(id)>=0&&that.deny_gid.remove(id);break;case"c":that.allow_cid.indexOf(id)<0?that.allow_cid.push(id):that.allow_cid.remove(id),that.deny_cid.indexOf(id)>=0&&that.deny_cid.remove(id)}that.update_view()},ACL.prototype.set_deny=function(e){type=e[0],id=parseInt(e.substr(1));switch(type){case"g":that.deny_gid.indexOf(id)<0?that.deny_gid.push(id):that.deny_gid.remove(id),that.allow_gid.indexOf(id)>=0&&that.allow_gid.remove(id);break;case"c":that.deny_cid.indexOf(id)<0?that.deny_cid.push(id):that.deny_cid.remove(id),that.allow_cid.indexOf(id)>=0&&that.allow_cid.remove(id)}that.update_view()},ACL.prototype.update_view=function(){that.allow_gid.length==0&&that.allow_cid.length==0&&that.deny_gid.length==0&&that.deny_cid.length==0?(that.showall.addClass("selected"),$j("#jot-perms-icon").removeClass("lock").addClass("unlock"),$j("#jot-public").show(),$j(".profile-jot-net input").attr("disabled",!1),typeof editor!="undefined"&&editor!=0&&$j("#profile-jot-desc").html(ispublic)):(that.showall.removeClass("selected"),$j("#jot-perms-icon").removeClass("unlock").addClass("lock"),$j("#jot-public").hide(),$j(".profile-jot-net input").attr("disabled","disabled"),$j("#profile-jot-desc").html(" ")),$j("#acl-list-content .acl-list-item").each(function(){$j(this).removeClass("groupshow grouphide")}),$j("#acl-list-content .acl-list-item").each(function(){itemid=$j(this).attr("id"),type=itemid[0],id=parseInt(itemid.substr(1)),btshow=$j(this).children(".acl-button-show").removeClass("selected"),bthide=$j(this).children(".acl-button-hide").removeClass("selected");switch(type){case"g":var e="";that.allow_gid.indexOf(id)>=0&&(btshow.addClass("selected"),bthide.removeClass("selected"),e="groupshow"),that.deny_gid.indexOf(id)>=0&&(btshow.removeClass("selected"),bthide.addClass("selected"),e="grouphide"),$j(that.group_uids[id]).each(function(t,n){e=="grouphide"&&$j("#c"+n).removeClass("groupshow");if(e!=""){var r=$j("#c"+n).attr("class");if(r==undefined)return!0;var i=r.indexOf("grouphide");i==-1&&$j("#c"+n).addClass(e)}});break;case"c":that.allow_cid.indexOf(id)>=0&&(btshow.addClass("selected"),bthide.removeClass("selected")),that.deny_cid.indexOf(id)>=0&&(btshow.removeClass("selected"),bthide.addClass("selected"))}})},ACL.prototype.get=function(e,t,n){var r={start:e,count:t,search:n};$j.ajax({type:"POST",url:that.url,data:r,dataType:"json",success:that.populate})},ACL.prototype.populate=function(e){$j(e.items).each(function(){html="<div class='acl-list-item {4} {5}' title='{6}' id='{2}{3}'>"+that.item_tpl+"</div>",html=html.format(this.photo,this.name,this.type,this.id,"",this.network,this.link),this.uids!=undefined&&(that.group_uids[this.id]=this.uids),that.list_content.append(html)}),that.update_view()};
|
5
view/theme/frost-mobile/js/fk.autocomplete.min.js
vendored
Normal file
5
view/theme/frost-mobile/js/fk.autocomplete.min.js
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
/**
|
||||
* Friendica people autocomplete
|
||||
*
|
||||
* require jQuery, jquery.textareas
|
||||
*/function ACPopup(e,t){this.idsel=-1,this.element=e,this.searchText="",this.ready=!0,this.kp_timer=!1,this.url=t;var n=530,r=130;if(typeof e.editorId=="undefined")style=$j(e).offset(),n=$j(e).width(),r=$j(e).height();else{var i=e.getContainer();typeof i!="undefined"&&(style=$j(i).offset(),n=$j(i).width(),r=$j(i).height())}style.top=style.top+r,style.width=n,style.position="absolute",style.display="none",this.cont=$j("<div class='acpopup'></div>"),this.cont.css(style),$j("body").append(this.cont)}function ContactAutocomplete(e,t){this.pattern=/@([^ \n]+)$/,this.popup=null;var n=this;$j(e).unbind("keydown"),$j(e).unbind("keyup"),$j(e).keydown(function(e){n.popup!==null&&n.popup.onkey(e)}),$j(e).keyup(function(e){cpos=$j(this).getSelection(),cpos.start==cpos.end&&(match=$j(this).val().substring(0,cpos.start).match(n.pattern),match!==null?(n.popup===null&&(n.popup=new ACPopup(this,t)),n.popup.ready&&match[1]!==n.popup.searchText&&n.popup.search(match[1]),n.popup.ready||(n.popup=null)):n.popup!==null&&(n.popup.close(),n.popup=null))})}ACPopup.prototype.close=function(){$j(this.cont).remove(),this.ready=!1},ACPopup.prototype.search=function(e){var t=this;this.searchText=e,this.kp_timer&&clearTimeout(this.kp_timer),this.kp_timer=setTimeout(function(){t._search()},500)},ACPopup.prototype._search=function(){console.log("_search");var e=this,t={start:0,count:100,search:this.searchText,type:"c"};$j.ajax({type:"POST",url:this.url,data:t,dataType:"json",success:function(t){e.cont.html(""),t.tot>0?(e.cont.show(),$j(t.items).each(function(){html="<img src='{0}' height='16px' width='16px'>{1} ({2})".format(this.photo,this.name,this.nick),e.add(html,this.nick.replace(" ","")+"+"+this.id+" - "+this.link)})):e.cont.hide()}})},ACPopup.prototype.add=function(e,n){var r=this,i=$j("<div class='acpopupitem' title='"+n+"'>"+e+"</div>");i.click(function(e){t=$j(this).attr("title").replace(new RegExp(" - .*"),""),typeof r.element.container=="undefined"?(el=$j(r.element),sel=el.getSelection(),sel.start=sel.start-r.searchText.length,el.setSelection(sel.start,sel.end).replaceSelectedText(t+" ").collapseSelection(!1),r.close()):(txt=tinyMCE.activeEditor.getContent(),newtxt=txt.replace(r.searchText,t+" "),tinyMCE.activeEditor.setContent(newtxt),tinyMCE.activeEditor.focus(),r.close())}),$j(this.cont).append(i)},ACPopup.prototype.onkey=function(e){e.keyCode=="13"&&(this.idsel>-1?(this.cont.children()[this.idsel].click(),e.preventDefault()):this.close()),e.keyCode=="38"&&(cmax=this.cont.children().size()-1,this.idsel--,this.idsel<0&&(this.idsel=cmax),e.preventDefault());if(e.keyCode=="40"||e.keyCode=="9")cmax=this.cont.children().size()-1,this.idsel++,this.idsel>cmax&&(this.idsel=0),e.preventDefault();if(e.keyCode=="38"||e.keyCode=="40"||e.keyCode=="9")this.cont.children().removeClass("selected"),$j(this.cont.children()[this.idsel]).addClass("selected");e.keyCode=="27"&&this.close()},function(e){$j.fn.contact_autocomplete=function(e){this.each(function(){new ContactAutocomplete(this,e)})}}(jQuery);
|
|
@ -33,14 +33,14 @@
|
|||
var last_popup_menu = null;
|
||||
var last_popup_button = null;
|
||||
|
||||
$(function() {
|
||||
$.ajaxSetup({cache: false});
|
||||
$j(function() {
|
||||
$j.ajaxSetup({cache: false});
|
||||
|
||||
msie = $.browser.msie ;
|
||||
msie = $j.browser.msie ;
|
||||
|
||||
/* setup tooltips *//*
|
||||
$("a,.tt").each(function(){
|
||||
var e = $(this);
|
||||
$j("a,.tt").each(function(){
|
||||
var e = $j(this);
|
||||
var pos="bottom";
|
||||
if (e.hasClass("tttop")) pos="top";
|
||||
if (e.hasClass("ttbottom")) pos="bottom";
|
||||
|
@ -52,19 +52,19 @@
|
|||
|
||||
|
||||
/* setup onoff widgets */
|
||||
$(".onoff input").each(function(){
|
||||
val = $(this).val();
|
||||
id = $(this).attr("id");
|
||||
$("#"+id+"_onoff ."+ (val==0?"on":"off")).addClass("hidden");
|
||||
$j(".onoff input").each(function(){
|
||||
val = $j(this).val();
|
||||
id = $j(this).attr("id");
|
||||
$j("#"+id+"_onoff ."+ (val==0?"on":"off")).addClass("hidden");
|
||||
|
||||
});
|
||||
$(".onoff > a").click(function(event){
|
||||
$j(".onoff > a").click(function(event){
|
||||
event.preventDefault();
|
||||
var input = $(this).siblings("input");
|
||||
var input = $j(this).siblings("input");
|
||||
var val = 1-input.val();
|
||||
var id = input.attr("id");
|
||||
$("#"+id+"_onoff ."+ (val==0?"on":"off")).addClass("hidden");
|
||||
$("#"+id+"_onoff ."+ (val==1?"on":"off")).removeClass("hidden");
|
||||
$j("#"+id+"_onoff ."+ (val==0?"on":"off")).addClass("hidden");
|
||||
$j("#"+id+"_onoff ."+ (val==1?"on":"off")).removeClass("hidden");
|
||||
input.val(val);
|
||||
//console.log(id);
|
||||
});
|
||||
|
@ -76,98 +76,98 @@
|
|||
function close_last_popup_menu(e) {
|
||||
|
||||
if( last_popup_menu ) {
|
||||
if( '#' + last_popup_menu.attr('id') !== $(e.target).attr('rel')) {
|
||||
if( '#' + last_popup_menu.attr('id') !== $j(e.target).attr('rel')) {
|
||||
last_popup_menu.hide();
|
||||
if (last_popup_menu.attr('id') == "nav-notifications-menu" ) $('section').show();
|
||||
if (last_popup_menu.attr('id') == "nav-notifications-menu" ) $j('section').show();
|
||||
last_popup_button.removeClass("selected");
|
||||
last_popup_menu = null;
|
||||
last_popup_button = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
$('img[rel^=#]').click(function(e){
|
||||
$j('img[rel^=#]').click(function(e){
|
||||
|
||||
close_last_popup_menu(e);
|
||||
menu = $( $(this).attr('rel') );
|
||||
menu = $j( $j(this).attr('rel') );
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
if (menu.attr('popup')=="false") return false;
|
||||
|
||||
// $(this).parent().toggleClass("selected");
|
||||
// $j(this).parent().toggleClass("selected");
|
||||
// menu.toggle();
|
||||
|
||||
if (menu.css("display") == "none") {
|
||||
$(this).parent().addClass("selected");
|
||||
$j(this).parent().addClass("selected");
|
||||
menu.show();
|
||||
if (menu.attr('id') == "nav-notifications-menu" ) $('section').hide();
|
||||
if (menu.attr('id') == "nav-notifications-menu" ) $j('section').hide();
|
||||
last_popup_menu = menu;
|
||||
last_popup_button = $(this).parent();
|
||||
last_popup_button = $j(this).parent();
|
||||
} else {
|
||||
$(this).parent().removeClass("selected");
|
||||
$j(this).parent().removeClass("selected");
|
||||
menu.hide();
|
||||
if (menu.attr('id') == "nav-notifications-menu" ) $('section').show();
|
||||
if (menu.attr('id') == "nav-notifications-menu" ) $j('section').show();
|
||||
last_popup_menu = null;
|
||||
last_popup_button = null;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
$('html').click(function(e) {
|
||||
$j('html').click(function(e) {
|
||||
close_last_popup_menu(e);
|
||||
});
|
||||
|
||||
// fancyboxes
|
||||
/*$("a.popupbox").fancybox({
|
||||
/*$j("a.popupbox").fancybox({
|
||||
'transitionIn' : 'elastic',
|
||||
'transitionOut' : 'elastic'
|
||||
});*/
|
||||
|
||||
|
||||
/* notifications template */
|
||||
var notifications_tpl= unescape($("#nav-notifications-template[rel=template]").html());
|
||||
var notifications_all = unescape($('<div>').append( $("#nav-notifications-see-all").clone() ).html()); //outerHtml hack
|
||||
var notifications_mark = unescape($('<div>').append( $("#nav-notifications-mark-all").clone() ).html()); //outerHtml hack
|
||||
var notifications_empty = unescape($("#nav-notifications-menu").html());
|
||||
var notifications_tpl= unescape($j("#nav-notifications-template[rel=template]").html());
|
||||
var notifications_all = unescape($j('<div>').append( $j("#nav-notifications-see-all").clone() ).html()); //outerHtml hack
|
||||
var notifications_mark = unescape($j('<div>').append( $j("#nav-notifications-mark-all").clone() ).html()); //outerHtml hack
|
||||
var notifications_empty = unescape($j("#nav-notifications-menu").html());
|
||||
|
||||
/* nav update event */
|
||||
$('nav').bind('nav-update', function(e,data){;
|
||||
var invalid = $(data).find('invalid').text();
|
||||
$j('nav').bind('nav-update', function(e,data){;
|
||||
var invalid = $j(data).find('invalid').text();
|
||||
if(invalid == 1) { window.location.href=window.location.href }
|
||||
|
||||
var net = $(data).find('net').text();
|
||||
if(net == 0) { net = ''; $('#net-update').removeClass('show') } else { $('#net-update').addClass('show') }
|
||||
$('#net-update').html(net);
|
||||
var net = $j(data).find('net').text();
|
||||
if(net == 0) { net = ''; $j('#net-update').removeClass('show') } else { $j('#net-update').addClass('show') }
|
||||
$j('#net-update').html(net);
|
||||
|
||||
var home = $(data).find('home').text();
|
||||
if(home == 0) { home = ''; $('#home-update').removeClass('show') } else { $('#home-update').addClass('show') }
|
||||
$('#home-update').html(home);
|
||||
var home = $j(data).find('home').text();
|
||||
if(home == 0) { home = ''; $j('#home-update').removeClass('show') } else { $j('#home-update').addClass('show') }
|
||||
$j('#home-update').html(home);
|
||||
|
||||
var intro = $(data).find('intro').text();
|
||||
if(intro == 0) { intro = ''; $('#intro-update').removeClass('show') } else { $('#intro-update').addClass('show') }
|
||||
$('#intro-update').html(intro);
|
||||
var intro = $j(data).find('intro').text();
|
||||
if(intro == 0) { intro = ''; $j('#intro-update').removeClass('show') } else { $j('#intro-update').addClass('show') }
|
||||
$j('#intro-update').html(intro);
|
||||
|
||||
var mail = $(data).find('mail').text();
|
||||
if(mail == 0) { mail = ''; $('#mail-update').removeClass('show') } else { $('#mail-update').addClass('show') }
|
||||
$('#mail-update').html(mail);
|
||||
var mail = $j(data).find('mail').text();
|
||||
if(mail == 0) { mail = ''; $j('#mail-update').removeClass('show') } else { $j('#mail-update').addClass('show') }
|
||||
$j('#mail-update').html(mail);
|
||||
|
||||
var intro = $(data).find('intro').text();
|
||||
if(intro == 0) { intro = ''; $('#intro-update-li').removeClass('show') } else { $('#intro-update-li').addClass('show') }
|
||||
$('#intro-update-li').html(intro);
|
||||
var intro = $j(data).find('intro').text();
|
||||
if(intro == 0) { intro = ''; $j('#intro-update-li').removeClass('show') } else { $j('#intro-update-li').addClass('show') }
|
||||
$j('#intro-update-li').html(intro);
|
||||
|
||||
var mail = $(data).find('mail').text();
|
||||
if(mail == 0) { mail = ''; $('#mail-update-li').removeClass('show') } else { $('#mail-update-li').addClass('show') }
|
||||
$('#mail-update-li').html(mail);
|
||||
var mail = $j(data).find('mail').text();
|
||||
if(mail == 0) { mail = ''; $j('#mail-update-li').removeClass('show') } else { $j('#mail-update-li').addClass('show') }
|
||||
$j('#mail-update-li').html(mail);
|
||||
|
||||
var eNotif = $(data).find('notif')
|
||||
var eNotif = $j(data).find('notif')
|
||||
|
||||
if (eNotif.children("note").length==0){
|
||||
$("#nav-notifications-menu").html(notifications_empty);
|
||||
$j("#nav-notifications-menu").html(notifications_empty);
|
||||
} else {
|
||||
nnm = $("#nav-notifications-menu");
|
||||
nnm = $j("#nav-notifications-menu");
|
||||
nnm.html(notifications_all + notifications_mark);
|
||||
//nnm.attr('popup','true');
|
||||
eNotif.children("note").each(function(){
|
||||
e = $(this);
|
||||
e = $j(this);
|
||||
text = e.text().format("<span class='contactname'>"+e.attr('name')+"</span>");
|
||||
html = notifications_tpl.format(e.attr('href'),e.attr('photo'), text, e.attr('date'), e.attr('seen'));
|
||||
nnm.append(html);
|
||||
|
@ -175,21 +175,21 @@
|
|||
}
|
||||
notif = eNotif.attr('count');
|
||||
if (notif>0){
|
||||
$("#nav-notifications-linkmenu").addClass("on");
|
||||
$j("#nav-notifications-linkmenu").addClass("on");
|
||||
} else {
|
||||
$("#nav-notifications-linkmenu").removeClass("on");
|
||||
$j("#nav-notifications-linkmenu").removeClass("on");
|
||||
}
|
||||
if(notif == 0) { notif = ''; $('#notify-update').removeClass('show') } else { $('#notify-update').addClass('show') }
|
||||
$('#notify-update').html(notif);
|
||||
if(notif == 0) { notif = ''; $j('#notify-update').removeClass('show') } else { $j('#notify-update').addClass('show') }
|
||||
$j('#notify-update').html(notif);
|
||||
|
||||
var eSysmsg = $(data).find('sysmsgs');
|
||||
var eSysmsg = $j(data).find('sysmsgs');
|
||||
eSysmsg.children("notice").each(function(){
|
||||
text = $(this).text();
|
||||
$.jGrowl(text, { sticky: true, theme: 'notice', life: 1000 });
|
||||
text = $j(this).text();
|
||||
$j.jGrowl(text, { sticky: false, theme: 'notice', life: 1500 });
|
||||
});
|
||||
eSysmsg.children("info").each(function(){
|
||||
text = $(this).text();
|
||||
$.jGrowl(text, { sticky: false, theme: 'info', life: 1000 });
|
||||
text = $j(this).text();
|
||||
$j.jGrowl(text, { sticky: false, theme: 'info', life: 1000 });
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -197,7 +197,7 @@
|
|||
|
||||
NavUpdate();
|
||||
// Allow folks to stop the ajax page updates with the pause/break key
|
||||
/* $(document).keydown(function(event) {
|
||||
/* $j(document).keydown(function(event) {
|
||||
if(event.keyCode == '8') {
|
||||
var target = event.target || event.srcElement;
|
||||
if (!/input|textarea/i.test(target.nodeName)) {
|
||||
|
@ -211,7 +211,7 @@
|
|||
if (event.ctrlKey) {
|
||||
totStopped = true;
|
||||
}
|
||||
$('#pause').html('<img src="images/pause.gif" alt="pause" style="border: 1px solid black;" />');
|
||||
$j('#pause').html('<img src="images/pause.gif" alt="pause" style="border: 1px solid black;" />');
|
||||
} else {
|
||||
unpause();
|
||||
}
|
||||
|
@ -229,27 +229,27 @@
|
|||
|
||||
if(! stopped) {
|
||||
var pingCmd = 'ping' + ((localUser != 0) ? '?f=&uid=' + localUser : '');
|
||||
$.get(pingCmd,function(data) {
|
||||
$(data).find('result').each(function() {
|
||||
$j.get(pingCmd,function(data) {
|
||||
$j(data).find('result').each(function() {
|
||||
// send nav-update event
|
||||
$('nav').trigger('nav-update', this);
|
||||
$j('nav').trigger('nav-update', this);
|
||||
|
||||
|
||||
// start live update
|
||||
|
||||
|
||||
|
||||
if($('#live-network').length) { src = 'network'; liveUpdate(); }
|
||||
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($j('#live-network').length) { src = 'network'; liveUpdate(); }
|
||||
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(liking) {
|
||||
liking = 0;
|
||||
window.location.href=window.location.href
|
||||
}
|
||||
}
|
||||
if($('#live-photos').length) {
|
||||
if($j('#live-photos').length) {
|
||||
if(liking) {
|
||||
liking = 0;
|
||||
window.location.href=window.location.href
|
||||
|
@ -266,8 +266,8 @@
|
|||
}
|
||||
|
||||
function liveUpdate() {
|
||||
if((src == null) || (stopped) || (! profile_uid)) { $('.like-rotator').hide(); return; }
|
||||
if(($('.comment-edit-text-full').length) || (in_progress)) {
|
||||
if((src == null) || (stopped) || (! profile_uid)) { $j('.like-rotator').hide(); return; }
|
||||
if(($j('.comment-edit-text-full').length) || (in_progress)) {
|
||||
if(livetime) {
|
||||
clearTimeout(livetime);
|
||||
}
|
||||
|
@ -283,34 +283,34 @@
|
|||
var udargs = ((netargs.length) ? '/' + netargs : '');
|
||||
var update_url = 'update_' + src + udargs + '&p=' + profile_uid + '&page=' + profile_page + '&msie=' + ((msie) ? 1 : 0);
|
||||
|
||||
$.get(update_url,function(data) {
|
||||
$j.get(update_url,function(data) {
|
||||
in_progress = false;
|
||||
// $('.collapsed-comments',data).each(function() {
|
||||
// var ident = $(this).attr('id');
|
||||
// var is_hidden = $('#' + ident).is(':hidden');
|
||||
// if($('#' + ident).length) {
|
||||
// $('#' + ident).replaceWith($(this));
|
||||
// $j('.collapsed-comments',data).each(function() {
|
||||
// var ident = $j(this).attr('id');
|
||||
// var is_hidden = $j('#' + ident).is(':hidden');
|
||||
// if($j('#' + ident).length) {
|
||||
// $j('#' + ident).replaceWith($j(this));
|
||||
// if(is_hidden)
|
||||
// $('#' + ident).hide();
|
||||
// $j('#' + ident).hide();
|
||||
// }
|
||||
//});
|
||||
|
||||
// add a new thread
|
||||
|
||||
$('.tread-wrapper',data).each(function() {
|
||||
var ident = $(this).attr('id');
|
||||
$j('.tread-wrapper',data).each(function() {
|
||||
var ident = $j(this).attr('id');
|
||||
|
||||
if($('#' + ident).length == 0 && profile_page == 1) {
|
||||
$('img',this).each(function() {
|
||||
$(this).attr('src',$(this).attr('dst'));
|
||||
if($j('#' + ident).length == 0 && profile_page == 1) {
|
||||
$j('img',this).each(function() {
|
||||
$j(this).attr('src',$j(this).attr('dst'));
|
||||
});
|
||||
$('#' + prev).after($(this));
|
||||
$j('#' + prev).after($j(this));
|
||||
}
|
||||
else {
|
||||
$('img',this).each(function() {
|
||||
$(this).attr('src',$(this).attr('dst'));
|
||||
$j('img',this).each(function() {
|
||||
$j(this).attr('src',$j(this).attr('dst'));
|
||||
});
|
||||
$('#' + ident).replaceWith($(this));
|
||||
$j('#' + ident).replaceWith($j(this));
|
||||
}
|
||||
prev = ident;
|
||||
});
|
||||
|
@ -319,45 +319,45 @@
|
|||
|
||||
/*prev = 'live-' + src;
|
||||
|
||||
$('.wall-item-outside-wrapper',data).each(function() {
|
||||
var ident = $(this).attr('id');
|
||||
$j('.wall-item-outside-wrapper',data).each(function() {
|
||||
var ident = $j(this).attr('id');
|
||||
|
||||
if($('#' + ident).length == 0 && prev != 'live-' + src) {
|
||||
$('img',this).each(function() {
|
||||
$(this).attr('src',$(this).attr('dst'));
|
||||
if($j('#' + ident).length == 0 && prev != 'live-' + src) {
|
||||
$j('img',this).each(function() {
|
||||
$j(this).attr('src',$j(this).attr('dst'));
|
||||
});
|
||||
$('#' + prev).after($(this));
|
||||
$j('#' + prev).after($j(this));
|
||||
}
|
||||
else {
|
||||
$('#' + ident + ' ' + '.wall-item-ago').replaceWith($(this).find('.wall-item-ago'));
|
||||
if($('#' + ident + ' ' + '.comment-edit-text-empty').length)
|
||||
$('#' + ident + ' ' + '.wall-item-comment-wrapper').replaceWith($(this).find('.wall-item-comment-wrapper'));
|
||||
$('#' + ident + ' ' + '.hide-comments-total').replaceWith($(this).find('.hide-comments-total'));
|
||||
$('#' + ident + ' ' + '.wall-item-like').replaceWith($(this).find('.wall-item-like'));
|
||||
$('#' + ident + ' ' + '.wall-item-dislike').replaceWith($(this).find('.wall-item-dislike'));
|
||||
$('#' + ident + ' ' + '.my-comment-photo').each(function() {
|
||||
$(this).attr('src',$(this).attr('dst'));
|
||||
$j('#' + ident + ' ' + '.wall-item-ago').replaceWith($j(this).find('.wall-item-ago'));
|
||||
if($j('#' + ident + ' ' + '.comment-edit-text-empty').length)
|
||||
$j('#' + ident + ' ' + '.wall-item-comment-wrapper').replaceWith($j(this).find('.wall-item-comment-wrapper'));
|
||||
$j('#' + ident + ' ' + '.hide-comments-total').replaceWith($j(this).find('.hide-comments-total'));
|
||||
$j('#' + ident + ' ' + '.wall-item-like').replaceWith($j(this).find('.wall-item-like'));
|
||||
$j('#' + ident + ' ' + '.wall-item-dislike').replaceWith($j(this).find('.wall-item-dislike'));
|
||||
$j('#' + ident + ' ' + '.my-comment-photo').each(function() {
|
||||
$j(this).attr('src',$j(this).attr('dst'));
|
||||
});
|
||||
}
|
||||
prev = ident;
|
||||
});*/
|
||||
|
||||
$('.like-rotator').hide();
|
||||
$j('.like-rotator').hide();
|
||||
if(commentBusy) {
|
||||
commentBusy = false;
|
||||
$('body').css('cursor', 'auto');
|
||||
$j('body').css('cursor', 'auto');
|
||||
}
|
||||
/* autocomplete @nicknames */
|
||||
$(".comment-edit-form textarea").contact_autocomplete(baseurl+"/acl");
|
||||
$j(".comment-edit-form textarea").contact_autocomplete(baseurl+"/acl");
|
||||
});
|
||||
}
|
||||
|
||||
function imgbright(node) {
|
||||
$(node).removeClass("drophide").addClass("drop");
|
||||
$j(node).removeClass("drophide").addClass("drop");
|
||||
}
|
||||
|
||||
function imgdull(node) {
|
||||
$(node).removeClass("drop").addClass("drophide");
|
||||
$j(node).removeClass("drop").addClass("drophide");
|
||||
}
|
||||
|
||||
// Since our ajax calls are asynchronous, we will give a few
|
||||
|
@ -372,8 +372,8 @@
|
|||
|
||||
function dolike(ident,verb) {
|
||||
unpause();
|
||||
$('#like-rotator-' + ident.toString()).show();
|
||||
$.get('like/' + ident.toString() + '?verb=' + verb, NavUpdate );
|
||||
$j('#like-rotator-' + ident.toString()).show();
|
||||
$j.get('like/' + ident.toString() + '?verb=' + verb, NavUpdate );
|
||||
// if(timer) clearTimeout(timer);
|
||||
// timer = setTimeout(NavUpdate,3000);
|
||||
liking = 1;
|
||||
|
@ -381,21 +381,21 @@
|
|||
|
||||
function dostar(ident) {
|
||||
ident = ident.toString();
|
||||
//$('#like-rotator-' + ident).show();
|
||||
$.get('starred/' + ident, function(data) {
|
||||
//$j('#like-rotator-' + ident).show();
|
||||
$j.get('starred/' + ident, function(data) {
|
||||
if(data.match(/1/)) {
|
||||
$('#starred-' + ident).addClass('starred');
|
||||
$('#starred-' + ident).removeClass('unstarred');
|
||||
$('#star-' + ident).addClass('hidden');
|
||||
$('#unstar-' + ident).removeClass('hidden');
|
||||
$j('#starred-' + ident).addClass('starred');
|
||||
$j('#starred-' + ident).removeClass('unstarred');
|
||||
$j('#star-' + ident).addClass('hidden');
|
||||
$j('#unstar-' + ident).removeClass('hidden');
|
||||
}
|
||||
else {
|
||||
$('#starred-' + ident).addClass('unstarred');
|
||||
$('#starred-' + ident).removeClass('starred');
|
||||
$('#star-' + ident).removeClass('hidden');
|
||||
$('#unstar-' + ident).addClass('hidden');
|
||||
$j('#starred-' + ident).addClass('unstarred');
|
||||
$j('#starred-' + ident).removeClass('starred');
|
||||
$j('#star-' + ident).removeClass('hidden');
|
||||
$j('#unstar-' + ident).addClass('hidden');
|
||||
}
|
||||
//$('#like-rotator-' + ident).hide();
|
||||
//$j('#like-rotator-' + ident).hide();
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -430,31 +430,31 @@
|
|||
}
|
||||
else {
|
||||
lockvisible = true;
|
||||
$.get('lockview/' + id, function(data) {
|
||||
$('#panel').html(data);
|
||||
$('#panel').css({ 'left': cursor.x + 5 , 'top': cursor.y + 5});
|
||||
$('#panel').show();
|
||||
$j.get('lockview/' + id, function(data) {
|
||||
$j('#panel').html(data);
|
||||
$j('#panel').css({ 'left': cursor.x + 5 , 'top': cursor.y + 5});
|
||||
$j('#panel').show();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function lockviewhide() {
|
||||
lockvisible = false;
|
||||
$('#panel').hide();
|
||||
$j('#panel').hide();
|
||||
}
|
||||
|
||||
function post_comment(id) {
|
||||
unpause();
|
||||
commentBusy = true;
|
||||
$('body').css('cursor', 'wait');
|
||||
$("#comment-preview-inp-" + id).val("0");
|
||||
$.post(
|
||||
$j('body').css('cursor', 'wait');
|
||||
$j("#comment-preview-inp-" + id).val("0");
|
||||
$j.post(
|
||||
"item",
|
||||
$("#comment-edit-form-" + id).serialize(),
|
||||
$j("#comment-edit-form-" + id).serialize(),
|
||||
function(data) {
|
||||
if(data.success) {
|
||||
$("#comment-edit-wrapper-" + id).hide();
|
||||
$("#comment-edit-text-" + id).val('');
|
||||
$j("#comment-edit-wrapper-" + id).hide();
|
||||
$j("#comment-edit-text-" + id).val('');
|
||||
var tarea = document.getElementById("comment-edit-text-" + id);
|
||||
if(tarea)
|
||||
commentClose(tarea,id);
|
||||
|
@ -472,16 +472,16 @@
|
|||
|
||||
|
||||
function preview_comment(id) {
|
||||
$("#comment-preview-inp-" + id).val("1");
|
||||
$("#comment-edit-preview-" + id).show();
|
||||
$.post(
|
||||
$j("#comment-preview-inp-" + id).val("1");
|
||||
$j("#comment-edit-preview-" + id).show();
|
||||
$j.post(
|
||||
"item",
|
||||
$("#comment-edit-form-" + id).serialize(),
|
||||
$j("#comment-edit-form-" + id).serialize(),
|
||||
function(data) {
|
||||
if(data.preview) {
|
||||
|
||||
$("#comment-edit-preview-" + id).html(data.preview);
|
||||
$("#comment-edit-preview-" + id + " a").click(function() { return false; });
|
||||
$j("#comment-edit-preview-" + id).html(data.preview);
|
||||
$j("#comment-edit-preview-" + id + " a").click(function() { return false; });
|
||||
}
|
||||
},
|
||||
"json"
|
||||
|
@ -492,21 +492,21 @@
|
|||
|
||||
|
||||
function preview_post() {
|
||||
$("#jot-preview").val("1");
|
||||
$("#jot-preview-content").show();
|
||||
$j("#jot-preview").val("1");
|
||||
$j("#jot-preview-content").show();
|
||||
tinyMCE.triggerSave();
|
||||
$.post(
|
||||
$j.post(
|
||||
"item",
|
||||
$("#profile-jot-form").serialize(),
|
||||
$j("#profile-jot-form").serialize(),
|
||||
function(data) {
|
||||
if(data.preview) {
|
||||
$("#jot-preview-content").html(data.preview);
|
||||
$("#jot-preview-content" + " a").click(function() { return false; });
|
||||
$j("#jot-preview-content").html(data.preview);
|
||||
$j("#jot-preview-content" + " a").click(function() { return false; });
|
||||
}
|
||||
},
|
||||
"json"
|
||||
);
|
||||
$("#jot-preview").val("0");
|
||||
$j("#jot-preview").val("0");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -515,7 +515,7 @@
|
|||
// unpause auto reloads if they are currently stopped
|
||||
totStopped = false;
|
||||
stopped = false;
|
||||
$('#pause').html('');
|
||||
$j('#pause').html('');
|
||||
}
|
||||
|
||||
|
||||
|
@ -543,40 +543,40 @@
|
|||
}
|
||||
|
||||
function groupChangeMember(gid, cid, sec_token) {
|
||||
$('body .fakelink').css('cursor', 'wait');
|
||||
$.get('group/' + gid + '/' + cid + "?t=" + sec_token, function(data) {
|
||||
$('#group-update-wrapper').html(data);
|
||||
$('body .fakelink').css('cursor', 'auto');
|
||||
$j('body .fakelink').css('cursor', 'wait');
|
||||
$j.get('group/' + gid + '/' + cid + "?t=" + sec_token, function(data) {
|
||||
$j('#group-update-wrapper').html(data);
|
||||
$j('body .fakelink').css('cursor', 'auto');
|
||||
});
|
||||
}
|
||||
|
||||
function profChangeMember(gid,cid) {
|
||||
$('body .fakelink').css('cursor', 'wait');
|
||||
$.get('profperm/' + gid + '/' + cid, function(data) {
|
||||
$('#prof-update-wrapper').html(data);
|
||||
$('body .fakelink').css('cursor', 'auto');
|
||||
$j('body .fakelink').css('cursor', 'wait');
|
||||
$j.get('profperm/' + gid + '/' + cid, function(data) {
|
||||
$j('#prof-update-wrapper').html(data);
|
||||
$j('body .fakelink').css('cursor', 'auto');
|
||||
});
|
||||
}
|
||||
|
||||
function contactgroupChangeMember(gid,cid) {
|
||||
$('body').css('cursor', 'wait');
|
||||
$.get('contactgroup/' + gid + '/' + cid, function(data) {
|
||||
$('body').css('cursor', 'auto');
|
||||
$j('body').css('cursor', 'wait');
|
||||
$j.get('contactgroup/' + gid + '/' + cid, function(data) {
|
||||
$j('body').css('cursor', 'auto');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function checkboxhighlight(box) {
|
||||
if($(box).is(':checked')) {
|
||||
$(box).addClass('checkeditem');
|
||||
if($j(box).is(':checked')) {
|
||||
$j(box).addClass('checkeditem');
|
||||
}
|
||||
else {
|
||||
$(box).removeClass('checkeditem');
|
||||
$j(box).removeClass('checkeditem');
|
||||
}
|
||||
}
|
||||
|
||||
function notifyMarkAll() {
|
||||
$.get('notify/mark/all', function(data) {
|
||||
$j.get('notify/mark/all', function(data) {
|
||||
if(timer) clearTimeout(timer);
|
||||
timer = setTimeout(NavUpdate,1000);
|
||||
});
|
||||
|
@ -655,9 +655,9 @@ Array.prototype.remove = function(item) {
|
|||
};
|
||||
|
||||
function previewTheme(elm) {
|
||||
theme = $(elm).val();
|
||||
$.getJSON('pretheme?f=&theme=' + theme,function(data) {
|
||||
$('#theme-preview').html('<div id="theme-desc">' + data.desc + '</div><div id="theme-version">' + data.version + '</div><div id="theme-credits">' + data.credits + '</div><a href="' + data.img + '"><img src="' + data.img + '" width="320" height="240" alt="' + theme + '" /></a>');
|
||||
theme = $j(elm).val();
|
||||
$j.getJSON('pretheme?f=&theme=' + theme,function(data) {
|
||||
$j('#theme-preview').html('<div id="theme-desc">' + data.desc + '</div><div id="theme-version">' + data.version + '</div><div id="theme-credits">' + data.credits + '</div><a href="' + data.img + '"><img src="' + data.img + '" width="320" height="240" alt="' + theme + '" /></a>');
|
||||
});
|
||||
|
||||
}
|
||||
|
|
1
view/theme/frost-mobile/js/main.min.js
vendored
Normal file
1
view/theme/frost-mobile/js/main.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
|
@ -1,44 +1,210 @@
|
|||
$(document).ready(function() {
|
||||
$j(document).ready(function() {
|
||||
|
||||
/*$('html').click(function() { $("#nav-notifications-menu" ).hide(); });*/
|
||||
/* enable tinymce on focus and click */
|
||||
$j("#profile-jot-text").focus(enableOnUser);
|
||||
$j("#profile-jot-text").click(enableOnUser);
|
||||
|
||||
$('.group-edit-icon').hover(
|
||||
if(typeof window.AjaxUpload != "undefined") {
|
||||
switch(window.ajaxType) {
|
||||
case 'jot-header':
|
||||
var uploader = new window.AjaxUpload(
|
||||
'wall-image-upload',
|
||||
{ action: 'wall_upload/'+window.nickname,
|
||||
name: 'userfile',
|
||||
onSubmit: function(file,ext) { $j('#profile-rotator').show(); },
|
||||
onComplete: function(file,response) {
|
||||
addeditortext(response);
|
||||
$j('#profile-rotator').hide();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
var file_uploader = new window.AjaxUpload(
|
||||
'wall-file-upload',
|
||||
{ action: 'wall_attach/'+window.nickname,
|
||||
name: 'userfile',
|
||||
onSubmit: function(file,ext) { $j('#profile-rotator').show(); },
|
||||
onComplete: function(file,response) {
|
||||
addeditortext(response);
|
||||
$j('#profile-rotator').hide();
|
||||
}
|
||||
}
|
||||
);
|
||||
break;
|
||||
case 'msg-header':
|
||||
var uploader = new window.AjaxUpload(
|
||||
'prvmail-upload',
|
||||
{ action: 'wall_upload/' + window.nickname,
|
||||
name: 'userfile',
|
||||
onSubmit: function(file,ext) { $j('#profile-rotator').show(); },
|
||||
onComplete: function(file,response) {
|
||||
tinyMCE.execCommand('mceInsertRawHTML',false,response);
|
||||
$j('#profile-rotator').hide();
|
||||
}
|
||||
}
|
||||
);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(typeof acl=="undefined"){
|
||||
acl = new ACL(
|
||||
baseurl+"/acl",
|
||||
[ window.allowCID,window.allowGID,window.denyCID,window.denyGID ]
|
||||
);
|
||||
}
|
||||
|
||||
/*$j('html').click(function() { $j("#nav-notifications-menu" ).hide(); });*/
|
||||
|
||||
/*$j('.group-edit-icon').hover(
|
||||
function() {
|
||||
$(this).addClass('icon'); $(this).removeClass('iconspacer');},
|
||||
$j(this).addClass('icon'); $j(this).removeClass('iconspacer');},
|
||||
function() {
|
||||
$(this).removeClass('icon'); $(this).addClass('iconspacer');}
|
||||
$j(this).removeClass('icon'); $j(this).addClass('iconspacer');}
|
||||
);
|
||||
|
||||
$('.sidebar-group-element').hover(
|
||||
$j('.sidebar-group-element').hover(
|
||||
function() {
|
||||
id = $(this).attr('id');
|
||||
$('#edit-' + id).addClass('icon'); $('#edit-' + id).removeClass('iconspacer');},
|
||||
id = $j(this).attr('id');
|
||||
$j('#edit-' + id).addClass('icon'); $j('#edit-' + id).removeClass('iconspacer');},
|
||||
|
||||
function() {
|
||||
id = $(this).attr('id');
|
||||
$('#edit-' + id).removeClass('icon');$('#edit-' + id).addClass('iconspacer');}
|
||||
id = $j(this).attr('id');
|
||||
$j('#edit-' + id).removeClass('icon');$j('#edit-' + id).addClass('iconspacer');}
|
||||
);
|
||||
|
||||
|
||||
$('.savedsearchdrop').hover(
|
||||
$j('.savedsearchdrop').hover(
|
||||
function() {
|
||||
$(this).addClass('drop'); $(this).addClass('icon'); $(this).removeClass('iconspacer');},
|
||||
$j(this).addClass('drop'); $j(this).addClass('icon'); $j(this).removeClass('iconspacer');},
|
||||
function() {
|
||||
$(this).removeClass('drop'); $(this).removeClass('icon'); $(this).addClass('iconspacer');}
|
||||
$j(this).removeClass('drop'); $j(this).removeClass('icon'); $j(this).addClass('iconspacer');}
|
||||
);
|
||||
|
||||
$('.savedsearchterm').hover(
|
||||
$j('.savedsearchterm').hover(
|
||||
function() {
|
||||
id = $(this).attr('id');
|
||||
$('#drop-' + id).addClass('icon'); $('#drop-' + id).addClass('drophide'); $('#drop-' + id).removeClass('iconspacer');},
|
||||
id = $j(this).attr('id');
|
||||
$j('#drop-' + id).addClass('icon'); $j('#drop-' + id).addClass('drophide'); $j('#drop-' + id).removeClass('iconspacer');},
|
||||
|
||||
function() {
|
||||
id = $(this).attr('id');
|
||||
$('#drop-' + id).removeClass('icon');$('#drop-' + id).removeClass('drophide'); $('#drop-' + id).addClass('iconspacer');}
|
||||
);
|
||||
id = $j(this).attr('id');
|
||||
$j('#drop-' + id).removeClass('icon');$j('#drop-' + id).removeClass('drophide'); $j('#drop-' + id).addClass('iconspacer');}
|
||||
);*/
|
||||
|
||||
$(".popupbox").click(function () {
|
||||
var parent = $( $(this).attr('href') ).parent();
|
||||
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(calEvent, jsEvent, view) {
|
||||
showEvent(calEvent.id);
|
||||
},
|
||||
|
||||
eventRender: function(event, element, view) {
|
||||
//console.log(view.name);
|
||||
if (event.item['author-name']==null) return;
|
||||
switch(view.name){
|
||||
case "month":
|
||||
element.find(".fc-event-title").html(
|
||||
"<img src='{0}' style='height:10px;width:10px'>{1} : {2}".format(
|
||||
event.item['author-avatar'],
|
||||
event.item['author-name'],
|
||||
event.title
|
||||
));
|
||||
break;
|
||||
case "agendaWeek":
|
||||
element.find(".fc-event-title").html(
|
||||
"<img src='{0}' style='height:12px; width:12px'>{1}<p>{2}</p><p>{3}</p>".format(
|
||||
event.item['author-avatar'],
|
||||
event.item['author-name'],
|
||||
event.item.desc,
|
||||
event.item.location
|
||||
));
|
||||
break;
|
||||
case "agendaDay":
|
||||
element.find(".fc-event-title").html(
|
||||
"<img src='{0}' style='height:24px;width:24px'>{1}<p>{2}</p><p>{3}</p>".format(
|
||||
event.item['author-avatar'],
|
||||
event.item['author-name'],
|
||||
event.item.desc,
|
||||
event.item.location
|
||||
));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// center on date
|
||||
var args=location.href.replace(baseurl,"").split("/");
|
||||
if (args.length>=4) {
|
||||
$j("#events-calendar").fullCalendar('gotoDate',args[2] , args[3]-1);
|
||||
}
|
||||
|
||||
// show event popup
|
||||
var hash = location.hash.split("-")
|
||||
if (hash.length==2 && hash[0]=="#link") showEvent(hash[1]);
|
||||
}
|
||||
|
||||
if(window.aclType == "settings-head" || window.aclType == "photos_head" || window.aclType == "event_head") {
|
||||
$j('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() {
|
||||
var selstr;
|
||||
$j('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() {
|
||||
selstr = $j(this).text();
|
||||
$j('#jot-perms-icon').removeClass('unlock').addClass('lock');
|
||||
$j('#jot-public').hide();
|
||||
});
|
||||
if(selstr == null) {
|
||||
$j('#jot-perms-icon').removeClass('lock').addClass('unlock');
|
||||
$j('#jot-public').show();
|
||||
}
|
||||
|
||||
}).trigger('change');
|
||||
}
|
||||
|
||||
switch(window.autocompleteType) {
|
||||
case 'msg-header':
|
||||
var a = $j("#recip").autocomplete({
|
||||
serviceUrl: baseurl + '/acl',
|
||||
minChars: 2,
|
||||
width: 350,
|
||||
onSelect: function(value,data) {
|
||||
$j("#recip-complete").val(data);
|
||||
}
|
||||
});
|
||||
break;
|
||||
case 'contacts-head':
|
||||
var a = $j("#contacts-search").autocomplete({
|
||||
serviceUrl: baseurl + '/acl',
|
||||
minChars: 2,
|
||||
width: 350,
|
||||
});
|
||||
a.setOptions({ params: { type: 'a' }});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
$j('#event-share-checkbox').change(function() {
|
||||
|
||||
if ($j('#event-share-checkbox').is(':checked')) {
|
||||
$j('#acl-wrapper').show();
|
||||
}
|
||||
else {
|
||||
$j('#acl-wrapper').hide();
|
||||
}
|
||||
}).trigger('change');
|
||||
|
||||
|
||||
$j(".popupbox").click(function () {
|
||||
var parent = $j( $j(this).attr('href') ).parent();
|
||||
if (parent.css('display') == 'none') {
|
||||
parent.show();
|
||||
} else {
|
||||
|
@ -49,17 +215,29 @@ $(document).ready(function() {
|
|||
|
||||
});
|
||||
|
||||
// update pending count //
|
||||
$j(function(){
|
||||
|
||||
$j("nav").bind('nav-update', function(e,data){
|
||||
var elm = $j('#pending-update');
|
||||
var register = $j(data).find('register').text();
|
||||
if (register=="0") { register=""; elm.hide();} else { elm.show(); }
|
||||
elm.html(register);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
function insertFormatting(comment,BBcode,id) {
|
||||
|
||||
var tmpStr = $("#comment-edit-text-" + id).val();
|
||||
if(tmpStr == comment) {
|
||||
tmpStr = "";
|
||||
$("#comment-edit-text-" + id).addClass("comment-edit-text-full");
|
||||
$("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
|
||||
openMenu("comment-edit-submit-wrapper-" + id);
|
||||
$("#comment-edit-text-" + id).val(tmpStr);
|
||||
}
|
||||
var tmpStr = $j("#comment-edit-text-" + id).val();
|
||||
if(tmpStr == comment) {
|
||||
tmpStr = "";
|
||||
$j("#comment-edit-text-" + id).addClass("comment-edit-text-full");
|
||||
$j("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
|
||||
openMenu("comment-edit-submit-wrapper-" + id);
|
||||
$j("#comment-edit-text-" + id).val(tmpStr);
|
||||
}
|
||||
|
||||
textarea = document.getElementById("comment-edit-text-" +id);
|
||||
if (document.selection) {
|
||||
|
@ -81,52 +259,50 @@ function insertFormatting(comment,BBcode,id) {
|
|||
}
|
||||
|
||||
function cmtBbOpen(id) {
|
||||
$(".comment-edit-bb-" + id).show();
|
||||
$j(".comment-edit-bb-" + id).show();
|
||||
}
|
||||
function cmtBbClose(id) {
|
||||
$(".comment-edit-bb-" + id).hide();
|
||||
$j(".comment-edit-bb-" + id).hide();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// TinyMCE stuff
|
||||
// Needs to be in "jot-header.tpl" if the "$editselect" variable is used
|
||||
|
||||
var editor=false;
|
||||
var textlen = 0;
|
||||
var plaintext = 'none';//'$editselect';
|
||||
var plaintext = 'none';//window.editSelect;
|
||||
var ispublic = window.isPublic;
|
||||
|
||||
function initEditor(cb){
|
||||
if (editor==false){
|
||||
// $("#profile-jot-text-loading").show();
|
||||
// $j("#profile-jot-text-loading").show();
|
||||
if(plaintext == 'none') {
|
||||
// $("#profile-jot-text-loading").hide();
|
||||
$("#profile-jot-text").css({ 'height': 200, 'color': '#000' });
|
||||
$("#profile-jot-text").contact_autocomplete(baseurl+"/acl");
|
||||
// $j("#profile-jot-text-loading").hide();
|
||||
$j("#profile-jot-text").css({ 'height': 200, 'color': '#000' });
|
||||
$j("#profile-jot-text").contact_autocomplete(baseurl+"/acl");
|
||||
editor = true;
|
||||
/* $("a#jot-perms-icon").fancybox({
|
||||
/* $j("a#jot-perms-icon").fancybox({
|
||||
'transitionIn' : 'none',
|
||||
'transitionOut' : 'none'
|
||||
});*/
|
||||
$("a#jot-perms-icon, a#settings-default-perms-menu").click(function () {
|
||||
var parent = $("#profile-jot-acl-wrapper").parent();
|
||||
$j("a#jot-perms-icon, a#settings-default-perms-menu").click(function () {
|
||||
var parent = $j("#profile-jot-acl-wrapper").parent();
|
||||
if (parent.css('display') == 'none') {
|
||||
parent.show();
|
||||
} else {
|
||||
parent.hide();
|
||||
}
|
||||
// $("#profile-jot-acl-wrapper").parent().toggle();
|
||||
// $j("#profile-jot-acl-wrapper").parent().toggle();
|
||||
return false;
|
||||
});
|
||||
$(".jothidden").show();
|
||||
$j(".jothidden").show();
|
||||
if (typeof cb!="undefined") cb();
|
||||
return;
|
||||
}
|
||||
/* tinyMCE.init({
|
||||
theme : "advanced",
|
||||
mode : "specific_textareas",
|
||||
editor_selector: $editselect,
|
||||
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",
|
||||
|
@ -169,37 +345,37 @@ function initEditor(cb){
|
|||
}
|
||||
|
||||
textlen = txt.length;
|
||||
if(textlen != 0 && $('#jot-perms-icon').is('.unlock')) {
|
||||
$('#profile-jot-desc').html(ispublic);
|
||||
if(textlen != 0 && $j('#jot-perms-icon').is('.unlock')) {
|
||||
$j('#profile-jot-desc').html(ispublic);
|
||||
}
|
||||
else {
|
||||
$('#profile-jot-desc').html(' ');
|
||||
$j('#profile-jot-desc').html(' ');
|
||||
}
|
||||
|
||||
//Character count
|
||||
|
||||
if(textlen <= 140) {
|
||||
$('#character-counter').removeClass('red');
|
||||
$('#character-counter').removeClass('orange');
|
||||
$('#character-counter').addClass('grey');
|
||||
$j('#character-counter').removeClass('red');
|
||||
$j('#character-counter').removeClass('orange');
|
||||
$j('#character-counter').addClass('grey');
|
||||
}
|
||||
if((textlen > 140) && (textlen <= 420)) {
|
||||
$('#character-counter').removeClass('grey');
|
||||
$('#character-counter').removeClass('red');
|
||||
$('#character-counter').addClass('orange');
|
||||
$j('#character-counter').removeClass('grey');
|
||||
$j('#character-counter').removeClass('red');
|
||||
$j('#character-counter').addClass('orange');
|
||||
}
|
||||
if(textlen > 420) {
|
||||
$('#character-counter').removeClass('grey');
|
||||
$('#character-counter').removeClass('orange');
|
||||
$('#character-counter').addClass('red');
|
||||
$j('#character-counter').removeClass('grey');
|
||||
$j('#character-counter').removeClass('orange');
|
||||
$j('#character-counter').addClass('red');
|
||||
}
|
||||
$('#character-counter').text(textlen);
|
||||
$j('#character-counter').text(textlen);
|
||||
});
|
||||
|
||||
ed.onInit.add(function(ed) {
|
||||
ed.pasteAsPlainText = true;
|
||||
$("#profile-jot-text-loading").hide();
|
||||
$(".jothidden").show();
|
||||
$j("#profile-jot-text-loading").hide();
|
||||
$j(".jothidden").show();
|
||||
if (typeof cb!="undefined") cb();
|
||||
});
|
||||
|
||||
|
@ -207,7 +383,7 @@ function initEditor(cb){
|
|||
});
|
||||
editor = true;
|
||||
// setup acl popup
|
||||
$("a#jot-perms-icon").fancybox({
|
||||
$j("a#jot-perms-icon").fancybox({
|
||||
'transitionIn' : 'elastic',
|
||||
'transitionOut' : 'elastic'
|
||||
}); */
|
||||
|
@ -218,7 +394,364 @@ function initEditor(cb){
|
|||
|
||||
function enableOnUser(){
|
||||
if (editor) return;
|
||||
$(this).val("");
|
||||
$j(this).val("");
|
||||
initEditor();
|
||||
}
|
||||
|
||||
function wallInitEditor() {
|
||||
var plaintext = window.editSelect;
|
||||
|
||||
if(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 : true,
|
||||
paste_text_sticky : true,
|
||||
entity_encoding : "raw",
|
||||
add_unload_trigger : false,
|
||||
remove_linebreaks : false,
|
||||
force_p_newlines : false,
|
||||
force_br_newlines : true,
|
||||
forced_root_block : '',
|
||||
convert_urls: false,
|
||||
content_css: baseurl + "/view/custom_tinymce.css",
|
||||
//Character count
|
||||
theme_advanced_path : false,
|
||||
setup : function(ed) {
|
||||
ed.onInit.add(function(ed) {
|
||||
ed.pasteAsPlainText = true;
|
||||
var editorId = ed.editorId;
|
||||
var textarea = $j('#'+editorId);
|
||||
if (typeof(textarea.attr('tabindex')) != "undefined") {
|
||||
$j('#'+editorId+'_ifr').attr('tabindex', textarea.attr('tabindex'));
|
||||
textarea.attr('tabindex', null);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
$j("#prvmail-text").contact_autocomplete(baseurl+"/acl");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function initCrop() {
|
||||
function onEndCrop( coords, dimensions ) {
|
||||
$( 'x1' ).value = coords.x1;
|
||||
$( 'y1' ).value = coords.y1;
|
||||
$( 'x2' ).value = coords.x2;
|
||||
$( 'y2' ).value = coords.y2;
|
||||
$( 'width' ).value = dimensions.width;
|
||||
$( 'height' ).value = dimensions.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: true,
|
||||
onEndCrop: onEndCrop
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function confirmDelete() { return confirm(window.delItem); }
|
||||
function commentOpen(obj,id) {
|
||||
if(obj.value == window.commentEmptyText) {
|
||||
obj.value = "";
|
||||
$j("#comment-edit-text-" + id).addClass("comment-edit-text-full");
|
||||
$j("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
|
||||
$j("#mod-cmnt-wrap-" + id).show();
|
||||
openMenu("comment-edit-submit-wrapper-" + id);
|
||||
}
|
||||
}
|
||||
function commentClose(obj,id) {
|
||||
if(obj.value == "") {
|
||||
obj.value = window.commentEmptyText;
|
||||
$j("#comment-edit-text-" + id).removeClass("comment-edit-text-full");
|
||||
$j("#comment-edit-text-" + id).addClass("comment-edit-text-empty");
|
||||
$j("#mod-cmnt-wrap-" + id).hide();
|
||||
closeMenu("comment-edit-submit-wrapper-" + id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function commentInsert(obj,id) {
|
||||
var tmpStr = $j("#comment-edit-text-" + id).val();
|
||||
if(tmpStr == window.commentEmptyText) {
|
||||
tmpStr = "";
|
||||
$j("#comment-edit-text-" + id).addClass("comment-edit-text-full");
|
||||
$j("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
|
||||
openMenu("comment-edit-submit-wrapper-" + id);
|
||||
}
|
||||
var ins = $j(obj).html();
|
||||
ins = ins.replace("<","<");
|
||||
ins = ins.replace(">",">");
|
||||
ins = ins.replace("&","&");
|
||||
ins = ins.replace(""",'"');
|
||||
$j("#comment-edit-text-" + id).val(tmpStr + ins);
|
||||
}
|
||||
|
||||
function qCommentInsert(obj,id) {
|
||||
var tmpStr = $j("#comment-edit-text-" + id).val();
|
||||
if(tmpStr == window.commentEmptyText) {
|
||||
tmpStr = "";
|
||||
$j("#comment-edit-text-" + id).addClass("comment-edit-text-full");
|
||||
$j("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
|
||||
openMenu("comment-edit-submit-wrapper-" + id);
|
||||
}
|
||||
var ins = $j(obj).val();
|
||||
ins = ins.replace("<","<");
|
||||
ins = ins.replace(">",">");
|
||||
ins = ins.replace("&","&");
|
||||
ins = ins.replace(""",'"');
|
||||
$j("#comment-edit-text-" + id).val(tmpStr + ins);
|
||||
$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 deleteCheckedItems() {
|
||||
var checkedstr = '';
|
||||
|
||||
$j('.item-select').each( function() {
|
||||
if($j(this).is(':checked')) {
|
||||
if(checkedstr.length != 0) {
|
||||
checkedstr = checkedstr + ',' + $j(this).val();
|
||||
}
|
||||
else {
|
||||
checkedstr = $j(this).val();
|
||||
}
|
||||
}
|
||||
});
|
||||
$j.post('item', { dropitems: checkedstr }, function(data) {
|
||||
window.location.reload();
|
||||
});
|
||||
}*/
|
||||
|
||||
function jotVideoURL() {
|
||||
reply = prompt(window.vidURL);
|
||||
if(reply && reply.length) {
|
||||
addeditortext('[video]' + reply + '[/video]');
|
||||
}
|
||||
}
|
||||
|
||||
function jotAudioURL() {
|
||||
reply = prompt(window.audURL);
|
||||
if(reply && reply.length) {
|
||||
addeditortext('[audio]' + reply + '[/audio]');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function jotGetLocation() {
|
||||
reply = prompt(window.whereAreU, $j('#jot-location').val());
|
||||
if(reply && reply.length) {
|
||||
$j('#jot-location').val(reply);
|
||||
}
|
||||
}
|
||||
|
||||
function jotShare(id) {
|
||||
if ($j('#jot-popup').length != 0) $j('#jot-popup').show();
|
||||
|
||||
$j('#like-rotator-' + id).show();
|
||||
$j.get('share/' + id, function(data) {
|
||||
if (!editor) $j("#profile-jot-text").val("");
|
||||
initEditor(function(){
|
||||
addeditortext(data);
|
||||
$j('#like-rotator-' + id).hide();
|
||||
$j(window).scrollTop(0);
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function linkdropper(event) {
|
||||
var linkFound = event.dataTransfer.types.contains("text/uri-list");
|
||||
if(linkFound)
|
||||
event.preventDefault();
|
||||
}
|
||||
|
||||
switch(window.ajaxType) {
|
||||
case 'jot-header':
|
||||
function jotGetLink() {
|
||||
reply = prompt(window.linkURL);
|
||||
if(reply && reply.length) {
|
||||
reply = bin2hex(reply);
|
||||
$j('#profile-rotator').show();
|
||||
$j.get('parse_url?binurl=' + reply, function(data) {
|
||||
addeditortext(data);
|
||||
$j('#profile-rotator').hide();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function linkdrop(event) {
|
||||
var reply = event.dataTransfer.getData("text/uri-list");
|
||||
event.target.textContent = reply;
|
||||
event.preventDefault();
|
||||
if(reply && reply.length) {
|
||||
reply = bin2hex(reply);
|
||||
$j('#profile-rotator').show();
|
||||
$j.get('parse_url?binurl=' + reply, function(data) {
|
||||
if (!editor) $j("#profile-jot-text").val("");
|
||||
initEditor(function(){
|
||||
addeditortext(data);
|
||||
$j('#profile-rotator').hide();
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'msg-header':
|
||||
case 'wallmsg-header':
|
||||
// TINYMCE -- BAD
|
||||
function jotGetLink() {
|
||||
reply = prompt(window.linkURL);
|
||||
if(reply && reply.length) {
|
||||
$j('#profile-rotator').show();
|
||||
$j.get('parse_url?url=' + reply, function(data) {
|
||||
tinyMCE.execCommand('mceInsertRawHTML',false,data);
|
||||
$j('#profile-rotator').hide();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function linkdrop(event) {
|
||||
var reply = event.dataTransfer.getData("text/uri-list");
|
||||
event.target.textContent = reply;
|
||||
event.preventDefault();
|
||||
if(reply && reply.length) {
|
||||
$j('#profile-rotator').show();
|
||||
$j.get('parse_url?url=' + reply, function(data) {
|
||||
tinyMCE.execCommand('mceInsertRawHTML',false,data);
|
||||
$j('#profile-rotator').hide();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
function showEvent(eventid) {
|
||||
/* $j.get(
|
||||
baseurl + '/events/?id='+eventid,
|
||||
function(data){
|
||||
$j.fancybox(data);
|
||||
}
|
||||
);*/
|
||||
}
|
||||
|
||||
|
||||
function itemTag(id) {
|
||||
reply = prompt(window.term);
|
||||
if(reply && reply.length) {
|
||||
reply = reply.replace('#','');
|
||||
if(reply.length) {
|
||||
|
||||
commentBusy = true;
|
||||
$j('body').css('cursor', 'wait');
|
||||
|
||||
$j.get('tagger/' + id + '?term=' + reply, NavUpdate);
|
||||
/*if(timer) clearTimeout(timer);
|
||||
timer = setTimeout(NavUpdate,3000);*/
|
||||
liking = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function itemFiler(id) {
|
||||
|
||||
$j.get('filer/', function(data){
|
||||
|
||||
var promptText = $j('#id_term_label', data).text();
|
||||
|
||||
reply = prompt(promptText);
|
||||
if(reply && reply.length) {
|
||||
commentBusy = true;
|
||||
$j('body').css('cursor', 'wait');
|
||||
$j.get('filer/' + id + '?term=' + reply, NavUpdate);
|
||||
/* if(timer) clearTimeout(timer);
|
||||
timer = setTimeout(NavUpdate,3000);*/
|
||||
liking = 1;
|
||||
/* $j.fancybox.close();*/
|
||||
}
|
||||
});
|
||||
|
||||
/* var bordercolor = $j("input").css("border-color");
|
||||
|
||||
$j.get('filer/', function(data){
|
||||
$j.fancybox(data);
|
||||
$j("#id_term").keypress(function(){
|
||||
$j(this).css("border-color",bordercolor);
|
||||
})
|
||||
$j("#select_term").change(function(){
|
||||
$j("#id_term").css("border-color",bordercolor);
|
||||
})
|
||||
|
||||
$j("#filer_save").click(function(e){
|
||||
e.preventDefault();
|
||||
reply = $j("#id_term").val();
|
||||
if(reply && reply.length) {
|
||||
commentBusy = true;
|
||||
$j('body').css('cursor', 'wait');
|
||||
$j.get('filer/' + id + '?term=' + reply);
|
||||
if(timer) clearTimeout(timer);
|
||||
timer = setTimeout(NavUpdate,3000);
|
||||
liking = 1;
|
||||
$j.fancybox.close();
|
||||
} else {
|
||||
$j("#id_term").css("border-color","#FF0000");
|
||||
}
|
||||
return false;
|
||||
});
|
||||
});
|
||||
*/
|
||||
}
|
||||
|
||||
function jotClearLocation() {
|
||||
$j('#jot-coord').val('');
|
||||
$j('#profile-nolocation-wrapper').hide();
|
||||
}
|
||||
|
||||
function addeditortext(data) {
|
||||
if(plaintext == 'none') {
|
||||
var currentText = $j("#profile-jot-text").val();
|
||||
$j("#profile-jot-text").val(currentText + data);
|
||||
}
|
||||
/*else
|
||||
tinyMCE.execCommand('mceInsertRawHTML',false,data);*/
|
||||
}
|
||||
|
||||
if(typeof window.geoTag === 'function') window.geoTag();
|
||||
|
||||
|
||||
|
|
|
@ -1,121 +0,0 @@
|
|||
$(document).ready(function() {
|
||||
|
||||
$.ajaxSetup({
|
||||
cache: false
|
||||
});
|
||||
|
||||
|
||||
$('.system-menu-link').click(function() {
|
||||
handleNavMenu('#system-menu-list');
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.contacts-menu-link').click(function() {
|
||||
handleNavMenu('#contacts-menu-list');
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.network-menu-link').click(function() {
|
||||
handleNavMenu('#network-menu-list');
|
||||
return false;
|
||||
});
|
||||
|
||||
/* $('.nav-load-page-link').click(function() {
|
||||
getPageContent( $(this).attr('href') );
|
||||
hideNavMenu( '#' + $(this).closest('ul').attr('id') );
|
||||
return false;
|
||||
});*/
|
||||
|
||||
/* $('#nav-network-link').click(function() {
|
||||
getPageContent('/network', '#network-menu-list');
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#nav-home-link').click(function() {
|
||||
|
||||
var username = $('#site-location').text();
|
||||
username = username.substring(0, username.indexOf('@'));
|
||||
|
||||
getPageContent('/profile/' + username, '#network-menu-list');
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#nav-community-link').click(function() {
|
||||
getPageContent('/community', '#network-menu-list');
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#nav-messages-link').click(function() {
|
||||
getPageContent('/message');
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#nav-contacts-link').click(function() {
|
||||
getPageContent('/contacts', '#contacts-menu-list');
|
||||
return false;
|
||||
});*/
|
||||
|
||||
});
|
||||
|
||||
$(document).mouseup(function (clickPos) {
|
||||
|
||||
var sysMenu = $("#system-menu-list");
|
||||
var sysMenuLink = $(".system-menu-link");
|
||||
var contactsMenu = $("#contacts-menu-list");
|
||||
var contactsMenuLink = $(".contacts-menu-link");
|
||||
var networkMenu = $("#network-menu-list");
|
||||
var networkMenuLink = $(".network-menu-link");
|
||||
|
||||
if( !sysMenu.is(clickPos.target) && !sysMenuLink.is(clickPos.target) && sysMenu.has(clickPos.target).length === 0) {
|
||||
hideNavMenu("#system-menu-list");
|
||||
}
|
||||
if( !contactsMenu.is(clickPos.target) && !contactsMenuLink.is(clickPos.target) && contactsMenu.has(clickPos.target).length === 0) {
|
||||
hideNavMenu("#contacts-menu-list");
|
||||
}
|
||||
if( !networkMenu.is(clickPos.target) && !networkMenuLink.is(clickPos.target) && networkMenu.has(clickPos.target).length === 0) {
|
||||
hideNavMenu("#network-menu-list");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function getPageContent(url) {
|
||||
|
||||
var pos = $('.main-container').position();
|
||||
|
||||
$('.main-container').css('margin-left', pos.left);
|
||||
$('.main-content-container').hide(0, function () {
|
||||
$('.main-content-loading').show(0);
|
||||
});
|
||||
|
||||
$.get(url, function(html) {
|
||||
console.log($('.main-content-container').html());
|
||||
$('.main-content-container').html( $('.main-content-container', html).html() );
|
||||
console.log($('.main-content-container').html());
|
||||
$('.main-content-loading').hide(function() {
|
||||
$('.main-content-container').fadeIn(800,function() {
|
||||
$('.main-container').css('margin-left', 'auto'); // This sucks -- if the CSS specification changes, this will be wrong
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function handleNavMenu(menuID) {
|
||||
if( $(menuID).hasClass('menu-visible') ) {
|
||||
hideNavMenu(menuID);
|
||||
}
|
||||
else {
|
||||
showNavMenu(menuID);
|
||||
}
|
||||
}
|
||||
|
||||
function showNavMenu(menuID) {
|
||||
$(menuID).show();
|
||||
$(menuID).addClass('menu-visible');
|
||||
}
|
||||
|
||||
function hideNavMenu(menuID) {
|
||||
$(menuID).hide();
|
||||
$(menuID).removeClass('menu-visible');
|
||||
}
|
||||
|
1
view/theme/frost-mobile/js/theme.min.js
vendored
Normal file
1
view/theme/frost-mobile/js/theme.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue