]> git.mxchange.org Git - friendica.git/commitdiff
bug fix #1135, show more is usable again
authorhauke <hauke@grlg.org>
Mon, 22 Sep 2014 11:53:16 +0000 (13:53 +0200)
committerhauke <hauke@grlg.org>
Mon, 22 Sep 2014 11:53:16 +0000 (13:53 +0200)
view/theme/frost-mobile/js/jquery.divgrow-1.3.1.f1.js [deleted file]
view/theme/frost-mobile/js/jquery.divgrow-1.3.1.f1.min.js [deleted file]
view/theme/frost-mobile/js/jquery.divgrow-1.3.1.min.js [deleted file]
view/theme/frost-mobile/js/main.js
view/theme/frost-mobile/js/main.min.js [deleted file]
view/theme/frost-mobile/js/readmore.js [new file with mode: 0644]
view/theme/frost-mobile/js/readmore.min.js [new file with mode: 0644]
view/theme/frost-mobile/js/theme.min.js [deleted file]
view/theme/frost-mobile/style.css
view/theme/frost-mobile/templates/end.tpl

diff --git a/view/theme/frost-mobile/js/jquery.divgrow-1.3.1.f1.js b/view/theme/frost-mobile/js/jquery.divgrow-1.3.1.f1.js
deleted file mode 100644 (file)
index e57722d..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-/*\r
-* Copyright (c) 2010 Simon Hibbard\r
-* \r
-* Permission is hereby granted, free of charge, to any person\r
-* obtaining a copy of this software and associated documentation\r
-* files (the "Software"), to deal in the Software without\r
-* restriction, including without limitation the rights to use,\r
-* copy, modify, merge, publish, distribute, sublicense, and/or sell\r
-* copies of the Software, and to permit persons to whom the\r
-* Software is furnished to do so, subject to the following\r
-* conditions:\r
-\r
-* The above copyright notice and this permission notice shall be\r
-* included in all copies or substantial portions of the Software.\r
-* \r
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\r
-* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\r
-* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\r
-* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\r
-* OTHER DEALINGS IN THE SOFTWARE. \r
-*/\r
-\r
-/*\r
-* Version: V1.3.1-f1\r
-* Release: 22-12-2010\r
-* Based on jQuery 1.4.2\r
-*\r
-* 2012-10-29: Modified by Zach Prezkuta to allow dynamic full heights\r
-*/\r
-\r
-(function ($) {\r
-    var divgrowid = 0;\r
-    $.fn.divgrow = function (options) {\r
-        var options = $.extend({}, { initialHeight: 100, moreText: "+ Show More", lessText: "- Show Less", speed: 1000, showBrackets: true }, options);\r
-\r
-        return this.each(function () {\r
-            divgrowid++;\r
-\r
-            obj = $(this);\r
-\r
-            //var fullHeight = obj.height() + 10;\r
-\r
-            obj.css('height', options.initialHeight).css('overflow', 'hidden');\r
-            if (options.showBrackets) {\r
-                obj.after('<p class="divgrow-brackets">[&hellip;]</p><a href="#" class="divgrow-showmore' + " divgrow-obj-" + divgrowid + '"' + '></a>');\r
-            }\r
-            else {\r
-                obj.after('<a href="#" class="divgrow-showmore' + " divgrow-obj-" + divgrowid + '"' + '></a>');\r
-            }\r
-            $("a.divgrow-showmore").html(options.moreText);\r
-\r
-            $("." + "divgrow-obj-" + divgrowid).toggle(function () {\r
-                //alert(obj.attr('class'));\r
-                // Set the height from the elements rel value\r
-                //var height = $(this).prevAll("div:first").attr('rel');\r
-\r
-                               var fullHeight = $(this).prevAll("div:first")[0].scrollHeight + 10;\r
-                $(this).prevAll("div:first").animate({ height: fullHeight + "px" }, options.speed, function () { // Animation complete.\r
-\r
-                    // Hide the overlay text when expanded, change the link text\r
-                    if (options.showBrackets) {\r
-                        $(this).nextAll("p.divgrow-brackets:first").fadeOut();\r
-                    }\r
-                    $(this).nextAll("a.divgrow-showmore:first").html(options.lessText);\r
-\r
-                });\r
-\r
-\r
-            }, function () {\r
-\r
-                $(this).prevAll("div:first").stop(true, false).animate({ height: options.initialHeight }, options.speed, function () { // Animation complete.\r
-\r
-                    // show the overlay text while closed, change the link text\r
-                    if (options.showBrackets) {\r
-                        $(this).nextAll("p.divgrow-brackets:first").stop(true, false).fadeIn();\r
-                    }\r
-                    $(this).nextAll("a.divgrow-showmore:first").stop(true, false).html(options.moreText);\r
-\r
-                });\r
-            });\r
-\r
-        });\r
-    };\r
-})(jQuery);\r
-\r
-\r
-\r
-\r
-\r
diff --git a/view/theme/frost-mobile/js/jquery.divgrow-1.3.1.f1.min.js b/view/theme/frost-mobile/js/jquery.divgrow-1.3.1.f1.min.js
deleted file mode 100644 (file)
index da7634a..0000000
+++ /dev/null
@@ -1 +0,0 @@
-(function($){var divgrowid=0;$.fn.divgrow=function(options){var options=$.extend({},{initialHeight:100,moreText:"+ Show More",lessText:"- Show Less",speed:1e3,showBrackets:true},options);return this.each(function(){divgrowid++;obj=$(this);obj.css("height",options.initialHeight).css("overflow","hidden");if(options.showBrackets){obj.after('<p class="divgrow-brackets">[&hellip;]</p><a href="#" class="divgrow-showmore'+" divgrow-obj-"+divgrowid+'"'+"></a>")}else{obj.after('<a href="#" class="divgrow-showmore'+" divgrow-obj-"+divgrowid+'"'+"></a>")}$("a.divgrow-showmore").html(options.moreText);$("."+"divgrow-obj-"+divgrowid).toggle(function(){var fullHeight=$(this).prevAll("div:first")[0].scrollHeight+10;$(this).prevAll("div:first").animate({height:fullHeight+"px"},options.speed,function(){if(options.showBrackets){$(this).nextAll("p.divgrow-brackets:first").fadeOut()}$(this).nextAll("a.divgrow-showmore:first").html(options.lessText)})},function(){$(this).prevAll("div:first").stop(true,false).animate({height:options.initialHeight},options.speed,function(){if(options.showBrackets){$(this).nextAll("p.divgrow-brackets:first").stop(true,false).fadeIn()}$(this).nextAll("a.divgrow-showmore:first").stop(true,false).html(options.moreText)})})})}})(jQuery);
\ No newline at end of file
diff --git a/view/theme/frost-mobile/js/jquery.divgrow-1.3.1.min.js b/view/theme/frost-mobile/js/jquery.divgrow-1.3.1.min.js
deleted file mode 100644 (file)
index fd08f7f..0000000
+++ /dev/null
@@ -1 +0,0 @@
-(function ($) { var divgrowid = 0; $.fn.divgrow = function (options) { var options = $.extend({}, { initialHeight: 100, moreText: "+ Show More", lessText: "- Show Less", speed: 1000, showBrackets: true }, options); return this.each(function () { divgrowid++; obj = $(this); var fullHeight = obj.height() + 10; obj.css('height', options.initialHeight).css('overflow', 'hidden'); if (options.showBrackets) { obj.after('<p class="divgrow-brackets">[&hellip;]</p><a href="#" class="divgrow-showmore' + " divgrow-obj-" + divgrowid + '"' + '></a>') } else { obj.after('<a href="#" class="divgrow-showmore' + " divgrow-obj-" + divgrowid + '"' + '></a>') } $("a.divgrow-showmore").html(options.moreText); $("." + "divgrow-obj-" + divgrowid).toggle(function () { $(this).prevAll("div:first").animate({ height: fullHeight + "px" }, options.speed, function () { if (options.showBrackets) { $(this).nextAll("p.divgrow-brackets:first").fadeOut() } $(this).nextAll("a.divgrow-showmore:first").html(options.lessText) }) }, function () { $(this).prevAll("div:first").stop(true, false).animate({ height: options.initialHeight }, options.speed, function () { if (options.showBrackets) { $(this).nextAll("p.divgrow-brackets:first").stop(true, false).fadeIn() } $(this).nextAll("a.divgrow-showmore:first").stop(true, false).html(options.moreText) }) }) }) } })(jQuery);
\ No newline at end of file
index 1b63a489d69243ef445af8e3296cdb0aa5e7df7a..07d0c52b36d030787421f3862efade04123f20b0 100644 (file)
@@ -48,7 +48,7 @@
        $(function() {
                $.ajaxSetup({cache: false});
 
-               collapseHeight();
+               //collapseHeight();
 
                /* setup tooltips *//*
                $("a,.tt").each(function(){
                        elemName = elems + ' ' + elemName;
                }
                $(elemName).each(function() {
-                       if($(this).height() > 350) {
-                               $('html').height($('html').height());
-                               $(this).divgrow({ initialHeight: 300, showBrackets: false, speed: 0 });
-                               $(this).addClass('divmore');
-                               $('html').height('auto');
-                       }
+                       $('html').height($('html').height());
+                       $(this).readmore({maxheight:350 , moreLink:'<a href="#" class="showmore">+ Show more</a>', lessLink:'<a href="#" class="showmore">+ Show less</a>'});
+                       $(this).addClass('divmore');
+                       $('html').height('auto');
                });
        }
 
diff --git a/view/theme/frost-mobile/js/main.min.js b/view/theme/frost-mobile/js/main.min.js
deleted file mode 100644 (file)
index eaf8a08..0000000
+++ /dev/null
@@ -1 +0,0 @@
-function openClose(listID){listID="#"+listID.replace(/:/g,"\\:");listID=listID.replace(/\./g,"\\.");listID=listID.replace(/@/g,"\\@");if($(listID).is(":visible")){$(listID).hide();$(listID+"-wrapper").show();alert($(listID+"-wrapper").attr("id"))}else{$(listID).show();$(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;$(function(){$.ajaxSetup({cache:false});msie=$.browser.msie;collapseHeight();$(".onoff input").each(function(){val=$(this).val();id=$(this).attr("id");$("#"+id+"_onoff ."+(val==0?"on":"off")).addClass("hidden")});$(".onoff > a").click(function(event){event.preventDefault();var input=$(this).siblings("input");var val=1-input.val();var id=input.attr("id");$("#"+id+"_onoff ."+(val==0?"on":"off")).addClass("hidden");$("#"+id+"_onoff ."+(val==1?"on":"off")).removeClass("hidden");input.val(val)});function close_last_popup_menu(e){if(last_popup_menu){if("#"+last_popup_menu.attr("id")!==$(e.target).attr("rel")){last_popup_menu.hide();if(last_popup_menu.attr("id")=="nav-notifications-menu")$(".main-container").show();last_popup_button.removeClass("selected");last_popup_menu=null;last_popup_button=null}}}$("img[rel^=#]").click(function(e){close_last_popup_menu(e);menu=$($(this).attr("rel"));e.preventDefault();e.stopPropagation();if(menu.attr("popup")=="false")return false;if(menu.css("display")=="none"){$(this).parent().addClass("selected");menu.show();if(menu.attr("id")=="nav-notifications-menu")$(".main-container").hide();last_popup_menu=menu;last_popup_button=$(this).parent()}else{$(this).parent().removeClass("selected");menu.hide();if(menu.attr("id")=="nav-notifications-menu")$(".main-container").show();last_popup_menu=null;last_popup_button=null}return false});$("html").click(function(e){close_last_popup_menu(e)});var notifications_tpl=unescape($("#nav-notifications-template[rel=template]").html());var notifications_all=unescape($("<div>").append($("#nav-notifications-see-all").clone()).html());var notifications_mark=unescape($("<div>").append($("#nav-notifications-mark-all").clone()).html());var notifications_empty=unescape($("#nav-notifications-menu").html());$("nav").bind("nav-update",function(e,data){var invalid=$(data).find("invalid").text();if(invalid==1){window.location.href=window.location.href}var net=$(data).find("net").text();if(net==0){net="";$("#net-update").removeClass("show")}else{$("#net-update").addClass("show")}$("#net-update").html(net);var home=$(data).find("home").text();if(home==0){home="";$("#home-update").removeClass("show")}else{$("#home-update").addClass("show")}$("#home-update").html(home);var intro=$(data).find("intro").text();if(intro==0){intro="";$("#intro-update").removeClass("show")}else{$("#intro-update").addClass("show")}$("#intro-update").html(intro);var mail=$(data).find("mail").text();if(mail==0){mail="";$("#mail-update").removeClass("show")}else{$("#mail-update").addClass("show")}$("#mail-update").html(mail);var intro=$(data).find("intro").text();if(intro==0){intro="";$("#intro-update-li").removeClass("show")}else{$("#intro-update-li").addClass("show")}$("#intro-update-li").html(intro);var mail=$(data).find("mail").text();if(mail==0){mail="";$("#mail-update-li").removeClass("show")}else{$("#mail-update-li").addClass("show")}$("#mail-update-li").html(mail);var eNotif=$(data).find("notif");if(eNotif.children("note").length==0){$("#nav-notifications-menu").html(notifications_empty)}else{nnm=$("#nav-notifications-menu");nnm.html(notifications_all+notifications_mark);eNotif.children("note").each(function(){e=$(this);text=e.text().format("<span class='contactname'>"+e.attr("name")+"</span>");html=notifications_tpl.format(e.attr("href"),e.attr("photo"),text,e.attr("date"),e.attr("seen"));nnm.append(html)});$("img[data-src]",nnm).each(function(i,el){if($(el).data("src")!="")$(el).attr("src",$(el).data("src"))})}notif=eNotif.attr("count");if(notif>0){$("#nav-notifications-linkmenu").addClass("on")}else{$("#nav-notifications-linkmenu").removeClass("on")}if(notif==0){notif="";$("#notify-update").removeClass("show")}else{$("#notify-update").addClass("show")}$("#notify-update").html(notif);var eSysmsg=$(data).find("sysmsgs");eSysmsg.children("notice").each(function(){text=$(this).text();$.jGrowl(text,{sticky:false,theme:"notice",life:1e3})});eSysmsg.children("info").each(function(){text=$(this).text();$.jGrowl(text,{sticky:false,theme:"info",life:1e3})})});NavUpdate()});function NavUpdate(){if(!stopped){var pingCmd="ping"+(localUser!=0?"?f=&uid="+localUser:"");$.get(pingCmd,function(data){$(data).find("result").each(function(){$("nav").trigger("nav-update",this);if($("#live-network").length){src="network";liveUpdate()}if($("#live-profile").length){src="profile";liveUpdate()}if($("#live-community").length){src="community";liveUpdate()}if($("#live-notes").length){src="notes";liveUpdate()}if($("#live-display").length){src="display";liveUpdate()}if($("#live-photos").length){if(liking){liking=0;window.location.href=window.location.href}}})})}timer=setTimeout(NavUpdate,updateInterval)}function liveUpdate(){if(src==null||stopped||typeof profile_uid=="undefined"||!profile_uid){$(".like-rotator").hide();return}if($(".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);$.get(update_url,function(data){in_progress=false;$(".toplevel_item",data).each(function(){var ident=$(this).attr("id");if($("#"+ident).length==0&&profile_page==1){$("img",this).each(function(){$(this).attr("src",$(this).attr("dst"))});$("#"+prev).after($(this))}else{var id=$(".hide-comments-total",this).attr("id");if(typeof id!="undefined"){id=id.split("-")[3];var commentsOpen=$("#collapsed-comments-"+id).is(":visible")}$("img",this).each(function(){$(this).attr("src",$(this).attr("dst"))});$("html").height($("html").height());$("#"+ident).replaceWith($(this));if(typeof id!="undefined"){if(commentsOpen)showHideComments(id)}$("html").height("auto")}prev=ident});collapseHeight();$(".like-rotator").hide();if(commentBusy){commentBusy=false;$("body").css("cursor","auto")}$(".comment-edit-form  textarea").contact_autocomplete(baseurl+"/acl");if(typeof videojs!="undefined")videojs.autoSetup()})}function collapseHeight(elems){var elemName=".wall-item-body:not(.divmore)";if(typeof elems!="undefined"){elemName=elems+" "+elemName}$(elemName).each(function(){if($(this).height()>350){$("html").height($("html").height());$(this).divgrow({initialHeight:300,showBrackets:false,speed:0});$(this).addClass("divmore");$("html").height("auto")}})}function dolike(ident,verb){unpause();$("#like-rotator-"+ident.toString()).show();$.get("like/"+ident.toString()+"?verb="+verb,NavUpdate);liking=1}function dostar(ident){ident=ident.toString();$.get("starred/"+ident,function(data){if(data.match(/1/)){$("#starred-"+ident).addClass("starred");$("#starred-"+ident).removeClass("unstarred");$("#star-"+ident).addClass("hidden");$("#unstar-"+ident).removeClass("hidden")}else{$("#starred-"+ident).addClass("unstarred");$("#starred-"+ident).removeClass("starred");$("#star-"+ident).removeClass("hidden");$("#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;$.get("lockview/"+id,function(data){$("#panel").html(data);$("#panel").css({left:10,top:cursor.y+20});$("#panel").show()})}}function lockviewhide(){lockvisible=false;$("#panel").hide()}function post_comment(id){unpause();commentBusy=true;$("body").css("cursor","wait");$("#comment-preview-inp-"+id).val("0");$.post("item",$("#comment-edit-form-"+id).serialize(),function(data){if(data.success){$("#comment-edit-wrapper-"+id).hide();$("#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){$("#comment-preview-inp-"+id).val("1");$("#comment-edit-preview-"+id).show();$.post("item",$("#comment-edit-form-"+id).serialize(),function(data){if(data.preview){$("#comment-edit-preview-"+id).html(data.preview);$("#comment-edit-preview-"+id+" a").click(function(){return false})}},"json");return true}function showHideComments(id){if($("#collapsed-comments-"+id).is(":visible")){$("#collapsed-comments-"+id).hide();$("#hide-comments-"+id).html(window.showMore)}else{$("#collapsed-comments-"+id).show();$("#hide-comments-"+id).html(window.showFewer);collapseHeight("#collapsed-comments-"+id)}}function preview_post(){$("#jot-preview").val("1");$("#jot-preview-content").show();tinyMCE.triggerSave();$.post("item",$("#profile-jot-form").serialize(),function(data){if(data.preview){$("#jot-preview-content").html(data.preview);$("#jot-preview-content"+" a").click(function(){return false})}},"json");$("#jot-preview").val("0");return true}function unpause(){totStopped=false;stopped=false;$("#pause").html("")}function bin2hex(s){var v,i,f=0,a=[];s+="";f=s.length;for(i=0;i<f;i++){a[i]=s.charCodeAt(i).toString(16).replace(/^([\da-f])$/,"0$1")}return a.join("")}function groupChangeMember(gid,cid,sec_token){$("body .fakelink").css("cursor","wait");$.get("group/"+gid+"/"+cid+"?t="+sec_token,function(data){$("#group-update-wrapper").html(data);$("body .fakelink").css("cursor","auto")})}function profChangeMember(gid,cid){$("body .fakelink").css("cursor","wait");$.get("profperm/"+gid+"/"+cid,function(data){$("#prof-update-wrapper").html(data);$("body .fakelink").css("cursor","auto")})}function contactgroupChangeMember(gid,cid){$("body").css("cursor","wait");$.get("contactgroup/"+gid+"/"+cid,function(data){$("body").css("cursor","auto")})}function checkboxhighlight(box){if($(box).is(":checked")){$(box).addClass("checkeditem")}else{$(box).removeClass("checkeditem")}}function notifyMarkAll(){$.get("notify/mark/all",function(data){if(timer)clearTimeout(timer);timer=setTimeout(NavUpdate,1e3)})}function fcFileBrowser(field_name,url,type,win){var cmsURL=baseurl+"/fbrowser/"+type+"/";tinyMCE.activeEditor.windowManager.open({file:cmsURL,title:"File Browser",width:420,height:400,resizable:"yes",inline:"yes",close_previous:"no"},{window:win,input:field_name});return false}function setupFieldRichtext(){tinyMCE.init({theme:"advanced",mode:"specific_textareas",editor_selector:"fieldRichtext",plugins:"bbcode,paste, inlinepopups",theme_advanced_buttons1:"bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code",theme_advanced_buttons2:"",theme_advanced_buttons3:"",theme_advanced_toolbar_location:"top",theme_advanced_toolbar_align:"center",theme_advanced_blockformats:"blockquote,code",paste_text_sticky:true,entity_encoding:"raw",add_unload_trigger:false,remove_linebreaks:false,forced_root_block:"div",convert_urls:false,content_css:baseurl+"/view/custom_tinymce.css",theme_advanced_path:false,file_browser_callback:"fcFileBrowser"})}String.prototype.format=function(){var formatted=this;for(var i=0;i<arguments.length;i++){var regexp=new RegExp("\\{"+i+"\\}","gi");formatted=formatted.replace(regexp,arguments[i])}return formatted};Array.prototype.remove=function(item){to=undefined;from=this.indexOf(item);var rest=this.slice((to||from)+1||this.length);this.length=from<0?this.length+from:from;return this.push.apply(this,rest)};function previewTheme(elm){theme=$(elm).val();$.getJSON("pretheme?f=&theme="+theme,function(data){$("#theme-preview").html('<div id="theme-desc">'+data.desc+'</div><div id="theme-version">'+data.version+'</div><div id="theme-credits">'+data.credits+"</div>")})}
\ No newline at end of file
diff --git a/view/theme/frost-mobile/js/readmore.js b/view/theme/frost-mobile/js/readmore.js
new file mode 100644 (file)
index 0000000..4a02cf1
--- /dev/null
@@ -0,0 +1,192 @@
+/*!
+ * Readmore.js jQuery plugin
+ * Author: @jed_foster
+ * Project home: jedfoster.github.io/Readmore.js
+ * Licensed under the MIT license
+ */
+
+;(function($) {
+
+  var readmore = 'readmore',
+      defaults = {
+        speed: 100,
+        maxHeight: 200,
+        heightMargin: 16,
+        moreLink: '<a href="#">Read More</a>',
+        lessLink: '<a href="#">Close</a>',
+        embedCSS: true,
+        sectionCSS: 'display: block; width: 100%;',
+        startOpen: false,
+        expandedClass: 'readmore-js-expanded',
+        collapsedClass: 'readmore-js-collapsed',
+
+        // callbacks
+        beforeToggle: function(){},
+        afterToggle: function(){}
+      },
+      cssEmbedded = false;
+
+  function Readmore( element, options ) {
+    this.element = element;
+
+    this.options = $.extend( {}, defaults, options);
+
+    $(this.element).data('max-height', this.options.maxHeight);
+    $(this.element).data('height-margin', this.options.heightMargin);
+
+    delete(this.options.maxHeight);
+
+    if(this.options.embedCSS && ! cssEmbedded) {
+      var styles = '.readmore-js-toggle, .readmore-js-section { ' + this.options.sectionCSS + ' } .readmore-js-section { overflow: hidden; }';
+
+      (function(d,u) {
+        var css=d.createElement('style');
+        css.type = 'text/css';
+        if(css.styleSheet) {
+            css.styleSheet.cssText = u;
+        }
+        else {
+            css.appendChild(d.createTextNode(u));
+        }
+        d.getElementsByTagName('head')[0].appendChild(css);
+      }(document, styles));
+
+      cssEmbedded = true;
+    }
+
+    this._defaults = defaults;
+    this._name = readmore;
+
+    this.init();
+  }
+
+  Readmore.prototype = {
+
+    init: function() {
+      var $this = this;
+
+      $(this.element).each(function() {
+        var current = $(this),
+            maxHeight = (current.css('max-height').replace(/[^-\d\.]/g, '') > current.data('max-height')) ? current.css('max-height').replace(/[^-\d\.]/g, '') : current.data('max-height'),
+            heightMargin = current.data('height-margin');
+
+        if(current.css('max-height') != 'none') {
+          current.css('max-height', 'none');
+        }
+
+        $this.setBoxHeight(current);
+
+        if(current.outerHeight(true) <= maxHeight + heightMargin) {
+          // The block is shorter than the limit, so there's no need to truncate it.
+          return true;
+        }
+        else {
+          current.addClass('readmore-js-section ' + $this.options.collapsedClass).data('collapsedHeight', maxHeight);
+
+          var useLink = $this.options.startOpen ? $this.options.lessLink : $this.options.moreLink;
+          current.after($(useLink).on('click', function(event) { $this.toggleSlider(this, current, event) }).addClass('readmore-js-toggle'));
+
+          if(!$this.options.startOpen) {
+            current.css({height: maxHeight});
+          }
+        }
+      });
+
+      $(window).on('resize', function(event) {
+        $this.resizeBoxes();
+      });
+    },
+
+    toggleSlider: function(trigger, element, event)
+    {
+      event.preventDefault();
+
+      var $this = this,
+          newHeight = newLink = sectionClass = '',
+          expanded = false,
+          collapsedHeight = $(element).data('collapsedHeight');
+
+      if ($(element).height() <= collapsedHeight) {
+        newHeight = $(element).data('expandedHeight') + 'px';
+        newLink = 'lessLink';
+        expanded = true;
+        sectionClass = $this.options.expandedClass;
+      }
+
+      else {
+        newHeight = collapsedHeight;
+        newLink = 'moreLink';
+        sectionClass = $this.options.collapsedClass;
+      }
+
+      // Fire beforeToggle callback
+      $this.options.beforeToggle(trigger, element, expanded);
+
+      $(element).animate({'height': newHeight}, {duration: $this.options.speed, complete: function() {
+          // Fire afterToggle callback
+          $this.options.afterToggle(trigger, element, expanded);
+
+          $(trigger).replaceWith($($this.options[newLink]).on('click', function(event) { $this.toggleSlider(this, element, event) }).addClass('readmore-js-toggle'));
+
+          $(this).removeClass($this.options.collapsedClass + ' ' + $this.options.expandedClass).addClass(sectionClass);
+        }
+      });
+    },
+
+    setBoxHeight: function(element) {
+      var el = element.clone().css({'height': 'auto', 'width': element.width(), 'overflow': 'hidden'}).insertAfter(element),
+          height = el.outerHeight(true);
+
+      el.remove();
+
+      element.data('expandedHeight', height);
+    },
+
+    resizeBoxes: function() {
+      var $this = this;
+
+      $('.readmore-js-section').each(function() {
+        var current = $(this);
+
+        $this.setBoxHeight(current);
+
+        if(current.height() > current.data('expandedHeight') || (current.hasClass($this.options.expandedClass) && current.height() < current.data('expandedHeight')) ) {
+          current.css('height', current.data('expandedHeight'));
+        }
+      });
+    },
+
+    destroy: function() {
+      var $this = this;
+
+      $(this.element).each(function() {
+        var current = $(this);
+
+        current.removeClass('readmore-js-section ' + $this.options.collapsedClass + ' ' + $this.options.expandedClass).css({'max-height': '', 'height': 'auto'}).next('.readmore-js-toggle').remove();
+
+        current.removeData();
+      });
+    }
+  };
+
+  $.fn[readmore] = function( options ) {
+    var args = arguments;
+    if (options === undefined || typeof options === 'object') {
+      return this.each(function () {
+        if ($.data(this, 'plugin_' + readmore)) {
+          var instance = $.data(this, 'plugin_' + readmore);
+          instance['destroy'].apply(instance);
+        }
+
+        $.data(this, 'plugin_' + readmore, new Readmore( this, options ));
+      });
+    } else if (typeof options === 'string' && options[0] !== '_' && options !== 'init') {
+      return this.each(function () {
+        var instance = $.data(this, 'plugin_' + readmore);
+        if (instance instanceof Readmore && typeof instance[options] === 'function') {
+          instance[options].apply( instance, Array.prototype.slice.call( args, 1 ) );
+        }
+      });
+    }
+  }
+})(jQuery);
\ No newline at end of file
diff --git a/view/theme/frost-mobile/js/readmore.min.js b/view/theme/frost-mobile/js/readmore.min.js
new file mode 100644 (file)
index 0000000..ae0ee63
--- /dev/null
@@ -0,0 +1,7 @@
+(function(c){function g(b,a){this.element=b;this.options=c.extend({},h,a);c(this.element).data("max-height",this.options.maxHeight);c(this.element).data("height-margin",this.options.heightMargin);delete this.options.maxHeight;if(this.options.embedCSS&&!k){var d=".readmore-js-toggle, .readmore-js-section { "+this.options.sectionCSS+" } .readmore-js-section { overflow: hidden; }",e=document.createElement("style");e.type="text/css";e.styleSheet?e.styleSheet.cssText=d:e.appendChild(document.createTextNode(d));
+document.getElementsByTagName("head")[0].appendChild(e);k=!0}this._defaults=h;this._name=f;this.init()}var f="readmore",h={speed:100,maxHeight:200,heightMargin:16,moreLink:'<a href="#">Read More</a>',lessLink:'<a href="#">Close</a>',embedCSS:!0,sectionCSS:"display: block; width: 100%;",startOpen:!1,expandedClass:"readmore-js-expanded",collapsedClass:"readmore-js-collapsed",beforeToggle:function(){},afterToggle:function(){}},k=!1;g.prototype={init:function(){var b=this;c(this.element).each(function(){var a=
+c(this),d=a.css("max-height").replace(/[^-\d\.]/g,"")>a.data("max-height")?a.css("max-height").replace(/[^-\d\.]/g,""):a.data("max-height"),e=a.data("height-margin");"none"!=a.css("max-height")&&a.css("max-height","none");b.setBoxHeight(a);if(a.outerHeight(!0)<=d+e)return!0;a.addClass("readmore-js-section "+b.options.collapsedClass).data("collapsedHeight",d);a.after(c(b.options.startOpen?b.options.lessLink:b.options.moreLink).on("click",function(c){b.toggleSlider(this,a,c)}).addClass("readmore-js-toggle"));
+b.options.startOpen||a.css({height:d})});c(window).on("resize",function(a){b.resizeBoxes()})},toggleSlider:function(b,a,d){d.preventDefault();var e=this;d=newLink=sectionClass="";var f=!1;d=c(a).data("collapsedHeight");c(a).height()<=d?(d=c(a).data("expandedHeight")+"px",newLink="lessLink",f=!0,sectionClass=e.options.expandedClass):(newLink="moreLink",sectionClass=e.options.collapsedClass);e.options.beforeToggle(b,a,f);c(a).animate({height:d},{duration:e.options.speed,complete:function(){e.options.afterToggle(b,
+a,f);c(b).replaceWith(c(e.options[newLink]).on("click",function(b){e.toggleSlider(this,a,b)}).addClass("readmore-js-toggle"));c(this).removeClass(e.options.collapsedClass+" "+e.options.expandedClass).addClass(sectionClass)}})},setBoxHeight:function(b){var a=b.clone().css({height:"auto",width:b.width(),overflow:"hidden"}).insertAfter(b),c=a.outerHeight(!0);a.remove();b.data("expandedHeight",c)},resizeBoxes:function(){var b=this;c(".readmore-js-section").each(function(){var a=c(this);b.setBoxHeight(a);
+(a.height()>a.data("expandedHeight")||a.hasClass(b.options.expandedClass)&&a.height()<a.data("expandedHeight"))&&a.css("height",a.data("expandedHeight"))})},destroy:function(){var b=this;c(this.element).each(function(){var a=c(this);a.removeClass("readmore-js-section "+b.options.collapsedClass+" "+b.options.expandedClass).css({"max-height":"",height:"auto"}).next(".readmore-js-toggle").remove();a.removeData()})}};c.fn[f]=function(b){var a=arguments;if(void 0===b||"object"===typeof b)return this.each(function(){if(c.data(this,
+"plugin_"+f)){var a=c.data(this,"plugin_"+f);a.destroy.apply(a)}c.data(this,"plugin_"+f,new g(this,b))});if("string"===typeof b&&"_"!==b[0]&&"init"!==b)return this.each(function(){var d=c.data(this,"plugin_"+f);d instanceof g&&"function"===typeof d[b]&&d[b].apply(d,Array.prototype.slice.call(a,1))})}})(jQuery);
diff --git a/view/theme/frost-mobile/js/theme.min.js b/view/theme/frost-mobile/js/theme.min.js
deleted file mode 100644 (file)
index 9cb4930..0000000
+++ /dev/null
@@ -1 +0,0 @@
-$(document).ready(function(){$("#profile-jot-text").focus(enableOnUser);$("#profile-jot-text").click(enableOnUser);$("#event-share-checkbox").change(function(){if($("#event-share-checkbox").is(":checked")){$("#acl-wrapper").show()}else{$("#acl-wrapper").hide()}}).trigger("change");$(".popupbox").click(function(){var parent=$($(this).attr("href")).parent();if(parent.css("display")=="none"){parent.show()}else{parent.hide()}return false});if(typeof window.AjaxUpload!="undefined"){var uploader=new window.AjaxUpload(window.imageUploadButton,{action:"wall_upload/"+window.nickname+"?nomce=1",name:"userfile",onSubmit:function(file,ext){$("#profile-rotator").show()},onComplete:function(file,response){addeditortext(window.jotId,response);$("#profile-rotator").hide()}});if($("#wall-file-upload").length){var file_uploader=new window.AjaxUpload("wall-file-upload",{action:"wall_attach/"+window.nickname+"?nomce=1",name:"userfile",onSubmit:function(file,ext){$("#profile-rotator").show()},onComplete:function(file,response){addeditortext(window.jotId,response);$("#profile-rotator").hide()}})}}if(typeof window.aclInit!="undefined"&&typeof acl=="undefined"){acl=new ACL(baseurl+"/acl",[window.allowCID,window.allowGID,window.denyCID,window.denyGID])}switch(window.autocompleteType){case"msg-header":var a=$("#recip").autocomplete({serviceUrl:baseurl+"/acl",minChars:2,width:350,onSelect:function(value,data){$("#recip-complete").val(data)}});break;case"contacts-head":var a=$("#contacts-search").autocomplete({serviceUrl:baseurl+"/acl",minChars:2,width:350});a.setOptions({params:{type:"a"}});break;case"display-head":$(".comment-wwedit-wrapper textarea").contact_autocomplete(baseurl+"/acl");break;default:break}if(window.aclType=="settings-head"||window.aclType=="photos_head"||window.aclType=="event_head"){$("#contact_allow, #contact_deny, #group_allow, #group_deny").change(function(){var selstr;$("#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected").each(function(){selstr=$(this).text();$("#jot-perms-icon").removeClass("unlock").addClass("lock");$("#jot-public").hide()});if(selstr==null){$("#jot-perms-icon").removeClass("lock").addClass("unlock");$("#jot-public").show()}}).trigger("change")}if(window.aclType=="event_head"){$("#events-calendar").fullCalendar({events:baseurl+"/events/json/",header:{left:"prev,next today",center:"title",right:"month,agendaWeek,agendaDay"},timeFormat:"H(:mm)",eventClick:function(calEvent,jsEvent,view){showEvent(calEvent.id)},eventRender:function(event,element,view){if(event.item["author-name"]==null)return;switch(view.name){case"month":element.find(".fc-event-title").html("<img src='{0}' style='height:10px;width:10px'>{1} : {2}".format(event.item["author-avatar"],event.item["author-name"],event.title));break;case"agendaWeek":element.find(".fc-event-title").html("<img src='{0}' style='height:12px; width:12px'>{1}<p>{2}</p><p>{3}</p>".format(event.item["author-avatar"],event.item["author-name"],event.item.desc,event.item.location));break;case"agendaDay":element.find(".fc-event-title").html("<img src='{0}' style='height:24px;width:24px'>{1}<p>{2}</p><p>{3}</p>".format(event.item["author-avatar"],event.item["author-name"],event.item.desc,event.item.location));break}}});var args=location.href.replace(baseurl,"").split("/");if(args.length>=4){$("#events-calendar").fullCalendar("gotoDate",args[2],args[3]-1)}var hash=location.hash.split("-");if(hash.length==2&&hash[0]=="#link")showEvent(hash[1])}});$(function(){$("nav").bind("nav-update",function(e,data){var elm=$("#pending-update");var register=$(data).find("register").text();if(register=="0"){register="";elm.hide()}else{elm.show()}elm.html(register)})});function homeRedirect(){$("html").fadeOut("slow",function(){window.location=baseurl+"/login"})}function initCrop(){function onEndCrop(coords,dimensions){$PR("x1").value=coords.x1;$PR("y1").value=coords.y1;$PR("x2").value=coords.x2;$PR("y2").value=coords.y2;$PR("width").value=dimensions.width;$PR("height").value=dimensions.height}Event.observe(window,"load",function(){new Cropper.ImgWithPreview("croppa",{previewWrap:"previewWrap",minWidth:175,minHeight:175,maxWidth:640,maxHeight:640,ratioDim:{x:100,y:100},displayOnInit:true,onEndCrop:onEndCrop})})}function showEvent(eventid){}var editor=false;var textlen=0;var plaintext="none";function initEditor(cb){if(editor==false){if(plaintext=="none"){$("#profile-jot-text").css({height:200,color:"#000"});$("#profile-jot-text").contact_autocomplete(baseurl+"/acl");editor=true;$("a#jot-perms-icon, a#settings-default-perms-menu").click(function(){var parent=$("#profile-jot-acl-wrapper").parent();if(parent.css("display")=="none"){parent.show()}else{parent.hide()}return false});$(".jothidden").show();if(typeof cb!="undefined")cb();return}}else{if(typeof cb!="undefined")cb()}}function enableOnUser(){if(editor)return;$(this).val("");initEditor()}function addeditortext(textElem,data){if(window.editSelect=="none"){var currentText=$(textElem).val();$(textElem).val(currentText+data)}}function jotVideoURL(){reply=prompt(window.vidURL);if(reply&&reply.length){addeditortext("#profile-jot-text","[video]"+reply+"[/video]")}}function jotAudioURL(){reply=prompt(window.audURL);if(reply&&reply.length){addeditortext("#profile-jot-text","[audio]"+reply+"[/audio]")}}function jotGetLocation(){reply=prompt(window.whereAreU,$("#jot-location").val());if(reply&&reply.length){$("#jot-location").val(reply)}}function jotShare(id){if($("#jot-popup").length!=0)$("#jot-popup").show();$("#like-rotator-"+id).show();$.get("share/"+id,function(data){if(!editor)$("#profile-jot-text").val("");initEditor(function(){addeditortext("#profile-jot-text",data);$("#like-rotator-"+id).hide();$(window).scrollTop(0)})})}function jotGetLink(){reply=prompt(window.linkURL);if(reply&&reply.length){reply=bin2hex(reply);$("#profile-rotator").show();$.get("parse_url?binurl="+reply,function(data){addeditortext(window.jotId,data);$("#profile-rotator").hide()})}}function jotClearLocation(){$("#jot-coord").val("");$("#profile-nolocation-wrapper").hide()}if(typeof window.geoTag==="function")window.geoTag();function confirmDelete(){return confirm(window.delItem)}function itemTag(id){reply=prompt(window.term);if(reply&&reply.length){reply=reply.replace("#","");if(reply.length){commentBusy=true;$("body").css("cursor","wait");$.get("tagger/"+id+"?term="+reply,NavUpdate);liking=1}}}function itemFiler(id){$.get("filer/",function(data){var promptText=$("#id_term_label",data).text();reply=prompt(promptText);if(reply&&reply.length){commentBusy=true;$("body").css("cursor","wait");$.get("filer/"+id+"?term="+reply,NavUpdate);liking=1}})}function commentOpen(obj,id){if(obj.value==window.commentEmptyText){obj.value="";$("#comment-edit-text-"+id).addClass("comment-edit-text-full");$("#comment-edit-text-"+id).removeClass("comment-edit-text-empty");$("#mod-cmnt-wrap-"+id).show();openMenu("comment-edit-submit-wrapper-"+id)}}function commentClose(obj,id){if(obj.value==""){obj.value=window.commentEmptyText;$("#comment-edit-text-"+id).removeClass("comment-edit-text-full");$("#comment-edit-text-"+id).addClass("comment-edit-text-empty");$("#mod-cmnt-wrap-"+id).hide();closeMenu("comment-edit-submit-wrapper-"+id)}}function commentInsert(obj,id){var tmpStr=$("#comment-edit-text-"+id).val();if(tmpStr==window.commentEmptyText){tmpStr="";$("#comment-edit-text-"+id).addClass("comment-edit-text-full");$("#comment-edit-text-"+id).removeClass("comment-edit-text-empty");openMenu("comment-edit-submit-wrapper-"+id)}var ins=$(obj).html();ins=ins.replace("&lt;","<");ins=ins.replace("&gt;",">");ins=ins.replace("&amp;","&");ins=ins.replace("&quot;",'"');$("#comment-edit-text-"+id).val(tmpStr+ins)}function qCommentInsert(obj,id){var tmpStr=$("#comment-edit-text-"+id).val();if(tmpStr==window.commentEmptyText){tmpStr="";$("#comment-edit-text-"+id).addClass("comment-edit-text-full");$("#comment-edit-text-"+id).removeClass("comment-edit-text-empty");openMenu("comment-edit-submit-wrapper-"+id)}var ins=$(obj).val();ins=ins.replace("&lt;","<");ins=ins.replace("&gt;",">");ins=ins.replace("&amp;","&");ins=ins.replace("&quot;",'"');$("#comment-edit-text-"+id).val(tmpStr+ins);$(obj).val("")}function insertFormatting(comment,BBcode,id){var tmpStr=$("#comment-edit-text-"+id).val();if(tmpStr==comment){tmpStr="";$("#comment-edit-text-"+id).addClass("comment-edit-text-full");$("#comment-edit-text-"+id).removeClass("comment-edit-text-empty");openMenu("comment-edit-submit-wrapper-"+id);$("#comment-edit-text-"+id).val(tmpStr)}textarea=document.getElementById("comment-edit-text-"+id);if(document.selection){textarea.focus();selected=document.selection.createRange();if(BBcode=="url"){selected.text="["+BBcode+"=http://]"+selected.text+"[/"+BBcode+"]"}else selected.text="["+BBcode+"]"+selected.text+"[/"+BBcode+"]"}else if(textarea.selectionStart||textarea.selectionStart=="0"){var start=textarea.selectionStart;var end=textarea.selectionEnd;if(BBcode=="url"){textarea.value=textarea.value.substring(0,start)+"["+BBcode+"=http://]"+textarea.value.substring(start,end)+"[/"+BBcode+"]"+textarea.value.substring(end,textarea.value.length)}else textarea.value=textarea.value.substring(0,start)+"["+BBcode+"]"+textarea.value.substring(start,end)+"[/"+BBcode+"]"+textarea.value.substring(end,textarea.value.length)}return true}function cmtBbOpen(id){$(".comment-edit-bb-"+id).show()}function cmtBbClose(id){$(".comment-edit-bb-"+id).hide()}
\ No newline at end of file
index 1621ef5059760e4527412f018ec5771f9ac31a8e..dc90c76236c5d989dbdac90a22ff0e7ebb6c0fb7 100644 (file)
@@ -1468,7 +1468,7 @@ input#dfrn-url {
        overflow: hidden;\r
 }\r
 \r
-.divgrow-showmore {\r
+.showmore {\r
        display: block;\r
        clear: both;\r
        text-align: center;\r
index 331f8b5c2072d33e00a64eefc7f97aceec5ae366..38cd144b4cb73094c6e00afd1248665aaf02e7a7 100644 (file)
@@ -1,15 +1,9 @@
 <!--[if IE]>
 <script type="text/javascript" src="https://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
 <![endif]-->
-{{*<!--<script type="text/javascript" src="{{$baseurl}}/library/tinymce/jscripts/tiny_mce/tiny_mce.js" ></script>
-<script type="text/javascript">
-  tinyMCE.init({ mode : "none"});
-</script>-->*}}
 <script type="text/javascript" src="{{$baseurl}}/js/jquery.js" ></script>
-<script type="text/javascript" src="{{$baseurl}}/view/theme/frost-mobile/js/jquery.divgrow-1.3.1.f1.min.js" ></script>
+<script type="text/javascript" src="{{$baseurl}}/view/theme/frost-mobile/js/readmore.min.js" ></script>
 <script type="text/javascript" src="{{$baseurl}}/js/jquery.textinputs.js" ></script>
-{{*<!--<script type="text/javascript" src="{{$baseurl}}/library/colorbox/jquery.colorbox-min.js"></script>-->*}}
-{{*<!--<script type="text/javascript" src="{{$baseurl}}/library/tiptip/jquery.tipTip.minified.js"></script>-->*}}
 <script type="text/javascript" src="{{$baseurl}}/library/jgrowl/jquery.jgrowl_minimized.js"></script>
 
 <script type="text/javascript" src="{{$baseurl}}/js/fk.autocomplete.js" ></script>