From 5e09fc31f51ee1cc207afb3d0771094eac5ed85b Mon Sep 17 00:00:00 2001 From: Zach Prezkuta Date: Sat, 11 Aug 2012 14:36:58 -0600 Subject: [PATCH 1/5] Threading updates - Add rudimentary thread handling to Frost - Fix possible CSS bug in several themes from threading update - Add ability for themes to prevent threading --- boot.php | 1 + include/conversation.php | 3 +- js/main.min.js | 2 +- view/search_item.tpl | 6 +- view/theme/comix-plain/search_item.tpl | 6 +- view/theme/comix-plain/wall_item.tpl | 8 +- view/theme/comix-plain/wallwall_item.tpl | 8 +- view/theme/comix/search_item.tpl | 6 +- view/theme/comix/wall_item.tpl | 8 +- view/theme/comix/wallwall_item.tpl | 8 +- view/theme/dispy/search_item.tpl | 6 +- view/theme/dispy/wall_item.tpl | 6 +- view/theme/dispy/wallwall_item.tpl | 6 +- view/theme/facepark/search_item.tpl | 6 +- view/theme/facepark/wall_item.tpl | 6 +- view/theme/facepark/wallwall_item.tpl | 6 +- view/theme/frost-mobile/TODO | 2 + view/theme/frost-mobile/admin_site.tpl | 1 + view/theme/frost-mobile/comment_item.tpl | 6 +- view/theme/frost-mobile/js/main.js | 2 +- view/theme/frost-mobile/js/main.min.js | 2 +- view/theme/frost-mobile/js/theme.js | 9 ++ view/theme/frost-mobile/style.css | 16 +++ view/theme/frost-mobile/theme.php | 3 +- view/theme/frost-mobile/wall_item.tpl | 8 +- view/theme/frost-mobile/wall_thread.tpl | 106 +++++++++++++++++++ view/theme/frost-mobile/wallwall_item.tpl | 8 +- view/theme/frost-mobile/wallwall_thread.tpl | 109 ++++++++++++++++++++ view/theme/frost/TODO | 7 +- view/theme/frost/admin_site.tpl | 1 + view/theme/frost/comment_item.tpl | 6 +- view/theme/frost/js/theme.js | 13 ++- view/theme/frost/js/theme.min.js | 2 +- view/theme/frost/style.css | 32 +++++- view/theme/frost/theme.php | 2 +- view/theme/frost/wall_item.tpl | 8 +- view/theme/frost/wall_thread.tpl | 103 ++++++++++++++++++ view/theme/frost/wallwall_item.tpl | 10 +- view/theme/frost/wallwall_thread.tpl | 108 +++++++++++++++++++ view/theme/testbubble/search_item.tpl | 6 +- view/theme/testbubble/wall_item.tpl | 6 +- view/theme/testbubble/wallwall_item.tpl | 6 +- view/wall_item.tpl | 6 +- view/wall_thread.tpl | 4 +- view/wallwall_item.tpl | 6 +- view/wallwall_thread.tpl | 8 +- 46 files changed, 601 insertions(+), 97 deletions(-) create mode 100644 view/theme/frost-mobile/wall_thread.tpl create mode 100644 view/theme/frost-mobile/wallwall_thread.tpl create mode 100644 view/theme/frost/wall_thread.tpl create mode 100644 view/theme/frost/wallwall_thread.tpl diff --git a/boot.php b/boot.php index b47164f100..76b40c9e98 100644 --- a/boot.php +++ b/boot.php @@ -365,6 +365,7 @@ if(! class_exists('App')) { public $videowidth = 425; public $videoheight = 350; public $force_max_items = 0; + public $theme_thread_allow = true; private $scheme; private $hostname; diff --git a/include/conversation.php b/include/conversation.php index adc198412e..5f3d7353e5 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -545,6 +545,7 @@ function prepare_threads_body($a, $items, $cmnt_tpl, $page_writeable, $mode, $pr '$edurl' => t('Link'), '$edvideo' => t('Video'), '$preview' => t('Preview'), + '$indent' => $indent, '$sourceapp' => t($a->sourcename), '$ww' => (($mode === 'network') ? $commentww : '') )); @@ -623,7 +624,7 @@ function prepare_threads_body($a, $items, $cmnt_tpl, $page_writeable, $mode, $pr /* * I don't like this very much... */ - if(get_config('system','thread_allow')) { + if(get_config('system','thread_allow') && $a->theme_thread_allow) { $item_result['flatten'] = false; $item_result['threaded'] = true; } diff --git a/js/main.min.js b/js/main.min.js index e8de026e40..f94d4dc98e 100644 --- a/js/main.min.js +++ b/js/main.min.js @@ -1 +1 @@ -function openClose(e){document.getElementById(e).style.display=="block"?document.getElementById(e).style.display="none":document.getElementById(e).style.display="block"}function openMenu(e){document.getElementById(e).style.display="block"}function closeMenu(e){document.getElementById(e).style.display="none"}function NavUpdate(){if(!stopped){var e="ping"+(localUser!=0?"?f=&uid="+localUser:"");$.get(e,function(e){$(e).find("result").each(function(){$("nav").trigger("nav-update",this),$("#live-network").length&&(src="network",liveUpdate()),$("#live-profile").length&&(src="profile",liveUpdate()),$("#live-community").length&&(src="community",liveUpdate()),$("#live-notes").length&&(src="notes",liveUpdate()),$("#live-display").length&&liking&&(liking=0,window.location.href=window.location.href),$("#live-photos").length&&liking&&(liking=0,window.location.href=window.location.href)})})}timer=setTimeout(NavUpdate,updateInterval)}function liveUpdate(){if(src==null||stopped||!profile_uid){$(".like-rotator").hide();return}if($(".comment-edit-text-full").length||in_progress){livetime&&clearTimeout(livetime),livetime=setTimeout(liveUpdate,1e4);return}livetime!=null&&(livetime=null),prev="live-"+src,in_progress=!0;var e=netargs.length?"/"+netargs:"",t="update_"+src+e+"&p="+profile_uid+"&page="+profile_page+"&msie="+(msie?1:0);$.get(t,function(e){in_progress=!1,$(".tread-wrapper",e).each(function(){var e=$(this).attr("id");$("#"+e).length==0&&profile_page==1?($("img",this).each(function(){$(this).attr("src",$(this).attr("dst"))}),$("#"+prev).after($(this))):($("img",this).each(function(){$(this).attr("src",$(this).attr("dst"))}),$("#"+e).replaceWith($(this))),prev=e}),$(".like-rotator").hide(),commentBusy&&(commentBusy=!1,$("body").css("cursor","auto")),$(".comment-edit-form textarea").contact_autocomplete(baseurl+"/acl")})}function imgbright(e){$(e).removeClass("drophide").addClass("drop")}function imgdull(e){$(e).removeClass("drop").addClass("drophide")}function dolike(e,t){unpause(),$("#like-rotator-"+e.toString()).show(),$.get("like/"+e.toString()+"?verb="+t,NavUpdate),liking=1}function dostar(e){e=e.toString(),$("#like-rotator-"+e).show(),$.get("starred/"+e,function(t){t.match(/1/)?($("#starred-"+e).addClass("starred"),$("#starred-"+e).removeClass("unstarred"),$("#star-"+e).addClass("hidden"),$("#unstar-"+e).removeClass("hidden")):($("#starred-"+e).addClass("unstarred"),$("#starred-"+e).removeClass("starred"),$("#star-"+e).removeClass("hidden"),$("#unstar-"+e).addClass("hidden")),$("#like-rotator-"+e).hide()})}function getPosition(e){var t={x:0,y:0};if(e.pageX||e.pageY)t.x=e.pageX,t.y=e.pageY;else if(e.clientX||e.clientY)t.x=e.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)-document.documentElement.clientLeft,t.y=e.clientY+(document.documentElement.scrollTop||document.body.scrollTop)-document.documentElement.clientTop;else if(e.x||e.y)t.x=e.x,t.y=e.y;return t}function lockview(e,t){e=e||window.event,cursor=getPosition(e),lockvisible?lockviewhide():(lockvisible=!0,$.get("lockview/"+t,function(e){$("#panel").html(e),$("#panel").css({left:cursor.x+5,top:cursor.y+5}),$("#panel").show()}))}function lockviewhide(){lockvisible=!1,$("#panel").hide()}function post_comment(e){return unpause(),commentBusy=!0,$("body").css("cursor","wait"),$("#comment-preview-inp-"+e).val("0"),$.post("item",$("#comment-edit-form-"+e).serialize(),function(t){if(t.success){$("#comment-edit-wrapper-"+e).hide(),$("#comment-edit-text-"+e).val("");var n=document.getElementById("comment-edit-text-"+e);n&&commentClose(n,e),timer&&clearTimeout(timer),timer=setTimeout(NavUpdate,10)}t.reload&&(window.location.href=t.reload)},"json"),!1}function preview_comment(e){return $("#comment-preview-inp-"+e).val("1"),$("#comment-edit-preview-"+e).show(),$.post("item",$("#comment-edit-form-"+e).serialize(),function(t){t.preview&&($("#comment-edit-preview-"+e).html(t.preview),$("#comment-edit-preview-"+e+" a").click(function(){return!1}))},"json"),!0}function preview_post(){return $("#jot-preview").val("1"),$("#jot-preview-content").show(),tinyMCE.triggerSave(),$.post("item",$("#profile-jot-form").serialize(),function(e){e.preview&&($("#jot-preview-content").html(e.preview),$("#jot-preview-content a").click(function(){return!1}))},"json"),$("#jot-preview").val("0"),!0}function unpause(){totStopped=!1,stopped=!1,$("#pause").html("")}function bin2hex(e){var t,n,r=0,i=[];e+="",r=e.length;for(n=0;n'+e.desc+'
'+e.version+'
'+e.credits+'
'+theme+'')})}var src=null,prev=null,livetime=null,msie=!1,stopped=!1,totStopped=!1,timer=null,pr=0,liking=0,in_progress=!1,langSelect=!1,commentBusy=!1,last_popup_menu=null,last_popup_button=null;$(function(){function e(){last_popup_menu&&(last_popup_menu.hide(),last_popup_button.removeClass("selected"),last_popup_menu=null,last_popup_button=null)}$.ajaxSetup({cache:!1}),msie=$.browser.msie,$(".onoff input").each(function(){val=$(this).val(),id=$(this).attr("id"),$("#"+id+"_onoff ."+(val==0?"on":"off")).addClass("hidden")}),$(".onoff > a").click(function(e){e.preventDefault();var t=$(this).siblings("input"),n=1-t.val(),r=t.attr("id");$("#"+r+"_onoff ."+(n==0?"on":"off")).addClass("hidden"),$("#"+r+"_onoff ."+(n==1?"on":"off")).removeClass("hidden"),t.val(n)}),setupFieldRichtext(),$("a[rel^=#]").click(function(t){return e(),menu=$($(this).attr("rel")),t.preventDefault(),t.stopPropagation(),menu.attr("popup")=="false"?!1:($(this).parent().toggleClass("selected"),menu.toggle(),menu.css("display")=="none"?(last_popup_menu=null,last_popup_button=null):(last_popup_menu=menu,last_popup_button=$(this).parent()),!1)}),$("html").click(function(){e()}),$("a.popupbox").fancybox({transitionIn:"elastic",transitionOut:"elastic"});var t=unescape($("#nav-notifications-template[rel=template]").html()),n=unescape($("
").append($("#nav-notifications-see-all").clone()).html()),r=unescape($("
").append($("#nav-notifications-mark-all").clone()).html()),i=unescape($("#nav-notifications-menu").html());$("nav").bind("nav-update",function(e,s){var o=$(s).find("invalid").text();o==1&&(window.location.href=window.location.href);var u=$(s).find("net").text();u==0?(u="",$("#net-update").removeClass("show")):$("#net-update").addClass("show"),$("#net-update").html(u);var a=$(s).find("home").text();a==0?(a="",$("#home-update").removeClass("show")):$("#home-update").addClass("show"),$("#home-update").html(a);var f=$(s).find("intro").text();f==0?(f="",$("#intro-update").removeClass("show")):$("#intro-update").addClass("show"),$("#intro-update").html(f);var l=$(s).find("mail").text();l==0?(l="",$("#mail-update").removeClass("show")):$("#mail-update").addClass("show"),$("#mail-update").html(l);var f=$(s).find("intro").text();f==0?(f="",$("#intro-update-li").removeClass("show")):$("#intro-update-li").addClass("show"),$("#intro-update-li").html(f);var l=$(s).find("mail").text();l==0?(l="",$("#mail-update-li").removeClass("show")):$("#mail-update-li").addClass("show"),$("#mail-update-li").html(l);var c=$(s).find("notif");c.children("note").length==0?$("#nav-notifications-menu").html(i):(nnm=$("#nav-notifications-menu"),nnm.html(n+r),c.children("note").each(function(){e=$(this),text=e.text().format(""+e.attr("name")+""),html=t.format(e.attr("href"),e.attr("photo"),text,e.attr("date"),e.attr("seen")),nnm.append(html)})),notif=c.attr("count"),notif>0?$("#nav-notifications-linkmenu").addClass("on"):$("#nav-notifications-linkmenu").removeClass("on"),notif==0?(notif="",$("#notify-update").removeClass("show")):$("#notify-update").addClass("show"),$("#notify-update").html(notif);var h=$(s).find("sysmsgs");h.children("notice").each(function(){text=$(this).text(),$.jGrowl(text,{sticky:!0,theme:"notice"})}),h.children("info").each(function(){text=$(this).text(),$.jGrowl(text,{sticky:!1,theme:"info",life:1e4})})}),NavUpdate(),$(document).keydown(function(e){if(e.keyCode=="8"){var t=e.target||e.srcElement;if(!/input|textarea/i.test(t.nodeName))return!1}e.keyCode=="19"||e.ctrlKey&&e.which=="32"?(e.preventDefault(),stopped==0?(stopped=!0,e.ctrlKey&&(totStopped=!0),$("#pause").html('pause')):unpause()):totStopped||unpause()})});var lockvisible=!1;String.prototype.format=function(){var e=this;for(var t=0;t'+e.desc+'
'+e.version+'
'+e.credits+'
'+theme+'')})}var src=null,prev=null,livetime=null,msie=!1,stopped=!1,totStopped=!1,timer=null,pr=0,liking=0,in_progress=!1,langSelect=!1,commentBusy=!1,last_popup_menu=null,last_popup_button=null;$(function(){function e(){last_popup_menu&&(last_popup_menu.hide(),last_popup_button.removeClass("selected"),last_popup_menu=null,last_popup_button=null)}$.ajaxSetup({cache:!1}),msie=$.browser.msie,$(".onoff input").each(function(){val=$(this).val(),id=$(this).attr("id"),$("#"+id+"_onoff ."+(val==0?"on":"off")).addClass("hidden")}),$(".onoff > a").click(function(e){e.preventDefault();var t=$(this).siblings("input"),n=1-t.val(),r=t.attr("id");$("#"+r+"_onoff ."+(n==0?"on":"off")).addClass("hidden"),$("#"+r+"_onoff ."+(n==1?"on":"off")).removeClass("hidden"),t.val(n)}),setupFieldRichtext(),$("a[rel^=#]").click(function(t){return e(),menu=$($(this).attr("rel")),t.preventDefault(),t.stopPropagation(),menu.attr("popup")=="false"?!1:($(this).parent().toggleClass("selected"),menu.toggle(),menu.css("display")=="none"?(last_popup_menu=null,last_popup_button=null):(last_popup_menu=menu,last_popup_button=$(this).parent()),!1)}),$("html").click(function(){e()}),$("a.popupbox").fancybox({transitionIn:"elastic",transitionOut:"elastic"});var t=unescape($("#nav-notifications-template[rel=template]").html()),n=unescape($("
").append($("#nav-notifications-see-all").clone()).html()),r=unescape($("
").append($("#nav-notifications-mark-all").clone()).html()),i=unescape($("#nav-notifications-menu").html());$("nav").bind("nav-update",function(e,s){var o=$(s).find("invalid").text();o==1&&(window.location.href=window.location.href);var u=$(s).find("net").text();u==0?(u="",$("#net-update").removeClass("show")):$("#net-update").addClass("show"),$("#net-update").html(u);var a=$(s).find("home").text();a==0?(a="",$("#home-update").removeClass("show")):$("#home-update").addClass("show"),$("#home-update").html(a);var f=$(s).find("intro").text();f==0?(f="",$("#intro-update").removeClass("show")):$("#intro-update").addClass("show"),$("#intro-update").html(f);var l=$(s).find("mail").text();l==0?(l="",$("#mail-update").removeClass("show")):$("#mail-update").addClass("show"),$("#mail-update").html(l);var f=$(s).find("intro").text();f==0?(f="",$("#intro-update-li").removeClass("show")):$("#intro-update-li").addClass("show"),$("#intro-update-li").html(f);var l=$(s).find("mail").text();l==0?(l="",$("#mail-update-li").removeClass("show")):$("#mail-update-li").addClass("show"),$("#mail-update-li").html(l);var c=$(s).find("notif");c.children("note").length==0?$("#nav-notifications-menu").html(i):(nnm=$("#nav-notifications-menu"),nnm.html(n+r),c.children("note").each(function(){e=$(this),text=e.text().format(""+e.attr("name")+""),html=t.format(e.attr("href"),e.attr("photo"),text,e.attr("date"),e.attr("seen")),nnm.append(html)})),notif=c.attr("count"),notif>0?$("#nav-notifications-linkmenu").addClass("on"):$("#nav-notifications-linkmenu").removeClass("on"),notif==0?(notif="",$("#notify-update").removeClass("show")):$("#notify-update").addClass("show"),$("#notify-update").html(notif);var h=$(s).find("sysmsgs");h.children("notice").each(function(){text=$(this).text(),$.jGrowl(text,{sticky:!0,theme:"notice"})}),h.children("info").each(function(){text=$(this).text(),$.jGrowl(text,{sticky:!1,theme:"info",life:1e4})})}),NavUpdate(),$(document).keydown(function(e){if(e.keyCode=="8"){var t=e.target||e.srcElement;if(!/input|textarea/i.test(t.nodeName))return!1}e.keyCode=="19"||e.ctrlKey&&e.which=="32"?(e.preventDefault(),stopped==0?(stopped=!0,e.ctrlKey&&(totStopped=!0),$("#pause").html('pause')):unpause()):totStopped||unpause()})});var lockvisible=!1;String.prototype.format=function(){var e=this;for(var t=0;t -
-
+
+
-
+
diff --git a/view/theme/comix-plain/search_item.tpl b/view/theme/comix-plain/search_item.tpl index dba289031c..828e1065b4 100644 --- a/view/theme/comix-plain/search_item.tpl +++ b/view/theme/comix-plain/search_item.tpl @@ -1,5 +1,5 @@ -
-
+
+
-
+
diff --git a/view/theme/comix-plain/wall_item.tpl b/view/theme/comix-plain/wall_item.tpl index dfcd8ca960..0ef70cf8b9 100644 --- a/view/theme/comix-plain/wall_item.tpl +++ b/view/theme/comix-plain/wall_item.tpl @@ -1,11 +1,11 @@ -
-
+
+
- $item.name + $item.name menu
@@ -74,5 +74,5 @@ $item.comment
-
+
diff --git a/view/theme/comix-plain/wallwall_item.tpl b/view/theme/comix-plain/wallwall_item.tpl index abd5967b2a..4c5b120873 100644 --- a/view/theme/comix-plain/wallwall_item.tpl +++ b/view/theme/comix-plain/wallwall_item.tpl @@ -1,5 +1,5 @@ -
-
+
+
diff --git a/view/theme/comix/search_item.tpl b/view/theme/comix/search_item.tpl index dba289031c..828e1065b4 100644 --- a/view/theme/comix/search_item.tpl +++ b/view/theme/comix/search_item.tpl @@ -1,5 +1,5 @@ -
-
+
+
-
+
diff --git a/view/theme/comix/wall_item.tpl b/view/theme/comix/wall_item.tpl index dfcd8ca960..0ef70cf8b9 100644 --- a/view/theme/comix/wall_item.tpl +++ b/view/theme/comix/wall_item.tpl @@ -1,11 +1,11 @@ -
-
+
+
- $item.name + $item.name menu
@@ -74,5 +74,5 @@ $item.comment
-
+
diff --git a/view/theme/comix/wallwall_item.tpl b/view/theme/comix/wallwall_item.tpl index abd5967b2a..4c5b120873 100644 --- a/view/theme/comix/wallwall_item.tpl +++ b/view/theme/comix/wallwall_item.tpl @@ -1,5 +1,5 @@ -
-
+
+
diff --git a/view/theme/dispy/search_item.tpl b/view/theme/dispy/search_item.tpl index bfad1b7b72..35572caa04 100644 --- a/view/theme/dispy/search_item.tpl +++ b/view/theme/dispy/search_item.tpl @@ -1,5 +1,5 @@ -
-
+
+
-
+
diff --git a/view/theme/dispy/wall_item.tpl b/view/theme/dispy/wall_item.tpl index 8d6f258e6e..d5cc7f16c8 100644 --- a/view/theme/dispy/wall_item.tpl +++ b/view/theme/dispy/wall_item.tpl @@ -1,6 +1,6 @@ -
-
+
+
-
+
diff --git a/view/theme/dispy/wallwall_item.tpl b/view/theme/dispy/wallwall_item.tpl index f5187b710f..63c8a2e96b 100644 --- a/view/theme/dispy/wallwall_item.tpl +++ b/view/theme/dispy/wallwall_item.tpl @@ -1,6 +1,6 @@ -
-
+
+
diff --git a/view/theme/facepark/search_item.tpl b/view/theme/facepark/search_item.tpl index bfad1b7b72..35572caa04 100644 --- a/view/theme/facepark/search_item.tpl +++ b/view/theme/facepark/search_item.tpl @@ -1,5 +1,5 @@ -
-
+
+
-
+
diff --git a/view/theme/facepark/wall_item.tpl b/view/theme/facepark/wall_item.tpl index 2c88fc598e..dda4bc4a90 100644 --- a/view/theme/facepark/wall_item.tpl +++ b/view/theme/facepark/wall_item.tpl @@ -1,5 +1,5 @@ -
-
+
+
-
+
diff --git a/view/theme/facepark/wallwall_item.tpl b/view/theme/facepark/wallwall_item.tpl index 211906c934..ba6131857f 100644 --- a/view/theme/facepark/wallwall_item.tpl +++ b/view/theme/facepark/wallwall_item.tpl @@ -1,5 +1,5 @@ -
-
+
+
diff --git a/view/theme/frost-mobile/TODO b/view/theme/frost-mobile/TODO index 0ffd4f8c3b..023e90bd65 100644 --- a/view/theme/frost-mobile/TODO +++ b/view/theme/frost-mobile/TODO @@ -26,4 +26,6 @@ Photo album display? - Reduce DOM elements (~2400 for 10 items, ~8400 for 40 items) +- Add wall-thread.tpl and wallwall-thread.tpl +- Sometimes, when "Permission denied", wrong login page is shown diff --git a/view/theme/frost-mobile/admin_site.tpl b/view/theme/frost-mobile/admin_site.tpl index bb00c2cccf..203802bba6 100644 --- a/view/theme/frost-mobile/admin_site.tpl +++ b/view/theme/frost-mobile/admin_site.tpl @@ -35,6 +35,7 @@ {{ inc field_checkbox.tpl with $field=$ostatus_disabled }}{{ endinc }} {{ inc field_checkbox.tpl with $field=$diaspora_enabled }}{{ endinc }} {{ inc field_checkbox.tpl with $field=$dfrn_only }}{{ endinc }} + {{ inc field_checkbox.tpl with $field=$thread_allow }}{{ endinc }} {{ inc field_input.tpl with $field=$global_directory }}{{ endinc }}
diff --git a/view/theme/frost-mobile/comment_item.tpl b/view/theme/frost-mobile/comment_item.tpl index 5aa84dc10e..570db68426 100755 --- a/view/theme/frost-mobile/comment_item.tpl +++ b/view/theme/frost-mobile/comment_item.tpl @@ -10,8 +10,10 @@ }); --> -
-
+
+ + diff --git a/view/theme/frost-mobile/js/main.js b/view/theme/frost-mobile/js/main.js index f8d8b8db0b..7498c3b91f 100644 --- a/view/theme/frost-mobile/js/main.js +++ b/view/theme/frost-mobile/js/main.js @@ -297,7 +297,7 @@ // add a new thread - $j('.tread-wrapper',data).each(function() { + $j('.toplevel_item',data).each(function() { var ident = $j(this).attr('id'); if($j('#' + ident).length == 0 && profile_page == 1) { diff --git a/view/theme/frost-mobile/js/main.min.js b/view/theme/frost-mobile/js/main.min.js index 22be255504..1cb4ab8bcd 100644 --- a/view/theme/frost-mobile/js/main.min.js +++ b/view/theme/frost-mobile/js/main.min.js @@ -1 +1 @@ -function openClose(e){document.getElementById(e).style.display=="block"?document.getElementById(e).style.display="none":document.getElementById(e).style.display="block"}function openMenu(e){document.getElementById(e).style.display="block"}function closeMenu(e){document.getElementById(e).style.display="none"}function NavUpdate(){if(!stopped){var e="ping"+(localUser!=0?"?f=&uid="+localUser:"");$j.get(e,function(e){$j(e).find("result").each(function(){$j("nav").trigger("nav-update",this),$j("#live-network").length&&(src="network",liveUpdate()),$j("#live-profile").length&&(src="profile",liveUpdate()),$j("#live-community").length&&(src="community",liveUpdate()),$j("#live-notes").length&&(src="notes",liveUpdate()),$j("#live-display").length&&liking&&(liking=0,window.location.href=window.location.href),$j("#live-photos").length&&liking&&(liking=0,window.location.href=window.location.href)})})}timer=setTimeout(NavUpdate,updateInterval)}function liveUpdate(){if(src==null||stopped||!profile_uid){$j(".like-rotator").hide();return}if($j(".comment-edit-text-full").length||in_progress){livetime&&clearTimeout(livetime),livetime=setTimeout(liveUpdate,1e4);return}livetime!=null&&(livetime=null),prev="live-"+src,in_progress=!0;var e=netargs.length?"/"+netargs:"",t="update_"+src+e+"&p="+profile_uid+"&page="+profile_page+"&msie="+(msie?1:0);$j.get(t,function(e){in_progress=!1,$j(".tread-wrapper",e).each(function(){var e=$j(this).attr("id");$j("#"+e).length==0&&profile_page==1?($j("img",this).each(function(){$j(this).attr("src",$j(this).attr("dst"))}),$j("#"+prev).after($j(this))):($j("img",this).each(function(){$j(this).attr("src",$j(this).attr("dst"))}),$j("#"+e).replaceWith($j(this))),prev=e}),$j(".like-rotator").hide(),commentBusy&&(commentBusy=!1,$j("body").css("cursor","auto")),$j(".comment-edit-form textarea").contact_autocomplete(baseurl+"/acl")})}function imgbright(e){$j(e).removeClass("drophide").addClass("drop")}function imgdull(e){$j(e).removeClass("drop").addClass("drophide")}function dolike(e,t){unpause(),$j("#like-rotator-"+e.toString()).show(),$j.get("like/"+e.toString()+"?verb="+t,NavUpdate),liking=1}function dostar(e){e=e.toString(),$j.get("starred/"+e,function(t){t.match(/1/)?($j("#starred-"+e).addClass("starred"),$j("#starred-"+e).removeClass("unstarred"),$j("#star-"+e).addClass("hidden"),$j("#unstar-"+e).removeClass("hidden")):($j("#starred-"+e).addClass("unstarred"),$j("#starred-"+e).removeClass("starred"),$j("#star-"+e).removeClass("hidden"),$j("#unstar-"+e).addClass("hidden"))})}function getPosition(e){var t={x:0,y:0};if(e.touches[0].pageX||e.touches[0].pageY)t.x=e.touches[0].pageX,t.y=e.touches[0].pageY;else if(e.touches[0].clientX||e.touches[0].clientY)t.x=e.touches[0].clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)-document.documentElement.clientLeft,t.y=e.touches[0].clientY+(document.documentElement.scrollTop||document.body.scrollTop)-document.documentElement.clientTop;else if(e.touches[0].x||e.touches[0].y)t.touches[0].x=e.touches[0].x,t.touches[0].y=e.touches[0].y;return t}function lockview(e,t){e=e||window.event,cursor=getPosition(e),lockvisible?lockviewhide():(lockvisible=!0,$j.get("lockview/"+t,function(e){$j("#panel").html(e),$j("#panel").css({left:cursor.x+5,top:cursor.y+5}),$j("#panel").show()}))}function lockviewhide(){lockvisible=!1,$j("#panel").hide()}function post_comment(e){return unpause(),commentBusy=!0,$j("body").css("cursor","wait"),$j("#comment-preview-inp-"+e).val("0"),$j.post("item",$j("#comment-edit-form-"+e).serialize(),function(t){if(t.success){$j("#comment-edit-wrapper-"+e).hide(),$j("#comment-edit-text-"+e).val("");var n=document.getElementById("comment-edit-text-"+e);n&&commentClose(n,e),timer&&clearTimeout(timer),timer=setTimeout(NavUpdate,10)}t.reload&&(window.location.href=t.reload)},"json"),!1}function preview_comment(e){return $j("#comment-preview-inp-"+e).val("1"),$j("#comment-edit-preview-"+e).show(),$j.post("item",$j("#comment-edit-form-"+e).serialize(),function(t){t.preview&&($j("#comment-edit-preview-"+e).html(t.preview),$j("#comment-edit-preview-"+e+" a").click(function(){return!1}))},"json"),!0}function preview_post(){return $j("#jot-preview").val("1"),$j("#jot-preview-content").show(),tinyMCE.triggerSave(),$j.post("item",$j("#profile-jot-form").serialize(),function(e){e.preview&&($j("#jot-preview-content").html(e.preview),$j("#jot-preview-content a").click(function(){return!1}))},"json"),$j("#jot-preview").val("0"),!0}function unpause(){totStopped=!1,stopped=!1,$j("#pause").html("")}function bin2hex(e){var t,n,r=0,i=[];e+="",r=e.length;for(n=0;n'+e.desc+'
'+e.version+'
'+e.credits+'
'+theme+'')})}var src=null,prev=null,livetime=null,msie=!1,stopped=!1,totStopped=!1,timer=null,pr=0,liking=0,in_progress=!1,langSelect=!1,commentBusy=!1,last_popup_menu=null,last_popup_button=null;$j(function(){function e(e){last_popup_menu&&"#"+last_popup_menu.attr("id")!==$j(e.target).attr("rel")&&(last_popup_menu.hide(),last_popup_menu.attr("id")=="nav-notifications-menu"&&$j("section").show(),last_popup_button.removeClass("selected"),last_popup_menu=null,last_popup_button=null)}$j.ajaxSetup({cache:!1}),msie=$j.browser.msie,$j(".onoff input").each(function(){val=$j(this).val(),id=$j(this).attr("id"),$j("#"+id+"_onoff ."+(val==0?"on":"off")).addClass("hidden")}),$j(".onoff > a").click(function(e){e.preventDefault();var t=$j(this).siblings("input"),n=1-t.val(),r=t.attr("id");$j("#"+r+"_onoff ."+(n==0?"on":"off")).addClass("hidden"),$j("#"+r+"_onoff ."+(n==1?"on":"off")).removeClass("hidden"),t.val(n)}),$j("img[rel^=#]").click(function(t){return e(t),menu=$j($j(this).attr("rel")),t.preventDefault(),t.stopPropagation(),menu.attr("popup")=="false"?!1:(menu.css("display")=="none"?($j(this).parent().addClass("selected"),menu.show(),menu.attr("id")=="nav-notifications-menu"&&$j("section").hide(),last_popup_menu=menu,last_popup_button=$j(this).parent()):($j(this).parent().removeClass("selected"),menu.hide(),menu.attr("id")=="nav-notifications-menu"&&$j("section").show(),last_popup_menu=null,last_popup_button=null),!1)}),$j("html").click(function(t){e(t)});var t=unescape($j("#nav-notifications-template[rel=template]").html()),n=unescape($j("
").append($j("#nav-notifications-see-all").clone()).html()),r=unescape($j("
").append($j("#nav-notifications-mark-all").clone()).html()),i=unescape($j("#nav-notifications-menu").html());$j("nav").bind("nav-update",function(e,s){var o=$j(s).find("invalid").text();o==1&&(window.location.href=window.location.href);var u=$j(s).find("net").text();u==0?(u="",$j("#net-update").removeClass("show")):$j("#net-update").addClass("show"),$j("#net-update").html(u);var a=$j(s).find("home").text();a==0?(a="",$j("#home-update").removeClass("show")):$j("#home-update").addClass("show"),$j("#home-update").html(a);var f=$j(s).find("intro").text();f==0?(f="",$j("#intro-update").removeClass("show")):$j("#intro-update").addClass("show"),$j("#intro-update").html(f);var l=$j(s).find("mail").text();l==0?(l="",$j("#mail-update").removeClass("show")):$j("#mail-update").addClass("show"),$j("#mail-update").html(l);var f=$j(s).find("intro").text();f==0?(f="",$j("#intro-update-li").removeClass("show")):$j("#intro-update-li").addClass("show"),$j("#intro-update-li").html(f);var l=$j(s).find("mail").text();l==0?(l="",$j("#mail-update-li").removeClass("show")):$j("#mail-update-li").addClass("show"),$j("#mail-update-li").html(l);var c=$j(s).find("notif");c.children("note").length==0?$j("#nav-notifications-menu").html(i):(nnm=$j("#nav-notifications-menu"),nnm.html(n+r),c.children("note").each(function(){e=$j(this),text=e.text().format(""+e.attr("name")+""),html=t.format(e.attr("href"),e.attr("photo"),text,e.attr("date"),e.attr("seen")),nnm.append(html)})),notif=c.attr("count"),notif>0?$j("#nav-notifications-linkmenu").addClass("on"):$j("#nav-notifications-linkmenu").removeClass("on"),notif==0?(notif="",$j("#notify-update").removeClass("show")):$j("#notify-update").addClass("show"),$j("#notify-update").html(notif);var h=$j(s).find("sysmsgs");h.children("notice").each(function(){text=$j(this).text(),$j.jGrowl(text,{sticky:!1,theme:"notice",life:1500})}),h.children("info").each(function(){text=$j(this).text(),$j.jGrowl(text,{sticky:!1,theme:"info",life:1e3})})}),NavUpdate()});var lockvisible=!1;String.prototype.format=function(){var e=this;for(var t=0;t'+e.desc+'
'+e.version+'
'+e.credits+'
'+theme+'')})}var src=null,prev=null,livetime=null,msie=!1,stopped=!1,totStopped=!1,timer=null,pr=0,liking=0,in_progress=!1,langSelect=!1,commentBusy=!1,last_popup_menu=null,last_popup_button=null;$j(function(){function e(e){last_popup_menu&&"#"+last_popup_menu.attr("id")!==$j(e.target).attr("rel")&&(last_popup_menu.hide(),last_popup_menu.attr("id")=="nav-notifications-menu"&&$j("section").show(),last_popup_button.removeClass("selected"),last_popup_menu=null,last_popup_button=null)}$j.ajaxSetup({cache:!1}),msie=$j.browser.msie,$j(".onoff input").each(function(){val=$j(this).val(),id=$j(this).attr("id"),$j("#"+id+"_onoff ."+(val==0?"on":"off")).addClass("hidden")}),$j(".onoff > a").click(function(e){e.preventDefault();var t=$j(this).siblings("input"),n=1-t.val(),r=t.attr("id");$j("#"+r+"_onoff ."+(n==0?"on":"off")).addClass("hidden"),$j("#"+r+"_onoff ."+(n==1?"on":"off")).removeClass("hidden"),t.val(n)}),$j("img[rel^=#]").click(function(t){return e(t),menu=$j($j(this).attr("rel")),t.preventDefault(),t.stopPropagation(),menu.attr("popup")=="false"?!1:(menu.css("display")=="none"?($j(this).parent().addClass("selected"),menu.show(),menu.attr("id")=="nav-notifications-menu"&&$j("section").hide(),last_popup_menu=menu,last_popup_button=$j(this).parent()):($j(this).parent().removeClass("selected"),menu.hide(),menu.attr("id")=="nav-notifications-menu"&&$j("section").show(),last_popup_menu=null,last_popup_button=null),!1)}),$j("html").click(function(t){e(t)});var t=unescape($j("#nav-notifications-template[rel=template]").html()),n=unescape($j("
").append($j("#nav-notifications-see-all").clone()).html()),r=unescape($j("
").append($j("#nav-notifications-mark-all").clone()).html()),i=unescape($j("#nav-notifications-menu").html());$j("nav").bind("nav-update",function(e,s){var o=$j(s).find("invalid").text();o==1&&(window.location.href=window.location.href);var u=$j(s).find("net").text();u==0?(u="",$j("#net-update").removeClass("show")):$j("#net-update").addClass("show"),$j("#net-update").html(u);var a=$j(s).find("home").text();a==0?(a="",$j("#home-update").removeClass("show")):$j("#home-update").addClass("show"),$j("#home-update").html(a);var f=$j(s).find("intro").text();f==0?(f="",$j("#intro-update").removeClass("show")):$j("#intro-update").addClass("show"),$j("#intro-update").html(f);var l=$j(s).find("mail").text();l==0?(l="",$j("#mail-update").removeClass("show")):$j("#mail-update").addClass("show"),$j("#mail-update").html(l);var f=$j(s).find("intro").text();f==0?(f="",$j("#intro-update-li").removeClass("show")):$j("#intro-update-li").addClass("show"),$j("#intro-update-li").html(f);var l=$j(s).find("mail").text();l==0?(l="",$j("#mail-update-li").removeClass("show")):$j("#mail-update-li").addClass("show"),$j("#mail-update-li").html(l);var c=$j(s).find("notif");c.children("note").length==0?$j("#nav-notifications-menu").html(i):(nnm=$j("#nav-notifications-menu"),nnm.html(n+r),c.children("note").each(function(){e=$j(this),text=e.text().format(""+e.attr("name")+""),html=t.format(e.attr("href"),e.attr("photo"),text,e.attr("date"),e.attr("seen")),nnm.append(html)})),notif=c.attr("count"),notif>0?$j("#nav-notifications-linkmenu").addClass("on"):$j("#nav-notifications-linkmenu").removeClass("on"),notif==0?(notif="",$j("#notify-update").removeClass("show")):$j("#notify-update").addClass("show"),$j("#notify-update").html(notif);var h=$j(s).find("sysmsgs");h.children("notice").each(function(){text=$j(this).text(),$j.jGrowl(text,{sticky:!1,theme:"notice",life:1500})}),h.children("info").each(function(){text=$j(this).text(),$j.jGrowl(text,{sticky:!1,theme:"info",life:1e3})})}),NavUpdate()});var lockvisible=!1;String.prototype.format=function(){var e=this;for(var t=0;t * Maintainer: Zach P */ @@ -26,5 +26,6 @@ function frost_mobile_init(&$a) { $a->sourcename = 'Friendica mobile web'; $a->videowidth = 250; $a->videoheight = 200; + $a->theme_thread_allow = false; } diff --git a/view/theme/frost-mobile/wall_item.tpl b/view/theme/frost-mobile/wall_item.tpl index 1867afe157..f75059d9c7 100644 --- a/view/theme/frost-mobile/wall_item.tpl +++ b/view/theme/frost-mobile/wall_item.tpl @@ -1,6 +1,6 @@ - -
+ +
$item.name -
$item.ago
+
$item.ago

@@ -78,5 +78,5 @@ $item.comment - + diff --git a/view/theme/frost-mobile/wall_thread.tpl b/view/theme/frost-mobile/wall_thread.tpl new file mode 100644 index 0000000000..165a188f19 --- /dev/null +++ b/view/theme/frost-mobile/wall_thread.tpl @@ -0,0 +1,106 @@ +{{if $item.comment_firstcollapsed}} +
+ $item.num_comments $item.hide_text +
+ {{endif}} +
+ + +
+
+ +
+ + $item.name + + +
+ +
+ {{ if $item.lock }}$item.lock + {{ else }}
{{ endif }} +
$item.location
+
+
+ + $item.name +
$item.ago
+ + +
+ +
+
$item.title
+ +
$item.body + + {{ for $item.tags as $tag }} + $tag + {{ endfor }} + +
+
+
+ {{ if $item.vote }} + + {{ endif }} + {{ if $item.plink }} + + {{ endif }} + {{ if $item.edpost }} + + {{ endif }} + + {{ if $item.star }} + + + {{ endif }} + {{ if $item.filer }} + + {{ endif }} + + {{ if $item.drop.dropping }}{{ endif }} + + {{ if $item.drop.dropping }}{{ endif }} + +
+
+ + +
$item.dislike
+ + {{ if $item.threaded }} + {{ if $item.comment }} + + $item.comment + + {{ endif }} + {{ endif }} + + + +{{ for $item.children as $item }} + {{ inc $item.template }}{{ endinc }} +{{ endfor }} + +{{ if $item.flatten }} + + $item.comment + +{{ endif }} +
+ diff --git a/view/theme/frost-mobile/wallwall_item.tpl b/view/theme/frost-mobile/wallwall_item.tpl index e4d6b60bb4..9affbcebae 100644 --- a/view/theme/frost-mobile/wallwall_item.tpl +++ b/view/theme/frost-mobile/wallwall_item.tpl @@ -1,6 +1,6 @@ - -
+ +
@@ -68,7 +68,7 @@ {{ endif }} - {{ if $item.drop.dropping }}{{ endif }} + {{ if $item.drop.dropping }}{{ endif }} {{ if $item.drop.dropping }}{{ endif }} @@ -82,6 +82,6 @@ $item.comment - + diff --git a/view/theme/frost-mobile/wallwall_thread.tpl b/view/theme/frost-mobile/wallwall_thread.tpl new file mode 100644 index 0000000000..816c33d2d7 --- /dev/null +++ b/view/theme/frost-mobile/wallwall_thread.tpl @@ -0,0 +1,109 @@ +{{if $item.comment_firstcollapsed}} +
+ $item.num_comments $item.hide_text +
+ {{endif}} +
+ + +
+
+
+ + $item.owner_name +
+
$item.wall
+ +
+ + $item.name + + +
+ +
+ {{ if $item.lock }}$item.lock + {{ else }}
{{ endif }} +
$item.location
+
+
+ + $item.name $item.to $item.owner_name $item.vwall
+
$item.ago
+ +
+
$item.title
+ +
$item.body + + {{ for $item.tags as $tag }} + $tag + {{ endfor }} + +
+
+
+ {{ if $item.vote }} + + {{ endif }} + {{ if $item.plink }} + + {{ endif }} + {{ if $item.edpost }} + + {{ endif }} + + {{ if $item.star }} + + + {{ endif }} + {{ if $item.filer }} + + {{ endif }} + + + {{ if $item.drop.dropping }}{{ endif }} + + {{ if $item.drop.dropping }}{{ endif }} + +
+
+ + +
$item.dislike
+ + {{ if $item.threaded }} + {{ if $item.comment }} + + $item.comment + + {{ endif }} + {{ endif }} + + + +{{ for $item.children as $item }} + {{ inc $item.template }}{{ endinc }} +{{ endfor }} + +{{ if $item.flatten }} + + $item.comment + +{{ endif }} +
+ diff --git a/view/theme/frost/TODO b/view/theme/frost/TODO index 930de8f6f7..1378e5d468 100644 --- a/view/theme/frost/TODO +++ b/view/theme/frost/TODO @@ -6,4 +6,9 @@ Check TinyMCE optimization "Profiles" page is wonky Settings, admin, photos upload don't look beautiful - +Threading: + - indentation + - top-level "show more" looks bad + - need some visual way to tie sub-comments to their parent comments + - need a way to change styles if the system allows threading or not + - just don't allow? diff --git a/view/theme/frost/admin_site.tpl b/view/theme/frost/admin_site.tpl index bb00c2cccf..203802bba6 100644 --- a/view/theme/frost/admin_site.tpl +++ b/view/theme/frost/admin_site.tpl @@ -35,6 +35,7 @@ {{ inc field_checkbox.tpl with $field=$ostatus_disabled }}{{ endinc }} {{ inc field_checkbox.tpl with $field=$diaspora_enabled }}{{ endinc }} {{ inc field_checkbox.tpl with $field=$dfrn_only }}{{ endinc }} + {{ inc field_checkbox.tpl with $field=$thread_allow }}{{ endinc }} {{ inc field_input.tpl with $field=$global_directory }}{{ endinc }}
diff --git a/view/theme/frost/comment_item.tpl b/view/theme/frost/comment_item.tpl index bdc2ef5e6d..32d4d78ef9 100755 --- a/view/theme/frost/comment_item.tpl +++ b/view/theme/frost/comment_item.tpl @@ -10,8 +10,10 @@ }); --> -
+
+ @@ -23,7 +25,7 @@ $mytitle -