diff options
author | mensonge | 2008-11-14 15:39:19 +0000 |
---|---|---|
committer | mensonge | 2008-11-14 15:39:19 +0000 |
commit | 1c5685d68f1b73270fb814fe04cbb490eb90ba5f (patch) | |
tree | 3d3ada08a934b96fc31531f1327690d7edc6f766 /includes/js/dojo/data/util/filter.js | |
parent | 104d59099e048688c4dbac37d72137006e396558 (diff) | |
download | scuttle-1c5685d68f1b73270fb814fe04cbb490eb90ba5f.tar.gz scuttle-1c5685d68f1b73270fb814fe04cbb490eb90ba5f.zip |
Minor fix: Remove DOJO library (60Mo) replaced by link to Google CDN (online DOJO library)
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@159 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'includes/js/dojo/data/util/filter.js')
-rw-r--r-- | includes/js/dojo/data/util/filter.js | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/includes/js/dojo/data/util/filter.js b/includes/js/dojo/data/util/filter.js deleted file mode 100644 index 125d264..0000000 --- a/includes/js/dojo/data/util/filter.js +++ /dev/null @@ -1,69 +0,0 @@ -if(!dojo._hasResource["dojo.data.util.filter"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["dojo.data.util.filter"] = true; -dojo.provide("dojo.data.util.filter"); - -dojo.data.util.filter.patternToRegExp = function(/*String*/pattern, /*boolean?*/ ignoreCase){ - // summary: - // Helper function to convert a simple pattern to a regular expression for matching. - // description: - // Returns a regular expression object that conforms to the defined conversion rules. - // For example: - // ca* -> /^ca.*$/ - // *ca* -> /^.*ca.*$/ - // *c\*a* -> /^.*c\*a.*$/ - // *c\*a?* -> /^.*c\*a..*$/ - // and so on. - // - // pattern: string - // A simple matching pattern to convert that follows basic rules: - // * Means match anything, so ca* means match anything starting with ca - // ? Means match single character. So, b?b will match to bob and bab, and so on. - // \ is an escape character. So for example, \* means do not treat * as a match, but literal character *. - // To use a \ as a character in the string, it must be escaped. So in the pattern it should be - // represented by \\ to be treated as an ordinary \ character instead of an escape. - // - // ignoreCase: - // An optional flag to indicate if the pattern matching should be treated as case-sensitive or not when comparing - // By default, it is assumed case sensitive. - - var rxp = "^"; - var c = null; - for(var i = 0; i < pattern.length; i++){ - c = pattern.charAt(i); - switch (c) { - case '\\': - rxp += c; - i++; - rxp += pattern.charAt(i); - break; - case '*': - rxp += ".*"; break; - case '?': - rxp += "."; break; - case '$': - case '^': - case '/': - case '+': - case '.': - case '|': - case '(': - case ')': - case '{': - case '}': - case '[': - case ']': - rxp += "\\"; //fallthrough - default: - rxp += c; - } - } - rxp += "$"; - if(ignoreCase){ - return new RegExp(rxp,"i"); //RegExp - }else{ - return new RegExp(rxp); //RegExp - } - -}; - -} |