Bump to version 2.21.0, add stable updaptes to the master branch.

This commit is contained in:
Nicolas Stepien 2011-11-26 23:34:01 +01:00
parent 7c103f99f2
commit 8862e3dbcc
4 changed files with 33 additions and 8 deletions

View File

@ -1,5 +1,6 @@
// ==UserScript== // ==UserScript==
// @name 4chan x // @name 4chan x
// @version 2.21.0
// @namespace aeosynth // @namespace aeosynth
// @description Adds various features. // @description Adds various features.
// @copyright 2009-2011 James Campos <james.r.campos@gmail.com> // @copyright 2009-2011 James Campos <james.r.campos@gmail.com>
@ -13,7 +14,8 @@
/* LICENSE /* LICENSE
* *
* Copyright (c) 2009-2011 James Campos <james.r.campos@gmail.com> * Copyright (c) 2009-2011 James Campos <james.r.campos@gmail.com>
* http://aeosynth.github.com/4chan-x/ * http://mayhemydg.github.com/4chan-x/
* 4chan x 2.21.0
* *
* Permission is hereby granted, free of charge, to any person * Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation * obtaining a copy of this software and associated documentation
@ -64,7 +66,7 @@
*/ */
(function() { (function() {
var $, $$, DAY, Favicon, HOUR, MINUTE, Main, NAMESPACE, Recaptcha, SECOND, Time, anonymize, conf, config, cooldown, d, expandComment, expandThread, filter, flatten, g, getTitle, imgExpand, imgGif, imgHover, key, keybinds, log, nav, options, qr, quoteBacklink, quoteInline, quoteOP, quotePreview, redirect, replyHiding, reportButton, revealSpoilers, sauce, strikethroughQuotes, threadHiding, threadStats, threading, titlePost, ui, unread, updater, val, watcher; var $, $$, DAY, Favicon, HOUR, MINUTE, Main, NAMESPACE, Recaptcha, SECOND, Time, VERSION, anonymize, conf, config, cooldown, d, expandComment, expandThread, filter, flatten, g, getTitle, imgExpand, imgGif, imgHover, key, keybinds, log, nav, options, qr, quoteBacklink, quoteInline, quoteOP, quotePreview, redirect, replyHiding, reportButton, revealSpoilers, sauce, strikethroughQuotes, threadHiding, threadStats, threading, titlePost, ui, unread, updater, val, watcher;
var __slice = Array.prototype.slice; var __slice = Array.prototype.slice;
config = { config = {
@ -77,7 +79,8 @@
'Comment Expansion': [true, 'Expand too long comments'], 'Comment Expansion': [true, 'Expand too long comments'],
'Thread Expansion': [true, 'View all replies'], 'Thread Expansion': [true, 'View all replies'],
'Index Navigation': [true, 'Navigate to previous / next thread'], 'Index Navigation': [true, 'Navigate to previous / next thread'],
'Reply Navigation': [false, 'Navigate to top / bottom of thread'] 'Reply Navigation': [false, 'Navigate to top / bottom of thread'],
'Check for Updates': [true, 'Check for updated versions of 4chan X']
}, },
Filtering: { Filtering: {
'Anonymize': [false, 'Make everybody anonymous'], 'Anonymize': [false, 'Make everybody anonymous'],
@ -208,6 +211,8 @@
NAMESPACE = '4chan_x.'; NAMESPACE = '4chan_x.';
VERSION = '2.21.0';
SECOND = 1000; SECOND = 1000;
MINUTE = 60 * SECOND; MINUTE = 60 * SECOND;
@ -2963,6 +2968,11 @@
$.addStyle(Main.css); $.addStyle(Main.css);
threading.init(); threading.init();
Favicon.init(); Favicon.init();
if (Main.reqUpdate && conf['Check for Updates']) {
$.add(d.head, $.el('script', {
src: 'https://raw.github.com/mayhemydg/4chan-x/master/latest.js'
}));
}
if ((form = $('form[name=post]')) && (canPost = !!$('#recaptcha_response_field'))) { if ((form = $('form[name=post]')) && (canPost = !!$('#recaptcha_response_field'))) {
Recaptcha.init(); Recaptcha.init();
if (g.REPLY && conf['Auto Watch Reply'] && conf['Thread Watcher']) { if (g.REPLY && conf['Auto Watch Reply'] && conf['Thread Watcher']) {
@ -3013,9 +3023,13 @@
return options.init(); return options.init();
}, },
message: function(e) { message: function(e) {
var data, origin; var data, location, origin;
origin = e.origin, data = e.data; origin = e.origin, data = e.data;
if (origin === 'http://sys.4chan.org') return qr.message(data); if (origin === 'http://sys.4chan.org') {
return qr.message(data);
} else if (data.version !== VERSION && confirm('An updated version of 4chan X is available, would you like to install it now?')) {
return location = "https://raw.github.com/mayhemydg/4chan-x/" + data.version + "/4chan_x.user.js";
}
}, },
node: function(e) { node: function(e) {
var callback, target, _i, _len, _ref, _results; var callback, target, _i, _len, _ref, _results;

View File

@ -2,9 +2,12 @@
{exec} = require 'child_process' {exec} = require 'child_process'
fs = require 'fs' fs = require 'fs'
VERSION = '2.21.0'
HEADER = """ HEADER = """
// ==UserScript== // ==UserScript==
// @name 4chan x // @name 4chan x
// @version #{VERSION}
// @namespace aeosynth // @namespace aeosynth
// @description Adds various features. // @description Adds various features.
// @copyright 2009-2011 James Campos <james.r.campos@gmail.com> // @copyright 2009-2011 James Campos <james.r.campos@gmail.com>
@ -18,7 +21,8 @@ HEADER = """
/* LICENSE /* LICENSE
* *
* Copyright (c) 2009-2011 James Campos <james.r.campos@gmail.com> * Copyright (c) 2009-2011 James Campos <james.r.campos@gmail.com>
* http://aeosynth.github.com/4chan-x/ * http://mayhemydg.github.com/4chan-x/
* 4chan x #{VERSION}
* *
* Permission is hereby granted, free of charge, to any person * Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation * obtaining a copy of this software and associated documentation

View File

@ -1,4 +1,6 @@
master master
2.21.0
- mayhem - mayhem
initiate 4chan X earlier initiate 4chan X earlier
performance improvements performance improvements
@ -7,8 +9,6 @@ master
automatically reload expanded pictures on error automatically reload expanded pictures on error
handle bans with the thread updater handle bans with the thread updater
use unread favicons by ferongr use unread favicons by ferongr
- aeosynth
quick reply redesign
2.20.3 2.20.3
- mayhem - mayhem

View File

@ -9,6 +9,7 @@ config =
'Thread Expansion': [true, 'View all replies'] 'Thread Expansion': [true, 'View all replies']
'Index Navigation': [true, 'Navigate to previous / next thread'] 'Index Navigation': [true, 'Navigate to previous / next thread']
'Reply Navigation': [false, 'Navigate to top / bottom of thread'] 'Reply Navigation': [false, 'Navigate to top / bottom of thread']
'Check for Updates': [true, 'Check for updated versions of 4chan X']
Filtering: Filtering:
'Anonymize': [false, 'Make everybody anonymous'] 'Anonymize': [false, 'Make everybody anonymous']
'Filter': [false, 'Self-moderation placebo'] 'Filter': [false, 'Self-moderation placebo']
@ -121,6 +122,7 @@ conf = {}
) null, config ) null, config
NAMESPACE = '4chan_x.' NAMESPACE = '4chan_x.'
VERSION = '2.21.0'
SECOND = 1000 SECOND = 1000
MINUTE = 60*SECOND MINUTE = 60*SECOND
HOUR = 60*MINUTE HOUR = 60*MINUTE
@ -2319,6 +2321,9 @@ Main =
threading.init() threading.init()
Favicon.init() Favicon.init()
if Main.reqUpdate and conf['Check for Updates']
$.add d.head, $.el 'script', src: 'https://raw.github.com/mayhemydg/4chan-x/master/latest.js'
#recaptcha may be blocked, eg by noscript #recaptcha may be blocked, eg by noscript
if (form = $ 'form[name=post]') and (canPost = !!$ '#recaptcha_response_field') if (form = $ 'form[name=post]') and (canPost = !!$ '#recaptcha_response_field')
Recaptcha.init() Recaptcha.init()
@ -2397,6 +2402,8 @@ Main =
{origin, data} = e {origin, data} = e
if origin is 'http://sys.4chan.org' if origin is 'http://sys.4chan.org'
qr.message data qr.message data
else if data.version isnt VERSION and confirm 'An updated version of 4chan X is available, would you like to install it now?'
location = "https://raw.github.com/mayhemydg/4chan-x/#{data.version}/4chan_x.user.js"
node: (e) -> node: (e) ->
{target} = e {target} = e