diff --git a/CHANGELOG.md b/CHANGELOG.md index e56944521..7ce41cb71 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,9 @@ The links to individual versions below are to copies of the script with the upda ### v1.10.14 +**v1.10.14.3** *(2015-06-16)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.14.3/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.14.3/builds/4chan-X-noupdate.crx "Chromium version")] +- Fix words being cut off in non-Javascript captcha. + **v1.10.14.2** *(2015-06-11)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.14.2/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.14.2/builds/4chan-X-noupdate.crx "Chromium version")] - Bring back workaround for scrolling to top caused by captcha as some users are still reporting it happening. diff --git a/Gruntfile.coffee b/Gruntfile.coffee index 49959fe56..f95978860 100755 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -8,6 +8,12 @@ module.exports = (grunt) -> json = (data) -> "`#{JSON.stringify(data).replace(/`/g, '\\`')}`" + importCSS = (filenames...) -> + grunt.template.process( + filenames.map((name) -> grunt.file.read "src/General/css/#{name}.css").join(''), + {data: grunt.config 'pkg'} + ).trim().replace(/\n+/g, '\n').split(/^/m).map(JSON.stringify).join(' +\n').replace(/`/g, '\\`') + importHTML = (filename) -> html grunt.template.process(grunt.file.read("src/General/html/#{filename}.html").replace(/^ +/gm, '').replace(/\r?\n/g, ''), data: grunt.config('pkg')) @@ -69,6 +75,7 @@ module.exports = (grunt) -> options: process: Object.create(null, data: get: -> pkg = grunt.config 'pkg' + pkg.importCSS = importCSS pkg.importHTML = importHTML pkg.html = html pkg.assert = assert diff --git a/package.json b/package.json index 7acbc69d4..fe05eb37d 100755 --- a/package.json +++ b/package.json @@ -21,6 +21,8 @@ "*://sys.4chan.org/*", "*://a.4cdn.org/*", "*://i.4cdn.org/*", + "*://www.4chan.org/banned", + "*://www.4chan.org/feedback", "https://www.google.com/recaptcha/api2/anchor?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc*", "https://www.google.com/recaptcha/api2/frame?*&k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc*", "*://www.google.com/recaptcha/api/fallback?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc" diff --git a/src/General/Main.coffee b/src/General/Main.coffee index b0e6fcd5e..c5a6fdf47 100755 --- a/src/General/Main.coffee +++ b/src/General/Main.coffee @@ -9,6 +9,10 @@ Main = $.ready -> Captcha.fixes.init() return + if location.hostname is 'www.4chan.org' + $.onExists d.documentElement, 'body', false, -> $.addStyle Main.cssWWW + return + g.threads = new SimpleDict() g.posts = new SimpleDict() @@ -301,14 +305,9 @@ Main = $.ready -> cb() if Main.isThisPageLegit() - css: `<%= - grunt.template.process( - ['font-awesome', 'style', 'yotsuba', 'yotsuba-b', 'futaba', 'burichan', 'tomorrow', 'photon'].map(function(name) { - return grunt.file.read('src/General/css/'+name+'.css'); - }).join(''), - {data: {type: type}} - ).trim().replace(/\n+/g, '\n').split(/^/m).map(JSON.stringify).join(' +\n').replace(/`/g, '\\`') - %>` + css: `<%= importCSS('font-awesome', 'noscript', 'style', 'yotsuba', 'yotsuba-b', 'futaba', 'burichan', 'tomorrow', 'photon') %>` + + cssWWW: `<%= importCSS('noscript', 'www') %>` features: [ ['Polyfill', Polyfill] diff --git a/src/General/css/noscript.css b/src/General/css/noscript.css new file mode 100644 index 000000000..648d901f3 --- /dev/null +++ b/src/General/css/noscript.css @@ -0,0 +1,3 @@ +noscript div:first-child, noscript iframe { + height: 422px !important; +} diff --git a/src/General/css/report.css b/src/General/css/report.css new file mode 100644 index 000000000..7dbe0134f --- /dev/null +++ b/src/General/css/report.css @@ -0,0 +1,3 @@ +:root:not(.js-enabled) #g-recaptcha { + height: auto; +} diff --git a/src/General/css/www.css b/src/General/css/www.css new file mode 100644 index 000000000..01b12c399 --- /dev/null +++ b/src/General/css/www.css @@ -0,0 +1,3 @@ +#captcha-cnt { + height: auto; +} diff --git a/src/Miscellaneous/Report.coffee b/src/Miscellaneous/Report.coffee index 2ebd665d1..33f8e3d93 100755 --- a/src/Miscellaneous/Report.coffee +++ b/src/Miscellaneous/Report.coffee @@ -1,9 +1,5 @@ Report = - css: ''' - :root:not(.js-enabled) #g-recaptcha { - height: auto; - } - ''' + css: `<%= importCSS('noscript', 'report') %>` init: -> return unless /\bmode=report\b/.test(location.search) and match = location.search.match /\bno=(\d+)/