1/* FILE: /home/strato/http/power/rid/48/01/51344801/htdocs/joomla_02//plugins/system/easyslider/assets/lib/backbone/backbone.js */ 2// Backbone.js 1.1.2 3(function(root, factory) { 4if (typeof define === 'function' && define.amd) { 5define(['underscore', 'jquery', 'exports'], function(_, $, exports) { 6root.Backbone = factory(root, exports, _, $); 7}); 8} else if (typeof exports !== 'undefined') { 9var _ = require('underscore'); 10factory(root, exports, _); 11} else { 12root.Backbone = factory(root, {}, root._, (root.jQuery || root.Zepto || root.ender || root.$)); 13} 14}(this, function(root, Backbone, _, $) { 15var previousBackbone = root.Backbone; 16var array = []; 17var push = array.push; 18var slice = array.slice; 19var splice = array.splice; 20Backbone.VERSION = '1.1.2'; 21Backbone.$ = $; 22Backbone.noConflict = function() { 23root.Backbone = previousBackbone; 24return this; 25}; 26Backbone.emulateHTTP = false; 27Backbone.emulateJSON = false; 28// 29// 30var Events = Backbone.Events = { 31on: function(name, callback, context) { 32if (!eventsApi(this, 'on', name, [callback, context]) || !callback) return this; 33this._events || (this._events = {}); 34var events = this._events[name] || (this._events[name] = []); 35events.push({callback: callback, context: context, ctx: context || this}); 36return this; 37}, 38once: function(name, callback, context) { 39if (!eventsApi(this, 'once', name, [callback, context]) || !callback) return this; 40var self = this; 41var once = _.once(function() { 42self.off(name, once); 43callback.apply(this, arguments); 44}); 45once._callback = callback; 46return this.on(name, once, context); 47}, 48off: function(name, callback, context) { 49var retain, ev, events, names, i, l, j, k; 50if (!this._events || !eventsApi(this, 'off', name, [callback, context])) return this; 51if (!name && !callback && !context) { 52this._events = void 0; 53return this; 54} 55names = name ? [name] : _.keys(this._events); 56for (i = 0, l = names.length; i < l; i++) { 57name = names[i]; 58if (events = this._events[name]) { 59this._events[name] = retain = []; 60if (callback || context) { 61for (j = 0, k = events.length; j < k; j++) { 62ev = events[j]; 63if ((callback && callback !== ev.callback && callback !== ev.callback._callback) || 64(context && context !== ev.context)) { 65retain.push(ev); 66} 67} 68} 69if (!retain.length) delete this._events[name]; 70} 71} 72return this; 73}, 74trigger: function(name) { 75if (!this._events) return this; 76var args = slice.call(arguments, 1); 77if (!eventsApi(this, 'trigger', name, args)) return this; 78var events = this._events[name]; 79var allEvents = this._events.all; 80if (events) triggerEvents(events, args); 81if (allEvents) triggerEvents(allEvents, arguments); 82return this; 83}, 84stopListening: function(obj, name, callback) { 85var listeningTo = this._listeningTo; 86if (!listeningTo) return this; 87var remove = !name && !callback; 88if (!callback && typeof name === 'object') callback = this; 89if (obj) (listeningTo = {})[obj._listenId] = obj; 90for (var id in listeningTo) { 91obj = listeningTo[id]; 92obj.off(name, callback, this); 93if (remove || _.isEmpty(obj._events)) delete this._listeningTo[id]; 94} 95return this; 96} 97}; 98var eventSplitter = /\s+/; 99var eventsApi = function(obj, action, name, rest) { 100if (!name) return true; 101if (typeof name === 'object') { 102for (var key in name) { 103obj[action].apply(obj, [key, name[key]].concat(rest)); 104} 105return false; 106} 107if (eventSplitter.test(name)) { 108var names = name.split(eventSplitter); 109for (var i = 0, l = names.length; i < l; i++) { 110obj[action].apply(obj, [names[i]].concat(rest)); 111} 112return false; 113} 114return true; 115}; 116var triggerEvents = function(events, args) { 117var ev, i = -1, l = events.length, a1 = args[0], a2 = args[1], a3 = args[2]; 118switch (args.length) { 119case 0: while (++i < l) (ev = events[i]).callback.call(ev.ctx); return; 120case 1: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1); return; 121case 2: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2); return; 122case 3: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2, a3); return; 123default: while (++i < l) (ev = events[i]).callback.apply(ev.ctx, args); return; 124} 125}; 126var listenMethods = {listenTo: 'on', listenToOnce: 'once'}; 127_.each(listenMethods, function(implementation, method) { 128Events[method] = function(obj, name, callback) { 129var listeningTo = this._listeningTo || (this._listeningTo = {}); 130var id = obj._listenId || (obj._listenId = _.uniqueId('l')); 131listeningTo[id] = obj; 132if (!callback && typeof name === 'object') callback = this; 133obj[implementation](name, callback, this); 134return this; 135}; 136}); 137Events.bind = Events.on; 138Events.unbind = Events.off; 139_.extend(Backbone, Events); 140var Model = Backbone.Model = function(attributes, options) { 141var attrs = attributes || {};
142options || (options = {}); 143this.cid = _.uniqueId('c'); 144this.attributes = {}; 145if (options.collection) this.collection = options.collection; 146if (options.parse) attrs = this.parse(attrs, options) || {}; 147attrs = _.defaults({}, attrs, _.result(this, 'defaults')); 148this.set(attrs, options); 149this.changed = {}; 150this.initialize.apply(this, arguments); 151}; 152_.extend(Model.prototype, Events, { 153changed: null, 154validationError: null, 155idAttribute: 'id', 156initialize: function(){}, 157toJSON: function(options) { 158return _.clone(this.attributes); 159}, 160sync: function() { 161return Backbone.sync.apply(this, arguments); 162}, 163get: function(attr) { 164return this.attributes[attr]; 165}, 166escape: function(attr) { 167return _.escape(this.get(attr)); 168}, 169has: function(attr) { 170return this.get(attr) != null; 171}, 172set: function(key, val, options) { 173var attr, attrs, unset, changes, silent, changing, prev, current; 174if (key == null) return this; 175if (typeof key === 'object') { 176attrs = key; 177options = val; 178} else { 179(attrs = {})[key] = val; 180} 181options || (options = {}); 182if (!this._validate(attrs, options)) return false; 183unset = options.unset; 184silent = options.silent; 185changes = []; 186changing = this._changing; 187this._changing = true; 188if (!changing) { 189this._previousAttributes = _.clone(this.attributes); 190this.changed = {}; 191} 192current = this.attributes, prev = this._previousAttributes; 193if (this.idAttribute in attrs) this.id = attrs[this.idAttribute]; 194for (attr in attrs) { 195val = attrs[attr]; 196if (!_.isEqual(current[attr], val)) changes.push(attr); 197if (!_.isEqual(prev[attr], val)) { 198this.changed[attr] = val; 199} else { 200delete this.changed[attr]; 201} 202unset ? delete current[attr] : current[attr] = val; 203} 204if (!silent) { 205if (changes.length) this._pending = options; 206for (var i = 0, l = changes.length; i < l; i++) { 207this.trigger('change:' + changes[i], this, current[changes[i]], options); 208} 209} 210if (changing) return this; 211if (!silent) { 212while (this._pending) { 213options = this._pending; 214this._pending = false; 215this.trigger('change', this, options); 216} 217} 218this._pending = false; 219this._changing = false; 220return this; 221}, 222unset: function(attr, options) { 223return this.set(attr, void 0, _.extend({}, options, {unset: true})); 224}, 225clear: function(options) { 226var attrs = {}; 227for (var key in this.attributes) attrs[key] = void 0; 228return this.set(attrs, _.extend({}, options, {unset: true})); 229}, 230hasChanged: function(attr) { 231if (attr == null) return !_.isEmpty(this.changed); 232return _.has(this.changed, attr); 233}, 234changedAttributes: function(diff) { 235if (!diff) return this.hasChanged() ? _.clone(this.changed) : false; 236var val, changed = false; 237var old = this._changing ? this._previousAttributes : this.attributes; 238for (var attr in diff) { 239if (_.isEqual(old[attr], (val = diff[attr]))) continue; 240(changed || (changed = {}))[attr] = val; 241} 242return changed; 243}, 244previous: function(attr) { 245if (attr == null || !this._previousAttributes) return null; 246return this._previousAttributes[attr]; 247}, 248previousAttributes: function() { 249return _.clone(this._previousAttributes); 250}, 251fetch: function(options) { 252options = options ? _.clone(options) : {}; 253if (options.parse === void 0) options.parse = true; 254var model = this; 255var success = options.success; 256options.success = function(resp) { 257if (!model.set(model.parse(resp, options), options)) return false; 258if (success) success(model, resp, options); 259model.trigger('sync', model, resp, options); 260}; 261wrapError(this, options); 262return this.sync('read', this, options); 263}, 264save: function(key, val, options) { 265var attrs, method, xhr, attributes = this.attributes; 266if (key == null || typeof key === 'object') { 267attrs = key; 268options = val; 269} else { 270(attrs = {})[key] = val; 271} 272options = _.extend({validate: true}, options); 273if (attrs && !options.wait) { 274if (!this.set(attrs, options)) return false; 275} else { 276if (!this._validate(attrs, options)) return false; 277} 278if (attrs && options.wait) { 279this.attributes = _.extend({}, attributes, attrs); 280} 281if (options.parse === void 0) options.parse = true; 282var model = this; 283var success = options.success; 284options.success = function(resp) { 285model.attributes = attributes; 286var serverAttrs = model.parse(resp, options); 287if (options.wait) serverAttrs = _.extend(attrs || {}, serverAttrs); 288if (_.isObject(serverAttrs) && !model.set(serverAttrs, options)) { 289return false;
290} 291if (success) success(model, resp, options); 292model.trigger('sync', model, resp, options); 293}; 294wrapError(this, options); 295method = this.isNew() ? 'create' : (options.patch ? 'patch' : 'update'); 296if (method === 'patch') options.attrs = attrs; 297xhr = this.sync(method, this, options); 298if (attrs && options.wait) this.attributes = attributes; 299return xhr; 300}, 301destroy: function(options) { 302options = options ? _.clone(options) : {}; 303var model = this; 304var success = options.success; 305var destroy = function() { 306model.trigger('destroy', model, model.collection, options); 307}; 308options.success = function(resp) { 309if (options.wait || model.isNew()) destroy(); 310if (success) success(model, resp, options); 311if (!model.isNew()) model.trigger('sync', model, resp, options); 312}; 313if (this.isNew()) { 314options.success(); 315return false; 316} 317wrapError(this, options); 318var xhr = this.sync('delete', this, options); 319if (!options.wait) destroy(); 320return xhr; 321}, 322url: function() { 323var base = 324_.result(this, 'urlRoot') || 325_.result(this.collection, 'url') || 326urlError(); 327if (this.isNew()) return base; 328return base.replace(/([^\/])$/, '$1/') + encodeURIComponent(this.id); 329}, 330parse: function(resp, options) { 331return resp; 332}, 333clone: function() { 334return new this.constructor(this.attributes); 335}, 336isNew: function() { 337return !this.has(this.idAttribute); 338}, 339isValid: function(options) { 340return this._validate({}, _.extend(options || {}, { validate: true })); 341}, 342_validate: function(attrs, options) { 343if (!options.validate || !this.validate) return true; 344attrs = _.extend({}, this.attributes, attrs); 345var error = this.validationError = this.validate(attrs, options) || null; 346if (!error) return true; 347this.trigger('invalid', this, error, _.extend(options, {validationError: error})); 348return false; 349} 350}); 351var modelMethods = ['keys', 'values', 'pairs', 'invert', 'pick', 'omit']; 352_.each(modelMethods, function(method) { 353Model.prototype[method] = function() { 354var args = slice.call(arguments); 355args.unshift(this.attributes); 356return _[method].apply(_, args); 357}; 358}); 359var Collection = Backbone.Collection = function(models, options) { 360options || (options = {}); 361if (options.model) this.model = options.model; 362if (options.comparator !== void 0) this.comparator = options.comparator; 363this._reset(); 364this.initialize.apply(this, arguments); 365if (models) this.reset(models, _.extend({silent: true}, options)); 366}; 367var setOptions = {add: true, remove: true, merge: true}; 368var addOptions = {add: true, remove: false}; 369_.extend(Collection.prototype, Events, { 370model: Model, 371initialize: function(){}, 372toJSON: function(options) { 373return this.map(function(model){ return model.toJSON(options); }); 374}, 375sync: function() { 376return Backbone.sync.apply(this, arguments); 377}, 378add: function(models, options) { 379return this.set(models, _.extend({merge: false}, options, addOptions)); 380}, 381remove: function(models, options) { 382var singular = !_.isArray(models); 383models = singular ? [models] : _.clone(models); 384options || (options = {}); 385var i, l, index, model; 386for (i = 0, l = models.length; i < l; i++) { 387model = models[i] = this.get(models[i]); 388if (!model) continue; 389delete this._byId[model.id]; 390delete this._byId[model.cid]; 391index = this.indexOf(model); 392this.models.splice(index, 1); 393this.length--; 394if (!options.silent) { 395options.index = index; 396model.trigger('remove', model, this, options); 397} 398this._removeReference(model, options); 399} 400return singular ? models[0] : models; 401}, 402set: function(models, options) { 403options = _.defaults({}, options, setOptions); 404if (options.parse) models = this.parse(models, options); 405var singular = !_.isArray(models); 406models = singular ? (models ? [models] : []) : _.clone(models); 407var i, l, id, model, attrs, existing, sort; 408var at = options.at; 409var targetModel = this.model; 410var sortable = this.comparator && (at == null) && options.sort !== false; 411var sortAttr = _.isString(this.comparator) ? this.comparator : null; 412var toAdd = [], toRemove = [], modelMap = {}; 413var add = options.add, merge = options.merge, remove = options.remove; 414var order = !sortable && add && remove ? [] : false; 415for (i = 0, l = models.length; i < l; i++) { 416attrs = models[i] || {}; 417if (attrs instanceof Model) { 418id = model = attrs; 419} else { 420id = attrs[targetModel.prototype.idAttribute || 'id']; 421} 422if (existing = this.get(id)) { 423if (remove) modelMap[existing.cid] = true; 424if (merge) { 425attrs = attrs === model ? model.attributes : attrs; 426if (options.parse) attrs = existing.parse(attrs, options); 427existing.set(attrs, options); 428if (sortable && !sort && existing.hasChanged(sortAttr)) sort = true; 429} 430models[i] = existing; 431} else if (add) { 432model = models[i] = this._prepareModel(attrs, options); 433if (!model) continue; 434toAdd.push(model); 435this._addReference(model, options); 436} 437model = existing || model; 438if (order && (model.isNew() || !modelMap[model.id])) order.push(model); 439modelMap[model.id] = true; 440} 441if (remove) { 442for (i = 0, l = this.length; i < l; ++i) { 443if (!modelMap[(model = this.models[i]).cid]) toRemove.push(model); 444} 445if (toRemove.length) this.remove(toRemove, options); 446} 447if (toAdd.length || (order && order.length)) { 448if (sortable) sort = true; 449this.length += toAdd.length; 450if (at != null) { 451for (i = 0, l = toAdd.length; i < l; i++) { 452this.models.splice(at + i, 0, toAdd[i]); 453} 454} else { 455if (order) this.models.length = 0; 456var orderedModels = order || toAdd; 457for (i = 0, l = orderedModels.length; i < l; i++) { 458this.models.push(orderedModels[i]); 459} 460} 461} 462if (sort) this.sort({silent: true}); 463if (!options.silent) { 464for (i = 0, l = toAdd.length; i < l; i++) { 465(model = toAdd[i]).trigger('add', model, this, options); 466} 467if (sort || (order && order.length)) this.trigger('sort', this, options); 468} 469return singular ? models[0] : models; 470}, 471reset: function(models, options) {
472options || (options = {}); 473for (var i = 0, l = this.models.length; i < l; i++) { 474this._removeReference(this.models[i], options); 475} 476options.previousModels = this.models; 477this._reset(); 478models = this.add(models, _.extend({silent: true}, options)); 479if (!options.silent) this.trigger('reset', this, options); 480return models; 481}, 482push: function(model, options) { 483return this.add(model, _.extend({at: this.length}, options)); 484}, 485pop: function(options) { 486var model = this.at(this.length - 1); 487this.remove(model, options); 488return model; 489}, 490unshift: function(model, options) { 491return this.add(model, _.extend({at: 0}, options)); 492}, 493shift: function(options) { 494var model = this.at(0); 495this.remove(model, options); 496return model; 497}, 498slice: function() { 499return slice.apply(this.models, arguments); 500}, 501get: function(obj) { 502if (obj == null) return void 0; 503return this._byId[obj] || this._byId[obj.id] || this._byId[obj.cid]; 504}, 505at: function(index) { 506return this.models[index]; 507}, 508where: function(attrs, first) { 509if (_.isEmpty(attrs)) return first ? void 0 : []; 510return this[first ? 'find' : 'filter'](function(model) { 511for (var key in attrs) { 512if (attrs[key] !== model.get(key)) return false; 513} 514return true; 515}); 516}, 517findWhere: function(attrs) { 518return this.where(attrs, true); 519}, 520sort: function(options) { 521if (!this.comparator) throw new Error('Cannot sort a set without a comparator'); 522options || (options = {}); 523if (_.isString(this.comparator) || this.comparator.length === 1) { 524this.models = this.sortBy(this.comparator, this); 525} else { 526this.models.sort(_.bind(this.comparator, this)); 527} 528if (!options.silent) this.trigger('sort', this, options); 529return this; 530}, 531pluck: function(attr) { 532return _.invoke(this.models, 'get', attr); 533}, 534fetch: function(options) { 535options = options ? _.clone(options) : {}; 536if (options.parse === void 0) options.parse = true; 537var success = options.success; 538var collection = this; 539options.success = function(resp) { 540var method = options.reset ? 'reset' : 'set'; 541collection[method](resp, options); 542if (success) success(collection, resp, options); 543collection.trigger('sync', collection, resp, options); 544}; 545wrapError(this, options); 546return this.sync('read', this, options); 547}, 548create: function(model, options) { 549options = options ? _.clone(options) : {}; 550if (!(model = this._prepareModel(model, options))) return false; 551if (!options.wait) this.add(model, options); 552var collection = this; 553var success = options.success; 554options.success = function(model, resp) { 555if (options.wait) collection.add(model, options); 556if (success) success(model, resp, options); 557}; 558model.save(null, options); 559return model; 560}, 561parse: function(resp, options) { 562return resp; 563}, 564clone: function() { 565return new this.constructor(this.models); 566}, 567_reset: function() { 568this.length = 0; 569this.models = []; 570this._byId = {}; 571}, 572_prepareModel: function(attrs, options) { 573if (attrs instanceof Model) return attrs; 574options = options ? _.clone(options) : {}; 575options.collection = this; 576var model = new this.model(attrs, options); 577if (!model.validationError) return model; 578this.trigger('invalid', this, model.validationError, options); 579return false; 580}, 581_addReference: function(model, options) { 582this._byId[model.cid] = model; 583if (model.id != null) this._byId[model.id] = model; 584if (!model.collection) model.collection = this; 585model.on('all', this._onModelEvent, this); 586}, 587_removeReference: function(model, options) { 588if (this === model.collection) delete model.collection; 589model.off('all', this._onModelEvent, this); 590}, 591_onModelEvent: function(event, model, collection, options) { 592if ((event === 'add' || event === 'remove') && collection !== this) return; 593if (event === 'destroy') this.remove(model, options); 594if (model && event === 'change:' + model.idAttribute) { 595delete this._byId[model.previous(model.idAttribute)]; 596if (model.id != null) this._byId[model.id] = model; 597} 598this.trigger.apply(this, arguments); 599} 600}); 601var methods = ['forEach', 'each', 'map', 'collect', 'reduce', 'foldl', 602'inject', 'reduceRight', 'foldr', 'find', 'detect', 'filter', 'select', 603'reject', 'every', 'all', 'some', 'any', 'include', 'contains', 'invoke', 604'max', 'min', 'toArray', 'size', 'first', 'head', 'take', 'initial', 'rest', 605'tail', 'drop', 'last', 'without', 'difference', 'indexOf', 'shuffle', 606'lastIndexOf', 'isEmpty', 'chain', 'sample']; 607_.each(methods, function(method) { 608Collection.prototype[method] = function() { 609var args = slice.call(arguments); 610args.unshift(this.models); 611return _[method].apply(_, args); 612}; 613}); 614var attributeMethods = ['groupBy', 'countBy', 'sortBy', 'indexBy']; 615_.each(attributeMethods, function(method) { 616Collection.prototype[method] = function(value, context) { 617var iterator = _.isFunction(value) ? value : function(model) { 618return model.get(value); 619}; 620return _[method](this.models, iterator, context); 621}; 622}); 623var View = Backbone.View = function(options) { 624this.cid = _.uniqueId('view');
625options || (options = {}); 626_.extend(this, _.pick(options, viewOptions)); 627this._ensureElement(); 628this.initialize.apply(this, arguments); 629this.delegateEvents(); 630}; 631var delegateEventSplitter = /^(\S+)\s*(.*)$/; 632var viewOptions = ['model', 'collection', 'el', 'id', 'attributes', 'className', 'tagName', 'events']; 633_.extend(View.prototype, Events, { 634tagName: 'div', 635$: function(selector) { 636return this.$el.find(selector); 637}, 638initialize: function(){}, 639render: function() { 640return this; 641}, 642remove: function() { 643this.$el.remove(); 644this.stopListening(); 645return this; 646}, 647setElement: function(element, delegate) { 648if (this.$el) this.undelegateEvents(); 649this.$el = element instanceof Backbone.$ ? element : Backbone.$(element); 650this.el = this.$el[0]; 651if (delegate !== false) this.delegateEvents(); 652return this; 653}, 654// 655// 656// 657delegateEvents: function(events) { 658if (!(events || (events = _.result(this, 'events')))) return this; 659this.undelegateEvents(); 660for (var key in events) { 661var method = events[key]; 662if (!_.isFunction(method)) method = this[events[key]]; 663if (!method) continue; 664var match = key.match(delegateEventSplitter); 665var eventName = match[1], selector = match[2]; 666method = _.bind(method, this); 667eventName += '.delegateEvents' + this.cid; 668if (selector === '') { 669this.$el.on(eventName, method); 670} else { 671this.$el.on(eventName, selector, method); 672} 673} 674return this; 675}, 676undelegateEvents: function() { 677this.$el.off('.delegateEvents' + this.cid); 678return this; 679}, 680_ensureElement: function() { 681if (!this.el) { 682var attrs = _.extend({}, _.result(this, 'attributes'));
683if (this.id) attrs.id = _.result(this, 'id'); 684if (this.className) attrs['class'] = _.result(this, 'className'); 685var $el = Backbone.$('<' + _.result(this, 'tagName') + '>').attr(attrs); 686this.setElement($el, false); 687} else { 688this.setElement(_.result(this, 'el'), false); 689} 690} 691}); 692// 693// 694Backbone.sync = function(method, model, options) { 695var type = methodMap[method]; 696_.defaults(options || (options = {}), { 697emulateHTTP: Backbone.emulateHTTP, 698emulateJSON: Backbone.emulateJSON 699}); 700var params = {type: type, dataType: 'json'}; 701if (!options.url) { 702params.url = _.result(model, 'url') || urlError(); 703} 704if (options.data == null && model && (method === 'create' || method === 'update' || method === 'patch')) { 705params.contentType = 'application/json'; 706params.data = JSON.stringify(options.attrs || model.toJSON(options)); 707} 708if (options.emulateJSON) { 709params.contentType = 'application/x-www-form-urlencoded'; 710params.data = params.data ? {model: params.data} : {}; 711} 712if (options.emulateHTTP && (type === 'PUT' || type === 'DELETE' || type === 'PATCH')) { 713params.type = 'POST'; 714if (options.emulateJSON) params.data._method = type; 715var beforeSend = options.beforeSend; 716options.beforeSend = function(xhr) { 717xhr.setRequestHeader('X-HTTP-Method-Override', type); 718if (beforeSend) return beforeSend.apply(this, arguments); 719}; 720} 721if (params.type !== 'GET' && !options.emulateJSON) { 722params.processData = false; 723} 724if (params.type === 'PATCH' && noXhrPatch) { 725params.xhr = function() { 726return new ActiveXObject("Microsoft.XMLHTTP"); 727}; 728} 729var xhr = options.xhr = Backbone.ajax(_.extend(params, options)); 730model.trigger('request', model, xhr, options); 731return xhr; 732}; 733var noXhrPatch = 734typeof window !== 'undefined' && !!window.ActiveXObject && 735!(window.XMLHttpRequest && (new XMLHttpRequest).dispatchEvent); 736var methodMap = { 737'create': 'POST', 738'update': 'PUT', 739'patch': 'PATCH', 740'delete': 'DELETE', 741'read': 'GET' 742}; 743Backbone.ajax = function() { 744return Backbone.$.ajax.apply(Backbone.$, arguments); 745}; 746var Router = Backbone.Router = function(options) { 747options || (options = {}); 748if (options.routes) this.routes = options.routes; 749this._bindRoutes(); 750this.initialize.apply(this, arguments); 751}; 752var optionalParam = /\((.*?)\)/g; 753var namedParam = /(\(\?)?:\w+/g; 754var splatParam = /\*\w+/g; 755var escapeRegExp = /[\-{}\[\]+?.,\\\^$|#\s]/g; 756_.extend(Router.prototype, Events, { 757initialize: function(){}, 758// 759// 760route: function(route, name, callback) { 761if (!_.isRegExp(route)) route = this._routeToRegExp(route); 762if (_.isFunction(name)) { 763callback = name; 764name = ''; 765} 766if (!callback) callback = this[name]; 767var router = this; 768Backbone.history.route(route, function(fragment) { 769var args = router._extractParameters(route, fragment); 770router.execute(callback, args); 771router.trigger.apply(router, ['route:' + name].concat(args)); 772router.trigger('route', name, args); 773Backbone.history.trigger('route', router, name, args); 774}); 775return this; 776}, 777execute: function(callback, args) { 778if (callback) callback.apply(this, args); 779}, 780navigate: function(fragment, options) { 781Backbone.history.navigate(fragment, options); 782return this; 783}, 784_bindRoutes: function() { 785if (!this.routes) return; 786this.routes = _.result(this, 'routes'); 787var route, routes = _.keys(this.routes); 788while ((route = routes.pop()) != null) { 789this.route(route, this.routes[route]); 790} 791}, 792_routeToRegExp: function(route) { 793route = route.replace(escapeRegExp, '\\$&') 794.replace(optionalParam, '(?:$1)?') 795.replace(namedParam, function(match, optional) { 796return optional ? match : '([^/?]+)'; 797}) 798.replace(splatParam, '([^?]*?)'); 799return new RegExp('^' + route + '(?:\\?([\\s\\S]*))?$'); 800}, 801_extractParameters: function(route, fragment) { 802var params = route.exec(fragment).slice(1); 803return _.map(params, function(param, i) { 804if (i === params.length - 1) return param || null; 805return param ? decodeURIComponent(param) : null; 806}); 807} 808}); 809var History = Backbone.History = function() { 810this.handlers = []; 811_.bindAll(this, 'checkUrl'); 812if (typeof window !== 'undefined') { 813this.location = window.location; 814this.history = window.history; 815} 816}; 817var routeStripper = /^[#\/]|\s+$/g; 818var rootStripper = /^\/+|\/+$/g; 819var isExplorer = /msie [\w.]+/; 820var trailingSlash = /\/$/; 821var pathStripper = /#.*$/; 822History.started = false;
823_.extend(History.prototype, Events, { 824interval: 50, 825atRoot: function() { 826return this.location.pathname.replace(/[^\/]$/, '$&/') === this.root; 827}, 828getHash: function(window) { 829var match = (window || this).location.href.match(/#(.*)$/); 830return match ? match[1] : ''; 831}, 832getFragment: function(fragment, forcePushState) { 833if (fragment == null) { 834if (this._hasPushState || !this._wantsHashChange || forcePushState) { 835fragment = decodeURI(this.location.pathname + this.location.search); 836var root = this.root.replace(trailingSlash, ''); 837if (!fragment.indexOf(root)) fragment = fragment.slice(root.length); 838} else { 839fragment = this.getHash(); 840} 841} 842return fragment.replace(routeStripper, ''); 843}, 844start: function(options) { 845if (History.started) throw new Error("Backbone.history has already been started"); 846History.started = true; 847this.options = _.extend({root: '/'}, this.options, options); 848this.root = this.options.root; 849this._wantsHashChange = this.options.hashChange !== false; 850this._wantsPushState = !!this.options.pushState; 851this._hasPushState = !!(this.options.pushState && this.history && this.history.pushState); 852var fragment = this.getFragment(); 853var docMode = document.documentMode; 854var oldIE = (isExplorer.exec(navigator.userAgent.toLowerCase()) && (!docMode || docMode <= 7)); 855this.root = ('/' + this.root + '/').replace(rootStripper, '/'); 856if (oldIE && this._wantsHashChange) { 857var frame = Backbone.$('<iframe src="javascript:0" tabindex="-1">'); 858this.iframe = frame.hide().appendTo('body')[0].contentWindow; 859this.navigate(fragment); 860} 861if (this._hasPushState) { 862Backbone.$(window).on('popstate', this.checkUrl); 863} else if (this._wantsHashChange && ('onhashchange' in window) && !oldIE) { 864Backbone.$(window).on('hashchange', this.checkUrl); 865} else if (this._wantsHashChange) { 866this._checkUrlInterval = setInterval(this.checkUrl, this.interval); 867} 868this.fragment = fragment; 869var loc = this.location; 870if (this._wantsHashChange && this._wantsPushState) { 871if (!this._hasPushState && !this.atRoot()) { 872this.fragment = this.getFragment(null, true); 873this.location.replace(this.root + '#' + this.fragment); 874return true; 875} else if (this._hasPushState && this.atRoot() && loc.hash) { 876this.fragment = this.getHash().replace(routeStripper, ''); 877this.history.replaceState({}, document.title, this.root + this.fragment); 878} 879} 880if (!this.options.silent) return this.loadUrl(); 881}, 882stop: function() { 883Backbone.$(window).off('popstate', this.checkUrl).off('hashchange', this.checkUrl); 884if (this._checkUrlInterval) clearInterval(this._checkUrlInterval); 885History.started = false; 886}, 887route: function(route, callback) { 888this.handlers.unshift({route: route, callback: callback}); 889}, 890checkUrl: function(e) { 891var current = this.getFragment(); 892if (current === this.fragment && this.iframe) { 893current = this.getFragment(this.getHash(this.iframe)); 894} 895if (current === this.fragment) return false; 896if (this.iframe) this.navigate(current); 897this.loadUrl(); 898}, 899loadUrl: function(fragment) { 900fragment = this.fragment = this.getFragment(fragment); 901return _.any(this.handlers, function(handler) { 902if (handler.route.test(fragment)) { 903handler.callback(fragment); 904return true; 905} 906}); 907}, 908// 909navigate: function(fragment, options) { 910if (!History.started) return false; 911if (!options || options === true) options = {trigger: !!options}; 912var url = this.root + (fragment = this.getFragment(fragment || '')); 913fragment = fragment.replace(pathStripper, ''); 914if (this.fragment === fragment) return; 915this.fragment = fragment; 916if (fragment === '' && url !== '/') url = url.slice(0, -1); 917if (this._hasPushState) { 918this.history[options.replace ? 'replaceState' : 'pushState']({}, document.title, url); 919} else if (this._wantsHashChange) { 920this._updateHash(this.location, fragment, options.replace); 921if (this.iframe && (fragment !== this.getFragment(this.getHash(this.iframe)))) { 922if(!options.replace) this.iframe.document.open().close(); 923this._updateHash(this.iframe.location, fragment, options.replace); 924} 925} else { 926return this.location.assign(url); 927} 928if (options.trigger) return this.loadUrl(fragment); 929}, 930_updateHash: function(location, fragment, replace) { 931if (replace) { 932var href = location.href.replace(/(javascript:|#).*$/, ''); 933location.replace(href + '#' + fragment); 934} else { 935location.hash = '#' + fragment; 936} 937} 938}); 939Backbone.history = new History; 940var extend = function(protoProps, staticProps) { 941var parent = this; 942var child; 943if (protoProps && _.has(protoProps, 'constructor')) { 944child = protoProps.constructor; 945} else { 946child = function(){ return parent.apply(this, arguments); }; 947} 948_.extend(child, parent, staticProps); 949var Surrogate = function(){ this.constructor = child; }; 950Surrogate.prototype = parent.prototype; 951child.prototype = new Surrogate; 952if (protoProps) _.extend(child.prototype, protoProps); 953child.__super__ = parent.prototype; 954return child; 955}; 956Model.extend = Collection.extend = Router.extend = View.extend = History.extend = extend; 957var urlError = function() { 958throw new Error('A "url" property or function must be specified'); 959}; 960var wrapError = function(model, options) { 961var error = options.error; 962options.error = function(resp) { 963if (error) error(model, resp, options); 964model.trigger('error', model, resp, options); 965}; 966}; 967return Backbone; 968}));; 969 970/* FILE: /home/strato/http/power/rid/48/01/51344801/htdocs/joomla_02//plugins/system/easyslider/assets/js/lib/utils.js */ 971void function( exports, $, _, Backbone ) { 972exports.log = _.noop; 973_.mixin( { 974prefixCSSRules: function( css, prefix ) { 975css = css.replace(/\n|\r|\t/g, ''); 976css = css.replace(/\/\*[^*]+\*\//g, ''); 977return _( css.match(/[^{]+{[^}]+}/g) || [] ).map(function ( rule ) { 978var split = rule.match(/^(.*)({.*})/) 979return _.map(split[1].split(','), function(name) { 980return prefix + ' ' + name.trim(); 981}, this).join(",\n") + split[2]; 982}, this).join("\n"); 983}, 984loadImage: function( src, callback, context ) { 985var img = new Image; 986img.onerror = function ( e ) { 987console.warn('Could not load image from source: ' + src) 988} 989img.onload = function() { 990_.isFunction(callback) && callback.call(context||this, this) 991} 992img.src = src; 993}, 994isPrototypeOf: function( child, parent ) { 995if ( !child || !parent ) 996return false;
997var result = false; 998var proto = child.prototype; 999while ( proto ) { 1000if ( proto == parent.prototype ) { 1001result = true; 1002break; 1003} 1004proto = proto.__proto__; 1005} 1006return result; 1007}, 1008setPrototypeOf: function( child, prototype ) { 1009if (_.isFunction(Object.setPrototypeOf)) 1010Object.setPrototypeOf(child.prototype || child, prototype); 1011else 1012(child.prototype || child).__proto__ = prototype; 1013return child 1014}, 1015extendPrototype: function( child, prototype ) { 1016_.extend(child.prototype, prototype) 1017return child 1018}, 1019joinPath: function() { 1020return _( arguments ).join( '/' ).replace(/([^:])\/+/g,'$1\/'); 1021}, 1022deepExtend: function deepExtend( obj ) { 1023return $.extend.apply( $, _( arguments ).splice( 0, 0, true ) ); 1024}, 1025parseNumberUnit: function( str ) { 1026str += ''; 1027var match = str.replace( /\s+/, ' ' ).match( /([-0-9.]+)\s?([^\s]*)?/ ); 1028return { 1029value: match && parseFloat( match[ 1 ] ) || 0, 1030unit: match && match[ 2 ] || '' 1031} 1032}, 1033stripTags: function( str ) { 1034return str 1035.replace( /</g, '<' ) 1036.replace( />/g, '>' ); 1037}, 1038encodeHtmlEntities: function( str ) { 1039return String( str ) 1040.replace( /&/g, '&' ) 1041.replace( /</g, '<' ) 1042.replace( />/g, '>' ) 1043.replace( /"/g, '"' ); 1044}, 1045decodeHtmlEntities: function( str ) { 1046return String( str ) 1047.replace( /&/g, '&' ) 1048.replace( /</g, '<' ) 1049.replace( />/g, '>' ) 1050.replace( /"/g, '"' ); 1051}, 1052parseBackgroundPos: function(str, container) { 1053str = (str == 'cover' || str == 'contain') ? '100%' : str; 1054str = str.replace(/center/g, '50%'); 1055var list = str.split(' '); 1056var newValue = []; 1057_.each(list, function( val, i ) { 1058if ( val.indexOf('%') >= 0 ){ 1059newValue.push(parseInt(val.replace(/%/, ''))); 1060/*val = parseFloat(val.replace(/%/g, '')); 1061if ( i == 0 ) { 1062newValue.push( val * container.width() / 100); 1063} 1064else if ( i == 1 ) { 1065newValue.push( val * container.height() / 100); 1066}*/ 1067} 1068else if ( val.indexOf('px') >= 0 ){ 1069val = parseInt(val.replace(/px/g, '')); 1070if ( i == 0 ) { 1071newValue.push( parseInt(val / container.width() * 100) ); 1072} 1073else if ( i == 1 ) { 1074newValue.push( parseInt(val / container.height() * 100) ); 1075} 1076} 1077}) 1078return newValue; 1079} 1080} ); 1081function deepExtend(obj) { 1082_(arguments).chain().slice(1).each(function(props) { 1083_(props).each(function( value, key ) { 1084if (_.isObject(value)) { 1085if (!_.isObject(obj[key])) 1086obj[key] = {}; 1087return deepExtend(obj[key], value) 1088} 1089obj[key] = value; 1090}) 1091}) 1092return obj; 1093} 1094}( this, jQuery, _, Backbone );; 1095 1096/* FILE: /home/strato/http/power/rid/48/01/51344801/htdocs/joomla_02//plugins/system/easyslider/assets/js/lib/jquery.js */ 1097void function ( exports, $, _, Backbone ) { 1098$("body").on("click", "[type=toggle]", function ( e ) { 1099e.preventDefault(); 1100$(this).attr('data-on', $(this).attr('data-on') == "true" ? false : true).trigger('change'); 1101}); 1102$.fn.getBoundingBox = function () { 1103var top = 0, left = 0, right = 0, bottom = 0, width = 0, height = 0; 1104var rects = this.map(function () { 1105return this.getBoundingClientRect() 1106}).toArray(); 1107if (rects.length) { 1108top = Math.min.apply(null, _.pluck(rects, 'top')); 1109left = Math.min.apply(null, _.pluck(rects, 'left')); 1110right = Math.max.apply(null, _.pluck(rects, 'right')); 1111bottom = Math.max.apply(null, _.pluck(rects, 'bottom')); 1112height = bottom - top; 1113width = right - left; 1114} 1115return { 1116top: top, 1117left: left, 1118width: width, 1119height: height 1120}; 1121}; 1122$.getImageThumb = function( src, width, height, callback ) { 1123if (!src) 1124return; 1125var canvas = document.createElement('canvas'); 1126canvas.width = width; 1127canvas.height = height || width; 1128var context = ccc=canvas.getContext('2d'); 1129var imageObj = new Image(); 1130imageObj.onload = function() { 1131var sourceWidth = this.width; 1132var sourceHeight = this.height; 1133var destWidth = canvas.width; 1134var destHeight = canvas.height; 1135var destX = 0.5; 1136var destY = 0.5; 1137var sourceRatio = sourceWidth / sourceHeight; 1138var destRatio = destWidth / destHeight; 1139if (sourceRatio > destRatio) { 1140destWidth *= destRatio; 1141} 1142else { 1143destHeight *= destRatio; 1144} 1145destX = canvas.width/2 - destWidth/2 + 0.5; 1146destY = canvas.height/2 - destHeight/2 + 0.5; 1147context.drawImage(imageObj, 0, 0, sourceWidth, sourceHeight, destX, destY, destWidth, destHeight); 1148callback && callback(canvas.toDataURL()); 1149}; 1150imageObj.onerror = function() { 1151} 1152imageObj.crossOrigin = 'anonymous'; 1153imageObj.src = src; 1154} 1155$.fn.clickOutside = function ( callback, context ) { 1156return typeof callback != 'function' ? this : this.each(function ( index, element ) { 1157$(window).on('mousedown', function clickHandler ( e ) { 1158if ( !$(element).is(e.target) && !$(e.target).parents('.' + $(element).attr('class').replace(/\s+/g, '.')).length ) 1159$(window).off('mousedown', clickHandler), 1160callback.call(context, e); 1161}); 1162}); 1163} 1164$.fn.selectText = function () { 1165var range, selection; 1166return this.each(function () { 1167if ( document.body.createTextRange ) { 1168range = document.body.createTextRange(); 1169range.moveToElementText(this); 1170range.select(); 1171} else if ( window.getSelection ) { 1172selection = window.getSelection(); 1173range = document.createRange(); 1174range.selectNodeContents(this); 1175selection.removeAllRanges(); 1176selection.addRange(range); 1177} 1178}
1178); 1179}; 1180$.fn.deselectText = function () { 1181var selection; 1182return this.each(function () { 1183if ( window.getSelection ) { 1184if ( window.getSelection().empty ) { // Chrome 1185window.getSelection().empty(); 1186} else if ( window.getSelection().removeAllRanges ) { // Firefox 1187window.getSelection().removeAllRanges(); 1188} 1189} else if ( document.selection ) { // IE? 1190document.selection.empty(); 1191} 1192}); 1193}; 1194$.fn.setCaretPosition = function ( pos ) { 1195var range; 1196return this.each(function () { 1197var elem = this; 1198if ( elem.createTextRange ) { 1199range = elem.createTextRange(); 1200range.move('character', pos); 1201range.select(); 1202} else { 1203elem.focus(); 1204if ( typeof elem.selectionStart !== 'undefined' ) { 1205elem.setSelectionRange(pos, pos); 1206} 1207} 1208}); 1209} 1210$.fn.getCaretPosition = function () { 1211if ( !this.length ) 1212return null; 1213var input = this.get(0); 1214if ( !input ) return; // No (input) element found 1215if ( document.selection ) { 1216input.focus(); 1217} 1218return 'selectionStart' in input ? input.selectionStart : '' || Math.abs(document.selection.createRange().moveStart('character', -input.value.length)); 1219} 1220$.fn.ES_WrapLetters = function( before, after ) { 1221return this.each( function() { 1222$( this ).html( $( this ).text().replace( /(<[^>]*>)?([^<]*)(<[^>]*>)?/g, function( string, x, text, y ) { 1223return _(!text.trim() ? '' : (x || '') + text.trim().split( '' )).map( function( letter ) { 1224return before + letter + after; 1225} ).join( '' ) + (y || ''); 1226} ) ); 1227} ); 1228}; 1229$.fn.ES_WrapWords = function( before, after ) { 1230return this.each( function() { 1231$( this ).html( $( this ).text().replace( /(<[^>]*>)?([^<]*)(<[^>]*>)?/g, function( string, x, text, y ) { 1232return _(!text.trim() ? '' : (x || '') + text.trim().split( /\s+/ )).map( function( word ) { 1233return before + word + after; 1234} ).join( ' ' ) + (y || ''); 1235} ) ); 1236} ); 1237}; 1238}(this, jQuery, _, Backbone); 1239void function ( exports, $, _, Backbone ) { 1240function setCaretPosition ( elem, pos ) { 1241var range; 1242if ( elem.createTextRange ) { 1243range = elem.createTextRange(); 1244range.move('character', pos); 1245range.select(); 1246} else { 1247elem.focus(); 1248if ( typeof elem.selectionStart !== 'undefined' ) { 1249elem.setSelectionRange(pos, pos); 1250} 1251} 1252} 1253function getCaretPosition ( input ) { 1254if ( document.selection ) { 1255input.focus(); 1256} 1257return 'selectionStart' in input ? input.selectionStart : '' || Math.abs(document.selection.createRange().moveStart('character', -input.value.length)); 1258} 1259function parseNumberUnit ( str ) { 1260str += ''; 1261var match = str.replace(/\s+/, ' ').match(/([-0-9.]+)\s?([^\s]*)?/); 1262return match && { 1263number: parseFloat(match[ 1 ]), 1264unit: match[ 2 ] 1265} 1266} 1267function spinValue ( $el, direction, page ) { 1268var value = $el.val(); 1269var min = parseFloat($el.attr('min')); 1270var max = parseFloat($el.attr('max')); 1271var step = Math.abs($el.attr('step') || 1); 1272var decimal = parseInt($el.attr('decimal')); 1273if ( !decimal ) { 1274decimal = step == step.toFixed() ? 0 : step.toString().split('.')[ 1 ].length; 1275} 1276var parsedValue = parseNumberUnit(value); 1277if ( !parsedValue ) { 1278parsedValue = { 1279num: 0, unit: '' 1280} 1281} 1282var num = parsedValue.number || 0; 1283var unit = parsedValue.unit || $el.attr('unit') || ''; 1284if ( typeof num !== 'number' ) return; 1285!page || (step *= 10); 1286switch ( direction ) { 1287case 'up': 1288num += step; 1289break; 1290case 'down': 1291num -= step; 1292break; 1293} 1294if ( direction == 'down' && min !== NaN && num < min ) 1295num = min; 1296if ( direction == 'up' && max !== NaN && num > max ) 1297num = max; 1298!decimal || (num = num.toFixed(decimal)) 1299!unit || (num += unit); 1300$el.val(num).trigger('change'); 1301} 1302$.fn.ES_NumberInput = function () { 1303return this.each(function () { 1304var $el = $(this); 1305var $parent = $el.parent(); 1306var $stepper = $el.next('.stepper'); 1307if ( !$stepper.length ) { 1308$stepper = $('<span class="input-group-addon stepper"><a class="up"></a><a class="down"></a></span>'); 1309} 1310if ( !$parent.is('.input-group') ) { 1311$parent = $('<div class="input-group">'); 1312$el.before($parent); 1313} 1314$parent.addClass('input-number-wrapper') 1315.on('mousedown', '.up', function ( e ) { 1316e.preventDefault(); 1317spinValue($el, 'up'); 1318}) 1319.on('mousedown', '.down', function ( e ) { 1320e.preventDefault(); 1321spinValue($el, 'down') 1322}); 1323$el.addClass('input-number') 1324.attr('type', 'text') 1325.attr('spellcheck', 'false') 1326.attr('autocomplete', 'off') 1327.on('keydown', function ( e ) { 1328var caretPos = getCaretPosition(this); 1329switch ( e.keyCode ) { 1330case 38: 1331spinValue($el, 'up', e.shiftKey); 1332break; 1333case 40: 1334spinValue($el, 'down', e.shiftKey); 1335break; 1336} 1337if ( e.keyCode == 38 || e.keyCode == 40 ) { 1338e.preventDefault(); 1339setCaretPosition(this, caretPos); 1340} 1341}); 1342$el.appendTo($parent); 1343$el.after($stepper); 1344}); 1345}; 1346$.fn.ES_ColorInput = function () { 1347return this.each(function () { 1348var $el = $(this); 1349var $parent = $('<div class="input-group input-color-wrapper">'); 1350var $remove = $('<span class="input-group-btn remove-color"><a class="btn btn-default btn-sm"><span class="fa fa-close"></span></a></span>'); 1351$remove.on('click', function ( e ) { 1352e.preventDefault(); 1353$el.val('').trigger('change:color'); 1354}); 1355$el.before($parent) 1356.appendTo($parent) 1357.after($remove); 1358}); 1359}; 1360$.fn.ES_ImageInput = function () { 1361return this.each(function () { 1362var $input = $(this); 1363var $parent = $('<div class="input-group input-image-wrapper">'); 1364var $select = $('<span class="input-group-btn"><a class="btn btn-default btn-sm input-image-select-btn"><span class="fa fa-folder-open"></span></a></span>'); 1365var $upload = $('<span class="input-group-btn"><a class="btn btn-default btn-sm input-image-upload-btn"><span class="fa fa-upload"></span></a></span>'); 1366var $clear = $('<span class="input-group-btn"><a class="btn btn-default btn-sm input-image-clear-btn"><span class="fa fa-close"></span></a></span>'); 1367$clear.click(function () { 1368$input.val() && $input.val('').trigger('change'); 1369}); 1370$select.click(function () { 1371$.ES_MediaSelector(function ( url ) { 1372$input.val(url).trigger('change'); 1373}); 1374}); 1375$input 1376.before($parent) 1377.appendTo($parent) 1378.after($clear) 1379.after($select); 1380}); 1381}; 1382$.fn.ES_VideoInput = function () { 1383}; 1384$.fn.ES_SelectBox = function () { 1385}; 1386$.ES_Prompt = function ( message, callback ) { 1387var reponse = prompt(message); 1388typeof callback == 'function' && callback(reponse); 1389}; 1390$.ES_MediaSelector = function ( callback ) { 1391window.jInsertEditorText = function ( value ) { 1392var regex = /<img.*?src="(.*?)"/; 1393var url = regex.exec(value)[ 1 ]; 1394typeof callback == 'function' && callback(url, { value: value }); 1395}; 1396window.jModalClose = function () { 1397$('.es-media-selector').addClass('hidden'); 1398} 1399var $iframe = $('.es-media-selector iframe'); 1400if ( !$iframe.prop('src') ) 1401$iframe.prop('src', 'index.php?option=com_media&view=images&tmpl=component'); 1402else { 1403$($iframe.get(0).contentDocument) 1404.find('#system-message-container') 1405.remove() 1406.trigger('load'); 1407} 1408$iframe 1409.off('load') 1410.on('load', function () { 1411var frameHeight = Math.min(window.innerHeight, this.contentDocument.body.scrollHeight); 1412var maxHeight = (frameHeight == this.contentDocument.body.scrollHeight);
1413$(this.contentDocument.body) 1414.css({ 1415'margin': '0', 1416'padding': '10px', 1417'overflow': maxHeight ? 'hidden' : 'scroll', 1418'box-sizing': 'border-box' 1419}); 1420$('.es-media-selector') 1421.css('height', frameHeight + 'px') 1422}); 1423$('.es-media-selector') 1424.removeClass('hidden') 1425.clickOutside(window.jModalClose); 1426}; 1427}(this, jQuery, _, Backbone);; 1428 1429/* FILE: /home/strato/http/power/rid/48/01/51344801/htdocs/joomla_02//plugins/system/easyslider/assets/js/lib/draggable.js */ 1430void function ( $, _ ) { 1431var x, y, 1432deltaX, deltaY, 1433offsetX, offsetY, 1434distance, direction, 1435velocityX, velocityY, 1436timeStart, timeStop, timeOffset, 1437axis, foundAxis, 1438event, target, 1439tapped, dragging, 1440isTouchDevice, now, 1441DRAG_DATA; 1442$(window).one('touchstart', function ( e ) { 1443isTouchDevice = true; 1444}) 1445$(document).ready(function () { 1446bindEvent(document.body, 'touchstart', tap); 1447bindEvent(document.body, 'touchmove', drag); 1448bindEvent(document.body, 'touchend', release); 1449bindEvent(document.body, 'touchcancel', release); 1450bindEvent(document.body, 'mousedown', tap); 1451bindEvent(document.body, 'mousemove', drag); 1452bindEvent(document.body, 'mouseup', release); 1453bindEvent(document.body, 'blur', release); 1454$(window).on('mouseout', function ( e ) { 1455e.toElement || release(e); 1456}); 1457}) 1458function tap ( e ) { 1459if (e.target.classList.contains('jsn-es-draggable')) { 1460target = $(e.target); 1461} 1462else { 1463var parent = findParentNode(e.target); 1464if (parent) { 1465target = $(parent); 1466} 1467else { 1468return; 1469} 1470} 1471if ( tapped ) 1472return; 1473now = timeStart = Date.now(); 1474DRAG_DATA = {}; 1475switch ( e.type ) { 1476case 'mousedown': 1477if (isTouchDevice) 1478return; 1479x = e.pageX; 1480y = e.pageY; 1481e.preventDefault(); 1482break; 1483case 'touchstart': 1484if ( e.touches.length != 1 ) 1485return; 1486x = e.touches[ 0 ].clientX; 1487y = e.touches[ 0 ].clientY; 1488break; 1489} 1490deltaX = 0; 1491deltaY = 0; 1492offsetX = 0; 1493offsetY = 0; 1494foundAxis = null; 1495distance = 0; 1496direction = 'none'; 1497axis = 'none'; 1498tapped = true; 1499} 1500function drag ( e ) { 1501if (!tapped) 1502return; 1503switch ( e.type ) { 1504case 'mousemove': 1505if (isTouchDevice) 1506return; 1507var pageX = e.pageX; 1508var pageY = e.pageY; 1509e.preventDefault(); 1510break; 1511case 'touchmove': 1512if ( e.touches.length != 1 ) 1513return; 1514var pageX = e.touches[ 0 ].clientX; 1515var pageY = e.touches[ 0 ].clientY; 1516break; 1517} 1518now = Date.now(); 1519deltaX = pageX - x; 1520deltaY = pageY - y; 1521offsetX += deltaX; 1522offsetY += deltaY; 1523x = pageX; 1524y = pageY; 1525if ( !foundAxis ) { 1526if ( Math.abs(offsetX) > Math.abs(offsetY) ) { 1527axis = 'x'; 1528} 1529else if ( Math.abs(offsetX) < Math.abs(offsetY) ) { 1530axis = 'y'; 1531} 1532else { 1533axis = 'none'; 1534} 1535distance = Math.max(Math.abs(offsetX), Math.abs(offsetY)); 1536if ( distance > 50 ) 1537foundAxis = true; 1538} 1539Math.abs(deltaX) >= Math.abs(deltaY) ? 1540direction = deltaX > 0 ? 'right' : deltaX < 0 ? 'left' : 'none' : 1541direction = deltaY > 0 ? 'down' : deltaY < 0 ? 'up' : 'none'; 1542if ( !dragging ) { 1543dragging = true; 1544target.trigger(createEvent('es_dragstart', e ), getData()); 1545$('body').add(target).addClass('jsn-es-draggable-dragging'); 1546} 1547if ( dragging ) { 1548timeStop = Date.now(); 1549calculateVelocity(); 1550timeStart = Date.now(); 1551target.trigger(createEvent('es_dragmove', e ), getData()); 1552} 1553} 1554function release ( e ) { 1555if ( !tapped ) 1556return; 1557switch ( e.type ) { 1558case 'touchend': 1559case 'touchcancel': 1560if ( e.touches.length ) 1561return; 1562} 1563tapped = false; 1564if ( !dragging ) 1565return 1566timeStop = Date.now(); 1567calculateVelocity(); 1568dragging = false; 1569$('body').add(target).removeClass('jsn-es-draggable-dragging'); 1570target.trigger(createEvent('es_dragstop', e), getData()); 1571target.removeData('jsn-es-draggable-data'); 1572} 1573function calculateVelocity() { 1574timeOffset = timeStop - timeStart; 1575velocityX = Math.abs(deltaX / timeOffset); 1576velocityY = Math.abs(deltaY / timeOffset); 1577} 1578function getData () { 1579var data = DRAG_DATA; 1580data.direction = direction; 1581data.axis = axis; 1582data.deltaX = deltaX; 1583data.deltaY = deltaY; 1584data.moveX = offsetX; 1585data.moveY = offsetY; 1586data.velocityX = velocityX; 1587data.velocityY = velocityY; 1588DRAG_DATA = data; 1589return data; 1590} 1591function bindEvent( element, event, handler, capture) { 1592if (element.addEventListener) 1593return element.addEventListener(event,handler,capture); 1594if (element.attachEvent) 1595return element.attachEvent(event,handler,capture); 1596} 1597function createEvent( type, e ) { 1598var options = {}; 1599options.originalEvent = e; 1600options.preventDefault = _.bind(e.preventDefault, e); 1601options.stopPropagation = _.bind(e.stopPropagation, e); 1602return $.Event(type, options) 1603} 1604function findParentNode( child ) { 1605var parent = child.parentNode, found = null; 1606while (parent && !found && !parent.isEqualNode(document.body)) 1607parent.classList && parent.classList.contains('jsn-es-draggable') ? 1608found = parent: 1609parent = parent.parentNode; 1610return found; 1611} 1612}(jQuery, _ ); 1613 1614/* FILE: /home/strato/http/power/rid/48/01/51344801/htdocs/joomla_02//plugins/system/easyslider/assets/js/lib/easing.js */ 1615/** 1616* Created by phong on 8/28/15. 1617*/ 1618void function ( exports, $, _, Backbone) {
1619var easings = exports.ES_Easings = { 1620linear: function( p ) { 1621return p; 1622} 1623}; 1624var baseEasings = {}; 1625_.each( [ "Quad", "Cubic", "Quart", "Quint", "Expo" ], function( name, i ) { 1626baseEasings[ name ] = function( p ) { 1627return Math.pow( p, i + 2 ); 1628}; 1629} ); 1630_.extend( baseEasings, { 1631Sine: function( p ) { 1632return 1 - Math.cos( p * Math.PI / 2 ); 1633}, 1634Circ: function( p ) { 1635return 1 - Math.sqrt( 1 - p * p ); 1636}, 1637Elastic: function( p ) { 1638return p === 0 || p === 1 ? p : 1639-Math.pow( 2, 8 * (p - 1) ) * Math.sin( ( (p - 1) * 80 - 7.5 ) * Math.PI / 15 ); 1640}, 1641Back: function( p ) { 1642return p * p * ( 3 * p - 2 ); 1643}, 1644Bounce: function( p ) { 1645var pow2, 1646bounce = 4; 1647while ( p < ( ( pow2 = Math.pow( 2, --bounce ) ) - 1 ) / 11 ) { 1648} 1649return 1 / Math.pow( 4, 3 - bounce ) - 7.5625 * Math.pow( ( pow2 * 3 - 2 ) / 22 - p, 2 ); 1650} 1651} ); 1652_.each( baseEasings, function( easeIn, name ) { 1653easings[ "easeIn" + name ] = easeIn; 1654easings[ "easeOut" + name ] = function( p ) { 1655return 1 - easeIn( 1 - p ); 1656}; 1657easings[ "easeInOut" + name ] = function( p ) { 1658return p < 0.5 ? 1659easeIn( p * 2 ) / 2 : 16601 - easeIn( p * -2 + 2 ) / 2; 1661}; 1662} ); 1663} ( this, jQuery, _, Backbone );; 1664 1665/* FILE: /home/strato/http/power/rid/48/01/51344801/htdocs/joomla_02//plugins/system/easyslider/assets/js/lib/tween.js */ 1666/** 1667* Created by phong on 8/28/15. 1668*/ 1669void function ( exports, $, _, Backbone ) { 1670var ES_Timer, ES_Tween, ES_Timeline; 1671var easings = ES_Easings; 1672var now; 1673ES_Timer = exports.ES_Timer = function ES_Timer( duration ) { 1674if ( !(this instanceof ES_Timer) ) 1675return new ES_Timer(duration) 1676_.bindAll(this, '_requestFrame', '_cancelFrame', '_renderFrame'); 1677this.duration = duration; 1678this.reverse = false; 1679this._lapsed = 0; 1680this._started = false; 1681this._running = false; 1682this._paused = false; 1683this._ended = false; 1684this._startTime = 0; 1685this._pauseTime = 0; 1686return this 1687} 1688_(ES_Timer).setPrototypeOf(Backbone.Events) 1689_(ES_Timer).extendPrototype({ 1690_requestFrame: function () { 1691if ( this._ended ) 1692return; 1693this.frameID = window.requestAnimationFrame(this._renderFrame); 1694}, 1695_cancelFrame: function () { 1696window.cancelAnimationFrame(this.frameID); 1697}, 1698_renderFrame: function () { 1699now = _.now(); 1700this._lapsed = now - this._startTime; 1701if ( this.duration && this._lapsed > this.duration ) { 1702this.end(); 1703} 1704else { 1705this._tick() 1706this._requestFrame() 1707} 1708}, 1709_tick: function ( options ) { 1710this.trigger('tick', this.currentTime(), options || {}) 1711}, 1712currentTime: function () { 1713return Math.max(this.reverse ? this.duration - this._lapsed : this._lapsed, 0); 1714}, 1715seek: function ( time, options ) { 1716var self = this; 1717time = parseInt(time); 1718self._startTime -= (time - self._lapsed); 1719self._lapsed = time; 1720if ( self._lapsed >= self.duration ) { 1721this.frameID = window.requestAnimationFrame(function () { 1722self.end(); 1723self.trigger('seek') 1724}) 1725} 1726else { 1727self._started = true; 1728self._ended = false; 1729self._paused = self._running ? false : true; 1730self._cancelFrame() 1731this.frameID = window.requestAnimationFrame(function () { 1732self._tick(options) 1733self.trigger('seek') 1734}) 1735} 1736return this; 1737}, 1738start: function () { 1739if ( this._started ) 1740this.stop(); 1741this._started = true; 1742this._running = true; 1743this._ended = false; 1744this._startTime = _.now() 1745this._requestFrame() 1746this._tick() 1747this.trigger('start') 1748return this; 1749}, 1750pause: function () { 1751if ( !this._started || !this._running || this._ended ) 1752return this; 1753this._running = false; 1754this._paused = true; 1755this._pauseTime = _.now(); 1756this._lapsed = Math.max(this._pauseTime - this._startTime, 0); 1757this._cancelFrame() 1758this.trigger('pause') 1759return this 1760}, 1761resume: function () { 1762if ( !this._started || !this._paused || this._ended ) 1763return this; 1764this._startTime += _.now() - this._pauseTime; 1765this._paused = false; 1766this._running = true; 1767this._requestFrame(); 1768this.trigger('resume') 1769return this 1770}, 1771stop: function () { 1772if ( !this._started ) 1773return this; 1774this._started = false; 1775this._running = false; 1776this._paused = false; 1777this._ended = false; 1778this._lapsed = 0; 1779this._cancelFrame() 1780this._tick() 1781this.trigger('stop') 1782return this; 1783}, 1784end: function () { 1785this._cancelFrame(); 1786this._started = false; 1787this._running = false; 1788this._paused = false; 1789this._ended = true; 1790this._lapsed = this.duration; 1791this.trigger('end'); 1792return this; 1793} 1794})
1795ES_Tween = exports.ES_Tween = function ES_Tween( selector, options ) { 1796if ( !(this instanceof ES_Tween) ) 1797return new ES_Tween(selector, options) 1798this.$el = $(selector); 1799var existingTween = this.$el.data('es-tween-data'); 1800var options = options || {}; 1801if ( existingTween && existingTween.tween ) { 1802if ( !options.from ) 1803options.from = existingTween.tween; 1804if ( !options.to ) 1805options.to = existingTween.tween; 1806} 1807this._setOptions(options) 1808this._setTimer(new ES_Timer) 1809this.options.from = parseTweenProps(this.options.from); 1810this.options.to = parseTweenProps(this.options.to); 1811mapTweenObject(this.options.from, this.options.to) 1812if ( !this.parent && !this.options.paused ) 1813_.defer(_.bind(this.start, this)) 1814return this 1815} 1816_(ES_Tween).setPrototypeOf(Backbone.Events) 1817_(ES_Tween).extendPrototype({ 1818_defaultOptions: { 1819from: {}, 1820to: {}, 1821loop: 0, 1822delay: 0, 1823duration: 1000, 1824easing: 'linear' 1825}, 1826_setOptions: function ( options ) { 1827this.options = _.defaults({}, options, this._defaultOptions); 1828_([ 'duration', 'delay', 'easing' ]).each(function ( key ) { 1829Object.defineProperty(this, key, { 1830get: function () { 1831return this.options[ key ]; 1832}, 1833set: function ( value ) { 1834this.options[ key ] = value; 1835if ( this.timer ) 1836switch ( key ) { 1837case 'delay': 1838case 'duration': 1839this.timer.duration = this.options.delay + this.options.duration; 1840this.parent && this.parent.refreshDuration(); 1841break; 1842} 1843} 1844}) 1845}, this) 1846}, 1847_setTimer: function ( timer ) { 1848this._clearTimer() 1849this.timer = timer; 1850this.timer.duration = this.delay + this.duration; 1851this.on('tick', function ( time, options ) { 1852if ( options.render !== false ) 1853this._render(time) 1854this.parent && this.parent.seek(time, _.extend({ render: false }, options)) 1855}) 1856this.on('end', function () { 1857this._render(this.timer._lapsed); 1858if ( this._loopCount == -1 ) 1859this.play() 1860else { 1861if ( this._loopCount && --this._loopCount > 0 ) 1862this.play() 1863else 1864this._looping = false; 1865} 1866}) 1867this.listenTo(this.timer, 'all', this.trigger) 1868}, 1869_clearTimer: function () { 1870if ( this.timer ) 1871this.stopListening(this.timer) 1872delete this.timer 1873}, 1874_render: function ( time ) { 1875if ( this.tweens ) { 1876_.invoke(this.tweens, '_render', time - this.delay) 1877return; 1878} 1879if ( time <= this.delay ) { 1880this.phase = 'waiting'; 1881var tween = this.options.from; 1882} 1883else if ( time >= this.delay + this.duration ) { 1884if ( this.phase == 'ended' ) 1885return; 1886this.phase = 'ended'; 1887var tween = this.options.to; 1888} 1889else { 1890if ( this.phase != 'tweening' ) { 1891this.phase = 'tweening'; 1892} 1893var a = this.options.from; 1894var b = this.options.to; 1895var c = time - this.delay; 1896var d = this.duration; 1897var e = this.easing; 1898var tween = getTweenObject(a, _.omit(b, 'opacity'), c, d, e); 1899_.extend(tween, getTweenObject(a, _.pick(b, 'opacity'), c, d, 'linear')) 1900} 1901if ( tween ) { 1902this.tween = tween; 1903this.$el.each(function () { 1904this.style.opacity = tween.opacity; 1905transform(this, toTransformCSS(tween)); 1906}) 1907this.trigger('render', tween) 1908} 1909return this; 1910}, 1911set: function ( type, props ) { 1912this.options[ type ] = parseTweenProps(props) 1913}, 1914end: function () { 1915this.timer.end(); 1916return this; 1917}, 1918start: function () { 1919if ( !this._looping ) { 1920this._loopCount = this.options.loop; 1921this._looping = true; 1922} 1923this.phase = null; 1924this.timer.start(); 1925return this; 1926}, 1927stop: function () { 1928this.timer.stop(); 1929return this; 1930}, 1931pause: function () { 1932this.timer.pause(); 1933return this; 1934}, 1935resume: function () { 1936this.timer.resume(); 1937return this; 1938}, 1939seek: function ( time, options ) { 1940this.timer.seek(time, options); 1941return this; 1942}, 1943seekPercent: function ( percent, options ) { 1944return this.seek(percent * this.duration, options) 1945}, 1946play: function ( from ) { 1947this.stop().start().pause().seek(!_.isUndefined(from) ? from : this.delay).resume(); 1948return this; 1949}, 1950position: function() { 1951return this.timer._lapsed; 1952} 1953}) 1954_(ES_Tween).extend({ 1955from: function ( selector, props, options ) { 1956return new ES_Tween(selector, _.chain(props) 1957.pick(defaultOptionKeys) 1958.extend(options) 1959.extend({ 1960from: _.omit(props, defaultOptionKeys) 1961}) 1962.value() 1963) 1964}, 1965to: function ( selector, props, options ) { 1966return new ES_Tween(selector, _.chain(props) 1967.pick(defaultOptionKeys) 1968.extend(options) 1969.extend({ 1970to: _.omit(props, defaultOptionKeys) 1971}) 1972.value() 1973) 1974}, 1975fromTo: function ( selector, fromProps, toProps, options ) { 1976return new ES_Tween(selector, _.extend({ from: fromProps, to: toProps }, options)); 1977}, 1978progress: function ( duration, iterator ) { 1979return new ES_Tween(null, { 1980from: { value: 0 }, 1981to: { value: 1 }, 1982duration: duration, 1983easing: 'linear', 1984}) 1985.on('tick', function () { 1986iterator.call(this, this.tween.value, false); 1987}) 1988.once('end', function () { 1989iterator.call(this, 1, true); 1990}) 1991} 1992}) 1993ES_Timeline = exports.ES_Timeline = function ES_Timeline( options ) { 1994if ( !(this instanceof ES_Timeline) ) 1995return new ES_Timeline(options) 1996this.tweens = []; 1997this._setOptions(options) 1998this._setTimer(new ES_Timer) 1999return this 2000} 2001_(ES_Timeline).setPrototypeOf(ES_Tween.prototype) 2002_(ES_Timeline).extendPrototype({ 2003_defaultOptions: { 2004loop: 0, 2005delay: 0, 2006duration: 0, 2007align: 'sequence' 2008}, 2009refreshDuration: function () { 2010var duration = 0; 2011_(this.tweens).each(function ( tween ) { 2012duration = Math.max(duration, tween.delay + tween.duration); 2013}) 2014this.duration = duration; 2015this.parent && this.parent.refreshDuration() 2016}, 2017add: function ( tween ) { 2018tween.stop(); 2019switch ( this.options.align ) {
2020case 'normal': 2021this.duration = Math.max(this.duration, tween.delay + tween.duration); 2022break; 2023case 'sequence': 2024var delay = tween.delay; 2025var duration = tween.duration; 2026if ( this.lastAddedTween && this.lastAddedTween.$el && tween.$el ) 2027if ( this.lastAddedTween.$el.get(0) == tween.$el.get(0) ) 2028tween.options.from = this.lastAddedTween.options.to; 2029tween.delay += this.duration; 2030this.duration += delay + duration; 2031this.lastAddedTween = tween; 2032break; 2033} 2034tween.parent = this; 2035this.tweens.unshift(tween); 2036return this 2037}, 2038from: function () { 2039this.add(ES_Tween.from.apply(null, arguments)); 2040return this; 2041}, 2042to: function () { 2043this.add(ES_Tween.to.apply(null, arguments)); 2044return this; 2045}, 2046staggerFrom: function () { 2047this.add(ES_Timeline.staggerFrom.apply(null, arguments)); 2048this.refreshDuration(); 2049return this; 2050}, 2051staggerTo: function () { 2052this.add(ES_Timeline.staggerTo.apply(null, arguments)); 2053this.refreshDuration(); 2054return this; 2055} 2056}) 2057_(ES_Timeline).extend({ 2058staggerFrom: function ( selector, delay, props, options ) { 2059var timeline = ES_Timeline(_.extend({}, props, { align: 'normal' }, options)); 2060var delayAt = timeline.delay; 2061timeline.delay = 0; 2062$(selector).each(function () { 2063var tween = ES_Tween(this, _.chain(props) 2064.pick(defaultOptionKeys) 2065.extend(options) 2066.extend({ 2067delay: delayAt, 2068from: _.omit(props, defaultOptionKeys) 2069}) 2070.value() 2071) 2072timeline.add(tween) 2073delayAt += delay; 2074}); 2075return timeline 2076}, 2077staggerTo: function ( selector, delay, props, options ) { 2078var timeline = ES_Timeline(_.extend({}, props, { align: 'normal' }, options)); 2079var delayAt = timeline.delay; 2080var delayAt = 0; 2081$(selector).each(function () { 2082timeline.add(ES_Tween(this, _.chain(props) 2083.pick(defaultOptionKeys) 2084.extend(options) 2085.extend({ 2086delay: delayAt, 2087to: _.omit(props, defaultOptionKeys) 2088}) 2089.value() 2090)) 2091delayAt += delay; 2092}); 2093return timeline 2094}, 2095getTweenObject: getTweenObject, 2096mapTweenObject: mapTweenObject, 2097getTweenValue: getTweenValue, 2098toTransformCSS: toTransformCSS 2099}) 2100/* Utils */ 2101var defaultProps = { 2102opacity: 1, 2103origin: { x: 0.5, y: 0.5, z: 0 }, 2104translate: { x: 0, y: 0, z: 0 }, 2105rotate: { x: 0, y: 0, z: 0 }, 2106scale: { x: 1, y: 1, z: 1 }, 2107skew: { x: 0, y: 0, z: 0 }, 2108}; 2109var defaultOptionKeys = [ 'delay', 'duration', 'easing', 'loop' ]; 2110function parseTweenProps( obj ) { 2111var props = _.deepExtend({}, defaultProps, obj); 2112if ( _.isNumber(props.scale) ) { 2113props.scale = { x: props.scale, y: props.scale, z: props.scale }; 2114} 2115if ( _.isNumber(props.rotate) ) { 2116props.rotate = { z: props.rotate, x: 0, y: 0 }; 2117} 2118_.has(props, 'x') && (props.translate.x = props.x), (delete props.x); 2119_.has(props, 'y') && (props.translate.y = props.y), (delete props.y); 2120_.has(props, 'z') && (props.translate.z = props.z), (delete props.z); 2121return props; 2122} 2123function mapTweenObject( from, to ) { 2124_(from).each(function ( v, key ) { 2125if ( _.isObject(from[ key ]) ) { 2126mapTweenObject(from[ key ], to[ key ] = to[ key ] || {}); 2127} 2128else { 2129if ( !to[ key ] ) to[ key ] = 0; 2130} 2131}, this) 2132} 2133function getTweenObject( from, to, time, duration, easing ) { 2134from = (from || {}); 2135to = (to || {}); 2136return _.mapObject(to, function ( toValue, key ) { 2137var fromValue = from[ key ]; 2138if ( _.isObject(toValue) ) 2139return getTweenObject(fromValue, toValue, time, duration, easing); 2140if ( _.isEqual(fromValue, toValue) ) 2141return toValue; 2142toValue = (toValue || 0); 2143fromValue = (fromValue || 0); 2144var timing = (easing && easings[ easing ]) ? easings[ easing ] : easings.linear; 2145return fromValue + ( ( toValue - fromValue ) * timing(time / duration) ); 2146}) 2147} 2148function getTweenValue(fromValue, toValue, progress, easing) { 2149var timing = (easing && easings[ easing ]) ? easings[ easing ] : easings.linear; 2150return fromValue + ( ( toValue - fromValue ) * timing(progress || 0) ); 2151} 2152function toTransformCSS( tx ) { 2153var result = ''; 2154tx.translate && ( result += 'translate3d(' + (tx.translate.x || 0) + 'px, ' + (tx.translate.y || 0) + 'px, ' + (tx.translate.z || 0) + 'px) ' ); 2155tx.rotate && typeof tx.rotate.x !== 'undefined' && ( result += 'rotate3d(1,0,0,' + (tx.rotate.x || 0) + 'deg) ' ); 2156tx.rotate && typeof tx.rotate.y !== 'undefined' && ( result += 'rotate3d(0,1,0,' + (tx.rotate.y || 0) + 'deg) ' ); 2157tx.rotate && typeof tx.rotate.z !== 'undefined' && ( result += 'rotate3d(0,
21570,1,' + (tx.rotate.z || 0) + 'deg) ' ); 2158tx.scale && ( result += 'scale3d(' + (tx.scale.x || 1) + ', ' + (tx.scale.y || 1) + ', ' + (tx.scale.z || 1) + ') ' ); 2159tx.skew && ( result += 'skew(' + tx.skew.x + 'deg, ' + tx.skew.y + 'deg) ' ); 2160return result; 2161} 2162var transformKey, transformKeys = [ "transform", "msTransform", "webkitTransform", "mozTransform", "oTransform" ]; 2163function transform( el, value ) { 2164if ( !transformKey && document.body && document.body.style ) { 2165while ( !transformKey && transformKeys.length ) { 2166var key = transformKeys.pop(); 2167if ( typeof document.body.style[ key ] !== 'undefined' ) 2168transformKey = key; 2169} 2170} 2171el.style[ transformKey ] = value; 2172} 2173}(this, jQuery, _, Backbone);; 2174 2175/* FILE: /home/strato/http/power/rid/48/01/51344801/htdocs/joomla_02//plugins/system/easyslider/assets/js/lib/model.js */ 2176var optimizeCb = function(func, context, argCount) { 2177if (context === void 0) return func; 2178switch (argCount == null ? 3 : argCount) { 2179case 1: return function(value) { 2180return func.call(context, value); 2181}; 2182case 2: return function(value, other) { 2183return func.call(context, value, other); 2184}; 2185case 3: return function(value, index, collection) { 2186return func.call(context, value, index, collection); 2187}; 2188case 4: return function(accumulator, value, index, collection) { 2189return func.call(context, accumulator, value, index, collection); 2190}; 2191} 2192return function() { 2193return func.apply(context, arguments); 2194}; 2195}; 2196var cb = function(value, context, argCount) { 2197if (value == null) return _.identity; 2198if (_.isFunction(value)) return optimizeCb(value, context, argCount); 2199if (_.isObject(value)) return _.matcher(value); 2200return _.property(value); 2201}; 2202_.mixin({ 2203mapObject: function(obj, iteratee, context) { 2204iteratee = cb(iteratee, context); 2205var keys = _.keys(obj), 2206length = keys.length, 2207results = {}, 2208currentKey; 2209for (var index = 0; index < length; index++) { 2210currentKey = keys[index]; 2211results[currentKey] = iteratee(obj[currentKey], currentKey, obj); 2212} 2213return results; 2214} 2215}) 2216_.noop = function(){} 2217void function ( root, factory ) { 2218if ( typeof define === 'function' && define.amd ) { 2219define([ 'underscore', 'backbone', 'exports' ], function ( _, Backbone, exports ) { 2220root.B = factory(root, exports, _, Backbone); 2221}); 2222} else if ( typeof exports !== 'undefined' ) { 2223var _ = require('underscore'); 2224var Backbone = require('backbone'); 2225factory(root, exports, _, Backbone); 2226} else { 2227root.B = factory(root, root.B || {}, root._, root.Backbone); 2228} 2229}(this, function ( root, B, _, Backbone ) { 2230var Model, Collection, Compute; 2231var BackboneModel = Backbone.Model; 2232var BackboneCollection = Backbone.Collection; 2233/* --- Compute --- */ 2234Compute = B.Compute = function () { 2235function Compute ( deps, options ) { 2236if ( !(this instanceof Compute) ) 2237return new Compute(deps, options); 2238if ( _.isArray(deps) && _.isFunction(options) ) 2239options = { deps: deps, get: options } 2240else if ( _.isFunction(deps) ) 2241options = _.defaults({ get: deps }, options) 2242else 2243options = (deps || {}); 2244_.defaults(this, options, { 2245deps: [], 2246init: function () { 2247return null; 2248}, 2249get: function ( value ) { 2250return value; 2251}, 2252set: function ( value ) { 2253return value; 2254} 2255}) 2256} 2257return Compute 2258}() 2259/* --- Model --- */ 2260Model = B.Model = function () { 2261function Model ( attrs, options ) { 2262if ( !(this instanceof Model) ) { 2263if (isPrototypeOf(attrs, Model)) 2264return attrs.create.apply(attrs, _(arguments).slice(1)); 2265return Model.create.apply(Model, arguments); 2266} 2267_.extend(this, _.pick(options, '_parent', '_relatedKey')) 2268_.each(this.computes, this._registerComputeValue, this) 2269Object.defineProperties(this, { 2270'root': { 2271get: function () { 2272var root = this; 2273var parent = this.collection || this._parent; 2274while ( parent ) { 2275root = parent; 2276parent = parent.collection || parent._parent; 2277} 2278return root; 2279} 2280} 2281}); 2282BackboneModel.apply(this, arguments); 2283} 2284Model.prototype.__proto__ = BackboneModel.prototype; 2285var useMatchAll = typeof String.prototype.matchAll == 'function' 2286_.extend(Model.prototype, { 2287relations: {}, 2288computes: {}, 2289defaults: {}, 2290/* 2291* Use String.matchAll() on newer browsers 2292* otherwise use Regex.exec() for older browsers 2293* */ 2294get: useMatchAll ? 2295function( key ) { 2296var value = this; 2297var regex = /(\w+)(?:\[([0-9]+)\])?/g; 2298var m = key.matchAll(regex) 2299var done = false 2300while (!done) { 2301var result = m.next() 2302if (result.done == false) { 2303var match = result.value 2304value = value instanceof BackboneModel ? getComputedValue(value, match[ 1 ]) : 2305typeof value == 'object' ? value[ match[ 1 ] ] : undefined; 2306if ( match[ 2 ] ) 2307value = value instanceof BackboneCollection ? value.at(match[ 2 ]) : value[ match[ 2 ] ]; 2308} else { 2309done = true 2310} 2311} 2312return value; 2313} : 2314function ( key ) { 2315var value = this; 2316var regex = /(\w+)(?:\[([0-9]+)\])?/g; 2317var match; 2318while (match = regex.exec(key)) { 2319value = value instanceof BackboneModel ? getComputedValue(value, match[ 1 ]) : 2320typeof value == 'object' ? value[ match[ 1 ] ] : undefined; 2321if ( match[ 2 ] ) { 2322value = value instanceof BackboneCollection ? value.at(match[ 2 ]) : value[ match[ 2 ] ]; 2323} 2324} 2325return value; 2326}, 2327// 2328// 2329setRelation: function ( attr, val, options ) { 2330var relation = this.attributes[ attr ], 2331id = this.idAttribute || "id", 2332modelToSet, modelsToAdd = [], modelsToRemove = []; 2333if ( options.unset && relation ) delete relation.parent; 2334if ( this.relations && _.has(this.relations, attr) ) { 2335if ( relation && relation instanceof Collection ) { 2336if ( val instanceof Collection || val instanceof Array ) { 2337val = val.models || val; 2338modelsToAdd = _.clone(val); 2339relation.each(function ( model, i ) { 2340if ( typeof model[ id ] == 'undefined' ) return; 2341var rModel = _.find(val, function ( _model ) { 2342return _model[ id ] === model[ id ]; 2343}); 2344if ( rModel ) { 2345model.set(rModel.toJSON ? rModel.toJSON() : rModel); 2346modelsToAdd.splice(i, 1); 2347} else { 2348modelsToRemove.push(model); 2349} 2350}); 2351_.each(modelsToRemove, function ( model ) { 2352relation.remove(model); 2353}); 2354relation.add(modelsToAdd); 2355} else { 2356relation.each(function ( model ) { 2357if ( val[ id ] === model[ id ] ) { 2358model.set(val); 2359} else { 2360relation.remove(model); 2361} 2362}); 2363} 2364return relation; 2365} 2366if ( val instanceof Model ) { 2367val = val.toJSON() 2368} 2369if ( relation && relation instanceof Model ) { 2370relation.set(val); 2371return relation; 2372} 2373options._parent = this; 2374options._relatedKey = attr; 2375val = new this.relations[ attr ](val, options); 2376val.parent = this; 2377} 2378return val; 2379}, 2380set: function ( key, val, options ) { 2381if ( typeof key == 'object' ) { 2382options = val; 2383return this._set(key, options) 2384} 2385if ( typeof key == 'string' ) { 2386if ( !key.match(/[.\[]/) ) 2387return this._set(key, val, options) 2388var regex = /(\w+)(?:\[([0-9]+)\])?/; 2389var keys = key.split('.'); 2390var setAttr = keys.pop().match(regex); 2391var getAttr = keys.join('.'); 2392if ( !setAttr[ 2 ] ) { 2393var setter = this.get(getAttr); 2394if ( setter instanceof BackboneModel ) 2395setter.set(setAttr[ 1 ], val, options); 2396else if ( typeof setter === 'object' ) 2397setter[ setAttr[ 1 ] ] = val; 2398return this; 2399}
2400var collection = this.get(getAttr + '.' + setAttr[ 1 ]); 2401if ( collection instanceof BackboneCollection ) 2402collection.at(parseInt(setAttr[ 2 ])).set(val, options) 2403else if ( typeof setter === 'object' ) 2404collection[ parseInt(setAttr[ 2 ]) ] = val; 2405return this; 2406} 2407}, 2408_set: function ( key, val, options ) { 2409var attr, attrs, unset, changes, silent, changing, prev, current; 2410if ( key == null ) return this; 2411if ( typeof key === 'object' ) { 2412attrs = key; 2413options = val; 2414} else { 2415(attrs = {})[ key ] = val; 2416} 2417options || (options = {}); 2418if ( !this._validate(attrs, options) ) return false; 2419unset = options.unset; 2420silent = options.silent; 2421changes = []; 2422changing = this._changing; 2423this._changing = true; 2424if ( !changing ) { 2425this._previousAttributes = _.clone(this.attributes); 2426this.changed = {}; 2427} 2428current = this.attributes, prev = this._previousAttributes; 2429if ( this.idAttribute in attrs ) this.id = attrs[ this.idAttribute ]; 2430for ( attr in attrs ) { 2431if ( this.computes[ attr ] ) { 2432val = attrs[ attr ] 2433val = this.computes[ attr ].set.call(this, val, options); 2434} 2435else { 2436val = attrs[ attr ]; 2437val = this.setRelation(attr, val, options); 2438} 2439if ( !_.isEqual(current[ attr ], val) ) changes.push(attr); 2440if ( !_.isEqual(prev[ attr ], val) ) { 2441this.changed[ attr ] = val; 2442} else { 2443delete this.changed[ attr ]; 2444} 2445unset ? delete current[ attr ] : current[ attr ] = val; 2446} 2447if ( !silent ) { 2448if ( changes.length ) this._pending = true; 2449for ( var i = 0, l = changes.length; i < l; i++ ) { 2450this.trigger('change:' + changes[ i ], this, current[ changes[ i ] ], options); 2451} 2452} 2453if ( changing ) return this; 2454if ( !silent ) { 2455while ( this._pending ) { 2456this._pending = false; 2457this.trigger('change', this, options); 2458this._triggerParentChange(options); 2459} 2460} 2461this._pending = false; 2462this._changing = false; 2463return this; 2464}, 2465clone: function ( options ) { 2466return new this.constructor(this.toJSON()); 2467}, 2468clear: function ( options ) { 2469var attrs = {}; 2470for ( var key in this.attributes ) { 2471if ( this.attributes[ key ] instanceof BackboneModel ) 2472this.attributes[ key ].clear(options); 2473else if ( this.attributes[ key ] instanceof BackboneCollection ) 2474this.attributes[ key ].invoke('clear', options), 2475this.attributes[ key ].reset([]); 2476else 2477attrs[ key ] = void 0; 2478} 2479return this.set(attrs, _.extend({}, options, { unset: true })); 2480}, 2481toJSON2: function ( options ) { 2482var attrs = _.clone(this.attributes); 2483attrs.__proto__ = null; 2484_.each(this.relations, function ( rel, key ) { 2485if ( _.has(attrs, key) ) { 2486attrs[ key ] = attrs[ key ].toJSON(); 2487} else { 2488attrs[ key ] = (new rel()).toJSON(); 2489} 2490}); 2491return attrs; 2492}, 2493toJSON: function () { 2494var attr, obj = Object.create(null, {}); 2495for ( var key in this.attributes ) { 2496attr = this.attributes[ key ]; 2497if ( attr instanceof BackboneModel || attr instanceof BackboneCollection ) 2498attr = attr.toJSON(); 2499if (this.computes.hasOwnProperty(key)) 2500continue; 2501if ( _.isObject(attr) ) 2502attr = _.clone(attr); 2503obj[ key ] = attr; 2504} 2505return obj; 2506}, 2507toCompactJSON: function () { 2508var attr, obj = Object.create(null, {}); 2509for ( var key in this.attributes ) { 2510if ( this.attributes.hasOwnProperty(key) ) { 2511attr = this.attributes[ key ]; 2512if ( attr instanceof Model || attr instanceof Collection ) 2513attr = attr.toCompactJSON(); 2514else if ( attr instanceof BackboneModel || attr instanceof BackboneCollection ) 2515attr = attr.toJSON(); 2516if (this.computes.hasOwnProperty(key)) 2517continue; 2518if ( _.isEqual(attr, this.defaults[ key ])) 2519continue; 2520obj[ key ] = attr; 2521} 2522} 2523return obj; 2524}, 2525_triggerParentChange: function ( options ) { 2526var parent = this._parent; 2527if ( !parent ) return; 2528parent.changed = {}; 2529_.extend(options, { chained: true }) 2530for ( var key in this.changed ) { 2531parent.changed[ this._relatedKey + '.' + key ] = this.changed[ key ]; 2532parent.trigger('change:' + this._relatedKey + '.' + key, parent, this.changed[ key ], options); 2533} 2534parent.changed[ this._relatedKey ] = undefined; 2535parent.trigger('change:' + this._relatedKey, parent, this, options); 2536parent.trigger('change', parent, options); 2537parent._triggerParentChange(options); 2538}, 2539_registerComputeValue: function ( compute, attr ) { 2540_.each(compute.deps, function ( depAttr ) { 2541this.on('change:' + depAttr, function ( model, value, options ) { 2542var value = model.get(depAttr); 2543if ( value instanceof BackboneModel || value instanceof Collection ) { 2544model.changed[ attr ] = undefined; 2545_.each(value.changed, function ( subValue, subAttr ) { 2546model.changed[ subAttr ] = subValue; 2547model.trigger('change:' + attr + '.' + subAttr, model, subValue, options) 2548}) 2549} 2550else { 2551model.changed[ attr ] = value; 2552} 2553model.trigger('change:' + attr, model, value, options) 2554model.trigger('change', model, options) 2555}) 2556}, this) 2557}, 2558alias: function ( model ) { 2559for ( var attr in model.attributes ) { 2560if ( model.attributes[ attr ] instanceof BackboneModel ) { 2561if ( !this.attributes.hasOwnProperty(attr) || !(this.attributes[ attr ] instanceof BackboneModel) || !(this.attributes[ attr ] instanceof BackboneCollection) ) { 2562this.attributes[ attr ] = new Model(this.attributes[ attr ], { _parent: this, _relatedKey: attr }); 2563} 2564this.attributes[ attr ].alias(model.attributes[ attr ]) 2565} 2566} 2567this._alias = model; 2568this.attributes.__proto__ = model.attributes; 2569this.defaults = _.extend({}, model.defaults, this.defaults); 2570this.relations = _.extend({}, model.relations, this.relations); 2571this.computes = _.extend({}, model.computes, this.computes); 2572return this; 2573} 2574}) 2575_.extend(Model, { 2576create: function ( attrs, protos, statics ) { 2577var protos = protos || {}; 2578var statics = statics || {}; 2579var defaults = _.extend( {}, this.prototype.defaults, protos.defaults, attrs ); 2580var relations = _.extend( {}, this.prototype.relations, protos.relations ); 2581var computes = _.extend( {}, this.prototype.computes, protos.computes ); 2582for ( var attr in attrs ) { 2583if ( isPrototypeOf(attrs[ attr ], BackboneModel) ) { 2584relations[ attr ] = attrs[ attr ]; 2585defaults[ attr ] = {}; 2586} 2587else if ( isPrototypeOf(attrs[ attr ], BackboneCollection) ) { 2588relations[ attr ] = attrs[ attr ]; 2589defaults[ attr ] = []; 2590} 2591else if ( attrs[ attr ] instanceof Compute ) { 2592computes[ attr ] = attrs[ attr ]; 2593delete defaults[ attr ]; 2594} 2595} 2596return this.extend( 2597_.extend({}, protos, {
2598defaults: defaults, 2599relations: relations, 2600computes: computes 2601}), 2602_.extend({}, statics, { 2603create: Model.create, 2604extend: Model.extend, 2605define: Model.define, 2606}) 2607); 2608}, 2609extend: function () { 2610return BackboneModel.extend.apply(this, arguments) 2611} 2612}) 2613Model.define = Model.create; 2614return Model 2615}(); 2616/* --- Collection --- */ 2617Collection = B.Collection = function () { 2618function Collection ( models, options ) { 2619if ( !(this instanceof Collection) ) { 2620if (isPrototypeOf(models, Collection)) 2621return models.create.apply(models, _(arguments).slice(1)); 2622return Collection.create.apply(Collection, arguments); 2623} 2624_.extend(this, _.pick(options, '_parent', '_relatedKey')) 2625this.on('change', this._triggerParentChange) 2626this.on('add', this._triggerParentChange) 2627this.on('remove', this._triggerParentChange) 2628BackboneCollection.apply(this, arguments) 2629} 2630Collection.prototype.__proto__ = BackboneCollection.prototype; 2631_.extend(Collection.prototype, { 2632model: Model, 2633_triggerParentChange: function ( model, options ) { 2634var parent = this._parent; 2635if ( !parent ) return; 2636if ( model && model.collection ) { 2637var modelIndex = model.collection.indexOf(model); 2638parent.changed = {}; 2639_.extend(options, { chained: true }) 2640for ( var key in model.changed ) { 2641parent.changed[ this._relatedKey + '[' + modelIndex + '].' + key ] = model.changed[ key ]; 2642parent.trigger('change:' + this._relatedKey + '[' + modelIndex + '].' + key, parent, model.changed[ key ], options); 2643parent.changed[ this._relatedKey + '.' + key ] = model.changed[ key ]; 2644parent.trigger('change:' + this._relatedKey + '.' + key, parent, model.changed[ key ], options); 2645} 2646parent.changed[ this._relatedKey ] = undefined; 2647parent.trigger('change:' + this._relatedKey, parent, options); 2648parent._triggerParentChange(options); 2649} 2650parent.trigger('change', parent, options); 2651}, 2652resetRelations: function ( options ) { 2653_.each(this.models, function ( model ) { 2654_.each(model.relations, function ( rel, key ) { 2655if ( model.get(key) instanceof BackboneCollection ) { 2656model.get(key).trigger('reset', model, options); 2657} 2658}); 2659}) 2660}, 2661reset: function ( models, options ) { 2662options || (options = {}); 2663for ( var i = 0, l = this.models.length; i < l; i++ ) { 2664this._removeReference(this.models[ i ]); 2665} 2666options.previousModels = this.models; 2667this._reset(); 2668this.add(models, _.extend({ silent: true }, options)); 2669if ( !options.silent ) { 2670this.trigger('reset', this, options); 2671this.resetRelations(options); 2672} 2673return this; 2674}, 2675comparator: function ( model ) { 2676return model.get('index'); 2677}, 2678toCompactJSON: function () { 2679var models = _(this.models).map(function ( model ) { 2680return model instanceof BackboneModel ? model.toCompactJSON() : model.toJSON(); 2681}); 2682models.__proto__ = null; 2683return models; 2684}, 2685_prepareModel: function( attrs, options ) { 2686if (attrs instanceof Model) 2687return attrs; 2688options = options ? _.clone(options) : {}; 2689options.collection = this; 2690var modelClass = this.model; 2691if (attrs._rel && this.relations[attrs._rel]) 2692modelClass = this.relations[attrs._rel]; 2693var model = new modelClass(attrs, options); 2694if (!model.validationError) return model; 2695this.trigger('invalid', this, model.validationError, options); 2696return false; 2697} 2698}) 2699_.extend(Collection, { 2700create: function ( models, protos, statics ) { 2701var statics = _.extend({}, statics, { 2702create: Collection.create, 2703extend: Collection.extend, 2704define: Collection.define, 2705}); 2706if ( _.isArray(models) || isPrototypeOf(models, Model)) 2707return Collection.extend(_.extend({}, protos, { 2708model: _.isArray(models) ? models[ 0 ] : models 2709}), statics); 2710else if ( _.isObject(models)) 2711return Collection.extend(_.extend({}, protos, { 2712relations: models 2713}), statics); 2714else 2715return Collection.extend( protos, statics ); 2716}, 2717extend: function () { 2718return BackboneCollection.extend.apply(this, arguments) 2719} 2720}) 2721Collection.define = Collection.create; 2722return Collection 2723}() 2724/* --- Utils --- */ 2725function getComputedValue ( model, key ) { 2726if ( model.computes && model.computes[ key ] ) { 2727var compute = model.computes[ key ]; 2728var deps = _(compute.deps).map(function ( dep ) { 2729return getComputedValue(model, dep); 2730}) 2731return compute.get.apply(model, deps); 2732} 2733return model.attributes[ key ]; 2734} 2735function setPrototypeOf( child, prototype ) {
2736if (_.isFunction(Object.setPrototypeOf)) 2737Object.setPrototypeOf(child.prototype || child, prototype); 2738else 2739(child.prototype || child).__proto__ = prototype; 2740return child 2741} 2742function isPrototypeOf( child, parent ) { 2743if ( !child || !parent ) 2744return false; 2745var result = false; 2746var proto = child.prototype; 2747while ( proto ) { 2748if ( proto == parent.prototype ) { 2749result = true; 2750break; 2751} 2752proto = proto.__proto__; 2753} 2754return result; 2755} 2756return B; 2757});; 2758 2759/* FILE: /home/strato/http/power/rid/48/01/51344801/htdocs/joomla_02//plugins/system/easyslider/assets/js/lib/view.js */ 2760/* Backbone Extension */ 2761void function ( root, factory ) { 2762if ( typeof define === 'function' && define.amd ) { 2763define([ 'jquery', 'underscore', 'backbone', 'exports' ], function ( $, _, Backbone, exports ) { 2764root.B = factory(root, exports, $, _, Backbone); 2765}); 2766} else if ( typeof exports !== 'undefined' ) { 2767var $ = require('jquery'); 2768var _ = require('underscore'); 2769var Backbone = require('backbone'); 2770factory(root, exports, $, _, Backbone); 2771} else { 2772root.B = factory(root, root.B || {}, root.jQuery, root._, root.Backbone); 2773} 2774}(this, function ( root, B, $, _, Backbone ) { 2775var View, CollectionView, DataBinder; 2776_.mixin({ 2777isPrototypeOf: function( child, parent ) { 2778if ( !child || !parent ) 2779return false; 2780var result = false;
2781var proto = child.prototype; 2782while ( proto ) { 2783if ( proto == parent.prototype ) { 2784result = true; 2785break; 2786} 2787proto = proto.__proto__; 2788} 2789return result; 2790}, 2791setPrototypeOf: function( child, prototype ) { 2792if (_.isFunction(Object.setPrototypeOf)) 2793Object.setPrototypeOf(child.prototype || child, prototype); 2794else 2795(child.prototype || child).__proto__ = prototype; 2796return child 2797}, 2798extendPrototype: function( child, prototype ) { 2799_.extend(child.prototype, prototype) 2800return child 2801}, 2802}); 2803var BackboneModel = Backbone.Model; 2804var BackboneCollection = Backbone.Collection; 2805var BackboneEvents = Backbone.Events; 2806var BackboneView = Backbone.View; 2807var BackboneViewEnsureElement = BackboneView.prototype._ensureElement; 2808var $reusableElements = $('<div>'); 2809/* --- View --- */ 2810View = B.View = function() { 2811function View( options ) { 2812if ( !(this instanceof View) ) 2813return new View(options); 2814var options = (options || {}); 2815this.__ready = _.once(this.__ready); 2816this.subViews = []; 2817_.extend(this, _.pick(options, 'template', 'views', 'bindings', 'events', 'modelEvents', 'superView')); 2818if ( this.template ) 2819switch ( typeof this.template ) { 2820case 'string': 2821this.template = this.template.trim(); 2822if (!this.template.match('<') && !this.template.match(/\s/)) 2823this.template = $(this.template).html(); 2824break; 2825} 2826Object.defineProperties(this, { 2827'rootView': { 2828get: function() { 2829var root = this; 2830var parent = this.superView; 2831while ( parent ) { 2832root = parent; 2833parent = parent.superView; 2834} 2835return root; 2836} 2837} 2838}); 2839BackboneView.call(this, options); 2840this.el && this.el.parentNode && this.__ready(); 2841} 2842_.extend(View.prototype, { 2843bindings : false, 2844initialize : _.noop, 2845ready : _.noop, 2846_ensureElement : function() { 2847BackboneViewEnsureElement.call(this); 2848this.render(); 2849}, 2850setModel : function( model ) { 2851if ( !model ) 2852return; 2853if ( this.modelEvents ) 2854_(this.modelEvents).each(function( handler, bind ) { 2855bind = _([ 'event', 'selector' ]).object(_(bind.match(/(.*)\s(.*)/) || [ 0, bind ]).rest(1)); 2856handler = _.isString(handler) ? this[ handler ] : handler; 2857var unbindModel = this.model && bind.selector ? this.model.get(bind.selector) : this.model; 2858var bindModel = (bind.selector && this.model) ? this.model.get(bind.selector) : model; 2859unbindModel && this.stopListening(unbindModel, bind.event); 2860this.listenTo(bindModel, bind.event, handler); 2861}, this); 2862this.model = model; 2863this.setBindingModel(this.model) 2864this.trigger('set:model', this.model) 2865}, 2866setBindingModel: function( model ) { 2867!this.__dataBinding && console.warn("Data-binding hasn't been initialized for this view."); 2868this.__dataBinding && this.__dataBinding.setModel(model); 2869this.trigger('set:binding:models', this.__dataBinding.models) 2870return this; 2871}, 2872__ready : function() { 2873this.initSubViews(); 2874this.initDataBinding(); 2875this.setModel(this.model); 2876this.ready(); 2877}, 2878freeze : function() { 2879this._frozen = true; 2880this.trigger('freeze'); 2881return this; 2882}, 2883unfreeze : function() { 2884this._frozen = false; 2885this.trigger('unfreeze'); 2886return this; 2887}, 2888preventDefault : function( e ) { 2889e.preventDefault(); 2890}, 2891stopPropagation: function( e ) { 2892e.stopPropagation(); 2893}, 2894defer : function( fn, context ) { 2895_.defer(_.bind(fn, context || this)); 2896return this; 2897}, 2898delay : function( fn, delay, context ) { 2899_.delay(_.bind(fn, context || this), delay); 2900return this; 2901}, 2902render : function() { 2903return this.__render.apply(this, arguments); 2904}, 2905__render : function() { 2906this.trigger('before:render'); 2907this.template && this.$el.html(this.template); 2908this.trigger('render'); 2909return this; 2910}, 2911initDataBinding: function() { 2912if ( this.__dataBinding ) 2913return; 2914this.__dataBinding = new DataBinder(this, this.model, { bindings: _.result(this, 'bindings') || [] }); 2915}, 2916initSubViews : function() { 2917var regex = (/^(\w+)(?: (collection|model):([$\w.]+))?\s*>\s*(.*)$/); 2918_.each(this.views, function( view, define ) { 2919var match = define.match(regex); 2920if ( !match ) 2921throw "View definition syntax error: '" + define + "'"; 2922var key = match[ 1 ]; 2923var type = match[ 2 ]; 2924var attr = match[ 3 ]; 2925var selector = match[ 4 ]; 2926var options = {}; 2927type && attr && (options[ type ] = (attr == '$model') ? this.model : (attr == '$collection') ? this.collection : this.model.get(attr)); 2928this[ key ] = this.attachView(view, selector, options); 2929}, this); 2930}, 2931hasView : function( view ) { 2932return this.subViews && this.subViews.indexOf(view) > -1; 2933}, 2934attachView : function( view, selector, options ) { 2935var el = this.$(selector).get(0); 2936if ( !el ) 2937throw 'No element found for selector "' + selector + '"'; 2938if ( _.isFunction(view) ) {
2939options || (options = {}); 2940options.el = el; 2941options.superView = this; 2942view = new view(options); 2943} 2944else { 2945view.setElement(el); 2946view.superView = this; 2947this.hasView(view) || this.subViews.push(view); 2948} 2949view.__ready(); 2950return view; 2951}, 2952appendView : function( view ) { 2953this.hasView(view) || this.subViews.push(view); 2954view.superView = this; 2955view.$el.appendTo(this.el); 2956view.__ready(); 2957return view; 2958}, 2959prependView : function( view ) { 2960this.hasView(view) || this.subViews.push(view); 2961view.superView = this; 2962view.$el.prependTo(this.el); 2963view.__ready(); 2964return view; 2965}, 2966remove : function() { 2967this.trigger('before:remove'); 2968BackboneView.prototype.remove.call(this); 2969this.superView && 2970this.superView.subViews && 2971_(this.superView.subViews).each(function( subView, index ) { 2972if ( subView && subView.cid == this.cid ) 2973this.superView.subViews.splice(index, 1); 2974}, this); 2975this.trigger('remove'); 2976return this; 2977} 2978}); 2979_.setPrototypeOf(View, BackboneView.prototype); 2980View.extend = BackboneView.extend; 2981return View; 2982}() 2983/* --- CollectionView --- */ 2984CollectionView = B.CollectionView = function() { 2985function CollectionView( options ) { 2986if ( !(this instanceof CollectionView) ) 2987return new CollectionView(options); 2988this.previousSubViews = {}; 2989this.options = options || {}; 2990this._debounceReset = _.debounce(this.reset); 2991options.collection || (options.collection = new BackboneCollection); 2992View.call(this, options); 2993} 2994_.extend(CollectionView.prototype, { 2995itemView : View, 2996itemViews : {}, 2997_reverseOrder : false, 2998_ensureElement : function() { 2999BackboneViewEnsureElement.call(this); 3000this.__render(); 3001this.getItemTemplate(); 3002}, 3003__ready : function() { 3004this.setCollection(this.collection); 3005this.ready(); 3006}, 3007getItemTemplate: function() { 3008if (!_.isEmpty(this.itemViews)) { 3009_.each(this.el.children, function( child ) { 3010var rel = child.getAttribute('data-relation'); 3011if (rel && this.itemViews[rel]) { 3012var template = child.innerHTML.trim(); 3013if ( this.itemViews[rel].prototype == View.prototype ) 3014this.itemViews[rel] = this.itemViews[rel].extend(); 3015_.extend(this.itemViews[rel].prototype, { 3016template : template, 3017tagName : child.tagName, 3018className : child.className, 3019attributes: _(child.attributes) 3020.chain() 3021.values() 3022.map(function( attr ) { 3023return attr.name; 3024}) 3025.object([]) 3026.mapObject(function( value, key ) { 3027return child.getAttribute(key); 3028}) 3029.value() 3030}); 3031} 3032}, this); 3033} 3034else { 3035var child = this.el.children[ 0 ]; 3036if ( child ) { 3037var template = child.innerHTML.trim(); 3038if ( this.itemView.prototype == View.prototype ) 3039this.itemView = this.itemView.extend(); 3040_.extend(this.itemView.prototype, { 3041template : template, 3042tagName : child.tagName, 3043className : child.className, 3044attributes: _(child.attributes) 3045.chain() 3046.values() 3047.map(function( attr ) { 3048return attr.name; 3049}) 3050.object([]) 3051.mapObject(function( value, key ) { 3052return child.getAttribute(key); 3053}) 3054.value() 3055}); 3056} 3057} 3058this.$el.empty(); 3059}, 3060setCollection : function( collection ) { 3061if ( !collection ) 3062return; 3063if ( this.collection ) { 3064this.stopListening(this.collection, 'add', this.reset); 3065this.stopListening(this.collection, 'reset', this.reset); 3066this.stopListening(this.collection, 'sort', this.reset); 3067this.trigger('unset:collection', this.collection); 3068} 3069this.collection = collection; 3070this.listenTo(this.collection, 'add', this.reset); 3071this.listenTo(this.collection, 'reset', this.reset); 3072this.listenTo(this.collection, 'sort', this.reset); 3073this.trigger('set:collection', this.collection); 3074this.reset(); 3075}, 3076add : function( model ) { 3077if ( this.previousSubViews[ model.cid ] ) { 3078var view = this.previousSubViews[ model.cid ]; 3079delete this.previousSubViews[ model.cid ]; 3080} 3081else { 3082var viewClass = this.itemView; 3083if (model.get('_rel') && this.itemViews[model.get('_rel')]) 3084viewClass = this.itemViews[model.get('_rel')]; 3085var view = new viewClass({ model: model }); 3086} 3087view.mid = model.cid; 3088this._reverseOrder ? 3089this.prependView(view) : 3090this.appendView(view); 3091return view; 3092}, 3093reset : function( models ) { 3094while ( this.subViews.length ) { 3095var view = this.subViews.pop(); 3096this.previousSubViews[ view.mid ] = view; 3097} 3098this.collection.each(this.add, this); 3099for ( var key in this.previousSubViews ) { 3100this.previousSubViews[ key ].$el.appendTo($reusableElements); 3101} 3102return this; 3103} 3104}) 3105_.setPrototypeOf(CollectionView, View.prototype); 3106CollectionView.extend = View.extend; 3107return CollectionView; 3108}() 3109/* --- Data Binder --- */ 3110DataBinder = B.DataBind = function() { 3111var bindingRegex = (/(?:(\w+):)?({.*}|[^;]+);?/ig); 3112var parseb = function parseBindingString( string ) { 3113var bindRegex = (/\s*(\w+)\s*:\s*([^,{]+(?!\()|\{(.+)\},(?=\s*\w)|\w+\(.+\)),?/g); 3114var match, obj = Object.create(null, {}); 3115var string = string 3116.replace(/\s+/, ' ') 3117.replace(/(.*)\}$/, '$1},a'); 3118while ( match = bindRegex.exec(string) ) { 3119var key = match[ 1 ], 3120value = match[ 2 ], 3121nestedValues = match[ 3 ]; 3122if ( nestedValues ) 3123value = parseBindingString(nestedValues); 3124obj[ key ] = value; 3125} 3126return obj; 3127}; 3128function DataBinder( view, models, options ) { 3129if ( this instanceof DataBinder === false ) 3130return new DataBinder(view, models, options);
3131options || (options = {}); 3132this.options = _(options).defaults({ 3133bindings: [] 3134}); 3135this.view = null; 3136this.models = []; 3137this.bindings = []; 3138_.bindAll(this, 3139'inputEventHandler', 3140'changeEventHandler' 3141); 3142this.setupView(view); 3143this.setModel(models); 3144return this; 3145}; 3146_.setPrototypeOf(DataBinder, BackboneEvents); 3147_.extend(DataBinder.prototype, { 3148setModel: function( models ) { 3149var self = this; 3150_(self.models).each(function( model ) { 3151self.stopListening(model); 3152}, self); 3153self.models = _.filter(_.isArray(models) ? models : [ models ], function( model ) { 3154return model instanceof BackboneModel; 3155}); 3156_(self.models).each(function( model ) { 3157_.each(self.bindingsIndex, function( bindings, attr ) { 3158self.listenTo(model, 'change:' + attr, function( model, value, options ) { 3159self.updateView(attr) 3160}); 3161}) 3162}, self); 3163self.updateView(); 3164self.trigger('set:models', self.models) 3165return this; 3166}, 3167setupView : function( view ) { 3168if ( view instanceof Backbone.View == false ) 3169return false; 3170_(this.bindings).each(function( binding ) { 3171binding.$el.off(binding.events || 'change', this.changeEventHandler); 3172}, this); 3173var self = this; 3174var binding, $children, matched, type, value; 3175this.view = view; 3176this.bindings = []; 3177this.bindingsIndex = {}; 3178_(this.options.bindings).each(function( opt ) { 3179$children = view.$(opt.selector); 3180($children.length ? $children : view.$el).each(function( index, el ) { 3181_(_.isString(opt.attr) ? [ opt.attr ] : opt.attr).each(function( attribute, key ) { 3182binding = _({ 3183$el : $(el), 3184el : el, 3185type: opt.type, 3186attr: attribute 3187}).defaults(opt); 3188if ( _.isString(key) ) 3189binding.key = key; 3190self.bindings.push(binding); 3191boundAttributes = [ binding.attr ]; 3192_(boundAttributes).each(function( attr ) { 3193self.bindingsIndex[ attr ] || (self.bindingsIndex[ attr ] = []); 3194self.bindingsIndex[ attr ].indexOf(binding) == -1 && self.bindingsIndex[ attr ].push(binding); 3195}); 3196}); 3197}); 3198}); 3199var hasBindingEl; 3200if ( view.$el.attr('data-bind') ) 3201parseBinding(view.el); 3202while ( hasBindingEl = view.el.querySelector('[data-bind]') ) 3203parseBinding(hasBindingEl); 3204function parseBinding( el ) { 3205var $el = $(el); 3206var syntax = ($el.attr('data-bind') || '').replace(/\s+/g, ''); 3207bindingRegex.lastIndex = 0; 3208$el.removeAttr('data-bind'); 3209matching : while ( matched = bindingRegex.exec(syntax) ) { 3210type = matched[ 1 ]; 3211value = matched[ 2 ]; 3212if ( !type ) 3213if ( $el.is('input[type="checkbox"]') ) 3214type = 'checked'; 3215else if ( $el.is('input[type="radio"]') ) 3216type = 'radio'; 3217else if ( $el.is('input,select,textarea') ) 3218type = 'value'; 3219else if ( $el.is('[contenteditable]') ) 3220type = 'html'; 3221else 3222type = 'text'; 3223if ( type == 'model' ) { 3224_.defer(function( view, value, template ) { 3225var childView = view[ value + 'View' ] = new View({ 3226el: el, 3227template: template 3228}); 3229view.on('set:model', function() { 3230var model = value == 'this' || value == '$model' ? view.model : view.model.get(value); 3231childView.setModel(model); 3232}); 3233view.model && view.trigger('set:model', view.model); 3234}, view, value, el.innerHTML); 3235el.innerHTML = ''; 3236continue matching; 3237} 3238if ( type == 'collection' ) { 3239_.defer(function( view, value, template ) { 3240var childView = view[ value + 'View' ] = new CollectionView({ 3241el : el, 3242template: template 3243}); 3244if (value == 'this' || value == '$collection') { 3245view.on('set:collection', function() { 3246childView.setCollection(view.collection); 3247}) 3248view.collection && view.trigger('set:collection', view.collection); 3249} 3250else { 3251view.on('set:model', function() { 3252childView.setCollection(view.model.get(value)); 3253}); 3254view.model && view.trigger('set:model', view.model); 3255} 3256}, view, value, el.innerHTML); 3257el.innerHTML = ''; 3258continue matching; 3259} 3260nested = value.match(/{(.*)}/); 3261value = nested ? nested[ 1 ] : value; 3262_(nested ? nested[ 1 ].split(',') : [ value ]).each(function( string ) { 3263split = string.split(':'); 3264binding = { 3265$el : $el, 3266el : el, 3267type: type, 3268attr: split.length == 1 ? split[ 0 ] : split[ 1 ] 3269} 3270if ( split.length == 2 ) 3271binding.key = split[ 0 ]; 3272if ( $el.data('bind-events') ) 3273binding.events = $el.data('bind-events'); 3274self.bindings.push(binding); 3275boundAttributes = [ binding.attr ]; 3276_(boundAttributes).each(function( attr ) { 3277self.bindingsIndex[ attr ] || (self.bindingsIndex[ attr ] = []); 3278self.bindingsIndex[ attr ].indexOf(binding) == -1 && self.bindingsIndex[ attr ].push(binding); 3279}); 3280}); 3281} 3282} 3283_(this.bindings).each(function( binding ) { 3284binding.$el.on(binding.events || 'change', { binding: binding }, this.changeEventHandler); 3285binding.$el 3286.removeAttr('data-bind') 3287.removeAttr('data-bind-events'); 3288}, this); 3289}, 3290updateView: function( attr ) { 3291var self = this; 3292var value, originalValue, setter; 3293_(attr ? self.bindingsIndex[ attr ] : self.bindings).each(function( binding ) { 3294value = self.getData(binding.attr); 3295if ( value instanceof BackboneModel || value instanceof BackboneCollection ) { 3296originalValue = value; 3297value = value.toJSON(); 3298} 3299setter = binding.set || self.setters[ binding.type ] || null; 3300if ( setter ) { 3301if ( _.isFunction(binding.parse) ) 3302value = binding.parse.call(binding, value, binding.key, self.view); 3303setter(binding.$el, value, binding.key); 3304} 3305}); 3306}, 3307setters: { 3308text : function( $el, value ) { 3309($el.text() === value) || $el.text(_.isUndefined(value) ? ' ' : value); 3310}, 3311html : function( $el, value ) { 3312($el.html() === value) || $el.html(_.isUndefined(value) ? ' ' : value); 3313}, 3314value : function( $el, value ) { 3315($el.val() === value) || $el.val(_.isUndefined(value) ? ' ' : value); 3316}, 3317attr : function( $el, value, key ) { 3318if ( !key ) return; 3319$el.attr(key, value); 3320}, 3321prop : function( $el, value, key ) { 3322if ( !key ) return; 3323$el.prop(key, value); 3324}, 3325style : function( $el, value, key ) { 3326key ? $el.css(key, value) : $el.css(value || {}); 3327}, 3328class : function( $el, value, key ) { 3329$el[ value ? 'addClass' : 'removeClass' ](key); 3330}, 3331checked : function( $el, value ) { 3332$el.attr('checked', value); 3333}, 3334radio : function( $el, value ) { 3335$el.attr('checked', $el.val() == value ? true : false ); 3336}, 3337enabled : function( $el, value ) { 3338$el.attr('disabled', !value); 3339}, 3340disabled: function( $el, value ) { 3341$el.attr('disabled', value); 3342}, 3343toggle : function( $el, value ) { 3344$el.toggle(value); 3345}, 3346visible : function( $el, value ) { 3347$el.toggle(!!value); 3348}, 3349hidden : function( $el, value ) { 3350$el.toggle(!value); 3351}, 3352}, 3353getters: { 3354text : function( $el ) { 3355return $el.text(); 3356}, 3357html : function( $el ) { 3358return $el.html(); 3359}, 3360value : function( $el ) { 3361var value = $el.val(); 3362if ( $el.is('input[type="number"],input[type="range"]') ) { 3363value = parseFloat(value); 3364if(_.isNaN(value) ) value = ''; 3365} 3366return value 3367}, 3368checked: function( $el ) { 3369return $el.prop('checked'); 3370}, 3371radio: function( $el ) { 3372return $el.prop('checked') ? $el.val() : undefined; 3373}, 3374}, 3375getData: function( key ) { 3376var values = []; 3377_.each(this.models, function( model ) { 3378var value = model.get(key); 3379values.indexOf(value) == -1 && values.push(value); 3380}); 3381return values.length < 2 ? values[ 0 ] : '-'; 3382}, 3383setData: function( key, value ) { 3384_.invoke(this.models, 'set', key, value); 3385}, 3386inputEventHandler : function( e ) { 3387return; 3388if ( e.data && e.data.binding && e.data.binding.$el.is(e.currentTarget) ) { 3389var binding = e.data.binding; 3390if ( this.getters[ binding.type ] ) { 3391var value = this.getters[ binding.type ](binding.$el); 3392console.log(value) 3393_.invoke(this.models, 'trigger', 'input', binding.attr, value); 3394_.invoke(this.models, 'trigger', 'input:' + binding.attr, value); 3395} 3396} 3397}, 3398changeEventHandler: function( e ) { 3399if ( e.data && e.data.binding && e.data.binding.$el.is(e.currentTarget) ) { 3400var binding = e.data.binding; 3401if ( this.getters[ binding.type ] ) { 3402var value = this.getters[ binding.type ](binding.$el, e); 3403value === undefined || this.setData( binding.attr, value ); 3404} 3405} 3406} 3407}); 3408return DataBinder; 3409}(); 3410return B; 3411});; 3412 3413/* FILE: /home/strato/http/power/rid/48/01/51344801/htdocs/joomla_02//plugins/system/easyslider/assets/js/conflict.js */ 3414var JSNES_Underscore = _; 3415var JSNES_jQuery = jQuery; 3416// 3417var JSNES_Backbone = Backbone;;
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.