Skip to content
Browse files

Merge branch 'mayhem' into thread

  • Loading branch information...
2 parents adae29e + f1ef6df commit 5e40359eb009a9b9866bff3578dada04e910eb59 @aeosynth committed Mar 28, 2012
Showing with 30 additions and 15 deletions.
  1. +13 −7 4chan_x.user.js
  2. +1 −1 Cakefile
  3. +4 −1 changelog
  4. +1 −1 latest.js
  5. +11 −5 script.coffee
View
20 4chan_x.user.js
@@ -1,6 +1,6 @@
// ==UserScript==
// @name 4chan x
-// @version 2.29.1
+// @version 2.29.2
// @namespace aeosynth
// @description Adds various features.
// @copyright 2009-2011 James Campos <james.r.campos@gmail.com>
@@ -20,7 +20,7 @@
* Copyright (c) 2009-2011 James Campos <james.r.campos@gmail.com>
* Copyright (c) 2012 Nicolas Stepien <stepien.nicolas@gmail.com>
* http://mayhemydg.github.com/4chan-x/
- * 4chan X 2.29.1
+ * 4chan X 2.29.2
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
@@ -1228,6 +1228,7 @@
},
asyncInit: function() {
var form, iframe, link, loadChecking, script, src;
+ form = $('form[name=post]');
if (Conf['Hide Original Post Form']) {
link = $.el('h1', {
innerHTML: "<a href=javascript:;>" + (g.REPLY ? 'Quick Reply' : 'New Thread') + "</a>"
@@ -1237,7 +1238,6 @@
if (!g.REPLY) $('select', QR.el).value = 'new';
return $('textarea', QR.el).focus();
});
- form = d.forms[0];
$.before(form, link);
}
if (/chrome/i.test(navigator.userAgent)) {
@@ -1995,9 +1995,15 @@
return QR.response(data.html);
case 'status':
return QR.status(data);
+ case 'connection error':
+ return QR.error('_', $.el('a', {
+ href: '//www.4chan.org/banned',
+ target: '_blank',
+ textContent: 'Connection error, or you are banned.'
+ }));
case 'banned':
- QR.error('You are banned.', $.el('a', {
- href: 'http://www.4chan.org/banned',
+ QR.error('_', $.el('a', {
+ href: '//www.4chan.org/banned',
target: '_blank',
textContent: 'You are banned.'
}));
@@ -2073,7 +2079,7 @@
},
onerror: function() {
return QR.message.send({
- req: 'banned'
+ req: 'connection error'
});
}
};
@@ -4083,7 +4089,7 @@
if (target.nodeName === 'TABLE') return Main.node([Main.preParse(target)]);
},
namespace: '4chan_x.',
- version: '2.29.1',
+ version: '2.29.2',
callbacks: [],
css: '\
/* dialog styling */\
View
2 Cakefile
@@ -2,7 +2,7 @@
{exec} = require 'child_process'
fs = require 'fs'
-VERSION = '2.29.1'
+VERSION = '2.29.2'
HEADER = """
// ==UserScript==
View
5 changelog
@@ -1,6 +1,9 @@
master
+
+2.29.2
- Mayhem
- Now works when using https.
+ Add HTTPS support.
+ Ban support improvements and fixes.
2.29.1
- Mayhem
View
2 latest.js
@@ -1 +1 @@
-postMessage({version:'2.29.1'},'*')
+postMessage({version:'2.29.2'},'*')
View
16 script.coffee
@@ -1011,13 +1011,13 @@ QR =
setTimeout @asyncInit
asyncInit: ->
+ form = $ 'form[name=post]'
if Conf['Hide Original Post Form']
link = $.el 'h1', innerHTML: "<a href=javascript:;>#{if g.REPLY then 'Quick Reply' else 'New Thread'}</a>"
$.on $('a', link), 'click', ->
QR.open()
$('select', QR.el).value = 'new' unless g.REPLY
$('textarea', QR.el).focus()
- form = d.forms[0]
$.before form, link
# CORS is ignored for content script on Chrome, but not Safari/Oprah/Firefox.
@@ -1677,9 +1677,14 @@ QR =
QR.response data.html
when 'status'
QR.status data
+ when 'connection error'
+ QR.error '_', $.el 'a',
+ href: '//www.4chan.org/banned'
+ target: '_blank'
+ textContent: 'Connection error, or you are banned.'
when 'banned'
- QR.error 'You are banned.', $.el 'a',
- href: 'http://www.4chan.org/banned'
+ QR.error '_', $.el 'a',
+ href: '//www.4chan.org/banned'
target: '_blank'
textContent: 'You are banned.'
# Disable iframe reloading
@@ -1743,8 +1748,9 @@ QR =
req: 'response'
html: @response
onerror: ->
+ # Connection error, or
# CORS disabled error: redirecting to banned page ;_;
- QR.message.send req: 'banned'
+ QR.message.send req: 'connection error'
opts =
form: form
type: 'post'
@@ -3429,7 +3435,7 @@ Main =
Main.node [Main.preParse target] if target.nodeName is 'TABLE'
namespace: '4chan_x.'
- version: '2.29.1'
+ version: '2.29.2'
callbacks: []
css: '
/* dialog styling */

0 comments on commit 5e40359

Please sign in to comment.
Something went wrong with that request. Please try again.