aboutsummaryrefslogtreecommitdiffstats
path: root/src/regex.js
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2014-07-25 17:47:03 +0200
committerwout <wout@impinc.co.uk>2014-07-25 17:47:03 +0200
commit9842187d84e71e736ada6a2e9444bab592945600 (patch)
tree3b2e67ca99fd881d0d6a8e2ab6358c4ef077a74a /src/regex.js
parent94077ff77815f622f6ad0daebf26160ec33e0271 (diff)
downloadsvg.js-9842187d84e71e736ada6a2e9444bab592945600.tar.gz
svg.js-9842187d84e71e736ada6a2e9444bab592945600.zip
Various small fixes
Diffstat (limited to 'src/regex.js')
-rwxr-xr-xsrc/regex.js27
1 files changed, 12 insertions, 15 deletions
diff --git a/src/regex.js b/src/regex.js
index 8e974a9..eeade9e 100755
--- a/src/regex.js
+++ b/src/regex.js
@@ -1,39 +1,36 @@
// Storage for regular expressions
SVG.regex = {
- /* parse unit value */
+ // Parse unit value
unit: /^(-?[\d\.]+)([a-z%]{0,2})$/
- /* parse hex value */
+ // Parse hex value
, hex: /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i
- /* parse rgb value */
+ // Parse rgb value
, rgb: /rgb\((\d+),(\d+),(\d+)\)/
- /* parse reference id */
+ // Parse reference id
, reference: /#([a-z0-9\-_]+)/i
- /* test hex value */
+ // Test hex value
, isHex: /^#[a-f0-9]{3,6}$/i
- /* test rgb value */
+ // Test rgb value
, isRgb: /^rgb\(/
- /* test css declaration */
+ // Test css declaration
, isCss: /[^:]+:[^;]+;?/
- /* test for blank string */
+ // Test for blank string
, isBlank: /^(\s+)?$/
- /* test for numeric string */
+ // Test for numeric string
, isNumber: /^-?[\d\.]+$/
- /* test for percent value */
+ // Test for percent value
, isPercent: /^-?[\d\.]+%$/
- /* test for image url */
-, isImage: /\.(jpg|jpeg|png|gif)(\?[^=]+.*)?/i
-
- /* test for namespaced event */
-, isEvent: /^[\w]+:[\w]+$/
+ // Test for image url
+, isImage: /\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i
} \ No newline at end of file