Develop and Download Open Source Software

Browse Subversion Repository

Diff of /js/common.js

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 29 by berupon, Tue Jan 12 02:00:59 2010 UTC revision 31 by berupon, Fri Jan 15 02:21:32 2010 UTC
# Line 636  function clone_obj(obj) { Line 636  function clone_obj(obj) {
636  String.prototype.htmlspecialchars = function() {  String.prototype.htmlspecialchars = function() {
637          ch = this + "";          ch = this + "";
638          ch = ch.replace(/&/g,"&") ;          ch = ch.replace(/&/g,"&") ;
639          ch = ch.replace(/"/g,""") ;          ch = ch.replace(/"/g,""") ; // "
640          ch = ch.replace(/'/g,"'") ;          ch = ch.replace(/'/g,"'") ; // '
641          ch = ch.replace(/</g,"&lt;") ;          ch = ch.replace(/</g,"&lt;") ;
642          ch = ch.replace(/>/g,"&gt;") ;          ch = ch.replace(/>/g,"&gt;") ;
643          return ch ;          return ch ;
# Line 658  function htmlspecialchars(str) { Line 658  function htmlspecialchars(str) {
658                  return "";                  return "";
659          }          }
660  }  }
661    
662    // innerHTMLで設定したスクリプトの内容がFirefox以外のブラウザでも実行されるようにする為に。
663    // 要:戻り値のNodeを他のNodeに追加
664    function createNodeWithScript(html) {
665            var div = document.createElement("div");
666            div.innerHTML = html;
667            if (Prototype.Browser.IE || Prototype.Browser.WebKit || Prototype.Browser.Opera) {
668                    var texts = new Array();
669                    var scripts = div.getElementsByTagName("script");
670                    for (var i=0; i<scripts.length; ++i) {
671                            var script = scripts[i];
672                            texts.push(script.text);
673                    }
674                    var script = document.createElement("script");
675                    script.text = texts.join("\r");
676                    div.appendChild(script);
677            }
678            return div;
679    }
680    

Legend:
Removed from v.29  
changed lines
  Added in v.31

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26