mirror of
https://github.com/openstf/stf
synced 2025-10-06 03:50:04 +02:00
Rename "roles" to "units". Put units in their own folders.
This commit is contained in:
parent
7d9d64ddcb
commit
3a9b193f68
63 changed files with 105 additions and 105 deletions
14
lib/units/storage/plugins/image/param/crop.js
Normal file
14
lib/units/storage/plugins/image/param/crop.js
Normal file
|
@ -0,0 +1,14 @@
|
|||
var RE_CROP = /^([0-9]*)x([0-9]*)$/
|
||||
|
||||
module.exports = function(raw) {
|
||||
var parsed
|
||||
|
||||
if (raw && (parsed = RE_CROP.exec(raw))) {
|
||||
return {
|
||||
width: +parsed[1] || 0
|
||||
, height: +parsed[2] || 0
|
||||
}
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
21
lib/units/storage/plugins/image/param/gravity.js
Normal file
21
lib/units/storage/plugins/image/param/gravity.js
Normal file
|
@ -0,0 +1,21 @@
|
|||
var GRAVITY = {
|
||||
northwest: 'NorthWest'
|
||||
, north: 'North'
|
||||
, northeast: 'NorthEast'
|
||||
, west: 'West'
|
||||
, center: 'Center'
|
||||
, east: 'East'
|
||||
, southwest: 'SouthWest'
|
||||
, south: 'South'
|
||||
, southeast: 'SouthEast'
|
||||
}
|
||||
|
||||
module.exports = function(raw) {
|
||||
var parsed
|
||||
|
||||
if (raw && (parsed = GRAVITY[raw])) {
|
||||
return parsed
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue