Merge branch 'v3'

Conflicts:
	CHANGELOG.md
	LICENSE
	builds/crx/manifest.json
	builds/crx/script.js
	latest.js
	package.json
	src/General/Config.coffee
	src/General/lib/post.class
	src/Posting/QuickReply.coffee
This commit is contained in:
Zixaphir 2013-07-24 22:17:35 -07:00
commit a6d05a6115
14 changed files with 1096 additions and 21429 deletions

View File

@ -188,19 +188,19 @@ module.exports = (grunt) ->
] ]
grunt.registerTask 'patch', [ grunt.registerTask 'patch', [
'bump' 'bump-only'
'reloadPkg' 'reloadPkg'
'updcl:3' 'updcl:3'
] ]
grunt.registerTask 'minor', [ grunt.registerTask 'minor', [
'bump:minor' 'bump-only:minor'
'reloadPkg' 'reloadPkg'
'updcl:2' 'updcl:2'
] ]
grunt.registerTask 'major', [ grunt.registerTask 'major', [
'bump:major' 'bump-only:major'
'reloadPkg' 'reloadPkg'
'updcl:1' 'updcl:1'
] ]

View File

@ -1,5 +1,5 @@
/* /*
* appchan x - Version 2.1.3 - 2013-07-22 * appchan x - Version 2.1.3 - 2013-07-24
* *
* Licensed under the MIT license. * Licensed under the MIT license.
* https://github.com/zixaphir/appchan-x/blob/master/LICENSE * https://github.com/zixaphir/appchan-x/blob/master/LICENSE

File diff suppressed because one or more lines are too long

View File

@ -1,19 +0,0 @@
// ==UserScript==
// @name 4chan X
// @version 1.2.19
// @namespace 4chan-X
// @description Cross-browser userscript for maximum lurking on 4chan.
// @license MIT; https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
// @match *://api.4chan.org/*
// @match *://boards.4chan.org/*
// @match *://images.4chan.org/*
// @match *://sys.4chan.org/*
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_deleteValue
// @grant GM_openInTab
// @run-at document-start
// @updateURL https://github.com/seaweedchan/4chan-x/raw/stable/builds/4chan-X.meta.js
// @downloadURL https://github.com/seaweedchan/4chan-x/raw/stable/builds/4chan-X.user.js
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC
// ==/UserScript==

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,3 +0,0 @@
<div class="move" title="Post count / File count / Page count">
<span id="post-count">...</span> / <span id="file-count">...</span> / <span id="page-count">...</span>
</div>

View File

@ -1,38 +0,0 @@
<div>
<input type="checkbox" id="autohide" title="Auto-hide">
<select data-name="thread" title="Create a new thread / Reply">
<option value="new">New thread</option>
</select>
<span class="move"></span>
<a href="javascript:;" class="close" title="Close">×</a>
</div>
<form>
<div class="persona">
<input type="button" id="dump-button" title="Dump list" value="+">
<input data-name="name" list="list-name" placeholder="Name" class="field" size="1">
<input data-name="email" list="list-email" placeholder="E-mail" class="field" size="1">
<input data-name="sub" list="list-sub" placeholder="Subject" class="field" size="1">
</div>
<div id="dump-list-container">
<div id="dump-list"></div>
<a id="add-post" href="javascript:;" title="Add a post">+</a>
</div>
<div class="textarea">
<textarea data-name="com" placeholder="Comment" class="field"></textarea>
<span id="char-count"></span>
</div>
<div id="file-n-submit">
<input type="submit">
<input type="button" id="qr-file-button" value="Choose files">
<span id="qr-filename-container">
<span id="qr-no-file">No selected file</span>
<span id="qr-filename"></span>
</span>
<a id="qr-filerm" href="javascript:;" title="Remove file">×</a>
<input type="checkbox" id="qr-file-spoiler" title="Spoiler image">
</div>
<input type="file" multiple hidden>
</form>
<datalist id="list-name"></datalist>
<datalist id="list-email"></datalist>
<datalist id="list-sub"></datalist>

View File

@ -28,7 +28,7 @@ Redirect =
'http': false 'http': false
'https': true 'https': true
'software': 'foolfuuka' 'software': 'foolfuuka'
'boards': ['a', 'co', 'gd', 'jp', 'm', 'q', 'sp', 'tg', 'tv', 'vg', 'vp', 'vr', 'wsg'] 'boards': ['a', 'co', 'gd', 'jp', 'm', 'q', 'sp', 'tg', 'tv', 'v', 'vg', 'vp', 'vr', 'wsg']
'files': ['a', 'gd', 'jp', 'm', 'q', 'tg', 'vg', 'vp', 'vr', 'wsg'] 'files': ['a', 'gd', 'jp', 'm', 'q', 'tg', 'vg', 'vp', 'vr', 'wsg']
'NSFW Foolz': 'NSFW Foolz':
@ -70,6 +70,14 @@ Redirect =
'boards': ['adv', 'asp', 'cm', 'i', 'lgbt', 'n', 'o', 'p', 's4s', 't', 'trv'] 'boards': ['adv', 'asp', 'cm', 'i', 'lgbt', 'n', 'o', 'p', 's4s', 't', 'trv']
'files': ['adv', 'asp', 'cm', 'i', 'lgbt', 'n', 'o', 'p', 's4s', 't', 'trv'] 'files': ['adv', 'asp', 'cm', 'i', 'lgbt', 'n', 'o', 'p', 's4s', 't', 'trv']
'World Athletic Project':
'domain': 'fuuka.worldathleticproject.org'
'http': true
'https': false
'software': 'foolfuuka'
'boards': ['e', 'h', 'p', 's', 'u']
'files': ['e', 'h', 'p', 's', 'u']
'Install Gentoo': 'Install Gentoo':
'domain': 'archive.installgentoo.net' 'domain': 'archive.installgentoo.net'
'http': false 'http': false
@ -78,6 +86,14 @@ Redirect =
'boards': ['diy', 'g', 'sci'] 'boards': ['diy', 'g', 'sci']
'files': [] 'files': []
'warosu':
'domain': 'fuuka.warosu.org'
'http': true
'https': true
'software': 'fuuka'
'boards': ['3', 'cgl', 'ck', 'fa', 'ic', 'jp', 'lit', 'q', 'tg', 'vr']
'files': ['3', 'cgl', 'ck', 'fa', 'ic', 'jp', 'lit', 'q', 'tg', 'vr']
'Rebecca Black Tech': 'Rebecca Black Tech':
'domain': 'rbt.asia' 'domain': 'rbt.asia'
'http': true 'http': true

View File

@ -26,7 +26,7 @@ Config =
'Localize and format timestamps.' 'Localize and format timestamps.'
] ]
'Relative Post Dates': [ 'Relative Post Dates': [
false true
'Display dates like "3 minutes ago". Tooltip shows the timestamp.' 'Display dates like "3 minutes ago". Tooltip shows the timestamp.'
] ]
'File Info Formatting': [ 'File Info Formatting': [
@ -104,11 +104,11 @@ Config =
'Hide replies of hidden posts, recursively.' 'Hide replies of hidden posts, recursively.'
] ]
'Thread Hiding Buttons': [ 'Thread Hiding Buttons': [
true false
'Add buttons to hide entire threads.' 'Add buttons to hide entire threads.'
] ]
'Reply Hiding Buttons': [ 'Reply Hiding Buttons': [
true false
'Add buttons to hide single replies.' 'Add buttons to hide single replies.'
] ]
'Filtered Backlinks': [ 'Filtered Backlinks': [
@ -126,7 +126,7 @@ Config =
'Expand images.' 'Expand images.'
] ]
'Image Hover': [ 'Image Hover': [
false true
'Show full image on mouseover.' 'Show full image on mouseover.'
] ]
'Sauce': [ 'Sauce': [
@ -258,7 +258,7 @@ Config =
'The Quick reply won\'t disappear after posting.' 'The Quick reply won\'t disappear after posting.'
] ]
'Auto Hide QR': [ 'Auto Hide QR': [
false true
'Automatically hide the quick reply when posting.' 'Automatically hide the quick reply when posting.'
] ]
'Open Post in New Tab': [ 'Open Post in New Tab': [
@ -358,13 +358,13 @@ Config =
'Add \'(Cross-thread)\' to cross-threads quotes.' 'Add \'(Cross-thread)\' to cross-threads quotes.'
] ]
'Quote Threading': [ 'Quote Threading': [
false true
'Thread conversations' 'Thread conversations'
] ]
imageExpansion: imageExpansion:
'Fit width': [ 'Fit width': [
true false
'' ''
] ]
'Fit height': [ 'Fit height': [
@ -376,7 +376,7 @@ Config =
'Expand all images along with spoilers.' 'Expand all images along with spoilers.'
] ]
'Expand from here': [ 'Expand from here': [
true false
'Expand all images only from current position to thread end.' 'Expand all images only from current position to thread end.'
] ]
'Advance on contract': [ 'Advance on contract': [
@ -829,12 +829,11 @@ http://iqdb.org/?url=%TURL
boardnav: """ boardnav: """
[ toggle-all ] [ toggle-all ]
[current-title] [current-title]
[external-text:"FAQ","https://github.com/seaweedchan/4chan-x/wiki/Frequently-Asked-Questions"]
""" """
QR: QR:
'QR.personas': """ 'QR.personas': """#email:"sage";boards:jp;always"""
#email:"sage";boards:jp;always
"""
time: '%m/%d/%y(%a)%H:%M:%S' time: '%m/%d/%y(%a)%H:%M:%S'

View File

@ -46,10 +46,11 @@ class Post
if date = $ '.dateTime', info if date = $ '.dateTime', info
@nodes.date = date @nodes.date = date
@info.date = new Date date.dataset.utc * 1000 @info.date = new Date date.dataset.utc * 1000
@info.yours = QR.db.get if Conf['Quick Reply']
boardID: @board @info.yours = QR.db.get
threadID: @thread boardID: @board
postID: @ID threadID: @thread
postID: @ID
@parseComment() @parseComment()
@parseQuotes() @parseQuotes()
@ -81,29 +82,34 @@ class Post
@info.comment = text.join('').trim().replace /\s+$/gm, '' @info.comment = text.join('').trim().replace /\s+$/gm, ''
parseQuotes: -> parseQuotes: ->
quotes = {} @quotes = []
for quotelink in $$ '.quotelink', @nodes.comment for quotelink in $$ '.quotelink', @nodes.comment
# Don't add board links. (>>>/b/) @parseQuote quotelink
{hash} = quotelink return
continue unless hash
# Don't add catalog links. (>>>/b/catalog or >>>/b/search) parseQuote: (quotelink) ->
{pathname} = quotelink # Only add quotes that link to posts on an imageboard.
continue if /catalog$/.test pathname # Don't add:
# - board links. (>>>/b/)
# - catalog links. (>>>/b/catalog or >>>/b/search)
# - rules links. (>>>/a/rules)
# - text-board quotelinks. (>>>/img/1234)
return unless match = quotelink.href.match ///
boards\.4chan\.org/
([^/]+) # boardID
/res/\d+#p
(\d+) # postID
$
///
# Don't add rules links. (>>>/a/rules) @nodes.quotelinks.push quotelink
# Don't add text-board quotelinks. (>>>/img/1234)
continue if quotelink.hostname isnt 'boards.4chan.org'
@nodes.quotelinks.push quotelink # Don't count capcode replies as quotes in OPs. (Admin/Mod/Dev Replies: ...)
return if @isClone or !@isReply and $.hasClass quotelink.parentNode.parentNode, 'capcodeReplies'
# Don't count capcode replies as quotes in OPs. (Admin/Mod/Dev Replies: ...) # ES6 Set when?
continue if !@isReply and $.hasClass quotelink.parentNode.parentNode, 'capcodeReplies' fullID = "#{match[1]}.#{match[2]}"
@quotes.push fullID unless @quotes.contains fullID
# Basically, only add quotes that link to posts on an imageboard.
quotes["#{pathname.split('/')[1]}.#{hash[2..]}"] = true
return if @isClone
@quotes = Object.keys quotes
parseFile: (that) -> parseFile: (that) ->
return unless (fileEl = $ '.file', @nodes.post) and thumb = $ 'img[data-md5]', fileEl return unless (fileEl = $ '.file', @nodes.post) and thumb = $ 'img[data-md5]', fileEl

View File

@ -1,6 +1,6 @@
Report = Report =
init: -> init: ->
return unless /report/.test(location.search) and d.cookie.indexOf('pass_enabled=1') is -1 return unless /report/.test(location.search) and not d.cookie.contains 'pass_enabled=1'
$.asap (-> $.id 'recaptcha_response_field'), Report.ready $.asap (-> $.id 'recaptcha_response_field'), Report.ready
ready: -> ready: ->
field = $.id 'recaptcha_response_field' field = $.id 'recaptcha_response_field'

View File

@ -5,7 +5,7 @@ QR =
$.ready @initReady $.ready @initReady
if Conf['Persistent QR'] if Conf['Persistent QR']
unless g.BOARD.ID is 'f' unless g.BOARD.ID is 'f' and g.VIEW is 'index'
$.on d, '4chanXInitFinished', @persist $.on d, '4chanXInitFinished', @persist
else else
$.ready @persist $.ready @persist
@ -1081,8 +1081,8 @@ QR =
QR.status() QR.status()
QR.error $.el 'span', QR.error $.el 'span',
innerHTML: """ innerHTML: """
Connection error. You may have been <a href=//www.4chan.org/banned target=_blank>banned</a>. 4chan X encountered an error while posting. Please try again.
[<a href="https://github.com/MayhemYDG/4chan-x/wiki/FAQ#what-does-connection-error-you-may-have-been-banned-mean" target=_blank>FAQ</a>] [<a href="https://github.com/seaweedchan/4chan-x/wiki/Frequently-Asked-Questions#what-does-4chan-x-encountered-an-error-while-posting-please-try-again-mean" target=_blank>?</a>]
""" """
opts = opts =
cred: true cred: true