Merge branch 'mayhem' into v3

Conflicts:
	CHANGELOG.md
	package.json
This commit is contained in:
Zixaphir 2014-04-19 16:54:50 -07:00
commit 26f491a0cc
8 changed files with 17 additions and 18 deletions

View File

@ -1,6 +1,7 @@
**MayhemYDG** **MayhemYDG**
- Update 4chan namespaces support. - Update 4chan namespaces support.
- Better handling of webm playback errors. - Better handling of webm playback errors.
- Bugfixes
### v1.7.8 ### v1.7.8
*2014-04-12* *2014-04-12*

View File

@ -1,5 +1,5 @@
/* /*
* 4chan X - Version 1.7.8 - 2014-04-12 * 4chan X - Version 1.7.8 - 2014-04-19
* *
* Licensed under the MIT license. * Licensed under the MIT license.
* https://github.com/ccd0/4chan-x/blob/master/LICENSE * https://github.com/ccd0/4chan-x/blob/master/LICENSE

View File

@ -24,7 +24,7 @@
// ==/UserScript== // ==/UserScript==
/* /*
* 4chan X - Version 1.7.8 - 2014-04-12 * 4chan X - Version 1.7.8 - 2014-04-19
* *
* Licensed under the MIT license. * Licensed under the MIT license.
* https://github.com/ccd0/4chan-x/blob/master/LICENSE * https://github.com/ccd0/4chan-x/blob/master/LICENSE
@ -131,7 +131,7 @@
Config = { Config = {
main: { main: {
'Miscellaneous': { 'Miscellaneous': {
'JSON Navigation': [false, 'Use JSON for loading the Board Index and Threads. Also allows searching and sorting the board index and infinite scolling.'], 'JSON Navigation': [true, 'Use JSON for loading the Board Index and Threads. Also allows searching and sorting the board index and infinite scolling.'],
'Catalog Links': [true, 'Add toggle link in header menu to turn Navigation links into links to each board\'s catalog.'], 'Catalog Links': [true, 'Add toggle link in header menu to turn Navigation links into links to each board\'s catalog.'],
'External Catalog': [false, 'Link to external catalog instead of the internal one.'], 'External Catalog': [false, 'Link to external catalog instead of the internal one.'],
'QR Shortcut': [false, 'Adds a small [QR] link in the header.'], 'QR Shortcut': [false, 'Adds a small [QR] link in the header.'],
@ -1210,7 +1210,7 @@
} }
this.file.sizeInBytes = size; this.file.sizeInBytes = size;
this.file.thumbURL = that.isArchived ? thumb.src : "" + location.protocol + "//t.4cdn.org/" + this.board + "/" + (this.file.URL.match(/(\d+)\./)[1]) + "s.jpg"; this.file.thumbURL = that.isArchived ? thumb.src : "" + location.protocol + "//t.4cdn.org/" + this.board + "/" + (this.file.URL.match(/(\d+)\./)[1]) + "s.jpg";
this.file.name = (nameNode = $('span', fileText)) ? nameNode.title || nameNode.textContent : fileText.title; this.file.name = !this.file.isSpoiler && (nameNode = $('a', fileText)) ? nameNode.title || nameNode.textContent : fileText.title;
this.file.isImage = /(jpg|png|gif)$/i.test(this.file.name); this.file.isImage = /(jpg|png|gif)$/i.test(this.file.name);
this.file.isVideo = /webm$/i.test(this.file.name); this.file.isVideo = /webm$/i.test(this.file.name);
if (this.file.isImage || this.file.isVideo) { if (this.file.isImage || this.file.isVideo) {
@ -3739,7 +3739,7 @@
a.textContent = filename; a.textContent = filename;
filename = a.innerHTML.replace(/'/g, '''); filename = a.innerHTML.replace(/'/g, ''');
fileDims = file.name.slice(-3) === 'pdf' ? 'PDF' : "" + file.width + "x" + file.height; fileDims = file.name.slice(-3) === 'pdf' ? 'PDF' : "" + file.width + "x" + file.height;
fileInfo = ("<div class=fileText" + (file.isSpoiler ? " title='" + filename + "'" : '') + ">File: <a href='" + file.url + "' target=_blank>" + file.timestamp + "</a>") + ("-(" + fileSize + ", " + fileDims + (file.isSpoiler ? '' : ", <span" + (filename !== shortFilename ? " title='" + filename + "'" : '') + ">" + shortFilename + "</span>")) + ")</div>"; fileInfo = ("<div class=fileText " + (file.isSpoiler ? "title='" + filename + "'" : '') + ">File: ") + ("<a href='" + file.url + "' " + (filename !== shortFilename && !file.isSpoiler ? " title='" + filename + "'" : '') + " target=_blank>" + (file.isSpoiler ? 'Spoiler Image' : shortFilename) + "</a>") + (" (" + fileSize + ", " + fileDims + ")</div>");
fileHTML = "<div class=file>" + fileInfo + imgSrc + "</div>"; fileHTML = "<div class=file>" + fileInfo + imgSrc + "</div>";
} else { } else {
fileHTML = ''; fileHTML = '';

View File

@ -1,6 +1,6 @@
// Generated by CoffeeScript // Generated by CoffeeScript
/* /*
* 4chan X - Version 1.7.8 - 2014-04-12 * 4chan X - Version 1.7.8 - 2014-04-19
* *
* Licensed under the MIT license. * Licensed under the MIT license.
* https://github.com/ccd0/4chan-x/blob/master/LICENSE * https://github.com/ccd0/4chan-x/blob/master/LICENSE
@ -107,7 +107,7 @@
Config = { Config = {
main: { main: {
'Miscellaneous': { 'Miscellaneous': {
'JSON Navigation': [false, 'Use JSON for loading the Board Index and Threads. Also allows searching and sorting the board index and infinite scolling.'], 'JSON Navigation': [true, 'Use JSON for loading the Board Index and Threads. Also allows searching and sorting the board index and infinite scolling.'],
'Catalog Links': [true, 'Add toggle link in header menu to turn Navigation links into links to each board\'s catalog.'], 'Catalog Links': [true, 'Add toggle link in header menu to turn Navigation links into links to each board\'s catalog.'],
'External Catalog': [false, 'Link to external catalog instead of the internal one.'], 'External Catalog': [false, 'Link to external catalog instead of the internal one.'],
'QR Shortcut': [false, 'Adds a small [QR] link in the header.'], 'QR Shortcut': [false, 'Adds a small [QR] link in the header.'],
@ -1266,7 +1266,7 @@
} }
this.file.sizeInBytes = size; this.file.sizeInBytes = size;
this.file.thumbURL = that.isArchived ? thumb.src : "" + location.protocol + "//t.4cdn.org/" + this.board + "/" + (this.file.URL.match(/(\d+)\./)[1]) + "s.jpg"; this.file.thumbURL = that.isArchived ? thumb.src : "" + location.protocol + "//t.4cdn.org/" + this.board + "/" + (this.file.URL.match(/(\d+)\./)[1]) + "s.jpg";
this.file.name = (nameNode = $('span', fileText)) ? nameNode.title || nameNode.textContent : fileText.title; this.file.name = !this.file.isSpoiler && (nameNode = $('a', fileText)) ? nameNode.title || nameNode.textContent : fileText.title;
this.file.name = this.file.name.replace(/%22/g, '"'); this.file.name = this.file.name.replace(/%22/g, '"');
this.file.isImage = /(jpg|png|gif)$/i.test(this.file.name); this.file.isImage = /(jpg|png|gif)$/i.test(this.file.name);
this.file.isVideo = /webm$/i.test(this.file.name); this.file.isVideo = /webm$/i.test(this.file.name);
@ -3798,7 +3798,7 @@
a.textContent = filename; a.textContent = filename;
filename = a.innerHTML.replace(/'/g, '&apos;'); filename = a.innerHTML.replace(/'/g, '&apos;');
fileDims = file.name.slice(-3) === 'pdf' ? 'PDF' : "" + file.width + "x" + file.height; fileDims = file.name.slice(-3) === 'pdf' ? 'PDF' : "" + file.width + "x" + file.height;
fileInfo = ("<div class=fileText" + (file.isSpoiler ? " title='" + filename + "'" : '') + ">File: <a href='" + file.url + "' target=_blank>" + file.timestamp + "</a>") + ("-(" + fileSize + ", " + fileDims + (file.isSpoiler ? '' : ", <span" + (filename !== shortFilename ? " title='" + filename + "'" : '') + ">" + shortFilename + "</span>")) + ")</div>"; fileInfo = ("<div class=fileText " + (file.isSpoiler ? "title='" + filename + "'" : '') + ">File: ") + ("<a href='" + file.url + "' " + (filename !== shortFilename && !file.isSpoiler ? " title='" + filename + "'" : '') + " target=_blank>" + (file.isSpoiler ? 'Spoiler Image' : shortFilename) + "</a>") + (" (" + fileSize + ", " + fileDims + ")</div>");
fileHTML = "<div class=file>" + fileInfo + imgSrc + "</div>"; fileHTML = "<div class=file>" + fileInfo + imgSrc + "</div>";
} else { } else {
fileHTML = ''; fileHTML = '';

View File

@ -105,6 +105,7 @@ a[href="javascript:;"] {
:root.bottom-header body { :root.bottom-header body {
margin-bottom: 2em; margin-bottom: 2em;
} }
body > .desktop,
:root.fourchan-x #navtopright, :root.fourchan-x #navtopright,
:root.fourchan-x #navbotright, :root.fourchan-x #navbotright,
:root.fourchan-x:not(.show-original-top-board-list) #boardNavDesktop, :root.fourchan-x:not(.show-original-top-board-list) #boardNavDesktop,
@ -1061,6 +1062,7 @@ a.remove {
/* Other */ /* Other */
.linkified { .linkified {
text-decoration: underline;
word-break: break-all; word-break: break-all;
} }
.posteruid.painted { .posteruid.painted {

View File

@ -160,13 +160,9 @@ Build =
filename = a.innerHTML.replace /'/g, '&apos;' filename = a.innerHTML.replace /'/g, '&apos;'
fileDims = if file.name[-3..] is 'pdf' then 'PDF' else "#{file.width}x#{file.height}" fileDims = if file.name[-3..] is 'pdf' then 'PDF' else "#{file.width}x#{file.height}"
fileInfo = "<div class=fileText#{if file.isSpoiler then " title='#{filename}'" else ''}>File: <a href='#{file.url}' target=_blank>#{file.timestamp}</a>" + fileInfo = "<div class=fileText #{if file.isSpoiler then "title='#{filename}'" else ''}>File: " +
"-(#{fileSize}, #{fileDims}#{ "<a href='#{file.url}' #{if filename isnt shortFilename and !file.isSpoiler then " title='#{filename}'" else ''} target=_blank>#{if file.isSpoiler then 'Spoiler Image' else shortFilename}</a>" +
if file.isSpoiler " (#{fileSize}, #{fileDims})</div>"
''
else
", <span#{if filename isnt shortFilename then " title='#{filename}'" else ''}>#{shortFilename}</span>"
}" + ")</div>"
fileHTML = "<div class=file>#{fileInfo}#{imgSrc}</div>" fileHTML = "<div class=file>#{fileInfo}#{imgSrc}</div>"
else else

View File

@ -2,7 +2,7 @@ Config =
main: main:
'Miscellaneous': 'Miscellaneous':
'JSON Navigation' : [ 'JSON Navigation' : [
false true
'Use JSON for loading the Board Index and Threads. Also allows searching and sorting the board index and infinite scolling.' 'Use JSON for loading the Board Index and Threads. Also allows searching and sorting the board index and infinite scolling.'
] ]
'Catalog Links': [ 'Catalog Links': [

View File

@ -135,7 +135,7 @@ class Post
thumb.src thumb.src
else else
"#{location.protocol}//t.4cdn.org/#{@board}/#{@file.URL.match(/(\d+)\./)[1]}s.jpg" "#{location.protocol}//t.4cdn.org/#{@board}/#{@file.URL.match(/(\d+)\./)[1]}s.jpg"
@file.name = if nameNode = $ 'span', fileText @file.name = if !@file.isSpoiler and nameNode = $ 'a', fileText
nameNode.title or nameNode.textContent nameNode.title or nameNode.textContent
else else
fileText.title fileText.title