From 7791d28a5d24193a01ce004988ba6767f45835ba Mon Sep 17 00:00:00 2001 From: Stefan Parviainen Date: Mon, 5 Jan 2015 17:10:08 +0100 Subject: Replace divgrow with more modern readmore.js --- view/js/main.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'view/js') diff --git a/view/js/main.js b/view/js/main.js index 8c48bbb72..80518768e 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -596,12 +596,10 @@ function updateConvItems(mode,data) { function collapseHeight() { $(".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).addClass('divmore'); - } - } + if(! $(this).hasClass('divmore')) { + $(this).readmore({collapsedHeight: divmore_height, moreLink: ''+aStr['divgrowmore']+'', lessLink: ''+aStr['divgrowless']+''}); + $(this).addClass('divmore'); + } }); } -- cgit v1.2.3 From b320b8cbf35e84df76e236a7bc2cbd53047e4654 Mon Sep 17 00:00:00 2001 From: Stefan Parviainen Date: Mon, 5 Jan 2015 19:49:15 +0100 Subject: Replace fancybox with colorbox --- view/js/main.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'view/js') diff --git a/view/js/main.js b/view/js/main.js index 80518768e..64e9e06f1 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' }); -- cgit v1.2.3 From 749aef7172f938019321ec1d43d65ab8d2a34cca Mon Sep 17 00:00:00 2001 From: Stefan Parviainen Date: Mon, 5 Jan 2015 20:27:01 +0100 Subject: Remove some unneeded libraries --- view/js/jquery-compat.js | 71 ------------------------------------------------ 1 file changed, 71 deletions(-) delete mode 100644 view/js/jquery-compat.js (limited to 'view/js') 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 ); -}; -- cgit v1.2.3 From 6d0832e693d99cd14b1e9fdde7fbc2931c301d1a Mon Sep 17 00:00:00 2001 From: Stefan Parviainen Date: Mon, 5 Jan 2015 20:29:20 +0100 Subject: Fix error with undefined profile_uid --- view/js/main.js | 1 + 1 file changed, 1 insertion(+) (limited to 'view/js') diff --git a/view/js/main.js b/view/js/main.js index 64e9e06f1..f1b41bcbe 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -604,6 +604,7 @@ function updateConvItems(mode,data) { } 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) { -- cgit v1.2.3 From 1ac9a4976fe6a84e3f0d9e405d929e45a0c1183c Mon Sep 17 00:00:00 2001 From: Stefan Parviainen Date: Mon, 5 Jan 2015 22:09:05 +0100 Subject: Unbreak readmore --- view/js/main.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'view/js') diff --git a/view/js/main.js b/view/js/main.js index f1b41bcbe..85aea9875 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -596,9 +596,11 @@ function updateConvItems(mode,data) { function collapseHeight() { $(".wall-item-body, .contact-info").each(function() { - if(! $(this).hasClass('divmore')) { - $(this).readmore({collapsedHeight: divmore_height, moreLink: ''+aStr['divgrowmore']+'', lessLink: ''+aStr['divgrowless']+''}); - $(this).addClass('divmore'); + if($(this).height() > divmore_height + 10) { + if(! $(this).hasClass('divmore')) { + $(this).readmore({collapsedHeight: divmore_height, moreLink: ''+aStr['divgrowmore']+'', lessLink: ''+aStr['divgrowless']+''}); + $(this).addClass('divmore'); + } } }); } -- cgit v1.2.3