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: '*'
dest: 'builds/'
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:
script:
@ -186,7 +188,11 @@ module.exports = (grunt) ->
builds: 'builds'
testbuilds: 'testbuilds'
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
@ -253,6 +259,8 @@ module.exports = (grunt) ->
'concat:userscript'
'set-channel:noupdate'
'concat:userscript'
'set-channel:dev'
'concat:userscript'
'clean:tmpuserscript'
]

View File

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

View File

@ -1,5 +1,5 @@
// ==UserScript==
// @name <%= meta.name %>
// @name <%= meta.name %><%= meta.namesuffix[channel] %>
// @version <%= meta.version %>
// @minGMVer <%= meta.min.greasemonkey %>
// @minFFVer <%= meta.min.firefox %>
@ -18,7 +18,7 @@
// @grant GM_openInTab
// @grant GM_xmlhttpRequest
// @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
// @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==

View File

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