Merge branch 'master' into catalog

This commit is contained in:
ccd0 2014-09-13 11:42:32 -07:00
commit 1491736233
4 changed files with 28 additions and 16 deletions

View File

@ -103,7 +103,9 @@ module.exports = (grunt) ->
src: '*' src: '*'
dest: 'builds/' dest: 'builds/'
expand: true expand: true
filter: 'isFile' filter: (src) ->
pkg = grunt.config 'pkg'
grunt.file.isFile(src) and src isnt "testbuilds/#{pkg.name}#{pkg.meta.suffix.dev}.user.js"
coffee: coffee:
script: script:
@ -186,7 +188,11 @@ module.exports = (grunt) ->
builds: 'builds' builds: 'builds'
testbuilds: 'testbuilds' testbuilds: 'testbuilds'
tmpcrx: ['tmp-crx', 'testbuilds/updates<%= pkg.meta.suffix.noupdate %>.xml'] tmpcrx: ['tmp-crx', 'testbuilds/updates<%= pkg.meta.suffix.noupdate %>.xml']
tmpuserscript: ['tmp-userscript', 'testbuilds/<%= pkg.name %><%= pkg.meta.suffix.noupdate %>.meta.js'] tmpuserscript: [
'tmp-userscript',
'testbuilds/<%= pkg.name %><%= pkg.meta.suffix.noupdate %>.meta.js',
'testbuilds/<%= pkg.name %><%= pkg.meta.suffix.dev %>.meta.js'
]
require('load-grunt-tasks') grunt require('load-grunt-tasks') grunt
@ -253,6 +259,8 @@ module.exports = (grunt) ->
'concat:userscript' 'concat:userscript'
'set-channel:noupdate' 'set-channel:noupdate'
'concat:userscript' 'concat:userscript'
'set-channel:dev'
'concat:userscript'
'clean:tmpuserscript' 'clean:tmpuserscript'
] ]

View File

@ -20,7 +20,14 @@
"suffix": { "suffix": {
"stable": "", "stable": "",
"beta": "-beta", "beta": "-beta",
"noupdate": "-noupdate" "noupdate": "-noupdate",
"dev": "-dev"
},
"namesuffix": {
"stable": "",
"beta": " beta",
"noupdate": "",
"dev": " dev"
}, },
"min": { "min": {
"chrome": "31", "chrome": "31",
@ -57,4 +64,4 @@
"engines": { "engines": {
"node": ">=0.10" "node": ">=0.10"
} }
} }

View File

@ -1,5 +1,5 @@
// ==UserScript== // ==UserScript==
// @name <%= meta.name %> // @name <%= meta.name %><%= meta.namesuffix[channel] %>
// @version <%= meta.version %> // @version <%= meta.version %>
// @minGMVer <%= meta.min.greasemonkey %> // @minGMVer <%= meta.min.greasemonkey %>
// @minFFVer <%= meta.min.firefox %> // @minFFVer <%= meta.min.firefox %>
@ -18,7 +18,7 @@
// @grant GM_openInTab // @grant GM_openInTab
// @grant GM_xmlhttpRequest // @grant GM_xmlhttpRequest
// @run-at document-start // @run-at document-start
<% if (channel !== 'noupdate') { %>// @updateURL <%= meta.downloads %><%= name %><%= meta.suffix[channel] %>.meta.js <% if (channel !== 'dev') { %><% if (channel !== 'noupdate') { %>// @updateURL <%= meta.downloads %><%= name %><%= meta.suffix[channel] %>.meta.js
<% } %>// @downloadURL <%= meta.downloads %><%= name %><%= meta.suffix[channel] %>.user.js <% } %>// @downloadURL <%= meta.downloads %><%= name %><%= meta.suffix[channel] %>.user.js
// @icon data:image/png;base64,<%= grunt.file.read('src/General/img/icon48.png', {encoding: 'base64'}) %> <% } %>// @icon data:image/png;base64,<%= grunt.file.read('src/General/img/icon48.png', {encoding: 'base64'}) %>
// ==/UserScript== // ==/UserScript==

View File

@ -442,15 +442,12 @@ QR =
setNode 'fileInput', '[type=file]' setNode 'fileInput', '[type=file]'
rules = $('ul.rules').textContent.trim() rules = $('ul.rules').textContent.trim()
QR.min_width = QR.min_height = 1 match_min = rules.match(/.+smaller than (\d+)x(\d+).+/)
QR.max_width = QR.max_height = 10000 match_max = rules.match(/.+greater than (\d+)x(\d+).+/)
try QR.min_width = +match_min?[1] or 1
[_, QR.min_width, QR.min_height] = rules.match(/.+smaller than (\d+)x(\d+).+/) QR.min_height = +match_min?[2] or 1
[_, QR.max_width, QR.max_height] = rules.match(/.+greater than (\d+)x(\d+).+/) QR.max_width = +match_max?[1] or 10000
for prop in ['min_width', 'min_height', 'max_width', 'max_height'] QR.max_height = +match_max?[2] or 10000
QR[prop] = parseInt QR[prop], 10
catch
null
nodes.fileInput.max = $('input[name=MAX_FILE_SIZE]').value nodes.fileInput.max = $('input[name=MAX_FILE_SIZE]').value