From d5c825c683af7ba4d460824ffbd1bdbb817aa36a Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Mon, 2 Jul 2012 09:55:25 +0200 Subject: [PATCH 1/2] Add Country filtering. --- 4chan_x.user.js | 9 +++++++++ changelog | 2 ++ script.coffee | 8 ++++++++ 3 files changed, 19 insertions(+) diff --git a/4chan_x.user.js b/4chan_x.user.js index 2d9e350c9..7f446d3df 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -151,6 +151,7 @@ email: ['# Filter any e-mails that are not `sage` on /a/ and /jp/:', '#/^(?!sage$)/;boards:a,jp'].join('\n'), subject: ['# Filter Generals on /v/:', '#/general/i;boards:v;op:only'].join('\n'), comment: ['# Filter Stallman copypasta on /g/:', '#/what you\'re refer+ing to as linux/i;boards:g'].join('\n'), + country: [''].join('\n'), filename: [''].join('\n'), dimensions: ['# Highlight potential wallpapers:', '#/1920x1080/;op:yes;highlight;top:no;boards:w,wg'].join('\n'), filesize: [''].join('\n'), @@ -701,6 +702,13 @@ } return text.join(''); }, + country: function(post) { + var flag; + if (flag = $('.countryFlag', post.el)) { + return flag.title.replace('Country: ', ''); + } + return false; + }, filename: function(post) { var file, fileInfo; fileInfo = post.fileInfo; @@ -2322,6 +2330,7 @@ \ \ \ + \ \ \ \ diff --git a/changelog b/changelog index 26ea54032..772521b37 100644 --- a/changelog +++ b/changelog @@ -1,4 +1,6 @@ master +- Mayhem + Add Country filtering. 2.33.7 - Mayhem diff --git a/script.coffee b/script.coffee index 37daa2bc1..9bfabe127 100644 --- a/script.coffee +++ b/script.coffee @@ -86,6 +86,9 @@ Config = '# Filter Stallman copypasta on /g/:' '#/what you\'re refer+ing to as linux/i;boards:g' ].join '\n' + country: [ + '' + ].join '\n' filename: [ '' ].join '\n' @@ -552,6 +555,10 @@ Filter = for i in [0...nodes.snapshotLength] text.push if data = nodes.snapshotItem(i).data then data else '\n' text.join '' + country: (post) -> + if flag = $ '.countryFlag', post.el + return flag.title.replace 'Country: ', '' + false filename: (post) -> {fileInfo} = post if fileInfo and file = $ '.fileText > span', fileInfo @@ -1778,6 +1785,7 @@ Options = + From 1b24f4460611962ce8d24b68aefacc054ec104c4 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Mon, 2 Jul 2012 09:56:48 +0200 Subject: [PATCH 2/2] Release 2.33.8. --- 4chan_x.user.js | 6 +++--- Cakefile | 2 +- changelog | 2 ++ latest.js | 2 +- script.coffee | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 7f446d3df..dd207a56b 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan x -// @version 2.33.7 +// @version 2.33.8 // @namespace aeosynth // @description Adds various features. // @copyright 2009-2011 James Campos @@ -23,7 +23,7 @@ * Copyright (c) 2009-2011 James Campos * Copyright (c) 2012 Nicolas Stepien * http://mayhemydg.github.com/4chan-x/ - * 4chan X 2.33.7 + * 4chan X 2.33.8 * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation @@ -4752,7 +4752,7 @@ return $.globalEval(("(" + code + ")()").replace('_id_', bq.id)); }, namespace: '4chan_x.', - version: '2.33.7', + version: '2.33.8', callbacks: [], css: '\ /* dialog styling */\ diff --git a/Cakefile b/Cakefile index 27d2af83a..125f4875c 100644 --- a/Cakefile +++ b/Cakefile @@ -2,7 +2,7 @@ {exec} = require 'child_process' fs = require 'fs' -VERSION = '2.33.7' +VERSION = '2.33.8' HEADER = """ // ==UserScript== diff --git a/changelog b/changelog index 772521b37..8e462e5c9 100644 --- a/changelog +++ b/changelog @@ -1,4 +1,6 @@ master + +2.33.8 - Mayhem Add Country filtering. diff --git a/latest.js b/latest.js index e1bebce4c..1926a62fe 100644 --- a/latest.js +++ b/latest.js @@ -1 +1 @@ -postMessage({version:'2.33.7'},'*') \ No newline at end of file +postMessage({version:'2.33.8'},'*') \ No newline at end of file diff --git a/script.coffee b/script.coffee index 9bfabe127..b221a1fc9 100644 --- a/script.coffee +++ b/script.coffee @@ -3668,7 +3668,7 @@ Main = $.globalEval "(#{code})()".replace '_id_', bq.id namespace: '4chan_x.' - version: '2.33.7' + version: '2.33.8' callbacks: [] css: ' /* dialog styling */