From 74caf1a4a745643312ab4ee2bf28d7e82c9e1350 Mon Sep 17 00:00:00 2001 From: Zach Prezkuta Date: Sat, 12 Jan 2013 06:31:32 -0700 Subject: [PATCH] * Add MIME types for file attachments * Restore translatability to mood phrases * Prevent casting of "false" in html2plain * Allow attachments with a comma in the filename * Fix/optimize ACL img data-src jQuery search * Fix bug when uploading files with a comma in the name using Chrome/Chromium * Babel nicer output formatting * Remove obsolete "plaintext" check in mod/parse_url * Restore TinyMCE live insertion of images * Smarty conversion script: add --no-header option to suppress warning headers in Smarty template files --- include/attach.php | 4 ++++ include/conversation.php | 21 +++++++--------- include/html2plain.php | 2 +- include/items.php | 4 ++-- include/notifier.php | 4 ++++ include/text.php | 4 ++-- js/acl.js | 2 +- js/acl.min.js | 2 +- mod/attach.php | 6 +++-- mod/babel.php | 24 +++++++++++-------- mod/parse_url.php | 2 -- mod/wall_upload.php | 7 +++++- mods/friendica-to-smarty-tpl.py | 11 ++++++--- view/smarty3/voting_fakelink.tpl | 3 +-- view/theme/frost-mobile/js/acl.js | 4 ++-- view/theme/frost-mobile/js/acl.min.js | 2 +- view/theme/frost-mobile/js/main.js | 4 ++-- view/theme/frost-mobile/js/main.min.js | 2 +- .../frost-mobile/smarty3/voting_fakelink.tpl | 3 +-- view/theme/frost-mobile/voting_fakelink.tpl | 3 +-- view/theme/frost/acl_selector.tpl | 1 + view/theme/frost/js/acl.js | 4 ++-- view/theme/frost/js/acl.min.js | 2 +- view/theme/frost/js/main.js | 4 ++-- view/theme/frost/js/main.min.js | 2 +- view/theme/frost/smarty3/acl_selector.tpl | 1 + view/theme/frost/smarty3/voting_fakelink.tpl | 3 +-- view/theme/frost/voting_fakelink.tpl | 3 +-- view/voting_fakelink.tpl | 3 +-- 29 files changed, 75 insertions(+), 62 deletions(-) diff --git a/include/attach.php b/include/attach.php index 6d611cec0..079911ffa 100644 --- a/include/attach.php +++ b/include/attach.php @@ -42,6 +42,10 @@ function z_mime_content_type($filename) { 'qt' => 'video/quicktime', 'mov' => 'video/quicktime', 'ogg' => 'application/ogg', + 'mp4' => 'video/mp4', + 'avi' => 'video/x-msvideo', + 'wmv' => 'video/x-ms-wmv', + 'wma' => 'audio/x-ms-wma', // adobe 'pdf' => 'application/pdf', diff --git a/include/conversation.php b/include/conversation.php index 9420d8b74..e659ca04d 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -877,26 +877,21 @@ function format_like($cnt,$arr,$type,$id) { if($cnt == 1) $o .= (($type === 'like') ? sprintf( t('%s likes this.'), $arr[0]) : sprintf( t('%s doesn\'t like this.'), $arr[0])) . EOL ; else { - //$spanatts = 'class="fakelink" onclick="openClose(\'' . $type . 'list-' . $id . '\');"'; + $spanatts = "class=\"fakelink\" onclick=\"openClose('{$type}list-$id');\""; switch($type) { case 'like': -// $phrase = sprintf( t('%2$d people like this.'), $spanatts, $cnt); - $mood = t('like this'); + $phrase = sprintf( t('%2$d people like this'), $spanatts, $cnt); break; case 'dislike': -// $phrase = sprintf( t('%2$d people don\'t like this.'), $spanatts, $cnt); - $mood = t('don\'t like this'); + $phrase = sprintf( t('%2$d people don\'t like this'), $spanatts, $cnt); break; } - $tpl = get_markup_template("voting_fakelink.tpl"); - $phrase = replace_macros($tpl, array( - '$vote_id' => $type . 'list-' . $id, - '$count' => $cnt, - '$people' => t('people'), - '$vote_mood' => $mood + $phrase .= EOL ; + $o .= replace_macros(get_markup_template('voting_fakelink.tpl'), array( + '$phrase' => $phrase, + '$type' => $type, + '$id' => $id )); - $o .= $phrase; -// $o .= EOL ; $total = count($arr); if($total >= MAX_LIKERS) diff --git a/include/html2plain.php b/include/html2plain.php index bafaadd8d..572f9714a 100644 --- a/include/html2plain.php +++ b/include/html2plain.php @@ -209,7 +209,7 @@ function html2plain($html, $wraplength = 75, $compact = false) if (!$compact) { $counter = 1; foreach ($urls as $id=>$url) - if (strpos($message, $url) == false) + if (strpos($message, $url) === false) $message .= "\n".$url." "; //$message .= "\n[".($counter++)."] ".$url; } diff --git a/include/items.php b/include/items.php index b465c444e..08127c6eb 100755 --- a/include/items.php +++ b/include/items.php @@ -3732,11 +3732,11 @@ function item_getfeedtags($item) { function item_getfeedattach($item) { $ret = ''; - $arr = explode(',',$item['attach']); + $arr = explode('[/attach],',$item['attach']); if(count($arr)) { foreach($arr as $r) { $matches = false; - $cnt = preg_match('|\[attach\]href=\"(.*?)\" length=\"(.*?)\" type=\"(.*?)\" title=\"(.*?)\"\[\/attach\]|',$r,$matches); + $cnt = preg_match('|\[attach\]href=\"(.*?)\" length=\"(.*?)\" type=\"(.*?)\" title=\"(.*?)\"|',$r,$matches); if($cnt) { $ret .= '")}),$(that.allow_cid).each(function(e,t){aclfileds.append("")}),$(that.deny_gid).each(function(e,t){aclfileds.append("")}),$(that.deny_cid).each(function(e,t){aclfileds.append("")})},ACL.prototype.search=function(){var e=$("#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($(this).parent().attr("id")),!1},ACL.prototype.on_button_hide=function(e){return e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation(),that.set_deny($(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"),$("#jot-perms-icon").removeClass("lock").addClass("unlock"),$("#jot-public").show(),$(".profile-jot-net input").attr("disabled",!1),typeof editor!="undefined"&&editor!=0&&$("#profile-jot-desc").html(ispublic)):(that.showall.removeClass("selected"),$("#jot-perms-icon").removeClass("unlock").addClass("lock"),$("#jot-public").hide(),$(".profile-jot-net input").attr("disabled","disabled"),$("#profile-jot-desc").html(" ")),$("#acl-list-content .acl-list-item").each(function(){$(this).removeClass("groupshow grouphide")}),$("#acl-list-content .acl-list-item").each(function(){itemid=$(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");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"),$(that.group_uids[id]).each(function(t,n){e=="grouphide"&&$("#c"+n).removeClass("groupshow");if(e!=""){var r=$("#c"+n).attr("class");if(r==undefined)return!0;var i=r.indexOf("grouphide");i==-1&&$("#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};$.ajax({type:"POST",url:that.url,data:r,dataType:"json",success:that.populate})},ACL.prototype.populate=function(e){var t=Math.ceil(e.tot/that.nw)*42;that.list_content.height(t),$(e.items).each(function(){html="
"+that.item_tpl+"
",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()}; \ No newline at end of file +function ACL(backend_url,preset){that=this;that.url=backend_url;that.kp_timer=null;if(preset==undefined)preset=[];that.allow_cid=preset[0]||[];that.allow_gid=preset[1]||[];that.deny_cid=preset[2]||[];that.deny_gid=preset[3]||[];that.group_uids=[];that.nw=4;that.list_content=$("#acl-list-content");that.item_tpl=unescape($(".acl-list-item[rel=acl-template]").html());that.showall=$("#acl-showall");if(preset.length==0)that.showall.addClass("selected");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);that.get(0,100)}ACL.prototype.on_submit=function(){aclfileds=$("#acl-fields").html("");$(that.allow_gid).each(function(i,v){aclfileds.append("")});$(that.allow_cid).each(function(i,v){aclfileds.append("")});$(that.deny_gid).each(function(i,v){aclfileds.append("")});$(that.deny_cid).each(function(i,v){aclfileds.append("")})};ACL.prototype.search=function(){var srcstr=$("#acl-search").val();that.list_content.html("");that.get(0,100,srcstr)};ACL.prototype.on_search=function(event){if(that.kp_timer)clearTimeout(that.kp_timer);that.kp_timer=setTimeout(that.search,1e3)};ACL.prototype.on_showall=function(event){event.preventDefault();event.stopPropagation();if(that.showall.hasClass("selected")){return false}that.showall.addClass("selected");that.allow_cid=[];that.allow_gid=[];that.deny_cid=[];that.deny_gid=[];that.update_view();return false};ACL.prototype.on_button_show=function(event){event.preventDefault();event.stopImmediatePropagation();event.stopPropagation();that.set_allow($(this).parent().attr("id"));return false};ACL.prototype.on_button_hide=function(event){event.preventDefault();event.stopImmediatePropagation();event.stopPropagation();that.set_deny($(this).parent().attr("id"));return false};ACL.prototype.set_allow=function(itemid){type=itemid[0];id=parseInt(itemid.substr(1));switch(type){case"g":if(that.allow_gid.indexOf(id)<0){that.allow_gid.push(id)}else{that.allow_gid.remove(id)}if(that.deny_gid.indexOf(id)>=0)that.deny_gid.remove(id);break;case"c":if(that.allow_cid.indexOf(id)<0){that.allow_cid.push(id)}else{that.allow_cid.remove(id)}if(that.deny_cid.indexOf(id)>=0)that.deny_cid.remove(id);break}that.update_view()};ACL.prototype.set_deny=function(itemid){type=itemid[0];id=parseInt(itemid.substr(1));switch(type){case"g":if(that.deny_gid.indexOf(id)<0){that.deny_gid.push(id)}else{that.deny_gid.remove(id)}if(that.allow_gid.indexOf(id)>=0)that.allow_gid.remove(id);break;case"c":if(that.deny_cid.indexOf(id)<0){that.deny_cid.push(id)}else{that.deny_cid.remove(id)}if(that.allow_cid.indexOf(id)>=0)that.allow_cid.remove(id);break}that.update_view()};ACL.prototype.update_view=function(){if(that.allow_gid.length==0&&that.allow_cid.length==0&&that.deny_gid.length==0&&that.deny_cid.length==0){that.showall.addClass("selected");$("#jot-perms-icon").removeClass("lock").addClass("unlock");$("#jot-public").show();$(".profile-jot-net input").attr("disabled",false);if(typeof editor!="undefined"&&editor!=false){$("#profile-jot-desc").html(ispublic)}}else{that.showall.removeClass("selected");$("#jot-perms-icon").removeClass("unlock").addClass("lock");$("#jot-public").hide();$(".profile-jot-net input").attr("disabled","disabled");$("#profile-jot-desc").html(" ")}$("#acl-list-content .acl-list-item").each(function(){$(this).removeClass("groupshow grouphide")});$("#acl-list-content .acl-list-item").each(function(){itemid=$(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");switch(type){case"g":var uclass="";if(that.allow_gid.indexOf(id)>=0){btshow.addClass("selected");bthide.removeClass("selected");uclass="groupshow"}if(that.deny_gid.indexOf(id)>=0){btshow.removeClass("selected");bthide.addClass("selected");uclass="grouphide"}$(that.group_uids[id]).each(function(i,v){if(uclass=="grouphide")$("#c"+v).removeClass("groupshow");if(uclass!=""){var cls=$("#c"+v).attr("class");if(cls==undefined)return true;var hiding=cls.indexOf("grouphide");if(hiding==-1)$("#c"+v).addClass(uclass)}});break;case"c":if(that.allow_cid.indexOf(id)>=0){btshow.addClass("selected");bthide.removeClass("selected")}if(that.deny_cid.indexOf(id)>=0){btshow.removeClass("selected");bthide.addClass("selected")}}})};ACL.prototype.get=function(start,count,search){var postdata={start:start,count:count,search:search};$.ajax({type:"POST",url:that.url,data:postdata,dataType:"json",success:that.populate})};ACL.prototype.populate=function(data){var height=Math.ceil(data.tot/that.nw)*42;that.list_content.height(height);$(data.items).each(function(){html="
"+that.item_tpl+"
";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;that.list_content.append(html)});$(".acl-list-item img[data-src]",that.list_content).each(function(i,el){$(el).attr("src",$(el).data("src"))});that.update_view()}; \ No newline at end of file diff --git a/mod/attach.php b/mod/attach.php index ae6540201..76d60a690 100644 --- a/mod/attach.php +++ b/mod/attach.php @@ -34,9 +34,11 @@ function attach_init(&$a) { return; } + // Use quotes around the filename to prevent a "multiple Content-Disposition" + // error in Chrome for filenames with commas in them header('Content-type: ' . $r[0]['filetype']); - header('Content-disposition: attachment; filename=' . $r[0]['filename']); + header('Content-disposition: attachment; filename="' . $r[0]['filename'] . '"'); echo $r[0]['data']; killme(); // NOTREACHED -} \ No newline at end of file +} diff --git a/mod/babel.php b/mod/babel.php index ca2c068f8..d31e090c5 100644 --- a/mod/babel.php +++ b/mod/babel.php @@ -11,7 +11,7 @@ function visible_lf($s) { function babel_content(&$a) { - $o .= '

Babel Diagnostic

'; + $o .= '

Babel Diagnostic

'; $o .= '
'; $o .= t('Source (bbcode) text:') . EOL . '' . EOL; @@ -28,31 +28,35 @@ function babel_content(&$a) { if(x($_REQUEST,'text')) { $text = trim($_REQUEST['text']); - $o .= t("Source input: ") . EOL. EOL; + $o .= "

" . t("Source input: ") . "

" . EOL. EOL; $o .= visible_lf($text) . EOL. EOL; $html = bbcode($text); - $o .= t("bb2html: ") . EOL. EOL; + $o .= "

" . t("bb2html (raw HTML): ") . "

" . EOL. EOL; + $o .= htmlspecialchars($html). EOL. EOL; + + //$html = bbcode($text); + $o .= "

" . t("bb2html: ") . "

" . EOL. EOL; $o .= $html. EOL. EOL; $bbcode = html2bbcode($html); - $o .= t("bb2html2bb: ") . EOL. EOL; + $o .= "

" . t("bb2html2bb: ") . "

" . EOL. EOL; $o .= visible_lf($bbcode) . EOL. EOL; $diaspora = bb2diaspora($text); - $o .= t("bb2md: ") . EOL. EOL; + $o .= "

" . t("bb2md: ") . "

" . EOL. EOL; $o .= visible_lf($diaspora) . EOL. EOL; $html = Markdown($diaspora); - $o .= t("bb2md2html: ") . EOL. EOL; + $o .= "

" . t("bb2md2html: ") . "

" . EOL. EOL; $o .= $html. EOL. EOL; $bbcode = diaspora2bb($diaspora); - $o .= t("bb2dia2bb: ") . EOL. EOL; + $o .= "

" . t("bb2dia2bb: ") . "

" . EOL. EOL; $o .= visible_lf($bbcode) . EOL. EOL; $bbcode = html2bbcode($html); - $o .= t("bb2md2html2bb: ") . EOL. EOL; + $o .= "

" . t("bb2md2html2bb: ") . "

" . EOL. EOL; $o .= visible_lf($bbcode) . EOL. EOL; @@ -62,12 +66,12 @@ function babel_content(&$a) { if(x($_REQUEST,'d2bbtext')) { $d2bbtext = trim($_REQUEST['d2bbtext']); - $o .= t("Source input (Diaspora format): ") . EOL. EOL; + $o .= "

" . t("Source input (Diaspora format): ") . "

" . EOL. EOL; $o .= visible_lf($d2bbtext) . EOL. EOL; $bb = diaspora2bb($d2bbtext); - $o .= t("diaspora2bb: ") . EOL. EOL; + $o .= "

" . t("diaspora2bb: ") . "

" . EOL. EOL; $o .= visible_lf($bb) . EOL. EOL; } diff --git a/mod/parse_url.php b/mod/parse_url.php index 400c248e0..a2b4c9e28 100644 --- a/mod/parse_url.php +++ b/mod/parse_url.php @@ -236,8 +236,6 @@ function parse_url_content(&$a) { $str_tags = ''; $textmode = false; - if(local_user() && intval(get_pconfig(local_user(),'system','plaintext'))) - $textmode = true; if(local_user() && (! feature_enabled(local_user(),'richtext'))) $textmode = true; diff --git a/mod/wall_upload.php b/mod/wall_upload.php index d35b703aa..3bd3d8dc2 100644 --- a/mod/wall_upload.php +++ b/mod/wall_upload.php @@ -160,7 +160,12 @@ function wall_upload_post(&$a) { //if we get the signal then return the image url info in BBCODE, otherwise this outputs the info and bails (for the ajax image uploader on wall post) if ($_REQUEST['hush']!='yeah') { - echo "\n\n" . '[url=' . $a->get_baseurl() . '/photos/' . $page_owner_nick . '/image/' . $hash . '][img]' . $a->get_baseurl() . "/photo/{$hash}-{$smallest}.".$ph->getExt()."[/img][/url]\n\n"; + if(local_user() && (! feature_enabled(local_user(),'richtext') || x($_REQUEST['nomce'])) ) { + echo "\n\n" . '[url=' . $a->get_baseurl() . '/photos/' . $page_owner_nick . '/image/' . $hash . '][img]' . $a->get_baseurl() . "/photo/{$hash}-{$smallest}.".$ph->getExt()."[/img][/url]\n\n"; + } + else { + echo '

getExt()."\" alt=\"$basename\" />

"; + } } else { $m = '[url=' . $a->get_baseurl() . '/photos/' . $page_owner_nick . '/image/' . $hash . '][img]' . $a->get_baseurl() . "/photo/{$hash}-{$smallest}.".$ph->getExt()."[/img][/url]"; diff --git a/mods/friendica-to-smarty-tpl.py b/mods/friendica-to-smarty-tpl.py index 3e0add771..8149051ca 100755 --- a/mods/friendica-to-smarty-tpl.py +++ b/mods/friendica-to-smarty-tpl.py @@ -10,6 +10,8 @@ import sys, getopt ldelim = '{{' rdelim = '}}' +addheader = True + def fToSmarty(matches): match = matches.group(0) if match == '$j': @@ -94,8 +96,9 @@ def fix_element(element): def convert(filename, tofilename, php_tpl): - header = ldelim + "*\n *\tAUTOMATICALLY GENERATED TEMPLATE\n *\tDO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN\n *\n *" + rdelim + "\n" - tofilename.write(header) + if addheader: + header = ldelim + "*\n *\tAUTOMATICALLY GENERATED TEMPLATE\n *\tDO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN\n *\n *" + rdelim + "\n" + tofilename.write(header) for line in filename: newline = '' @@ -190,13 +193,15 @@ def help(pname): path = '' try: - opts, args = getopt.getopt(sys.argv[1:], "hp:") + opts, args = getopt.getopt(sys.argv[1:], "hp:", ['no-header']) for opt, arg in opts: if opt == '-h': help(sys.argv[0]) sys.exit() elif opt == '-p': path = arg + elif opt == '--no-header': + addheader = False except getopt.GetoptError: help(sys.argv[0]) sys.exit(2) diff --git a/view/smarty3/voting_fakelink.tpl b/view/smarty3/voting_fakelink.tpl index 14eeb90f7..3d14ba48b 100644 --- a/view/smarty3/voting_fakelink.tpl +++ b/view/smarty3/voting_fakelink.tpl @@ -3,5 +3,4 @@ * DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN * *}} - {{$count}} {{$people}} {{$vote_mood}}
- +{{$phrase}} diff --git a/view/theme/frost-mobile/js/acl.js b/view/theme/frost-mobile/js/acl.js index 4e319577f..d54df12a3 100644 --- a/view/theme/frost-mobile/js/acl.js +++ b/view/theme/frost-mobile/js/acl.js @@ -253,9 +253,9 @@ ACL.prototype.populate = function(data){ //console.log(html); that.list_content.append(html); }); - $(".acl-list-item[rel!=acl-template] img[data-src]").each(function(i, el){ + $j(".acl-list-item img[data-src]", that.list_content).each(function(i, el){ // Add src attribute for images with a data-src attribute - $(el).attr('src', $(el).data("src")); + $j(el).attr('src', $j(el).data("src")); }); that.update_view(); } diff --git a/view/theme/frost-mobile/js/acl.min.js b/view/theme/frost-mobile/js/acl.min.js index 890e853ce..b543cbdd7 100644 --- a/view/theme/frost-mobile/js/acl.min.js +++ b/view/theme/frost-mobile/js/acl.min.js @@ -1 +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("")}),$j(that.allow_cid).each(function(e,t){aclfileds.append("")}),$j(that.deny_gid).each(function(e,t){aclfileds.append("")}),$j(that.deny_cid).each(function(e,t){aclfileds.append("")})},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="
"+that.item_tpl+"
",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()}; \ No newline at end of file +function ACL(backend_url,preset){that=this;that.url=backend_url;that.kp_timer=null;if(preset==undefined)preset=[];that.allow_cid=preset[0]||[];that.allow_gid=preset[1]||[];that.deny_cid=preset[2]||[];that.deny_gid=preset[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");if(preset.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(i,v){aclfileds.append("")});$j(that.allow_cid).each(function(i,v){aclfileds.append("")});$j(that.deny_gid).each(function(i,v){aclfileds.append("")});$j(that.deny_cid).each(function(i,v){aclfileds.append("")})};ACL.prototype.search=function(){var srcstr=$j("#acl-search").val();that.list_content.html("");that.get(0,100,srcstr)};ACL.prototype.on_search=function(event){if(that.kp_timer)clearTimeout(that.kp_timer);that.kp_timer=setTimeout(that.search,1e3)};ACL.prototype.on_showall=function(event){event.preventDefault();event.stopPropagation();if(that.showall.hasClass("selected")){return false}that.showall.addClass("selected");that.allow_cid=[];that.allow_gid=[];that.deny_cid=[];that.deny_gid=[];that.update_view();return false};ACL.prototype.on_button_show=function(event){event.preventDefault();event.stopImmediatePropagation();event.stopPropagation();that.set_allow($j(this).parent().attr("id"));return false};ACL.prototype.on_button_hide=function(event){event.preventDefault();event.stopImmediatePropagation();event.stopPropagation();that.set_deny($j(this).parent().attr("id"));return false};ACL.prototype.set_allow=function(itemid){type=itemid[0];id=parseInt(itemid.substr(1));switch(type){case"g":if(that.allow_gid.indexOf(id)<0){that.allow_gid.push(id)}else{that.allow_gid.remove(id)}if(that.deny_gid.indexOf(id)>=0)that.deny_gid.remove(id);break;case"c":if(that.allow_cid.indexOf(id)<0){that.allow_cid.push(id)}else{that.allow_cid.remove(id)}if(that.deny_cid.indexOf(id)>=0)that.deny_cid.remove(id);break}that.update_view()};ACL.prototype.set_deny=function(itemid){type=itemid[0];id=parseInt(itemid.substr(1));switch(type){case"g":if(that.deny_gid.indexOf(id)<0){that.deny_gid.push(id)}else{that.deny_gid.remove(id)}if(that.allow_gid.indexOf(id)>=0)that.allow_gid.remove(id);break;case"c":if(that.deny_cid.indexOf(id)<0){that.deny_cid.push(id)}else{that.deny_cid.remove(id)}if(that.allow_cid.indexOf(id)>=0)that.allow_cid.remove(id);break}that.update_view()};ACL.prototype.update_view=function(){if(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",false);if(typeof editor!="undefined"&&editor!=false){$j("#profile-jot-desc").html(ispublic)}}else{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 uclass="";if(that.allow_gid.indexOf(id)>=0){btshow.addClass("selected");bthide.removeClass("selected");uclass="groupshow"}if(that.deny_gid.indexOf(id)>=0){btshow.removeClass("selected");bthide.addClass("selected");uclass="grouphide"}$j(that.group_uids[id]).each(function(i,v){if(uclass=="grouphide")$j("#c"+v).removeClass("groupshow");if(uclass!=""){var cls=$j("#c"+v).attr("class");if(cls==undefined)return true;var hiding=cls.indexOf("grouphide");if(hiding==-1)$j("#c"+v).addClass(uclass)}});break;case"c":if(that.allow_cid.indexOf(id)>=0){btshow.addClass("selected");bthide.removeClass("selected")}if(that.deny_cid.indexOf(id)>=0){btshow.removeClass("selected");bthide.addClass("selected")}}})};ACL.prototype.get=function(start,count,search){var postdata={start:start,count:count,search:search};$j.ajax({type:"POST",url:that.url,data:postdata,dataType:"json",success:that.populate})};ACL.prototype.populate=function(data){$j(data.items).each(function(){html="
"+that.item_tpl+"
";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;that.list_content.append(html)});$j(".acl-list-item img[data-src]",that.list_content).each(function(i,el){$j(el).attr("src",$j(el).data("src"))});that.update_view()}; \ No newline at end of file diff --git a/view/theme/frost-mobile/js/main.js b/view/theme/frost-mobile/js/main.js index 5a15b081b..0773dcc02 100644 --- a/view/theme/frost-mobile/js/main.js +++ b/view/theme/frost-mobile/js/main.js @@ -188,9 +188,9 @@ nnm.append(html); }); - $("img[data-src]", nnm).each(function(i, el){ + $j("img[data-src]", nnm).each(function(i, el){ // Add src attribute for images with a data-src attribute - $(el).attr('src', $(el).data("src")); + $j(el).attr('src', $j(el).data("src")); }); } notif = eNotif.attr('count'); diff --git a/view/theme/frost-mobile/js/main.min.js b/view/theme/frost-mobile/js/main.min.js index 807c5327f..fad629ce4 100644 --- a/view/theme/frost-mobile/js/main.min.js +++ b/view/theme/frost-mobile/js/main.min.js @@ -1 +1 @@ -function openClose(listID){listID="#"+listID.replace(/:/g,"\\:");listID=listID.replace(/\./g,"\\.");listID=listID.replace(/@/g,"\\@");if($j(listID).is(":visible")){$j(listID).hide();$j(listID+"-wrapper").show();alert($j(listID+"-wrapper").attr("id"))}else{$j(listID).show();$j(listID+"-wrapper").hide()}}function openMenu(theID){document.getElementById(theID).style.display="block"}function closeMenu(theID){document.getElementById(theID).style.display="none"}var src=null;var prev=null;var livetime=null;var msie=false;var stopped=false;var totStopped=false;var timer=null;var pr=0;var liking=0;var in_progress=false;var langSelect=false;var commentBusy=false;var last_popup_menu=null;var last_popup_button=null;$j(function(){$j.ajaxSetup({cache:false});msie=$j.browser.msie;collapseHeight();$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(event){event.preventDefault();var input=$j(this).siblings("input");var val=1-input.val();var id=input.attr("id");$j("#"+id+"_onoff ."+(val==0?"on":"off")).addClass("hidden");$j("#"+id+"_onoff ."+(val==1?"on":"off")).removeClass("hidden");input.val(val)});function close_last_popup_menu(e){if(last_popup_menu){if("#"+last_popup_menu.attr("id")!==$j(e.target).attr("rel")){last_popup_menu.hide();if(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("img[rel^=#]").click(function(e){close_last_popup_menu(e);menu=$j($j(this).attr("rel"));e.preventDefault();e.stopPropagation();if(menu.attr("popup")=="false")return false;if(menu.css("display")=="none"){$j(this).parent().addClass("selected");menu.show();if(menu.attr("id")=="nav-notifications-menu")$j(".main-container").hide();last_popup_menu=menu;last_popup_button=$j(this).parent()}else{$j(this).parent().removeClass("selected");menu.hide();if(menu.attr("id")=="nav-notifications-menu")$j(".main-container").show();last_popup_menu=null;last_popup_button=null}return false});$j("html").click(function(e){close_last_popup_menu(e)});var notifications_tpl=unescape($j("#nav-notifications-template[rel=template]").html());var notifications_all=unescape($j("
").append($j("#nav-notifications-see-all").clone()).html());var notifications_mark=unescape($j("
").append($j("#nav-notifications-mark-all").clone()).html());var notifications_empty=unescape($j("#nav-notifications-menu").html());$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=$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=$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=$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=$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=$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=$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=$j(data).find("notif");if(eNotif.children("note").length==0){$j("#nav-notifications-menu").html(notifications_empty)}else{nnm=$j("#nav-notifications-menu");nnm.html(notifications_all+notifications_mark);eNotif.children("note").each(function(){e=$j(this);text=e.text().format(""+e.attr("name")+"");html=notifications_tpl.format(e.attr("href"),e.attr("photo"),text,e.attr("date"),e.attr("seen"));nnm.append(html)})}notif=eNotif.attr("count");if(notif>0){$j("#nav-notifications-linkmenu").addClass("on")}else{$j("#nav-notifications-linkmenu").removeClass("on")}if(notif==0){notif="";$j("#notify-update").removeClass("show")}else{$j("#notify-update").addClass("show")}$j("#notify-update").html(notif);var eSysmsg=$j(data).find("sysmsgs");eSysmsg.children("notice").each(function(){text=$j(this).text();$j.jGrowl(text,{sticky:false,theme:"notice",life:1e3})});eSysmsg.children("info").each(function(){text=$j(this).text();$j.jGrowl(text,{sticky:false,theme:"info",life:1e3})})});NavUpdate()});function NavUpdate(){if(!stopped){var pingCmd="ping"+(localUser!=0?"?f=&uid="+localUser:"");$j.get(pingCmd,function(data){$j(data).find("result").each(function(){$j("nav").trigger("nav-update",this);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){src="display";liveUpdate()}if($j("#live-photos").length){if(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){if(livetime){clearTimeout(livetime)}livetime=setTimeout(liveUpdate,1e4);return}if(livetime!=null)livetime=null;prev="live-"+src;in_progress=true;var udargs=netargs.length?"/"+netargs:"";var update_url="update_"+src+udargs+"&p="+profile_uid+"&page="+profile_page+"&msie="+(msie?1:0);$j.get(update_url,function(data){in_progress=false;$j(".toplevel_item",data).each(function(){var ident=$j(this).attr("id");if($j("#"+ident).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 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"))});$j("html").height($j("html").height());$j("#"+ident).replaceWith($j(this));if(typeof id!="undefined"){if(commentsOpen)showHideComments(id)}$j("html").height("auto")}prev=ident});collapseHeight();$j(".like-rotator").hide();if(commentBusy){commentBusy=false;$j("body").css("cursor","auto")}$j(".comment-edit-form textarea").contact_autocomplete(baseurl+"/acl")})}function collapseHeight(elems){var elemName=".wall-item-body:not(.divmore)";if(typeof elems!="undefined"){elemName=elems+" "+elemName}$j(elemName).each(function(){if($j(this).height()>350){$j("html").height($j("html").height());$j(this).divgrow({initialHeight:300,showBrackets:false,speed:0});$j(this).addClass("divmore");$j("html").height("auto")}})}function imgbright(node){$j(node).removeClass("drophide").addClass("drop")}function imgdull(node){$j(node).removeClass("drop").addClass("drophide")}function dolike(ident,verb){unpause();$j("#like-rotator-"+ident.toString()).show();$j.get("like/"+ident.toString()+"?verb="+verb,NavUpdate);liking=1}function dostar(ident){ident=ident.toString();$j.get("starred/"+ident,function(data){if(data.match(/1/)){$j("#starred-"+ident).addClass("starred");$j("#starred-"+ident).removeClass("unstarred");$j("#star-"+ident).addClass("hidden");$j("#unstar-"+ident).removeClass("hidden")}else{$j("#starred-"+ident).addClass("unstarred");$j("#starred-"+ident).removeClass("starred");$j("#star-"+ident).removeClass("hidden");$j("#unstar-"+ident).addClass("hidden")}})}function getPosition(e){var cursor={x:0,y:0};if(e.touches[0].pageX||e.touches[0].pageY){cursor.x=e.touches[0].pageX;cursor.y=e.touches[0].pageY}else{if(e.touches[0].clientX||e.touches[0].clientY){cursor.x=e.touches[0].clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)-document.documentElement.clientLeft;cursor.y=e.touches[0].clientY+(document.documentElement.scrollTop||document.body.scrollTop)-document.documentElement.clientTop}else{if(e.touches[0].x||e.touches[0].y){cursor.touches[0].x=e.touches[0].x;cursor.touches[0].y=e.touches[0].y}}}return cursor}var lockvisible=false;function lockview(event,id){event=event||window.event;cursor=getPosition(event);if(lockvisible){lockviewhide()}else{lockvisible=true;$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;$j("#panel").hide()}function post_comment(id){unpause();commentBusy=true;$j("body").css("cursor","wait");$j("#comment-preview-inp-"+id).val("0");$j.post("item",$j("#comment-edit-form-"+id).serialize(),function(data){if(data.success){$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);if(timer)clearTimeout(timer);timer=setTimeout(NavUpdate,10)}if(data.reload){window.location.href=data.reload}},"json");return false}function preview_comment(id){$j("#comment-preview-inp-"+id).val("1");$j("#comment-edit-preview-"+id).show();$j.post("item",$j("#comment-edit-form-"+id).serialize(),function(data){if(data.preview){$j("#comment-edit-preview-"+id).html(data.preview);$j("#comment-edit-preview-"+id+" a").click(function(){return false})}},"json");return true}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);collapseHeight("#collapsed-comments-"+id)}}function preview_post(){$j("#jot-preview").val("1");$j("#jot-preview-content").show();tinyMCE.triggerSave();$j.post("item",$j("#profile-jot-form").serialize(),function(data){if(data.preview){$j("#jot-preview-content").html(data.preview);$j("#jot-preview-content"+" a").click(function(){return false})}},"json");$j("#jot-preview").val("0");return true}function unpause(){totStopped=false;stopped=false;$j("#pause").html("")}function bin2hex(s){var v,i,f=0,a=[];s+="";f=s.length;for(i=0;i'+data.desc+'
'+data.version+'
'+data.credits+"
")})} \ No newline at end of file +function openClose(listID){listID="#"+listID.replace(/:/g,"\\:");listID=listID.replace(/\./g,"\\.");listID=listID.replace(/@/g,"\\@");if($j(listID).is(":visible")){$j(listID).hide();$j(listID+"-wrapper").show();alert($j(listID+"-wrapper").attr("id"))}else{$j(listID).show();$j(listID+"-wrapper").hide()}}function openMenu(theID){document.getElementById(theID).style.display="block"}function closeMenu(theID){document.getElementById(theID).style.display="none"}var src=null;var prev=null;var livetime=null;var msie=false;var stopped=false;var totStopped=false;var timer=null;var pr=0;var liking=0;var in_progress=false;var langSelect=false;var commentBusy=false;var last_popup_menu=null;var last_popup_button=null;$j(function(){$j.ajaxSetup({cache:false});msie=$j.browser.msie;collapseHeight();$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(event){event.preventDefault();var input=$j(this).siblings("input");var val=1-input.val();var id=input.attr("id");$j("#"+id+"_onoff ."+(val==0?"on":"off")).addClass("hidden");$j("#"+id+"_onoff ."+(val==1?"on":"off")).removeClass("hidden");input.val(val)});function close_last_popup_menu(e){if(last_popup_menu){if("#"+last_popup_menu.attr("id")!==$j(e.target).attr("rel")){last_popup_menu.hide();if(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("img[rel^=#]").click(function(e){close_last_popup_menu(e);menu=$j($j(this).attr("rel"));e.preventDefault();e.stopPropagation();if(menu.attr("popup")=="false")return false;if(menu.css("display")=="none"){$j(this).parent().addClass("selected");menu.show();if(menu.attr("id")=="nav-notifications-menu")$j(".main-container").hide();last_popup_menu=menu;last_popup_button=$j(this).parent()}else{$j(this).parent().removeClass("selected");menu.hide();if(menu.attr("id")=="nav-notifications-menu")$j(".main-container").show();last_popup_menu=null;last_popup_button=null}return false});$j("html").click(function(e){close_last_popup_menu(e)});var notifications_tpl=unescape($j("#nav-notifications-template[rel=template]").html());var notifications_all=unescape($j("
").append($j("#nav-notifications-see-all").clone()).html());var notifications_mark=unescape($j("
").append($j("#nav-notifications-mark-all").clone()).html());var notifications_empty=unescape($j("#nav-notifications-menu").html());$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=$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=$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=$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=$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=$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=$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=$j(data).find("notif");if(eNotif.children("note").length==0){$j("#nav-notifications-menu").html(notifications_empty)}else{nnm=$j("#nav-notifications-menu");nnm.html(notifications_all+notifications_mark);eNotif.children("note").each(function(){e=$j(this);text=e.text().format(""+e.attr("name")+"");html=notifications_tpl.format(e.attr("href"),e.attr("photo"),text,e.attr("date"),e.attr("seen"));nnm.append(html)});$j("img[data-src]",nnm).each(function(i,el){$j(el).attr("src",$j(el).data("src"))})}notif=eNotif.attr("count");if(notif>0){$j("#nav-notifications-linkmenu").addClass("on")}else{$j("#nav-notifications-linkmenu").removeClass("on")}if(notif==0){notif="";$j("#notify-update").removeClass("show")}else{$j("#notify-update").addClass("show")}$j("#notify-update").html(notif);var eSysmsg=$j(data).find("sysmsgs");eSysmsg.children("notice").each(function(){text=$j(this).text();$j.jGrowl(text,{sticky:false,theme:"notice",life:1e3})});eSysmsg.children("info").each(function(){text=$j(this).text();$j.jGrowl(text,{sticky:false,theme:"info",life:1e3})})});NavUpdate()});function NavUpdate(){if(!stopped){var pingCmd="ping"+(localUser!=0?"?f=&uid="+localUser:"");$j.get(pingCmd,function(data){$j(data).find("result").each(function(){$j("nav").trigger("nav-update",this);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){src="display";liveUpdate()}if($j("#live-photos").length){if(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){if(livetime){clearTimeout(livetime)}livetime=setTimeout(liveUpdate,1e4);return}if(livetime!=null)livetime=null;prev="live-"+src;in_progress=true;var udargs=netargs.length?"/"+netargs:"";var update_url="update_"+src+udargs+"&p="+profile_uid+"&page="+profile_page+"&msie="+(msie?1:0);$j.get(update_url,function(data){in_progress=false;$j(".toplevel_item",data).each(function(){var ident=$j(this).attr("id");if($j("#"+ident).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 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"))});$j("html").height($j("html").height());$j("#"+ident).replaceWith($j(this));if(typeof id!="undefined"){if(commentsOpen)showHideComments(id)}$j("html").height("auto")}prev=ident});collapseHeight();$j(".like-rotator").hide();if(commentBusy){commentBusy=false;$j("body").css("cursor","auto")}$j(".comment-edit-form textarea").contact_autocomplete(baseurl+"/acl")})}function collapseHeight(elems){var elemName=".wall-item-body:not(.divmore)";if(typeof elems!="undefined"){elemName=elems+" "+elemName}$j(elemName).each(function(){if($j(this).height()>350){$j("html").height($j("html").height());$j(this).divgrow({initialHeight:300,showBrackets:false,speed:0});$j(this).addClass("divmore");$j("html").height("auto")}})}function imgbright(node){$j(node).removeClass("drophide").addClass("drop")}function imgdull(node){$j(node).removeClass("drop").addClass("drophide")}function dolike(ident,verb){unpause();$j("#like-rotator-"+ident.toString()).show();$j.get("like/"+ident.toString()+"?verb="+verb,NavUpdate);liking=1}function dostar(ident){ident=ident.toString();$j.get("starred/"+ident,function(data){if(data.match(/1/)){$j("#starred-"+ident).addClass("starred");$j("#starred-"+ident).removeClass("unstarred");$j("#star-"+ident).addClass("hidden");$j("#unstar-"+ident).removeClass("hidden")}else{$j("#starred-"+ident).addClass("unstarred");$j("#starred-"+ident).removeClass("starred");$j("#star-"+ident).removeClass("hidden");$j("#unstar-"+ident).addClass("hidden")}})}function getPosition(e){var cursor={x:0,y:0};if(e.touches[0].pageX||e.touches[0].pageY){cursor.x=e.touches[0].pageX;cursor.y=e.touches[0].pageY}else{if(e.touches[0].clientX||e.touches[0].clientY){cursor.x=e.touches[0].clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)-document.documentElement.clientLeft;cursor.y=e.touches[0].clientY+(document.documentElement.scrollTop||document.body.scrollTop)-document.documentElement.clientTop}else{if(e.touches[0].x||e.touches[0].y){cursor.touches[0].x=e.touches[0].x;cursor.touches[0].y=e.touches[0].y}}}return cursor}var lockvisible=false;function lockview(event,id){event=event||window.event;cursor=getPosition(event);if(lockvisible){lockviewhide()}else{lockvisible=true;$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;$j("#panel").hide()}function post_comment(id){unpause();commentBusy=true;$j("body").css("cursor","wait");$j("#comment-preview-inp-"+id).val("0");$j.post("item",$j("#comment-edit-form-"+id).serialize(),function(data){if(data.success){$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);if(timer)clearTimeout(timer);timer=setTimeout(NavUpdate,10)}if(data.reload){window.location.href=data.reload}},"json");return false}function preview_comment(id){$j("#comment-preview-inp-"+id).val("1");$j("#comment-edit-preview-"+id).show();$j.post("item",$j("#comment-edit-form-"+id).serialize(),function(data){if(data.preview){$j("#comment-edit-preview-"+id).html(data.preview);$j("#comment-edit-preview-"+id+" a").click(function(){return false})}},"json");return true}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);collapseHeight("#collapsed-comments-"+id)}}function preview_post(){$j("#jot-preview").val("1");$j("#jot-preview-content").show();tinyMCE.triggerSave();$j.post("item",$j("#profile-jot-form").serialize(),function(data){if(data.preview){$j("#jot-preview-content").html(data.preview);$j("#jot-preview-content"+" a").click(function(){return false})}},"json");$j("#jot-preview").val("0");return true}function unpause(){totStopped=false;stopped=false;$j("#pause").html("")}function bin2hex(s){var v,i,f=0,a=[];s+="";f=s.length;for(i=0;i'+data.desc+'
'+data.version+'
'+data.credits+"
")})} \ No newline at end of file diff --git a/view/theme/frost-mobile/smarty3/voting_fakelink.tpl b/view/theme/frost-mobile/smarty3/voting_fakelink.tpl index aabdc8ef5..1e073916e 100644 --- a/view/theme/frost-mobile/smarty3/voting_fakelink.tpl +++ b/view/theme/frost-mobile/smarty3/voting_fakelink.tpl @@ -3,5 +3,4 @@ * DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN * *}} - {{$count}} {{$people}} {{$vote_mood}} - +{{$phrase}} diff --git a/view/theme/frost-mobile/voting_fakelink.tpl b/view/theme/frost-mobile/voting_fakelink.tpl index c34204697..b66302cc2 100644 --- a/view/theme/frost-mobile/voting_fakelink.tpl +++ b/view/theme/frost-mobile/voting_fakelink.tpl @@ -1,2 +1 @@ - $count $people $vote_mood - +$phrase diff --git a/view/theme/frost/acl_selector.tpl b/view/theme/frost/acl_selector.tpl index e79a6891a..df34a1a2a 100644 --- a/view/theme/frost/acl_selector.tpl +++ b/view/theme/frost/acl_selector.tpl @@ -9,6 +9,7 @@
diff --git a/view/theme/frost/js/acl.js b/view/theme/frost/js/acl.js index 1c843d7fe..511f84f78 100644 --- a/view/theme/frost/js/acl.js +++ b/view/theme/frost/js/acl.js @@ -253,9 +253,9 @@ ACL.prototype.populate = function(data){ //console.log(html); that.list_content.append(html); }); - $(".acl-list-item[rel!=acl-template] img[data-src]").each(function(i, el){ + $j(".acl-list-item img[data-src]", that.list_content).each(function(i, el){ // Add src attribute for images with a data-src attribute - $(el).attr('src', $(el).data("src")); + $j(el).attr('src', $j(el).data("src")); }); that.update_view(); } diff --git a/view/theme/frost/js/acl.min.js b/view/theme/frost/js/acl.min.js index fe69e5189..e365f6fee 100644 --- a/view/theme/frost/js/acl.min.js +++ b/view/theme/frost/js/acl.min.js @@ -1 +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=3,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("")}),$j(that.allow_cid).each(function(e,t){aclfileds.append("")}),$j(that.deny_gid).each(function(e,t){aclfileds.append("")}),$j(that.deny_cid).each(function(e,t){aclfileds.append("")})},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){var t=Math.ceil(e.tot/that.nw)*42;that.list_content.height(t),$j(e.items).each(function(){html="
"+that.item_tpl+"
",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()}; \ No newline at end of file +function ACL(backend_url,preset){that=this;that.url=backend_url;that.kp_timer=null;if(preset==undefined)preset=[];that.allow_cid=preset[0]||[];that.allow_gid=preset[1]||[];that.deny_cid=preset[2]||[];that.deny_gid=preset[3]||[];that.group_uids=[];that.nw=3;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");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(i,v){aclfileds.append("")});$j(that.allow_cid).each(function(i,v){aclfileds.append("")});$j(that.deny_gid).each(function(i,v){aclfileds.append("")});$j(that.deny_cid).each(function(i,v){aclfileds.append("")})};ACL.prototype.search=function(){var srcstr=$j("#acl-search").val();that.list_content.html("");that.get(0,100,srcstr)};ACL.prototype.on_search=function(event){if(that.kp_timer)clearTimeout(that.kp_timer);that.kp_timer=setTimeout(that.search,1e3)};ACL.prototype.on_showall=function(event){event.preventDefault();event.stopPropagation();if(that.showall.hasClass("selected")){return false}that.showall.addClass("selected");that.allow_cid=[];that.allow_gid=[];that.deny_cid=[];that.deny_gid=[];that.update_view();return false};ACL.prototype.on_button_show=function(event){event.preventDefault();event.stopImmediatePropagation();event.stopPropagation();that.set_allow($j(this).parent().attr("id"));return false};ACL.prototype.on_button_hide=function(event){event.preventDefault();event.stopImmediatePropagation();event.stopPropagation();that.set_deny($j(this).parent().attr("id"));return false};ACL.prototype.set_allow=function(itemid){type=itemid[0];id=parseInt(itemid.substr(1));switch(type){case"g":if(that.allow_gid.indexOf(id)<0){that.allow_gid.push(id)}else{that.allow_gid.remove(id)}if(that.deny_gid.indexOf(id)>=0)that.deny_gid.remove(id);break;case"c":if(that.allow_cid.indexOf(id)<0){that.allow_cid.push(id)}else{that.allow_cid.remove(id)}if(that.deny_cid.indexOf(id)>=0)that.deny_cid.remove(id);break}that.update_view()};ACL.prototype.set_deny=function(itemid){type=itemid[0];id=parseInt(itemid.substr(1));switch(type){case"g":if(that.deny_gid.indexOf(id)<0){that.deny_gid.push(id)}else{that.deny_gid.remove(id)}if(that.allow_gid.indexOf(id)>=0)that.allow_gid.remove(id);break;case"c":if(that.deny_cid.indexOf(id)<0){that.deny_cid.push(id)}else{that.deny_cid.remove(id)}if(that.allow_cid.indexOf(id)>=0)that.allow_cid.remove(id);break}that.update_view()};ACL.prototype.update_view=function(){if(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",false);if(typeof editor!="undefined"&&editor!=false){$j("#profile-jot-desc").html(ispublic)}}else{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 uclass="";if(that.allow_gid.indexOf(id)>=0){btshow.addClass("selected");bthide.removeClass("selected");uclass="groupshow"}if(that.deny_gid.indexOf(id)>=0){btshow.removeClass("selected");bthide.addClass("selected");uclass="grouphide"}$j(that.group_uids[id]).each(function(i,v){if(uclass=="grouphide")$j("#c"+v).removeClass("groupshow");if(uclass!=""){var cls=$j("#c"+v).attr("class");if(cls==undefined)return true;var hiding=cls.indexOf("grouphide");if(hiding==-1)$j("#c"+v).addClass(uclass)}});break;case"c":if(that.allow_cid.indexOf(id)>=0){btshow.addClass("selected");bthide.removeClass("selected")}if(that.deny_cid.indexOf(id)>=0){btshow.removeClass("selected");bthide.addClass("selected")}}})};ACL.prototype.get=function(start,count,search){var postdata={start:start,count:count,search:search};$j.ajax({type:"POST",url:that.url,data:postdata,dataType:"json",success:that.populate})};ACL.prototype.populate=function(data){var height=Math.ceil(data.tot/that.nw)*42;that.list_content.height(height);$j(data.items).each(function(){html="
"+that.item_tpl+"
";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;that.list_content.append(html)});$j(".acl-list-item img[data-src]",that.list_content).each(function(i,el){$j(el).attr("src",$j(el).data("src"))});that.update_view()}; \ No newline at end of file diff --git a/view/theme/frost/js/main.js b/view/theme/frost/js/main.js index e47ecff37..3f2f13569 100644 --- a/view/theme/frost/js/main.js +++ b/view/theme/frost/js/main.js @@ -180,9 +180,9 @@ nnm.append(html); }); - $("img[data-src]", nnm).each(function(i, el){ + $j("img[data-src]", nnm).each(function(i, el){ // Add src attribute for images with a data-src attribute - $(el).attr('src', $(el).data("src")); + $j(el).attr('src', $j(el).data("src")); }); } notif = eNotif.attr('count'); diff --git a/view/theme/frost/js/main.min.js b/view/theme/frost/js/main.min.js index f021b7bef..8e5214249 100644 --- a/view/theme/frost/js/main.min.js +++ b/view/theme/frost/js/main.min.js @@ -1 +1 @@ -function openClose(listID){listID="#"+listID.replace(/:/g,"\\:");listID=listID.replace(/\./g,"\\.");listID=listID.replace(/@/g,"\\@");if($j(listID).is(":visible")){$j(listID).hide();$j(listID+"-wrapper").show()}else{$j(listID).show();$j(listID+"-wrapper").hide()}}function openMenu(theID){document.getElementById(theID).style.display="block"}function closeMenu(theID){document.getElementById(theID).style.display="none"}var src=null;var prev=null;var livetime=null;var msie=false;var stopped=false;var totStopped=false;var timer=null;var pr=0;var liking=0;var in_progress=false;var langSelect=false;var commentBusy=false;var last_popup_menu=null;var last_popup_button=null;$j(function(){$j.ajaxSetup({cache:false});msie=$j.browser.msie;collapseHeight();$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(event){event.preventDefault();var input=$j(this).siblings("input");var val=1-input.val();var id=input.attr("id");$j("#"+id+"_onoff ."+(val==0?"on":"off")).addClass("hidden");$j("#"+id+"_onoff ."+(val==1?"on":"off")).removeClass("hidden");input.val(val)});setupFieldRichtext();function close_last_popup_menu(e){if(last_popup_menu){if("#"+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("a[rel^=#]").click(function(e){close_last_popup_menu(e);menu=$j($j(this).attr("rel"));e.preventDefault();e.stopPropagation();if(menu.attr("popup")=="false")return false;$j(this).parent().toggleClass("selected");menu.slideToggle("fast");if(menu.css("display")=="none"){last_popup_menu=null;last_popup_button=null}else{last_popup_menu=menu;last_popup_button=$j(this).parent()}return false});$j("html").click(function(e){close_last_popup_menu(e)});$j("a.popupbox").fancybox({transitionIn:"none",transitionOut:"none"});var notifications_tpl=unescape($j("#nav-notifications-template[rel=template]").html());var notifications_all=unescape($j("
").append($j("#nav-notifications-see-all").clone()).html());var notifications_mark=unescape($j("
").append($j("#nav-notifications-mark-all").clone()).html());var notifications_empty=unescape($j("#nav-notifications-menu").html());$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=$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=$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=$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=$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=$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=$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=$j(data).find("notif");if(eNotif.children("note").length==0){$j("#nav-notifications-menu").html(notifications_empty)}else{nnm=$j("#nav-notifications-menu");nnm.html(notifications_all+notifications_mark);eNotif.children("note").each(function(){e=$j(this);text=e.text().format(""+e.attr("name")+"");html=notifications_tpl.format(e.attr("href"),e.attr("photo"),text,e.attr("date"),e.attr("seen"));nnm.append(html)})}notif=eNotif.attr("count");if(notif>0){$j("#nav-notifications-linkmenu").addClass("on")}else{$j("#nav-notifications-linkmenu").removeClass("on")}if(notif==0){notif="";$j("#notify-update").removeClass("show")}else{$j("#notify-update").addClass("show")}$j("#notify-update").html(notif);var eSysmsg=$j(data).find("sysmsgs");eSysmsg.children("notice").each(function(){text=$j(this).text();$j.jGrowl(text,{sticky:false,theme:"notice",life:3e3})});eSysmsg.children("info").each(function(){text=$j(this).text();$j.jGrowl(text,{sticky:false,theme:"info",life:1e3})})});NavUpdate();$j(document).keydown(function(event){if(event.keyCode=="8"){var target=event.target||event.srcElement;if(!/input|textarea/i.test(target.nodeName)){return false}}if(event.keyCode=="19"||event.ctrlKey&&event.which=="32"){event.preventDefault();if(stopped==false){stopped=true;if(event.ctrlKey){totStopped=true}$j("#pause").html('pause')}else{unpause()}}else{if(!totStopped){unpause()}}})});function NavUpdate(){if(!stopped){var pingCmd="ping"+(localUser!=0?"?f=&uid="+localUser:"");$j.get(pingCmd,function(data){$j(data).find("result").each(function(){$j("nav").trigger("nav-update",this);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){src="display";liveUpdate()}if($j("#live-photos").length){if(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){if(livetime){clearTimeout(livetime)}livetime=setTimeout(liveUpdate,1e4);return}if(livetime!=null)livetime=null;prev="live-"+src;in_progress=true;var udargs=netargs.length?"/"+netargs:"";var update_url="update_"+src+udargs+"&p="+profile_uid+"&page="+profile_page+"&msie="+(msie?1:0);$j.get(update_url,function(data){in_progress=false;$j(".toplevel_item",data).each(function(){var ident=$j(this).attr("id");if($j("#"+ident).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 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"))});$j("html").height($j("html").height());$j("#"+ident).replaceWith($j(this));if(typeof id!="undefined"){if(commentsOpen)showHideComments(id)}$j("html").height("auto")}prev=ident});$j(".like-rotator").hide();if(commentBusy){commentBusy=false;$j("body").css("cursor","auto")}$j(".comment-edit-form textarea").contact_autocomplete(baseurl+"/acl");collapseHeight()})}function collapseHeight(elems){var elemName=".wall-item-body:not(.divmore)";if(typeof elems!="undefined"){elemName=elems+" "+elemName}$j(elemName).each(function(){if($j(this).height()>450){$j("html").height($j("html").height());$j(this).divgrow({initialHeight:400,showBrackets:false,speed:0});$j(this).addClass("divmore");$j("html").height("auto")}})}function imgbright(node){$j(node).removeClass("drophide").addClass("drop")}function imgdull(node){$j(node).removeClass("drop").addClass("drophide")}function dolike(ident,verb){unpause();$j("#like-rotator-"+ident.toString()).show();$j.get("like/"+ident.toString()+"?verb="+verb,NavUpdate);liking=1}function dostar(ident){ident=ident.toString();$j.get("starred/"+ident,function(data){if(data.match(/1/)){$j("#starred-"+ident).addClass("starred");$j("#starred-"+ident).removeClass("unstarred");$j("#star-"+ident).addClass("hidden");$j("#unstar-"+ident).removeClass("hidden")}else{$j("#starred-"+ident).addClass("unstarred");$j("#starred-"+ident).removeClass("starred");$j("#star-"+ident).removeClass("hidden");$j("#unstar-"+ident).addClass("hidden")}})}function getPosition(e){var cursor={x:0,y:0};if(e.pageX||e.pageY){cursor.x=e.pageX;cursor.y=e.pageY}else{if(e.clientX||e.clientY){cursor.x=e.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)-document.documentElement.clientLeft;cursor.y=e.clientY+(document.documentElement.scrollTop||document.body.scrollTop)-document.documentElement.clientTop}else{if(e.x||e.y){cursor.x=e.x;cursor.y=e.y}}}return cursor}var lockvisible=false;function lockview(event,id){event=event||window.event;cursor=getPosition(event);if(lockvisible){lockviewhide()}else{lockvisible=true;$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;$j("#panel").hide()}function post_comment(id){unpause();commentBusy=true;$j("body").css("cursor","wait");$j("#comment-preview-inp-"+id).val("0");$j.post("item",$j("#comment-edit-form-"+id).serialize(),function(data){if(data.success){$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);if(timer)clearTimeout(timer);timer=setTimeout(NavUpdate,10)}if(data.reload){window.location.href=data.reload}},"json");return false}function preview_comment(id){$j("#comment-preview-inp-"+id).val("1");$j("#comment-edit-preview-"+id).show();$j.post("item",$j("#comment-edit-form-"+id).serialize(),function(data){if(data.preview){$j("#comment-edit-preview-"+id).html(data.preview);$j("#comment-edit-preview-"+id+" a").click(function(){return false})}},"json");return true}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);collapseHeight("#collapsed-comments-"+id)}}function preview_post(){$j("#jot-preview").val("1");$j("#jot-preview-content").show();tinyMCE.triggerSave();$j.post("item",$j("#profile-jot-form").serialize(),function(data){if(data.preview){$j("#jot-preview-content").html(data.preview);$j("#jot-preview-content"+" a").click(function(){return false})}},"json");$j("#jot-preview").val("0");return true}function unpause(){totStopped=false;stopped=false;$j("#pause").html("")}function bin2hex(s){var v,i,f=0,a=[];s+="";f=s.length;for(i=0;i'+data.desc+'
'+data.version+'
'+data.credits+'
'+theme+'')})} \ No newline at end of file +function openClose(listID){listID="#"+listID.replace(/:/g,"\\:");listID=listID.replace(/\./g,"\\.");listID=listID.replace(/@/g,"\\@");if($j(listID).is(":visible")){$j(listID).hide();$j(listID+"-wrapper").show()}else{$j(listID).show();$j(listID+"-wrapper").hide()}}function openMenu(theID){document.getElementById(theID).style.display="block"}function closeMenu(theID){document.getElementById(theID).style.display="none"}var src=null;var prev=null;var livetime=null;var msie=false;var stopped=false;var totStopped=false;var timer=null;var pr=0;var liking=0;var in_progress=false;var langSelect=false;var commentBusy=false;var last_popup_menu=null;var last_popup_button=null;$j(function(){$j.ajaxSetup({cache:false});msie=$j.browser.msie;collapseHeight();$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(event){event.preventDefault();var input=$j(this).siblings("input");var val=1-input.val();var id=input.attr("id");$j("#"+id+"_onoff ."+(val==0?"on":"off")).addClass("hidden");$j("#"+id+"_onoff ."+(val==1?"on":"off")).removeClass("hidden");input.val(val)});setupFieldRichtext();function close_last_popup_menu(e){if(last_popup_menu){if("#"+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("a[rel^=#]").click(function(e){close_last_popup_menu(e);menu=$j($j(this).attr("rel"));e.preventDefault();e.stopPropagation();if(menu.attr("popup")=="false")return false;$j(this).parent().toggleClass("selected");menu.slideToggle("fast");if(menu.css("display")=="none"){last_popup_menu=null;last_popup_button=null}else{last_popup_menu=menu;last_popup_button=$j(this).parent()}return false});$j("html").click(function(e){close_last_popup_menu(e)});$j("a.popupbox").fancybox({transitionIn:"none",transitionOut:"none"});var notifications_tpl=unescape($j("#nav-notifications-template[rel=template]").html());var notifications_all=unescape($j("
").append($j("#nav-notifications-see-all").clone()).html());var notifications_mark=unescape($j("
").append($j("#nav-notifications-mark-all").clone()).html());var notifications_empty=unescape($j("#nav-notifications-menu").html());$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=$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=$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=$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=$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=$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=$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=$j(data).find("notif");if(eNotif.children("note").length==0){$j("#nav-notifications-menu").html(notifications_empty)}else{nnm=$j("#nav-notifications-menu");nnm.html(notifications_all+notifications_mark);eNotif.children("note").each(function(){e=$j(this);text=e.text().format(""+e.attr("name")+"");html=notifications_tpl.format(e.attr("href"),e.attr("photo"),text,e.attr("date"),e.attr("seen"));nnm.append(html)});$j("img[data-src]",nnm).each(function(i,el){$j(el).attr("src",$j(el).data("src"))})}notif=eNotif.attr("count");if(notif>0){$j("#nav-notifications-linkmenu").addClass("on")}else{$j("#nav-notifications-linkmenu").removeClass("on")}if(notif==0){notif="";$j("#notify-update").removeClass("show")}else{$j("#notify-update").addClass("show")}$j("#notify-update").html(notif);var eSysmsg=$j(data).find("sysmsgs");eSysmsg.children("notice").each(function(){text=$j(this).text();$j.jGrowl(text,{sticky:false,theme:"notice",life:3e3})});eSysmsg.children("info").each(function(){text=$j(this).text();$j.jGrowl(text,{sticky:false,theme:"info",life:1e3})})});NavUpdate();$j(document).keydown(function(event){if(event.keyCode=="8"){var target=event.target||event.srcElement;if(!/input|textarea/i.test(target.nodeName)){return false}}if(event.keyCode=="19"||event.ctrlKey&&event.which=="32"){event.preventDefault();if(stopped==false){stopped=true;if(event.ctrlKey){totStopped=true}$j("#pause").html('pause')}else{unpause()}}else{if(!totStopped){unpause()}}})});function NavUpdate(){if(!stopped){var pingCmd="ping"+(localUser!=0?"?f=&uid="+localUser:"");$j.get(pingCmd,function(data){$j(data).find("result").each(function(){$j("nav").trigger("nav-update",this);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){src="display";liveUpdate()}if($j("#live-photos").length){if(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){if(livetime){clearTimeout(livetime)}livetime=setTimeout(liveUpdate,1e4);return}if(livetime!=null)livetime=null;prev="live-"+src;in_progress=true;var udargs=netargs.length?"/"+netargs:"";var update_url="update_"+src+udargs+"&p="+profile_uid+"&page="+profile_page+"&msie="+(msie?1:0);$j.get(update_url,function(data){in_progress=false;$j(".toplevel_item",data).each(function(){var ident=$j(this).attr("id");if($j("#"+ident).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 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"))});$j("html").height($j("html").height());$j("#"+ident).replaceWith($j(this));if(typeof id!="undefined"){if(commentsOpen)showHideComments(id)}$j("html").height("auto")}prev=ident});$j(".like-rotator").hide();if(commentBusy){commentBusy=false;$j("body").css("cursor","auto")}$j(".comment-edit-form textarea").contact_autocomplete(baseurl+"/acl");collapseHeight()})}function collapseHeight(elems){var elemName=".wall-item-body:not(.divmore)";if(typeof elems!="undefined"){elemName=elems+" "+elemName}$j(elemName).each(function(){if($j(this).height()>450){$j("html").height($j("html").height());$j(this).divgrow({initialHeight:400,showBrackets:false,speed:0});$j(this).addClass("divmore");$j("html").height("auto")}})}function imgbright(node){$j(node).removeClass("drophide").addClass("drop")}function imgdull(node){$j(node).removeClass("drop").addClass("drophide")}function dolike(ident,verb){unpause();$j("#like-rotator-"+ident.toString()).show();$j.get("like/"+ident.toString()+"?verb="+verb,NavUpdate);liking=1}function dostar(ident){ident=ident.toString();$j.get("starred/"+ident,function(data){if(data.match(/1/)){$j("#starred-"+ident).addClass("starred");$j("#starred-"+ident).removeClass("unstarred");$j("#star-"+ident).addClass("hidden");$j("#unstar-"+ident).removeClass("hidden")}else{$j("#starred-"+ident).addClass("unstarred");$j("#starred-"+ident).removeClass("starred");$j("#star-"+ident).removeClass("hidden");$j("#unstar-"+ident).addClass("hidden")}})}function getPosition(e){var cursor={x:0,y:0};if(e.pageX||e.pageY){cursor.x=e.pageX;cursor.y=e.pageY}else{if(e.clientX||e.clientY){cursor.x=e.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)-document.documentElement.clientLeft;cursor.y=e.clientY+(document.documentElement.scrollTop||document.body.scrollTop)-document.documentElement.clientTop}else{if(e.x||e.y){cursor.x=e.x;cursor.y=e.y}}}return cursor}var lockvisible=false;function lockview(event,id){event=event||window.event;cursor=getPosition(event);if(lockvisible){lockviewhide()}else{lockvisible=true;$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;$j("#panel").hide()}function post_comment(id){unpause();commentBusy=true;$j("body").css("cursor","wait");$j("#comment-preview-inp-"+id).val("0");$j.post("item",$j("#comment-edit-form-"+id).serialize(),function(data){if(data.success){$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);if(timer)clearTimeout(timer);timer=setTimeout(NavUpdate,10)}if(data.reload){window.location.href=data.reload}},"json");return false}function preview_comment(id){$j("#comment-preview-inp-"+id).val("1");$j("#comment-edit-preview-"+id).show();$j.post("item",$j("#comment-edit-form-"+id).serialize(),function(data){if(data.preview){$j("#comment-edit-preview-"+id).html(data.preview);$j("#comment-edit-preview-"+id+" a").click(function(){return false})}},"json");return true}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);collapseHeight("#collapsed-comments-"+id)}}function preview_post(){$j("#jot-preview").val("1");$j("#jot-preview-content").show();tinyMCE.triggerSave();$j.post("item",$j("#profile-jot-form").serialize(),function(data){if(data.preview){$j("#jot-preview-content").html(data.preview);$j("#jot-preview-content"+" a").click(function(){return false})}},"json");$j("#jot-preview").val("0");return true}function unpause(){totStopped=false;stopped=false;$j("#pause").html("")}function bin2hex(s){var v,i,f=0,a=[];s+="";f=s.length;for(i=0;i'+data.desc+'
'+data.version+'
'+data.credits+'
'+theme+'')})} \ No newline at end of file diff --git a/view/theme/frost/smarty3/acl_selector.tpl b/view/theme/frost/smarty3/acl_selector.tpl index d9af000ec..d18776e36 100644 --- a/view/theme/frost/smarty3/acl_selector.tpl +++ b/view/theme/frost/smarty3/acl_selector.tpl @@ -14,6 +14,7 @@
diff --git a/view/theme/frost/smarty3/voting_fakelink.tpl b/view/theme/frost/smarty3/voting_fakelink.tpl index aabdc8ef5..1e073916e 100644 --- a/view/theme/frost/smarty3/voting_fakelink.tpl +++ b/view/theme/frost/smarty3/voting_fakelink.tpl @@ -3,5 +3,4 @@ * DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN * *}} - {{$count}} {{$people}} {{$vote_mood}} - +{{$phrase}} diff --git a/view/theme/frost/voting_fakelink.tpl b/view/theme/frost/voting_fakelink.tpl index c34204697..b66302cc2 100644 --- a/view/theme/frost/voting_fakelink.tpl +++ b/view/theme/frost/voting_fakelink.tpl @@ -1,2 +1 @@ - $count $people $vote_mood - +$phrase diff --git a/view/voting_fakelink.tpl b/view/voting_fakelink.tpl index cf1e4beb5..a1ff04a70 100644 --- a/view/voting_fakelink.tpl +++ b/view/voting_fakelink.tpl @@ -1,2 +1 @@ - $count $people $vote_mood
- +$phrase