From 6637ceaf41e0b28329bbe9ccf27ce809ac6ed242 Mon Sep 17 00:00:00 2001 From: perploug Date: Wed, 19 Feb 2014 00:11:02 +0100 Subject: [PATCH] Add support for looking up 3rd party editor file paths Adds a file resolver on the mediaHelper, property editors can then register a resolver to return file paths from whatever format --- .../UmbracoSettings/ContentElement.cs | 5 -- .../ContentImagingCropCollection.cs | 36 ------------- .../ContentImagingCropElement.cs | 33 ------------ .../ContentImagingCropSizeCollection.cs | 36 ------------- .../ContentImagingCropSizeElement.cs | 25 --------- .../ContentImagingCropsElement.cs | 27 ---------- .../UmbracoSettings/ContentImagingElement.cs | 7 +-- .../UmbracoSettings/IContentSection.cs | 2 - .../UmbracoSettings/IImagingCrop.cs | 13 ----- .../UmbracoSettings/IImagingCropSize.cs | 11 ---- .../UmbracoSettings/IImagingCrops.cs | 11 ---- src/Umbraco.Core/Umbraco.Core.csproj | 8 --- .../ContentElementDefaultTests.cs | 18 ------- .../UmbracoSettings/ContentElementTests.cs | 53 ------------------- .../lib/yepnope/yepnope.min.js | 2 +- .../common/services/mediahelper.service.js | 38 +++++++++++++ .../src/common/services/util.service.js | 11 ++-- .../fileupload/fileupload.controller.js | 9 +++- .../imagecropper/imagecropper.controller.js | 35 ++++++++++-- .../imagecropper/imagecropper.html | 3 +- 20 files changed, 86 insertions(+), 297 deletions(-) delete mode 100644 src/Umbraco.Core/Configuration/UmbracoSettings/ContentImagingCropCollection.cs delete mode 100644 src/Umbraco.Core/Configuration/UmbracoSettings/ContentImagingCropElement.cs delete mode 100644 src/Umbraco.Core/Configuration/UmbracoSettings/ContentImagingCropSizeCollection.cs delete mode 100644 src/Umbraco.Core/Configuration/UmbracoSettings/ContentImagingCropSizeElement.cs delete mode 100644 src/Umbraco.Core/Configuration/UmbracoSettings/ContentImagingCropsElement.cs delete mode 100644 src/Umbraco.Core/Configuration/UmbracoSettings/IImagingCrop.cs delete mode 100644 src/Umbraco.Core/Configuration/UmbracoSettings/IImagingCropSize.cs delete mode 100644 src/Umbraco.Core/Configuration/UmbracoSettings/IImagingCrops.cs diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/ContentElement.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/ContentElement.cs index 87fe63002b..ced63f04bb 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/ContentElement.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/ContentElement.cs @@ -280,11 +280,6 @@ namespace Umbraco.Core.Configuration.UmbracoSettings } } - IImagingCrops IContentSection.ImageCrops - { - get { return Imaging.Crops; } - } - string IContentSection.NotificationEmailAddress { get { return Notifications.NotificationEmailAddress; } diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/ContentImagingCropCollection.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/ContentImagingCropCollection.cs deleted file mode 100644 index ed2da19b34..0000000000 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/ContentImagingCropCollection.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Collections.Generic; -using System.Configuration; - -namespace Umbraco.Core.Configuration.UmbracoSettings -{ - internal class ContentImagingCropCollection : ConfigurationElementCollection, IEnumerable - { - internal void Add(ContentImagingCropElement c) - { - BaseAdd(c); - } - - protected override ConfigurationElement CreateNewElement() - { - return new ContentImagingCropElement(); - } - - protected override object GetElementKey(ConfigurationElement element) - { - return ((ContentImagingCropElement)element).MediaTypeAlias; - } - - IEnumerator IEnumerable.GetEnumerator() - { - for (var i = 0; i < Count; i++) - { - yield return BaseGet(i) as IImagingCrop; - } - } - - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } - } -} \ No newline at end of file diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/ContentImagingCropElement.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/ContentImagingCropElement.cs deleted file mode 100644 index 86a4cda18e..0000000000 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/ContentImagingCropElement.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.Collections.Generic; -using System.Configuration; - -namespace Umbraco.Core.Configuration.UmbracoSettings -{ - internal class ContentImagingCropElement : ConfigurationElement, IImagingCrop - { - [ConfigurationProperty("mediaTypeAlias", IsRequired = true)] - public string MediaTypeAlias - { - get { return (string)base["mediaTypeAlias"]; } - } - - [ConfigurationProperty("focalPointProperty", IsRequired = false)] - public string FocalPointProperty - { - get { return (string)base["focalPointProperty"]; } - } - - [ConfigurationCollection(typeof(ContentImagingCropSizeCollection))] - [ConfigurationProperty("", IsDefaultCollection = true)] - public ContentImagingCropSizeCollection CropSizeCollection - { - get { return (ContentImagingCropSizeCollection)base[""]; } - //set { base[""] = value; } - } - - IEnumerable IImagingCrop.CropSizes - { - get { return CropSizeCollection; } - } - } -} \ No newline at end of file diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/ContentImagingCropSizeCollection.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/ContentImagingCropSizeCollection.cs deleted file mode 100644 index 427674720a..0000000000 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/ContentImagingCropSizeCollection.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Collections.Generic; -using System.Configuration; - -namespace Umbraco.Core.Configuration.UmbracoSettings -{ - internal class ContentImagingCropSizeCollection : ConfigurationElementCollection, IEnumerable - { - internal void Add(ContentImagingCropSizeElement c) - { - BaseAdd(c); - } - - protected override ConfigurationElement CreateNewElement() - { - return new ContentImagingCropSizeElement(); - } - - protected override object GetElementKey(ConfigurationElement element) - { - return ((ContentImagingCropSizeElement)element).Alias; - } - - IEnumerator IEnumerable.GetEnumerator() - { - for (var i = 0; i < Count; i++) - { - yield return BaseGet(i) as IImagingCropSize; - } - } - - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } - } -} \ No newline at end of file diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/ContentImagingCropSizeElement.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/ContentImagingCropSizeElement.cs deleted file mode 100644 index 6691a8ea06..0000000000 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/ContentImagingCropSizeElement.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.Configuration; - -namespace Umbraco.Core.Configuration.UmbracoSettings -{ - internal class ContentImagingCropSizeElement : ConfigurationElement, IImagingCropSize - { - [ConfigurationProperty("alias", IsRequired = true)] - public string Alias - { - get { return (string)base["alias"]; } - } - - [ConfigurationProperty("width", IsRequired = true)] - public int Width - { - get { return (int)base["width"]; } - } - - [ConfigurationProperty("height", IsRequired = true)] - public int Height - { - get { return (int)base["height"]; } - } - } -} \ No newline at end of file diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/ContentImagingCropsElement.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/ContentImagingCropsElement.cs deleted file mode 100644 index 9555fe1422..0000000000 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/ContentImagingCropsElement.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.Collections.Generic; -using System.Configuration; - -namespace Umbraco.Core.Configuration.UmbracoSettings -{ - internal class ContentImagingCropsElement : ConfigurationElement, IImagingCrops - { - [ConfigurationProperty("saveFiles", DefaultValue = false)] - public bool SaveFiles - { - get { return (bool)base["saveFiles"]; } - } - - [ConfigurationCollection(typeof(ContentImagingCropCollection), AddItemName = "crop")] - [ConfigurationProperty("", IsDefaultCollection = true)] - public ContentImagingCropCollection CropCollection - { - get { return (ContentImagingCropCollection)base[""]; } - //set { base[""] = value; } - } - - IEnumerable IImagingCrops.Crops - { - get { return CropCollection; } - } - } -} \ No newline at end of file diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/ContentImagingElement.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/ContentImagingElement.cs index 07af1335b3..305463856b 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/ContentImagingElement.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/ContentImagingElement.cs @@ -4,12 +4,7 @@ namespace Umbraco.Core.Configuration.UmbracoSettings { internal class ContentImagingElement : ConfigurationElement { - [ConfigurationProperty("crops")] - internal ContentImagingCropsElement Crops - { - get { return (ContentImagingCropsElement)base["crops"]; } - } - + [ConfigurationProperty("imageFileTypes")] internal CommaDelimitedConfigurationElement ImageFileTypes { diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IContentSection.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IContentSection.cs index c3a86c1710..93e3260b44 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/IContentSection.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/IContentSection.cs @@ -4,8 +4,6 @@ namespace Umbraco.Core.Configuration.UmbracoSettings { public interface IContentSection : IUmbracoConfigurationSection { - IImagingCrops ImageCrops { get; } - string NotificationEmailAddress { get; } bool DisableHtmlEmail { get; } diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IImagingCrop.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IImagingCrop.cs deleted file mode 100644 index 025a264a1d..0000000000 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/IImagingCrop.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Collections.Generic; - -namespace Umbraco.Core.Configuration.UmbracoSettings -{ - public interface IImagingCrop - { - string MediaTypeAlias { get; } - - string FocalPointProperty { get; } - - IEnumerable CropSizes { get; } - } -} \ No newline at end of file diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IImagingCropSize.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IImagingCropSize.cs deleted file mode 100644 index 0dac07b9b2..0000000000 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/IImagingCropSize.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace Umbraco.Core.Configuration.UmbracoSettings -{ - public interface IImagingCropSize - { - string Alias { get; } - - int Width { get; } - - int Height { get; } - } -} \ No newline at end of file diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IImagingCrops.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IImagingCrops.cs deleted file mode 100644 index 02b602c6b9..0000000000 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/IImagingCrops.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Collections.Generic; - -namespace Umbraco.Core.Configuration.UmbracoSettings -{ - public interface IImagingCrops - { - bool SaveFiles { get; } - - IEnumerable Crops { get; } - } -} \ No newline at end of file diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj index bca0b0adce..6a4b90a311 100644 --- a/src/Umbraco.Core/Umbraco.Core.csproj +++ b/src/Umbraco.Core/Umbraco.Core.csproj @@ -198,14 +198,6 @@ - - - - - - - - diff --git a/src/Umbraco.Tests/Configurations/UmbracoSettings/ContentElementDefaultTests.cs b/src/Umbraco.Tests/Configurations/UmbracoSettings/ContentElementDefaultTests.cs index ca9d5484ea..d31bfa3a7a 100644 --- a/src/Umbraco.Tests/Configurations/UmbracoSettings/ContentElementDefaultTests.cs +++ b/src/Umbraco.Tests/Configurations/UmbracoSettings/ContentElementDefaultTests.cs @@ -11,24 +11,6 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings get { return true; } } - [Test] - public override void ImageCrops() - { - Assert.IsFalse(SettingsSection.Content.ImageCrops.SaveFiles); - } - - [Test] - public override void ImageCropItem() - { - Assert.AreEqual(0, SettingsSection.Content.ImageCrops.Crops.Count()); - } - - [Test] - public override void ImageCropSizes() - { - Assert.AreEqual(0, SettingsSection.Content.ImageCrops.Crops.Count()); - } - [Test] public override void DisableHtmlEmail() { diff --git a/src/Umbraco.Tests/Configurations/UmbracoSettings/ContentElementTests.cs b/src/Umbraco.Tests/Configurations/UmbracoSettings/ContentElementTests.cs index 904f819cb7..668845b7b7 100644 --- a/src/Umbraco.Tests/Configurations/UmbracoSettings/ContentElementTests.cs +++ b/src/Umbraco.Tests/Configurations/UmbracoSettings/ContentElementTests.cs @@ -11,59 +11,6 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings [TestFixture] public class ContentElementTests : UmbracoSettingsTests { - [Test] - public virtual void ImageCrops() - { - Assert.AreEqual(true, SettingsSection.Content.ImageCrops.SaveFiles); - Assert.AreEqual(2, SettingsSection.Content.ImageCrops.Crops.Count()); - } - - [Test] - public virtual void ImageCropItem() - { - Assert.AreEqual("image", SettingsSection.Content.ImageCrops.Crops.First().MediaTypeAlias); - Assert.AreEqual("umbracoFocalPoint", SettingsSection.Content.ImageCrops.Crops.First().FocalPointProperty); - Assert.AreEqual(3, SettingsSection.Content.ImageCrops.Crops.First().CropSizes.Count()); - - Assert.AreEqual("custom", SettingsSection.Content.ImageCrops.Crops.Last().MediaTypeAlias); - Assert.AreEqual("customPoint", SettingsSection.Content.ImageCrops.Crops.Last().FocalPointProperty); - Assert.AreEqual(2, SettingsSection.Content.ImageCrops.Crops.Last().CropSizes.Count()); - } - - [Test] - public virtual void ImageCropSizes() - { - var toVerify1 = new List> - { - new Tuple("thumb", 100, 100), - new Tuple("portrait", 320, 400), - new Tuple("banner", 620, 140), - }; - var toVerify2 = new List> - { - new Tuple("thumb", 100, 100), - new Tuple("banner", 600, 100), - }; - - for (var i = 0; i < SettingsSection.Content.ImageCrops.Crops.First().CropSizes.Count(); i++) - { - var size = SettingsSection.Content.ImageCrops.Crops.First().CropSizes.ElementAt(i); - var verify = toVerify1[i]; - Assert.AreEqual(verify.Item1, size.Alias); - Assert.AreEqual(verify.Item2, size.Width); - Assert.AreEqual(verify.Item3, size.Height); - } - for (var i = 0; i < SettingsSection.Content.ImageCrops.Crops.Last().CropSizes.Count(); i++) - { - var size = SettingsSection.Content.ImageCrops.Crops.Last().CropSizes.ElementAt(i); - var verify = toVerify2[i]; - Assert.AreEqual(verify.Item1, size.Alias); - Assert.AreEqual(verify.Item2, size.Width); - Assert.AreEqual(verify.Item3, size.Height); - } - - } - [Test] public void EmailAddress() { diff --git a/src/Umbraco.Web.UI.Client/lib/yepnope/yepnope.min.js b/src/Umbraco.Web.UI.Client/lib/yepnope/yepnope.min.js index 59428559a3..da934c045a 100644 --- a/src/Umbraco.Web.UI.Client/lib/yepnope/yepnope.min.js +++ b/src/Umbraco.Web.UI.Client/lib/yepnope/yepnope.min.js @@ -1,2 +1,2 @@ /*yepnope1.5.x|WTFPL*/ -(function (a, b, c) { function d(a) { return "[object Function]" == o.call(a) } function e(a) { return "string" == typeof a } function f() { } function g(a) { return !a || "loaded" == a || "complete" == a || "uninitialized" == a } function h() { var a = p.shift(); q = 1, a ? a.t ? m(function () { ("c" == a.t ? B.injectCss : B.injectJs)(a.s, 0, a.a, a.x, a.e, 1) }, 0) : (a(), h()) : q = 0 } function i(a, c, d, e, f, i, j) { function k(b) { if (!o && g(l.readyState) && (u.r = o = 1, !q && h(), l.onload = l.onreadystatechange = null, b)) { "img" != a && m(function () { t.removeChild(l) }, 50); for (var d in y[c]) y[c].hasOwnProperty(d) && y[c][d].onload() } } var j = j || B.errorTimeout, l = b.createElement(a), o = 0, r = 0, u = { t: d, s: c, e: f, a: i, x: j }; 1 === y[c] && (r = 1, y[c] = []), "object" == a ? l.data = c : (l.src = c, l.type = a), l.width = l.height = "0", l.onerror = l.onload = l.onreadystatechange = function () { k.call(this, r) }, p.splice(e, 0, u), "img" != a && (r || 2 === y[c] ? (t.insertBefore(l, s ? null : n), m(k, j)) : y[c].push(l)) } function j(a, b, c, d, f) { return q = 0, b = b || "j", e(a) ? i("c" == b ? v : u, a, b, this.i++, c, d, f) : (p.splice(this.i++, 0, a), 1 == p.length && h()), this } function k() { var a = B; return a.loader = { load: j, i: 0 }, a } var l = b.documentElement, m = a.setTimeout, n = b.getElementsByTagName("script")[0], o = {}.toString, p = [], q = 0, r = "MozAppearance" in l.style, s = r && !!b.createRange().compareNode, t = s ? l : n.parentNode, l = a.opera && "[object Opera]" == o.call(a.opera), l = !!b.attachEvent && !l, u = r ? "object" : l ? "script" : "img", v = l ? "script" : u, w = Array.isArray || function (a) { return "[object Array]" == o.call(a) }, x = [], y = {}, z = { timeout: function (a, b) { return b.length && (a.timeout = b[0]), a } }, A, B; B = function (a) { function b(a) { var a = a.split("!"), b = x.length, c = a.pop(), d = a.length, c = { url: c, origUrl: c, prefixes: a }, e, f, g; for (f = 0; f < d; f++) g = a[f].split("="), (e = z[g.shift()]) && (c = e(c, g)); for (f = 0; f < b; f++) c = x[f](c); return c } function g(a, e, f, g, h) { var i = b(a), j = i.autoCallback; i.url.split(".").pop().split("?").shift(), i.bypass || (e && (e = d(e) ? e : e[a] || e[g] || e[a.split("/").pop().split("?")[0]]), i.instead ? i.instead(a, e, f, g, h) : (y[i.url] ? i.noexec = !0 : y[i.url] = 1, f.load(i.url, i.forceCSS || !i.forceJS && "css" == i.url.split(".").pop().split("?").shift() ? "c" : c, i.noexec, i.attrs, i.timeout), (d(e) || d(j)) && f.load(function () { k(), e && e(i.origUrl, h, g), j && j(i.origUrl, h, g), y[i.url] = 2 }))) } function h(a, b) { function c(a, c) { if (a) { if (e(a)) c || (j = function () { var a = [].slice.call(arguments); k.apply(this, a), l() }), g(a, j, b, 0, h); else if (Object(a) === a) for (n in m = function () { var b = 0, c; for (c in a) a.hasOwnProperty(c) && b++; return b }(), a) a.hasOwnProperty(n) && (!c && !--m && (d(j) ? j = function () { var a = [].slice.call(arguments); k.apply(this, a), l() } : j[n] = function (a) { return function () { var b = [].slice.call(arguments); a && a.apply(this, b), l() } }(k[n])), g(a[n], j, b, n, h)) } else !c && l() } var h = !!a.test, i = a.load || a.both, j = a.callback || f, k = j, l = a.complete || f, m, n; c(h ? a.yep : a.nope, !!i), i && c(i) } var i, j, l = this.yepnope.loader; if (e(a)) g(a, 0, l, 0); else if (w(a)) for (i = 0; i < a.length; i++) j = a[i], e(j) ? g(j, 0, l, 0) : w(j) ? B(j) : Object(j) === j && h(j, l); else Object(a) === a && h(a, l) }, B.addPrefix = function (a, b) { z[a] = b }, B.addFilter = function (a) { x.push(a) }, B.errorTimeout = 1e4, null == b.readyState && b.addEventListener && (b.readyState = "loading", b.addEventListener("DOMContentLoaded", A = function () { b.removeEventListener("DOMContentLoaded", A, 0), b.readyState = "complete" }, 0)), a.yepnope = k(), a.yepnope.executeStack = h, a.yepnope.injectJs = function (a, c, d, e, i, j) { var k = b.createElement("script"), l, o, e = e || B.errorTimeout; k.src = a; for (o in d) k.setAttribute(o, d[o]); c = j ? h : c || f, k.onreadystatechange = k.onload = function () { !l && g(k.readyState) && (l = 1, c(), k.onload = k.onreadystatechange = null) }, m(function () { l || (l = 1, c(1)) }, e), i ? k.onload() : n.parentNode.insertBefore(k, n) }, a.yepnope.injectCss = function (a, c, d, e, g, i) { var e = b.createElement("link"), j, c = i ? h : c || f; e.href = a, e.rel = "stylesheet", e.type = "text/css"; for (j in d) e.setAttribute(j, d[j]); g || (n.parentNode.insertBefore(e, n), m(c, 0)) } })(this, document); \ No newline at end of file +(function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f - + +