Advance on contract option, close #74
This commit is contained in:
parent
82cc5dcd10
commit
75735aedf0
2
LICENSE
2
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.
|
* Licensed under the MIT license.
|
||||||
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
|
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
|
||||||
|
|||||||
@ -19,7 +19,7 @@
|
|||||||
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC
|
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC
|
||||||
// ==/UserScript==
|
// ==/UserScript==
|
||||||
/*
|
/*
|
||||||
* 4chan X - Version 1.2.7 - 2013-05-18
|
* 4chan X - Version 1.2.7 - 2013-05-19
|
||||||
*
|
*
|
||||||
* Licensed under the MIT license.
|
* Licensed under the MIT license.
|
||||||
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
|
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
|
||||||
@ -222,7 +222,8 @@
|
|||||||
'Fit width': [true, ''],
|
'Fit width': [true, ''],
|
||||||
'Fit height': [false, ''],
|
'Fit height': [false, ''],
|
||||||
'Expand spoilers': [true, 'Expand all images along with spoilers.'],
|
'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: {
|
filter: {
|
||||||
name: "# Filter any namefags:\n#/^(?!Anonymous$)/",
|
name: "# Filter any namefags:\n#/^(?!Anonymous$)/",
|
||||||
@ -6182,7 +6183,7 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ImageExpand.contract(post);
|
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)) {
|
if (!(rect.top <= 0 || rect.left <= 0)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,7 +19,7 @@
|
|||||||
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC
|
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC
|
||||||
// ==/UserScript==
|
// ==/UserScript==
|
||||||
/*
|
/*
|
||||||
* 4chan X - Version 1.2.7 - 2013-05-18
|
* 4chan X - Version 1.2.7 - 2013-05-19
|
||||||
*
|
*
|
||||||
* Licensed under the MIT license.
|
* Licensed under the MIT license.
|
||||||
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
|
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
|
||||||
@ -223,7 +223,8 @@
|
|||||||
'Fit width': [true, ''],
|
'Fit width': [true, ''],
|
||||||
'Fit height': [false, ''],
|
'Fit height': [false, ''],
|
||||||
'Expand spoilers': [true, 'Expand all images along with spoilers.'],
|
'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: {
|
filter: {
|
||||||
name: "# Filter any namefags:\n#/^(?!Anonymous$)/",
|
name: "# Filter any namefags:\n#/^(?!Anonymous$)/",
|
||||||
@ -6191,7 +6192,7 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ImageExpand.contract(post);
|
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)) {
|
if (!(rect.top <= 0 || rect.left <= 0)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
// Generated by CoffeeScript
|
// 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.
|
* Licensed under the MIT license.
|
||||||
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
|
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
|
||||||
@ -204,7 +204,8 @@
|
|||||||
'Fit width': [true, ''],
|
'Fit width': [true, ''],
|
||||||
'Fit height': [false, ''],
|
'Fit height': [false, ''],
|
||||||
'Expand spoilers': [true, 'Expand all images along with spoilers.'],
|
'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: {
|
filter: {
|
||||||
name: "# Filter any namefags:\n#/^(?!Anonymous$)/",
|
name: "# Filter any namefags:\n#/^(?!Anonymous$)/",
|
||||||
@ -6169,7 +6170,7 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ImageExpand.contract(post);
|
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)) {
|
if (!(rect.top <= 0 || rect.left <= 0)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -377,6 +377,10 @@ Config =
|
|||||||
true
|
true
|
||||||
'Expand all images only from current position to thread end.'
|
'Expand all images only from current position to thread end.'
|
||||||
]
|
]
|
||||||
|
'Advance on contract': [
|
||||||
|
false
|
||||||
|
'Advance to next post when contracting an expanded image.'
|
||||||
|
]
|
||||||
|
|
||||||
filter:
|
filter:
|
||||||
name: """
|
name: """
|
||||||
|
|||||||
@ -68,7 +68,10 @@ ImageExpand =
|
|||||||
ImageExpand.expand post
|
ImageExpand.expand post
|
||||||
return
|
return
|
||||||
ImageExpand.contract post
|
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
|
return unless rect.top <= 0 or rect.left <= 0
|
||||||
|
|
||||||
{top} = rect
|
{top} = rect
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user