diff --git a/CHANGELOG.md b/CHANGELOG.md index 84f062a09..0bd7d2103 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ seaweedchan: - Chrome doesn't get .null, so don't style it - Fix count when auto update is disabled and set updater text to "Update" +- Remove /v/ and /vg/ redirection. See https://archive.foolz.us/foolz/thread/509388/ for news and how you can donate to bring /v/ and /vg/ archiving back. + +MayhemYDG: +- Fix Unread Count taking into account hidden posts. ### 1.1.2 - 2013-04-26 seaweedchan: diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 000000000..d2ce937a1 --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,210 @@ +module.exports = function(grunt) { + + var pkg = grunt.file.readJSON('package.json'); + var concatOptions = { + process: { + data: pkg + } + }; + var shellOptions = { + stdout: true, + stderr: true, + failOnError: true + }; + + // Project configuration. + grunt.initConfig({ + pkg: pkg, + concat: { + coffee: { + options: concatOptions, + src: [ + 'src/General/Config.coffee', + 'src/General/Globals.coffee', + 'lib/**/*', + 'src/General/UI.coffee', + 'src/General/Header.coffee', + 'src/General/Notification.coffee', + 'src/General/Settings.coffee', + 'src/General/Get.coffee', + 'src/General/Build.coffee', + // Features --> + 'src/Filtering/**/*', + 'src/Quotelinks/**/*', + 'src/Posting/**/*', + 'src/Images/**/*', + 'src/Menu/**/*', + 'src/Monitoring/**/*', + 'src/Archive/**/*', + 'src/Miscellaneous/**/*', + // <--| + 'src/General/Board.coffee', + 'src/General/Thread.coffee', + 'src/General/Post.coffee', + 'src/General/Clone.coffee', + 'src/General/DataBoard.coffee', + 'src/General/Main.coffee' + ], + dest: 'tmp-<%= pkg.type %>/script.coffee' + }, + crx: { + options: concatOptions, + files: { + 'builds/crx/manifest.json': 'src/Meta/manifest.json', + 'builds/crx/script.js': [ + 'src/Meta/banner.js', + 'tmp-<%= pkg.type %>/script.js' + ] + } + }, + userjs: { + options: concatOptions, + src: [ + 'src/Meta/metadata.js', + 'src/Meta/banner.js', + 'tmp-<%= pkg.type %>/script.js' + ], + dest: 'builds/<%= pkg.name %>.js' + }, + userscript: { + options: concatOptions, + files: { + 'builds/<%= pkg.name %>.meta.js': 'src/Meta/metadata.js', + 'builds/<%= pkg.name %>.user.js': [ + 'src/Meta/metadata.js', + 'src/Meta/banner.js', + 'tmp-<%= pkg.type %>/script.js' + ] + } + } + }, + copy: { + crx: { + src: 'img/*.png', + dest: 'builds/crx/', + expand: true, + flatten: true + } + }, + coffee: { + script: { + src: 'tmp-<%= pkg.type %>/script.coffee', + dest: 'tmp-<%= pkg.type %>/script.js' + } + }, + concurrent: { + build: ['build-crx', 'build-userjs', 'build-userscript'] + }, + shell: { + commit: { + options: shellOptions, + command: [ + 'git checkout <%= pkg.meta.mainBranch %>', + 'git commit -am "Release <%= pkg.meta.name %> v<%= pkg.version %>."', + 'git tag -a <%= pkg.version %> -m "<%= pkg.meta.name %> v<%= pkg.version %>."', + 'git tag -af stable-v3 -m "<%= pkg.meta.name %> v<%= pkg.version %>."' + ].join(' && ') + }, + push: { + options: shellOptions, + command: 'git push origin --tags -f && git push origin --all' + } + }, + watch: { + all: { + options: { + interrupt: true + }, + files: [ + 'Gruntfile.js', + 'package.json', + 'lib/**/*', + 'src/**/*', + 'html/**/*', + 'css/**/*', + 'img/**/*' + ], + tasks: 'build' + } + }, + compress: { + crx: { + options: { + archive: 'builds/<%= pkg.name %>.zip', + level: 9, + pretty: true + }, + expand: true, + flatten: true, + src: 'builds/crx/*', + dest: '/' + } + }, + clean: { + builds: 'builds', + tmpcrx: 'tmp-crx', + tmpuserjs: 'tmp-userjs', + tmpuserscript: 'tmp-userscript' + } + }); + + grunt.loadNpmTasks('grunt-bump'); + grunt.loadNpmTasks('grunt-concurrent'); + grunt.loadNpmTasks('grunt-contrib-clean'); + grunt.loadNpmTasks('grunt-contrib-coffee'); + grunt.loadNpmTasks('grunt-contrib-compress'); + grunt.loadNpmTasks('grunt-contrib-concat'); + grunt.loadNpmTasks('grunt-contrib-copy'); + grunt.loadNpmTasks('grunt-contrib-watch'); + grunt.loadNpmTasks('grunt-shell'); + + grunt.registerTask('default', ['build']); + + grunt.registerTask('set-build', 'Set the build type variable', function(type) { + pkg.type = type; + grunt.log.ok('pkg.type = %s', type); + }); + grunt.registerTask('build', ['concurrent:build']); + grunt.registerTask('build-crx', [ + 'set-build:crx', + 'concat:coffee', + 'coffee:script', + 'concat:crx', + 'copy:crx', + 'clean:tmpcrx' + ]); + grunt.registerTask('build-userjs', [ + 'set-build:userjs', + 'concat:coffee', + 'coffee:script', + 'concat:userjs', + 'clean:tmpuserjs' + ]); + grunt.registerTask('build-userscript', [ + 'set-build:userscript', + 'concat:coffee', + 'coffee:script', + 'concat:userscript', + 'clean:tmpuserscript' + ]); + + grunt.registerTask('release', ['shell:commit', 'shell:push', 'build-crx', 'compress:crx']); + grunt.registerTask('patch', ['bump', 'reloadPkg', 'updcl:3', 'release']); + grunt.registerTask('minor', ['bump:minor', 'reloadPkg', 'updcl:2', 'release']); + grunt.registerTask('major', ['bump:major', 'reloadPkg', 'updcl:1', 'release']); + + grunt.registerTask('reloadPkg', 'Reload the package', function() { + // Update the `pkg` object with the new version. + pkg = grunt.file.readJSON('package.json'); + grunt.config.data.pkg = concatOptions.process.data = pkg; + grunt.log.ok('pkg reloaded.'); + }); + + grunt.registerTask('updcl', 'Update the changelog', function(i) { + // i is the number of #s for markdown. + var version = new Array(+i + 1).join('#') + ' ' + pkg.version + ' - *' + grunt.template.today('yyyy-mm-dd') + '*'; + grunt.file.write('CHANGELOG.md', version + '\n\n' + grunt.file.read('CHANGELOG.md')); + grunt.log.ok('Changelog updated for v' + pkg.version + '.'); + }); + +}; diff --git a/builds/4chan-X.zip b/builds/4chan-X.zip new file mode 100644 index 000000000..1c356996c Binary files /dev/null and b/builds/4chan-X.zip differ diff --git a/package.json b/package.json index 664aaba78..4b27b5149 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "grunt-contrib-clean": "~0.4.1", "grunt-contrib-coffee": "~0.7.0", "grunt-contrib-compress": "~0.5.0", - "grunt-contrib-concat": "~0.2.0", + "grunt-contrib-concat": "~0.3.0", "grunt-contrib-copy": "~0.4.1", "grunt-contrib-watch": "~0.3.1", "grunt-shell": "~0.2.2" diff --git a/src/Archive/Redirect.coffee b/src/Archive/Redirect.coffee index c3ecd3b6c..b51e8878a 100644 --- a/src/Archive/Redirect.coffee +++ b/src/Archive/Redirect.coffee @@ -9,7 +9,7 @@ Redirect = image: (boardID, filename) -> # Do not use g.BOARD, the image url can originate from a cross-quote. switch boardID - when 'a', 'gd', 'jp', 'm', 'q', 'tg', 'vg', 'vp', 'vr', 'wsg' + when 'a', 'gd', 'jp', 'm', 'q', 'tg', 'vp', 'vr', 'wsg' "//archive.foolz.us/#{boardID}/full_image/#{filename}" when 'u' "//nsfw.foolz.us/#{boardID}/full_image/#{filename}" @@ -61,7 +61,7 @@ Redirect = archiver: 'Foolz': base: 'https://archive.foolz.us' - boards: ['a', 'co', 'gd', 'jp', 'm', 'q', 'sp', 'tg', 'tv', 'v', 'vg', 'vp', 'vr', 'wsg'] + boards: ['a', 'co', 'gd', 'jp', 'm', 'q', 'sp', 'tg', 'tv', 'vp', 'vr', 'wsg'] type: 'foolfuuka' 'NSFWFoolz': base: 'https://nsfw.foolz.us' @@ -130,4 +130,4 @@ Redirect = "##{postID}" else "#p#{postID}" - "#{base}/#{path}" \ No newline at end of file + "#{base}/#{path}" diff --git a/src/General/Header.coffee b/src/General/Header.coffee index 543c444e6..7cd7f0ce6 100644 --- a/src/General/Header.coffee +++ b/src/General/Header.coffee @@ -285,4 +285,4 @@ Header = createNotification: (e) -> {type, content, lifetime, cb} = e.detail notif = new Notification type, content, lifetime - cb notif if cb \ No newline at end of file + cb notif if cb diff --git a/src/General/Settings.coffee b/src/General/Settings.coffee index 6af221f15..dece80cf2 100644 --- a/src/General/Settings.coffee +++ b/src/General/Settings.coffee @@ -47,20 +47,7 @@ Settings = $.event 'CloseMenu' html = """ - -
+ <%= grunt.file.read('src/General/html/Settings/Settings.html').replace(/>\s+<').trim() %> """ Settings.overlay = overlay = $.el 'div', @@ -297,22 +284,7 @@ Settings = filter: (section) -> section.innerHTML = """ - -
+ <%= grunt.file.read('src/General/html/Settings/Filter-guide.html').replace(/>\s+<').trim() %> """ select = $ 'select', section $.on select, 'change', Settings.selectFilter @@ -331,49 +303,12 @@ Settings = $.add div, ta return div.innerHTML = """ -
Filter is disabled.
-

- Use regular expressions, one per line.
- Lines starting with a # will be ignored.
- For example, /weeaboo/i will filter posts containing the string `weeaboo`, case-insensitive.
- MD5 filtering uses exact string matching, not regular expressions. -

- + <%= grunt.file.read('src/General/html/Settings/Filter-select.html').replace(/>\s+<').trim() %> """ sauce: (section) -> section.innerHTML = """ -
Sauce is disabled.
-
Lines starting with a # will be ignored.
-
You can specify a display text by appending ;text:[text] to the URL.
- - + <%= grunt.file.read('src/General/html/Settings/Sauce.html').replace(/>\s+<').trim() %> """ sauce = $ 'textarea', section $.get 'sauces', Conf['sauces'], (item) -> @@ -382,102 +317,7 @@ Settings = advanced: (section) -> section.innerHTML = """ -
- Archiver - Select an Archiver for this board: - -
-
- Custom Board Navigation -
-
In the following, board can translate to a board ID (a, b, etc...), the current board (current), or the Status/Twitter link (status, @).
-
- For example:
- [ toggle-all ] [current-title] [g-title / a-title / jp-title] [x / wsg / h] [t-text:"Piracy"]
- will give you
- [ + ] [Technology] [Technology / Anime & Manga / Otaku Culture] [x / wsg / h] [Piracy]
- if you are on /g/. -
-
Board link: board
-
Title link: board-title
-
Board link (Replace with title when on that board): board-replace
-
Full text link: board-full
-
Custom text link: board-text:"VIP Board"
-
Index-only link: board-index
-
Catalog-only link: board-catalog
-
Combinations are possible: board-index-text:"VIP Index"
-
Full board list toggle: toggle-all
-
- -
- Time Formatting is disabled. -
:
-
Supported format specifiers:
-
Day: %a, %A, %d, %e
-
Month: %m, %b, %B
-
Year: %y
-
Hour: %k, %H, %l, %I, %p, %P
-
Minute: %M
-
Second: %S
-
- -
- Quote Backlinks formatting is disabled. -
:
-
- -
- File Info Formatting is disabled. -
:
-
Link: %l (truncated), %L (untruncated), %T (Unix timestamp)
-
Original file name: %n (truncated), %N (untruncated), %t (Unix timestamp)
-
Spoiler indicator: %p
-
Size: %B (Bytes), %K (KB), %M (MB), %s (4chan default)
-
Resolution: %r (Displays 'PDF' for PDF files)
-
- -
- Unread Favicon is disabled. - - -
- -
- Emoji is disabled. -
- Sage Icon: - -
-
- Position: -
-
- -
- Thread Updater is disabled. -
- Interval: -
-
- -
- - - - - -
+ <%= grunt.file.read('src/General/html/Settings/Advanced.html').replace(/>\s+<').trim() %> """ items = {} inputs = {} @@ -523,7 +363,7 @@ Settings = funk = Time.createFunc @value @nextElementSibling.textContent = funk Time, new Date() backlink: -> - @nextElementSibling.textContent = Conf['backlink'].replace /%id/, '123456789' + @nextElementSibling.textContent = @value.replace /%id/, '123456789' fileInfo: -> data = isReply: true @@ -561,12 +401,7 @@ Settings = keybinds: (section) -> section.innerHTML = """ -
Keybinds are disabled.
-
Allowed keys: a-z, 0-9, Ctrl, Shift, Alt, Meta, Enter, Esc, Up, Down, Right, Left.
-
Press Backspace to disable a keybind.
- - -
ActionsKeybinds
+ <%= grunt.file.read('src/General/html/Settings/Keybinds.html').replace(/>\s+<').trim() %> """ tbody = $ 'tbody', section items = {} @@ -591,4 +426,4 @@ Settings = e.stopPropagation() return unless (key = Keybinds.keyCode e)? @value = key - $.cb.value.call @ \ No newline at end of file + $.cb.value.call @ diff --git a/src/General/html/Features/QuickReply.html b/src/General/html/Features/QuickReply.html new file mode 100644 index 000000000..8c13b41a7 --- /dev/null +++ b/src/General/html/Features/QuickReply.html @@ -0,0 +1,38 @@ +
+ + × + +
+
+
+ + + + +
+
+ + +
+
+
+ + +
+
+ + No selected file + + + × + +
+ + +
\ No newline at end of file diff --git a/src/General/html/Settings/Advanced.html b/src/General/html/Settings/Advanced.html new file mode 100644 index 000000000..8cc598eef --- /dev/null +++ b/src/General/html/Settings/Advanced.html @@ -0,0 +1,96 @@ +
+ Archiver + Select an Archiver for this board: + +
+
+ Custom Board Navigation +
+
In the following, board can translate to a board ID (a, b, etc...), the current board (current), or the Status/Twitter link (status, @).
+
+ For example:
+ [ toggle-all ] [current-title] [g-title / a-title / jp-title] [x / wsg / h] [t-text:"Piracy"]
+ will give you
+ [ + ] [Technology] [Technology / Anime & Manga / Otaku Culture] [x / wsg / h] [Piracy]
+ if you are on /g/. +
+
Board link: board
+
Title link: board-title
+
Board link (Replace with title when on that board): board-replace
+
Full text link: board-full
+
Custom text link: board-text:"VIP Board"
+
Index-only link: board-index
+
Catalog-only link: board-catalog
+
Combinations are possible: board-index-text:"VIP Index"
+
Full board list toggle: toggle-all
+
+ +
+ Time Formatting is disabled. +
:
+
Supported format specifiers:
+
Day: %a, %A, %d, %e
+
Month: %m, %b, %B
+
Year: %y
+
Hour: %k, %H, %l, %I, %p, %P
+
Minute: %M
+
Second: %S
+
+ +
+ Quote Backlinks formatting is disabled. +
:
+
+ +
+ File Info Formatting is disabled. +
:
+
Link: %l (truncated), %L (untruncated), %T (Unix timestamp)
+
Original file name: %n (truncated), %N (untruncated), %t (Unix timestamp)
+
Spoiler indicator: %p
+
Size: %B (Bytes), %K (KB), %M (MB), %s (4chan default)
+
Resolution: %r (Displays 'PDF' for PDF files)
+
+ +
+ Unread Favicon is disabled. + + +
+ +
+ Emoji is disabled. +
+ Sage Icon: + +
+
+ Position: +
+
+ +
+ Thread Updater is disabled. +
+ Interval: +
+
+ +
+ + + + + +
\ No newline at end of file diff --git a/src/General/html/Settings/Filter-guide.html b/src/General/html/Settings/Filter-guide.html new file mode 100644 index 000000000..3e50d37e3 --- /dev/null +++ b/src/General/html/Settings/Filter-guide.html @@ -0,0 +1,29 @@ +
Filter is disabled.
+

+ Use regular expressions, one per line.
+ Lines starting with a # will be ignored.
+ For example, /weeaboo/i will filter posts containing the string `weeaboo`, case-insensitive.
+ MD5 filtering uses exact string matching, not regular expressions. +

+ \ No newline at end of file diff --git a/src/General/html/Settings/Filter-select.html b/src/General/html/Settings/Filter-select.html new file mode 100644 index 000000000..b65eb3d05 --- /dev/null +++ b/src/General/html/Settings/Filter-select.html @@ -0,0 +1,16 @@ + +
\ No newline at end of file diff --git a/src/General/html/Settings/Keybinds.html b/src/General/html/Settings/Keybinds.html new file mode 100644 index 000000000..e8c29434c --- /dev/null +++ b/src/General/html/Settings/Keybinds.html @@ -0,0 +1,6 @@ +
Keybinds are disabled.
+
Allowed keys: a-z, 0-9, Ctrl, Shift, Alt, Meta, Enter, Esc, Up, Down, Right, Left.
+
Press Backspace to disable a keybind.
+ + +
ActionsKeybinds
\ No newline at end of file diff --git a/src/General/html/Settings/Sauce.html b/src/General/html/Settings/Sauce.html new file mode 100644 index 000000000..d4e9df83c --- /dev/null +++ b/src/General/html/Settings/Sauce.html @@ -0,0 +1,10 @@ +
Sauce is disabled.
+
Lines starting with a # will be ignored.
+
You can specify a display text by appending ;text:[text] to the URL.
+ + \ No newline at end of file diff --git a/src/General/html/Settings/Settings.html b/src/General/html/Settings/Settings.html new file mode 100644 index 000000000..b7012a19e --- /dev/null +++ b/src/General/html/Settings/Settings.html @@ -0,0 +1,14 @@ + +
\ No newline at end of file diff --git a/src/Monitoring/ThreadUpdater.coffee b/src/Monitoring/ThreadUpdater.coffee index 6e696b7f6..0341c19c9 100644 --- a/src/Monitoring/ThreadUpdater.coffee +++ b/src/Monitoring/ThreadUpdater.coffee @@ -321,4 +321,4 @@ ThreadUpdater = deletedPosts: deletedPosts deletedFiles: deletedFiles postCount: OP.replies + 1 - fileCount: OP.images + (!!ThreadUpdater.thread.OP.file and !ThreadUpdater.thread.OP.file.isDead) \ No newline at end of file + fileCount: OP.images + (!!ThreadUpdater.thread.OP.file and !ThreadUpdater.thread.OP.file.isDead) diff --git a/src/Posting/QR.coffee b/src/Posting/QuickReply.coffee similarity index 95% rename from src/Posting/QR.coffee rename to src/Posting/QuickReply.coffee index b60fe2fec..198391aaa 100644 --- a/src/Posting/QR.coffee +++ b/src/Posting/QuickReply.coffee @@ -747,45 +747,8 @@ QR = dialog: -> dialog = UI.dialog 'qr', 'top:0;right:0;', """ -
- - × - -
-
-
- - - - -
-
- - -
-
-
- + -
-
- - No selected file - - - × - -
- - -
- """.replace />\s+<' # get rid of spaces between elements + <%= grunt.file.read('src/General/html/Features/QuickReply.html').replace(/>\s+<').trim() %> + """ QR.nodes = nodes = el: dialog