Changeset 8692

Show
Ignore:
Timestamp:
04/03/08 03:23:36 (5 years ago)
Author:
drry
Message:

platform/firefox/textareavieditor/locale/en-US/textareavieditor.dtd
platform/firefox/textareavieditor/chrome.test.manifest
platform/firefox/textareavieditor/install.rdf
platform/firefox/textareavieditor/chrome.manifest
platform/firefox/textareavieditor/skin/textareavieditor.css
platform/firefox/textareavieditor/chrome.default.manifest
platform/firefox/textareavieditor/defaults/preferences/textareavieditor.js
platform/firefox/textareavieditor/content/vi_commandline.js
platform/firefox/textareavieditor/content/vi_editor.js
platform/firefox/textareavieditor/content/vi_io.js
platform/firefox/textareavieditor/content/overlay-ff.xul
platform/firefox/textareavieditor/content/overlay-fx.xul
platform/firefox/textareavieditor/content/vi_options.js
platform/firefox/textareavieditor/content/textareavieditor.html
platform/firefox/textareavieditor/content/vi_caret.js
platform/firefox/textareavieditor/content/vi_mappings.js
platform/firefox/textareavieditor/content/vi_utils.js
platform/firefox/textareavieditor/content/textareavieditor.xul
platform/firefox/textareavieditor/content/vi_commands.js
platform/firefox/textareavieditor/content/vi_events.js
platform/firefox/textareavieditor/build.xml:

  • プロパティ svn:executable を除去しました。
  • 正規表現を修正しました。
  • typo を修正しました。
  • 空白を修整しました。
  • ほか。
Location:
platform/firefox/textareavieditor
Files:
19 modified
1 moved

Legend:

