diff --git a/src/collective/behavior/featuredimage/static/main.js b/src/collective/behavior/featuredimage/static/main.js index 4646a49..53a39cf 100644 --- a/src/collective/behavior/featuredimage/static/main.js +++ b/src/collective/behavior/featuredimage/static/main.js @@ -1,2 +1,2 @@ -!function(){var a,b,c;!function(d){function e(a,b){return u.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=b&&b.split("/"),o=s.map,p=o&&o["*"]||{};if(a&&"."===a.charAt(0))if(b){for(n=n.slice(0,n.length-1),a=a.split("/"),g=a.length-1,s.nodeIdCompat&&w.test(a[g])&&(a[g]=a[g].replace(w,"")),a=n.concat(a),k=0;k0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((n||p)&&o){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),n)for(l=n.length;l>0;l-=1)if(e=o[n.slice(0,l).join("/")],e&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&p&&p[d]&&(i=p[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,b){return function(){return n.apply(d,v.call(arguments,0).concat([a,b]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){q[a]=b}}function j(a){if(e(r,a)){var b=r[a];delete r[a],t[a]=!0,m.apply(d,b)}if(!e(q,a)&&!e(t,a))throw new Error("No "+a);return q[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return function(){return s&&s.config&&s.config[a]||{}}}var m,n,o,p,q={},r={},s={},t={},u=Object.prototype.hasOwnProperty,v=[].slice,w=/\.js$/;o=function(a,b){var c,d=k(a),e=d[0];return a=d[1],e&&(e=f(e,b),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(b)):f(a,b):(a=f(a,b),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},p={require:function(a){return g(a)},exports:function(a){var b=q[a];return"undefined"!=typeof b?b:q[a]={}},module:function(a){return{id:a,uri:"",exports:q[a],config:l(a)}}},m=function(a,b,c,f){var h,k,l,m,n,s,u=[],v=typeof c;if(f=f||a,"undefined"===v||"function"===v){for(b=!b.length&&c.length?["require","exports","module"]:b,n=0;n-1?0:-1:b?0:-1}function d(a){var b=this.cache,c=typeof a;if("boolean"==c||null==a)b[a]=!0;else{"number"!=c&&"string"!=c&&(c="object");var d="number"==c?a:s+a,e=b[c]||(b[c]={});"object"==c?(e[d]||(e[d]=[])).push(a):e[d]=!0}}function e(a){return a.charCodeAt(0)}function f(a,b){for(var c=a.criteria,d=b.criteria,e=-1,f=c.length;++eh||"undefined"==typeof g)return 1;if(h>g||"undefined"==typeof h)return-1}}return a.index-b.index}function g(a){var b=-1,c=a.length,e=a[0],f=a[c/2|0],g=a[c-1];if(e&&"object"==typeof e&&f&&"object"==typeof f&&g&&"object"==typeof g)return!1;var h=j();h["false"]=h["null"]=h["true"]=h.undefined=!1;var i=j();for(i.array=a,i.cache=h,i.push=d;++be?0:e);++d=t&&f===a,j=[];if(i){var k=g(d);k?(f=b,d=k):i=!1}for(;++e-1:void 0});return e.pop(),f.pop(),s&&(k(e),k(f)),g}function ca(a,b,c,d,e){(Zc(b)?Ya:hd)(b,function(b,f){var g,h,i=b,j=a[f];if(b&&((h=Zc(b))||id(b))){for(var k=d.length;k--;)if(g=d[k]==b){j=e[k];break}if(!g){var l;c&&(i=c(j,b),(l="undefined"!=typeof i)&&(j=i)),l||(j=h?Zc(j)?j:[]:id(j)?j:{}),d.push(b),e.push(j),l||ca(j,b,c,d,e)}}else c&&(i=c(j,b),"undefined"==typeof i&&(i=b)),"undefined"!=typeof i&&(j=i);a[f]=j})}function da(a,b){return a+Ec(Vc()*(b-a+1))}function ea(c,d,e){var f=-1,h=ia(),j=c?c.length:0,m=[],n=!d&&j>=t&&h===a,o=e||n?i():m;if(n){var p=g(o);h=b,o=p}for(;++f3&&"function"==typeof b[c-2])var d=Y(b[--c-1],b[c--],2);else c>2&&"function"==typeof b[c-1]&&(d=b[--c]);for(var e=m(arguments,1,c),f=-1,g=i(),h=i();++fc?Sc(0,f+c):c)||0,Zc(a)?g=e(a,b,c)>-1:"number"==typeof f?g=(Ja(a)?a.indexOf(b,c):e(a,b,c))>-1:hd(a,function(a){return++d>=c?!(g=a===b):void 0}),g}function Ua(a,b,c){var e=!0;b=d.createCallback(b,c,3);var f=-1,g=a?a.length:0;if("number"==typeof g)for(;++fg&&(g=j)}else b=null==b&&Ja(a)?e:d.createCallback(b,c,3),Ya(a,function(a,c,d){var e=b(a,c,d);e>f&&(f=e,g=a)});return g}function bb(a,b,c){var f=1/0,g=f;if("function"!=typeof b&&c&&c[b]===a&&(b=null),null==b&&Zc(a))for(var h=-1,i=a.length;++hj&&(g=j)}else b=null==b&&Ja(a)?e:d.createCallback(b,c,3),Ya(a,function(a,c,d){var e=b(a,c,d);f>e&&(f=e,g=a)});return g}function cb(a,b,c,e){if(!a)return c;var f=arguments.length<3;b=d.createCallback(b,e,4);var g=-1,h=a.length;if("number"==typeof h)for(f&&(c=a[++g]);++gd?Sc(0,e+d):d||0}else if(d){var f=Ab(b,c);return b[f]===c?f:-1}return a(b,c,d)}function sb(a,b,c){var e=0,f=a?a.length:0;if("number"!=typeof b&&null!=b){var g=f;for(b=d.createCallback(b,c,3);g--&&b(a[g],g,a);)e++}else e=null==b||c?1:b||e;return m(a,0,Tc(Sc(0,f-e),f))}function tb(){for(var c=[],d=-1,e=arguments.length,f=i(),h=ia(),j=h===a,m=i();++d=t&&g(d?c[d]:m)))}var o=c[0],p=-1,q=o?o.length:0,r=[];a:for(;++pc?Sc(0,d+c):Tc(c,d-1))+1);d--;)if(a[d]===b)return d;return-1}function wb(a){for(var b=arguments,c=0,d=b.length,e=a?a.length:0;++cf;){var h=f+g>>>1;c(a[h])1?arguments:arguments[0],b=-1,c=a?ab(md(a,"length")):0,d=nc(0>c?0:c);++b2?ga(a,17,m(arguments,2),null,b):ga(a,1,null,null,b)}function Jb(a){for(var b=arguments.length>1?_(arguments,!0,!1,1):ua(a),c=-1,d=b.length;++c2?ga(b,19,m(arguments,2),null,a):ga(b,3,null,null,a)}function Lb(){for(var a=arguments,b=a.length;b--;)if(!Da(a[b]))throw new wc;return function(){for(var b=arguments,c=a.length;c--;)b=[a[c].apply(this,b)];return b[0]}}function Mb(a,b){return b="number"==typeof b?b:+b||a.length,ga(a,4,null,null,null,b)}function Nb(a,b,c){var d,e,f,g,h,i,j,k=0,l=!1,m=!0;if(!Da(a))throw new wc;if(b=Sc(0,b)||0,c===!0){var n=!0;m=!1}else Ea(c)&&(n=c.leading,l="maxWait"in c&&(Sc(b,c.maxWait)||0),m="trailing"in c?c.trailing:m);var p=function(){var c=b-(od()-g);if(0>=c){e&&Dc(e);var l=j;e=i=j=o,l&&(k=od(),f=a.apply(h,d),i||e||(d=h=null))}else i=Jc(p,c)},q=function(){i&&Dc(i),e=i=j=o,(m||l!==b)&&(k=od(),f=a.apply(h,d),i||e||(d=h=null))};return function(){if(d=arguments,g=od(),h=this,j=m&&(i||!n),l===!1)var c=n&&!i;else{e||n||(k=g);var o=l-(g-k),r=0>=o;r?(e&&(e=Dc(e)),k=g,f=a.apply(h,d)):e||(e=Jc(q,o))}return r&&i?i=Dc(i):i||b===l||(i=Jc(p,b)),c&&(r=!0,f=a.apply(h,d)),!r||i||e||(d=h=null),f}}function Ob(a){if(!Da(a))throw new wc;var b=m(arguments,1);return Jc(function(){a.apply(o,b)},1)}function Pb(a,b){if(!Da(a))throw new wc;var c=m(arguments,2);return Jc(function(){a.apply(o,c)},b)}function Qb(a,b){if(!Da(a))throw new wc;var c=function(){var d=c.cache,e=b?b.apply(this,arguments):s+arguments[0];return Hc.call(d,e)?d[e]:d[e]=a.apply(this,arguments)};return c.cache={},c}function Rb(a){var b,c;if(!Da(a))throw new wc;return function(){return b?c:(b=!0,c=a.apply(this,arguments),a=null,c)}}function Sb(a){return ga(a,16,m(arguments,1))}function Tb(a){return ga(a,32,null,m(arguments,1))}function Ub(a,b,c){var d=!0,e=!0;if(!Da(a))throw new wc;return c===!1?d=!1:Ea(c)&&(d="leading"in c?c.leading:d,e="trailing"in c?c.trailing:e),T.leading=d,T.maxWait=b,T.trailing=e,Nb(a,b,T)}function Vb(a,b){return ga(b,16,[a])}function Wb(a){return function(){return a}}function Xb(a,b,c){var d=typeof a;if(null==a||"function"==d)return Y(a,b,c);if("object"!=d)return bc(a);var e=_c(a),f=e[0],g=a[f];return 1!=e.length||g!==g||Ea(g)?function(b){for(var c=e.length,d=!1;c--&&(d=ba(b[e[c]],a[e[c]],null,!0)););return d}:function(a){var b=a[f];return g===b&&(0!==g||1/g==1/b)}}function Yb(a){return null==a?"":vc(a).replace(dd,ha)}function Zb(a){return a}function $b(a,b,c){var e=!0,f=b&&ua(b);b&&(c||f.length)||(null==c&&(c=b),g=p,b=a,a=d,f=ua(b)),c===!1?e=!1:Ea(c)&&"chain"in c&&(e=c.chain);var g=a,h=Da(g);Ya(f,function(c){var d=a[c]=b[c];h&&(g.prototype[c]=function(){var b=this.__chain__,c=this.__wrapped__,f=[c];Ic.apply(f,arguments);var h=d.apply(a,f);if(e||b){if(c===h&&Ea(h))return this;h=new g(h),h.__chain__=b}return h})})}function _b(){return c._=zc,this}function ac(){}function bc(a){return function(b){return b[a]}}function cc(a,b,c){var d=null==a,e=null==b;if(null==c&&("boolean"==typeof a&&e?(c=a,a=1):e||"boolean"!=typeof b||(c=b,e=!0)),d&&e&&(b=1),a=+a||0,e?(b=a,a=0):b=+b||0,c||a%1||b%1){var f=Vc();return Tc(a+f*(b-a+parseFloat("1e-"+((f+"").length-1))),b)}return da(a,b)}function dc(a,b){if(a){var c=a[b];return Da(c)?a[b]():c}}function ec(a,b,c){var e=d.templateSettings;a=vc(a||""),c=fd({},c,e);var f,g=fd({},c.imports,e.imports),i=_c(g),j=Ra(g),k=0,l=c.interpolate||E,m="__p += '",n=uc((c.escape||E).source+"|"+l.source+"|"+(l===C?z:E).source+"|"+(c.evaluate||E).source+"|$","g");a.replace(n,function(b,c,d,e,g,i){return d||(d=e),m+=a.slice(k,i).replace(G,h),c&&(m+="' +\n__e("+c+") +\n'"),g&&(f=!0,m+="';\n"+g+";\n__p += '"),d&&(m+="' +\n((__t = ("+d+")) == null ? '' : __t) +\n'"),k=i+b.length,b}),m+="';\n";var p=c.variable,q=p;q||(p="obj",m="with ("+p+") {\n"+m+"\n}\n"),m=(f?m.replace(w,""):m).replace(x,"$1").replace(y,"$1;"),m="function("+p+") {\n"+(q?"":p+" || ("+p+" = {});\n")+"var __t, __p = '', __e = _.escape"+(f?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+m+"return __p\n}";var r="\n/*\n//# sourceURL="+(c.sourceURL||"/lodash/template/source["+I++ +"]")+"\n*/";try{var s=qc(i,"return "+m+r).apply(o,j)}catch(t){throw t.source=m,t}return b?s(b):(s.source=m,s)}function fc(a,b,c){a=(a=+a)>-1?a:0;var d=-1,e=nc(a);for(b=Y(b,c,1);++d/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:C,variable:"",imports:{_:d}},Nc||(W=function(){function a(){}return function(b){if(Ea(b)){a.prototype=b;var d=new a;a.prototype=null}return d||c.Object()}}());var Yc=Mc?function(a,b){U.value=b,Mc(a,"__bindData__",U),U.value=null}:ac,Zc=Oc||function(a){return a&&"object"==typeof a&&"number"==typeof a.length&&Ac.call(a)==K||!1},$c=function(a){var b,c=a,d=[];if(!c)return d;if(!V[typeof a])return d;for(b in c)Hc.call(c,b)&&d.push(b);return d},_c=Rc?function(a){return Ea(a)?Rc(a):[]}:$c,ad={"&":"&","<":"<",">":">",'"':""","'":"'"},bd=wa(ad),cd=uc("("+_c(bd).join("|")+")","g"),dd=uc("["+_c(ad).join("")+"]","g"),ed=function(a,b,c){var d,e=a,f=e;if(!e)return f;var g=arguments,h=0,i="number"==typeof c?2:g.length;if(i>3&&"function"==typeof g[i-2])var j=Y(g[--i-1],g[i--],2);else i>2&&"function"==typeof g[i-1]&&(j=g[--i]);for(;++h/g,D=RegExp("^["+v+"]*0+(?=.$)"),E=/($^)/,F=/\bthis\b/,G=/['\n\r\t\u2028\u2029\\]/g,H=["Array","Boolean","Date","Function","Math","Number","Object","RegExp","String","_","attachEvent","clearTimeout","isFinite","isNaN","parseInt","setTimeout"],I=0,J="[object Arguments]",K="[object Array]",L="[object Boolean]",M="[object Date]",N="[object Function]",O="[object Number]",P="[object Object]",Q="[object RegExp]",R="[object String]",S={};S[N]=!1,S[J]=S[K]=S[L]=S[M]=S[O]=S[P]=S[Q]=S[R]=!0;var T={leading:!1,maxWait:0,trailing:!1},U={configurable:!1,enumerable:!1,value:null,writable:!1},V={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},W={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},X=V[typeof window]&&window||this,Y=V[typeof exports]&&exports&&!exports.nodeType&&exports,Z=V[typeof module]&&module&&!module.nodeType&&module,$=Z&&Z.exports===Y&&Y,_=V[typeof global]&&global;!_||_.global!==_&&_.window!==_||(X=_);var aa=n();"function"==typeof c&&"object"==typeof c.amd&&c.amd?(X._=aa,c("underscore",[],function(){return aa})):Y&&Z?$?(Z.exports=aa)._=aa:Y._=aa:X._=aa}.call(this),function(a,d){if("function"==typeof c&&c.amd)c("backbone",["underscore","jquery","exports"],function(b,c,e){a.Backbone=d(a,e,b,c)});else if("undefined"!=typeof exports){var e=b("underscore");d(a,exports,e)}else a.Backbone=d(a,{},a._,a.jQuery||a.Zepto||a.ender||a.$)}(this,function(a,b,c,d){var e=a.Backbone,f=[],g=(f.push,f.slice);f.splice;b.VERSION="1.1.2",b.$=d,b.noConflict=function(){return a.Backbone=e,this},b.emulateHTTP=!1,b.emulateJSON=!1;var h=b.Events={on:function(a,b,c){if(!j(this,"on",a,[b,c])||!b)return this;this._events||(this._events={});var d=this._events[a]||(this._events[a]=[]);return d.push({callback:b,context:c,ctx:c||this}),this},once:function(a,b,d){if(!j(this,"once",a,[b,d])||!b)return this;var e=this,f=c.once(function(){ -e.off(a,f),b.apply(this,arguments)});return f._callback=b,this.on(a,f,d)},off:function(a,b,d){var e,f,g,h,i,k,l,m;if(!this._events||!j(this,"off",a,[b,d]))return this;if(!a&&!b&&!d)return this._events=void 0,this;for(h=a?[a]:c.keys(this._events),i=0,k=h.length;k>i;i++)if(a=h[i],g=this._events[a]){if(this._events[a]=e=[],b||d)for(l=0,m=g.length;m>l;l++)f=g[l],(b&&b!==f.callback&&b!==f.callback._callback||d&&d!==f.context)&&e.push(f);e.length||delete this._events[a]}return this},trigger:function(a){if(!this._events)return this;var b=g.call(arguments,1);if(!j(this,"trigger",a,b))return this;var c=this._events[a],d=this._events.all;return c&&k(c,b),d&&k(d,arguments),this},stopListening:function(a,b,d){var e=this._listeningTo;if(!e)return this;var f=!b&&!d;d||"object"!=typeof b||(d=this),a&&((e={})[a._listenId]=a);for(var g in e)a=e[g],a.off(b,d,this),(f||c.isEmpty(a._events))&&delete this._listeningTo[g];return this}},i=/\s+/,j=function(a,b,c,d){if(!c)return!0;if("object"==typeof c){for(var e in c)a[b].apply(a,[e,c[e]].concat(d));return!1}if(i.test(c)){for(var f=c.split(i),g=0,h=f.length;h>g;g++)a[b].apply(a,[f[g]].concat(d));return!1}return!0},k=function(a,b){var c,d=-1,e=a.length,f=b[0],g=b[1],h=b[2];switch(b.length){case 0:for(;++dm;m++)this.trigger("change:"+h[m],this,l[h[m]],d)}if(j)return this;if(!i)for(;this._pending;)d=this._pending,this._pending=!1,this.trigger("change",this,d);return this._pending=!1,this._changing=!1,this},unset:function(a,b){return this.set(a,void 0,c.extend({},b,{unset:!0}))},clear:function(a){var b={};for(var d in this.attributes)b[d]=void 0;return this.set(b,c.extend({},a,{unset:!0}))},hasChanged:function(a){return null==a?!c.isEmpty(this.changed):c.has(this.changed,a)},changedAttributes:function(a){if(!a)return this.hasChanged()?c.clone(this.changed):!1;var b,d=!1,e=this._changing?this._previousAttributes:this.attributes;for(var f in a)c.isEqual(e[f],b=a[f])||((d||(d={}))[f]=b);return d},previous:function(a){return null!=a&&this._previousAttributes?this._previousAttributes[a]:null},previousAttributes:function(){return c.clone(this._previousAttributes)},fetch:function(a){a=a?c.clone(a):{},void 0===a.parse&&(a.parse=!0);var b=this,d=a.success;return a.success=function(c){return b.set(b.parse(c,a),a)?(d&&d(b,c,a),void b.trigger("sync",b,c,a)):!1},L(this,a),this.sync("read",this,a)},save:function(a,b,d){var e,f,g,h=this.attributes;if(null==a||"object"==typeof a?(e=a,d=b):(e={})[a]=b,d=c.extend({validate:!0},d),e&&!d.wait){if(!this.set(e,d))return!1}else if(!this._validate(e,d))return!1;e&&d.wait&&(this.attributes=c.extend({},h,e)),void 0===d.parse&&(d.parse=!0);var i=this,j=d.success;return d.success=function(a){i.attributes=h;var b=i.parse(a,d);return d.wait&&(b=c.extend(e||{},b)),c.isObject(b)&&!i.set(b,d)?!1:(j&&j(i,a,d),void i.trigger("sync",i,a,d))},L(this,d),f=this.isNew()?"create":d.patch?"patch":"update","patch"===f&&(d.attrs=e),g=this.sync(f,this,d),e&&d.wait&&(this.attributes=h),g},destroy:function(a){a=a?c.clone(a):{};var b=this,d=a.success,e=function(){b.trigger("destroy",b,b.collection,a)};if(a.success=function(c){(a.wait||b.isNew())&&e(),d&&d(b,c,a),b.isNew()||b.trigger("sync",b,c,a)},this.isNew())return a.success(),!1;L(this,a);var f=this.sync("delete",this,a);return a.wait||e(),f},url:function(){var a=c.result(this,"urlRoot")||c.result(this.collection,"url")||K();return this.isNew()?a:a.replace(/([^\/])$/,"$1/")+encodeURIComponent(this.id)},parse:function(a,b){return a},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(a){return this._validate({},c.extend(a||{},{validate:!0}))},_validate:function(a,b){if(!b.validate||!this.validate)return!0;a=c.extend({},this.attributes,a);var d=this.validationError=this.validate(a,b)||null;return d?(this.trigger("invalid",this,d,c.extend(b,{validationError:d})),!1):!0}});var n=["keys","values","pairs","invert","pick","omit"];c.each(n,function(a){m.prototype[a]=function(){var b=g.call(arguments);return b.unshift(this.attributes),c[a].apply(c,b)}});var o=b.Collection=function(a,b){b||(b={}),b.model&&(this.model=b.model),void 0!==b.comparator&&(this.comparator=b.comparator),this._reset(),this.initialize.apply(this,arguments),a&&this.reset(a,c.extend({silent:!0},b))},p={add:!0,remove:!0,merge:!0},q={add:!0,remove:!1};c.extend(o.prototype,h,{model:m,initialize:function(){},toJSON:function(a){return this.map(function(b){return b.toJSON(a)})},sync:function(){return b.sync.apply(this,arguments)},add:function(a,b){return this.set(a,c.extend({merge:!1},b,q))},remove:function(a,b){var d=!c.isArray(a);a=d?[a]:c.clone(a),b||(b={});var e,f,g,h;for(e=0,f=a.length;f>e;e++)h=a[e]=this.get(a[e]),h&&(delete this._byId[h.id],delete this._byId[h.cid],g=this.indexOf(h),this.models.splice(g,1),this.length--,b.silent||(b.index=g,h.trigger("remove",h,this,b)),this._removeReference(h,b));return d?a[0]:a},set:function(a,b){b=c.defaults({},b,p),b.parse&&(a=this.parse(a,b));var d=!c.isArray(a);a=d?a?[a]:[]:c.clone(a);var e,f,g,h,i,j,k,l=b.at,n=this.model,o=this.comparator&&null==l&&b.sort!==!1,q=c.isString(this.comparator)?this.comparator:null,r=[],s=[],t={},u=b.add,v=b.merge,w=b.remove,x=!o&&u&&w?[]:!1;for(e=0,f=a.length;f>e;e++){if(i=a[e]||{},g=i instanceof m?h=i:i[n.prototype.idAttribute||"id"],j=this.get(g))w&&(t[j.cid]=!0),v&&(i=i===h?h.attributes:i,b.parse&&(i=j.parse(i,b)),j.set(i,b),o&&!k&&j.hasChanged(q)&&(k=!0)),a[e]=j;else if(u){if(h=a[e]=this._prepareModel(i,b),!h)continue;r.push(h),this._addReference(h,b)}h=j||h,!x||!h.isNew()&&t[h.id]||x.push(h),t[h.id]=!0}if(w){for(e=0,f=this.length;f>e;++e)t[(h=this.models[e]).cid]||s.push(h);s.length&&this.remove(s,b)}if(r.length||x&&x.length)if(o&&(k=!0),this.length+=r.length,null!=l)for(e=0,f=r.length;f>e;e++)this.models.splice(l+e,0,r[e]);else{x&&(this.models.length=0);var y=x||r;for(e=0,f=y.length;f>e;e++)this.models.push(y[e])}if(k&&this.sort({silent:!0}),!b.silent){for(e=0,f=r.length;f>e;e++)(h=r[e]).trigger("add",h,this,b);(k||x&&x.length)&&this.trigger("sort",this,b)}return d?a[0]:a},reset:function(a,b){b||(b={});for(var d=0,e=this.models.length;e>d;d++)this._removeReference(this.models[d],b);return b.previousModels=this.models,this._reset(),a=this.add(a,c.extend({silent:!0},b)),b.silent||this.trigger("reset",this,b),a},push:function(a,b){return this.add(a,c.extend({at:this.length},b))},pop:function(a){var b=this.at(this.length-1);return this.remove(b,a),b},unshift:function(a,b){return this.add(a,c.extend({at:0},b))},shift:function(a){var b=this.at(0);return this.remove(b,a),b},slice:function(){return g.apply(this.models,arguments)},get:function(a){return null==a?void 0:this._byId[a]||this._byId[a.id]||this._byId[a.cid]},at:function(a){return this.models[a]},where:function(a,b){return c.isEmpty(a)?b?void 0:[]:this[b?"find":"filter"](function(b){for(var c in a)if(a[c]!==b.get(c))return!1;return!0})},findWhere:function(a){return this.where(a,!0)},sort:function(a){if(!this.comparator)throw new Error("Cannot sort a set without a comparator");return a||(a={}),c.isString(this.comparator)||1===this.comparator.length?this.models=this.sortBy(this.comparator,this):this.models.sort(c.bind(this.comparator,this)),a.silent||this.trigger("sort",this,a),this},pluck:function(a){return c.invoke(this.models,"get",a)},fetch:function(a){a=a?c.clone(a):{},void 0===a.parse&&(a.parse=!0);var b=a.success,d=this;return a.success=function(c){var e=a.reset?"reset":"set";d[e](c,a),b&&b(d,c,a),d.trigger("sync",d,c,a)},L(this,a),this.sync("read",this,a)},create:function(a,b){if(b=b?c.clone(b):{},!(a=this._prepareModel(a,b)))return!1;b.wait||this.add(a,b);var d=this,e=b.success;return b.success=function(a,c){b.wait&&d.add(a,b),e&&e(a,c,b)},a.save(null,b),a},parse:function(a,b){return a},clone:function(){return new this.constructor(this.models)},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(a,b){if(a instanceof m)return a;b=b?c.clone(b):{},b.collection=this;var d=new this.model(a,b);return d.validationError?(this.trigger("invalid",this,d.validationError,b),!1):d},_addReference:function(a,b){this._byId[a.cid]=a,null!=a.id&&(this._byId[a.id]=a),a.collection||(a.collection=this),a.on("all",this._onModelEvent,this)},_removeReference:function(a,b){this===a.collection&&delete a.collection,a.off("all",this._onModelEvent,this)},_onModelEvent:function(a,b,c,d){("add"!==a&&"remove"!==a||c===this)&&("destroy"===a&&this.remove(b,d),b&&a==="change:"+b.idAttribute&&(delete this._byId[b.previous(b.idAttribute)],null!=b.id&&(this._byId[b.id]=b)),this.trigger.apply(this,arguments))}});var r=["forEach","each","map","collect","reduce","foldl","inject","reduceRight","foldr","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max","min","toArray","size","first","head","take","initial","rest","tail","drop","last","without","difference","indexOf","shuffle","lastIndexOf","isEmpty","chain","sample"];c.each(r,function(a){o.prototype[a]=function(){var b=g.call(arguments);return b.unshift(this.models),c[a].apply(c,b)}});var s=["groupBy","countBy","sortBy","indexBy"];c.each(s,function(a){o.prototype[a]=function(b,d){var e=c.isFunction(b)?b:function(a){return a.get(b)};return c[a](this.models,e,d)}});var t=b.View=function(a){this.cid=c.uniqueId("view"),a||(a={}),c.extend(this,c.pick(a,v)),this._ensureElement(),this.initialize.apply(this,arguments),this.delegateEvents()},u=/^(\S+)\s*(.*)$/,v=["model","collection","el","id","attributes","className","tagName","events"];c.extend(t.prototype,h,{tagName:"div",$:function(a){return this.$el.find(a)},initialize:function(){},render:function(){return this},remove:function(){return this.$el.remove(),this.stopListening(),this},setElement:function(a,c){return this.$el&&this.undelegateEvents(),this.$el=a instanceof b.$?a:b.$(a),this.el=this.$el[0],c!==!1&&this.delegateEvents(),this},delegateEvents:function(a){if(!a&&!(a=c.result(this,"events")))return this;this.undelegateEvents();for(var b in a){var d=a[b];if(c.isFunction(d)||(d=this[a[b]]),d){var e=b.match(u),f=e[1],g=e[2];d=c.bind(d,this),f+=".delegateEvents"+this.cid,""===g?this.$el.on(f,d):this.$el.on(f,g,d)}}return this},undelegateEvents:function(){return this.$el.off(".delegateEvents"+this.cid),this},_ensureElement:function(){if(this.el)this.setElement(c.result(this,"el"),!1);else{var a=c.extend({},c.result(this,"attributes"));this.id&&(a.id=c.result(this,"id")),this.className&&(a["class"]=c.result(this,"className"));var d=b.$("<"+c.result(this,"tagName")+">").attr(a);this.setElement(d,!1)}}}),b.sync=function(a,d,e){var f=x[a];c.defaults(e||(e={}),{emulateHTTP:b.emulateHTTP,emulateJSON:b.emulateJSON});var g={type:f,dataType:"json"};if(e.url||(g.url=c.result(d,"url")||K()),null!=e.data||!d||"create"!==a&&"update"!==a&&"patch"!==a||(g.contentType="application/json",g.data=JSON.stringify(e.attrs||d.toJSON(e))),e.emulateJSON&&(g.contentType="application/x-www-form-urlencoded",g.data=g.data?{model:g.data}:{}),e.emulateHTTP&&("PUT"===f||"DELETE"===f||"PATCH"===f)){g.type="POST",e.emulateJSON&&(g.data._method=f);var h=e.beforeSend;e.beforeSend=function(a){return a.setRequestHeader("X-HTTP-Method-Override",f),h?h.apply(this,arguments):void 0}}"GET"===g.type||e.emulateJSON||(g.processData=!1),"PATCH"===g.type&&w&&(g.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")});var i=e.xhr=b.ajax(c.extend(g,e));return d.trigger("request",d,i,e),i};var w=!("undefined"==typeof window||!window.ActiveXObject||window.XMLHttpRequest&&(new XMLHttpRequest).dispatchEvent),x={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};b.ajax=function(){return b.$.ajax.apply(b.$,arguments)};var y=b.Router=function(a){a||(a={}),a.routes&&(this.routes=a.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},z=/\((.*?)\)/g,A=/(\(\?)?:\w+/g,B=/\*\w+/g,C=/[\-{}\[\]+?.,\\\^$|#\s]/g;c.extend(y.prototype,h,{initialize:function(){},route:function(a,d,e){c.isRegExp(a)||(a=this._routeToRegExp(a)),c.isFunction(d)&&(e=d,d=""),e||(e=this[d]);var f=this;return b.history.route(a,function(c){var g=f._extractParameters(a,c);f.execute(e,g),f.trigger.apply(f,["route:"+d].concat(g)),f.trigger("route",d,g),b.history.trigger("route",f,d,g)}),this},execute:function(a,b){a&&a.apply(this,b)},navigate:function(a,c){return b.history.navigate(a,c),this},_bindRoutes:function(){if(this.routes){this.routes=c.result(this,"routes");for(var a,b=c.keys(this.routes);null!=(a=b.pop());)this.route(a,this.routes[a])}},_routeToRegExp:function(a){return a=a.replace(C,"\\$&").replace(z,"(?:$1)?").replace(A,function(a,b){return b?a:"([^/?]+)"}).replace(B,"([^?]*?)"),new RegExp("^"+a+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(a,b){var d=a.exec(b).slice(1);return c.map(d,function(a,b){return b===d.length-1?a||null:a?decodeURIComponent(a):null})}});var D=b.History=function(){this.handlers=[],c.bindAll(this,"checkUrl"),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)},E=/^[#\/]|\s+$/g,F=/^\/+|\/+$/g,G=/msie [\w.]+/,H=/\/$/,I=/#.*$/;D.started=!1,c.extend(D.prototype,h,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root},getHash:function(a){var b=(a||this).location.href.match(/#(.*)$/);return b?b[1]:""},getFragment:function(a,b){if(null==a)if(this._hasPushState||!this._wantsHashChange||b){a=decodeURI(this.location.pathname+this.location.search);var c=this.root.replace(H,"");a.indexOf(c)||(a=a.slice(c.length))}else a=this.getHash();return a.replace(E,"")},start:function(a){if(D.started)throw new Error("Backbone.history has already been started");D.started=!0,this.options=c.extend({root:"/"},this.options,a),this.root=this.options.root,this._wantsHashChange=this.options.hashChange!==!1,this._wantsPushState=!!this.options.pushState,this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var d=this.getFragment(),e=document.documentMode,f=G.exec(navigator.userAgent.toLowerCase())&&(!e||7>=e);if(this.root=("/"+this.root+"/").replace(F,"/"),f&&this._wantsHashChange){var g=b.$('\n'},this.JST}),c("views/behaviorform",["jquery","underscore","backbone","templates"],function(a,b,c,d){"use strict";var e=c.View.extend({template:d["app/scripts/templates/behaviorform.ejs"],tagName:"div",id:"featuredimage-preview",initialize:function(){this.render(),a("#fieldset-featured-image").append(this.el),this.$iframe=this.$("iframe"),this.$quote=a("#form-widgets-IFeaturedImage-featuredimage_quote"),this.$author=a("#form-widgets-IFeaturedImage-featuredimage_author"),this.$iframe.on("load",this.iframeready(this)),this.$quote.on("input",this.updateFeaturedImage(this)),this.$author.on("input",this.updateFeaturedImage(this))},render:function(){var b=void 0;b={source:"featuredimage.html"},"9000"!==location.port&&(location.href.indexOf("++add++")>0?b.source=portal_url+"/@@featuredimage":b.source=a("head base").attr("href")+"/@@featuredimage"),b.source=b.source.replace(/\/\//g,"/"),b.source=b.source.replace(/http\:\//g,"http://"),this.$el.html(this.template(b))},iframeready:function(b){return function(){var c=void 0,d=void 0;b.$featuredimage=a("#featuredimage",b.$iframe[0].contentWindow.document.body),c=a("img",b.$featuredimage),d=new Image,d.src=c.attr("src"),d.onload=function(){b.$el.width(this.width/2+10),b.$el.height(this.height/2+10),b.$iframe.width(this.width+10),b.$iframe.height(this.height+10),b.updateFeaturedImage(b)()}}},updateFeaturedImage:function(b){return function(){var c=void 0,d=void 0;d=a(".quote .text",b.$featuredimage),c=a(".quote .author",b.$featuredimage),d.html(b.$quote.val()),c.html(b.$author.val())}}});return e}),c("jquery",[],function(){return jQuery}),b.config({paths:{backbone:"../bower_components/backbone/backbone",underscore:"../bower_components/lodash/dist/lodash"}}),b(["backbone","views/behaviorform"],function(a,b){return a.history.start(),$("#fieldset-featured-image").length>0?new b:void 0}),c("main",function(){})}(); \ No newline at end of file +!function(){var a,b,c;!function(d){function e(a,b){return u.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=b&&b.split("/"),o=s.map,p=o&&o["*"]||{};if(a&&"."===a.charAt(0))if(b){for(n=n.slice(0,n.length-1),a=a.split("/"),g=a.length-1,s.nodeIdCompat&&w.test(a[g])&&(a[g]=a[g].replace(w,"")),a=n.concat(a),k=0;k0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((n||p)&&o){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),n)for(l=n.length;l>0;l-=1)if(e=o[n.slice(0,l).join("/")],e&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&p&&p[d]&&(i=p[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,b){return function(){return n.apply(d,v.call(arguments,0).concat([a,b]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){q[a]=b}}function j(a){if(e(r,a)){var b=r[a];delete r[a],t[a]=!0,m.apply(d,b)}if(!e(q,a)&&!e(t,a))throw new Error("No "+a);return q[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return function(){return s&&s.config&&s.config[a]||{}}}var m,n,o,p,q={},r={},s={},t={},u=Object.prototype.hasOwnProperty,v=[].slice,w=/\.js$/;o=function(a,b){var c,d=k(a),e=d[0];return a=d[1],e&&(e=f(e,b),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(b)):f(a,b):(a=f(a,b),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},p={require:function(a){return g(a)},exports:function(a){var b=q[a];return"undefined"!=typeof b?b:q[a]={}},module:function(a){return{id:a,uri:"",exports:q[a],config:l(a)}}},m=function(a,b,c,f){var h,k,l,m,n,s,u=[],v=typeof c;if(f=f||a,"undefined"===v||"function"===v){for(b=!b.length&&c.length?["require","exports","module"]:b,n=0;n-1?0:-1:b?0:-1}function d(a){var b=this.cache,c=typeof a;if("boolean"==c||null==a)b[a]=!0;else{"number"!=c&&"string"!=c&&(c="object");var d="number"==c?a:s+a,e=b[c]||(b[c]={});"object"==c?(e[d]||(e[d]=[])).push(a):e[d]=!0}}function e(a){return a.charCodeAt(0)}function f(a,b){for(var c=a.criteria,d=b.criteria,e=-1,f=c.length;++eh||"undefined"==typeof g)return 1;if(h>g||"undefined"==typeof h)return-1}}return a.index-b.index}function g(a){var b=-1,c=a.length,e=a[0],f=a[c/2|0],g=a[c-1];if(e&&"object"==typeof e&&f&&"object"==typeof f&&g&&"object"==typeof g)return!1;var h=j();h["false"]=h["null"]=h["true"]=h.undefined=!1;var i=j();for(i.array=a,i.cache=h,i.push=d;++be?0:e);++d=t&&f===a,j=[];if(i){var k=g(d);k?(f=b,d=k):i=!1}for(;++e-1:void 0});return e.pop(),f.pop(),s&&(k(e),k(f)),g}function ca(a,b,c,d,e){(Zc(b)?Ya:hd)(b,function(b,f){var g,h,i=b,j=a[f];if(b&&((h=Zc(b))||id(b))){for(var k=d.length;k--;)if(g=d[k]==b){j=e[k];break}if(!g){var l;c&&(i=c(j,b),(l="undefined"!=typeof i)&&(j=i)),l||(j=h?Zc(j)?j:[]:id(j)?j:{}),d.push(b),e.push(j),l||ca(j,b,c,d,e)}}else c&&(i=c(j,b),"undefined"==typeof i&&(i=b)),"undefined"!=typeof i&&(j=i);a[f]=j})}function da(a,b){return a+Ec(Vc()*(b-a+1))}function ea(c,d,e){var f=-1,h=ia(),j=c?c.length:0,m=[],n=!d&&j>=t&&h===a,o=e||n?i():m;if(n){var p=g(o);h=b,o=p}for(;++f3&&"function"==typeof b[c-2])var d=Y(b[--c-1],b[c--],2);else c>2&&"function"==typeof b[c-1]&&(d=b[--c]);for(var e=m(arguments,1,c),f=-1,g=i(),h=i();++fc?Sc(0,f+c):c)||0,Zc(a)?g=e(a,b,c)>-1:"number"==typeof f?g=(Ja(a)?a.indexOf(b,c):e(a,b,c))>-1:hd(a,function(a){return++d>=c?!(g=a===b):void 0}),g}function Ua(a,b,c){var e=!0;b=d.createCallback(b,c,3);var f=-1,g=a?a.length:0;if("number"==typeof g)for(;++fg&&(g=j)}else b=null==b&&Ja(a)?e:d.createCallback(b,c,3),Ya(a,function(a,c,d){var e=b(a,c,d);e>f&&(f=e,g=a)});return g}function bb(a,b,c){var f=1/0,g=f;if("function"!=typeof b&&c&&c[b]===a&&(b=null),null==b&&Zc(a))for(var h=-1,i=a.length;++hj&&(g=j)}else b=null==b&&Ja(a)?e:d.createCallback(b,c,3),Ya(a,function(a,c,d){var e=b(a,c,d);f>e&&(f=e,g=a)});return g}function cb(a,b,c,e){if(!a)return c;var f=arguments.length<3;b=d.createCallback(b,e,4);var g=-1,h=a.length;if("number"==typeof h)for(f&&(c=a[++g]);++gd?Sc(0,e+d):d||0}else if(d){var f=Ab(b,c);return b[f]===c?f:-1}return a(b,c,d)}function sb(a,b,c){var e=0,f=a?a.length:0;if("number"!=typeof b&&null!=b){var g=f;for(b=d.createCallback(b,c,3);g--&&b(a[g],g,a);)e++}else e=null==b||c?1:b||e;return m(a,0,Tc(Sc(0,f-e),f))}function tb(){for(var c=[],d=-1,e=arguments.length,f=i(),h=ia(),j=h===a,m=i();++d=t&&g(d?c[d]:m)))}var o=c[0],p=-1,q=o?o.length:0,r=[];a:for(;++pc?Sc(0,d+c):Tc(c,d-1))+1);d--;)if(a[d]===b)return d;return-1}function wb(a){for(var b=arguments,c=0,d=b.length,e=a?a.length:0;++cf;){var h=f+g>>>1;c(a[h])1?arguments:arguments[0],b=-1,c=a?ab(md(a,"length")):0,d=nc(0>c?0:c);++b2?ga(a,17,m(arguments,2),null,b):ga(a,1,null,null,b)}function Jb(a){for(var b=arguments.length>1?_(arguments,!0,!1,1):ua(a),c=-1,d=b.length;++c2?ga(b,19,m(arguments,2),null,a):ga(b,3,null,null,a)}function Lb(){for(var a=arguments,b=a.length;b--;)if(!Da(a[b]))throw new wc;return function(){for(var b=arguments,c=a.length;c--;)b=[a[c].apply(this,b)];return b[0]}}function Mb(a,b){return b="number"==typeof b?b:+b||a.length,ga(a,4,null,null,null,b)}function Nb(a,b,c){var d,e,f,g,h,i,j,k=0,l=!1,m=!0;if(!Da(a))throw new wc;if(b=Sc(0,b)||0,c===!0){var n=!0;m=!1}else Ea(c)&&(n=c.leading,l="maxWait"in c&&(Sc(b,c.maxWait)||0),m="trailing"in c?c.trailing:m);var p=function(){var c=b-(od()-g);if(0>=c){e&&Dc(e);var l=j;e=i=j=o,l&&(k=od(),f=a.apply(h,d),i||e||(d=h=null))}else i=Jc(p,c)},q=function(){i&&Dc(i),e=i=j=o,(m||l!==b)&&(k=od(),f=a.apply(h,d),i||e||(d=h=null))};return function(){if(d=arguments,g=od(),h=this,j=m&&(i||!n),l===!1)var c=n&&!i;else{e||n||(k=g);var o=l-(g-k),r=0>=o;r?(e&&(e=Dc(e)),k=g,f=a.apply(h,d)):e||(e=Jc(q,o))}return r&&i?i=Dc(i):i||b===l||(i=Jc(p,b)),c&&(r=!0,f=a.apply(h,d)),!r||i||e||(d=h=null),f}}function Ob(a){if(!Da(a))throw new wc;var b=m(arguments,1);return Jc(function(){a.apply(o,b)},1)}function Pb(a,b){if(!Da(a))throw new wc;var c=m(arguments,2);return Jc(function(){a.apply(o,c)},b)}function Qb(a,b){if(!Da(a))throw new wc;var c=function(){var d=c.cache,e=b?b.apply(this,arguments):s+arguments[0];return Hc.call(d,e)?d[e]:d[e]=a.apply(this,arguments)};return c.cache={},c}function Rb(a){var b,c;if(!Da(a))throw new wc;return function(){return b?c:(b=!0,c=a.apply(this,arguments),a=null,c)}}function Sb(a){return ga(a,16,m(arguments,1))}function Tb(a){return ga(a,32,null,m(arguments,1))}function Ub(a,b,c){var d=!0,e=!0;if(!Da(a))throw new wc;return c===!1?d=!1:Ea(c)&&(d="leading"in c?c.leading:d,e="trailing"in c?c.trailing:e),T.leading=d,T.maxWait=b,T.trailing=e,Nb(a,b,T)}function Vb(a,b){return ga(b,16,[a])}function Wb(a){return function(){return a}}function Xb(a,b,c){var d=typeof a;if(null==a||"function"==d)return Y(a,b,c);if("object"!=d)return bc(a);var e=_c(a),f=e[0],g=a[f];return 1!=e.length||g!==g||Ea(g)?function(b){for(var c=e.length,d=!1;c--&&(d=ba(b[e[c]],a[e[c]],null,!0)););return d}:function(a){var b=a[f];return g===b&&(0!==g||1/g==1/b)}}function Yb(a){return null==a?"":vc(a).replace(dd,ha)}function Zb(a){return a}function $b(a,b,c){var e=!0,f=b&&ua(b);b&&(c||f.length)||(null==c&&(c=b),g=p,b=a,a=d,f=ua(b)),c===!1?e=!1:Ea(c)&&"chain"in c&&(e=c.chain);var g=a,h=Da(g);Ya(f,function(c){var d=a[c]=b[c];h&&(g.prototype[c]=function(){var b=this.__chain__,c=this.__wrapped__,f=[c];Ic.apply(f,arguments);var h=d.apply(a,f);if(e||b){if(c===h&&Ea(h))return this;h=new g(h),h.__chain__=b}return h})})}function _b(){return c._=zc,this}function ac(){}function bc(a){return function(b){return b[a]}}function cc(a,b,c){var d=null==a,e=null==b;if(null==c&&("boolean"==typeof a&&e?(c=a,a=1):e||"boolean"!=typeof b||(c=b,e=!0)),d&&e&&(b=1),a=+a||0,e?(b=a,a=0):b=+b||0,c||a%1||b%1){var f=Vc();return Tc(a+f*(b-a+parseFloat("1e-"+((f+"").length-1))),b)}return da(a,b)}function dc(a,b){if(a){var c=a[b];return Da(c)?a[b]():c}}function ec(a,b,c){var e=d.templateSettings;a=vc(a||""),c=fd({},c,e);var f,g=fd({},c.imports,e.imports),i=_c(g),j=Ra(g),k=0,l=c.interpolate||E,m="__p += '",n=uc((c.escape||E).source+"|"+l.source+"|"+(l===C?z:E).source+"|"+(c.evaluate||E).source+"|$","g");a.replace(n,function(b,c,d,e,g,i){return d||(d=e),m+=a.slice(k,i).replace(G,h),c&&(m+="' +\n__e("+c+") +\n'"),g&&(f=!0,m+="';\n"+g+";\n__p += '"),d&&(m+="' +\n((__t = ("+d+")) == null ? '' : __t) +\n'"),k=i+b.length,b}),m+="';\n";var p=c.variable,q=p;q||(p="obj",m="with ("+p+") {\n"+m+"\n}\n"),m=(f?m.replace(w,""):m).replace(x,"$1").replace(y,"$1;"),m="function("+p+") {\n"+(q?"":p+" || ("+p+" = {});\n")+"var __t, __p = '', __e = _.escape"+(f?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+m+"return __p\n}";var r="\n/*\n//# sourceURL="+(c.sourceURL||"/lodash/template/source["+I++ +"]")+"\n*/";try{var s=qc(i,"return "+m+r).apply(o,j)}catch(t){throw t.source=m,t}return b?s(b):(s.source=m,s)}function fc(a,b,c){a=(a=+a)>-1?a:0;var d=-1,e=nc(a);for(b=Y(b,c,1);++d/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:C,variable:"",imports:{_:d}},Nc||(W=function(){function a(){}return function(b){if(Ea(b)){a.prototype=b;var d=new a;a.prototype=null}return d||c.Object()}}());var Yc=Mc?function(a,b){U.value=b,Mc(a,"__bindData__",U),U.value=null}:ac,Zc=Oc||function(a){return a&&"object"==typeof a&&"number"==typeof a.length&&Ac.call(a)==K||!1},$c=function(a){var b,c=a,d=[];if(!c)return d;if(!V[typeof a])return d;for(b in c)Hc.call(c,b)&&d.push(b);return d},_c=Rc?function(a){return Ea(a)?Rc(a):[]}:$c,ad={"&":"&","<":"<",">":">",'"':""","'":"'"},bd=wa(ad),cd=uc("("+_c(bd).join("|")+")","g"),dd=uc("["+_c(ad).join("")+"]","g"),ed=function(a,b,c){var d,e=a,f=e;if(!e)return f;var g=arguments,h=0,i="number"==typeof c?2:g.length;if(i>3&&"function"==typeof g[i-2])var j=Y(g[--i-1],g[i--],2);else i>2&&"function"==typeof g[i-1]&&(j=g[--i]);for(;++h/g,D=RegExp("^["+v+"]*0+(?=.$)"),E=/($^)/,F=/\bthis\b/,G=/['\n\r\t\u2028\u2029\\]/g,H=["Array","Boolean","Date","Function","Math","Number","Object","RegExp","String","_","attachEvent","clearTimeout","isFinite","isNaN","parseInt","setTimeout"],I=0,J="[object Arguments]",K="[object Array]",L="[object Boolean]",M="[object Date]",N="[object Function]",O="[object Number]",P="[object Object]",Q="[object RegExp]",R="[object String]",S={};S[N]=!1,S[J]=S[K]=S[L]=S[M]=S[O]=S[P]=S[Q]=S[R]=!0;var T={leading:!1,maxWait:0,trailing:!1},U={configurable:!1,enumerable:!1,value:null,writable:!1},V={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},W={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},X=V[typeof window]&&window||this,Y=V[typeof exports]&&exports&&!exports.nodeType&&exports,Z=V[typeof module]&&module&&!module.nodeType&&module,$=Z&&Z.exports===Y&&Y,_=V[typeof global]&&global;!_||_.global!==_&&_.window!==_||(X=_);var aa=n();"function"==typeof c&&"object"==typeof c.amd&&c.amd?(X._=aa,c("underscore",[],function(){return aa})):Y&&Z?$?(Z.exports=aa)._=aa:Y._=aa:X._=aa}.call(this),function(a,d){if("function"==typeof c&&c.amd)c("backbone",["underscore","jquery","exports"],function(b,c,e){a.Backbone=d(a,e,b,c)});else if("undefined"!=typeof exports){var e=b("underscore");d(a,exports,e)}else a.Backbone=d(a,{},a._,a.jQuery||a.Zepto||a.ender||a.$)}(this,function(a,b,c,d){var e=a.Backbone,f=[],g=(f.push,f.slice);f.splice;b.VERSION="1.1.2",b.$=d,b.noConflict=function(){return a.Backbone=e,this},b.emulateHTTP=!1,b.emulateJSON=!1;var h=b.Events={on:function(a,b,c){if(!j(this,"on",a,[b,c])||!b)return this;this._events||(this._events={});var d=this._events[a]||(this._events[a]=[]);return d.push({callback:b,context:c,ctx:c||this}),this},once:function(a,b,d){if(!j(this,"once",a,[b,d])||!b)return this;var e=this,f=c.once(function(){ +e.off(a,f),b.apply(this,arguments)});return f._callback=b,this.on(a,f,d)},off:function(a,b,d){var e,f,g,h,i,k,l,m;if(!this._events||!j(this,"off",a,[b,d]))return this;if(!a&&!b&&!d)return this._events=void 0,this;for(h=a?[a]:c.keys(this._events),i=0,k=h.length;k>i;i++)if(a=h[i],g=this._events[a]){if(this._events[a]=e=[],b||d)for(l=0,m=g.length;m>l;l++)f=g[l],(b&&b!==f.callback&&b!==f.callback._callback||d&&d!==f.context)&&e.push(f);e.length||delete this._events[a]}return this},trigger:function(a){if(!this._events)return this;var b=g.call(arguments,1);if(!j(this,"trigger",a,b))return this;var c=this._events[a],d=this._events.all;return c&&k(c,b),d&&k(d,arguments),this},stopListening:function(a,b,d){var e=this._listeningTo;if(!e)return this;var f=!b&&!d;d||"object"!=typeof b||(d=this),a&&((e={})[a._listenId]=a);for(var g in e)a=e[g],a.off(b,d,this),(f||c.isEmpty(a._events))&&delete this._listeningTo[g];return this}},i=/\s+/,j=function(a,b,c,d){if(!c)return!0;if("object"==typeof c){for(var e in c)a[b].apply(a,[e,c[e]].concat(d));return!1}if(i.test(c)){for(var f=c.split(i),g=0,h=f.length;h>g;g++)a[b].apply(a,[f[g]].concat(d));return!1}return!0},k=function(a,b){var c,d=-1,e=a.length,f=b[0],g=b[1],h=b[2];switch(b.length){case 0:for(;++dm;m++)this.trigger("change:"+h[m],this,l[h[m]],d)}if(j)return this;if(!i)for(;this._pending;)d=this._pending,this._pending=!1,this.trigger("change",this,d);return this._pending=!1,this._changing=!1,this},unset:function(a,b){return this.set(a,void 0,c.extend({},b,{unset:!0}))},clear:function(a){var b={};for(var d in this.attributes)b[d]=void 0;return this.set(b,c.extend({},a,{unset:!0}))},hasChanged:function(a){return null==a?!c.isEmpty(this.changed):c.has(this.changed,a)},changedAttributes:function(a){if(!a)return this.hasChanged()?c.clone(this.changed):!1;var b,d=!1,e=this._changing?this._previousAttributes:this.attributes;for(var f in a)c.isEqual(e[f],b=a[f])||((d||(d={}))[f]=b);return d},previous:function(a){return null!=a&&this._previousAttributes?this._previousAttributes[a]:null},previousAttributes:function(){return c.clone(this._previousAttributes)},fetch:function(a){a=a?c.clone(a):{},void 0===a.parse&&(a.parse=!0);var b=this,d=a.success;return a.success=function(c){return b.set(b.parse(c,a),a)?(d&&d(b,c,a),void b.trigger("sync",b,c,a)):!1},L(this,a),this.sync("read",this,a)},save:function(a,b,d){var e,f,g,h=this.attributes;if(null==a||"object"==typeof a?(e=a,d=b):(e={})[a]=b,d=c.extend({validate:!0},d),e&&!d.wait){if(!this.set(e,d))return!1}else if(!this._validate(e,d))return!1;e&&d.wait&&(this.attributes=c.extend({},h,e)),void 0===d.parse&&(d.parse=!0);var i=this,j=d.success;return d.success=function(a){i.attributes=h;var b=i.parse(a,d);return d.wait&&(b=c.extend(e||{},b)),c.isObject(b)&&!i.set(b,d)?!1:(j&&j(i,a,d),void i.trigger("sync",i,a,d))},L(this,d),f=this.isNew()?"create":d.patch?"patch":"update","patch"===f&&(d.attrs=e),g=this.sync(f,this,d),e&&d.wait&&(this.attributes=h),g},destroy:function(a){a=a?c.clone(a):{};var b=this,d=a.success,e=function(){b.trigger("destroy",b,b.collection,a)};if(a.success=function(c){(a.wait||b.isNew())&&e(),d&&d(b,c,a),b.isNew()||b.trigger("sync",b,c,a)},this.isNew())return a.success(),!1;L(this,a);var f=this.sync("delete",this,a);return a.wait||e(),f},url:function(){var a=c.result(this,"urlRoot")||c.result(this.collection,"url")||K();return this.isNew()?a:a.replace(/([^\/])$/,"$1/")+encodeURIComponent(this.id)},parse:function(a,b){return a},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(a){return this._validate({},c.extend(a||{},{validate:!0}))},_validate:function(a,b){if(!b.validate||!this.validate)return!0;a=c.extend({},this.attributes,a);var d=this.validationError=this.validate(a,b)||null;return d?(this.trigger("invalid",this,d,c.extend(b,{validationError:d})),!1):!0}});var n=["keys","values","pairs","invert","pick","omit"];c.each(n,function(a){m.prototype[a]=function(){var b=g.call(arguments);return b.unshift(this.attributes),c[a].apply(c,b)}});var o=b.Collection=function(a,b){b||(b={}),b.model&&(this.model=b.model),void 0!==b.comparator&&(this.comparator=b.comparator),this._reset(),this.initialize.apply(this,arguments),a&&this.reset(a,c.extend({silent:!0},b))},p={add:!0,remove:!0,merge:!0},q={add:!0,remove:!1};c.extend(o.prototype,h,{model:m,initialize:function(){},toJSON:function(a){return this.map(function(b){return b.toJSON(a)})},sync:function(){return b.sync.apply(this,arguments)},add:function(a,b){return this.set(a,c.extend({merge:!1},b,q))},remove:function(a,b){var d=!c.isArray(a);a=d?[a]:c.clone(a),b||(b={});var e,f,g,h;for(e=0,f=a.length;f>e;e++)h=a[e]=this.get(a[e]),h&&(delete this._byId[h.id],delete this._byId[h.cid],g=this.indexOf(h),this.models.splice(g,1),this.length--,b.silent||(b.index=g,h.trigger("remove",h,this,b)),this._removeReference(h,b));return d?a[0]:a},set:function(a,b){b=c.defaults({},b,p),b.parse&&(a=this.parse(a,b));var d=!c.isArray(a);a=d?a?[a]:[]:c.clone(a);var e,f,g,h,i,j,k,l=b.at,n=this.model,o=this.comparator&&null==l&&b.sort!==!1,q=c.isString(this.comparator)?this.comparator:null,r=[],s=[],t={},u=b.add,v=b.merge,w=b.remove,x=!o&&u&&w?[]:!1;for(e=0,f=a.length;f>e;e++){if(i=a[e]||{},g=i instanceof m?h=i:i[n.prototype.idAttribute||"id"],j=this.get(g))w&&(t[j.cid]=!0),v&&(i=i===h?h.attributes:i,b.parse&&(i=j.parse(i,b)),j.set(i,b),o&&!k&&j.hasChanged(q)&&(k=!0)),a[e]=j;else if(u){if(h=a[e]=this._prepareModel(i,b),!h)continue;r.push(h),this._addReference(h,b)}h=j||h,!x||!h.isNew()&&t[h.id]||x.push(h),t[h.id]=!0}if(w){for(e=0,f=this.length;f>e;++e)t[(h=this.models[e]).cid]||s.push(h);s.length&&this.remove(s,b)}if(r.length||x&&x.length)if(o&&(k=!0),this.length+=r.length,null!=l)for(e=0,f=r.length;f>e;e++)this.models.splice(l+e,0,r[e]);else{x&&(this.models.length=0);var y=x||r;for(e=0,f=y.length;f>e;e++)this.models.push(y[e])}if(k&&this.sort({silent:!0}),!b.silent){for(e=0,f=r.length;f>e;e++)(h=r[e]).trigger("add",h,this,b);(k||x&&x.length)&&this.trigger("sort",this,b)}return d?a[0]:a},reset:function(a,b){b||(b={});for(var d=0,e=this.models.length;e>d;d++)this._removeReference(this.models[d],b);return b.previousModels=this.models,this._reset(),a=this.add(a,c.extend({silent:!0},b)),b.silent||this.trigger("reset",this,b),a},push:function(a,b){return this.add(a,c.extend({at:this.length},b))},pop:function(a){var b=this.at(this.length-1);return this.remove(b,a),b},unshift:function(a,b){return this.add(a,c.extend({at:0},b))},shift:function(a){var b=this.at(0);return this.remove(b,a),b},slice:function(){return g.apply(this.models,arguments)},get:function(a){return null==a?void 0:this._byId[a]||this._byId[a.id]||this._byId[a.cid]},at:function(a){return this.models[a]},where:function(a,b){return c.isEmpty(a)?b?void 0:[]:this[b?"find":"filter"](function(b){for(var c in a)if(a[c]!==b.get(c))return!1;return!0})},findWhere:function(a){return this.where(a,!0)},sort:function(a){if(!this.comparator)throw new Error("Cannot sort a set without a comparator");return a||(a={}),c.isString(this.comparator)||1===this.comparator.length?this.models=this.sortBy(this.comparator,this):this.models.sort(c.bind(this.comparator,this)),a.silent||this.trigger("sort",this,a),this},pluck:function(a){return c.invoke(this.models,"get",a)},fetch:function(a){a=a?c.clone(a):{},void 0===a.parse&&(a.parse=!0);var b=a.success,d=this;return a.success=function(c){var e=a.reset?"reset":"set";d[e](c,a),b&&b(d,c,a),d.trigger("sync",d,c,a)},L(this,a),this.sync("read",this,a)},create:function(a,b){if(b=b?c.clone(b):{},!(a=this._prepareModel(a,b)))return!1;b.wait||this.add(a,b);var d=this,e=b.success;return b.success=function(a,c){b.wait&&d.add(a,b),e&&e(a,c,b)},a.save(null,b),a},parse:function(a,b){return a},clone:function(){return new this.constructor(this.models)},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(a,b){if(a instanceof m)return a;b=b?c.clone(b):{},b.collection=this;var d=new this.model(a,b);return d.validationError?(this.trigger("invalid",this,d.validationError,b),!1):d},_addReference:function(a,b){this._byId[a.cid]=a,null!=a.id&&(this._byId[a.id]=a),a.collection||(a.collection=this),a.on("all",this._onModelEvent,this)},_removeReference:function(a,b){this===a.collection&&delete a.collection,a.off("all",this._onModelEvent,this)},_onModelEvent:function(a,b,c,d){("add"!==a&&"remove"!==a||c===this)&&("destroy"===a&&this.remove(b,d),b&&a==="change:"+b.idAttribute&&(delete this._byId[b.previous(b.idAttribute)],null!=b.id&&(this._byId[b.id]=b)),this.trigger.apply(this,arguments))}});var r=["forEach","each","map","collect","reduce","foldl","inject","reduceRight","foldr","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max","min","toArray","size","first","head","take","initial","rest","tail","drop","last","without","difference","indexOf","shuffle","lastIndexOf","isEmpty","chain","sample"];c.each(r,function(a){o.prototype[a]=function(){var b=g.call(arguments);return b.unshift(this.models),c[a].apply(c,b)}});var s=["groupBy","countBy","sortBy","indexBy"];c.each(s,function(a){o.prototype[a]=function(b,d){var e=c.isFunction(b)?b:function(a){return a.get(b)};return c[a](this.models,e,d)}});var t=b.View=function(a){this.cid=c.uniqueId("view"),a||(a={}),c.extend(this,c.pick(a,v)),this._ensureElement(),this.initialize.apply(this,arguments),this.delegateEvents()},u=/^(\S+)\s*(.*)$/,v=["model","collection","el","id","attributes","className","tagName","events"];c.extend(t.prototype,h,{tagName:"div",$:function(a){return this.$el.find(a)},initialize:function(){},render:function(){return this},remove:function(){return this.$el.remove(),this.stopListening(),this},setElement:function(a,c){return this.$el&&this.undelegateEvents(),this.$el=a instanceof b.$?a:b.$(a),this.el=this.$el[0],c!==!1&&this.delegateEvents(),this},delegateEvents:function(a){if(!a&&!(a=c.result(this,"events")))return this;this.undelegateEvents();for(var b in a){var d=a[b];if(c.isFunction(d)||(d=this[a[b]]),d){var e=b.match(u),f=e[1],g=e[2];d=c.bind(d,this),f+=".delegateEvents"+this.cid,""===g?this.$el.on(f,d):this.$el.on(f,g,d)}}return this},undelegateEvents:function(){return this.$el.off(".delegateEvents"+this.cid),this},_ensureElement:function(){if(this.el)this.setElement(c.result(this,"el"),!1);else{var a=c.extend({},c.result(this,"attributes"));this.id&&(a.id=c.result(this,"id")),this.className&&(a["class"]=c.result(this,"className"));var d=b.$("<"+c.result(this,"tagName")+">").attr(a);this.setElement(d,!1)}}}),b.sync=function(a,d,e){var f=x[a];c.defaults(e||(e={}),{emulateHTTP:b.emulateHTTP,emulateJSON:b.emulateJSON});var g={type:f,dataType:"json"};if(e.url||(g.url=c.result(d,"url")||K()),null!=e.data||!d||"create"!==a&&"update"!==a&&"patch"!==a||(g.contentType="application/json",g.data=JSON.stringify(e.attrs||d.toJSON(e))),e.emulateJSON&&(g.contentType="application/x-www-form-urlencoded",g.data=g.data?{model:g.data}:{}),e.emulateHTTP&&("PUT"===f||"DELETE"===f||"PATCH"===f)){g.type="POST",e.emulateJSON&&(g.data._method=f);var h=e.beforeSend;e.beforeSend=function(a){return a.setRequestHeader("X-HTTP-Method-Override",f),h?h.apply(this,arguments):void 0}}"GET"===g.type||e.emulateJSON||(g.processData=!1),"PATCH"===g.type&&w&&(g.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")});var i=e.xhr=b.ajax(c.extend(g,e));return d.trigger("request",d,i,e),i};var w=!("undefined"==typeof window||!window.ActiveXObject||window.XMLHttpRequest&&(new XMLHttpRequest).dispatchEvent),x={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};b.ajax=function(){return b.$.ajax.apply(b.$,arguments)};var y=b.Router=function(a){a||(a={}),a.routes&&(this.routes=a.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},z=/\((.*?)\)/g,A=/(\(\?)?:\w+/g,B=/\*\w+/g,C=/[\-{}\[\]+?.,\\\^$|#\s]/g;c.extend(y.prototype,h,{initialize:function(){},route:function(a,d,e){c.isRegExp(a)||(a=this._routeToRegExp(a)),c.isFunction(d)&&(e=d,d=""),e||(e=this[d]);var f=this;return b.history.route(a,function(c){var g=f._extractParameters(a,c);f.execute(e,g),f.trigger.apply(f,["route:"+d].concat(g)),f.trigger("route",d,g),b.history.trigger("route",f,d,g)}),this},execute:function(a,b){a&&a.apply(this,b)},navigate:function(a,c){return b.history.navigate(a,c),this},_bindRoutes:function(){if(this.routes){this.routes=c.result(this,"routes");for(var a,b=c.keys(this.routes);null!=(a=b.pop());)this.route(a,this.routes[a])}},_routeToRegExp:function(a){return a=a.replace(C,"\\$&").replace(z,"(?:$1)?").replace(A,function(a,b){return b?a:"([^/?]+)"}).replace(B,"([^?]*?)"),new RegExp("^"+a+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(a,b){var d=a.exec(b).slice(1);return c.map(d,function(a,b){return b===d.length-1?a||null:a?decodeURIComponent(a):null})}});var D=b.History=function(){this.handlers=[],c.bindAll(this,"checkUrl"),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)},E=/^[#\/]|\s+$/g,F=/^\/+|\/+$/g,G=/msie [\w.]+/,H=/\/$/,I=/#.*$/;D.started=!1,c.extend(D.prototype,h,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root},getHash:function(a){var b=(a||this).location.href.match(/#(.*)$/);return b?b[1]:""},getFragment:function(a,b){if(null==a)if(this._hasPushState||!this._wantsHashChange||b){a=decodeURI(this.location.pathname+this.location.search);var c=this.root.replace(H,"");a.indexOf(c)||(a=a.slice(c.length))}else a=this.getHash();return a.replace(E,"")},start:function(a){if(D.started)throw new Error("Backbone.history has already been started");D.started=!0,this.options=c.extend({root:"/"},this.options,a),this.root=this.options.root,this._wantsHashChange=this.options.hashChange!==!1,this._wantsPushState=!!this.options.pushState,this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var d=this.getFragment(),e=document.documentMode,f=G.exec(navigator.userAgent.toLowerCase())&&(!e||7>=e);if(this.root=("/"+this.root+"/").replace(F,"/"),f&&this._wantsHashChange){var g=b.$('\n'},this.JST}),c("views/behaviorform",["jquery","underscore","backbone","templates"],function(a,b,c,d){"use strict";var e=c.View.extend({template:d["app/scripts/templates/behaviorform.ejs"],tagName:"div",id:"featuredimage-preview",initialize:function(){this.render(),a("#fieldset-featured-image").append(this.el),this.$iframe=this.$("iframe"),this.$quote=a("#form-widgets-IFeaturedImage-featuredimage_quote"),this.$author=a("#form-widgets-IFeaturedImage-featuredimage_author"),this.$iframe.on("load",this.iframeready(this)),this.$quote.on("input",this.updateFeaturedImage(this)),this.$author.on("input",this.updateFeaturedImage(this))},render:function(){var b=void 0;b={source:"featuredimage.html"},"9000"!==location.port&&(location.href.indexOf("++add++")>0?b.source=portal_url+"/@@featuredimage":b.source=a("head base").attr("href")+"/@@featuredimage"),b.source=b.source.replace(/\/\//g,"/"),b.source=b.source.replace(/http\:\//g,"http://"),b.source=b.source.replace(/https\:\//g,"https://"),this.$el.html(this.template(b))},iframeready:function(b){return function(){var c=void 0,d=void 0;b.$featuredimage=a("#featuredimage",b.$iframe[0].contentWindow.document.body),c=a("img",b.$featuredimage),d=new Image,d.src=c.attr("src"),d.onload=function(){b.$el.width(this.width/2+10),b.$el.height(this.height/2+10),b.$iframe.width(this.width+10),b.$iframe.height(this.height+10),b.updateFeaturedImage(b)()}}},updateFeaturedImage:function(b){return function(){var c=void 0,d=void 0;d=a(".quote .text",b.$featuredimage),c=a(".quote .author",b.$featuredimage),d.html(b.$quote.val()),c.html(b.$author.val())}}});return e}),c("jquery",[],function(){return jQuery}),b.config({paths:{backbone:"../bower_components/backbone/backbone",underscore:"../bower_components/lodash/dist/lodash"}}),b(["backbone","views/behaviorform"],function(a,b){return a.history.start(),$("#fieldset-featured-image").length>0?new b:void 0}),c("main",function(){})}(); diff --git a/yeoman/app/scripts/views/behaviorform.js b/yeoman/app/scripts/views/behaviorform.js index 0a24071..cc57e0a 100644 --- a/yeoman/app/scripts/views/behaviorform.js +++ b/yeoman/app/scripts/views/behaviorform.js @@ -39,6 +39,7 @@ define([ } data.source = data.source.replace(/\/\//g, '/'); data.source = data.source.replace(/http\:\//g, 'http://'); + data.source = data.source.replace(/https\:\//g, 'https://'); this.$el.html(this.template(data)); },