مجموعة طريقة الصفيف
Angela.array = {//# method array // index ، return position! إذا لم يكن موجودًا ، فإنه يعود -1 ؛ الفهرس: الدالة (t ، arr) {//# إرجاع موضع الصفيف حيث توجد القيمة الحالية إذا (arr.indexof) {return arr.indexof (t) ؛ } لـ (var i = arr.length ؛ i-- ؛) {if (arr [i] === t) {return i * 1 ؛ }} ؛ العودة -1 ؛ } // إرجاع القيمة الرئيسية للكائن! نوع قيمة الإرجاع هو صفيف. ، getKey: function (data) {//# إرجاع جميع قيم المفاتيح للكائن var arr = [] ، k ؛ لـ (k في البيانات) {arr.push (k) ؛ } ؛ إرجاع arr ؛ }. [] ؛ var len = arrays.length ، index = tydic.math.randint (0 ، len - 1) ؛ صفائف العودة [الفهرس] || '' ؛ }. [] ؛ لـ (var i = 0 ، len = array.length ؛ i <len ؛ i ++) {for (var j = i+1 ؛ j <array.length ؛ j ++) {if (Array [i] === Array [j]) {array.splice (j ، 1) ؛ ي-؛ }}} مجموعة الإرجاع ؛ } // Max ، وهو أكبر مصطلح في المصفوفة ، الحد الأقصى: الدالة (صفيف) {//#ابحث عن المصطلح الأكبر في مجموعة Math.Max.apply (Null ، Array) ؛ } // min ، أصغر مصطلح في المصفوفة ، min: function (array) {//#ابحث عن أصغر عنصر في لعبة return math.min.apply (null ، array) ؛ } // إزالة ، إزالة ، إزالة: الدالة (صفيف ، قيمة) {//#قم بإزالة قيمة في Array var length = array.length ؛ بينما (الطول-) {if (value === array [length]) {array.splice (length ، 1) ؛ }} صفيف الإرجاع ؛ } // قم بمسح الصفيف ، فارغ: الدالة (صفيف) {//# مسح الصفيف (صفيف || []). الطول = 0 ؛ مجموعة العودة } // lexoveeat ، حذف قيمة الموضع المحدد //@index ، الفهرس. إذا لم يتم تمرير الفهرس ، فسيتم حذف أول واحد ، وإزالة: الدالة (صفيف ، فهرس) {//#حذف قيمة الموضع المحدد في صفيف الصفيف. مجموعة العودة }. بينما (i--) {pos = rand (0 ، length) ؛ // مبادلة الموضع العشوائي tmp = صفيف [pos] ؛ صفيف [pos] = صفيف [i] ؛ صفيف [i] = tmp ؛ } صفيف الإرجاع ؛ }} ؛مجموعة طريقة ملفات تعريف الارتباط
angela.cookie = {//# cookie // يدعم المتصفح ملفات تعريف الارتباط بما فيه الكفاية. Enable: !! navigator.cookieenabled // read cookie ، get: function (name) {//#read cookie var reg = new regexp ("(^|)" + name + "(؟: = ([^؛]*))؟ إرجاع فال؟ (Val [2]؟ Unescape (Val [2]): ""): '' ؛ }. null ، path = وسيطات [3] || "/" ، المجال = الوسائط [4] || خالية ، آمنة = وسيطات [5] || خطأ شنيع ؛ تنتهي؟ exp.setMinutes (exp.getMinutes () + parseint (انتهاء صلاحية)): "" ؛ document.cookie = name + '=' + Escape (value) + (انتهاء صلاحية؟ }. if (value! = null) {var exp = new date () ؛ exp.setMinutes (exp.getMinutes () - 1000) ؛ المسار = المسار || "/" ؛ document.cookie = name + '= ؛ expires =' + exp.togmtstring () + (path؟ }}} ؛مجموعة طريقة URL
Angela.URL = {//#url // المقالات: الاسم المتغير ، إذا كان عنوان URL فارغًا ، فسيأخذ الجدول getQuery من عنوان URL في الصفحة الحالية: الدالة (الاسم ، url) {var u = enduments [1] || window.location.search ، reg = new regexp ("(^| &)" + name + "= ([^&]*) (& | $)") ، r = U.Substr (U.Indexof ("؟") + 1) .Match (reg) ؛ العودة r! = فارغة؟ ص [2]: "" ؛ } ، gethash: function (name ، url) {//# get hash value var u = mancepitions [1] || الموقع. var reg = new regexp ("(^| &)" + name + "= ([^&]*) (& | $)") ؛ var r = U.Substr (U.Indexof ("#") + 1) .Match (Reg) ؛ if (r! = null) {return r [2] ؛ } يعود ""؛ } ، parse: function (url) {//# parse url var a = document.createElement ('a') ؛ url = url || document.location.href ؛ A.Href = url ؛ إرجاع {المصدر: url ، البروتوكول: a.protocol.replace (':' ، '') ، المضيف: A.HostName ، المنفذ: A.Port ، الاستعلام: A.Search ، الملف: (A.PathName.match (/([^//؟#]+) $/i) || A.PathName.replace (/^([^//])/، '/$ 1') ، النسبية: (A.Href.Match (/tps؟: /// [^//] }} ؛مجموعة طريقة التعبير العادية
Angela.Regexp = {//# string match // ما إذا كان رقمًا! عدد صحيح ، رقم نقطة العائمة isNum: function (num) {//# هل هو عودة صفيف! isnan (num) ؛ } ، isemail: function (mail) {//# is a a mailbox return /^( Budapa-z0-90+ Budap_/-/.. } ، IsidCard: function (card) {//# is a id card return /^(/d {14 )|/d {17 ))(/d| budapxx intlymnmel :) $/stest(card) ؛ } ، isMobile: function (mobile) {//# is a phone return /^0*1/d {10) m$/.test(mobile) ؛ } ، isqq: function (qq) {//# is a qq return /^ budap1-9/201/d {4،10) $/.test(qq) ؛ } ، istel: function (tel) {//# is a a phone return /^/d {3،4 )-/d {7،8 )(-/d {1،6 ))؟te/.text(tel) ؛ } ، isurl: function (url) {//# is a url return /https؟:////////z0-9/. } ، isColor: function (color) {//# ما إذا كان هو عودة اللون السداسي /# (Budap/DA-- } // @id: بطاقة الهوية ، // now: الوقت الحالي مثل: التاريخ الجديد ('2013/12/12') ، '2013/12/12' السماح = parsefloat (السماح) || 18 ؛ الآن = typeof الآن == 'سلسلة'؟ تاريخ جديد (الآن): (الآن || New Date ()) ؛ if (! this.isidCard (id)) {return false ؛ } // بطاقة معرف 15-bit إذا (15 == id.length) {Age = '19' + id.slice (6 ، 6) ؛ } آخر {Age = id.slice (6 ، 14) ؛ } // نوع التحويل العدد العمر = ~~ العمر ؛ nowdate = ~~ (tydic.date.format ('Yyyymmdd' ، الآن)) ؛ // قارن العمر if (nowdate - العمر <leftage * 1e4) {return false ؛ } إعادة صواب ؛ }. } // عدد صحيح موجب ، ISINT: function (num) {//# ما إذا كان عودة عدد صحيح إيجابي/^Budap1-9/D*$/.test(num) ؛ } // هل هي جميع الأحرف الصينية ، ischinese: function (str) {//# هل كل الأحرف الصينية تعود/^(Budap/U4e00-/u9fa5 out budap/ufe30-/uffa0 )+/gi.test(str) ؛ }} ؛مجموعة طريقة السلسلة
Angela.String = {//# string codehtml: function (content) {//# eprect html أحرف إرجاع this.replace (content ، {'&': "*": "*" ، "+": "،" ،: "،"-"-" ، ".:". }. '' ؛ // أضف إلى الطول الأخير = ~~ الطول ؛ إرجاع مجموعة جديدة (طول * 1 + 1). } // إضافة بادئة ، addpre: function (pre ، word ، size) {//# make up. إذا سبقت 0 pre = pre || '0' ؛ الحجم = parseint (الحجم) || 0 ؛ word = string (word || '') ؛ var length = math.max (0 ، size - word.length) ؛ إرجاع this.repeat (قبل ، طول ، كلمة) ؛ }. } // استبدال السلسلة ، استبدال: function (str ، re) {//# string replacement str = str || '' ؛ لـ (var key in re) {reply (key ، re [key]) ؛ } ؛ دالة استبدال (a ، b) {var arr = str.split (a) ؛ str = arr.join (b) ؛ } ؛ إرجاع شارع } ، xss: function (str ، type) {//# xss excell // fantive filter if (! str) {return str === 0؟ "0": "" ؛ } switch (type) {case "html": // filter xss in html string return str.replace (/[& '"<> ////-/x00-/x09/x0b-/x0c/x1f/x80-/xff]/g ، function (r) {return" &#" ") .replace (// r/n/g ، str.replace (/[& '"<> ////-/x00-/x1f/x80-/xff]/g ، function (r) {return" &#" + r.charcodeat (0) +" ؛ "}) ؛ استراحة؛ حالة "url": // تصفية url إرجاع url excart (str) .replace (//+/g ، "٪ 2b") ؛ استراحة؛ حالة "miniurl": إرجاع str.replace (/٪/g ، "٪ 25") ؛ استراحة؛ حالة "البرنامج النصي": return str.replace (/[// "']/g ، function (r) {return" // " + r ؛}). استبدال (/٪/g ،" //x25").replace(//n/g ، "//n") (//r/g ، Case "Reg": Return Str.replace (/Budaper Escape (str) .replace (/[& '"<> //////-/x00-/x09/x0b-/x0c/x1f/x80-/xff]/g ، function (r) {return" &#" />"). replace(//n/g ، الكلمات /النص: Text Toy Toy: string //@Words: Type ، Array ، مثل: var reg = new regexp (words.join ('|') ، 'g') ، _self = this ؛ return text.replace (reg ، function ($ 0) {var length = string ($ 0 || '') .Length ؛ return _self.repeat ('*' ، length) ؛}) ؛ }} ؛مجموعة طريقة التشفير
angela.encrypt = {//# encryption md5: function (كلمات) {//# md5 hash algorithm/ * * crypto-js 3.1.2 * {} ، r = l.base = {extend: function (b) {n.prototype = this ؛ var h = new n ؛ b && h.mixin (b) ؛ H.HasownProperty ("init") || (h.init = function () {h. $ super.init.apply (هذا ، الوسائط)}) ؛ h.init.prototype = h ؛ h. $ super = this ؛ إرجاع H} ، إنشاء: function () {var b = this.extend () ؛ B.Init.Apply (B ، الحجج) ؛ return b} ، init: function () {} ، mixin: function (b) {for (var h in b) b.hasownproperty (h) && (this [h] = b [h]) ؛ B.HasownProperty ("toString") && (this.toString = B.ToString)} ، clone: function () {return this.init.prototype.extend (this)}} ، B.Length} ، TOSTRING: function (b) {b || t) .Stringify (this)} ، function (b) (G >> 2] >> 24 - 8 (G ٪ 4) << 24 - 8 * (J + G) } clamp: function () {var b = this.words ، this.sigbytes ؛ عشوائي: دالة (ب) {for (var h = [] ، a = 0 ؛ a <b ؛ a += 4) h.push (4294967296 * s.Random () | 0) ؛ إرجاع جديد Q.Init (h ، b)}}) ، v = m.enc = {} ، t = v.hex = {stringify: function (b) {var a = b.words ؛ ب = b.sigbytes ؛ لـ (var g = [] ، j = 0 ؛ j <b ؛ j ++) {var k = a [j >> 2] >>> 24 - 8 * (j ٪ 4) & 255 ؛ G.Push ((K >>> 4) .ToString (16)) ؛ G.Push ((K & 15) .ToString (16))} return G.Join ("")} ، parse: function (b) {for (var a = b.length ، g = [] ، j = 0 ؛ j <a ؛ j += 2) g [j >> 3] | إرجاع جديد Q.Init (g ، a / 2)}} ، a = v.latin1 = {stringify: function (b) {var a = b.words ؛ ب = b.sigbytes ؛ لـ (var g = [] ، j = 0 ؛ j <b ؛ j ++) g.push (string.fromcharcode (a [j >> 2] >>> 24 - 8 * (j ٪ 4) & 255)) ؛ return g.join ("")} ، parse: function (b) {for (var a = b.length ، g = [] ، j = 0 ؛ j <a ؛ j ++) g [j >>> 2] | = b.CharCodeAt (j) & 255) << 24 - 8 * (j ٪ 4) ؛ إرجاع جديد Q.Init (g ، a)}} ، u = v.Utf8 = {trishify: function (b) {try {return decodeUricomponent (excart (a.stringify (b)))} catch (g) {throw error ("dailded utf-8 data") ؛ }} ، parse: function (b) {return A.Parse (unescape (EncodeUricomponent (b)))}} ، g = l.bufferedblockalgorithm = r.extend ({reset: function () {this._data = new q.init ؛ (ب = U.Parse (ب)) ؛ S.Max (M | 0) clone: function () {var b = r.clone.call (this) ؛ l.hasher = g.Extend ({cfg: r.extend () ، init: function (b) {this.cfg = this.cfg.extend (b) ؛ this.reset ()} ، reset: function () {g.reset.call (this) ؛ this._doreset ()} ، update: function (b) {b) } ، الانتهاء من: الدالة (b) {b && this._append (b) ؛ K.Hmac.init (B ، G)). اللمسات الأخيرة (A)}}}) ؛ var k = m.algo = {} ؛ العودة m} (الرياضيات) ؛ (الوظيفة (s) {function p (a ، k ، b ، h ، l ، j ، m) {a = a + (k & b | ~ k & h) + l + m ؛ return (a << j | a >>> 32 - j) + k} function m (a ، k ، b ، h ، l ، m) J) +} وظيفة L (A ، K ، B ، H ، L ، J ، M) {A + (B ^ (K | ~ H)) + L + M ؛ + k} الدالة N (A ، K ، B ، H ، L ، J ، M) {A + (B ^ (K | ~ H)) + L + M ؛ } لـ (var r = cryptojs ، q = r.lib ، v = q.wordarray ، t = q.hasher ، q = r.algo ، a = [] this._hash = new v.init ([1732584193 ، 4023233417 ، 2562383102 ، 271733878])} ، _doprocessblock: function (g ، k) {for (var b = 0 ؛ b ؛ b ++) {var h = k+b ، w = g [h] G [H] = (W << 8 | W >>> 24) و 16711935 | (w << 24 | w >>> 8) و 4278255360} var b = this._hash.words ، h = g [k + 0] ، w = g [k + 1] ، j = g [k + 2] ، q = g [k + 3] ، r = g [k + 4] x = g [k + 9] ، y = g [k + 10] ، z = g [k + 11] ، a = g [k + 12] ، b = g [k + 13] ، c = g [k + 14] ، d = g [k + 15] ، c = b [0] ، d = b [1] p (f ، c ، d ، e ، w ، 12 ، a [1]) ، e = p (e ، f ، c ، d ، j ، j ، 17 ، a [2]) ، d = p (d ، e ، f ، c ، q ، 22 ، a [3]) ، c = p (c ، d ، D ، T ، 17 ، A [6]) ، d = p (d ، e ، f ، c ، u ، 22 ، a [7]) ، c = p (c ، d ، e ، f ، v ، 7 ، a [8]) ، f = p (f ، c ، d ، e ، 12 ، a [11]) ، c = p (c ، d ، e ، f ، a ، 7 ، a [12]) ، f = p (f ، c ، d ، e ، b ، 12 ، a [13]) m (f ، c ، d ، e ، t ، 9 ، a [17]) ، e = m (e ، f ، c ، d ، d ، z ، 14 ، a [18]) ، d = m (d ، e ، f ، c ، 20 ، a [19]) ، c = m (c ، d ، C ، D ، E ، Y ، 9 ، A [21]) ، E = M (E ، F ، C ، C ، C ، H ، 20 ، A [19]) ، C = M (C ، D ، E ، F ، S ، 5 ، A [20]) ، F = M (F ، C ، D ، Y ، Y ، a [23]) ، c = m (c ، d ، e ، f ، x ، 5 ، a [24]) ، f = m (f ، c ، d ، e ، c ، 9 ، a [25]) ، e = m (e ، f ، c ، d ، m (f ، c ، d ، e ، j ، 9 ، a [29]) ، e = m (e ، f ، c ، d ، u ، 14 ، a [30]) ، d = m (d ، e ، f ، c ، 20 ، a [27]) ، c = m (c ، d ، e ، f ، C ، D ، E ، V ، 11 ، A [33]) ، E = L (E ، F ، C ، D ، D ، Z ، 16 ، A [34]) ، D = L (D ، E ، F ، C ، D ، z ، 16 ، C ، D ، E ، R ، 11 ، A [37]) ، E = L (E ، F ، C ، D ، U ، 16 ، A [38]) ، D = L (D ، E ، F ، A [42]) ، d = l (d ، e ، f ، c ، t ، 23 ، a [43]) ، c = l (c ، d ، e ، f ، x ، 4 ، a [44]) ، f = l (f ، c ، d ، e ، a ، 11 ، a [47]) ، c = n (c ، d ، e ، f ، h ، 6 ، a [48]) ، f = n (f ، d ، d ، u ، u ، = n (c ، d ، e ، f ، a ، 6 ، a [52]) ، f = n (f ، c ، d ، e ، q ، q ، 10 ، a [53]) ، e = n (e ، f ، c ، d ، n (f ، c ، d ، e ، d ، 10 ، a [57]) ، e = n (e ، f ، c ، d ، t ، 15 ، a [58]) ، d = n (d ، e ، f ، c ، b ، 21 ، a [59]) ، c = n (c ، d ، e F ، C ، D ، J ، 15 ، A [62]) ، D = N (D ، E ، F ، C ، X ، 21 ، A [63]) ؛ B [0] = B [0] + C | 0 ؛ ب [1] = ب [1] + د | 0 ؛ B [2] = B [2] + E | 0 ؛ B [3] = B [3] + F | 0} ، _dofinalize: function () {var a = this._data ، k = a.words ، b = 8 * 16711935 | (l << 24 | l >>> 8) و 4278255360 ؛ K [(H + 64 >>> 9 << 4) + 14] = (B << 8 | B >>> 24) و 16711935 | (b << 24 | l >>> 8) و 4278255360 ؛ K [(H + 64 >>> 9 << 4) + 14] = (B << 8 | B >>> 24) و 16711935 | (B << 24 | B >>> 9 << 4) + 14] = (B << 8 | B >>> 24) و 16711935 | (B << 24 | B >>> 8) و 4278255360 ؛ A.Sigbytes = 4 * (K.Length + 1) ؛ this._process () ؛ a = this._hash ؛ k = a.words ؛ لـ (b = 0 ؛ 4> b ؛ b ++) h = k [b] ، k [b] = (h << 8 | h >>> 24) و 16711935 | (H << 24 | H >>> 8) و 4278255360 ؛ إرجاع A} ، clone: function () {var a = t.clone.call (this) ؛ a._hash = this._hash.clone () ؛ إرجاع A}}) ؛ r.md5 = t._createHelper (q) ؛ R.HMACMD5 = T._CreateHmachelper (Q)}) (Math) ؛ إرجاع cryptojs.md5 (الكلمات) .ToString () ؛ } // sha1 ، sha1: function (words) {//# sha1 hashing glegorithm var cryptojs = function (e ، m) {var p = {} ، j = p.lib = {} ، l = function () {} ، f = var c = new l ؛ A && c.mixin (a) ؛ C.HasownProperty ("init") || (c.init = function () {c. $ super.init.apply (هذا ، الوسائط)}) ؛ c.init.prototype = c ؛ ج. $ super = هذا ؛ return c} ، إنشاء: function () {var a = this.extend () ؛ A.Init.apply (A ، الحجج) ؛ إرجاع A} ، init: function () {} ، mixin: function (a) {for (var c in a) a.hasownproperty (c) && (this [c] = a [c]) ؛ a.hasownproperty ("toString") && (this.toString = A.ToString)} ، clone: function () {return this.init.prototype.extend (this)}} ، n = A.Length} ، وظيفة (أ) (ب >>> 2] >> 24 - 8 (ب ٪ 4) } clamp: {var a = this.words ، c = this.sigbytes ؛ } ، عشوائي: function (a) {for (var c = [] ، b = 0 ؛ b <a ؛ b += 4) c.push (4294967296 * e.Random () | 0) ؛ إرجاع n.init جديد (c ، a)}}) ، b = p.enc = {} ، h = b.hex = {stringify: function (a) {var c = a.words ؛ a = a.sigbytes ؛ لـ (var b = [] ، d = 0 ؛ d <a ؛ d ++) {var f = c [d >>> 2] >>> 24 - 8 * (d ٪ 4) & 255 ؛ B.Push ((f >>> 4) .ToString (16)) ؛ B.Push ((F & 15) .ToString (16))} return B.Join ("")} ، parse: function (a) {for (var c = a.length ، b = [] ، d = 0 ؛ d <c ؛ d += 2) b [d >> 3] | إرجاع N.Init جديد (B ، C / 2)}} ، g = B.Latin1 = {trishify: function (a) {var c = a.words ؛ a = a.sigbytes ؛ لـ (var b = [] ، d = 0 ؛ d <a ؛ d ++) b.push (string.fromcharcode (c [d >> 2] >>> 24 - 8 * (d ٪ 4) & 255)) ؛ إرجاع B.Join ("")} ، parse: function (a) {for (var c = a.length ، b = [] ، d = 0 ؛ d <c ؛ d ++) b [d >> 2] | = (A.CharCodeAt (d) & 255) << 24 - 8 * (d ٪ 4) ؛ إرجاع n.init جديد (b ، c)}} ، r = b.Utf8 = {chatefy: function (a) {try {return decodeUricomponent (excart (g.stringify (a)))} catch (c) {throw error ("data utf-8 data") ؛ }} ، parse: function (a) {return g.parse (unescape (EncodeUricomponent (a)))} ، k = && (A = R.Parse (A)) ؛ E.Max (H | 0) clone: function () {var a = f.clone.call (this) ؛ j.hasher = k.Extend ({cfg: f.extend () ، init: function (a) {this.cfg = this.cfg.extend (a) ؛ this.reset ()} ، reset: function () {k.reset.call (this) ؛ this._doreset ()} ، update: function (a) {a) } ، الانتهاء من: الدالة (a) {a && this._append (a) ؛ S.Hmac.Init (A ، F)). اللمسات الأخيرة (ب)}}}}) ؛ var s = p.algo = {} ؛ العودة p} (الرياضيات) ؛ (function () {var e = cryptojs ، m = e.lib ، p = m.wordarray ، j = m.hasher ، l = [] ، m = e.algo.sha1 = 3285377520)} ، _condercessblock: function (f ، n) {for (var b = this._hash.words ، h = b [0] ، g = b [1] ، e = b [2] C = L [A - 3] 18577393 ] + G | << 24 - H ٪ 32 ؛ E [(H + 64 >>> 9 << 4) + 15] = B ؛ f.sigbytes = 4 * e.length ؛ this._process () ؛ إرجاع this._hash} ، clone: function () {var e = j.clone.call (this) ؛ e._hash = this._hash.clone () ؛ العودة e}}) ؛ E.Sha1 = J._createHelper (M) ؛ e.hmacsha1 = j._createhmachelper (m)}) () ؛ إرجاع cryptojs.sha1 (الكلمات) .ToString () ؛ } // time33 hash ، time33: function (words) {//# time33 hash gords = words || '' ؛ // hash time33 خوارزمية لـ (var i = 0 ، len = words.length ، hash = 5381 ؛ i <len ؛ ++ i) {hash += (hash << 5) +words.charat (i) .charcodeat () ؛ } ؛ إرجاع التجزئة و 0x7ffffffff ؛ }}مجموعة طريقة التاريخ
Angela.Date = {//# time date //@s: وقت البدء //@e: نهاية الوقت //@n: الوقت الحالي ، n isinarea: function (s ، e ، n) {// تاريخ جديد () ؛ start = math.min (start ، end) ؛ end = math.max (ابدأ ، نهاية) ؛ العودة الآن> = ابدأ && الآن <= نهاية؟ صحيح: خطأ }. //. 'خيط' ؟ this.parse (time): (time || new Date ()) ؛ pre = pre || 'أسبوع'؛ // weeks nums = 'اليوم الأول ، اثنان ، ثلاثة ، أربعة ، خمسة ، ستة' ؛ إرجاع pre + nums [time.getDay ()] ؛ } //@formattype: yyyy ، yy ، mm //@time: date new ('2013/11/12') //@week: day ، اثنان ، ثلاثة ، أربعة ، خمسة ، ستة ، تنسيق: وظيفة (formattype ، time ، weeks) {// format time var pre = '0' ؛ formattype = formattype || "Yyy-MM-DD" أسابيع = أسابيع || "اليوم الأول ، اثنان ، ثلاثة ، أربعة ، خمسة ، ستة" ؛ الوقت = الوقت || تاريخ جديد () ؛ //formattyp.com return (formattype || '' ') .replace (/yyyy | yyyy/g ، time.getlyear () time.getMonth () + 1 ، 2)) .replace (/m | m/g ، time.getmonth () + 1) .replace (/dd | dd/g ، tydic.string.addpre (pre ، time.getDate () ، 2) .replace (/d | d/g ، time.getdate (). tydic.string.addpre (pre ، time.gethours () ، 2)) .replace (/h | h/g ، time.gethours ()) .replace (/ii | ii/g ، tydic.string.addpre (pre ، time.getminutes () ، 2) .replace (/ss | ss/g ، tydic.string.addpre (pre ، time.getSeconds () ، 2)) .replace (/s | s/g ، time.getSeconds () } // العد التنازلي ، العد التنازلي: الدالة (OPT) {//# countdown var option = {nowtime: 0 // الوقت الحالي ، ، 2013/02/01 18:30:30 ، نهاية الوقت: 0 // الموعد النهائي ، 2013/02/01 18:33 {} // callback بعد الانتهاء} ، opts = {} ، timer = null ؛ opts = tydic.extend (الخيار ، OPT) ؛ // الوقت الحالي if (! opts.nowtime) {opts.nowtime = (new date ()). getTime () ؛ } آخر {opts.nowtime = this.parse (opts.nowtime) ؛ } // الوقت الحالي if (! opts.endtime) {opts.endtime = (new date ()). getTime () ؛ } آخر {opts.endtime = this.parse (opts.endtime) ؛ } timer = setInterval (loop ، opts.Interval * 1e3) ؛ // loop function loop () {var ts = opts.endtime - opts.nowtime // احسب milliseconds المتبقية ، dd = parseint (ts/8.64e7) // حساب الأيام المتبقية ، hh = parseint (ts/3.6e7 ٪ 24) = parseint (TS/1E3 ٪ 60) // حساب الثواني المتبقية ؛ // احسب انخفاض الوقت الحالي opts.nowtime += opts.Interval * 1e3 ؛ if (ts <= 0) {clearinterval (timer) ؛ opts.finaled () ؛ } آخر {opts.called (dd ، hh ، mm ، ss) ؛ }}}} ؛مجموعة طريقة اكتشاف المتصفح
angela.browser = {//# browser browsers: {//# browser kernel category weixin: /micromessenger(// budap/d/.0itive+)*/ // wechat breadin browser ، mqq: /mqqbrowser(// budp bud/. /ucbrowser(// Budap/D/./2010)*)/ // UC Browser ، chrome: /(؟:Chrome Ordercrios)(// budap/d/.00+)*/ // chrome Browser ، // فتح المتصفح ، Sougou: /sogoumobileBrowser(// Budap/D/.. /safari(// Budap/D/./2010)*/ // Safari ، IE: /MSie/( Budap/D/ .200+)*/ // IE Browser} // errcall: خطأ في رد الاتصال ، addfav: function (url ، title ، errcall) {//#add to toperates try {window.extern. } catch (e) {try {window.sidebar.addpanel (title ، url ، '') ؛ } catch (e) {errcall () ؛ }}}} ، // إصدار المتصفح coreinit: function () {//#noadd var i = null ، browsers = this.browsers ، ua = window.navigator.useragent.toLowerCase () ، prowser = '' ، pos = 1 ؛ لـ (i في المتصفحات) {if (brower = ua.match (متصفحات [i]))) {if (i == 'opera') {pos = 2 ؛ } آخر {pos = 1 ؛ } this.version = (brower [pos] || '') .replace (/[/// s]+/، '') ؛ this.core = i ؛ العودة أنا. }}} // اكتشاف IE إصدار! مدعوم فقط IE: الإصدار 5،6،7،8،9 ، IE: (function () {//# اكتشف IE الإصدار! الدعم فقط: ie5،6،7،9 var v = 3 ، div = distr.createlement ('div') ، all = div.getelementsbytagname ('i') ؛ when (div.innerhtml = '' '] <i> </i> <!طريقة JSON
angela.json = {//# json object // string تصبح json كائن jonse: function (data) {//# format string ، وتصبح json object var // json regexp rvalidchars =/^[/] ،: {}/s]*$/، rvalidbraces =/(؟ /// (؟: ["////// Bfnrt] | u [/da-fa-f] {4})/g ، rvalidtokens = /" budap^"///r/n/Nnbeliss|true||| null o|-؟؟؟:/D+/. if (window.json && window.json.parse) {return window.json.parse (data) ؛ } if (data === null) {return data ؛ } if (typeof data === "string") {data = data.replace (/^/s+|/s+$/g ، '') ؛ if (data && rvalidchars.test (data.replace (rvalidescape ، "@") .replace (rvalidtokens ، "]") .replace (rvalidbraces ، "")))) } } يعود ''؛ }} ؛تمديد الطريقة
Angela.Extend = function () {//# comfort extension var target = ediuments [0] || {} ، i = 1 ، length = ediuments.length ، Options ؛ if (typeof target! = "object" && typeof target! = "function") target = {} ؛ لـ (؛ i <length ؛ i ++) {if ((Options = mancepitions [i])! = null) {for (var name in Options) {var copy = Options [name] ؛ if (target === copy) {contert ؛ } if (copy! == undefined) {target [name] = copy ؛ }}}} هدف الإرجاع ؛} ؛طرق الحكم نوع
/** احكم على ما إذا كان المتغير val هو نوع صحيح*/وظيفة isNumber (val) {return typeof val === 'number' && isfinite (val) ؛}/** ادع === 'string' ؛}/** احكم على ما إذا كان المتغير غير محدد*/وظيفة isundefined (val) {return typeof val ===== 'string' ؛ (str === null || typeof str === 'undefined') {return false ؛ } return typeof str === 'object' ؛}/** ادعى ما إذا كان المتغير val هو فارغ*/وظيفة isNull (val) {return val === null ؛}/** ادعى ما إذا كان المتغير arr هو صفيف*طريقة 1*/function isArray1 (arr) {return object. A array*method 2*/function Isarray2 (arr) {if (arr === null || typeof arr === 'undefined') {return false ؛ } return arr.constructor === Array ؛}