From 01f814fe7707e5cb1890bd46663377750fad9309 Mon Sep 17 00:00:00 2001 From: drry Date: Fri, 5 Sep 2008 17:09:27 +0000 Subject: * fixed a regexp. * et cetera. git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@18907 d0d07461-0603-4401-acd4-de1884942a52 --- param_editor.js | 46 +++++++++++++++++++++------------------------- 1 file changed, 21 insertions(+), 25 deletions(-) (limited to 'param_editor.js') diff --git a/param_editor.js b/param_editor.js index 3a3fe13..6291c5e 100644 --- a/param_editor.js +++ b/param_editor.js @@ -8,14 +8,14 @@ var snap = doc.evaluate(query, node, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); var res = []; - for(var i = 0; i < snap.snapshotLength; i++){ + for(let i = 0, l = snap.snapshotLength; i < l; i++){ res.push(snap.snapshotItem(i)); } return res; }; var Form = function(form, i){ - this.uid = i; + this.uid = i; this.method = (form.method.length) ? form.method.toUpperCase() : "GET"; this.action = form.action; this.name = (form.name.length) ? form.name : this.uid; @@ -29,8 +29,8 @@ if(!e.type) return; var type = e.type.toLowerCase(); if(type == "radio" || type == "checkbox"){ - var mg = null; - for(var i = 0; i < this.member.length; i++){ + let mg = null; + for(let i = 0, l = this.member.length; i < l; i++){ if(this.member[i].constructor == FormMemberGroup && this.member[i].name == e.name){ mg = this.member[i]; @@ -93,7 +93,7 @@ } }; - for(var i = 0; i < this.elems.length; i++){ + for(let i = 0, l = this.elems.length; i < l; i++){ if(this.elems[i].value == v){ check.call(this, i); return; @@ -106,20 +106,20 @@ FormMemberGroup.prototype.add_elem = function(e){ this.elems.push(e); - } + }; var form2html = function(form){ var html = [ - '', '
Name | Type | Value |
---|---|---|
Name | Type | Value |