Unmodified
Added
Removed
  • platform/firefox/textareavieditor/build.xml

    • Property svn:executable deleted
    r8686 r8692  
    77        <property name="app.name" value="textareavieditor" /> 
    88        <property name="app.id" value="${app.name}@teramako.ddo.jp" /> <!-- extension id like: xxx@xxx.com --> 
    9         <property name="ff.dir" value="C:\Documents and Settings\teramako\Application Data\Mozilla\Firefox\Profiles\kq1voi12.develop" /> 
     9        <property name="fx.dir" value="C:\Documents and Settings\teramako\Application Data\Mozilla\Firefox\Profiles\kq1voi12.develop" /> 
    1010 
    11         <condition property="ff.present"> 
     11        <condition property="fx.present"> 
    1212                <and> 
    13                         <isset property="ff.dir" /> 
    14                         <available file="${ff.dir}" type="dir" /> 
     13                        <isset property="fx.dir" /> 
     14                        <available file="${fx.dir}" type="dir" /> 
    1515                </and> 
    1616        </condition> 
     
    2929        </target> 
    3030 
    31         <target name="test.chrome" depends="chrome" if="ff.present"> 
     31        <target name="test.chrome" depends="chrome" if="fx.present"> 
    3232                <!-- copy to chrome directory --> 
    33                 <copy file="${dist.dir}/${app.name}.jar" todir="${ff.dir}/chrome/chrome" overwrite="true" /> 
    34                 <copy file="${src.dir}/chrome.manifest" tofile="${ff.dir}/chrome/${app.name}.manifest" overwrite="true" /> 
     33                <copy file="${dist.dir}/${app.name}.jar" todir="${fx.dir}/chrome/chrome" overwrite="true" /> 
     34                <copy file="${src.dir}/chrome.manifest" tofile="${fx.dir}/chrome/${app.name}.manifest" overwrite="true" /> 
    3535        </target> 
    3636         
    3737        <!-- copy to extensions directory --> 
    3838        <!-- 
    39         <target name="test.ext" depends="chrome" if="ff.present"> 
    40                 <copy file="${dist.dir}/${app.name}.jar" todir="${ff.dir}/extensions/${app.id}/chrome" overwrite="true" /> 
    41                 <copy file="${src.dir}/chrome.manifest" todir="${ff.dir}/extensions/${app.id}" overwrite="true" /> 
     39        <target name="test.ext" depends="chrome" if="fx.present"> 
     40                <copy file="${dist.dir}/${app.name}.jar" todir="${fx.dir}/extensions/${app.id}/chrome" overwrite="true" /> 
     41                <copy file="${src.dir}/chrome.manifest" todir="${fx.dir}/extensions/${app.id}" overwrite="true" /> 
    4242        </target> 
    4343        --> 
     
    6060        </target> 
    6161 
    62         <target name="clean.ff"  if="ff.present"> 
    63                 <delete dir="${ff.dir}/extensions/${app.id}" failonerror="false" /> 
    64                 <delete file="${ff.dir}/chrome/${app.name}.manifest" failonerror="false" /> 
    65                 <delete file="${ff.dir}/chrome/chrome/${app.name}.jar" failonerror="false" /> 
     62        <target name="clean.fx"  if="fx.present"> 
     63                <delete dir="${fx.dir}/extensions/${app.id}" failonerror="false" /> 
     64                <delete file="${fx.dir}/chrome/${app.name}.manifest" failonerror="false" /> 
     65                <delete file="${fx.dir}/chrome/chrome/${app.name}.jar" failonerror="false" /> 
    6666        </target> 
    6767 
  • platform/firefox/textareavieditor/chrome.default.manifest

    • Property svn:executable deleted
    r8686 r8692  
    11content textareavieditor jar:chrome/textareavieditor.jar!/content/ 
    2 overlay chrome://browser/content/browser.xul    chrome://textareavieditor/content/overlay-ff.xul 
     2overlay chrome://browser/content/browser.xul    chrome://textareavieditor/content/overlay-fx.xul 
    33locale  textareavieditor        en-US           jar:chrome/textareavieditor.jar!/locale/en-US/ 
    44skin    textareavieditor        classic/1.0     jar:chrome/textareavieditor.jar!/skin/ 
  • platform/firefox/textareavieditor/chrome.manifest

    • Property svn:executable deleted
    r8686 r8692  
    11content textareavieditor jar:chrome/textareavieditor.jar!/content/ 
    2 overlay chrome://browser/content/browser.xul    chrome://textareavieditor/content/overlay-ff.xul 
     2overlay chrome://browser/content/browser.xul    chrome://textareavieditor/content/overlay-fx.xul 
    33locale  textareavieditor        en-US           jar:chrome/textareavieditor.jar!/locale/en-US/ 
    44skin    textareavieditor        classic/1.0     jar:chrome/textareavieditor.jar!/skin/ 
  • platform/firefox/textareavieditor/chrome.test.manifest

    • Property svn:executable deleted
    r8686 r8692  
    11content textareavieditor content/ 
    2 overlay chrome://browser/content/browser.xul    chrome://textareavieditor/content/overlay-ff.xul 
     2overlay chrome://browser/content/browser.xul    chrome://textareavieditor/content/overlay-fx.xul 
    33locale  textareavieditor        en-US           locale/en-US/ 
    44skin    textareavieditor        classic/1.0     skin/ 
  • platform/firefox/textareavieditor/content/overlay-fx.xul

    • Property svn:executable deleted
  • platform/firefox/textareavieditor/content/textareavieditor.html

    • Property svn:executable deleted
  • platform/firefox/textareavieditor/content/textareavieditor.xul

    • Property svn:executable deleted
    r8686 r8692  
    1212<html:h1>Sandbox</html:h1> 
    1313<html:p>Input: <html:input style="width:500px;"/></html:p> 
    14 <html:p>Textarea:<html:br/><html:textarea cols="80" rows="20"></html:textarea></html:p> 
     14<html:p>Textarea:<html:br/><html:textarea cols="80" rows="20"/></html:p> 
    1515</window> 
  • platform/firefox/textareavieditor/content/vi_caret.js

    • Property svn:executable deleted
    r8686 r8692  
    55/*  ***** BEGIN LICENSE BLOCK ***** 
    66 *  Version: MPL 1.1/GPL 2.0/LGPL 2.1 
    7  *   
     7 * 
    88 *  The contents of this file are subject to the Mozilla Public License Version 
    99 *  1.1 (the "License"); you may not use this file except in compliance with 
    1010 *  the License. You may obtain a copy of the License at 
    1111 *  http://www.mozilla.org/MPL/ 
    12  *   
     12 * 
    1313 *  Software distributed under the License is distributed on an "AS IS" basis, 
    1414 *  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 
    1515 *  for the specific language governing rights and limitations under the License. 
    16  *  
     16 * 
    1717 *  (c) 2007-2008: teramako <teramako@gmail.com> 
    18  *  
     18 * 
    1919 *  Alternatively, the contents of this file may be used under the terms of 
    2020 *  either the GNU General Public License Version 2 or later (the "GPL"), or 
     
    8989        }, 
    9090        /** 
    91          * Return postition of [offset, lineNum] cordinate 
     91         * Return postition of [offset, lineNum] coordinate 
    9292         * @method 
    9393         * @param {Number} lineNum 
     
    9595         * @return {Number} 
    9696         */ 
    97         getPositionFromCordinate: function(lineNum, offset){ 
     97        getPositionFromCoordinate: function(lineNum, offset){ 
    9898                var t = viEditor.input.target; 
    9999                var lines = t.value.split('\n'); 
     
    246246                        [line1, line2] = [line2, line1]; 
    247247                } 
    248                 var start = this.getPositionFromCordinate(line1,0); 
    249                 var end = this.getPositionFromCordinate(line2, Number.POSITIVE_INFINITY); 
     248                var start = this.getPositionFromCoordinate(line1,0); 
     249                var end = this.getPositionFromCoordinate(line2, Number.POSITIVE_INFINITY); 
    250250                if ( t.textLength > end){ 
    251                         end++ 
     251                        end++; 
    252252                } 
    253253                t.selectionStart = start; 
  • platform/firefox/textareavieditor/content/vi_commandline.js

    • Property svn:executable deleted
    r8686 r8692  
    55/*  ***** BEGIN LICENSE BLOCK ***** 
    66 *  Version: MPL 1.1/GPL 2.0/LGPL 2.1 
    7  *   
     7 * 
    88 *  The contents of this file are subject to the Mozilla Public License Version 
    99 *  1.1 (the "License"); you may not use this file except in compliance with 
    1010 *  the License. You may obtain a copy of the License at 
    1111 *  http://www.mozilla.org/MPL/ 
    12  *   
     12 * 
    1313 *  Software distributed under the License is distributed on an "AS IS" basis, 
    1414 *  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 
    1515 *  for the specific language governing rights and limitations under the License. 
    16  *  
     16 * 
    1717 *  (c) 2007-2008: teramako <teramako@gmail.com> 
    18  *  
     18 * 
    1919 *  Alternatively, the contents of this file may be used under the terms of 
    2020 *  either the GNU General Public License Version 2 or later (the "GPL"), or 
     
    6767        var completions = []; 
    6868        var completionIndex = 0; 
    69         var commandReg = /^((?:(?:[+-]?[\d]+|'<|\.)(?:,(?:[+-]?[\d]+|'>|\.))?)|[%$])?([\S]+)?(?:([\s]+)(.+))?$/; 
     69        var commandReg = /^((?:[+-]?\d+|'<|\.)(?:,(?:[+-]?\d+|'>|\.))?|[%$])?(\S+)?(?:(\s+)(.+))?$/; 
    7070        function completer(forward){ 
    7171                if(completions.length == 0){ 
     
    102102                } 
    103103                if (completions.length > 1){ 
    104                         completionIndex = forward ? completionIndex + 1 : completionIndex -1; 
     104                        completionIndex += forward ? 1 : -1; 
    105105                        if (completions.length <= completionIndex){ 
    106106                                completionIndex = 0; 
     
    126126                                deckElm.selectedIndex = 0; 
    127127                        },false); 
    128                         defaultColor = document.defaultView.getComputedStyle(modeElm,null).getPropertyValue('color') 
     128                        defaultColor = document.defaultView.getComputedStyle(modeElm,null).getPropertyValue('color'); 
    129129                }, 
    130130                /** 
     
    256256                                        //viEditor.log("commandLine.execute: `" + cmds[0].names[0] + "` args:" + cmds[1]); 
    257257                                        result = cmds[0].execute.apply(cmds[0], cmds[1]); 
    258                                 }  
     258                                } 
    259259                        } catch (e) { 
    260260                                this.error(e.name + ': ' + e.message); 
  • platform/firefox/textareavieditor/content/vi_commands.js

    • Property svn:executable deleted
    r8686 r8692  
    55/*  ***** BEGIN LICENSE BLOCK ***** 
    66 *  Version: MPL 1.1/GPL 2.0/LGPL 2.1 
    7  *   
     7 * 
    88 *  The contents of this file are subject to the Mozilla Public License Version 
    99 *  1.1 (the "License"); you may not use this file except in compliance with 
    1010 *  the License. You may obtain a copy of the License at 
    1111 *  http://www.mozilla.org/MPL/ 
    12  *   
     12 * 
    1313 *  Software distributed under the License is distributed on an "AS IS" basis, 
    1414 *  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 
    1515 *  for the specific language governing rights and limitations under the License. 
    16  *  
     16 * 
    1717 *  (c) 2007-2008: teramako <teramako@gmail.com> 
    18  *  
     18 * 
    1919 *  Alternatively, the contents of this file may be used under the terms of 
    2020 *  either the GNU General Public License Version 2 or later (the "GPL"), or 
     
    5050viEditor.Command = function(specs, action, extraInfo){ 
    5151        if (!specs || !action) return null; 
    52          
     52 
    5353        function parseSpaces(specs){ 
    5454                var shortNames = []; 
     
    6969                return { names: names, longNames: longNames, shortNames: shortNames }; 
    7070        } 
    71          
     71 
    7272        this.spacs = specs; 
    7373        var expandSpecs = parseSpaces(specs); 
    7474        this.shortNames = expandSpecs.shortNames; 
    7575        this.longNames = expandSpecs.longNames; 
    76          
     76 
    7777        this.name = this.longNames[0]; 
    7878        this.names = expandSpecs.names; 
     
    8282         */ 
    8383        this.action = action; 
    84          
     84 
    8585        if (extraInfo){ 
    8686                this.flags = extraInfo.flags || 0; 
     
    150150        var exCommands = []; 
    151151        var lastRunCommand = ""; 
    152         // For command parse                                                1       2            3 
    153         var reg = /^((?:(?:[+-]?[\d]+|'<|\.)(?:,(?:[+-]?[\d]+|'>|\.))?)|[%$])?([\S]+)?(?:[\s]+(.+))?$/; 
    154          
     152        // For command parse                                        1     2          3 
     153        var reg = /^((?:[+-]?\d+|'<|\.)(?:,(?:[+-]?\d+|'>|\.))?|[%$])?(\S+)?(?:\s+(.+))?$/; 
     154 
    155155        /** 
    156156         * Return Iterator of <var>exCommands</var> 
     
    171171                //viEditor.log('parseRange: `' + str + "'"); 
    172172                var t = viEditor.input.target; 
    173                 var reg = /^([+-])?([\d]+)$/; 
     173                var reg = /^([+-])?(\d+)$/; 
    174174                var start, end; 
    175175                if (!str || str == '.'){ 
     
    183183                        return [0, t.value.length]; 
    184184                } 
    185                  
     185 
    186186                function getPositionFromString(str){ 
    187187                        //viEditor.log('command#getPositionFromString: str:`' + str + "'"); 
     
    200200                        } 
    201201                } 
    202                  
     202 
    203203                var strList = str.split(','); 
    204204                var p = []; 
    205                 for (var i=0; i<strList.length; i++){ 
    206                         if (reg.test(strList[i])){ 
    207                                 p = p.concat(getPositionFromNumber(strList[i])); 
     205                strList.forEach(function(strItem){ 
     206                        if (reg.test(strItem)){ 
     207                                p = p.concat(getPositionFromNumber(strItem)); 
    208208                        } else { 
    209                                 var r = getPositionFromString(strList[i]); 
     209                                var r = getPositionFromString(strItem); 
    210210                                if (r == null){ 
    211                                         throw new SyntaxError('Invalid range: `' + strList[i] + "'"); 
     211                                        throw new SyntaxError('Invalid range: `' + strItem + "'"); 
    212212                                } 
    213213                                p = p.concat(r); 
    214214                        } 
    215                 } 
     215                }); 
    216216                start = Math.min.apply(this,p); 
    217217                end = Math.max.apply(this,p); 
     
    289289                        if (prefix == ':') { 
    290290                                var arg = ''; 
    291                                 var range = [] 
     291                                var range = []; 
    292292                                var list = str.match(reg); 
    293293                                if (!list) return null; 
     
    443443                viEditor.input.target = null; 
    444444        },{ 
    445                 shortHelp: 'Quit the testarea/input', 
    446                 help: 'Blur the textarea or input element. And forcus to the browser.' 
     445                shortHelp: 'Quit the textarea/input', 
     446                help: 'Blur the textarea or input element. And focus to the browser.' 
    447447        } 
    448448)); 
    449449viEditor.commands.add(new viEditor.Command(['gotoline'], 
    450450        function(arg){ 
    451                 var matches = arg.replace(/[\s]+/g,'').match(/^(?:([+-])?(\d+)|([%$]))$/); 
     451                var matches = arg.replace(/\s+/g,'').match(/^(?:([+-])?(\d+)|([%$]))$/); 
    452452                var num; 
    453453                if (!matches){ 
     
    471471                                break; 
    472472                } 
    473                 viEditor.caret.to(viEditor.caret.getPositionFromCordinate(num,0)); 
     473                viEditor.caret.to(viEditor.caret.getPositionFromCoordinate(num,0)); 
    474474                viEditor.caret.toBeginOfLine(true); 
    475475        },{ 
    476                 shortHelp: 'Quit the testarea/input', 
    477                 help: 'Blur the textarea or input element. And forcus to the browser.', 
     476                shortHelp: 'Quit the textarea/input', 
     477                help: 'Blur the textarea or input element. And focus to the browser.', 
    478478                flags: viEditor.commandFlags.ARGUMENT 
    479479        } 
     
    491491viEditor.commands.add(new viEditor.Command(['set'], 
    492492        function(arg){ 
    493                 var [,name,value] = arg.match(/^\s*([\w\-]+)(?:\s*=\s*(.+))?/); 
     493                var [,name,value] = arg.match(/^\s*([\w-]+)(?:\s*=\s*(.+))?/); 
    494494                var option = viEditor.options.get(name); 
    495495                if (!option) throw new SyntaxError('No such option'); 
  • platform/firefox/textareavieditor/content/vi_editor.js

    • Property svn:executable deleted
    r8686 r8692  
    55/*  ***** BEGIN LICENSE BLOCK ***** 
    66 *  Version: MPL 1.1/GPL 2.0/LGPL 2.1 
    7  *   
     7 * 
    88 *  The contents of this file are subject to the Mozilla Public License Version 
    99 *  1.1 (the "License"); you may not use this file except in compliance with 
    1010 *  the License. You may obtain a copy of the License at 
    1111 *  http://www.mozilla.org/MPL/ 
    12  *   
     12 * 
    1313 *  Software distributed under the License is distributed on an "AS IS" basis, 
    1414 *  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 
    1515 *  for the specific language governing rights and limitations under the License. 
    16  *  
     16 * 
    1717 *  (c) 2007-2008: teramako <teramako@gmail.com> 
    18  *  
     18 * 
    1919 *  Alternatively, the contents of this file may be used under the terms of 
    2020 *  either the GNU General Public License Version 2 or later (the "GPL"), or 
     
    5454         * pending motion map object 
    5555         * @type {Map,Object} 
    56          */  
     56         */ 
    5757        pendingMotionMap: null, 
    5858        /** 
     
    9696 */ 
    9797viEditor.setMode = function(mode){ 
    98         if (!this.input.target)  
     98        if (!this.input.target) 
    9999                return false; 
    100100        switch (mode) { 
     
    130130 */ 
    131131viEditor.doCommand = function(cmd, count){ 
    132         if (!this.input.target || !this.input.target.controllers)  
     132        if (!this.input.target || !this.input.target.controllers) 
    133133                return false; 
    134         if (isNaN(count))  
     134        if (isNaN(count)) 
    135135                count = 1; 
    136136        var controller = this.input.target.controllers.getControllerForCommand(cmd); 
     
    154154        var console_service = Components.classes['@mozilla.org/consoleservice;1'].getService(Components.interfaces.nsIConsoleService); 
    155155        return function(msg, level){ 
    156                 console_service.logStringMessage('viEditor: ' + msg) 
     156                console_service.logStringMessage('viEditor: ' + msg); 
    157157        }; 
    158158})(); 
     
    168168                if (tagname == 'textarea') { 
    169169                        viEditor.events.onKeyPress(e, target, true); 
    170                 } else  if (tagname == 'input' && (target.getAttribute('type') == 'text' || !target.hasAttribute('type'))) { 
     170                } else  if (tagname == 'input' && (!target.hasAttribute('type') || target.getAttribute('type') == 'text')) { 
    171171                        viEditor.events.onKeyPress(e, target, false); 
    172172                } 
     
    181181                        viEditor.input.target = target; 
    182182                        viEditor.commandLine.appear(); 
    183                         return 
     183                        return; 
    184184                } 
    185185        },true); 
     
    191191                //var etarget = e.originalTarget; 
    192192                var tagname = etarget.localName.toLowerCase(); 
    193                  
    194                 if (tagname != 'textarea' && !(tagname == 'input' && (etarget.type == 'text' || !etarget.type))) { 
     193 
     194                if (tagname != 'textarea' && !(tagname == 'input' && (!etarget.type || etarget.type == 'text'))) { 
    195195                        viEditor.commandLine.hide(); 
    196                         return 
     196                        return; 
    197197                } 
    198198        },true); 
  • platform/firefox/textareavieditor/content/vi_events.js

    • Property svn:executable deleted
    r8686 r8692  
    55/*  ***** BEGIN LICENSE BLOCK ***** 
    66 *  Version: MPL 1.1/GPL 2.0/LGPL 2.1 
    7  *   
     7 * 
    88 *  The contents of this file are subject to the Mozilla Public License Version 
    99 *  1.1 (the "License"); you may not use this file except in compliance with 
    1010 *  the License. You may obtain a copy of the License at 
    1111 *  http://www.mozilla.org/MPL/ 
    12  *   
     12 * 
    1313 *  Software distributed under the License is distributed on an "AS IS" basis, 
    1414 *  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 
    1515 *  for the specific language governing rights and limitations under the License. 
    16  *  
     16 * 
    1717 *  (c) 2007-2008: teramako <teramako@gmail.com> 
    18  *  
     18 * 
    1919 *  Alternatively, the contents of this file may be used under the terms of 
    2020 *  either the GNU General Public License Version 2 or later (the "GPL"), or 
     
    3535 */ 
    3636viEditor.events = (function(){ 
    37         var keyTable = [ 
     37        const KEYTABLE = [ 
    3838                [ KeyEvent.DOM_VK_ESCAPE, ["Esc", "Escape"] ], 
    3939                [ KeyEvent.DOM_VK_LEFT_SHIFT, ["<"] ], 
     
    197197                if (e.altKey){modifier += 'A-';} 
    198198                if (e.metaKey){modifier += 'M-';} 
    199                  
     199 
    200200                if(e.charCode == 0){ 
    201201                        if(e.shiftKey){modifier += 'S-';} 
    202                         for(var i in keyTable){ 
    203                                 if(keyTable[i][0] == e.keyCode){ 
    204                                         key = keyTable[i][1][0]; 
     202                        for each(var k in KEYTABLE){ 
     203                                if(k[0] == e.keyCode){ 
     204                                        key = k[1][0]; 
    205205                                        break; 
    206206                                } 
    207207                        } 
    208                 } else if (e.charCode == 32){ 
     208                } else if (e.charCode == KeyEvent.DOM_VK_SPACE){ 
    209209                        if(e.shiftKey){modifier += 'S-';} 
    210210                        key = 'Space'; 
     
    216216                } 
    217217                return '<' + modifier + key + '>'; 
    218                 } 
     218        } 
    219219        } 
    220220})(); 
  • platform/firefox/textareavieditor/content/vi_io.js

    • Property svn:executable deleted
    r8686 r8692  
    55/*  ***** BEGIN LICENSE BLOCK ***** 
    66 *  Version: MPL 1.1/GPL 2.0/LGPL 2.1 
    7  *   
     7 * 
    88 *  The contents of this file are subject to the Mozilla Public License Version 
    99 *  1.1 (the "License"); you may not use this file except in compliance with 
    1010 *  the License. You may obtain a copy of the License at 
    1111 *  http://www.mozilla.org/MPL/ 
    12  *   
     12 * 
    1313 *  Software distributed under the License is distributed on an "AS IS" basis, 
    1414 *  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 
    1515 *  for the specific language governing rights and limitations under the License. 
    16  *  
     16 * 
    1717 *  (c) 2007-2008: teramako <teramako@gmail.com> 
    18  *  
     18 * 
    1919 *  Alternatively, the contents of this file may be used under the terms of 
    2020 *  either the GNU General Public License Version 2 or later (the "GPL"), or 
     
    4949                                path = path.replace('/','\\','g'); 
    5050                        } 
    51                         if (/^~/.test(path)){ 
     51                        if (/^~(?=\W|$)/.test(path)){ 
    5252                                var home = envService.get('HOME'); 
    5353                                if (WINDOWS && !home){ 
  • platform/firefox/textareavieditor/content/vi_mappings.js

    • Property svn:executable deleted
    r8686 r8692  
    55/*  ***** BEGIN LICENSE BLOCK ***** 
    66 *  Version: MPL 1.1/GPL 2.0/LGPL 2.1 
    7  *   
     7 * 
    88 *  The contents of this file are subject to the Mozilla Public License Version 
    99 *  1.1 (the "License"); you may not use this file except in compliance with 
    1010 *  the License. You may obtain a copy of the License at 
    1111 *  http://www.mozilla.org/MPL/ 
    12  *   
     12 * 
    1313 *  Software distributed under the License is distributed on an "AS IS" basis, 
    1414 *  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 
    1515 *  for the specific language governing rights and limitations under the License. 
    16  *  
     16 * 
    1717 *  (c) 2007-2008: teramako <teramako@gmail.com> 
    18  *  
     18 * 
    1919 *  Alternatively, the contents of this file may be used under the terms of 
    2020 *  either the GNU General Public License Version 2 or later (the "GPL"), or 
     
    3535 */ 
    3636viEditor.mapFlags = { 
    37         /** MOTION 1 */  
     37        /** MOTION 1 */ 
    3838        MOTION:   1 << 0, 
    3939        /** COUNT 2 */ 
     
    6060 */ 
    6161viEditor.Map = function(mode, cmds, action, extraInfo){ 
    62         if (!mode || (!cmds || !cmds.length) || !action)  
     62        if (!mode || !cmds || !cmds.length || !action) 
    6363                return null; 
    6464        /** map mode */ 
     
    7676                this.help = extraInfo.help || null; 
    7777        } 
    78 } 
     78}; 
    7979/** 
    8080 * @method 
     
    8585 */ 
    8686viEditor.Map.prototype.hasName = function(name){ 
    87         for (var i=0; i<this.names.length; i++){ 
    88                 if(this.names[i] == name){ 
    89                         return true; 
    90                 } 
    91         } 
    92         return false; 
     87        return this.names.some(function(n){ 
     88                return n == name; 
     89        }); 
    9390}; 
    9491/** 
     
    108105        if(this.flags & viEditor.mapFlags.MOTION){ 
    109106                args.push(motion); 
    110                 args.push(argument) 
     107                args.push(argument); 
    111108                args.push(motionCount >= 1 ? motionCount : 0); 
    112109        } 
     
    124121         * main map list 
    125122         * @type {Array} 
    126          */  
     123         */ 
    127124        var mainMaps = []; 
    128125        /** 
     
    155152        function getMap(mode, cmd, stack){ 
    156153                var maps = stack[mode]; 
    157                 if (!maps) {  return null; } 
     154                if (!maps) { return null; } 
    158155                var names; 
    159156                for (var i=0; i<maps.length; i++){ 
    160157                        names = maps[i].names; 
    161                         for (var j=0; j<names.length; j++){ 
     158                        for (let j=0; j<names.length; j++){ 
    162159                                if(names[j] == cmd){ 
    163160                                        return maps[i]; 
     
    177174                for (var i=0; i<maps.length; i++){ 
    178175                        names = maps[i].names; 
    179                         for (var j=0; j<names.length; j++){ 
     176                        for (let j=0; j<names.length; j++){ 
    180177                                if(names[j] == cmd){ 
    181178                                        names.splice(j,1); 
     
    301298                function(c){ 
    302299                        if (c > 0){ 
    303                                 viEditor.caret.to(viEditor.caret.getPositionFromCordinate(c,0)); 
     300                                viEditor.caret.to(viEditor.caret.getPositionFromCoordinate(c,0)); 
    304301                        } else { 
    305302                                viEditor.caret.to(viEditor.input.target.textLength); 
     
    308305                },{ 
    309306                        flags: viEditor.mapFlags.COUNT, 
    310                         shortHelp: 'Goto line <var>{count}</var> of the non-brank character', 
     307                        shortHelp: 'Goto line <var>{count}</var> of the non-blank character', 
    311308                        help: 'If not <var>{count}</var>, goto the last line' 
    312309                } 
     
    315312                function(c){ 
    316313                        if (c > 0){ 
    317                                 viEditor.caret.to(viEditor.caret.getPositionFromCordinate(c,0)); 
     314                                viEditor.caret.to(viEditor.caret.getPositionFromCoordinate(c,0)); 
    318315                                viEditor.caret.toEndOfLine(); 
    319316                        } else { 
     
    322319                },{ 
    323320                        flags: viEditor.mapFlags.COUNT, 
    324                         shortHelp: 'Goto line <var>{count}</var> of the last charactor', 
     321                        shortHelp: 'Goto line <var>{count}</var> of the last character', 
    325322                        help: 'If not <var>{count}</var>, goto the last line' 
    326323                } 
     
    543540                        var map = viEditor.mappings.getMainMap(viEditor.modes.NORMAL,'d'); 
    544541                        if ( map.execute(c,(m == 'c' ? 'd' : m),arg,mc) ){ 
    545                                 if (/^[jkc]$/.test(m)){ 
     542                                if (/^[cjk]$/.test(m)){ 
    546543                                        viEditor.mappings.getMainMap(viEditor.modes.NORMAL,'O').execute(null,null,null,null); 
    547544                                } else { 
     
    954951                function(){ 
    955952                        viEditor.setMode(viEditor.modes.NORMAL); 
    956                         viEditor.commandLine.focus('/') 
     953                        viEditor.commandLine.focus('/'); 
    957954                } 
    958955        )); 
     
    10451042                 */ 
    10461043                getUserIterator: function(mode){ 
    1047                         return mappingsIterator(mode, userMaps) 
     1044                        return mappingsIterator(mode, userMaps); 
    10481045                }, 
    10491046                /** 
    1050                  * Return true if cmd matches one of userMaps names  
     1047                 * Return true if cmd matches one of userMaps names 
    10511048                 * @alias viEditor.mappings.hasMap 
    10521049                 * @method 
     
    10561053                 */ 
    10571054                hasMap: function(mode, cmd){ 
    1058                         var maps = userMaps[mode]; 
    1059                         for (var i=0; i<maps.length; i++){ 
    1060                                 if(maps[i].names.indexOf(cmd) != -1){ 
    1061                                         return true; 
    1062                                 } 
    1063                         } 
    1064                         return false; 
     1055                        return userMaps[mode].some(function(map){ 
     1056                                return map.names.indexOf(cmd) > -1; 
     1057                        }); 
    10651058                }, 
    10661059                /** 
     
    11391132                                /** @type {viEditor.Map} */ 
    11401133                                var map = mappings[i]; 
    1141                                 for (var j=0; j<map.names.length; j++){ 
     1134                                for (let j=0; j<map.names.length; j++){ 
    11421135                                        if(map.names[j].indexOf(cmd) == 0){ 
    11431136                                                matches.push(map); 
  • platform/firefox/textareavieditor/content/vi_options.js

    • Property svn:executable deleted
    r8686 r8692  
    44/*  ***** BEGIN LICENSE BLOCK ***** 
    55 *  Version: MPL 1.1/GPL 2.0/LGPL 2.1 
    6  *   
     6 * 
    77 *  The contents of this file are subject to the Mozilla Public License Version 
    88 *  1.1 (the "License"); you may not use this file except in compliance with 
    99 *  the License. You may obtain a copy of the License at 
    1010 *  http://www.mozilla.org/MPL/ 
    11  *   
     11 * 
    1212 *  Software distributed under the License is distributed on an "AS IS" basis, 
    1313 *  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 
    1414 *  for the specific language governing rights and limitations under the License. 
    15  *  
     15 * 
    1616 *  (c) 2007-2008: teramako <teramako@gmail.com> 
    17  *  
     17 * 
    1818 *  Alternatively, the contents of this file may be used under the terms of 
    1919 *  either the GNU General Public License Version 2 or later (the "GPL"), or 
     
    5353        } 
    5454        var value = null; 
    55          
     55 
    5656        this.name = names[0]; 
    5757        this.names = names; 
     
    5959        this.type = type; 
    6060        this.storable = false; 
    61          
     61 
    6262        if (extraInfo){ 
    6363                if (extraInfo.usage){ 
     
    7575                } 
    7676                value = this.defaultValue; 
    77                  
     77 
    7878                if (extraInfo.setter){ 
    7979                        this.setter = extraInfo.setter; 
     
    8484                this.completer = extraInfo.completer || null; 
    8585                this.validator = extraInfo.validator || null; 
    86                  
     86 
    8787                if (this.type == 'boolean'){ 
    8888                        this.names = []; 
     
    219219                      'If not, value is computed as absoluted px size', 
    220220                setter: function(width){ 
    221                         var list = width.match(/^([+-])?([\d]+)$/); 
     221                        var list = width.match(/^([+-])?(\d+)$/); 
    222222                        if (!list || !viEditor.input.target) return; 
    223223                        var w = parseInt(width,10); 
     
    225225                        if (list[1]){ 
    226226                                var s = t.ownerDocument.defaultView.getComputedStyle(t, null); 
    227                                 var fontSize = parseInt(s.getPropertyValue('font-size').replace('px',''), 10); 
     227                                var fontSize = parseInt(s.getPropertyValue('font-size').replace(/\D+/g,''), 10); 
    228228                                w = t.scrollWidth + (w * fontSize); 
    229229                        } 
     
    237237})(); 
    238238viEditor.options.add(new viEditor.Option(['height'], 'number', { 
    239         shortHelp: 'Set texarea height(px)', 
     239        shortHelp: 'Set textarea height(px)', 
    240240        help: 'If argument is begnning of "+" or "-", it\'s computed as relative value which is timed font-size.<br/>' + 
    241241              'If not, value is computed as absoluted ps size.', 
    242242        setter: function(height){ 
    243                 var list = height.match(/^([+-])?([\d]+)$/); 
     243                var list = height.match(/^([+-])?(\d+)$/); 
    244244                if (!list | !viEditor.input.target) return; 
    245245                var h = parseInt(height,10); 
     
    248248                        var s = t.ownerDocument.defaultView.getComputedStyle(t, null); 
    249249                        var lineHeight = s.getPropertyValue('line-height'); 
    250                         var fontSize = parseInt(s.getPropertyValue('font-size').repralce('px',''),10); 
     250                        var fontSize = parseInt(s.getPropertyValue('font-size').repralce(/\D+/g,''),10); 
    251251                        var currentLineHeight; 
    252252                        if (lineHeight == 'normal'){ 
    253253                                currentLineHeight = 1.25 * fontSize; 
    254254                        } else { 
    255                                 currentLineHeight = parseInt(lineHeight.replace('px',''),10); 
     255                                currentLineHeight = parseInt(lineHeight.replace(/\D+/g,''),10); 
    256256                        } 
    257257                        h = t.scrollHeight + (h * currentLineHeight); 
     
    308308        storable: true 
    309309})); 
    310          
     310 
  • platform/firefox/textareavieditor/content/vi_utils.js

    • Property svn:executable deleted
    r8686 r8692  
    55/*  ***** BEGIN LICENSE BLOCK ***** 
    66 *  Version: MPL 1.1/GPL 2.0/LGPL 2.1 
    7  *   
     7 * 
    88 *  The contents of this file are subject to the Mozilla Public License Version 
    99 *  1.1 (the "License"); you may not use this file except in compliance with 
    1010 *  the License. You may obtain a copy of the License at 
    1111 *  http://www.mozilla.org/MPL/ 
    12  *   
     12 * 
    1313 *  Software distributed under the License is distributed on an "AS IS" basis, 
    1414 *  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 
    1515 *  for the specific language governing rights and limitations under the License. 
    16  *  
     16 * 
    1717 *  (c) 2007-2008: teramako <teramako@gmail.com> 
    18  *  
     18 * 
    1919 *  Alternatively, the contents of this file may be used under the terms of 
    2020 *  either the GNU General Public License Version 2 or later (the "GPL"), or 
     
    7373                var startLineNum = t.value.substring(0, start).split('\n').length; 
    7474                var lineNum = t.value.substring(start,end).split('\n').length; 
    75                 var reg = new RegExp('^(\t|[ ]{1,' + (count*viEditor.options.shiftwidth) +'})','g'); 
     75                var reg = new RegExp('^(?:\\t| {1,' + (count*viEditor.options.shiftwidth) +'})','g'); 
    7676                for (var i=startLineNum-1; i<startLineNum+lineNum-1; i++){ 
    7777                        lines[i] = lines[i].replace(reg,''); 
  • platform/firefox/textareavieditor/defaults/preferences/textareavieditor.js

    • Property svn:executable deleted
    r8686 r8692  
    33pref('extensions.vieditor.vfg', '-moz-fieldtext'); 
    44pref('extensions.vieditor.vlfg', '-moz-fieldtext'); 
    5 perf('extensions.vieditor.ibg', '-moz-field'); 
    6 perf('extensions.vieditor.nbg', '-moz-field'); 
    7 perf('extensions.vieditor.vbg', '-moz-field'); 
    8 perf('extensions.vieditor.vlbg', '-moz-field'); 
     5pref('extensions.vieditor.ibg', '-moz-field'); 
     6pref('extensions.vieditor.nbg', '-moz-field'); 
     7pref('extensions.vieditor.vbg', '-moz-field'); 
     8pref('extensions.vieditor.vlbg', '-moz-field'); 
    99pref('extensions.vieditor.shiftwidth', 4); 
    1010 
  • platform/firefox/textareavieditor/install.rdf

    • Property svn:executable deleted
    r8686 r8692  
    99                <em:id>textareavieditor@teramako.ddo.jp</em:id> 
    1010                <em:type>2</em:type> 
    11                  
     11 
    1212                <em:targetApplication> 
    1313                        <!-- Firefox --> 
     
    2727                <em:localized> 
    2828                        <Description> 
    29                                 <em:locale>ja-JP</em:locale> 
     29                                <em:locale>ja</em:locale> 
    3030                                <em:name>Textarea viEditor</em:name> 
    3131                                <em:description>vim のような操作で textarea を編集</em:description> 
  • platform/firefox/textareavieditor/locale/en-US/textareavieditor.dtd

    • Property svn:executable deleted
  • platform/firefox/textareavieditor/skin/textareavieditor.css

    • Property svn:executable deleted