Sha256: abf5c6853a08761764d7fc18f21a896dfc3deddf5b1678c91e4a07cd58562df0

Contents?: true

Size: 1.4 KB

Versions: 63

Compression:

Stored size: 1.4 KB

Contents

$.fn.serializeXML = function () {
    var out = '';
    if (typeof XMLSerializer == 'function') {
        var xs = new XMLSerializer();
        this.each(function() {
            out += xs.serializeToString(this);
        });
    } else if (this[0] && this[0].xml != 'undefined') {
        this.each(function() {
            out += this.xml;
        });
    }
    return out;
};
$.fn.serializePrettyXML = function () {
    var out = '';
    if (typeof XMLSerializer == 'function') {
        var xs = new XMLSerializer();
        this.each(function() {
            out += XML(xs.serializeToString(this)).toXMLString();
        });
    } else if (this[0] && this[0].xml != 'undefined') {
        this.each(function() {
            out += this.xml;
        });
    }
    return out;
};

String.prototype.repeat = function(num) {
  return new Array(num + 1).join(this);
};

String.prototype.unserialize = function() {
  var data = this.split("&");
  var ret = new Array();
  $.each(data, function(){
      var properties = this.split("=");
      ret.push([properties[0], properties[1]]);
  });
  return ret;
};

String.prototype.parseXML = function() {         
  if (window.ActiveXObject && window.GetObject) {
    var dom = new ActiveXObject('Microsoft.XMLDOM');
    dom.loadXML(this);
    return dom;
  }
  if (window.DOMParser)
    return new DOMParser().parseFromString(this,'text/xml');
  throw new Error('NoXMLparser available');
} 

Version data entries

63 entries across 63 versions & 1 rubygems

Version Path
cpee-1.3.170 cockpit/lib/util.js
cpee-1.3.169 cockpit/lib/util.js
cpee-1.3.167 cockpit/lib/util.js
cpee-1.3.166 cockpit/lib/util.js
cpee-1.3.164 cockpit/lib/util.js
cpee-1.3.163 cockpit/lib/util.js
cpee-1.3.162 cockpit/lib/util.js
cpee-1.3.161 cockpit/lib/util.js
cpee-1.3.160 cockpit/lib/util.js
cpee-1.3.159 cockpit/lib/util.js
cpee-1.3.158 cockpit/lib/util.js
cpee-1.3.157 cockpit/lib/util.js
cpee-1.3.156 cockpit/lib/util.js
cpee-1.3.155 cockpit/lib/util.js
cpee-1.3.154 cockpit/lib/util.js
cpee-1.3.153 cockpit/lib/util.js
cpee-1.3.152 cockpit/lib/util.js
cpee-1.3.151 cockpit/lib/util.js
cpee-1.3.150 cockpit/lib/util.js
cpee-1.3.149 cockpit/lib/util.js