Changeset 19579 for platform

Show
Ignore:
Timestamp:
09/19/08 11:14:10 (2 months ago)
Author:
drry
Message:
  • fixed regexes.
  • et cetera.
Location:
platform/firefox/FireMobileSimulator/trunk
Files:
1 removed
48 modified
1 moved

Legend:

Unmodified
Added
Removed
  • platform/firefox/FireMobileSimulator/trunk/build.xml

    • Property svn:mime-type deleted
    r19538 r19579  
    22 
    33<project name="FireMobileSimulator" default="dist"> 
    4         <property name="src.dir" value="src" /> 
    5         <property name="dist.dir" value="dist" /> 
    6         <property name="app.name" value="FireMobileSimulator" /> 
    7         <property name="app.code" value="msim" /> 
    8         <property name="app.id" value="{77cc852e-6b45-11dd-929f-d30256d89593}" /> <!-- extension id like: xxx@xxx.com --> 
    9         <property name="ff.dir" value="C:\Documents and Settings\horikawa_t\Application Data\Mozilla\Firefox\Profiles\dzneq73f.nms\extensions\" /> 
     4        <property name="src.dir" value="src"/> 
     5        <property name="dist.dir" value="dist"/> 
     6        <property name="app.name" value="FireMobileSimulator"/> 
     7        <property name="app.code" value="msim"/> 
     8        <property name="app.id" value="{77cc852e-6b45-11dd-929f-d30256d89593}"/> <!-- extension id like: xxx@xxx.com --> 
     9        <property name="fx.dir" value="C:\Documents and Settings\horikawa_t\Application Data\Mozilla\Firefox\Profiles\dzneq73f.nms\extensions\"/> 
    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> 
    17          
     17 
    1818        <target name="chrome"> 
    19                 <mkdir dir="${dist.dir}" /> 
    20                 <mkdir dir="${dist.dir}/chrome" /> 
     19                <mkdir dir="${dist.dir}"/> 
     20                <mkdir dir="${dist.dir}/chrome"/> 
    2121                <zip destfile="${dist.dir}/chrome/${app.code}.jar"> 
    2222                        <fileset dir="${src.dir}/chrome"> 
    23                                 <include name="content/**" /> 
    24                                 <include name="locale/**" /> 
    25                                 <include name="skin/**" /> 
    26                                 <exclude name="**/Thumbs.db" /> 
    27                                 <exclude name="**/.*" /> 
    28                                 <exclude name="**/CVS/**" /> 
     23                                <include name="content/**"/> 
     24                                <include name="locale/**"/> 
     25                                <include name="skin/**"/> 
     26                                <exclude name="**/Thumbs.db"/> 
     27                                <exclude name="**/.*"/> 
     28                                <exclude name="**/CVS/**"/> 
    2929                        </fileset> 
    3030                </zip> 
    3131        </target> 
    3232 
    33         <target name="test.chrome" depends="chrome" if="ff.present"> 
     33        <target name="test.chrome" depends="chrome" if="fx.present"> 
    3434                <!-- copy to chrome directory --> 
    35                 <copy file="${dist.dir}/chrome/${app.code}.jar" todir="${ff.dir}/chrome/chrome" overwrite="true" /> 
    36                 <copy file="${src.dir}/chrome.manifest" tofile="${ff.dir}/chrome/${app.name}.manifest" overwrite="true" /> 
     35                <copy file="${dist.dir}/chrome/${app.code}.jar" todir="${fx.dir}/chrome/chrome" overwrite="true"/> 
     36                <copy file="${src.dir}/chrome.manifest" tofile="${fx.dir}/chrome/${app.name}.manifest" overwrite="true"/> 
    3737        </target> 
    38          
     38 
    3939        <!-- copy to extensions directory --> 
    4040        <!-- 
    41         <target name="test.ext" depends="chrome" if="ff.present"> 
    42                 <copy file="${dist.dir}/${app.name}.jar" todir="${ff.dir}/extensions/${app.id}/chrome" overwrite="true" /> 
    43                 <copy file="${src.dir}/chrome.manifest" todir="${ff.dir}/extensions/${app.id}" overwrite="true" /> 
     41        <target name="test.ext" depends="chrome" if="fx.present"> 
     42                <copy file="${dist.dir}/${app.name}.jar" todir="${fx.dir}/extensions/${app.id}/chrome" overwrite="true"/> 
     43                <copy file="${src.dir}/chrome.manifest" todir="${fx.dir}/extensions/${app.id}" overwrite="true"/> 
    4444        </target> 
    4545        --> 
    46          
     46 
    4747        <target name="dist" depends="chrome"> 
    4848                <zip destfile="${dist.dir}/${app.name}.xpi"> 
    4949                        <zipfileset file="${dist.dir}/chrome/${app.code}.jar" prefix="chrome"/> 
    5050                        <fileset dir="${src.dir}"> 
    51                                 <include name="chrome.manifest" /> 
    52                                 <include name="install.rdf" /> 
    53                                 <include name="defaults/**" /> 
    54                                 <include name="components/**" /> 
    55                                 <exclude name="**/.*" /> 
    56                                 <exclude name="**/CVS/**" /> 
     51                                <include name="chrome.manifest"/> 
     52                                <include name="install.rdf"/> 
     53                                <include name="defaults/**"/> 
     54                                <include name="components/**"/> 
     55                                <exclude name="**/.*"/> 
     56                                <exclude name="**/CVS/**"/> 
    5757                        </fileset> 
    5858                </zip> 
    59                 <copy file="${dist.dir}/chrome/${app.code}.jar" todir="${ff.dir}/${app.id}/chrome" /> 
    60                 <copy todir="${ff.dir}/${app.id}"> 
     59                <copy file="${dist.dir}/chrome/${app.code}.jar" todir="${fx.dir}/${app.id}/chrome"/> 
     60                <copy todir="${fx.dir}/${app.id}"> 
    6161                        <fileset dir="${src.dir}"> 
    62                                 <include name="chrome.manifest" /> 
    63                                 <include name="install.rdf" /> 
    64                                 <include name="defaults/**" /> 
    65                                 <include name="components/**" /> 
    66                                 <exclude name="**/.*" /> 
    67                                 <exclude name="**/CVS/**" /> 
     62                                <include name="chrome.manifest"/> 
     63                                <include name="install.rdf"/> 
     64                                <include name="defaults/**"/> 
     65                                <include name="components/**"/> 
     66                                <exclude name="**/.*"/> 
     67                                <exclude name="**/CVS/**"/> 
    6868                        </fileset> 
    6969                </copy> 
    7070        </target> 
    71          
     71 
    7272        <target name="clean"> 
    73                 <delete dir="${dist.dir}" /> 
     73                <delete dir="${dist.dir}"/> 
    7474        </target> 
    7575 
    76         <target name="clean.ff"  if="ff.present"> 
    77                 <delete dir="${ff.dir}/extensions/${app.id}" failonerror="false" /> 
    78                 <delete file="${ff.dir}/chrome/${app.name}.manifest" failonerror="false" /> 
    79                 <delete file="${ff.dir}/chrome/chrome/${app.name}.jar" failonerror="false" /> 
     76        <target name="clean.ff" if="fx.present"> 
     77                <delete dir="${fx.dir}/extensions/${app.id}" failonerror="false"/> 
     78                <delete file="${fx.dir}/chrome/${app.name}.manifest" failonerror="false"/> 
     79                <delete file="${fx.dir}/chrome/chrome/${app.name}.jar" failonerror="false"/> 
    8080        </target> 
    8181 
  • platform/firefox/FireMobileSimulator/trunk/src/chrome.manifest

    r19538 r19579  
    11content msim    jar:chrome/msim.jar!/content/ 
    22content msim    jar:chrome/msim.jar!/content/ contentaccessible=yes 
    3 locale  msim    ja-JP   jar:chrome/msim.jar!/locale/ja-JP/ 
     3locale  msim    ja      jar:chrome/msim.jar!/locale/ja/ 
    44skin    msim    classic/1.0     jar:chrome/msim.jar!/skin/ 
    55overlay chrome://browser/content/browser.xul    chrome://msim/content/firefoxOverlay.xul 
  • platform/firefox/FireMobileSimulator/trunk/src/chrome/content/about.xul

    • Property svn:mime-type deleted
    r19538 r19579  
    5252  <separator class="thin"/> 
    5353  <label value="&homepage;" style="font-weight: bold;"/> 
    54   <label onclick="openURL(this.value)" class="text-link" value="https://addons.mozilla.org/ja/firefox/addon/8519" /> 
     54  <label onclick="openURL(this.value)" class="text-link" value="https://addons.mozilla.org/ja/firefox/addon/8519"/> 
    5555  <separator class="thin"/> 
    5656</vbox> 
  • platform/firefox/FireMobileSimulator/trunk/src/chrome/content/carrier/common.js

    • Property svn:mime-type deleted
    r19538 r19579  
    11var MPC_SJIS = "SJIS"; 
    2 var MPC_UTF8 = "UTF-8" 
    3 var MPC_EUCJP = "EUC_JP" 
     2var MPC_UTF8 = "UTF-8"; 
     3var MPC_EUCJP = "EUC_JP"; 
    44 
    55var HexStrings = function(hexstrings, charset) { 
     
    1414        i : 0, 
    1515        hasNextCharacter : function() { 
    16                 if (this.i < this.hexstrings.length - 1) { 
    17                         return true; 
    18                 } else { 
    19                         return false; 
    20                 } 
     16                return this.i < (this.hexstrings.length - 1); 
    2117        }, 
    2218 
     
    4642                } 
    4743        } 
    48 } 
     44}; 
    4945 
    5046function unpack(str) { 
     
    6662        } 
    6763        var unicode = EscapeUnicode(UnescapeSJIS(hex)); 
    68         if (unicode.match(/^\%u[0-9A-F]{4}$/) || unicode.match(/^\%[0-9A-F]{2}$/)) { 
     64        if (/^\%(?:u[0-9A-F]{4}|[0-9A-F]{2})$/.test(unicode)) { 
    6965                //dump("return" + parseInt(unicode.substring(2, 6), 16) + "\n"); 
    7066                return parseInt(unicode.substring(2, 6), 16); 
     
    8177        } 
    8278        var unicode = EscapeUnicode(UnescapeUTF8(hex)); 
    83         if (unicode.match(/^\%u[0-9A-F]{4}$/) || unicode.match(/^\%[0-9A-F]{2}$/)) { 
     79        if (/^\%(?:u[0-9A-F]{4}|[0-9A-F]{2})$/.test(unicode)) { 
    8480                //dump("return" + parseInt(unicode.substring(2, 6), 16) + "\n"); 
    8581                return parseInt(unicode.substring(2, 6), 16); 
     
    8985} 
    9086 
    91 function utf82unicode(bits){ 
     87function utf82unicode(bits) { 
    9288        var rbits = new Array(2); 
    93         if(bits.length == 3){ 
     89        if (bits.length == 3) { 
    9490                var x = bits[0] & 0x0F; 
    9591                var y = bits[1] & 0x3F; 
     
    9793                rbits[0] = (x << 4) + (y >> 2); 
    9894                rbits[1] = ((y & 0x3) << 6) + z; 
    99         }else{ 
     95        } else { 
    10096                dump("NOT IMPLEMENTED!\n"); 
    10197        } 
     
    10399} 
    104100 
    105 function unicode2utf8(bits){ 
     101function unicode2utf8(bits) { 
    106102        var rbits = new Array(3); 
    107         if(bits.length == 2){ 
     103        if (bits.length == 2) { 
    108104                rbits[0] = 0xE0 + (bits[0] >> 4); 
    109105                rbits[1] = 0x80 + ((bits[0] & 0x0F) << 2) + (bits[1] >> 6); 
    110106                rbits[2] = 0x80 + (0x3F & bits[1]); 
    111         }else{ 
     107        } else { 
    112108                dump("NOT IMPLEMENTED!\n"); 
    113109        } 
     
    115111} 
    116112 
    117 function bits2dec(bits){ 
    118         var r=0; 
    119         for(var i=0; i<bits.length; i++){ 
     113function bits2dec(bits) { 
     114        var r = 0; 
     115        for (var i=0; i<bits.length; i++) { 
    120116                r += bits[i] << (8*(bits.length-i-1)); 
    121117        } 
    122118        //dump(bits[0].toString(16)+",return to:"+r+"\n"); 
    123         //if(bits.length>1){ 
     119        //if (bits.length>1) { 
    124120                //dump(bits[1].toString(16)+",return to:"+r+"\n"); 
    125121        //} 
  • platform/firefox/FireMobileSimulator/trunk/src/chrome/content/carrier/ezweb.js

    • Property svn:mime-type deleted
    r19538 r19579  
    2828        _____convert : function(str) { 
    2929                // 2008/09/03 この変換は正規表現でなくてDOMでやった方が良いので使っていない 
    30                 var re1 = /<img\s+(icon|localsrc)="?([0-9]+)"?\s*>/ig; 
     30                var re1 = /<img\s+(?:icon|localsrc)\s*=\s*(["']?)([0-9]+)\1\s*>/ig; 
    3131 
    3232                var _this = this; 
    3333                var f = function(whole, s1, s2) { 
    3434                        return _this.e_options_encode(s2); 
    35                 } 
     35                }; 
    3636                str = str.replace(re1, f); 
    3737                return str; 
     
    4545         */ 
    4646        setImagePath : function(path) { 
    47                 path.replace(RegExp('/*$'), ''); 
     47                path.replace(RegExp('/+$'), ''); 
    4848                this.e_img_path = path + '/e/'; 
    4949        }, 
     
    6565 
    6666        getImageSrc : function(iconno) { 
    67                 return this.e_img_path.replace(/[/]*$/g, "") + '/' + iconno + '.gif'; 
     67                return this.e_img_path.replace(/\/+$/g, "") + '/' + iconno + '.gif'; 
    6868        }, 
    69          
     69 
    7070        getIconNumFromIconName : function(iconname){ 
    7171                //javascriptの予約語が含まれているため、キー名の先頭に_(アンダーバー)を付与している 
     
    773773                        result = false; 
    774774                } 
    775                  
    776                 if(char1 == 0xEE && char2 == 0x94){ 
     775 
     776                if (char1 == 0xEE && char2 == 0x94) { 
    777777                        dump("##probably pictogram?? "+char1+":"+char2+":"+char3+"\n") 
    778778                } 
     
    823823                        if (_this.isPictogramSJISDecs(decs)) { 
    824824                                // decsはSJISの文字コード 
    825                                 dump("au SJIS 16 match\n") 
     825                                dump("au SJIS 16 match\n"); 
    826826                                return _this 
    827827                                                .e_options_encode(_this.getIconMapSJIS()[bits2dec(decs)]); 
    828828                        } else if (_this.isPictogramUnicodeDecs(decs)) { 
    829829                                // decsはUnicode 
    830                                 dump("au Unicode 16 match\n") 
     830                                dump("au Unicode 16 match\n"); 
    831831                                return _this 
    832832                                                .e_options_encode(_this.getIconMapUnicode()[bits2dec(decs)]); 
     
    838838                }); 
    839839                // SJIS10進数値参照を、SJIS文字コードに変換 
    840                 var re2 = /\&\#([0-9]{5});/ig; 
     840                var re2 = /\&\#([0-9]{5});/g; 
    841841                str = str.replace(re2, function(whole, s1) { 
    842842                        dump("[mpc]au regmatch10:" + s1 + "\n"); 
     
    853853                        if (_this.isPictogramSJISDecs(decs)) { 
    854854                                // decsはSJISの文字コード 
    855                                 dump("au SJIS 10 match\n") 
     855                                dump("au SJIS 10 match\n"); 
    856856                                return _this 
    857857                                                .e_options_encode(_this.getIconMapSJIS()[bits2dec(decs)]); 
    858858                        } else if (_this.isPictogramUnicodeDecs(decs)) { 
    859859                                // decsはUnicode 
    860                                 dump("au Unicode 10 match\n") 
     860                                dump("au Unicode 10 match\n"); 
    861861                                return _this 
    862862                                                .e_options_encode(_this.getIconMapUnicode()[bits2dec(decs)]); 
    863863                        } else { 
    864                                 dump("au 10 no match\n") 
     864                                dump("au 10 no match\n"); 
    865865                                // return String.fromCharCode(dec1) + String.fromCharCode(dec2); 
    866866                                return whole; 
     
    910910                        return r; 
    911911                } 
    912                 r[0] = bits[0] + 0x07 
     912                r[0] = bits[0] + 0x07; 
    913913                r[1] = bits[1]; 
    914914                return r; 
     
    15591559                                62604 : 821, 
    15601560                                62605 : 822 
    1561                         } 
     1561                        }; 
    15621562                } 
    15631563                return this.icomMap; 
     
    22082208                                60295 : 821, 
    22092209                                60296 : 822 
    2210                         } 
     2210                        }; 
    22112211                } 
    22122212                return this.icomMap; 
  • platform/firefox/FireMobileSimulator/trunk/src/chrome/content/carrier/foma.js

    • Property svn:mime-type deleted
    r19538 r19579  
    2828                dump("[mpc]DoCoMo convert start.charset = "+this.charset+"\n"); 
    2929                // Firefoxから数値参照が直接渡ってこないので、とりあえずコメントアウト 
    30                 // var re1 = /\&\#x([a-f0-9]{4});/ig; 
    31                 // var re2 = /\&\#([0-9]{5});/ig; 
     30                // var re1 = /&#x([a-f0-9]{4});/ig; 
     31                // var re2 = /&#([0-9]{5});/g; 
    3232                // var _this = this; 
    3333                // Unicodeの16進数値文字参照をimgタグ形式に変換 
    34                 // str = str.replace(re1, function(whole, s1){ var udec = 
     34                // str = str.replace(re1, function(whole, s1) { var udec = 
    3535                // parseInt(s1,16); return _this.isPictogramDec(udec) ? 
    3636                // _this.i_options_encode(udec) : s1 ; }); 
    3737                // SJISの10進数値文字参照をimgタグ形式に変換 
    38                 // str = str.replace(re2, function(whole, s1){ var udec = sdec2udec(s1); 
     38                // str = str.replace(re2, function(whole, s1) { var udec = sdec2udec(s1); 
    3939                // return _this.isPictogramDec(udec) ? _this.i_options_encode(udec) : s1 
    4040                // ; }); 
     
    4848                // いきなりimgタグに変換する 
    4949                dump("[mpc]DoCoMo Unicode16match start\n"); 
    50                 var re1 = /\&\#x([a-f0-9]{2})([a-f0-9]{2});/ig; 
     50                var re1 = /&#x([a-f0-9]{2})([a-f0-9]{2});/ig; 
    5151                var _this = this; 
    5252                str = str.replace(re1, function(whole, s1, s2) { 
     
    6767                if (this.charset == MPC_SJIS) { 
    6868                        dump("[mpc]DoCoMo SJIS10match start\n"); 
    69                         var regNumericReferenceDec = /\&\#([0-9]{5});/ig; 
     69                        var regNumericReferenceDec = /&#([0-9]{5});/g; 
    7070                        str = str.replace(regNumericReferenceDec, function(whole, s1) { 
    7171                                //dump("regmatch10:" + s1 + "\n"); 
     
    192192         */ 
    193193        setImagePath : function(path) { 
    194                 path.replace(RegExp('/*$'), ''); 
     194                path.replace(RegExp('/+$'), ''); 
    195195                this.i_img_path = path + '/i/'; 
    196196        }, 
     
    204204         */ 
    205205        i_options_encode : function(dec) { 
    206                 var buf = '<img src="' + this.i_img_path.replace(/[/]*$/g, "") + '/' 
     206                var buf = '<img src="' + this.i_img_path.replace(/\/+$/g, "") + '/' 
    207207                                + dec + '.gif" alt="" border="0" width="12" height="12" />'; 
    208208                return buf;