Outsource banner, metadata and latest.
This commit is contained in:
parent
d8ff9c4743
commit
80619c763d
@ -1,7 +1,7 @@
|
||||
// ==UserScript==
|
||||
// @name 4chan X Alpha
|
||||
// @version 3.0.0
|
||||
// @description Adds various features.
|
||||
// @description Cross-browser userscript for maximum lurking on 4chan.
|
||||
// @copyright 2009-2011 James Campos <james.r.campos@gmail.com>
|
||||
// @copyright 2012 Nicolas Stepien <stepien.nicolas@gmail.com>
|
||||
// @license MIT; http://en.wikipedia.org/wiki/Mit_license
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
// ==UserScript==
|
||||
// @name 4chan X Alpha
|
||||
// @version 3.0.0
|
||||
// @description Adds various features.
|
||||
// @description Cross-browser userscript for maximum lurking on 4chan.
|
||||
// @copyright 2009-2011 James Campos <james.r.campos@gmail.com>
|
||||
// @copyright 2012 Nicolas Stepien <stepien.nicolas@gmail.com>
|
||||
// @license MIT; http://en.wikipedia.org/wiki/Mit_license
|
||||
|
||||
66
grunt.js
66
grunt.js
@ -6,58 +6,11 @@ module.exports = function(grunt) {
|
||||
meta: {
|
||||
name: '<%= pkg.name.replace(/-/g, " ") %>',
|
||||
repo: 'https://github.com/MayhemYDG/4chan-x/',
|
||||
banner: [
|
||||
'/* <%= meta.name %> - Version <%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>',
|
||||
' * http://mayhemydg.github.com/4chan-x/',
|
||||
' *',
|
||||
' * Copyright (c) 2009-2011 James Campos <james.r.campos@gmail.com>',
|
||||
' * Copyright (c) <%= grunt.template.today("yyyy") %> Nicolas Stepien <stepien.nicolas@gmail.com>',
|
||||
' * Licensed under the MIT license.',
|
||||
' * <%= meta.repo %>blob/master/LICENSE',
|
||||
' *',
|
||||
' * Contributors:',
|
||||
' * <%= meta.repo %>graphs/contributors',
|
||||
' * Non-GitHub contributors:',
|
||||
' * ferongr, xat-, Ongpot, thisisanon and Anonymous - favicon contributions',
|
||||
' * e000 - cooldown sanity check',
|
||||
' * Seiba - chrome quick reply focusing',
|
||||
' * herpaderpderp - recaptcha fixes',
|
||||
' * WakiMiko - recaptcha tab order http://userscripts.org/scripts/show/82657',
|
||||
' *',
|
||||
' * All the people who\'ve taken the time to write bug reports.',
|
||||
' *',
|
||||
' * Thank you.',
|
||||
' */'
|
||||
].join('\n'),
|
||||
metadataBlock: [
|
||||
'// ==UserScript==',
|
||||
'// @name <%= meta.name %>',
|
||||
'// @version <%= pkg.version %>',
|
||||
'// @description Adds various features.',
|
||||
'// @copyright 2009-2011 James Campos <james.r.campos@gmail.com>',
|
||||
'// @copyright <%= grunt.template.today("yyyy") %> Nicolas Stepien <stepien.nicolas@gmail.com>',
|
||||
'// @license MIT; http://en.wikipedia.org/wiki/Mit_license',
|
||||
'// @match *://boards.4chan.org/*',
|
||||
'// @match *://images.4chan.org/*',
|
||||
'// @match *://sys.4chan.org/*',
|
||||
'// @match *://api.4chan.org/*',
|
||||
'// @match *://*.foolz.us/api/*',
|
||||
'// @grant GM_getValue',
|
||||
'// @grant GM_setValue',
|
||||
'// @grant GM_deleteValue',
|
||||
'// @grant GM_openInTab',
|
||||
'// @run-at document-start',
|
||||
'// @updateURL <%= meta.repo %>raw/stable/<%= meta.files.metajs %>',
|
||||
'// @downloadURL <%= meta.repo %>raw/stable/<%= meta.files.userjs %>',
|
||||
'// @icon <%= meta.repo %>raw/stable/img/icon.gif',
|
||||
'// ==/UserScript=='
|
||||
].join('\n'),
|
||||
latest: 'document.dispatchEvent(new CustomEvent("<%= pkg.name.replace(/-/g, "") %>Update",{detail:{v:"<%= pkg.version %>"}}))',
|
||||
files: {
|
||||
metajs: '4chan_x.meta.js',
|
||||
userjs: '4chan_x.user.js',
|
||||
latestjs: 'latestv3.js'
|
||||
},
|
||||
}
|
||||
},
|
||||
concat: {
|
||||
coffee: {
|
||||
@ -72,15 +25,15 @@ module.exports = function(grunt) {
|
||||
dest: 'tmp/script.coffee'
|
||||
},
|
||||
js: {
|
||||
src: ['<banner:meta.metadataBlock>', '<banner:meta.banner>', 'tmp/script.js'],
|
||||
src: ['<file_template:src/metadata.js>', '<file_template:src/banner.js>', 'tmp/script.js'],
|
||||
dest: '<config:meta.files.userjs>'
|
||||
},
|
||||
meta: {
|
||||
src: '<banner:meta.metadataBlock>',
|
||||
src: '<file_template:src/metadata.js>',
|
||||
dest: '<config:meta.files.metajs>'
|
||||
},
|
||||
latest: {
|
||||
src: '<banner:meta.latest>',
|
||||
src: '<file_template:src/latest.js>',
|
||||
dest: '<config:meta.files.latestjs>'
|
||||
}
|
||||
},
|
||||
@ -88,7 +41,7 @@ module.exports = function(grunt) {
|
||||
all: {
|
||||
src: 'tmp/script.coffee',
|
||||
dest: 'tmp/script.js'
|
||||
},
|
||||
}
|
||||
},
|
||||
exec: {
|
||||
commit: {
|
||||
@ -111,7 +64,14 @@ module.exports = function(grunt) {
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
files: ['grunt.js', 'lib/**/*.coffee', 'src/**/*.coffee', 'css/**/*.css', 'img/*'],
|
||||
files: [
|
||||
'grunt.js',
|
||||
'lib/**/*.coffee',
|
||||
'src/**/*.coffee',
|
||||
'src/**/*.js',
|
||||
'css/**/*.css',
|
||||
'img/*'
|
||||
],
|
||||
tasks: 'default'
|
||||
},
|
||||
clean: {
|
||||
|
||||
@ -1 +1 @@
|
||||
document.dispatchEvent(new CustomEvent("4chanXAlphaUpdate",{detail:{v:"3.0.0"}}))
|
||||
document.dispatchEvent(new CustomEvent("4chanXAlphaVersion",{detail:{v:"3.0.0"}}))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user