Changeset 29023 for extensions


Ignore:
Timestamp:
Jul 10, 2014, 11:02:06 PM (10 years ago)
Author:
rvelices
Message:

rv_tscroller allow other plugins to insert dynamic html somewhere else ...

Location:
extensions/rv_tscroller
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/rv_tscroller/main.inc.php

    r27448 r29023  
    77Author URI: http://www.modusoptimus.com
    88*/
    9 define('RVTS_VERSION', '26');
     9define('RVTS_VERSION', '26b');
    1010
    1111class RVTS
     
    6868        $url_model = str_replace('&', '&', $url_model);
    6969        $ajax_url_model = str_replace('&', '&', $ajax_url_model);
    70        
     70
    7171        $my_base_name = basename(dirname(__FILE__));
    7272        $ajax_loader_image = get_root_url()."plugins/$my_base_name/ajax-loader.gif";
  • extensions/rv_tscroller/rv_tscroller.js

    r27448 r29023  
    3030                success: function(htm) {
    3131                        RVTS.start = newStart;
    32                         RVTS.$thumbs.prepend(htm);
     32
     33                        var event = jQuery.Event( "RVTS_add" );
     34                        $(window).trigger(event, [htm, false]);
     35
     36                        if (!event.isDefaultPrevented())
     37                                RVTS.$thumbs.prepend(htm);
     38
    3339                        if (RVTS.start<=0)
    3440                                $("#rvtsUp").remove();
     
    5763                success: function(htm) {
    5864                        RVTS.next+=RVTS.perPage;
    59                         RVTS.$thumbs.append(htm);
     65                        var event = jQuery.Event( "RVTS_add" );
     66                        $(window).trigger(event, [htm, true]);
     67
     68                        if (!event.isDefaultPrevented())
     69                                RVTS.$thumbs.append(htm);
    6070                        if (RVTS.next-RVTS.start>500 && RVTS.total-RVTS.next>50) {
    6171                                RVTS.$thumbs.after(
  • extensions/rv_tscroller/rv_tscroller.min.js

    r27448 r29023  
    11window.jQuery&&window.RVTS&&function(b){if(0<RVTS.start){var e=b(".navigationBar A[rel=first]");b("#thumbnails").before('<div id=rvtsUp style="text-align:center;font-size:120%;margin:10px"><a href="'+e.attr("href")+'">'+e.html()+'</a> | <a href="javascript:RVTS.loadUp()">'+RVTS.prevMsg+"</a></div>")}RVTS=b.fn.extend(RVTS,{loading:0,loadingUp:0,adjust:0,loadUp:function(){if(!(RVTS.loadingUp||0>=RVTS.start)){var a=RVTS.start-RVTS.perPage,c=RVTS.perPage;0>a&&(c+=a,a=0);c=RVTS.ajaxUrlModel.replace("%start%",
    2 a).replace("%per%",c);b("#ajaxLoader").show();RVTS.loadingUp=1;b.ajax({type:"GET",dataType:"html",url:c,success:function(c){RVTS.start=a;RVTS.$thumbs.prepend(c);0>=RVTS.start&&b("#rvtsUp").remove()},complete:function(){RVTS.loadingUp=0;RVTS.loading||b("#ajaxLoader").hide();b(window).trigger("RVTS_loaded",0);"undefined"!=typeof pwg_ajax_thumbnails_loader&&pwg_ajax_thumbnails_loader()}})}},doAutoScroll:function(){if(!(RVTS.loading||RVTS.next>=RVTS.total)){var a=RVTS.ajaxUrlModel.replace("%start%",RVTS.next).replace("%per%",
    3 RVTS.perPage);RVTS.adjust&&(a+="&adj="+RVTS.adjust,RVTS.adjust=0);b("#ajaxLoader").show();RVTS.loading=1;b.ajax({type:"GET",dataType:"html",url:a,success:function(a){RVTS.next+=RVTS.perPage;RVTS.$thumbs.append(a);500<RVTS.next-RVTS.start&&50<RVTS.total-RVTS.next&&(RVTS.$thumbs.after('<div style="text-align:center;font-size:180%;margin:0 0 20px"><a href="'+RVTS.urlModel.replace("%start%",RVTS.next)+'">'+RVTS.moreMsg.replace("%d",RVTS.total-RVTS.next)+"</a></div>"),RVTS.total=0)},complete:function(){RVTS.loading=
    4 0;RVTS.loadingUp||b("#ajaxLoader").hide();b(window).trigger("RVTS_loaded",1);"undefined"!=typeof pwg_ajax_thumbnails_loader&&pwg_ajax_thumbnails_loader()}})}},checkAutoScroll:function(a){var c=RVTS.$thumbs.position().top+RVTS.$thumbs.outerHeight(),d=b(window).scrollTop()+b(window).height();return c-(a?100:0)<=d?(RVTS.doAutoScroll(),1):0},engage:function(){var a=b(window);RVTS.$thumbs=b("#thumbnails");RVTS.$thumbs.after('<div id="ajaxLoader" style="display:none;position:fixed;bottom:32px;right:1%;z-index:999"><img src="'+
    5 RVTS.ajaxLoaderImage+'" width="128" height="15" alt="~"></div>');"#top"==window.location.hash&&window.scrollTo(0,0);RVTS.$thumbs.outerHeight()<a.height()?RVTS.adjust=1:RVTS.$thumbs.height()>2*a.height()&&(RVTS.adjust=-1);a.on("scroll resize",RVTS.checkAutoScroll);RVTS.checkAutoScroll()&&window.setTimeout(RVTS.checkAutoScroll,1500)}});b(document).ready(function(){"#top"==window.location.hash&&window.scrollTo(0,0);window.setTimeout(RVTS.engage,150)});if(window.history.replaceState){var f=RVTS.start;
    6 b(window).one("RVTS_loaded",function(){b(window).on("unload",function(){for(var a=Math.max(0,b(window).scrollTop()-60),c=RVTS.$thumbs.children("li"),d=0;d<c.length;d++)if(b(c[d]).offset().top>=a){a=RVTS.start+d;c=a-f;if(0>c||c>=RVTS.perPage)a=a?RVTS.urlModel.replace("%start%",a):RVTS.urlModel.replace("/start-%start%",""),window.history.replaceState(null,"",a+"#top");break}})})}}(jQuery);
     2a).replace("%per%",c);b("#ajaxLoader").show();RVTS.loadingUp=1;b.ajax({type:"GET",dataType:"html",url:c,success:function(c){RVTS.start=a;var e=jQuery.Event("RVTS_add");b(window).trigger(e,[c,!1]);e.isDefaultPrevented()||RVTS.$thumbs.prepend(c);0>=RVTS.start&&b("#rvtsUp").remove()},complete:function(){RVTS.loadingUp=0;RVTS.loading||b("#ajaxLoader").hide();b(window).trigger("RVTS_loaded",0);"undefined"!=typeof pwg_ajax_thumbnails_loader&&pwg_ajax_thumbnails_loader()}})}},doAutoScroll:function(){if(!(RVTS.loading||
     3RVTS.next>=RVTS.total)){var a=RVTS.ajaxUrlModel.replace("%start%",RVTS.next).replace("%per%",RVTS.perPage);RVTS.adjust&&(a+="&adj="+RVTS.adjust,RVTS.adjust=0);b("#ajaxLoader").show();RVTS.loading=1;b.ajax({type:"GET",dataType:"html",url:a,success:function(a){RVTS.next+=RVTS.perPage;var d=jQuery.Event("RVTS_add");b(window).trigger(d,[a,!0]);d.isDefaultPrevented()||RVTS.$thumbs.append(a);500<RVTS.next-RVTS.start&&50<RVTS.total-RVTS.next&&(RVTS.$thumbs.after('<div style="text-align:center;font-size:180%;margin:0 0 20px"><a href="'+
     4RVTS.urlModel.replace("%start%",RVTS.next)+'">'+RVTS.moreMsg.replace("%d",RVTS.total-RVTS.next)+"</a></div>"),RVTS.total=0)},complete:function(){RVTS.loading=0;RVTS.loadingUp||b("#ajaxLoader").hide();b(window).trigger("RVTS_loaded",1);"undefined"!=typeof pwg_ajax_thumbnails_loader&&pwg_ajax_thumbnails_loader()}})}},checkAutoScroll:function(a){var c=RVTS.$thumbs.position().top+RVTS.$thumbs.outerHeight(),d=b(window).scrollTop()+b(window).height();return c-(a?100:0)<=d?(RVTS.doAutoScroll(),1):0},engage:function(){var a=
     5b(window);RVTS.$thumbs=b("#thumbnails");RVTS.$thumbs.after('<div id="ajaxLoader" style="display:none;position:fixed;bottom:32px;right:1%;z-index:999"><img src="'+RVTS.ajaxLoaderImage+'" width="128" height="15" alt="~"></div>');"#top"==window.location.hash&&window.scrollTo(0,0);RVTS.$thumbs.outerHeight()<a.height()?RVTS.adjust=1:RVTS.$thumbs.height()>2*a.height()&&(RVTS.adjust=-1);a.on("scroll resize",RVTS.checkAutoScroll);RVTS.checkAutoScroll()&&window.setTimeout(RVTS.checkAutoScroll,1500)}});b(document).ready(function(){"#top"==
     6window.location.hash&&window.scrollTo(0,0);window.setTimeout(RVTS.engage,150)});if(window.history.replaceState){var f=RVTS.start;b(window).one("RVTS_loaded",function(){b(window).on("unload",function(){for(var a=Math.max(0,b(window).scrollTop()-60),c=RVTS.$thumbs.children("li"),d=0;d<c.length;d++)if(b(c[d]).offset().top>=a){a=RVTS.start+d;c=a-f;if(0>c||c>=RVTS.perPage)a=a?RVTS.urlModel.replace("%start%",a):RVTS.urlModel.replace("/start-%start%",""),window.history.replaceState(null,"",a+"#top");break}})})}}(jQuery);
Note: See TracChangeset for help on using the changeset viewer.