diff options
author | alecpl <alec@alec.pl> | 2010-03-17 13:48:23 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2010-03-17 13:48:23 +0000 |
commit | 81ab85e5ab9377fd805a91a78388ad9775366a34 (patch) | |
tree | 9261498ff0d54dafd8cee82e0c80ca923845464c /program/js | |
parent | 71e7545f946a6dd5a3052cd659e51dc4be3fecbc (diff) |
- use jQuery.inArray() instead of rcube_in_array()
Diffstat (limited to 'program/js')
-rw-r--r-- | program/js/app.js | 6 | ||||
-rw-r--r-- | program/js/common.js | 21 | ||||
-rw-r--r-- | program/js/list.js | 2 |
3 files changed, 4 insertions, 25 deletions
diff --git a/program/js/app.js b/program/js/app.js index a5114fadf..7aca3d8de 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -733,7 +733,7 @@ function rcube_webmail() var qstring = '_mbox='+urlencode(this.env.mailbox)+'&_uid='+this.env.uid+'&_part='+props.part; // open attachment in frame if it's of a supported mimetype - if (this.env.uid && props.mimetype && find_in_array(props.mimetype, this.mimetypes)>=0) + if (this.env.uid && props.mimetype && jQuery.inArray(props.mimetype, this.mimetypes)>=0) { if (props.mimetype == 'text/html') qstring += '&_safe=1'; @@ -4276,12 +4276,12 @@ function rcube_webmail() this.env.flagged_col = null; var found; - if((found = find_in_array('subject', this.env.coltypes)) >= 0) { + if((found = jQuery.inArray('subject', this.env.coltypes)) >= 0) { this.set_env('subject_col', found); if (this.message_list) this.message_list.subject_col = found+1; } - if((found = find_in_array('flag', this.env.coltypes)) >= 0) + if((found = jQuery.inArray('flag', this.env.coltypes)) >= 0) this.set_env('flagged_col', found); }; diff --git a/program/js/common.js b/program/js/common.js index 829da8ae8..10d0c258d 100644 --- a/program/js/common.js +++ b/program/js/common.js @@ -469,27 +469,6 @@ function rcube_check_email(input, inline) } -// find a value in a specific array and returns the index -function find_in_array() - { - var args = find_in_array.arguments; - if(!args.length) return -1; - - var haystack = typeof(args[0])=='object' ? args[0] : args.length>1 && typeof(args[1])=='object' ? args[1] : new Array(); - var needle = typeof(args[0])!='object' ? args[0] : args.length>1 && typeof(args[1])!='object' ? args[1] : ''; - var nocase = args.length==3 ? args[2] : false; - - if(!haystack.length) return -1; - - for(var i=0; i<haystack.length; i++) - if(nocase && haystack[i].toLowerCase()==needle.toLowerCase()) - return i; - else if(haystack[i]==needle) - return i; - - return -1; - } - // recursively copy an object function rcube_clone_object(obj) { diff --git a/program/js/list.js b/program/js/list.js index 3ab4b1a83..5764afc98 100644 --- a/program/js/list.js +++ b/program/js/list.js @@ -840,7 +840,7 @@ highlight_row: function(id, multiple) } else // unselect row { - var p = find_in_array(id, this.selection); + var p = jQuery.inArray(id, this.selection); var a_pre = this.selection.slice(0, p); var a_post = this.selection.slice(p+1, this.selection.length); this.selection = a_pre.concat(a_post); |