diff options
author | RedMatrix <info@friendica.com> | 2015-01-06 09:40:26 +1100 |
---|---|---|
committer | RedMatrix <info@friendica.com> | 2015-01-06 09:40:26 +1100 |
commit | c45456fa3342bc72d30c20bafd029913930130aa (patch) | |
tree | f707891da9bd1c7272f04e455f33043bbb29ef1d /view | |
parent | 074be42e234a9d44ffe7875ffef6eb7a5e22f013 (diff) | |
parent | 5ce5de73051e0d68d277dc189b3bcc4593d7ab8d (diff) | |
download | volse-hubzilla-c45456fa3342bc72d30c20bafd029913930130aa.tar.gz volse-hubzilla-c45456fa3342bc72d30c20bafd029913930130aa.tar.bz2 volse-hubzilla-c45456fa3342bc72d30c20bafd029913930130aa.zip |
Merge pull request #820 from pafcu/nomigrate
Steps towards not needing jquery-migrate
Diffstat (limited to 'view')
-rw-r--r-- | view/js/jquery-compat.js | 71 | ||||
-rw-r--r-- | view/js/main.js | 11 | ||||
-rw-r--r-- | view/php/theme_init.php | 10 | ||||
-rw-r--r-- | view/theme/redbasic/css/style.css | 4 | ||||
-rwxr-xr-x | view/tpl/admin_site.tpl | 8 | ||||
-rwxr-xr-x | view/tpl/contact_slider.tpl | 2 | ||||
-rwxr-xr-x | view/tpl/main_slider.tpl | 4 |
7 files changed, 20 insertions, 90 deletions
diff --git a/view/js/jquery-compat.js b/view/js/jquery-compat.js deleted file mode 100644 index 7bf912542..000000000 --- a/view/js/jquery-compat.js +++ /dev/null @@ -1,71 +0,0 @@ - -// provide jquery.browser so we can get rid of the migration toolkit - -jQuery.uaMatch = function( ua ) { - ua = ua.toLowerCase(); - - var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) || - /(webkit)[ \/]([\w.]+)/.exec( ua ) || - /(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) || - /(msie) ([\w.]+)/.exec( ua ) || - ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) || - []; - - return { - browser: match[ 1 ] || "", - version: match[ 2 ] || "0" - }; -}; - - -// Don't clobber any existing jQuery.browser in case it's different -if ( !jQuery.browser ) { - matched = jQuery.uaMatch( navigator.userAgent ); - browser = {}; - - if ( matched.browser ) { - browser[ matched.browser ] = true; - browser.version = matched.version; - } - - // Chrome is Webkit, but Webkit is also Safari. - if ( browser.chrome ) { - browser.webkit = true; - } else if ( browser.webkit ) { - browser.safari = true; - } - - jQuery.browser = browser; -} - -jQuery.fn.toggle = function( fn, fn2 ) { - - // Don't mess with animation or css toggles - if ( !jQuery.isFunction( fn ) || !jQuery.isFunction( fn2 ) ) { - return oldToggle.apply( this, arguments ); - } - - // Save reference to arguments for access in closure - var args = arguments, - guid = fn.guid || jQuery.guid++, - i = 0, - toggler = function( event ) { - // Figure out which function to execute - var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i; - jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 ); - - // Make sure that clicks stop - event.preventDefault(); - - // and execute the function - return args[ lastToggle ].apply( this, arguments ) || false; - }; - - // link all the functions, so any of them can unbind this click handler - toggler.guid = guid; - while ( i < args.length ) { - args[ i++ ].guid = guid; - } - - return this.click( toggler ); -}; diff --git a/view/js/main.js b/view/js/main.js index 8c48bbb72..85aea9875 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -269,9 +269,9 @@ } // fancyboxes - $("a.popupbox").fancybox({ - 'transitionIn' : 'elastic', - 'transitionOut' : 'elastic' + // Is this actually used anywhere? + $("a.popupbox").colorbox({ + 'transition' : 'elastic' }); @@ -598,14 +598,15 @@ function updateConvItems(mode,data) { $(".wall-item-body, .contact-info").each(function() { if($(this).height() > divmore_height + 10) { if(! $(this).hasClass('divmore')) { - $(this).divgrow({ initialHeight: divmore_height, moreText: aStr['divgrowmore'], lessText: aStr['divgrowless'], showBrackets: false }); + $(this).readmore({collapsedHeight: divmore_height, moreLink: '<a href="#">'+aStr['divgrowmore']+'</a>', lessLink: '<a href="#">'+aStr['divgrowless']+'</a>'}); $(this).addClass('divmore'); } - } + } }); } function liveUpdate() { + if(typeof profile_uid === 'undefined') profile_uid = false; /* Should probably be unified with channelId defined in head.tpl */ if((src == null) || (stopped) || (! profile_uid)) { $('.like-rotator').spin(false); return; } if(($('.comment-edit-text-full').length) || (in_progress)) { if(livetime) { diff --git a/view/php/theme_init.php b/view/php/theme_init.php index 33b7e87dc..d43a87046 100644 --- a/view/php/theme_init.php +++ b/view/php/theme_init.php @@ -2,11 +2,9 @@ require_once('include/plugin.php'); -head_add_css('library/fancybox/jquery.fancybox-1.3.4.css'); head_add_css('library/tiptip/tipTip.css'); head_add_css('library/jgrowl/jquery.jgrowl.css'); -head_add_css('library/jslider/css/jslider.css'); -head_add_css('library/colorbox/colorbox.css'); +head_add_css('library/jRange/jquery.range.css'); head_add_css('view/css/conversation.css'); head_add_css('view/css/widgets.css'); @@ -23,9 +21,9 @@ head_add_js('jquery.spin.js'); head_add_js('jquery.textinputs.js'); head_add_js('autocomplete.js'); head_add_js('library/jquery-textcomplete/jquery.textcomplete.js'); -head_add_js('library/fancybox/jquery.fancybox-1.3.4.js'); +head_add_js('library/colorbox/jquery.colorbox.js'); head_add_js('library/jquery.timeago.js'); -head_add_js('library/jquery.divgrow/jquery.divgrow-1.3.1.js'); +head_add_js('library/readmore.js/readmore.js'); head_add_js('library/jquery_ac/friendica.complete.js'); head_add_js('library/tiptip/jquery.tipTip.minified.js'); head_add_js('library/jgrowl/jquery.jgrowl_minimized.js'); @@ -39,7 +37,7 @@ head_add_js('acl.js'); head_add_js('webtoolkit.base64.js'); head_add_js('main.js'); head_add_js('crypto.js'); -head_add_js('library/jslider/bin/jquery.slider.min.js'); +head_add_js('library/jRange/jquery.range.js'); head_add_js('docready.js'); head_add_js('library/colorbox/jquery.colorbox-min.js'); head_add_js('library/bootstrap-tagsinput/bootstrap-tagsinput.js'); diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index 7a6ceb968..842e7063a 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -1028,7 +1028,7 @@ footer { background: none repeat scroll 0% 0% $cal_bgcolour !important; } -#fancybox-content { +#colorbox { border: 0px solid $fancybox_bgcolour; background-color: $fancybox_bgcolour; } @@ -2352,6 +2352,8 @@ aside .nav > li > a:hover, aside .nav > li > a:focus { border: 1px solid #cccccc; } +/* Abusing theme-green is less work than makeing a new new one */ +.theme-green .back-bar .selected-bar { background-color: #000000; background-image: none; !important } /* Turn checkboxes into switches */ diff --git a/view/tpl/admin_site.tpl b/view/tpl/admin_site.tpl index 0003ddfc0..caeddeecb 100755 --- a/view/tpl/admin_site.tpl +++ b/view/tpl/admin_site.tpl @@ -1,15 +1,15 @@ <script> $(function(){ - $("#cnftheme").fancybox({ + $("#cnftheme").colorbox({ width: 800, - autoDimensions: false, - onStart: function(){ + onLoad: function(){ var theme = $("#id_theme :selected").val(); $("#cnftheme").attr('href',"{{$baseurl}}/admin/themes/"+theme); }, onComplete: function(){ - $("div#fancybox-content form").submit(function(e){ + $(this).colorbox.resize(); + $("#colorbox form").submit(function(e){ var url = $(this).attr('action'); // can't get .serialize() to work... var data={}; diff --git a/view/tpl/contact_slider.tpl b/view/tpl/contact_slider.tpl index 93d0cc625..09a79edd8 100755 --- a/view/tpl/contact_slider.tpl +++ b/view/tpl/contact_slider.tpl @@ -1,4 +1,4 @@ <div id="contact-slider" class="slider" style="height: 32px; position: relative; left: 5%; width: 90%;"><input id="contact-range" type="text" name="fake-closeness" value="{{$val}}" /></div> <script> - $("#contact-range").slider({ from: {{$min|default:'0'}}, to: 99, step: 1, scale: ['{{$me}}', '|', '{{$intimate}}', '|', '{{$friends}}', '|', '{{$oldfriends}}', '|', '{{$acquaintances}}', '|', '{{$world}}' ], onstatechange: function(v) { $("#contact-closeness-mirror").val(v); } }); + $("#contact-range").jRange({ from: {{$min|default:'0'}}, to: 99, step: 1, scale: ['{{$me}}', '|', '{{$intimate}}', '|', '{{$friends}}', '|', '{{$oldfriends}}', '|', '{{$acquaintances}}', '|', '{{$world}}' ], width:'100%', showLabels: false, onstatechange: function(v) { $("#contact-closeness-mirror").val(v); } }); </script> diff --git a/view/tpl/main_slider.tpl b/view/tpl/main_slider.tpl index fbc290df1..c8f3d2e06 100755 --- a/view/tpl/main_slider.tpl +++ b/view/tpl/main_slider.tpl @@ -2,8 +2,8 @@ <script> var old_cmin = 0; var old_cmax = 99; - $("#main-range").slider({ from: 0, to: 99, step: 1, scale: ['{{$me}}', '|', '{{$intimate}}', '|', '{{$friends}}', '|', '{{$oldfriends}}', '|', '{{$acquaintances}}', '|', '{{$world}}' ], onstatechange: function(v) { - var carr = v.split(";"); + $("#main-range").jRange({ isRange: true, from: 0, to: 99, step: 1, scale: ['{{$me}}', '|', '{{$intimate}}', '|', '{{$friends}}', '|', '{{$oldfriends}}', '|', '{{$acquaintances}}', '|', '{{$world}}' ], width:'100%', showLabels: false, onstatechange: function(v) { + var carr = v.split(","); if(carr[0] != bParam_cmin) { old_cmin = bParam_cmin; bParam_cmin = carr[0]; |