diff --git a/LICENSE b/LICENSE index 9fde98049..ee053995d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ /* -* 4chan X - Version 1.2.7 - 2013-05-18 +* 4chan X - Version 1.2.7 - 2013-05-19 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE diff --git a/builds/4chan-X.js b/builds/4chan-X.js index af40175eb..8f71e4b6c 100644 --- a/builds/4chan-X.js +++ b/builds/4chan-X.js @@ -19,7 +19,7 @@ // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC // ==/UserScript== /* -* 4chan X - Version 1.2.7 - 2013-05-18 +* 4chan X - Version 1.2.7 - 2013-05-19 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -222,7 +222,8 @@ 'Fit width': [true, ''], 'Fit height': [false, ''], 'Expand spoilers': [true, 'Expand all images along with spoilers.'], - 'Expand from here': [true, 'Expand all images only from current position to thread end.'] + 'Expand from here': [true, 'Expand all images only from current position to thread end.'], + 'Advance on contract': [false, 'Advance to next post when contracting an expanded image.'] }, filter: { name: "# Filter any namefags:\n#/^(?!Anonymous$)/", @@ -6182,7 +6183,7 @@ return; } ImageExpand.contract(post); - rect = post.nodes.root.getBoundingClientRect(); + rect = Conf['Advance on contract'] ? post.nodes.root.nextSibling.getBoundingClientRect() : post.nodes.root.getBoundingClientRect(); if (!(rect.top <= 0 || rect.left <= 0)) { return; } diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 025a970dd..19bb57347 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -19,7 +19,7 @@ // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC // ==/UserScript== /* -* 4chan X - Version 1.2.7 - 2013-05-18 +* 4chan X - Version 1.2.7 - 2013-05-19 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -223,7 +223,8 @@ 'Fit width': [true, ''], 'Fit height': [false, ''], 'Expand spoilers': [true, 'Expand all images along with spoilers.'], - 'Expand from here': [true, 'Expand all images only from current position to thread end.'] + 'Expand from here': [true, 'Expand all images only from current position to thread end.'], + 'Advance on contract': [false, 'Advance to next post when contracting an expanded image.'] }, filter: { name: "# Filter any namefags:\n#/^(?!Anonymous$)/", @@ -6191,7 +6192,7 @@ return; } ImageExpand.contract(post); - rect = post.nodes.root.getBoundingClientRect(); + rect = Conf['Advance on contract'] ? post.nodes.root.nextSibling.getBoundingClientRect() : post.nodes.root.getBoundingClientRect(); if (!(rect.top <= 0 || rect.left <= 0)) { return; } diff --git a/builds/crx/script.js b/builds/crx/script.js index 4c122ac10..4e4795a2b 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -1,6 +1,6 @@ // Generated by CoffeeScript /* -* 4chan X - Version 1.2.7 - 2013-05-18 +* 4chan X - Version 1.2.7 - 2013-05-19 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -204,7 +204,8 @@ 'Fit width': [true, ''], 'Fit height': [false, ''], 'Expand spoilers': [true, 'Expand all images along with spoilers.'], - 'Expand from here': [true, 'Expand all images only from current position to thread end.'] + 'Expand from here': [true, 'Expand all images only from current position to thread end.'], + 'Advance on contract': [false, 'Advance to next post when contracting an expanded image.'] }, filter: { name: "# Filter any namefags:\n#/^(?!Anonymous$)/", @@ -6169,7 +6170,7 @@ return; } ImageExpand.contract(post); - rect = post.nodes.root.getBoundingClientRect(); + rect = Conf['Advance on contract'] ? post.nodes.root.nextSibling.getBoundingClientRect() : post.nodes.root.getBoundingClientRect(); if (!(rect.top <= 0 || rect.left <= 0)) { return; } diff --git a/src/General/Config.coffee b/src/General/Config.coffee index 6a8be3c12..da1726add 100644 --- a/src/General/Config.coffee +++ b/src/General/Config.coffee @@ -377,7 +377,11 @@ Config = true 'Expand all images only from current position to thread end.' ] - + 'Advance on contract': [ + false + 'Advance to next post when contracting an expanded image.' + ] + filter: name: """ # Filter any namefags: diff --git a/src/Images/ImageExpand.coffee b/src/Images/ImageExpand.coffee index a2427365a..da7047a20 100644 --- a/src/Images/ImageExpand.coffee +++ b/src/Images/ImageExpand.coffee @@ -68,7 +68,10 @@ ImageExpand = ImageExpand.expand post return ImageExpand.contract post - rect = post.nodes.root.getBoundingClientRect() + rect = if Conf['Advance on contract'] + post.nodes.root.nextSibling.getBoundingClientRect() + else + post.nodes.root.getBoundingClientRect() return unless rect.top <= 0 or rect.left <= 0 {top} = rect