1 | !function(e){if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.S=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
|
2 | function count(self, substr) {
|
3 | var count = 0
|
4 | var pos = self.indexOf(substr)
|
5 |
|
6 | while (pos >= 0) {
|
7 | count += 1
|
8 | pos = self.indexOf(substr, pos + 1)
|
9 | }
|
10 |
|
11 | return count
|
12 | }
|
13 |
|
14 | module.exports = count
|
15 | },{}],2:[function(_dereq_,module,exports){
|
16 | function splitLeft(self, sep, maxSplit, limit) {
|
17 |
|
18 | if (typeof maxSplit === 'undefined') {
|
19 | var maxSplit = -1;
|
20 | }
|
21 |
|
22 | var splitResult = self.split(sep);
|
23 | var splitPart1 = splitResult.slice(0, maxSplit);
|
24 | var splitPart2 = splitResult.slice(maxSplit);
|
25 |
|
26 | if (splitPart2.length === 0) {
|
27 | splitResult = splitPart1;
|
28 | } else {
|
29 | splitResult = splitPart1.concat(splitPart2.join(sep));
|
30 | }
|
31 |
|
32 | if (typeof limit === 'undefined') {
|
33 | return splitResult;
|
34 | } else if (limit < 0) {
|
35 | return splitResult.slice(limit);
|
36 | } else {
|
37 | return splitResult.slice(0, limit);
|
38 | }
|
39 |
|
40 | }
|
41 |
|
42 | module.exports = splitLeft;
|
43 |
|
44 | },{}],3:[function(_dereq_,module,exports){
|
45 | function splitRight(self, sep, maxSplit, limit) {
|
46 |
|
47 | if (typeof maxSplit === 'undefined') {
|
48 | var maxSplit = -1;
|
49 | }
|
50 | if (typeof limit === 'undefined') {
|
51 | var limit = 0;
|
52 | }
|
53 |
|
54 | var splitResult = [self];
|
55 |
|
56 | for (var i = self.length-1; i >= 0; i--) {
|
57 |
|
58 | if (
|
59 | splitResult[0].slice(i).indexOf(sep) === 0 &&
|
60 | (splitResult.length <= maxSplit || maxSplit === -1)
|
61 | ) {
|
62 | splitResult.splice(1, 0, splitResult[0].slice(i+sep.length));
|
63 | splitResult[0] = splitResult[0].slice(0, i)
|
64 | }
|
65 | }
|
66 |
|
67 | if (limit >= 0) {
|
68 | return splitResult.slice(-limit);
|
69 | } else {
|
70 | return splitResult.slice(0, -limit);
|
71 | }
|
72 |
|
73 | }
|
74 |
|
75 | module.exports = splitRight;
|
76 |
|
77 | },{}],4:[function(_dereq_,module,exports){
|
78 |
|
79 |
|
80 |
|
81 |
|
82 | !(function() {
|
83 | "use strict";
|
84 |
|
85 | var VERSION = '3.3.3';
|
86 |
|
87 | var ENTITIES = {};
|
88 |
|
89 |
|
90 | var latin_map={"Á":"A","Ă":"A","Ắ":"A","Ặ":"A","Ằ":"A","Ẳ":"A","Ẵ":"A","Ǎ":"A","Â":"A","Ấ":"A","Ậ":"A","Ầ":"A","Ẩ":"A","Ẫ":"A","Ä":"A","Ǟ":"A","Ȧ":"A","Ǡ":"A","Ạ":"A","Ȁ":"A","À":"A","Ả":"A","Ȃ":"A","Ā":"A","Ą":"A","Å":"A","Ǻ":"A","Ḁ":"A","Ⱥ":"A","Ã":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ḃ":"B","Ḅ":"B","Ɓ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ć":"C","Č":"C","Ç":"C","Ḉ":"C","Ĉ":"C","Ċ":"C","Ƈ":"C","Ȼ":"C","Ď":"D","Ḑ":"D","Ḓ":"D","Ḋ":"D","Ḍ":"D","Ɗ":"D","Ḏ":"D","Dz":"D","Dž":"D","Đ":"D","Ƌ":"D","DZ":"DZ","DŽ":"DZ","É":"E","Ĕ":"E","Ě":"E","Ȩ":"E","Ḝ":"E","Ê":"E","Ế":"E","Ệ":"E","Ề":"E","Ể":"E","Ễ":"E","Ḙ":"E","Ë":"E","Ė":"E","Ẹ":"E","Ȅ":"E","È":"E","Ẻ":"E","Ȇ":"E","Ē":"E","Ḗ":"E","Ḕ":"E","Ę":"E","Ɇ":"E","Ẽ":"E","Ḛ":"E","Ꝫ":"ET","Ḟ":"F","Ƒ":"F","Ǵ":"G","Ğ":"G","Ǧ":"G","Ģ":"G","Ĝ":"G","Ġ":"G","Ɠ":"G","Ḡ":"G","Ǥ":"G","Ḫ":"H","Ȟ":"H","Ḩ":"H","Ĥ":"H","Ⱨ":"H","Ḧ":"H","Ḣ":"H","Ḥ":"H","Ħ":"H","Í":"I","Ĭ":"I","Ǐ":"I","Î":"I","Ï":"I","Ḯ":"I","İ":"I","Ị":"I","Ȉ":"I","Ì":"I","Ỉ":"I","Ȋ":"I","Ī":"I","Į":"I","Ɨ":"I","Ĩ":"I","Ḭ":"I","Ꝺ":"D","Ꝼ":"F","Ᵹ":"G","Ꞃ":"R","Ꞅ":"S","Ꞇ":"T","Ꝭ":"IS","Ĵ":"J","Ɉ":"J","Ḱ":"K","Ǩ":"K","Ķ":"K","Ⱪ":"K","Ꝃ":"K","Ḳ":"K","Ƙ":"K","Ḵ":"K","Ꝁ":"K","Ꝅ":"K","Ĺ":"L","Ƚ":"L","Ľ":"L","Ļ":"L","Ḽ":"L","Ḷ":"L","Ḹ":"L","Ⱡ":"L","Ꝉ":"L","Ḻ":"L","Ŀ":"L","Ɫ":"L","Lj":"L","Ł":"L","LJ":"LJ","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ń":"N","Ň":"N","Ņ":"N","Ṋ":"N","Ṅ":"N","Ṇ":"N","Ǹ":"N","Ɲ":"N","Ṉ":"N","Ƞ":"N","Nj":"N","Ñ":"N","NJ":"NJ","Ó":"O","Ŏ":"O","Ǒ":"O","Ô":"O","Ố":"O","Ộ":"O","Ồ":"O","Ổ":"O","Ỗ":"O","Ö":"O","Ȫ":"O","Ȯ":"O","Ȱ":"O","Ọ":"O","Ő":"O","Ȍ":"O","Ò":"O","Ỏ":"O","Ơ":"O","Ớ":"O","Ợ":"O","Ờ":"O","Ở":"O","Ỡ":"O","Ȏ":"O","Ꝋ":"O","Ꝍ":"O","Ō":"O","Ṓ":"O","Ṑ":"O","Ɵ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Õ":"O","Ṍ":"O","Ṏ":"O","Ȭ":"O","Ƣ":"OI","Ꝏ":"OO","Ɛ":"E","Ɔ":"O","Ȣ":"OU","Ṕ":"P","Ṗ":"P","Ꝓ":"P","Ƥ":"P","Ꝕ":"P","Ᵽ":"P","Ꝑ":"P","Ꝙ":"Q","Ꝗ":"Q","Ŕ":"R","Ř":"R","Ŗ":"R","Ṙ":"R","Ṛ":"R","Ṝ":"R","Ȑ":"R","Ȓ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꜿ":"C","Ǝ":"E","Ś":"S","Ṥ":"S","Š":"S","Ṧ":"S","Ş":"S","Ŝ":"S","Ș":"S","Ṡ":"S","Ṣ":"S","Ṩ":"S","ẞ":"SS","Ť":"T","Ţ":"T","Ṱ":"T","Ț":"T","Ⱦ":"T","Ṫ":"T","Ṭ":"T","Ƭ":"T","Ṯ":"T","Ʈ":"T","Ŧ":"T","Ɐ":"A","Ꞁ":"L","Ɯ":"M","Ʌ":"V","Ꜩ":"TZ","Ú":"U","Ŭ":"U","Ǔ":"U","Û":"U","Ṷ":"U","Ü":"U","Ǘ":"U","Ǚ":"U","Ǜ":"U","Ǖ":"U","Ṳ":"U","Ụ":"U","Ű":"U","Ȕ":"U","Ù":"U","Ủ":"U","Ư":"U","Ứ":"U","Ự":"U","Ừ":"U","Ử":"U","Ữ":"U","Ȗ":"U","Ū":"U","Ṻ":"U","Ų":"U","Ů":"U","Ũ":"U","Ṹ":"U","Ṵ":"U","Ꝟ":"V","Ṿ":"V","Ʋ":"V","Ṽ":"V","Ꝡ":"VY","Ẃ":"W","Ŵ":"W","Ẅ":"W","Ẇ":"W","Ẉ":"W","Ẁ":"W","Ⱳ":"W","Ẍ":"X","Ẋ":"X","Ý":"Y","Ŷ":"Y","Ÿ":"Y","Ẏ":"Y","Ỵ":"Y","Ỳ":"Y","Ƴ":"Y","Ỷ":"Y","Ỿ":"Y","Ȳ":"Y","Ɏ":"Y","Ỹ":"Y","Ź":"Z","Ž":"Z","Ẑ":"Z","Ⱬ":"Z","Ż":"Z","Ẓ":"Z","Ȥ":"Z","Ẕ":"Z","Ƶ":"Z","IJ":"IJ","Œ":"OE","ᴀ":"A","ᴁ":"AE","ʙ":"B","ᴃ":"B","ᴄ":"C","ᴅ":"D","ᴇ":"E","ꜰ":"F","ɢ":"G","ʛ":"G","ʜ":"H","ɪ":"I","ʁ":"R","ᴊ":"J","ᴋ":"K","ʟ":"L","ᴌ":"L","ᴍ":"M","ɴ":"N","ᴏ":"O","ɶ":"OE","ᴐ":"O","ᴕ":"OU","ᴘ":"P","ʀ":"R","ᴎ":"N","ᴙ":"R","ꜱ":"S","ᴛ":"T","ⱻ":"E","ᴚ":"R","ᴜ":"U","ᴠ":"V","ᴡ":"W","ʏ":"Y","ᴢ":"Z","á":"a","ă":"a","ắ":"a","ặ":"a","ằ":"a","ẳ":"a","ẵ":"a","ǎ":"a","â":"a","ấ":"a","ậ":"a","ầ":"a","ẩ":"a","ẫ":"a","ä":"a","ǟ":"a","ȧ":"a","ǡ":"a","ạ":"a","ȁ":"a","à":"a","ả":"a","ȃ":"a","ā":"a","ą":"a","ᶏ":"a","ẚ":"a","å":"a","ǻ":"a","ḁ":"a","ⱥ":"a","ã":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ḃ":"b","ḅ":"b","ɓ":"b","ḇ":"b","ᵬ":"b","ᶀ":"b","ƀ":"b","ƃ":"b","ɵ":"o","ć":"c","č":"c","ç":"c","ḉ":"c","ĉ":"c","ɕ":"c","ċ":"c","ƈ":"c","ȼ":"c","ď":"d","ḑ":"d","ḓ":"d","ȡ":"d","ḋ":"d","ḍ":"d","ɗ":"d","ᶑ":"d","ḏ":"d","ᵭ":"d","ᶁ":"d","đ":"d","ɖ":"d","ƌ":"d","ı":"i","ȷ":"j","ɟ":"j","ʄ":"j","dz":"dz","dž":"dz","é":"e","ĕ":"e","ě":"e","ȩ":"e","ḝ":"e","ê":"e","ế":"e","ệ":"e","ề":"e","ể":"e","ễ":"e","ḙ":"e","ë":"e","ė":"e","ẹ":"e","ȅ":"e","è":"e","ẻ":"e","ȇ":"e","ē":"e","ḗ":"e","ḕ":"e","ⱸ":"e","ę":"e","ᶒ":"e","ɇ":"e","ẽ":"e","ḛ":"e","ꝫ":"et","ḟ":"f","ƒ":"f","ᵮ":"f","ᶂ":"f","ǵ":"g","ğ":"g","ǧ":"g","ģ":"g","ĝ":"g","ġ":"g","ɠ":"g","ḡ":"g","ᶃ":"g","ǥ":"g","ḫ":"h","ȟ":"h","ḩ":"h","ĥ":"h","ⱨ":"h","ḧ":"h","ḣ":"h","ḥ":"h","ɦ":"h","ẖ":"h","ħ":"h","ƕ":"hv","í":"i","ĭ":"i","ǐ":"i","î":"i","ï":"i","ḯ":"i","ị":"i","ȉ":"i","ì":"i","ỉ":"i","ȋ":"i","ī":"i","į":"i","ᶖ":"i","ɨ":"i","ĩ":"i","ḭ":"i","ꝺ":"d","ꝼ":"f","ᵹ":"g","ꞃ":"r","ꞅ":"s","ꞇ":"t","ꝭ":"is","ǰ":"j","ĵ":"j","ʝ":"j","ɉ":"j","ḱ":"k","ǩ":"k","ķ":"k","ⱪ":"k","ꝃ":"k","ḳ":"k","ƙ":"k","ḵ":"k","ᶄ":"k","ꝁ":"k","ꝅ":"k","ĺ":"l","ƚ":"l","ɬ":"l","ľ":"l","ļ":"l","ḽ":"l","ȴ":"l","ḷ":"l","ḹ":"l","ⱡ":"l","ꝉ":"l","ḻ":"l","ŀ":"l","ɫ":"l","ᶅ":"l","ɭ":"l","ł":"l","lj":"lj","ſ":"s","ẜ":"s","ẛ":"s","ẝ":"s","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ᵯ":"m","ᶆ":"m","ń":"n","ň":"n","ņ":"n","ṋ":"n","ȵ":"n","ṅ":"n","ṇ":"n","ǹ":"n","ɲ":"n","ṉ":"n","ƞ":"n","ᵰ":"n","ᶇ":"n","ɳ":"n","ñ":"n","nj":"nj","ó":"o","ŏ":"o","ǒ":"o","ô":"o","ố":"o","ộ":"o","ồ":"o","ổ":"o","ỗ":"o","ö":"o","ȫ":"o","ȯ":"o","ȱ":"o","ọ":"o","ő":"o","ȍ":"o","ò":"o","ỏ":"o","ơ":"o","ớ":"o","ợ":"o","ờ":"o","ở":"o","ỡ":"o","ȏ":"o","ꝋ":"o","ꝍ":"o","ⱺ":"o","ō":"o","ṓ":"o","ṑ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","õ":"o","ṍ":"o","ṏ":"o","ȭ":"o","ƣ":"oi","ꝏ":"oo","ɛ":"e","ᶓ":"e","ɔ":"o","ᶗ":"o","ȣ":"ou","ṕ":"p","ṗ":"p","ꝓ":"p","ƥ":"p","ᵱ":"p","ᶈ":"p","ꝕ":"p","ᵽ":"p","ꝑ":"p","ꝙ":"q","ʠ":"q","ɋ":"q","ꝗ":"q","ŕ":"r","ř":"r","ŗ":"r","ṙ":"r","ṛ":"r","ṝ":"r","ȑ":"r","ɾ":"r","ᵳ":"r","ȓ":"r","ṟ":"r","ɼ":"r","ᵲ":"r","ᶉ":"r","ɍ":"r","ɽ":"r","ↄ":"c","ꜿ":"c","ɘ":"e","ɿ":"r","ś":"s","ṥ":"s","š":"s","ṧ":"s","ş":"s","ŝ":"s","ș":"s","ṡ":"s","ṣ":"s","ṩ":"s","ʂ":"s","ᵴ":"s","ᶊ":"s","ȿ":"s","ɡ":"g","ß":"ss","ᴑ":"o","ᴓ":"o","ᴝ":"u","ť":"t","ţ":"t","ṱ":"t","ț":"t","ȶ":"t","ẗ":"t","ⱦ":"t","ṫ":"t","ṭ":"t","ƭ":"t","ṯ":"t","ᵵ":"t","ƫ":"t","ʈ":"t","ŧ":"t","ᵺ":"th","ɐ":"a","ᴂ":"ae","ǝ":"e","ᵷ":"g","ɥ":"h","ʮ":"h","ʯ":"h","ᴉ":"i","ʞ":"k","ꞁ":"l","ɯ":"m","ɰ":"m","ᴔ":"oe","ɹ":"r","ɻ":"r","ɺ":"r","ⱹ":"r","ʇ":"t","ʌ":"v","ʍ":"w","ʎ":"y","ꜩ":"tz","ú":"u","ŭ":"u","ǔ":"u","û":"u","ṷ":"u","ü":"u","ǘ":"u","ǚ":"u","ǜ":"u","ǖ":"u","ṳ":"u","ụ":"u","ű":"u","ȕ":"u","ù":"u","ủ":"u","ư":"u","ứ":"u","ự":"u","ừ":"u","ử":"u","ữ":"u","ȗ":"u","ū":"u","ṻ":"u","ų":"u","ᶙ":"u","ů":"u","ũ":"u","ṹ":"u","ṵ":"u","ᵫ":"ue","ꝸ":"um","ⱴ":"v","ꝟ":"v","ṿ":"v","ʋ":"v","ᶌ":"v","ⱱ":"v","ṽ":"v","ꝡ":"vy","ẃ":"w","ŵ":"w","ẅ":"w","ẇ":"w","ẉ":"w","ẁ":"w","ⱳ":"w","ẘ":"w","ẍ":"x","ẋ":"x","ᶍ":"x","ý":"y","ŷ":"y","ÿ":"y","ẏ":"y","ỵ":"y","ỳ":"y","ƴ":"y","ỷ":"y","ỿ":"y","ȳ":"y","ẙ":"y","ɏ":"y","ỹ":"y","ź":"z","ž":"z","ẑ":"z","ʑ":"z","ⱬ":"z","ż":"z","ẓ":"z","ȥ":"z","ẕ":"z","ᵶ":"z","ᶎ":"z","ʐ":"z","ƶ":"z","ɀ":"z","ff":"ff","ffi":"ffi","ffl":"ffl","fi":"fi","fl":"fl","ij":"ij","œ":"oe","st":"st","ₐ":"a","ₑ":"e","ᵢ":"i","ⱼ":"j","ₒ":"o","ᵣ":"r","ᵤ":"u","ᵥ":"v","ₓ":"x"};
|
91 |
|
92 |
|
93 |
|
94 |
|
95 |
|
96 |
|
97 |
|
98 |
|
99 |
|
100 |
|
101 |
|
102 |
|
103 |
|
104 |
|
105 |
|
106 |
|
107 |
|
108 |
|
109 |
|
110 | function initialize (object, s) {
|
111 | if (s !== null && s !== undefined) {
|
112 | if (typeof s === 'string')
|
113 | object.s = s;
|
114 | else
|
115 | object.s = s.toString();
|
116 | } else {
|
117 | object.s = s;
|
118 | }
|
119 |
|
120 | object.orig = s;
|
121 |
|
122 | if (s !== null && s !== undefined) {
|
123 | if (object.__defineGetter__) {
|
124 | object.__defineGetter__('length', function() {
|
125 | return object.s.length;
|
126 | })
|
127 | } else {
|
128 | object.length = s.length;
|
129 | }
|
130 | } else {
|
131 | object.length = -1;
|
132 | }
|
133 | }
|
134 |
|
135 | function S(s) {
|
136 | initialize(this, s);
|
137 | }
|
138 |
|
139 | var __nsp = String.prototype;
|
140 | var __sp = S.prototype = {
|
141 |
|
142 | between: function(left, right) {
|
143 | var s = this.s;
|
144 | var startPos = s.indexOf(left);
|
145 | var endPos = s.indexOf(right, startPos + left.length);
|
146 | if (endPos == -1 && right != null)
|
147 | return new this.constructor('')
|
148 | else if (endPos == -1 && right == null)
|
149 | return new this.constructor(s.substring(startPos + left.length))
|
150 | else
|
151 | return new this.constructor(s.slice(startPos + left.length, endPos));
|
152 | },
|
153 |
|
154 |
|
155 | camelize: function() {
|
156 | var s = this.trim().s.replace(/(\-|_|\s)+(.)?/g, function(mathc, sep, c) {
|
157 | return (c ? c.toUpperCase() : '');
|
158 | });
|
159 | return new this.constructor(s);
|
160 | },
|
161 |
|
162 | capitalize: function() {
|
163 | return new this.constructor(this.s.substr(0, 1).toUpperCase() + this.s.substring(1).toLowerCase());
|
164 | },
|
165 |
|
166 | charAt: function(index) {
|
167 | return this.s.charAt(index);
|
168 | },
|
169 |
|
170 | chompLeft: function(prefix) {
|
171 | var s = this.s;
|
172 | if (s.indexOf(prefix) === 0) {
|
173 | s = s.slice(prefix.length);
|
174 | return new this.constructor(s);
|
175 | } else {
|
176 | return this;
|
177 | }
|
178 | },
|
179 |
|
180 | chompRight: function(suffix) {
|
181 | if (this.endsWith(suffix)) {
|
182 | var s = this.s;
|
183 | s = s.slice(0, s.length - suffix.length);
|
184 | return new this.constructor(s);
|
185 | } else {
|
186 | return this;
|
187 | }
|
188 | },
|
189 |
|
190 |
|
191 | collapseWhitespace: function() {
|
192 | var s = this.s.replace(/[\s\xa0]+/g, ' ').replace(/^\s+|\s+$/g, '');
|
193 | return new this.constructor(s);
|
194 | },
|
195 |
|
196 | contains: function(ss) {
|
197 | return this.s.indexOf(ss) >= 0;
|
198 | },
|
199 |
|
200 | count: function(ss) {
|
201 | return _dereq_('./_count')(this.s, ss)
|
202 | },
|
203 |
|
204 |
|
205 | dasherize: function() {
|
206 | var s = this.trim().s.replace(/[_\s]+/g, '-').replace(/([A-Z])/g, '-$1').replace(/-+/g, '-').toLowerCase();
|
207 | return new this.constructor(s);
|
208 | },
|
209 |
|
210 | equalsIgnoreCase: function(prefix) {
|
211 | var s = this.s;
|
212 | return s.toLowerCase() == prefix.toLowerCase()
|
213 | },
|
214 |
|
215 | latinise: function() {
|
216 | var s = this.replace(/[^A-Za-z0-9\[\] ]/g, function(x) { return latin_map[x] || x; });
|
217 | return new this.constructor(s);
|
218 | },
|
219 |
|
220 | decodeHtmlEntities: function() {
|
221 | var s = this.s;
|
222 | s = s.replace(/&#(\d+);?/g, function (_, code) {
|
223 | return String.fromCharCode(code);
|
224 | })
|
225 | .replace(/&#[xX]([A-Fa-f0-9]+);?/g, function (_, hex) {
|
226 | return String.fromCharCode(parseInt(hex, 16));
|
227 | })
|
228 | .replace(/&([^;\W]+;?)/g, function (m, e) {
|
229 | var ee = e.replace(/;$/, '');
|
230 | var target = ENTITIES[e] || (e.match(/;$/) && ENTITIES[ee]);
|
231 |
|
232 | if (typeof target === 'number') {
|
233 | return String.fromCharCode(target);
|
234 | }
|
235 | else if (typeof target === 'string') {
|
236 | return target;
|
237 | }
|
238 | else {
|
239 | return m;
|
240 | }
|
241 | })
|
242 |
|
243 | return new this.constructor(s);
|
244 | },
|
245 |
|
246 | endsWith: function() {
|
247 | var suffixes = Array.prototype.slice.call(arguments, 0);
|
248 | for (var i = 0; i < suffixes.length; ++i) {
|
249 | var l = this.s.length - suffixes[i].length;
|
250 | if (l >= 0 && this.s.indexOf(suffixes[i], l) === l) return true;
|
251 | }
|
252 | return false;
|
253 | },
|
254 |
|
255 | escapeHTML: function() {
|
256 | return new this.constructor(this.s.replace(/[&<>"']/g, function(m){ return '&' + reversedEscapeChars[m] + ';'; }));
|
257 | },
|
258 |
|
259 | ensureLeft: function(prefix) {
|
260 | var s = this.s;
|
261 | if (s.indexOf(prefix) === 0) {
|
262 | return this;
|
263 | } else {
|
264 | return new this.constructor(prefix + s);
|
265 | }
|
266 | },
|
267 |
|
268 | ensureRight: function(suffix) {
|
269 | var s = this.s;
|
270 | if (this.endsWith(suffix)) {
|
271 | return this;
|
272 | } else {
|
273 | return new this.constructor(s + suffix);
|
274 | }
|
275 | },
|
276 |
|
277 | humanize: function() {
|
278 | if (this.s === null || this.s === undefined)
|
279 | return new this.constructor('')
|
280 | var s = this.underscore().replace(/_id$/,'').replace(/_/g, ' ').trim().capitalize()
|
281 | return new this.constructor(s)
|
282 | },
|
283 |
|
284 | isAlpha: function() {
|
285 | return !/[^a-z\xDF-\xFF]|^$/.test(this.s.toLowerCase());
|
286 | },
|
287 |
|
288 | isAlphaNumeric: function() {
|
289 | return !/[^0-9a-z\xDF-\xFF]/.test(this.s.toLowerCase());
|
290 | },
|
291 |
|
292 | isEmpty: function() {
|
293 | return this.s === null || this.s === undefined ? true : /^[\s\xa0]*$/.test(this.s);
|
294 | },
|
295 |
|
296 | isLower: function() {
|
297 | return this.isAlpha() && this.s.toLowerCase() === this.s;
|
298 | },
|
299 |
|
300 | isNumeric: function() {
|
301 | return !/[^0-9]/.test(this.s);
|
302 | },
|
303 |
|
304 | isUpper: function() {
|
305 | return this.isAlpha() && this.s.toUpperCase() === this.s;
|
306 | },
|
307 |
|
308 | left: function(N) {
|
309 | if (N >= 0) {
|
310 | var s = this.s.substr(0, N);
|
311 | return new this.constructor(s);
|
312 | } else {
|
313 | return this.right(-N);
|
314 | }
|
315 | },
|
316 |
|
317 | lines: function() {
|
318 | return this.replaceAll('\r\n', '\n').s.split('\n');
|
319 | },
|
320 |
|
321 | pad: function(len, ch) {
|
322 | if (ch == null) ch = ' ';
|
323 | if (this.s.length >= len) return new this.constructor(this.s);
|
324 | len = len - this.s.length;
|
325 | var left = Array(Math.ceil(len / 2) + 1).join(ch);
|
326 | var right = Array(Math.floor(len / 2) + 1).join(ch);
|
327 | return new this.constructor(left + this.s + right);
|
328 | },
|
329 |
|
330 | padLeft: function(len, ch) {
|
331 | if (ch == null) ch = ' ';
|
332 | if (this.s.length >= len) return new this.constructor(this.s);
|
333 | return new this.constructor(Array(len - this.s.length + 1).join(ch) + this.s);
|
334 | },
|
335 |
|
336 | padRight: function(len, ch) {
|
337 | if (ch == null) ch = ' ';
|
338 | if (this.s.length >= len) return new this.constructor(this.s);
|
339 | return new this.constructor(this.s + Array(len - this.s.length + 1).join(ch));
|
340 | },
|
341 |
|
342 | parseCSV: function(delimiter, qualifier, escape, lineDelimiter) {
|
343 | delimiter = delimiter || ',';
|
344 | escape = escape || '\\'
|
345 | if (typeof qualifier == 'undefined')
|
346 | qualifier = '"';
|
347 |
|
348 | var i = 0, fieldBuffer = [], fields = [], len = this.s.length, inField = false, inUnqualifiedString = false, self = this;
|
349 | var ca = function(i){return self.s.charAt(i)};
|
350 | if (typeof lineDelimiter !== 'undefined') var rows = [];
|
351 |
|
352 | if (!qualifier)
|
353 | inField = true;
|
354 |
|
355 | while (i < len) {
|
356 | var current = ca(i);
|
357 | switch (current) {
|
358 | case escape:
|
359 |
|
360 | if (inField && ((escape !== qualifier) || ca(i+1) === qualifier)) {
|
361 | i += 1;
|
362 | fieldBuffer.push(ca(i));
|
363 | break;
|
364 | }
|
365 | if (escape !== qualifier) break;
|
366 | case qualifier:
|
367 | inField = !inField;
|
368 | break;
|
369 | case delimiter:
|
370 | if(inUnqualifiedString) {
|
371 | inField=false;
|
372 | inUnqualifiedString=false;
|
373 | }
|
374 | if (inField && qualifier)
|
375 | fieldBuffer.push(current);
|
376 | else {
|
377 | fields.push(fieldBuffer.join(''))
|
378 | fieldBuffer.length = 0;
|
379 | }
|
380 | break;
|
381 | case lineDelimiter:
|
382 | if(inUnqualifiedString) {
|
383 | inField=false;
|
384 | inUnqualifiedString=false;
|
385 | fields.push(fieldBuffer.join(''))
|
386 | rows.push(fields);
|
387 | fields = [];
|
388 | fieldBuffer.length = 0;
|
389 | }
|
390 | else if (inField) {
|
391 | fieldBuffer.push(current);
|
392 | } else {
|
393 | if (rows) {
|
394 | fields.push(fieldBuffer.join(''))
|
395 | rows.push(fields);
|
396 | fields = [];
|
397 | fieldBuffer.length = 0;
|
398 | }
|
399 | }
|
400 | break;
|
401 | case ' ':
|
402 | if (inField)
|
403 | fieldBuffer.push(current);
|
404 | break;
|
405 | default:
|
406 | if (inField)
|
407 | fieldBuffer.push(current);
|
408 | else if(current!==qualifier) {
|
409 | fieldBuffer.push(current);
|
410 | inField=true;
|
411 | inUnqualifiedString=true;
|
412 | }
|
413 | break;
|
414 | }
|
415 | i += 1;
|
416 | }
|
417 |
|
418 | fields.push(fieldBuffer.join(''));
|
419 | if (rows) {
|
420 | rows.push(fields);
|
421 | return rows;
|
422 | }
|
423 | return fields;
|
424 | },
|
425 |
|
426 | replaceAll: function(ss, r) {
|
427 |
|
428 | var s = this.s.split(ss).join(r)
|
429 | return new this.constructor(s);
|
430 | },
|
431 |
|
432 | splitLeft: function(sep, maxSplit, limit) {
|
433 | return _dereq_('./_splitLeft')(this.s, sep, maxSplit, limit)
|
434 | },
|
435 |
|
436 | splitRight: function(sep, maxSplit, limit) {
|
437 | return _dereq_('./_splitRight')(this.s, sep, maxSplit, limit)
|
438 | },
|
439 |
|
440 | strip: function() {
|
441 | var ss = this.s;
|
442 | for(var i= 0, n=arguments.length; i<n; i++) {
|
443 | ss = ss.split(arguments[i]).join('');
|
444 | }
|
445 | return new this.constructor(ss);
|
446 | },
|
447 |
|
448 | stripLeft: function (chars) {
|
449 | var regex;
|
450 | var pattern;
|
451 | var ss = ensureString(this.s);
|
452 |
|
453 | if (chars === undefined) {
|
454 | pattern = /^\s+/g;
|
455 | }
|
456 | else {
|
457 | regex = escapeRegExp(chars);
|
458 | pattern = new RegExp("^[" + regex + "]+", "g");
|
459 | }
|
460 |
|
461 | return new this.constructor(ss.replace(pattern, ""));
|
462 | },
|
463 |
|
464 | stripRight: function (chars) {
|
465 | var regex;
|
466 | var pattern;
|
467 | var ss = ensureString(this.s);
|
468 |
|
469 | if (chars === undefined) {
|
470 | pattern = /\s+$/g;
|
471 | }
|
472 | else {
|
473 | regex = escapeRegExp(chars);
|
474 | pattern = new RegExp("[" + regex + "]+$", "g");
|
475 | }
|
476 |
|
477 | return new this.constructor(ss.replace(pattern, ""));
|
478 | },
|
479 |
|
480 | right: function(N) {
|
481 | if (N >= 0) {
|
482 | var s = this.s.substr(this.s.length - N, N);
|
483 | return new this.constructor(s);
|
484 | } else {
|
485 | return this.left(-N);
|
486 | }
|
487 | },
|
488 |
|
489 | setValue: function (s) {
|
490 | initialize(this, s);
|
491 | return this;
|
492 | },
|
493 |
|
494 | slugify: function() {
|
495 | var sl = (new S(new S(this.s).latinise().s.replace(/[^\w\s-]/g, '').toLowerCase())).dasherize().s;
|
496 | if (sl.charAt(0) === '-')
|
497 | sl = sl.substr(1);
|
498 | return new this.constructor(sl);
|
499 | },
|
500 |
|
501 | startsWith: function() {
|
502 | var prefixes = Array.prototype.slice.call(arguments, 0);
|
503 | for (var i = 0; i < prefixes.length; ++i) {
|
504 | if (this.s.lastIndexOf(prefixes[i], 0) === 0) return true;
|
505 | }
|
506 | return false;
|
507 | },
|
508 |
|
509 | stripPunctuation: function() {
|
510 |
|
511 | return new this.constructor(this.s.replace(/[^\w\s]|_/g, "").replace(/\s+/g, " "));
|
512 | },
|
513 |
|
514 | stripTags: function() {
|
515 | var s = this.s, args = arguments.length > 0 ? arguments : [''];
|
516 | multiArgs(args, function(tag) {
|
517 | s = s.replace(RegExp('<\/?' + tag + '[^<>]*>', 'gi'), '');
|
518 | });
|
519 | return new this.constructor(s);
|
520 | },
|
521 |
|
522 | template: function(values, opening, closing) {
|
523 | var s = this.s
|
524 | var opening = opening || Export.TMPL_OPEN
|
525 | var closing = closing || Export.TMPL_CLOSE
|
526 |
|
527 | var open = opening.replace(/[-[\]()*\s]/g, "\\$&").replace(/\$/g, '\\$')
|
528 | var close = closing.replace(/[-[\]()*\s]/g, "\\$&").replace(/\$/g, '\\$')
|
529 | var r = new RegExp(open + '(.+?)' + close, 'g')
|
530 |
|
531 | var matches = s.match(r) || [];
|
532 |
|
533 | matches.forEach(function(match) {
|
534 | var key = match.substring(opening.length, match.length - closing.length).trim();
|
535 | var value = typeof values[key] == 'undefined' ? '' : values[key];
|
536 | s = s.replace(match, value);
|
537 | });
|
538 | return new this.constructor(s);
|
539 | },
|
540 |
|
541 | times: function(n) {
|
542 | return new this.constructor(new Array(n + 1).join(this.s));
|
543 | },
|
544 |
|
545 | titleCase: function() {
|
546 | var s = this.s;
|
547 | if (s) {
|
548 | s = s.replace(/(^[a-z]| [a-z]|-[a-z]|_[a-z])/g,
|
549 | function($1){
|
550 | return $1.toUpperCase();
|
551 | }
|
552 | );
|
553 | }
|
554 | return new this.constructor(s);
|
555 | },
|
556 |
|
557 | toBoolean: function() {
|
558 | if (typeof this.orig === 'string') {
|
559 | var s = this.s.toLowerCase();
|
560 | return s === 'true' || s === 'yes' || s === 'on' || s === '1';
|
561 | } else
|
562 | return this.orig === true || this.orig === 1;
|
563 | },
|
564 |
|
565 | toFloat: function(precision) {
|
566 | var num = parseFloat(this.s)
|
567 | if (precision)
|
568 | return parseFloat(num.toFixed(precision))
|
569 | else
|
570 | return num
|
571 | },
|
572 |
|
573 | toInt: function() {
|
574 |
|
575 | return /^\s*-?0x/i.test(this.s) ? parseInt(this.s, 16) : parseInt(this.s, 10)
|
576 | },
|
577 |
|
578 | trim: function() {
|
579 | var s;
|
580 | if (typeof __nsp.trim === 'undefined')
|
581 | s = this.s.replace(/(^\s*|\s*$)/g, '')
|
582 | else
|
583 | s = this.s.trim()
|
584 | return new this.constructor(s);
|
585 | },
|
586 |
|
587 | trimLeft: function() {
|
588 | var s;
|
589 | if (__nsp.trimLeft)
|
590 | s = this.s.trimLeft();
|
591 | else
|
592 | s = this.s.replace(/(^\s*)/g, '');
|
593 | return new this.constructor(s);
|
594 | },
|
595 |
|
596 | trimRight: function() {
|
597 | var s;
|
598 | if (__nsp.trimRight)
|
599 | s = this.s.trimRight();
|
600 | else
|
601 | s = this.s.replace(/\s+$/, '');
|
602 | return new this.constructor(s);
|
603 | },
|
604 |
|
605 | truncate: function(length, pruneStr) {
|
606 | var str = this.s;
|
607 |
|
608 | length = ~~length;
|
609 | pruneStr = pruneStr || '...';
|
610 |
|
611 | if (str.length <= length) return new this.constructor(str);
|
612 |
|
613 | var tmpl = function(c){ return c.toUpperCase() !== c.toLowerCase() ? 'A' : ' '; },
|
614 | template = str.slice(0, length+1).replace(/.(?=\W*\w*$)/g, tmpl);
|
615 |
|
616 | if (template.slice(template.length-2).match(/\w\w/))
|
617 | template = template.replace(/\s*\S+$/, '');
|
618 | else
|
619 | template = new S(template.slice(0, template.length-1)).trimRight().s;
|
620 |
|
621 | return (template+pruneStr).length > str.length ? new S(str) : new S(str.slice(0, template.length)+pruneStr);
|
622 | },
|
623 |
|
624 | toCSV: function() {
|
625 | var delim = ',', qualifier = '"', escape = '\\', encloseNumbers = true, keys = false;
|
626 | var dataArray = [];
|
627 |
|
628 | function hasVal(it) {
|
629 | return it !== null && it !== '';
|
630 | }
|
631 |
|
632 | if (typeof arguments[0] === 'object') {
|
633 | delim = arguments[0].delimiter || delim;
|
634 | delim = arguments[0].separator || delim;
|
635 | qualifier = arguments[0].qualifier || qualifier;
|
636 | encloseNumbers = !!arguments[0].encloseNumbers;
|
637 | escape = arguments[0].escape || escape;
|
638 | keys = !!arguments[0].keys;
|
639 | } else if (typeof arguments[0] === 'string') {
|
640 | delim = arguments[0];
|
641 | }
|
642 |
|
643 | if (typeof arguments[1] === 'string')
|
644 | qualifier = arguments[1];
|
645 |
|
646 | if (arguments[1] === null)
|
647 | qualifier = null;
|
648 |
|
649 | if (this.orig instanceof Array)
|
650 | dataArray = this.orig;
|
651 | else {
|
652 | for (var key in this.orig)
|
653 | if (this.orig.hasOwnProperty(key))
|
654 | if (keys)
|
655 | dataArray.push(key);
|
656 | else
|
657 | dataArray.push(this.orig[key]);
|
658 | }
|
659 |
|
660 | var rep = escape + qualifier;
|
661 | var buildString = [];
|
662 | for (var i = 0; i < dataArray.length; ++i) {
|
663 | var shouldQualify = hasVal(qualifier)
|
664 | if (typeof dataArray[i] == 'number')
|
665 | shouldQualify &= encloseNumbers;
|
666 |
|
667 | if (shouldQualify)
|
668 | buildString.push(qualifier);
|
669 |
|
670 | if (dataArray[i] !== null && dataArray[i] !== undefined) {
|
671 | var d = new S(dataArray[i]).replaceAll(qualifier, rep).s;
|
672 | buildString.push(d);
|
673 | } else
|
674 | buildString.push('')
|
675 |
|
676 | if (shouldQualify)
|
677 | buildString.push(qualifier);
|
678 |
|
679 | if (delim)
|
680 | buildString.push(delim);
|
681 | }
|
682 |
|
683 |
|
684 |
|
685 | buildString.length = buildString.length - 1;
|
686 | return new this.constructor(buildString.join(''));
|
687 | },
|
688 |
|
689 | toString: function() {
|
690 | return this.s;
|
691 | },
|
692 |
|
693 |
|
694 | underscore: function() {
|
695 | var s = this.trim().s.replace(/([a-z\d])([A-Z]+)/g, '$1_$2').replace(/([A-Z\d]+)([A-Z][a-z])/g,'$1_$2').replace(/[-\s]+/g, '_').toLowerCase();
|
696 | return new this.constructor(s);
|
697 | },
|
698 |
|
699 | unescapeHTML: function() {
|
700 | return new this.constructor(this.s.replace(/\&([^;]+);/g, function(entity, entityCode){
|
701 | var match;
|
702 |
|
703 | if (entityCode in escapeChars) {
|
704 | return escapeChars[entityCode];
|
705 | } else if (match = entityCode.match(/^#x([\da-fA-F]+)$/)) {
|
706 | return String.fromCharCode(parseInt(match[1], 16));
|
707 | } else if (match = entityCode.match(/^#(\d+)$/)) {
|
708 | return String.fromCharCode(~~match[1]);
|
709 | } else {
|
710 | return entity;
|
711 | }
|
712 | }));
|
713 | },
|
714 |
|
715 | valueOf: function() {
|
716 | return this.s.valueOf();
|
717 | },
|
718 |
|
719 |
|
720 | wrapHTML: function (tagName, tagAttrs) {
|
721 | var s = this.s, el = (tagName == null) ? 'span' : tagName, elAttr = '', wrapped = '';
|
722 | if(typeof tagAttrs == 'object') for(var prop in tagAttrs) elAttr += ' ' + prop + '="' +(new this.constructor(tagAttrs[prop])).escapeHTML() + '"';
|
723 | s = wrapped.concat('<', el, elAttr, '>', this, '</', el, '>');
|
724 | return new this.constructor(s);
|
725 | }
|
726 | }
|
727 |
|
728 | var methodsAdded = [];
|
729 | function extendPrototype() {
|
730 | for (var name in __sp) {
|
731 | (function(name){
|
732 | var func = __sp[name];
|
733 | if (!__nsp.hasOwnProperty(name)) {
|
734 | methodsAdded.push(name);
|
735 | __nsp[name] = function() {
|
736 | String.prototype.s = this;
|
737 | return func.apply(this, arguments);
|
738 | }
|
739 | }
|
740 | })(name);
|
741 | }
|
742 | }
|
743 |
|
744 | function restorePrototype() {
|
745 | for (var i = 0; i < methodsAdded.length; ++i)
|
746 | delete String.prototype[methodsAdded[i]];
|
747 | methodsAdded.length = 0;
|
748 | }
|
749 |
|
750 |
|
751 |
|
752 |
|
753 |
|
754 |
|
755 | var nativeProperties = getNativeStringProperties();
|
756 | for (var name in nativeProperties) {
|
757 | (function(name) {
|
758 | var stringProp = __nsp[name];
|
759 | if (typeof stringProp == 'function') {
|
760 |
|
761 | if (!__sp[name]) {
|
762 | if (nativeProperties[name] === 'string') {
|
763 | __sp[name] = function() {
|
764 |
|
765 | return new this.constructor(stringProp.apply(this, arguments));
|
766 | }
|
767 | } else {
|
768 | __sp[name] = stringProp;
|
769 | }
|
770 | }
|
771 | }
|
772 | })(name);
|
773 | }
|
774 |
|
775 |
|
776 |
|
777 |
|
778 |
|
779 |
|
780 | __sp.repeat = __sp.times;
|
781 | __sp.include = __sp.contains;
|
782 | __sp.toInteger = __sp.toInt;
|
783 | __sp.toBool = __sp.toBoolean;
|
784 | __sp.decodeHTMLEntities = __sp.decodeHtmlEntities
|
785 |
|
786 |
|
787 |
|
788 |
|
789 |
|
790 |
|
791 |
|
792 | __sp.constructor = S;
|
793 |
|
794 |
|
795 |
|
796 |
|
797 |
|
798 |
|
799 | function getNativeStringProperties() {
|
800 | var names = getNativeStringPropertyNames();
|
801 | var retObj = {};
|
802 |
|
803 | for (var i = 0; i < names.length; ++i) {
|
804 | var name = names[i];
|
805 | if (name === 'to' || name === 'toEnd') continue;
|
806 | var func = __nsp[name];
|
807 | try {
|
808 | var type = typeof func.apply('teststring');
|
809 | retObj[name] = type;
|
810 | } catch (e) {}
|
811 | }
|
812 | return retObj;
|
813 | }
|
814 |
|
815 | function getNativeStringPropertyNames() {
|
816 | var results = [];
|
817 | if (Object.getOwnPropertyNames) {
|
818 | results = Object.getOwnPropertyNames(__nsp);
|
819 | results.splice(results.indexOf('valueOf'), 1);
|
820 | results.splice(results.indexOf('toString'), 1);
|
821 | return results;
|
822 | } else {
|
823 | var stringNames = {};
|
824 | var objectNames = [];
|
825 | for (var name in String.prototype)
|
826 | stringNames[name] = name;
|
827 |
|
828 | for (var name in Object.prototype)
|
829 | delete stringNames[name];
|
830 |
|
831 |
|
832 | for (var name in stringNames) {
|
833 | results.push(name);
|
834 | }
|
835 | return results;
|
836 | }
|
837 | }
|
838 |
|
839 | function Export(str) {
|
840 | return new S(str);
|
841 | };
|
842 |
|
843 |
|
844 | Export.extendPrototype = extendPrototype;
|
845 | Export.restorePrototype = restorePrototype;
|
846 | Export.VERSION = VERSION;
|
847 | Export.TMPL_OPEN = '{{';
|
848 | Export.TMPL_CLOSE = '}}';
|
849 | Export.ENTITIES = ENTITIES;
|
850 |
|
851 |
|
852 |
|
853 |
|
854 |
|
855 |
|
856 |
|
857 | if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {
|
858 | module.exports = Export;
|
859 |
|
860 | } else {
|
861 |
|
862 | if(typeof define === "function" && define.amd) {
|
863 | define([], function() {
|
864 | return Export;
|
865 | });
|
866 | } else {
|
867 | window.S = Export;
|
868 | }
|
869 | }
|
870 |
|
871 |
|
872 |
|
873 |
|
874 |
|
875 |
|
876 |
|
877 | function multiArgs(args, fn) {
|
878 | var result = [], i;
|
879 | for(i = 0; i < args.length; i++) {
|
880 | result.push(args[i]);
|
881 | if(fn) fn.call(args, args[i], i);
|
882 | }
|
883 | return result;
|
884 | }
|
885 |
|
886 |
|
887 | var escapeChars = {
|
888 | lt: '<',
|
889 | gt: '>',
|
890 | quot: '"',
|
891 | apos: "'",
|
892 | amp: '&'
|
893 | };
|
894 |
|
895 | function escapeRegExp (s) {
|
896 |
|
897 | var c;
|
898 | var i;
|
899 | var ret = [];
|
900 | var re = /^[A-Za-z0-9]+$/;
|
901 | s = ensureString(s);
|
902 | for (i = 0; i < s.length; ++i) {
|
903 | c = s.charAt(i);
|
904 |
|
905 | if (re.test(c)) {
|
906 | ret.push(c);
|
907 | }
|
908 | else {
|
909 | if (c === "\\000") {
|
910 | ret.push("\\000");
|
911 | }
|
912 | else {
|
913 | ret.push("\\" + c);
|
914 | }
|
915 | }
|
916 | }
|
917 | return ret.join("");
|
918 | }
|
919 |
|
920 | function ensureString(string) {
|
921 | return string == null ? '' : '' + string;
|
922 | }
|
923 |
|
924 |
|
925 | var reversedEscapeChars = {};
|
926 | for(var key in escapeChars){ reversedEscapeChars[escapeChars[key]] = key; }
|
927 |
|
928 | ENTITIES = {
|
929 | "amp" : "&",
|
930 | "gt" : ">",
|
931 | "lt" : "<",
|
932 | "quot" : "\"",
|
933 | "apos" : "'",
|
934 | "AElig" : 198,
|
935 | "Aacute" : 193,
|
936 | "Acirc" : 194,
|
937 | "Agrave" : 192,
|
938 | "Aring" : 197,
|
939 | "Atilde" : 195,
|
940 | "Auml" : 196,
|
941 | "Ccedil" : 199,
|
942 | "ETH" : 208,
|
943 | "Eacute" : 201,
|
944 | "Ecirc" : 202,
|
945 | "Egrave" : 200,
|
946 | "Euml" : 203,
|
947 | "Iacute" : 205,
|
948 | "Icirc" : 206,
|
949 | "Igrave" : 204,
|
950 | "Iuml" : 207,
|
951 | "Ntilde" : 209,
|
952 | "Oacute" : 211,
|
953 | "Ocirc" : 212,
|
954 | "Ograve" : 210,
|
955 | "Oslash" : 216,
|
956 | "Otilde" : 213,
|
957 | "Ouml" : 214,
|
958 | "THORN" : 222,
|
959 | "Uacute" : 218,
|
960 | "Ucirc" : 219,
|
961 | "Ugrave" : 217,
|
962 | "Uuml" : 220,
|
963 | "Yacute" : 221,
|
964 | "aacute" : 225,
|
965 | "acirc" : 226,
|
966 | "aelig" : 230,
|
967 | "agrave" : 224,
|
968 | "aring" : 229,
|
969 | "atilde" : 227,
|
970 | "auml" : 228,
|
971 | "ccedil" : 231,
|
972 | "eacute" : 233,
|
973 | "ecirc" : 234,
|
974 | "egrave" : 232,
|
975 | "eth" : 240,
|
976 | "euml" : 235,
|
977 | "iacute" : 237,
|
978 | "icirc" : 238,
|
979 | "igrave" : 236,
|
980 | "iuml" : 239,
|
981 | "ntilde" : 241,
|
982 | "oacute" : 243,
|
983 | "ocirc" : 244,
|
984 | "ograve" : 242,
|
985 | "oslash" : 248,
|
986 | "otilde" : 245,
|
987 | "ouml" : 246,
|
988 | "szlig" : 223,
|
989 | "thorn" : 254,
|
990 | "uacute" : 250,
|
991 | "ucirc" : 251,
|
992 | "ugrave" : 249,
|
993 | "uuml" : 252,
|
994 | "yacute" : 253,
|
995 | "yuml" : 255,
|
996 | "copy" : 169,
|
997 | "reg" : 174,
|
998 | "nbsp" : 160,
|
999 | "iexcl" : 161,
|
1000 | "cent" : 162,
|
1001 | "pound" : 163,
|
1002 | "curren" : 164,
|
1003 | "yen" : 165,
|
1004 | "brvbar" : 166,
|
1005 | "sect" : 167,
|
1006 | "uml" : 168,
|
1007 | "ordf" : 170,
|
1008 | "laquo" : 171,
|
1009 | "not" : 172,
|
1010 | "shy" : 173,
|
1011 | "macr" : 175,
|
1012 | "deg" : 176,
|
1013 | "plusmn" : 177,
|
1014 | "sup1" : 185,
|
1015 | "sup2" : 178,
|
1016 | "sup3" : 179,
|
1017 | "acute" : 180,
|
1018 | "micro" : 181,
|
1019 | "para" : 182,
|
1020 | "middot" : 183,
|
1021 | "cedil" : 184,
|
1022 | "ordm" : 186,
|
1023 | "raquo" : 187,
|
1024 | "frac14" : 188,
|
1025 | "frac12" : 189,
|
1026 | "frac34" : 190,
|
1027 | "iquest" : 191,
|
1028 | "times" : 215,
|
1029 | "divide" : 247,
|
1030 | "OElig;" : 338,
|
1031 | "oelig;" : 339,
|
1032 | "Scaron;" : 352,
|
1033 | "scaron;" : 353,
|
1034 | "Yuml;" : 376,
|
1035 | "fnof;" : 402,
|
1036 | "circ;" : 710,
|
1037 | "tilde;" : 732,
|
1038 | "Alpha;" : 913,
|
1039 | "Beta;" : 914,
|
1040 | "Gamma;" : 915,
|
1041 | "Delta;" : 916,
|
1042 | "Epsilon;" : 917,
|
1043 | "Zeta;" : 918,
|
1044 | "Eta;" : 919,
|
1045 | "Theta;" : 920,
|
1046 | "Iota;" : 921,
|
1047 | "Kappa;" : 922,
|
1048 | "Lambda;" : 923,
|
1049 | "Mu;" : 924,
|
1050 | "Nu;" : 925,
|
1051 | "Xi;" : 926,
|
1052 | "Omicron;" : 927,
|
1053 | "Pi;" : 928,
|
1054 | "Rho;" : 929,
|
1055 | "Sigma;" : 931,
|
1056 | "Tau;" : 932,
|
1057 | "Upsilon;" : 933,
|
1058 | "Phi;" : 934,
|
1059 | "Chi;" : 935,
|
1060 | "Psi;" : 936,
|
1061 | "Omega;" : 937,
|
1062 | "alpha;" : 945,
|
1063 | "beta;" : 946,
|
1064 | "gamma;" : 947,
|
1065 | "delta;" : 948,
|
1066 | "epsilon;" : 949,
|
1067 | "zeta;" : 950,
|
1068 | "eta;" : 951,
|
1069 | "theta;" : 952,
|
1070 | "iota;" : 953,
|
1071 | "kappa;" : 954,
|
1072 | "lambda;" : 955,
|
1073 | "mu;" : 956,
|
1074 | "nu;" : 957,
|
1075 | "xi;" : 958,
|
1076 | "omicron;" : 959,
|
1077 | "pi;" : 960,
|
1078 | "rho;" : 961,
|
1079 | "sigmaf;" : 962,
|
1080 | "sigma;" : 963,
|
1081 | "tau;" : 964,
|
1082 | "upsilon;" : 965,
|
1083 | "phi;" : 966,
|
1084 | "chi;" : 967,
|
1085 | "psi;" : 968,
|
1086 | "omega;" : 969,
|
1087 | "thetasym;" : 977,
|
1088 | "upsih;" : 978,
|
1089 | "piv;" : 982,
|
1090 | "ensp;" : 8194,
|
1091 | "emsp;" : 8195,
|
1092 | "thinsp;" : 8201,
|
1093 | "zwnj;" : 8204,
|
1094 | "zwj;" : 8205,
|
1095 | "lrm;" : 8206,
|
1096 | "rlm;" : 8207,
|
1097 | "ndash;" : 8211,
|
1098 | "mdash;" : 8212,
|
1099 | "lsquo;" : 8216,
|
1100 | "rsquo;" : 8217,
|
1101 | "sbquo;" : 8218,
|
1102 | "ldquo;" : 8220,
|
1103 | "rdquo;" : 8221,
|
1104 | "bdquo;" : 8222,
|
1105 | "dagger;" : 8224,
|
1106 | "Dagger;" : 8225,
|
1107 | "bull;" : 8226,
|
1108 | "hellip;" : 8230,
|
1109 | "permil;" : 8240,
|
1110 | "prime;" : 8242,
|
1111 | "Prime;" : 8243,
|
1112 | "lsaquo;" : 8249,
|
1113 | "rsaquo;" : 8250,
|
1114 | "oline;" : 8254,
|
1115 | "frasl;" : 8260,
|
1116 | "euro;" : 8364,
|
1117 | "image;" : 8465,
|
1118 | "weierp;" : 8472,
|
1119 | "real;" : 8476,
|
1120 | "trade;" : 8482,
|
1121 | "alefsym;" : 8501,
|
1122 | "larr;" : 8592,
|
1123 | "uarr;" : 8593,
|
1124 | "rarr;" : 8594,
|
1125 | "darr;" : 8595,
|
1126 | "harr;" : 8596,
|
1127 | "crarr;" : 8629,
|
1128 | "lArr;" : 8656,
|
1129 | "uArr;" : 8657,
|
1130 | "rArr;" : 8658,
|
1131 | "dArr;" : 8659,
|
1132 | "hArr;" : 8660,
|
1133 | "forall;" : 8704,
|
1134 | "part;" : 8706,
|
1135 | "exist;" : 8707,
|
1136 | "empty;" : 8709,
|
1137 | "nabla;" : 8711,
|
1138 | "isin;" : 8712,
|
1139 | "notin;" : 8713,
|
1140 | "ni;" : 8715,
|
1141 | "prod;" : 8719,
|
1142 | "sum;" : 8721,
|
1143 | "minus;" : 8722,
|
1144 | "lowast;" : 8727,
|
1145 | "radic;" : 8730,
|
1146 | "prop;" : 8733,
|
1147 | "infin;" : 8734,
|
1148 | "ang;" : 8736,
|
1149 | "and;" : 8743,
|
1150 | "or;" : 8744,
|
1151 | "cap;" : 8745,
|
1152 | "cup;" : 8746,
|
1153 | "int;" : 8747,
|
1154 | "there4;" : 8756,
|
1155 | "sim;" : 8764,
|
1156 | "cong;" : 8773,
|
1157 | "asymp;" : 8776,
|
1158 | "ne;" : 8800,
|
1159 | "equiv;" : 8801,
|
1160 | "le;" : 8804,
|
1161 | "ge;" : 8805,
|
1162 | "sub;" : 8834,
|
1163 | "sup;" : 8835,
|
1164 | "nsub;" : 8836,
|
1165 | "sube;" : 8838,
|
1166 | "supe;" : 8839,
|
1167 | "oplus;" : 8853,
|
1168 | "otimes;" : 8855,
|
1169 | "perp;" : 8869,
|
1170 | "sdot;" : 8901,
|
1171 | "lceil;" : 8968,
|
1172 | "rceil;" : 8969,
|
1173 | "lfloor;" : 8970,
|
1174 | "rfloor;" : 8971,
|
1175 | "lang;" : 9001,
|
1176 | "rang;" : 9002,
|
1177 | "loz;" : 9674,
|
1178 | "spades;" : 9824,
|
1179 | "clubs;" : 9827,
|
1180 | "hearts;" : 9829,
|
1181 | "diams;" : 9830
|
1182 | }
|
1183 |
|
1184 |
|
1185 | }).call(this);
|
1186 |
|
1187 | },{"./_count":1,"./_splitLeft":2,"./_splitRight":3}]},{},[4])
|
1188 | (4)
|
1189 | }); |
\ | No newline at end of file |