From 6d1d77adb5b919f205e4c2221ca575d83934e449 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dirk=20L=C3=BCth?= Date: Wed, 5 Aug 2015 12:59:40 +0200 Subject: [PATCH] [UPDATE] building 3.7.3 --- dist/3.7.2/min/base.js | 2 - dist/{3.7.2 => 3.7.3}/max/asset.js | 2 +- dist/{3.7.2 => 3.7.3}/max/base.js | 15 +- .../max/component/iterator.js | 2 +- dist/{3.7.2 => 3.7.3}/max/component/remux.js | 2 +- dist/{3.7.2 => 3.7.3}/max/component/sense.js | 2 +- dist/{3.7.2 => 3.7.3}/max/dom/collection.js | 2 +- dist/{3.7.2 => 3.7.3}/max/dom/element.js | 2 +- .../max/dom/element/emerge.js | 2 +- .../max/dom/element/lazyimage.js | 2 +- .../max/dom/element/shrinkimage.js | 2 +- dist/{3.7.2 => 3.7.3}/max/dom/event.js | 2 +- dist/{3.7.2 => 3.7.3}/max/emitter.js | 2 +- .../{3.7.2 => 3.7.3}/max/function/load/css.js | 2 +- dist/{3.7.2 => 3.7.3}/max/function/merge.js | 2 +- .../max/function/proximity.js | 2 +- .../max/function/unique/string.js | 2 +- .../max/function/unique/uuid.js | 2 +- dist/{3.7.2 => 3.7.3}/max/hook/css.js | 2 +- dist/{3.7.2 => 3.7.3}/max/hook/event.js | 2 +- .../max/jquery/extension/selector.js | 2 +- .../max/jquery/function/prefetch.js | 2 +- .../max/jquery/plugin/emerge.js | 2 +- .../max/jquery/plugin/lazyimage.js | 2 +- .../max/jquery/plugin/shrinkimage.js | 2 +- dist/3.7.3/max/packages/qoopido.base.js | 115 + .../3.7.3/max/packages/qoopido.base.legacy.js | 286 +++ dist/3.7.3/max/packages/qoopido.emerge.js | 1453 ++++++++++++ .../max/packages/qoopido.emerge.legacy.js | 1649 ++++++++++++++ dist/3.7.3/max/packages/qoopido.emitter.js | 201 ++ .../max/packages/qoopido.emitter.legacy.js | 372 +++ dist/3.7.3/max/packages/qoopido.lazyimage.js | 1489 +++++++++++++ .../max/packages/qoopido.lazyimage.legacy.js | 1685 ++++++++++++++ dist/3.7.3/max/packages/qoopido.remux.js | 519 +++++ .../max/packages/qoopido.remux.legacy.js | 715 ++++++ dist/3.7.3/max/packages/qoopido.sense.js | 420 ++++ .../max/packages/qoopido.sense.legacy.js | 616 +++++ .../3.7.3/max/packages/qoopido.shrinkimage.js | 1789 +++++++++++++++ .../packages/qoopido.shrinkimage.legacy.js | 1985 +++++++++++++++++ dist/{3.7.2 => 3.7.3}/max/particle.js | 2 +- .../max/polyfill/array/indexof.js | 2 +- .../document/getelementsbyclassname.js | 2 +- .../max/polyfill/document/queryselector.js | 2 +- .../max/polyfill/document/queryselectorall.js | 2 +- .../max/polyfill/element/matches.js | 2 +- .../max/polyfill/object/create.js | 2 +- .../max/polyfill/object/defineproperties.js | 2 +- .../max/polyfill/object/defineproperty.js | 2 +- .../object/getownpropertydescriptor.js | 2 +- .../polyfill/object/getownpropertynames.js | 2 +- .../max/polyfill/object/getprototypeof.js | 2 +- .../max/polyfill/object/keys.js | 2 +- .../max/polyfill/string/lcfirst.js | 2 +- .../max/polyfill/string/trim.js | 2 +- .../max/polyfill/string/ucfirst.js | 2 +- .../max/polyfill/window/addeventlistener.js | 2 +- .../max/polyfill/window/customevent.js | 2 +- .../max/polyfill/window/dispatchevent.js | 2 +- .../max/polyfill/window/getcomputedstyle.js | 2 +- .../max/polyfill/window/matchmedia.js | 2 +- .../max/polyfill/window/promise.js | 2 +- .../polyfill/window/removeeventlistener.js | 2 +- dist/{3.7.2 => 3.7.3}/max/pool.js | 2 +- dist/{3.7.2 => 3.7.3}/max/pool/array.js | 2 +- dist/{3.7.2 => 3.7.3}/max/pool/dom.js | 2 +- dist/{3.7.2 => 3.7.3}/max/pool/module.js | 2 +- dist/{3.7.2 => 3.7.3}/max/pool/object.js | 2 +- dist/{3.7.2 => 3.7.3}/max/promise/all.js | 2 +- dist/{3.7.2 => 3.7.3}/max/promise/defer.js | 2 +- dist/{3.7.2 => 3.7.3}/max/promise/race.js | 2 +- dist/{3.7.2 => 3.7.3}/max/proxy.js | 2 +- dist/{3.7.2 => 3.7.3}/max/renderer.js | 2 +- dist/{3.7.2 => 3.7.3}/max/support.js | 2 +- .../max/support/capability/datauri.js | 2 +- .../max/support/capability/touch.js | 2 +- .../max/support/css/borderradius.js | 2 +- .../max/support/css/boxshadow.js | 2 +- dist/{3.7.2 => 3.7.3}/max/support/css/rem.js | 2 +- dist/{3.7.2 => 3.7.3}/max/support/css/rgba.js | 2 +- .../max/support/css/textshadow.js | 2 +- .../max/support/css/transform.js | 2 +- .../max/support/css/transform/2d.js | 2 +- .../max/support/css/transform/3d.js | 2 +- .../max/support/css/transition.js | 2 +- .../max/support/element/canvas.js | 2 +- .../max/support/element/canvas/todataurl.js | 2 +- .../support/element/canvas/todataurl/jpeg.js | 2 +- .../support/element/canvas/todataurl/png.js | 2 +- .../support/element/canvas/todataurl/webp.js | 2 +- .../max/support/element/svg.js | 2 +- .../max/support/element/video.js | 2 +- .../max/support/element/video/mp4.js | 2 +- .../max/support/element/video/ogg.js | 2 +- .../max/support/element/video/webm.js | 2 +- dist/{3.7.2 => 3.7.3}/max/transport.js | 2 +- dist/{3.7.2 => 3.7.3}/max/transport/jsonp.js | 2 +- dist/{3.7.2 => 3.7.3}/max/transport/xhr.js | 2 +- dist/{3.7.2 => 3.7.3}/max/url.js | 2 +- dist/{3.7.2 => 3.7.3}/max/vector/2d.js | 2 +- .../max/widget/image/adapt.js | 2 +- dist/{3.7.2 => 3.7.3}/max/worker.js | 2 +- dist/{3.7.2 => 3.7.3}/min/asset.js | 2 +- dist/3.7.3/min/base.js | 2 + .../min/component/iterator.js | 2 +- dist/{3.7.2 => 3.7.3}/min/component/remux.js | 2 +- dist/{3.7.2 => 3.7.3}/min/component/sense.js | 2 +- dist/{3.7.2 => 3.7.3}/min/dom/collection.js | 2 +- dist/{3.7.2 => 3.7.3}/min/dom/element.js | 2 +- .../min/dom/element/emerge.js | 2 +- .../min/dom/element/lazyimage.js | 2 +- .../min/dom/element/shrinkimage.js | 2 +- dist/{3.7.2 => 3.7.3}/min/dom/event.js | 2 +- dist/{3.7.2 => 3.7.3}/min/emitter.js | 2 +- .../{3.7.2 => 3.7.3}/min/function/load/css.js | 2 +- dist/{3.7.2 => 3.7.3}/min/function/merge.js | 2 +- .../min/function/proximity.js | 2 +- .../min/function/unique/string.js | 2 +- .../min/function/unique/uuid.js | 2 +- dist/{3.7.2 => 3.7.3}/min/hook/css.js | 2 +- dist/{3.7.2 => 3.7.3}/min/hook/event.js | 2 +- .../min/jquery/extension/selector.js | 2 +- .../min/jquery/function/prefetch.js | 2 +- .../min/jquery/plugin/emerge.js | 2 +- .../min/jquery/plugin/lazyimage.js | 2 +- .../min/jquery/plugin/shrinkimage.js | 2 +- dist/3.7.3/min/packages/qoopido.base.js | 2 + .../3.7.3/min/packages/qoopido.base.legacy.js | 2 + dist/3.7.3/min/packages/qoopido.emerge.js | 2 + .../min/packages/qoopido.emerge.legacy.js | 2 + dist/3.7.3/min/packages/qoopido.emitter.js | 2 + .../min/packages/qoopido.emitter.legacy.js | 2 + dist/3.7.3/min/packages/qoopido.lazyimage.js | 2 + .../min/packages/qoopido.lazyimage.legacy.js | 2 + dist/3.7.3/min/packages/qoopido.remux.js | 2 + .../min/packages/qoopido.remux.legacy.js | 2 + dist/3.7.3/min/packages/qoopido.sense.js | 2 + .../min/packages/qoopido.sense.legacy.js | 2 + .../3.7.3/min/packages/qoopido.shrinkimage.js | 2 + .../packages/qoopido.shrinkimage.legacy.js | 3 + dist/{3.7.2 => 3.7.3}/min/particle.js | 2 +- .../min/polyfill/array/indexof.js | 2 +- .../document/getelementsbyclassname.js | 2 +- .../min/polyfill/document/queryselector.js | 2 +- .../min/polyfill/document/queryselectorall.js | 2 +- .../min/polyfill/element/matches.js | 2 +- .../min/polyfill/object/create.js | 2 +- .../min/polyfill/object/defineproperties.js | 2 +- .../min/polyfill/object/defineproperty.js | 2 +- .../object/getownpropertydescriptor.js | 2 +- .../polyfill/object/getownpropertynames.js | 2 +- .../min/polyfill/object/getprototypeof.js | 2 +- .../min/polyfill/object/keys.js | 2 +- .../min/polyfill/string/lcfirst.js | 2 +- .../min/polyfill/string/trim.js | 2 +- .../min/polyfill/string/ucfirst.js | 2 +- .../min/polyfill/window/addeventlistener.js | 2 +- .../min/polyfill/window/customevent.js | 2 +- .../min/polyfill/window/dispatchevent.js | 2 +- .../min/polyfill/window/getcomputedstyle.js | 2 +- .../min/polyfill/window/matchmedia.js | 2 +- .../min/polyfill/window/promise.js | 2 +- .../polyfill/window/removeeventlistener.js | 2 +- dist/{3.7.2 => 3.7.3}/min/pool.js | 2 +- dist/{3.7.2 => 3.7.3}/min/pool/array.js | 2 +- dist/{3.7.2 => 3.7.3}/min/pool/dom.js | 2 +- dist/{3.7.2 => 3.7.3}/min/pool/module.js | 2 +- dist/{3.7.2 => 3.7.3}/min/pool/object.js | 2 +- dist/{3.7.2 => 3.7.3}/min/promise/all.js | 2 +- dist/{3.7.2 => 3.7.3}/min/promise/defer.js | 2 +- dist/{3.7.2 => 3.7.3}/min/promise/race.js | 2 +- dist/{3.7.2 => 3.7.3}/min/proxy.js | 2 +- dist/{3.7.2 => 3.7.3}/min/renderer.js | 2 +- dist/{3.7.2 => 3.7.3}/min/support.js | 2 +- .../min/support/capability/datauri.js | 2 +- .../min/support/capability/touch.js | 2 +- .../min/support/css/borderradius.js | 2 +- .../min/support/css/boxshadow.js | 2 +- dist/{3.7.2 => 3.7.3}/min/support/css/rem.js | 2 +- dist/{3.7.2 => 3.7.3}/min/support/css/rgba.js | 2 +- .../min/support/css/textshadow.js | 2 +- .../min/support/css/transform.js | 2 +- .../min/support/css/transform/2d.js | 2 +- .../min/support/css/transform/3d.js | 2 +- .../min/support/css/transition.js | 2 +- .../min/support/element/canvas.js | 2 +- .../min/support/element/canvas/todataurl.js | 2 +- .../support/element/canvas/todataurl/jpeg.js | 2 +- .../support/element/canvas/todataurl/png.js | 2 +- .../support/element/canvas/todataurl/webp.js | 2 +- .../min/support/element/svg.js | 2 +- .../min/support/element/video.js | 2 +- .../min/support/element/video/mp4.js | 2 +- .../min/support/element/video/ogg.js | 2 +- .../min/support/element/video/webm.js | 2 +- dist/{3.7.2 => 3.7.3}/min/transport.js | 2 +- dist/{3.7.2 => 3.7.3}/min/transport/jsonp.js | 2 +- dist/{3.7.2 => 3.7.3}/min/transport/xhr.js | 2 +- dist/{3.7.2 => 3.7.3}/min/url.js | 2 +- dist/{3.7.2 => 3.7.3}/min/vector/2d.js | 2 +- .../min/widget/image/adapt.js | 2 +- dist/{3.7.2 => 3.7.3}/min/worker.js | 2 +- dist/latest/max/asset.js | 2 +- dist/latest/max/base.js | 15 +- dist/latest/max/component/iterator.js | 2 +- dist/latest/max/component/remux.js | 2 +- dist/latest/max/component/sense.js | 2 +- dist/latest/max/dom/collection.js | 2 +- dist/latest/max/dom/element.js | 2 +- dist/latest/max/dom/element/emerge.js | 2 +- dist/latest/max/dom/element/lazyimage.js | 2 +- dist/latest/max/dom/element/shrinkimage.js | 2 +- dist/latest/max/dom/event.js | 2 +- dist/latest/max/emitter.js | 2 +- dist/latest/max/function/load/css.js | 2 +- dist/latest/max/function/merge.js | 2 +- dist/latest/max/function/proximity.js | 2 +- dist/latest/max/function/unique/string.js | 2 +- dist/latest/max/function/unique/uuid.js | 2 +- dist/latest/max/hook/css.js | 2 +- dist/latest/max/hook/event.js | 2 +- dist/latest/max/jquery/extension/selector.js | 2 +- dist/latest/max/jquery/function/prefetch.js | 2 +- dist/latest/max/jquery/plugin/emerge.js | 2 +- dist/latest/max/jquery/plugin/lazyimage.js | 2 +- dist/latest/max/jquery/plugin/shrinkimage.js | 2 +- dist/latest/max/packages/qoopido.base.js | 115 + .../max/packages/qoopido.base.legacy.js | 286 +++ dist/latest/max/packages/qoopido.emerge.js | 1453 ++++++++++++ .../max/packages/qoopido.emerge.legacy.js | 1649 ++++++++++++++ dist/latest/max/packages/qoopido.emitter.js | 201 ++ .../max/packages/qoopido.emitter.legacy.js | 372 +++ dist/latest/max/packages/qoopido.lazyimage.js | 1489 +++++++++++++ .../max/packages/qoopido.lazyimage.legacy.js | 1685 ++++++++++++++ dist/latest/max/packages/qoopido.remux.js | 519 +++++ .../max/packages/qoopido.remux.legacy.js | 715 ++++++ dist/latest/max/packages/qoopido.sense.js | 420 ++++ .../max/packages/qoopido.sense.legacy.js | 616 +++++ .../max/packages/qoopido.shrinkimage.js | 1789 +++++++++++++++ .../packages/qoopido.shrinkimage.legacy.js | 1985 +++++++++++++++++ dist/latest/max/particle.js | 2 +- dist/latest/max/polyfill/array/indexof.js | 2 +- .../document/getelementsbyclassname.js | 2 +- .../max/polyfill/document/queryselector.js | 2 +- .../max/polyfill/document/queryselectorall.js | 2 +- dist/latest/max/polyfill/element/matches.js | 2 +- dist/latest/max/polyfill/object/create.js | 2 +- .../max/polyfill/object/defineproperties.js | 2 +- .../max/polyfill/object/defineproperty.js | 2 +- .../object/getownpropertydescriptor.js | 2 +- .../polyfill/object/getownpropertynames.js | 2 +- .../max/polyfill/object/getprototypeof.js | 2 +- dist/latest/max/polyfill/object/keys.js | 2 +- dist/latest/max/polyfill/string/lcfirst.js | 2 +- dist/latest/max/polyfill/string/trim.js | 2 +- dist/latest/max/polyfill/string/ucfirst.js | 2 +- .../max/polyfill/window/addeventlistener.js | 2 +- .../latest/max/polyfill/window/customevent.js | 2 +- .../max/polyfill/window/dispatchevent.js | 2 +- .../max/polyfill/window/getcomputedstyle.js | 2 +- dist/latest/max/polyfill/window/matchmedia.js | 2 +- dist/latest/max/polyfill/window/promise.js | 2 +- .../polyfill/window/removeeventlistener.js | 2 +- dist/latest/max/pool.js | 2 +- dist/latest/max/pool/array.js | 2 +- dist/latest/max/pool/dom.js | 2 +- dist/latest/max/pool/module.js | 2 +- dist/latest/max/pool/object.js | 2 +- dist/latest/max/promise/all.js | 2 +- dist/latest/max/promise/defer.js | 2 +- dist/latest/max/promise/race.js | 2 +- dist/latest/max/proxy.js | 2 +- dist/latest/max/renderer.js | 2 +- dist/latest/max/support.js | 2 +- dist/latest/max/support/capability/datauri.js | 2 +- dist/latest/max/support/capability/touch.js | 2 +- dist/latest/max/support/css/borderradius.js | 2 +- dist/latest/max/support/css/boxshadow.js | 2 +- dist/latest/max/support/css/rem.js | 2 +- dist/latest/max/support/css/rgba.js | 2 +- dist/latest/max/support/css/textshadow.js | 2 +- dist/latest/max/support/css/transform.js | 2 +- dist/latest/max/support/css/transform/2d.js | 2 +- dist/latest/max/support/css/transform/3d.js | 2 +- dist/latest/max/support/css/transition.js | 2 +- dist/latest/max/support/element/canvas.js | 2 +- .../max/support/element/canvas/todataurl.js | 2 +- .../support/element/canvas/todataurl/jpeg.js | 2 +- .../support/element/canvas/todataurl/png.js | 2 +- .../support/element/canvas/todataurl/webp.js | 2 +- dist/latest/max/support/element/svg.js | 2 +- dist/latest/max/support/element/video.js | 2 +- dist/latest/max/support/element/video/mp4.js | 2 +- dist/latest/max/support/element/video/ogg.js | 2 +- dist/latest/max/support/element/video/webm.js | 2 +- dist/latest/max/transport.js | 2 +- dist/latest/max/transport/jsonp.js | 2 +- dist/latest/max/transport/xhr.js | 2 +- dist/latest/max/url.js | 2 +- dist/latest/max/vector/2d.js | 2 +- dist/latest/max/widget/image/adapt.js | 2 +- dist/latest/max/worker.js | 2 +- dist/latest/min/asset.js | 2 +- dist/latest/min/base.js | 4 +- dist/latest/min/component/iterator.js | 2 +- dist/latest/min/component/remux.js | 2 +- dist/latest/min/component/sense.js | 2 +- dist/latest/min/dom/collection.js | 2 +- dist/latest/min/dom/element.js | 2 +- dist/latest/min/dom/element/emerge.js | 2 +- dist/latest/min/dom/element/lazyimage.js | 2 +- dist/latest/min/dom/element/shrinkimage.js | 2 +- dist/latest/min/dom/event.js | 2 +- dist/latest/min/emitter.js | 2 +- dist/latest/min/function/load/css.js | 2 +- dist/latest/min/function/merge.js | 2 +- dist/latest/min/function/proximity.js | 2 +- dist/latest/min/function/unique/string.js | 2 +- dist/latest/min/function/unique/uuid.js | 2 +- dist/latest/min/hook/css.js | 2 +- dist/latest/min/hook/event.js | 2 +- dist/latest/min/jquery/extension/selector.js | 2 +- dist/latest/min/jquery/function/prefetch.js | 2 +- dist/latest/min/jquery/plugin/emerge.js | 2 +- dist/latest/min/jquery/plugin/lazyimage.js | 2 +- dist/latest/min/jquery/plugin/shrinkimage.js | 2 +- dist/latest/min/packages/qoopido.base.js | 2 + .../min/packages/qoopido.base.legacy.js | 2 + dist/latest/min/packages/qoopido.emerge.js | 2 + .../min/packages/qoopido.emerge.legacy.js | 2 + dist/latest/min/packages/qoopido.emitter.js | 2 + .../min/packages/qoopido.emitter.legacy.js | 2 + dist/latest/min/packages/qoopido.lazyimage.js | 2 + .../min/packages/qoopido.lazyimage.legacy.js | 2 + dist/latest/min/packages/qoopido.remux.js | 2 + .../min/packages/qoopido.remux.legacy.js | 2 + dist/latest/min/packages/qoopido.sense.js | 2 + .../min/packages/qoopido.sense.legacy.js | 2 + .../min/packages/qoopido.shrinkimage.js | 2 + .../packages/qoopido.shrinkimage.legacy.js | 3 + dist/latest/min/particle.js | 2 +- dist/latest/min/polyfill/array/indexof.js | 2 +- .../document/getelementsbyclassname.js | 2 +- .../min/polyfill/document/queryselector.js | 2 +- .../min/polyfill/document/queryselectorall.js | 2 +- dist/latest/min/polyfill/element/matches.js | 2 +- dist/latest/min/polyfill/object/create.js | 2 +- .../min/polyfill/object/defineproperties.js | 2 +- .../min/polyfill/object/defineproperty.js | 2 +- .../object/getownpropertydescriptor.js | 2 +- .../polyfill/object/getownpropertynames.js | 2 +- .../min/polyfill/object/getprototypeof.js | 2 +- dist/latest/min/polyfill/object/keys.js | 2 +- dist/latest/min/polyfill/string/lcfirst.js | 2 +- dist/latest/min/polyfill/string/trim.js | 2 +- dist/latest/min/polyfill/string/ucfirst.js | 2 +- .../min/polyfill/window/addeventlistener.js | 2 +- .../latest/min/polyfill/window/customevent.js | 2 +- .../min/polyfill/window/dispatchevent.js | 2 +- .../min/polyfill/window/getcomputedstyle.js | 2 +- dist/latest/min/polyfill/window/matchmedia.js | 2 +- dist/latest/min/polyfill/window/promise.js | 2 +- .../polyfill/window/removeeventlistener.js | 2 +- dist/latest/min/pool.js | 2 +- dist/latest/min/pool/array.js | 2 +- dist/latest/min/pool/dom.js | 2 +- dist/latest/min/pool/module.js | 2 +- dist/latest/min/pool/object.js | 2 +- dist/latest/min/promise/all.js | 2 +- dist/latest/min/promise/defer.js | 2 +- dist/latest/min/promise/race.js | 2 +- dist/latest/min/proxy.js | 2 +- dist/latest/min/renderer.js | 2 +- dist/latest/min/support.js | 2 +- dist/latest/min/support/capability/datauri.js | 2 +- dist/latest/min/support/capability/touch.js | 2 +- dist/latest/min/support/css/borderradius.js | 2 +- dist/latest/min/support/css/boxshadow.js | 2 +- dist/latest/min/support/css/rem.js | 2 +- dist/latest/min/support/css/rgba.js | 2 +- dist/latest/min/support/css/textshadow.js | 2 +- dist/latest/min/support/css/transform.js | 2 +- dist/latest/min/support/css/transform/2d.js | 2 +- dist/latest/min/support/css/transform/3d.js | 2 +- dist/latest/min/support/css/transition.js | 2 +- dist/latest/min/support/element/canvas.js | 2 +- .../min/support/element/canvas/todataurl.js | 2 +- .../support/element/canvas/todataurl/jpeg.js | 2 +- .../support/element/canvas/todataurl/png.js | 2 +- .../support/element/canvas/todataurl/webp.js | 2 +- dist/latest/min/support/element/svg.js | 2 +- dist/latest/min/support/element/video.js | 2 +- dist/latest/min/support/element/video/mp4.js | 2 +- dist/latest/min/support/element/video/ogg.js | 2 +- dist/latest/min/support/element/video/webm.js | 2 +- dist/latest/min/transport.js | 2 +- dist/latest/min/transport/jsonp.js | 2 +- dist/latest/min/transport/xhr.js | 2 +- dist/latest/min/url.js | 2 +- dist/latest/min/vector/2d.js | 2 +- dist/latest/min/widget/image/adapt.js | 2 +- dist/latest/min/worker.js | 2 +- package.json | 2 +- 402 files changed, 27005 insertions(+), 361 deletions(-) delete mode 100644 dist/3.7.2/min/base.js rename dist/{3.7.2 => 3.7.3}/max/asset.js (99%) rename dist/{3.7.2 => 3.7.3}/max/base.js (87%) rename dist/{3.7.2 => 3.7.3}/max/component/iterator.js (99%) rename dist/{3.7.2 => 3.7.3}/max/component/remux.js (99%) rename dist/{3.7.2 => 3.7.3}/max/component/sense.js (98%) rename dist/{3.7.2 => 3.7.3}/max/dom/collection.js (99%) rename dist/{3.7.2 => 3.7.3}/max/dom/element.js (99%) rename dist/{3.7.2 => 3.7.3}/max/dom/element/emerge.js (99%) rename dist/{3.7.2 => 3.7.3}/max/dom/element/lazyimage.js (99%) rename dist/{3.7.2 => 3.7.3}/max/dom/element/shrinkimage.js (99%) rename dist/{3.7.2 => 3.7.3}/max/dom/event.js (99%) rename dist/{3.7.2 => 3.7.3}/max/emitter.js (99%) rename dist/{3.7.2 => 3.7.3}/max/function/load/css.js (98%) rename dist/{3.7.2 => 3.7.3}/max/function/merge.js (98%) rename dist/{3.7.2 => 3.7.3}/max/function/proximity.js (98%) rename dist/{3.7.2 => 3.7.3}/max/function/unique/string.js (98%) rename dist/{3.7.2 => 3.7.3}/max/function/unique/uuid.js (98%) rename dist/{3.7.2 => 3.7.3}/max/hook/css.js (99%) rename dist/{3.7.2 => 3.7.3}/max/hook/event.js (99%) rename dist/{3.7.2 => 3.7.3}/max/jquery/extension/selector.js (99%) rename dist/{3.7.2 => 3.7.3}/max/jquery/function/prefetch.js (98%) rename dist/{3.7.2 => 3.7.3}/max/jquery/plugin/emerge.js (98%) rename dist/{3.7.2 => 3.7.3}/max/jquery/plugin/lazyimage.js (98%) rename dist/{3.7.2 => 3.7.3}/max/jquery/plugin/shrinkimage.js (99%) create mode 100644 dist/3.7.3/max/packages/qoopido.base.js create mode 100644 dist/3.7.3/max/packages/qoopido.base.legacy.js create mode 100644 dist/3.7.3/max/packages/qoopido.emerge.js create mode 100644 dist/3.7.3/max/packages/qoopido.emerge.legacy.js create mode 100644 dist/3.7.3/max/packages/qoopido.emitter.js create mode 100644 dist/3.7.3/max/packages/qoopido.emitter.legacy.js create mode 100644 dist/3.7.3/max/packages/qoopido.lazyimage.js create mode 100644 dist/3.7.3/max/packages/qoopido.lazyimage.legacy.js create mode 100644 dist/3.7.3/max/packages/qoopido.remux.js create mode 100644 dist/3.7.3/max/packages/qoopido.remux.legacy.js create mode 100644 dist/3.7.3/max/packages/qoopido.sense.js create mode 100644 dist/3.7.3/max/packages/qoopido.sense.legacy.js create mode 100644 dist/3.7.3/max/packages/qoopido.shrinkimage.js create mode 100644 dist/3.7.3/max/packages/qoopido.shrinkimage.legacy.js rename dist/{3.7.2 => 3.7.3}/max/particle.js (99%) rename dist/{3.7.2 => 3.7.3}/max/polyfill/array/indexof.js (97%) rename dist/{3.7.2 => 3.7.3}/max/polyfill/document/getelementsbyclassname.js (98%) rename dist/{3.7.2 => 3.7.3}/max/polyfill/document/queryselector.js (97%) rename dist/{3.7.2 => 3.7.3}/max/polyfill/document/queryselectorall.js (98%) rename dist/{3.7.2 => 3.7.3}/max/polyfill/element/matches.js (98%) rename dist/{3.7.2 => 3.7.3}/max/polyfill/object/create.js (98%) rename dist/{3.7.2 => 3.7.3}/max/polyfill/object/defineproperties.js (98%) rename dist/{3.7.2 => 3.7.3}/max/polyfill/object/defineproperty.js (99%) rename dist/{3.7.2 => 3.7.3}/max/polyfill/object/getownpropertydescriptor.js (98%) rename dist/{3.7.2 => 3.7.3}/max/polyfill/object/getownpropertynames.js (98%) rename dist/{3.7.2 => 3.7.3}/max/polyfill/object/getprototypeof.js (98%) rename dist/{3.7.2 => 3.7.3}/max/polyfill/object/keys.js (97%) rename dist/{3.7.2 => 3.7.3}/max/polyfill/string/lcfirst.js (97%) rename dist/{3.7.2 => 3.7.3}/max/polyfill/string/trim.js (97%) rename dist/{3.7.2 => 3.7.3}/max/polyfill/string/ucfirst.js (97%) rename dist/{3.7.2 => 3.7.3}/max/polyfill/window/addeventlistener.js (99%) rename dist/{3.7.2 => 3.7.3}/max/polyfill/window/customevent.js (98%) rename dist/{3.7.2 => 3.7.3}/max/polyfill/window/dispatchevent.js (99%) rename dist/{3.7.2 => 3.7.3}/max/polyfill/window/getcomputedstyle.js (98%) rename dist/{3.7.2 => 3.7.3}/max/polyfill/window/matchmedia.js (99%) rename dist/{3.7.2 => 3.7.3}/max/polyfill/window/promise.js (99%) rename dist/{3.7.2 => 3.7.3}/max/polyfill/window/removeeventlistener.js (98%) rename dist/{3.7.2 => 3.7.3}/max/pool.js (99%) rename dist/{3.7.2 => 3.7.3}/max/pool/array.js (97%) rename dist/{3.7.2 => 3.7.3}/max/pool/dom.js (98%) rename dist/{3.7.2 => 3.7.3}/max/pool/module.js (98%) rename dist/{3.7.2 => 3.7.3}/max/pool/object.js (99%) rename dist/{3.7.2 => 3.7.3}/max/promise/all.js (98%) rename dist/{3.7.2 => 3.7.3}/max/promise/defer.js (97%) rename dist/{3.7.2 => 3.7.3}/max/promise/race.js (98%) rename dist/{3.7.2 => 3.7.3}/max/proxy.js (97%) rename dist/{3.7.2 => 3.7.3}/max/renderer.js (99%) rename dist/{3.7.2 => 3.7.3}/max/support.js (99%) rename dist/{3.7.2 => 3.7.3}/max/support/capability/datauri.js (98%) rename dist/{3.7.2 => 3.7.3}/max/support/capability/touch.js (97%) rename dist/{3.7.2 => 3.7.3}/max/support/css/borderradius.js (97%) rename dist/{3.7.2 => 3.7.3}/max/support/css/boxshadow.js (97%) rename dist/{3.7.2 => 3.7.3}/max/support/css/rem.js (97%) rename dist/{3.7.2 => 3.7.3}/max/support/css/rgba.js (97%) rename dist/{3.7.2 => 3.7.3}/max/support/css/textshadow.js (97%) rename dist/{3.7.2 => 3.7.3}/max/support/css/transform.js (97%) rename dist/{3.7.2 => 3.7.3}/max/support/css/transform/2d.js (98%) rename dist/{3.7.2 => 3.7.3}/max/support/css/transform/3d.js (98%) rename dist/{3.7.2 => 3.7.3}/max/support/css/transition.js (97%) rename dist/{3.7.2 => 3.7.3}/max/support/element/canvas.js (97%) rename dist/{3.7.2 => 3.7.3}/max/support/element/canvas/todataurl.js (98%) rename dist/{3.7.2 => 3.7.3}/max/support/element/canvas/todataurl/jpeg.js (98%) rename dist/{3.7.2 => 3.7.3}/max/support/element/canvas/todataurl/png.js (98%) rename dist/{3.7.2 => 3.7.3}/max/support/element/canvas/todataurl/webp.js (98%) rename dist/{3.7.2 => 3.7.3}/max/support/element/svg.js (97%) rename dist/{3.7.2 => 3.7.3}/max/support/element/video.js (97%) rename dist/{3.7.2 => 3.7.3}/max/support/element/video/mp4.js (98%) rename dist/{3.7.2 => 3.7.3}/max/support/element/video/ogg.js (98%) rename dist/{3.7.2 => 3.7.3}/max/support/element/video/webm.js (98%) rename dist/{3.7.2 => 3.7.3}/max/transport.js (98%) rename dist/{3.7.2 => 3.7.3}/max/transport/jsonp.js (99%) rename dist/{3.7.2 => 3.7.3}/max/transport/xhr.js (99%) rename dist/{3.7.2 => 3.7.3}/max/url.js (98%) rename dist/{3.7.2 => 3.7.3}/max/vector/2d.js (99%) rename dist/{3.7.2 => 3.7.3}/max/widget/image/adapt.js (99%) rename dist/{3.7.2 => 3.7.3}/max/worker.js (99%) rename dist/{3.7.2 => 3.7.3}/min/asset.js (96%) create mode 100644 dist/3.7.3/min/base.js rename dist/{3.7.2 => 3.7.3}/min/component/iterator.js (96%) rename dist/{3.7.2 => 3.7.3}/min/component/remux.js (96%) rename dist/{3.7.2 => 3.7.3}/min/component/sense.js (89%) rename dist/{3.7.2 => 3.7.3}/min/dom/collection.js (98%) rename dist/{3.7.2 => 3.7.3}/min/dom/element.js (99%) rename dist/{3.7.2 => 3.7.3}/min/dom/element/emerge.js (97%) rename dist/{3.7.2 => 3.7.3}/min/dom/element/lazyimage.js (92%) rename dist/{3.7.2 => 3.7.3}/min/dom/element/shrinkimage.js (97%) rename dist/{3.7.2 => 3.7.3}/min/dom/event.js (94%) rename dist/{3.7.2 => 3.7.3}/min/emitter.js (95%) rename dist/{3.7.2 => 3.7.3}/min/function/load/css.js (86%) rename dist/{3.7.2 => 3.7.3}/min/function/merge.js (86%) rename dist/{3.7.2 => 3.7.3}/min/function/proximity.js (89%) rename dist/{3.7.2 => 3.7.3}/min/function/unique/string.js (86%) rename dist/{3.7.2 => 3.7.3}/min/function/unique/uuid.js (86%) rename dist/{3.7.2 => 3.7.3}/min/hook/css.js (93%) rename dist/{3.7.2 => 3.7.3}/min/hook/event.js (96%) rename dist/{3.7.2 => 3.7.3}/min/jquery/extension/selector.js (95%) rename dist/{3.7.2 => 3.7.3}/min/jquery/function/prefetch.js (88%) rename dist/{3.7.2 => 3.7.3}/min/jquery/plugin/emerge.js (89%) rename dist/{3.7.2 => 3.7.3}/min/jquery/plugin/lazyimage.js (89%) rename dist/{3.7.2 => 3.7.3}/min/jquery/plugin/shrinkimage.js (91%) create mode 100644 dist/3.7.3/min/packages/qoopido.base.js create mode 100644 dist/3.7.3/min/packages/qoopido.base.legacy.js create mode 100644 dist/3.7.3/min/packages/qoopido.emerge.js create mode 100644 dist/3.7.3/min/packages/qoopido.emerge.legacy.js create mode 100644 dist/3.7.3/min/packages/qoopido.emitter.js create mode 100644 dist/3.7.3/min/packages/qoopido.emitter.legacy.js create mode 100644 dist/3.7.3/min/packages/qoopido.lazyimage.js create mode 100644 dist/3.7.3/min/packages/qoopido.lazyimage.legacy.js create mode 100644 dist/3.7.3/min/packages/qoopido.remux.js create mode 100644 dist/3.7.3/min/packages/qoopido.remux.legacy.js create mode 100644 dist/3.7.3/min/packages/qoopido.sense.js create mode 100644 dist/3.7.3/min/packages/qoopido.sense.legacy.js create mode 100644 dist/3.7.3/min/packages/qoopido.shrinkimage.js create mode 100644 dist/3.7.3/min/packages/qoopido.shrinkimage.legacy.js rename dist/{3.7.2 => 3.7.3}/min/particle.js (94%) rename dist/{3.7.2 => 3.7.3}/min/polyfill/array/indexof.js (82%) rename dist/{3.7.2 => 3.7.3}/min/polyfill/document/getelementsbyclassname.js (86%) rename dist/{3.7.2 => 3.7.3}/min/polyfill/document/queryselector.js (84%) rename dist/{3.7.2 => 3.7.3}/min/polyfill/document/queryselectorall.js (90%) rename dist/{3.7.2 => 3.7.3}/min/polyfill/element/matches.js (89%) rename dist/{3.7.2 => 3.7.3}/min/polyfill/object/create.js (90%) rename dist/{3.7.2 => 3.7.3}/min/polyfill/object/defineproperties.js (91%) rename dist/{3.7.2 => 3.7.3}/min/polyfill/object/defineproperty.js (92%) rename dist/{3.7.2 => 3.7.3}/min/polyfill/object/getownpropertydescriptor.js (91%) rename dist/{3.7.2 => 3.7.3}/min/polyfill/object/getownpropertynames.js (89%) rename dist/{3.7.2 => 3.7.3}/min/polyfill/object/getprototypeof.js (88%) rename dist/{3.7.2 => 3.7.3}/min/polyfill/object/keys.js (84%) rename dist/{3.7.2 => 3.7.3}/min/polyfill/string/lcfirst.js (82%) rename dist/{3.7.2 => 3.7.3}/min/polyfill/string/trim.js (83%) rename dist/{3.7.2 => 3.7.3}/min/polyfill/string/ucfirst.js (82%) rename dist/{3.7.2 => 3.7.3}/min/polyfill/window/addeventlistener.js (94%) rename dist/{3.7.2 => 3.7.3}/min/polyfill/window/customevent.js (91%) rename dist/{3.7.2 => 3.7.3}/min/polyfill/window/dispatchevent.js (92%) rename dist/{3.7.2 => 3.7.3}/min/polyfill/window/getcomputedstyle.js (87%) rename dist/{3.7.2 => 3.7.3}/min/polyfill/window/matchmedia.js (97%) rename dist/{3.7.2 => 3.7.3}/min/polyfill/window/promise.js (96%) rename dist/{3.7.2 => 3.7.3}/min/polyfill/window/removeeventlistener.js (90%) rename dist/{3.7.2 => 3.7.3}/min/pool.js (96%) rename dist/{3.7.2 => 3.7.3}/min/pool/array.js (81%) rename dist/{3.7.2 => 3.7.3}/min/pool/dom.js (90%) rename dist/{3.7.2 => 3.7.3}/min/pool/module.js (91%) rename dist/{3.7.2 => 3.7.3}/min/pool/object.js (92%) rename dist/{3.7.2 => 3.7.3}/min/promise/all.js (89%) rename dist/{3.7.2 => 3.7.3}/min/promise/defer.js (82%) rename dist/{3.7.2 => 3.7.3}/min/promise/race.js (87%) rename dist/{3.7.2 => 3.7.3}/min/proxy.js (85%) rename dist/{3.7.2 => 3.7.3}/min/renderer.js (94%) rename dist/{3.7.2 => 3.7.3}/min/support.js (98%) rename dist/{3.7.2 => 3.7.3}/min/support/capability/datauri.js (90%) rename dist/{3.7.2 => 3.7.3}/min/support/capability/touch.js (84%) rename dist/{3.7.2 => 3.7.3}/min/support/css/borderradius.js (84%) rename dist/{3.7.2 => 3.7.3}/min/support/css/boxshadow.js (83%) rename dist/{3.7.2 => 3.7.3}/min/support/css/rem.js (85%) rename dist/{3.7.2 => 3.7.3}/min/support/css/rgba.js (86%) rename dist/{3.7.2 => 3.7.3}/min/support/css/textshadow.js (83%) rename dist/{3.7.2 => 3.7.3}/min/support/css/transform.js (83%) rename dist/{3.7.2 => 3.7.3}/min/support/css/transform/2d.js (89%) rename dist/{3.7.2 => 3.7.3}/min/support/css/transform/3d.js (89%) rename dist/{3.7.2 => 3.7.3}/min/support/css/transition.js (83%) rename dist/{3.7.2 => 3.7.3}/min/support/element/canvas.js (85%) rename dist/{3.7.2 => 3.7.3}/min/support/element/canvas/todataurl.js (87%) rename dist/{3.7.2 => 3.7.3}/min/support/element/canvas/todataurl/jpeg.js (89%) rename dist/{3.7.2 => 3.7.3}/min/support/element/canvas/todataurl/png.js (89%) rename dist/{3.7.2 => 3.7.3}/min/support/element/canvas/todataurl/webp.js (89%) rename dist/{3.7.2 => 3.7.3}/min/support/element/svg.js (83%) rename dist/{3.7.2 => 3.7.3}/min/support/element/video.js (84%) rename dist/{3.7.2 => 3.7.3}/min/support/element/video/mp4.js (88%) rename dist/{3.7.2 => 3.7.3}/min/support/element/video/ogg.js (88%) rename dist/{3.7.2 => 3.7.3}/min/support/element/video/webm.js (88%) rename dist/{3.7.2 => 3.7.3}/min/transport.js (88%) rename dist/{3.7.2 => 3.7.3}/min/transport/jsonp.js (96%) rename dist/{3.7.2 => 3.7.3}/min/transport/xhr.js (97%) rename dist/{3.7.2 => 3.7.3}/min/url.js (91%) rename dist/{3.7.2 => 3.7.3}/min/vector/2d.js (95%) rename dist/{3.7.2 => 3.7.3}/min/widget/image/adapt.js (97%) rename dist/{3.7.2 => 3.7.3}/min/worker.js (96%) create mode 100644 dist/latest/max/packages/qoopido.base.js create mode 100644 dist/latest/max/packages/qoopido.base.legacy.js create mode 100644 dist/latest/max/packages/qoopido.emerge.js create mode 100644 dist/latest/max/packages/qoopido.emerge.legacy.js create mode 100644 dist/latest/max/packages/qoopido.emitter.js create mode 100644 dist/latest/max/packages/qoopido.emitter.legacy.js create mode 100644 dist/latest/max/packages/qoopido.lazyimage.js create mode 100644 dist/latest/max/packages/qoopido.lazyimage.legacy.js create mode 100644 dist/latest/max/packages/qoopido.remux.js create mode 100644 dist/latest/max/packages/qoopido.remux.legacy.js create mode 100644 dist/latest/max/packages/qoopido.sense.js create mode 100644 dist/latest/max/packages/qoopido.sense.legacy.js create mode 100644 dist/latest/max/packages/qoopido.shrinkimage.js create mode 100644 dist/latest/max/packages/qoopido.shrinkimage.legacy.js create mode 100644 dist/latest/min/packages/qoopido.base.js create mode 100644 dist/latest/min/packages/qoopido.base.legacy.js create mode 100644 dist/latest/min/packages/qoopido.emerge.js create mode 100644 dist/latest/min/packages/qoopido.emerge.legacy.js create mode 100644 dist/latest/min/packages/qoopido.emitter.js create mode 100644 dist/latest/min/packages/qoopido.emitter.legacy.js create mode 100644 dist/latest/min/packages/qoopido.lazyimage.js create mode 100644 dist/latest/min/packages/qoopido.lazyimage.legacy.js create mode 100644 dist/latest/min/packages/qoopido.remux.js create mode 100644 dist/latest/min/packages/qoopido.remux.legacy.js create mode 100644 dist/latest/min/packages/qoopido.sense.js create mode 100644 dist/latest/min/packages/qoopido.sense.legacy.js create mode 100644 dist/latest/min/packages/qoopido.shrinkimage.js create mode 100644 dist/latest/min/packages/qoopido.shrinkimage.legacy.js diff --git a/dist/3.7.2/min/base.js b/dist/3.7.2/min/base.js deleted file mode 100644 index 9dcc288a..00000000 --- a/dist/3.7.2/min/base.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ -!function(e,t,r,o,n,c){"use strict";function i(e,t,i,u){var s,f=e.split("/");return d[e]?d[e]:(s=function(){if(i)for(var s,g,y=f.slice(0,-1).join("/"),j=0;(s=i[j])!==c;j++)g=l.test(s),g&&(s=p(y+"/"+s)),!d[s]&&arguments[j]&&(d[s]=arguments[j]),g&&!d[s]&&"undefined"!=typeof console&&console.error("".concat("[Qoopido.js] ",e,": Could not load dependency ",s));return d[e]=t(d,a,f,r,o,n,c),u&&u(d[e]),d[e]},void("undefined"!=typeof module&&module.exports?module.exports=define(s):"function"==typeof define&&define.amd?i?define(i,s):define(s):s()))}function u(e,t,r){i(e,t,r,function(t){d[e]=t.create()})}function p(e){for(var t;(t=e.replace(g,""))!==e;)e=t;return e.replace(y,"")}var s=t.qoopido||(t.qoopido={register:i,registerSingleton:u}),a=s.shared||(s.shared={}),d=s.modules||(s.modules={}),f=[],l=new RegExp("^\\.+\\/"),g=new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."),y=new RegExp("(^\\/)|\\.\\/","g");Object.create||f.push("./polyfill/object/create"),Object.getOwnPropertyNames||f.push("./polyfill/object/getownpropertynames"),Object.getOwnPropertyDescriptor&&function(){try{return Object.getOwnPropertyDescriptor({x:0},"x"),!0}catch(e){return!1}}()||f.push("./polyfill/object/getownpropertydescriptor"),i("base",e,f)}(function(e,t,r,o,n,c,i){"use strict";function u(e){for(var t,r={},o=Object.getOwnPropertyNames(e),n=0;(t=o[n])!==i;n++)r[t]=Object.getOwnPropertyDescriptor(e,t);return r}function p(){throw new Error("[Qoopido.js] Operation prohibited")}return{create:function(){var e,t=Object.create(this,u(this));return t._constructor&&(e=t._constructor.apply(t,arguments)),t.create=t.extend=p,e||t},extend:function(e,t){var r;return e=e||{},t=t===!0,e._parent=this,r=Object.create(this,u(e)),t===!0&&(r.extend=p),r}}},this,navigator,window,document); \ No newline at end of file diff --git a/dist/3.7.2/max/asset.js b/dist/3.7.3/max/asset.js similarity index 99% rename from dist/3.7.2/max/asset.js rename to dist/3.7.3/max/asset.js index 832c5fd2..5494ffea 100644 --- a/dist/3.7.2/max/asset.js +++ b/dist/3.7.3/max/asset.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/base.js b/dist/3.7.3/max/base.js similarity index 87% rename from dist/3.7.2/max/base.js rename to dist/3.7.3/max/base.js index c1aad9a0..50fbc5e3 100644 --- a/dist/3.7.2/max/base.js +++ b/dist/3.7.3/max/base.js @@ -1,14 +1,14 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js * * Copyright (c) 2015 Dirk Lueth */ -(function(definition, global, navigator, window, document, undefined) { +(function(definition, navigator, global, document, undefined) { "use strict"; function register(id, definition, dependencies, callback) { var namespace = id.split("/"), initialize; @@ -31,7 +31,7 @@ } } } - modules[id] = definition(modules, shared, namespace, navigator, window, document, undefined); + modules[id] = definition(modules, shared, namespace, navigator, global, document, undefined); if (callback) { callback(modules[id]); } @@ -50,10 +50,9 @@ modules[id] = module.create(); }); } - var qoopido = global.qoopido || (global.qoopido = { - register: register, - registerSingleton: registerSingleton - }), shared = qoopido.shared || (qoopido.shared = {}), modules = qoopido.modules || (qoopido.modules = {}), dependencies = [], isInternal = new RegExp("^\\.+\\/"), regexCanonicalize = new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."), removeNeutral = new RegExp("(^\\/)|\\.\\/", "g"); + var qoopido = global.qoopido || (global.qoopido = {}), shared = qoopido.shared || (qoopido.shared = {}), modules = qoopido.modules || (qoopido.modules = {}), dependencies = [], isInternal = new RegExp("^\\.+\\/"), regexCanonicalize = new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."), removeNeutral = new RegExp("(^\\/)|\\.\\/", "g"); + qoopido.register = register; + qoopido.registerSingleton = registerSingleton; function canonicalize(path) { var collapsed; while ((collapsed = path.replace(regexCanonicalize, "")) !== path) { @@ -113,4 +112,4 @@ return instance; } }; -}, this, navigator, window, document); \ No newline at end of file +}, navigator, this, document); \ No newline at end of file diff --git a/dist/3.7.2/max/component/iterator.js b/dist/3.7.3/max/component/iterator.js similarity index 99% rename from dist/3.7.2/max/component/iterator.js rename to dist/3.7.3/max/component/iterator.js index 90378983..70aac983 100644 --- a/dist/3.7.2/max/component/iterator.js +++ b/dist/3.7.3/max/component/iterator.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/component/remux.js b/dist/3.7.3/max/component/remux.js similarity index 99% rename from dist/3.7.2/max/component/remux.js rename to dist/3.7.3/max/component/remux.js index 62464ef3..9e1710f3 100644 --- a/dist/3.7.2/max/component/remux.js +++ b/dist/3.7.3/max/component/remux.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/component/sense.js b/dist/3.7.3/max/component/sense.js similarity index 98% rename from dist/3.7.2/max/component/sense.js rename to dist/3.7.3/max/component/sense.js index 7e865893..ef31535e 100644 --- a/dist/3.7.2/max/component/sense.js +++ b/dist/3.7.3/max/component/sense.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/dom/collection.js b/dist/3.7.3/max/dom/collection.js similarity index 99% rename from dist/3.7.2/max/dom/collection.js rename to dist/3.7.3/max/dom/collection.js index 72141f28..9bb6835b 100644 --- a/dist/3.7.2/max/dom/collection.js +++ b/dist/3.7.3/max/dom/collection.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/dom/element.js b/dist/3.7.3/max/dom/element.js similarity index 99% rename from dist/3.7.2/max/dom/element.js rename to dist/3.7.3/max/dom/element.js index c4004388..12b2ea9b 100644 --- a/dist/3.7.2/max/dom/element.js +++ b/dist/3.7.3/max/dom/element.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/dom/element/emerge.js b/dist/3.7.3/max/dom/element/emerge.js similarity index 99% rename from dist/3.7.2/max/dom/element/emerge.js rename to dist/3.7.3/max/dom/element/emerge.js index 04971155..72ea390a 100644 --- a/dist/3.7.2/max/dom/element/emerge.js +++ b/dist/3.7.3/max/dom/element/emerge.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/dom/element/lazyimage.js b/dist/3.7.3/max/dom/element/lazyimage.js similarity index 99% rename from dist/3.7.2/max/dom/element/lazyimage.js rename to dist/3.7.3/max/dom/element/lazyimage.js index a84dcf8a..4919cb38 100644 --- a/dist/3.7.2/max/dom/element/lazyimage.js +++ b/dist/3.7.3/max/dom/element/lazyimage.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/dom/element/shrinkimage.js b/dist/3.7.3/max/dom/element/shrinkimage.js similarity index 99% rename from dist/3.7.2/max/dom/element/shrinkimage.js rename to dist/3.7.3/max/dom/element/shrinkimage.js index 6dfc18ea..18c90fc3 100644 --- a/dist/3.7.2/max/dom/element/shrinkimage.js +++ b/dist/3.7.3/max/dom/element/shrinkimage.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/dom/event.js b/dist/3.7.3/max/dom/event.js similarity index 99% rename from dist/3.7.2/max/dom/event.js rename to dist/3.7.3/max/dom/event.js index 8a57094f..f9ded10c 100644 --- a/dist/3.7.2/max/dom/event.js +++ b/dist/3.7.3/max/dom/event.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/emitter.js b/dist/3.7.3/max/emitter.js similarity index 99% rename from dist/3.7.2/max/emitter.js rename to dist/3.7.3/max/emitter.js index d27da22e..20e20ad5 100644 --- a/dist/3.7.2/max/emitter.js +++ b/dist/3.7.3/max/emitter.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/function/load/css.js b/dist/3.7.3/max/function/load/css.js similarity index 98% rename from dist/3.7.2/max/function/load/css.js rename to dist/3.7.3/max/function/load/css.js index 88db6d6f..38af4f55 100644 --- a/dist/3.7.2/max/function/load/css.js +++ b/dist/3.7.3/max/function/load/css.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/function/merge.js b/dist/3.7.3/max/function/merge.js similarity index 98% rename from dist/3.7.2/max/function/merge.js rename to dist/3.7.3/max/function/merge.js index e4a76894..1784bc8b 100644 --- a/dist/3.7.2/max/function/merge.js +++ b/dist/3.7.3/max/function/merge.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/function/proximity.js b/dist/3.7.3/max/function/proximity.js similarity index 98% rename from dist/3.7.2/max/function/proximity.js rename to dist/3.7.3/max/function/proximity.js index a0f51b93..9db3786f 100644 --- a/dist/3.7.2/max/function/proximity.js +++ b/dist/3.7.3/max/function/proximity.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/function/unique/string.js b/dist/3.7.3/max/function/unique/string.js similarity index 98% rename from dist/3.7.2/max/function/unique/string.js rename to dist/3.7.3/max/function/unique/string.js index eee99fba..a3ceac9d 100644 --- a/dist/3.7.2/max/function/unique/string.js +++ b/dist/3.7.3/max/function/unique/string.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/function/unique/uuid.js b/dist/3.7.3/max/function/unique/uuid.js similarity index 98% rename from dist/3.7.2/max/function/unique/uuid.js rename to dist/3.7.3/max/function/unique/uuid.js index 16073074..4f7bdd6c 100644 --- a/dist/3.7.2/max/function/unique/uuid.js +++ b/dist/3.7.3/max/function/unique/uuid.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/hook/css.js b/dist/3.7.3/max/hook/css.js similarity index 99% rename from dist/3.7.2/max/hook/css.js rename to dist/3.7.3/max/hook/css.js index 75ac4c86..625e0760 100644 --- a/dist/3.7.2/max/hook/css.js +++ b/dist/3.7.3/max/hook/css.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/hook/event.js b/dist/3.7.3/max/hook/event.js similarity index 99% rename from dist/3.7.2/max/hook/event.js rename to dist/3.7.3/max/hook/event.js index 329e1e00..84777161 100644 --- a/dist/3.7.2/max/hook/event.js +++ b/dist/3.7.3/max/hook/event.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/jquery/extension/selector.js b/dist/3.7.3/max/jquery/extension/selector.js similarity index 99% rename from dist/3.7.2/max/jquery/extension/selector.js rename to dist/3.7.3/max/jquery/extension/selector.js index ec1b2d66..5cdb1d04 100644 --- a/dist/3.7.2/max/jquery/extension/selector.js +++ b/dist/3.7.3/max/jquery/extension/selector.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/jquery/function/prefetch.js b/dist/3.7.3/max/jquery/function/prefetch.js similarity index 98% rename from dist/3.7.2/max/jquery/function/prefetch.js rename to dist/3.7.3/max/jquery/function/prefetch.js index ff9dc036..1d349153 100644 --- a/dist/3.7.2/max/jquery/function/prefetch.js +++ b/dist/3.7.3/max/jquery/function/prefetch.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/jquery/plugin/emerge.js b/dist/3.7.3/max/jquery/plugin/emerge.js similarity index 98% rename from dist/3.7.2/max/jquery/plugin/emerge.js rename to dist/3.7.3/max/jquery/plugin/emerge.js index 4f3ccb7a..f888e3cf 100644 --- a/dist/3.7.2/max/jquery/plugin/emerge.js +++ b/dist/3.7.3/max/jquery/plugin/emerge.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/jquery/plugin/lazyimage.js b/dist/3.7.3/max/jquery/plugin/lazyimage.js similarity index 98% rename from dist/3.7.2/max/jquery/plugin/lazyimage.js rename to dist/3.7.3/max/jquery/plugin/lazyimage.js index c51469e8..c45bfeaa 100644 --- a/dist/3.7.2/max/jquery/plugin/lazyimage.js +++ b/dist/3.7.3/max/jquery/plugin/lazyimage.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/jquery/plugin/shrinkimage.js b/dist/3.7.3/max/jquery/plugin/shrinkimage.js similarity index 99% rename from dist/3.7.2/max/jquery/plugin/shrinkimage.js rename to dist/3.7.3/max/jquery/plugin/shrinkimage.js index 28c18dd1..e206e0a1 100644 --- a/dist/3.7.2/max/jquery/plugin/shrinkimage.js +++ b/dist/3.7.3/max/jquery/plugin/shrinkimage.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.3/max/packages/qoopido.base.js b/dist/3.7.3/max/packages/qoopido.base.js new file mode 100644 index 00000000..50fbc5e3 --- /dev/null +++ b/dist/3.7.3/max/packages/qoopido.base.js @@ -0,0 +1,115 @@ +/*! +* Qoopido.js library +* +* version: 3.7.3 +* date: 2015-08-05 +* author: Dirk Lueth +* website: https://github.com/dlueth/qoopido.js +* +* Copyright (c) 2015 Dirk Lueth +*/ +(function(definition, navigator, global, document, undefined) { + "use strict"; + function register(id, definition, dependencies, callback) { + var namespace = id.split("/"), initialize; + if (modules[id]) { + return modules[id]; + } + initialize = function() { + if (dependencies) { + var path = namespace.slice(0, -1).join("/"), i = 0, dependency, internal; + for (;(dependency = dependencies[i]) !== undefined; i++) { + internal = isInternal.test(dependency); + if (internal) { + dependency = canonicalize(path + "/" + dependency); + } + if (!modules[dependency] && arguments[i]) { + modules[dependency] = arguments[i]; + } + if (internal && !modules[dependency] && typeof console !== "undefined") { + console.error("".concat("[Qoopido.js] ", id, ": Could not load dependency ", dependency)); + } + } + } + modules[id] = definition(modules, shared, namespace, navigator, global, document, undefined); + if (callback) { + callback(modules[id]); + } + return modules[id]; + }; + if (typeof module !== "undefined" && module.exports) { + module.exports = define(initialize); + } else if (typeof define === "function" && define.amd) { + dependencies ? define(dependencies, initialize) : define(initialize); + } else { + initialize(); + } + } + function registerSingleton(id, definition, dependencies) { + register(id, definition, dependencies, function(module) { + modules[id] = module.create(); + }); + } + var qoopido = global.qoopido || (global.qoopido = {}), shared = qoopido.shared || (qoopido.shared = {}), modules = qoopido.modules || (qoopido.modules = {}), dependencies = [], isInternal = new RegExp("^\\.+\\/"), regexCanonicalize = new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."), removeNeutral = new RegExp("(^\\/)|\\.\\/", "g"); + qoopido.register = register; + qoopido.registerSingleton = registerSingleton; + function canonicalize(path) { + var collapsed; + while ((collapsed = path.replace(regexCanonicalize, "")) !== path) { + path = collapsed; + } + return path.replace(removeNeutral, ""); + } + if (!Object.create) { + dependencies.push("./polyfill/object/create"); + } + if (!Object.getOwnPropertyNames) { + dependencies.push("./polyfill/object/getownpropertynames"); + } + if (!Object.getOwnPropertyDescriptor || !function() { + try { + Object.getOwnPropertyDescriptor({ + x: 0 + }, "x"); + return true; + } catch (exception) { + return false; + } + }()) { + dependencies.push("./polyfill/object/getownpropertydescriptor"); + } + register("base", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + function getOwnPropertyDescriptors(object) { + var descriptors = {}, properties = Object.getOwnPropertyNames(object), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + descriptors[property] = Object.getOwnPropertyDescriptor(object, property); + } + return descriptors; + } + function prohibitCall() { + throw new Error("[Qoopido.js] Operation prohibited"); + } + return { + create: function() { + var instance = Object.create(this, getOwnPropertyDescriptors(this)), result; + if (instance._constructor) { + result = instance._constructor.apply(instance, arguments); + } + instance.create = instance.extend = prohibitCall; + return result || instance; + }, + extend: function(properties, final) { + var instance; + properties = properties || {}; + final = final === true; + properties._parent = this; + instance = Object.create(this, getOwnPropertyDescriptors(properties)); + if (final === true) { + instance.extend = prohibitCall; + } + return instance; + } + }; +}, navigator, this, document); \ No newline at end of file diff --git a/dist/3.7.3/max/packages/qoopido.base.legacy.js b/dist/3.7.3/max/packages/qoopido.base.legacy.js new file mode 100644 index 00000000..15a8ca67 --- /dev/null +++ b/dist/3.7.3/max/packages/qoopido.base.legacy.js @@ -0,0 +1,286 @@ +/*! +* Qoopido.js library +* +* version: 3.7.3 +* date: 2015-08-05 +* author: Dirk Lueth +* website: https://github.com/dlueth/qoopido.js +* +* Copyright (c) 2015 Dirk Lueth +*/ +(function(definition, qoopido) { + if (qoopido.register) { + qoopido.register("polyfill/object/defineproperty", definition); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/defineproperty"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.defineProperty || !function() { + try { + Object.defineProperty({}, "x", {}); + return true; + } catch (exception) { + return false; + } + }()) { + var defineProperty = Object.defineProperty, defineGetter = Object.prototype.__defineGetter__, defineSetter = Object.prototype.__defineSetter__; + Object.defineProperty = function(obj, prop, desc) { + if (defineProperty) { + try { + return defineProperty(obj, prop, desc); + } catch (exception) {} + } + if (obj !== Object(obj)) { + throw new TypeError("Object.defineProperty called on non-object"); + } + if (defineGetter && "get" in desc) { + defineGetter.call(obj, prop, desc.get); + } + if (defineSetter && "set" in desc) { + defineSetter.call(obj, prop, desc.set); + } + if ("value" in desc) { + obj[prop] = desc.value; + } + return obj; + }; + } + return Object.defineProperty; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + var dependencies = []; + if (!Object.defineProperty || !function() { + try { + Object.defineProperty({}, "x", {}); + return true; + } catch (exception) { + return false; + } + }()) { + dependencies.push("./defineproperty"); + } + qoopido.register("polyfill/object/defineproperties", definition, dependencies); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/defineproperties"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.defineProperties) { + Object.defineProperties = function(obj, properties) { + if (obj !== Object(obj)) { + throw new TypeError("Object.defineProperties called on non-object"); + } + var name; + for (name in properties) { + if (Object.prototype.hasOwnProperty.call(properties, name)) { + Object.defineProperty(obj, name, properties[name]); + } + } + return obj; + }; + } + return Object.defineProperties; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + var dependencies = []; + if (!Object.defineProperties) { + dependencies.push("./defineproperties"); + } + qoopido.register("polyfill/object/create", definition, dependencies); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/create"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.create) { + Object.create = function(prototype, properties) { + if (typeof prototype !== "object") { + throw new TypeError(); + } + function Constructor() {} + Constructor.prototype = prototype; + var obj = new Constructor(); + if (prototype) { + obj.constructor = Constructor; + } + if (arguments.length > 1) { + if (properties !== Object(properties)) { + throw new TypeError(); + } + Object.defineProperties(obj, properties); + } + return obj; + }; + } + return Object.create; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + qoopido.register("polyfill/object/getownpropertynames", definition); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/getownpropertynames"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.getOwnPropertyNames) { + Object.getOwnPropertyNames = function(obj) { + if (obj !== Object(obj)) { + throw new TypeError("Object.getOwnPropertyNames called on non-object"); + } + var props = [], p; + for (p in obj) { + if (Object.prototype.hasOwnProperty.call(obj, p)) { + props.push(p); + } + } + return props; + }; + } + return Object.getOwnPropertyNames; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + qoopido.register("polyfill/object/getownpropertydescriptor", definition); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/getownpropertydescriptor"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.getOwnPropertyDescriptor || !function() { + try { + Object.getOwnPropertyDescriptor({ + x: 0 + }, "x"); + return true; + } catch (exception) { + return false; + } + }()) { + var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; + Object.getOwnPropertyDescriptor = function(obj, property) { + if (obj !== Object(obj)) { + throw new TypeError(); + } + try { + return getOwnPropertyDescriptor.call(Object, obj, property); + } catch (exception) {} + if (Object.prototype.hasOwnProperty.call(obj, property)) { + return { + value: obj[property], + enumerable: true, + writable: true, + configurable: true + }; + } + }; + } + return Object.getOwnPropertyDescriptor; +}, window.qoopido = window.qoopido || {}); +(function(definition, navigator, global, document, undefined) { + "use strict"; + function register(id, definition, dependencies, callback) { + var namespace = id.split("/"), initialize; + if (modules[id]) { + return modules[id]; + } + initialize = function() { + if (dependencies) { + var path = namespace.slice(0, -1).join("/"), i = 0, dependency, internal; + for (;(dependency = dependencies[i]) !== undefined; i++) { + internal = isInternal.test(dependency); + if (internal) { + dependency = canonicalize(path + "/" + dependency); + } + if (!modules[dependency] && arguments[i]) { + modules[dependency] = arguments[i]; + } + if (internal && !modules[dependency] && typeof console !== "undefined") { + console.error("".concat("[Qoopido.js] ", id, ": Could not load dependency ", dependency)); + } + } + } + modules[id] = definition(modules, shared, namespace, navigator, global, document, undefined); + if (callback) { + callback(modules[id]); + } + return modules[id]; + }; + if (typeof module !== "undefined" && module.exports) { + module.exports = define(initialize); + } else if (typeof define === "function" && define.amd) { + dependencies ? define(dependencies, initialize) : define(initialize); + } else { + initialize(); + } + } + function registerSingleton(id, definition, dependencies) { + register(id, definition, dependencies, function(module) { + modules[id] = module.create(); + }); + } + var qoopido = global.qoopido || (global.qoopido = {}), shared = qoopido.shared || (qoopido.shared = {}), modules = qoopido.modules || (qoopido.modules = {}), dependencies = [], isInternal = new RegExp("^\\.+\\/"), regexCanonicalize = new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."), removeNeutral = new RegExp("(^\\/)|\\.\\/", "g"); + qoopido.register = register; + qoopido.registerSingleton = registerSingleton; + function canonicalize(path) { + var collapsed; + while ((collapsed = path.replace(regexCanonicalize, "")) !== path) { + path = collapsed; + } + return path.replace(removeNeutral, ""); + } + if (!Object.create) { + dependencies.push("./polyfill/object/create"); + } + if (!Object.getOwnPropertyNames) { + dependencies.push("./polyfill/object/getownpropertynames"); + } + if (!Object.getOwnPropertyDescriptor || !function() { + try { + Object.getOwnPropertyDescriptor({ + x: 0 + }, "x"); + return true; + } catch (exception) { + return false; + } + }()) { + dependencies.push("./polyfill/object/getownpropertydescriptor"); + } + register("base", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + function getOwnPropertyDescriptors(object) { + var descriptors = {}, properties = Object.getOwnPropertyNames(object), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + descriptors[property] = Object.getOwnPropertyDescriptor(object, property); + } + return descriptors; + } + function prohibitCall() { + throw new Error("[Qoopido.js] Operation prohibited"); + } + return { + create: function() { + var instance = Object.create(this, getOwnPropertyDescriptors(this)), result; + if (instance._constructor) { + result = instance._constructor.apply(instance, arguments); + } + instance.create = instance.extend = prohibitCall; + return result || instance; + }, + extend: function(properties, final) { + var instance; + properties = properties || {}; + final = final === true; + properties._parent = this; + instance = Object.create(this, getOwnPropertyDescriptors(properties)); + if (final === true) { + instance.extend = prohibitCall; + } + return instance; + } + }; +}, navigator, this, document); \ No newline at end of file diff --git a/dist/3.7.3/max/packages/qoopido.emerge.js b/dist/3.7.3/max/packages/qoopido.emerge.js new file mode 100644 index 00000000..fbbc6f7f --- /dev/null +++ b/dist/3.7.3/max/packages/qoopido.emerge.js @@ -0,0 +1,1453 @@ +/*! +* Qoopido.js library +* +* version: 3.7.3 +* date: 2015-08-05 +* author: Dirk Lueth +* website: https://github.com/dlueth/qoopido.js +* +* Copyright (c) 2015 Dirk Lueth +*/ +(function(definition, navigator, global, document, undefined) { + "use strict"; + function register(id, definition, dependencies, callback) { + var namespace = id.split("/"), initialize; + if (modules[id]) { + return modules[id]; + } + initialize = function() { + if (dependencies) { + var path = namespace.slice(0, -1).join("/"), i = 0, dependency, internal; + for (;(dependency = dependencies[i]) !== undefined; i++) { + internal = isInternal.test(dependency); + if (internal) { + dependency = canonicalize(path + "/" + dependency); + } + if (!modules[dependency] && arguments[i]) { + modules[dependency] = arguments[i]; + } + if (internal && !modules[dependency] && typeof console !== "undefined") { + console.error("".concat("[Qoopido.js] ", id, ": Could not load dependency ", dependency)); + } + } + } + modules[id] = definition(modules, shared, namespace, navigator, global, document, undefined); + if (callback) { + callback(modules[id]); + } + return modules[id]; + }; + if (typeof module !== "undefined" && module.exports) { + module.exports = define(initialize); + } else if (typeof define === "function" && define.amd) { + dependencies ? define(dependencies, initialize) : define(initialize); + } else { + initialize(); + } + } + function registerSingleton(id, definition, dependencies) { + register(id, definition, dependencies, function(module) { + modules[id] = module.create(); + }); + } + var qoopido = global.qoopido || (global.qoopido = {}), shared = qoopido.shared || (qoopido.shared = {}), modules = qoopido.modules || (qoopido.modules = {}), dependencies = [], isInternal = new RegExp("^\\.+\\/"), regexCanonicalize = new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."), removeNeutral = new RegExp("(^\\/)|\\.\\/", "g"); + qoopido.register = register; + qoopido.registerSingleton = registerSingleton; + function canonicalize(path) { + var collapsed; + while ((collapsed = path.replace(regexCanonicalize, "")) !== path) { + path = collapsed; + } + return path.replace(removeNeutral, ""); + } + if (!Object.create) { + dependencies.push("./polyfill/object/create"); + } + if (!Object.getOwnPropertyNames) { + dependencies.push("./polyfill/object/getownpropertynames"); + } + if (!Object.getOwnPropertyDescriptor || !function() { + try { + Object.getOwnPropertyDescriptor({ + x: 0 + }, "x"); + return true; + } catch (exception) { + return false; + } + }()) { + dependencies.push("./polyfill/object/getownpropertydescriptor"); + } + register("base", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + function getOwnPropertyDescriptors(object) { + var descriptors = {}, properties = Object.getOwnPropertyNames(object), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + descriptors[property] = Object.getOwnPropertyDescriptor(object, property); + } + return descriptors; + } + function prohibitCall() { + throw new Error("[Qoopido.js] Operation prohibited"); + } + return { + create: function() { + var instance = Object.create(this, getOwnPropertyDescriptors(this)), result; + if (instance._constructor) { + result = instance._constructor.apply(instance, arguments); + } + instance.create = instance.extend = prohibitCall; + return result || instance; + }, + extend: function(properties, final) { + var instance; + properties = properties || {}; + final = final === true; + properties._parent = this; + instance = Object.create(this, getOwnPropertyDescriptors(properties)); + if (final === true) { + instance.extend = prohibitCall; + } + return instance; + } + }; +}, navigator, this, document); +(function(definition) { + window.qoopido.register("polyfill/string/ucfirst", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!String.prototype.ucfirst) { + String.prototype.ucfirst = function() { + var self = this; + return self.charAt(0).toUpperCase() + self.slice(1); + }; + } + return String.prototype.ucfirst; +}); +(function(definition) { + window.qoopido.register("polyfill/string/lcfirst", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!String.prototype.lcfirst) { + String.prototype.lcfirst = function() { + var self = this; + return self.charAt(0).toLowerCase() + self.slice(1); + }; + } + return String.prototype.lcfirst; +}); +(function(definition) { + window.qoopido.register("polyfill/window/promise", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var STATE_PENDING = void 0, STATE_SEALED = 0, STATE_FULFILLED = 1, STATE_REJECTED = 2, queue = []; + function addCallback(fn, arg) { + var length = queue.push([ fn, arg ]); + if (length === 1) { + scheduleFlushCallbacks(); + } + } + function scheduleFlushCallbacks() { + window.setTimeout(flushCallbacks, 1); + } + function flushCallbacks() { + var i = 0, tuple; + for (;(tuple = queue[i]) !== undefined; i++) { + tuple[0](tuple[1]); + } + queue.length = 0; + } + function handleThenable(promise, value) { + var then = null, resolved; + try { + if (promise === value) { + throw new TypeError("A promises callback cannot return that same promise."); + } + if (typeof value === "function" || typeof value === "object" && value !== null) { + then = value.then; + if (typeof then === "function") { + then.call(value, function(val) { + if (resolved) { + return true; + } + resolved = true; + if (value !== val) { + resolve(promise, val); + } else { + fulfill(promise, val); + } + }, function(val) { + if (resolved) { + return true; + } + resolved = true; + reject(promise, val); + }); + return true; + } + } + } catch (exception) { + if (resolved) { + return true; + } + reject(promise, exception); + return true; + } + return false; + } + function invokeResolver(resolver, promise) { + function resolvePromise(value) { + resolve(promise, value); + } + function rejectPromise(reason) { + reject(promise, reason); + } + try { + resolver(resolvePromise, rejectPromise); + } catch (exception) { + rejectPromise(exception); + } + } + function invokeCallback(settled, promise, callback, detail) { + var hasCallback = typeof callback === "function", value, error, succeeded, failed; + if (hasCallback) { + try { + value = callback(detail); + succeeded = true; + } catch (exception) { + failed = true; + error = exception; + } + } else { + value = detail; + succeeded = true; + } + if (handleThenable(promise, value)) { + return; + } else if (hasCallback && succeeded) { + resolve(promise, value); + } else if (failed) { + reject(promise, error); + } else if (settled === STATE_FULFILLED) { + resolve(promise, value); + } else if (settled === STATE_REJECTED) { + reject(promise, value); + } + } + function resolve(promise, value) { + if (promise === value) { + fulfill(promise, value); + } else if (!handleThenable(promise, value)) { + fulfill(promise, value); + } + } + function fulfill(promise, value) { + if (promise._state !== STATE_PENDING) { + return; + } + promise._state = STATE_SEALED; + promise._detail = value; + addCallback(publishFulfillment, promise); + } + function reject(promise, reason) { + if (promise._state !== STATE_PENDING) { + return; + } + promise._state = STATE_SEALED; + promise._detail = reason; + addCallback(publishRejection, promise); + } + function publishFulfillment(promise) { + publish(promise, promise._state = STATE_FULFILLED); + } + function publishRejection(promise) { + publish(promise, promise._state = STATE_REJECTED); + } + function subscribe(parent, child, onFulfillment, onRejection) { + var subscribers = parent._subscribers, length = subscribers.length; + subscribers[length] = child; + subscribers[length + STATE_FULFILLED] = onFulfillment; + subscribers[length + STATE_REJECTED] = onRejection; + } + function publish(promise, settled) { + var child, callback, subscribers = promise._subscribers, detail = promise._detail, i = 0; + for (;(child = subscribers[i]) !== undefined; i += 3) { + callback = subscribers[i + settled]; + invokeCallback(settled, child, callback, detail); + } + promise._subscribers = null; + } + function Promise(resolver) { + var self = this; + if (typeof resolver !== "function") { + throw new TypeError("You must pass a resolver function as the first argument to the promise constructor"); + } + self._subscribers = []; + invokeResolver(resolver, self); + } + Promise.prototype = { + _state: undefined, + _detail: undefined, + _subscribers: undefined, + then: function(onFulfilled, onRejected) { + var self = this, thenPromise = new Promise(function() {}); + if (self._state) { + addCallback(function invokePromiseCallback() { + invokeCallback(self._state, thenPromise, arguments[self._state - 1], self._detail); + }); + } else { + subscribe(self, thenPromise, onFulfilled, onRejected); + } + return thenPromise; + }, + "catch": function(onRejected) { + return this.then(null, onRejected); + } + }; + if (!window.Promise) { + window.Promise = Promise; + } + return window.Promise; +}); +(function(definition) { + var dependencies = []; + if (!window.Promise) { + dependencies.push("../polyfill/window/promise"); + } + window.qoopido.register("promise/all", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + return function all(promises) { + if (Object.prototype.toString.call(promises) !== "[object Array]") { + throw new TypeError("You must pass an array to all."); + } + return new window.Promise(function(resolve, reject) { + var results = [], remaining = promises.length, i = 0, promise; + if (remaining === 0) { + resolve([]); + } + function resolver(index) { + return function(value) { + resolveAll(index, value); + }; + } + function resolveAll(index, value) { + results[index] = value; + if (--remaining === 0) { + resolve(results); + } + } + for (;(promise = promises[i]) !== undefined; i++) { + if (promise && typeof promise.then === "function") { + promise.then(resolver(i), reject); + } else { + resolveAll(i, promise); + } + } + }); + }; +}); +(function(definition) { + var dependencies = []; + if (!window.Promise) { + dependencies.push("../polyfill/window/promise"); + } + window.qoopido.register("promise/defer", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + return function defer() { + var self = this; + self.promise = new window.Promise(function(resolve, reject) { + self.resolve = resolve; + self.reject = reject; + }); + }; +}); +(function(definition) { + var dependencies = [ "./base", "./promise/all", "./promise/defer" ]; + if (!String.prototype.ucfirst) { + dependencies.push("./polyfill/string/ucfirst"); + } + if (!String.prototype.lcfirst) { + dependencies.push("./polyfill/string/lcfirst"); + } + window.qoopido.registerSingleton("support", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var CombinedPromise = modules["promise/all"], DeferredPromise = modules["promise/defer"], matchPrefix = new RegExp("^(Moz|WebKit|Khtml|ms|O|Icab)(?=[A-Z])"), removeJsPrefix = new RegExp("^(?:webkit|khtml|icab|moz|ms|o)([A-Z])"), removeCssPrefix = new RegExp("^-(?:webkit|khtml|icab|moz|ms|o)-"), convertToCamelCase = new RegExp("-([a-z])", "gi"), convertToHyphens = new RegExp("([A-Z])", "g"), callbackUcfirst = function() { + return arguments[1].ucfirst(); + }, lookup = { + prefix: null, + method: {}, + property: {}, + css: {}, + promises: { + prefix: null, + method: {}, + property: {}, + css: {}, + test: {} + } + }; + function normalize(value) { + return value.replace(removeJsPrefix, "$1").lcfirst().replace(removeCssPrefix, "").replace(convertToCamelCase, callbackUcfirst); + } + return modules["base"].extend({ + test: {}, + pool: shared.pool && shared.pool.dom, + testMultiple: function() { + var test, tests = [], i = 0; + for (;(test = arguments[i]) !== undefined; i++) { + switch (typeof test) { + case "string": + tests.push(this.test[test]()); + break; + + case "boolean": + var deferred = new DeferredPromise(); + !!test ? deferred.resolve() : deferred.reject(); + tests.push(deferred.promise); + break; + + default: + tests.push(test); + break; + } + } + return new CombinedPromise(tests); + }, + getPrefix: function() { + var self = this, stored = lookup.prefix || null, property; + if (stored === null) { + var sample = self.pool ? self.pool.obtain("div") : document.createElement("div"), styles = sample.style; + stored = false; + for (property in styles) { + if (matchPrefix.test(property)) { + stored = property.match(matchPrefix)[0]; + } + } + if (stored === false && "WebkitOpacity" in styles) { + stored = "WebKit"; + } + if (stored === false && "KhtmlOpacity" in styles) { + stored = "Khtml"; + } + stored = lookup.prefix = stored === false ? false : [ stored.toLowerCase(), stored.toLowerCase().ucfirst(), stored ]; + sample.dispose && sample.dispose(); + } + return stored; + }, + getMethod: function(pMethod, pElement) { + pMethod = normalize(pMethod); + pElement = pElement || window; + var type = pElement.tagName, pointer = lookup.method[type] = lookup.method[type] || {}, stored = pointer[pMethod] = lookup.method[type][pMethod] || null; + if (stored === null) { + stored = false; + var candidates, candidate, i = 0, uMethod = pMethod.ucfirst(), prefixes = this.getPrefix(); + if (prefixes !== false) { + candidates = (pMethod + " " + uMethod + " " + prefixes.join(uMethod + " ") + uMethod).split(" "); + } else { + candidates = [ pMethod ]; + } + for (;(candidate = candidates[i]) !== undefined; i++) { + if (pElement[candidate] !== undefined && (typeof pElement[candidate] === "function" || typeof pElement[candidate] === "object")) { + stored = candidate; + break; + } + } + lookup.method[type][pMethod] = stored; + } + return stored; + }, + getProperty: function(pProperty, pElement) { + pProperty = normalize(pProperty); + pElement = pElement || window; + var type = pElement.tagName, pointer = lookup.property[type] = lookup.property[type] || {}, stored = pointer[pProperty] = lookup.property[type][pProperty] || null; + if (stored === null) { + stored = false; + var candidates, candidate, i = 0, uProperty = pProperty.ucfirst(), prefixes = this.getPrefix(); + if (prefixes !== false) { + candidates = (pProperty + " " + uProperty + " " + prefixes.join(uProperty + " ") + uProperty).split(" "); + } else { + candidates = [ pProperty ]; + } + for (i; (candidate = candidates[i]) !== undefined; i++) { + if (pElement[candidate] !== undefined) { + stored = candidate; + break; + } + } + lookup.property[type][pProperty] = stored; + } + return stored; + }, + getCssProperty: function(pProperty) { + pProperty = normalize(pProperty); + var self = this, stored = lookup.css[pProperty] || null; + if (stored === null) { + stored = false; + var candidate, i = 0, sample = self.pool ? self.pool.obtain("div") : document.createElement("div"), uProperty = pProperty.ucfirst(), prefixes = this.getPrefix() || [], candidates = (pProperty + " " + uProperty + " " + prefixes.join(uProperty + " ") + uProperty).split(" "), prefix = ""; + for (i; (candidate = candidates[i]) !== undefined; i++) { + if (sample.style[candidate] !== undefined) { + stored = candidate; + if (i > 0) { + prefix = "-"; + } + break; + } + } + stored = lookup.css[pProperty] = stored !== false ? [ prefix + stored.replace(convertToHyphens, "-$1").toLowerCase(), stored ] : false; + sample.dispose && sample.dispose(); + } + return stored; + }, + supportsPrefix: function() { + return !!this.getPrefix(); + }, + supportsMethod: function(pMethod, pElement) { + return !!this.getMethod(pMethod, pElement); + }, + supportsProperty: function(pProperty, pElement) { + return !!this.getProperty(pProperty, pElement); + }, + supportsCssProperty: function(pProperty) { + return !!this.getCssProperty(pProperty); + }, + testPrefix: function() { + var stored = lookup.promises.prefix; + if (stored === null) { + var deferred = new DeferredPromise(), prefix = this.getPrefix(); + !!prefix ? deferred.resolve(prefix) : deferred.reject(); + stored = lookup.promises.prefix = deferred.promise; + } + return stored; + }, + testMethod: function(pMethod, pElement) { + pElement = pElement || window; + var type = pElement.tagName, pointer = lookup.promises.method[type] = lookup.promises.method[type] || {}, stored = pointer[pMethod] = lookup.promises.method[type][pMethod] || null; + if (stored === null) { + var deferred = new DeferredPromise(), method = this.getMethod(pMethod, pElement); + !!method ? deferred.resolve(method) : deferred.reject(); + stored = lookup.promises.method[type][pMethod] = deferred.promise; + } + return stored; + }, + testProperty: function(pProperty, pElement) { + pElement = pElement || window; + var type = pElement.tagName, pointer = lookup.promises.property[type] = lookup.promises.property[type] || {}, stored = pointer[pProperty] = lookup.promises.property[type][pProperty] || null; + if (stored === null) { + var deferred = new DeferredPromise(), property = this.getProperty(pProperty, pElement); + !!property ? deferred.resolve(property) : deferred.reject(); + stored = lookup.promises.property[type][pProperty] = deferred.promise; + } + return stored; + }, + testCssProperty: function(pProperty) { + var stored = lookup.promises.css[pProperty] || null; + if (stored === null) { + var deferred = new DeferredPromise(), property = this.getCssProperty(pProperty); + !!property ? deferred.resolve(property) : deferred.reject(); + stored = lookup.promises.css[pProperty] = deferred.promise; + } + return stored; + }, + addTest: function(pId, pTest) { + return this.test[pId] = function() { + var stored = lookup.promises.test[pId] || null; + if (stored === null) { + var deferred = new DeferredPromise(), parameter = Array.prototype.slice.call(arguments); + parameter.splice(0, 0, deferred); + pTest.apply(null, parameter); + stored = lookup.promises.test[pId] = deferred.promise; + } + return stored; + }; + } + }); +}); +(function(definition) { + window.qoopido.register("function/merge", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + return function merge() { + var target = arguments[0], i, properties, property, tgt, src; + for (i = 1; (properties = arguments[i]) !== undefined; i++) { + for (property in properties) { + tgt = target[property]; + src = properties[property]; + if (src !== undefined) { + if (src !== null && typeof src === "object") { + if (src.length !== undefined) { + tgt = tgt && typeof tgt === "object" && tgt.length !== undefined ? tgt : []; + } else { + tgt = tgt && typeof tgt === "object" && tgt.length === undefined ? tgt : {}; + } + target[property] = merge(tgt, src); + } else { + target[property] = src; + } + } + } + } + return target; + }; +}); +(function(definition) { + window.qoopido.register("function/unique/uuid", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var lookup = {}, regex = new RegExp("[xy]", "g"); + function generateUuid() { + return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(regex, function(c) { + var r = Math.random() * 16 | 0, v = c === "x" ? r : r & 3 | 8; + return v.toString(16); + }); + } + return function() { + var result; + do { + result = generateUuid(); + } while (typeof lookup[result] !== "undefined"); + lookup[result] = true; + return result; + }; +}); +(function(definition) { + window.qoopido.registerSingleton("hook/event", definition, [ "../base" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + function transferProperties(event, originalEvent, properties) { + var i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + event[property] = originalEvent[property]; + } + event._properties = event._properties.concat(properties); + } + var hooks = { + general: { + properties: "type altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which path".split(" "), + process: function(event, originalEvent) { + var pointer; + event.originalEvent = originalEvent; + event.isDefaultPrevented = originalEvent.defaultPrevented ? true : false; + event.isPropagationStopped = originalEvent.cancelBubble ? true : false; + event.metaKey = originalEvent.metaKey && originalEvent.metaKey !== false ? true : false; + if (!event.target) { + event.target = originalEvent.srcElement || document; + } + if (event.target.nodeType === 3) { + event.target = event.target.parentNode; + } + if (!event.path) { + event.path = []; + pointer = event.target; + do { + event.path.push(pointer); + } while (pointer = pointer.parentNode); + event.path.push(window); + } + } + }, + mouse: { + regex: new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"), + properties: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement dataTransfer".split(" "), + process: function(event, originalEvent) { + var pointer, fromElement, which; + fromElement = originalEvent.fromElement; + which = originalEvent.button; + if (event.pageX === null && originalEvent.clientX !== null) { + pointer = event.target.ownerDocument || document; + pointer = pointer.documentElement || pointer.body; + event.pageX = originalEvent.clientX + (pointer.scrollLeft || 0) - (pointer.clientLeft || 0); + event.pageY = originalEvent.clientY + (pointer.scrollTop || 0) - (pointer.clientTop || 0); + } + if (!event.relatedTarget && fromElement) { + event.relatedTarget = fromElement === event.target ? originalEvent.toElement : fromElement; + } + if (!event.which && which !== undefined) { + event.which = which & 1 ? 1 : which & 2 ? 3 : which & 4 ? 2 : 0; + } + } + }, + key: { + regex: new RegExp("^(?:key)"), + properties: "char charCode key keyCode".split(" "), + process: function(event, originalEvent) { + if (event.which === null) { + event.which = originalEvent.charCode !== null ? originalEvent.charCode : originalEvent.keyCode; + } + } + } + }; + return modules["base"].extend({ + add: function(property, hook) { + if (property && hook && hooks[property]) { + hooks[property] = hook; + } + return this; + }, + get: function(property) { + if (property && hooks[property]) { + return hooks[property]; + } + return null; + }, + process: function(event, originalEvent) { + var id, hook, isMatch; + for (id in hooks) { + hook = hooks[id]; + isMatch = !hook.regex || hook.regex.test(originalEvent.type); + if (isMatch) { + if (hook.properties) { + transferProperties(event, originalEvent, hook.properties); + } + if (hook.process) { + hook.process(event, originalEvent); + } + if (hook.delegate) { + event.delegate = hook.delegate; + } + } + } + } + }); +}); +(function(definition) { + var dependencies = [ "../base", "../support" ]; + if (!window.getComputedStyle) { + dependencies.push("../polyfill/window/getcomputedstyle"); + } + window.qoopido.registerSingleton("hook/css", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var mSupport = modules["support"], getComputedStyle = window.getComputedStyle || modules["polyfill/window/getcomputedstyle"], hooks = { + general: { + get: function(element, property) { + return getComputedStyle(element, null).getPropertyValue(property[0]); + }, + set: function(element, property, value) { + element.style[property[1]] = value; + } + }, + opacity: !mSupport.supportsCssProperty("opacity") ? { + regex: new RegExp("alpha\\(opacity=(.*)\\)", "i"), + get: function(element, property, value) { + value = getComputedStyle(element, null).getPropertyValue("filter").toString().match(this.regex); + if (value) { + value = value[1] / 100; + } else { + value = 1; + } + return value; + }, + set: function(element, property, value) { + var style = element.style; + style.zoom = 1; + style.filter = "alpha(opacity=" + (value * 100 + .5 >> 0) + ")"; + } + } : null + }; + return modules["base"].extend({ + add: function(property, hook) { + if (property && hook && hooks[property]) { + hooks[property] = hook; + } + return this; + }, + get: function(property) { + if (property && hooks[property]) { + return hooks[property]; + } + return null; + }, + process: function(method, element, property, value) { + var hook; + property = mSupport.getCssProperty(property, element) || null; + if (property) { + return ((hook = this.get(property[1])) && hook[method] || this.get("general")[method])(element, property, value); + } + } + }); +}); +(function(definition) { + window.qoopido.register("dom/event", definition, [ "../base", "../hook/event" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var hooks = modules["hook/event"]; + return modules["base"].extend({ + originalEvent: null, + isDelegate: false, + isDefaultPrevented: false, + isPropagationStopped: false, + isImmediatePropagationStopped: false, + _properties: null, + _constructor: function(event) { + var self = this; + self._properties = []; + self._obtain(event); + return self; + }, + _obtain: function(event) { + hooks.process(this, event); + }, + _dispose: function() { + var self = this, i = 0, property; + for (;(property = self._properties[i]) !== undefined; i++) { + delete self[property]; + } + delete self.delegate; + self.originalEvent = null; + self.isDelegate = false; + self.isDefaultPrevented = false; + self.isPropagationStopped = false; + self.isImmediatePropagationStopped = false; + self._properties.length = 0; + }, + preventDefault: function() { + var self = this, event = self.originalEvent; + if (event.cancelable !== false) { + self.isDefaultPrevented = true; + if (event.preventDefault) { + event.preventDefault(); + } else { + event.returnValue = false; + } + } + }, + stopPropagation: function() { + var self = this, event = self.originalEvent; + self.isPropagationStopped = true; + if (event.stopPropagation) { + event.stopPropagation(); + } + event.cancelBubble = true; + }, + stopImmediatePropagation: function() { + var self = this, event = self.originalEvent; + self.isImmediatePropagationStopped = true; + if (event.stopImmediatePropagation) { + event.stopImmediatePropagation(); + } + self.stopPropagation(); + } + }); +}); +(function(definition) { + var dependencies = [ "../base", "../function/unique/uuid", "../hook/css", "./event" ]; + if (!window.CustomEvent) { + dependencies.push("../polyfill/window/customevent"); + } + if (!window.addEventListener) { + dependencies.push("../polyfill/window/addeventlistener"); + } + if (!window.removeEventListener) { + dependencies.push("../polyfill/window/removeeventlistener"); + } + if (!window.dispatchEvent) { + dependencies.push("../polyfill/window/dispatchevent"); + } + if (!Element.prototype.matches) { + dependencies.push("../polyfill/element/matches"); + } + if (!document.querySelector) { + dependencies.push("../polyfill/document/queryselector"); + } + if (!document.querySelectorAll) { + dependencies.push("../polyfill/document/queryselectorall"); + } + if (!String.prototype.trim) { + dependencies.push("../polyfill/string/trim"); + } + window.qoopido.register("dom/element", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var stringObject = "object", stringString = "string", generateUuid = modules["function/unique/uuid"], head = document.getElementsByTagName("head")[0], contentAttribute = "textContent" in document.createElement("a") ? "textContent" : "innerText", previousSibling = typeof head.previousElementSibling !== "undefined" ? function previousSibling() { + return this.previousElementSibling; + } : function previousSibling() { + var element = this; + while (element = element.previousSibling) { + if (element.nodeType === 1) { + return element; + } + } + }, nextSibling = typeof head.nextElementSibling !== "undefined" ? function nextSibling() { + return this.nextElementSibling; + } : function nextSibling() { + var element = this; + while (element = element.nextSibling) { + if (element.nodeType === 1) { + return element; + } + } + }, isTag = new RegExp("^<(\\w+)\\s*/>$"), matchEvent = new RegExp("^[^-]+"), splitList = new RegExp(" +", "g"), pool = modules["pool/module"] && modules["pool/module"].create(modules["dom/event"], null, true) || null, hooks = modules["hook/css"], storage = {}, events = { + custom: { + type: "CustomEvent", + method: "initCustomEvent" + }, + html: { + regex: new RegExp("^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$"), + type: "HTMLEvents", + method: "initEvent" + }, + mouse: { + regex: new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"), + type: "MouseEvents", + method: "initMouseEvent" + } + }; + function resolveEvent(type) { + var id, prototype, candidate; + for (id in events) { + prototype = events[id]; + if (!prototype.regex || prototype.regex.test(type)) { + candidate = prototype; + } + } + return candidate; + } + function emitEvent(type, detail, uuid) { + var self = this, prototype = resolveEvent(type), event = document.createEvent(prototype.type); + event[prototype.method](type, type === "load" ? false : true, true, detail); + if (uuid) { + event._quid = uuid; + event.isDelegate = true; + } + self.element.dispatchEvent(event); + } + function resolveElement(element) { + var tag; + if (typeof element === "string") { + try { + if (isTag.test(element) === true) { + tag = element.replace(isTag, "$1").toLowerCase(); + element = document.createElement(tag); + } else { + element = document.querySelector(element); + } + } catch (exception) { + element = null; + } + } + if (!element) { + throw new Error("[Qoopido.js] Element could not be resolved"); + } + return element; + } + function resolveArguments(parameters) { + return Array.prototype.concat.apply([], Array.prototype.splice.call(parameters, 0)).join(" ").split(splitList); + } + function matchesDelegate(event, delegate) { + var i = 0, pointer; + for (;(pointer = event.path[i]) !== undefined; i++) { + if (pointer.matches(delegate)) { + event.currentTarget = pointer; + return true; + } + if (pointer === event.currentTarget) { + break; + } + } + return false; + } + return modules["base"].extend({ + type: null, + element: null, + _listener: null, + _constructor: function(element, attributes, styles) { + var self = this, uuid; + element = resolveElement(element); + uuid = element._quid; + if (!uuid) { + uuid = element._quid = generateUuid(); + self.type = element.tagName; + self.element = element; + self._listener = {}; + storage[uuid] = self; + } else { + self = storage[uuid]; + } + if (typeof attributes === "object" && attributes !== null) { + self.setAttributes(attributes); + } + if (typeof styles === "object" && styles !== null) { + self.setStyles(styles); + } + if (self !== this) { + this.dispose && this.dispose(); + } + return self; + }, + _obtain: function(element, attributes, styles) { + this._constructor(element, attributes, styles); + }, + _dispose: function() { + var self = this, id, event; + for (id in self._listener) { + event = id.match(matchEvent); + self.element.removeEventListener(event, self._listener[id]); + delete self._listener[id]; + } + self.type = null; + self.element = null; + }, + getContent: function(html) { + var element = this.element; + return html && html !== false ? element.innerHTML : element[contentAttribute]; + }, + setContent: function(content, html) { + var self = this, element = self.element; + if (html && html !== false) { + element.innerHTML = content; + } else { + element[contentAttribute] = content; + } + return self; + }, + getAttribute: function(attribute) { + var self = this; + if (attribute && typeof attribute === stringString) { + return self.element.getAttribute(attribute); + } + }, + getAttributes: function() { + var self = this, result = {}, attributes = resolveArguments(arguments), i = 0, attribute; + for (;(attribute = attributes[i]) !== undefined; i++) { + result[attribute] = self.element.getAttribute(attribute); + } + return result; + }, + setAttribute: function(attribute, value) { + var self = this; + if (attribute && typeof attribute === stringString) { + self.element.setAttribute(attribute, value); + } + return self; + }, + setAttributes: function(attributes) { + var self = this, attribute; + if (attributes && typeof attributes === stringObject && !attributes.length) { + for (attribute in attributes) { + self.element.setAttribute(attribute, attributes[attribute]); + } + } + return self; + }, + removeAttribute: function(attribute) { + var self = this; + if (attribute && typeof attribute === stringString) { + self.element.removeAttribute(attribute); + } + return self; + }, + removeAttributes: function() { + var self = this, attributes = resolveArguments(arguments), i = 0, attribute; + for (;(attribute = attributes[i]) !== undefined; i++) { + self.element.removeAttribute(attribute); + } + return self; + }, + getStyle: function(property) { + var self = this; + if (property && typeof property === stringString) { + return hooks.process("get", self.element, property); + } + }, + getStyles: function() { + var self = this, result = {}, properties = resolveArguments(arguments), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + result[property] = hooks.process("get", self.element, property); + } + return result; + }, + setStyle: function(property, value) { + var self = this; + if (property && typeof property === stringString) { + hooks.process("set", self.element, property, value); + } + return self; + }, + setStyles: function(properties) { + var self = this, property; + if (properties && typeof properties === stringObject && !properties.length) { + for (property in properties) { + hooks.process("set", self.element, property, properties[property]); + } + } + return self; + }, + removeStyle: function(property) { + var self = this; + if (property && typeof property === stringString) { + self.setStyle(property, ""); + } + return self; + }, + removeStyles: function() { + var self = this, properties = resolveArguments(arguments), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + self.setStyle(property, ""); + } + return self; + }, + siblings: function(selector) { + var element = this.element, pointer = element.parentNode.firstChild, siblings = []; + for (;pointer; pointer = nextSibling.call(pointer)) { + if (pointer !== element && (!selector || pointer.matches(selector))) { + siblings.push(pointer); + } + } + return siblings; + }, + siblingsBefore: function(selector) { + var pointer = this.element.previousSibling, siblings = []; + for (;pointer; pointer = previousSibling.call(pointer)) { + if (!selector || pointer.matches(selector)) { + siblings.push(pointer); + } + } + return siblings; + }, + siblingsAfter: function(selector) { + var pointer = this.element.nextSibling, siblings = []; + for (;pointer; pointer = nextSibling.call(pointer)) { + if (!selector || pointer.matches(selector)) { + siblings.push(pointer); + } + } + return siblings; + }, + previous: function(selector) { + var pointer = previousSibling.call(this.element); + if (!selector) { + return pointer; + } else { + for (;pointer; pointer = previousSibling.call(pointer)) { + if (pointer.matches(selector)) { + return pointer; + } + } + } + }, + next: function(selector) { + var pointer = nextSibling.call(this.element); + if (!selector) { + return pointer; + } else { + for (;pointer; pointer = nextSibling.call(pointer)) { + if (pointer.matches(selector)) { + return pointer; + } + } + } + }, + find: function(selector) { + var self = this.element, uuid, matches; + selector = selector.trim(); + if (selector.charAt(0) === ">") { + uuid = self._quid; + self.setAttribute("data-quid", uuid); + selector = '[data-quid="' + uuid + '"] ' + selector; + matches = self.parentNode.querySelectorAll(selector); + self.removeAttribute("data-quid"); + } else { + matches = self.querySelectorAll(selector); + } + return matches; + }, + parent: function(selector) { + var pointer; + if (!selector) { + return this.element.parentNode; + } else { + pointer = this.element; + for (;pointer; pointer = pointer.parentNode) { + if (pointer.matches(selector)) { + return pointer; + } + } + } + }, + parents: function(selector) { + var pointer = this.element.parentNode, parents = []; + for (;pointer; pointer = pointer.parentNode) { + if (pointer.nodeType === 9) { + return parents; + } else if (pointer.nodeType === 1) { + if (!selector || pointer.matches(selector)) { + parents.push(pointer); + } + } + } + }, + isVisible: function() { + var self = this, element = self.element; + return !(element.offsetWidth <= 0 && element.offsetHeight <= 0 || self.getStyle("visibility") === "hidden" || self.getStyle("opacity") <= 0); + }, + hasClass: function(name) { + return name ? new RegExp("(?:^|\\s)" + name + "(?:\\s|$)").test(this.element.className) : false; + }, + addClass: function(name) { + var self = this; + if (name && !self.hasClass(name)) { + self.element.className += self.element.className ? " " + name : name; + } + return self; + }, + removeClass: function(name) { + var self = this; + if (name && self.hasClass(name)) { + self.element.className = self.element.className.replace(new RegExp("(?:^|\\s)" + name + "(?!\\S)"), ""); + } + return self; + }, + toggleClass: function(name) { + var self = this; + if (name) { + self.hasClass(name) ? self.removeClass(name) : self.addClass(name); + } + return self; + }, + prepend: function(element) { + var self = this, target = self.element; + if (element) { + try { + element = element.element || resolveElement(element); + target.firstChild ? target.insertBefore(element, target.firstChild) : self.append(element); + } catch (exception) { + target.insertAdjacentHTML("afterBegin", element); + } + } + return self; + }, + append: function(element) { + var self = this, target = self.element; + if (element) { + try { + target.appendChild(element.element || resolveElement(element)); + } catch (exception) { + target.insertAdjacentHTML("beforeEnd", element); + } + } + return self; + }, + prependTo: function(target) { + var self = this, element = self.element; + if (target) { + (target = target.element || resolveElement(target)).firstChild ? target.insertBefore(element, target.firstChild) : self.appendTo(target); + } + return self; + }, + appendTo: function(target) { + var self = this; + if (target) { + (target.element || resolveElement(target)).appendChild(self.element); + } + return self; + }, + insertBefore: function(target) { + var self = this, element = self.element; + if (target) { + (target = target.element || resolveElement(target)).parentNode.insertBefore(element, target); + } + return self; + }, + insertAfter: function(target) { + var self = this, element = self.element; + if (target) { + (target = target.element || resolveElement(target)).nextSibling ? target.parentNode.insertBefore(element, target.nextSibling) : self.appendTo(target.parentNode); + } + return self; + }, + replace: function(target) { + var self = this, element = self.element; + if (target) { + (target = target.element || resolveElement(target)).parentNode.replaceChild(element, target); + } + return self; + }, + replaceWith: function(element) { + var self = this, target = self.element; + if (element) { + element = element.element || resolveElement(element); + target.parentNode.replaceChild(element, target); + } + return self; + }, + remove: function() { + var self = this, element = self.element; + element.parentNode.removeChild(element); + return self; + }, + on: function(events) { + var self = this, element = self.element, delegate = arguments.length > 2 ? arguments[1] : null, fn = arguments.length > 2 ? arguments[2] : arguments[1], uuid = fn._quid || (fn._quid = generateUuid()), i = 0, event; + events = events.split(" "); + for (;(event = events[i]) !== undefined; i++) { + var id = event + "-" + uuid, listener = function(event) { + var delegateTo; + event = pool && pool.obtain(event) || modules["dom/event"].create(event); + if (!event.isPropagationStopped) { + delegateTo = event.delegate; + event._quid = generateUuid(); + if (!delegate || matchesDelegate(event, delegate)) { + fn.call(event.currentTarget, event, event.originalEvent.detail); + } + if (delegateTo) { + delete event.delegate; + emitEvent.call(self, delegateTo); + } + } + event.dispose && event.dispose(); + }; + listener.type = event; + self._listener[id] = listener; + element.addEventListener(event, listener); + } + return self; + }, + one: function(events) { + var self = this, delegate = arguments.length > 3 || typeof arguments[1] === "string" ? arguments[1] : null, fn = arguments.length > 3 || typeof arguments[2] === "function" ? arguments[2] : arguments[1], each = (arguments.length > 3 ? arguments[3] : arguments[2]) !== false, listener = function(event) { + self.off(each === true ? event.type : events, listener); + fn.call(this, event, event.originalEvent.detail); + }; + fn._quid = listener._quid = generateUuid(); + if (delegate) { + self.on(events, delegate, listener); + } else { + self.on(events, listener); + } + return self; + }, + off: function(events, fn) { + var self = this, element = self.element, i = 0, event, id, listener; + events = events.split(" "); + for (;(event = events[i]) !== undefined; i++) { + id = fn._quid && event + "-" + fn._quid || null; + listener = id && self._listener[id] || null; + if (listener) { + element.removeEventListener(event, listener); + delete self._listener[id]; + } else { + element.removeEventListener(event, fn); + } + } + return self; + }, + emit: function(event, data) { + var self = this; + emitEvent.call(self, event, data); + return self; + } + }); +}); +(function(definition) { + window.qoopido.register("dom/element/emerge", definition, [ "../element", "../../function/merge", "../../function/unique/uuid" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var defaults = { + interval: 50, + threshold: "auto", + recur: true, + auto: 1, + visibility: true + }, documentElement = window.document.documentElement, viewport = {}, intervals = {}, elements = {}, prototype, EVENT_EMERGED = "emerged", EVENT_DEMERGED = "demerged", DOM_RESIZE = "resize orientationchange"; + window = modules["dom/element"].create(window); + if (document.compatMode !== "CSS1Compat") { + throw "[Qoopido.js] Not in standards mode"; + } + function tick(interval) { + var index, pointer = elements[interval]; + for (index in pointer) { + if (index !== "length") { + checkState.call(pointer[index]); + } + } + if (pointer.length === 0) { + window.element.clearInterval(intervals[interval]); + delete intervals[interval]; + } + } + function globalOnResize() { + viewport.left = 0; + viewport.top = 0; + viewport.right = window.innerWidth || documentElement.clientWidth; + viewport.bottom = window.innerHeight || documentElement.clientHeight; + } + function instanceOnResize() { + var self = this, treshold = self._settings.threshold, x = treshold !== undefined ? treshold : documentElement.clientWidth * self._settings.auto, y = treshold !== undefined ? treshold : documentElement.clientHeight * self._settings.auto; + self._viewport.left = viewport.left - x; + self._viewport.top = viewport.top - y; + self._viewport.right = viewport.right + x; + self._viewport.bottom = viewport.bottom + y; + } + function checkState() { + var self = this, state = false, priority = 2, boundaries; + if (self.isVisible() && (self.getStyle("visibility") !== "hidden" || self._settings.visibility === false)) { + boundaries = self.element.getBoundingClientRect(); + if ((boundaries.bottom >= self._viewport.top && boundaries.bottom <= self._viewport.bottom || boundaries.top >= self._viewport.top && boundaries.top <= self._viewport.bottom || self._viewport.bottom >= boundaries.top && self._viewport.bottom <= boundaries.bottom || self._viewport.top >= boundaries.top && self._viewport.top <= boundaries.bottom) && (boundaries.left >= self._viewport.left && boundaries.left <= self._viewport.right || boundaries.right >= self._viewport.left && boundaries.right <= self._viewport.right || self._viewport.left >= boundaries.left && self._viewport.left <= boundaries.right || self._viewport.right >= boundaries.left && self._viewport.right <= boundaries.right)) { + if (self._settings.threshold === 0 || (boundaries.bottom >= viewport.top && boundaries.bottom <= viewport.bottom || boundaries.top >= viewport.top && boundaries.top <= viewport.bottom || viewport.bottom >= boundaries.top && viewport.bottom <= boundaries.bottom || viewport.top >= boundaries.top && viewport.top <= boundaries.bottom) && (boundaries.left >= viewport.left && boundaries.left <= viewport.right || boundaries.right >= viewport.left && boundaries.right <= viewport.right || viewport.left >= boundaries.left && viewport.left <= boundaries.right || viewport.right >= boundaries.left && viewport.right <= boundaries.right)) { + priority = 1; + } + state = true; + } + } + if (state !== self._state || state === true && priority !== self._priority) { + setState.call(self, state, priority); + } + } + function setState(state, priority) { + var self = this; + self._state = state; + self._priority = priority; + if (self._settings.recur !== true) { + self.remove(); + } + if (state === true) { + self.emit(EVENT_EMERGED, priority); + } else { + self.emit(EVENT_DEMERGED); + } + } + prototype = modules["dom/element"].extend({ + _quid: null, + _viewport: null, + _settings: null, + _state: null, + _priority: null, + _constructor: function(element, settings) { + var self = prototype._parent._constructor.call(this, element); + settings = modules["function/merge"]({}, defaults, settings || {}); + if (settings.threshold === "auto") { + delete settings.threshold; + } + if (intervals[settings.interval] === undefined) { + elements[settings.interval] = elements[settings.interval] || { + length: 0 + }; + intervals[settings.interval] = window.element.setInterval(function() { + tick(settings.interval); + }, settings.interval); + } + self._quid = modules["function/unique/uuid"](); + self._viewport = {}; + self._settings = settings; + self._state = false; + self._priority = 2; + elements[settings.interval][self._quid] = self; + elements[settings.interval].length++; + window.on(DOM_RESIZE, function() { + instanceOnResize.call(self); + }); + instanceOnResize.call(self); + return self; + }, + remove: function() { + var self = this; + delete elements[self._settings.interval][self._quid]; + elements[self._settings.interval].length--; + } + }); + window.on(DOM_RESIZE, globalOnResize); + globalOnResize(); + return prototype; +}); \ No newline at end of file diff --git a/dist/3.7.3/max/packages/qoopido.emerge.legacy.js b/dist/3.7.3/max/packages/qoopido.emerge.legacy.js new file mode 100644 index 00000000..aed5e61f --- /dev/null +++ b/dist/3.7.3/max/packages/qoopido.emerge.legacy.js @@ -0,0 +1,1649 @@ +/*! +* Qoopido.js library +* +* version: 3.7.3 +* date: 2015-08-05 +* author: Dirk Lueth +* website: https://github.com/dlueth/qoopido.js +* +* Copyright (c) 2015 Dirk Lueth +*/ +(function(definition, qoopido) { + if (qoopido.register) { + qoopido.register("polyfill/object/defineproperty", definition); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/defineproperty"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.defineProperty || !function() { + try { + Object.defineProperty({}, "x", {}); + return true; + } catch (exception) { + return false; + } + }()) { + var defineProperty = Object.defineProperty, defineGetter = Object.prototype.__defineGetter__, defineSetter = Object.prototype.__defineSetter__; + Object.defineProperty = function(obj, prop, desc) { + if (defineProperty) { + try { + return defineProperty(obj, prop, desc); + } catch (exception) {} + } + if (obj !== Object(obj)) { + throw new TypeError("Object.defineProperty called on non-object"); + } + if (defineGetter && "get" in desc) { + defineGetter.call(obj, prop, desc.get); + } + if (defineSetter && "set" in desc) { + defineSetter.call(obj, prop, desc.set); + } + if ("value" in desc) { + obj[prop] = desc.value; + } + return obj; + }; + } + return Object.defineProperty; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + var dependencies = []; + if (!Object.defineProperty || !function() { + try { + Object.defineProperty({}, "x", {}); + return true; + } catch (exception) { + return false; + } + }()) { + dependencies.push("./defineproperty"); + } + qoopido.register("polyfill/object/defineproperties", definition, dependencies); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/defineproperties"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.defineProperties) { + Object.defineProperties = function(obj, properties) { + if (obj !== Object(obj)) { + throw new TypeError("Object.defineProperties called on non-object"); + } + var name; + for (name in properties) { + if (Object.prototype.hasOwnProperty.call(properties, name)) { + Object.defineProperty(obj, name, properties[name]); + } + } + return obj; + }; + } + return Object.defineProperties; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + var dependencies = []; + if (!Object.defineProperties) { + dependencies.push("./defineproperties"); + } + qoopido.register("polyfill/object/create", definition, dependencies); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/create"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.create) { + Object.create = function(prototype, properties) { + if (typeof prototype !== "object") { + throw new TypeError(); + } + function Constructor() {} + Constructor.prototype = prototype; + var obj = new Constructor(); + if (prototype) { + obj.constructor = Constructor; + } + if (arguments.length > 1) { + if (properties !== Object(properties)) { + throw new TypeError(); + } + Object.defineProperties(obj, properties); + } + return obj; + }; + } + return Object.create; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + qoopido.register("polyfill/object/getownpropertynames", definition); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/getownpropertynames"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.getOwnPropertyNames) { + Object.getOwnPropertyNames = function(obj) { + if (obj !== Object(obj)) { + throw new TypeError("Object.getOwnPropertyNames called on non-object"); + } + var props = [], p; + for (p in obj) { + if (Object.prototype.hasOwnProperty.call(obj, p)) { + props.push(p); + } + } + return props; + }; + } + return Object.getOwnPropertyNames; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + qoopido.register("polyfill/object/getownpropertydescriptor", definition); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/getownpropertydescriptor"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.getOwnPropertyDescriptor || !function() { + try { + Object.getOwnPropertyDescriptor({ + x: 0 + }, "x"); + return true; + } catch (exception) { + return false; + } + }()) { + var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; + Object.getOwnPropertyDescriptor = function(obj, property) { + if (obj !== Object(obj)) { + throw new TypeError(); + } + try { + return getOwnPropertyDescriptor.call(Object, obj, property); + } catch (exception) {} + if (Object.prototype.hasOwnProperty.call(obj, property)) { + return { + value: obj[property], + enumerable: true, + writable: true, + configurable: true + }; + } + }; + } + return Object.getOwnPropertyDescriptor; +}, window.qoopido = window.qoopido || {}); +(function(definition, navigator, global, document, undefined) { + "use strict"; + function register(id, definition, dependencies, callback) { + var namespace = id.split("/"), initialize; + if (modules[id]) { + return modules[id]; + } + initialize = function() { + if (dependencies) { + var path = namespace.slice(0, -1).join("/"), i = 0, dependency, internal; + for (;(dependency = dependencies[i]) !== undefined; i++) { + internal = isInternal.test(dependency); + if (internal) { + dependency = canonicalize(path + "/" + dependency); + } + if (!modules[dependency] && arguments[i]) { + modules[dependency] = arguments[i]; + } + if (internal && !modules[dependency] && typeof console !== "undefined") { + console.error("".concat("[Qoopido.js] ", id, ": Could not load dependency ", dependency)); + } + } + } + modules[id] = definition(modules, shared, namespace, navigator, global, document, undefined); + if (callback) { + callback(modules[id]); + } + return modules[id]; + }; + if (typeof module !== "undefined" && module.exports) { + module.exports = define(initialize); + } else if (typeof define === "function" && define.amd) { + dependencies ? define(dependencies, initialize) : define(initialize); + } else { + initialize(); + } + } + function registerSingleton(id, definition, dependencies) { + register(id, definition, dependencies, function(module) { + modules[id] = module.create(); + }); + } + var qoopido = global.qoopido || (global.qoopido = {}), shared = qoopido.shared || (qoopido.shared = {}), modules = qoopido.modules || (qoopido.modules = {}), dependencies = [], isInternal = new RegExp("^\\.+\\/"), regexCanonicalize = new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."), removeNeutral = new RegExp("(^\\/)|\\.\\/", "g"); + qoopido.register = register; + qoopido.registerSingleton = registerSingleton; + function canonicalize(path) { + var collapsed; + while ((collapsed = path.replace(regexCanonicalize, "")) !== path) { + path = collapsed; + } + return path.replace(removeNeutral, ""); + } + if (!Object.create) { + dependencies.push("./polyfill/object/create"); + } + if (!Object.getOwnPropertyNames) { + dependencies.push("./polyfill/object/getownpropertynames"); + } + if (!Object.getOwnPropertyDescriptor || !function() { + try { + Object.getOwnPropertyDescriptor({ + x: 0 + }, "x"); + return true; + } catch (exception) { + return false; + } + }()) { + dependencies.push("./polyfill/object/getownpropertydescriptor"); + } + register("base", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + function getOwnPropertyDescriptors(object) { + var descriptors = {}, properties = Object.getOwnPropertyNames(object), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + descriptors[property] = Object.getOwnPropertyDescriptor(object, property); + } + return descriptors; + } + function prohibitCall() { + throw new Error("[Qoopido.js] Operation prohibited"); + } + return { + create: function() { + var instance = Object.create(this, getOwnPropertyDescriptors(this)), result; + if (instance._constructor) { + result = instance._constructor.apply(instance, arguments); + } + instance.create = instance.extend = prohibitCall; + return result || instance; + }, + extend: function(properties, final) { + var instance; + properties = properties || {}; + final = final === true; + properties._parent = this; + instance = Object.create(this, getOwnPropertyDescriptors(properties)); + if (final === true) { + instance.extend = prohibitCall; + } + return instance; + } + }; +}, navigator, this, document); +(function(definition) { + window.qoopido.register("polyfill/string/ucfirst", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!String.prototype.ucfirst) { + String.prototype.ucfirst = function() { + var self = this; + return self.charAt(0).toUpperCase() + self.slice(1); + }; + } + return String.prototype.ucfirst; +}); +(function(definition) { + window.qoopido.register("polyfill/string/lcfirst", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!String.prototype.lcfirst) { + String.prototype.lcfirst = function() { + var self = this; + return self.charAt(0).toLowerCase() + self.slice(1); + }; + } + return String.prototype.lcfirst; +}); +(function(definition) { + window.qoopido.register("polyfill/window/getcomputedstyle", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!window.getComputedStyle) { + var getComputedStyleRegex = new RegExp("(\\-([a-z]){1})", "g"), getComputedStyleCallback = function() { + return arguments[2].toUpperCase(); + }; + return function(element, pseudo) { + var self = this; + self.getPropertyValue = function(property) { + if (property === "float") { + property = "styleFloat"; + } + if (getComputedStyleRegex.test(property)) { + property = property.replace(getComputedStyleRegex, getComputedStyleCallback); + } + return element.currentStyle[property] || null; + }; + return self; + }; + } else { + return window.getComputedStyle; + } +}); +(function(definition) { + window.qoopido.register("polyfill/window/promise", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var STATE_PENDING = void 0, STATE_SEALED = 0, STATE_FULFILLED = 1, STATE_REJECTED = 2, queue = []; + function addCallback(fn, arg) { + var length = queue.push([ fn, arg ]); + if (length === 1) { + scheduleFlushCallbacks(); + } + } + function scheduleFlushCallbacks() { + window.setTimeout(flushCallbacks, 1); + } + function flushCallbacks() { + var i = 0, tuple; + for (;(tuple = queue[i]) !== undefined; i++) { + tuple[0](tuple[1]); + } + queue.length = 0; + } + function handleThenable(promise, value) { + var then = null, resolved; + try { + if (promise === value) { + throw new TypeError("A promises callback cannot return that same promise."); + } + if (typeof value === "function" || typeof value === "object" && value !== null) { + then = value.then; + if (typeof then === "function") { + then.call(value, function(val) { + if (resolved) { + return true; + } + resolved = true; + if (value !== val) { + resolve(promise, val); + } else { + fulfill(promise, val); + } + }, function(val) { + if (resolved) { + return true; + } + resolved = true; + reject(promise, val); + }); + return true; + } + } + } catch (exception) { + if (resolved) { + return true; + } + reject(promise, exception); + return true; + } + return false; + } + function invokeResolver(resolver, promise) { + function resolvePromise(value) { + resolve(promise, value); + } + function rejectPromise(reason) { + reject(promise, reason); + } + try { + resolver(resolvePromise, rejectPromise); + } catch (exception) { + rejectPromise(exception); + } + } + function invokeCallback(settled, promise, callback, detail) { + var hasCallback = typeof callback === "function", value, error, succeeded, failed; + if (hasCallback) { + try { + value = callback(detail); + succeeded = true; + } catch (exception) { + failed = true; + error = exception; + } + } else { + value = detail; + succeeded = true; + } + if (handleThenable(promise, value)) { + return; + } else if (hasCallback && succeeded) { + resolve(promise, value); + } else if (failed) { + reject(promise, error); + } else if (settled === STATE_FULFILLED) { + resolve(promise, value); + } else if (settled === STATE_REJECTED) { + reject(promise, value); + } + } + function resolve(promise, value) { + if (promise === value) { + fulfill(promise, value); + } else if (!handleThenable(promise, value)) { + fulfill(promise, value); + } + } + function fulfill(promise, value) { + if (promise._state !== STATE_PENDING) { + return; + } + promise._state = STATE_SEALED; + promise._detail = value; + addCallback(publishFulfillment, promise); + } + function reject(promise, reason) { + if (promise._state !== STATE_PENDING) { + return; + } + promise._state = STATE_SEALED; + promise._detail = reason; + addCallback(publishRejection, promise); + } + function publishFulfillment(promise) { + publish(promise, promise._state = STATE_FULFILLED); + } + function publishRejection(promise) { + publish(promise, promise._state = STATE_REJECTED); + } + function subscribe(parent, child, onFulfillment, onRejection) { + var subscribers = parent._subscribers, length = subscribers.length; + subscribers[length] = child; + subscribers[length + STATE_FULFILLED] = onFulfillment; + subscribers[length + STATE_REJECTED] = onRejection; + } + function publish(promise, settled) { + var child, callback, subscribers = promise._subscribers, detail = promise._detail, i = 0; + for (;(child = subscribers[i]) !== undefined; i += 3) { + callback = subscribers[i + settled]; + invokeCallback(settled, child, callback, detail); + } + promise._subscribers = null; + } + function Promise(resolver) { + var self = this; + if (typeof resolver !== "function") { + throw new TypeError("You must pass a resolver function as the first argument to the promise constructor"); + } + self._subscribers = []; + invokeResolver(resolver, self); + } + Promise.prototype = { + _state: undefined, + _detail: undefined, + _subscribers: undefined, + then: function(onFulfilled, onRejected) { + var self = this, thenPromise = new Promise(function() {}); + if (self._state) { + addCallback(function invokePromiseCallback() { + invokeCallback(self._state, thenPromise, arguments[self._state - 1], self._detail); + }); + } else { + subscribe(self, thenPromise, onFulfilled, onRejected); + } + return thenPromise; + }, + "catch": function(onRejected) { + return this.then(null, onRejected); + } + }; + if (!window.Promise) { + window.Promise = Promise; + } + return window.Promise; +}); +(function(definition) { + var dependencies = []; + if (!window.Promise) { + dependencies.push("../polyfill/window/promise"); + } + window.qoopido.register("promise/all", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + return function all(promises) { + if (Object.prototype.toString.call(promises) !== "[object Array]") { + throw new TypeError("You must pass an array to all."); + } + return new window.Promise(function(resolve, reject) { + var results = [], remaining = promises.length, i = 0, promise; + if (remaining === 0) { + resolve([]); + } + function resolver(index) { + return function(value) { + resolveAll(index, value); + }; + } + function resolveAll(index, value) { + results[index] = value; + if (--remaining === 0) { + resolve(results); + } + } + for (;(promise = promises[i]) !== undefined; i++) { + if (promise && typeof promise.then === "function") { + promise.then(resolver(i), reject); + } else { + resolveAll(i, promise); + } + } + }); + }; +}); +(function(definition) { + var dependencies = []; + if (!window.Promise) { + dependencies.push("../polyfill/window/promise"); + } + window.qoopido.register("promise/defer", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + return function defer() { + var self = this; + self.promise = new window.Promise(function(resolve, reject) { + self.resolve = resolve; + self.reject = reject; + }); + }; +}); +(function(definition) { + var dependencies = [ "./base", "./promise/all", "./promise/defer" ]; + if (!String.prototype.ucfirst) { + dependencies.push("./polyfill/string/ucfirst"); + } + if (!String.prototype.lcfirst) { + dependencies.push("./polyfill/string/lcfirst"); + } + window.qoopido.registerSingleton("support", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var CombinedPromise = modules["promise/all"], DeferredPromise = modules["promise/defer"], matchPrefix = new RegExp("^(Moz|WebKit|Khtml|ms|O|Icab)(?=[A-Z])"), removeJsPrefix = new RegExp("^(?:webkit|khtml|icab|moz|ms|o)([A-Z])"), removeCssPrefix = new RegExp("^-(?:webkit|khtml|icab|moz|ms|o)-"), convertToCamelCase = new RegExp("-([a-z])", "gi"), convertToHyphens = new RegExp("([A-Z])", "g"), callbackUcfirst = function() { + return arguments[1].ucfirst(); + }, lookup = { + prefix: null, + method: {}, + property: {}, + css: {}, + promises: { + prefix: null, + method: {}, + property: {}, + css: {}, + test: {} + } + }; + function normalize(value) { + return value.replace(removeJsPrefix, "$1").lcfirst().replace(removeCssPrefix, "").replace(convertToCamelCase, callbackUcfirst); + } + return modules["base"].extend({ + test: {}, + pool: shared.pool && shared.pool.dom, + testMultiple: function() { + var test, tests = [], i = 0; + for (;(test = arguments[i]) !== undefined; i++) { + switch (typeof test) { + case "string": + tests.push(this.test[test]()); + break; + + case "boolean": + var deferred = new DeferredPromise(); + !!test ? deferred.resolve() : deferred.reject(); + tests.push(deferred.promise); + break; + + default: + tests.push(test); + break; + } + } + return new CombinedPromise(tests); + }, + getPrefix: function() { + var self = this, stored = lookup.prefix || null, property; + if (stored === null) { + var sample = self.pool ? self.pool.obtain("div") : document.createElement("div"), styles = sample.style; + stored = false; + for (property in styles) { + if (matchPrefix.test(property)) { + stored = property.match(matchPrefix)[0]; + } + } + if (stored === false && "WebkitOpacity" in styles) { + stored = "WebKit"; + } + if (stored === false && "KhtmlOpacity" in styles) { + stored = "Khtml"; + } + stored = lookup.prefix = stored === false ? false : [ stored.toLowerCase(), stored.toLowerCase().ucfirst(), stored ]; + sample.dispose && sample.dispose(); + } + return stored; + }, + getMethod: function(pMethod, pElement) { + pMethod = normalize(pMethod); + pElement = pElement || window; + var type = pElement.tagName, pointer = lookup.method[type] = lookup.method[type] || {}, stored = pointer[pMethod] = lookup.method[type][pMethod] || null; + if (stored === null) { + stored = false; + var candidates, candidate, i = 0, uMethod = pMethod.ucfirst(), prefixes = this.getPrefix(); + if (prefixes !== false) { + candidates = (pMethod + " " + uMethod + " " + prefixes.join(uMethod + " ") + uMethod).split(" "); + } else { + candidates = [ pMethod ]; + } + for (;(candidate = candidates[i]) !== undefined; i++) { + if (pElement[candidate] !== undefined && (typeof pElement[candidate] === "function" || typeof pElement[candidate] === "object")) { + stored = candidate; + break; + } + } + lookup.method[type][pMethod] = stored; + } + return stored; + }, + getProperty: function(pProperty, pElement) { + pProperty = normalize(pProperty); + pElement = pElement || window; + var type = pElement.tagName, pointer = lookup.property[type] = lookup.property[type] || {}, stored = pointer[pProperty] = lookup.property[type][pProperty] || null; + if (stored === null) { + stored = false; + var candidates, candidate, i = 0, uProperty = pProperty.ucfirst(), prefixes = this.getPrefix(); + if (prefixes !== false) { + candidates = (pProperty + " " + uProperty + " " + prefixes.join(uProperty + " ") + uProperty).split(" "); + } else { + candidates = [ pProperty ]; + } + for (i; (candidate = candidates[i]) !== undefined; i++) { + if (pElement[candidate] !== undefined) { + stored = candidate; + break; + } + } + lookup.property[type][pProperty] = stored; + } + return stored; + }, + getCssProperty: function(pProperty) { + pProperty = normalize(pProperty); + var self = this, stored = lookup.css[pProperty] || null; + if (stored === null) { + stored = false; + var candidate, i = 0, sample = self.pool ? self.pool.obtain("div") : document.createElement("div"), uProperty = pProperty.ucfirst(), prefixes = this.getPrefix() || [], candidates = (pProperty + " " + uProperty + " " + prefixes.join(uProperty + " ") + uProperty).split(" "), prefix = ""; + for (i; (candidate = candidates[i]) !== undefined; i++) { + if (sample.style[candidate] !== undefined) { + stored = candidate; + if (i > 0) { + prefix = "-"; + } + break; + } + } + stored = lookup.css[pProperty] = stored !== false ? [ prefix + stored.replace(convertToHyphens, "-$1").toLowerCase(), stored ] : false; + sample.dispose && sample.dispose(); + } + return stored; + }, + supportsPrefix: function() { + return !!this.getPrefix(); + }, + supportsMethod: function(pMethod, pElement) { + return !!this.getMethod(pMethod, pElement); + }, + supportsProperty: function(pProperty, pElement) { + return !!this.getProperty(pProperty, pElement); + }, + supportsCssProperty: function(pProperty) { + return !!this.getCssProperty(pProperty); + }, + testPrefix: function() { + var stored = lookup.promises.prefix; + if (stored === null) { + var deferred = new DeferredPromise(), prefix = this.getPrefix(); + !!prefix ? deferred.resolve(prefix) : deferred.reject(); + stored = lookup.promises.prefix = deferred.promise; + } + return stored; + }, + testMethod: function(pMethod, pElement) { + pElement = pElement || window; + var type = pElement.tagName, pointer = lookup.promises.method[type] = lookup.promises.method[type] || {}, stored = pointer[pMethod] = lookup.promises.method[type][pMethod] || null; + if (stored === null) { + var deferred = new DeferredPromise(), method = this.getMethod(pMethod, pElement); + !!method ? deferred.resolve(method) : deferred.reject(); + stored = lookup.promises.method[type][pMethod] = deferred.promise; + } + return stored; + }, + testProperty: function(pProperty, pElement) { + pElement = pElement || window; + var type = pElement.tagName, pointer = lookup.promises.property[type] = lookup.promises.property[type] || {}, stored = pointer[pProperty] = lookup.promises.property[type][pProperty] || null; + if (stored === null) { + var deferred = new DeferredPromise(), property = this.getProperty(pProperty, pElement); + !!property ? deferred.resolve(property) : deferred.reject(); + stored = lookup.promises.property[type][pProperty] = deferred.promise; + } + return stored; + }, + testCssProperty: function(pProperty) { + var stored = lookup.promises.css[pProperty] || null; + if (stored === null) { + var deferred = new DeferredPromise(), property = this.getCssProperty(pProperty); + !!property ? deferred.resolve(property) : deferred.reject(); + stored = lookup.promises.css[pProperty] = deferred.promise; + } + return stored; + }, + addTest: function(pId, pTest) { + return this.test[pId] = function() { + var stored = lookup.promises.test[pId] || null; + if (stored === null) { + var deferred = new DeferredPromise(), parameter = Array.prototype.slice.call(arguments); + parameter.splice(0, 0, deferred); + pTest.apply(null, parameter); + stored = lookup.promises.test[pId] = deferred.promise; + } + return stored; + }; + } + }); +}); +(function(definition) { + window.qoopido.register("function/merge", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + return function merge() { + var target = arguments[0], i, properties, property, tgt, src; + for (i = 1; (properties = arguments[i]) !== undefined; i++) { + for (property in properties) { + tgt = target[property]; + src = properties[property]; + if (src !== undefined) { + if (src !== null && typeof src === "object") { + if (src.length !== undefined) { + tgt = tgt && typeof tgt === "object" && tgt.length !== undefined ? tgt : []; + } else { + tgt = tgt && typeof tgt === "object" && tgt.length === undefined ? tgt : {}; + } + target[property] = merge(tgt, src); + } else { + target[property] = src; + } + } + } + } + return target; + }; +}); +(function(definition) { + window.qoopido.register("function/unique/uuid", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var lookup = {}, regex = new RegExp("[xy]", "g"); + function generateUuid() { + return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(regex, function(c) { + var r = Math.random() * 16 | 0, v = c === "x" ? r : r & 3 | 8; + return v.toString(16); + }); + } + return function() { + var result; + do { + result = generateUuid(); + } while (typeof lookup[result] !== "undefined"); + lookup[result] = true; + return result; + }; +}); +(function(definition) { + window.qoopido.registerSingleton("hook/event", definition, [ "../base" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + function transferProperties(event, originalEvent, properties) { + var i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + event[property] = originalEvent[property]; + } + event._properties = event._properties.concat(properties); + } + var hooks = { + general: { + properties: "type altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which path".split(" "), + process: function(event, originalEvent) { + var pointer; + event.originalEvent = originalEvent; + event.isDefaultPrevented = originalEvent.defaultPrevented ? true : false; + event.isPropagationStopped = originalEvent.cancelBubble ? true : false; + event.metaKey = originalEvent.metaKey && originalEvent.metaKey !== false ? true : false; + if (!event.target) { + event.target = originalEvent.srcElement || document; + } + if (event.target.nodeType === 3) { + event.target = event.target.parentNode; + } + if (!event.path) { + event.path = []; + pointer = event.target; + do { + event.path.push(pointer); + } while (pointer = pointer.parentNode); + event.path.push(window); + } + } + }, + mouse: { + regex: new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"), + properties: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement dataTransfer".split(" "), + process: function(event, originalEvent) { + var pointer, fromElement, which; + fromElement = originalEvent.fromElement; + which = originalEvent.button; + if (event.pageX === null && originalEvent.clientX !== null) { + pointer = event.target.ownerDocument || document; + pointer = pointer.documentElement || pointer.body; + event.pageX = originalEvent.clientX + (pointer.scrollLeft || 0) - (pointer.clientLeft || 0); + event.pageY = originalEvent.clientY + (pointer.scrollTop || 0) - (pointer.clientTop || 0); + } + if (!event.relatedTarget && fromElement) { + event.relatedTarget = fromElement === event.target ? originalEvent.toElement : fromElement; + } + if (!event.which && which !== undefined) { + event.which = which & 1 ? 1 : which & 2 ? 3 : which & 4 ? 2 : 0; + } + } + }, + key: { + regex: new RegExp("^(?:key)"), + properties: "char charCode key keyCode".split(" "), + process: function(event, originalEvent) { + if (event.which === null) { + event.which = originalEvent.charCode !== null ? originalEvent.charCode : originalEvent.keyCode; + } + } + } + }; + return modules["base"].extend({ + add: function(property, hook) { + if (property && hook && hooks[property]) { + hooks[property] = hook; + } + return this; + }, + get: function(property) { + if (property && hooks[property]) { + return hooks[property]; + } + return null; + }, + process: function(event, originalEvent) { + var id, hook, isMatch; + for (id in hooks) { + hook = hooks[id]; + isMatch = !hook.regex || hook.regex.test(originalEvent.type); + if (isMatch) { + if (hook.properties) { + transferProperties(event, originalEvent, hook.properties); + } + if (hook.process) { + hook.process(event, originalEvent); + } + if (hook.delegate) { + event.delegate = hook.delegate; + } + } + } + } + }); +}); +(function(definition) { + var dependencies = [ "../base", "../support" ]; + if (!window.getComputedStyle) { + dependencies.push("../polyfill/window/getcomputedstyle"); + } + window.qoopido.registerSingleton("hook/css", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var mSupport = modules["support"], getComputedStyle = window.getComputedStyle || modules["polyfill/window/getcomputedstyle"], hooks = { + general: { + get: function(element, property) { + return getComputedStyle(element, null).getPropertyValue(property[0]); + }, + set: function(element, property, value) { + element.style[property[1]] = value; + } + }, + opacity: !mSupport.supportsCssProperty("opacity") ? { + regex: new RegExp("alpha\\(opacity=(.*)\\)", "i"), + get: function(element, property, value) { + value = getComputedStyle(element, null).getPropertyValue("filter").toString().match(this.regex); + if (value) { + value = value[1] / 100; + } else { + value = 1; + } + return value; + }, + set: function(element, property, value) { + var style = element.style; + style.zoom = 1; + style.filter = "alpha(opacity=" + (value * 100 + .5 >> 0) + ")"; + } + } : null + }; + return modules["base"].extend({ + add: function(property, hook) { + if (property && hook && hooks[property]) { + hooks[property] = hook; + } + return this; + }, + get: function(property) { + if (property && hooks[property]) { + return hooks[property]; + } + return null; + }, + process: function(method, element, property, value) { + var hook; + property = mSupport.getCssProperty(property, element) || null; + if (property) { + return ((hook = this.get(property[1])) && hook[method] || this.get("general")[method])(element, property, value); + } + } + }); +}); +(function(definition) { + window.qoopido.register("dom/event", definition, [ "../base", "../hook/event" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var hooks = modules["hook/event"]; + return modules["base"].extend({ + originalEvent: null, + isDelegate: false, + isDefaultPrevented: false, + isPropagationStopped: false, + isImmediatePropagationStopped: false, + _properties: null, + _constructor: function(event) { + var self = this; + self._properties = []; + self._obtain(event); + return self; + }, + _obtain: function(event) { + hooks.process(this, event); + }, + _dispose: function() { + var self = this, i = 0, property; + for (;(property = self._properties[i]) !== undefined; i++) { + delete self[property]; + } + delete self.delegate; + self.originalEvent = null; + self.isDelegate = false; + self.isDefaultPrevented = false; + self.isPropagationStopped = false; + self.isImmediatePropagationStopped = false; + self._properties.length = 0; + }, + preventDefault: function() { + var self = this, event = self.originalEvent; + if (event.cancelable !== false) { + self.isDefaultPrevented = true; + if (event.preventDefault) { + event.preventDefault(); + } else { + event.returnValue = false; + } + } + }, + stopPropagation: function() { + var self = this, event = self.originalEvent; + self.isPropagationStopped = true; + if (event.stopPropagation) { + event.stopPropagation(); + } + event.cancelBubble = true; + }, + stopImmediatePropagation: function() { + var self = this, event = self.originalEvent; + self.isImmediatePropagationStopped = true; + if (event.stopImmediatePropagation) { + event.stopImmediatePropagation(); + } + self.stopPropagation(); + } + }); +}); +(function(definition) { + var dependencies = [ "../base", "../function/unique/uuid", "../hook/css", "./event" ]; + if (!window.CustomEvent) { + dependencies.push("../polyfill/window/customevent"); + } + if (!window.addEventListener) { + dependencies.push("../polyfill/window/addeventlistener"); + } + if (!window.removeEventListener) { + dependencies.push("../polyfill/window/removeeventlistener"); + } + if (!window.dispatchEvent) { + dependencies.push("../polyfill/window/dispatchevent"); + } + if (!Element.prototype.matches) { + dependencies.push("../polyfill/element/matches"); + } + if (!document.querySelector) { + dependencies.push("../polyfill/document/queryselector"); + } + if (!document.querySelectorAll) { + dependencies.push("../polyfill/document/queryselectorall"); + } + if (!String.prototype.trim) { + dependencies.push("../polyfill/string/trim"); + } + window.qoopido.register("dom/element", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var stringObject = "object", stringString = "string", generateUuid = modules["function/unique/uuid"], head = document.getElementsByTagName("head")[0], contentAttribute = "textContent" in document.createElement("a") ? "textContent" : "innerText", previousSibling = typeof head.previousElementSibling !== "undefined" ? function previousSibling() { + return this.previousElementSibling; + } : function previousSibling() { + var element = this; + while (element = element.previousSibling) { + if (element.nodeType === 1) { + return element; + } + } + }, nextSibling = typeof head.nextElementSibling !== "undefined" ? function nextSibling() { + return this.nextElementSibling; + } : function nextSibling() { + var element = this; + while (element = element.nextSibling) { + if (element.nodeType === 1) { + return element; + } + } + }, isTag = new RegExp("^<(\\w+)\\s*/>$"), matchEvent = new RegExp("^[^-]+"), splitList = new RegExp(" +", "g"), pool = modules["pool/module"] && modules["pool/module"].create(modules["dom/event"], null, true) || null, hooks = modules["hook/css"], storage = {}, events = { + custom: { + type: "CustomEvent", + method: "initCustomEvent" + }, + html: { + regex: new RegExp("^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$"), + type: "HTMLEvents", + method: "initEvent" + }, + mouse: { + regex: new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"), + type: "MouseEvents", + method: "initMouseEvent" + } + }; + function resolveEvent(type) { + var id, prototype, candidate; + for (id in events) { + prototype = events[id]; + if (!prototype.regex || prototype.regex.test(type)) { + candidate = prototype; + } + } + return candidate; + } + function emitEvent(type, detail, uuid) { + var self = this, prototype = resolveEvent(type), event = document.createEvent(prototype.type); + event[prototype.method](type, type === "load" ? false : true, true, detail); + if (uuid) { + event._quid = uuid; + event.isDelegate = true; + } + self.element.dispatchEvent(event); + } + function resolveElement(element) { + var tag; + if (typeof element === "string") { + try { + if (isTag.test(element) === true) { + tag = element.replace(isTag, "$1").toLowerCase(); + element = document.createElement(tag); + } else { + element = document.querySelector(element); + } + } catch (exception) { + element = null; + } + } + if (!element) { + throw new Error("[Qoopido.js] Element could not be resolved"); + } + return element; + } + function resolveArguments(parameters) { + return Array.prototype.concat.apply([], Array.prototype.splice.call(parameters, 0)).join(" ").split(splitList); + } + function matchesDelegate(event, delegate) { + var i = 0, pointer; + for (;(pointer = event.path[i]) !== undefined; i++) { + if (pointer.matches(delegate)) { + event.currentTarget = pointer; + return true; + } + if (pointer === event.currentTarget) { + break; + } + } + return false; + } + return modules["base"].extend({ + type: null, + element: null, + _listener: null, + _constructor: function(element, attributes, styles) { + var self = this, uuid; + element = resolveElement(element); + uuid = element._quid; + if (!uuid) { + uuid = element._quid = generateUuid(); + self.type = element.tagName; + self.element = element; + self._listener = {}; + storage[uuid] = self; + } else { + self = storage[uuid]; + } + if (typeof attributes === "object" && attributes !== null) { + self.setAttributes(attributes); + } + if (typeof styles === "object" && styles !== null) { + self.setStyles(styles); + } + if (self !== this) { + this.dispose && this.dispose(); + } + return self; + }, + _obtain: function(element, attributes, styles) { + this._constructor(element, attributes, styles); + }, + _dispose: function() { + var self = this, id, event; + for (id in self._listener) { + event = id.match(matchEvent); + self.element.removeEventListener(event, self._listener[id]); + delete self._listener[id]; + } + self.type = null; + self.element = null; + }, + getContent: function(html) { + var element = this.element; + return html && html !== false ? element.innerHTML : element[contentAttribute]; + }, + setContent: function(content, html) { + var self = this, element = self.element; + if (html && html !== false) { + element.innerHTML = content; + } else { + element[contentAttribute] = content; + } + return self; + }, + getAttribute: function(attribute) { + var self = this; + if (attribute && typeof attribute === stringString) { + return self.element.getAttribute(attribute); + } + }, + getAttributes: function() { + var self = this, result = {}, attributes = resolveArguments(arguments), i = 0, attribute; + for (;(attribute = attributes[i]) !== undefined; i++) { + result[attribute] = self.element.getAttribute(attribute); + } + return result; + }, + setAttribute: function(attribute, value) { + var self = this; + if (attribute && typeof attribute === stringString) { + self.element.setAttribute(attribute, value); + } + return self; + }, + setAttributes: function(attributes) { + var self = this, attribute; + if (attributes && typeof attributes === stringObject && !attributes.length) { + for (attribute in attributes) { + self.element.setAttribute(attribute, attributes[attribute]); + } + } + return self; + }, + removeAttribute: function(attribute) { + var self = this; + if (attribute && typeof attribute === stringString) { + self.element.removeAttribute(attribute); + } + return self; + }, + removeAttributes: function() { + var self = this, attributes = resolveArguments(arguments), i = 0, attribute; + for (;(attribute = attributes[i]) !== undefined; i++) { + self.element.removeAttribute(attribute); + } + return self; + }, + getStyle: function(property) { + var self = this; + if (property && typeof property === stringString) { + return hooks.process("get", self.element, property); + } + }, + getStyles: function() { + var self = this, result = {}, properties = resolveArguments(arguments), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + result[property] = hooks.process("get", self.element, property); + } + return result; + }, + setStyle: function(property, value) { + var self = this; + if (property && typeof property === stringString) { + hooks.process("set", self.element, property, value); + } + return self; + }, + setStyles: function(properties) { + var self = this, property; + if (properties && typeof properties === stringObject && !properties.length) { + for (property in properties) { + hooks.process("set", self.element, property, properties[property]); + } + } + return self; + }, + removeStyle: function(property) { + var self = this; + if (property && typeof property === stringString) { + self.setStyle(property, ""); + } + return self; + }, + removeStyles: function() { + var self = this, properties = resolveArguments(arguments), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + self.setStyle(property, ""); + } + return self; + }, + siblings: function(selector) { + var element = this.element, pointer = element.parentNode.firstChild, siblings = []; + for (;pointer; pointer = nextSibling.call(pointer)) { + if (pointer !== element && (!selector || pointer.matches(selector))) { + siblings.push(pointer); + } + } + return siblings; + }, + siblingsBefore: function(selector) { + var pointer = this.element.previousSibling, siblings = []; + for (;pointer; pointer = previousSibling.call(pointer)) { + if (!selector || pointer.matches(selector)) { + siblings.push(pointer); + } + } + return siblings; + }, + siblingsAfter: function(selector) { + var pointer = this.element.nextSibling, siblings = []; + for (;pointer; pointer = nextSibling.call(pointer)) { + if (!selector || pointer.matches(selector)) { + siblings.push(pointer); + } + } + return siblings; + }, + previous: function(selector) { + var pointer = previousSibling.call(this.element); + if (!selector) { + return pointer; + } else { + for (;pointer; pointer = previousSibling.call(pointer)) { + if (pointer.matches(selector)) { + return pointer; + } + } + } + }, + next: function(selector) { + var pointer = nextSibling.call(this.element); + if (!selector) { + return pointer; + } else { + for (;pointer; pointer = nextSibling.call(pointer)) { + if (pointer.matches(selector)) { + return pointer; + } + } + } + }, + find: function(selector) { + var self = this.element, uuid, matches; + selector = selector.trim(); + if (selector.charAt(0) === ">") { + uuid = self._quid; + self.setAttribute("data-quid", uuid); + selector = '[data-quid="' + uuid + '"] ' + selector; + matches = self.parentNode.querySelectorAll(selector); + self.removeAttribute("data-quid"); + } else { + matches = self.querySelectorAll(selector); + } + return matches; + }, + parent: function(selector) { + var pointer; + if (!selector) { + return this.element.parentNode; + } else { + pointer = this.element; + for (;pointer; pointer = pointer.parentNode) { + if (pointer.matches(selector)) { + return pointer; + } + } + } + }, + parents: function(selector) { + var pointer = this.element.parentNode, parents = []; + for (;pointer; pointer = pointer.parentNode) { + if (pointer.nodeType === 9) { + return parents; + } else if (pointer.nodeType === 1) { + if (!selector || pointer.matches(selector)) { + parents.push(pointer); + } + } + } + }, + isVisible: function() { + var self = this, element = self.element; + return !(element.offsetWidth <= 0 && element.offsetHeight <= 0 || self.getStyle("visibility") === "hidden" || self.getStyle("opacity") <= 0); + }, + hasClass: function(name) { + return name ? new RegExp("(?:^|\\s)" + name + "(?:\\s|$)").test(this.element.className) : false; + }, + addClass: function(name) { + var self = this; + if (name && !self.hasClass(name)) { + self.element.className += self.element.className ? " " + name : name; + } + return self; + }, + removeClass: function(name) { + var self = this; + if (name && self.hasClass(name)) { + self.element.className = self.element.className.replace(new RegExp("(?:^|\\s)" + name + "(?!\\S)"), ""); + } + return self; + }, + toggleClass: function(name) { + var self = this; + if (name) { + self.hasClass(name) ? self.removeClass(name) : self.addClass(name); + } + return self; + }, + prepend: function(element) { + var self = this, target = self.element; + if (element) { + try { + element = element.element || resolveElement(element); + target.firstChild ? target.insertBefore(element, target.firstChild) : self.append(element); + } catch (exception) { + target.insertAdjacentHTML("afterBegin", element); + } + } + return self; + }, + append: function(element) { + var self = this, target = self.element; + if (element) { + try { + target.appendChild(element.element || resolveElement(element)); + } catch (exception) { + target.insertAdjacentHTML("beforeEnd", element); + } + } + return self; + }, + prependTo: function(target) { + var self = this, element = self.element; + if (target) { + (target = target.element || resolveElement(target)).firstChild ? target.insertBefore(element, target.firstChild) : self.appendTo(target); + } + return self; + }, + appendTo: function(target) { + var self = this; + if (target) { + (target.element || resolveElement(target)).appendChild(self.element); + } + return self; + }, + insertBefore: function(target) { + var self = this, element = self.element; + if (target) { + (target = target.element || resolveElement(target)).parentNode.insertBefore(element, target); + } + return self; + }, + insertAfter: function(target) { + var self = this, element = self.element; + if (target) { + (target = target.element || resolveElement(target)).nextSibling ? target.parentNode.insertBefore(element, target.nextSibling) : self.appendTo(target.parentNode); + } + return self; + }, + replace: function(target) { + var self = this, element = self.element; + if (target) { + (target = target.element || resolveElement(target)).parentNode.replaceChild(element, target); + } + return self; + }, + replaceWith: function(element) { + var self = this, target = self.element; + if (element) { + element = element.element || resolveElement(element); + target.parentNode.replaceChild(element, target); + } + return self; + }, + remove: function() { + var self = this, element = self.element; + element.parentNode.removeChild(element); + return self; + }, + on: function(events) { + var self = this, element = self.element, delegate = arguments.length > 2 ? arguments[1] : null, fn = arguments.length > 2 ? arguments[2] : arguments[1], uuid = fn._quid || (fn._quid = generateUuid()), i = 0, event; + events = events.split(" "); + for (;(event = events[i]) !== undefined; i++) { + var id = event + "-" + uuid, listener = function(event) { + var delegateTo; + event = pool && pool.obtain(event) || modules["dom/event"].create(event); + if (!event.isPropagationStopped) { + delegateTo = event.delegate; + event._quid = generateUuid(); + if (!delegate || matchesDelegate(event, delegate)) { + fn.call(event.currentTarget, event, event.originalEvent.detail); + } + if (delegateTo) { + delete event.delegate; + emitEvent.call(self, delegateTo); + } + } + event.dispose && event.dispose(); + }; + listener.type = event; + self._listener[id] = listener; + element.addEventListener(event, listener); + } + return self; + }, + one: function(events) { + var self = this, delegate = arguments.length > 3 || typeof arguments[1] === "string" ? arguments[1] : null, fn = arguments.length > 3 || typeof arguments[2] === "function" ? arguments[2] : arguments[1], each = (arguments.length > 3 ? arguments[3] : arguments[2]) !== false, listener = function(event) { + self.off(each === true ? event.type : events, listener); + fn.call(this, event, event.originalEvent.detail); + }; + fn._quid = listener._quid = generateUuid(); + if (delegate) { + self.on(events, delegate, listener); + } else { + self.on(events, listener); + } + return self; + }, + off: function(events, fn) { + var self = this, element = self.element, i = 0, event, id, listener; + events = events.split(" "); + for (;(event = events[i]) !== undefined; i++) { + id = fn._quid && event + "-" + fn._quid || null; + listener = id && self._listener[id] || null; + if (listener) { + element.removeEventListener(event, listener); + delete self._listener[id]; + } else { + element.removeEventListener(event, fn); + } + } + return self; + }, + emit: function(event, data) { + var self = this; + emitEvent.call(self, event, data); + return self; + } + }); +}); +(function(definition) { + window.qoopido.register("dom/element/emerge", definition, [ "../element", "../../function/merge", "../../function/unique/uuid" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var defaults = { + interval: 50, + threshold: "auto", + recur: true, + auto: 1, + visibility: true + }, documentElement = window.document.documentElement, viewport = {}, intervals = {}, elements = {}, prototype, EVENT_EMERGED = "emerged", EVENT_DEMERGED = "demerged", DOM_RESIZE = "resize orientationchange"; + window = modules["dom/element"].create(window); + if (document.compatMode !== "CSS1Compat") { + throw "[Qoopido.js] Not in standards mode"; + } + function tick(interval) { + var index, pointer = elements[interval]; + for (index in pointer) { + if (index !== "length") { + checkState.call(pointer[index]); + } + } + if (pointer.length === 0) { + window.element.clearInterval(intervals[interval]); + delete intervals[interval]; + } + } + function globalOnResize() { + viewport.left = 0; + viewport.top = 0; + viewport.right = window.innerWidth || documentElement.clientWidth; + viewport.bottom = window.innerHeight || documentElement.clientHeight; + } + function instanceOnResize() { + var self = this, treshold = self._settings.threshold, x = treshold !== undefined ? treshold : documentElement.clientWidth * self._settings.auto, y = treshold !== undefined ? treshold : documentElement.clientHeight * self._settings.auto; + self._viewport.left = viewport.left - x; + self._viewport.top = viewport.top - y; + self._viewport.right = viewport.right + x; + self._viewport.bottom = viewport.bottom + y; + } + function checkState() { + var self = this, state = false, priority = 2, boundaries; + if (self.isVisible() && (self.getStyle("visibility") !== "hidden" || self._settings.visibility === false)) { + boundaries = self.element.getBoundingClientRect(); + if ((boundaries.bottom >= self._viewport.top && boundaries.bottom <= self._viewport.bottom || boundaries.top >= self._viewport.top && boundaries.top <= self._viewport.bottom || self._viewport.bottom >= boundaries.top && self._viewport.bottom <= boundaries.bottom || self._viewport.top >= boundaries.top && self._viewport.top <= boundaries.bottom) && (boundaries.left >= self._viewport.left && boundaries.left <= self._viewport.right || boundaries.right >= self._viewport.left && boundaries.right <= self._viewport.right || self._viewport.left >= boundaries.left && self._viewport.left <= boundaries.right || self._viewport.right >= boundaries.left && self._viewport.right <= boundaries.right)) { + if (self._settings.threshold === 0 || (boundaries.bottom >= viewport.top && boundaries.bottom <= viewport.bottom || boundaries.top >= viewport.top && boundaries.top <= viewport.bottom || viewport.bottom >= boundaries.top && viewport.bottom <= boundaries.bottom || viewport.top >= boundaries.top && viewport.top <= boundaries.bottom) && (boundaries.left >= viewport.left && boundaries.left <= viewport.right || boundaries.right >= viewport.left && boundaries.right <= viewport.right || viewport.left >= boundaries.left && viewport.left <= boundaries.right || viewport.right >= boundaries.left && viewport.right <= boundaries.right)) { + priority = 1; + } + state = true; + } + } + if (state !== self._state || state === true && priority !== self._priority) { + setState.call(self, state, priority); + } + } + function setState(state, priority) { + var self = this; + self._state = state; + self._priority = priority; + if (self._settings.recur !== true) { + self.remove(); + } + if (state === true) { + self.emit(EVENT_EMERGED, priority); + } else { + self.emit(EVENT_DEMERGED); + } + } + prototype = modules["dom/element"].extend({ + _quid: null, + _viewport: null, + _settings: null, + _state: null, + _priority: null, + _constructor: function(element, settings) { + var self = prototype._parent._constructor.call(this, element); + settings = modules["function/merge"]({}, defaults, settings || {}); + if (settings.threshold === "auto") { + delete settings.threshold; + } + if (intervals[settings.interval] === undefined) { + elements[settings.interval] = elements[settings.interval] || { + length: 0 + }; + intervals[settings.interval] = window.element.setInterval(function() { + tick(settings.interval); + }, settings.interval); + } + self._quid = modules["function/unique/uuid"](); + self._viewport = {}; + self._settings = settings; + self._state = false; + self._priority = 2; + elements[settings.interval][self._quid] = self; + elements[settings.interval].length++; + window.on(DOM_RESIZE, function() { + instanceOnResize.call(self); + }); + instanceOnResize.call(self); + return self; + }, + remove: function() { + var self = this; + delete elements[self._settings.interval][self._quid]; + elements[self._settings.interval].length--; + } + }); + window.on(DOM_RESIZE, globalOnResize); + globalOnResize(); + return prototype; +}); \ No newline at end of file diff --git a/dist/3.7.3/max/packages/qoopido.emitter.js b/dist/3.7.3/max/packages/qoopido.emitter.js new file mode 100644 index 00000000..06d79b4f --- /dev/null +++ b/dist/3.7.3/max/packages/qoopido.emitter.js @@ -0,0 +1,201 @@ +/*! +* Qoopido.js library +* +* version: 3.7.3 +* date: 2015-08-05 +* author: Dirk Lueth +* website: https://github.com/dlueth/qoopido.js +* +* Copyright (c) 2015 Dirk Lueth +*/ +(function(definition, navigator, global, document, undefined) { + "use strict"; + function register(id, definition, dependencies, callback) { + var namespace = id.split("/"), initialize; + if (modules[id]) { + return modules[id]; + } + initialize = function() { + if (dependencies) { + var path = namespace.slice(0, -1).join("/"), i = 0, dependency, internal; + for (;(dependency = dependencies[i]) !== undefined; i++) { + internal = isInternal.test(dependency); + if (internal) { + dependency = canonicalize(path + "/" + dependency); + } + if (!modules[dependency] && arguments[i]) { + modules[dependency] = arguments[i]; + } + if (internal && !modules[dependency] && typeof console !== "undefined") { + console.error("".concat("[Qoopido.js] ", id, ": Could not load dependency ", dependency)); + } + } + } + modules[id] = definition(modules, shared, namespace, navigator, global, document, undefined); + if (callback) { + callback(modules[id]); + } + return modules[id]; + }; + if (typeof module !== "undefined" && module.exports) { + module.exports = define(initialize); + } else if (typeof define === "function" && define.amd) { + dependencies ? define(dependencies, initialize) : define(initialize); + } else { + initialize(); + } + } + function registerSingleton(id, definition, dependencies) { + register(id, definition, dependencies, function(module) { + modules[id] = module.create(); + }); + } + var qoopido = global.qoopido || (global.qoopido = {}), shared = qoopido.shared || (qoopido.shared = {}), modules = qoopido.modules || (qoopido.modules = {}), dependencies = [], isInternal = new RegExp("^\\.+\\/"), regexCanonicalize = new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."), removeNeutral = new RegExp("(^\\/)|\\.\\/", "g"); + qoopido.register = register; + qoopido.registerSingleton = registerSingleton; + function canonicalize(path) { + var collapsed; + while ((collapsed = path.replace(regexCanonicalize, "")) !== path) { + path = collapsed; + } + return path.replace(removeNeutral, ""); + } + if (!Object.create) { + dependencies.push("./polyfill/object/create"); + } + if (!Object.getOwnPropertyNames) { + dependencies.push("./polyfill/object/getownpropertynames"); + } + if (!Object.getOwnPropertyDescriptor || !function() { + try { + Object.getOwnPropertyDescriptor({ + x: 0 + }, "x"); + return true; + } catch (exception) { + return false; + } + }()) { + dependencies.push("./polyfill/object/getownpropertydescriptor"); + } + register("base", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + function getOwnPropertyDescriptors(object) { + var descriptors = {}, properties = Object.getOwnPropertyNames(object), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + descriptors[property] = Object.getOwnPropertyDescriptor(object, property); + } + return descriptors; + } + function prohibitCall() { + throw new Error("[Qoopido.js] Operation prohibited"); + } + return { + create: function() { + var instance = Object.create(this, getOwnPropertyDescriptors(this)), result; + if (instance._constructor) { + result = instance._constructor.apply(instance, arguments); + } + instance.create = instance.extend = prohibitCall; + return result || instance; + }, + extend: function(properties, final) { + var instance; + properties = properties || {}; + final = final === true; + properties._parent = this; + instance = Object.create(this, getOwnPropertyDescriptors(properties)); + if (final === true) { + instance.extend = prohibitCall; + } + return instance; + } + }; +}, navigator, this, document); +(function(definition) { + window.qoopido.register("emitter", definition, [ "./base" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var excludeMethods = /^(_|extend$|create$|on$|one$|off$|emit$|get.+)/; + function map(context, method) { + var event = method.charAt(0).toUpperCase() + method.slice(1); + context._mapped[method] = context[method]; + return function() { + var args = Array.prototype.slice.call(arguments), returnValue; + context.emit.apply(context, [ "pre" + event, args ]); + returnValue = context._mapped[method].apply(context, args); + context.emit.apply(context, [ "post" + event, args, returnValue ]); + return returnValue; + }; + } + return modules["base"].extend({ + _mapped: null, + _listener: null, + _temp: null, + _constructor: function() { + var self = this, method; + self._mapped = {}; + self._listener = {}; + for (method in self) { + if (typeof self[method] === "function" && excludeMethods.test(method) === false) { + self[method] = map(self, method); + } + } + return self; + }, + on: function(events, fn) { + var self = this, i = 0, event; + events = events.split(" "); + for (;(event = events[i]) !== undefined; i++) { + (self._listener[event] = self._listener[event] || []).push(fn); + } + return self; + }, + one: function(events, fn, each) { + each = each !== false; + var self = this; + self.on(events, function listener(event) { + self.off(each === true ? event : events, listener); + fn.apply(this, arguments); + }); + return self; + }, + off: function(events, fn) { + var self = this, i = 0, event, j, listener; + if (events) { + events = events.split(" "); + for (;(event = events[i]) !== undefined; i++) { + self._listener[event] = self._listener[event] || []; + if (fn) { + for (j = 0; (listener = self._listener[event][j]) !== undefined; j++) { + if (listener === fn) { + self._listener[event].splice(j, 1); + j--; + } + } + } else { + self._listener[event].length = 0; + } + } + } else { + for (event in self._listener) { + self._listener[event].length = 0; + } + } + return self; + }, + emit: function(event) { + var self = this, i = 0, listener; + if (event !== undefined) { + self._listener[event] = self._listener[event] || []; + self._temp = self._listener[event].slice(); + for (;(listener = self._temp[i]) !== undefined; i++) { + listener.apply(self, arguments); + } + self._temp.length = 0; + } + return self; + } + }); +}); \ No newline at end of file diff --git a/dist/3.7.3/max/packages/qoopido.emitter.legacy.js b/dist/3.7.3/max/packages/qoopido.emitter.legacy.js new file mode 100644 index 00000000..75dee908 --- /dev/null +++ b/dist/3.7.3/max/packages/qoopido.emitter.legacy.js @@ -0,0 +1,372 @@ +/*! +* Qoopido.js library +* +* version: 3.7.3 +* date: 2015-08-05 +* author: Dirk Lueth +* website: https://github.com/dlueth/qoopido.js +* +* Copyright (c) 2015 Dirk Lueth +*/ +(function(definition, qoopido) { + if (qoopido.register) { + qoopido.register("polyfill/object/defineproperty", definition); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/defineproperty"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.defineProperty || !function() { + try { + Object.defineProperty({}, "x", {}); + return true; + } catch (exception) { + return false; + } + }()) { + var defineProperty = Object.defineProperty, defineGetter = Object.prototype.__defineGetter__, defineSetter = Object.prototype.__defineSetter__; + Object.defineProperty = function(obj, prop, desc) { + if (defineProperty) { + try { + return defineProperty(obj, prop, desc); + } catch (exception) {} + } + if (obj !== Object(obj)) { + throw new TypeError("Object.defineProperty called on non-object"); + } + if (defineGetter && "get" in desc) { + defineGetter.call(obj, prop, desc.get); + } + if (defineSetter && "set" in desc) { + defineSetter.call(obj, prop, desc.set); + } + if ("value" in desc) { + obj[prop] = desc.value; + } + return obj; + }; + } + return Object.defineProperty; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + var dependencies = []; + if (!Object.defineProperty || !function() { + try { + Object.defineProperty({}, "x", {}); + return true; + } catch (exception) { + return false; + } + }()) { + dependencies.push("./defineproperty"); + } + qoopido.register("polyfill/object/defineproperties", definition, dependencies); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/defineproperties"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.defineProperties) { + Object.defineProperties = function(obj, properties) { + if (obj !== Object(obj)) { + throw new TypeError("Object.defineProperties called on non-object"); + } + var name; + for (name in properties) { + if (Object.prototype.hasOwnProperty.call(properties, name)) { + Object.defineProperty(obj, name, properties[name]); + } + } + return obj; + }; + } + return Object.defineProperties; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + var dependencies = []; + if (!Object.defineProperties) { + dependencies.push("./defineproperties"); + } + qoopido.register("polyfill/object/create", definition, dependencies); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/create"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.create) { + Object.create = function(prototype, properties) { + if (typeof prototype !== "object") { + throw new TypeError(); + } + function Constructor() {} + Constructor.prototype = prototype; + var obj = new Constructor(); + if (prototype) { + obj.constructor = Constructor; + } + if (arguments.length > 1) { + if (properties !== Object(properties)) { + throw new TypeError(); + } + Object.defineProperties(obj, properties); + } + return obj; + }; + } + return Object.create; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + qoopido.register("polyfill/object/getownpropertynames", definition); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/getownpropertynames"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.getOwnPropertyNames) { + Object.getOwnPropertyNames = function(obj) { + if (obj !== Object(obj)) { + throw new TypeError("Object.getOwnPropertyNames called on non-object"); + } + var props = [], p; + for (p in obj) { + if (Object.prototype.hasOwnProperty.call(obj, p)) { + props.push(p); + } + } + return props; + }; + } + return Object.getOwnPropertyNames; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + qoopido.register("polyfill/object/getownpropertydescriptor", definition); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/getownpropertydescriptor"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.getOwnPropertyDescriptor || !function() { + try { + Object.getOwnPropertyDescriptor({ + x: 0 + }, "x"); + return true; + } catch (exception) { + return false; + } + }()) { + var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; + Object.getOwnPropertyDescriptor = function(obj, property) { + if (obj !== Object(obj)) { + throw new TypeError(); + } + try { + return getOwnPropertyDescriptor.call(Object, obj, property); + } catch (exception) {} + if (Object.prototype.hasOwnProperty.call(obj, property)) { + return { + value: obj[property], + enumerable: true, + writable: true, + configurable: true + }; + } + }; + } + return Object.getOwnPropertyDescriptor; +}, window.qoopido = window.qoopido || {}); +(function(definition, navigator, global, document, undefined) { + "use strict"; + function register(id, definition, dependencies, callback) { + var namespace = id.split("/"), initialize; + if (modules[id]) { + return modules[id]; + } + initialize = function() { + if (dependencies) { + var path = namespace.slice(0, -1).join("/"), i = 0, dependency, internal; + for (;(dependency = dependencies[i]) !== undefined; i++) { + internal = isInternal.test(dependency); + if (internal) { + dependency = canonicalize(path + "/" + dependency); + } + if (!modules[dependency] && arguments[i]) { + modules[dependency] = arguments[i]; + } + if (internal && !modules[dependency] && typeof console !== "undefined") { + console.error("".concat("[Qoopido.js] ", id, ": Could not load dependency ", dependency)); + } + } + } + modules[id] = definition(modules, shared, namespace, navigator, global, document, undefined); + if (callback) { + callback(modules[id]); + } + return modules[id]; + }; + if (typeof module !== "undefined" && module.exports) { + module.exports = define(initialize); + } else if (typeof define === "function" && define.amd) { + dependencies ? define(dependencies, initialize) : define(initialize); + } else { + initialize(); + } + } + function registerSingleton(id, definition, dependencies) { + register(id, definition, dependencies, function(module) { + modules[id] = module.create(); + }); + } + var qoopido = global.qoopido || (global.qoopido = {}), shared = qoopido.shared || (qoopido.shared = {}), modules = qoopido.modules || (qoopido.modules = {}), dependencies = [], isInternal = new RegExp("^\\.+\\/"), regexCanonicalize = new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."), removeNeutral = new RegExp("(^\\/)|\\.\\/", "g"); + qoopido.register = register; + qoopido.registerSingleton = registerSingleton; + function canonicalize(path) { + var collapsed; + while ((collapsed = path.replace(regexCanonicalize, "")) !== path) { + path = collapsed; + } + return path.replace(removeNeutral, ""); + } + if (!Object.create) { + dependencies.push("./polyfill/object/create"); + } + if (!Object.getOwnPropertyNames) { + dependencies.push("./polyfill/object/getownpropertynames"); + } + if (!Object.getOwnPropertyDescriptor || !function() { + try { + Object.getOwnPropertyDescriptor({ + x: 0 + }, "x"); + return true; + } catch (exception) { + return false; + } + }()) { + dependencies.push("./polyfill/object/getownpropertydescriptor"); + } + register("base", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + function getOwnPropertyDescriptors(object) { + var descriptors = {}, properties = Object.getOwnPropertyNames(object), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + descriptors[property] = Object.getOwnPropertyDescriptor(object, property); + } + return descriptors; + } + function prohibitCall() { + throw new Error("[Qoopido.js] Operation prohibited"); + } + return { + create: function() { + var instance = Object.create(this, getOwnPropertyDescriptors(this)), result; + if (instance._constructor) { + result = instance._constructor.apply(instance, arguments); + } + instance.create = instance.extend = prohibitCall; + return result || instance; + }, + extend: function(properties, final) { + var instance; + properties = properties || {}; + final = final === true; + properties._parent = this; + instance = Object.create(this, getOwnPropertyDescriptors(properties)); + if (final === true) { + instance.extend = prohibitCall; + } + return instance; + } + }; +}, navigator, this, document); +(function(definition) { + window.qoopido.register("emitter", definition, [ "./base" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var excludeMethods = /^(_|extend$|create$|on$|one$|off$|emit$|get.+)/; + function map(context, method) { + var event = method.charAt(0).toUpperCase() + method.slice(1); + context._mapped[method] = context[method]; + return function() { + var args = Array.prototype.slice.call(arguments), returnValue; + context.emit.apply(context, [ "pre" + event, args ]); + returnValue = context._mapped[method].apply(context, args); + context.emit.apply(context, [ "post" + event, args, returnValue ]); + return returnValue; + }; + } + return modules["base"].extend({ + _mapped: null, + _listener: null, + _temp: null, + _constructor: function() { + var self = this, method; + self._mapped = {}; + self._listener = {}; + for (method in self) { + if (typeof self[method] === "function" && excludeMethods.test(method) === false) { + self[method] = map(self, method); + } + } + return self; + }, + on: function(events, fn) { + var self = this, i = 0, event; + events = events.split(" "); + for (;(event = events[i]) !== undefined; i++) { + (self._listener[event] = self._listener[event] || []).push(fn); + } + return self; + }, + one: function(events, fn, each) { + each = each !== false; + var self = this; + self.on(events, function listener(event) { + self.off(each === true ? event : events, listener); + fn.apply(this, arguments); + }); + return self; + }, + off: function(events, fn) { + var self = this, i = 0, event, j, listener; + if (events) { + events = events.split(" "); + for (;(event = events[i]) !== undefined; i++) { + self._listener[event] = self._listener[event] || []; + if (fn) { + for (j = 0; (listener = self._listener[event][j]) !== undefined; j++) { + if (listener === fn) { + self._listener[event].splice(j, 1); + j--; + } + } + } else { + self._listener[event].length = 0; + } + } + } else { + for (event in self._listener) { + self._listener[event].length = 0; + } + } + return self; + }, + emit: function(event) { + var self = this, i = 0, listener; + if (event !== undefined) { + self._listener[event] = self._listener[event] || []; + self._temp = self._listener[event].slice(); + for (;(listener = self._temp[i]) !== undefined; i++) { + listener.apply(self, arguments); + } + self._temp.length = 0; + } + return self; + } + }); +}); \ No newline at end of file diff --git a/dist/3.7.3/max/packages/qoopido.lazyimage.js b/dist/3.7.3/max/packages/qoopido.lazyimage.js new file mode 100644 index 00000000..8aa60f2a --- /dev/null +++ b/dist/3.7.3/max/packages/qoopido.lazyimage.js @@ -0,0 +1,1489 @@ +/*! +* Qoopido.js library +* +* version: 3.7.3 +* date: 2015-08-05 +* author: Dirk Lueth +* website: https://github.com/dlueth/qoopido.js +* +* Copyright (c) 2015 Dirk Lueth +*/ +(function(definition, navigator, global, document, undefined) { + "use strict"; + function register(id, definition, dependencies, callback) { + var namespace = id.split("/"), initialize; + if (modules[id]) { + return modules[id]; + } + initialize = function() { + if (dependencies) { + var path = namespace.slice(0, -1).join("/"), i = 0, dependency, internal; + for (;(dependency = dependencies[i]) !== undefined; i++) { + internal = isInternal.test(dependency); + if (internal) { + dependency = canonicalize(path + "/" + dependency); + } + if (!modules[dependency] && arguments[i]) { + modules[dependency] = arguments[i]; + } + if (internal && !modules[dependency] && typeof console !== "undefined") { + console.error("".concat("[Qoopido.js] ", id, ": Could not load dependency ", dependency)); + } + } + } + modules[id] = definition(modules, shared, namespace, navigator, global, document, undefined); + if (callback) { + callback(modules[id]); + } + return modules[id]; + }; + if (typeof module !== "undefined" && module.exports) { + module.exports = define(initialize); + } else if (typeof define === "function" && define.amd) { + dependencies ? define(dependencies, initialize) : define(initialize); + } else { + initialize(); + } + } + function registerSingleton(id, definition, dependencies) { + register(id, definition, dependencies, function(module) { + modules[id] = module.create(); + }); + } + var qoopido = global.qoopido || (global.qoopido = {}), shared = qoopido.shared || (qoopido.shared = {}), modules = qoopido.modules || (qoopido.modules = {}), dependencies = [], isInternal = new RegExp("^\\.+\\/"), regexCanonicalize = new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."), removeNeutral = new RegExp("(^\\/)|\\.\\/", "g"); + qoopido.register = register; + qoopido.registerSingleton = registerSingleton; + function canonicalize(path) { + var collapsed; + while ((collapsed = path.replace(regexCanonicalize, "")) !== path) { + path = collapsed; + } + return path.replace(removeNeutral, ""); + } + if (!Object.create) { + dependencies.push("./polyfill/object/create"); + } + if (!Object.getOwnPropertyNames) { + dependencies.push("./polyfill/object/getownpropertynames"); + } + if (!Object.getOwnPropertyDescriptor || !function() { + try { + Object.getOwnPropertyDescriptor({ + x: 0 + }, "x"); + return true; + } catch (exception) { + return false; + } + }()) { + dependencies.push("./polyfill/object/getownpropertydescriptor"); + } + register("base", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + function getOwnPropertyDescriptors(object) { + var descriptors = {}, properties = Object.getOwnPropertyNames(object), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + descriptors[property] = Object.getOwnPropertyDescriptor(object, property); + } + return descriptors; + } + function prohibitCall() { + throw new Error("[Qoopido.js] Operation prohibited"); + } + return { + create: function() { + var instance = Object.create(this, getOwnPropertyDescriptors(this)), result; + if (instance._constructor) { + result = instance._constructor.apply(instance, arguments); + } + instance.create = instance.extend = prohibitCall; + return result || instance; + }, + extend: function(properties, final) { + var instance; + properties = properties || {}; + final = final === true; + properties._parent = this; + instance = Object.create(this, getOwnPropertyDescriptors(properties)); + if (final === true) { + instance.extend = prohibitCall; + } + return instance; + } + }; +}, navigator, this, document); +(function(definition) { + window.qoopido.register("polyfill/string/ucfirst", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!String.prototype.ucfirst) { + String.prototype.ucfirst = function() { + var self = this; + return self.charAt(0).toUpperCase() + self.slice(1); + }; + } + return String.prototype.ucfirst; +}); +(function(definition) { + window.qoopido.register("polyfill/string/lcfirst", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!String.prototype.lcfirst) { + String.prototype.lcfirst = function() { + var self = this; + return self.charAt(0).toLowerCase() + self.slice(1); + }; + } + return String.prototype.lcfirst; +}); +(function(definition) { + window.qoopido.register("polyfill/window/promise", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var STATE_PENDING = void 0, STATE_SEALED = 0, STATE_FULFILLED = 1, STATE_REJECTED = 2, queue = []; + function addCallback(fn, arg) { + var length = queue.push([ fn, arg ]); + if (length === 1) { + scheduleFlushCallbacks(); + } + } + function scheduleFlushCallbacks() { + window.setTimeout(flushCallbacks, 1); + } + function flushCallbacks() { + var i = 0, tuple; + for (;(tuple = queue[i]) !== undefined; i++) { + tuple[0](tuple[1]); + } + queue.length = 0; + } + function handleThenable(promise, value) { + var then = null, resolved; + try { + if (promise === value) { + throw new TypeError("A promises callback cannot return that same promise."); + } + if (typeof value === "function" || typeof value === "object" && value !== null) { + then = value.then; + if (typeof then === "function") { + then.call(value, function(val) { + if (resolved) { + return true; + } + resolved = true; + if (value !== val) { + resolve(promise, val); + } else { + fulfill(promise, val); + } + }, function(val) { + if (resolved) { + return true; + } + resolved = true; + reject(promise, val); + }); + return true; + } + } + } catch (exception) { + if (resolved) { + return true; + } + reject(promise, exception); + return true; + } + return false; + } + function invokeResolver(resolver, promise) { + function resolvePromise(value) { + resolve(promise, value); + } + function rejectPromise(reason) { + reject(promise, reason); + } + try { + resolver(resolvePromise, rejectPromise); + } catch (exception) { + rejectPromise(exception); + } + } + function invokeCallback(settled, promise, callback, detail) { + var hasCallback = typeof callback === "function", value, error, succeeded, failed; + if (hasCallback) { + try { + value = callback(detail); + succeeded = true; + } catch (exception) { + failed = true; + error = exception; + } + } else { + value = detail; + succeeded = true; + } + if (handleThenable(promise, value)) { + return; + } else if (hasCallback && succeeded) { + resolve(promise, value); + } else if (failed) { + reject(promise, error); + } else if (settled === STATE_FULFILLED) { + resolve(promise, value); + } else if (settled === STATE_REJECTED) { + reject(promise, value); + } + } + function resolve(promise, value) { + if (promise === value) { + fulfill(promise, value); + } else if (!handleThenable(promise, value)) { + fulfill(promise, value); + } + } + function fulfill(promise, value) { + if (promise._state !== STATE_PENDING) { + return; + } + promise._state = STATE_SEALED; + promise._detail = value; + addCallback(publishFulfillment, promise); + } + function reject(promise, reason) { + if (promise._state !== STATE_PENDING) { + return; + } + promise._state = STATE_SEALED; + promise._detail = reason; + addCallback(publishRejection, promise); + } + function publishFulfillment(promise) { + publish(promise, promise._state = STATE_FULFILLED); + } + function publishRejection(promise) { + publish(promise, promise._state = STATE_REJECTED); + } + function subscribe(parent, child, onFulfillment, onRejection) { + var subscribers = parent._subscribers, length = subscribers.length; + subscribers[length] = child; + subscribers[length + STATE_FULFILLED] = onFulfillment; + subscribers[length + STATE_REJECTED] = onRejection; + } + function publish(promise, settled) { + var child, callback, subscribers = promise._subscribers, detail = promise._detail, i = 0; + for (;(child = subscribers[i]) !== undefined; i += 3) { + callback = subscribers[i + settled]; + invokeCallback(settled, child, callback, detail); + } + promise._subscribers = null; + } + function Promise(resolver) { + var self = this; + if (typeof resolver !== "function") { + throw new TypeError("You must pass a resolver function as the first argument to the promise constructor"); + } + self._subscribers = []; + invokeResolver(resolver, self); + } + Promise.prototype = { + _state: undefined, + _detail: undefined, + _subscribers: undefined, + then: function(onFulfilled, onRejected) { + var self = this, thenPromise = new Promise(function() {}); + if (self._state) { + addCallback(function invokePromiseCallback() { + invokeCallback(self._state, thenPromise, arguments[self._state - 1], self._detail); + }); + } else { + subscribe(self, thenPromise, onFulfilled, onRejected); + } + return thenPromise; + }, + "catch": function(onRejected) { + return this.then(null, onRejected); + } + }; + if (!window.Promise) { + window.Promise = Promise; + } + return window.Promise; +}); +(function(definition) { + var dependencies = []; + if (!window.Promise) { + dependencies.push("../polyfill/window/promise"); + } + window.qoopido.register("promise/all", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + return function all(promises) { + if (Object.prototype.toString.call(promises) !== "[object Array]") { + throw new TypeError("You must pass an array to all."); + } + return new window.Promise(function(resolve, reject) { + var results = [], remaining = promises.length, i = 0, promise; + if (remaining === 0) { + resolve([]); + } + function resolver(index) { + return function(value) { + resolveAll(index, value); + }; + } + function resolveAll(index, value) { + results[index] = value; + if (--remaining === 0) { + resolve(results); + } + } + for (;(promise = promises[i]) !== undefined; i++) { + if (promise && typeof promise.then === "function") { + promise.then(resolver(i), reject); + } else { + resolveAll(i, promise); + } + } + }); + }; +}); +(function(definition) { + var dependencies = []; + if (!window.Promise) { + dependencies.push("../polyfill/window/promise"); + } + window.qoopido.register("promise/defer", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + return function defer() { + var self = this; + self.promise = new window.Promise(function(resolve, reject) { + self.resolve = resolve; + self.reject = reject; + }); + }; +}); +(function(definition) { + var dependencies = [ "./base", "./promise/all", "./promise/defer" ]; + if (!String.prototype.ucfirst) { + dependencies.push("./polyfill/string/ucfirst"); + } + if (!String.prototype.lcfirst) { + dependencies.push("./polyfill/string/lcfirst"); + } + window.qoopido.registerSingleton("support", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var CombinedPromise = modules["promise/all"], DeferredPromise = modules["promise/defer"], matchPrefix = new RegExp("^(Moz|WebKit|Khtml|ms|O|Icab)(?=[A-Z])"), removeJsPrefix = new RegExp("^(?:webkit|khtml|icab|moz|ms|o)([A-Z])"), removeCssPrefix = new RegExp("^-(?:webkit|khtml|icab|moz|ms|o)-"), convertToCamelCase = new RegExp("-([a-z])", "gi"), convertToHyphens = new RegExp("([A-Z])", "g"), callbackUcfirst = function() { + return arguments[1].ucfirst(); + }, lookup = { + prefix: null, + method: {}, + property: {}, + css: {}, + promises: { + prefix: null, + method: {}, + property: {}, + css: {}, + test: {} + } + }; + function normalize(value) { + return value.replace(removeJsPrefix, "$1").lcfirst().replace(removeCssPrefix, "").replace(convertToCamelCase, callbackUcfirst); + } + return modules["base"].extend({ + test: {}, + pool: shared.pool && shared.pool.dom, + testMultiple: function() { + var test, tests = [], i = 0; + for (;(test = arguments[i]) !== undefined; i++) { + switch (typeof test) { + case "string": + tests.push(this.test[test]()); + break; + + case "boolean": + var deferred = new DeferredPromise(); + !!test ? deferred.resolve() : deferred.reject(); + tests.push(deferred.promise); + break; + + default: + tests.push(test); + break; + } + } + return new CombinedPromise(tests); + }, + getPrefix: function() { + var self = this, stored = lookup.prefix || null, property; + if (stored === null) { + var sample = self.pool ? self.pool.obtain("div") : document.createElement("div"), styles = sample.style; + stored = false; + for (property in styles) { + if (matchPrefix.test(property)) { + stored = property.match(matchPrefix)[0]; + } + } + if (stored === false && "WebkitOpacity" in styles) { + stored = "WebKit"; + } + if (stored === false && "KhtmlOpacity" in styles) { + stored = "Khtml"; + } + stored = lookup.prefix = stored === false ? false : [ stored.toLowerCase(), stored.toLowerCase().ucfirst(), stored ]; + sample.dispose && sample.dispose(); + } + return stored; + }, + getMethod: function(pMethod, pElement) { + pMethod = normalize(pMethod); + pElement = pElement || window; + var type = pElement.tagName, pointer = lookup.method[type] = lookup.method[type] || {}, stored = pointer[pMethod] = lookup.method[type][pMethod] || null; + if (stored === null) { + stored = false; + var candidates, candidate, i = 0, uMethod = pMethod.ucfirst(), prefixes = this.getPrefix(); + if (prefixes !== false) { + candidates = (pMethod + " " + uMethod + " " + prefixes.join(uMethod + " ") + uMethod).split(" "); + } else { + candidates = [ pMethod ]; + } + for (;(candidate = candidates[i]) !== undefined; i++) { + if (pElement[candidate] !== undefined && (typeof pElement[candidate] === "function" || typeof pElement[candidate] === "object")) { + stored = candidate; + break; + } + } + lookup.method[type][pMethod] = stored; + } + return stored; + }, + getProperty: function(pProperty, pElement) { + pProperty = normalize(pProperty); + pElement = pElement || window; + var type = pElement.tagName, pointer = lookup.property[type] = lookup.property[type] || {}, stored = pointer[pProperty] = lookup.property[type][pProperty] || null; + if (stored === null) { + stored = false; + var candidates, candidate, i = 0, uProperty = pProperty.ucfirst(), prefixes = this.getPrefix(); + if (prefixes !== false) { + candidates = (pProperty + " " + uProperty + " " + prefixes.join(uProperty + " ") + uProperty).split(" "); + } else { + candidates = [ pProperty ]; + } + for (i; (candidate = candidates[i]) !== undefined; i++) { + if (pElement[candidate] !== undefined) { + stored = candidate; + break; + } + } + lookup.property[type][pProperty] = stored; + } + return stored; + }, + getCssProperty: function(pProperty) { + pProperty = normalize(pProperty); + var self = this, stored = lookup.css[pProperty] || null; + if (stored === null) { + stored = false; + var candidate, i = 0, sample = self.pool ? self.pool.obtain("div") : document.createElement("div"), uProperty = pProperty.ucfirst(), prefixes = this.getPrefix() || [], candidates = (pProperty + " " + uProperty + " " + prefixes.join(uProperty + " ") + uProperty).split(" "), prefix = ""; + for (i; (candidate = candidates[i]) !== undefined; i++) { + if (sample.style[candidate] !== undefined) { + stored = candidate; + if (i > 0) { + prefix = "-"; + } + break; + } + } + stored = lookup.css[pProperty] = stored !== false ? [ prefix + stored.replace(convertToHyphens, "-$1").toLowerCase(), stored ] : false; + sample.dispose && sample.dispose(); + } + return stored; + }, + supportsPrefix: function() { + return !!this.getPrefix(); + }, + supportsMethod: function(pMethod, pElement) { + return !!this.getMethod(pMethod, pElement); + }, + supportsProperty: function(pProperty, pElement) { + return !!this.getProperty(pProperty, pElement); + }, + supportsCssProperty: function(pProperty) { + return !!this.getCssProperty(pProperty); + }, + testPrefix: function() { + var stored = lookup.promises.prefix; + if (stored === null) { + var deferred = new DeferredPromise(), prefix = this.getPrefix(); + !!prefix ? deferred.resolve(prefix) : deferred.reject(); + stored = lookup.promises.prefix = deferred.promise; + } + return stored; + }, + testMethod: function(pMethod, pElement) { + pElement = pElement || window; + var type = pElement.tagName, pointer = lookup.promises.method[type] = lookup.promises.method[type] || {}, stored = pointer[pMethod] = lookup.promises.method[type][pMethod] || null; + if (stored === null) { + var deferred = new DeferredPromise(), method = this.getMethod(pMethod, pElement); + !!method ? deferred.resolve(method) : deferred.reject(); + stored = lookup.promises.method[type][pMethod] = deferred.promise; + } + return stored; + }, + testProperty: function(pProperty, pElement) { + pElement = pElement || window; + var type = pElement.tagName, pointer = lookup.promises.property[type] = lookup.promises.property[type] || {}, stored = pointer[pProperty] = lookup.promises.property[type][pProperty] || null; + if (stored === null) { + var deferred = new DeferredPromise(), property = this.getProperty(pProperty, pElement); + !!property ? deferred.resolve(property) : deferred.reject(); + stored = lookup.promises.property[type][pProperty] = deferred.promise; + } + return stored; + }, + testCssProperty: function(pProperty) { + var stored = lookup.promises.css[pProperty] || null; + if (stored === null) { + var deferred = new DeferredPromise(), property = this.getCssProperty(pProperty); + !!property ? deferred.resolve(property) : deferred.reject(); + stored = lookup.promises.css[pProperty] = deferred.promise; + } + return stored; + }, + addTest: function(pId, pTest) { + return this.test[pId] = function() { + var stored = lookup.promises.test[pId] || null; + if (stored === null) { + var deferred = new DeferredPromise(), parameter = Array.prototype.slice.call(arguments); + parameter.splice(0, 0, deferred); + pTest.apply(null, parameter); + stored = lookup.promises.test[pId] = deferred.promise; + } + return stored; + }; + } + }); +}); +(function(definition) { + window.qoopido.register("function/merge", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + return function merge() { + var target = arguments[0], i, properties, property, tgt, src; + for (i = 1; (properties = arguments[i]) !== undefined; i++) { + for (property in properties) { + tgt = target[property]; + src = properties[property]; + if (src !== undefined) { + if (src !== null && typeof src === "object") { + if (src.length !== undefined) { + tgt = tgt && typeof tgt === "object" && tgt.length !== undefined ? tgt : []; + } else { + tgt = tgt && typeof tgt === "object" && tgt.length === undefined ? tgt : {}; + } + target[property] = merge(tgt, src); + } else { + target[property] = src; + } + } + } + } + return target; + }; +}); +(function(definition) { + window.qoopido.register("function/unique/uuid", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var lookup = {}, regex = new RegExp("[xy]", "g"); + function generateUuid() { + return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(regex, function(c) { + var r = Math.random() * 16 | 0, v = c === "x" ? r : r & 3 | 8; + return v.toString(16); + }); + } + return function() { + var result; + do { + result = generateUuid(); + } while (typeof lookup[result] !== "undefined"); + lookup[result] = true; + return result; + }; +}); +(function(definition) { + window.qoopido.registerSingleton("hook/event", definition, [ "../base" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + function transferProperties(event, originalEvent, properties) { + var i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + event[property] = originalEvent[property]; + } + event._properties = event._properties.concat(properties); + } + var hooks = { + general: { + properties: "type altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which path".split(" "), + process: function(event, originalEvent) { + var pointer; + event.originalEvent = originalEvent; + event.isDefaultPrevented = originalEvent.defaultPrevented ? true : false; + event.isPropagationStopped = originalEvent.cancelBubble ? true : false; + event.metaKey = originalEvent.metaKey && originalEvent.metaKey !== false ? true : false; + if (!event.target) { + event.target = originalEvent.srcElement || document; + } + if (event.target.nodeType === 3) { + event.target = event.target.parentNode; + } + if (!event.path) { + event.path = []; + pointer = event.target; + do { + event.path.push(pointer); + } while (pointer = pointer.parentNode); + event.path.push(window); + } + } + }, + mouse: { + regex: new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"), + properties: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement dataTransfer".split(" "), + process: function(event, originalEvent) { + var pointer, fromElement, which; + fromElement = originalEvent.fromElement; + which = originalEvent.button; + if (event.pageX === null && originalEvent.clientX !== null) { + pointer = event.target.ownerDocument || document; + pointer = pointer.documentElement || pointer.body; + event.pageX = originalEvent.clientX + (pointer.scrollLeft || 0) - (pointer.clientLeft || 0); + event.pageY = originalEvent.clientY + (pointer.scrollTop || 0) - (pointer.clientTop || 0); + } + if (!event.relatedTarget && fromElement) { + event.relatedTarget = fromElement === event.target ? originalEvent.toElement : fromElement; + } + if (!event.which && which !== undefined) { + event.which = which & 1 ? 1 : which & 2 ? 3 : which & 4 ? 2 : 0; + } + } + }, + key: { + regex: new RegExp("^(?:key)"), + properties: "char charCode key keyCode".split(" "), + process: function(event, originalEvent) { + if (event.which === null) { + event.which = originalEvent.charCode !== null ? originalEvent.charCode : originalEvent.keyCode; + } + } + } + }; + return modules["base"].extend({ + add: function(property, hook) { + if (property && hook && hooks[property]) { + hooks[property] = hook; + } + return this; + }, + get: function(property) { + if (property && hooks[property]) { + return hooks[property]; + } + return null; + }, + process: function(event, originalEvent) { + var id, hook, isMatch; + for (id in hooks) { + hook = hooks[id]; + isMatch = !hook.regex || hook.regex.test(originalEvent.type); + if (isMatch) { + if (hook.properties) { + transferProperties(event, originalEvent, hook.properties); + } + if (hook.process) { + hook.process(event, originalEvent); + } + if (hook.delegate) { + event.delegate = hook.delegate; + } + } + } + } + }); +}); +(function(definition) { + var dependencies = [ "../base", "../support" ]; + if (!window.getComputedStyle) { + dependencies.push("../polyfill/window/getcomputedstyle"); + } + window.qoopido.registerSingleton("hook/css", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var mSupport = modules["support"], getComputedStyle = window.getComputedStyle || modules["polyfill/window/getcomputedstyle"], hooks = { + general: { + get: function(element, property) { + return getComputedStyle(element, null).getPropertyValue(property[0]); + }, + set: function(element, property, value) { + element.style[property[1]] = value; + } + }, + opacity: !mSupport.supportsCssProperty("opacity") ? { + regex: new RegExp("alpha\\(opacity=(.*)\\)", "i"), + get: function(element, property, value) { + value = getComputedStyle(element, null).getPropertyValue("filter").toString().match(this.regex); + if (value) { + value = value[1] / 100; + } else { + value = 1; + } + return value; + }, + set: function(element, property, value) { + var style = element.style; + style.zoom = 1; + style.filter = "alpha(opacity=" + (value * 100 + .5 >> 0) + ")"; + } + } : null + }; + return modules["base"].extend({ + add: function(property, hook) { + if (property && hook && hooks[property]) { + hooks[property] = hook; + } + return this; + }, + get: function(property) { + if (property && hooks[property]) { + return hooks[property]; + } + return null; + }, + process: function(method, element, property, value) { + var hook; + property = mSupport.getCssProperty(property, element) || null; + if (property) { + return ((hook = this.get(property[1])) && hook[method] || this.get("general")[method])(element, property, value); + } + } + }); +}); +(function(definition) { + window.qoopido.register("dom/event", definition, [ "../base", "../hook/event" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var hooks = modules["hook/event"]; + return modules["base"].extend({ + originalEvent: null, + isDelegate: false, + isDefaultPrevented: false, + isPropagationStopped: false, + isImmediatePropagationStopped: false, + _properties: null, + _constructor: function(event) { + var self = this; + self._properties = []; + self._obtain(event); + return self; + }, + _obtain: function(event) { + hooks.process(this, event); + }, + _dispose: function() { + var self = this, i = 0, property; + for (;(property = self._properties[i]) !== undefined; i++) { + delete self[property]; + } + delete self.delegate; + self.originalEvent = null; + self.isDelegate = false; + self.isDefaultPrevented = false; + self.isPropagationStopped = false; + self.isImmediatePropagationStopped = false; + self._properties.length = 0; + }, + preventDefault: function() { + var self = this, event = self.originalEvent; + if (event.cancelable !== false) { + self.isDefaultPrevented = true; + if (event.preventDefault) { + event.preventDefault(); + } else { + event.returnValue = false; + } + } + }, + stopPropagation: function() { + var self = this, event = self.originalEvent; + self.isPropagationStopped = true; + if (event.stopPropagation) { + event.stopPropagation(); + } + event.cancelBubble = true; + }, + stopImmediatePropagation: function() { + var self = this, event = self.originalEvent; + self.isImmediatePropagationStopped = true; + if (event.stopImmediatePropagation) { + event.stopImmediatePropagation(); + } + self.stopPropagation(); + } + }); +}); +(function(definition) { + var dependencies = [ "../base", "../function/unique/uuid", "../hook/css", "./event" ]; + if (!window.CustomEvent) { + dependencies.push("../polyfill/window/customevent"); + } + if (!window.addEventListener) { + dependencies.push("../polyfill/window/addeventlistener"); + } + if (!window.removeEventListener) { + dependencies.push("../polyfill/window/removeeventlistener"); + } + if (!window.dispatchEvent) { + dependencies.push("../polyfill/window/dispatchevent"); + } + if (!Element.prototype.matches) { + dependencies.push("../polyfill/element/matches"); + } + if (!document.querySelector) { + dependencies.push("../polyfill/document/queryselector"); + } + if (!document.querySelectorAll) { + dependencies.push("../polyfill/document/queryselectorall"); + } + if (!String.prototype.trim) { + dependencies.push("../polyfill/string/trim"); + } + window.qoopido.register("dom/element", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var stringObject = "object", stringString = "string", generateUuid = modules["function/unique/uuid"], head = document.getElementsByTagName("head")[0], contentAttribute = "textContent" in document.createElement("a") ? "textContent" : "innerText", previousSibling = typeof head.previousElementSibling !== "undefined" ? function previousSibling() { + return this.previousElementSibling; + } : function previousSibling() { + var element = this; + while (element = element.previousSibling) { + if (element.nodeType === 1) { + return element; + } + } + }, nextSibling = typeof head.nextElementSibling !== "undefined" ? function nextSibling() { + return this.nextElementSibling; + } : function nextSibling() { + var element = this; + while (element = element.nextSibling) { + if (element.nodeType === 1) { + return element; + } + } + }, isTag = new RegExp("^<(\\w+)\\s*/>$"), matchEvent = new RegExp("^[^-]+"), splitList = new RegExp(" +", "g"), pool = modules["pool/module"] && modules["pool/module"].create(modules["dom/event"], null, true) || null, hooks = modules["hook/css"], storage = {}, events = { + custom: { + type: "CustomEvent", + method: "initCustomEvent" + }, + html: { + regex: new RegExp("^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$"), + type: "HTMLEvents", + method: "initEvent" + }, + mouse: { + regex: new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"), + type: "MouseEvents", + method: "initMouseEvent" + } + }; + function resolveEvent(type) { + var id, prototype, candidate; + for (id in events) { + prototype = events[id]; + if (!prototype.regex || prototype.regex.test(type)) { + candidate = prototype; + } + } + return candidate; + } + function emitEvent(type, detail, uuid) { + var self = this, prototype = resolveEvent(type), event = document.createEvent(prototype.type); + event[prototype.method](type, type === "load" ? false : true, true, detail); + if (uuid) { + event._quid = uuid; + event.isDelegate = true; + } + self.element.dispatchEvent(event); + } + function resolveElement(element) { + var tag; + if (typeof element === "string") { + try { + if (isTag.test(element) === true) { + tag = element.replace(isTag, "$1").toLowerCase(); + element = document.createElement(tag); + } else { + element = document.querySelector(element); + } + } catch (exception) { + element = null; + } + } + if (!element) { + throw new Error("[Qoopido.js] Element could not be resolved"); + } + return element; + } + function resolveArguments(parameters) { + return Array.prototype.concat.apply([], Array.prototype.splice.call(parameters, 0)).join(" ").split(splitList); + } + function matchesDelegate(event, delegate) { + var i = 0, pointer; + for (;(pointer = event.path[i]) !== undefined; i++) { + if (pointer.matches(delegate)) { + event.currentTarget = pointer; + return true; + } + if (pointer === event.currentTarget) { + break; + } + } + return false; + } + return modules["base"].extend({ + type: null, + element: null, + _listener: null, + _constructor: function(element, attributes, styles) { + var self = this, uuid; + element = resolveElement(element); + uuid = element._quid; + if (!uuid) { + uuid = element._quid = generateUuid(); + self.type = element.tagName; + self.element = element; + self._listener = {}; + storage[uuid] = self; + } else { + self = storage[uuid]; + } + if (typeof attributes === "object" && attributes !== null) { + self.setAttributes(attributes); + } + if (typeof styles === "object" && styles !== null) { + self.setStyles(styles); + } + if (self !== this) { + this.dispose && this.dispose(); + } + return self; + }, + _obtain: function(element, attributes, styles) { + this._constructor(element, attributes, styles); + }, + _dispose: function() { + var self = this, id, event; + for (id in self._listener) { + event = id.match(matchEvent); + self.element.removeEventListener(event, self._listener[id]); + delete self._listener[id]; + } + self.type = null; + self.element = null; + }, + getContent: function(html) { + var element = this.element; + return html && html !== false ? element.innerHTML : element[contentAttribute]; + }, + setContent: function(content, html) { + var self = this, element = self.element; + if (html && html !== false) { + element.innerHTML = content; + } else { + element[contentAttribute] = content; + } + return self; + }, + getAttribute: function(attribute) { + var self = this; + if (attribute && typeof attribute === stringString) { + return self.element.getAttribute(attribute); + } + }, + getAttributes: function() { + var self = this, result = {}, attributes = resolveArguments(arguments), i = 0, attribute; + for (;(attribute = attributes[i]) !== undefined; i++) { + result[attribute] = self.element.getAttribute(attribute); + } + return result; + }, + setAttribute: function(attribute, value) { + var self = this; + if (attribute && typeof attribute === stringString) { + self.element.setAttribute(attribute, value); + } + return self; + }, + setAttributes: function(attributes) { + var self = this, attribute; + if (attributes && typeof attributes === stringObject && !attributes.length) { + for (attribute in attributes) { + self.element.setAttribute(attribute, attributes[attribute]); + } + } + return self; + }, + removeAttribute: function(attribute) { + var self = this; + if (attribute && typeof attribute === stringString) { + self.element.removeAttribute(attribute); + } + return self; + }, + removeAttributes: function() { + var self = this, attributes = resolveArguments(arguments), i = 0, attribute; + for (;(attribute = attributes[i]) !== undefined; i++) { + self.element.removeAttribute(attribute); + } + return self; + }, + getStyle: function(property) { + var self = this; + if (property && typeof property === stringString) { + return hooks.process("get", self.element, property); + } + }, + getStyles: function() { + var self = this, result = {}, properties = resolveArguments(arguments), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + result[property] = hooks.process("get", self.element, property); + } + return result; + }, + setStyle: function(property, value) { + var self = this; + if (property && typeof property === stringString) { + hooks.process("set", self.element, property, value); + } + return self; + }, + setStyles: function(properties) { + var self = this, property; + if (properties && typeof properties === stringObject && !properties.length) { + for (property in properties) { + hooks.process("set", self.element, property, properties[property]); + } + } + return self; + }, + removeStyle: function(property) { + var self = this; + if (property && typeof property === stringString) { + self.setStyle(property, ""); + } + return self; + }, + removeStyles: function() { + var self = this, properties = resolveArguments(arguments), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + self.setStyle(property, ""); + } + return self; + }, + siblings: function(selector) { + var element = this.element, pointer = element.parentNode.firstChild, siblings = []; + for (;pointer; pointer = nextSibling.call(pointer)) { + if (pointer !== element && (!selector || pointer.matches(selector))) { + siblings.push(pointer); + } + } + return siblings; + }, + siblingsBefore: function(selector) { + var pointer = this.element.previousSibling, siblings = []; + for (;pointer; pointer = previousSibling.call(pointer)) { + if (!selector || pointer.matches(selector)) { + siblings.push(pointer); + } + } + return siblings; + }, + siblingsAfter: function(selector) { + var pointer = this.element.nextSibling, siblings = []; + for (;pointer; pointer = nextSibling.call(pointer)) { + if (!selector || pointer.matches(selector)) { + siblings.push(pointer); + } + } + return siblings; + }, + previous: function(selector) { + var pointer = previousSibling.call(this.element); + if (!selector) { + return pointer; + } else { + for (;pointer; pointer = previousSibling.call(pointer)) { + if (pointer.matches(selector)) { + return pointer; + } + } + } + }, + next: function(selector) { + var pointer = nextSibling.call(this.element); + if (!selector) { + return pointer; + } else { + for (;pointer; pointer = nextSibling.call(pointer)) { + if (pointer.matches(selector)) { + return pointer; + } + } + } + }, + find: function(selector) { + var self = this.element, uuid, matches; + selector = selector.trim(); + if (selector.charAt(0) === ">") { + uuid = self._quid; + self.setAttribute("data-quid", uuid); + selector = '[data-quid="' + uuid + '"] ' + selector; + matches = self.parentNode.querySelectorAll(selector); + self.removeAttribute("data-quid"); + } else { + matches = self.querySelectorAll(selector); + } + return matches; + }, + parent: function(selector) { + var pointer; + if (!selector) { + return this.element.parentNode; + } else { + pointer = this.element; + for (;pointer; pointer = pointer.parentNode) { + if (pointer.matches(selector)) { + return pointer; + } + } + } + }, + parents: function(selector) { + var pointer = this.element.parentNode, parents = []; + for (;pointer; pointer = pointer.parentNode) { + if (pointer.nodeType === 9) { + return parents; + } else if (pointer.nodeType === 1) { + if (!selector || pointer.matches(selector)) { + parents.push(pointer); + } + } + } + }, + isVisible: function() { + var self = this, element = self.element; + return !(element.offsetWidth <= 0 && element.offsetHeight <= 0 || self.getStyle("visibility") === "hidden" || self.getStyle("opacity") <= 0); + }, + hasClass: function(name) { + return name ? new RegExp("(?:^|\\s)" + name + "(?:\\s|$)").test(this.element.className) : false; + }, + addClass: function(name) { + var self = this; + if (name && !self.hasClass(name)) { + self.element.className += self.element.className ? " " + name : name; + } + return self; + }, + removeClass: function(name) { + var self = this; + if (name && self.hasClass(name)) { + self.element.className = self.element.className.replace(new RegExp("(?:^|\\s)" + name + "(?!\\S)"), ""); + } + return self; + }, + toggleClass: function(name) { + var self = this; + if (name) { + self.hasClass(name) ? self.removeClass(name) : self.addClass(name); + } + return self; + }, + prepend: function(element) { + var self = this, target = self.element; + if (element) { + try { + element = element.element || resolveElement(element); + target.firstChild ? target.insertBefore(element, target.firstChild) : self.append(element); + } catch (exception) { + target.insertAdjacentHTML("afterBegin", element); + } + } + return self; + }, + append: function(element) { + var self = this, target = self.element; + if (element) { + try { + target.appendChild(element.element || resolveElement(element)); + } catch (exception) { + target.insertAdjacentHTML("beforeEnd", element); + } + } + return self; + }, + prependTo: function(target) { + var self = this, element = self.element; + if (target) { + (target = target.element || resolveElement(target)).firstChild ? target.insertBefore(element, target.firstChild) : self.appendTo(target); + } + return self; + }, + appendTo: function(target) { + var self = this; + if (target) { + (target.element || resolveElement(target)).appendChild(self.element); + } + return self; + }, + insertBefore: function(target) { + var self = this, element = self.element; + if (target) { + (target = target.element || resolveElement(target)).parentNode.insertBefore(element, target); + } + return self; + }, + insertAfter: function(target) { + var self = this, element = self.element; + if (target) { + (target = target.element || resolveElement(target)).nextSibling ? target.parentNode.insertBefore(element, target.nextSibling) : self.appendTo(target.parentNode); + } + return self; + }, + replace: function(target) { + var self = this, element = self.element; + if (target) { + (target = target.element || resolveElement(target)).parentNode.replaceChild(element, target); + } + return self; + }, + replaceWith: function(element) { + var self = this, target = self.element; + if (element) { + element = element.element || resolveElement(element); + target.parentNode.replaceChild(element, target); + } + return self; + }, + remove: function() { + var self = this, element = self.element; + element.parentNode.removeChild(element); + return self; + }, + on: function(events) { + var self = this, element = self.element, delegate = arguments.length > 2 ? arguments[1] : null, fn = arguments.length > 2 ? arguments[2] : arguments[1], uuid = fn._quid || (fn._quid = generateUuid()), i = 0, event; + events = events.split(" "); + for (;(event = events[i]) !== undefined; i++) { + var id = event + "-" + uuid, listener = function(event) { + var delegateTo; + event = pool && pool.obtain(event) || modules["dom/event"].create(event); + if (!event.isPropagationStopped) { + delegateTo = event.delegate; + event._quid = generateUuid(); + if (!delegate || matchesDelegate(event, delegate)) { + fn.call(event.currentTarget, event, event.originalEvent.detail); + } + if (delegateTo) { + delete event.delegate; + emitEvent.call(self, delegateTo); + } + } + event.dispose && event.dispose(); + }; + listener.type = event; + self._listener[id] = listener; + element.addEventListener(event, listener); + } + return self; + }, + one: function(events) { + var self = this, delegate = arguments.length > 3 || typeof arguments[1] === "string" ? arguments[1] : null, fn = arguments.length > 3 || typeof arguments[2] === "function" ? arguments[2] : arguments[1], each = (arguments.length > 3 ? arguments[3] : arguments[2]) !== false, listener = function(event) { + self.off(each === true ? event.type : events, listener); + fn.call(this, event, event.originalEvent.detail); + }; + fn._quid = listener._quid = generateUuid(); + if (delegate) { + self.on(events, delegate, listener); + } else { + self.on(events, listener); + } + return self; + }, + off: function(events, fn) { + var self = this, element = self.element, i = 0, event, id, listener; + events = events.split(" "); + for (;(event = events[i]) !== undefined; i++) { + id = fn._quid && event + "-" + fn._quid || null; + listener = id && self._listener[id] || null; + if (listener) { + element.removeEventListener(event, listener); + delete self._listener[id]; + } else { + element.removeEventListener(event, fn); + } + } + return self; + }, + emit: function(event, data) { + var self = this; + emitEvent.call(self, event, data); + return self; + } + }); +}); +(function(definition) { + window.qoopido.register("dom/element/emerge", definition, [ "../element", "../../function/merge", "../../function/unique/uuid" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var defaults = { + interval: 50, + threshold: "auto", + recur: true, + auto: 1, + visibility: true + }, documentElement = window.document.documentElement, viewport = {}, intervals = {}, elements = {}, prototype, EVENT_EMERGED = "emerged", EVENT_DEMERGED = "demerged", DOM_RESIZE = "resize orientationchange"; + window = modules["dom/element"].create(window); + if (document.compatMode !== "CSS1Compat") { + throw "[Qoopido.js] Not in standards mode"; + } + function tick(interval) { + var index, pointer = elements[interval]; + for (index in pointer) { + if (index !== "length") { + checkState.call(pointer[index]); + } + } + if (pointer.length === 0) { + window.element.clearInterval(intervals[interval]); + delete intervals[interval]; + } + } + function globalOnResize() { + viewport.left = 0; + viewport.top = 0; + viewport.right = window.innerWidth || documentElement.clientWidth; + viewport.bottom = window.innerHeight || documentElement.clientHeight; + } + function instanceOnResize() { + var self = this, treshold = self._settings.threshold, x = treshold !== undefined ? treshold : documentElement.clientWidth * self._settings.auto, y = treshold !== undefined ? treshold : documentElement.clientHeight * self._settings.auto; + self._viewport.left = viewport.left - x; + self._viewport.top = viewport.top - y; + self._viewport.right = viewport.right + x; + self._viewport.bottom = viewport.bottom + y; + } + function checkState() { + var self = this, state = false, priority = 2, boundaries; + if (self.isVisible() && (self.getStyle("visibility") !== "hidden" || self._settings.visibility === false)) { + boundaries = self.element.getBoundingClientRect(); + if ((boundaries.bottom >= self._viewport.top && boundaries.bottom <= self._viewport.bottom || boundaries.top >= self._viewport.top && boundaries.top <= self._viewport.bottom || self._viewport.bottom >= boundaries.top && self._viewport.bottom <= boundaries.bottom || self._viewport.top >= boundaries.top && self._viewport.top <= boundaries.bottom) && (boundaries.left >= self._viewport.left && boundaries.left <= self._viewport.right || boundaries.right >= self._viewport.left && boundaries.right <= self._viewport.right || self._viewport.left >= boundaries.left && self._viewport.left <= boundaries.right || self._viewport.right >= boundaries.left && self._viewport.right <= boundaries.right)) { + if (self._settings.threshold === 0 || (boundaries.bottom >= viewport.top && boundaries.bottom <= viewport.bottom || boundaries.top >= viewport.top && boundaries.top <= viewport.bottom || viewport.bottom >= boundaries.top && viewport.bottom <= boundaries.bottom || viewport.top >= boundaries.top && viewport.top <= boundaries.bottom) && (boundaries.left >= viewport.left && boundaries.left <= viewport.right || boundaries.right >= viewport.left && boundaries.right <= viewport.right || viewport.left >= boundaries.left && viewport.left <= boundaries.right || viewport.right >= boundaries.left && viewport.right <= boundaries.right)) { + priority = 1; + } + state = true; + } + } + if (state !== self._state || state === true && priority !== self._priority) { + setState.call(self, state, priority); + } + } + function setState(state, priority) { + var self = this; + self._state = state; + self._priority = priority; + if (self._settings.recur !== true) { + self.remove(); + } + if (state === true) { + self.emit(EVENT_EMERGED, priority); + } else { + self.emit(EVENT_DEMERGED); + } + } + prototype = modules["dom/element"].extend({ + _quid: null, + _viewport: null, + _settings: null, + _state: null, + _priority: null, + _constructor: function(element, settings) { + var self = prototype._parent._constructor.call(this, element); + settings = modules["function/merge"]({}, defaults, settings || {}); + if (settings.threshold === "auto") { + delete settings.threshold; + } + if (intervals[settings.interval] === undefined) { + elements[settings.interval] = elements[settings.interval] || { + length: 0 + }; + intervals[settings.interval] = window.element.setInterval(function() { + tick(settings.interval); + }, settings.interval); + } + self._quid = modules["function/unique/uuid"](); + self._viewport = {}; + self._settings = settings; + self._state = false; + self._priority = 2; + elements[settings.interval][self._quid] = self; + elements[settings.interval].length++; + window.on(DOM_RESIZE, function() { + instanceOnResize.call(self); + }); + instanceOnResize.call(self); + return self; + }, + remove: function() { + var self = this; + delete elements[self._settings.interval][self._quid]; + elements[self._settings.interval].length--; + } + }); + window.on(DOM_RESIZE, globalOnResize); + globalOnResize(); + return prototype; +}); +(function(definition) { + window.qoopido.register("dom/element/lazyimage", definition, [ "./emerge", "../../function/merge" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var defaults = { + interval: 50, + threshold: "auto", + attribute: "data-lazyimage" + }, queue = 0, prototype, EVENT_REQUESTED = "requested", EVENT_LOADED = "loaded", EVENT_FAILED = "failed", EVENT_EMERGED = "emerged", DOM_LOAD = "load", DOM_ERROR = "error", DOM_STATE = "".concat(DOM_LOAD, " ", DOM_ERROR); + function load() { + var self = this, attribute = self._settings.attribute; + queue += 1; + self.emit(EVENT_REQUESTED).one(DOM_STATE, function(event) { + if (event.type === DOM_LOAD) { + self.emit(EVENT_LOADED); + } else { + self.emit(EVENT_FAILED); + } + queue -= 1; + }, false).setAttribute("src", self.getAttribute(attribute)).removeAttribute(attribute); + } + prototype = modules["dom/element/emerge"].extend({ + _constructor: function(element, settings) { + var self = prototype._parent._constructor.call(this, element, modules["function/merge"]({}, defaults, settings || {})); + self.on(EVENT_EMERGED, function onEmerge(event) { + if (queue === 0 || event.data === 1) { + self.remove(); + self.off(EVENT_EMERGED, onEmerge); + load.call(self); + } + }); + return self; + } + }); + return prototype; +}); \ No newline at end of file diff --git a/dist/3.7.3/max/packages/qoopido.lazyimage.legacy.js b/dist/3.7.3/max/packages/qoopido.lazyimage.legacy.js new file mode 100644 index 00000000..6fbcf4f2 --- /dev/null +++ b/dist/3.7.3/max/packages/qoopido.lazyimage.legacy.js @@ -0,0 +1,1685 @@ +/*! +* Qoopido.js library +* +* version: 3.7.3 +* date: 2015-08-05 +* author: Dirk Lueth +* website: https://github.com/dlueth/qoopido.js +* +* Copyright (c) 2015 Dirk Lueth +*/ +(function(definition, qoopido) { + if (qoopido.register) { + qoopido.register("polyfill/object/defineproperty", definition); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/defineproperty"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.defineProperty || !function() { + try { + Object.defineProperty({}, "x", {}); + return true; + } catch (exception) { + return false; + } + }()) { + var defineProperty = Object.defineProperty, defineGetter = Object.prototype.__defineGetter__, defineSetter = Object.prototype.__defineSetter__; + Object.defineProperty = function(obj, prop, desc) { + if (defineProperty) { + try { + return defineProperty(obj, prop, desc); + } catch (exception) {} + } + if (obj !== Object(obj)) { + throw new TypeError("Object.defineProperty called on non-object"); + } + if (defineGetter && "get" in desc) { + defineGetter.call(obj, prop, desc.get); + } + if (defineSetter && "set" in desc) { + defineSetter.call(obj, prop, desc.set); + } + if ("value" in desc) { + obj[prop] = desc.value; + } + return obj; + }; + } + return Object.defineProperty; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + var dependencies = []; + if (!Object.defineProperty || !function() { + try { + Object.defineProperty({}, "x", {}); + return true; + } catch (exception) { + return false; + } + }()) { + dependencies.push("./defineproperty"); + } + qoopido.register("polyfill/object/defineproperties", definition, dependencies); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/defineproperties"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.defineProperties) { + Object.defineProperties = function(obj, properties) { + if (obj !== Object(obj)) { + throw new TypeError("Object.defineProperties called on non-object"); + } + var name; + for (name in properties) { + if (Object.prototype.hasOwnProperty.call(properties, name)) { + Object.defineProperty(obj, name, properties[name]); + } + } + return obj; + }; + } + return Object.defineProperties; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + var dependencies = []; + if (!Object.defineProperties) { + dependencies.push("./defineproperties"); + } + qoopido.register("polyfill/object/create", definition, dependencies); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/create"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.create) { + Object.create = function(prototype, properties) { + if (typeof prototype !== "object") { + throw new TypeError(); + } + function Constructor() {} + Constructor.prototype = prototype; + var obj = new Constructor(); + if (prototype) { + obj.constructor = Constructor; + } + if (arguments.length > 1) { + if (properties !== Object(properties)) { + throw new TypeError(); + } + Object.defineProperties(obj, properties); + } + return obj; + }; + } + return Object.create; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + qoopido.register("polyfill/object/getownpropertynames", definition); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/getownpropertynames"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.getOwnPropertyNames) { + Object.getOwnPropertyNames = function(obj) { + if (obj !== Object(obj)) { + throw new TypeError("Object.getOwnPropertyNames called on non-object"); + } + var props = [], p; + for (p in obj) { + if (Object.prototype.hasOwnProperty.call(obj, p)) { + props.push(p); + } + } + return props; + }; + } + return Object.getOwnPropertyNames; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + qoopido.register("polyfill/object/getownpropertydescriptor", definition); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/getownpropertydescriptor"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.getOwnPropertyDescriptor || !function() { + try { + Object.getOwnPropertyDescriptor({ + x: 0 + }, "x"); + return true; + } catch (exception) { + return false; + } + }()) { + var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; + Object.getOwnPropertyDescriptor = function(obj, property) { + if (obj !== Object(obj)) { + throw new TypeError(); + } + try { + return getOwnPropertyDescriptor.call(Object, obj, property); + } catch (exception) {} + if (Object.prototype.hasOwnProperty.call(obj, property)) { + return { + value: obj[property], + enumerable: true, + writable: true, + configurable: true + }; + } + }; + } + return Object.getOwnPropertyDescriptor; +}, window.qoopido = window.qoopido || {}); +(function(definition, navigator, global, document, undefined) { + "use strict"; + function register(id, definition, dependencies, callback) { + var namespace = id.split("/"), initialize; + if (modules[id]) { + return modules[id]; + } + initialize = function() { + if (dependencies) { + var path = namespace.slice(0, -1).join("/"), i = 0, dependency, internal; + for (;(dependency = dependencies[i]) !== undefined; i++) { + internal = isInternal.test(dependency); + if (internal) { + dependency = canonicalize(path + "/" + dependency); + } + if (!modules[dependency] && arguments[i]) { + modules[dependency] = arguments[i]; + } + if (internal && !modules[dependency] && typeof console !== "undefined") { + console.error("".concat("[Qoopido.js] ", id, ": Could not load dependency ", dependency)); + } + } + } + modules[id] = definition(modules, shared, namespace, navigator, global, document, undefined); + if (callback) { + callback(modules[id]); + } + return modules[id]; + }; + if (typeof module !== "undefined" && module.exports) { + module.exports = define(initialize); + } else if (typeof define === "function" && define.amd) { + dependencies ? define(dependencies, initialize) : define(initialize); + } else { + initialize(); + } + } + function registerSingleton(id, definition, dependencies) { + register(id, definition, dependencies, function(module) { + modules[id] = module.create(); + }); + } + var qoopido = global.qoopido || (global.qoopido = {}), shared = qoopido.shared || (qoopido.shared = {}), modules = qoopido.modules || (qoopido.modules = {}), dependencies = [], isInternal = new RegExp("^\\.+\\/"), regexCanonicalize = new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."), removeNeutral = new RegExp("(^\\/)|\\.\\/", "g"); + qoopido.register = register; + qoopido.registerSingleton = registerSingleton; + function canonicalize(path) { + var collapsed; + while ((collapsed = path.replace(regexCanonicalize, "")) !== path) { + path = collapsed; + } + return path.replace(removeNeutral, ""); + } + if (!Object.create) { + dependencies.push("./polyfill/object/create"); + } + if (!Object.getOwnPropertyNames) { + dependencies.push("./polyfill/object/getownpropertynames"); + } + if (!Object.getOwnPropertyDescriptor || !function() { + try { + Object.getOwnPropertyDescriptor({ + x: 0 + }, "x"); + return true; + } catch (exception) { + return false; + } + }()) { + dependencies.push("./polyfill/object/getownpropertydescriptor"); + } + register("base", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + function getOwnPropertyDescriptors(object) { + var descriptors = {}, properties = Object.getOwnPropertyNames(object), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + descriptors[property] = Object.getOwnPropertyDescriptor(object, property); + } + return descriptors; + } + function prohibitCall() { + throw new Error("[Qoopido.js] Operation prohibited"); + } + return { + create: function() { + var instance = Object.create(this, getOwnPropertyDescriptors(this)), result; + if (instance._constructor) { + result = instance._constructor.apply(instance, arguments); + } + instance.create = instance.extend = prohibitCall; + return result || instance; + }, + extend: function(properties, final) { + var instance; + properties = properties || {}; + final = final === true; + properties._parent = this; + instance = Object.create(this, getOwnPropertyDescriptors(properties)); + if (final === true) { + instance.extend = prohibitCall; + } + return instance; + } + }; +}, navigator, this, document); +(function(definition) { + window.qoopido.register("polyfill/string/ucfirst", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!String.prototype.ucfirst) { + String.prototype.ucfirst = function() { + var self = this; + return self.charAt(0).toUpperCase() + self.slice(1); + }; + } + return String.prototype.ucfirst; +}); +(function(definition) { + window.qoopido.register("polyfill/string/lcfirst", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!String.prototype.lcfirst) { + String.prototype.lcfirst = function() { + var self = this; + return self.charAt(0).toLowerCase() + self.slice(1); + }; + } + return String.prototype.lcfirst; +}); +(function(definition) { + window.qoopido.register("polyfill/window/getcomputedstyle", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!window.getComputedStyle) { + var getComputedStyleRegex = new RegExp("(\\-([a-z]){1})", "g"), getComputedStyleCallback = function() { + return arguments[2].toUpperCase(); + }; + return function(element, pseudo) { + var self = this; + self.getPropertyValue = function(property) { + if (property === "float") { + property = "styleFloat"; + } + if (getComputedStyleRegex.test(property)) { + property = property.replace(getComputedStyleRegex, getComputedStyleCallback); + } + return element.currentStyle[property] || null; + }; + return self; + }; + } else { + return window.getComputedStyle; + } +}); +(function(definition) { + window.qoopido.register("polyfill/window/promise", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var STATE_PENDING = void 0, STATE_SEALED = 0, STATE_FULFILLED = 1, STATE_REJECTED = 2, queue = []; + function addCallback(fn, arg) { + var length = queue.push([ fn, arg ]); + if (length === 1) { + scheduleFlushCallbacks(); + } + } + function scheduleFlushCallbacks() { + window.setTimeout(flushCallbacks, 1); + } + function flushCallbacks() { + var i = 0, tuple; + for (;(tuple = queue[i]) !== undefined; i++) { + tuple[0](tuple[1]); + } + queue.length = 0; + } + function handleThenable(promise, value) { + var then = null, resolved; + try { + if (promise === value) { + throw new TypeError("A promises callback cannot return that same promise."); + } + if (typeof value === "function" || typeof value === "object" && value !== null) { + then = value.then; + if (typeof then === "function") { + then.call(value, function(val) { + if (resolved) { + return true; + } + resolved = true; + if (value !== val) { + resolve(promise, val); + } else { + fulfill(promise, val); + } + }, function(val) { + if (resolved) { + return true; + } + resolved = true; + reject(promise, val); + }); + return true; + } + } + } catch (exception) { + if (resolved) { + return true; + } + reject(promise, exception); + return true; + } + return false; + } + function invokeResolver(resolver, promise) { + function resolvePromise(value) { + resolve(promise, value); + } + function rejectPromise(reason) { + reject(promise, reason); + } + try { + resolver(resolvePromise, rejectPromise); + } catch (exception) { + rejectPromise(exception); + } + } + function invokeCallback(settled, promise, callback, detail) { + var hasCallback = typeof callback === "function", value, error, succeeded, failed; + if (hasCallback) { + try { + value = callback(detail); + succeeded = true; + } catch (exception) { + failed = true; + error = exception; + } + } else { + value = detail; + succeeded = true; + } + if (handleThenable(promise, value)) { + return; + } else if (hasCallback && succeeded) { + resolve(promise, value); + } else if (failed) { + reject(promise, error); + } else if (settled === STATE_FULFILLED) { + resolve(promise, value); + } else if (settled === STATE_REJECTED) { + reject(promise, value); + } + } + function resolve(promise, value) { + if (promise === value) { + fulfill(promise, value); + } else if (!handleThenable(promise, value)) { + fulfill(promise, value); + } + } + function fulfill(promise, value) { + if (promise._state !== STATE_PENDING) { + return; + } + promise._state = STATE_SEALED; + promise._detail = value; + addCallback(publishFulfillment, promise); + } + function reject(promise, reason) { + if (promise._state !== STATE_PENDING) { + return; + } + promise._state = STATE_SEALED; + promise._detail = reason; + addCallback(publishRejection, promise); + } + function publishFulfillment(promise) { + publish(promise, promise._state = STATE_FULFILLED); + } + function publishRejection(promise) { + publish(promise, promise._state = STATE_REJECTED); + } + function subscribe(parent, child, onFulfillment, onRejection) { + var subscribers = parent._subscribers, length = subscribers.length; + subscribers[length] = child; + subscribers[length + STATE_FULFILLED] = onFulfillment; + subscribers[length + STATE_REJECTED] = onRejection; + } + function publish(promise, settled) { + var child, callback, subscribers = promise._subscribers, detail = promise._detail, i = 0; + for (;(child = subscribers[i]) !== undefined; i += 3) { + callback = subscribers[i + settled]; + invokeCallback(settled, child, callback, detail); + } + promise._subscribers = null; + } + function Promise(resolver) { + var self = this; + if (typeof resolver !== "function") { + throw new TypeError("You must pass a resolver function as the first argument to the promise constructor"); + } + self._subscribers = []; + invokeResolver(resolver, self); + } + Promise.prototype = { + _state: undefined, + _detail: undefined, + _subscribers: undefined, + then: function(onFulfilled, onRejected) { + var self = this, thenPromise = new Promise(function() {}); + if (self._state) { + addCallback(function invokePromiseCallback() { + invokeCallback(self._state, thenPromise, arguments[self._state - 1], self._detail); + }); + } else { + subscribe(self, thenPromise, onFulfilled, onRejected); + } + return thenPromise; + }, + "catch": function(onRejected) { + return this.then(null, onRejected); + } + }; + if (!window.Promise) { + window.Promise = Promise; + } + return window.Promise; +}); +(function(definition) { + var dependencies = []; + if (!window.Promise) { + dependencies.push("../polyfill/window/promise"); + } + window.qoopido.register("promise/all", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + return function all(promises) { + if (Object.prototype.toString.call(promises) !== "[object Array]") { + throw new TypeError("You must pass an array to all."); + } + return new window.Promise(function(resolve, reject) { + var results = [], remaining = promises.length, i = 0, promise; + if (remaining === 0) { + resolve([]); + } + function resolver(index) { + return function(value) { + resolveAll(index, value); + }; + } + function resolveAll(index, value) { + results[index] = value; + if (--remaining === 0) { + resolve(results); + } + } + for (;(promise = promises[i]) !== undefined; i++) { + if (promise && typeof promise.then === "function") { + promise.then(resolver(i), reject); + } else { + resolveAll(i, promise); + } + } + }); + }; +}); +(function(definition) { + var dependencies = []; + if (!window.Promise) { + dependencies.push("../polyfill/window/promise"); + } + window.qoopido.register("promise/defer", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + return function defer() { + var self = this; + self.promise = new window.Promise(function(resolve, reject) { + self.resolve = resolve; + self.reject = reject; + }); + }; +}); +(function(definition) { + var dependencies = [ "./base", "./promise/all", "./promise/defer" ]; + if (!String.prototype.ucfirst) { + dependencies.push("./polyfill/string/ucfirst"); + } + if (!String.prototype.lcfirst) { + dependencies.push("./polyfill/string/lcfirst"); + } + window.qoopido.registerSingleton("support", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var CombinedPromise = modules["promise/all"], DeferredPromise = modules["promise/defer"], matchPrefix = new RegExp("^(Moz|WebKit|Khtml|ms|O|Icab)(?=[A-Z])"), removeJsPrefix = new RegExp("^(?:webkit|khtml|icab|moz|ms|o)([A-Z])"), removeCssPrefix = new RegExp("^-(?:webkit|khtml|icab|moz|ms|o)-"), convertToCamelCase = new RegExp("-([a-z])", "gi"), convertToHyphens = new RegExp("([A-Z])", "g"), callbackUcfirst = function() { + return arguments[1].ucfirst(); + }, lookup = { + prefix: null, + method: {}, + property: {}, + css: {}, + promises: { + prefix: null, + method: {}, + property: {}, + css: {}, + test: {} + } + }; + function normalize(value) { + return value.replace(removeJsPrefix, "$1").lcfirst().replace(removeCssPrefix, "").replace(convertToCamelCase, callbackUcfirst); + } + return modules["base"].extend({ + test: {}, + pool: shared.pool && shared.pool.dom, + testMultiple: function() { + var test, tests = [], i = 0; + for (;(test = arguments[i]) !== undefined; i++) { + switch (typeof test) { + case "string": + tests.push(this.test[test]()); + break; + + case "boolean": + var deferred = new DeferredPromise(); + !!test ? deferred.resolve() : deferred.reject(); + tests.push(deferred.promise); + break; + + default: + tests.push(test); + break; + } + } + return new CombinedPromise(tests); + }, + getPrefix: function() { + var self = this, stored = lookup.prefix || null, property; + if (stored === null) { + var sample = self.pool ? self.pool.obtain("div") : document.createElement("div"), styles = sample.style; + stored = false; + for (property in styles) { + if (matchPrefix.test(property)) { + stored = property.match(matchPrefix)[0]; + } + } + if (stored === false && "WebkitOpacity" in styles) { + stored = "WebKit"; + } + if (stored === false && "KhtmlOpacity" in styles) { + stored = "Khtml"; + } + stored = lookup.prefix = stored === false ? false : [ stored.toLowerCase(), stored.toLowerCase().ucfirst(), stored ]; + sample.dispose && sample.dispose(); + } + return stored; + }, + getMethod: function(pMethod, pElement) { + pMethod = normalize(pMethod); + pElement = pElement || window; + var type = pElement.tagName, pointer = lookup.method[type] = lookup.method[type] || {}, stored = pointer[pMethod] = lookup.method[type][pMethod] || null; + if (stored === null) { + stored = false; + var candidates, candidate, i = 0, uMethod = pMethod.ucfirst(), prefixes = this.getPrefix(); + if (prefixes !== false) { + candidates = (pMethod + " " + uMethod + " " + prefixes.join(uMethod + " ") + uMethod).split(" "); + } else { + candidates = [ pMethod ]; + } + for (;(candidate = candidates[i]) !== undefined; i++) { + if (pElement[candidate] !== undefined && (typeof pElement[candidate] === "function" || typeof pElement[candidate] === "object")) { + stored = candidate; + break; + } + } + lookup.method[type][pMethod] = stored; + } + return stored; + }, + getProperty: function(pProperty, pElement) { + pProperty = normalize(pProperty); + pElement = pElement || window; + var type = pElement.tagName, pointer = lookup.property[type] = lookup.property[type] || {}, stored = pointer[pProperty] = lookup.property[type][pProperty] || null; + if (stored === null) { + stored = false; + var candidates, candidate, i = 0, uProperty = pProperty.ucfirst(), prefixes = this.getPrefix(); + if (prefixes !== false) { + candidates = (pProperty + " " + uProperty + " " + prefixes.join(uProperty + " ") + uProperty).split(" "); + } else { + candidates = [ pProperty ]; + } + for (i; (candidate = candidates[i]) !== undefined; i++) { + if (pElement[candidate] !== undefined) { + stored = candidate; + break; + } + } + lookup.property[type][pProperty] = stored; + } + return stored; + }, + getCssProperty: function(pProperty) { + pProperty = normalize(pProperty); + var self = this, stored = lookup.css[pProperty] || null; + if (stored === null) { + stored = false; + var candidate, i = 0, sample = self.pool ? self.pool.obtain("div") : document.createElement("div"), uProperty = pProperty.ucfirst(), prefixes = this.getPrefix() || [], candidates = (pProperty + " " + uProperty + " " + prefixes.join(uProperty + " ") + uProperty).split(" "), prefix = ""; + for (i; (candidate = candidates[i]) !== undefined; i++) { + if (sample.style[candidate] !== undefined) { + stored = candidate; + if (i > 0) { + prefix = "-"; + } + break; + } + } + stored = lookup.css[pProperty] = stored !== false ? [ prefix + stored.replace(convertToHyphens, "-$1").toLowerCase(), stored ] : false; + sample.dispose && sample.dispose(); + } + return stored; + }, + supportsPrefix: function() { + return !!this.getPrefix(); + }, + supportsMethod: function(pMethod, pElement) { + return !!this.getMethod(pMethod, pElement); + }, + supportsProperty: function(pProperty, pElement) { + return !!this.getProperty(pProperty, pElement); + }, + supportsCssProperty: function(pProperty) { + return !!this.getCssProperty(pProperty); + }, + testPrefix: function() { + var stored = lookup.promises.prefix; + if (stored === null) { + var deferred = new DeferredPromise(), prefix = this.getPrefix(); + !!prefix ? deferred.resolve(prefix) : deferred.reject(); + stored = lookup.promises.prefix = deferred.promise; + } + return stored; + }, + testMethod: function(pMethod, pElement) { + pElement = pElement || window; + var type = pElement.tagName, pointer = lookup.promises.method[type] = lookup.promises.method[type] || {}, stored = pointer[pMethod] = lookup.promises.method[type][pMethod] || null; + if (stored === null) { + var deferred = new DeferredPromise(), method = this.getMethod(pMethod, pElement); + !!method ? deferred.resolve(method) : deferred.reject(); + stored = lookup.promises.method[type][pMethod] = deferred.promise; + } + return stored; + }, + testProperty: function(pProperty, pElement) { + pElement = pElement || window; + var type = pElement.tagName, pointer = lookup.promises.property[type] = lookup.promises.property[type] || {}, stored = pointer[pProperty] = lookup.promises.property[type][pProperty] || null; + if (stored === null) { + var deferred = new DeferredPromise(), property = this.getProperty(pProperty, pElement); + !!property ? deferred.resolve(property) : deferred.reject(); + stored = lookup.promises.property[type][pProperty] = deferred.promise; + } + return stored; + }, + testCssProperty: function(pProperty) { + var stored = lookup.promises.css[pProperty] || null; + if (stored === null) { + var deferred = new DeferredPromise(), property = this.getCssProperty(pProperty); + !!property ? deferred.resolve(property) : deferred.reject(); + stored = lookup.promises.css[pProperty] = deferred.promise; + } + return stored; + }, + addTest: function(pId, pTest) { + return this.test[pId] = function() { + var stored = lookup.promises.test[pId] || null; + if (stored === null) { + var deferred = new DeferredPromise(), parameter = Array.prototype.slice.call(arguments); + parameter.splice(0, 0, deferred); + pTest.apply(null, parameter); + stored = lookup.promises.test[pId] = deferred.promise; + } + return stored; + }; + } + }); +}); +(function(definition) { + window.qoopido.register("function/merge", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + return function merge() { + var target = arguments[0], i, properties, property, tgt, src; + for (i = 1; (properties = arguments[i]) !== undefined; i++) { + for (property in properties) { + tgt = target[property]; + src = properties[property]; + if (src !== undefined) { + if (src !== null && typeof src === "object") { + if (src.length !== undefined) { + tgt = tgt && typeof tgt === "object" && tgt.length !== undefined ? tgt : []; + } else { + tgt = tgt && typeof tgt === "object" && tgt.length === undefined ? tgt : {}; + } + target[property] = merge(tgt, src); + } else { + target[property] = src; + } + } + } + } + return target; + }; +}); +(function(definition) { + window.qoopido.register("function/unique/uuid", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var lookup = {}, regex = new RegExp("[xy]", "g"); + function generateUuid() { + return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(regex, function(c) { + var r = Math.random() * 16 | 0, v = c === "x" ? r : r & 3 | 8; + return v.toString(16); + }); + } + return function() { + var result; + do { + result = generateUuid(); + } while (typeof lookup[result] !== "undefined"); + lookup[result] = true; + return result; + }; +}); +(function(definition) { + window.qoopido.registerSingleton("hook/event", definition, [ "../base" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + function transferProperties(event, originalEvent, properties) { + var i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + event[property] = originalEvent[property]; + } + event._properties = event._properties.concat(properties); + } + var hooks = { + general: { + properties: "type altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which path".split(" "), + process: function(event, originalEvent) { + var pointer; + event.originalEvent = originalEvent; + event.isDefaultPrevented = originalEvent.defaultPrevented ? true : false; + event.isPropagationStopped = originalEvent.cancelBubble ? true : false; + event.metaKey = originalEvent.metaKey && originalEvent.metaKey !== false ? true : false; + if (!event.target) { + event.target = originalEvent.srcElement || document; + } + if (event.target.nodeType === 3) { + event.target = event.target.parentNode; + } + if (!event.path) { + event.path = []; + pointer = event.target; + do { + event.path.push(pointer); + } while (pointer = pointer.parentNode); + event.path.push(window); + } + } + }, + mouse: { + regex: new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"), + properties: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement dataTransfer".split(" "), + process: function(event, originalEvent) { + var pointer, fromElement, which; + fromElement = originalEvent.fromElement; + which = originalEvent.button; + if (event.pageX === null && originalEvent.clientX !== null) { + pointer = event.target.ownerDocument || document; + pointer = pointer.documentElement || pointer.body; + event.pageX = originalEvent.clientX + (pointer.scrollLeft || 0) - (pointer.clientLeft || 0); + event.pageY = originalEvent.clientY + (pointer.scrollTop || 0) - (pointer.clientTop || 0); + } + if (!event.relatedTarget && fromElement) { + event.relatedTarget = fromElement === event.target ? originalEvent.toElement : fromElement; + } + if (!event.which && which !== undefined) { + event.which = which & 1 ? 1 : which & 2 ? 3 : which & 4 ? 2 : 0; + } + } + }, + key: { + regex: new RegExp("^(?:key)"), + properties: "char charCode key keyCode".split(" "), + process: function(event, originalEvent) { + if (event.which === null) { + event.which = originalEvent.charCode !== null ? originalEvent.charCode : originalEvent.keyCode; + } + } + } + }; + return modules["base"].extend({ + add: function(property, hook) { + if (property && hook && hooks[property]) { + hooks[property] = hook; + } + return this; + }, + get: function(property) { + if (property && hooks[property]) { + return hooks[property]; + } + return null; + }, + process: function(event, originalEvent) { + var id, hook, isMatch; + for (id in hooks) { + hook = hooks[id]; + isMatch = !hook.regex || hook.regex.test(originalEvent.type); + if (isMatch) { + if (hook.properties) { + transferProperties(event, originalEvent, hook.properties); + } + if (hook.process) { + hook.process(event, originalEvent); + } + if (hook.delegate) { + event.delegate = hook.delegate; + } + } + } + } + }); +}); +(function(definition) { + var dependencies = [ "../base", "../support" ]; + if (!window.getComputedStyle) { + dependencies.push("../polyfill/window/getcomputedstyle"); + } + window.qoopido.registerSingleton("hook/css", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var mSupport = modules["support"], getComputedStyle = window.getComputedStyle || modules["polyfill/window/getcomputedstyle"], hooks = { + general: { + get: function(element, property) { + return getComputedStyle(element, null).getPropertyValue(property[0]); + }, + set: function(element, property, value) { + element.style[property[1]] = value; + } + }, + opacity: !mSupport.supportsCssProperty("opacity") ? { + regex: new RegExp("alpha\\(opacity=(.*)\\)", "i"), + get: function(element, property, value) { + value = getComputedStyle(element, null).getPropertyValue("filter").toString().match(this.regex); + if (value) { + value = value[1] / 100; + } else { + value = 1; + } + return value; + }, + set: function(element, property, value) { + var style = element.style; + style.zoom = 1; + style.filter = "alpha(opacity=" + (value * 100 + .5 >> 0) + ")"; + } + } : null + }; + return modules["base"].extend({ + add: function(property, hook) { + if (property && hook && hooks[property]) { + hooks[property] = hook; + } + return this; + }, + get: function(property) { + if (property && hooks[property]) { + return hooks[property]; + } + return null; + }, + process: function(method, element, property, value) { + var hook; + property = mSupport.getCssProperty(property, element) || null; + if (property) { + return ((hook = this.get(property[1])) && hook[method] || this.get("general")[method])(element, property, value); + } + } + }); +}); +(function(definition) { + window.qoopido.register("dom/event", definition, [ "../base", "../hook/event" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var hooks = modules["hook/event"]; + return modules["base"].extend({ + originalEvent: null, + isDelegate: false, + isDefaultPrevented: false, + isPropagationStopped: false, + isImmediatePropagationStopped: false, + _properties: null, + _constructor: function(event) { + var self = this; + self._properties = []; + self._obtain(event); + return self; + }, + _obtain: function(event) { + hooks.process(this, event); + }, + _dispose: function() { + var self = this, i = 0, property; + for (;(property = self._properties[i]) !== undefined; i++) { + delete self[property]; + } + delete self.delegate; + self.originalEvent = null; + self.isDelegate = false; + self.isDefaultPrevented = false; + self.isPropagationStopped = false; + self.isImmediatePropagationStopped = false; + self._properties.length = 0; + }, + preventDefault: function() { + var self = this, event = self.originalEvent; + if (event.cancelable !== false) { + self.isDefaultPrevented = true; + if (event.preventDefault) { + event.preventDefault(); + } else { + event.returnValue = false; + } + } + }, + stopPropagation: function() { + var self = this, event = self.originalEvent; + self.isPropagationStopped = true; + if (event.stopPropagation) { + event.stopPropagation(); + } + event.cancelBubble = true; + }, + stopImmediatePropagation: function() { + var self = this, event = self.originalEvent; + self.isImmediatePropagationStopped = true; + if (event.stopImmediatePropagation) { + event.stopImmediatePropagation(); + } + self.stopPropagation(); + } + }); +}); +(function(definition) { + var dependencies = [ "../base", "../function/unique/uuid", "../hook/css", "./event" ]; + if (!window.CustomEvent) { + dependencies.push("../polyfill/window/customevent"); + } + if (!window.addEventListener) { + dependencies.push("../polyfill/window/addeventlistener"); + } + if (!window.removeEventListener) { + dependencies.push("../polyfill/window/removeeventlistener"); + } + if (!window.dispatchEvent) { + dependencies.push("../polyfill/window/dispatchevent"); + } + if (!Element.prototype.matches) { + dependencies.push("../polyfill/element/matches"); + } + if (!document.querySelector) { + dependencies.push("../polyfill/document/queryselector"); + } + if (!document.querySelectorAll) { + dependencies.push("../polyfill/document/queryselectorall"); + } + if (!String.prototype.trim) { + dependencies.push("../polyfill/string/trim"); + } + window.qoopido.register("dom/element", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var stringObject = "object", stringString = "string", generateUuid = modules["function/unique/uuid"], head = document.getElementsByTagName("head")[0], contentAttribute = "textContent" in document.createElement("a") ? "textContent" : "innerText", previousSibling = typeof head.previousElementSibling !== "undefined" ? function previousSibling() { + return this.previousElementSibling; + } : function previousSibling() { + var element = this; + while (element = element.previousSibling) { + if (element.nodeType === 1) { + return element; + } + } + }, nextSibling = typeof head.nextElementSibling !== "undefined" ? function nextSibling() { + return this.nextElementSibling; + } : function nextSibling() { + var element = this; + while (element = element.nextSibling) { + if (element.nodeType === 1) { + return element; + } + } + }, isTag = new RegExp("^<(\\w+)\\s*/>$"), matchEvent = new RegExp("^[^-]+"), splitList = new RegExp(" +", "g"), pool = modules["pool/module"] && modules["pool/module"].create(modules["dom/event"], null, true) || null, hooks = modules["hook/css"], storage = {}, events = { + custom: { + type: "CustomEvent", + method: "initCustomEvent" + }, + html: { + regex: new RegExp("^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$"), + type: "HTMLEvents", + method: "initEvent" + }, + mouse: { + regex: new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"), + type: "MouseEvents", + method: "initMouseEvent" + } + }; + function resolveEvent(type) { + var id, prototype, candidate; + for (id in events) { + prototype = events[id]; + if (!prototype.regex || prototype.regex.test(type)) { + candidate = prototype; + } + } + return candidate; + } + function emitEvent(type, detail, uuid) { + var self = this, prototype = resolveEvent(type), event = document.createEvent(prototype.type); + event[prototype.method](type, type === "load" ? false : true, true, detail); + if (uuid) { + event._quid = uuid; + event.isDelegate = true; + } + self.element.dispatchEvent(event); + } + function resolveElement(element) { + var tag; + if (typeof element === "string") { + try { + if (isTag.test(element) === true) { + tag = element.replace(isTag, "$1").toLowerCase(); + element = document.createElement(tag); + } else { + element = document.querySelector(element); + } + } catch (exception) { + element = null; + } + } + if (!element) { + throw new Error("[Qoopido.js] Element could not be resolved"); + } + return element; + } + function resolveArguments(parameters) { + return Array.prototype.concat.apply([], Array.prototype.splice.call(parameters, 0)).join(" ").split(splitList); + } + function matchesDelegate(event, delegate) { + var i = 0, pointer; + for (;(pointer = event.path[i]) !== undefined; i++) { + if (pointer.matches(delegate)) { + event.currentTarget = pointer; + return true; + } + if (pointer === event.currentTarget) { + break; + } + } + return false; + } + return modules["base"].extend({ + type: null, + element: null, + _listener: null, + _constructor: function(element, attributes, styles) { + var self = this, uuid; + element = resolveElement(element); + uuid = element._quid; + if (!uuid) { + uuid = element._quid = generateUuid(); + self.type = element.tagName; + self.element = element; + self._listener = {}; + storage[uuid] = self; + } else { + self = storage[uuid]; + } + if (typeof attributes === "object" && attributes !== null) { + self.setAttributes(attributes); + } + if (typeof styles === "object" && styles !== null) { + self.setStyles(styles); + } + if (self !== this) { + this.dispose && this.dispose(); + } + return self; + }, + _obtain: function(element, attributes, styles) { + this._constructor(element, attributes, styles); + }, + _dispose: function() { + var self = this, id, event; + for (id in self._listener) { + event = id.match(matchEvent); + self.element.removeEventListener(event, self._listener[id]); + delete self._listener[id]; + } + self.type = null; + self.element = null; + }, + getContent: function(html) { + var element = this.element; + return html && html !== false ? element.innerHTML : element[contentAttribute]; + }, + setContent: function(content, html) { + var self = this, element = self.element; + if (html && html !== false) { + element.innerHTML = content; + } else { + element[contentAttribute] = content; + } + return self; + }, + getAttribute: function(attribute) { + var self = this; + if (attribute && typeof attribute === stringString) { + return self.element.getAttribute(attribute); + } + }, + getAttributes: function() { + var self = this, result = {}, attributes = resolveArguments(arguments), i = 0, attribute; + for (;(attribute = attributes[i]) !== undefined; i++) { + result[attribute] = self.element.getAttribute(attribute); + } + return result; + }, + setAttribute: function(attribute, value) { + var self = this; + if (attribute && typeof attribute === stringString) { + self.element.setAttribute(attribute, value); + } + return self; + }, + setAttributes: function(attributes) { + var self = this, attribute; + if (attributes && typeof attributes === stringObject && !attributes.length) { + for (attribute in attributes) { + self.element.setAttribute(attribute, attributes[attribute]); + } + } + return self; + }, + removeAttribute: function(attribute) { + var self = this; + if (attribute && typeof attribute === stringString) { + self.element.removeAttribute(attribute); + } + return self; + }, + removeAttributes: function() { + var self = this, attributes = resolveArguments(arguments), i = 0, attribute; + for (;(attribute = attributes[i]) !== undefined; i++) { + self.element.removeAttribute(attribute); + } + return self; + }, + getStyle: function(property) { + var self = this; + if (property && typeof property === stringString) { + return hooks.process("get", self.element, property); + } + }, + getStyles: function() { + var self = this, result = {}, properties = resolveArguments(arguments), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + result[property] = hooks.process("get", self.element, property); + } + return result; + }, + setStyle: function(property, value) { + var self = this; + if (property && typeof property === stringString) { + hooks.process("set", self.element, property, value); + } + return self; + }, + setStyles: function(properties) { + var self = this, property; + if (properties && typeof properties === stringObject && !properties.length) { + for (property in properties) { + hooks.process("set", self.element, property, properties[property]); + } + } + return self; + }, + removeStyle: function(property) { + var self = this; + if (property && typeof property === stringString) { + self.setStyle(property, ""); + } + return self; + }, + removeStyles: function() { + var self = this, properties = resolveArguments(arguments), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + self.setStyle(property, ""); + } + return self; + }, + siblings: function(selector) { + var element = this.element, pointer = element.parentNode.firstChild, siblings = []; + for (;pointer; pointer = nextSibling.call(pointer)) { + if (pointer !== element && (!selector || pointer.matches(selector))) { + siblings.push(pointer); + } + } + return siblings; + }, + siblingsBefore: function(selector) { + var pointer = this.element.previousSibling, siblings = []; + for (;pointer; pointer = previousSibling.call(pointer)) { + if (!selector || pointer.matches(selector)) { + siblings.push(pointer); + } + } + return siblings; + }, + siblingsAfter: function(selector) { + var pointer = this.element.nextSibling, siblings = []; + for (;pointer; pointer = nextSibling.call(pointer)) { + if (!selector || pointer.matches(selector)) { + siblings.push(pointer); + } + } + return siblings; + }, + previous: function(selector) { + var pointer = previousSibling.call(this.element); + if (!selector) { + return pointer; + } else { + for (;pointer; pointer = previousSibling.call(pointer)) { + if (pointer.matches(selector)) { + return pointer; + } + } + } + }, + next: function(selector) { + var pointer = nextSibling.call(this.element); + if (!selector) { + return pointer; + } else { + for (;pointer; pointer = nextSibling.call(pointer)) { + if (pointer.matches(selector)) { + return pointer; + } + } + } + }, + find: function(selector) { + var self = this.element, uuid, matches; + selector = selector.trim(); + if (selector.charAt(0) === ">") { + uuid = self._quid; + self.setAttribute("data-quid", uuid); + selector = '[data-quid="' + uuid + '"] ' + selector; + matches = self.parentNode.querySelectorAll(selector); + self.removeAttribute("data-quid"); + } else { + matches = self.querySelectorAll(selector); + } + return matches; + }, + parent: function(selector) { + var pointer; + if (!selector) { + return this.element.parentNode; + } else { + pointer = this.element; + for (;pointer; pointer = pointer.parentNode) { + if (pointer.matches(selector)) { + return pointer; + } + } + } + }, + parents: function(selector) { + var pointer = this.element.parentNode, parents = []; + for (;pointer; pointer = pointer.parentNode) { + if (pointer.nodeType === 9) { + return parents; + } else if (pointer.nodeType === 1) { + if (!selector || pointer.matches(selector)) { + parents.push(pointer); + } + } + } + }, + isVisible: function() { + var self = this, element = self.element; + return !(element.offsetWidth <= 0 && element.offsetHeight <= 0 || self.getStyle("visibility") === "hidden" || self.getStyle("opacity") <= 0); + }, + hasClass: function(name) { + return name ? new RegExp("(?:^|\\s)" + name + "(?:\\s|$)").test(this.element.className) : false; + }, + addClass: function(name) { + var self = this; + if (name && !self.hasClass(name)) { + self.element.className += self.element.className ? " " + name : name; + } + return self; + }, + removeClass: function(name) { + var self = this; + if (name && self.hasClass(name)) { + self.element.className = self.element.className.replace(new RegExp("(?:^|\\s)" + name + "(?!\\S)"), ""); + } + return self; + }, + toggleClass: function(name) { + var self = this; + if (name) { + self.hasClass(name) ? self.removeClass(name) : self.addClass(name); + } + return self; + }, + prepend: function(element) { + var self = this, target = self.element; + if (element) { + try { + element = element.element || resolveElement(element); + target.firstChild ? target.insertBefore(element, target.firstChild) : self.append(element); + } catch (exception) { + target.insertAdjacentHTML("afterBegin", element); + } + } + return self; + }, + append: function(element) { + var self = this, target = self.element; + if (element) { + try { + target.appendChild(element.element || resolveElement(element)); + } catch (exception) { + target.insertAdjacentHTML("beforeEnd", element); + } + } + return self; + }, + prependTo: function(target) { + var self = this, element = self.element; + if (target) { + (target = target.element || resolveElement(target)).firstChild ? target.insertBefore(element, target.firstChild) : self.appendTo(target); + } + return self; + }, + appendTo: function(target) { + var self = this; + if (target) { + (target.element || resolveElement(target)).appendChild(self.element); + } + return self; + }, + insertBefore: function(target) { + var self = this, element = self.element; + if (target) { + (target = target.element || resolveElement(target)).parentNode.insertBefore(element, target); + } + return self; + }, + insertAfter: function(target) { + var self = this, element = self.element; + if (target) { + (target = target.element || resolveElement(target)).nextSibling ? target.parentNode.insertBefore(element, target.nextSibling) : self.appendTo(target.parentNode); + } + return self; + }, + replace: function(target) { + var self = this, element = self.element; + if (target) { + (target = target.element || resolveElement(target)).parentNode.replaceChild(element, target); + } + return self; + }, + replaceWith: function(element) { + var self = this, target = self.element; + if (element) { + element = element.element || resolveElement(element); + target.parentNode.replaceChild(element, target); + } + return self; + }, + remove: function() { + var self = this, element = self.element; + element.parentNode.removeChild(element); + return self; + }, + on: function(events) { + var self = this, element = self.element, delegate = arguments.length > 2 ? arguments[1] : null, fn = arguments.length > 2 ? arguments[2] : arguments[1], uuid = fn._quid || (fn._quid = generateUuid()), i = 0, event; + events = events.split(" "); + for (;(event = events[i]) !== undefined; i++) { + var id = event + "-" + uuid, listener = function(event) { + var delegateTo; + event = pool && pool.obtain(event) || modules["dom/event"].create(event); + if (!event.isPropagationStopped) { + delegateTo = event.delegate; + event._quid = generateUuid(); + if (!delegate || matchesDelegate(event, delegate)) { + fn.call(event.currentTarget, event, event.originalEvent.detail); + } + if (delegateTo) { + delete event.delegate; + emitEvent.call(self, delegateTo); + } + } + event.dispose && event.dispose(); + }; + listener.type = event; + self._listener[id] = listener; + element.addEventListener(event, listener); + } + return self; + }, + one: function(events) { + var self = this, delegate = arguments.length > 3 || typeof arguments[1] === "string" ? arguments[1] : null, fn = arguments.length > 3 || typeof arguments[2] === "function" ? arguments[2] : arguments[1], each = (arguments.length > 3 ? arguments[3] : arguments[2]) !== false, listener = function(event) { + self.off(each === true ? event.type : events, listener); + fn.call(this, event, event.originalEvent.detail); + }; + fn._quid = listener._quid = generateUuid(); + if (delegate) { + self.on(events, delegate, listener); + } else { + self.on(events, listener); + } + return self; + }, + off: function(events, fn) { + var self = this, element = self.element, i = 0, event, id, listener; + events = events.split(" "); + for (;(event = events[i]) !== undefined; i++) { + id = fn._quid && event + "-" + fn._quid || null; + listener = id && self._listener[id] || null; + if (listener) { + element.removeEventListener(event, listener); + delete self._listener[id]; + } else { + element.removeEventListener(event, fn); + } + } + return self; + }, + emit: function(event, data) { + var self = this; + emitEvent.call(self, event, data); + return self; + } + }); +}); +(function(definition) { + window.qoopido.register("dom/element/emerge", definition, [ "../element", "../../function/merge", "../../function/unique/uuid" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var defaults = { + interval: 50, + threshold: "auto", + recur: true, + auto: 1, + visibility: true + }, documentElement = window.document.documentElement, viewport = {}, intervals = {}, elements = {}, prototype, EVENT_EMERGED = "emerged", EVENT_DEMERGED = "demerged", DOM_RESIZE = "resize orientationchange"; + window = modules["dom/element"].create(window); + if (document.compatMode !== "CSS1Compat") { + throw "[Qoopido.js] Not in standards mode"; + } + function tick(interval) { + var index, pointer = elements[interval]; + for (index in pointer) { + if (index !== "length") { + checkState.call(pointer[index]); + } + } + if (pointer.length === 0) { + window.element.clearInterval(intervals[interval]); + delete intervals[interval]; + } + } + function globalOnResize() { + viewport.left = 0; + viewport.top = 0; + viewport.right = window.innerWidth || documentElement.clientWidth; + viewport.bottom = window.innerHeight || documentElement.clientHeight; + } + function instanceOnResize() { + var self = this, treshold = self._settings.threshold, x = treshold !== undefined ? treshold : documentElement.clientWidth * self._settings.auto, y = treshold !== undefined ? treshold : documentElement.clientHeight * self._settings.auto; + self._viewport.left = viewport.left - x; + self._viewport.top = viewport.top - y; + self._viewport.right = viewport.right + x; + self._viewport.bottom = viewport.bottom + y; + } + function checkState() { + var self = this, state = false, priority = 2, boundaries; + if (self.isVisible() && (self.getStyle("visibility") !== "hidden" || self._settings.visibility === false)) { + boundaries = self.element.getBoundingClientRect(); + if ((boundaries.bottom >= self._viewport.top && boundaries.bottom <= self._viewport.bottom || boundaries.top >= self._viewport.top && boundaries.top <= self._viewport.bottom || self._viewport.bottom >= boundaries.top && self._viewport.bottom <= boundaries.bottom || self._viewport.top >= boundaries.top && self._viewport.top <= boundaries.bottom) && (boundaries.left >= self._viewport.left && boundaries.left <= self._viewport.right || boundaries.right >= self._viewport.left && boundaries.right <= self._viewport.right || self._viewport.left >= boundaries.left && self._viewport.left <= boundaries.right || self._viewport.right >= boundaries.left && self._viewport.right <= boundaries.right)) { + if (self._settings.threshold === 0 || (boundaries.bottom >= viewport.top && boundaries.bottom <= viewport.bottom || boundaries.top >= viewport.top && boundaries.top <= viewport.bottom || viewport.bottom >= boundaries.top && viewport.bottom <= boundaries.bottom || viewport.top >= boundaries.top && viewport.top <= boundaries.bottom) && (boundaries.left >= viewport.left && boundaries.left <= viewport.right || boundaries.right >= viewport.left && boundaries.right <= viewport.right || viewport.left >= boundaries.left && viewport.left <= boundaries.right || viewport.right >= boundaries.left && viewport.right <= boundaries.right)) { + priority = 1; + } + state = true; + } + } + if (state !== self._state || state === true && priority !== self._priority) { + setState.call(self, state, priority); + } + } + function setState(state, priority) { + var self = this; + self._state = state; + self._priority = priority; + if (self._settings.recur !== true) { + self.remove(); + } + if (state === true) { + self.emit(EVENT_EMERGED, priority); + } else { + self.emit(EVENT_DEMERGED); + } + } + prototype = modules["dom/element"].extend({ + _quid: null, + _viewport: null, + _settings: null, + _state: null, + _priority: null, + _constructor: function(element, settings) { + var self = prototype._parent._constructor.call(this, element); + settings = modules["function/merge"]({}, defaults, settings || {}); + if (settings.threshold === "auto") { + delete settings.threshold; + } + if (intervals[settings.interval] === undefined) { + elements[settings.interval] = elements[settings.interval] || { + length: 0 + }; + intervals[settings.interval] = window.element.setInterval(function() { + tick(settings.interval); + }, settings.interval); + } + self._quid = modules["function/unique/uuid"](); + self._viewport = {}; + self._settings = settings; + self._state = false; + self._priority = 2; + elements[settings.interval][self._quid] = self; + elements[settings.interval].length++; + window.on(DOM_RESIZE, function() { + instanceOnResize.call(self); + }); + instanceOnResize.call(self); + return self; + }, + remove: function() { + var self = this; + delete elements[self._settings.interval][self._quid]; + elements[self._settings.interval].length--; + } + }); + window.on(DOM_RESIZE, globalOnResize); + globalOnResize(); + return prototype; +}); +(function(definition) { + window.qoopido.register("dom/element/lazyimage", definition, [ "./emerge", "../../function/merge" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var defaults = { + interval: 50, + threshold: "auto", + attribute: "data-lazyimage" + }, queue = 0, prototype, EVENT_REQUESTED = "requested", EVENT_LOADED = "loaded", EVENT_FAILED = "failed", EVENT_EMERGED = "emerged", DOM_LOAD = "load", DOM_ERROR = "error", DOM_STATE = "".concat(DOM_LOAD, " ", DOM_ERROR); + function load() { + var self = this, attribute = self._settings.attribute; + queue += 1; + self.emit(EVENT_REQUESTED).one(DOM_STATE, function(event) { + if (event.type === DOM_LOAD) { + self.emit(EVENT_LOADED); + } else { + self.emit(EVENT_FAILED); + } + queue -= 1; + }, false).setAttribute("src", self.getAttribute(attribute)).removeAttribute(attribute); + } + prototype = modules["dom/element/emerge"].extend({ + _constructor: function(element, settings) { + var self = prototype._parent._constructor.call(this, element, modules["function/merge"]({}, defaults, settings || {})); + self.on(EVENT_EMERGED, function onEmerge(event) { + if (queue === 0 || event.data === 1) { + self.remove(); + self.off(EVENT_EMERGED, onEmerge); + load.call(self); + } + }); + return self; + } + }); + return prototype; +}); \ No newline at end of file diff --git a/dist/3.7.3/max/packages/qoopido.remux.js b/dist/3.7.3/max/packages/qoopido.remux.js new file mode 100644 index 00000000..72285a62 --- /dev/null +++ b/dist/3.7.3/max/packages/qoopido.remux.js @@ -0,0 +1,519 @@ +/*! +* Qoopido.js library +* +* version: 3.7.3 +* date: 2015-08-05 +* author: Dirk Lueth +* website: https://github.com/dlueth/qoopido.js +* +* Copyright (c) 2015 Dirk Lueth +*/ +(function(definition, navigator, global, document, undefined) { + "use strict"; + function register(id, definition, dependencies, callback) { + var namespace = id.split("/"), initialize; + if (modules[id]) { + return modules[id]; + } + initialize = function() { + if (dependencies) { + var path = namespace.slice(0, -1).join("/"), i = 0, dependency, internal; + for (;(dependency = dependencies[i]) !== undefined; i++) { + internal = isInternal.test(dependency); + if (internal) { + dependency = canonicalize(path + "/" + dependency); + } + if (!modules[dependency] && arguments[i]) { + modules[dependency] = arguments[i]; + } + if (internal && !modules[dependency] && typeof console !== "undefined") { + console.error("".concat("[Qoopido.js] ", id, ": Could not load dependency ", dependency)); + } + } + } + modules[id] = definition(modules, shared, namespace, navigator, global, document, undefined); + if (callback) { + callback(modules[id]); + } + return modules[id]; + }; + if (typeof module !== "undefined" && module.exports) { + module.exports = define(initialize); + } else if (typeof define === "function" && define.amd) { + dependencies ? define(dependencies, initialize) : define(initialize); + } else { + initialize(); + } + } + function registerSingleton(id, definition, dependencies) { + register(id, definition, dependencies, function(module) { + modules[id] = module.create(); + }); + } + var qoopido = global.qoopido || (global.qoopido = {}), shared = qoopido.shared || (qoopido.shared = {}), modules = qoopido.modules || (qoopido.modules = {}), dependencies = [], isInternal = new RegExp("^\\.+\\/"), regexCanonicalize = new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."), removeNeutral = new RegExp("(^\\/)|\\.\\/", "g"); + qoopido.register = register; + qoopido.registerSingleton = registerSingleton; + function canonicalize(path) { + var collapsed; + while ((collapsed = path.replace(regexCanonicalize, "")) !== path) { + path = collapsed; + } + return path.replace(removeNeutral, ""); + } + if (!Object.create) { + dependencies.push("./polyfill/object/create"); + } + if (!Object.getOwnPropertyNames) { + dependencies.push("./polyfill/object/getownpropertynames"); + } + if (!Object.getOwnPropertyDescriptor || !function() { + try { + Object.getOwnPropertyDescriptor({ + x: 0 + }, "x"); + return true; + } catch (exception) { + return false; + } + }()) { + dependencies.push("./polyfill/object/getownpropertydescriptor"); + } + register("base", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + function getOwnPropertyDescriptors(object) { + var descriptors = {}, properties = Object.getOwnPropertyNames(object), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + descriptors[property] = Object.getOwnPropertyDescriptor(object, property); + } + return descriptors; + } + function prohibitCall() { + throw new Error("[Qoopido.js] Operation prohibited"); + } + return { + create: function() { + var instance = Object.create(this, getOwnPropertyDescriptors(this)), result; + if (instance._constructor) { + result = instance._constructor.apply(instance, arguments); + } + instance.create = instance.extend = prohibitCall; + return result || instance; + }, + extend: function(properties, final) { + var instance; + properties = properties || {}; + final = final === true; + properties._parent = this; + instance = Object.create(this, getOwnPropertyDescriptors(properties)); + if (final === true) { + instance.extend = prohibitCall; + } + return instance; + } + }; +}, navigator, this, document); +(function(definition) { + var dependencies = []; + if (!window.getComputedStyle) { + dependencies.push("polyfill/window/getcomputedstyle"); + } + if (!Array.prototype.indexOf) { + dependencies.push("../array/indexof"); + } + window.qoopido.register("polyfill/window/matchmedia", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var identifier = "qoopidoPolyfillWindowMatchmedia", viewport = document.documentElement, queries = [], lookup = {}, features = {}, regex = { + type: /\s*(only|not)?\s*(screen|print|[a-z\-]+)\s*(and)?\s*/i, + media: /^\s*\(\s*(-[a-z]+-)?(min-|max-)?([a-z\-]+)\s*(:?\s*([0-9]+(\.[0-9]+)?|portrait|landscape)(px|em|dppx|dpcm|rem|%|in|cm|mm|ex|pt|pc|\/([0-9]+(\.[0-9]+)?))?)?\s*\)\s*$/ + }, timeout; + function detectFeatures() { + var ww = window.innerWidth || viewport.clientWidth, wh = window.innerHeight || viewport.clientHeight, dw = window.screen.width, dh = window.screen.height, cd = window.screen.colorDepth, pr = window.devicePixelRatio; + features["width"] = ww; + features["height"] = wh; + features["aspect-ratio"] = (ww / wh).toFixed(2); + features["color"] = cd; + features["color-index"] = Math.pow(2, cd); + features["device-aspect-ratio"] = (dw / dh).toFixed(2); + features["device-height"] = dh; + features["device-width"] = dw; + features["device-pixel-ratio"] = pr || 1; + features["resolution"] = pr && pr * 96 || window.screen.deviceXDPI || 96; + features["orientation"] = wh >= ww ? "portrait" : "landscape"; + } + function createQuery(query) { + var mql = { + matches: false, + media: query, + addListener: function addListener(listener) { + listener && listeners.push(listener); + }, + removeListener: function removeListener(listener) { + var i = 0, pointer; + for (;(pointer = listeners[i]) !== undefined; i++) { + if (pointer === listener) { + listeners.splice(i, 1); + } + } + } + }, index, listeners; + if (query === "") { + mql.matches = true; + } else { + mql.matches = checkQueryMatch(query); + } + queries.push({ + mql: mql, + listeners: [] + }); + index = queries.length - 1; + lookup[query] = index; + listeners = queries[index].listeners; + return mql; + } + function checkQueryMatch(query) { + var mql = query.indexOf(",") !== -1 && query.split(",") || [ query ], mqIndex = mql.length - 1, mqLength = mqIndex, mq = null, negateType = null, negateTypeFound = "", negateTypeIndex = 0, negate = false, type = "", exprListStr = "", exprList = null, exprIndex = 0, exprLength = 0, expr = null, prefix = "", length = "", unit = "", value = "", feature = "", match = false; + if (query === "") { + return true; + } + do { + mq = mql[mqLength - mqIndex]; + negate = false; + negateType = mq.match(regex.type); + if (negateType) { + negateTypeFound = negateType[0]; + negateTypeIndex = negateType.index; + } + if (!negateType || mq.substring(0, negateTypeIndex).indexOf("(") === -1 && (negateTypeIndex || !negateType[3] && negateTypeFound !== negateType.input)) { + match = false; + continue; + } + exprListStr = mq; + negate = negateType[1] === "not"; + if (!negateTypeIndex) { + type = negateType[2]; + exprListStr = mq.substring(negateTypeFound.length); + } + match = type === features.type || type === "all" || type === ""; + exprList = exprListStr.indexOf(" and ") !== -1 && exprListStr.split(" and ") || [ exprListStr ]; + exprIndex = exprList.length - 1; + exprLength = exprIndex; + if (match && exprIndex >= 0 && exprListStr !== "") { + do { + expr = exprList[exprIndex].match(regex.media); + if (!expr || !features[expr[3]]) { + match = false; + break; + } + prefix = expr[2]; + length = expr[5]; + value = length; + unit = expr[7]; + feature = features[expr[3]]; + if (unit) { + if (unit === "px") { + value = Number(length); + } else if (unit === "em" || unit === "rem") { + value = 16 * length; + } else if (expr[8]) { + value = (length / expr[8]).toFixed(2); + } else if (unit === "dppx") { + value = length * 96; + } else if (unit === "dpcm") { + value = length * .3937; + } else { + value = Number(length); + } + } + if (prefix === "min-" && value) { + match = feature >= value; + } else if (prefix === "max-" && value) { + match = feature <= value; + } else if (value) { + match = feature === value; + } else { + match = !!feature; + } + if (!match) { + break; + } + } while (exprIndex--); + } + if (match) { + break; + } + } while (mqIndex--); + return negate ? !match : match; + } + function delayedOnResize() { + var match = false, i = 0, j = 0, query, listener; + if (queries.length > 0) { + detectFeatures(); + for (;(query = queries[i]) !== undefined; i++) { + match = checkQueryMatch(query.mql.media); + if (match && !query.mql.matches || !match && query.mql.matches) { + query.mql.matches = match; + if (query.listeners) { + for (;(listener = query.listeners[j]) !== undefined; j++) { + listener.call(window, query.mql); + } + } + } + } + } + } + function delayOnResize() { + window.clearTimeout(timeout); + timeout = window.setTimeout(delayedOnResize, 10); + } + function initialize() { + var target = window.document.getElementsByTagName("script")[0], style = document.createElement("style"), types = [ "screen", "print", "speech", "projection", "handheld", "tv", "braille", "embossed", "tty" ], cssText = "#" + identifier + " { position: relative; z-index: 0; }", prefix = "", addListener = window.addEventListener || (prefix = "on") && window.attachEvent, i = 0, pointer; + style.type = "text/css"; + style.id = identifier; + target.parentNode.insertBefore(style, target); + for (;(pointer = types[i]) !== undefined; i++) { + cssText += "@media " + pointer + " { #" + identifier + " { position: relative; z-index: " + i + " } }"; + } + if (style.styleSheet) { + style.styleSheet.cssText = cssText; + } else { + style.textContent = cssText; + } + features.type = types[(window.getComputedStyle || modules["polyfill/window/getcomputedstyle"])(style).zIndex * 1 || 0]; + style.parentNode.removeChild(style); + addListener(prefix + "resize", delayOnResize); + addListener(prefix + "orientationchange", delayOnResize); + } + if (!window.matchMedia) { + initialize(); + detectFeatures(); + window.matchMedia = function(query) { + var index = lookup[query] || false; + if (index === false) { + return createQuery(query); + } else { + return queries[index].mql; + } + }; + } + return window.matchMedia; +}); +(function(definition) { + window.qoopido.register("emitter", definition, [ "./base" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var excludeMethods = /^(_|extend$|create$|on$|one$|off$|emit$|get.+)/; + function map(context, method) { + var event = method.charAt(0).toUpperCase() + method.slice(1); + context._mapped[method] = context[method]; + return function() { + var args = Array.prototype.slice.call(arguments), returnValue; + context.emit.apply(context, [ "pre" + event, args ]); + returnValue = context._mapped[method].apply(context, args); + context.emit.apply(context, [ "post" + event, args, returnValue ]); + return returnValue; + }; + } + return modules["base"].extend({ + _mapped: null, + _listener: null, + _temp: null, + _constructor: function() { + var self = this, method; + self._mapped = {}; + self._listener = {}; + for (method in self) { + if (typeof self[method] === "function" && excludeMethods.test(method) === false) { + self[method] = map(self, method); + } + } + return self; + }, + on: function(events, fn) { + var self = this, i = 0, event; + events = events.split(" "); + for (;(event = events[i]) !== undefined; i++) { + (self._listener[event] = self._listener[event] || []).push(fn); + } + return self; + }, + one: function(events, fn, each) { + each = each !== false; + var self = this; + self.on(events, function listener(event) { + self.off(each === true ? event : events, listener); + fn.apply(this, arguments); + }); + return self; + }, + off: function(events, fn) { + var self = this, i = 0, event, j, listener; + if (events) { + events = events.split(" "); + for (;(event = events[i]) !== undefined; i++) { + self._listener[event] = self._listener[event] || []; + if (fn) { + for (j = 0; (listener = self._listener[event][j]) !== undefined; j++) { + if (listener === fn) { + self._listener[event].splice(j, 1); + j--; + } + } + } else { + self._listener[event].length = 0; + } + } + } else { + for (event in self._listener) { + self._listener[event].length = 0; + } + } + return self; + }, + emit: function(event) { + var self = this, i = 0, listener; + if (event !== undefined) { + self._listener[event] = self._listener[event] || []; + self._temp = self._listener[event].slice(); + for (;(listener = self._temp[i]) !== undefined; i++) { + listener.apply(self, arguments); + } + self._temp.length = 0; + } + return self; + } + }); +}); +(function(definition) { + var dependencies = [ "../emitter" ]; + if (!window.matchMedia) { + dependencies.push("../polyfill/window/matchmedia"); + } + window.qoopido.register("component/sense", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var prototype, queries = {}; + function onQueryStateChange() { + var self = this, mql = self.mql; + if (mql.matches === true) { + self.emit("matched"); + } else { + self.emit("dematched"); + } + } + prototype = modules["emitter"].extend({ + mql: null, + _constructor: function(query) { + var self = prototype._parent._constructor.call(this), mql = self.mql = queries[query] || (queries[query] = window.matchMedia(query)), listener = function() { + onQueryStateChange.call(self); + }; + mql.addListener(listener); + window.setTimeout(listener, 0); + return self; + }, + matches: function() { + return this.mql.matches; + } + }); + return prototype; +}); +(function(definition) { + window.qoopido.registerSingleton("component/remux", definition, [ "../emitter", "./sense" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var prototype, html = document.getElementsByTagName("html")[0], base = 16, state = { + fontsize: null, + layout: null, + ratio: {} + }, current = { + fontsize: null, + layout: null + }; + function updateState(layout, fontsize) { + var self = this; + if (layout && fontsize) { + html.className = layout; + html.style.fontSize = fontsize + "px"; + state.layout = layout; + state.fontsize = fontsize; + if (current.fontsize !== state.fontsize || current.layout !== state.layout) { + state.ratio.device = window.devicePixelRatio || 1; + state.ratio.fontsize = state.fontsize / base; + state.ratio.total = state.ratio.device * state.ratio.fontsize; + if (current.layout !== state.layout) { + self.emit("layoutchanged", state); + } + if (current.fontsize !== state.fontsize) { + self.emit("fontsizechanged", state); + } + self.emit("statechanged", state); + current.fontsize = state.fontsize; + current.layout = state.layout; + } + } + return self; + } + function addQuery(query, layout, fontsize) { + var self = this; + window.setTimeout(function() { + modules["component/sense"].create(query).on("matched", function() { + updateState.call(self, layout, fontsize); + }); + }, 0); + } + prototype = modules["emitter"].extend({ + _constructor: function() { + var self = prototype._parent._constructor.call(this), pBase = parseInt(html.getAttribute("data-base"), 10); + if (isNaN(pBase) === false) { + base = pBase; + } + return self; + }, + getState: function() { + return state; + }, + getLayout: function() { + return state.layout; + }, + getFontsize: function() { + return state.fontsize; + }, + setLayout: function(layout, fontsize) { + var self = this; + updateState.call(self, layout, fontsize); + return self; + }, + addLayout: function(pId, pLayout) { + var self = this, parameter, id, layout, size, min, max, lMin, lMax; + if (arguments.length > 1) { + parameter = {}; + parameter[pId] = pLayout; + } else { + parameter = arguments[0]; + } + for (id in parameter) { + layout = parameter[id]; + for (size = layout.min; size <= layout.max; size++) { + lMin = Math.round(layout.width * (size / base)); + lMax = Math.round(layout.width * ((size + 1) / base)) - 1; + addQuery.call(self, "screen and (min-width: " + lMin + "px) and (max-width: " + lMax + "px )", id, size); + min = !min || lMin < min.width ? { + width: lMin, + fontsize: size, + layout: id + } : min; + max = !max || lMax >= max.width ? { + width: lMax, + fontsize: size, + layout: id + } : max; + } + } + addQuery.call(self, "screen and (max-width: " + (min.width - 1) + "px)", min.layout, min.fontsize); + addQuery.call(self, "screen and (min-width: " + (max.width + 1) + "px)", max.layout, max.fontsize); + return self; + } + }); + return prototype; +}); \ No newline at end of file diff --git a/dist/3.7.3/max/packages/qoopido.remux.legacy.js b/dist/3.7.3/max/packages/qoopido.remux.legacy.js new file mode 100644 index 00000000..7f67de41 --- /dev/null +++ b/dist/3.7.3/max/packages/qoopido.remux.legacy.js @@ -0,0 +1,715 @@ +/*! +* Qoopido.js library +* +* version: 3.7.3 +* date: 2015-08-05 +* author: Dirk Lueth +* website: https://github.com/dlueth/qoopido.js +* +* Copyright (c) 2015 Dirk Lueth +*/ +(function(definition, qoopido) { + if (qoopido.register) { + qoopido.register("polyfill/object/defineproperty", definition); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/defineproperty"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.defineProperty || !function() { + try { + Object.defineProperty({}, "x", {}); + return true; + } catch (exception) { + return false; + } + }()) { + var defineProperty = Object.defineProperty, defineGetter = Object.prototype.__defineGetter__, defineSetter = Object.prototype.__defineSetter__; + Object.defineProperty = function(obj, prop, desc) { + if (defineProperty) { + try { + return defineProperty(obj, prop, desc); + } catch (exception) {} + } + if (obj !== Object(obj)) { + throw new TypeError("Object.defineProperty called on non-object"); + } + if (defineGetter && "get" in desc) { + defineGetter.call(obj, prop, desc.get); + } + if (defineSetter && "set" in desc) { + defineSetter.call(obj, prop, desc.set); + } + if ("value" in desc) { + obj[prop] = desc.value; + } + return obj; + }; + } + return Object.defineProperty; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + var dependencies = []; + if (!Object.defineProperty || !function() { + try { + Object.defineProperty({}, "x", {}); + return true; + } catch (exception) { + return false; + } + }()) { + dependencies.push("./defineproperty"); + } + qoopido.register("polyfill/object/defineproperties", definition, dependencies); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/defineproperties"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.defineProperties) { + Object.defineProperties = function(obj, properties) { + if (obj !== Object(obj)) { + throw new TypeError("Object.defineProperties called on non-object"); + } + var name; + for (name in properties) { + if (Object.prototype.hasOwnProperty.call(properties, name)) { + Object.defineProperty(obj, name, properties[name]); + } + } + return obj; + }; + } + return Object.defineProperties; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + var dependencies = []; + if (!Object.defineProperties) { + dependencies.push("./defineproperties"); + } + qoopido.register("polyfill/object/create", definition, dependencies); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/create"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.create) { + Object.create = function(prototype, properties) { + if (typeof prototype !== "object") { + throw new TypeError(); + } + function Constructor() {} + Constructor.prototype = prototype; + var obj = new Constructor(); + if (prototype) { + obj.constructor = Constructor; + } + if (arguments.length > 1) { + if (properties !== Object(properties)) { + throw new TypeError(); + } + Object.defineProperties(obj, properties); + } + return obj; + }; + } + return Object.create; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + qoopido.register("polyfill/object/getownpropertynames", definition); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/getownpropertynames"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.getOwnPropertyNames) { + Object.getOwnPropertyNames = function(obj) { + if (obj !== Object(obj)) { + throw new TypeError("Object.getOwnPropertyNames called on non-object"); + } + var props = [], p; + for (p in obj) { + if (Object.prototype.hasOwnProperty.call(obj, p)) { + props.push(p); + } + } + return props; + }; + } + return Object.getOwnPropertyNames; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + qoopido.register("polyfill/object/getownpropertydescriptor", definition); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/getownpropertydescriptor"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.getOwnPropertyDescriptor || !function() { + try { + Object.getOwnPropertyDescriptor({ + x: 0 + }, "x"); + return true; + } catch (exception) { + return false; + } + }()) { + var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; + Object.getOwnPropertyDescriptor = function(obj, property) { + if (obj !== Object(obj)) { + throw new TypeError(); + } + try { + return getOwnPropertyDescriptor.call(Object, obj, property); + } catch (exception) {} + if (Object.prototype.hasOwnProperty.call(obj, property)) { + return { + value: obj[property], + enumerable: true, + writable: true, + configurable: true + }; + } + }; + } + return Object.getOwnPropertyDescriptor; +}, window.qoopido = window.qoopido || {}); +(function(definition, navigator, global, document, undefined) { + "use strict"; + function register(id, definition, dependencies, callback) { + var namespace = id.split("/"), initialize; + if (modules[id]) { + return modules[id]; + } + initialize = function() { + if (dependencies) { + var path = namespace.slice(0, -1).join("/"), i = 0, dependency, internal; + for (;(dependency = dependencies[i]) !== undefined; i++) { + internal = isInternal.test(dependency); + if (internal) { + dependency = canonicalize(path + "/" + dependency); + } + if (!modules[dependency] && arguments[i]) { + modules[dependency] = arguments[i]; + } + if (internal && !modules[dependency] && typeof console !== "undefined") { + console.error("".concat("[Qoopido.js] ", id, ": Could not load dependency ", dependency)); + } + } + } + modules[id] = definition(modules, shared, namespace, navigator, global, document, undefined); + if (callback) { + callback(modules[id]); + } + return modules[id]; + }; + if (typeof module !== "undefined" && module.exports) { + module.exports = define(initialize); + } else if (typeof define === "function" && define.amd) { + dependencies ? define(dependencies, initialize) : define(initialize); + } else { + initialize(); + } + } + function registerSingleton(id, definition, dependencies) { + register(id, definition, dependencies, function(module) { + modules[id] = module.create(); + }); + } + var qoopido = global.qoopido || (global.qoopido = {}), shared = qoopido.shared || (qoopido.shared = {}), modules = qoopido.modules || (qoopido.modules = {}), dependencies = [], isInternal = new RegExp("^\\.+\\/"), regexCanonicalize = new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."), removeNeutral = new RegExp("(^\\/)|\\.\\/", "g"); + qoopido.register = register; + qoopido.registerSingleton = registerSingleton; + function canonicalize(path) { + var collapsed; + while ((collapsed = path.replace(regexCanonicalize, "")) !== path) { + path = collapsed; + } + return path.replace(removeNeutral, ""); + } + if (!Object.create) { + dependencies.push("./polyfill/object/create"); + } + if (!Object.getOwnPropertyNames) { + dependencies.push("./polyfill/object/getownpropertynames"); + } + if (!Object.getOwnPropertyDescriptor || !function() { + try { + Object.getOwnPropertyDescriptor({ + x: 0 + }, "x"); + return true; + } catch (exception) { + return false; + } + }()) { + dependencies.push("./polyfill/object/getownpropertydescriptor"); + } + register("base", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + function getOwnPropertyDescriptors(object) { + var descriptors = {}, properties = Object.getOwnPropertyNames(object), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + descriptors[property] = Object.getOwnPropertyDescriptor(object, property); + } + return descriptors; + } + function prohibitCall() { + throw new Error("[Qoopido.js] Operation prohibited"); + } + return { + create: function() { + var instance = Object.create(this, getOwnPropertyDescriptors(this)), result; + if (instance._constructor) { + result = instance._constructor.apply(instance, arguments); + } + instance.create = instance.extend = prohibitCall; + return result || instance; + }, + extend: function(properties, final) { + var instance; + properties = properties || {}; + final = final === true; + properties._parent = this; + instance = Object.create(this, getOwnPropertyDescriptors(properties)); + if (final === true) { + instance.extend = prohibitCall; + } + return instance; + } + }; +}, navigator, this, document); +(function(definition) { + window.qoopido.register("polyfill/window/getcomputedstyle", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!window.getComputedStyle) { + var getComputedStyleRegex = new RegExp("(\\-([a-z]){1})", "g"), getComputedStyleCallback = function() { + return arguments[2].toUpperCase(); + }; + return function(element, pseudo) { + var self = this; + self.getPropertyValue = function(property) { + if (property === "float") { + property = "styleFloat"; + } + if (getComputedStyleRegex.test(property)) { + property = property.replace(getComputedStyleRegex, getComputedStyleCallback); + } + return element.currentStyle[property] || null; + }; + return self; + }; + } else { + return window.getComputedStyle; + } +}); +(function(definition) { + var dependencies = []; + if (!window.getComputedStyle) { + dependencies.push("polyfill/window/getcomputedstyle"); + } + if (!Array.prototype.indexOf) { + dependencies.push("../array/indexof"); + } + window.qoopido.register("polyfill/window/matchmedia", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var identifier = "qoopidoPolyfillWindowMatchmedia", viewport = document.documentElement, queries = [], lookup = {}, features = {}, regex = { + type: /\s*(only|not)?\s*(screen|print|[a-z\-]+)\s*(and)?\s*/i, + media: /^\s*\(\s*(-[a-z]+-)?(min-|max-)?([a-z\-]+)\s*(:?\s*([0-9]+(\.[0-9]+)?|portrait|landscape)(px|em|dppx|dpcm|rem|%|in|cm|mm|ex|pt|pc|\/([0-9]+(\.[0-9]+)?))?)?\s*\)\s*$/ + }, timeout; + function detectFeatures() { + var ww = window.innerWidth || viewport.clientWidth, wh = window.innerHeight || viewport.clientHeight, dw = window.screen.width, dh = window.screen.height, cd = window.screen.colorDepth, pr = window.devicePixelRatio; + features["width"] = ww; + features["height"] = wh; + features["aspect-ratio"] = (ww / wh).toFixed(2); + features["color"] = cd; + features["color-index"] = Math.pow(2, cd); + features["device-aspect-ratio"] = (dw / dh).toFixed(2); + features["device-height"] = dh; + features["device-width"] = dw; + features["device-pixel-ratio"] = pr || 1; + features["resolution"] = pr && pr * 96 || window.screen.deviceXDPI || 96; + features["orientation"] = wh >= ww ? "portrait" : "landscape"; + } + function createQuery(query) { + var mql = { + matches: false, + media: query, + addListener: function addListener(listener) { + listener && listeners.push(listener); + }, + removeListener: function removeListener(listener) { + var i = 0, pointer; + for (;(pointer = listeners[i]) !== undefined; i++) { + if (pointer === listener) { + listeners.splice(i, 1); + } + } + } + }, index, listeners; + if (query === "") { + mql.matches = true; + } else { + mql.matches = checkQueryMatch(query); + } + queries.push({ + mql: mql, + listeners: [] + }); + index = queries.length - 1; + lookup[query] = index; + listeners = queries[index].listeners; + return mql; + } + function checkQueryMatch(query) { + var mql = query.indexOf(",") !== -1 && query.split(",") || [ query ], mqIndex = mql.length - 1, mqLength = mqIndex, mq = null, negateType = null, negateTypeFound = "", negateTypeIndex = 0, negate = false, type = "", exprListStr = "", exprList = null, exprIndex = 0, exprLength = 0, expr = null, prefix = "", length = "", unit = "", value = "", feature = "", match = false; + if (query === "") { + return true; + } + do { + mq = mql[mqLength - mqIndex]; + negate = false; + negateType = mq.match(regex.type); + if (negateType) { + negateTypeFound = negateType[0]; + negateTypeIndex = negateType.index; + } + if (!negateType || mq.substring(0, negateTypeIndex).indexOf("(") === -1 && (negateTypeIndex || !negateType[3] && negateTypeFound !== negateType.input)) { + match = false; + continue; + } + exprListStr = mq; + negate = negateType[1] === "not"; + if (!negateTypeIndex) { + type = negateType[2]; + exprListStr = mq.substring(negateTypeFound.length); + } + match = type === features.type || type === "all" || type === ""; + exprList = exprListStr.indexOf(" and ") !== -1 && exprListStr.split(" and ") || [ exprListStr ]; + exprIndex = exprList.length - 1; + exprLength = exprIndex; + if (match && exprIndex >= 0 && exprListStr !== "") { + do { + expr = exprList[exprIndex].match(regex.media); + if (!expr || !features[expr[3]]) { + match = false; + break; + } + prefix = expr[2]; + length = expr[5]; + value = length; + unit = expr[7]; + feature = features[expr[3]]; + if (unit) { + if (unit === "px") { + value = Number(length); + } else if (unit === "em" || unit === "rem") { + value = 16 * length; + } else if (expr[8]) { + value = (length / expr[8]).toFixed(2); + } else if (unit === "dppx") { + value = length * 96; + } else if (unit === "dpcm") { + value = length * .3937; + } else { + value = Number(length); + } + } + if (prefix === "min-" && value) { + match = feature >= value; + } else if (prefix === "max-" && value) { + match = feature <= value; + } else if (value) { + match = feature === value; + } else { + match = !!feature; + } + if (!match) { + break; + } + } while (exprIndex--); + } + if (match) { + break; + } + } while (mqIndex--); + return negate ? !match : match; + } + function delayedOnResize() { + var match = false, i = 0, j = 0, query, listener; + if (queries.length > 0) { + detectFeatures(); + for (;(query = queries[i]) !== undefined; i++) { + match = checkQueryMatch(query.mql.media); + if (match && !query.mql.matches || !match && query.mql.matches) { + query.mql.matches = match; + if (query.listeners) { + for (;(listener = query.listeners[j]) !== undefined; j++) { + listener.call(window, query.mql); + } + } + } + } + } + } + function delayOnResize() { + window.clearTimeout(timeout); + timeout = window.setTimeout(delayedOnResize, 10); + } + function initialize() { + var target = window.document.getElementsByTagName("script")[0], style = document.createElement("style"), types = [ "screen", "print", "speech", "projection", "handheld", "tv", "braille", "embossed", "tty" ], cssText = "#" + identifier + " { position: relative; z-index: 0; }", prefix = "", addListener = window.addEventListener || (prefix = "on") && window.attachEvent, i = 0, pointer; + style.type = "text/css"; + style.id = identifier; + target.parentNode.insertBefore(style, target); + for (;(pointer = types[i]) !== undefined; i++) { + cssText += "@media " + pointer + " { #" + identifier + " { position: relative; z-index: " + i + " } }"; + } + if (style.styleSheet) { + style.styleSheet.cssText = cssText; + } else { + style.textContent = cssText; + } + features.type = types[(window.getComputedStyle || modules["polyfill/window/getcomputedstyle"])(style).zIndex * 1 || 0]; + style.parentNode.removeChild(style); + addListener(prefix + "resize", delayOnResize); + addListener(prefix + "orientationchange", delayOnResize); + } + if (!window.matchMedia) { + initialize(); + detectFeatures(); + window.matchMedia = function(query) { + var index = lookup[query] || false; + if (index === false) { + return createQuery(query); + } else { + return queries[index].mql; + } + }; + } + return window.matchMedia; +}); +(function(definition) { + window.qoopido.register("emitter", definition, [ "./base" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var excludeMethods = /^(_|extend$|create$|on$|one$|off$|emit$|get.+)/; + function map(context, method) { + var event = method.charAt(0).toUpperCase() + method.slice(1); + context._mapped[method] = context[method]; + return function() { + var args = Array.prototype.slice.call(arguments), returnValue; + context.emit.apply(context, [ "pre" + event, args ]); + returnValue = context._mapped[method].apply(context, args); + context.emit.apply(context, [ "post" + event, args, returnValue ]); + return returnValue; + }; + } + return modules["base"].extend({ + _mapped: null, + _listener: null, + _temp: null, + _constructor: function() { + var self = this, method; + self._mapped = {}; + self._listener = {}; + for (method in self) { + if (typeof self[method] === "function" && excludeMethods.test(method) === false) { + self[method] = map(self, method); + } + } + return self; + }, + on: function(events, fn) { + var self = this, i = 0, event; + events = events.split(" "); + for (;(event = events[i]) !== undefined; i++) { + (self._listener[event] = self._listener[event] || []).push(fn); + } + return self; + }, + one: function(events, fn, each) { + each = each !== false; + var self = this; + self.on(events, function listener(event) { + self.off(each === true ? event : events, listener); + fn.apply(this, arguments); + }); + return self; + }, + off: function(events, fn) { + var self = this, i = 0, event, j, listener; + if (events) { + events = events.split(" "); + for (;(event = events[i]) !== undefined; i++) { + self._listener[event] = self._listener[event] || []; + if (fn) { + for (j = 0; (listener = self._listener[event][j]) !== undefined; j++) { + if (listener === fn) { + self._listener[event].splice(j, 1); + j--; + } + } + } else { + self._listener[event].length = 0; + } + } + } else { + for (event in self._listener) { + self._listener[event].length = 0; + } + } + return self; + }, + emit: function(event) { + var self = this, i = 0, listener; + if (event !== undefined) { + self._listener[event] = self._listener[event] || []; + self._temp = self._listener[event].slice(); + for (;(listener = self._temp[i]) !== undefined; i++) { + listener.apply(self, arguments); + } + self._temp.length = 0; + } + return self; + } + }); +}); +(function(definition) { + var dependencies = [ "../emitter" ]; + if (!window.matchMedia) { + dependencies.push("../polyfill/window/matchmedia"); + } + window.qoopido.register("component/sense", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var prototype, queries = {}; + function onQueryStateChange() { + var self = this, mql = self.mql; + if (mql.matches === true) { + self.emit("matched"); + } else { + self.emit("dematched"); + } + } + prototype = modules["emitter"].extend({ + mql: null, + _constructor: function(query) { + var self = prototype._parent._constructor.call(this), mql = self.mql = queries[query] || (queries[query] = window.matchMedia(query)), listener = function() { + onQueryStateChange.call(self); + }; + mql.addListener(listener); + window.setTimeout(listener, 0); + return self; + }, + matches: function() { + return this.mql.matches; + } + }); + return prototype; +}); +(function(definition) { + window.qoopido.registerSingleton("component/remux", definition, [ "../emitter", "./sense" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var prototype, html = document.getElementsByTagName("html")[0], base = 16, state = { + fontsize: null, + layout: null, + ratio: {} + }, current = { + fontsize: null, + layout: null + }; + function updateState(layout, fontsize) { + var self = this; + if (layout && fontsize) { + html.className = layout; + html.style.fontSize = fontsize + "px"; + state.layout = layout; + state.fontsize = fontsize; + if (current.fontsize !== state.fontsize || current.layout !== state.layout) { + state.ratio.device = window.devicePixelRatio || 1; + state.ratio.fontsize = state.fontsize / base; + state.ratio.total = state.ratio.device * state.ratio.fontsize; + if (current.layout !== state.layout) { + self.emit("layoutchanged", state); + } + if (current.fontsize !== state.fontsize) { + self.emit("fontsizechanged", state); + } + self.emit("statechanged", state); + current.fontsize = state.fontsize; + current.layout = state.layout; + } + } + return self; + } + function addQuery(query, layout, fontsize) { + var self = this; + window.setTimeout(function() { + modules["component/sense"].create(query).on("matched", function() { + updateState.call(self, layout, fontsize); + }); + }, 0); + } + prototype = modules["emitter"].extend({ + _constructor: function() { + var self = prototype._parent._constructor.call(this), pBase = parseInt(html.getAttribute("data-base"), 10); + if (isNaN(pBase) === false) { + base = pBase; + } + return self; + }, + getState: function() { + return state; + }, + getLayout: function() { + return state.layout; + }, + getFontsize: function() { + return state.fontsize; + }, + setLayout: function(layout, fontsize) { + var self = this; + updateState.call(self, layout, fontsize); + return self; + }, + addLayout: function(pId, pLayout) { + var self = this, parameter, id, layout, size, min, max, lMin, lMax; + if (arguments.length > 1) { + parameter = {}; + parameter[pId] = pLayout; + } else { + parameter = arguments[0]; + } + for (id in parameter) { + layout = parameter[id]; + for (size = layout.min; size <= layout.max; size++) { + lMin = Math.round(layout.width * (size / base)); + lMax = Math.round(layout.width * ((size + 1) / base)) - 1; + addQuery.call(self, "screen and (min-width: " + lMin + "px) and (max-width: " + lMax + "px )", id, size); + min = !min || lMin < min.width ? { + width: lMin, + fontsize: size, + layout: id + } : min; + max = !max || lMax >= max.width ? { + width: lMax, + fontsize: size, + layout: id + } : max; + } + } + addQuery.call(self, "screen and (max-width: " + (min.width - 1) + "px)", min.layout, min.fontsize); + addQuery.call(self, "screen and (min-width: " + (max.width + 1) + "px)", max.layout, max.fontsize); + return self; + } + }); + return prototype; +}); \ No newline at end of file diff --git a/dist/3.7.3/max/packages/qoopido.sense.js b/dist/3.7.3/max/packages/qoopido.sense.js new file mode 100644 index 00000000..df6a0ed5 --- /dev/null +++ b/dist/3.7.3/max/packages/qoopido.sense.js @@ -0,0 +1,420 @@ +/*! +* Qoopido.js library +* +* version: 3.7.3 +* date: 2015-08-05 +* author: Dirk Lueth +* website: https://github.com/dlueth/qoopido.js +* +* Copyright (c) 2015 Dirk Lueth +*/ +(function(definition, navigator, global, document, undefined) { + "use strict"; + function register(id, definition, dependencies, callback) { + var namespace = id.split("/"), initialize; + if (modules[id]) { + return modules[id]; + } + initialize = function() { + if (dependencies) { + var path = namespace.slice(0, -1).join("/"), i = 0, dependency, internal; + for (;(dependency = dependencies[i]) !== undefined; i++) { + internal = isInternal.test(dependency); + if (internal) { + dependency = canonicalize(path + "/" + dependency); + } + if (!modules[dependency] && arguments[i]) { + modules[dependency] = arguments[i]; + } + if (internal && !modules[dependency] && typeof console !== "undefined") { + console.error("".concat("[Qoopido.js] ", id, ": Could not load dependency ", dependency)); + } + } + } + modules[id] = definition(modules, shared, namespace, navigator, global, document, undefined); + if (callback) { + callback(modules[id]); + } + return modules[id]; + }; + if (typeof module !== "undefined" && module.exports) { + module.exports = define(initialize); + } else if (typeof define === "function" && define.amd) { + dependencies ? define(dependencies, initialize) : define(initialize); + } else { + initialize(); + } + } + function registerSingleton(id, definition, dependencies) { + register(id, definition, dependencies, function(module) { + modules[id] = module.create(); + }); + } + var qoopido = global.qoopido || (global.qoopido = {}), shared = qoopido.shared || (qoopido.shared = {}), modules = qoopido.modules || (qoopido.modules = {}), dependencies = [], isInternal = new RegExp("^\\.+\\/"), regexCanonicalize = new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."), removeNeutral = new RegExp("(^\\/)|\\.\\/", "g"); + qoopido.register = register; + qoopido.registerSingleton = registerSingleton; + function canonicalize(path) { + var collapsed; + while ((collapsed = path.replace(regexCanonicalize, "")) !== path) { + path = collapsed; + } + return path.replace(removeNeutral, ""); + } + if (!Object.create) { + dependencies.push("./polyfill/object/create"); + } + if (!Object.getOwnPropertyNames) { + dependencies.push("./polyfill/object/getownpropertynames"); + } + if (!Object.getOwnPropertyDescriptor || !function() { + try { + Object.getOwnPropertyDescriptor({ + x: 0 + }, "x"); + return true; + } catch (exception) { + return false; + } + }()) { + dependencies.push("./polyfill/object/getownpropertydescriptor"); + } + register("base", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + function getOwnPropertyDescriptors(object) { + var descriptors = {}, properties = Object.getOwnPropertyNames(object), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + descriptors[property] = Object.getOwnPropertyDescriptor(object, property); + } + return descriptors; + } + function prohibitCall() { + throw new Error("[Qoopido.js] Operation prohibited"); + } + return { + create: function() { + var instance = Object.create(this, getOwnPropertyDescriptors(this)), result; + if (instance._constructor) { + result = instance._constructor.apply(instance, arguments); + } + instance.create = instance.extend = prohibitCall; + return result || instance; + }, + extend: function(properties, final) { + var instance; + properties = properties || {}; + final = final === true; + properties._parent = this; + instance = Object.create(this, getOwnPropertyDescriptors(properties)); + if (final === true) { + instance.extend = prohibitCall; + } + return instance; + } + }; +}, navigator, this, document); +(function(definition) { + var dependencies = []; + if (!window.getComputedStyle) { + dependencies.push("polyfill/window/getcomputedstyle"); + } + if (!Array.prototype.indexOf) { + dependencies.push("../array/indexof"); + } + window.qoopido.register("polyfill/window/matchmedia", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var identifier = "qoopidoPolyfillWindowMatchmedia", viewport = document.documentElement, queries = [], lookup = {}, features = {}, regex = { + type: /\s*(only|not)?\s*(screen|print|[a-z\-]+)\s*(and)?\s*/i, + media: /^\s*\(\s*(-[a-z]+-)?(min-|max-)?([a-z\-]+)\s*(:?\s*([0-9]+(\.[0-9]+)?|portrait|landscape)(px|em|dppx|dpcm|rem|%|in|cm|mm|ex|pt|pc|\/([0-9]+(\.[0-9]+)?))?)?\s*\)\s*$/ + }, timeout; + function detectFeatures() { + var ww = window.innerWidth || viewport.clientWidth, wh = window.innerHeight || viewport.clientHeight, dw = window.screen.width, dh = window.screen.height, cd = window.screen.colorDepth, pr = window.devicePixelRatio; + features["width"] = ww; + features["height"] = wh; + features["aspect-ratio"] = (ww / wh).toFixed(2); + features["color"] = cd; + features["color-index"] = Math.pow(2, cd); + features["device-aspect-ratio"] = (dw / dh).toFixed(2); + features["device-height"] = dh; + features["device-width"] = dw; + features["device-pixel-ratio"] = pr || 1; + features["resolution"] = pr && pr * 96 || window.screen.deviceXDPI || 96; + features["orientation"] = wh >= ww ? "portrait" : "landscape"; + } + function createQuery(query) { + var mql = { + matches: false, + media: query, + addListener: function addListener(listener) { + listener && listeners.push(listener); + }, + removeListener: function removeListener(listener) { + var i = 0, pointer; + for (;(pointer = listeners[i]) !== undefined; i++) { + if (pointer === listener) { + listeners.splice(i, 1); + } + } + } + }, index, listeners; + if (query === "") { + mql.matches = true; + } else { + mql.matches = checkQueryMatch(query); + } + queries.push({ + mql: mql, + listeners: [] + }); + index = queries.length - 1; + lookup[query] = index; + listeners = queries[index].listeners; + return mql; + } + function checkQueryMatch(query) { + var mql = query.indexOf(",") !== -1 && query.split(",") || [ query ], mqIndex = mql.length - 1, mqLength = mqIndex, mq = null, negateType = null, negateTypeFound = "", negateTypeIndex = 0, negate = false, type = "", exprListStr = "", exprList = null, exprIndex = 0, exprLength = 0, expr = null, prefix = "", length = "", unit = "", value = "", feature = "", match = false; + if (query === "") { + return true; + } + do { + mq = mql[mqLength - mqIndex]; + negate = false; + negateType = mq.match(regex.type); + if (negateType) { + negateTypeFound = negateType[0]; + negateTypeIndex = negateType.index; + } + if (!negateType || mq.substring(0, negateTypeIndex).indexOf("(") === -1 && (negateTypeIndex || !negateType[3] && negateTypeFound !== negateType.input)) { + match = false; + continue; + } + exprListStr = mq; + negate = negateType[1] === "not"; + if (!negateTypeIndex) { + type = negateType[2]; + exprListStr = mq.substring(negateTypeFound.length); + } + match = type === features.type || type === "all" || type === ""; + exprList = exprListStr.indexOf(" and ") !== -1 && exprListStr.split(" and ") || [ exprListStr ]; + exprIndex = exprList.length - 1; + exprLength = exprIndex; + if (match && exprIndex >= 0 && exprListStr !== "") { + do { + expr = exprList[exprIndex].match(regex.media); + if (!expr || !features[expr[3]]) { + match = false; + break; + } + prefix = expr[2]; + length = expr[5]; + value = length; + unit = expr[7]; + feature = features[expr[3]]; + if (unit) { + if (unit === "px") { + value = Number(length); + } else if (unit === "em" || unit === "rem") { + value = 16 * length; + } else if (expr[8]) { + value = (length / expr[8]).toFixed(2); + } else if (unit === "dppx") { + value = length * 96; + } else if (unit === "dpcm") { + value = length * .3937; + } else { + value = Number(length); + } + } + if (prefix === "min-" && value) { + match = feature >= value; + } else if (prefix === "max-" && value) { + match = feature <= value; + } else if (value) { + match = feature === value; + } else { + match = !!feature; + } + if (!match) { + break; + } + } while (exprIndex--); + } + if (match) { + break; + } + } while (mqIndex--); + return negate ? !match : match; + } + function delayedOnResize() { + var match = false, i = 0, j = 0, query, listener; + if (queries.length > 0) { + detectFeatures(); + for (;(query = queries[i]) !== undefined; i++) { + match = checkQueryMatch(query.mql.media); + if (match && !query.mql.matches || !match && query.mql.matches) { + query.mql.matches = match; + if (query.listeners) { + for (;(listener = query.listeners[j]) !== undefined; j++) { + listener.call(window, query.mql); + } + } + } + } + } + } + function delayOnResize() { + window.clearTimeout(timeout); + timeout = window.setTimeout(delayedOnResize, 10); + } + function initialize() { + var target = window.document.getElementsByTagName("script")[0], style = document.createElement("style"), types = [ "screen", "print", "speech", "projection", "handheld", "tv", "braille", "embossed", "tty" ], cssText = "#" + identifier + " { position: relative; z-index: 0; }", prefix = "", addListener = window.addEventListener || (prefix = "on") && window.attachEvent, i = 0, pointer; + style.type = "text/css"; + style.id = identifier; + target.parentNode.insertBefore(style, target); + for (;(pointer = types[i]) !== undefined; i++) { + cssText += "@media " + pointer + " { #" + identifier + " { position: relative; z-index: " + i + " } }"; + } + if (style.styleSheet) { + style.styleSheet.cssText = cssText; + } else { + style.textContent = cssText; + } + features.type = types[(window.getComputedStyle || modules["polyfill/window/getcomputedstyle"])(style).zIndex * 1 || 0]; + style.parentNode.removeChild(style); + addListener(prefix + "resize", delayOnResize); + addListener(prefix + "orientationchange", delayOnResize); + } + if (!window.matchMedia) { + initialize(); + detectFeatures(); + window.matchMedia = function(query) { + var index = lookup[query] || false; + if (index === false) { + return createQuery(query); + } else { + return queries[index].mql; + } + }; + } + return window.matchMedia; +}); +(function(definition) { + window.qoopido.register("emitter", definition, [ "./base" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var excludeMethods = /^(_|extend$|create$|on$|one$|off$|emit$|get.+)/; + function map(context, method) { + var event = method.charAt(0).toUpperCase() + method.slice(1); + context._mapped[method] = context[method]; + return function() { + var args = Array.prototype.slice.call(arguments), returnValue; + context.emit.apply(context, [ "pre" + event, args ]); + returnValue = context._mapped[method].apply(context, args); + context.emit.apply(context, [ "post" + event, args, returnValue ]); + return returnValue; + }; + } + return modules["base"].extend({ + _mapped: null, + _listener: null, + _temp: null, + _constructor: function() { + var self = this, method; + self._mapped = {}; + self._listener = {}; + for (method in self) { + if (typeof self[method] === "function" && excludeMethods.test(method) === false) { + self[method] = map(self, method); + } + } + return self; + }, + on: function(events, fn) { + var self = this, i = 0, event; + events = events.split(" "); + for (;(event = events[i]) !== undefined; i++) { + (self._listener[event] = self._listener[event] || []).push(fn); + } + return self; + }, + one: function(events, fn, each) { + each = each !== false; + var self = this; + self.on(events, function listener(event) { + self.off(each === true ? event : events, listener); + fn.apply(this, arguments); + }); + return self; + }, + off: function(events, fn) { + var self = this, i = 0, event, j, listener; + if (events) { + events = events.split(" "); + for (;(event = events[i]) !== undefined; i++) { + self._listener[event] = self._listener[event] || []; + if (fn) { + for (j = 0; (listener = self._listener[event][j]) !== undefined; j++) { + if (listener === fn) { + self._listener[event].splice(j, 1); + j--; + } + } + } else { + self._listener[event].length = 0; + } + } + } else { + for (event in self._listener) { + self._listener[event].length = 0; + } + } + return self; + }, + emit: function(event) { + var self = this, i = 0, listener; + if (event !== undefined) { + self._listener[event] = self._listener[event] || []; + self._temp = self._listener[event].slice(); + for (;(listener = self._temp[i]) !== undefined; i++) { + listener.apply(self, arguments); + } + self._temp.length = 0; + } + return self; + } + }); +}); +(function(definition) { + var dependencies = [ "../emitter" ]; + if (!window.matchMedia) { + dependencies.push("../polyfill/window/matchmedia"); + } + window.qoopido.register("component/sense", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var prototype, queries = {}; + function onQueryStateChange() { + var self = this, mql = self.mql; + if (mql.matches === true) { + self.emit("matched"); + } else { + self.emit("dematched"); + } + } + prototype = modules["emitter"].extend({ + mql: null, + _constructor: function(query) { + var self = prototype._parent._constructor.call(this), mql = self.mql = queries[query] || (queries[query] = window.matchMedia(query)), listener = function() { + onQueryStateChange.call(self); + }; + mql.addListener(listener); + window.setTimeout(listener, 0); + return self; + }, + matches: function() { + return this.mql.matches; + } + }); + return prototype; +}); \ No newline at end of file diff --git a/dist/3.7.3/max/packages/qoopido.sense.legacy.js b/dist/3.7.3/max/packages/qoopido.sense.legacy.js new file mode 100644 index 00000000..f50b1180 --- /dev/null +++ b/dist/3.7.3/max/packages/qoopido.sense.legacy.js @@ -0,0 +1,616 @@ +/*! +* Qoopido.js library +* +* version: 3.7.3 +* date: 2015-08-05 +* author: Dirk Lueth +* website: https://github.com/dlueth/qoopido.js +* +* Copyright (c) 2015 Dirk Lueth +*/ +(function(definition, qoopido) { + if (qoopido.register) { + qoopido.register("polyfill/object/defineproperty", definition); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/defineproperty"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.defineProperty || !function() { + try { + Object.defineProperty({}, "x", {}); + return true; + } catch (exception) { + return false; + } + }()) { + var defineProperty = Object.defineProperty, defineGetter = Object.prototype.__defineGetter__, defineSetter = Object.prototype.__defineSetter__; + Object.defineProperty = function(obj, prop, desc) { + if (defineProperty) { + try { + return defineProperty(obj, prop, desc); + } catch (exception) {} + } + if (obj !== Object(obj)) { + throw new TypeError("Object.defineProperty called on non-object"); + } + if (defineGetter && "get" in desc) { + defineGetter.call(obj, prop, desc.get); + } + if (defineSetter && "set" in desc) { + defineSetter.call(obj, prop, desc.set); + } + if ("value" in desc) { + obj[prop] = desc.value; + } + return obj; + }; + } + return Object.defineProperty; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + var dependencies = []; + if (!Object.defineProperty || !function() { + try { + Object.defineProperty({}, "x", {}); + return true; + } catch (exception) { + return false; + } + }()) { + dependencies.push("./defineproperty"); + } + qoopido.register("polyfill/object/defineproperties", definition, dependencies); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/defineproperties"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.defineProperties) { + Object.defineProperties = function(obj, properties) { + if (obj !== Object(obj)) { + throw new TypeError("Object.defineProperties called on non-object"); + } + var name; + for (name in properties) { + if (Object.prototype.hasOwnProperty.call(properties, name)) { + Object.defineProperty(obj, name, properties[name]); + } + } + return obj; + }; + } + return Object.defineProperties; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + var dependencies = []; + if (!Object.defineProperties) { + dependencies.push("./defineproperties"); + } + qoopido.register("polyfill/object/create", definition, dependencies); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/create"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.create) { + Object.create = function(prototype, properties) { + if (typeof prototype !== "object") { + throw new TypeError(); + } + function Constructor() {} + Constructor.prototype = prototype; + var obj = new Constructor(); + if (prototype) { + obj.constructor = Constructor; + } + if (arguments.length > 1) { + if (properties !== Object(properties)) { + throw new TypeError(); + } + Object.defineProperties(obj, properties); + } + return obj; + }; + } + return Object.create; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + qoopido.register("polyfill/object/getownpropertynames", definition); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/getownpropertynames"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.getOwnPropertyNames) { + Object.getOwnPropertyNames = function(obj) { + if (obj !== Object(obj)) { + throw new TypeError("Object.getOwnPropertyNames called on non-object"); + } + var props = [], p; + for (p in obj) { + if (Object.prototype.hasOwnProperty.call(obj, p)) { + props.push(p); + } + } + return props; + }; + } + return Object.getOwnPropertyNames; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + qoopido.register("polyfill/object/getownpropertydescriptor", definition); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/getownpropertydescriptor"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.getOwnPropertyDescriptor || !function() { + try { + Object.getOwnPropertyDescriptor({ + x: 0 + }, "x"); + return true; + } catch (exception) { + return false; + } + }()) { + var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; + Object.getOwnPropertyDescriptor = function(obj, property) { + if (obj !== Object(obj)) { + throw new TypeError(); + } + try { + return getOwnPropertyDescriptor.call(Object, obj, property); + } catch (exception) {} + if (Object.prototype.hasOwnProperty.call(obj, property)) { + return { + value: obj[property], + enumerable: true, + writable: true, + configurable: true + }; + } + }; + } + return Object.getOwnPropertyDescriptor; +}, window.qoopido = window.qoopido || {}); +(function(definition, navigator, global, document, undefined) { + "use strict"; + function register(id, definition, dependencies, callback) { + var namespace = id.split("/"), initialize; + if (modules[id]) { + return modules[id]; + } + initialize = function() { + if (dependencies) { + var path = namespace.slice(0, -1).join("/"), i = 0, dependency, internal; + for (;(dependency = dependencies[i]) !== undefined; i++) { + internal = isInternal.test(dependency); + if (internal) { + dependency = canonicalize(path + "/" + dependency); + } + if (!modules[dependency] && arguments[i]) { + modules[dependency] = arguments[i]; + } + if (internal && !modules[dependency] && typeof console !== "undefined") { + console.error("".concat("[Qoopido.js] ", id, ": Could not load dependency ", dependency)); + } + } + } + modules[id] = definition(modules, shared, namespace, navigator, global, document, undefined); + if (callback) { + callback(modules[id]); + } + return modules[id]; + }; + if (typeof module !== "undefined" && module.exports) { + module.exports = define(initialize); + } else if (typeof define === "function" && define.amd) { + dependencies ? define(dependencies, initialize) : define(initialize); + } else { + initialize(); + } + } + function registerSingleton(id, definition, dependencies) { + register(id, definition, dependencies, function(module) { + modules[id] = module.create(); + }); + } + var qoopido = global.qoopido || (global.qoopido = {}), shared = qoopido.shared || (qoopido.shared = {}), modules = qoopido.modules || (qoopido.modules = {}), dependencies = [], isInternal = new RegExp("^\\.+\\/"), regexCanonicalize = new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."), removeNeutral = new RegExp("(^\\/)|\\.\\/", "g"); + qoopido.register = register; + qoopido.registerSingleton = registerSingleton; + function canonicalize(path) { + var collapsed; + while ((collapsed = path.replace(regexCanonicalize, "")) !== path) { + path = collapsed; + } + return path.replace(removeNeutral, ""); + } + if (!Object.create) { + dependencies.push("./polyfill/object/create"); + } + if (!Object.getOwnPropertyNames) { + dependencies.push("./polyfill/object/getownpropertynames"); + } + if (!Object.getOwnPropertyDescriptor || !function() { + try { + Object.getOwnPropertyDescriptor({ + x: 0 + }, "x"); + return true; + } catch (exception) { + return false; + } + }()) { + dependencies.push("./polyfill/object/getownpropertydescriptor"); + } + register("base", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + function getOwnPropertyDescriptors(object) { + var descriptors = {}, properties = Object.getOwnPropertyNames(object), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + descriptors[property] = Object.getOwnPropertyDescriptor(object, property); + } + return descriptors; + } + function prohibitCall() { + throw new Error("[Qoopido.js] Operation prohibited"); + } + return { + create: function() { + var instance = Object.create(this, getOwnPropertyDescriptors(this)), result; + if (instance._constructor) { + result = instance._constructor.apply(instance, arguments); + } + instance.create = instance.extend = prohibitCall; + return result || instance; + }, + extend: function(properties, final) { + var instance; + properties = properties || {}; + final = final === true; + properties._parent = this; + instance = Object.create(this, getOwnPropertyDescriptors(properties)); + if (final === true) { + instance.extend = prohibitCall; + } + return instance; + } + }; +}, navigator, this, document); +(function(definition) { + window.qoopido.register("polyfill/window/getcomputedstyle", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!window.getComputedStyle) { + var getComputedStyleRegex = new RegExp("(\\-([a-z]){1})", "g"), getComputedStyleCallback = function() { + return arguments[2].toUpperCase(); + }; + return function(element, pseudo) { + var self = this; + self.getPropertyValue = function(property) { + if (property === "float") { + property = "styleFloat"; + } + if (getComputedStyleRegex.test(property)) { + property = property.replace(getComputedStyleRegex, getComputedStyleCallback); + } + return element.currentStyle[property] || null; + }; + return self; + }; + } else { + return window.getComputedStyle; + } +}); +(function(definition) { + var dependencies = []; + if (!window.getComputedStyle) { + dependencies.push("polyfill/window/getcomputedstyle"); + } + if (!Array.prototype.indexOf) { + dependencies.push("../array/indexof"); + } + window.qoopido.register("polyfill/window/matchmedia", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var identifier = "qoopidoPolyfillWindowMatchmedia", viewport = document.documentElement, queries = [], lookup = {}, features = {}, regex = { + type: /\s*(only|not)?\s*(screen|print|[a-z\-]+)\s*(and)?\s*/i, + media: /^\s*\(\s*(-[a-z]+-)?(min-|max-)?([a-z\-]+)\s*(:?\s*([0-9]+(\.[0-9]+)?|portrait|landscape)(px|em|dppx|dpcm|rem|%|in|cm|mm|ex|pt|pc|\/([0-9]+(\.[0-9]+)?))?)?\s*\)\s*$/ + }, timeout; + function detectFeatures() { + var ww = window.innerWidth || viewport.clientWidth, wh = window.innerHeight || viewport.clientHeight, dw = window.screen.width, dh = window.screen.height, cd = window.screen.colorDepth, pr = window.devicePixelRatio; + features["width"] = ww; + features["height"] = wh; + features["aspect-ratio"] = (ww / wh).toFixed(2); + features["color"] = cd; + features["color-index"] = Math.pow(2, cd); + features["device-aspect-ratio"] = (dw / dh).toFixed(2); + features["device-height"] = dh; + features["device-width"] = dw; + features["device-pixel-ratio"] = pr || 1; + features["resolution"] = pr && pr * 96 || window.screen.deviceXDPI || 96; + features["orientation"] = wh >= ww ? "portrait" : "landscape"; + } + function createQuery(query) { + var mql = { + matches: false, + media: query, + addListener: function addListener(listener) { + listener && listeners.push(listener); + }, + removeListener: function removeListener(listener) { + var i = 0, pointer; + for (;(pointer = listeners[i]) !== undefined; i++) { + if (pointer === listener) { + listeners.splice(i, 1); + } + } + } + }, index, listeners; + if (query === "") { + mql.matches = true; + } else { + mql.matches = checkQueryMatch(query); + } + queries.push({ + mql: mql, + listeners: [] + }); + index = queries.length - 1; + lookup[query] = index; + listeners = queries[index].listeners; + return mql; + } + function checkQueryMatch(query) { + var mql = query.indexOf(",") !== -1 && query.split(",") || [ query ], mqIndex = mql.length - 1, mqLength = mqIndex, mq = null, negateType = null, negateTypeFound = "", negateTypeIndex = 0, negate = false, type = "", exprListStr = "", exprList = null, exprIndex = 0, exprLength = 0, expr = null, prefix = "", length = "", unit = "", value = "", feature = "", match = false; + if (query === "") { + return true; + } + do { + mq = mql[mqLength - mqIndex]; + negate = false; + negateType = mq.match(regex.type); + if (negateType) { + negateTypeFound = negateType[0]; + negateTypeIndex = negateType.index; + } + if (!negateType || mq.substring(0, negateTypeIndex).indexOf("(") === -1 && (negateTypeIndex || !negateType[3] && negateTypeFound !== negateType.input)) { + match = false; + continue; + } + exprListStr = mq; + negate = negateType[1] === "not"; + if (!negateTypeIndex) { + type = negateType[2]; + exprListStr = mq.substring(negateTypeFound.length); + } + match = type === features.type || type === "all" || type === ""; + exprList = exprListStr.indexOf(" and ") !== -1 && exprListStr.split(" and ") || [ exprListStr ]; + exprIndex = exprList.length - 1; + exprLength = exprIndex; + if (match && exprIndex >= 0 && exprListStr !== "") { + do { + expr = exprList[exprIndex].match(regex.media); + if (!expr || !features[expr[3]]) { + match = false; + break; + } + prefix = expr[2]; + length = expr[5]; + value = length; + unit = expr[7]; + feature = features[expr[3]]; + if (unit) { + if (unit === "px") { + value = Number(length); + } else if (unit === "em" || unit === "rem") { + value = 16 * length; + } else if (expr[8]) { + value = (length / expr[8]).toFixed(2); + } else if (unit === "dppx") { + value = length * 96; + } else if (unit === "dpcm") { + value = length * .3937; + } else { + value = Number(length); + } + } + if (prefix === "min-" && value) { + match = feature >= value; + } else if (prefix === "max-" && value) { + match = feature <= value; + } else if (value) { + match = feature === value; + } else { + match = !!feature; + } + if (!match) { + break; + } + } while (exprIndex--); + } + if (match) { + break; + } + } while (mqIndex--); + return negate ? !match : match; + } + function delayedOnResize() { + var match = false, i = 0, j = 0, query, listener; + if (queries.length > 0) { + detectFeatures(); + for (;(query = queries[i]) !== undefined; i++) { + match = checkQueryMatch(query.mql.media); + if (match && !query.mql.matches || !match && query.mql.matches) { + query.mql.matches = match; + if (query.listeners) { + for (;(listener = query.listeners[j]) !== undefined; j++) { + listener.call(window, query.mql); + } + } + } + } + } + } + function delayOnResize() { + window.clearTimeout(timeout); + timeout = window.setTimeout(delayedOnResize, 10); + } + function initialize() { + var target = window.document.getElementsByTagName("script")[0], style = document.createElement("style"), types = [ "screen", "print", "speech", "projection", "handheld", "tv", "braille", "embossed", "tty" ], cssText = "#" + identifier + " { position: relative; z-index: 0; }", prefix = "", addListener = window.addEventListener || (prefix = "on") && window.attachEvent, i = 0, pointer; + style.type = "text/css"; + style.id = identifier; + target.parentNode.insertBefore(style, target); + for (;(pointer = types[i]) !== undefined; i++) { + cssText += "@media " + pointer + " { #" + identifier + " { position: relative; z-index: " + i + " } }"; + } + if (style.styleSheet) { + style.styleSheet.cssText = cssText; + } else { + style.textContent = cssText; + } + features.type = types[(window.getComputedStyle || modules["polyfill/window/getcomputedstyle"])(style).zIndex * 1 || 0]; + style.parentNode.removeChild(style); + addListener(prefix + "resize", delayOnResize); + addListener(prefix + "orientationchange", delayOnResize); + } + if (!window.matchMedia) { + initialize(); + detectFeatures(); + window.matchMedia = function(query) { + var index = lookup[query] || false; + if (index === false) { + return createQuery(query); + } else { + return queries[index].mql; + } + }; + } + return window.matchMedia; +}); +(function(definition) { + window.qoopido.register("emitter", definition, [ "./base" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var excludeMethods = /^(_|extend$|create$|on$|one$|off$|emit$|get.+)/; + function map(context, method) { + var event = method.charAt(0).toUpperCase() + method.slice(1); + context._mapped[method] = context[method]; + return function() { + var args = Array.prototype.slice.call(arguments), returnValue; + context.emit.apply(context, [ "pre" + event, args ]); + returnValue = context._mapped[method].apply(context, args); + context.emit.apply(context, [ "post" + event, args, returnValue ]); + return returnValue; + }; + } + return modules["base"].extend({ + _mapped: null, + _listener: null, + _temp: null, + _constructor: function() { + var self = this, method; + self._mapped = {}; + self._listener = {}; + for (method in self) { + if (typeof self[method] === "function" && excludeMethods.test(method) === false) { + self[method] = map(self, method); + } + } + return self; + }, + on: function(events, fn) { + var self = this, i = 0, event; + events = events.split(" "); + for (;(event = events[i]) !== undefined; i++) { + (self._listener[event] = self._listener[event] || []).push(fn); + } + return self; + }, + one: function(events, fn, each) { + each = each !== false; + var self = this; + self.on(events, function listener(event) { + self.off(each === true ? event : events, listener); + fn.apply(this, arguments); + }); + return self; + }, + off: function(events, fn) { + var self = this, i = 0, event, j, listener; + if (events) { + events = events.split(" "); + for (;(event = events[i]) !== undefined; i++) { + self._listener[event] = self._listener[event] || []; + if (fn) { + for (j = 0; (listener = self._listener[event][j]) !== undefined; j++) { + if (listener === fn) { + self._listener[event].splice(j, 1); + j--; + } + } + } else { + self._listener[event].length = 0; + } + } + } else { + for (event in self._listener) { + self._listener[event].length = 0; + } + } + return self; + }, + emit: function(event) { + var self = this, i = 0, listener; + if (event !== undefined) { + self._listener[event] = self._listener[event] || []; + self._temp = self._listener[event].slice(); + for (;(listener = self._temp[i]) !== undefined; i++) { + listener.apply(self, arguments); + } + self._temp.length = 0; + } + return self; + } + }); +}); +(function(definition) { + var dependencies = [ "../emitter" ]; + if (!window.matchMedia) { + dependencies.push("../polyfill/window/matchmedia"); + } + window.qoopido.register("component/sense", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var prototype, queries = {}; + function onQueryStateChange() { + var self = this, mql = self.mql; + if (mql.matches === true) { + self.emit("matched"); + } else { + self.emit("dematched"); + } + } + prototype = modules["emitter"].extend({ + mql: null, + _constructor: function(query) { + var self = prototype._parent._constructor.call(this), mql = self.mql = queries[query] || (queries[query] = window.matchMedia(query)), listener = function() { + onQueryStateChange.call(self); + }; + mql.addListener(listener); + window.setTimeout(listener, 0); + return self; + }, + matches: function() { + return this.mql.matches; + } + }); + return prototype; +}); \ No newline at end of file diff --git a/dist/3.7.3/max/packages/qoopido.shrinkimage.js b/dist/3.7.3/max/packages/qoopido.shrinkimage.js new file mode 100644 index 00000000..bb18f2c3 --- /dev/null +++ b/dist/3.7.3/max/packages/qoopido.shrinkimage.js @@ -0,0 +1,1789 @@ +/*! +* Qoopido.js library +* +* version: 3.7.3 +* date: 2015-08-05 +* author: Dirk Lueth +* website: https://github.com/dlueth/qoopido.js +* +* Copyright (c) 2015 Dirk Lueth +*/ +(function(definition, navigator, global, document, undefined) { + "use strict"; + function register(id, definition, dependencies, callback) { + var namespace = id.split("/"), initialize; + if (modules[id]) { + return modules[id]; + } + initialize = function() { + if (dependencies) { + var path = namespace.slice(0, -1).join("/"), i = 0, dependency, internal; + for (;(dependency = dependencies[i]) !== undefined; i++) { + internal = isInternal.test(dependency); + if (internal) { + dependency = canonicalize(path + "/" + dependency); + } + if (!modules[dependency] && arguments[i]) { + modules[dependency] = arguments[i]; + } + if (internal && !modules[dependency] && typeof console !== "undefined") { + console.error("".concat("[Qoopido.js] ", id, ": Could not load dependency ", dependency)); + } + } + } + modules[id] = definition(modules, shared, namespace, navigator, global, document, undefined); + if (callback) { + callback(modules[id]); + } + return modules[id]; + }; + if (typeof module !== "undefined" && module.exports) { + module.exports = define(initialize); + } else if (typeof define === "function" && define.amd) { + dependencies ? define(dependencies, initialize) : define(initialize); + } else { + initialize(); + } + } + function registerSingleton(id, definition, dependencies) { + register(id, definition, dependencies, function(module) { + modules[id] = module.create(); + }); + } + var qoopido = global.qoopido || (global.qoopido = {}), shared = qoopido.shared || (qoopido.shared = {}), modules = qoopido.modules || (qoopido.modules = {}), dependencies = [], isInternal = new RegExp("^\\.+\\/"), regexCanonicalize = new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."), removeNeutral = new RegExp("(^\\/)|\\.\\/", "g"); + qoopido.register = register; + qoopido.registerSingleton = registerSingleton; + function canonicalize(path) { + var collapsed; + while ((collapsed = path.replace(regexCanonicalize, "")) !== path) { + path = collapsed; + } + return path.replace(removeNeutral, ""); + } + if (!Object.create) { + dependencies.push("./polyfill/object/create"); + } + if (!Object.getOwnPropertyNames) { + dependencies.push("./polyfill/object/getownpropertynames"); + } + if (!Object.getOwnPropertyDescriptor || !function() { + try { + Object.getOwnPropertyDescriptor({ + x: 0 + }, "x"); + return true; + } catch (exception) { + return false; + } + }()) { + dependencies.push("./polyfill/object/getownpropertydescriptor"); + } + register("base", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + function getOwnPropertyDescriptors(object) { + var descriptors = {}, properties = Object.getOwnPropertyNames(object), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + descriptors[property] = Object.getOwnPropertyDescriptor(object, property); + } + return descriptors; + } + function prohibitCall() { + throw new Error("[Qoopido.js] Operation prohibited"); + } + return { + create: function() { + var instance = Object.create(this, getOwnPropertyDescriptors(this)), result; + if (instance._constructor) { + result = instance._constructor.apply(instance, arguments); + } + instance.create = instance.extend = prohibitCall; + return result || instance; + }, + extend: function(properties, final) { + var instance; + properties = properties || {}; + final = final === true; + properties._parent = this; + instance = Object.create(this, getOwnPropertyDescriptors(properties)); + if (final === true) { + instance.extend = prohibitCall; + } + return instance; + } + }; +}, navigator, this, document); +(function(definition) { + window.qoopido.register("polyfill/string/ucfirst", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!String.prototype.ucfirst) { + String.prototype.ucfirst = function() { + var self = this; + return self.charAt(0).toUpperCase() + self.slice(1); + }; + } + return String.prototype.ucfirst; +}); +(function(definition) { + window.qoopido.register("polyfill/string/lcfirst", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!String.prototype.lcfirst) { + String.prototype.lcfirst = function() { + var self = this; + return self.charAt(0).toLowerCase() + self.slice(1); + }; + } + return String.prototype.lcfirst; +}); +(function(definition) { + window.qoopido.register("polyfill/window/promise", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var STATE_PENDING = void 0, STATE_SEALED = 0, STATE_FULFILLED = 1, STATE_REJECTED = 2, queue = []; + function addCallback(fn, arg) { + var length = queue.push([ fn, arg ]); + if (length === 1) { + scheduleFlushCallbacks(); + } + } + function scheduleFlushCallbacks() { + window.setTimeout(flushCallbacks, 1); + } + function flushCallbacks() { + var i = 0, tuple; + for (;(tuple = queue[i]) !== undefined; i++) { + tuple[0](tuple[1]); + } + queue.length = 0; + } + function handleThenable(promise, value) { + var then = null, resolved; + try { + if (promise === value) { + throw new TypeError("A promises callback cannot return that same promise."); + } + if (typeof value === "function" || typeof value === "object" && value !== null) { + then = value.then; + if (typeof then === "function") { + then.call(value, function(val) { + if (resolved) { + return true; + } + resolved = true; + if (value !== val) { + resolve(promise, val); + } else { + fulfill(promise, val); + } + }, function(val) { + if (resolved) { + return true; + } + resolved = true; + reject(promise, val); + }); + return true; + } + } + } catch (exception) { + if (resolved) { + return true; + } + reject(promise, exception); + return true; + } + return false; + } + function invokeResolver(resolver, promise) { + function resolvePromise(value) { + resolve(promise, value); + } + function rejectPromise(reason) { + reject(promise, reason); + } + try { + resolver(resolvePromise, rejectPromise); + } catch (exception) { + rejectPromise(exception); + } + } + function invokeCallback(settled, promise, callback, detail) { + var hasCallback = typeof callback === "function", value, error, succeeded, failed; + if (hasCallback) { + try { + value = callback(detail); + succeeded = true; + } catch (exception) { + failed = true; + error = exception; + } + } else { + value = detail; + succeeded = true; + } + if (handleThenable(promise, value)) { + return; + } else if (hasCallback && succeeded) { + resolve(promise, value); + } else if (failed) { + reject(promise, error); + } else if (settled === STATE_FULFILLED) { + resolve(promise, value); + } else if (settled === STATE_REJECTED) { + reject(promise, value); + } + } + function resolve(promise, value) { + if (promise === value) { + fulfill(promise, value); + } else if (!handleThenable(promise, value)) { + fulfill(promise, value); + } + } + function fulfill(promise, value) { + if (promise._state !== STATE_PENDING) { + return; + } + promise._state = STATE_SEALED; + promise._detail = value; + addCallback(publishFulfillment, promise); + } + function reject(promise, reason) { + if (promise._state !== STATE_PENDING) { + return; + } + promise._state = STATE_SEALED; + promise._detail = reason; + addCallback(publishRejection, promise); + } + function publishFulfillment(promise) { + publish(promise, promise._state = STATE_FULFILLED); + } + function publishRejection(promise) { + publish(promise, promise._state = STATE_REJECTED); + } + function subscribe(parent, child, onFulfillment, onRejection) { + var subscribers = parent._subscribers, length = subscribers.length; + subscribers[length] = child; + subscribers[length + STATE_FULFILLED] = onFulfillment; + subscribers[length + STATE_REJECTED] = onRejection; + } + function publish(promise, settled) { + var child, callback, subscribers = promise._subscribers, detail = promise._detail, i = 0; + for (;(child = subscribers[i]) !== undefined; i += 3) { + callback = subscribers[i + settled]; + invokeCallback(settled, child, callback, detail); + } + promise._subscribers = null; + } + function Promise(resolver) { + var self = this; + if (typeof resolver !== "function") { + throw new TypeError("You must pass a resolver function as the first argument to the promise constructor"); + } + self._subscribers = []; + invokeResolver(resolver, self); + } + Promise.prototype = { + _state: undefined, + _detail: undefined, + _subscribers: undefined, + then: function(onFulfilled, onRejected) { + var self = this, thenPromise = new Promise(function() {}); + if (self._state) { + addCallback(function invokePromiseCallback() { + invokeCallback(self._state, thenPromise, arguments[self._state - 1], self._detail); + }); + } else { + subscribe(self, thenPromise, onFulfilled, onRejected); + } + return thenPromise; + }, + "catch": function(onRejected) { + return this.then(null, onRejected); + } + }; + if (!window.Promise) { + window.Promise = Promise; + } + return window.Promise; +}); +(function(definition) { + var dependencies = []; + if (!window.Promise) { + dependencies.push("../polyfill/window/promise"); + } + window.qoopido.register("promise/all", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + return function all(promises) { + if (Object.prototype.toString.call(promises) !== "[object Array]") { + throw new TypeError("You must pass an array to all."); + } + return new window.Promise(function(resolve, reject) { + var results = [], remaining = promises.length, i = 0, promise; + if (remaining === 0) { + resolve([]); + } + function resolver(index) { + return function(value) { + resolveAll(index, value); + }; + } + function resolveAll(index, value) { + results[index] = value; + if (--remaining === 0) { + resolve(results); + } + } + for (;(promise = promises[i]) !== undefined; i++) { + if (promise && typeof promise.then === "function") { + promise.then(resolver(i), reject); + } else { + resolveAll(i, promise); + } + } + }); + }; +}); +(function(definition) { + var dependencies = []; + if (!window.Promise) { + dependencies.push("../polyfill/window/promise"); + } + window.qoopido.register("promise/defer", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + return function defer() { + var self = this; + self.promise = new window.Promise(function(resolve, reject) { + self.resolve = resolve; + self.reject = reject; + }); + }; +}); +(function(definition) { + window.qoopido.register("function/merge", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + return function merge() { + var target = arguments[0], i, properties, property, tgt, src; + for (i = 1; (properties = arguments[i]) !== undefined; i++) { + for (property in properties) { + tgt = target[property]; + src = properties[property]; + if (src !== undefined) { + if (src !== null && typeof src === "object") { + if (src.length !== undefined) { + tgt = tgt && typeof tgt === "object" && tgt.length !== undefined ? tgt : []; + } else { + tgt = tgt && typeof tgt === "object" && tgt.length === undefined ? tgt : {}; + } + target[property] = merge(tgt, src); + } else { + target[property] = src; + } + } + } + } + return target; + }; +}); +(function(definition) { + window.qoopido.register("function/unique/string", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var lookup = {}, characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""); + function generateString(length) { + var result = "", i = 0; + length = parseInt(length, 10) || 12; + for (;i < length; i++) { + result += characters[parseInt(Math.random() * (characters.length - 1), 10)]; + } + return result; + } + return function(length) { + var result; + do { + result = generateString(length); + } while (typeof lookup[result] !== "undefined"); + lookup[result] = true; + return result; + }; +}); +(function(definition) { + window.qoopido.register("function/unique/uuid", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var lookup = {}, regex = new RegExp("[xy]", "g"); + function generateUuid() { + return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(regex, function(c) { + var r = Math.random() * 16 | 0, v = c === "x" ? r : r & 3 | 8; + return v.toString(16); + }); + } + return function() { + var result; + do { + result = generateUuid(); + } while (typeof lookup[result] !== "undefined"); + lookup[result] = true; + return result; + }; +}); +(function(definition) { + window.qoopido.register("proxy", definition, [ "./base", "./function/unique/uuid" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + return modules["base"].extend({ + _constructor: function(context, fn) { + var args = Array.prototype.splice.call(arguments, 2), proxy = function() { + return fn.apply(context, Array.prototype.slice.call(arguments).concat(args)); + }; + proxy._quid = modules["function/unique/uuid"](); + return proxy; + } + }); +}); +(function(definition) { + var dependencies = [ "./base", "./promise/all", "./promise/defer" ]; + if (!String.prototype.ucfirst) { + dependencies.push("./polyfill/string/ucfirst"); + } + if (!String.prototype.lcfirst) { + dependencies.push("./polyfill/string/lcfirst"); + } + window.qoopido.registerSingleton("support", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var CombinedPromise = modules["promise/all"], DeferredPromise = modules["promise/defer"], matchPrefix = new RegExp("^(Moz|WebKit|Khtml|ms|O|Icab)(?=[A-Z])"), removeJsPrefix = new RegExp("^(?:webkit|khtml|icab|moz|ms|o)([A-Z])"), removeCssPrefix = new RegExp("^-(?:webkit|khtml|icab|moz|ms|o)-"), convertToCamelCase = new RegExp("-([a-z])", "gi"), convertToHyphens = new RegExp("([A-Z])", "g"), callbackUcfirst = function() { + return arguments[1].ucfirst(); + }, lookup = { + prefix: null, + method: {}, + property: {}, + css: {}, + promises: { + prefix: null, + method: {}, + property: {}, + css: {}, + test: {} + } + }; + function normalize(value) { + return value.replace(removeJsPrefix, "$1").lcfirst().replace(removeCssPrefix, "").replace(convertToCamelCase, callbackUcfirst); + } + return modules["base"].extend({ + test: {}, + pool: shared.pool && shared.pool.dom, + testMultiple: function() { + var test, tests = [], i = 0; + for (;(test = arguments[i]) !== undefined; i++) { + switch (typeof test) { + case "string": + tests.push(this.test[test]()); + break; + + case "boolean": + var deferred = new DeferredPromise(); + !!test ? deferred.resolve() : deferred.reject(); + tests.push(deferred.promise); + break; + + default: + tests.push(test); + break; + } + } + return new CombinedPromise(tests); + }, + getPrefix: function() { + var self = this, stored = lookup.prefix || null, property; + if (stored === null) { + var sample = self.pool ? self.pool.obtain("div") : document.createElement("div"), styles = sample.style; + stored = false; + for (property in styles) { + if (matchPrefix.test(property)) { + stored = property.match(matchPrefix)[0]; + } + } + if (stored === false && "WebkitOpacity" in styles) { + stored = "WebKit"; + } + if (stored === false && "KhtmlOpacity" in styles) { + stored = "Khtml"; + } + stored = lookup.prefix = stored === false ? false : [ stored.toLowerCase(), stored.toLowerCase().ucfirst(), stored ]; + sample.dispose && sample.dispose(); + } + return stored; + }, + getMethod: function(pMethod, pElement) { + pMethod = normalize(pMethod); + pElement = pElement || window; + var type = pElement.tagName, pointer = lookup.method[type] = lookup.method[type] || {}, stored = pointer[pMethod] = lookup.method[type][pMethod] || null; + if (stored === null) { + stored = false; + var candidates, candidate, i = 0, uMethod = pMethod.ucfirst(), prefixes = this.getPrefix(); + if (prefixes !== false) { + candidates = (pMethod + " " + uMethod + " " + prefixes.join(uMethod + " ") + uMethod).split(" "); + } else { + candidates = [ pMethod ]; + } + for (;(candidate = candidates[i]) !== undefined; i++) { + if (pElement[candidate] !== undefined && (typeof pElement[candidate] === "function" || typeof pElement[candidate] === "object")) { + stored = candidate; + break; + } + } + lookup.method[type][pMethod] = stored; + } + return stored; + }, + getProperty: function(pProperty, pElement) { + pProperty = normalize(pProperty); + pElement = pElement || window; + var type = pElement.tagName, pointer = lookup.property[type] = lookup.property[type] || {}, stored = pointer[pProperty] = lookup.property[type][pProperty] || null; + if (stored === null) { + stored = false; + var candidates, candidate, i = 0, uProperty = pProperty.ucfirst(), prefixes = this.getPrefix(); + if (prefixes !== false) { + candidates = (pProperty + " " + uProperty + " " + prefixes.join(uProperty + " ") + uProperty).split(" "); + } else { + candidates = [ pProperty ]; + } + for (i; (candidate = candidates[i]) !== undefined; i++) { + if (pElement[candidate] !== undefined) { + stored = candidate; + break; + } + } + lookup.property[type][pProperty] = stored; + } + return stored; + }, + getCssProperty: function(pProperty) { + pProperty = normalize(pProperty); + var self = this, stored = lookup.css[pProperty] || null; + if (stored === null) { + stored = false; + var candidate, i = 0, sample = self.pool ? self.pool.obtain("div") : document.createElement("div"), uProperty = pProperty.ucfirst(), prefixes = this.getPrefix() || [], candidates = (pProperty + " " + uProperty + " " + prefixes.join(uProperty + " ") + uProperty).split(" "), prefix = ""; + for (i; (candidate = candidates[i]) !== undefined; i++) { + if (sample.style[candidate] !== undefined) { + stored = candidate; + if (i > 0) { + prefix = "-"; + } + break; + } + } + stored = lookup.css[pProperty] = stored !== false ? [ prefix + stored.replace(convertToHyphens, "-$1").toLowerCase(), stored ] : false; + sample.dispose && sample.dispose(); + } + return stored; + }, + supportsPrefix: function() { + return !!this.getPrefix(); + }, + supportsMethod: function(pMethod, pElement) { + return !!this.getMethod(pMethod, pElement); + }, + supportsProperty: function(pProperty, pElement) { + return !!this.getProperty(pProperty, pElement); + }, + supportsCssProperty: function(pProperty) { + return !!this.getCssProperty(pProperty); + }, + testPrefix: function() { + var stored = lookup.promises.prefix; + if (stored === null) { + var deferred = new DeferredPromise(), prefix = this.getPrefix(); + !!prefix ? deferred.resolve(prefix) : deferred.reject(); + stored = lookup.promises.prefix = deferred.promise; + } + return stored; + }, + testMethod: function(pMethod, pElement) { + pElement = pElement || window; + var type = pElement.tagName, pointer = lookup.promises.method[type] = lookup.promises.method[type] || {}, stored = pointer[pMethod] = lookup.promises.method[type][pMethod] || null; + if (stored === null) { + var deferred = new DeferredPromise(), method = this.getMethod(pMethod, pElement); + !!method ? deferred.resolve(method) : deferred.reject(); + stored = lookup.promises.method[type][pMethod] = deferred.promise; + } + return stored; + }, + testProperty: function(pProperty, pElement) { + pElement = pElement || window; + var type = pElement.tagName, pointer = lookup.promises.property[type] = lookup.promises.property[type] || {}, stored = pointer[pProperty] = lookup.promises.property[type][pProperty] || null; + if (stored === null) { + var deferred = new DeferredPromise(), property = this.getProperty(pProperty, pElement); + !!property ? deferred.resolve(property) : deferred.reject(); + stored = lookup.promises.property[type][pProperty] = deferred.promise; + } + return stored; + }, + testCssProperty: function(pProperty) { + var stored = lookup.promises.css[pProperty] || null; + if (stored === null) { + var deferred = new DeferredPromise(), property = this.getCssProperty(pProperty); + !!property ? deferred.resolve(property) : deferred.reject(); + stored = lookup.promises.css[pProperty] = deferred.promise; + } + return stored; + }, + addTest: function(pId, pTest) { + return this.test[pId] = function() { + var stored = lookup.promises.test[pId] || null; + if (stored === null) { + var deferred = new DeferredPromise(), parameter = Array.prototype.slice.call(arguments); + parameter.splice(0, 0, deferred); + pTest.apply(null, parameter); + stored = lookup.promises.test[pId] = deferred.promise; + } + return stored; + }; + } + }); +}); +(function(definition) { + window.qoopido.register("support/capability/datauri", definition, [ "../../support", "../../dom/element" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var support = modules["support"]; + return support.addTest("/capability/datauri", function(deferred) { + var sample = modules["dom/element"].create(support.pool ? support.pool.obtain("img") : document.createElement("img")); + sample.one("error load", function(event) { + if (event.type === "load" && sample.element.width === 1 && sample.element.height === 1) { + deferred.resolve(); + } else { + deferred.reject(); + } + sample.element.dispose && sample.element.dispose(); + }, false).setAttribute("src", "data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="); + }); +}); +(function(definition) { + window.qoopido.register("support/element/canvas", definition, [ "../../support" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var support = modules["support"]; + return support.addTest("/element/canvas", function(deferred) { + var sample = support.pool ? support.pool.obtain("canvas") : document.createElement("canvas"); + sample.getContext && sample.getContext("2d") ? deferred.resolve() : deferred.reject(); + sample.dispose && sample.dispose(); + }); +}); +(function(definition) { + window.qoopido.register("support/element/canvas/todataurl", definition, [ "../../../support", "../canvas" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var support = modules["support"]; + return support.addTest("/element/canvas/todataurl", function(deferred) { + modules["support/element/canvas"]().then(function() { + var sample = support.pool ? support.pool.obtain("canvas") : document.createElement("canvas"); + sample.toDataURL !== undefined ? deferred.resolve() : deferred.reject(); + sample.dispose && sample.dispose(); + }, function() { + deferred.reject(); + }); + }); +}); +(function(definition) { + window.qoopido.register("support/element/canvas/todataurl/png", definition, [ "../../../../support", "../todataurl" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var support = modules["support"]; + return support.addTest("/element/canvas/todataurl/png", function(deferred) { + modules["support/element/canvas/todataurl"]().then(function() { + var sample = support.pool ? support.pool.obtain("canvas") : document.createElement("canvas"); + sample.toDataURL("image/png").indexOf("data:image/png") === 0 ? deferred.resolve() : deferred.reject(); + sample.dispose && sample.dispose(); + }, function() { + deferred.reject(); + }); + }); +}); +(function(definition) { + window.qoopido.registerSingleton("hook/event", definition, [ "../base" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + function transferProperties(event, originalEvent, properties) { + var i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + event[property] = originalEvent[property]; + } + event._properties = event._properties.concat(properties); + } + var hooks = { + general: { + properties: "type altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which path".split(" "), + process: function(event, originalEvent) { + var pointer; + event.originalEvent = originalEvent; + event.isDefaultPrevented = originalEvent.defaultPrevented ? true : false; + event.isPropagationStopped = originalEvent.cancelBubble ? true : false; + event.metaKey = originalEvent.metaKey && originalEvent.metaKey !== false ? true : false; + if (!event.target) { + event.target = originalEvent.srcElement || document; + } + if (event.target.nodeType === 3) { + event.target = event.target.parentNode; + } + if (!event.path) { + event.path = []; + pointer = event.target; + do { + event.path.push(pointer); + } while (pointer = pointer.parentNode); + event.path.push(window); + } + } + }, + mouse: { + regex: new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"), + properties: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement dataTransfer".split(" "), + process: function(event, originalEvent) { + var pointer, fromElement, which; + fromElement = originalEvent.fromElement; + which = originalEvent.button; + if (event.pageX === null && originalEvent.clientX !== null) { + pointer = event.target.ownerDocument || document; + pointer = pointer.documentElement || pointer.body; + event.pageX = originalEvent.clientX + (pointer.scrollLeft || 0) - (pointer.clientLeft || 0); + event.pageY = originalEvent.clientY + (pointer.scrollTop || 0) - (pointer.clientTop || 0); + } + if (!event.relatedTarget && fromElement) { + event.relatedTarget = fromElement === event.target ? originalEvent.toElement : fromElement; + } + if (!event.which && which !== undefined) { + event.which = which & 1 ? 1 : which & 2 ? 3 : which & 4 ? 2 : 0; + } + } + }, + key: { + regex: new RegExp("^(?:key)"), + properties: "char charCode key keyCode".split(" "), + process: function(event, originalEvent) { + if (event.which === null) { + event.which = originalEvent.charCode !== null ? originalEvent.charCode : originalEvent.keyCode; + } + } + } + }; + return modules["base"].extend({ + add: function(property, hook) { + if (property && hook && hooks[property]) { + hooks[property] = hook; + } + return this; + }, + get: function(property) { + if (property && hooks[property]) { + return hooks[property]; + } + return null; + }, + process: function(event, originalEvent) { + var id, hook, isMatch; + for (id in hooks) { + hook = hooks[id]; + isMatch = !hook.regex || hook.regex.test(originalEvent.type); + if (isMatch) { + if (hook.properties) { + transferProperties(event, originalEvent, hook.properties); + } + if (hook.process) { + hook.process(event, originalEvent); + } + if (hook.delegate) { + event.delegate = hook.delegate; + } + } + } + } + }); +}); +(function(definition) { + var dependencies = [ "../base", "../support" ]; + if (!window.getComputedStyle) { + dependencies.push("../polyfill/window/getcomputedstyle"); + } + window.qoopido.registerSingleton("hook/css", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var mSupport = modules["support"], getComputedStyle = window.getComputedStyle || modules["polyfill/window/getcomputedstyle"], hooks = { + general: { + get: function(element, property) { + return getComputedStyle(element, null).getPropertyValue(property[0]); + }, + set: function(element, property, value) { + element.style[property[1]] = value; + } + }, + opacity: !mSupport.supportsCssProperty("opacity") ? { + regex: new RegExp("alpha\\(opacity=(.*)\\)", "i"), + get: function(element, property, value) { + value = getComputedStyle(element, null).getPropertyValue("filter").toString().match(this.regex); + if (value) { + value = value[1] / 100; + } else { + value = 1; + } + return value; + }, + set: function(element, property, value) { + var style = element.style; + style.zoom = 1; + style.filter = "alpha(opacity=" + (value * 100 + .5 >> 0) + ")"; + } + } : null + }; + return modules["base"].extend({ + add: function(property, hook) { + if (property && hook && hooks[property]) { + hooks[property] = hook; + } + return this; + }, + get: function(property) { + if (property && hooks[property]) { + return hooks[property]; + } + return null; + }, + process: function(method, element, property, value) { + var hook; + property = mSupport.getCssProperty(property, element) || null; + if (property) { + return ((hook = this.get(property[1])) && hook[method] || this.get("general")[method])(element, property, value); + } + } + }); +}); +(function(definition) { + window.qoopido.register("dom/event", definition, [ "../base", "../hook/event" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var hooks = modules["hook/event"]; + return modules["base"].extend({ + originalEvent: null, + isDelegate: false, + isDefaultPrevented: false, + isPropagationStopped: false, + isImmediatePropagationStopped: false, + _properties: null, + _constructor: function(event) { + var self = this; + self._properties = []; + self._obtain(event); + return self; + }, + _obtain: function(event) { + hooks.process(this, event); + }, + _dispose: function() { + var self = this, i = 0, property; + for (;(property = self._properties[i]) !== undefined; i++) { + delete self[property]; + } + delete self.delegate; + self.originalEvent = null; + self.isDelegate = false; + self.isDefaultPrevented = false; + self.isPropagationStopped = false; + self.isImmediatePropagationStopped = false; + self._properties.length = 0; + }, + preventDefault: function() { + var self = this, event = self.originalEvent; + if (event.cancelable !== false) { + self.isDefaultPrevented = true; + if (event.preventDefault) { + event.preventDefault(); + } else { + event.returnValue = false; + } + } + }, + stopPropagation: function() { + var self = this, event = self.originalEvent; + self.isPropagationStopped = true; + if (event.stopPropagation) { + event.stopPropagation(); + } + event.cancelBubble = true; + }, + stopImmediatePropagation: function() { + var self = this, event = self.originalEvent; + self.isImmediatePropagationStopped = true; + if (event.stopImmediatePropagation) { + event.stopImmediatePropagation(); + } + self.stopPropagation(); + } + }); +}); +(function(definition) { + var dependencies = [ "../base", "../function/unique/uuid", "../hook/css", "./event" ]; + if (!window.CustomEvent) { + dependencies.push("../polyfill/window/customevent"); + } + if (!window.addEventListener) { + dependencies.push("../polyfill/window/addeventlistener"); + } + if (!window.removeEventListener) { + dependencies.push("../polyfill/window/removeeventlistener"); + } + if (!window.dispatchEvent) { + dependencies.push("../polyfill/window/dispatchevent"); + } + if (!Element.prototype.matches) { + dependencies.push("../polyfill/element/matches"); + } + if (!document.querySelector) { + dependencies.push("../polyfill/document/queryselector"); + } + if (!document.querySelectorAll) { + dependencies.push("../polyfill/document/queryselectorall"); + } + if (!String.prototype.trim) { + dependencies.push("../polyfill/string/trim"); + } + window.qoopido.register("dom/element", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var stringObject = "object", stringString = "string", generateUuid = modules["function/unique/uuid"], head = document.getElementsByTagName("head")[0], contentAttribute = "textContent" in document.createElement("a") ? "textContent" : "innerText", previousSibling = typeof head.previousElementSibling !== "undefined" ? function previousSibling() { + return this.previousElementSibling; + } : function previousSibling() { + var element = this; + while (element = element.previousSibling) { + if (element.nodeType === 1) { + return element; + } + } + }, nextSibling = typeof head.nextElementSibling !== "undefined" ? function nextSibling() { + return this.nextElementSibling; + } : function nextSibling() { + var element = this; + while (element = element.nextSibling) { + if (element.nodeType === 1) { + return element; + } + } + }, isTag = new RegExp("^<(\\w+)\\s*/>$"), matchEvent = new RegExp("^[^-]+"), splitList = new RegExp(" +", "g"), pool = modules["pool/module"] && modules["pool/module"].create(modules["dom/event"], null, true) || null, hooks = modules["hook/css"], storage = {}, events = { + custom: { + type: "CustomEvent", + method: "initCustomEvent" + }, + html: { + regex: new RegExp("^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$"), + type: "HTMLEvents", + method: "initEvent" + }, + mouse: { + regex: new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"), + type: "MouseEvents", + method: "initMouseEvent" + } + }; + function resolveEvent(type) { + var id, prototype, candidate; + for (id in events) { + prototype = events[id]; + if (!prototype.regex || prototype.regex.test(type)) { + candidate = prototype; + } + } + return candidate; + } + function emitEvent(type, detail, uuid) { + var self = this, prototype = resolveEvent(type), event = document.createEvent(prototype.type); + event[prototype.method](type, type === "load" ? false : true, true, detail); + if (uuid) { + event._quid = uuid; + event.isDelegate = true; + } + self.element.dispatchEvent(event); + } + function resolveElement(element) { + var tag; + if (typeof element === "string") { + try { + if (isTag.test(element) === true) { + tag = element.replace(isTag, "$1").toLowerCase(); + element = document.createElement(tag); + } else { + element = document.querySelector(element); + } + } catch (exception) { + element = null; + } + } + if (!element) { + throw new Error("[Qoopido.js] Element could not be resolved"); + } + return element; + } + function resolveArguments(parameters) { + return Array.prototype.concat.apply([], Array.prototype.splice.call(parameters, 0)).join(" ").split(splitList); + } + function matchesDelegate(event, delegate) { + var i = 0, pointer; + for (;(pointer = event.path[i]) !== undefined; i++) { + if (pointer.matches(delegate)) { + event.currentTarget = pointer; + return true; + } + if (pointer === event.currentTarget) { + break; + } + } + return false; + } + return modules["base"].extend({ + type: null, + element: null, + _listener: null, + _constructor: function(element, attributes, styles) { + var self = this, uuid; + element = resolveElement(element); + uuid = element._quid; + if (!uuid) { + uuid = element._quid = generateUuid(); + self.type = element.tagName; + self.element = element; + self._listener = {}; + storage[uuid] = self; + } else { + self = storage[uuid]; + } + if (typeof attributes === "object" && attributes !== null) { + self.setAttributes(attributes); + } + if (typeof styles === "object" && styles !== null) { + self.setStyles(styles); + } + if (self !== this) { + this.dispose && this.dispose(); + } + return self; + }, + _obtain: function(element, attributes, styles) { + this._constructor(element, attributes, styles); + }, + _dispose: function() { + var self = this, id, event; + for (id in self._listener) { + event = id.match(matchEvent); + self.element.removeEventListener(event, self._listener[id]); + delete self._listener[id]; + } + self.type = null; + self.element = null; + }, + getContent: function(html) { + var element = this.element; + return html && html !== false ? element.innerHTML : element[contentAttribute]; + }, + setContent: function(content, html) { + var self = this, element = self.element; + if (html && html !== false) { + element.innerHTML = content; + } else { + element[contentAttribute] = content; + } + return self; + }, + getAttribute: function(attribute) { + var self = this; + if (attribute && typeof attribute === stringString) { + return self.element.getAttribute(attribute); + } + }, + getAttributes: function() { + var self = this, result = {}, attributes = resolveArguments(arguments), i = 0, attribute; + for (;(attribute = attributes[i]) !== undefined; i++) { + result[attribute] = self.element.getAttribute(attribute); + } + return result; + }, + setAttribute: function(attribute, value) { + var self = this; + if (attribute && typeof attribute === stringString) { + self.element.setAttribute(attribute, value); + } + return self; + }, + setAttributes: function(attributes) { + var self = this, attribute; + if (attributes && typeof attributes === stringObject && !attributes.length) { + for (attribute in attributes) { + self.element.setAttribute(attribute, attributes[attribute]); + } + } + return self; + }, + removeAttribute: function(attribute) { + var self = this; + if (attribute && typeof attribute === stringString) { + self.element.removeAttribute(attribute); + } + return self; + }, + removeAttributes: function() { + var self = this, attributes = resolveArguments(arguments), i = 0, attribute; + for (;(attribute = attributes[i]) !== undefined; i++) { + self.element.removeAttribute(attribute); + } + return self; + }, + getStyle: function(property) { + var self = this; + if (property && typeof property === stringString) { + return hooks.process("get", self.element, property); + } + }, + getStyles: function() { + var self = this, result = {}, properties = resolveArguments(arguments), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + result[property] = hooks.process("get", self.element, property); + } + return result; + }, + setStyle: function(property, value) { + var self = this; + if (property && typeof property === stringString) { + hooks.process("set", self.element, property, value); + } + return self; + }, + setStyles: function(properties) { + var self = this, property; + if (properties && typeof properties === stringObject && !properties.length) { + for (property in properties) { + hooks.process("set", self.element, property, properties[property]); + } + } + return self; + }, + removeStyle: function(property) { + var self = this; + if (property && typeof property === stringString) { + self.setStyle(property, ""); + } + return self; + }, + removeStyles: function() { + var self = this, properties = resolveArguments(arguments), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + self.setStyle(property, ""); + } + return self; + }, + siblings: function(selector) { + var element = this.element, pointer = element.parentNode.firstChild, siblings = []; + for (;pointer; pointer = nextSibling.call(pointer)) { + if (pointer !== element && (!selector || pointer.matches(selector))) { + siblings.push(pointer); + } + } + return siblings; + }, + siblingsBefore: function(selector) { + var pointer = this.element.previousSibling, siblings = []; + for (;pointer; pointer = previousSibling.call(pointer)) { + if (!selector || pointer.matches(selector)) { + siblings.push(pointer); + } + } + return siblings; + }, + siblingsAfter: function(selector) { + var pointer = this.element.nextSibling, siblings = []; + for (;pointer; pointer = nextSibling.call(pointer)) { + if (!selector || pointer.matches(selector)) { + siblings.push(pointer); + } + } + return siblings; + }, + previous: function(selector) { + var pointer = previousSibling.call(this.element); + if (!selector) { + return pointer; + } else { + for (;pointer; pointer = previousSibling.call(pointer)) { + if (pointer.matches(selector)) { + return pointer; + } + } + } + }, + next: function(selector) { + var pointer = nextSibling.call(this.element); + if (!selector) { + return pointer; + } else { + for (;pointer; pointer = nextSibling.call(pointer)) { + if (pointer.matches(selector)) { + return pointer; + } + } + } + }, + find: function(selector) { + var self = this.element, uuid, matches; + selector = selector.trim(); + if (selector.charAt(0) === ">") { + uuid = self._quid; + self.setAttribute("data-quid", uuid); + selector = '[data-quid="' + uuid + '"] ' + selector; + matches = self.parentNode.querySelectorAll(selector); + self.removeAttribute("data-quid"); + } else { + matches = self.querySelectorAll(selector); + } + return matches; + }, + parent: function(selector) { + var pointer; + if (!selector) { + return this.element.parentNode; + } else { + pointer = this.element; + for (;pointer; pointer = pointer.parentNode) { + if (pointer.matches(selector)) { + return pointer; + } + } + } + }, + parents: function(selector) { + var pointer = this.element.parentNode, parents = []; + for (;pointer; pointer = pointer.parentNode) { + if (pointer.nodeType === 9) { + return parents; + } else if (pointer.nodeType === 1) { + if (!selector || pointer.matches(selector)) { + parents.push(pointer); + } + } + } + }, + isVisible: function() { + var self = this, element = self.element; + return !(element.offsetWidth <= 0 && element.offsetHeight <= 0 || self.getStyle("visibility") === "hidden" || self.getStyle("opacity") <= 0); + }, + hasClass: function(name) { + return name ? new RegExp("(?:^|\\s)" + name + "(?:\\s|$)").test(this.element.className) : false; + }, + addClass: function(name) { + var self = this; + if (name && !self.hasClass(name)) { + self.element.className += self.element.className ? " " + name : name; + } + return self; + }, + removeClass: function(name) { + var self = this; + if (name && self.hasClass(name)) { + self.element.className = self.element.className.replace(new RegExp("(?:^|\\s)" + name + "(?!\\S)"), ""); + } + return self; + }, + toggleClass: function(name) { + var self = this; + if (name) { + self.hasClass(name) ? self.removeClass(name) : self.addClass(name); + } + return self; + }, + prepend: function(element) { + var self = this, target = self.element; + if (element) { + try { + element = element.element || resolveElement(element); + target.firstChild ? target.insertBefore(element, target.firstChild) : self.append(element); + } catch (exception) { + target.insertAdjacentHTML("afterBegin", element); + } + } + return self; + }, + append: function(element) { + var self = this, target = self.element; + if (element) { + try { + target.appendChild(element.element || resolveElement(element)); + } catch (exception) { + target.insertAdjacentHTML("beforeEnd", element); + } + } + return self; + }, + prependTo: function(target) { + var self = this, element = self.element; + if (target) { + (target = target.element || resolveElement(target)).firstChild ? target.insertBefore(element, target.firstChild) : self.appendTo(target); + } + return self; + }, + appendTo: function(target) { + var self = this; + if (target) { + (target.element || resolveElement(target)).appendChild(self.element); + } + return self; + }, + insertBefore: function(target) { + var self = this, element = self.element; + if (target) { + (target = target.element || resolveElement(target)).parentNode.insertBefore(element, target); + } + return self; + }, + insertAfter: function(target) { + var self = this, element = self.element; + if (target) { + (target = target.element || resolveElement(target)).nextSibling ? target.parentNode.insertBefore(element, target.nextSibling) : self.appendTo(target.parentNode); + } + return self; + }, + replace: function(target) { + var self = this, element = self.element; + if (target) { + (target = target.element || resolveElement(target)).parentNode.replaceChild(element, target); + } + return self; + }, + replaceWith: function(element) { + var self = this, target = self.element; + if (element) { + element = element.element || resolveElement(element); + target.parentNode.replaceChild(element, target); + } + return self; + }, + remove: function() { + var self = this, element = self.element; + element.parentNode.removeChild(element); + return self; + }, + on: function(events) { + var self = this, element = self.element, delegate = arguments.length > 2 ? arguments[1] : null, fn = arguments.length > 2 ? arguments[2] : arguments[1], uuid = fn._quid || (fn._quid = generateUuid()), i = 0, event; + events = events.split(" "); + for (;(event = events[i]) !== undefined; i++) { + var id = event + "-" + uuid, listener = function(event) { + var delegateTo; + event = pool && pool.obtain(event) || modules["dom/event"].create(event); + if (!event.isPropagationStopped) { + delegateTo = event.delegate; + event._quid = generateUuid(); + if (!delegate || matchesDelegate(event, delegate)) { + fn.call(event.currentTarget, event, event.originalEvent.detail); + } + if (delegateTo) { + delete event.delegate; + emitEvent.call(self, delegateTo); + } + } + event.dispose && event.dispose(); + }; + listener.type = event; + self._listener[id] = listener; + element.addEventListener(event, listener); + } + return self; + }, + one: function(events) { + var self = this, delegate = arguments.length > 3 || typeof arguments[1] === "string" ? arguments[1] : null, fn = arguments.length > 3 || typeof arguments[2] === "function" ? arguments[2] : arguments[1], each = (arguments.length > 3 ? arguments[3] : arguments[2]) !== false, listener = function(event) { + self.off(each === true ? event.type : events, listener); + fn.call(this, event, event.originalEvent.detail); + }; + fn._quid = listener._quid = generateUuid(); + if (delegate) { + self.on(events, delegate, listener); + } else { + self.on(events, listener); + } + return self; + }, + off: function(events, fn) { + var self = this, element = self.element, i = 0, event, id, listener; + events = events.split(" "); + for (;(event = events[i]) !== undefined; i++) { + id = fn._quid && event + "-" + fn._quid || null; + listener = id && self._listener[id] || null; + if (listener) { + element.removeEventListener(event, listener); + delete self._listener[id]; + } else { + element.removeEventListener(event, fn); + } + } + return self; + }, + emit: function(event, data) { + var self = this; + emitEvent.call(self, event, data); + return self; + } + }); +}); +(function(definition) { + window.qoopido.registerSingleton("url", definition, [ "./base" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var urlCurrent, regexLocal, regexParameter = new RegExp("[?&]?([^=]+)=([^&]*)", "g"); + try { + urlCurrent = location; + } catch (exception) { + urlCurrent = getResolver(); + } + regexLocal = new RegExp("".concat("^", urlCurrent.protocol, "//", urlCurrent.hostname), "i"); + function getResolver(url) { + var resolver = document.createElement("a"); + resolver.href = url || ""; + return resolver; + } + return modules["base"].extend({ + resolve: function(url) { + return getResolver(url).href; + }, + redirect: function redirect(url, target) { + target = target || window; + target.location.href = this.resolve(url); + }, + getParameter: function(url) { + var params = {}, querystring = getResolver(url).search.split("+").join(" "), tokens; + while (tokens = regexParameter.exec(querystring)) { + params[decodeURIComponent(tokens[1])] = decodeURIComponent(tokens[2]); + } + return params; + }, + isLocal: function(url) { + return regexLocal.test(this.resolve(url)); + } + }); +}); +(function(definition) { + window.qoopido.register("transport", definition, [ "./base", "./function/merge" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var prototype; + prototype = modules["base"].extend({ + setup: function(options) { + var self = this; + self._settings = modules["function/merge"]({}, self._settings, options); + return self; + }, + serialize: function(obj, prefix) { + var parameter = [], id, key, value; + for (id in obj) { + key = prefix ? "".concat(prefix, "[", id, "]") : id; + value = obj[id]; + parameter.push(typeof value === "object" ? this.serialize(value, key) : "".concat(encodeURIComponent(key), "=", encodeURIComponent(value))); + } + return parameter.join("&"); + } + }); + return prototype; +}, window, document); +(function(definition) { + window.qoopido.registerSingleton("transport/xhr", definition, [ "../transport", "../function/merge", "../function/unique/string", "../url", "../promise/defer" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var prototype, DeferredPromise = modules["promise/defer"], getXhr = typeof window.XMLHttpRequest !== "undefined" ? function(url) { + if (modules["url"].isLocal(url)) { + return new window.XMLHttpRequest(); + } else { + return window.XDomainRequest ? new window.XDomainRequest() : new window.XMLHttpRequest(); + } + } : function() { + try { + return new ActiveXObject("MSXML2.XMLHTTP.3.0"); + } catch (exception) { + return null; + } + }; + function sendRequest(method, url, content) { + var self = this, xhr = self.xhr, settings = self.settings, id; + url = settings.cache === false ? "".concat(url, url.indexOf("?") > -1 ? "&" : "?", "_=" + new Date().getTime()) : url; + url = content && method === "GET" ? "".concat(url, url.indexOf("?") > -1 ? "&" : "?", content) : url; + for (id in settings.xhrOptions) { + xhr[id] = settings.xhrOptions[id]; + } + xhr.open(method, url, settings.async, settings.username, settings.password); + if (xhr.setRequestHeader) { + xhr.setRequestHeader("Accept", settings.accept); + if (content && method !== "GET") { + xhr.setRequestHeader("Content-Type", settings.contentType); + } + for (id in settings.header) { + xhr.setRequestHeader(id, settings.header[id]); + } + } + xhr.timeout = settings.timeout; + xhr.onprogress = function(event) { + onProgress.call(self, event); + }; + xhr.onreadystatechange = xhr.onload = function() { + onReadyStateChange.call(self); + }; + xhr.onerror = function() { + onError.call(self); + }; + xhr.send(content || null); + self.timeout = setTimeout(function() { + onTimeout.call(self); + }, settings.timeout); + } + function onProgress(event) { + var self = this; + if (self.timeout) { + clearTimeout(self.timeout); + } + self.timeout = setTimeout(function() { + onTimeout.call(self); + }, self.settings.timeout); + } + function onReadyStateChange() { + var self = this, xhr = self.xhr, dfd = self.dfd; + if (xhr.readyState === undefined || xhr.readyState === 4) { + clear.call(self); + if (xhr.status === undefined || xhr.status === 200) { + dfd.resolve({ + data: xhr.responseText, + xhr: xhr + }); + } else { + dfd.reject({ + status: xhr.status, + xhr: xhr + }); + } + } + } + function onError() { + var self = this; + clear.call(self); + self.dfd.reject(); + } + function onTimeout() { + var self = this; + self.xhr.abort(); + clear.call(self); + self.dfd.reject(); + } + function clear() { + var self = this, xhr = self.xhr; + if (self.timeout) { + clearTimeout(self.timeout); + } + xhr.onprogress = xhr.onreadystatechange = xhr.onerror = null; + } + prototype = modules["transport"].extend({ + _settings: { + accept: "*/*", + timeout: 5e3, + async: true, + cache: false, + header: {}, + username: null, + password: null, + contentType: "application/x-www-form-urlencoded; charset=UTF-8 ", + xhrOptions: {} + }, + load: function(method, url, data, options) { + var context = {}; + url = modules["url"].resolve(url); + context.url = url; + context.id = "".concat("xhr-", modules["function/unique/string"]()); + context.dfd = new DeferredPromise(); + context.xhr = getXhr(url); + context.settings = modules["function/merge"]({}, this._settings, options); + context.timeout = null; + sendRequest.call(context, method.toUpperCase(), url, data); + return context.dfd.promise; + }, + get: function(url, data, options) { + return this.load("GET", url, data, options); + }, + post: function(url, data, options) { + return this.load("POST", url, data, options); + }, + put: function(url, data, options) { + return this.load("PUT", url, data, options); + }, + "delete": function(url, data, options) { + return this.load("DELETE", url, data, options); + }, + head: function(url, data, options) { + return this.load("HEAD", url, data, options); + } + }); + return prototype; +}, window, document); +(function(definition) { + var dependencies = [ "../element", "../../proxy", "../../function/merge", "../../url", "../../support", "../../support/capability/datauri", "../../support/element/canvas/todataurl/png", "../../transport/xhr" ]; + window.qoopido.register("dom/element/shrinkimage", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var JSON = window.JSON, name = namespace.pop(), defaults = { + attribute: "data-" + name, + quality: 80, + debug: false + }, pool = shared.pool && shared.pool.dom || null, lookup = {}, regexBackground = new RegExp('^url\\x28"{0,1}data:image/shrink,(.+?)"{0,1}\\x29$', "i"), regexPath = new RegExp('^(?:url\\x28"{0,1}|)(?:data:image/shrink,|)(.+?)(?:"{0,1}\\x29|)$', "i"), regexSuffix = new RegExp("\\.png$", "i"), supported = modules["support"].testMultiple("/capability/datauri", "/element/canvas/todataurl/png"), prototype, loader, EVENT_QUEUED = "queued", EVENT_CACHED = "cached", EVENT_LOADED = "loaded", EVENT_FAILED = "failed", EVENT_STATE = "".concat(EVENT_LOADED, " ", EVENT_FAILED), DOM_LOAD = "load", DOM_ERROR = "error", DOM_STATE = "".concat(DOM_LOAD, " ", DOM_ERROR); + function processMain(url, isBackground) { + url = modules["url"].resolve(regexPath.exec(url)[1]); + isBackground = isBackground === true; + var self = this, settings = modules["function/merge"]({}, self._settings, modules["url"].getParameter(url)), target = settings.target || (url = url.split("?")[0]).replace(regexSuffix, "".concat(".q", settings.quality, ".shrunk")); + if (!isBackground) { + self.removeAttribute(self._settings.attribute).hide(); + } + supported.then(function() { + if (settings.debug === true) { + throw new Error("[Qoopido.js] Debug enabled"); + } + switch (typeof lookup[target]) { + case "object": + lookup[target].one(EVENT_LOADED, function(event) { + assign.call(self, event.data, isBackground); + }); + self.emit(EVENT_QUEUED); + break; + + case "string": + assign.call(self, lookup[target], isBackground); + break; + + default: + lookup[target] = loader.create(target, !isBackground ? self.element : null).one(EVENT_STATE, function(event, data) { + if (event.type === EVENT_LOADED) { + lookup[target] = data; + self.emit(EVENT_CACHED); + assign.call(self, data, isBackground); + } else { + lookup[target] = url; + assign.call(self, url, isBackground); + } + }, false); + break; + } + })["catch"](function() { + lookup[target] = url; + assign.call(self, url, isBackground); + }); + } + function assign(source, isBackground) { + var self = this; + if (isBackground) { + self.setStyle("backgroundImage", "url(" + source + ")"); + self.emit(EVENT_LOADED); + } else { + self.one(DOM_LOAD, function() { + self.show(); + self.emit(EVENT_LOADED); + }).setAttribute("src", source); + } + } + function processTransport(transport) { + var self = this; + transport.get(self._url).then(function(response) { + try { + var data = JSON.parse(response.data); + data.width = parseInt(data.width, 10); + data.height = parseInt(data.height, 10); + processData.call(self, data); + } catch (exception) { + self.emit(EVENT_FAILED); + } + }, function() { + self.emit(EVENT_FAILED); + }); + } + function processData(data) { + var canvas, context, self = this, onLoadMain = function(event) { + canvas = pool && pool.obtain("canvas") || document.createElement("canvas"); + canvas.style.display = "none"; + canvas.width = data.width; + canvas.height = data.height; + context = canvas.getContext("2d"); + context.clearRect(0, 0, data.width, data.height); + context.drawImage(self.element, 0, 0, data.width, data.height); + self.one(DOM_LOAD, onLoadAlpha).setAttribute("src", data.alpha); + return suppressEvent(event); + }, onLoadAlpha = function(event) { + var result; + context.globalCompositeOperation = "xor"; + context.drawImage(self.element, 0, 0, data.width, data.height); + result = canvas.toDataURL("image/png"); + dispose(); + self.emit(EVENT_LOADED, result); + return suppressEvent(event); + }, dispose = function() { + if (canvas) { + canvas.dispose && canvas.dispose(); + } + self.element.dispose && self.element.dispose(); + }; + self.one(DOM_STATE, function(event) { + if (event.type === DOM_LOAD) { + onLoadMain.call(this, event); + } else { + dispose(); + self.emit(EVENT_FAILED); + } + }, false).setAttribute("src", data.main); + } + function suppressEvent(event) { + event.preventDefault(); + event.stopPropagation(); + return false; + } + prototype = modules["dom/element"].extend({ + _constructor: function(element, settings) { + var self = prototype._parent._constructor.call(this, element), foreground, background; + self._settings = settings = modules["function/merge"]({}, defaults, settings); + foreground = self.getAttribute(settings.attribute); + background = self.getStyle("backgroundImage"); + if (self.type === "IMG") { + processMain.call(self, foreground); + } + if (background !== "none" && regexBackground.test(background)) { + processMain.call(self, background, true); + } + return self; + }, + hide: function() { + this.setStyles({ + visibility: "hidden", + opacity: 0 + }); + }, + show: function() { + this.setStyles({ + visibility: "", + opacity: "" + }); + } + }); + loader = modules["dom/element"].extend({ + _url: null, + _constructor: function(url, element) { + var self; + if (!element) { + element = pool && pool.obtain("img") || document.createElement("img"); + } + self = loader._parent._constructor.call(this, element); + self._url = url; + processTransport.call(self, modules["transport/xhr"]); + return self; + } + }); + return prototype; +}, window); \ No newline at end of file diff --git a/dist/3.7.3/max/packages/qoopido.shrinkimage.legacy.js b/dist/3.7.3/max/packages/qoopido.shrinkimage.legacy.js new file mode 100644 index 00000000..0249fb66 --- /dev/null +++ b/dist/3.7.3/max/packages/qoopido.shrinkimage.legacy.js @@ -0,0 +1,1985 @@ +/*! +* Qoopido.js library +* +* version: 3.7.3 +* date: 2015-08-05 +* author: Dirk Lueth +* website: https://github.com/dlueth/qoopido.js +* +* Copyright (c) 2015 Dirk Lueth +*/ +(function(definition, qoopido) { + if (qoopido.register) { + qoopido.register("polyfill/object/defineproperty", definition); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/defineproperty"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.defineProperty || !function() { + try { + Object.defineProperty({}, "x", {}); + return true; + } catch (exception) { + return false; + } + }()) { + var defineProperty = Object.defineProperty, defineGetter = Object.prototype.__defineGetter__, defineSetter = Object.prototype.__defineSetter__; + Object.defineProperty = function(obj, prop, desc) { + if (defineProperty) { + try { + return defineProperty(obj, prop, desc); + } catch (exception) {} + } + if (obj !== Object(obj)) { + throw new TypeError("Object.defineProperty called on non-object"); + } + if (defineGetter && "get" in desc) { + defineGetter.call(obj, prop, desc.get); + } + if (defineSetter && "set" in desc) { + defineSetter.call(obj, prop, desc.set); + } + if ("value" in desc) { + obj[prop] = desc.value; + } + return obj; + }; + } + return Object.defineProperty; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + var dependencies = []; + if (!Object.defineProperty || !function() { + try { + Object.defineProperty({}, "x", {}); + return true; + } catch (exception) { + return false; + } + }()) { + dependencies.push("./defineproperty"); + } + qoopido.register("polyfill/object/defineproperties", definition, dependencies); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/defineproperties"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.defineProperties) { + Object.defineProperties = function(obj, properties) { + if (obj !== Object(obj)) { + throw new TypeError("Object.defineProperties called on non-object"); + } + var name; + for (name in properties) { + if (Object.prototype.hasOwnProperty.call(properties, name)) { + Object.defineProperty(obj, name, properties[name]); + } + } + return obj; + }; + } + return Object.defineProperties; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + var dependencies = []; + if (!Object.defineProperties) { + dependencies.push("./defineproperties"); + } + qoopido.register("polyfill/object/create", definition, dependencies); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/create"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.create) { + Object.create = function(prototype, properties) { + if (typeof prototype !== "object") { + throw new TypeError(); + } + function Constructor() {} + Constructor.prototype = prototype; + var obj = new Constructor(); + if (prototype) { + obj.constructor = Constructor; + } + if (arguments.length > 1) { + if (properties !== Object(properties)) { + throw new TypeError(); + } + Object.defineProperties(obj, properties); + } + return obj; + }; + } + return Object.create; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + qoopido.register("polyfill/object/getownpropertynames", definition); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/getownpropertynames"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.getOwnPropertyNames) { + Object.getOwnPropertyNames = function(obj) { + if (obj !== Object(obj)) { + throw new TypeError("Object.getOwnPropertyNames called on non-object"); + } + var props = [], p; + for (p in obj) { + if (Object.prototype.hasOwnProperty.call(obj, p)) { + props.push(p); + } + } + return props; + }; + } + return Object.getOwnPropertyNames; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + qoopido.register("polyfill/object/getownpropertydescriptor", definition); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/getownpropertydescriptor"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.getOwnPropertyDescriptor || !function() { + try { + Object.getOwnPropertyDescriptor({ + x: 0 + }, "x"); + return true; + } catch (exception) { + return false; + } + }()) { + var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; + Object.getOwnPropertyDescriptor = function(obj, property) { + if (obj !== Object(obj)) { + throw new TypeError(); + } + try { + return getOwnPropertyDescriptor.call(Object, obj, property); + } catch (exception) {} + if (Object.prototype.hasOwnProperty.call(obj, property)) { + return { + value: obj[property], + enumerable: true, + writable: true, + configurable: true + }; + } + }; + } + return Object.getOwnPropertyDescriptor; +}, window.qoopido = window.qoopido || {}); +(function(definition, navigator, global, document, undefined) { + "use strict"; + function register(id, definition, dependencies, callback) { + var namespace = id.split("/"), initialize; + if (modules[id]) { + return modules[id]; + } + initialize = function() { + if (dependencies) { + var path = namespace.slice(0, -1).join("/"), i = 0, dependency, internal; + for (;(dependency = dependencies[i]) !== undefined; i++) { + internal = isInternal.test(dependency); + if (internal) { + dependency = canonicalize(path + "/" + dependency); + } + if (!modules[dependency] && arguments[i]) { + modules[dependency] = arguments[i]; + } + if (internal && !modules[dependency] && typeof console !== "undefined") { + console.error("".concat("[Qoopido.js] ", id, ": Could not load dependency ", dependency)); + } + } + } + modules[id] = definition(modules, shared, namespace, navigator, global, document, undefined); + if (callback) { + callback(modules[id]); + } + return modules[id]; + }; + if (typeof module !== "undefined" && module.exports) { + module.exports = define(initialize); + } else if (typeof define === "function" && define.amd) { + dependencies ? define(dependencies, initialize) : define(initialize); + } else { + initialize(); + } + } + function registerSingleton(id, definition, dependencies) { + register(id, definition, dependencies, function(module) { + modules[id] = module.create(); + }); + } + var qoopido = global.qoopido || (global.qoopido = {}), shared = qoopido.shared || (qoopido.shared = {}), modules = qoopido.modules || (qoopido.modules = {}), dependencies = [], isInternal = new RegExp("^\\.+\\/"), regexCanonicalize = new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."), removeNeutral = new RegExp("(^\\/)|\\.\\/", "g"); + qoopido.register = register; + qoopido.registerSingleton = registerSingleton; + function canonicalize(path) { + var collapsed; + while ((collapsed = path.replace(regexCanonicalize, "")) !== path) { + path = collapsed; + } + return path.replace(removeNeutral, ""); + } + if (!Object.create) { + dependencies.push("./polyfill/object/create"); + } + if (!Object.getOwnPropertyNames) { + dependencies.push("./polyfill/object/getownpropertynames"); + } + if (!Object.getOwnPropertyDescriptor || !function() { + try { + Object.getOwnPropertyDescriptor({ + x: 0 + }, "x"); + return true; + } catch (exception) { + return false; + } + }()) { + dependencies.push("./polyfill/object/getownpropertydescriptor"); + } + register("base", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + function getOwnPropertyDescriptors(object) { + var descriptors = {}, properties = Object.getOwnPropertyNames(object), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + descriptors[property] = Object.getOwnPropertyDescriptor(object, property); + } + return descriptors; + } + function prohibitCall() { + throw new Error("[Qoopido.js] Operation prohibited"); + } + return { + create: function() { + var instance = Object.create(this, getOwnPropertyDescriptors(this)), result; + if (instance._constructor) { + result = instance._constructor.apply(instance, arguments); + } + instance.create = instance.extend = prohibitCall; + return result || instance; + }, + extend: function(properties, final) { + var instance; + properties = properties || {}; + final = final === true; + properties._parent = this; + instance = Object.create(this, getOwnPropertyDescriptors(properties)); + if (final === true) { + instance.extend = prohibitCall; + } + return instance; + } + }; +}, navigator, this, document); +(function(definition) { + window.qoopido.register("polyfill/string/ucfirst", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!String.prototype.ucfirst) { + String.prototype.ucfirst = function() { + var self = this; + return self.charAt(0).toUpperCase() + self.slice(1); + }; + } + return String.prototype.ucfirst; +}); +(function(definition) { + window.qoopido.register("polyfill/string/lcfirst", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!String.prototype.lcfirst) { + String.prototype.lcfirst = function() { + var self = this; + return self.charAt(0).toLowerCase() + self.slice(1); + }; + } + return String.prototype.lcfirst; +}); +(function(definition) { + window.qoopido.register("polyfill/window/getcomputedstyle", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!window.getComputedStyle) { + var getComputedStyleRegex = new RegExp("(\\-([a-z]){1})", "g"), getComputedStyleCallback = function() { + return arguments[2].toUpperCase(); + }; + return function(element, pseudo) { + var self = this; + self.getPropertyValue = function(property) { + if (property === "float") { + property = "styleFloat"; + } + if (getComputedStyleRegex.test(property)) { + property = property.replace(getComputedStyleRegex, getComputedStyleCallback); + } + return element.currentStyle[property] || null; + }; + return self; + }; + } else { + return window.getComputedStyle; + } +}); +(function(definition) { + window.qoopido.register("polyfill/window/promise", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var STATE_PENDING = void 0, STATE_SEALED = 0, STATE_FULFILLED = 1, STATE_REJECTED = 2, queue = []; + function addCallback(fn, arg) { + var length = queue.push([ fn, arg ]); + if (length === 1) { + scheduleFlushCallbacks(); + } + } + function scheduleFlushCallbacks() { + window.setTimeout(flushCallbacks, 1); + } + function flushCallbacks() { + var i = 0, tuple; + for (;(tuple = queue[i]) !== undefined; i++) { + tuple[0](tuple[1]); + } + queue.length = 0; + } + function handleThenable(promise, value) { + var then = null, resolved; + try { + if (promise === value) { + throw new TypeError("A promises callback cannot return that same promise."); + } + if (typeof value === "function" || typeof value === "object" && value !== null) { + then = value.then; + if (typeof then === "function") { + then.call(value, function(val) { + if (resolved) { + return true; + } + resolved = true; + if (value !== val) { + resolve(promise, val); + } else { + fulfill(promise, val); + } + }, function(val) { + if (resolved) { + return true; + } + resolved = true; + reject(promise, val); + }); + return true; + } + } + } catch (exception) { + if (resolved) { + return true; + } + reject(promise, exception); + return true; + } + return false; + } + function invokeResolver(resolver, promise) { + function resolvePromise(value) { + resolve(promise, value); + } + function rejectPromise(reason) { + reject(promise, reason); + } + try { + resolver(resolvePromise, rejectPromise); + } catch (exception) { + rejectPromise(exception); + } + } + function invokeCallback(settled, promise, callback, detail) { + var hasCallback = typeof callback === "function", value, error, succeeded, failed; + if (hasCallback) { + try { + value = callback(detail); + succeeded = true; + } catch (exception) { + failed = true; + error = exception; + } + } else { + value = detail; + succeeded = true; + } + if (handleThenable(promise, value)) { + return; + } else if (hasCallback && succeeded) { + resolve(promise, value); + } else if (failed) { + reject(promise, error); + } else if (settled === STATE_FULFILLED) { + resolve(promise, value); + } else if (settled === STATE_REJECTED) { + reject(promise, value); + } + } + function resolve(promise, value) { + if (promise === value) { + fulfill(promise, value); + } else if (!handleThenable(promise, value)) { + fulfill(promise, value); + } + } + function fulfill(promise, value) { + if (promise._state !== STATE_PENDING) { + return; + } + promise._state = STATE_SEALED; + promise._detail = value; + addCallback(publishFulfillment, promise); + } + function reject(promise, reason) { + if (promise._state !== STATE_PENDING) { + return; + } + promise._state = STATE_SEALED; + promise._detail = reason; + addCallback(publishRejection, promise); + } + function publishFulfillment(promise) { + publish(promise, promise._state = STATE_FULFILLED); + } + function publishRejection(promise) { + publish(promise, promise._state = STATE_REJECTED); + } + function subscribe(parent, child, onFulfillment, onRejection) { + var subscribers = parent._subscribers, length = subscribers.length; + subscribers[length] = child; + subscribers[length + STATE_FULFILLED] = onFulfillment; + subscribers[length + STATE_REJECTED] = onRejection; + } + function publish(promise, settled) { + var child, callback, subscribers = promise._subscribers, detail = promise._detail, i = 0; + for (;(child = subscribers[i]) !== undefined; i += 3) { + callback = subscribers[i + settled]; + invokeCallback(settled, child, callback, detail); + } + promise._subscribers = null; + } + function Promise(resolver) { + var self = this; + if (typeof resolver !== "function") { + throw new TypeError("You must pass a resolver function as the first argument to the promise constructor"); + } + self._subscribers = []; + invokeResolver(resolver, self); + } + Promise.prototype = { + _state: undefined, + _detail: undefined, + _subscribers: undefined, + then: function(onFulfilled, onRejected) { + var self = this, thenPromise = new Promise(function() {}); + if (self._state) { + addCallback(function invokePromiseCallback() { + invokeCallback(self._state, thenPromise, arguments[self._state - 1], self._detail); + }); + } else { + subscribe(self, thenPromise, onFulfilled, onRejected); + } + return thenPromise; + }, + "catch": function(onRejected) { + return this.then(null, onRejected); + } + }; + if (!window.Promise) { + window.Promise = Promise; + } + return window.Promise; +}); +(function(definition) { + var dependencies = []; + if (!window.Promise) { + dependencies.push("../polyfill/window/promise"); + } + window.qoopido.register("promise/all", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + return function all(promises) { + if (Object.prototype.toString.call(promises) !== "[object Array]") { + throw new TypeError("You must pass an array to all."); + } + return new window.Promise(function(resolve, reject) { + var results = [], remaining = promises.length, i = 0, promise; + if (remaining === 0) { + resolve([]); + } + function resolver(index) { + return function(value) { + resolveAll(index, value); + }; + } + function resolveAll(index, value) { + results[index] = value; + if (--remaining === 0) { + resolve(results); + } + } + for (;(promise = promises[i]) !== undefined; i++) { + if (promise && typeof promise.then === "function") { + promise.then(resolver(i), reject); + } else { + resolveAll(i, promise); + } + } + }); + }; +}); +(function(definition) { + var dependencies = []; + if (!window.Promise) { + dependencies.push("../polyfill/window/promise"); + } + window.qoopido.register("promise/defer", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + return function defer() { + var self = this; + self.promise = new window.Promise(function(resolve, reject) { + self.resolve = resolve; + self.reject = reject; + }); + }; +}); +(function(definition) { + window.qoopido.register("function/merge", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + return function merge() { + var target = arguments[0], i, properties, property, tgt, src; + for (i = 1; (properties = arguments[i]) !== undefined; i++) { + for (property in properties) { + tgt = target[property]; + src = properties[property]; + if (src !== undefined) { + if (src !== null && typeof src === "object") { + if (src.length !== undefined) { + tgt = tgt && typeof tgt === "object" && tgt.length !== undefined ? tgt : []; + } else { + tgt = tgt && typeof tgt === "object" && tgt.length === undefined ? tgt : {}; + } + target[property] = merge(tgt, src); + } else { + target[property] = src; + } + } + } + } + return target; + }; +}); +(function(definition) { + window.qoopido.register("function/unique/string", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var lookup = {}, characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""); + function generateString(length) { + var result = "", i = 0; + length = parseInt(length, 10) || 12; + for (;i < length; i++) { + result += characters[parseInt(Math.random() * (characters.length - 1), 10)]; + } + return result; + } + return function(length) { + var result; + do { + result = generateString(length); + } while (typeof lookup[result] !== "undefined"); + lookup[result] = true; + return result; + }; +}); +(function(definition) { + window.qoopido.register("function/unique/uuid", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var lookup = {}, regex = new RegExp("[xy]", "g"); + function generateUuid() { + return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(regex, function(c) { + var r = Math.random() * 16 | 0, v = c === "x" ? r : r & 3 | 8; + return v.toString(16); + }); + } + return function() { + var result; + do { + result = generateUuid(); + } while (typeof lookup[result] !== "undefined"); + lookup[result] = true; + return result; + }; +}); +(function(definition) { + window.qoopido.register("proxy", definition, [ "./base", "./function/unique/uuid" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + return modules["base"].extend({ + _constructor: function(context, fn) { + var args = Array.prototype.splice.call(arguments, 2), proxy = function() { + return fn.apply(context, Array.prototype.slice.call(arguments).concat(args)); + }; + proxy._quid = modules["function/unique/uuid"](); + return proxy; + } + }); +}); +(function(definition) { + var dependencies = [ "./base", "./promise/all", "./promise/defer" ]; + if (!String.prototype.ucfirst) { + dependencies.push("./polyfill/string/ucfirst"); + } + if (!String.prototype.lcfirst) { + dependencies.push("./polyfill/string/lcfirst"); + } + window.qoopido.registerSingleton("support", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var CombinedPromise = modules["promise/all"], DeferredPromise = modules["promise/defer"], matchPrefix = new RegExp("^(Moz|WebKit|Khtml|ms|O|Icab)(?=[A-Z])"), removeJsPrefix = new RegExp("^(?:webkit|khtml|icab|moz|ms|o)([A-Z])"), removeCssPrefix = new RegExp("^-(?:webkit|khtml|icab|moz|ms|o)-"), convertToCamelCase = new RegExp("-([a-z])", "gi"), convertToHyphens = new RegExp("([A-Z])", "g"), callbackUcfirst = function() { + return arguments[1].ucfirst(); + }, lookup = { + prefix: null, + method: {}, + property: {}, + css: {}, + promises: { + prefix: null, + method: {}, + property: {}, + css: {}, + test: {} + } + }; + function normalize(value) { + return value.replace(removeJsPrefix, "$1").lcfirst().replace(removeCssPrefix, "").replace(convertToCamelCase, callbackUcfirst); + } + return modules["base"].extend({ + test: {}, + pool: shared.pool && shared.pool.dom, + testMultiple: function() { + var test, tests = [], i = 0; + for (;(test = arguments[i]) !== undefined; i++) { + switch (typeof test) { + case "string": + tests.push(this.test[test]()); + break; + + case "boolean": + var deferred = new DeferredPromise(); + !!test ? deferred.resolve() : deferred.reject(); + tests.push(deferred.promise); + break; + + default: + tests.push(test); + break; + } + } + return new CombinedPromise(tests); + }, + getPrefix: function() { + var self = this, stored = lookup.prefix || null, property; + if (stored === null) { + var sample = self.pool ? self.pool.obtain("div") : document.createElement("div"), styles = sample.style; + stored = false; + for (property in styles) { + if (matchPrefix.test(property)) { + stored = property.match(matchPrefix)[0]; + } + } + if (stored === false && "WebkitOpacity" in styles) { + stored = "WebKit"; + } + if (stored === false && "KhtmlOpacity" in styles) { + stored = "Khtml"; + } + stored = lookup.prefix = stored === false ? false : [ stored.toLowerCase(), stored.toLowerCase().ucfirst(), stored ]; + sample.dispose && sample.dispose(); + } + return stored; + }, + getMethod: function(pMethod, pElement) { + pMethod = normalize(pMethod); + pElement = pElement || window; + var type = pElement.tagName, pointer = lookup.method[type] = lookup.method[type] || {}, stored = pointer[pMethod] = lookup.method[type][pMethod] || null; + if (stored === null) { + stored = false; + var candidates, candidate, i = 0, uMethod = pMethod.ucfirst(), prefixes = this.getPrefix(); + if (prefixes !== false) { + candidates = (pMethod + " " + uMethod + " " + prefixes.join(uMethod + " ") + uMethod).split(" "); + } else { + candidates = [ pMethod ]; + } + for (;(candidate = candidates[i]) !== undefined; i++) { + if (pElement[candidate] !== undefined && (typeof pElement[candidate] === "function" || typeof pElement[candidate] === "object")) { + stored = candidate; + break; + } + } + lookup.method[type][pMethod] = stored; + } + return stored; + }, + getProperty: function(pProperty, pElement) { + pProperty = normalize(pProperty); + pElement = pElement || window; + var type = pElement.tagName, pointer = lookup.property[type] = lookup.property[type] || {}, stored = pointer[pProperty] = lookup.property[type][pProperty] || null; + if (stored === null) { + stored = false; + var candidates, candidate, i = 0, uProperty = pProperty.ucfirst(), prefixes = this.getPrefix(); + if (prefixes !== false) { + candidates = (pProperty + " " + uProperty + " " + prefixes.join(uProperty + " ") + uProperty).split(" "); + } else { + candidates = [ pProperty ]; + } + for (i; (candidate = candidates[i]) !== undefined; i++) { + if (pElement[candidate] !== undefined) { + stored = candidate; + break; + } + } + lookup.property[type][pProperty] = stored; + } + return stored; + }, + getCssProperty: function(pProperty) { + pProperty = normalize(pProperty); + var self = this, stored = lookup.css[pProperty] || null; + if (stored === null) { + stored = false; + var candidate, i = 0, sample = self.pool ? self.pool.obtain("div") : document.createElement("div"), uProperty = pProperty.ucfirst(), prefixes = this.getPrefix() || [], candidates = (pProperty + " " + uProperty + " " + prefixes.join(uProperty + " ") + uProperty).split(" "), prefix = ""; + for (i; (candidate = candidates[i]) !== undefined; i++) { + if (sample.style[candidate] !== undefined) { + stored = candidate; + if (i > 0) { + prefix = "-"; + } + break; + } + } + stored = lookup.css[pProperty] = stored !== false ? [ prefix + stored.replace(convertToHyphens, "-$1").toLowerCase(), stored ] : false; + sample.dispose && sample.dispose(); + } + return stored; + }, + supportsPrefix: function() { + return !!this.getPrefix(); + }, + supportsMethod: function(pMethod, pElement) { + return !!this.getMethod(pMethod, pElement); + }, + supportsProperty: function(pProperty, pElement) { + return !!this.getProperty(pProperty, pElement); + }, + supportsCssProperty: function(pProperty) { + return !!this.getCssProperty(pProperty); + }, + testPrefix: function() { + var stored = lookup.promises.prefix; + if (stored === null) { + var deferred = new DeferredPromise(), prefix = this.getPrefix(); + !!prefix ? deferred.resolve(prefix) : deferred.reject(); + stored = lookup.promises.prefix = deferred.promise; + } + return stored; + }, + testMethod: function(pMethod, pElement) { + pElement = pElement || window; + var type = pElement.tagName, pointer = lookup.promises.method[type] = lookup.promises.method[type] || {}, stored = pointer[pMethod] = lookup.promises.method[type][pMethod] || null; + if (stored === null) { + var deferred = new DeferredPromise(), method = this.getMethod(pMethod, pElement); + !!method ? deferred.resolve(method) : deferred.reject(); + stored = lookup.promises.method[type][pMethod] = deferred.promise; + } + return stored; + }, + testProperty: function(pProperty, pElement) { + pElement = pElement || window; + var type = pElement.tagName, pointer = lookup.promises.property[type] = lookup.promises.property[type] || {}, stored = pointer[pProperty] = lookup.promises.property[type][pProperty] || null; + if (stored === null) { + var deferred = new DeferredPromise(), property = this.getProperty(pProperty, pElement); + !!property ? deferred.resolve(property) : deferred.reject(); + stored = lookup.promises.property[type][pProperty] = deferred.promise; + } + return stored; + }, + testCssProperty: function(pProperty) { + var stored = lookup.promises.css[pProperty] || null; + if (stored === null) { + var deferred = new DeferredPromise(), property = this.getCssProperty(pProperty); + !!property ? deferred.resolve(property) : deferred.reject(); + stored = lookup.promises.css[pProperty] = deferred.promise; + } + return stored; + }, + addTest: function(pId, pTest) { + return this.test[pId] = function() { + var stored = lookup.promises.test[pId] || null; + if (stored === null) { + var deferred = new DeferredPromise(), parameter = Array.prototype.slice.call(arguments); + parameter.splice(0, 0, deferred); + pTest.apply(null, parameter); + stored = lookup.promises.test[pId] = deferred.promise; + } + return stored; + }; + } + }); +}); +(function(definition) { + window.qoopido.register("support/capability/datauri", definition, [ "../../support", "../../dom/element" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var support = modules["support"]; + return support.addTest("/capability/datauri", function(deferred) { + var sample = modules["dom/element"].create(support.pool ? support.pool.obtain("img") : document.createElement("img")); + sample.one("error load", function(event) { + if (event.type === "load" && sample.element.width === 1 && sample.element.height === 1) { + deferred.resolve(); + } else { + deferred.reject(); + } + sample.element.dispose && sample.element.dispose(); + }, false).setAttribute("src", "data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="); + }); +}); +(function(definition) { + window.qoopido.register("support/element/canvas", definition, [ "../../support" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var support = modules["support"]; + return support.addTest("/element/canvas", function(deferred) { + var sample = support.pool ? support.pool.obtain("canvas") : document.createElement("canvas"); + sample.getContext && sample.getContext("2d") ? deferred.resolve() : deferred.reject(); + sample.dispose && sample.dispose(); + }); +}); +(function(definition) { + window.qoopido.register("support/element/canvas/todataurl", definition, [ "../../../support", "../canvas" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var support = modules["support"]; + return support.addTest("/element/canvas/todataurl", function(deferred) { + modules["support/element/canvas"]().then(function() { + var sample = support.pool ? support.pool.obtain("canvas") : document.createElement("canvas"); + sample.toDataURL !== undefined ? deferred.resolve() : deferred.reject(); + sample.dispose && sample.dispose(); + }, function() { + deferred.reject(); + }); + }); +}); +(function(definition) { + window.qoopido.register("support/element/canvas/todataurl/png", definition, [ "../../../../support", "../todataurl" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var support = modules["support"]; + return support.addTest("/element/canvas/todataurl/png", function(deferred) { + modules["support/element/canvas/todataurl"]().then(function() { + var sample = support.pool ? support.pool.obtain("canvas") : document.createElement("canvas"); + sample.toDataURL("image/png").indexOf("data:image/png") === 0 ? deferred.resolve() : deferred.reject(); + sample.dispose && sample.dispose(); + }, function() { + deferred.reject(); + }); + }); +}); +(function(definition) { + window.qoopido.registerSingleton("hook/event", definition, [ "../base" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + function transferProperties(event, originalEvent, properties) { + var i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + event[property] = originalEvent[property]; + } + event._properties = event._properties.concat(properties); + } + var hooks = { + general: { + properties: "type altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which path".split(" "), + process: function(event, originalEvent) { + var pointer; + event.originalEvent = originalEvent; + event.isDefaultPrevented = originalEvent.defaultPrevented ? true : false; + event.isPropagationStopped = originalEvent.cancelBubble ? true : false; + event.metaKey = originalEvent.metaKey && originalEvent.metaKey !== false ? true : false; + if (!event.target) { + event.target = originalEvent.srcElement || document; + } + if (event.target.nodeType === 3) { + event.target = event.target.parentNode; + } + if (!event.path) { + event.path = []; + pointer = event.target; + do { + event.path.push(pointer); + } while (pointer = pointer.parentNode); + event.path.push(window); + } + } + }, + mouse: { + regex: new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"), + properties: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement dataTransfer".split(" "), + process: function(event, originalEvent) { + var pointer, fromElement, which; + fromElement = originalEvent.fromElement; + which = originalEvent.button; + if (event.pageX === null && originalEvent.clientX !== null) { + pointer = event.target.ownerDocument || document; + pointer = pointer.documentElement || pointer.body; + event.pageX = originalEvent.clientX + (pointer.scrollLeft || 0) - (pointer.clientLeft || 0); + event.pageY = originalEvent.clientY + (pointer.scrollTop || 0) - (pointer.clientTop || 0); + } + if (!event.relatedTarget && fromElement) { + event.relatedTarget = fromElement === event.target ? originalEvent.toElement : fromElement; + } + if (!event.which && which !== undefined) { + event.which = which & 1 ? 1 : which & 2 ? 3 : which & 4 ? 2 : 0; + } + } + }, + key: { + regex: new RegExp("^(?:key)"), + properties: "char charCode key keyCode".split(" "), + process: function(event, originalEvent) { + if (event.which === null) { + event.which = originalEvent.charCode !== null ? originalEvent.charCode : originalEvent.keyCode; + } + } + } + }; + return modules["base"].extend({ + add: function(property, hook) { + if (property && hook && hooks[property]) { + hooks[property] = hook; + } + return this; + }, + get: function(property) { + if (property && hooks[property]) { + return hooks[property]; + } + return null; + }, + process: function(event, originalEvent) { + var id, hook, isMatch; + for (id in hooks) { + hook = hooks[id]; + isMatch = !hook.regex || hook.regex.test(originalEvent.type); + if (isMatch) { + if (hook.properties) { + transferProperties(event, originalEvent, hook.properties); + } + if (hook.process) { + hook.process(event, originalEvent); + } + if (hook.delegate) { + event.delegate = hook.delegate; + } + } + } + } + }); +}); +(function(definition) { + var dependencies = [ "../base", "../support" ]; + if (!window.getComputedStyle) { + dependencies.push("../polyfill/window/getcomputedstyle"); + } + window.qoopido.registerSingleton("hook/css", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var mSupport = modules["support"], getComputedStyle = window.getComputedStyle || modules["polyfill/window/getcomputedstyle"], hooks = { + general: { + get: function(element, property) { + return getComputedStyle(element, null).getPropertyValue(property[0]); + }, + set: function(element, property, value) { + element.style[property[1]] = value; + } + }, + opacity: !mSupport.supportsCssProperty("opacity") ? { + regex: new RegExp("alpha\\(opacity=(.*)\\)", "i"), + get: function(element, property, value) { + value = getComputedStyle(element, null).getPropertyValue("filter").toString().match(this.regex); + if (value) { + value = value[1] / 100; + } else { + value = 1; + } + return value; + }, + set: function(element, property, value) { + var style = element.style; + style.zoom = 1; + style.filter = "alpha(opacity=" + (value * 100 + .5 >> 0) + ")"; + } + } : null + }; + return modules["base"].extend({ + add: function(property, hook) { + if (property && hook && hooks[property]) { + hooks[property] = hook; + } + return this; + }, + get: function(property) { + if (property && hooks[property]) { + return hooks[property]; + } + return null; + }, + process: function(method, element, property, value) { + var hook; + property = mSupport.getCssProperty(property, element) || null; + if (property) { + return ((hook = this.get(property[1])) && hook[method] || this.get("general")[method])(element, property, value); + } + } + }); +}); +(function(definition) { + window.qoopido.register("dom/event", definition, [ "../base", "../hook/event" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var hooks = modules["hook/event"]; + return modules["base"].extend({ + originalEvent: null, + isDelegate: false, + isDefaultPrevented: false, + isPropagationStopped: false, + isImmediatePropagationStopped: false, + _properties: null, + _constructor: function(event) { + var self = this; + self._properties = []; + self._obtain(event); + return self; + }, + _obtain: function(event) { + hooks.process(this, event); + }, + _dispose: function() { + var self = this, i = 0, property; + for (;(property = self._properties[i]) !== undefined; i++) { + delete self[property]; + } + delete self.delegate; + self.originalEvent = null; + self.isDelegate = false; + self.isDefaultPrevented = false; + self.isPropagationStopped = false; + self.isImmediatePropagationStopped = false; + self._properties.length = 0; + }, + preventDefault: function() { + var self = this, event = self.originalEvent; + if (event.cancelable !== false) { + self.isDefaultPrevented = true; + if (event.preventDefault) { + event.preventDefault(); + } else { + event.returnValue = false; + } + } + }, + stopPropagation: function() { + var self = this, event = self.originalEvent; + self.isPropagationStopped = true; + if (event.stopPropagation) { + event.stopPropagation(); + } + event.cancelBubble = true; + }, + stopImmediatePropagation: function() { + var self = this, event = self.originalEvent; + self.isImmediatePropagationStopped = true; + if (event.stopImmediatePropagation) { + event.stopImmediatePropagation(); + } + self.stopPropagation(); + } + }); +}); +(function(definition) { + var dependencies = [ "../base", "../function/unique/uuid", "../hook/css", "./event" ]; + if (!window.CustomEvent) { + dependencies.push("../polyfill/window/customevent"); + } + if (!window.addEventListener) { + dependencies.push("../polyfill/window/addeventlistener"); + } + if (!window.removeEventListener) { + dependencies.push("../polyfill/window/removeeventlistener"); + } + if (!window.dispatchEvent) { + dependencies.push("../polyfill/window/dispatchevent"); + } + if (!Element.prototype.matches) { + dependencies.push("../polyfill/element/matches"); + } + if (!document.querySelector) { + dependencies.push("../polyfill/document/queryselector"); + } + if (!document.querySelectorAll) { + dependencies.push("../polyfill/document/queryselectorall"); + } + if (!String.prototype.trim) { + dependencies.push("../polyfill/string/trim"); + } + window.qoopido.register("dom/element", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var stringObject = "object", stringString = "string", generateUuid = modules["function/unique/uuid"], head = document.getElementsByTagName("head")[0], contentAttribute = "textContent" in document.createElement("a") ? "textContent" : "innerText", previousSibling = typeof head.previousElementSibling !== "undefined" ? function previousSibling() { + return this.previousElementSibling; + } : function previousSibling() { + var element = this; + while (element = element.previousSibling) { + if (element.nodeType === 1) { + return element; + } + } + }, nextSibling = typeof head.nextElementSibling !== "undefined" ? function nextSibling() { + return this.nextElementSibling; + } : function nextSibling() { + var element = this; + while (element = element.nextSibling) { + if (element.nodeType === 1) { + return element; + } + } + }, isTag = new RegExp("^<(\\w+)\\s*/>$"), matchEvent = new RegExp("^[^-]+"), splitList = new RegExp(" +", "g"), pool = modules["pool/module"] && modules["pool/module"].create(modules["dom/event"], null, true) || null, hooks = modules["hook/css"], storage = {}, events = { + custom: { + type: "CustomEvent", + method: "initCustomEvent" + }, + html: { + regex: new RegExp("^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$"), + type: "HTMLEvents", + method: "initEvent" + }, + mouse: { + regex: new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"), + type: "MouseEvents", + method: "initMouseEvent" + } + }; + function resolveEvent(type) { + var id, prototype, candidate; + for (id in events) { + prototype = events[id]; + if (!prototype.regex || prototype.regex.test(type)) { + candidate = prototype; + } + } + return candidate; + } + function emitEvent(type, detail, uuid) { + var self = this, prototype = resolveEvent(type), event = document.createEvent(prototype.type); + event[prototype.method](type, type === "load" ? false : true, true, detail); + if (uuid) { + event._quid = uuid; + event.isDelegate = true; + } + self.element.dispatchEvent(event); + } + function resolveElement(element) { + var tag; + if (typeof element === "string") { + try { + if (isTag.test(element) === true) { + tag = element.replace(isTag, "$1").toLowerCase(); + element = document.createElement(tag); + } else { + element = document.querySelector(element); + } + } catch (exception) { + element = null; + } + } + if (!element) { + throw new Error("[Qoopido.js] Element could not be resolved"); + } + return element; + } + function resolveArguments(parameters) { + return Array.prototype.concat.apply([], Array.prototype.splice.call(parameters, 0)).join(" ").split(splitList); + } + function matchesDelegate(event, delegate) { + var i = 0, pointer; + for (;(pointer = event.path[i]) !== undefined; i++) { + if (pointer.matches(delegate)) { + event.currentTarget = pointer; + return true; + } + if (pointer === event.currentTarget) { + break; + } + } + return false; + } + return modules["base"].extend({ + type: null, + element: null, + _listener: null, + _constructor: function(element, attributes, styles) { + var self = this, uuid; + element = resolveElement(element); + uuid = element._quid; + if (!uuid) { + uuid = element._quid = generateUuid(); + self.type = element.tagName; + self.element = element; + self._listener = {}; + storage[uuid] = self; + } else { + self = storage[uuid]; + } + if (typeof attributes === "object" && attributes !== null) { + self.setAttributes(attributes); + } + if (typeof styles === "object" && styles !== null) { + self.setStyles(styles); + } + if (self !== this) { + this.dispose && this.dispose(); + } + return self; + }, + _obtain: function(element, attributes, styles) { + this._constructor(element, attributes, styles); + }, + _dispose: function() { + var self = this, id, event; + for (id in self._listener) { + event = id.match(matchEvent); + self.element.removeEventListener(event, self._listener[id]); + delete self._listener[id]; + } + self.type = null; + self.element = null; + }, + getContent: function(html) { + var element = this.element; + return html && html !== false ? element.innerHTML : element[contentAttribute]; + }, + setContent: function(content, html) { + var self = this, element = self.element; + if (html && html !== false) { + element.innerHTML = content; + } else { + element[contentAttribute] = content; + } + return self; + }, + getAttribute: function(attribute) { + var self = this; + if (attribute && typeof attribute === stringString) { + return self.element.getAttribute(attribute); + } + }, + getAttributes: function() { + var self = this, result = {}, attributes = resolveArguments(arguments), i = 0, attribute; + for (;(attribute = attributes[i]) !== undefined; i++) { + result[attribute] = self.element.getAttribute(attribute); + } + return result; + }, + setAttribute: function(attribute, value) { + var self = this; + if (attribute && typeof attribute === stringString) { + self.element.setAttribute(attribute, value); + } + return self; + }, + setAttributes: function(attributes) { + var self = this, attribute; + if (attributes && typeof attributes === stringObject && !attributes.length) { + for (attribute in attributes) { + self.element.setAttribute(attribute, attributes[attribute]); + } + } + return self; + }, + removeAttribute: function(attribute) { + var self = this; + if (attribute && typeof attribute === stringString) { + self.element.removeAttribute(attribute); + } + return self; + }, + removeAttributes: function() { + var self = this, attributes = resolveArguments(arguments), i = 0, attribute; + for (;(attribute = attributes[i]) !== undefined; i++) { + self.element.removeAttribute(attribute); + } + return self; + }, + getStyle: function(property) { + var self = this; + if (property && typeof property === stringString) { + return hooks.process("get", self.element, property); + } + }, + getStyles: function() { + var self = this, result = {}, properties = resolveArguments(arguments), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + result[property] = hooks.process("get", self.element, property); + } + return result; + }, + setStyle: function(property, value) { + var self = this; + if (property && typeof property === stringString) { + hooks.process("set", self.element, property, value); + } + return self; + }, + setStyles: function(properties) { + var self = this, property; + if (properties && typeof properties === stringObject && !properties.length) { + for (property in properties) { + hooks.process("set", self.element, property, properties[property]); + } + } + return self; + }, + removeStyle: function(property) { + var self = this; + if (property && typeof property === stringString) { + self.setStyle(property, ""); + } + return self; + }, + removeStyles: function() { + var self = this, properties = resolveArguments(arguments), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + self.setStyle(property, ""); + } + return self; + }, + siblings: function(selector) { + var element = this.element, pointer = element.parentNode.firstChild, siblings = []; + for (;pointer; pointer = nextSibling.call(pointer)) { + if (pointer !== element && (!selector || pointer.matches(selector))) { + siblings.push(pointer); + } + } + return siblings; + }, + siblingsBefore: function(selector) { + var pointer = this.element.previousSibling, siblings = []; + for (;pointer; pointer = previousSibling.call(pointer)) { + if (!selector || pointer.matches(selector)) { + siblings.push(pointer); + } + } + return siblings; + }, + siblingsAfter: function(selector) { + var pointer = this.element.nextSibling, siblings = []; + for (;pointer; pointer = nextSibling.call(pointer)) { + if (!selector || pointer.matches(selector)) { + siblings.push(pointer); + } + } + return siblings; + }, + previous: function(selector) { + var pointer = previousSibling.call(this.element); + if (!selector) { + return pointer; + } else { + for (;pointer; pointer = previousSibling.call(pointer)) { + if (pointer.matches(selector)) { + return pointer; + } + } + } + }, + next: function(selector) { + var pointer = nextSibling.call(this.element); + if (!selector) { + return pointer; + } else { + for (;pointer; pointer = nextSibling.call(pointer)) { + if (pointer.matches(selector)) { + return pointer; + } + } + } + }, + find: function(selector) { + var self = this.element, uuid, matches; + selector = selector.trim(); + if (selector.charAt(0) === ">") { + uuid = self._quid; + self.setAttribute("data-quid", uuid); + selector = '[data-quid="' + uuid + '"] ' + selector; + matches = self.parentNode.querySelectorAll(selector); + self.removeAttribute("data-quid"); + } else { + matches = self.querySelectorAll(selector); + } + return matches; + }, + parent: function(selector) { + var pointer; + if (!selector) { + return this.element.parentNode; + } else { + pointer = this.element; + for (;pointer; pointer = pointer.parentNode) { + if (pointer.matches(selector)) { + return pointer; + } + } + } + }, + parents: function(selector) { + var pointer = this.element.parentNode, parents = []; + for (;pointer; pointer = pointer.parentNode) { + if (pointer.nodeType === 9) { + return parents; + } else if (pointer.nodeType === 1) { + if (!selector || pointer.matches(selector)) { + parents.push(pointer); + } + } + } + }, + isVisible: function() { + var self = this, element = self.element; + return !(element.offsetWidth <= 0 && element.offsetHeight <= 0 || self.getStyle("visibility") === "hidden" || self.getStyle("opacity") <= 0); + }, + hasClass: function(name) { + return name ? new RegExp("(?:^|\\s)" + name + "(?:\\s|$)").test(this.element.className) : false; + }, + addClass: function(name) { + var self = this; + if (name && !self.hasClass(name)) { + self.element.className += self.element.className ? " " + name : name; + } + return self; + }, + removeClass: function(name) { + var self = this; + if (name && self.hasClass(name)) { + self.element.className = self.element.className.replace(new RegExp("(?:^|\\s)" + name + "(?!\\S)"), ""); + } + return self; + }, + toggleClass: function(name) { + var self = this; + if (name) { + self.hasClass(name) ? self.removeClass(name) : self.addClass(name); + } + return self; + }, + prepend: function(element) { + var self = this, target = self.element; + if (element) { + try { + element = element.element || resolveElement(element); + target.firstChild ? target.insertBefore(element, target.firstChild) : self.append(element); + } catch (exception) { + target.insertAdjacentHTML("afterBegin", element); + } + } + return self; + }, + append: function(element) { + var self = this, target = self.element; + if (element) { + try { + target.appendChild(element.element || resolveElement(element)); + } catch (exception) { + target.insertAdjacentHTML("beforeEnd", element); + } + } + return self; + }, + prependTo: function(target) { + var self = this, element = self.element; + if (target) { + (target = target.element || resolveElement(target)).firstChild ? target.insertBefore(element, target.firstChild) : self.appendTo(target); + } + return self; + }, + appendTo: function(target) { + var self = this; + if (target) { + (target.element || resolveElement(target)).appendChild(self.element); + } + return self; + }, + insertBefore: function(target) { + var self = this, element = self.element; + if (target) { + (target = target.element || resolveElement(target)).parentNode.insertBefore(element, target); + } + return self; + }, + insertAfter: function(target) { + var self = this, element = self.element; + if (target) { + (target = target.element || resolveElement(target)).nextSibling ? target.parentNode.insertBefore(element, target.nextSibling) : self.appendTo(target.parentNode); + } + return self; + }, + replace: function(target) { + var self = this, element = self.element; + if (target) { + (target = target.element || resolveElement(target)).parentNode.replaceChild(element, target); + } + return self; + }, + replaceWith: function(element) { + var self = this, target = self.element; + if (element) { + element = element.element || resolveElement(element); + target.parentNode.replaceChild(element, target); + } + return self; + }, + remove: function() { + var self = this, element = self.element; + element.parentNode.removeChild(element); + return self; + }, + on: function(events) { + var self = this, element = self.element, delegate = arguments.length > 2 ? arguments[1] : null, fn = arguments.length > 2 ? arguments[2] : arguments[1], uuid = fn._quid || (fn._quid = generateUuid()), i = 0, event; + events = events.split(" "); + for (;(event = events[i]) !== undefined; i++) { + var id = event + "-" + uuid, listener = function(event) { + var delegateTo; + event = pool && pool.obtain(event) || modules["dom/event"].create(event); + if (!event.isPropagationStopped) { + delegateTo = event.delegate; + event._quid = generateUuid(); + if (!delegate || matchesDelegate(event, delegate)) { + fn.call(event.currentTarget, event, event.originalEvent.detail); + } + if (delegateTo) { + delete event.delegate; + emitEvent.call(self, delegateTo); + } + } + event.dispose && event.dispose(); + }; + listener.type = event; + self._listener[id] = listener; + element.addEventListener(event, listener); + } + return self; + }, + one: function(events) { + var self = this, delegate = arguments.length > 3 || typeof arguments[1] === "string" ? arguments[1] : null, fn = arguments.length > 3 || typeof arguments[2] === "function" ? arguments[2] : arguments[1], each = (arguments.length > 3 ? arguments[3] : arguments[2]) !== false, listener = function(event) { + self.off(each === true ? event.type : events, listener); + fn.call(this, event, event.originalEvent.detail); + }; + fn._quid = listener._quid = generateUuid(); + if (delegate) { + self.on(events, delegate, listener); + } else { + self.on(events, listener); + } + return self; + }, + off: function(events, fn) { + var self = this, element = self.element, i = 0, event, id, listener; + events = events.split(" "); + for (;(event = events[i]) !== undefined; i++) { + id = fn._quid && event + "-" + fn._quid || null; + listener = id && self._listener[id] || null; + if (listener) { + element.removeEventListener(event, listener); + delete self._listener[id]; + } else { + element.removeEventListener(event, fn); + } + } + return self; + }, + emit: function(event, data) { + var self = this; + emitEvent.call(self, event, data); + return self; + } + }); +}); +(function(definition) { + window.qoopido.registerSingleton("url", definition, [ "./base" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var urlCurrent, regexLocal, regexParameter = new RegExp("[?&]?([^=]+)=([^&]*)", "g"); + try { + urlCurrent = location; + } catch (exception) { + urlCurrent = getResolver(); + } + regexLocal = new RegExp("".concat("^", urlCurrent.protocol, "//", urlCurrent.hostname), "i"); + function getResolver(url) { + var resolver = document.createElement("a"); + resolver.href = url || ""; + return resolver; + } + return modules["base"].extend({ + resolve: function(url) { + return getResolver(url).href; + }, + redirect: function redirect(url, target) { + target = target || window; + target.location.href = this.resolve(url); + }, + getParameter: function(url) { + var params = {}, querystring = getResolver(url).search.split("+").join(" "), tokens; + while (tokens = regexParameter.exec(querystring)) { + params[decodeURIComponent(tokens[1])] = decodeURIComponent(tokens[2]); + } + return params; + }, + isLocal: function(url) { + return regexLocal.test(this.resolve(url)); + } + }); +}); +(function(definition) { + window.qoopido.register("transport", definition, [ "./base", "./function/merge" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var prototype; + prototype = modules["base"].extend({ + setup: function(options) { + var self = this; + self._settings = modules["function/merge"]({}, self._settings, options); + return self; + }, + serialize: function(obj, prefix) { + var parameter = [], id, key, value; + for (id in obj) { + key = prefix ? "".concat(prefix, "[", id, "]") : id; + value = obj[id]; + parameter.push(typeof value === "object" ? this.serialize(value, key) : "".concat(encodeURIComponent(key), "=", encodeURIComponent(value))); + } + return parameter.join("&"); + } + }); + return prototype; +}, window, document); +(function(definition) { + window.qoopido.registerSingleton("transport/xhr", definition, [ "../transport", "../function/merge", "../function/unique/string", "../url", "../promise/defer" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var prototype, DeferredPromise = modules["promise/defer"], getXhr = typeof window.XMLHttpRequest !== "undefined" ? function(url) { + if (modules["url"].isLocal(url)) { + return new window.XMLHttpRequest(); + } else { + return window.XDomainRequest ? new window.XDomainRequest() : new window.XMLHttpRequest(); + } + } : function() { + try { + return new ActiveXObject("MSXML2.XMLHTTP.3.0"); + } catch (exception) { + return null; + } + }; + function sendRequest(method, url, content) { + var self = this, xhr = self.xhr, settings = self.settings, id; + url = settings.cache === false ? "".concat(url, url.indexOf("?") > -1 ? "&" : "?", "_=" + new Date().getTime()) : url; + url = content && method === "GET" ? "".concat(url, url.indexOf("?") > -1 ? "&" : "?", content) : url; + for (id in settings.xhrOptions) { + xhr[id] = settings.xhrOptions[id]; + } + xhr.open(method, url, settings.async, settings.username, settings.password); + if (xhr.setRequestHeader) { + xhr.setRequestHeader("Accept", settings.accept); + if (content && method !== "GET") { + xhr.setRequestHeader("Content-Type", settings.contentType); + } + for (id in settings.header) { + xhr.setRequestHeader(id, settings.header[id]); + } + } + xhr.timeout = settings.timeout; + xhr.onprogress = function(event) { + onProgress.call(self, event); + }; + xhr.onreadystatechange = xhr.onload = function() { + onReadyStateChange.call(self); + }; + xhr.onerror = function() { + onError.call(self); + }; + xhr.send(content || null); + self.timeout = setTimeout(function() { + onTimeout.call(self); + }, settings.timeout); + } + function onProgress(event) { + var self = this; + if (self.timeout) { + clearTimeout(self.timeout); + } + self.timeout = setTimeout(function() { + onTimeout.call(self); + }, self.settings.timeout); + } + function onReadyStateChange() { + var self = this, xhr = self.xhr, dfd = self.dfd; + if (xhr.readyState === undefined || xhr.readyState === 4) { + clear.call(self); + if (xhr.status === undefined || xhr.status === 200) { + dfd.resolve({ + data: xhr.responseText, + xhr: xhr + }); + } else { + dfd.reject({ + status: xhr.status, + xhr: xhr + }); + } + } + } + function onError() { + var self = this; + clear.call(self); + self.dfd.reject(); + } + function onTimeout() { + var self = this; + self.xhr.abort(); + clear.call(self); + self.dfd.reject(); + } + function clear() { + var self = this, xhr = self.xhr; + if (self.timeout) { + clearTimeout(self.timeout); + } + xhr.onprogress = xhr.onreadystatechange = xhr.onerror = null; + } + prototype = modules["transport"].extend({ + _settings: { + accept: "*/*", + timeout: 5e3, + async: true, + cache: false, + header: {}, + username: null, + password: null, + contentType: "application/x-www-form-urlencoded; charset=UTF-8 ", + xhrOptions: {} + }, + load: function(method, url, data, options) { + var context = {}; + url = modules["url"].resolve(url); + context.url = url; + context.id = "".concat("xhr-", modules["function/unique/string"]()); + context.dfd = new DeferredPromise(); + context.xhr = getXhr(url); + context.settings = modules["function/merge"]({}, this._settings, options); + context.timeout = null; + sendRequest.call(context, method.toUpperCase(), url, data); + return context.dfd.promise; + }, + get: function(url, data, options) { + return this.load("GET", url, data, options); + }, + post: function(url, data, options) { + return this.load("POST", url, data, options); + }, + put: function(url, data, options) { + return this.load("PUT", url, data, options); + }, + "delete": function(url, data, options) { + return this.load("DELETE", url, data, options); + }, + head: function(url, data, options) { + return this.load("HEAD", url, data, options); + } + }); + return prototype; +}, window, document); +(function(definition) { + var dependencies = [ "../element", "../../proxy", "../../function/merge", "../../url", "../../support", "../../support/capability/datauri", "../../support/element/canvas/todataurl/png", "../../transport/xhr" ]; + window.qoopido.register("dom/element/shrinkimage", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var JSON = window.JSON, name = namespace.pop(), defaults = { + attribute: "data-" + name, + quality: 80, + debug: false + }, pool = shared.pool && shared.pool.dom || null, lookup = {}, regexBackground = new RegExp('^url\\x28"{0,1}data:image/shrink,(.+?)"{0,1}\\x29$', "i"), regexPath = new RegExp('^(?:url\\x28"{0,1}|)(?:data:image/shrink,|)(.+?)(?:"{0,1}\\x29|)$', "i"), regexSuffix = new RegExp("\\.png$", "i"), supported = modules["support"].testMultiple("/capability/datauri", "/element/canvas/todataurl/png"), prototype, loader, EVENT_QUEUED = "queued", EVENT_CACHED = "cached", EVENT_LOADED = "loaded", EVENT_FAILED = "failed", EVENT_STATE = "".concat(EVENT_LOADED, " ", EVENT_FAILED), DOM_LOAD = "load", DOM_ERROR = "error", DOM_STATE = "".concat(DOM_LOAD, " ", DOM_ERROR); + function processMain(url, isBackground) { + url = modules["url"].resolve(regexPath.exec(url)[1]); + isBackground = isBackground === true; + var self = this, settings = modules["function/merge"]({}, self._settings, modules["url"].getParameter(url)), target = settings.target || (url = url.split("?")[0]).replace(regexSuffix, "".concat(".q", settings.quality, ".shrunk")); + if (!isBackground) { + self.removeAttribute(self._settings.attribute).hide(); + } + supported.then(function() { + if (settings.debug === true) { + throw new Error("[Qoopido.js] Debug enabled"); + } + switch (typeof lookup[target]) { + case "object": + lookup[target].one(EVENT_LOADED, function(event) { + assign.call(self, event.data, isBackground); + }); + self.emit(EVENT_QUEUED); + break; + + case "string": + assign.call(self, lookup[target], isBackground); + break; + + default: + lookup[target] = loader.create(target, !isBackground ? self.element : null).one(EVENT_STATE, function(event, data) { + if (event.type === EVENT_LOADED) { + lookup[target] = data; + self.emit(EVENT_CACHED); + assign.call(self, data, isBackground); + } else { + lookup[target] = url; + assign.call(self, url, isBackground); + } + }, false); + break; + } + })["catch"](function() { + lookup[target] = url; + assign.call(self, url, isBackground); + }); + } + function assign(source, isBackground) { + var self = this; + if (isBackground) { + self.setStyle("backgroundImage", "url(" + source + ")"); + self.emit(EVENT_LOADED); + } else { + self.one(DOM_LOAD, function() { + self.show(); + self.emit(EVENT_LOADED); + }).setAttribute("src", source); + } + } + function processTransport(transport) { + var self = this; + transport.get(self._url).then(function(response) { + try { + var data = JSON.parse(response.data); + data.width = parseInt(data.width, 10); + data.height = parseInt(data.height, 10); + processData.call(self, data); + } catch (exception) { + self.emit(EVENT_FAILED); + } + }, function() { + self.emit(EVENT_FAILED); + }); + } + function processData(data) { + var canvas, context, self = this, onLoadMain = function(event) { + canvas = pool && pool.obtain("canvas") || document.createElement("canvas"); + canvas.style.display = "none"; + canvas.width = data.width; + canvas.height = data.height; + context = canvas.getContext("2d"); + context.clearRect(0, 0, data.width, data.height); + context.drawImage(self.element, 0, 0, data.width, data.height); + self.one(DOM_LOAD, onLoadAlpha).setAttribute("src", data.alpha); + return suppressEvent(event); + }, onLoadAlpha = function(event) { + var result; + context.globalCompositeOperation = "xor"; + context.drawImage(self.element, 0, 0, data.width, data.height); + result = canvas.toDataURL("image/png"); + dispose(); + self.emit(EVENT_LOADED, result); + return suppressEvent(event); + }, dispose = function() { + if (canvas) { + canvas.dispose && canvas.dispose(); + } + self.element.dispose && self.element.dispose(); + }; + self.one(DOM_STATE, function(event) { + if (event.type === DOM_LOAD) { + onLoadMain.call(this, event); + } else { + dispose(); + self.emit(EVENT_FAILED); + } + }, false).setAttribute("src", data.main); + } + function suppressEvent(event) { + event.preventDefault(); + event.stopPropagation(); + return false; + } + prototype = modules["dom/element"].extend({ + _constructor: function(element, settings) { + var self = prototype._parent._constructor.call(this, element), foreground, background; + self._settings = settings = modules["function/merge"]({}, defaults, settings); + foreground = self.getAttribute(settings.attribute); + background = self.getStyle("backgroundImage"); + if (self.type === "IMG") { + processMain.call(self, foreground); + } + if (background !== "none" && regexBackground.test(background)) { + processMain.call(self, background, true); + } + return self; + }, + hide: function() { + this.setStyles({ + visibility: "hidden", + opacity: 0 + }); + }, + show: function() { + this.setStyles({ + visibility: "", + opacity: "" + }); + } + }); + loader = modules["dom/element"].extend({ + _url: null, + _constructor: function(url, element) { + var self; + if (!element) { + element = pool && pool.obtain("img") || document.createElement("img"); + } + self = loader._parent._constructor.call(this, element); + self._url = url; + processTransport.call(self, modules["transport/xhr"]); + return self; + } + }); + return prototype; +}, window); \ No newline at end of file diff --git a/dist/3.7.2/max/particle.js b/dist/3.7.3/max/particle.js similarity index 99% rename from dist/3.7.2/max/particle.js rename to dist/3.7.3/max/particle.js index 3b5eb9ae..f02775ec 100644 --- a/dist/3.7.2/max/particle.js +++ b/dist/3.7.3/max/particle.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/polyfill/array/indexof.js b/dist/3.7.3/max/polyfill/array/indexof.js similarity index 97% rename from dist/3.7.2/max/polyfill/array/indexof.js rename to dist/3.7.3/max/polyfill/array/indexof.js index 41730585..2afb5b9f 100644 --- a/dist/3.7.2/max/polyfill/array/indexof.js +++ b/dist/3.7.3/max/polyfill/array/indexof.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/polyfill/document/getelementsbyclassname.js b/dist/3.7.3/max/polyfill/document/getelementsbyclassname.js similarity index 98% rename from dist/3.7.2/max/polyfill/document/getelementsbyclassname.js rename to dist/3.7.3/max/polyfill/document/getelementsbyclassname.js index 729468bc..fdeb42f3 100644 --- a/dist/3.7.2/max/polyfill/document/getelementsbyclassname.js +++ b/dist/3.7.3/max/polyfill/document/getelementsbyclassname.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/polyfill/document/queryselector.js b/dist/3.7.3/max/polyfill/document/queryselector.js similarity index 97% rename from dist/3.7.2/max/polyfill/document/queryselector.js rename to dist/3.7.3/max/polyfill/document/queryselector.js index ccbc9787..e00c3075 100644 --- a/dist/3.7.2/max/polyfill/document/queryselector.js +++ b/dist/3.7.3/max/polyfill/document/queryselector.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/polyfill/document/queryselectorall.js b/dist/3.7.3/max/polyfill/document/queryselectorall.js similarity index 98% rename from dist/3.7.2/max/polyfill/document/queryselectorall.js rename to dist/3.7.3/max/polyfill/document/queryselectorall.js index e216784c..ad41340d 100644 --- a/dist/3.7.2/max/polyfill/document/queryselectorall.js +++ b/dist/3.7.3/max/polyfill/document/queryselectorall.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/polyfill/element/matches.js b/dist/3.7.3/max/polyfill/element/matches.js similarity index 98% rename from dist/3.7.2/max/polyfill/element/matches.js rename to dist/3.7.3/max/polyfill/element/matches.js index f669210f..d903a8f6 100644 --- a/dist/3.7.2/max/polyfill/element/matches.js +++ b/dist/3.7.3/max/polyfill/element/matches.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/polyfill/object/create.js b/dist/3.7.3/max/polyfill/object/create.js similarity index 98% rename from dist/3.7.2/max/polyfill/object/create.js rename to dist/3.7.3/max/polyfill/object/create.js index c29c1c86..a7fd11a5 100644 --- a/dist/3.7.2/max/polyfill/object/create.js +++ b/dist/3.7.3/max/polyfill/object/create.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/polyfill/object/defineproperties.js b/dist/3.7.3/max/polyfill/object/defineproperties.js similarity index 98% rename from dist/3.7.2/max/polyfill/object/defineproperties.js rename to dist/3.7.3/max/polyfill/object/defineproperties.js index 741c2753..162f0f13 100644 --- a/dist/3.7.2/max/polyfill/object/defineproperties.js +++ b/dist/3.7.3/max/polyfill/object/defineproperties.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/polyfill/object/defineproperty.js b/dist/3.7.3/max/polyfill/object/defineproperty.js similarity index 99% rename from dist/3.7.2/max/polyfill/object/defineproperty.js rename to dist/3.7.3/max/polyfill/object/defineproperty.js index 475b0bb6..787e0d92 100644 --- a/dist/3.7.2/max/polyfill/object/defineproperty.js +++ b/dist/3.7.3/max/polyfill/object/defineproperty.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/polyfill/object/getownpropertydescriptor.js b/dist/3.7.3/max/polyfill/object/getownpropertydescriptor.js similarity index 98% rename from dist/3.7.2/max/polyfill/object/getownpropertydescriptor.js rename to dist/3.7.3/max/polyfill/object/getownpropertydescriptor.js index 6523c138..0964a9af 100644 --- a/dist/3.7.2/max/polyfill/object/getownpropertydescriptor.js +++ b/dist/3.7.3/max/polyfill/object/getownpropertydescriptor.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/polyfill/object/getownpropertynames.js b/dist/3.7.3/max/polyfill/object/getownpropertynames.js similarity index 98% rename from dist/3.7.2/max/polyfill/object/getownpropertynames.js rename to dist/3.7.3/max/polyfill/object/getownpropertynames.js index d10d97c2..f607a993 100644 --- a/dist/3.7.2/max/polyfill/object/getownpropertynames.js +++ b/dist/3.7.3/max/polyfill/object/getownpropertynames.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/polyfill/object/getprototypeof.js b/dist/3.7.3/max/polyfill/object/getprototypeof.js similarity index 98% rename from dist/3.7.2/max/polyfill/object/getprototypeof.js rename to dist/3.7.3/max/polyfill/object/getprototypeof.js index acea70ab..ffafad37 100644 --- a/dist/3.7.2/max/polyfill/object/getprototypeof.js +++ b/dist/3.7.3/max/polyfill/object/getprototypeof.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/polyfill/object/keys.js b/dist/3.7.3/max/polyfill/object/keys.js similarity index 97% rename from dist/3.7.2/max/polyfill/object/keys.js rename to dist/3.7.3/max/polyfill/object/keys.js index afe1ae8a..33b8cdab 100644 --- a/dist/3.7.2/max/polyfill/object/keys.js +++ b/dist/3.7.3/max/polyfill/object/keys.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/polyfill/string/lcfirst.js b/dist/3.7.3/max/polyfill/string/lcfirst.js similarity index 97% rename from dist/3.7.2/max/polyfill/string/lcfirst.js rename to dist/3.7.3/max/polyfill/string/lcfirst.js index 269b92e0..ee16480d 100644 --- a/dist/3.7.2/max/polyfill/string/lcfirst.js +++ b/dist/3.7.3/max/polyfill/string/lcfirst.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/polyfill/string/trim.js b/dist/3.7.3/max/polyfill/string/trim.js similarity index 97% rename from dist/3.7.2/max/polyfill/string/trim.js rename to dist/3.7.3/max/polyfill/string/trim.js index 7d68cc8f..a1a62723 100644 --- a/dist/3.7.2/max/polyfill/string/trim.js +++ b/dist/3.7.3/max/polyfill/string/trim.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/polyfill/string/ucfirst.js b/dist/3.7.3/max/polyfill/string/ucfirst.js similarity index 97% rename from dist/3.7.2/max/polyfill/string/ucfirst.js rename to dist/3.7.3/max/polyfill/string/ucfirst.js index 82437491..9abb4936 100644 --- a/dist/3.7.2/max/polyfill/string/ucfirst.js +++ b/dist/3.7.3/max/polyfill/string/ucfirst.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/polyfill/window/addeventlistener.js b/dist/3.7.3/max/polyfill/window/addeventlistener.js similarity index 99% rename from dist/3.7.2/max/polyfill/window/addeventlistener.js rename to dist/3.7.3/max/polyfill/window/addeventlistener.js index 1dc5cbf1..ea8c2972 100644 --- a/dist/3.7.2/max/polyfill/window/addeventlistener.js +++ b/dist/3.7.3/max/polyfill/window/addeventlistener.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/polyfill/window/customevent.js b/dist/3.7.3/max/polyfill/window/customevent.js similarity index 98% rename from dist/3.7.2/max/polyfill/window/customevent.js rename to dist/3.7.3/max/polyfill/window/customevent.js index 739be3b3..5ddbaea2 100644 --- a/dist/3.7.2/max/polyfill/window/customevent.js +++ b/dist/3.7.3/max/polyfill/window/customevent.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/polyfill/window/dispatchevent.js b/dist/3.7.3/max/polyfill/window/dispatchevent.js similarity index 99% rename from dist/3.7.2/max/polyfill/window/dispatchevent.js rename to dist/3.7.3/max/polyfill/window/dispatchevent.js index 737fbb45..59ded966 100644 --- a/dist/3.7.2/max/polyfill/window/dispatchevent.js +++ b/dist/3.7.3/max/polyfill/window/dispatchevent.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/polyfill/window/getcomputedstyle.js b/dist/3.7.3/max/polyfill/window/getcomputedstyle.js similarity index 98% rename from dist/3.7.2/max/polyfill/window/getcomputedstyle.js rename to dist/3.7.3/max/polyfill/window/getcomputedstyle.js index b268972b..53242d4f 100644 --- a/dist/3.7.2/max/polyfill/window/getcomputedstyle.js +++ b/dist/3.7.3/max/polyfill/window/getcomputedstyle.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/polyfill/window/matchmedia.js b/dist/3.7.3/max/polyfill/window/matchmedia.js similarity index 99% rename from dist/3.7.2/max/polyfill/window/matchmedia.js rename to dist/3.7.3/max/polyfill/window/matchmedia.js index 2c03a37a..9da78f06 100644 --- a/dist/3.7.2/max/polyfill/window/matchmedia.js +++ b/dist/3.7.3/max/polyfill/window/matchmedia.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/polyfill/window/promise.js b/dist/3.7.3/max/polyfill/window/promise.js similarity index 99% rename from dist/3.7.2/max/polyfill/window/promise.js rename to dist/3.7.3/max/polyfill/window/promise.js index d0304424..bb796f67 100644 --- a/dist/3.7.2/max/polyfill/window/promise.js +++ b/dist/3.7.3/max/polyfill/window/promise.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/polyfill/window/removeeventlistener.js b/dist/3.7.3/max/polyfill/window/removeeventlistener.js similarity index 98% rename from dist/3.7.2/max/polyfill/window/removeeventlistener.js rename to dist/3.7.3/max/polyfill/window/removeeventlistener.js index 5550e4ee..34ff20d8 100644 --- a/dist/3.7.2/max/polyfill/window/removeeventlistener.js +++ b/dist/3.7.3/max/polyfill/window/removeeventlistener.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/pool.js b/dist/3.7.3/max/pool.js similarity index 99% rename from dist/3.7.2/max/pool.js rename to dist/3.7.3/max/pool.js index 018533dc..d37d993c 100644 --- a/dist/3.7.2/max/pool.js +++ b/dist/3.7.3/max/pool.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/pool/array.js b/dist/3.7.3/max/pool/array.js similarity index 97% rename from dist/3.7.2/max/pool/array.js rename to dist/3.7.3/max/pool/array.js index 8a68be66..002800db 100644 --- a/dist/3.7.2/max/pool/array.js +++ b/dist/3.7.3/max/pool/array.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/pool/dom.js b/dist/3.7.3/max/pool/dom.js similarity index 98% rename from dist/3.7.2/max/pool/dom.js rename to dist/3.7.3/max/pool/dom.js index ed62319c..6880de94 100644 --- a/dist/3.7.2/max/pool/dom.js +++ b/dist/3.7.3/max/pool/dom.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/pool/module.js b/dist/3.7.3/max/pool/module.js similarity index 98% rename from dist/3.7.2/max/pool/module.js rename to dist/3.7.3/max/pool/module.js index 980fcd78..a47bb7bf 100644 --- a/dist/3.7.2/max/pool/module.js +++ b/dist/3.7.3/max/pool/module.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/pool/object.js b/dist/3.7.3/max/pool/object.js similarity index 99% rename from dist/3.7.2/max/pool/object.js rename to dist/3.7.3/max/pool/object.js index 88bc1d58..f048f771 100644 --- a/dist/3.7.2/max/pool/object.js +++ b/dist/3.7.3/max/pool/object.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/promise/all.js b/dist/3.7.3/max/promise/all.js similarity index 98% rename from dist/3.7.2/max/promise/all.js rename to dist/3.7.3/max/promise/all.js index 9685f201..7f9ba391 100644 --- a/dist/3.7.2/max/promise/all.js +++ b/dist/3.7.3/max/promise/all.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/promise/defer.js b/dist/3.7.3/max/promise/defer.js similarity index 97% rename from dist/3.7.2/max/promise/defer.js rename to dist/3.7.3/max/promise/defer.js index 57d976cc..0eedf4b5 100644 --- a/dist/3.7.2/max/promise/defer.js +++ b/dist/3.7.3/max/promise/defer.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/promise/race.js b/dist/3.7.3/max/promise/race.js similarity index 98% rename from dist/3.7.2/max/promise/race.js rename to dist/3.7.3/max/promise/race.js index ca9d269e..5120ee5b 100644 --- a/dist/3.7.2/max/promise/race.js +++ b/dist/3.7.3/max/promise/race.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/proxy.js b/dist/3.7.3/max/proxy.js similarity index 97% rename from dist/3.7.2/max/proxy.js rename to dist/3.7.3/max/proxy.js index 9f37c22f..184cb427 100644 --- a/dist/3.7.2/max/proxy.js +++ b/dist/3.7.3/max/proxy.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/renderer.js b/dist/3.7.3/max/renderer.js similarity index 99% rename from dist/3.7.2/max/renderer.js rename to dist/3.7.3/max/renderer.js index f127e249..f170b7f4 100644 --- a/dist/3.7.2/max/renderer.js +++ b/dist/3.7.3/max/renderer.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/support.js b/dist/3.7.3/max/support.js similarity index 99% rename from dist/3.7.2/max/support.js rename to dist/3.7.3/max/support.js index 5ae7af94..7ce74e79 100644 --- a/dist/3.7.2/max/support.js +++ b/dist/3.7.3/max/support.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/support/capability/datauri.js b/dist/3.7.3/max/support/capability/datauri.js similarity index 98% rename from dist/3.7.2/max/support/capability/datauri.js rename to dist/3.7.3/max/support/capability/datauri.js index 0b594465..04256a7d 100644 --- a/dist/3.7.2/max/support/capability/datauri.js +++ b/dist/3.7.3/max/support/capability/datauri.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/support/capability/touch.js b/dist/3.7.3/max/support/capability/touch.js similarity index 97% rename from dist/3.7.2/max/support/capability/touch.js rename to dist/3.7.3/max/support/capability/touch.js index 960393e4..98cf2f6f 100644 --- a/dist/3.7.2/max/support/capability/touch.js +++ b/dist/3.7.3/max/support/capability/touch.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/support/css/borderradius.js b/dist/3.7.3/max/support/css/borderradius.js similarity index 97% rename from dist/3.7.2/max/support/css/borderradius.js rename to dist/3.7.3/max/support/css/borderradius.js index 2532c163..81f74e1d 100644 --- a/dist/3.7.2/max/support/css/borderradius.js +++ b/dist/3.7.3/max/support/css/borderradius.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/support/css/boxshadow.js b/dist/3.7.3/max/support/css/boxshadow.js similarity index 97% rename from dist/3.7.2/max/support/css/boxshadow.js rename to dist/3.7.3/max/support/css/boxshadow.js index 3f67e2f5..80ee4479 100644 --- a/dist/3.7.2/max/support/css/boxshadow.js +++ b/dist/3.7.3/max/support/css/boxshadow.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/support/css/rem.js b/dist/3.7.3/max/support/css/rem.js similarity index 97% rename from dist/3.7.2/max/support/css/rem.js rename to dist/3.7.3/max/support/css/rem.js index da54a0bb..535825d0 100644 --- a/dist/3.7.2/max/support/css/rem.js +++ b/dist/3.7.3/max/support/css/rem.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/support/css/rgba.js b/dist/3.7.3/max/support/css/rgba.js similarity index 97% rename from dist/3.7.2/max/support/css/rgba.js rename to dist/3.7.3/max/support/css/rgba.js index 561ea118..0834c3ed 100644 --- a/dist/3.7.2/max/support/css/rgba.js +++ b/dist/3.7.3/max/support/css/rgba.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/support/css/textshadow.js b/dist/3.7.3/max/support/css/textshadow.js similarity index 97% rename from dist/3.7.2/max/support/css/textshadow.js rename to dist/3.7.3/max/support/css/textshadow.js index e9bc284c..f9e6b917 100644 --- a/dist/3.7.2/max/support/css/textshadow.js +++ b/dist/3.7.3/max/support/css/textshadow.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/support/css/transform.js b/dist/3.7.3/max/support/css/transform.js similarity index 97% rename from dist/3.7.2/max/support/css/transform.js rename to dist/3.7.3/max/support/css/transform.js index 6393d0bf..fa94134f 100644 --- a/dist/3.7.2/max/support/css/transform.js +++ b/dist/3.7.3/max/support/css/transform.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/support/css/transform/2d.js b/dist/3.7.3/max/support/css/transform/2d.js similarity index 98% rename from dist/3.7.2/max/support/css/transform/2d.js rename to dist/3.7.3/max/support/css/transform/2d.js index ed711feb..227e0723 100644 --- a/dist/3.7.2/max/support/css/transform/2d.js +++ b/dist/3.7.3/max/support/css/transform/2d.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/support/css/transform/3d.js b/dist/3.7.3/max/support/css/transform/3d.js similarity index 98% rename from dist/3.7.2/max/support/css/transform/3d.js rename to dist/3.7.3/max/support/css/transform/3d.js index 50076efa..c20e63dd 100644 --- a/dist/3.7.2/max/support/css/transform/3d.js +++ b/dist/3.7.3/max/support/css/transform/3d.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/support/css/transition.js b/dist/3.7.3/max/support/css/transition.js similarity index 97% rename from dist/3.7.2/max/support/css/transition.js rename to dist/3.7.3/max/support/css/transition.js index 2fee1bf4..8f1b1ffb 100644 --- a/dist/3.7.2/max/support/css/transition.js +++ b/dist/3.7.3/max/support/css/transition.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/support/element/canvas.js b/dist/3.7.3/max/support/element/canvas.js similarity index 97% rename from dist/3.7.2/max/support/element/canvas.js rename to dist/3.7.3/max/support/element/canvas.js index 559352b2..20e6bd68 100644 --- a/dist/3.7.2/max/support/element/canvas.js +++ b/dist/3.7.3/max/support/element/canvas.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/support/element/canvas/todataurl.js b/dist/3.7.3/max/support/element/canvas/todataurl.js similarity index 98% rename from dist/3.7.2/max/support/element/canvas/todataurl.js rename to dist/3.7.3/max/support/element/canvas/todataurl.js index b099a769..83ee9835 100644 --- a/dist/3.7.2/max/support/element/canvas/todataurl.js +++ b/dist/3.7.3/max/support/element/canvas/todataurl.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/support/element/canvas/todataurl/jpeg.js b/dist/3.7.3/max/support/element/canvas/todataurl/jpeg.js similarity index 98% rename from dist/3.7.2/max/support/element/canvas/todataurl/jpeg.js rename to dist/3.7.3/max/support/element/canvas/todataurl/jpeg.js index d3c1fe16..c02f8537 100644 --- a/dist/3.7.2/max/support/element/canvas/todataurl/jpeg.js +++ b/dist/3.7.3/max/support/element/canvas/todataurl/jpeg.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/support/element/canvas/todataurl/png.js b/dist/3.7.3/max/support/element/canvas/todataurl/png.js similarity index 98% rename from dist/3.7.2/max/support/element/canvas/todataurl/png.js rename to dist/3.7.3/max/support/element/canvas/todataurl/png.js index 5635ebb4..cddf0c6f 100644 --- a/dist/3.7.2/max/support/element/canvas/todataurl/png.js +++ b/dist/3.7.3/max/support/element/canvas/todataurl/png.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/support/element/canvas/todataurl/webp.js b/dist/3.7.3/max/support/element/canvas/todataurl/webp.js similarity index 98% rename from dist/3.7.2/max/support/element/canvas/todataurl/webp.js rename to dist/3.7.3/max/support/element/canvas/todataurl/webp.js index bd240998..ac0e910c 100644 --- a/dist/3.7.2/max/support/element/canvas/todataurl/webp.js +++ b/dist/3.7.3/max/support/element/canvas/todataurl/webp.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/support/element/svg.js b/dist/3.7.3/max/support/element/svg.js similarity index 97% rename from dist/3.7.2/max/support/element/svg.js rename to dist/3.7.3/max/support/element/svg.js index 84c645b3..9fffe4b8 100644 --- a/dist/3.7.2/max/support/element/svg.js +++ b/dist/3.7.3/max/support/element/svg.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/support/element/video.js b/dist/3.7.3/max/support/element/video.js similarity index 97% rename from dist/3.7.2/max/support/element/video.js rename to dist/3.7.3/max/support/element/video.js index 8380141d..f6dd3884 100644 --- a/dist/3.7.2/max/support/element/video.js +++ b/dist/3.7.3/max/support/element/video.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/support/element/video/mp4.js b/dist/3.7.3/max/support/element/video/mp4.js similarity index 98% rename from dist/3.7.2/max/support/element/video/mp4.js rename to dist/3.7.3/max/support/element/video/mp4.js index 8cba6629..6c724a42 100644 --- a/dist/3.7.2/max/support/element/video/mp4.js +++ b/dist/3.7.3/max/support/element/video/mp4.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/support/element/video/ogg.js b/dist/3.7.3/max/support/element/video/ogg.js similarity index 98% rename from dist/3.7.2/max/support/element/video/ogg.js rename to dist/3.7.3/max/support/element/video/ogg.js index 72db763b..90466fdb 100644 --- a/dist/3.7.2/max/support/element/video/ogg.js +++ b/dist/3.7.3/max/support/element/video/ogg.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/support/element/video/webm.js b/dist/3.7.3/max/support/element/video/webm.js similarity index 98% rename from dist/3.7.2/max/support/element/video/webm.js rename to dist/3.7.3/max/support/element/video/webm.js index 2e0dc01a..7106e90a 100644 --- a/dist/3.7.2/max/support/element/video/webm.js +++ b/dist/3.7.3/max/support/element/video/webm.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/transport.js b/dist/3.7.3/max/transport.js similarity index 98% rename from dist/3.7.2/max/transport.js rename to dist/3.7.3/max/transport.js index 702a770c..85464333 100644 --- a/dist/3.7.2/max/transport.js +++ b/dist/3.7.3/max/transport.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/transport/jsonp.js b/dist/3.7.3/max/transport/jsonp.js similarity index 99% rename from dist/3.7.2/max/transport/jsonp.js rename to dist/3.7.3/max/transport/jsonp.js index a07cd687..49aaf198 100644 --- a/dist/3.7.2/max/transport/jsonp.js +++ b/dist/3.7.3/max/transport/jsonp.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/transport/xhr.js b/dist/3.7.3/max/transport/xhr.js similarity index 99% rename from dist/3.7.2/max/transport/xhr.js rename to dist/3.7.3/max/transport/xhr.js index 3428856e..09f8c876 100644 --- a/dist/3.7.2/max/transport/xhr.js +++ b/dist/3.7.3/max/transport/xhr.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/url.js b/dist/3.7.3/max/url.js similarity index 98% rename from dist/3.7.2/max/url.js rename to dist/3.7.3/max/url.js index ae82c83e..6e518ce4 100644 --- a/dist/3.7.2/max/url.js +++ b/dist/3.7.3/max/url.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/vector/2d.js b/dist/3.7.3/max/vector/2d.js similarity index 99% rename from dist/3.7.2/max/vector/2d.js rename to dist/3.7.3/max/vector/2d.js index 0186c9d4..e21f36cc 100644 --- a/dist/3.7.2/max/vector/2d.js +++ b/dist/3.7.3/max/vector/2d.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/widget/image/adapt.js b/dist/3.7.3/max/widget/image/adapt.js similarity index 99% rename from dist/3.7.2/max/widget/image/adapt.js rename to dist/3.7.3/max/widget/image/adapt.js index 51b9c5bb..778c64c4 100644 --- a/dist/3.7.2/max/widget/image/adapt.js +++ b/dist/3.7.3/max/widget/image/adapt.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/max/worker.js b/dist/3.7.3/max/worker.js similarity index 99% rename from dist/3.7.2/max/worker.js rename to dist/3.7.3/max/worker.js index 414c0e66..3ff54101 100644 --- a/dist/3.7.2/max/worker.js +++ b/dist/3.7.3/max/worker.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/3.7.2/min/asset.js b/dist/3.7.3/min/asset.js similarity index 96% rename from dist/3.7.2/min/asset.js rename to dist/3.7.3/min/asset.js index e8217324..4ec29304 100644 --- a/dist/3.7.2/min/asset.js +++ b/dist/3.7.3/min/asset.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("asset",e,["./emitter","./transport/xhr","./promise/defer","./function/unique/uuid"])}(function(e,o,t,r,n,i,u){"use strict";function a(e){m.push(e),1===m.length&&c()}function c(){l(m[0]).then(function(){m.splice(0,1)&&m.length>=1&&c()},function(){m.splice(0,1)&&m.length>=1&&c()})}function l(e){var o=d[e._uuid],t=o.dfd,r=o.url;return v.get(r,null,f).then(function(n){var u=n.data,a=o.id,c=o.version,l=o.storage;e.emit("loaded",r,a,c,u),l&&(i.cookie=o.cookie+"="+encodeURIComponent(c)+"; expires=Fri, 31 Dec 9999 23:59:59 GMT; path=/",localStorage[l.version]=c,localStorage[l.value]=u,e.emit("stored",r,a,c,u,l.version,l.value)),t.resolve(localStorage[l.value])},function(){t.reject()})}var s,d={},v=e["transport/xhr"],f={cache:!0},g=e["promise/defer"],p=e["function/unique/uuid"],h=new RegExp("/","g"),m=[];return s=e.emitter.extend({_uuid:null,_constructor:function(e,o,t){var r=s._parent._constructor.call(this),n=p(),i=d[n]={dfd:new g,url:e};return r._uuid=n,o&&t&&(i.id=o,i.version=t,i.cookie=encodeURIComponent("qoopido[asset]["+o.replace(h,"][")+"]"),i.storage={version:"@"+o,value:"©"+o}),r},fetch:function(){var e=this,o=d[e._uuid],t=o.dfd,r=o.url,n=o.id,i=o.version,u=o.storage,c=u&&u.version&&localStorage[u.version];if(c&&c>=i){var l=localStorage[o.storage.value];e.emit("hit",r,n,i,l),t.resolve(l)}else e.emit("miss",r,n,i),a(e);return t.promise},clear:function(){var e=this,o=d[e._uuid],t=o.storage;return t&&(i.cookie=o.cookie+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/",delete localStorage[t.version],delete localStorage[t.value],e.emit("cleared",o.url,o.id,o.version)),e}})},window,document); \ No newline at end of file diff --git a/dist/3.7.3/min/base.js b/dist/3.7.3/min/base.js new file mode 100644 index 00000000..b0b475eb --- /dev/null +++ b/dist/3.7.3/min/base.js @@ -0,0 +1,2 @@ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +!function(e,t,r,o,n){"use strict";function c(e,c,i,p){var d,l=e.split("/");return a[e]?a[e]:(d=function(){if(i)for(var d,g,y=l.slice(0,-1).join("/"),j=0;(d=i[j])!==n;j++)g=f.test(d),g&&(d=u(y+"/"+d)),!a[d]&&arguments[j]&&(a[d]=arguments[j]),g&&!a[d]&&"undefined"!=typeof console&&console.error("".concat("[Qoopido.js] ",e,": Could not load dependency ",d));return a[e]=c(a,s,l,t,r,o,n),p&&p(a[e]),a[e]},void("undefined"!=typeof module&&module.exports?module.exports=define(d):"function"==typeof define&&define.amd?i?define(i,d):define(d):d()))}function i(e,t,r){c(e,t,r,function(t){a[e]=t.create()})}function u(e){for(var t;(t=e.replace(l,""))!==e;)e=t;return e.replace(g,"")}var p=r.qoopido||(r.qoopido={}),s=p.shared||(p.shared={}),a=p.modules||(p.modules={}),d=[],f=new RegExp("^\\.+\\/"),l=new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."),g=new RegExp("(^\\/)|\\.\\/","g");p.register=c,p.registerSingleton=i,Object.create||d.push("./polyfill/object/create"),Object.getOwnPropertyNames||d.push("./polyfill/object/getownpropertynames"),Object.getOwnPropertyDescriptor&&function(){try{return Object.getOwnPropertyDescriptor({x:0},"x"),!0}catch(e){return!1}}()||d.push("./polyfill/object/getownpropertydescriptor"),c("base",e,d)}(function(e,t,r,o,n,c,i){"use strict";function u(e){for(var t,r={},o=Object.getOwnPropertyNames(e),n=0;(t=o[n])!==i;n++)r[t]=Object.getOwnPropertyDescriptor(e,t);return r}function p(){throw new Error("[Qoopido.js] Operation prohibited")}return{create:function(){var e,t=Object.create(this,u(this));return t._constructor&&(e=t._constructor.apply(t,arguments)),t.create=t.extend=p,e||t},extend:function(e,t){var r;return e=e||{},t=t===!0,e._parent=this,r=Object.create(this,u(e)),t===!0&&(r.extend=p),r}}},navigator,this,document); \ No newline at end of file diff --git a/dist/3.7.2/min/component/iterator.js b/dist/3.7.3/min/component/iterator.js similarity index 96% rename from dist/3.7.2/min/component/iterator.js rename to dist/3.7.3/min/component/iterator.js index a831e584..21f42cf0 100644 --- a/dist/3.7.2/min/component/iterator.js +++ b/dist/3.7.3/min/component/iterator.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){window.qoopido.register("component/iterator",t,["../emitter","../function/merge"])}(function(t,e,n,s,a,i,r){"use strict";var u,l={loop:!0,initial:0};return u=t.emitter.extend({_settings:null,_state:null,_constructor:function(e,n){var s=u._parent._constructor.call(this);return s._settings=t["function/merge"]({},l,n||{}),s._state={length:null,index:null,item:null,data:null},e!==r&&null!==e&&s.setData(e),s},getState:function(){var t=this;return t._state},setData:function(t){var e=this;return"object"==typeof t&&t.length&&(e._state.data=t,e._state.length=t.length,null!==e._settings.initial&&e.seek(e._settings.initial)),e},getData:function(){var t=this;return t._state.data},getLength:function(){var t=this;return t._state.length},getIndex:function(){var t=this;return t._state.index},getCurrent:function(){var t=this;return t._state.data[t._state.index]||null},getItem:function(t){var e=this;return e._state.data[t]||null},first:function(){var t=this;return t.seek(0)},last:function(){var t=this;return t.seek(t._state.length-1)},previous:function(){var t,e=this;return t=e._settings.loop===!0?(e._state.index-1)%e._state.length:e._state.index-1,t=e._settings.loop===!0&&0>t?e._state.length+t:t,e.seek(t)},next:function(){var t,e=this;return t=e._settings.loop===!0?(e._state.index+1)%e._state.length:e._state.index+1,e.seek(t)},seek:function(t){var e=this;return t=parseInt(t,10),t!==e._state.index&&e._state.data[t]!==r&&(e._state.index=t,e._state.item=e._state.data[t]),e}})}); \ No newline at end of file diff --git a/dist/3.7.2/min/component/remux.js b/dist/3.7.3/min/component/remux.js similarity index 96% rename from dist/3.7.2/min/component/remux.js rename to dist/3.7.3/min/component/remux.js index 542e7509..cc011a06 100644 --- a/dist/3.7.2/min/component/remux.js +++ b/dist/3.7.3/min/component/remux.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){window.qoopido.registerSingleton("component/remux",t,["../emitter","./sense"])}(function(t,n,e,i,o,a,u){"use strict";function r(t,n){var e=this;return t&&n&&(c.className=t,c.style.fontSize=n+"px",d.layout=t,d.fontsize=n,(h.fontsize!==d.fontsize||h.layout!==d.layout)&&(d.ratio.device=o.devicePixelRatio||1,d.ratio.fontsize=d.fontsize/f,d.ratio.total=d.ratio.device*d.ratio.fontsize,h.layout!==d.layout&&e.emit("layoutchanged",d),h.fontsize!==d.fontsize&&e.emit("fontsizechanged",d),e.emit("statechanged",d),h.fontsize=d.fontsize,h.layout=d.layout)),e}function s(n,e,i){var a=this;o.setTimeout(function(){t["component/sense"].create(n).on("matched",function(){r.call(a,e,i)})},0)}var l,c=a.getElementsByTagName("html")[0],f=16,d={fontsize:null,layout:null,ratio:{}},h={fontsize:null,layout:null};return l=t.emitter.extend({_constructor:function(){var t=l._parent._constructor.call(this),n=parseInt(c.getAttribute("data-base"),10);return isNaN(n)===!1&&(f=n),t},getState:function(){return d},getLayout:function(){return d.layout},getFontsize:function(){return d.fontsize},setLayout:function(t,n){var e=this;return r.call(e,t,n),e},addLayout:function(t,n){var e,i,o,a,u,r,l,c,d=this;arguments.length>1?(e={},e[t]=n):e=arguments[0];for(i in e)for(o=e[i],a=o.min;a<=o.max;a++)l=Math.round(o.width*(a/f)),c=Math.round(o.width*((a+1)/f))-1,s.call(d,"screen and (min-width: "+l+"px) and (max-width: "+c+"px )",i,a),u=!u||l=r.width?{width:c,fontsize:a,layout:i}:r;return s.call(d,"screen and (max-width: "+(u.width-1)+"px)",u.layout,u.fontsize),s.call(d,"screen and (min-width: "+(r.width+1)+"px)",r.layout,r.fontsize),d}})}); \ No newline at end of file diff --git a/dist/3.7.2/min/component/sense.js b/dist/3.7.3/min/component/sense.js similarity index 89% rename from dist/3.7.2/min/component/sense.js rename to dist/3.7.3/min/component/sense.js index c39ef8a7..5bbf020d 100644 --- a/dist/3.7.2/min/component/sense.js +++ b/dist/3.7.3/min/component/sense.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){var e=["../emitter"];window.matchMedia||e.push("../polyfill/window/matchmedia"),window.qoopido.register("component/sense",t,e)}(function(t,e,n,i,c,r,o){"use strict";function a(){var t=this,e=t.mql;t.emit(e.matches===!0?"matched":"dematched")}var m,s={};return m=t.emitter.extend({mql:null,_constructor:function(t){var e=m._parent._constructor.call(this),n=e.mql=s[t]||(s[t]=c.matchMedia(t)),i=function(){a.call(e)};return n.addListener(i),c.setTimeout(i,0),e},matches:function(){return this.mql.matches}})}); \ No newline at end of file diff --git a/dist/3.7.2/min/dom/collection.js b/dist/3.7.3/min/dom/collection.js similarity index 98% rename from dist/3.7.2/min/dom/collection.js rename to dist/3.7.3/min/dom/collection.js index a2e321ea..e15ba178 100644 --- a/dist/3.7.2/min/dom/collection.js +++ b/dist/3.7.3/min/dom/collection.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("dom/collection",e,["../base","./element"])}(function(e,t,n,r,l,o,s){"use strict";function i(){for(var e,t=this,n=t.elements,r=o.createDocumentFragment(),l=0;(e=n[l])!==s;l++)r.appendChild(e.element);return r}function c(e){for(var t,n=this,r=n.elements,l=Array.prototype.slice.call(arguments,1),o=0;(t=r[o])!==s;o++)t[e].apply(t,l);return n}function a(e,t){var n=this;return e=e&&e.element?e:p&&p.obtain(e)||u.create(e),e&&(e[t].call(e,i.call(n)),e.dispose&&e.dispose()),n}var u=e["dom/element"],p=e["pool/module"]&&e["pool/module"].create(u,null,!0)||null;return e.base.extend({elements:null,_constructor:function(e,t,n){var r,l,i,c,a=this;if(a.elements=[],e&&"string"==typeof e)for(r=e.split(","),e=[],i=0;(l=r[i])!==s;i++)try{e=e.concat(Array.prototype.slice.call(o.querySelectorAll(l)))}catch(f){}for(i=0;(c=e[i])!==s;i++)a.elements.push(p&&p.obtain(c)||u.create(c));return"object"==typeof t&&null!==t&&a.setAttributes(t),"object"==typeof n&&null!==n&&a.setStyles(n),a},get:function(e){return this.elements[e]||null},each:function(e){for(var t,n=this,r=n.elements,l=0;(t=r[l])!==s;l++)e.call(t,l);return n},setAttribute:function(e,t){return c.call(this,"setAttribute",e,t)},setAttributes:function(e){return c.call(this,"setAttributes",e)},removeAttribute:function(e){return c.call(this,"removeAttribute",e)},removeAttributes:function(e){return c.call(this,"removeAttributes",e)},setStyle:function(e,t){return c.call(this,"setStyle",e,t)},setStyles:function(e){return c.call(this,"setStyles",e)},removeStyle:function(e){return c.call(this,"removeStyle",e)},removeStyles:function(e){return c.call(this,"removeStyles",e)},addClass:function(e){return c.call(this,"addClass",e)},removeClass:function(e){return c.call(this,"removeClass",e)},toggleClass:function(e){return c.call(this,"toggleClass",e)},prependTo:function(e){return a.call(this,e,"prepend")},appendTo:function(e){return a.call(this,e,"append")},insertBefore:function(e){var t=this;return e=e&&e.element?e:p&&p.obtain(e)||u.create(e),e&&(e.element.parentNode.insertBefore(i.call(t),e.element),e.dispose&&e.dispose()),t},insertAfter:function(e){var t=this;return e=e&&e.element?e:p&&p.obtain(e)||u.create(e),e&&(e.element.nextSibling?e.element.parentNode.insertBefore(i.call(t),e.element.nextSibling):e.element.appendChild(i.call(t)),e.dispose&&e.dispose()),t},replace:function(e){for(var t,n=this,r=n.elements,l=0;(t=r[l])!==s;l++)0===l?t.replace(e):t.insertAfter(r[l-1]);return n},hide:function(){return c.call(this,"hide")},show:function(){return c.call(this,"show")},remove:function(e){var t,n,r=this,l=r.elements;if(!e&&0!==e||(n=r.elements[e])===s)for(t=l.length-1;(n=l[t])!==s;t--)n.remove(),n.dispose&&n.dispose(),l.pop();else n.remove(),n.dispose&&n.dispose(),l.splice(e,1);return r},on:function(){return c.apply(this,["on"].concat(Array.prototype.slice.call(arguments)))},one:function(e){return c.apply(this,["one"].concat(Array.prototype.slice.call(arguments)))},off:function(e,t){return c.apply(this,["off"].concat(Array.prototype.slice.call(arguments)))},emit:function(e,t){return c.apply(this,["emit"].concat(Array.prototype.slice.call(arguments)))}})}); \ No newline at end of file diff --git a/dist/3.7.2/min/dom/element.js b/dist/3.7.3/min/dom/element.js similarity index 99% rename from dist/3.7.2/min/dom/element.js rename to dist/3.7.3/min/dom/element.js index 88f1f57c..01884a71 100644 --- a/dist/3.7.2/min/dom/element.js +++ b/dist/3.7.3/min/dom/element.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){var t=["../base","../function/unique/uuid","../hook/css","./event"];window.CustomEvent||t.push("../polyfill/window/customevent"),window.addEventListener||t.push("../polyfill/window/addeventlistener"),window.removeEventListener||t.push("../polyfill/window/removeeventlistener"),window.dispatchEvent||t.push("../polyfill/window/dispatchevent"),Element.prototype.matches||t.push("../polyfill/element/matches"),document.querySelector||t.push("../polyfill/document/queryselector"),document.querySelectorAll||t.push("../polyfill/document/queryselectorall"),String.prototype.trim||t.push("../polyfill/string/trim"),window.qoopido.register("dom/element",e,t)}(function(e,t,n,r,i,o,s){"use strict";function l(e){var t,n,r;for(t in q)n=q[t],(!n.regex||n.regex.test(e))&&(r=n);return r}function u(e,t,n){var r=this,i=l(e),s=o.createEvent(i.type);s[i.method](e,"load"===e?!1:!0,!0,t),n&&(s._quid=n,s.isDelegate=!0),r.element.dispatchEvent(s)}function a(e){var t;if("string"==typeof e)try{b.test(e)===!0?(t=e.replace(b,"$1").toLowerCase(),e=o.createElement(t)):e=o.querySelector(e)}catch(n){e=null}if(!e)throw new Error("[Qoopido.js] Element could not be resolved");return e}function c(e){return Array.prototype.concat.apply([],Array.prototype.splice.call(e,0)).join(" ").split(w)}function f(e,t){for(var n,r=0;(n=e.path[r])!==s;r++){if(n.matches(t))return e.currentTarget=n,!0;if(n===e.currentTarget)break}return!1}var m="object",p="string",d=e["function/unique/uuid"],h=o.getElementsByTagName("head")[0],v="textContent"in o.createElement("a")?"textContent":"innerText",g="undefined"!=typeof h.previousElementSibling?function(){return this.previousElementSibling}:function(){for(var e=this;e=e.previousSibling;)if(1===e.nodeType)return e},y="undefined"!=typeof h.nextElementSibling?function(){return this.nextElementSibling}:function(){for(var e=this;e=e.nextSibling;)if(1===e.nodeType)return e},b=new RegExp("^<(\\w+)\\s*/>$"),E=new RegExp("^[^-]+"),w=new RegExp(" +","g"),S=e["pool/module"]&&e["pool/module"].create(e["dom/event"],null,!0)||null,C=e["hook/css"],A={},q={custom:{type:"CustomEvent",method:"initCustomEvent"},html:{regex:new RegExp("^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$"),type:"HTMLEvents",method:"initEvent"},mouse:{regex:new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"),type:"MouseEvents",method:"initMouseEvent"}};return e.base.extend({type:null,element:null,_listener:null,_constructor:function(e,t,n){var r,i=this;return e=a(e),r=e._quid,r?i=A[r]:(r=e._quid=d(),i.type=e.tagName,i.element=e,i._listener={},A[r]=i),"object"==typeof t&&null!==t&&i.setAttributes(t),"object"==typeof n&&null!==n&&i.setStyles(n),i!==this&&this.dispose&&this.dispose(),i},_obtain:function(e,t,n){this._constructor(e,t,n)},_dispose:function(){var e,t,n=this;for(e in n._listener)t=e.match(E),n.element.removeEventListener(t,n._listener[e]),delete n._listener[e];n.type=null,n.element=null},getContent:function(e){var t=this.element;return e&&e!==!1?t.innerHTML:t[v]},setContent:function(e,t){var n=this,r=n.element;return t&&t!==!1?r.innerHTML=e:r[v]=e,n},getAttribute:function(e){var t=this;return e&&typeof e===p?t.element.getAttribute(e):void 0},getAttributes:function(){for(var e,t=this,n={},r=c(arguments),i=0;(e=r[i])!==s;i++)n[e]=t.element.getAttribute(e);return n},setAttribute:function(e,t){var n=this;return e&&typeof e===p&&n.element.setAttribute(e,t),n},setAttributes:function(e){var t,n=this;if(e&&typeof e===m&&!e.length)for(t in e)n.element.setAttribute(t,e[t]);return n},removeAttribute:function(e){var t=this;return e&&typeof e===p&&t.element.removeAttribute(e),t},removeAttributes:function(){for(var e,t=this,n=c(arguments),r=0;(e=n[r])!==s;r++)t.element.removeAttribute(e);return t},getStyle:function(e){var t=this;return e&&typeof e===p?C.process("get",t.element,e):void 0},getStyles:function(){for(var e,t=this,n={},r=c(arguments),i=0;(e=r[i])!==s;i++)n[e]=C.process("get",t.element,e);return n},setStyle:function(e,t){var n=this;return e&&typeof e===p&&C.process("set",n.element,e,t),n},setStyles:function(e){var t,n=this;if(e&&typeof e===m&&!e.length)for(t in e)C.process("set",n.element,t,e[t]);return n},removeStyle:function(e){var t=this;return e&&typeof e===p&&t.setStyle(e,""),t},removeStyles:function(){for(var e,t=this,n=c(arguments),r=0;(e=n[r])!==s;r++)t.setStyle(e,"");return t},siblings:function(e){for(var t=this.element,n=t.parentNode.firstChild,r=[];n;n=y.call(n))n===t||e&&!n.matches(e)||r.push(n);return r},siblingsBefore:function(e){for(var t=this.element.previousSibling,n=[];t;t=g.call(t))(!e||t.matches(e))&&n.push(t);return n},siblingsAfter:function(e){for(var t=this.element.nextSibling,n=[];t;t=y.call(t))(!e||t.matches(e))&&n.push(t);return n},previous:function(e){var t=g.call(this.element);if(!e)return t;for(;t;t=g.call(t))if(t.matches(e))return t},next:function(e){var t=y.call(this.element);if(!e)return t;for(;t;t=y.call(t))if(t.matches(e))return t},find:function(e){var t,n,r=this.element;return e=e.trim(),">"===e.charAt(0)?(t=r._quid,r.setAttribute("data-quid",t),e='[data-quid="'+t+'"] '+e,n=r.parentNode.querySelectorAll(e),r.removeAttribute("data-quid")):n=r.querySelectorAll(e),n},parent:function(e){var t;if(!e)return this.element.parentNode;for(t=this.element;t;t=t.parentNode)if(t.matches(e))return t},parents:function(e){for(var t=this.element.parentNode,n=[];t;t=t.parentNode){if(9===t.nodeType)return n;1===t.nodeType&&(!e||t.matches(e))&&n.push(t)}},isVisible:function(){var e=this,t=e.element;return!(t.offsetWidth<=0&&t.offsetHeight<=0||"hidden"===e.getStyle("visibility")||e.getStyle("opacity")<=0)},hasClass:function(e){return e?new RegExp("(?:^|\\s)"+e+"(?:\\s|$)").test(this.element.className):!1},addClass:function(e){var t=this;return e&&!t.hasClass(e)&&(t.element.className+=t.element.className?" "+e:e),t},removeClass:function(e){var t=this;return e&&t.hasClass(e)&&(t.element.className=t.element.className.replace(new RegExp("(?:^|\\s)"+e+"(?!\\S)"),"")),t},toggleClass:function(e){var t=this;return e&&(t.hasClass(e)?t.removeClass(e):t.addClass(e)),t},prepend:function(e){var t=this,n=t.element;if(e)try{e=e.element||a(e),n.firstChild?n.insertBefore(e,n.firstChild):t.append(e)}catch(r){n.insertAdjacentHTML("afterBegin",e)}return t},append:function(e){var t=this,n=t.element;if(e)try{n.appendChild(e.element||a(e))}catch(r){n.insertAdjacentHTML("beforeEnd",e)}return t},prependTo:function(e){var t=this,n=t.element;return e&&((e=e.element||a(e)).firstChild?e.insertBefore(n,e.firstChild):t.appendTo(e)),t},appendTo:function(e){var t=this;return e&&(e.element||a(e)).appendChild(t.element),t},insertBefore:function(e){var t=this,n=t.element;return e&&(e=e.element||a(e)).parentNode.insertBefore(n,e),t},insertAfter:function(e){var t=this,n=t.element;return e&&((e=e.element||a(e)).nextSibling?e.parentNode.insertBefore(n,e.nextSibling):t.appendTo(e.parentNode)),t},replace:function(e){var t=this,n=t.element;return e&&(e=e.element||a(e)).parentNode.replaceChild(n,e),t},replaceWith:function(e){var t=this,n=t.element;return e&&(e=e.element||a(e),n.parentNode.replaceChild(e,n)),t},remove:function(){var e=this,t=e.element;return t.parentNode.removeChild(t),e},on:function(t){var n,r=this,i=r.element,o=arguments.length>2?arguments[1]:null,l=arguments.length>2?arguments[2]:arguments[1],a=l._quid||(l._quid=d()),c=0;for(t=t.split(" ");(n=t[c])!==s;c++){var m=n+"-"+a,p=function(t){var n;t=S&&S.obtain(t)||e["dom/event"].create(t),t.isPropagationStopped||(n=t.delegate,t._quid=d(),(!o||f(t,o))&&l.call(t.currentTarget,t,t.originalEvent.detail),n&&(delete t.delegate,u.call(r,n))),t.dispose&&t.dispose()};p.type=n,r._listener[m]=p,i.addEventListener(n,p)}return r},one:function(e){var t=this,n=arguments.length>3||"string"==typeof arguments[1]?arguments[1]:null,r=arguments.length>3||"function"==typeof arguments[2]?arguments[2]:arguments[1],i=(arguments.length>3?arguments[3]:arguments[2])!==!1,o=function(n){t.off(i===!0?n.type:e,o),r.call(this,n,n.originalEvent.detail)};return r._quid=o._quid=d(),n?t.on(e,n,o):t.on(e,o),t},off:function(e,t){var n,r,i,o=this,l=o.element,u=0;for(e=e.split(" ");(n=e[u])!==s;u++)r=t._quid&&n+"-"+t._quid||null,i=r&&o._listener[r]||null,i?(l.removeEventListener(n,i),delete o._listener[r]):l.removeEventListener(n,t);return o},emit:function(e,t){var n=this;return u.call(n,e,t),n}})}); \ No newline at end of file diff --git a/dist/3.7.2/min/dom/element/emerge.js b/dist/3.7.3/min/dom/element/emerge.js similarity index 97% rename from dist/3.7.2/min/dom/element/emerge.js rename to dist/3.7.3/min/dom/element/emerge.js index f2b2056b..cbc1a847 100644 --- a/dist/3.7.2/min/dom/element/emerge.js +++ b/dist/3.7.3/min/dom/element/emerge.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){window.qoopido.register("dom/element/emerge",t,["../element","../../function/merge","../../function/unique/uuid"])}(function(t,e,i,o,r,n,l){"use strict";function p(t){var e,i=d[t];for(e in i)"length"!==e&&g.call(i[e]);0===i.length&&(r.element.clearInterval(c[t]),delete c[t])}function s(){a.left=0,a.top=0,a.right=r.innerWidth||m.clientWidth,a.bottom=r.innerHeight||m.clientHeight}function h(){var t=this,e=t._settings.threshold,i=e!==l?e:m.clientWidth*t._settings.auto,o=e!==l?e:m.clientHeight*t._settings.auto;t._viewport.left=a.left-i,t._viewport.top=a.top-o,t._viewport.right=a.right+i,t._viewport.bottom=a.bottom+o}function g(){var t,e=this,i=!1,o=2;!e.isVisible()||"hidden"===e.getStyle("visibility")&&e._settings.visibility!==!1||(t=e.element.getBoundingClientRect(),(t.bottom>=e._viewport.top&&t.bottom<=e._viewport.bottom||t.top>=e._viewport.top&&t.top<=e._viewport.bottom||e._viewport.bottom>=t.top&&e._viewport.bottom<=t.bottom||e._viewport.top>=t.top&&e._viewport.top<=t.bottom)&&(t.left>=e._viewport.left&&t.left<=e._viewport.right||t.right>=e._viewport.left&&t.right<=e._viewport.right||e._viewport.left>=t.left&&e._viewport.left<=t.right||e._viewport.right>=t.left&&e._viewport.right<=t.right)&&((0===e._settings.threshold||(t.bottom>=a.top&&t.bottom<=a.bottom||t.top>=a.top&&t.top<=a.bottom||a.bottom>=t.top&&a.bottom<=t.bottom||a.top>=t.top&&a.top<=t.bottom)&&(t.left>=a.left&&t.left<=a.right||t.right>=a.left&&t.right<=a.right||a.left>=t.left&&a.left<=t.right||a.right>=t.left&&a.right<=t.right))&&(o=1),i=!0)),(i!==e._state||i===!0&&o!==e._priority)&&u.call(e,i,o)}function u(t,e){var i=this;i._state=t,i._priority=e,i._settings.recur!==!0&&i.remove(),t===!0?i.emit(f,e):i.emit(w)}var v,_={interval:50,threshold:"auto",recur:!0,auto:1,visibility:!0},m=r.document.documentElement,a={},c={},d={},f="emerged",w="demerged",b="resize orientationchange";if(r=t["dom/element"].create(r),"CSS1Compat"!==n.compatMode)throw"[Qoopido.js] Not in standards mode";return v=t["dom/element"].extend({_quid:null,_viewport:null,_settings:null,_state:null,_priority:null,_constructor:function(e,i){var o=v._parent._constructor.call(this,e);return i=t["function/merge"]({},_,i||{}),"auto"===i.threshold&&delete i.threshold,c[i.interval]===l&&(d[i.interval]=d[i.interval]||{length:0},c[i.interval]=r.element.setInterval(function(){p(i.interval)},i.interval)),o._quid=t["function/unique/uuid"](),o._viewport={},o._settings=i,o._state=!1,o._priority=2,d[i.interval][o._quid]=o,d[i.interval].length++,r.on(b,function(){h.call(o)}),h.call(o),o},remove:function(){var t=this;delete d[t._settings.interval][t._quid],d[t._settings.interval].length--}}),r.on(b,s),s(),v}); \ No newline at end of file diff --git a/dist/3.7.2/min/dom/element/lazyimage.js b/dist/3.7.3/min/dom/element/lazyimage.js similarity index 92% rename from dist/3.7.2/min/dom/element/lazyimage.js rename to dist/3.7.3/min/dom/element/lazyimage.js index 50c74290..02751eed 100644 --- a/dist/3.7.2/min/dom/element/lazyimage.js +++ b/dist/3.7.3/min/dom/element/lazyimage.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("dom/element/lazyimage",e,["./emerge","../../function/merge"])}(function(e,t,r,n,o,i,a){"use strict";function u(){var e=this,t=e._settings.attribute;d+=1,e.emit(l).one(h,function(t){e.emit(t.type===v?s:f),d-=1},!1).setAttribute("src",e.getAttribute(t)).removeAttribute(t)}var c,m={interval:50,threshold:"auto",attribute:"data-lazyimage"},d=0,l="requested",s="loaded",f="failed",g="emerged",v="load",b="error",h="".concat(v," ",b);return c=e["dom/element/emerge"].extend({_constructor:function(t,r){var n=c._parent._constructor.call(this,t,e["function/merge"]({},m,r||{}));return n.on(g,function o(e){(0===d||1===e.data)&&(n.remove(),n.off(g,o),u.call(n))}),n}})}); \ No newline at end of file diff --git a/dist/3.7.2/min/dom/element/shrinkimage.js b/dist/3.7.3/min/dom/element/shrinkimage.js similarity index 97% rename from dist/3.7.2/min/dom/element/shrinkimage.js rename to dist/3.7.3/min/dom/element/shrinkimage.js index 4d1c32f4..757ecbc0 100644 --- a/dist/3.7.2/min/dom/element/shrinkimage.js +++ b/dist/3.7.3/min/dom/element/shrinkimage.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){var e=["../element","../../proxy","../../function/merge","../../url","../../support","../../support/capability/datauri","../../support/element/canvas/todataurl/png","../../transport/xhr"];window.qoopido.register("dom/element/shrinkimage",t,e)}(function(t,e,n,i,a,r,o){"use strict";function l(e,n){e=t.url.resolve(v.exec(e)[1]),n=n===!0;var i=this,a=t["function/merge"]({},i._settings,t.url.getParameter(e)),r=a.target||(e=e.split("?")[0]).replace(x,"".concat(".q",a.quality,".shrunk"));n||i.removeAttribute(i._settings.attribute).hide(),_.then(function(){if(a.debug===!0)throw new Error("[Qoopido.js] Debug enabled");switch(typeof w[r]){case"object":w[r].one(E,function(t){c.call(i,t.data,n)}),i.emit(k);break;case"string":c.call(i,w[r],n);break;default:w[r]=h.create(r,n?null:i.element).one(A,function(t,a){t.type===E?(w[r]=a,i.emit(I),c.call(i,a,n)):(w[r]=e,c.call(i,e,n))},!1)}})["catch"](function(){w[r]=e,c.call(i,e,n)})}function c(t,e){var n=this;e?(n.setStyle("backgroundImage","url("+t+")"),n.emit(E)):n.one(R,function(){n.show(),n.emit(E)}).setAttribute("src",t)}function u(t){var e=this;t.get(e._url).then(function(t){try{var n=g.parse(t.data);n.width=parseInt(n.width,10),n.height=parseInt(n.height,10),s.call(e,n)}catch(i){e.emit(q)}},function(){e.emit(q)})}function s(t){var e,n,i=this,a=function(a){return e=b&&b.obtain("canvas")||r.createElement("canvas"),e.style.display="none",e.width=t.width,e.height=t.height,n=e.getContext("2d"),n.clearRect(0,0,t.width,t.height),n.drawImage(i.element,0,0,t.width,t.height),i.one(R,o).setAttribute("src",t.alpha),p(a)},o=function(a){var r;return n.globalCompositeOperation="xor",n.drawImage(i.element,0,0,t.width,t.height),r=e.toDataURL("image/png"),l(),i.emit(E,r),p(a)},l=function(){e&&e.dispose&&e.dispose(),i.element.dispose&&i.element.dispose()};i.one(D,function(t){t.type===R?a.call(this,t):(l(),i.emit(q))},!1).setAttribute("src",t.main)}function p(t){return t.preventDefault(),t.stopPropagation(),!1}var d,h,g=a.JSON,m=n.pop(),f={attribute:"data-"+m,quality:80,debug:!1},b=e.pool&&e.pool.dom||null,w={},y=new RegExp('^url\\x28"{0,1}data:image/shrink,(.+?)"{0,1}\\x29$',"i"),v=new RegExp('^(?:url\\x28"{0,1}|)(?:data:image/shrink,|)(.+?)(?:"{0,1}\\x29|)$',"i"),x=new RegExp("\\.png$","i"),_=t.support.testMultiple("/capability/datauri","/element/canvas/todataurl/png"),k="queued",I="cached",E="loaded",q="failed",A="".concat(E," ",q),R="load",S="error",D="".concat(R," ",S);return d=t["dom/element"].extend({_constructor:function(e,n){var i,a,r=d._parent._constructor.call(this,e);return r._settings=n=t["function/merge"]({},f,n),i=r.getAttribute(n.attribute),a=r.getStyle("backgroundImage"),"IMG"===r.type&&l.call(r,i),"none"!==a&&y.test(a)&&l.call(r,a,!0),r},hide:function(){this.setStyles({visibility:"hidden",opacity:0})},show:function(){this.setStyles({visibility:"",opacity:""})}}),h=t["dom/element"].extend({_url:null,_constructor:function(e,n){var i;return n||(n=b&&b.obtain("img")||r.createElement("img")),i=h._parent._constructor.call(this,n),i._url=e,u.call(i,t["transport/xhr"]),i}}),d},window); \ No newline at end of file diff --git a/dist/3.7.2/min/dom/event.js b/dist/3.7.3/min/dom/event.js similarity index 94% rename from dist/3.7.2/min/dom/event.js rename to dist/3.7.3/min/dom/event.js index 07030c20..13ec030d 100644 --- a/dist/3.7.2/min/dom/event.js +++ b/dist/3.7.3/min/dom/event.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("dom/event",e,["../base","../hook/event"])}(function(e,t,o,i,n,a,r){"use strict";var p=e["hook/event"];return e.base.extend({originalEvent:null,isDelegate:!1,isDefaultPrevented:!1,isPropagationStopped:!1,isImmediatePropagationStopped:!1,_properties:null,_constructor:function(e){var t=this;return t._properties=[],t._obtain(e),t},_obtain:function(e){p.process(this,e)},_dispose:function(){for(var e,t=this,o=0;(e=t._properties[o])!==r;o++)delete t[e];delete t.delegate,t.originalEvent=null,t.isDelegate=!1,t.isDefaultPrevented=!1,t.isPropagationStopped=!1,t.isImmediatePropagationStopped=!1,t._properties.length=0},preventDefault:function(){var e=this,t=e.originalEvent;t.cancelable!==!1&&(e.isDefaultPrevented=!0,t.preventDefault?t.preventDefault():t.returnValue=!1)},stopPropagation:function(){var e=this,t=e.originalEvent;e.isPropagationStopped=!0,t.stopPropagation&&t.stopPropagation(),t.cancelBubble=!0},stopImmediatePropagation:function(){var e=this,t=e.originalEvent;e.isImmediatePropagationStopped=!0,t.stopImmediatePropagation&&t.stopImmediatePropagation(),e.stopPropagation()}})}); \ No newline at end of file diff --git a/dist/3.7.2/min/emitter.js b/dist/3.7.3/min/emitter.js similarity index 95% rename from dist/3.7.2/min/emitter.js rename to dist/3.7.3/min/emitter.js index 1b174581..5f5611a2 100644 --- a/dist/3.7.2/min/emitter.js +++ b/dist/3.7.3/min/emitter.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("emitter",e,["./base"])}(function(e,t,n,r,i,s,l){"use strict";function o(e,t){var n=t.charAt(0).toUpperCase()+t.slice(1);return e._mapped[t]=e[t],function(){var r,i=Array.prototype.slice.call(arguments);return e.emit.apply(e,["pre"+n,i]),r=e._mapped[t].apply(e,i),e.emit.apply(e,["post"+n,i,r]),r}}var p=/^(_|extend$|create$|on$|one$|off$|emit$|get.+)/;return e.base.extend({_mapped:null,_listener:null,_temp:null,_constructor:function(){var e,t=this;t._mapped={},t._listener={};for(e in t)"function"==typeof t[e]&&p.test(e)===!1&&(t[e]=o(t,e));return t},on:function(e,t){var n,r=this,i=0;for(e=e.split(" ");(n=e[i])!==l;i++)(r._listener[n]=r._listener[n]||[]).push(t);return r},one:function(e,t,n){n=n!==!1;var r=this;return r.on(e,function i(s){r.off(n===!0?s:e,i),t.apply(this,arguments)}),r},off:function(e,t){var n,r,i,s=this,o=0;if(e)for(e=e.split(" ");(n=e[o])!==l;o++)if(s._listener[n]=s._listener[n]||[],t)for(r=0;(i=s._listener[n][r])!==l;r++)i===t&&(s._listener[n].splice(r,1),r--);else s._listener[n].length=0;else for(n in s._listener)s._listener[n].length=0;return s},emit:function(e){var t,n=this,r=0;if(e!==l){for(n._listener[e]=n._listener[e]||[],n._temp=n._listener[e].slice();(t=n._temp[r])!==l;r++)t.apply(n,arguments);n._temp.length=0}return n}})}); \ No newline at end of file diff --git a/dist/3.7.2/min/function/load/css.js b/dist/3.7.3/min/function/load/css.js similarity index 86% rename from dist/3.7.2/min/function/load/css.js rename to dist/3.7.3/min/function/load/css.js index d4d785cb..8ed95531 100644 --- a/dist/3.7.2/min/function/load/css.js +++ b/dist/3.7.3/min/function/load/css.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("function/load/css",e)}(function(e,t,n,i,o,r,s){"use strict";var a={};return function(e,t){t=t||"all";var n,i=e+":"+t,s=a[i];return s||(s=a[i]=r.createElement("link"),n=r.getElementsByTagName("script")[0],s.rel="stylesheet",s.media="only x",s.href=e,n.parentNode.insertBefore(s,n),o.setTimeout(function(){s.media=t})),s}},window,document); \ No newline at end of file diff --git a/dist/3.7.2/min/function/merge.js b/dist/3.7.3/min/function/merge.js similarity index 86% rename from dist/3.7.2/min/function/merge.js rename to dist/3.7.3/min/function/merge.js index 61312fa3..e8aa4f6d 100644 --- a/dist/3.7.2/min/function/merge.js +++ b/dist/3.7.3/min/function/merge.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){window.qoopido.register("function/merge",t)}(function(t,e,n,o,r,u,f){"use strict";return function i(){var t,e,n,o,r,u=arguments[0];for(t=1;(e=arguments[t])!==f;t++)for(n in e)o=u[n],r=e[n],r!==f&&(null!==r&&"object"==typeof r?(o=r.length!==f?o&&"object"==typeof o&&o.length!==f?o:[]:o&&"object"==typeof o&&o.length===f?o:{},u[n]=i(o,r)):u[n]=r);return u}}); \ No newline at end of file diff --git a/dist/3.7.2/min/function/proximity.js b/dist/3.7.3/min/function/proximity.js similarity index 89% rename from dist/3.7.2/min/function/proximity.js rename to dist/3.7.3/min/function/proximity.js index 6516299a..a48f03b5 100644 --- a/dist/3.7.2/min/function/proximity.js +++ b/dist/3.7.3/min/function/proximity.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){window.qoopido.register("function/proximity",t)}(function(t,a,o,r,e,y,x){"use strict";return function(t,a){var o=!1;return t="object"==typeof t&&null!==t?t:{x:x,y:x},a="object"==typeof a&&null!==a?a:{x:x,y:x},t.x!==x&&t.y!==x&&a.x!==x&&a.y!==x&&(t.x=parseFloat(t.x),t.y=parseFloat(t.y),a.x=parseFloat(a.x),a.y=parseFloat(a.y),o={x:parseFloat(Math.abs(a.x-t.x)),y:parseFloat(Math.abs(a.y-t.y)),total:parseFloat(Math.sqrt(Math.pow(a.x-t.x,2)+Math.pow(a.y-t.y,2)))}),o}}); \ No newline at end of file diff --git a/dist/3.7.2/min/function/unique/string.js b/dist/3.7.3/min/function/unique/string.js similarity index 86% rename from dist/3.7.2/min/function/unique/string.js rename to dist/3.7.3/min/function/unique/string.js index bd8e2c4b..69ace740 100644 --- a/dist/3.7.2/min/function/unique/string.js +++ b/dist/3.7.3/min/function/unique/string.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(n){window.qoopido.register("function/unique/string",n)}(function(n,t,r,e,i,o,u){"use strict";function f(n){var t="",r=0;for(n=parseInt(n,10)||12;n>r;r++)t+=s[parseInt(Math.random()*(s.length-1),10)];return t}var a={},s="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");return function(n){var t;do t=f(n);while("undefined"!=typeof a[t]);return a[t]=!0,t}}); \ No newline at end of file diff --git a/dist/3.7.2/min/function/unique/uuid.js b/dist/3.7.3/min/function/unique/uuid.js similarity index 86% rename from dist/3.7.2/min/function/unique/uuid.js rename to dist/3.7.3/min/function/unique/uuid.js index 75a643d8..82f81223 100644 --- a/dist/3.7.2/min/function/unique/uuid.js +++ b/dist/3.7.3/min/function/unique/uuid.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(x){window.qoopido.register("function/unique/uuid",x)}(function(x,n,r,t,e,u,i){"use strict";function o(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(f,function(x){var n=16*Math.random()|0,r="x"===x?n:3&n|8;return r.toString(16)})}var c={},f=new RegExp("[xy]","g");return function(){var x;do x=o();while("undefined"!=typeof c[x]);return c[x]=!0,x}}); \ No newline at end of file diff --git a/dist/3.7.2/min/hook/css.js b/dist/3.7.3/min/hook/css.js similarity index 93% rename from dist/3.7.2/min/hook/css.js rename to dist/3.7.3/min/hook/css.js index 211c05a8..16f9a443 100644 --- a/dist/3.7.2/min/hook/css.js +++ b/dist/3.7.3/min/hook/css.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){var e=["../base","../support"];window.getComputedStyle||e.push("../polyfill/window/getcomputedstyle"),window.qoopido.registerSingleton("hook/css",t,e)}(function(t,e,o,n,r,i,l){"use strict";var u=t.support,s=r.getComputedStyle||t["polyfill/window/getcomputedstyle"],p={general:{get:function(t,e){return s(t,null).getPropertyValue(e[0])},set:function(t,e,o){t.style[e[1]]=o}},opacity:u.supportsCssProperty("opacity")?null:{regex:new RegExp("alpha\\(opacity=(.*)\\)","i"),get:function(t,e,o){return o=s(t,null).getPropertyValue("filter").toString().match(this.regex),o=o?o[1]/100:1},set:function(t,e,o){var n=t.style;n.zoom=1,n.filter="alpha(opacity="+(100*o+.5>>0)+")"}}};return t.base.extend({add:function(t,e){return t&&e&&p[t]&&(p[t]=e),this},get:function(t){return t&&p[t]?p[t]:null},process:function(t,e,o,n){var r;return o=u.getCssProperty(o,e)||null,o?((r=this.get(o[1]))&&r[t]||this.get("general")[t])(e,o,n):void 0}})}); \ No newline at end of file diff --git a/dist/3.7.2/min/hook/event.js b/dist/3.7.3/min/hook/event.js similarity index 96% rename from dist/3.7.2/min/hook/event.js rename to dist/3.7.3/min/hook/event.js index 330fb477..f63199c3 100644 --- a/dist/3.7.2/min/hook/event.js +++ b/dist/3.7.3/min/hook/event.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.registerSingleton("hook/event",e,["../base"])}(function(e,t,r,n,o,a,c){"use strict";function l(e,t,r){for(var n,o=0;(n=r[o])!==c;o++)e[n]=t[n];e._properties=e._properties.concat(r)}var i={general:{properties:"type altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which path".split(" "),process:function(e,t){var r;if(e.originalEvent=t,e.isDefaultPrevented=t.defaultPrevented?!0:!1,e.isPropagationStopped=t.cancelBubble?!0:!1,e.metaKey=t.metaKey&&t.metaKey!==!1?!0:!1,e.target||(e.target=t.srcElement||a),3===e.target.nodeType&&(e.target=e.target.parentNode),!e.path){e.path=[],r=e.target;do e.path.push(r);while(r=r.parentNode);e.path.push(o)}}},mouse:{regex:new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"),properties:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement dataTransfer".split(" "),process:function(e,t){var r,n,o;n=t.fromElement,o=t.button,null===e.pageX&&null!==t.clientX&&(r=e.target.ownerDocument||a,r=r.documentElement||r.body,e.pageX=t.clientX+(r.scrollLeft||0)-(r.clientLeft||0),e.pageY=t.clientY+(r.scrollTop||0)-(r.clientTop||0)),!e.relatedTarget&&n&&(e.relatedTarget=n===e.target?t.toElement:n),e.which||o===c||(e.which=1&o?1:2&o?3:4&o?2:0)}},key:{regex:new RegExp("^(?:key)"),properties:"char charCode key keyCode".split(" "),process:function(e,t){null===e.which&&(e.which=null!==t.charCode?t.charCode:t.keyCode)}}};return e.base.extend({add:function(e,t){return e&&t&&i[e]&&(i[e]=t),this},get:function(e){return e&&i[e]?i[e]:null},process:function(e,t){var r,n,o;for(r in i)n=i[r],o=!n.regex||n.regex.test(t.type),o&&(n.properties&&l(e,t,n.properties),n.process&&n.process(e,t),n.delegate&&(e.delegate=n.delegate))}})}); \ No newline at end of file diff --git a/dist/3.7.2/min/jquery/extension/selector.js b/dist/3.7.3/min/jquery/extension/selector.js similarity index 95% rename from dist/3.7.2/min/jquery/extension/selector.js rename to dist/3.7.3/min/jquery/extension/selector.js index 78326c2a..6a1f512e 100644 --- a/dist/3.7.2/min/jquery/extension/selector.js +++ b/dist/3.7.3/min/jquery/extension/selector.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){window.qoopido.register("jquery/extension/selector",t,["jquery"])}(function(t,e,r,n,o,i,f){"use strict";var u=t.jquery||o.jQuery,s=u(o),h=u(i);return u.extend(u.expr[":"],{loaded:function(t){return u(t).data("loaded")},scrollable:function(t,e,r){return"auto"===u(t).css("overflow")},width:function(t,e,r){return r[3]&&/^(<|>)\d+$/.test(r[3])?">"===r[3].substr(0,1)?u(t).width()>r[3].substr(1):u(t).width())\d+$/.test(r[3])?">"===r[3].substr(0,1)?u(t).height()>r[3].substr(1):u(t).height()r.offset().left+r.width()):!1},external:function(t){return t.href?t.hostname&&t.hostname!==o.location.hostname:!1},inView:function(t){t=u(t);var e=s,r=h,n=t.offset(),o={top:r.scrollTop(),height:r.scrollLeft()};return!(n.top>e.height()+o.top||n.top+t.height()e.width()+o.left||n.left+t.width()r.width()*r.height()):!1},isBold:function(t){return"700"===u(t).css("fontWeight")},color:function(t,e,r){return r[3]?u(t).css("color")===r[3]:!1},hasId:function(t){return t=u(t),t.attr("id")!==f&&""!==t.attr("id")}}),u}); \ No newline at end of file diff --git a/dist/3.7.2/min/jquery/function/prefetch.js b/dist/3.7.3/min/jquery/function/prefetch.js similarity index 88% rename from dist/3.7.2/min/jquery/function/prefetch.js rename to dist/3.7.3/min/jquery/function/prefetch.js index 36c29d60..3fba30d7 100644 --- a/dist/3.7.2/min/jquery/function/prefetch.js +++ b/dist/3.7.3/min/jquery/function/prefetch.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("jquery/function/prefetch",e,["jquery"])}(function(e,r,n,t,i,u,f){"use strict";var o=e.jquery||i.jQuery,c=o("head"),p=[];return o.prefetch=function(){var e=o.unique(o('a[rel="prefetch"]').removeAttr("rel").map(function(){return o(this).attr("href")}));e.each(function(e,r){-1===o.inArray(r,p)&&(o("",{rel:"prefetch",href:r}).appendTo(c),o("",{rel:"prerender",href:r}).appendTo(c))})},o}); \ No newline at end of file diff --git a/dist/3.7.2/min/jquery/plugin/emerge.js b/dist/3.7.3/min/jquery/plugin/emerge.js similarity index 89% rename from dist/3.7.2/min/jquery/plugin/emerge.js rename to dist/3.7.3/min/jquery/plugin/emerge.js index d6240c9f..31ca67c9 100644 --- a/dist/3.7.2/min/jquery/plugin/emerge.js +++ b/dist/3.7.3/min/jquery/plugin/emerge.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("jquery/plugins/emerge",e,["../../dom/element/emerge","jquery"])}(function(e,r,t,n,o,c,i){"use strict";var u,g=e.jquery||o.jQuery,a=t.pop(),d="emerged",m="demerged",s="".concat(d,".",a),f="".concat(m,".",a);return g.fn[a]=function(e){return this.each(function(){u.create(this,e)})},u=e["dom/element/emerge"].extend({_constructor:function(e,r){var t=u._parent._constructor.call(this,e,r),n=g(e);return t.on(d,function(e){n.trigger(s,{priority:e.data})}),t.on(m,function(){n.trigger(f)}),t}})}); \ No newline at end of file diff --git a/dist/3.7.2/min/jquery/plugin/lazyimage.js b/dist/3.7.3/min/jquery/plugin/lazyimage.js similarity index 89% rename from dist/3.7.2/min/jquery/plugin/lazyimage.js rename to dist/3.7.3/min/jquery/plugin/lazyimage.js index c1908629..73fdf830 100644 --- a/dist/3.7.2/min/jquery/plugin/lazyimage.js +++ b/dist/3.7.3/min/jquery/plugin/lazyimage.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("jquery/plugins/lazyimage",e,["../../dom/element/lazyimage","jquery"])}(function(e,n,t,r,o,i,c){"use strict";var u,a=e.jquery||o.jQuery,s=t.pop(),g="requested",l="loaded",d="".concat(g,".",s),f="".concat(l,".",s);return a.fn[s]=function(e){return this.each(function(){u.create(this,e)})},u=e["dom/element/lazyimage"].extend({_constructor:function(e,n){var t=u._parent._constructor.call(this,e,n),r=a(e);return t.on(g,function(){r.trigger(d)}),t.on(l,function(){r.trigger(f)}),t}})}); \ No newline at end of file diff --git a/dist/3.7.2/min/jquery/plugin/shrinkimage.js b/dist/3.7.3/min/jquery/plugin/shrinkimage.js similarity index 91% rename from dist/3.7.2/min/jquery/plugin/shrinkimage.js rename to dist/3.7.3/min/jquery/plugin/shrinkimage.js index 6db8a6e3..cb1cf290 100644 --- a/dist/3.7.2/min/jquery/plugin/shrinkimage.js +++ b/dist/3.7.3/min/jquery/plugin/shrinkimage.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(n){window.qoopido.register("jquery/plugins/shrinkimage",n,["../../dom/element/shrinkimage","jquery"])}(function(n,t,e,r,o,i,c){"use strict";var u,a=n.jquery||o.jQuery,g=e.pop(),s="queued",f="cached",d="loaded",h="failed",l="".concat(s,".",g),m="".concat(f,".",g),p="".concat(d,".",g),q="".concat(h,".",g);return a.fn[g]=function(n){return this.each(function(){u.create(this,n)})},u=n["dom/element/shrinkimage"].extend({_constructor:function(n,t){var e=u._parent._constructor.call(this,n,t),r=a(n);return e.on(s,function(){r.trigger(l)}),e.on(f,function(){r.trigger(m)}),e.on(d,function(){r.trigger(p)}),e.on(h,function(){r.trigger(q)}),e}})}); \ No newline at end of file diff --git a/dist/3.7.3/min/packages/qoopido.base.js b/dist/3.7.3/min/packages/qoopido.base.js new file mode 100644 index 00000000..b0b475eb --- /dev/null +++ b/dist/3.7.3/min/packages/qoopido.base.js @@ -0,0 +1,2 @@ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +!function(e,t,r,o,n){"use strict";function c(e,c,i,p){var d,l=e.split("/");return a[e]?a[e]:(d=function(){if(i)for(var d,g,y=l.slice(0,-1).join("/"),j=0;(d=i[j])!==n;j++)g=f.test(d),g&&(d=u(y+"/"+d)),!a[d]&&arguments[j]&&(a[d]=arguments[j]),g&&!a[d]&&"undefined"!=typeof console&&console.error("".concat("[Qoopido.js] ",e,": Could not load dependency ",d));return a[e]=c(a,s,l,t,r,o,n),p&&p(a[e]),a[e]},void("undefined"!=typeof module&&module.exports?module.exports=define(d):"function"==typeof define&&define.amd?i?define(i,d):define(d):d()))}function i(e,t,r){c(e,t,r,function(t){a[e]=t.create()})}function u(e){for(var t;(t=e.replace(l,""))!==e;)e=t;return e.replace(g,"")}var p=r.qoopido||(r.qoopido={}),s=p.shared||(p.shared={}),a=p.modules||(p.modules={}),d=[],f=new RegExp("^\\.+\\/"),l=new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."),g=new RegExp("(^\\/)|\\.\\/","g");p.register=c,p.registerSingleton=i,Object.create||d.push("./polyfill/object/create"),Object.getOwnPropertyNames||d.push("./polyfill/object/getownpropertynames"),Object.getOwnPropertyDescriptor&&function(){try{return Object.getOwnPropertyDescriptor({x:0},"x"),!0}catch(e){return!1}}()||d.push("./polyfill/object/getownpropertydescriptor"),c("base",e,d)}(function(e,t,r,o,n,c,i){"use strict";function u(e){for(var t,r={},o=Object.getOwnPropertyNames(e),n=0;(t=o[n])!==i;n++)r[t]=Object.getOwnPropertyDescriptor(e,t);return r}function p(){throw new Error("[Qoopido.js] Operation prohibited")}return{create:function(){var e,t=Object.create(this,u(this));return t._constructor&&(e=t._constructor.apply(t,arguments)),t.create=t.extend=p,e||t},extend:function(e,t){var r;return e=e||{},t=t===!0,e._parent=this,r=Object.create(this,u(e)),t===!0&&(r.extend=p),r}}},navigator,this,document); \ No newline at end of file diff --git a/dist/3.7.3/min/packages/qoopido.base.legacy.js b/dist/3.7.3/min/packages/qoopido.base.legacy.js new file mode 100644 index 00000000..cfcbf42a --- /dev/null +++ b/dist/3.7.3/min/packages/qoopido.base.legacy.js @@ -0,0 +1,2 @@ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +!function(e,t){t.register?t.register("polyfill/object/defineproperty",e):(t.modules=t.modules||{})["polyfill/object/defineproperty"]=e()}(function(e,t,r,o,n,i,c){"use strict";if(!Object.defineProperty||!function(){try{return Object.defineProperty({},"x",{}),!0}catch(e){return!1}}()){var p=Object.defineProperty,s=Object.prototype.__defineGetter__,u=Object.prototype.__defineSetter__;Object.defineProperty=function(e,t,r){if(p)try{return p(e,t,r)}catch(o){}if(e!==Object(e))throw new TypeError("Object.defineProperty called on non-object");return s&&"get"in r&&s.call(e,t,r.get),u&&"set"in r&&u.call(e,t,r.set),"value"in r&&(e[t]=r.value),e}}return Object.defineProperty},window.qoopido=window.qoopido||{}),function(e,t){if(t.register){var r=[];Object.defineProperty&&function(){try{return Object.defineProperty({},"x",{}),!0}catch(e){return!1}}()||r.push("./defineproperty"),t.register("polyfill/object/defineproperties",e,r)}else(t.modules=t.modules||{})["polyfill/object/defineproperties"]=e()}(function(e,t,r,o,n,i,c){"use strict";return Object.defineProperties||(Object.defineProperties=function(e,t){if(e!==Object(e))throw new TypeError("Object.defineProperties called on non-object");var r;for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&Object.defineProperty(e,r,t[r]);return e}),Object.defineProperties},window.qoopido=window.qoopido||{}),function(e,t){if(t.register){var r=[];Object.defineProperties||r.push("./defineproperties"),t.register("polyfill/object/create",e,r)}else(t.modules=t.modules||{})["polyfill/object/create"]=e()}(function(e,t,r,o,n,i,c){"use strict";return Object.create||(Object.create=function(e,t){function r(){}if("object"!=typeof e)throw new TypeError;r.prototype=e;var o=new r;if(e&&(o.constructor=r),arguments.length>1){if(t!==Object(t))throw new TypeError;Object.defineProperties(o,t)}return o}),Object.create},window.qoopido=window.qoopido||{}),function(e,t){t.register?t.register("polyfill/object/getownpropertynames",e):(t.modules=t.modules||{})["polyfill/object/getownpropertynames"]=e()}(function(e,t,r,o,n,i,c){"use strict";return Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(e){if(e!==Object(e))throw new TypeError("Object.getOwnPropertyNames called on non-object");var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.push(t);return r}),Object.getOwnPropertyNames},window.qoopido=window.qoopido||{}),function(e,t){t.register?t.register("polyfill/object/getownpropertydescriptor",e):(t.modules=t.modules||{})["polyfill/object/getownpropertydescriptor"]=e()}(function(e,t,r,o,n,i,c){"use strict";if(!Object.getOwnPropertyDescriptor||!function(){try{return Object.getOwnPropertyDescriptor({x:0},"x"),!0}catch(e){return!1}}()){var p=Object.getOwnPropertyDescriptor;Object.getOwnPropertyDescriptor=function(e,t){if(e!==Object(e))throw new TypeError;try{return p.call(Object,e,t)}catch(r){}return Object.prototype.hasOwnProperty.call(e,t)?{value:e[t],enumerable:!0,writable:!0,configurable:!0}:void 0}}return Object.getOwnPropertyDescriptor},window.qoopido=window.qoopido||{}),function(e,t,r,o,n){"use strict";function i(e,i,c,s){var d,a=e.split("/");return f[e]?f[e]:(d=function(){if(c)for(var d,y,b=a.slice(0,-1).join("/"),j=0;(d=c[j])!==n;j++)y=l.test(d),y&&(d=p(b+"/"+d)),!f[d]&&arguments[j]&&(f[d]=arguments[j]),y&&!f[d]&&"undefined"!=typeof console&&console.error("".concat("[Qoopido.js] ",e,": Could not load dependency ",d));return f[e]=i(f,u,a,t,r,o,n),s&&s(f[e]),f[e]},void("undefined"!=typeof module&&module.exports?module.exports=define(d):"function"==typeof define&&define.amd?c?define(c,d):define(d):d()))}function c(e,t,r){i(e,t,r,function(t){f[e]=t.create()})}function p(e){for(var t;(t=e.replace(a,""))!==e;)e=t;return e.replace(y,"")}var s=r.qoopido||(r.qoopido={}),u=s.shared||(s.shared={}),f=s.modules||(s.modules={}),d=[],l=new RegExp("^\\.+\\/"),a=new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."),y=new RegExp("(^\\/)|\\.\\/","g");s.register=i,s.registerSingleton=c,Object.create||d.push("./polyfill/object/create"),Object.getOwnPropertyNames||d.push("./polyfill/object/getownpropertynames"),Object.getOwnPropertyDescriptor&&function(){try{return Object.getOwnPropertyDescriptor({x:0},"x"),!0}catch(e){return!1}}()||d.push("./polyfill/object/getownpropertydescriptor"),i("base",e,d)}(function(e,t,r,o,n,i,c){"use strict";function p(e){for(var t,r={},o=Object.getOwnPropertyNames(e),n=0;(t=o[n])!==c;n++)r[t]=Object.getOwnPropertyDescriptor(e,t);return r}function s(){throw new Error("[Qoopido.js] Operation prohibited")}return{create:function(){var e,t=Object.create(this,p(this));return t._constructor&&(e=t._constructor.apply(t,arguments)),t.create=t.extend=s,e||t},extend:function(e,t){var r;return e=e||{},t=t===!0,e._parent=this,r=Object.create(this,p(e)),t===!0&&(r.extend=s),r}}},navigator,this,document); \ No newline at end of file diff --git a/dist/3.7.3/min/packages/qoopido.emerge.js b/dist/3.7.3/min/packages/qoopido.emerge.js new file mode 100644 index 00000000..60e34c10 --- /dev/null +++ b/dist/3.7.3/min/packages/qoopido.emerge.js @@ -0,0 +1,2 @@ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +!function(e,t,r,n,o){"use strict";function i(e,i,s,u){var c,d=e.split("/");return p[e]?p[e]:(c=function(){if(s)for(var c,m,h=d.slice(0,-1).join("/"),g=0;(c=s[g])!==o;g++)m=f.test(c),m&&(c=l(h+"/"+c)),!p[c]&&arguments[g]&&(p[c]=arguments[g]),m&&!p[c]&&"undefined"!=typeof console&&console.error("".concat("[Qoopido.js] ",e,": Could not load dependency ",c));return p[e]=i(p,a,d,t,r,n,o),u&&u(p[e]),p[e]},void("undefined"!=typeof module&&module.exports?module.exports=define(c):"function"==typeof define&&define.amd?s?define(s,c):define(c):c()))}function s(e,t,r){i(e,t,r,function(t){p[e]=t.create()})}function l(e){for(var t;(t=e.replace(d,""))!==e;)e=t;return e.replace(m,"")}var u=r.qoopido||(r.qoopido={}),a=u.shared||(u.shared={}),p=u.modules||(u.modules={}),c=[],f=new RegExp("^\\.+\\/"),d=new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."),m=new RegExp("(^\\/)|\\.\\/","g");u.register=i,u.registerSingleton=s,Object.create||c.push("./polyfill/object/create"),Object.getOwnPropertyNames||c.push("./polyfill/object/getownpropertynames"),Object.getOwnPropertyDescriptor&&function(){try{return Object.getOwnPropertyDescriptor({x:0},"x"),!0}catch(e){return!1}}()||c.push("./polyfill/object/getownpropertydescriptor"),i("base",e,c)}(function(e,t,r,n,o,i,s){"use strict";function l(e){for(var t,r={},n=Object.getOwnPropertyNames(e),o=0;(t=n[o])!==s;o++)r[t]=Object.getOwnPropertyDescriptor(e,t);return r}function u(){throw new Error("[Qoopido.js] Operation prohibited")}return{create:function(){var e,t=Object.create(this,l(this));return t._constructor&&(e=t._constructor.apply(t,arguments)),t.create=t.extend=u,e||t},extend:function(e,t){var r;return e=e||{},t=t===!0,e._parent=this,r=Object.create(this,l(e)),t===!0&&(r.extend=u),r}}},navigator,this,document),function(e){window.qoopido.register("polyfill/string/ucfirst",e)}(function(e,t,r,n,o,i,s){"use strict";return String.prototype.ucfirst||(String.prototype.ucfirst=function(){var e=this;return e.charAt(0).toUpperCase()+e.slice(1)}),String.prototype.ucfirst}),function(e){window.qoopido.register("polyfill/string/lcfirst",e)}(function(e,t,r,n,o,i,s){"use strict";return String.prototype.lcfirst||(String.prototype.lcfirst=function(){var e=this;return e.charAt(0).toLowerCase()+e.slice(1)}),String.prototype.lcfirst}),function(e){window.qoopido.register("polyfill/window/promise",e)}(function(e,t,r,n,o,i,s){"use strict";function l(e,t){var r=P.push([e,t]);1===r&&u()}function u(){o.setTimeout(a,1)}function a(){for(var e,t=0;(e=P[t])!==s;t++)e[0](e[1]);P.length=0}function p(e,t){var r,n=null;try{if(e===t)throw new TypeError("A promises callback cannot return that same promise.");if(("function"==typeof t||"object"==typeof t&&null!==t)&&(n=t.then,"function"==typeof n))return n.call(t,function(n){return r?!0:(r=!0,void(t!==n?d(e,n):m(e,n)))},function(t){return r?!0:(r=!0,void h(e,t))}),!0}catch(o){return r?!0:(h(e,o),!0)}return!1}function c(e,t){function r(e){d(t,e)}function n(e){h(t,e)}try{e(r,n)}catch(o){n(o)}}function f(e,t,r,n){var o,i,s,l,u="function"==typeof r;if(u)try{o=r(n),s=!0}catch(a){l=!0,i=a}else o=n,s=!0;p(t,o)||(u&&s?d(t,o):l?h(t,i):e===E?d(t,o):e===S&&h(t,o))}function d(e,t){e===t?m(e,t):p(e,t)||m(e,t)}function m(e,t){e._state===_&&(e._state=x,e._detail=t,l(g,e))}function h(e,t){e._state===_&&(e._state=x,e._detail=t,l(v,e))}function g(e){w(e,e._state=E)}function v(e){w(e,e._state=S)}function y(e,t,r,n){var o=e._subscribers,i=o.length;o[i]=t,o[i+E]=r,o[i+S]=n}function w(e,t){for(var r,n,o=e._subscribers,i=e._detail,l=0;(r=o[l])!==s;l+=3)n=o[l+t],f(t,r,n,i);e._subscribers=null}function b(e){var t=this;if("function"!=typeof e)throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");t._subscribers=[],c(e,t)}var _=void 0,x=0,E=1,S=2,P=[];return b.prototype={_state:s,_detail:s,_subscribers:s,then:function(e,t){var r=this,n=new b(function(){});return r._state?l(function(){f(r._state,n,arguments[r._state-1],r._detail)}):y(r,n,e,t),n},"catch":function(e){return this.then(null,e)}},o.Promise||(o.Promise=b),o.Promise}),function(e){var t=[];window.Promise||t.push("../polyfill/window/promise"),window.qoopido.register("promise/all",e,t)}(function(e,t,r,n,o,i,s){"use strict";return function(e){if("[object Array]"!==Object.prototype.toString.call(e))throw new TypeError("You must pass an array to all.");return new o.Promise(function(t,r){function n(e){return function(t){o(e,t)}}function o(e,r){l[e]=r,0===--u&&t(l)}var i,l=[],u=e.length,a=0;for(0===u&&t([]);(i=e[a])!==s;a++)i&&"function"==typeof i.then?i.then(n(a),r):o(a,i)})}}),function(e){var t=[];window.Promise||t.push("../polyfill/window/promise"),window.qoopido.register("promise/defer",e,t)}(function(e,t,r,n,o,i,s){"use strict";return function(){var e=this;e.promise=new o.Promise(function(t,r){e.resolve=t,e.reject=r})}}),function(e){var t=["./base","./promise/all","./promise/defer"];String.prototype.ucfirst||t.push("./polyfill/string/ucfirst"),String.prototype.lcfirst||t.push("./polyfill/string/lcfirst"),window.qoopido.registerSingleton("support",e,t)}(function(e,t,r,n,o,i,s){"use strict";function l(e){return e.replace(c,"$1").lcfirst().replace(f,"").replace(d,h)}var u=e["promise/all"],a=e["promise/defer"],p=new RegExp("^(Moz|WebKit|Khtml|ms|O|Icab)(?=[A-Z])"),c=new RegExp("^(?:webkit|khtml|icab|moz|ms|o)([A-Z])"),f=new RegExp("^-(?:webkit|khtml|icab|moz|ms|o)-"),d=new RegExp("-([a-z])","gi"),m=new RegExp("([A-Z])","g"),h=function(){return arguments[1].ucfirst()},g={prefix:null,method:{},property:{},css:{},promises:{prefix:null,method:{},property:{},css:{},test:{}}};return e.base.extend({test:{},pool:t.pool&&t.pool.dom,testMultiple:function(){for(var e,t=[],r=0;(e=arguments[r])!==s;r++)switch(typeof e){case"string":t.push(this.test[e]());break;case"boolean":var n=new a;e?n.resolve():n.reject(),t.push(n.promise);break;default:t.push(e)}return new u(t)},getPrefix:function(){var e,t=this,r=g.prefix||null;if(null===r){var n=t.pool?t.pool.obtain("div"):i.createElement("div"),o=n.style;r=!1;for(e in o)p.test(e)&&(r=e.match(p)[0]);r===!1&&"WebkitOpacity"in o&&(r="WebKit"),r===!1&&"KhtmlOpacity"in o&&(r="Khtml"),r=g.prefix=r===!1?!1:[r.toLowerCase(),r.toLowerCase().ucfirst(),r],n.dispose&&n.dispose()}return r},getMethod:function(e,t){e=l(e),t=t||o;var r=t.tagName,n=g.method[r]=g.method[r]||{},i=n[e]=g.method[r][e]||null;if(null===i){i=!1;var u,a,p=0,c=e.ucfirst(),f=this.getPrefix();for(u=f!==!1?(e+" "+c+" "+f.join(c+" ")+c).split(" "):[e];(a=u[p])!==s;p++)if(t[a]!==s&&("function"==typeof t[a]||"object"==typeof t[a])){i=a;break}g.method[r][e]=i}return i},getProperty:function(e,t){e=l(e),t=t||o;var r=t.tagName,n=g.property[r]=g.property[r]||{},i=n[e]=g.property[r][e]||null;if(null===i){i=!1;var u,a,p=0,c=e.ucfirst(),f=this.getPrefix();for(u=f!==!1?(e+" "+c+" "+f.join(c+" ")+c).split(" "):[e],p;(a=u[p])!==s;p++)if(t[a]!==s){i=a;break}g.property[r][e]=i}return i},getCssProperty:function(e){e=l(e);var t=this,r=g.css[e]||null;if(null===r){r=!1;var n,o=0,u=t.pool?t.pool.obtain("div"):i.createElement("div"),a=e.ucfirst(),p=this.getPrefix()||[],c=(e+" "+a+" "+p.join(a+" ")+a).split(" "),f="";for(o;(n=c[o])!==s;o++)if(u.style[n]!==s){r=n,o>0&&(f="-");break}r=g.css[e]=r!==!1?[f+r.replace(m,"-$1").toLowerCase(),r]:!1,u.dispose&&u.dispose()}return r},supportsPrefix:function(){return!!this.getPrefix()},supportsMethod:function(e,t){return!!this.getMethod(e,t)},supportsProperty:function(e,t){return!!this.getProperty(e,t)},supportsCssProperty:function(e){return!!this.getCssProperty(e)},testPrefix:function(){var e=g.promises.prefix;if(null===e){var t=new a,r=this.getPrefix();r?t.resolve(r):t.reject(),e=g.promises.prefix=t.promise}return e},testMethod:function(e,t){t=t||o;var r=t.tagName,n=g.promises.method[r]=g.promises.method[r]||{},i=n[e]=g.promises.method[r][e]||null;if(null===i){var s=new a,l=this.getMethod(e,t);l?s.resolve(l):s.reject(),i=g.promises.method[r][e]=s.promise}return i},testProperty:function(e,t){t=t||o;var r=t.tagName,n=g.promises.property[r]=g.promises.property[r]||{},i=n[e]=g.promises.property[r][e]||null;if(null===i){var s=new a,l=this.getProperty(e,t);l?s.resolve(l):s.reject(),i=g.promises.property[r][e]=s.promise}return i},testCssProperty:function(e){var t=g.promises.css[e]||null;if(null===t){var r=new a,n=this.getCssProperty(e);n?r.resolve(n):r.reject(),t=g.promises.css[e]=r.promise}return t},addTest:function(e,t){return this.test[e]=function(){var r=g.promises.test[e]||null;if(null===r){var n=new a,o=Array.prototype.slice.call(arguments);o.splice(0,0,n),t.apply(null,o),r=g.promises.test[e]=n.promise}return r}}})}),function(e){window.qoopido.register("function/merge",e)}(function(e,t,r,n,o,i,s){"use strict";return function l(){var e,t,r,n,o,i=arguments[0];for(e=1;(t=arguments[e])!==s;e++)for(r in t)n=i[r],o=t[r],o!==s&&(null!==o&&"object"==typeof o?(n=o.length!==s?n&&"object"==typeof n&&n.length!==s?n:[]:n&&"object"==typeof n&&n.length===s?n:{},i[r]=l(n,o)):i[r]=o);return i}}),function(e){window.qoopido.register("function/unique/uuid",e)}(function(e,t,r,n,o,i,s){"use strict";function l(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(a,function(e){var t=16*Math.random()|0,r="x"===e?t:3&t|8;return r.toString(16)})}var u={},a=new RegExp("[xy]","g");return function(){var e;do e=l();while("undefined"!=typeof u[e]);return u[e]=!0,e}}),function(e){window.qoopido.registerSingleton("hook/event",e,["../base"])}(function(e,t,r,n,o,i,s){"use strict";function l(e,t,r){for(var n,o=0;(n=r[o])!==s;o++)e[n]=t[n];e._properties=e._properties.concat(r)}var u={general:{properties:"type altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which path".split(" "),process:function(e,t){var r;if(e.originalEvent=t,e.isDefaultPrevented=t.defaultPrevented?!0:!1,e.isPropagationStopped=t.cancelBubble?!0:!1,e.metaKey=t.metaKey&&t.metaKey!==!1?!0:!1,e.target||(e.target=t.srcElement||i),3===e.target.nodeType&&(e.target=e.target.parentNode),!e.path){e.path=[],r=e.target;do e.path.push(r);while(r=r.parentNode);e.path.push(o)}}},mouse:{regex:new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"),properties:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement dataTransfer".split(" "),process:function(e,t){var r,n,o;n=t.fromElement,o=t.button,null===e.pageX&&null!==t.clientX&&(r=e.target.ownerDocument||i,r=r.documentElement||r.body,e.pageX=t.clientX+(r.scrollLeft||0)-(r.clientLeft||0),e.pageY=t.clientY+(r.scrollTop||0)-(r.clientTop||0)),!e.relatedTarget&&n&&(e.relatedTarget=n===e.target?t.toElement:n),e.which||o===s||(e.which=1&o?1:2&o?3:4&o?2:0)}},key:{regex:new RegExp("^(?:key)"),properties:"char charCode key keyCode".split(" "),process:function(e,t){null===e.which&&(e.which=null!==t.charCode?t.charCode:t.keyCode)}}};return e.base.extend({add:function(e,t){return e&&t&&u[e]&&(u[e]=t),this},get:function(e){return e&&u[e]?u[e]:null},process:function(e,t){var r,n,o;for(r in u)n=u[r],o=!n.regex||n.regex.test(t.type),o&&(n.properties&&l(e,t,n.properties),n.process&&n.process(e,t),n.delegate&&(e.delegate=n.delegate))}})}),function(e){var t=["../base","../support"];window.getComputedStyle||t.push("../polyfill/window/getcomputedstyle"),window.qoopido.registerSingleton("hook/css",e,t)}(function(e,t,r,n,o,i,s){"use strict";var l=e.support,u=o.getComputedStyle||e["polyfill/window/getcomputedstyle"],a={general:{get:function(e,t){return u(e,null).getPropertyValue(t[0])},set:function(e,t,r){e.style[t[1]]=r}},opacity:l.supportsCssProperty("opacity")?null:{regex:new RegExp("alpha\\(opacity=(.*)\\)","i"),get:function(e,t,r){return r=u(e,null).getPropertyValue("filter").toString().match(this.regex),r=r?r[1]/100:1},set:function(e,t,r){var n=e.style;n.zoom=1,n.filter="alpha(opacity="+(100*r+.5>>0)+")"}}};return e.base.extend({add:function(e,t){return e&&t&&a[e]&&(a[e]=t),this},get:function(e){return e&&a[e]?a[e]:null},process:function(e,t,r,n){var o;return r=l.getCssProperty(r,t)||null,r?((o=this.get(r[1]))&&o[e]||this.get("general")[e])(t,r,n):void 0}})}),function(e){window.qoopido.register("dom/event",e,["../base","../hook/event"])}(function(e,t,r,n,o,i,s){"use strict";var l=e["hook/event"];return e.base.extend({originalEvent:null,isDelegate:!1,isDefaultPrevented:!1,isPropagationStopped:!1,isImmediatePropagationStopped:!1,_properties:null,_constructor:function(e){var t=this;return t._properties=[],t._obtain(e),t},_obtain:function(e){l.process(this,e)},_dispose:function(){for(var e,t=this,r=0;(e=t._properties[r])!==s;r++)delete t[e];delete t.delegate,t.originalEvent=null,t.isDelegate=!1,t.isDefaultPrevented=!1,t.isPropagationStopped=!1,t.isImmediatePropagationStopped=!1,t._properties.length=0},preventDefault:function(){var e=this,t=e.originalEvent;t.cancelable!==!1&&(e.isDefaultPrevented=!0,t.preventDefault?t.preventDefault():t.returnValue=!1)},stopPropagation:function(){var e=this,t=e.originalEvent;e.isPropagationStopped=!0,t.stopPropagation&&t.stopPropagation(),t.cancelBubble=!0},stopImmediatePropagation:function(){var e=this,t=e.originalEvent;e.isImmediatePropagationStopped=!0,t.stopImmediatePropagation&&t.stopImmediatePropagation(),e.stopPropagation()}})}),function(e){var t=["../base","../function/unique/uuid","../hook/css","./event"];window.CustomEvent||t.push("../polyfill/window/customevent"),window.addEventListener||t.push("../polyfill/window/addeventlistener"),window.removeEventListener||t.push("../polyfill/window/removeeventlistener"),window.dispatchEvent||t.push("../polyfill/window/dispatchevent"),Element.prototype.matches||t.push("../polyfill/element/matches"),document.querySelector||t.push("../polyfill/document/queryselector"),document.querySelectorAll||t.push("../polyfill/document/queryselectorall"),String.prototype.trim||t.push("../polyfill/string/trim"),window.qoopido.register("dom/element",e,t)}(function(e,t,r,n,o,i,s){"use strict";function l(e){var t,r,n;for(t in P)r=P[t],(!r.regex||r.regex.test(e))&&(n=r);return n}function u(e,t,r){var n=this,o=l(e),s=i.createEvent(o.type);s[o.method](e,"load"===e?!1:!0,!0,t),r&&(s._quid=r,s.isDelegate=!0),n.element.dispatchEvent(s)}function a(e){var t;if("string"==typeof e)try{w.test(e)===!0?(t=e.replace(w,"$1").toLowerCase(),e=i.createElement(t)):e=i.querySelector(e)}catch(r){e=null}if(!e)throw new Error("[Qoopido.js] Element could not be resolved");return e}function p(e){return Array.prototype.concat.apply([],Array.prototype.splice.call(e,0)).join(" ").split(_)}function c(e,t){for(var r,n=0;(r=e.path[n])!==s;n++){if(r.matches(t))return e.currentTarget=r,!0;if(r===e.currentTarget)break}return!1}var f="object",d="string",m=e["function/unique/uuid"],h=i.getElementsByTagName("head")[0],g="textContent"in i.createElement("a")?"textContent":"innerText",v="undefined"!=typeof h.previousElementSibling?function(){return this.previousElementSibling}:function(){for(var e=this;e=e.previousSibling;)if(1===e.nodeType)return e},y="undefined"!=typeof h.nextElementSibling?function(){return this.nextElementSibling}:function(){for(var e=this;e=e.nextSibling;)if(1===e.nodeType)return e},w=new RegExp("^<(\\w+)\\s*/>$"),b=new RegExp("^[^-]+"),_=new RegExp(" +","g"),x=e["pool/module"]&&e["pool/module"].create(e["dom/event"],null,!0)||null,E=e["hook/css"],S={},P={custom:{type:"CustomEvent",method:"initCustomEvent"},html:{regex:new RegExp("^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$"),type:"HTMLEvents",method:"initEvent"},mouse:{regex:new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"),type:"MouseEvents",method:"initMouseEvent"}};return e.base.extend({type:null,element:null,_listener:null,_constructor:function(e,t,r){var n,o=this;return e=a(e),n=e._quid,n?o=S[n]:(n=e._quid=m(),o.type=e.tagName,o.element=e,o._listener={},S[n]=o),"object"==typeof t&&null!==t&&o.setAttributes(t),"object"==typeof r&&null!==r&&o.setStyles(r),o!==this&&this.dispose&&this.dispose(),o},_obtain:function(e,t,r){this._constructor(e,t,r)},_dispose:function(){var e,t,r=this;for(e in r._listener)t=e.match(b),r.element.removeEventListener(t,r._listener[e]),delete r._listener[e];r.type=null,r.element=null},getContent:function(e){var t=this.element;return e&&e!==!1?t.innerHTML:t[g]},setContent:function(e,t){var r=this,n=r.element;return t&&t!==!1?n.innerHTML=e:n[g]=e,r},getAttribute:function(e){var t=this;return e&&typeof e===d?t.element.getAttribute(e):void 0},getAttributes:function(){for(var e,t=this,r={},n=p(arguments),o=0;(e=n[o])!==s;o++)r[e]=t.element.getAttribute(e);return r},setAttribute:function(e,t){var r=this;return e&&typeof e===d&&r.element.setAttribute(e,t),r},setAttributes:function(e){var t,r=this;if(e&&typeof e===f&&!e.length)for(t in e)r.element.setAttribute(t,e[t]);return r},removeAttribute:function(e){var t=this;return e&&typeof e===d&&t.element.removeAttribute(e),t},removeAttributes:function(){for(var e,t=this,r=p(arguments),n=0;(e=r[n])!==s;n++)t.element.removeAttribute(e);return t},getStyle:function(e){var t=this;return e&&typeof e===d?E.process("get",t.element,e):void 0},getStyles:function(){for(var e,t=this,r={},n=p(arguments),o=0;(e=n[o])!==s;o++)r[e]=E.process("get",t.element,e);return r},setStyle:function(e,t){var r=this;return e&&typeof e===d&&E.process("set",r.element,e,t),r},setStyles:function(e){var t,r=this;if(e&&typeof e===f&&!e.length)for(t in e)E.process("set",r.element,t,e[t]);return r},removeStyle:function(e){var t=this;return e&&typeof e===d&&t.setStyle(e,""),t},removeStyles:function(){for(var e,t=this,r=p(arguments),n=0;(e=r[n])!==s;n++)t.setStyle(e,"");return t},siblings:function(e){for(var t=this.element,r=t.parentNode.firstChild,n=[];r;r=y.call(r))r===t||e&&!r.matches(e)||n.push(r);return n},siblingsBefore:function(e){for(var t=this.element.previousSibling,r=[];t;t=v.call(t))(!e||t.matches(e))&&r.push(t);return r},siblingsAfter:function(e){for(var t=this.element.nextSibling,r=[];t;t=y.call(t))(!e||t.matches(e))&&r.push(t);return r},previous:function(e){var t=v.call(this.element);if(!e)return t;for(;t;t=v.call(t))if(t.matches(e))return t},next:function(e){var t=y.call(this.element);if(!e)return t;for(;t;t=y.call(t))if(t.matches(e))return t},find:function(e){var t,r,n=this.element;return e=e.trim(),">"===e.charAt(0)?(t=n._quid,n.setAttribute("data-quid",t),e='[data-quid="'+t+'"] '+e,r=n.parentNode.querySelectorAll(e),n.removeAttribute("data-quid")):r=n.querySelectorAll(e),r},parent:function(e){var t;if(!e)return this.element.parentNode;for(t=this.element;t;t=t.parentNode)if(t.matches(e))return t},parents:function(e){for(var t=this.element.parentNode,r=[];t;t=t.parentNode){if(9===t.nodeType)return r;1===t.nodeType&&(!e||t.matches(e))&&r.push(t)}},isVisible:function(){var e=this,t=e.element;return!(t.offsetWidth<=0&&t.offsetHeight<=0||"hidden"===e.getStyle("visibility")||e.getStyle("opacity")<=0)},hasClass:function(e){return e?new RegExp("(?:^|\\s)"+e+"(?:\\s|$)").test(this.element.className):!1},addClass:function(e){var t=this;return e&&!t.hasClass(e)&&(t.element.className+=t.element.className?" "+e:e),t},removeClass:function(e){var t=this;return e&&t.hasClass(e)&&(t.element.className=t.element.className.replace(new RegExp("(?:^|\\s)"+e+"(?!\\S)"),"")),t},toggleClass:function(e){var t=this;return e&&(t.hasClass(e)?t.removeClass(e):t.addClass(e)),t},prepend:function(e){var t=this,r=t.element;if(e)try{e=e.element||a(e),r.firstChild?r.insertBefore(e,r.firstChild):t.append(e)}catch(n){r.insertAdjacentHTML("afterBegin",e)}return t},append:function(e){var t=this,r=t.element;if(e)try{r.appendChild(e.element||a(e))}catch(n){r.insertAdjacentHTML("beforeEnd",e)}return t},prependTo:function(e){var t=this,r=t.element;return e&&((e=e.element||a(e)).firstChild?e.insertBefore(r,e.firstChild):t.appendTo(e)),t},appendTo:function(e){var t=this;return e&&(e.element||a(e)).appendChild(t.element),t},insertBefore:function(e){var t=this,r=t.element;return e&&(e=e.element||a(e)).parentNode.insertBefore(r,e),t},insertAfter:function(e){var t=this,r=t.element;return e&&((e=e.element||a(e)).nextSibling?e.parentNode.insertBefore(r,e.nextSibling):t.appendTo(e.parentNode)),t},replace:function(e){var t=this,r=t.element;return e&&(e=e.element||a(e)).parentNode.replaceChild(r,e),t},replaceWith:function(e){var t=this,r=t.element;return e&&(e=e.element||a(e),r.parentNode.replaceChild(e,r)),t},remove:function(){var e=this,t=e.element;return t.parentNode.removeChild(t),e},on:function(t){var r,n=this,o=n.element,i=arguments.length>2?arguments[1]:null,l=arguments.length>2?arguments[2]:arguments[1],a=l._quid||(l._quid=m()),p=0;for(t=t.split(" ");(r=t[p])!==s;p++){var f=r+"-"+a,d=function(t){var r;t=x&&x.obtain(t)||e["dom/event"].create(t),t.isPropagationStopped||(r=t.delegate,t._quid=m(),(!i||c(t,i))&&l.call(t.currentTarget,t,t.originalEvent.detail),r&&(delete t.delegate,u.call(n,r))),t.dispose&&t.dispose()};d.type=r,n._listener[f]=d,o.addEventListener(r,d)}return n},one:function(e){var t=this,r=arguments.length>3||"string"==typeof arguments[1]?arguments[1]:null,n=arguments.length>3||"function"==typeof arguments[2]?arguments[2]:arguments[1],o=(arguments.length>3?arguments[3]:arguments[2])!==!1,i=function(r){t.off(o===!0?r.type:e,i),n.call(this,r,r.originalEvent.detail)};return n._quid=i._quid=m(),r?t.on(e,r,i):t.on(e,i),t},off:function(e,t){var r,n,o,i=this,l=i.element,u=0;for(e=e.split(" ");(r=e[u])!==s;u++)n=t._quid&&r+"-"+t._quid||null,o=n&&i._listener[n]||null,o?(l.removeEventListener(r,o),delete i._listener[n]):l.removeEventListener(r,t);return i},emit:function(e,t){var r=this;return u.call(r,e,t),r}})}),function(e){window.qoopido.register("dom/element/emerge",e,["../element","../../function/merge","../../function/unique/uuid"])}(function(e,t,r,n,o,i,s){"use strict";function l(e){var t,r=v[e];for(t in r)"length"!==t&&p.call(r[t]);0===r.length&&(o.element.clearInterval(g[e]),delete g[e])}function u(){h.left=0,h.top=0,h.right=o.innerWidth||m.clientWidth,h.bottom=o.innerHeight||m.clientHeight}function a(){var e=this,t=e._settings.threshold,r=t!==s?t:m.clientWidth*e._settings.auto,n=t!==s?t:m.clientHeight*e._settings.auto;e._viewport.left=h.left-r,e._viewport.top=h.top-n,e._viewport.right=h.right+r,e._viewport.bottom=h.bottom+n}function p(){var e,t=this,r=!1,n=2;!t.isVisible()||"hidden"===t.getStyle("visibility")&&t._settings.visibility!==!1||(e=t.element.getBoundingClientRect(),(e.bottom>=t._viewport.top&&e.bottom<=t._viewport.bottom||e.top>=t._viewport.top&&e.top<=t._viewport.bottom||t._viewport.bottom>=e.top&&t._viewport.bottom<=e.bottom||t._viewport.top>=e.top&&t._viewport.top<=e.bottom)&&(e.left>=t._viewport.left&&e.left<=t._viewport.right||e.right>=t._viewport.left&&e.right<=t._viewport.right||t._viewport.left>=e.left&&t._viewport.left<=e.right||t._viewport.right>=e.left&&t._viewport.right<=e.right)&&((0===t._settings.threshold||(e.bottom>=h.top&&e.bottom<=h.bottom||e.top>=h.top&&e.top<=h.bottom||h.bottom>=e.top&&h.bottom<=e.bottom||h.top>=e.top&&h.top<=e.bottom)&&(e.left>=h.left&&e.left<=h.right||e.right>=h.left&&e.right<=h.right||h.left>=e.left&&h.left<=e.right||h.right>=e.left&&h.right<=e.right))&&(n=1),r=!0)),(r!==t._state||r===!0&&n!==t._priority)&&c.call(t,r,n)}function c(e,t){var r=this;r._state=e,r._priority=t,r._settings.recur!==!0&&r.remove(),e===!0?r.emit(y,t):r.emit(w)}var f,d={interval:50,threshold:"auto",recur:!0,auto:1,visibility:!0},m=o.document.documentElement,h={},g={},v={},y="emerged",w="demerged",b="resize orientationchange";if(o=e["dom/element"].create(o),"CSS1Compat"!==i.compatMode)throw"[Qoopido.js] Not in standards mode";return f=e["dom/element"].extend({_quid:null,_viewport:null,_settings:null,_state:null,_priority:null,_constructor:function(t,r){var n=f._parent._constructor.call(this,t);return r=e["function/merge"]({},d,r||{}),"auto"===r.threshold&&delete r.threshold,g[r.interval]===s&&(v[r.interval]=v[r.interval]||{length:0},g[r.interval]=o.element.setInterval(function(){l(r.interval)},r.interval)),n._quid=e["function/unique/uuid"](),n._viewport={},n._settings=r,n._state=!1,n._priority=2,v[r.interval][n._quid]=n,v[r.interval].length++,o.on(b,function(){a.call(n)}),a.call(n),n},remove:function(){var e=this;delete v[e._settings.interval][e._quid],v[e._settings.interval].length--}}),o.on(b,u),u(),f}); \ No newline at end of file diff --git a/dist/3.7.3/min/packages/qoopido.emerge.legacy.js b/dist/3.7.3/min/packages/qoopido.emerge.legacy.js new file mode 100644 index 00000000..035f68c2 --- /dev/null +++ b/dist/3.7.3/min/packages/qoopido.emerge.legacy.js @@ -0,0 +1,2 @@ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +!function(e,t){t.register?t.register("polyfill/object/defineproperty",e):(t.modules=t.modules||{})["polyfill/object/defineproperty"]=e()}(function(e,t,r,n,o,i,s){"use strict";if(!Object.defineProperty||!function(){try{return Object.defineProperty({},"x",{}),!0}catch(e){return!1}}()){var l=Object.defineProperty,u=Object.prototype.__defineGetter__,p=Object.prototype.__defineSetter__;Object.defineProperty=function(e,t,r){if(l)try{return l(e,t,r)}catch(n){}if(e!==Object(e))throw new TypeError("Object.defineProperty called on non-object");return u&&"get"in r&&u.call(e,t,r.get),p&&"set"in r&&p.call(e,t,r.set),"value"in r&&(e[t]=r.value),e}}return Object.defineProperty},window.qoopido=window.qoopido||{}),function(e,t){if(t.register){var r=[];Object.defineProperty&&function(){try{return Object.defineProperty({},"x",{}),!0}catch(e){return!1}}()||r.push("./defineproperty"),t.register("polyfill/object/defineproperties",e,r)}else(t.modules=t.modules||{})["polyfill/object/defineproperties"]=e()}(function(e,t,r,n,o,i,s){"use strict";return Object.defineProperties||(Object.defineProperties=function(e,t){if(e!==Object(e))throw new TypeError("Object.defineProperties called on non-object");var r;for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&Object.defineProperty(e,r,t[r]);return e}),Object.defineProperties},window.qoopido=window.qoopido||{}),function(e,t){if(t.register){var r=[];Object.defineProperties||r.push("./defineproperties"),t.register("polyfill/object/create",e,r)}else(t.modules=t.modules||{})["polyfill/object/create"]=e()}(function(e,t,r,n,o,i,s){"use strict";return Object.create||(Object.create=function(e,t){function r(){}if("object"!=typeof e)throw new TypeError;r.prototype=e;var n=new r;if(e&&(n.constructor=r),arguments.length>1){if(t!==Object(t))throw new TypeError;Object.defineProperties(n,t)}return n}),Object.create},window.qoopido=window.qoopido||{}),function(e,t){t.register?t.register("polyfill/object/getownpropertynames",e):(t.modules=t.modules||{})["polyfill/object/getownpropertynames"]=e()}(function(e,t,r,n,o,i,s){"use strict";return Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(e){if(e!==Object(e))throw new TypeError("Object.getOwnPropertyNames called on non-object");var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.push(t);return r}),Object.getOwnPropertyNames},window.qoopido=window.qoopido||{}),function(e,t){t.register?t.register("polyfill/object/getownpropertydescriptor",e):(t.modules=t.modules||{})["polyfill/object/getownpropertydescriptor"]=e()}(function(e,t,r,n,o,i,s){"use strict";if(!Object.getOwnPropertyDescriptor||!function(){try{return Object.getOwnPropertyDescriptor({x:0},"x"),!0}catch(e){return!1}}()){var l=Object.getOwnPropertyDescriptor;Object.getOwnPropertyDescriptor=function(e,t){if(e!==Object(e))throw new TypeError;try{return l.call(Object,e,t)}catch(r){}return Object.prototype.hasOwnProperty.call(e,t)?{value:e[t],enumerable:!0,writable:!0,configurable:!0}:void 0}}return Object.getOwnPropertyDescriptor},window.qoopido=window.qoopido||{}),function(e,t,r,n,o){"use strict";function i(e,i,s,u){var a,d=e.split("/");return c[e]?c[e]:(a=function(){if(s)for(var a,m,g=d.slice(0,-1).join("/"),h=0;(a=s[h])!==o;h++)m=f.test(a),m&&(a=l(g+"/"+a)),!c[a]&&arguments[h]&&(c[a]=arguments[h]),m&&!c[a]&&"undefined"!=typeof console&&console.error("".concat("[Qoopido.js] ",e,": Could not load dependency ",a));return c[e]=i(c,p,d,t,r,n,o),u&&u(c[e]),c[e]},void("undefined"!=typeof module&&module.exports?module.exports=define(a):"function"==typeof define&&define.amd?s?define(s,a):define(a):a()))}function s(e,t,r){i(e,t,r,function(t){c[e]=t.create()})}function l(e){for(var t;(t=e.replace(d,""))!==e;)e=t;return e.replace(m,"")}var u=r.qoopido||(r.qoopido={}),p=u.shared||(u.shared={}),c=u.modules||(u.modules={}),a=[],f=new RegExp("^\\.+\\/"),d=new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."),m=new RegExp("(^\\/)|\\.\\/","g");u.register=i,u.registerSingleton=s,Object.create||a.push("./polyfill/object/create"),Object.getOwnPropertyNames||a.push("./polyfill/object/getownpropertynames"),Object.getOwnPropertyDescriptor&&function(){try{return Object.getOwnPropertyDescriptor({x:0},"x"),!0}catch(e){return!1}}()||a.push("./polyfill/object/getownpropertydescriptor"),i("base",e,a)}(function(e,t,r,n,o,i,s){"use strict";function l(e){for(var t,r={},n=Object.getOwnPropertyNames(e),o=0;(t=n[o])!==s;o++)r[t]=Object.getOwnPropertyDescriptor(e,t);return r}function u(){throw new Error("[Qoopido.js] Operation prohibited")}return{create:function(){var e,t=Object.create(this,l(this));return t._constructor&&(e=t._constructor.apply(t,arguments)),t.create=t.extend=u,e||t},extend:function(e,t){var r;return e=e||{},t=t===!0,e._parent=this,r=Object.create(this,l(e)),t===!0&&(r.extend=u),r}}},navigator,this,document),function(e){window.qoopido.register("polyfill/string/ucfirst",e)}(function(e,t,r,n,o,i,s){"use strict";return String.prototype.ucfirst||(String.prototype.ucfirst=function(){var e=this;return e.charAt(0).toUpperCase()+e.slice(1)}),String.prototype.ucfirst}),function(e){window.qoopido.register("polyfill/string/lcfirst",e)}(function(e,t,r,n,o,i,s){"use strict";return String.prototype.lcfirst||(String.prototype.lcfirst=function(){var e=this;return e.charAt(0).toLowerCase()+e.slice(1)}),String.prototype.lcfirst}),function(e){window.qoopido.register("polyfill/window/getcomputedstyle",e)}(function(e,t,r,n,o,i,s){"use strict";if(o.getComputedStyle)return o.getComputedStyle;var l=new RegExp("(\\-([a-z]){1})","g"),u=function(){return arguments[2].toUpperCase()};return function(e,t){var r=this;return r.getPropertyValue=function(t){return"float"===t&&(t="styleFloat"),l.test(t)&&(t=t.replace(l,u)),e.currentStyle[t]||null},r}}),function(e){window.qoopido.register("polyfill/window/promise",e)}(function(e,t,r,n,o,i,s){"use strict";function l(e,t){var r=E.push([e,t]);1===r&&u()}function u(){o.setTimeout(p,1)}function p(){for(var e,t=0;(e=E[t])!==s;t++)e[0](e[1]);E.length=0}function c(e,t){var r,n=null;try{if(e===t)throw new TypeError("A promises callback cannot return that same promise.");if(("function"==typeof t||"object"==typeof t&&null!==t)&&(n=t.then,"function"==typeof n))return n.call(t,function(n){return r?!0:(r=!0,void(t!==n?d(e,n):m(e,n)))},function(t){return r?!0:(r=!0,void g(e,t))}),!0}catch(o){return r?!0:(g(e,o),!0)}return!1}function a(e,t){function r(e){d(t,e)}function n(e){g(t,e)}try{e(r,n)}catch(o){n(o)}}function f(e,t,r,n){var o,i,s,l,u="function"==typeof r;if(u)try{o=r(n),s=!0}catch(p){l=!0,i=p}else o=n,s=!0;c(t,o)||(u&&s?d(t,o):l?g(t,i):e===j?d(t,o):e===P&&g(t,o))}function d(e,t){e===t?m(e,t):c(e,t)||m(e,t)}function m(e,t){e._state===_&&(e._state=x,e._detail=t,l(h,e))}function g(e,t){e._state===_&&(e._state=x,e._detail=t,l(v,e))}function h(e){w(e,e._state=j)}function v(e){w(e,e._state=P)}function y(e,t,r,n){var o=e._subscribers,i=o.length;o[i]=t,o[i+j]=r,o[i+P]=n}function w(e,t){for(var r,n,o=e._subscribers,i=e._detail,l=0;(r=o[l])!==s;l+=3)n=o[l+t],f(t,r,n,i);e._subscribers=null}function b(e){var t=this;if("function"!=typeof e)throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");t._subscribers=[],a(e,t)}var _=void 0,x=0,j=1,P=2,E=[];return b.prototype={_state:s,_detail:s,_subscribers:s,then:function(e,t){var r=this,n=new b(function(){});return r._state?l(function(){f(r._state,n,arguments[r._state-1],r._detail)}):y(r,n,e,t),n},"catch":function(e){return this.then(null,e)}},o.Promise||(o.Promise=b),o.Promise}),function(e){var t=[];window.Promise||t.push("../polyfill/window/promise"),window.qoopido.register("promise/all",e,t)}(function(e,t,r,n,o,i,s){"use strict";return function(e){if("[object Array]"!==Object.prototype.toString.call(e))throw new TypeError("You must pass an array to all.");return new o.Promise(function(t,r){function n(e){return function(t){o(e,t)}}function o(e,r){l[e]=r,0===--u&&t(l)}var i,l=[],u=e.length,p=0;for(0===u&&t([]);(i=e[p])!==s;p++)i&&"function"==typeof i.then?i.then(n(p),r):o(p,i)})}}),function(e){var t=[];window.Promise||t.push("../polyfill/window/promise"),window.qoopido.register("promise/defer",e,t)}(function(e,t,r,n,o,i,s){"use strict";return function(){var e=this;e.promise=new o.Promise(function(t,r){e.resolve=t,e.reject=r})}}),function(e){var t=["./base","./promise/all","./promise/defer"];String.prototype.ucfirst||t.push("./polyfill/string/ucfirst"),String.prototype.lcfirst||t.push("./polyfill/string/lcfirst"),window.qoopido.registerSingleton("support",e,t)}(function(e,t,r,n,o,i,s){"use strict";function l(e){return e.replace(a,"$1").lcfirst().replace(f,"").replace(d,g)}var u=e["promise/all"],p=e["promise/defer"],c=new RegExp("^(Moz|WebKit|Khtml|ms|O|Icab)(?=[A-Z])"),a=new RegExp("^(?:webkit|khtml|icab|moz|ms|o)([A-Z])"),f=new RegExp("^-(?:webkit|khtml|icab|moz|ms|o)-"),d=new RegExp("-([a-z])","gi"),m=new RegExp("([A-Z])","g"),g=function(){return arguments[1].ucfirst()},h={prefix:null,method:{},property:{},css:{},promises:{prefix:null,method:{},property:{},css:{},test:{}}};return e.base.extend({test:{},pool:t.pool&&t.pool.dom,testMultiple:function(){for(var e,t=[],r=0;(e=arguments[r])!==s;r++)switch(typeof e){case"string":t.push(this.test[e]());break;case"boolean":var n=new p;e?n.resolve():n.reject(),t.push(n.promise);break;default:t.push(e)}return new u(t)},getPrefix:function(){var e,t=this,r=h.prefix||null;if(null===r){var n=t.pool?t.pool.obtain("div"):i.createElement("div"),o=n.style;r=!1;for(e in o)c.test(e)&&(r=e.match(c)[0]);r===!1&&"WebkitOpacity"in o&&(r="WebKit"),r===!1&&"KhtmlOpacity"in o&&(r="Khtml"),r=h.prefix=r===!1?!1:[r.toLowerCase(),r.toLowerCase().ucfirst(),r],n.dispose&&n.dispose()}return r},getMethod:function(e,t){e=l(e),t=t||o;var r=t.tagName,n=h.method[r]=h.method[r]||{},i=n[e]=h.method[r][e]||null;if(null===i){i=!1;var u,p,c=0,a=e.ucfirst(),f=this.getPrefix();for(u=f!==!1?(e+" "+a+" "+f.join(a+" ")+a).split(" "):[e];(p=u[c])!==s;c++)if(t[p]!==s&&("function"==typeof t[p]||"object"==typeof t[p])){i=p;break}h.method[r][e]=i}return i},getProperty:function(e,t){e=l(e),t=t||o;var r=t.tagName,n=h.property[r]=h.property[r]||{},i=n[e]=h.property[r][e]||null;if(null===i){i=!1;var u,p,c=0,a=e.ucfirst(),f=this.getPrefix();for(u=f!==!1?(e+" "+a+" "+f.join(a+" ")+a).split(" "):[e],c;(p=u[c])!==s;c++)if(t[p]!==s){i=p;break}h.property[r][e]=i}return i},getCssProperty:function(e){e=l(e);var t=this,r=h.css[e]||null;if(null===r){r=!1;var n,o=0,u=t.pool?t.pool.obtain("div"):i.createElement("div"),p=e.ucfirst(),c=this.getPrefix()||[],a=(e+" "+p+" "+c.join(p+" ")+p).split(" "),f="";for(o;(n=a[o])!==s;o++)if(u.style[n]!==s){r=n,o>0&&(f="-");break}r=h.css[e]=r!==!1?[f+r.replace(m,"-$1").toLowerCase(),r]:!1,u.dispose&&u.dispose()}return r},supportsPrefix:function(){return!!this.getPrefix()},supportsMethod:function(e,t){return!!this.getMethod(e,t)},supportsProperty:function(e,t){return!!this.getProperty(e,t)},supportsCssProperty:function(e){return!!this.getCssProperty(e)},testPrefix:function(){var e=h.promises.prefix;if(null===e){var t=new p,r=this.getPrefix();r?t.resolve(r):t.reject(),e=h.promises.prefix=t.promise}return e},testMethod:function(e,t){t=t||o;var r=t.tagName,n=h.promises.method[r]=h.promises.method[r]||{},i=n[e]=h.promises.method[r][e]||null;if(null===i){var s=new p,l=this.getMethod(e,t);l?s.resolve(l):s.reject(),i=h.promises.method[r][e]=s.promise}return i},testProperty:function(e,t){t=t||o;var r=t.tagName,n=h.promises.property[r]=h.promises.property[r]||{},i=n[e]=h.promises.property[r][e]||null;if(null===i){var s=new p,l=this.getProperty(e,t);l?s.resolve(l):s.reject(),i=h.promises.property[r][e]=s.promise}return i},testCssProperty:function(e){var t=h.promises.css[e]||null;if(null===t){var r=new p,n=this.getCssProperty(e);n?r.resolve(n):r.reject(),t=h.promises.css[e]=r.promise}return t},addTest:function(e,t){return this.test[e]=function(){var r=h.promises.test[e]||null;if(null===r){var n=new p,o=Array.prototype.slice.call(arguments);o.splice(0,0,n),t.apply(null,o),r=h.promises.test[e]=n.promise}return r}}})}),function(e){window.qoopido.register("function/merge",e)}(function(e,t,r,n,o,i,s){"use strict";return function l(){var e,t,r,n,o,i=arguments[0];for(e=1;(t=arguments[e])!==s;e++)for(r in t)n=i[r],o=t[r],o!==s&&(null!==o&&"object"==typeof o?(n=o.length!==s?n&&"object"==typeof n&&n.length!==s?n:[]:n&&"object"==typeof n&&n.length===s?n:{},i[r]=l(n,o)):i[r]=o);return i}}),function(e){window.qoopido.register("function/unique/uuid",e)}(function(e,t,r,n,o,i,s){"use strict";function l(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(p,function(e){var t=16*Math.random()|0,r="x"===e?t:3&t|8;return r.toString(16)})}var u={},p=new RegExp("[xy]","g");return function(){var e;do e=l();while("undefined"!=typeof u[e]);return u[e]=!0,e}}),function(e){window.qoopido.registerSingleton("hook/event",e,["../base"])}(function(e,t,r,n,o,i,s){"use strict";function l(e,t,r){for(var n,o=0;(n=r[o])!==s;o++)e[n]=t[n];e._properties=e._properties.concat(r)}var u={general:{properties:"type altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which path".split(" "),process:function(e,t){var r;if(e.originalEvent=t,e.isDefaultPrevented=t.defaultPrevented?!0:!1,e.isPropagationStopped=t.cancelBubble?!0:!1,e.metaKey=t.metaKey&&t.metaKey!==!1?!0:!1,e.target||(e.target=t.srcElement||i),3===e.target.nodeType&&(e.target=e.target.parentNode),!e.path){e.path=[],r=e.target;do e.path.push(r);while(r=r.parentNode);e.path.push(o)}}},mouse:{regex:new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"),properties:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement dataTransfer".split(" "),process:function(e,t){var r,n,o;n=t.fromElement,o=t.button,null===e.pageX&&null!==t.clientX&&(r=e.target.ownerDocument||i,r=r.documentElement||r.body,e.pageX=t.clientX+(r.scrollLeft||0)-(r.clientLeft||0),e.pageY=t.clientY+(r.scrollTop||0)-(r.clientTop||0)),!e.relatedTarget&&n&&(e.relatedTarget=n===e.target?t.toElement:n),e.which||o===s||(e.which=1&o?1:2&o?3:4&o?2:0)}},key:{regex:new RegExp("^(?:key)"),properties:"char charCode key keyCode".split(" "),process:function(e,t){null===e.which&&(e.which=null!==t.charCode?t.charCode:t.keyCode)}}};return e.base.extend({add:function(e,t){return e&&t&&u[e]&&(u[e]=t),this},get:function(e){return e&&u[e]?u[e]:null},process:function(e,t){var r,n,o;for(r in u)n=u[r],o=!n.regex||n.regex.test(t.type),o&&(n.properties&&l(e,t,n.properties),n.process&&n.process(e,t),n.delegate&&(e.delegate=n.delegate))}})}),function(e){var t=["../base","../support"];window.getComputedStyle||t.push("../polyfill/window/getcomputedstyle"),window.qoopido.registerSingleton("hook/css",e,t)}(function(e,t,r,n,o,i,s){"use strict";var l=e.support,u=o.getComputedStyle||e["polyfill/window/getcomputedstyle"],p={general:{get:function(e,t){return u(e,null).getPropertyValue(t[0])},set:function(e,t,r){e.style[t[1]]=r}},opacity:l.supportsCssProperty("opacity")?null:{regex:new RegExp("alpha\\(opacity=(.*)\\)","i"),get:function(e,t,r){return r=u(e,null).getPropertyValue("filter").toString().match(this.regex),r=r?r[1]/100:1},set:function(e,t,r){var n=e.style;n.zoom=1,n.filter="alpha(opacity="+(100*r+.5>>0)+")"}}};return e.base.extend({add:function(e,t){return e&&t&&p[e]&&(p[e]=t),this},get:function(e){return e&&p[e]?p[e]:null},process:function(e,t,r,n){var o;return r=l.getCssProperty(r,t)||null,r?((o=this.get(r[1]))&&o[e]||this.get("general")[e])(t,r,n):void 0}})}),function(e){window.qoopido.register("dom/event",e,["../base","../hook/event"])}(function(e,t,r,n,o,i,s){"use strict";var l=e["hook/event"];return e.base.extend({originalEvent:null,isDelegate:!1,isDefaultPrevented:!1,isPropagationStopped:!1,isImmediatePropagationStopped:!1,_properties:null,_constructor:function(e){var t=this;return t._properties=[],t._obtain(e),t},_obtain:function(e){l.process(this,e)},_dispose:function(){for(var e,t=this,r=0;(e=t._properties[r])!==s;r++)delete t[e];delete t.delegate,t.originalEvent=null,t.isDelegate=!1,t.isDefaultPrevented=!1,t.isPropagationStopped=!1,t.isImmediatePropagationStopped=!1,t._properties.length=0},preventDefault:function(){var e=this,t=e.originalEvent;t.cancelable!==!1&&(e.isDefaultPrevented=!0,t.preventDefault?t.preventDefault():t.returnValue=!1)},stopPropagation:function(){var e=this,t=e.originalEvent;e.isPropagationStopped=!0,t.stopPropagation&&t.stopPropagation(),t.cancelBubble=!0},stopImmediatePropagation:function(){var e=this,t=e.originalEvent;e.isImmediatePropagationStopped=!0,t.stopImmediatePropagation&&t.stopImmediatePropagation(),e.stopPropagation()}})}),function(e){var t=["../base","../function/unique/uuid","../hook/css","./event"];window.CustomEvent||t.push("../polyfill/window/customevent"),window.addEventListener||t.push("../polyfill/window/addeventlistener"),window.removeEventListener||t.push("../polyfill/window/removeeventlistener"),window.dispatchEvent||t.push("../polyfill/window/dispatchevent"),Element.prototype.matches||t.push("../polyfill/element/matches"),document.querySelector||t.push("../polyfill/document/queryselector"),document.querySelectorAll||t.push("../polyfill/document/queryselectorall"),String.prototype.trim||t.push("../polyfill/string/trim"),window.qoopido.register("dom/element",e,t)}(function(e,t,r,n,o,i,s){"use strict";function l(e){var t,r,n;for(t in E)r=E[t],(!r.regex||r.regex.test(e))&&(n=r);return n}function u(e,t,r){var n=this,o=l(e),s=i.createEvent(o.type);s[o.method](e,"load"===e?!1:!0,!0,t),r&&(s._quid=r,s.isDelegate=!0),n.element.dispatchEvent(s)}function p(e){var t;if("string"==typeof e)try{w.test(e)===!0?(t=e.replace(w,"$1").toLowerCase(),e=i.createElement(t)):e=i.querySelector(e)}catch(r){e=null}if(!e)throw new Error("[Qoopido.js] Element could not be resolved");return e}function c(e){return Array.prototype.concat.apply([],Array.prototype.splice.call(e,0)).join(" ").split(_)}function a(e,t){for(var r,n=0;(r=e.path[n])!==s;n++){if(r.matches(t))return e.currentTarget=r,!0;if(r===e.currentTarget)break}return!1}var f="object",d="string",m=e["function/unique/uuid"],g=i.getElementsByTagName("head")[0],h="textContent"in i.createElement("a")?"textContent":"innerText",v="undefined"!=typeof g.previousElementSibling?function(){return this.previousElementSibling}:function(){for(var e=this;e=e.previousSibling;)if(1===e.nodeType)return e},y="undefined"!=typeof g.nextElementSibling?function(){return this.nextElementSibling}:function(){for(var e=this;e=e.nextSibling;)if(1===e.nodeType)return e},w=new RegExp("^<(\\w+)\\s*/>$"),b=new RegExp("^[^-]+"),_=new RegExp(" +","g"),x=e["pool/module"]&&e["pool/module"].create(e["dom/event"],null,!0)||null,j=e["hook/css"],P={},E={custom:{type:"CustomEvent",method:"initCustomEvent"},html:{regex:new RegExp("^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$"),type:"HTMLEvents",method:"initEvent"},mouse:{regex:new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"),type:"MouseEvents",method:"initMouseEvent"}};return e.base.extend({type:null,element:null,_listener:null,_constructor:function(e,t,r){var n,o=this;return e=p(e),n=e._quid,n?o=P[n]:(n=e._quid=m(),o.type=e.tagName,o.element=e,o._listener={},P[n]=o),"object"==typeof t&&null!==t&&o.setAttributes(t),"object"==typeof r&&null!==r&&o.setStyles(r),o!==this&&this.dispose&&this.dispose(),o},_obtain:function(e,t,r){this._constructor(e,t,r)},_dispose:function(){var e,t,r=this;for(e in r._listener)t=e.match(b),r.element.removeEventListener(t,r._listener[e]),delete r._listener[e];r.type=null,r.element=null},getContent:function(e){var t=this.element;return e&&e!==!1?t.innerHTML:t[h]},setContent:function(e,t){var r=this,n=r.element;return t&&t!==!1?n.innerHTML=e:n[h]=e,r},getAttribute:function(e){var t=this;return e&&typeof e===d?t.element.getAttribute(e):void 0},getAttributes:function(){for(var e,t=this,r={},n=c(arguments),o=0;(e=n[o])!==s;o++)r[e]=t.element.getAttribute(e);return r},setAttribute:function(e,t){var r=this;return e&&typeof e===d&&r.element.setAttribute(e,t),r},setAttributes:function(e){var t,r=this;if(e&&typeof e===f&&!e.length)for(t in e)r.element.setAttribute(t,e[t]);return r},removeAttribute:function(e){var t=this;return e&&typeof e===d&&t.element.removeAttribute(e),t},removeAttributes:function(){for(var e,t=this,r=c(arguments),n=0;(e=r[n])!==s;n++)t.element.removeAttribute(e);return t},getStyle:function(e){var t=this;return e&&typeof e===d?j.process("get",t.element,e):void 0},getStyles:function(){for(var e,t=this,r={},n=c(arguments),o=0;(e=n[o])!==s;o++)r[e]=j.process("get",t.element,e);return r},setStyle:function(e,t){var r=this;return e&&typeof e===d&&j.process("set",r.element,e,t),r},setStyles:function(e){var t,r=this;if(e&&typeof e===f&&!e.length)for(t in e)j.process("set",r.element,t,e[t]);return r},removeStyle:function(e){var t=this;return e&&typeof e===d&&t.setStyle(e,""),t},removeStyles:function(){for(var e,t=this,r=c(arguments),n=0;(e=r[n])!==s;n++)t.setStyle(e,"");return t},siblings:function(e){for(var t=this.element,r=t.parentNode.firstChild,n=[];r;r=y.call(r))r===t||e&&!r.matches(e)||n.push(r);return n},siblingsBefore:function(e){for(var t=this.element.previousSibling,r=[];t;t=v.call(t))(!e||t.matches(e))&&r.push(t);return r},siblingsAfter:function(e){for(var t=this.element.nextSibling,r=[];t;t=y.call(t))(!e||t.matches(e))&&r.push(t);return r},previous:function(e){var t=v.call(this.element);if(!e)return t;for(;t;t=v.call(t))if(t.matches(e))return t},next:function(e){var t=y.call(this.element);if(!e)return t;for(;t;t=y.call(t))if(t.matches(e))return t},find:function(e){var t,r,n=this.element;return e=e.trim(),">"===e.charAt(0)?(t=n._quid,n.setAttribute("data-quid",t),e='[data-quid="'+t+'"] '+e,r=n.parentNode.querySelectorAll(e),n.removeAttribute("data-quid")):r=n.querySelectorAll(e),r},parent:function(e){var t;if(!e)return this.element.parentNode;for(t=this.element;t;t=t.parentNode)if(t.matches(e))return t},parents:function(e){for(var t=this.element.parentNode,r=[];t;t=t.parentNode){if(9===t.nodeType)return r;1===t.nodeType&&(!e||t.matches(e))&&r.push(t)}},isVisible:function(){var e=this,t=e.element;return!(t.offsetWidth<=0&&t.offsetHeight<=0||"hidden"===e.getStyle("visibility")||e.getStyle("opacity")<=0)},hasClass:function(e){return e?new RegExp("(?:^|\\s)"+e+"(?:\\s|$)").test(this.element.className):!1},addClass:function(e){var t=this;return e&&!t.hasClass(e)&&(t.element.className+=t.element.className?" "+e:e),t},removeClass:function(e){var t=this;return e&&t.hasClass(e)&&(t.element.className=t.element.className.replace(new RegExp("(?:^|\\s)"+e+"(?!\\S)"),"")),t},toggleClass:function(e){var t=this;return e&&(t.hasClass(e)?t.removeClass(e):t.addClass(e)),t},prepend:function(e){var t=this,r=t.element;if(e)try{e=e.element||p(e),r.firstChild?r.insertBefore(e,r.firstChild):t.append(e)}catch(n){r.insertAdjacentHTML("afterBegin",e)}return t},append:function(e){var t=this,r=t.element;if(e)try{r.appendChild(e.element||p(e))}catch(n){r.insertAdjacentHTML("beforeEnd",e)}return t},prependTo:function(e){var t=this,r=t.element;return e&&((e=e.element||p(e)).firstChild?e.insertBefore(r,e.firstChild):t.appendTo(e)),t},appendTo:function(e){var t=this;return e&&(e.element||p(e)).appendChild(t.element),t},insertBefore:function(e){var t=this,r=t.element;return e&&(e=e.element||p(e)).parentNode.insertBefore(r,e),t},insertAfter:function(e){var t=this,r=t.element;return e&&((e=e.element||p(e)).nextSibling?e.parentNode.insertBefore(r,e.nextSibling):t.appendTo(e.parentNode)),t},replace:function(e){var t=this,r=t.element;return e&&(e=e.element||p(e)).parentNode.replaceChild(r,e),t},replaceWith:function(e){var t=this,r=t.element;return e&&(e=e.element||p(e),r.parentNode.replaceChild(e,r)),t},remove:function(){var e=this,t=e.element;return t.parentNode.removeChild(t),e},on:function(t){var r,n=this,o=n.element,i=arguments.length>2?arguments[1]:null,l=arguments.length>2?arguments[2]:arguments[1],p=l._quid||(l._quid=m()),c=0;for(t=t.split(" ");(r=t[c])!==s;c++){var f=r+"-"+p,d=function(t){var r;t=x&&x.obtain(t)||e["dom/event"].create(t),t.isPropagationStopped||(r=t.delegate,t._quid=m(),(!i||a(t,i))&&l.call(t.currentTarget,t,t.originalEvent.detail),r&&(delete t.delegate,u.call(n,r))),t.dispose&&t.dispose()};d.type=r,n._listener[f]=d,o.addEventListener(r,d)}return n},one:function(e){var t=this,r=arguments.length>3||"string"==typeof arguments[1]?arguments[1]:null,n=arguments.length>3||"function"==typeof arguments[2]?arguments[2]:arguments[1],o=(arguments.length>3?arguments[3]:arguments[2])!==!1,i=function(r){t.off(o===!0?r.type:e,i),n.call(this,r,r.originalEvent.detail)};return n._quid=i._quid=m(),r?t.on(e,r,i):t.on(e,i),t},off:function(e,t){var r,n,o,i=this,l=i.element,u=0;for(e=e.split(" ");(r=e[u])!==s;u++)n=t._quid&&r+"-"+t._quid||null,o=n&&i._listener[n]||null,o?(l.removeEventListener(r,o),delete i._listener[n]):l.removeEventListener(r,t);return i},emit:function(e,t){var r=this;return u.call(r,e,t),r}})}),function(e){window.qoopido.register("dom/element/emerge",e,["../element","../../function/merge","../../function/unique/uuid"])}(function(e,t,r,n,o,i,s){"use strict";function l(e){var t,r=v[e];for(t in r)"length"!==t&&c.call(r[t]);0===r.length&&(o.element.clearInterval(h[e]),delete h[e])}function u(){g.left=0,g.top=0,g.right=o.innerWidth||m.clientWidth,g.bottom=o.innerHeight||m.clientHeight}function p(){var e=this,t=e._settings.threshold,r=t!==s?t:m.clientWidth*e._settings.auto,n=t!==s?t:m.clientHeight*e._settings.auto;e._viewport.left=g.left-r,e._viewport.top=g.top-n,e._viewport.right=g.right+r,e._viewport.bottom=g.bottom+n}function c(){var e,t=this,r=!1,n=2;!t.isVisible()||"hidden"===t.getStyle("visibility")&&t._settings.visibility!==!1||(e=t.element.getBoundingClientRect(),(e.bottom>=t._viewport.top&&e.bottom<=t._viewport.bottom||e.top>=t._viewport.top&&e.top<=t._viewport.bottom||t._viewport.bottom>=e.top&&t._viewport.bottom<=e.bottom||t._viewport.top>=e.top&&t._viewport.top<=e.bottom)&&(e.left>=t._viewport.left&&e.left<=t._viewport.right||e.right>=t._viewport.left&&e.right<=t._viewport.right||t._viewport.left>=e.left&&t._viewport.left<=e.right||t._viewport.right>=e.left&&t._viewport.right<=e.right)&&((0===t._settings.threshold||(e.bottom>=g.top&&e.bottom<=g.bottom||e.top>=g.top&&e.top<=g.bottom||g.bottom>=e.top&&g.bottom<=e.bottom||g.top>=e.top&&g.top<=e.bottom)&&(e.left>=g.left&&e.left<=g.right||e.right>=g.left&&e.right<=g.right||g.left>=e.left&&g.left<=e.right||g.right>=e.left&&g.right<=e.right))&&(n=1),r=!0)),(r!==t._state||r===!0&&n!==t._priority)&&a.call(t,r,n)}function a(e,t){var r=this;r._state=e,r._priority=t,r._settings.recur!==!0&&r.remove(),e===!0?r.emit(y,t):r.emit(w)}var f,d={interval:50,threshold:"auto",recur:!0,auto:1,visibility:!0},m=o.document.documentElement,g={},h={},v={},y="emerged",w="demerged",b="resize orientationchange";if(o=e["dom/element"].create(o),"CSS1Compat"!==i.compatMode)throw"[Qoopido.js] Not in standards mode";return f=e["dom/element"].extend({_quid:null,_viewport:null,_settings:null,_state:null,_priority:null,_constructor:function(t,r){var n=f._parent._constructor.call(this,t);return r=e["function/merge"]({},d,r||{}),"auto"===r.threshold&&delete r.threshold,h[r.interval]===s&&(v[r.interval]=v[r.interval]||{length:0},h[r.interval]=o.element.setInterval(function(){l(r.interval)},r.interval)),n._quid=e["function/unique/uuid"](),n._viewport={},n._settings=r,n._state=!1,n._priority=2,v[r.interval][n._quid]=n,v[r.interval].length++,o.on(b,function(){p.call(n)}),p.call(n),n},remove:function(){var e=this;delete v[e._settings.interval][e._quid],v[e._settings.interval].length--}}),o.on(b,u),u(),f}); \ No newline at end of file diff --git a/dist/3.7.3/min/packages/qoopido.emitter.js b/dist/3.7.3/min/packages/qoopido.emitter.js new file mode 100644 index 00000000..adca17d7 --- /dev/null +++ b/dist/3.7.3/min/packages/qoopido.emitter.js @@ -0,0 +1,2 @@ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +!function(e,t,r,n,o){"use strict";function i(e,i,s,c){var a,d=e.split("/");return l[e]?l[e]:(a=function(){if(s)for(var a,m,_=d.slice(0,-1).join("/"),g=0;(a=s[g])!==o;g++)m=f.test(a),m&&(a=p(_+"/"+a)),!l[a]&&arguments[g]&&(l[a]=arguments[g]),m&&!l[a]&&"undefined"!=typeof console&&console.error("".concat("[Qoopido.js] ",e,": Could not load dependency ",a));return l[e]=i(l,u,d,t,r,n,o),c&&c(l[e]),l[e]},void("undefined"!=typeof module&&module.exports?module.exports=define(a):"function"==typeof define&&define.amd?s?define(s,a):define(a):a()))}function s(e,t,r){i(e,t,r,function(t){l[e]=t.create()})}function p(e){for(var t;(t=e.replace(d,""))!==e;)e=t;return e.replace(m,"")}var c=r.qoopido||(r.qoopido={}),u=c.shared||(c.shared={}),l=c.modules||(c.modules={}),a=[],f=new RegExp("^\\.+\\/"),d=new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."),m=new RegExp("(^\\/)|\\.\\/","g");c.register=i,c.registerSingleton=s,Object.create||a.push("./polyfill/object/create"),Object.getOwnPropertyNames||a.push("./polyfill/object/getownpropertynames"),Object.getOwnPropertyDescriptor&&function(){try{return Object.getOwnPropertyDescriptor({x:0},"x"),!0}catch(e){return!1}}()||a.push("./polyfill/object/getownpropertydescriptor"),i("base",e,a)}(function(e,t,r,n,o,i,s){"use strict";function p(e){for(var t,r={},n=Object.getOwnPropertyNames(e),o=0;(t=n[o])!==s;o++)r[t]=Object.getOwnPropertyDescriptor(e,t);return r}function c(){throw new Error("[Qoopido.js] Operation prohibited")}return{create:function(){var e,t=Object.create(this,p(this));return t._constructor&&(e=t._constructor.apply(t,arguments)),t.create=t.extend=c,e||t},extend:function(e,t){var r;return e=e||{},t=t===!0,e._parent=this,r=Object.create(this,p(e)),t===!0&&(r.extend=c),r}}},navigator,this,document),function(e){window.qoopido.register("emitter",e,["./base"])}(function(e,t,r,n,o,i,s){"use strict";function p(e,t){var r=t.charAt(0).toUpperCase()+t.slice(1);return e._mapped[t]=e[t],function(){var n,o=Array.prototype.slice.call(arguments);return e.emit.apply(e,["pre"+r,o]),n=e._mapped[t].apply(e,o),e.emit.apply(e,["post"+r,o,n]),n}}var c=/^(_|extend$|create$|on$|one$|off$|emit$|get.+)/;return e.base.extend({_mapped:null,_listener:null,_temp:null,_constructor:function(){var e,t=this;t._mapped={},t._listener={};for(e in t)"function"==typeof t[e]&&c.test(e)===!1&&(t[e]=p(t,e));return t},on:function(e,t){var r,n=this,o=0;for(e=e.split(" ");(r=e[o])!==s;o++)(n._listener[r]=n._listener[r]||[]).push(t);return n},one:function(e,t,r){r=r!==!1;var n=this;return n.on(e,function o(i){n.off(r===!0?i:e,o),t.apply(this,arguments)}),n},off:function(e,t){var r,n,o,i=this,p=0;if(e)for(e=e.split(" ");(r=e[p])!==s;p++)if(i._listener[r]=i._listener[r]||[],t)for(n=0;(o=i._listener[r][n])!==s;n++)o===t&&(i._listener[r].splice(n,1),n--);else i._listener[r].length=0;else for(r in i._listener)i._listener[r].length=0;return i},emit:function(e){var t,r=this,n=0;if(e!==s){for(r._listener[e]=r._listener[e]||[],r._temp=r._listener[e].slice();(t=r._temp[n])!==s;n++)t.apply(r,arguments);r._temp.length=0}return r}})}); \ No newline at end of file diff --git a/dist/3.7.3/min/packages/qoopido.emitter.legacy.js b/dist/3.7.3/min/packages/qoopido.emitter.legacy.js new file mode 100644 index 00000000..402dfe7c --- /dev/null +++ b/dist/3.7.3/min/packages/qoopido.emitter.legacy.js @@ -0,0 +1,2 @@ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +!function(e,t){t.register?t.register("polyfill/object/defineproperty",e):(t.modules=t.modules||{})["polyfill/object/defineproperty"]=e()}(function(e,t,r,o,n,i,c){"use strict";if(!Object.defineProperty||!function(){try{return Object.defineProperty({},"x",{}),!0}catch(e){return!1}}()){var p=Object.defineProperty,s=Object.prototype.__defineGetter__,u=Object.prototype.__defineSetter__;Object.defineProperty=function(e,t,r){if(p)try{return p(e,t,r)}catch(o){}if(e!==Object(e))throw new TypeError("Object.defineProperty called on non-object");return s&&"get"in r&&s.call(e,t,r.get),u&&"set"in r&&u.call(e,t,r.set),"value"in r&&(e[t]=r.value),e}}return Object.defineProperty},window.qoopido=window.qoopido||{}),function(e,t){if(t.register){var r=[];Object.defineProperty&&function(){try{return Object.defineProperty({},"x",{}),!0}catch(e){return!1}}()||r.push("./defineproperty"),t.register("polyfill/object/defineproperties",e,r)}else(t.modules=t.modules||{})["polyfill/object/defineproperties"]=e()}(function(e,t,r,o,n,i,c){"use strict";return Object.defineProperties||(Object.defineProperties=function(e,t){if(e!==Object(e))throw new TypeError("Object.defineProperties called on non-object");var r;for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&Object.defineProperty(e,r,t[r]);return e}),Object.defineProperties},window.qoopido=window.qoopido||{}),function(e,t){if(t.register){var r=[];Object.defineProperties||r.push("./defineproperties"),t.register("polyfill/object/create",e,r)}else(t.modules=t.modules||{})["polyfill/object/create"]=e()}(function(e,t,r,o,n,i,c){"use strict";return Object.create||(Object.create=function(e,t){function r(){}if("object"!=typeof e)throw new TypeError;r.prototype=e;var o=new r;if(e&&(o.constructor=r),arguments.length>1){if(t!==Object(t))throw new TypeError;Object.defineProperties(o,t)}return o}),Object.create},window.qoopido=window.qoopido||{}),function(e,t){t.register?t.register("polyfill/object/getownpropertynames",e):(t.modules=t.modules||{})["polyfill/object/getownpropertynames"]=e()}(function(e,t,r,o,n,i,c){"use strict";return Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(e){if(e!==Object(e))throw new TypeError("Object.getOwnPropertyNames called on non-object");var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.push(t);return r}),Object.getOwnPropertyNames},window.qoopido=window.qoopido||{}),function(e,t){t.register?t.register("polyfill/object/getownpropertydescriptor",e):(t.modules=t.modules||{})["polyfill/object/getownpropertydescriptor"]=e()}(function(e,t,r,o,n,i,c){"use strict";if(!Object.getOwnPropertyDescriptor||!function(){try{return Object.getOwnPropertyDescriptor({x:0},"x"),!0}catch(e){return!1}}()){var p=Object.getOwnPropertyDescriptor;Object.getOwnPropertyDescriptor=function(e,t){if(e!==Object(e))throw new TypeError;try{return p.call(Object,e,t)}catch(r){}return Object.prototype.hasOwnProperty.call(e,t)?{value:e[t],enumerable:!0,writable:!0,configurable:!0}:void 0}}return Object.getOwnPropertyDescriptor},window.qoopido=window.qoopido||{}),function(e,t,r,o,n){"use strict";function i(e,i,c,s){var f,d=e.split("/");return l[e]?l[e]:(f=function(){if(c)for(var f,y,b=d.slice(0,-1).join("/"),j=0;(f=c[j])!==n;j++)y=a.test(f),y&&(f=p(b+"/"+f)),!l[f]&&arguments[j]&&(l[f]=arguments[j]),y&&!l[f]&&"undefined"!=typeof console&&console.error("".concat("[Qoopido.js] ",e,": Could not load dependency ",f));return l[e]=i(l,u,d,t,r,o,n),s&&s(l[e]),l[e]},void("undefined"!=typeof module&&module.exports?module.exports=define(f):"function"==typeof define&&define.amd?c?define(c,f):define(f):f()))}function c(e,t,r){i(e,t,r,function(t){l[e]=t.create()})}function p(e){for(var t;(t=e.replace(d,""))!==e;)e=t;return e.replace(y,"")}var s=r.qoopido||(r.qoopido={}),u=s.shared||(s.shared={}),l=s.modules||(s.modules={}),f=[],a=new RegExp("^\\.+\\/"),d=new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."),y=new RegExp("(^\\/)|\\.\\/","g");s.register=i,s.registerSingleton=c,Object.create||f.push("./polyfill/object/create"),Object.getOwnPropertyNames||f.push("./polyfill/object/getownpropertynames"),Object.getOwnPropertyDescriptor&&function(){try{return Object.getOwnPropertyDescriptor({x:0},"x"),!0}catch(e){return!1}}()||f.push("./polyfill/object/getownpropertydescriptor"),i("base",e,f)}(function(e,t,r,o,n,i,c){"use strict";function p(e){for(var t,r={},o=Object.getOwnPropertyNames(e),n=0;(t=o[n])!==c;n++)r[t]=Object.getOwnPropertyDescriptor(e,t);return r}function s(){throw new Error("[Qoopido.js] Operation prohibited")}return{create:function(){var e,t=Object.create(this,p(this));return t._constructor&&(e=t._constructor.apply(t,arguments)),t.create=t.extend=s,e||t},extend:function(e,t){var r;return e=e||{},t=t===!0,e._parent=this,r=Object.create(this,p(e)),t===!0&&(r.extend=s),r}}},navigator,this,document),function(e){window.qoopido.register("emitter",e,["./base"])}(function(e,t,r,o,n,i,c){"use strict";function p(e,t){var r=t.charAt(0).toUpperCase()+t.slice(1);return e._mapped[t]=e[t],function(){var o,n=Array.prototype.slice.call(arguments);return e.emit.apply(e,["pre"+r,n]),o=e._mapped[t].apply(e,n),e.emit.apply(e,["post"+r,n,o]),o}}var s=/^(_|extend$|create$|on$|one$|off$|emit$|get.+)/;return e.base.extend({_mapped:null,_listener:null,_temp:null,_constructor:function(){var e,t=this;t._mapped={},t._listener={};for(e in t)"function"==typeof t[e]&&s.test(e)===!1&&(t[e]=p(t,e));return t},on:function(e,t){var r,o=this,n=0;for(e=e.split(" ");(r=e[n])!==c;n++)(o._listener[r]=o._listener[r]||[]).push(t);return o},one:function(e,t,r){r=r!==!1;var o=this;return o.on(e,function n(i){o.off(r===!0?i:e,n),t.apply(this,arguments)}),o},off:function(e,t){var r,o,n,i=this,p=0;if(e)for(e=e.split(" ");(r=e[p])!==c;p++)if(i._listener[r]=i._listener[r]||[],t)for(o=0;(n=i._listener[r][o])!==c;o++)n===t&&(i._listener[r].splice(o,1),o--);else i._listener[r].length=0;else for(r in i._listener)i._listener[r].length=0;return i},emit:function(e){var t,r=this,o=0;if(e!==c){for(r._listener[e]=r._listener[e]||[],r._temp=r._listener[e].slice();(t=r._temp[o])!==c;o++)t.apply(r,arguments);r._temp.length=0}return r}})}); \ No newline at end of file diff --git a/dist/3.7.3/min/packages/qoopido.lazyimage.js b/dist/3.7.3/min/packages/qoopido.lazyimage.js new file mode 100644 index 00000000..08a09bb0 --- /dev/null +++ b/dist/3.7.3/min/packages/qoopido.lazyimage.js @@ -0,0 +1,2 @@ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +!function(e,t,r,n,o){"use strict";function i(e,i,s,u){var c,d=e.split("/");return p[e]?p[e]:(c=function(){if(s)for(var c,m,h=d.slice(0,-1).join("/"),g=0;(c=s[g])!==o;g++)m=f.test(c),m&&(c=l(h+"/"+c)),!p[c]&&arguments[g]&&(p[c]=arguments[g]),m&&!p[c]&&"undefined"!=typeof console&&console.error("".concat("[Qoopido.js] ",e,": Could not load dependency ",c));return p[e]=i(p,a,d,t,r,n,o),u&&u(p[e]),p[e]},void("undefined"!=typeof module&&module.exports?module.exports=define(c):"function"==typeof define&&define.amd?s?define(s,c):define(c):c()))}function s(e,t,r){i(e,t,r,function(t){p[e]=t.create()})}function l(e){for(var t;(t=e.replace(d,""))!==e;)e=t;return e.replace(m,"")}var u=r.qoopido||(r.qoopido={}),a=u.shared||(u.shared={}),p=u.modules||(u.modules={}),c=[],f=new RegExp("^\\.+\\/"),d=new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."),m=new RegExp("(^\\/)|\\.\\/","g");u.register=i,u.registerSingleton=s,Object.create||c.push("./polyfill/object/create"),Object.getOwnPropertyNames||c.push("./polyfill/object/getownpropertynames"),Object.getOwnPropertyDescriptor&&function(){try{return Object.getOwnPropertyDescriptor({x:0},"x"),!0}catch(e){return!1}}()||c.push("./polyfill/object/getownpropertydescriptor"),i("base",e,c)}(function(e,t,r,n,o,i,s){"use strict";function l(e){for(var t,r={},n=Object.getOwnPropertyNames(e),o=0;(t=n[o])!==s;o++)r[t]=Object.getOwnPropertyDescriptor(e,t);return r}function u(){throw new Error("[Qoopido.js] Operation prohibited")}return{create:function(){var e,t=Object.create(this,l(this));return t._constructor&&(e=t._constructor.apply(t,arguments)),t.create=t.extend=u,e||t},extend:function(e,t){var r;return e=e||{},t=t===!0,e._parent=this,r=Object.create(this,l(e)),t===!0&&(r.extend=u),r}}},navigator,this,document),function(e){window.qoopido.register("polyfill/string/ucfirst",e)}(function(e,t,r,n,o,i,s){"use strict";return String.prototype.ucfirst||(String.prototype.ucfirst=function(){var e=this;return e.charAt(0).toUpperCase()+e.slice(1)}),String.prototype.ucfirst}),function(e){window.qoopido.register("polyfill/string/lcfirst",e)}(function(e,t,r,n,o,i,s){"use strict";return String.prototype.lcfirst||(String.prototype.lcfirst=function(){var e=this;return e.charAt(0).toLowerCase()+e.slice(1)}),String.prototype.lcfirst}),function(e){window.qoopido.register("polyfill/window/promise",e)}(function(e,t,r,n,o,i,s){"use strict";function l(e,t){var r=P.push([e,t]);1===r&&u()}function u(){o.setTimeout(a,1)}function a(){for(var e,t=0;(e=P[t])!==s;t++)e[0](e[1]);P.length=0}function p(e,t){var r,n=null;try{if(e===t)throw new TypeError("A promises callback cannot return that same promise.");if(("function"==typeof t||"object"==typeof t&&null!==t)&&(n=t.then,"function"==typeof n))return n.call(t,function(n){return r?!0:(r=!0,void(t!==n?d(e,n):m(e,n)))},function(t){return r?!0:(r=!0,void h(e,t))}),!0}catch(o){return r?!0:(h(e,o),!0)}return!1}function c(e,t){function r(e){d(t,e)}function n(e){h(t,e)}try{e(r,n)}catch(o){n(o)}}function f(e,t,r,n){var o,i,s,l,u="function"==typeof r;if(u)try{o=r(n),s=!0}catch(a){l=!0,i=a}else o=n,s=!0;p(t,o)||(u&&s?d(t,o):l?h(t,i):e===E?d(t,o):e===S&&h(t,o))}function d(e,t){e===t?m(e,t):p(e,t)||m(e,t)}function m(e,t){e._state===_&&(e._state=x,e._detail=t,l(g,e))}function h(e,t){e._state===_&&(e._state=x,e._detail=t,l(v,e))}function g(e){w(e,e._state=E)}function v(e){w(e,e._state=S)}function y(e,t,r,n){var o=e._subscribers,i=o.length;o[i]=t,o[i+E]=r,o[i+S]=n}function w(e,t){for(var r,n,o=e._subscribers,i=e._detail,l=0;(r=o[l])!==s;l+=3)n=o[l+t],f(t,r,n,i);e._subscribers=null}function b(e){var t=this;if("function"!=typeof e)throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");t._subscribers=[],c(e,t)}var _=void 0,x=0,E=1,S=2,P=[];return b.prototype={_state:s,_detail:s,_subscribers:s,then:function(e,t){var r=this,n=new b(function(){});return r._state?l(function(){f(r._state,n,arguments[r._state-1],r._detail)}):y(r,n,e,t),n},"catch":function(e){return this.then(null,e)}},o.Promise||(o.Promise=b),o.Promise}),function(e){var t=[];window.Promise||t.push("../polyfill/window/promise"),window.qoopido.register("promise/all",e,t)}(function(e,t,r,n,o,i,s){"use strict";return function(e){if("[object Array]"!==Object.prototype.toString.call(e))throw new TypeError("You must pass an array to all.");return new o.Promise(function(t,r){function n(e){return function(t){o(e,t)}}function o(e,r){l[e]=r,0===--u&&t(l)}var i,l=[],u=e.length,a=0;for(0===u&&t([]);(i=e[a])!==s;a++)i&&"function"==typeof i.then?i.then(n(a),r):o(a,i)})}}),function(e){var t=[];window.Promise||t.push("../polyfill/window/promise"),window.qoopido.register("promise/defer",e,t)}(function(e,t,r,n,o,i,s){"use strict";return function(){var e=this;e.promise=new o.Promise(function(t,r){e.resolve=t,e.reject=r})}}),function(e){var t=["./base","./promise/all","./promise/defer"];String.prototype.ucfirst||t.push("./polyfill/string/ucfirst"),String.prototype.lcfirst||t.push("./polyfill/string/lcfirst"),window.qoopido.registerSingleton("support",e,t)}(function(e,t,r,n,o,i,s){"use strict";function l(e){return e.replace(c,"$1").lcfirst().replace(f,"").replace(d,h)}var u=e["promise/all"],a=e["promise/defer"],p=new RegExp("^(Moz|WebKit|Khtml|ms|O|Icab)(?=[A-Z])"),c=new RegExp("^(?:webkit|khtml|icab|moz|ms|o)([A-Z])"),f=new RegExp("^-(?:webkit|khtml|icab|moz|ms|o)-"),d=new RegExp("-([a-z])","gi"),m=new RegExp("([A-Z])","g"),h=function(){return arguments[1].ucfirst()},g={prefix:null,method:{},property:{},css:{},promises:{prefix:null,method:{},property:{},css:{},test:{}}};return e.base.extend({test:{},pool:t.pool&&t.pool.dom,testMultiple:function(){for(var e,t=[],r=0;(e=arguments[r])!==s;r++)switch(typeof e){case"string":t.push(this.test[e]());break;case"boolean":var n=new a;e?n.resolve():n.reject(),t.push(n.promise);break;default:t.push(e)}return new u(t)},getPrefix:function(){var e,t=this,r=g.prefix||null;if(null===r){var n=t.pool?t.pool.obtain("div"):i.createElement("div"),o=n.style;r=!1;for(e in o)p.test(e)&&(r=e.match(p)[0]);r===!1&&"WebkitOpacity"in o&&(r="WebKit"),r===!1&&"KhtmlOpacity"in o&&(r="Khtml"),r=g.prefix=r===!1?!1:[r.toLowerCase(),r.toLowerCase().ucfirst(),r],n.dispose&&n.dispose()}return r},getMethod:function(e,t){e=l(e),t=t||o;var r=t.tagName,n=g.method[r]=g.method[r]||{},i=n[e]=g.method[r][e]||null;if(null===i){i=!1;var u,a,p=0,c=e.ucfirst(),f=this.getPrefix();for(u=f!==!1?(e+" "+c+" "+f.join(c+" ")+c).split(" "):[e];(a=u[p])!==s;p++)if(t[a]!==s&&("function"==typeof t[a]||"object"==typeof t[a])){i=a;break}g.method[r][e]=i}return i},getProperty:function(e,t){e=l(e),t=t||o;var r=t.tagName,n=g.property[r]=g.property[r]||{},i=n[e]=g.property[r][e]||null;if(null===i){i=!1;var u,a,p=0,c=e.ucfirst(),f=this.getPrefix();for(u=f!==!1?(e+" "+c+" "+f.join(c+" ")+c).split(" "):[e],p;(a=u[p])!==s;p++)if(t[a]!==s){i=a;break}g.property[r][e]=i}return i},getCssProperty:function(e){e=l(e);var t=this,r=g.css[e]||null;if(null===r){r=!1;var n,o=0,u=t.pool?t.pool.obtain("div"):i.createElement("div"),a=e.ucfirst(),p=this.getPrefix()||[],c=(e+" "+a+" "+p.join(a+" ")+a).split(" "),f="";for(o;(n=c[o])!==s;o++)if(u.style[n]!==s){r=n,o>0&&(f="-");break}r=g.css[e]=r!==!1?[f+r.replace(m,"-$1").toLowerCase(),r]:!1,u.dispose&&u.dispose()}return r},supportsPrefix:function(){return!!this.getPrefix()},supportsMethod:function(e,t){return!!this.getMethod(e,t)},supportsProperty:function(e,t){return!!this.getProperty(e,t)},supportsCssProperty:function(e){return!!this.getCssProperty(e)},testPrefix:function(){var e=g.promises.prefix;if(null===e){var t=new a,r=this.getPrefix();r?t.resolve(r):t.reject(),e=g.promises.prefix=t.promise}return e},testMethod:function(e,t){t=t||o;var r=t.tagName,n=g.promises.method[r]=g.promises.method[r]||{},i=n[e]=g.promises.method[r][e]||null;if(null===i){var s=new a,l=this.getMethod(e,t);l?s.resolve(l):s.reject(),i=g.promises.method[r][e]=s.promise}return i},testProperty:function(e,t){t=t||o;var r=t.tagName,n=g.promises.property[r]=g.promises.property[r]||{},i=n[e]=g.promises.property[r][e]||null;if(null===i){var s=new a,l=this.getProperty(e,t);l?s.resolve(l):s.reject(),i=g.promises.property[r][e]=s.promise}return i},testCssProperty:function(e){var t=g.promises.css[e]||null;if(null===t){var r=new a,n=this.getCssProperty(e);n?r.resolve(n):r.reject(),t=g.promises.css[e]=r.promise}return t},addTest:function(e,t){return this.test[e]=function(){var r=g.promises.test[e]||null;if(null===r){var n=new a,o=Array.prototype.slice.call(arguments);o.splice(0,0,n),t.apply(null,o),r=g.promises.test[e]=n.promise}return r}}})}),function(e){window.qoopido.register("function/merge",e)}(function(e,t,r,n,o,i,s){"use strict";return function l(){var e,t,r,n,o,i=arguments[0];for(e=1;(t=arguments[e])!==s;e++)for(r in t)n=i[r],o=t[r],o!==s&&(null!==o&&"object"==typeof o?(n=o.length!==s?n&&"object"==typeof n&&n.length!==s?n:[]:n&&"object"==typeof n&&n.length===s?n:{},i[r]=l(n,o)):i[r]=o);return i}}),function(e){window.qoopido.register("function/unique/uuid",e)}(function(e,t,r,n,o,i,s){"use strict";function l(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(a,function(e){var t=16*Math.random()|0,r="x"===e?t:3&t|8;return r.toString(16)})}var u={},a=new RegExp("[xy]","g");return function(){var e;do e=l();while("undefined"!=typeof u[e]);return u[e]=!0,e}}),function(e){window.qoopido.registerSingleton("hook/event",e,["../base"])}(function(e,t,r,n,o,i,s){"use strict";function l(e,t,r){for(var n,o=0;(n=r[o])!==s;o++)e[n]=t[n];e._properties=e._properties.concat(r)}var u={general:{properties:"type altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which path".split(" "),process:function(e,t){var r;if(e.originalEvent=t,e.isDefaultPrevented=t.defaultPrevented?!0:!1,e.isPropagationStopped=t.cancelBubble?!0:!1,e.metaKey=t.metaKey&&t.metaKey!==!1?!0:!1,e.target||(e.target=t.srcElement||i),3===e.target.nodeType&&(e.target=e.target.parentNode),!e.path){e.path=[],r=e.target;do e.path.push(r);while(r=r.parentNode);e.path.push(o)}}},mouse:{regex:new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"),properties:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement dataTransfer".split(" "),process:function(e,t){var r,n,o;n=t.fromElement,o=t.button,null===e.pageX&&null!==t.clientX&&(r=e.target.ownerDocument||i,r=r.documentElement||r.body,e.pageX=t.clientX+(r.scrollLeft||0)-(r.clientLeft||0),e.pageY=t.clientY+(r.scrollTop||0)-(r.clientTop||0)),!e.relatedTarget&&n&&(e.relatedTarget=n===e.target?t.toElement:n),e.which||o===s||(e.which=1&o?1:2&o?3:4&o?2:0)}},key:{regex:new RegExp("^(?:key)"),properties:"char charCode key keyCode".split(" "),process:function(e,t){null===e.which&&(e.which=null!==t.charCode?t.charCode:t.keyCode)}}};return e.base.extend({add:function(e,t){return e&&t&&u[e]&&(u[e]=t),this},get:function(e){return e&&u[e]?u[e]:null},process:function(e,t){var r,n,o;for(r in u)n=u[r],o=!n.regex||n.regex.test(t.type),o&&(n.properties&&l(e,t,n.properties),n.process&&n.process(e,t),n.delegate&&(e.delegate=n.delegate))}})}),function(e){var t=["../base","../support"];window.getComputedStyle||t.push("../polyfill/window/getcomputedstyle"),window.qoopido.registerSingleton("hook/css",e,t)}(function(e,t,r,n,o,i,s){"use strict";var l=e.support,u=o.getComputedStyle||e["polyfill/window/getcomputedstyle"],a={general:{get:function(e,t){return u(e,null).getPropertyValue(t[0])},set:function(e,t,r){e.style[t[1]]=r}},opacity:l.supportsCssProperty("opacity")?null:{regex:new RegExp("alpha\\(opacity=(.*)\\)","i"),get:function(e,t,r){return r=u(e,null).getPropertyValue("filter").toString().match(this.regex),r=r?r[1]/100:1},set:function(e,t,r){var n=e.style;n.zoom=1,n.filter="alpha(opacity="+(100*r+.5>>0)+")"}}};return e.base.extend({add:function(e,t){return e&&t&&a[e]&&(a[e]=t),this},get:function(e){return e&&a[e]?a[e]:null},process:function(e,t,r,n){var o;return r=l.getCssProperty(r,t)||null,r?((o=this.get(r[1]))&&o[e]||this.get("general")[e])(t,r,n):void 0}})}),function(e){window.qoopido.register("dom/event",e,["../base","../hook/event"])}(function(e,t,r,n,o,i,s){"use strict";var l=e["hook/event"];return e.base.extend({originalEvent:null,isDelegate:!1,isDefaultPrevented:!1,isPropagationStopped:!1,isImmediatePropagationStopped:!1,_properties:null,_constructor:function(e){var t=this;return t._properties=[],t._obtain(e),t},_obtain:function(e){l.process(this,e)},_dispose:function(){for(var e,t=this,r=0;(e=t._properties[r])!==s;r++)delete t[e];delete t.delegate,t.originalEvent=null,t.isDelegate=!1,t.isDefaultPrevented=!1,t.isPropagationStopped=!1,t.isImmediatePropagationStopped=!1,t._properties.length=0},preventDefault:function(){var e=this,t=e.originalEvent;t.cancelable!==!1&&(e.isDefaultPrevented=!0,t.preventDefault?t.preventDefault():t.returnValue=!1)},stopPropagation:function(){var e=this,t=e.originalEvent;e.isPropagationStopped=!0,t.stopPropagation&&t.stopPropagation(),t.cancelBubble=!0},stopImmediatePropagation:function(){var e=this,t=e.originalEvent;e.isImmediatePropagationStopped=!0,t.stopImmediatePropagation&&t.stopImmediatePropagation(),e.stopPropagation()}})}),function(e){var t=["../base","../function/unique/uuid","../hook/css","./event"];window.CustomEvent||t.push("../polyfill/window/customevent"),window.addEventListener||t.push("../polyfill/window/addeventlistener"),window.removeEventListener||t.push("../polyfill/window/removeeventlistener"),window.dispatchEvent||t.push("../polyfill/window/dispatchevent"),Element.prototype.matches||t.push("../polyfill/element/matches"),document.querySelector||t.push("../polyfill/document/queryselector"),document.querySelectorAll||t.push("../polyfill/document/queryselectorall"),String.prototype.trim||t.push("../polyfill/string/trim"),window.qoopido.register("dom/element",e,t)}(function(e,t,r,n,o,i,s){"use strict";function l(e){var t,r,n;for(t in P)r=P[t],(!r.regex||r.regex.test(e))&&(n=r);return n}function u(e,t,r){var n=this,o=l(e),s=i.createEvent(o.type);s[o.method](e,"load"===e?!1:!0,!0,t),r&&(s._quid=r,s.isDelegate=!0),n.element.dispatchEvent(s)}function a(e){var t;if("string"==typeof e)try{w.test(e)===!0?(t=e.replace(w,"$1").toLowerCase(),e=i.createElement(t)):e=i.querySelector(e)}catch(r){e=null}if(!e)throw new Error("[Qoopido.js] Element could not be resolved");return e}function p(e){return Array.prototype.concat.apply([],Array.prototype.splice.call(e,0)).join(" ").split(_)}function c(e,t){for(var r,n=0;(r=e.path[n])!==s;n++){if(r.matches(t))return e.currentTarget=r,!0;if(r===e.currentTarget)break}return!1}var f="object",d="string",m=e["function/unique/uuid"],h=i.getElementsByTagName("head")[0],g="textContent"in i.createElement("a")?"textContent":"innerText",v="undefined"!=typeof h.previousElementSibling?function(){return this.previousElementSibling}:function(){for(var e=this;e=e.previousSibling;)if(1===e.nodeType)return e},y="undefined"!=typeof h.nextElementSibling?function(){return this.nextElementSibling}:function(){for(var e=this;e=e.nextSibling;)if(1===e.nodeType)return e},w=new RegExp("^<(\\w+)\\s*/>$"),b=new RegExp("^[^-]+"),_=new RegExp(" +","g"),x=e["pool/module"]&&e["pool/module"].create(e["dom/event"],null,!0)||null,E=e["hook/css"],S={},P={custom:{type:"CustomEvent",method:"initCustomEvent"},html:{regex:new RegExp("^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$"),type:"HTMLEvents",method:"initEvent"},mouse:{regex:new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"),type:"MouseEvents",method:"initMouseEvent"}};return e.base.extend({type:null,element:null,_listener:null,_constructor:function(e,t,r){var n,o=this;return e=a(e),n=e._quid,n?o=S[n]:(n=e._quid=m(),o.type=e.tagName,o.element=e,o._listener={},S[n]=o),"object"==typeof t&&null!==t&&o.setAttributes(t),"object"==typeof r&&null!==r&&o.setStyles(r),o!==this&&this.dispose&&this.dispose(),o},_obtain:function(e,t,r){this._constructor(e,t,r)},_dispose:function(){var e,t,r=this;for(e in r._listener)t=e.match(b),r.element.removeEventListener(t,r._listener[e]),delete r._listener[e];r.type=null,r.element=null},getContent:function(e){var t=this.element;return e&&e!==!1?t.innerHTML:t[g]},setContent:function(e,t){var r=this,n=r.element;return t&&t!==!1?n.innerHTML=e:n[g]=e,r},getAttribute:function(e){var t=this;return e&&typeof e===d?t.element.getAttribute(e):void 0},getAttributes:function(){for(var e,t=this,r={},n=p(arguments),o=0;(e=n[o])!==s;o++)r[e]=t.element.getAttribute(e);return r},setAttribute:function(e,t){var r=this;return e&&typeof e===d&&r.element.setAttribute(e,t),r},setAttributes:function(e){var t,r=this;if(e&&typeof e===f&&!e.length)for(t in e)r.element.setAttribute(t,e[t]);return r},removeAttribute:function(e){var t=this;return e&&typeof e===d&&t.element.removeAttribute(e),t},removeAttributes:function(){for(var e,t=this,r=p(arguments),n=0;(e=r[n])!==s;n++)t.element.removeAttribute(e);return t},getStyle:function(e){var t=this;return e&&typeof e===d?E.process("get",t.element,e):void 0},getStyles:function(){for(var e,t=this,r={},n=p(arguments),o=0;(e=n[o])!==s;o++)r[e]=E.process("get",t.element,e);return r},setStyle:function(e,t){var r=this;return e&&typeof e===d&&E.process("set",r.element,e,t),r},setStyles:function(e){var t,r=this;if(e&&typeof e===f&&!e.length)for(t in e)E.process("set",r.element,t,e[t]);return r},removeStyle:function(e){var t=this;return e&&typeof e===d&&t.setStyle(e,""),t},removeStyles:function(){for(var e,t=this,r=p(arguments),n=0;(e=r[n])!==s;n++)t.setStyle(e,"");return t},siblings:function(e){for(var t=this.element,r=t.parentNode.firstChild,n=[];r;r=y.call(r))r===t||e&&!r.matches(e)||n.push(r);return n},siblingsBefore:function(e){for(var t=this.element.previousSibling,r=[];t;t=v.call(t))(!e||t.matches(e))&&r.push(t);return r},siblingsAfter:function(e){for(var t=this.element.nextSibling,r=[];t;t=y.call(t))(!e||t.matches(e))&&r.push(t);return r},previous:function(e){var t=v.call(this.element);if(!e)return t;for(;t;t=v.call(t))if(t.matches(e))return t},next:function(e){var t=y.call(this.element);if(!e)return t;for(;t;t=y.call(t))if(t.matches(e))return t},find:function(e){var t,r,n=this.element;return e=e.trim(),">"===e.charAt(0)?(t=n._quid,n.setAttribute("data-quid",t),e='[data-quid="'+t+'"] '+e,r=n.parentNode.querySelectorAll(e),n.removeAttribute("data-quid")):r=n.querySelectorAll(e),r},parent:function(e){var t;if(!e)return this.element.parentNode;for(t=this.element;t;t=t.parentNode)if(t.matches(e))return t},parents:function(e){for(var t=this.element.parentNode,r=[];t;t=t.parentNode){if(9===t.nodeType)return r;1===t.nodeType&&(!e||t.matches(e))&&r.push(t)}},isVisible:function(){var e=this,t=e.element;return!(t.offsetWidth<=0&&t.offsetHeight<=0||"hidden"===e.getStyle("visibility")||e.getStyle("opacity")<=0)},hasClass:function(e){return e?new RegExp("(?:^|\\s)"+e+"(?:\\s|$)").test(this.element.className):!1},addClass:function(e){var t=this;return e&&!t.hasClass(e)&&(t.element.className+=t.element.className?" "+e:e),t},removeClass:function(e){var t=this;return e&&t.hasClass(e)&&(t.element.className=t.element.className.replace(new RegExp("(?:^|\\s)"+e+"(?!\\S)"),"")),t},toggleClass:function(e){var t=this;return e&&(t.hasClass(e)?t.removeClass(e):t.addClass(e)),t},prepend:function(e){var t=this,r=t.element;if(e)try{e=e.element||a(e),r.firstChild?r.insertBefore(e,r.firstChild):t.append(e)}catch(n){r.insertAdjacentHTML("afterBegin",e)}return t},append:function(e){var t=this,r=t.element;if(e)try{r.appendChild(e.element||a(e))}catch(n){r.insertAdjacentHTML("beforeEnd",e)}return t},prependTo:function(e){var t=this,r=t.element;return e&&((e=e.element||a(e)).firstChild?e.insertBefore(r,e.firstChild):t.appendTo(e)),t},appendTo:function(e){var t=this;return e&&(e.element||a(e)).appendChild(t.element),t},insertBefore:function(e){var t=this,r=t.element;return e&&(e=e.element||a(e)).parentNode.insertBefore(r,e),t},insertAfter:function(e){var t=this,r=t.element;return e&&((e=e.element||a(e)).nextSibling?e.parentNode.insertBefore(r,e.nextSibling):t.appendTo(e.parentNode)),t},replace:function(e){var t=this,r=t.element;return e&&(e=e.element||a(e)).parentNode.replaceChild(r,e),t},replaceWith:function(e){var t=this,r=t.element;return e&&(e=e.element||a(e),r.parentNode.replaceChild(e,r)),t},remove:function(){var e=this,t=e.element;return t.parentNode.removeChild(t),e},on:function(t){var r,n=this,o=n.element,i=arguments.length>2?arguments[1]:null,l=arguments.length>2?arguments[2]:arguments[1],a=l._quid||(l._quid=m()),p=0;for(t=t.split(" ");(r=t[p])!==s;p++){var f=r+"-"+a,d=function(t){var r;t=x&&x.obtain(t)||e["dom/event"].create(t),t.isPropagationStopped||(r=t.delegate,t._quid=m(),(!i||c(t,i))&&l.call(t.currentTarget,t,t.originalEvent.detail),r&&(delete t.delegate,u.call(n,r))),t.dispose&&t.dispose()};d.type=r,n._listener[f]=d,o.addEventListener(r,d)}return n},one:function(e){var t=this,r=arguments.length>3||"string"==typeof arguments[1]?arguments[1]:null,n=arguments.length>3||"function"==typeof arguments[2]?arguments[2]:arguments[1],o=(arguments.length>3?arguments[3]:arguments[2])!==!1,i=function(r){t.off(o===!0?r.type:e,i),n.call(this,r,r.originalEvent.detail)};return n._quid=i._quid=m(),r?t.on(e,r,i):t.on(e,i),t},off:function(e,t){var r,n,o,i=this,l=i.element,u=0;for(e=e.split(" ");(r=e[u])!==s;u++)n=t._quid&&r+"-"+t._quid||null,o=n&&i._listener[n]||null,o?(l.removeEventListener(r,o),delete i._listener[n]):l.removeEventListener(r,t);return i},emit:function(e,t){var r=this;return u.call(r,e,t),r}})}),function(e){window.qoopido.register("dom/element/emerge",e,["../element","../../function/merge","../../function/unique/uuid"])}(function(e,t,r,n,o,i,s){"use strict";function l(e){var t,r=v[e];for(t in r)"length"!==t&&p.call(r[t]);0===r.length&&(o.element.clearInterval(g[e]),delete g[e])}function u(){h.left=0,h.top=0,h.right=o.innerWidth||m.clientWidth,h.bottom=o.innerHeight||m.clientHeight}function a(){var e=this,t=e._settings.threshold,r=t!==s?t:m.clientWidth*e._settings.auto,n=t!==s?t:m.clientHeight*e._settings.auto;e._viewport.left=h.left-r,e._viewport.top=h.top-n,e._viewport.right=h.right+r,e._viewport.bottom=h.bottom+n}function p(){var e,t=this,r=!1,n=2;!t.isVisible()||"hidden"===t.getStyle("visibility")&&t._settings.visibility!==!1||(e=t.element.getBoundingClientRect(),(e.bottom>=t._viewport.top&&e.bottom<=t._viewport.bottom||e.top>=t._viewport.top&&e.top<=t._viewport.bottom||t._viewport.bottom>=e.top&&t._viewport.bottom<=e.bottom||t._viewport.top>=e.top&&t._viewport.top<=e.bottom)&&(e.left>=t._viewport.left&&e.left<=t._viewport.right||e.right>=t._viewport.left&&e.right<=t._viewport.right||t._viewport.left>=e.left&&t._viewport.left<=e.right||t._viewport.right>=e.left&&t._viewport.right<=e.right)&&((0===t._settings.threshold||(e.bottom>=h.top&&e.bottom<=h.bottom||e.top>=h.top&&e.top<=h.bottom||h.bottom>=e.top&&h.bottom<=e.bottom||h.top>=e.top&&h.top<=e.bottom)&&(e.left>=h.left&&e.left<=h.right||e.right>=h.left&&e.right<=h.right||h.left>=e.left&&h.left<=e.right||h.right>=e.left&&h.right<=e.right))&&(n=1),r=!0)),(r!==t._state||r===!0&&n!==t._priority)&&c.call(t,r,n)}function c(e,t){var r=this;r._state=e,r._priority=t,r._settings.recur!==!0&&r.remove(),e===!0?r.emit(y,t):r.emit(w)}var f,d={interval:50,threshold:"auto",recur:!0,auto:1,visibility:!0},m=o.document.documentElement,h={},g={},v={},y="emerged",w="demerged",b="resize orientationchange";if(o=e["dom/element"].create(o),"CSS1Compat"!==i.compatMode)throw"[Qoopido.js] Not in standards mode";return f=e["dom/element"].extend({_quid:null,_viewport:null,_settings:null,_state:null,_priority:null,_constructor:function(t,r){var n=f._parent._constructor.call(this,t);return r=e["function/merge"]({},d,r||{}),"auto"===r.threshold&&delete r.threshold,g[r.interval]===s&&(v[r.interval]=v[r.interval]||{length:0},g[r.interval]=o.element.setInterval(function(){l(r.interval)},r.interval)),n._quid=e["function/unique/uuid"](),n._viewport={},n._settings=r,n._state=!1,n._priority=2,v[r.interval][n._quid]=n,v[r.interval].length++,o.on(b,function(){a.call(n)}),a.call(n),n},remove:function(){var e=this;delete v[e._settings.interval][e._quid],v[e._settings.interval].length--}}),o.on(b,u),u(),f}),function(e){window.qoopido.register("dom/element/lazyimage",e,["./emerge","../../function/merge"])}(function(e,t,r,n,o,i,s){"use strict";function l(){var e=this,t=e._settings.attribute;p+=1,e.emit(c).one(v,function(t){e.emit(t.type===h?f:d),p-=1},!1).setAttribute("src",e.getAttribute(t)).removeAttribute(t)}var u,a={interval:50,threshold:"auto",attribute:"data-lazyimage"},p=0,c="requested",f="loaded",d="failed",m="emerged",h="load",g="error",v="".concat(h," ",g);return u=e["dom/element/emerge"].extend({_constructor:function(t,r){var n=u._parent._constructor.call(this,t,e["function/merge"]({},a,r||{}));return n.on(m,function o(e){(0===p||1===e.data)&&(n.remove(),n.off(m,o),l.call(n))}),n}})}); \ No newline at end of file diff --git a/dist/3.7.3/min/packages/qoopido.lazyimage.legacy.js b/dist/3.7.3/min/packages/qoopido.lazyimage.legacy.js new file mode 100644 index 00000000..b50eb3c7 --- /dev/null +++ b/dist/3.7.3/min/packages/qoopido.lazyimage.legacy.js @@ -0,0 +1,2 @@ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +!function(e,t){t.register?t.register("polyfill/object/defineproperty",e):(t.modules=t.modules||{})["polyfill/object/defineproperty"]=e()}(function(e,t,r,n,o,i,s){"use strict";if(!Object.defineProperty||!function(){try{return Object.defineProperty({},"x",{}),!0}catch(e){return!1}}()){var l=Object.defineProperty,u=Object.prototype.__defineGetter__,c=Object.prototype.__defineSetter__;Object.defineProperty=function(e,t,r){if(l)try{return l(e,t,r)}catch(n){}if(e!==Object(e))throw new TypeError("Object.defineProperty called on non-object");return u&&"get"in r&&u.call(e,t,r.get),c&&"set"in r&&c.call(e,t,r.set),"value"in r&&(e[t]=r.value),e}}return Object.defineProperty},window.qoopido=window.qoopido||{}),function(e,t){if(t.register){var r=[];Object.defineProperty&&function(){try{return Object.defineProperty({},"x",{}),!0}catch(e){return!1}}()||r.push("./defineproperty"),t.register("polyfill/object/defineproperties",e,r)}else(t.modules=t.modules||{})["polyfill/object/defineproperties"]=e()}(function(e,t,r,n,o,i,s){"use strict";return Object.defineProperties||(Object.defineProperties=function(e,t){if(e!==Object(e))throw new TypeError("Object.defineProperties called on non-object");var r;for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&Object.defineProperty(e,r,t[r]);return e}),Object.defineProperties},window.qoopido=window.qoopido||{}),function(e,t){if(t.register){var r=[];Object.defineProperties||r.push("./defineproperties"),t.register("polyfill/object/create",e,r)}else(t.modules=t.modules||{})["polyfill/object/create"]=e()}(function(e,t,r,n,o,i,s){"use strict";return Object.create||(Object.create=function(e,t){function r(){}if("object"!=typeof e)throw new TypeError;r.prototype=e;var n=new r;if(e&&(n.constructor=r),arguments.length>1){if(t!==Object(t))throw new TypeError;Object.defineProperties(n,t)}return n}),Object.create},window.qoopido=window.qoopido||{}),function(e,t){t.register?t.register("polyfill/object/getownpropertynames",e):(t.modules=t.modules||{})["polyfill/object/getownpropertynames"]=e()}(function(e,t,r,n,o,i,s){"use strict";return Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(e){if(e!==Object(e))throw new TypeError("Object.getOwnPropertyNames called on non-object");var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.push(t);return r}),Object.getOwnPropertyNames},window.qoopido=window.qoopido||{}),function(e,t){t.register?t.register("polyfill/object/getownpropertydescriptor",e):(t.modules=t.modules||{})["polyfill/object/getownpropertydescriptor"]=e()}(function(e,t,r,n,o,i,s){"use strict";if(!Object.getOwnPropertyDescriptor||!function(){try{return Object.getOwnPropertyDescriptor({x:0},"x"),!0}catch(e){return!1}}()){var l=Object.getOwnPropertyDescriptor;Object.getOwnPropertyDescriptor=function(e,t){if(e!==Object(e))throw new TypeError;try{return l.call(Object,e,t)}catch(r){}return Object.prototype.hasOwnProperty.call(e,t)?{value:e[t],enumerable:!0,writable:!0,configurable:!0}:void 0}}return Object.getOwnPropertyDescriptor},window.qoopido=window.qoopido||{}),function(e,t,r,n,o){"use strict";function i(e,i,s,u){var p,d=e.split("/");return a[e]?a[e]:(p=function(){if(s)for(var p,m,g=d.slice(0,-1).join("/"),h=0;(p=s[h])!==o;h++)m=f.test(p),m&&(p=l(g+"/"+p)),!a[p]&&arguments[h]&&(a[p]=arguments[h]),m&&!a[p]&&"undefined"!=typeof console&&console.error("".concat("[Qoopido.js] ",e,": Could not load dependency ",p));return a[e]=i(a,c,d,t,r,n,o),u&&u(a[e]),a[e]},void("undefined"!=typeof module&&module.exports?module.exports=define(p):"function"==typeof define&&define.amd?s?define(s,p):define(p):p()))}function s(e,t,r){i(e,t,r,function(t){a[e]=t.create()})}function l(e){for(var t;(t=e.replace(d,""))!==e;)e=t;return e.replace(m,"")}var u=r.qoopido||(r.qoopido={}),c=u.shared||(u.shared={}),a=u.modules||(u.modules={}),p=[],f=new RegExp("^\\.+\\/"),d=new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."),m=new RegExp("(^\\/)|\\.\\/","g");u.register=i,u.registerSingleton=s,Object.create||p.push("./polyfill/object/create"),Object.getOwnPropertyNames||p.push("./polyfill/object/getownpropertynames"),Object.getOwnPropertyDescriptor&&function(){try{return Object.getOwnPropertyDescriptor({x:0},"x"),!0}catch(e){return!1}}()||p.push("./polyfill/object/getownpropertydescriptor"),i("base",e,p)}(function(e,t,r,n,o,i,s){"use strict";function l(e){for(var t,r={},n=Object.getOwnPropertyNames(e),o=0;(t=n[o])!==s;o++)r[t]=Object.getOwnPropertyDescriptor(e,t);return r}function u(){throw new Error("[Qoopido.js] Operation prohibited")}return{create:function(){var e,t=Object.create(this,l(this));return t._constructor&&(e=t._constructor.apply(t,arguments)),t.create=t.extend=u,e||t},extend:function(e,t){var r;return e=e||{},t=t===!0,e._parent=this,r=Object.create(this,l(e)),t===!0&&(r.extend=u),r}}},navigator,this,document),function(e){window.qoopido.register("polyfill/string/ucfirst",e)}(function(e,t,r,n,o,i,s){"use strict";return String.prototype.ucfirst||(String.prototype.ucfirst=function(){var e=this;return e.charAt(0).toUpperCase()+e.slice(1)}),String.prototype.ucfirst}),function(e){window.qoopido.register("polyfill/string/lcfirst",e)}(function(e,t,r,n,o,i,s){"use strict";return String.prototype.lcfirst||(String.prototype.lcfirst=function(){var e=this;return e.charAt(0).toLowerCase()+e.slice(1)}),String.prototype.lcfirst}),function(e){window.qoopido.register("polyfill/window/getcomputedstyle",e)}(function(e,t,r,n,o,i,s){"use strict";if(o.getComputedStyle)return o.getComputedStyle;var l=new RegExp("(\\-([a-z]){1})","g"),u=function(){return arguments[2].toUpperCase()};return function(e,t){var r=this;return r.getPropertyValue=function(t){return"float"===t&&(t="styleFloat"),l.test(t)&&(t=t.replace(l,u)),e.currentStyle[t]||null},r}}),function(e){window.qoopido.register("polyfill/window/promise",e)}(function(e,t,r,n,o,i,s){"use strict";function l(e,t){var r=E.push([e,t]);1===r&&u()}function u(){o.setTimeout(c,1)}function c(){for(var e,t=0;(e=E[t])!==s;t++)e[0](e[1]);E.length=0}function a(e,t){var r,n=null;try{if(e===t)throw new TypeError("A promises callback cannot return that same promise.");if(("function"==typeof t||"object"==typeof t&&null!==t)&&(n=t.then,"function"==typeof n))return n.call(t,function(n){return r?!0:(r=!0,void(t!==n?d(e,n):m(e,n)))},function(t){return r?!0:(r=!0,void g(e,t))}),!0}catch(o){return r?!0:(g(e,o),!0)}return!1}function p(e,t){function r(e){d(t,e)}function n(e){g(t,e)}try{e(r,n)}catch(o){n(o)}}function f(e,t,r,n){var o,i,s,l,u="function"==typeof r;if(u)try{o=r(n),s=!0}catch(c){l=!0,i=c}else o=n,s=!0;a(t,o)||(u&&s?d(t,o):l?g(t,i):e===j?d(t,o):e===P&&g(t,o))}function d(e,t){e===t?m(e,t):a(e,t)||m(e,t)}function m(e,t){e._state===_&&(e._state=x,e._detail=t,l(h,e))}function g(e,t){e._state===_&&(e._state=x,e._detail=t,l(v,e))}function h(e){w(e,e._state=j)}function v(e){w(e,e._state=P)}function y(e,t,r,n){var o=e._subscribers,i=o.length;o[i]=t,o[i+j]=r,o[i+P]=n}function w(e,t){for(var r,n,o=e._subscribers,i=e._detail,l=0;(r=o[l])!==s;l+=3)n=o[l+t],f(t,r,n,i);e._subscribers=null}function b(e){var t=this;if("function"!=typeof e)throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");t._subscribers=[],p(e,t)}var _=void 0,x=0,j=1,P=2,E=[];return b.prototype={_state:s,_detail:s,_subscribers:s,then:function(e,t){var r=this,n=new b(function(){});return r._state?l(function(){f(r._state,n,arguments[r._state-1],r._detail)}):y(r,n,e,t),n},"catch":function(e){return this.then(null,e)}},o.Promise||(o.Promise=b),o.Promise}),function(e){var t=[];window.Promise||t.push("../polyfill/window/promise"),window.qoopido.register("promise/all",e,t)}(function(e,t,r,n,o,i,s){"use strict";return function(e){if("[object Array]"!==Object.prototype.toString.call(e))throw new TypeError("You must pass an array to all.");return new o.Promise(function(t,r){function n(e){return function(t){o(e,t)}}function o(e,r){l[e]=r,0===--u&&t(l)}var i,l=[],u=e.length,c=0;for(0===u&&t([]);(i=e[c])!==s;c++)i&&"function"==typeof i.then?i.then(n(c),r):o(c,i)})}}),function(e){var t=[];window.Promise||t.push("../polyfill/window/promise"),window.qoopido.register("promise/defer",e,t)}(function(e,t,r,n,o,i,s){"use strict";return function(){var e=this;e.promise=new o.Promise(function(t,r){e.resolve=t,e.reject=r})}}),function(e){var t=["./base","./promise/all","./promise/defer"];String.prototype.ucfirst||t.push("./polyfill/string/ucfirst"),String.prototype.lcfirst||t.push("./polyfill/string/lcfirst"),window.qoopido.registerSingleton("support",e,t)}(function(e,t,r,n,o,i,s){"use strict";function l(e){return e.replace(p,"$1").lcfirst().replace(f,"").replace(d,g)}var u=e["promise/all"],c=e["promise/defer"],a=new RegExp("^(Moz|WebKit|Khtml|ms|O|Icab)(?=[A-Z])"),p=new RegExp("^(?:webkit|khtml|icab|moz|ms|o)([A-Z])"),f=new RegExp("^-(?:webkit|khtml|icab|moz|ms|o)-"),d=new RegExp("-([a-z])","gi"),m=new RegExp("([A-Z])","g"),g=function(){return arguments[1].ucfirst()},h={prefix:null,method:{},property:{},css:{},promises:{prefix:null,method:{},property:{},css:{},test:{}}};return e.base.extend({test:{},pool:t.pool&&t.pool.dom,testMultiple:function(){for(var e,t=[],r=0;(e=arguments[r])!==s;r++)switch(typeof e){case"string":t.push(this.test[e]());break;case"boolean":var n=new c;e?n.resolve():n.reject(),t.push(n.promise);break;default:t.push(e)}return new u(t)},getPrefix:function(){var e,t=this,r=h.prefix||null;if(null===r){var n=t.pool?t.pool.obtain("div"):i.createElement("div"),o=n.style;r=!1;for(e in o)a.test(e)&&(r=e.match(a)[0]);r===!1&&"WebkitOpacity"in o&&(r="WebKit"),r===!1&&"KhtmlOpacity"in o&&(r="Khtml"),r=h.prefix=r===!1?!1:[r.toLowerCase(),r.toLowerCase().ucfirst(),r],n.dispose&&n.dispose()}return r},getMethod:function(e,t){e=l(e),t=t||o;var r=t.tagName,n=h.method[r]=h.method[r]||{},i=n[e]=h.method[r][e]||null;if(null===i){i=!1;var u,c,a=0,p=e.ucfirst(),f=this.getPrefix();for(u=f!==!1?(e+" "+p+" "+f.join(p+" ")+p).split(" "):[e];(c=u[a])!==s;a++)if(t[c]!==s&&("function"==typeof t[c]||"object"==typeof t[c])){i=c;break}h.method[r][e]=i}return i},getProperty:function(e,t){e=l(e),t=t||o;var r=t.tagName,n=h.property[r]=h.property[r]||{},i=n[e]=h.property[r][e]||null;if(null===i){i=!1;var u,c,a=0,p=e.ucfirst(),f=this.getPrefix();for(u=f!==!1?(e+" "+p+" "+f.join(p+" ")+p).split(" "):[e],a;(c=u[a])!==s;a++)if(t[c]!==s){i=c;break}h.property[r][e]=i}return i},getCssProperty:function(e){e=l(e);var t=this,r=h.css[e]||null;if(null===r){r=!1;var n,o=0,u=t.pool?t.pool.obtain("div"):i.createElement("div"),c=e.ucfirst(),a=this.getPrefix()||[],p=(e+" "+c+" "+a.join(c+" ")+c).split(" "),f="";for(o;(n=p[o])!==s;o++)if(u.style[n]!==s){r=n,o>0&&(f="-");break}r=h.css[e]=r!==!1?[f+r.replace(m,"-$1").toLowerCase(),r]:!1,u.dispose&&u.dispose()}return r},supportsPrefix:function(){return!!this.getPrefix()},supportsMethod:function(e,t){return!!this.getMethod(e,t)},supportsProperty:function(e,t){return!!this.getProperty(e,t)},supportsCssProperty:function(e){return!!this.getCssProperty(e)},testPrefix:function(){var e=h.promises.prefix;if(null===e){var t=new c,r=this.getPrefix();r?t.resolve(r):t.reject(),e=h.promises.prefix=t.promise}return e},testMethod:function(e,t){t=t||o;var r=t.tagName,n=h.promises.method[r]=h.promises.method[r]||{},i=n[e]=h.promises.method[r][e]||null;if(null===i){var s=new c,l=this.getMethod(e,t);l?s.resolve(l):s.reject(),i=h.promises.method[r][e]=s.promise}return i},testProperty:function(e,t){t=t||o;var r=t.tagName,n=h.promises.property[r]=h.promises.property[r]||{},i=n[e]=h.promises.property[r][e]||null;if(null===i){var s=new c,l=this.getProperty(e,t);l?s.resolve(l):s.reject(),i=h.promises.property[r][e]=s.promise}return i},testCssProperty:function(e){var t=h.promises.css[e]||null;if(null===t){var r=new c,n=this.getCssProperty(e);n?r.resolve(n):r.reject(),t=h.promises.css[e]=r.promise}return t},addTest:function(e,t){return this.test[e]=function(){var r=h.promises.test[e]||null;if(null===r){var n=new c,o=Array.prototype.slice.call(arguments);o.splice(0,0,n),t.apply(null,o),r=h.promises.test[e]=n.promise}return r}}})}),function(e){window.qoopido.register("function/merge",e)}(function(e,t,r,n,o,i,s){"use strict";return function l(){var e,t,r,n,o,i=arguments[0];for(e=1;(t=arguments[e])!==s;e++)for(r in t)n=i[r],o=t[r],o!==s&&(null!==o&&"object"==typeof o?(n=o.length!==s?n&&"object"==typeof n&&n.length!==s?n:[]:n&&"object"==typeof n&&n.length===s?n:{},i[r]=l(n,o)):i[r]=o);return i}}),function(e){window.qoopido.register("function/unique/uuid",e)}(function(e,t,r,n,o,i,s){"use strict";function l(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(c,function(e){var t=16*Math.random()|0,r="x"===e?t:3&t|8;return r.toString(16)})}var u={},c=new RegExp("[xy]","g");return function(){var e;do e=l();while("undefined"!=typeof u[e]);return u[e]=!0,e}}),function(e){window.qoopido.registerSingleton("hook/event",e,["../base"])}(function(e,t,r,n,o,i,s){"use strict";function l(e,t,r){for(var n,o=0;(n=r[o])!==s;o++)e[n]=t[n];e._properties=e._properties.concat(r)}var u={general:{properties:"type altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which path".split(" "),process:function(e,t){var r;if(e.originalEvent=t,e.isDefaultPrevented=t.defaultPrevented?!0:!1,e.isPropagationStopped=t.cancelBubble?!0:!1,e.metaKey=t.metaKey&&t.metaKey!==!1?!0:!1,e.target||(e.target=t.srcElement||i),3===e.target.nodeType&&(e.target=e.target.parentNode),!e.path){e.path=[],r=e.target;do e.path.push(r);while(r=r.parentNode);e.path.push(o)}}},mouse:{regex:new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"),properties:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement dataTransfer".split(" "),process:function(e,t){var r,n,o;n=t.fromElement,o=t.button,null===e.pageX&&null!==t.clientX&&(r=e.target.ownerDocument||i,r=r.documentElement||r.body,e.pageX=t.clientX+(r.scrollLeft||0)-(r.clientLeft||0),e.pageY=t.clientY+(r.scrollTop||0)-(r.clientTop||0)),!e.relatedTarget&&n&&(e.relatedTarget=n===e.target?t.toElement:n),e.which||o===s||(e.which=1&o?1:2&o?3:4&o?2:0)}},key:{regex:new RegExp("^(?:key)"),properties:"char charCode key keyCode".split(" "),process:function(e,t){null===e.which&&(e.which=null!==t.charCode?t.charCode:t.keyCode)}}};return e.base.extend({add:function(e,t){return e&&t&&u[e]&&(u[e]=t),this},get:function(e){return e&&u[e]?u[e]:null},process:function(e,t){var r,n,o;for(r in u)n=u[r],o=!n.regex||n.regex.test(t.type),o&&(n.properties&&l(e,t,n.properties),n.process&&n.process(e,t),n.delegate&&(e.delegate=n.delegate))}})}),function(e){var t=["../base","../support"];window.getComputedStyle||t.push("../polyfill/window/getcomputedstyle"),window.qoopido.registerSingleton("hook/css",e,t)}(function(e,t,r,n,o,i,s){"use strict";var l=e.support,u=o.getComputedStyle||e["polyfill/window/getcomputedstyle"],c={general:{get:function(e,t){return u(e,null).getPropertyValue(t[0])},set:function(e,t,r){e.style[t[1]]=r}},opacity:l.supportsCssProperty("opacity")?null:{regex:new RegExp("alpha\\(opacity=(.*)\\)","i"),get:function(e,t,r){return r=u(e,null).getPropertyValue("filter").toString().match(this.regex),r=r?r[1]/100:1},set:function(e,t,r){var n=e.style;n.zoom=1,n.filter="alpha(opacity="+(100*r+.5>>0)+")"}}};return e.base.extend({add:function(e,t){return e&&t&&c[e]&&(c[e]=t),this},get:function(e){return e&&c[e]?c[e]:null},process:function(e,t,r,n){var o;return r=l.getCssProperty(r,t)||null,r?((o=this.get(r[1]))&&o[e]||this.get("general")[e])(t,r,n):void 0}})}),function(e){window.qoopido.register("dom/event",e,["../base","../hook/event"])}(function(e,t,r,n,o,i,s){"use strict";var l=e["hook/event"];return e.base.extend({originalEvent:null,isDelegate:!1,isDefaultPrevented:!1,isPropagationStopped:!1,isImmediatePropagationStopped:!1,_properties:null,_constructor:function(e){var t=this;return t._properties=[],t._obtain(e),t},_obtain:function(e){l.process(this,e)},_dispose:function(){for(var e,t=this,r=0;(e=t._properties[r])!==s;r++)delete t[e];delete t.delegate,t.originalEvent=null,t.isDelegate=!1,t.isDefaultPrevented=!1,t.isPropagationStopped=!1,t.isImmediatePropagationStopped=!1,t._properties.length=0},preventDefault:function(){var e=this,t=e.originalEvent;t.cancelable!==!1&&(e.isDefaultPrevented=!0,t.preventDefault?t.preventDefault():t.returnValue=!1)},stopPropagation:function(){var e=this,t=e.originalEvent;e.isPropagationStopped=!0,t.stopPropagation&&t.stopPropagation(),t.cancelBubble=!0},stopImmediatePropagation:function(){var e=this,t=e.originalEvent;e.isImmediatePropagationStopped=!0,t.stopImmediatePropagation&&t.stopImmediatePropagation(),e.stopPropagation()}})}),function(e){var t=["../base","../function/unique/uuid","../hook/css","./event"];window.CustomEvent||t.push("../polyfill/window/customevent"),window.addEventListener||t.push("../polyfill/window/addeventlistener"),window.removeEventListener||t.push("../polyfill/window/removeeventlistener"),window.dispatchEvent||t.push("../polyfill/window/dispatchevent"),Element.prototype.matches||t.push("../polyfill/element/matches"),document.querySelector||t.push("../polyfill/document/queryselector"),document.querySelectorAll||t.push("../polyfill/document/queryselectorall"),String.prototype.trim||t.push("../polyfill/string/trim"),window.qoopido.register("dom/element",e,t)}(function(e,t,r,n,o,i,s){"use strict";function l(e){var t,r,n;for(t in E)r=E[t],(!r.regex||r.regex.test(e))&&(n=r);return n}function u(e,t,r){var n=this,o=l(e),s=i.createEvent(o.type);s[o.method](e,"load"===e?!1:!0,!0,t),r&&(s._quid=r,s.isDelegate=!0),n.element.dispatchEvent(s)}function c(e){var t;if("string"==typeof e)try{w.test(e)===!0?(t=e.replace(w,"$1").toLowerCase(),e=i.createElement(t)):e=i.querySelector(e)}catch(r){e=null}if(!e)throw new Error("[Qoopido.js] Element could not be resolved");return e}function a(e){return Array.prototype.concat.apply([],Array.prototype.splice.call(e,0)).join(" ").split(_)}function p(e,t){for(var r,n=0;(r=e.path[n])!==s;n++){if(r.matches(t))return e.currentTarget=r,!0;if(r===e.currentTarget)break}return!1}var f="object",d="string",m=e["function/unique/uuid"],g=i.getElementsByTagName("head")[0],h="textContent"in i.createElement("a")?"textContent":"innerText",v="undefined"!=typeof g.previousElementSibling?function(){return this.previousElementSibling}:function(){for(var e=this;e=e.previousSibling;)if(1===e.nodeType)return e},y="undefined"!=typeof g.nextElementSibling?function(){return this.nextElementSibling}:function(){for(var e=this;e=e.nextSibling;)if(1===e.nodeType)return e},w=new RegExp("^<(\\w+)\\s*/>$"),b=new RegExp("^[^-]+"),_=new RegExp(" +","g"),x=e["pool/module"]&&e["pool/module"].create(e["dom/event"],null,!0)||null,j=e["hook/css"],P={},E={custom:{type:"CustomEvent",method:"initCustomEvent"},html:{regex:new RegExp("^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$"),type:"HTMLEvents",method:"initEvent"},mouse:{regex:new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"),type:"MouseEvents",method:"initMouseEvent"}};return e.base.extend({type:null,element:null,_listener:null,_constructor:function(e,t,r){var n,o=this;return e=c(e),n=e._quid,n?o=P[n]:(n=e._quid=m(),o.type=e.tagName,o.element=e,o._listener={},P[n]=o),"object"==typeof t&&null!==t&&o.setAttributes(t),"object"==typeof r&&null!==r&&o.setStyles(r),o!==this&&this.dispose&&this.dispose(),o},_obtain:function(e,t,r){this._constructor(e,t,r)},_dispose:function(){var e,t,r=this;for(e in r._listener)t=e.match(b),r.element.removeEventListener(t,r._listener[e]),delete r._listener[e];r.type=null,r.element=null},getContent:function(e){var t=this.element;return e&&e!==!1?t.innerHTML:t[h]},setContent:function(e,t){var r=this,n=r.element;return t&&t!==!1?n.innerHTML=e:n[h]=e,r},getAttribute:function(e){var t=this;return e&&typeof e===d?t.element.getAttribute(e):void 0},getAttributes:function(){for(var e,t=this,r={},n=a(arguments),o=0;(e=n[o])!==s;o++)r[e]=t.element.getAttribute(e);return r},setAttribute:function(e,t){var r=this;return e&&typeof e===d&&r.element.setAttribute(e,t),r},setAttributes:function(e){var t,r=this;if(e&&typeof e===f&&!e.length)for(t in e)r.element.setAttribute(t,e[t]);return r},removeAttribute:function(e){var t=this;return e&&typeof e===d&&t.element.removeAttribute(e),t},removeAttributes:function(){for(var e,t=this,r=a(arguments),n=0;(e=r[n])!==s;n++)t.element.removeAttribute(e);return t},getStyle:function(e){var t=this;return e&&typeof e===d?j.process("get",t.element,e):void 0},getStyles:function(){for(var e,t=this,r={},n=a(arguments),o=0;(e=n[o])!==s;o++)r[e]=j.process("get",t.element,e);return r},setStyle:function(e,t){var r=this;return e&&typeof e===d&&j.process("set",r.element,e,t),r},setStyles:function(e){var t,r=this;if(e&&typeof e===f&&!e.length)for(t in e)j.process("set",r.element,t,e[t]);return r},removeStyle:function(e){var t=this;return e&&typeof e===d&&t.setStyle(e,""),t},removeStyles:function(){for(var e,t=this,r=a(arguments),n=0;(e=r[n])!==s;n++)t.setStyle(e,"");return t},siblings:function(e){for(var t=this.element,r=t.parentNode.firstChild,n=[];r;r=y.call(r))r===t||e&&!r.matches(e)||n.push(r);return n},siblingsBefore:function(e){for(var t=this.element.previousSibling,r=[];t;t=v.call(t))(!e||t.matches(e))&&r.push(t);return r},siblingsAfter:function(e){for(var t=this.element.nextSibling,r=[];t;t=y.call(t))(!e||t.matches(e))&&r.push(t);return r},previous:function(e){var t=v.call(this.element);if(!e)return t;for(;t;t=v.call(t))if(t.matches(e))return t},next:function(e){var t=y.call(this.element);if(!e)return t;for(;t;t=y.call(t))if(t.matches(e))return t},find:function(e){var t,r,n=this.element;return e=e.trim(),">"===e.charAt(0)?(t=n._quid,n.setAttribute("data-quid",t),e='[data-quid="'+t+'"] '+e,r=n.parentNode.querySelectorAll(e),n.removeAttribute("data-quid")):r=n.querySelectorAll(e),r},parent:function(e){var t;if(!e)return this.element.parentNode;for(t=this.element;t;t=t.parentNode)if(t.matches(e))return t},parents:function(e){for(var t=this.element.parentNode,r=[];t;t=t.parentNode){if(9===t.nodeType)return r;1===t.nodeType&&(!e||t.matches(e))&&r.push(t)}},isVisible:function(){var e=this,t=e.element;return!(t.offsetWidth<=0&&t.offsetHeight<=0||"hidden"===e.getStyle("visibility")||e.getStyle("opacity")<=0)},hasClass:function(e){return e?new RegExp("(?:^|\\s)"+e+"(?:\\s|$)").test(this.element.className):!1},addClass:function(e){var t=this;return e&&!t.hasClass(e)&&(t.element.className+=t.element.className?" "+e:e),t},removeClass:function(e){var t=this;return e&&t.hasClass(e)&&(t.element.className=t.element.className.replace(new RegExp("(?:^|\\s)"+e+"(?!\\S)"),"")),t},toggleClass:function(e){var t=this;return e&&(t.hasClass(e)?t.removeClass(e):t.addClass(e)),t},prepend:function(e){var t=this,r=t.element;if(e)try{e=e.element||c(e),r.firstChild?r.insertBefore(e,r.firstChild):t.append(e)}catch(n){r.insertAdjacentHTML("afterBegin",e)}return t},append:function(e){var t=this,r=t.element;if(e)try{r.appendChild(e.element||c(e))}catch(n){r.insertAdjacentHTML("beforeEnd",e)}return t},prependTo:function(e){var t=this,r=t.element;return e&&((e=e.element||c(e)).firstChild?e.insertBefore(r,e.firstChild):t.appendTo(e)),t},appendTo:function(e){var t=this;return e&&(e.element||c(e)).appendChild(t.element),t},insertBefore:function(e){var t=this,r=t.element;return e&&(e=e.element||c(e)).parentNode.insertBefore(r,e),t},insertAfter:function(e){var t=this,r=t.element;return e&&((e=e.element||c(e)).nextSibling?e.parentNode.insertBefore(r,e.nextSibling):t.appendTo(e.parentNode)),t},replace:function(e){var t=this,r=t.element;return e&&(e=e.element||c(e)).parentNode.replaceChild(r,e),t},replaceWith:function(e){var t=this,r=t.element;return e&&(e=e.element||c(e),r.parentNode.replaceChild(e,r)),t},remove:function(){var e=this,t=e.element;return t.parentNode.removeChild(t),e},on:function(t){var r,n=this,o=n.element,i=arguments.length>2?arguments[1]:null,l=arguments.length>2?arguments[2]:arguments[1],c=l._quid||(l._quid=m()),a=0;for(t=t.split(" ");(r=t[a])!==s;a++){var f=r+"-"+c,d=function(t){var r;t=x&&x.obtain(t)||e["dom/event"].create(t),t.isPropagationStopped||(r=t.delegate,t._quid=m(),(!i||p(t,i))&&l.call(t.currentTarget,t,t.originalEvent.detail),r&&(delete t.delegate,u.call(n,r))),t.dispose&&t.dispose()};d.type=r,n._listener[f]=d,o.addEventListener(r,d)}return n},one:function(e){var t=this,r=arguments.length>3||"string"==typeof arguments[1]?arguments[1]:null,n=arguments.length>3||"function"==typeof arguments[2]?arguments[2]:arguments[1],o=(arguments.length>3?arguments[3]:arguments[2])!==!1,i=function(r){t.off(o===!0?r.type:e,i),n.call(this,r,r.originalEvent.detail)};return n._quid=i._quid=m(),r?t.on(e,r,i):t.on(e,i),t},off:function(e,t){var r,n,o,i=this,l=i.element,u=0;for(e=e.split(" ");(r=e[u])!==s;u++)n=t._quid&&r+"-"+t._quid||null,o=n&&i._listener[n]||null,o?(l.removeEventListener(r,o),delete i._listener[n]):l.removeEventListener(r,t);return i},emit:function(e,t){var r=this;return u.call(r,e,t),r}})}),function(e){window.qoopido.register("dom/element/emerge",e,["../element","../../function/merge","../../function/unique/uuid"])}(function(e,t,r,n,o,i,s){"use strict";function l(e){var t,r=v[e];for(t in r)"length"!==t&&a.call(r[t]);0===r.length&&(o.element.clearInterval(h[e]),delete h[e])}function u(){g.left=0,g.top=0,g.right=o.innerWidth||m.clientWidth,g.bottom=o.innerHeight||m.clientHeight}function c(){var e=this,t=e._settings.threshold,r=t!==s?t:m.clientWidth*e._settings.auto,n=t!==s?t:m.clientHeight*e._settings.auto;e._viewport.left=g.left-r,e._viewport.top=g.top-n,e._viewport.right=g.right+r,e._viewport.bottom=g.bottom+n}function a(){var e,t=this,r=!1,n=2;!t.isVisible()||"hidden"===t.getStyle("visibility")&&t._settings.visibility!==!1||(e=t.element.getBoundingClientRect(),(e.bottom>=t._viewport.top&&e.bottom<=t._viewport.bottom||e.top>=t._viewport.top&&e.top<=t._viewport.bottom||t._viewport.bottom>=e.top&&t._viewport.bottom<=e.bottom||t._viewport.top>=e.top&&t._viewport.top<=e.bottom)&&(e.left>=t._viewport.left&&e.left<=t._viewport.right||e.right>=t._viewport.left&&e.right<=t._viewport.right||t._viewport.left>=e.left&&t._viewport.left<=e.right||t._viewport.right>=e.left&&t._viewport.right<=e.right)&&((0===t._settings.threshold||(e.bottom>=g.top&&e.bottom<=g.bottom||e.top>=g.top&&e.top<=g.bottom||g.bottom>=e.top&&g.bottom<=e.bottom||g.top>=e.top&&g.top<=e.bottom)&&(e.left>=g.left&&e.left<=g.right||e.right>=g.left&&e.right<=g.right||g.left>=e.left&&g.left<=e.right||g.right>=e.left&&g.right<=e.right))&&(n=1),r=!0)),(r!==t._state||r===!0&&n!==t._priority)&&p.call(t,r,n)}function p(e,t){var r=this;r._state=e,r._priority=t,r._settings.recur!==!0&&r.remove(),e===!0?r.emit(y,t):r.emit(w)}var f,d={interval:50,threshold:"auto",recur:!0,auto:1,visibility:!0},m=o.document.documentElement,g={},h={},v={},y="emerged",w="demerged",b="resize orientationchange";if(o=e["dom/element"].create(o),"CSS1Compat"!==i.compatMode)throw"[Qoopido.js] Not in standards mode";return f=e["dom/element"].extend({_quid:null,_viewport:null,_settings:null,_state:null,_priority:null,_constructor:function(t,r){var n=f._parent._constructor.call(this,t);return r=e["function/merge"]({},d,r||{}),"auto"===r.threshold&&delete r.threshold,h[r.interval]===s&&(v[r.interval]=v[r.interval]||{length:0},h[r.interval]=o.element.setInterval(function(){l(r.interval)},r.interval)),n._quid=e["function/unique/uuid"](),n._viewport={},n._settings=r,n._state=!1,n._priority=2,v[r.interval][n._quid]=n,v[r.interval].length++,o.on(b,function(){c.call(n)}),c.call(n),n},remove:function(){var e=this;delete v[e._settings.interval][e._quid],v[e._settings.interval].length--}}),o.on(b,u),u(),f}),function(e){window.qoopido.register("dom/element/lazyimage",e,["./emerge","../../function/merge"])}(function(e,t,r,n,o,i,s){"use strict";function l(){var e=this,t=e._settings.attribute;a+=1,e.emit(p).one(v,function(t){e.emit(t.type===g?f:d),a-=1},!1).setAttribute("src",e.getAttribute(t)).removeAttribute(t)}var u,c={interval:50,threshold:"auto",attribute:"data-lazyimage"},a=0,p="requested",f="loaded",d="failed",m="emerged",g="load",h="error",v="".concat(g," ",h);return u=e["dom/element/emerge"].extend({_constructor:function(t,r){var n=u._parent._constructor.call(this,t,e["function/merge"]({},c,r||{}));return n.on(m,function o(e){(0===a||1===e.data)&&(n.remove(),n.off(m,o),l.call(n))}),n}})}); \ No newline at end of file diff --git a/dist/3.7.3/min/packages/qoopido.remux.js b/dist/3.7.3/min/packages/qoopido.remux.js new file mode 100644 index 00000000..d888c2e1 --- /dev/null +++ b/dist/3.7.3/min/packages/qoopido.remux.js @@ -0,0 +1,2 @@ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +!function(e,t,n,i,r){"use strict";function o(e,o,a,c){var d,f=e.split("/");return u[e]?u[e]:(d=function(){if(a)for(var d,m,h=f.slice(0,-1).join("/"),y=0;(d=a[y])!==r;y++)m=p.test(d),m&&(d=s(h+"/"+d)),!u[d]&&arguments[y]&&(u[d]=arguments[y]),m&&!u[d]&&"undefined"!=typeof console&&console.error("".concat("[Qoopido.js] ",e,": Could not load dependency ",d));return u[e]=o(u,l,f,t,n,i,r),c&&c(u[e]),u[e]},void("undefined"!=typeof module&&module.exports?module.exports=define(d):"function"==typeof define&&define.amd?a?define(a,d):define(d):d()))}function a(e,t,n){o(e,t,n,function(t){u[e]=t.create()})}function s(e){for(var t;(t=e.replace(f,""))!==e;)e=t;return e.replace(m,"")}var c=n.qoopido||(n.qoopido={}),l=c.shared||(c.shared={}),u=c.modules||(c.modules={}),d=[],p=new RegExp("^\\.+\\/"),f=new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."),m=new RegExp("(^\\/)|\\.\\/","g");c.register=o,c.registerSingleton=a,Object.create||d.push("./polyfill/object/create"),Object.getOwnPropertyNames||d.push("./polyfill/object/getownpropertynames"),Object.getOwnPropertyDescriptor&&function(){try{return Object.getOwnPropertyDescriptor({x:0},"x"),!0}catch(e){return!1}}()||d.push("./polyfill/object/getownpropertydescriptor"),o("base",e,d)}(function(e,t,n,i,r,o,a){"use strict";function s(e){for(var t,n={},i=Object.getOwnPropertyNames(e),r=0;(t=i[r])!==a;r++)n[t]=Object.getOwnPropertyDescriptor(e,t);return n}function c(){throw new Error("[Qoopido.js] Operation prohibited")}return{create:function(){var e,t=Object.create(this,s(this));return t._constructor&&(e=t._constructor.apply(t,arguments)),t.create=t.extend=c,e||t},extend:function(e,t){var n;return e=e||{},t=t===!0,e._parent=this,n=Object.create(this,s(e)),t===!0&&(n.extend=c),n}}},navigator,this,document),function(e){var t=[];window.getComputedStyle||t.push("polyfill/window/getcomputedstyle"),Array.prototype.indexOf||t.push("../array/indexof"),window.qoopido.register("polyfill/window/matchmedia",e,t)}(function(e,t,n,i,r,o,a){"use strict";function s(){var e=r.innerWidth||h.clientWidth,t=r.innerHeight||h.clientHeight,n=r.screen.width,i=r.screen.height,o=r.screen.colorDepth,a=r.devicePixelRatio;v.width=e,v.height=t,v["aspect-ratio"]=(e/t).toFixed(2),v.color=o,v["color-index"]=Math.pow(2,o),v["device-aspect-ratio"]=(n/i).toFixed(2),v["device-height"]=i,v["device-width"]=n,v["device-pixel-ratio"]=a||1,v.resolution=a&&96*a||r.screen.deviceXDPI||96,v.orientation=t>=e?"portrait":"landscape"}function c(e){var t,n,i={matches:!1,media:e,addListener:function(e){e&&n.push(e)},removeListener:function(e){for(var t,i=0;(t=n[i])!==a;i++)t===e&&n.splice(i,1)}};return i.matches=""===e?!0:l(e),y.push({mql:i,listeners:[]}),t=y.length-1,g[e]=t,n=y[t].listeners,i}function l(e){var t=-1!==e.indexOf(",")&&e.split(",")||[e],n=t.length-1,i=n,r=null,o=null,a="",s=0,c=!1,l="",u="",d=null,p=0,f=0,m=null,h="",y="",g="",x="",_="",z=!1;if(""===e)return!0;do if(r=t[i-n],c=!1,o=r.match(w.type),o&&(a=o[0],s=o.index),!o||-1===r.substring(0,s).indexOf("(")&&(s||!o[3]&&a!==o.input))z=!1;else{if(u=r,c="not"===o[1],s||(l=o[2],u=r.substring(a.length)),z=l===v.type||"all"===l||""===l,d=-1!==u.indexOf(" and ")&&u.split(" and ")||[u],p=d.length-1,f=p,z&&p>=0&&""!==u)do{if(m=d[p].match(w.media),!m||!v[m[3]]){z=!1;break}if(h=m[2],y=m[5],x=y,g=m[7],_=v[m[3]],g&&(x="px"===g?Number(y):"em"===g||"rem"===g?16*y:m[8]?(y/m[8]).toFixed(2):"dppx"===g?96*y:"dpcm"===g?.3937*y:Number(y)),z="min-"===h&&x?_>=x:"max-"===h&&x?x>=_:x?_===x:!!_,!z)break}while(p--);if(z)break}while(n--);return c?!z:z}function u(){var e,t,n=!1,i=0,o=0;if(y.length>0)for(s();(e=y[i])!==a;i++)if(n=l(e.mql.media),(n&&!e.mql.matches||!n&&e.mql.matches)&&(e.mql.matches=n,e.listeners))for(;(t=e.listeners[o])!==a;o++)t.call(r,e.mql)}function d(){r.clearTimeout(f),f=r.setTimeout(u,10)}function p(){var t,n=r.document.getElementsByTagName("script")[0],i=o.createElement("style"),s=["screen","print","speech","projection","handheld","tv","braille","embossed","tty"],c="#"+m+" { position: relative; z-index: 0; }",l="",u=r.addEventListener||(l="on")&&r.attachEvent,p=0;for(i.type="text/css",i.id=m,n.parentNode.insertBefore(i,n);(t=s[p])!==a;p++)c+="@media "+t+" { #"+m+" { position: relative; z-index: "+p+" } }";i.styleSheet?i.styleSheet.cssText=c:i.textContent=c,v.type=s[1*(r.getComputedStyle||e["polyfill/window/getcomputedstyle"])(i).zIndex||0],i.parentNode.removeChild(i),u(l+"resize",d),u(l+"orientationchange",d)}var f,m="qoopidoPolyfillWindowMatchmedia",h=o.documentElement,y=[],g={},v={},w={type:/\s*(only|not)?\s*(screen|print|[a-z\-]+)\s*(and)?\s*/i,media:/^\s*\(\s*(-[a-z]+-)?(min-|max-)?([a-z\-]+)\s*(:?\s*([0-9]+(\.[0-9]+)?|portrait|landscape)(px|em|dppx|dpcm|rem|%|in|cm|mm|ex|pt|pc|\/([0-9]+(\.[0-9]+)?))?)?\s*\)\s*$/};return r.matchMedia||(p(),s(),r.matchMedia=function(e){var t=g[e]||!1;return t===!1?c(e):y[t].mql}),r.matchMedia}),function(e){window.qoopido.register("emitter",e,["./base"])}(function(e,t,n,i,r,o,a){"use strict";function s(e,t){var n=t.charAt(0).toUpperCase()+t.slice(1);return e._mapped[t]=e[t],function(){var i,r=Array.prototype.slice.call(arguments);return e.emit.apply(e,["pre"+n,r]),i=e._mapped[t].apply(e,r),e.emit.apply(e,["post"+n,r,i]),i}}var c=/^(_|extend$|create$|on$|one$|off$|emit$|get.+)/;return e.base.extend({_mapped:null,_listener:null,_temp:null,_constructor:function(){var e,t=this;t._mapped={},t._listener={};for(e in t)"function"==typeof t[e]&&c.test(e)===!1&&(t[e]=s(t,e));return t},on:function(e,t){var n,i=this,r=0;for(e=e.split(" ");(n=e[r])!==a;r++)(i._listener[n]=i._listener[n]||[]).push(t);return i},one:function(e,t,n){n=n!==!1;var i=this;return i.on(e,function r(o){i.off(n===!0?o:e,r),t.apply(this,arguments)}),i},off:function(e,t){var n,i,r,o=this,s=0;if(e)for(e=e.split(" ");(n=e[s])!==a;s++)if(o._listener[n]=o._listener[n]||[],t)for(i=0;(r=o._listener[n][i])!==a;i++)r===t&&(o._listener[n].splice(i,1),i--);else o._listener[n].length=0;else for(n in o._listener)o._listener[n].length=0;return o},emit:function(e){var t,n=this,i=0;if(e!==a){for(n._listener[e]=n._listener[e]||[],n._temp=n._listener[e].slice();(t=n._temp[i])!==a;i++)t.apply(n,arguments);n._temp.length=0}return n}})}),function(e){var t=["../emitter"];window.matchMedia||t.push("../polyfill/window/matchmedia"),window.qoopido.register("component/sense",e,t)}(function(e,t,n,i,r,o,a){"use strict";function s(){var e=this,t=e.mql;e.emit(t.matches===!0?"matched":"dematched")}var c,l={};return c=e.emitter.extend({mql:null,_constructor:function(e){var t=c._parent._constructor.call(this),n=t.mql=l[e]||(l[e]=r.matchMedia(e)),i=function(){s.call(t)};return n.addListener(i),r.setTimeout(i,0),t},matches:function(){return this.mql.matches}})}),function(e){window.qoopido.registerSingleton("component/remux",e,["../emitter","./sense"])}(function(e,t,n,i,r,o,a){"use strict";function s(e,t){var n=this;return e&&t&&(u.className=e,u.style.fontSize=t+"px",p.layout=e,p.fontsize=t,(f.fontsize!==p.fontsize||f.layout!==p.layout)&&(p.ratio.device=r.devicePixelRatio||1,p.ratio.fontsize=p.fontsize/d,p.ratio.total=p.ratio.device*p.ratio.fontsize,f.layout!==p.layout&&n.emit("layoutchanged",p),f.fontsize!==p.fontsize&&n.emit("fontsizechanged",p),n.emit("statechanged",p),f.fontsize=p.fontsize,f.layout=p.layout)),n}function c(t,n,i){var o=this;r.setTimeout(function(){e["component/sense"].create(t).on("matched",function(){s.call(o,n,i)})},0)}var l,u=o.getElementsByTagName("html")[0],d=16,p={fontsize:null,layout:null,ratio:{}},f={fontsize:null,layout:null};return l=e.emitter.extend({_constructor:function(){var e=l._parent._constructor.call(this),t=parseInt(u.getAttribute("data-base"),10);return isNaN(t)===!1&&(d=t),e},getState:function(){return p},getLayout:function(){return p.layout},getFontsize:function(){return p.fontsize},setLayout:function(e,t){var n=this;return s.call(n,e,t),n},addLayout:function(e,t){var n,i,r,o,a,s,l,u,p=this;arguments.length>1?(n={},n[e]=t):n=arguments[0];for(i in n)for(r=n[i],o=r.min;o<=r.max;o++)l=Math.round(r.width*(o/d)),u=Math.round(r.width*((o+1)/d))-1,c.call(p,"screen and (min-width: "+l+"px) and (max-width: "+u+"px )",i,o),a=!a||l=s.width?{width:u,fontsize:o,layout:i}:s;return c.call(p,"screen and (max-width: "+(a.width-1)+"px)",a.layout,a.fontsize),c.call(p,"screen and (min-width: "+(s.width+1)+"px)",s.layout,s.fontsize),p}})}); \ No newline at end of file diff --git a/dist/3.7.3/min/packages/qoopido.remux.legacy.js b/dist/3.7.3/min/packages/qoopido.remux.legacy.js new file mode 100644 index 00000000..f34cfdcc --- /dev/null +++ b/dist/3.7.3/min/packages/qoopido.remux.legacy.js @@ -0,0 +1,2 @@ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +!function(e,t){t.register?t.register("polyfill/object/defineproperty",e):(t.modules=t.modules||{})["polyfill/object/defineproperty"]=e()}(function(e,t,r,n,o,i,c){"use strict";if(!Object.defineProperty||!function(){try{return Object.defineProperty({},"x",{}),!0}catch(e){return!1}}()){var s=Object.defineProperty,a=Object.prototype.__defineGetter__,l=Object.prototype.__defineSetter__;Object.defineProperty=function(e,t,r){if(s)try{return s(e,t,r)}catch(n){}if(e!==Object(e))throw new TypeError("Object.defineProperty called on non-object");return a&&"get"in r&&a.call(e,t,r.get),l&&"set"in r&&l.call(e,t,r.set),"value"in r&&(e[t]=r.value),e}}return Object.defineProperty},window.qoopido=window.qoopido||{}),function(e,t){if(t.register){var r=[];Object.defineProperty&&function(){try{return Object.defineProperty({},"x",{}),!0}catch(e){return!1}}()||r.push("./defineproperty"),t.register("polyfill/object/defineproperties",e,r)}else(t.modules=t.modules||{})["polyfill/object/defineproperties"]=e()}(function(e,t,r,n,o,i,c){"use strict";return Object.defineProperties||(Object.defineProperties=function(e,t){if(e!==Object(e))throw new TypeError("Object.defineProperties called on non-object");var r;for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&Object.defineProperty(e,r,t[r]);return e}),Object.defineProperties},window.qoopido=window.qoopido||{}),function(e,t){if(t.register){var r=[];Object.defineProperties||r.push("./defineproperties"),t.register("polyfill/object/create",e,r)}else(t.modules=t.modules||{})["polyfill/object/create"]=e()}(function(e,t,r,n,o,i,c){"use strict";return Object.create||(Object.create=function(e,t){function r(){}if("object"!=typeof e)throw new TypeError;r.prototype=e;var n=new r;if(e&&(n.constructor=r),arguments.length>1){if(t!==Object(t))throw new TypeError;Object.defineProperties(n,t)}return n}),Object.create},window.qoopido=window.qoopido||{}),function(e,t){t.register?t.register("polyfill/object/getownpropertynames",e):(t.modules=t.modules||{})["polyfill/object/getownpropertynames"]=e()}(function(e,t,r,n,o,i,c){"use strict";return Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(e){if(e!==Object(e))throw new TypeError("Object.getOwnPropertyNames called on non-object");var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.push(t);return r}),Object.getOwnPropertyNames},window.qoopido=window.qoopido||{}),function(e,t){t.register?t.register("polyfill/object/getownpropertydescriptor",e):(t.modules=t.modules||{})["polyfill/object/getownpropertydescriptor"]=e()}(function(e,t,r,n,o,i,c){"use strict";if(!Object.getOwnPropertyDescriptor||!function(){try{return Object.getOwnPropertyDescriptor({x:0},"x"),!0}catch(e){return!1}}()){var s=Object.getOwnPropertyDescriptor;Object.getOwnPropertyDescriptor=function(e,t){if(e!==Object(e))throw new TypeError;try{return s.call(Object,e,t)}catch(r){}return Object.prototype.hasOwnProperty.call(e,t)?{value:e[t],enumerable:!0,writable:!0,configurable:!0}:void 0}}return Object.getOwnPropertyDescriptor},window.qoopido=window.qoopido||{}),function(e,t,r,n,o){"use strict";function i(e,i,c,a){var p,f=e.split("/");return u[e]?u[e]:(p=function(){if(c)for(var p,m,y=f.slice(0,-1).join("/"),h=0;(p=c[h])!==o;h++)m=d.test(p),m&&(p=s(y+"/"+p)),!u[p]&&arguments[h]&&(u[p]=arguments[h]),m&&!u[p]&&"undefined"!=typeof console&&console.error("".concat("[Qoopido.js] ",e,": Could not load dependency ",p));return u[e]=i(u,l,f,t,r,n,o),a&&a(u[e]),u[e]},void("undefined"!=typeof module&&module.exports?module.exports=define(p):"function"==typeof define&&define.amd?c?define(c,p):define(p):p()))}function c(e,t,r){i(e,t,r,function(t){u[e]=t.create()})}function s(e){for(var t;(t=e.replace(f,""))!==e;)e=t;return e.replace(m,"")}var a=r.qoopido||(r.qoopido={}),l=a.shared||(a.shared={}),u=a.modules||(a.modules={}),p=[],d=new RegExp("^\\.+\\/"),f=new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."),m=new RegExp("(^\\/)|\\.\\/","g");a.register=i,a.registerSingleton=c,Object.create||p.push("./polyfill/object/create"),Object.getOwnPropertyNames||p.push("./polyfill/object/getownpropertynames"),Object.getOwnPropertyDescriptor&&function(){try{return Object.getOwnPropertyDescriptor({x:0},"x"),!0}catch(e){return!1}}()||p.push("./polyfill/object/getownpropertydescriptor"),i("base",e,p)}(function(e,t,r,n,o,i,c){"use strict";function s(e){for(var t,r={},n=Object.getOwnPropertyNames(e),o=0;(t=n[o])!==c;o++)r[t]=Object.getOwnPropertyDescriptor(e,t);return r}function a(){throw new Error("[Qoopido.js] Operation prohibited")}return{create:function(){var e,t=Object.create(this,s(this));return t._constructor&&(e=t._constructor.apply(t,arguments)),t.create=t.extend=a,e||t},extend:function(e,t){var r;return e=e||{},t=t===!0,e._parent=this,r=Object.create(this,s(e)),t===!0&&(r.extend=a),r}}},navigator,this,document),function(e){window.qoopido.register("polyfill/window/getcomputedstyle",e)}(function(e,t,r,n,o,i,c){"use strict";if(o.getComputedStyle)return o.getComputedStyle;var s=new RegExp("(\\-([a-z]){1})","g"),a=function(){return arguments[2].toUpperCase()};return function(e,t){var r=this;return r.getPropertyValue=function(t){return"float"===t&&(t="styleFloat"),s.test(t)&&(t=t.replace(s,a)),e.currentStyle[t]||null},r}}),function(e){var t=[];window.getComputedStyle||t.push("polyfill/window/getcomputedstyle"),Array.prototype.indexOf||t.push("../array/indexof"),window.qoopido.register("polyfill/window/matchmedia",e,t)}(function(e,t,r,n,o,i,c){"use strict";function s(){var e=o.innerWidth||y.clientWidth,t=o.innerHeight||y.clientHeight,r=o.screen.width,n=o.screen.height,i=o.screen.colorDepth,c=o.devicePixelRatio;g.width=e,g.height=t,g["aspect-ratio"]=(e/t).toFixed(2),g.color=i,g["color-index"]=Math.pow(2,i),g["device-aspect-ratio"]=(r/n).toFixed(2),g["device-height"]=n,g["device-width"]=r,g["device-pixel-ratio"]=c||1,g.resolution=c&&96*c||o.screen.deviceXDPI||96,g.orientation=t>=e?"portrait":"landscape"}function a(e){var t,r,n={matches:!1,media:e,addListener:function(e){e&&r.push(e)},removeListener:function(e){for(var t,n=0;(t=r[n])!==c;n++)t===e&&r.splice(n,1)}};return n.matches=""===e?!0:l(e),h.push({mql:n,listeners:[]}),t=h.length-1,w[e]=t,r=h[t].listeners,n}function l(e){var t=-1!==e.indexOf(",")&&e.split(",")||[e],r=t.length-1,n=r,o=null,i=null,c="",s=0,a=!1,l="",u="",p=null,d=0,f=0,m=null,y="",h="",w="",O="",j="",v=!1;if(""===e)return!0;do if(o=t[n-r],a=!1,i=o.match(b.type),i&&(c=i[0],s=i.index),!i||-1===o.substring(0,s).indexOf("(")&&(s||!i[3]&&c!==i.input))v=!1;else{if(u=o,a="not"===i[1],s||(l=i[2],u=o.substring(c.length)),v=l===g.type||"all"===l||""===l,p=-1!==u.indexOf(" and ")&&u.split(" and ")||[u],d=p.length-1,f=d,v&&d>=0&&""!==u)do{if(m=p[d].match(b.media),!m||!g[m[3]]){v=!1;break}if(y=m[2],h=m[5],O=h,w=m[7],j=g[m[3]],w&&(O="px"===w?Number(h):"em"===w||"rem"===w?16*h:m[8]?(h/m[8]).toFixed(2):"dppx"===w?96*h:"dpcm"===w?.3937*h:Number(h)),v="min-"===y&&O?j>=O:"max-"===y&&O?O>=j:O?j===O:!!j,!v)break}while(d--);if(v)break}while(r--);return a?!v:v}function u(){var e,t,r=!1,n=0,i=0;if(h.length>0)for(s();(e=h[n])!==c;n++)if(r=l(e.mql.media),(r&&!e.mql.matches||!r&&e.mql.matches)&&(e.mql.matches=r,e.listeners))for(;(t=e.listeners[i])!==c;i++)t.call(o,e.mql)}function p(){o.clearTimeout(f),f=o.setTimeout(u,10)}function d(){var t,r=o.document.getElementsByTagName("script")[0],n=i.createElement("style"),s=["screen","print","speech","projection","handheld","tv","braille","embossed","tty"],a="#"+m+" { position: relative; z-index: 0; }",l="",u=o.addEventListener||(l="on")&&o.attachEvent,d=0;for(n.type="text/css",n.id=m,r.parentNode.insertBefore(n,r);(t=s[d])!==c;d++)a+="@media "+t+" { #"+m+" { position: relative; z-index: "+d+" } }";n.styleSheet?n.styleSheet.cssText=a:n.textContent=a,g.type=s[1*(o.getComputedStyle||e["polyfill/window/getcomputedstyle"])(n).zIndex||0],n.parentNode.removeChild(n),u(l+"resize",p),u(l+"orientationchange",p)}var f,m="qoopidoPolyfillWindowMatchmedia",y=i.documentElement,h=[],w={},g={},b={type:/\s*(only|not)?\s*(screen|print|[a-z\-]+)\s*(and)?\s*/i,media:/^\s*\(\s*(-[a-z]+-)?(min-|max-)?([a-z\-]+)\s*(:?\s*([0-9]+(\.[0-9]+)?|portrait|landscape)(px|em|dppx|dpcm|rem|%|in|cm|mm|ex|pt|pc|\/([0-9]+(\.[0-9]+)?))?)?\s*\)\s*$/};return o.matchMedia||(d(),s(),o.matchMedia=function(e){var t=w[e]||!1;return t===!1?a(e):h[t].mql}),o.matchMedia}),function(e){window.qoopido.register("emitter",e,["./base"])}(function(e,t,r,n,o,i,c){"use strict";function s(e,t){var r=t.charAt(0).toUpperCase()+t.slice(1);return e._mapped[t]=e[t],function(){var n,o=Array.prototype.slice.call(arguments);return e.emit.apply(e,["pre"+r,o]),n=e._mapped[t].apply(e,o),e.emit.apply(e,["post"+r,o,n]),n}}var a=/^(_|extend$|create$|on$|one$|off$|emit$|get.+)/;return e.base.extend({_mapped:null,_listener:null,_temp:null,_constructor:function(){var e,t=this;t._mapped={},t._listener={};for(e in t)"function"==typeof t[e]&&a.test(e)===!1&&(t[e]=s(t,e));return t},on:function(e,t){var r,n=this,o=0;for(e=e.split(" ");(r=e[o])!==c;o++)(n._listener[r]=n._listener[r]||[]).push(t);return n},one:function(e,t,r){r=r!==!1;var n=this;return n.on(e,function o(i){n.off(r===!0?i:e,o),t.apply(this,arguments)}),n},off:function(e,t){var r,n,o,i=this,s=0;if(e)for(e=e.split(" ");(r=e[s])!==c;s++)if(i._listener[r]=i._listener[r]||[],t)for(n=0;(o=i._listener[r][n])!==c;n++)o===t&&(i._listener[r].splice(n,1),n--);else i._listener[r].length=0;else for(r in i._listener)i._listener[r].length=0;return i},emit:function(e){var t,r=this,n=0;if(e!==c){for(r._listener[e]=r._listener[e]||[],r._temp=r._listener[e].slice();(t=r._temp[n])!==c;n++)t.apply(r,arguments);r._temp.length=0}return r}})}),function(e){var t=["../emitter"];window.matchMedia||t.push("../polyfill/window/matchmedia"),window.qoopido.register("component/sense",e,t)}(function(e,t,r,n,o,i,c){"use strict";function s(){var e=this,t=e.mql;e.emit(t.matches===!0?"matched":"dematched")}var a,l={};return a=e.emitter.extend({mql:null,_constructor:function(e){var t=a._parent._constructor.call(this),r=t.mql=l[e]||(l[e]=o.matchMedia(e)),n=function(){s.call(t)};return r.addListener(n),o.setTimeout(n,0),t},matches:function(){return this.mql.matches}})}),function(e){window.qoopido.registerSingleton("component/remux",e,["../emitter","./sense"])}(function(e,t,r,n,o,i,c){"use strict";function s(e,t){var r=this;return e&&t&&(u.className=e,u.style.fontSize=t+"px",d.layout=e,d.fontsize=t,(f.fontsize!==d.fontsize||f.layout!==d.layout)&&(d.ratio.device=o.devicePixelRatio||1,d.ratio.fontsize=d.fontsize/p,d.ratio.total=d.ratio.device*d.ratio.fontsize,f.layout!==d.layout&&r.emit("layoutchanged",d),f.fontsize!==d.fontsize&&r.emit("fontsizechanged",d),r.emit("statechanged",d),f.fontsize=d.fontsize,f.layout=d.layout)),r}function a(t,r,n){var i=this;o.setTimeout(function(){e["component/sense"].create(t).on("matched",function(){s.call(i,r,n)})},0)}var l,u=i.getElementsByTagName("html")[0],p=16,d={fontsize:null,layout:null,ratio:{}},f={fontsize:null,layout:null};return l=e.emitter.extend({_constructor:function(){var e=l._parent._constructor.call(this),t=parseInt(u.getAttribute("data-base"),10);return isNaN(t)===!1&&(p=t),e},getState:function(){return d},getLayout:function(){return d.layout},getFontsize:function(){return d.fontsize},setLayout:function(e,t){var r=this;return s.call(r,e,t),r},addLayout:function(e,t){var r,n,o,i,c,s,l,u,d=this;arguments.length>1?(r={},r[e]=t):r=arguments[0];for(n in r)for(o=r[n],i=o.min;i<=o.max;i++)l=Math.round(o.width*(i/p)),u=Math.round(o.width*((i+1)/p))-1,a.call(d,"screen and (min-width: "+l+"px) and (max-width: "+u+"px )",n,i),c=!c||l=s.width?{width:u,fontsize:i,layout:n}:s;return a.call(d,"screen and (max-width: "+(c.width-1)+"px)",c.layout,c.fontsize),a.call(d,"screen and (min-width: "+(s.width+1)+"px)",s.layout,s.fontsize),d}})}); \ No newline at end of file diff --git a/dist/3.7.3/min/packages/qoopido.sense.js b/dist/3.7.3/min/packages/qoopido.sense.js new file mode 100644 index 00000000..df0388f5 --- /dev/null +++ b/dist/3.7.3/min/packages/qoopido.sense.js @@ -0,0 +1,2 @@ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +!function(e,t,n,r,i){"use strict";function o(e,o,s,a){var d,m=e.split("/");return p[e]?p[e]:(d=function(){if(s)for(var d,f,h=m.slice(0,-1).join("/"),g=0;(d=s[g])!==i;g++)f=u.test(d),f&&(d=c(h+"/"+d)),!p[d]&&arguments[g]&&(p[d]=arguments[g]),f&&!p[d]&&"undefined"!=typeof console&&console.error("".concat("[Qoopido.js] ",e,": Could not load dependency ",d));return p[e]=o(p,l,m,t,n,r,i),a&&a(p[e]),p[e]},void("undefined"!=typeof module&&module.exports?module.exports=define(d):"function"==typeof define&&define.amd?s?define(s,d):define(d):d()))}function s(e,t,n){o(e,t,n,function(t){p[e]=t.create()})}function c(e){for(var t;(t=e.replace(m,""))!==e;)e=t;return e.replace(f,"")}var a=n.qoopido||(n.qoopido={}),l=a.shared||(a.shared={}),p=a.modules||(a.modules={}),d=[],u=new RegExp("^\\.+\\/"),m=new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."),f=new RegExp("(^\\/)|\\.\\/","g");a.register=o,a.registerSingleton=s,Object.create||d.push("./polyfill/object/create"),Object.getOwnPropertyNames||d.push("./polyfill/object/getownpropertynames"),Object.getOwnPropertyDescriptor&&function(){try{return Object.getOwnPropertyDescriptor({x:0},"x"),!0}catch(e){return!1}}()||d.push("./polyfill/object/getownpropertydescriptor"),o("base",e,d)}(function(e,t,n,r,i,o,s){"use strict";function c(e){for(var t,n={},r=Object.getOwnPropertyNames(e),i=0;(t=r[i])!==s;i++)n[t]=Object.getOwnPropertyDescriptor(e,t);return n}function a(){throw new Error("[Qoopido.js] Operation prohibited")}return{create:function(){var e,t=Object.create(this,c(this));return t._constructor&&(e=t._constructor.apply(t,arguments)),t.create=t.extend=a,e||t},extend:function(e,t){var n;return e=e||{},t=t===!0,e._parent=this,n=Object.create(this,c(e)),t===!0&&(n.extend=a),n}}},navigator,this,document),function(e){var t=[];window.getComputedStyle||t.push("polyfill/window/getcomputedstyle"),Array.prototype.indexOf||t.push("../array/indexof"),window.qoopido.register("polyfill/window/matchmedia",e,t)}(function(e,t,n,r,i,o,s){"use strict";function c(){var e=i.innerWidth||h.clientWidth,t=i.innerHeight||h.clientHeight,n=i.screen.width,r=i.screen.height,o=i.screen.colorDepth,s=i.devicePixelRatio;v.width=e,v.height=t,v["aspect-ratio"]=(e/t).toFixed(2),v.color=o,v["color-index"]=Math.pow(2,o),v["device-aspect-ratio"]=(n/r).toFixed(2),v["device-height"]=r,v["device-width"]=n,v["device-pixel-ratio"]=s||1,v.resolution=s&&96*s||i.screen.deviceXDPI||96,v.orientation=t>=e?"portrait":"landscape"}function a(e){var t,n,r={matches:!1,media:e,addListener:function(e){e&&n.push(e)},removeListener:function(e){for(var t,r=0;(t=n[r])!==s;r++)t===e&&n.splice(r,1)}};return r.matches=""===e?!0:l(e),g.push({mql:r,listeners:[]}),t=g.length-1,y[e]=t,n=g[t].listeners,r}function l(e){var t=-1!==e.indexOf(",")&&e.split(",")||[e],n=t.length-1,r=n,i=null,o=null,s="",c=0,a=!1,l="",p="",d=null,u=0,m=0,f=null,h="",g="",y="",w="",_="",b=!1;if(""===e)return!0;do if(i=t[r-n],a=!1,o=i.match(x.type),o&&(s=o[0],c=o.index),!o||-1===i.substring(0,c).indexOf("(")&&(c||!o[3]&&s!==o.input))b=!1;else{if(p=i,a="not"===o[1],c||(l=o[2],p=i.substring(s.length)),b=l===v.type||"all"===l||""===l,d=-1!==p.indexOf(" and ")&&p.split(" and ")||[p],u=d.length-1,m=u,b&&u>=0&&""!==p)do{if(f=d[u].match(x.media),!f||!v[f[3]]){b=!1;break}if(h=f[2],g=f[5],w=g,y=f[7],_=v[f[3]],y&&(w="px"===y?Number(g):"em"===y||"rem"===y?16*g:f[8]?(g/f[8]).toFixed(2):"dppx"===y?96*g:"dpcm"===y?.3937*g:Number(g)),b="min-"===h&&w?_>=w:"max-"===h&&w?w>=_:w?_===w:!!_,!b)break}while(u--);if(b)break}while(n--);return a?!b:b}function p(){var e,t,n=!1,r=0,o=0;if(g.length>0)for(c();(e=g[r])!==s;r++)if(n=l(e.mql.media),(n&&!e.mql.matches||!n&&e.mql.matches)&&(e.mql.matches=n,e.listeners))for(;(t=e.listeners[o])!==s;o++)t.call(i,e.mql)}function d(){i.clearTimeout(m),m=i.setTimeout(p,10)}function u(){var t,n=i.document.getElementsByTagName("script")[0],r=o.createElement("style"),c=["screen","print","speech","projection","handheld","tv","braille","embossed","tty"],a="#"+f+" { position: relative; z-index: 0; }",l="",p=i.addEventListener||(l="on")&&i.attachEvent,u=0;for(r.type="text/css",r.id=f,n.parentNode.insertBefore(r,n);(t=c[u])!==s;u++)a+="@media "+t+" { #"+f+" { position: relative; z-index: "+u+" } }";r.styleSheet?r.styleSheet.cssText=a:r.textContent=a,v.type=c[1*(i.getComputedStyle||e["polyfill/window/getcomputedstyle"])(r).zIndex||0],r.parentNode.removeChild(r),p(l+"resize",d),p(l+"orientationchange",d)}var m,f="qoopidoPolyfillWindowMatchmedia",h=o.documentElement,g=[],y={},v={},x={type:/\s*(only|not)?\s*(screen|print|[a-z\-]+)\s*(and)?\s*/i,media:/^\s*\(\s*(-[a-z]+-)?(min-|max-)?([a-z\-]+)\s*(:?\s*([0-9]+(\.[0-9]+)?|portrait|landscape)(px|em|dppx|dpcm|rem|%|in|cm|mm|ex|pt|pc|\/([0-9]+(\.[0-9]+)?))?)?\s*\)\s*$/};return i.matchMedia||(u(),c(),i.matchMedia=function(e){var t=y[e]||!1;return t===!1?a(e):g[t].mql}),i.matchMedia}),function(e){window.qoopido.register("emitter",e,["./base"])}(function(e,t,n,r,i,o,s){"use strict";function c(e,t){var n=t.charAt(0).toUpperCase()+t.slice(1);return e._mapped[t]=e[t],function(){var r,i=Array.prototype.slice.call(arguments);return e.emit.apply(e,["pre"+n,i]),r=e._mapped[t].apply(e,i),e.emit.apply(e,["post"+n,i,r]),r}}var a=/^(_|extend$|create$|on$|one$|off$|emit$|get.+)/;return e.base.extend({_mapped:null,_listener:null,_temp:null,_constructor:function(){var e,t=this;t._mapped={},t._listener={};for(e in t)"function"==typeof t[e]&&a.test(e)===!1&&(t[e]=c(t,e));return t},on:function(e,t){var n,r=this,i=0;for(e=e.split(" ");(n=e[i])!==s;i++)(r._listener[n]=r._listener[n]||[]).push(t);return r},one:function(e,t,n){n=n!==!1;var r=this;return r.on(e,function i(o){r.off(n===!0?o:e,i),t.apply(this,arguments)}),r},off:function(e,t){var n,r,i,o=this,c=0;if(e)for(e=e.split(" ");(n=e[c])!==s;c++)if(o._listener[n]=o._listener[n]||[],t)for(r=0;(i=o._listener[n][r])!==s;r++)i===t&&(o._listener[n].splice(r,1),r--);else o._listener[n].length=0;else for(n in o._listener)o._listener[n].length=0;return o},emit:function(e){var t,n=this,r=0;if(e!==s){for(n._listener[e]=n._listener[e]||[],n._temp=n._listener[e].slice();(t=n._temp[r])!==s;r++)t.apply(n,arguments);n._temp.length=0}return n}})}),function(e){var t=["../emitter"];window.matchMedia||t.push("../polyfill/window/matchmedia"),window.qoopido.register("component/sense",e,t)}(function(e,t,n,r,i,o,s){"use strict";function c(){var e=this,t=e.mql;e.emit(t.matches===!0?"matched":"dematched")}var a,l={};return a=e.emitter.extend({mql:null,_constructor:function(e){var t=a._parent._constructor.call(this),n=t.mql=l[e]||(l[e]=i.matchMedia(e)),r=function(){c.call(t)};return n.addListener(r),i.setTimeout(r,0),t},matches:function(){return this.mql.matches}})}); \ No newline at end of file diff --git a/dist/3.7.3/min/packages/qoopido.sense.legacy.js b/dist/3.7.3/min/packages/qoopido.sense.legacy.js new file mode 100644 index 00000000..7799ca2f --- /dev/null +++ b/dist/3.7.3/min/packages/qoopido.sense.legacy.js @@ -0,0 +1,2 @@ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +!function(e,t){t.register?t.register("polyfill/object/defineproperty",e):(t.modules=t.modules||{})["polyfill/object/defineproperty"]=e()}(function(e,t,r,n,o,i,c){"use strict";if(!Object.defineProperty||!function(){try{return Object.defineProperty({},"x",{}),!0}catch(e){return!1}}()){var s=Object.defineProperty,p=Object.prototype.__defineGetter__,l=Object.prototype.__defineSetter__;Object.defineProperty=function(e,t,r){if(s)try{return s(e,t,r)}catch(n){}if(e!==Object(e))throw new TypeError("Object.defineProperty called on non-object");return p&&"get"in r&&p.call(e,t,r.get),l&&"set"in r&&l.call(e,t,r.set),"value"in r&&(e[t]=r.value),e}}return Object.defineProperty},window.qoopido=window.qoopido||{}),function(e,t){if(t.register){var r=[];Object.defineProperty&&function(){try{return Object.defineProperty({},"x",{}),!0}catch(e){return!1}}()||r.push("./defineproperty"),t.register("polyfill/object/defineproperties",e,r)}else(t.modules=t.modules||{})["polyfill/object/defineproperties"]=e()}(function(e,t,r,n,o,i,c){"use strict";return Object.defineProperties||(Object.defineProperties=function(e,t){if(e!==Object(e))throw new TypeError("Object.defineProperties called on non-object");var r;for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&Object.defineProperty(e,r,t[r]);return e}),Object.defineProperties},window.qoopido=window.qoopido||{}),function(e,t){if(t.register){var r=[];Object.defineProperties||r.push("./defineproperties"),t.register("polyfill/object/create",e,r)}else(t.modules=t.modules||{})["polyfill/object/create"]=e()}(function(e,t,r,n,o,i,c){"use strict";return Object.create||(Object.create=function(e,t){function r(){}if("object"!=typeof e)throw new TypeError;r.prototype=e;var n=new r;if(e&&(n.constructor=r),arguments.length>1){if(t!==Object(t))throw new TypeError;Object.defineProperties(n,t)}return n}),Object.create},window.qoopido=window.qoopido||{}),function(e,t){t.register?t.register("polyfill/object/getownpropertynames",e):(t.modules=t.modules||{})["polyfill/object/getownpropertynames"]=e()}(function(e,t,r,n,o,i,c){"use strict";return Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(e){if(e!==Object(e))throw new TypeError("Object.getOwnPropertyNames called on non-object");var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.push(t);return r}),Object.getOwnPropertyNames},window.qoopido=window.qoopido||{}),function(e,t){t.register?t.register("polyfill/object/getownpropertydescriptor",e):(t.modules=t.modules||{})["polyfill/object/getownpropertydescriptor"]=e()}(function(e,t,r,n,o,i,c){"use strict";if(!Object.getOwnPropertyDescriptor||!function(){try{return Object.getOwnPropertyDescriptor({x:0},"x"),!0}catch(e){return!1}}()){var s=Object.getOwnPropertyDescriptor;Object.getOwnPropertyDescriptor=function(e,t){if(e!==Object(e))throw new TypeError;try{return s.call(Object,e,t)}catch(r){}return Object.prototype.hasOwnProperty.call(e,t)?{value:e[t],enumerable:!0,writable:!0,configurable:!0}:void 0}}return Object.getOwnPropertyDescriptor},window.qoopido=window.qoopido||{}),function(e,t,r,n,o){"use strict";function i(e,i,c,p){var u,f=e.split("/");return a[e]?a[e]:(u=function(){if(c)for(var u,m,y=f.slice(0,-1).join("/"),h=0;(u=c[h])!==o;h++)m=d.test(u),m&&(u=s(y+"/"+u)),!a[u]&&arguments[h]&&(a[u]=arguments[h]),m&&!a[u]&&"undefined"!=typeof console&&console.error("".concat("[Qoopido.js] ",e,": Could not load dependency ",u));return a[e]=i(a,l,f,t,r,n,o),p&&p(a[e]),a[e]},void("undefined"!=typeof module&&module.exports?module.exports=define(u):"function"==typeof define&&define.amd?c?define(c,u):define(u):u()))}function c(e,t,r){i(e,t,r,function(t){a[e]=t.create()})}function s(e){for(var t;(t=e.replace(f,""))!==e;)e=t;return e.replace(m,"")}var p=r.qoopido||(r.qoopido={}),l=p.shared||(p.shared={}),a=p.modules||(p.modules={}),u=[],d=new RegExp("^\\.+\\/"),f=new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."),m=new RegExp("(^\\/)|\\.\\/","g");p.register=i,p.registerSingleton=c,Object.create||u.push("./polyfill/object/create"),Object.getOwnPropertyNames||u.push("./polyfill/object/getownpropertynames"),Object.getOwnPropertyDescriptor&&function(){try{return Object.getOwnPropertyDescriptor({x:0},"x"),!0}catch(e){return!1}}()||u.push("./polyfill/object/getownpropertydescriptor"),i("base",e,u)}(function(e,t,r,n,o,i,c){"use strict";function s(e){for(var t,r={},n=Object.getOwnPropertyNames(e),o=0;(t=n[o])!==c;o++)r[t]=Object.getOwnPropertyDescriptor(e,t);return r}function p(){throw new Error("[Qoopido.js] Operation prohibited")}return{create:function(){var e,t=Object.create(this,s(this));return t._constructor&&(e=t._constructor.apply(t,arguments)),t.create=t.extend=p,e||t},extend:function(e,t){var r;return e=e||{},t=t===!0,e._parent=this,r=Object.create(this,s(e)),t===!0&&(r.extend=p),r}}},navigator,this,document),function(e){window.qoopido.register("polyfill/window/getcomputedstyle",e)}(function(e,t,r,n,o,i,c){"use strict";if(o.getComputedStyle)return o.getComputedStyle;var s=new RegExp("(\\-([a-z]){1})","g"),p=function(){return arguments[2].toUpperCase()};return function(e,t){var r=this;return r.getPropertyValue=function(t){return"float"===t&&(t="styleFloat"),s.test(t)&&(t=t.replace(s,p)),e.currentStyle[t]||null},r}}),function(e){var t=[];window.getComputedStyle||t.push("polyfill/window/getcomputedstyle"),Array.prototype.indexOf||t.push("../array/indexof"),window.qoopido.register("polyfill/window/matchmedia",e,t)}(function(e,t,r,n,o,i,c){"use strict";function s(){var e=o.innerWidth||y.clientWidth,t=o.innerHeight||y.clientHeight,r=o.screen.width,n=o.screen.height,i=o.screen.colorDepth,c=o.devicePixelRatio;g.width=e,g.height=t,g["aspect-ratio"]=(e/t).toFixed(2),g.color=i,g["color-index"]=Math.pow(2,i),g["device-aspect-ratio"]=(r/n).toFixed(2),g["device-height"]=n,g["device-width"]=r,g["device-pixel-ratio"]=c||1,g.resolution=c&&96*c||o.screen.deviceXDPI||96,g.orientation=t>=e?"portrait":"landscape"}function p(e){var t,r,n={matches:!1,media:e,addListener:function(e){e&&r.push(e)},removeListener:function(e){for(var t,n=0;(t=r[n])!==c;n++)t===e&&r.splice(n,1)}};return n.matches=""===e?!0:l(e),h.push({mql:n,listeners:[]}),t=h.length-1,w[e]=t,r=h[t].listeners,n}function l(e){var t=-1!==e.indexOf(",")&&e.split(",")||[e],r=t.length-1,n=r,o=null,i=null,c="",s=0,p=!1,l="",a="",u=null,d=0,f=0,m=null,y="",h="",w="",O="",j="",v=!1;if(""===e)return!0;do if(o=t[n-r],p=!1,i=o.match(b.type),i&&(c=i[0],s=i.index),!i||-1===o.substring(0,s).indexOf("(")&&(s||!i[3]&&c!==i.input))v=!1;else{if(a=o,p="not"===i[1],s||(l=i[2],a=o.substring(c.length)),v=l===g.type||"all"===l||""===l,u=-1!==a.indexOf(" and ")&&a.split(" and ")||[a],d=u.length-1,f=d,v&&d>=0&&""!==a)do{if(m=u[d].match(b.media),!m||!g[m[3]]){v=!1;break}if(y=m[2],h=m[5],O=h,w=m[7],j=g[m[3]],w&&(O="px"===w?Number(h):"em"===w||"rem"===w?16*h:m[8]?(h/m[8]).toFixed(2):"dppx"===w?96*h:"dpcm"===w?.3937*h:Number(h)),v="min-"===y&&O?j>=O:"max-"===y&&O?O>=j:O?j===O:!!j,!v)break}while(d--);if(v)break}while(r--);return p?!v:v}function a(){var e,t,r=!1,n=0,i=0;if(h.length>0)for(s();(e=h[n])!==c;n++)if(r=l(e.mql.media),(r&&!e.mql.matches||!r&&e.mql.matches)&&(e.mql.matches=r,e.listeners))for(;(t=e.listeners[i])!==c;i++)t.call(o,e.mql)}function u(){o.clearTimeout(f),f=o.setTimeout(a,10)}function d(){var t,r=o.document.getElementsByTagName("script")[0],n=i.createElement("style"),s=["screen","print","speech","projection","handheld","tv","braille","embossed","tty"],p="#"+m+" { position: relative; z-index: 0; }",l="",a=o.addEventListener||(l="on")&&o.attachEvent,d=0;for(n.type="text/css",n.id=m,r.parentNode.insertBefore(n,r);(t=s[d])!==c;d++)p+="@media "+t+" { #"+m+" { position: relative; z-index: "+d+" } }";n.styleSheet?n.styleSheet.cssText=p:n.textContent=p,g.type=s[1*(o.getComputedStyle||e["polyfill/window/getcomputedstyle"])(n).zIndex||0],n.parentNode.removeChild(n),a(l+"resize",u),a(l+"orientationchange",u)}var f,m="qoopidoPolyfillWindowMatchmedia",y=i.documentElement,h=[],w={},g={},b={type:/\s*(only|not)?\s*(screen|print|[a-z\-]+)\s*(and)?\s*/i,media:/^\s*\(\s*(-[a-z]+-)?(min-|max-)?([a-z\-]+)\s*(:?\s*([0-9]+(\.[0-9]+)?|portrait|landscape)(px|em|dppx|dpcm|rem|%|in|cm|mm|ex|pt|pc|\/([0-9]+(\.[0-9]+)?))?)?\s*\)\s*$/};return o.matchMedia||(d(),s(),o.matchMedia=function(e){var t=w[e]||!1;return t===!1?p(e):h[t].mql}),o.matchMedia}),function(e){window.qoopido.register("emitter",e,["./base"])}(function(e,t,r,n,o,i,c){"use strict";function s(e,t){var r=t.charAt(0).toUpperCase()+t.slice(1);return e._mapped[t]=e[t],function(){var n,o=Array.prototype.slice.call(arguments);return e.emit.apply(e,["pre"+r,o]),n=e._mapped[t].apply(e,o),e.emit.apply(e,["post"+r,o,n]),n}}var p=/^(_|extend$|create$|on$|one$|off$|emit$|get.+)/;return e.base.extend({_mapped:null,_listener:null,_temp:null,_constructor:function(){var e,t=this;t._mapped={},t._listener={};for(e in t)"function"==typeof t[e]&&p.test(e)===!1&&(t[e]=s(t,e));return t},on:function(e,t){var r,n=this,o=0;for(e=e.split(" ");(r=e[o])!==c;o++)(n._listener[r]=n._listener[r]||[]).push(t);return n},one:function(e,t,r){r=r!==!1;var n=this;return n.on(e,function o(i){n.off(r===!0?i:e,o),t.apply(this,arguments)}),n},off:function(e,t){var r,n,o,i=this,s=0;if(e)for(e=e.split(" ");(r=e[s])!==c;s++)if(i._listener[r]=i._listener[r]||[],t)for(n=0;(o=i._listener[r][n])!==c;n++)o===t&&(i._listener[r].splice(n,1),n--);else i._listener[r].length=0;else for(r in i._listener)i._listener[r].length=0;return i},emit:function(e){var t,r=this,n=0;if(e!==c){for(r._listener[e]=r._listener[e]||[],r._temp=r._listener[e].slice();(t=r._temp[n])!==c;n++)t.apply(r,arguments);r._temp.length=0}return r}})}),function(e){var t=["../emitter"];window.matchMedia||t.push("../polyfill/window/matchmedia"),window.qoopido.register("component/sense",e,t)}(function(e,t,r,n,o,i,c){"use strict";function s(){var e=this,t=e.mql;e.emit(t.matches===!0?"matched":"dematched")}var p,l={};return p=e.emitter.extend({mql:null,_constructor:function(e){var t=p._parent._constructor.call(this),r=t.mql=l[e]||(l[e]=o.matchMedia(e)),n=function(){s.call(t)};return r.addListener(n),o.setTimeout(n,0),t},matches:function(){return this.mql.matches}})}); \ No newline at end of file diff --git a/dist/3.7.3/min/packages/qoopido.shrinkimage.js b/dist/3.7.3/min/packages/qoopido.shrinkimage.js new file mode 100644 index 00000000..fbaea9db --- /dev/null +++ b/dist/3.7.3/min/packages/qoopido.shrinkimage.js @@ -0,0 +1,2 @@ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +!function(e,t,n,r,o){"use strict";function i(e,i,s,a){var p,d=e.split("/");return c[e]?c[e]:(p=function(){if(s)for(var p,m,h=d.slice(0,-1).join("/"),g=0;(p=s[g])!==o;g++)m=f.test(p),m&&(p=u(h+"/"+p)),!c[p]&&arguments[g]&&(c[p]=arguments[g]),m&&!c[p]&&"undefined"!=typeof console&&console.error("".concat("[Qoopido.js] ",e,": Could not load dependency ",p));return c[e]=i(c,l,d,t,n,r,o),a&&a(c[e]),c[e]},void("undefined"!=typeof module&&module.exports?module.exports=define(p):"function"==typeof define&&define.amd?s?define(s,p):define(p):p()))}function s(e,t,n){i(e,t,n,function(t){c[e]=t.create()})}function u(e){for(var t;(t=e.replace(d,""))!==e;)e=t;return e.replace(m,"")}var a=n.qoopido||(n.qoopido={}),l=a.shared||(a.shared={}),c=a.modules||(a.modules={}),p=[],f=new RegExp("^\\.+\\/"),d=new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."),m=new RegExp("(^\\/)|\\.\\/","g");a.register=i,a.registerSingleton=s,Object.create||p.push("./polyfill/object/create"),Object.getOwnPropertyNames||p.push("./polyfill/object/getownpropertynames"),Object.getOwnPropertyDescriptor&&function(){try{return Object.getOwnPropertyDescriptor({x:0},"x"),!0}catch(e){return!1}}()||p.push("./polyfill/object/getownpropertydescriptor"),i("base",e,p)}(function(e,t,n,r,o,i,s){"use strict";function u(e){for(var t,n={},r=Object.getOwnPropertyNames(e),o=0;(t=r[o])!==s;o++)n[t]=Object.getOwnPropertyDescriptor(e,t);return n}function a(){throw new Error("[Qoopido.js] Operation prohibited")}return{create:function(){var e,t=Object.create(this,u(this));return t._constructor&&(e=t._constructor.apply(t,arguments)),t.create=t.extend=a,e||t},extend:function(e,t){var n;return e=e||{},t=t===!0,e._parent=this,n=Object.create(this,u(e)),t===!0&&(n.extend=a),n}}},navigator,this,document),function(e){window.qoopido.register("polyfill/string/ucfirst",e)}(function(e,t,n,r,o,i,s){"use strict";return String.prototype.ucfirst||(String.prototype.ucfirst=function(){var e=this;return e.charAt(0).toUpperCase()+e.slice(1)}),String.prototype.ucfirst}),function(e){window.qoopido.register("polyfill/string/lcfirst",e)}(function(e,t,n,r,o,i,s){"use strict";return String.prototype.lcfirst||(String.prototype.lcfirst=function(){var e=this;return e.charAt(0).toLowerCase()+e.slice(1)}),String.prototype.lcfirst}),function(e){window.qoopido.register("polyfill/window/promise",e)}(function(e,t,n,r,o,i,s){"use strict";function u(e,t){var n=A.push([e,t]);1===n&&a()}function a(){o.setTimeout(l,1)}function l(){for(var e,t=0;(e=A[t])!==s;t++)e[0](e[1]);A.length=0}function c(e,t){var n,r=null;try{if(e===t)throw new TypeError("A promises callback cannot return that same promise.");if(("function"==typeof t||"object"==typeof t&&null!==t)&&(r=t.then,"function"==typeof r))return r.call(t,function(r){return n?!0:(n=!0,void(t!==r?d(e,r):m(e,r)))},function(t){return n?!0:(n=!0,void h(e,t))}),!0}catch(o){return n?!0:(h(e,o),!0)}return!1}function p(e,t){function n(e){d(t,e)}function r(e){h(t,e)}try{e(n,r)}catch(o){r(o)}}function f(e,t,n,r){var o,i,s,u,a="function"==typeof n;if(a)try{o=n(r),s=!0}catch(l){u=!0,i=l}else o=r,s=!0;c(t,o)||(a&&s?d(t,o):u?h(t,i):e===_?d(t,o):e===q&&h(t,o))}function d(e,t){e===t?m(e,t):c(e,t)||m(e,t)}function m(e,t){e._state===x&&(e._state=E,e._detail=t,u(g,e))}function h(e,t){e._state===x&&(e._state=E,e._detail=t,u(v,e))}function g(e){w(e,e._state=_)}function v(e){w(e,e._state=q)}function y(e,t,n,r){var o=e._subscribers,i=o.length;o[i]=t,o[i+_]=n,o[i+q]=r}function w(e,t){for(var n,r,o=e._subscribers,i=e._detail,u=0;(n=o[u])!==s;u+=3)r=o[u+t],f(t,n,r,i);e._subscribers=null}function b(e){var t=this;if("function"!=typeof e)throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");t._subscribers=[],p(e,t)}var x=void 0,E=0,_=1,q=2,A=[];return b.prototype={_state:s,_detail:s,_subscribers:s,then:function(e,t){var n=this,r=new b(function(){});return n._state?u(function(){f(n._state,r,arguments[n._state-1],n._detail)}):y(n,r,e,t),r},"catch":function(e){return this.then(null,e)}},o.Promise||(o.Promise=b),o.Promise}),function(e){var t=[];window.Promise||t.push("../polyfill/window/promise"),window.qoopido.register("promise/all",e,t)}(function(e,t,n,r,o,i,s){"use strict";return function(e){if("[object Array]"!==Object.prototype.toString.call(e))throw new TypeError("You must pass an array to all.");return new o.Promise(function(t,n){function r(e){return function(t){o(e,t)}}function o(e,n){u[e]=n,0===--a&&t(u)}var i,u=[],a=e.length,l=0;for(0===a&&t([]);(i=e[l])!==s;l++)i&&"function"==typeof i.then?i.then(r(l),n):o(l,i)})}}),function(e){var t=[];window.Promise||t.push("../polyfill/window/promise"),window.qoopido.register("promise/defer",e,t)}(function(e,t,n,r,o,i,s){"use strict";return function(){var e=this;e.promise=new o.Promise(function(t,n){e.resolve=t,e.reject=n})}}),function(e){window.qoopido.register("function/merge",e)}(function(e,t,n,r,o,i,s){"use strict";return function u(){var e,t,n,r,o,i=arguments[0];for(e=1;(t=arguments[e])!==s;e++)for(n in t)r=i[n],o=t[n],o!==s&&(null!==o&&"object"==typeof o?(r=o.length!==s?r&&"object"==typeof r&&r.length!==s?r:[]:r&&"object"==typeof r&&r.length===s?r:{},i[n]=u(r,o)):i[n]=o);return i}}),function(e){window.qoopido.register("function/unique/string",e)}(function(e,t,n,r,o,i,s){"use strict";function u(e){var t="",n=0;for(e=parseInt(e,10)||12;e>n;n++)t+=l[parseInt(Math.random()*(l.length-1),10)];return t}var a={},l="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");return function(e){var t;do t=u(e);while("undefined"!=typeof a[t]);return a[t]=!0,t}}),function(e){window.qoopido.register("function/unique/uuid",e)}(function(e,t,n,r,o,i,s){"use strict";function u(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(l,function(e){var t=16*Math.random()|0,n="x"===e?t:3&t|8;return n.toString(16)})}var a={},l=new RegExp("[xy]","g");return function(){var e;do e=u();while("undefined"!=typeof a[e]);return a[e]=!0,e}}),function(e){window.qoopido.register("proxy",e,["./base","./function/unique/uuid"])}(function(e,t,n,r,o,i,s){"use strict";return e.base.extend({_constructor:function(t,n){var r=Array.prototype.splice.call(arguments,2),o=function(){return n.apply(t,Array.prototype.slice.call(arguments).concat(r))};return o._quid=e["function/unique/uuid"](),o}})}),function(e){var t=["./base","./promise/all","./promise/defer"];String.prototype.ucfirst||t.push("./polyfill/string/ucfirst"),String.prototype.lcfirst||t.push("./polyfill/string/lcfirst"),window.qoopido.registerSingleton("support",e,t)}(function(e,t,n,r,o,i,s){"use strict";function u(e){return e.replace(p,"$1").lcfirst().replace(f,"").replace(d,h)}var a=e["promise/all"],l=e["promise/defer"],c=new RegExp("^(Moz|WebKit|Khtml|ms|O|Icab)(?=[A-Z])"),p=new RegExp("^(?:webkit|khtml|icab|moz|ms|o)([A-Z])"),f=new RegExp("^-(?:webkit|khtml|icab|moz|ms|o)-"),d=new RegExp("-([a-z])","gi"),m=new RegExp("([A-Z])","g"),h=function(){return arguments[1].ucfirst()},g={prefix:null,method:{},property:{},css:{},promises:{prefix:null,method:{},property:{},css:{},test:{}}};return e.base.extend({test:{},pool:t.pool&&t.pool.dom,testMultiple:function(){for(var e,t=[],n=0;(e=arguments[n])!==s;n++)switch(typeof e){case"string":t.push(this.test[e]());break;case"boolean":var r=new l;e?r.resolve():r.reject(),t.push(r.promise);break;default:t.push(e)}return new a(t)},getPrefix:function(){var e,t=this,n=g.prefix||null;if(null===n){var r=t.pool?t.pool.obtain("div"):i.createElement("div"),o=r.style;n=!1;for(e in o)c.test(e)&&(n=e.match(c)[0]);n===!1&&"WebkitOpacity"in o&&(n="WebKit"),n===!1&&"KhtmlOpacity"in o&&(n="Khtml"),n=g.prefix=n===!1?!1:[n.toLowerCase(),n.toLowerCase().ucfirst(),n],r.dispose&&r.dispose()}return n},getMethod:function(e,t){e=u(e),t=t||o;var n=t.tagName,r=g.method[n]=g.method[n]||{},i=r[e]=g.method[n][e]||null;if(null===i){i=!1;var a,l,c=0,p=e.ucfirst(),f=this.getPrefix();for(a=f!==!1?(e+" "+p+" "+f.join(p+" ")+p).split(" "):[e];(l=a[c])!==s;c++)if(t[l]!==s&&("function"==typeof t[l]||"object"==typeof t[l])){i=l;break}g.method[n][e]=i}return i},getProperty:function(e,t){e=u(e),t=t||o;var n=t.tagName,r=g.property[n]=g.property[n]||{},i=r[e]=g.property[n][e]||null;if(null===i){i=!1;var a,l,c=0,p=e.ucfirst(),f=this.getPrefix();for(a=f!==!1?(e+" "+p+" "+f.join(p+" ")+p).split(" "):[e],c;(l=a[c])!==s;c++)if(t[l]!==s){i=l;break}g.property[n][e]=i}return i},getCssProperty:function(e){e=u(e);var t=this,n=g.css[e]||null;if(null===n){n=!1;var r,o=0,a=t.pool?t.pool.obtain("div"):i.createElement("div"),l=e.ucfirst(),c=this.getPrefix()||[],p=(e+" "+l+" "+c.join(l+" ")+l).split(" "),f="";for(o;(r=p[o])!==s;o++)if(a.style[r]!==s){n=r,o>0&&(f="-");break}n=g.css[e]=n!==!1?[f+n.replace(m,"-$1").toLowerCase(),n]:!1,a.dispose&&a.dispose()}return n},supportsPrefix:function(){return!!this.getPrefix()},supportsMethod:function(e,t){return!!this.getMethod(e,t)},supportsProperty:function(e,t){return!!this.getProperty(e,t)},supportsCssProperty:function(e){return!!this.getCssProperty(e)},testPrefix:function(){var e=g.promises.prefix;if(null===e){var t=new l,n=this.getPrefix();n?t.resolve(n):t.reject(),e=g.promises.prefix=t.promise}return e},testMethod:function(e,t){t=t||o;var n=t.tagName,r=g.promises.method[n]=g.promises.method[n]||{},i=r[e]=g.promises.method[n][e]||null;if(null===i){var s=new l,u=this.getMethod(e,t);u?s.resolve(u):s.reject(),i=g.promises.method[n][e]=s.promise}return i},testProperty:function(e,t){t=t||o;var n=t.tagName,r=g.promises.property[n]=g.promises.property[n]||{},i=r[e]=g.promises.property[n][e]||null;if(null===i){var s=new l,u=this.getProperty(e,t);u?s.resolve(u):s.reject(),i=g.promises.property[n][e]=s.promise}return i},testCssProperty:function(e){var t=g.promises.css[e]||null;if(null===t){var n=new l,r=this.getCssProperty(e);r?n.resolve(r):n.reject(),t=g.promises.css[e]=n.promise}return t},addTest:function(e,t){return this.test[e]=function(){var n=g.promises.test[e]||null;if(null===n){var r=new l,o=Array.prototype.slice.call(arguments);o.splice(0,0,r),t.apply(null,o),n=g.promises.test[e]=r.promise}return n}}})}),function(e){window.qoopido.register("support/capability/datauri",e,["../../support","../../dom/element"])}(function(e,t,n,r,o,i,s){"use strict";var u=e.support;return u.addTest("/capability/datauri",function(t){var n=e["dom/element"].create(u.pool?u.pool.obtain("img"):i.createElement("img"));n.one("error load",function(e){"load"===e.type&&1===n.element.width&&1===n.element.height?t.resolve():t.reject(),n.element.dispose&&n.element.dispose()},!1).setAttribute("src","data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==")})}),function(e){window.qoopido.register("support/element/canvas",e,["../../support"])}(function(e,t,n,r,o,i,s){"use strict";var u=e.support;return u.addTest("/element/canvas",function(e){var t=u.pool?u.pool.obtain("canvas"):i.createElement("canvas");t.getContext&&t.getContext("2d")?e.resolve():e.reject(),t.dispose&&t.dispose()})}),function(e){window.qoopido.register("support/element/canvas/todataurl",e,["../../../support","../canvas"])}(function(e,t,n,r,o,i,s){"use strict";var u=e.support;return u.addTest("/element/canvas/todataurl",function(t){e["support/element/canvas"]().then(function(){var e=u.pool?u.pool.obtain("canvas"):i.createElement("canvas");e.toDataURL!==s?t.resolve():t.reject(),e.dispose&&e.dispose()},function(){t.reject()})})}),function(e){window.qoopido.register("support/element/canvas/todataurl/png",e,["../../../../support","../todataurl"])}(function(e,t,n,r,o,i,s){"use strict";var u=e.support;return u.addTest("/element/canvas/todataurl/png",function(t){e["support/element/canvas/todataurl"]().then(function(){var e=u.pool?u.pool.obtain("canvas"):i.createElement("canvas");0===e.toDataURL("image/png").indexOf("data:image/png")?t.resolve():t.reject(),e.dispose&&e.dispose()},function(){t.reject()})})}),function(e){window.qoopido.registerSingleton("hook/event",e,["../base"])}(function(e,t,n,r,o,i,s){"use strict";function u(e,t,n){for(var r,o=0;(r=n[o])!==s;o++)e[r]=t[r];e._properties=e._properties.concat(n)}var a={general:{properties:"type altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which path".split(" "),process:function(e,t){var n;if(e.originalEvent=t,e.isDefaultPrevented=t.defaultPrevented?!0:!1,e.isPropagationStopped=t.cancelBubble?!0:!1,e.metaKey=t.metaKey&&t.metaKey!==!1?!0:!1,e.target||(e.target=t.srcElement||i),3===e.target.nodeType&&(e.target=e.target.parentNode),!e.path){e.path=[],n=e.target;do e.path.push(n);while(n=n.parentNode);e.path.push(o)}}},mouse:{regex:new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"),properties:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement dataTransfer".split(" "),process:function(e,t){var n,r,o;r=t.fromElement,o=t.button,null===e.pageX&&null!==t.clientX&&(n=e.target.ownerDocument||i,n=n.documentElement||n.body,e.pageX=t.clientX+(n.scrollLeft||0)-(n.clientLeft||0),e.pageY=t.clientY+(n.scrollTop||0)-(n.clientTop||0)),!e.relatedTarget&&r&&(e.relatedTarget=r===e.target?t.toElement:r),e.which||o===s||(e.which=1&o?1:2&o?3:4&o?2:0)}},key:{regex:new RegExp("^(?:key)"),properties:"char charCode key keyCode".split(" "),process:function(e,t){null===e.which&&(e.which=null!==t.charCode?t.charCode:t.keyCode)}}};return e.base.extend({add:function(e,t){return e&&t&&a[e]&&(a[e]=t),this},get:function(e){return e&&a[e]?a[e]:null},process:function(e,t){var n,r,o;for(n in a)r=a[n],o=!r.regex||r.regex.test(t.type),o&&(r.properties&&u(e,t,r.properties),r.process&&r.process(e,t),r.delegate&&(e.delegate=r.delegate))}})}),function(e){var t=["../base","../support"];window.getComputedStyle||t.push("../polyfill/window/getcomputedstyle"),window.qoopido.registerSingleton("hook/css",e,t)}(function(e,t,n,r,o,i,s){"use strict";var u=e.support,a=o.getComputedStyle||e["polyfill/window/getcomputedstyle"],l={general:{get:function(e,t){return a(e,null).getPropertyValue(t[0])},set:function(e,t,n){e.style[t[1]]=n}},opacity:u.supportsCssProperty("opacity")?null:{regex:new RegExp("alpha\\(opacity=(.*)\\)","i"),get:function(e,t,n){return n=a(e,null).getPropertyValue("filter").toString().match(this.regex),n=n?n[1]/100:1},set:function(e,t,n){var r=e.style;r.zoom=1,r.filter="alpha(opacity="+(100*n+.5>>0)+")"}}};return e.base.extend({add:function(e,t){return e&&t&&l[e]&&(l[e]=t),this},get:function(e){return e&&l[e]?l[e]:null},process:function(e,t,n,r){var o;return n=u.getCssProperty(n,t)||null,n?((o=this.get(n[1]))&&o[e]||this.get("general")[e])(t,n,r):void 0}})}),function(e){window.qoopido.register("dom/event",e,["../base","../hook/event"])}(function(e,t,n,r,o,i,s){"use strict";var u=e["hook/event"];return e.base.extend({originalEvent:null,isDelegate:!1,isDefaultPrevented:!1,isPropagationStopped:!1,isImmediatePropagationStopped:!1,_properties:null,_constructor:function(e){var t=this;return t._properties=[],t._obtain(e),t},_obtain:function(e){u.process(this,e)},_dispose:function(){for(var e,t=this,n=0;(e=t._properties[n])!==s;n++)delete t[e];delete t.delegate,t.originalEvent=null,t.isDelegate=!1,t.isDefaultPrevented=!1,t.isPropagationStopped=!1,t.isImmediatePropagationStopped=!1,t._properties.length=0},preventDefault:function(){var e=this,t=e.originalEvent;t.cancelable!==!1&&(e.isDefaultPrevented=!0,t.preventDefault?t.preventDefault():t.returnValue=!1)},stopPropagation:function(){var e=this,t=e.originalEvent;e.isPropagationStopped=!0,t.stopPropagation&&t.stopPropagation(),t.cancelBubble=!0},stopImmediatePropagation:function(){var e=this,t=e.originalEvent;e.isImmediatePropagationStopped=!0,t.stopImmediatePropagation&&t.stopImmediatePropagation(),e.stopPropagation()}})}),function(e){var t=["../base","../function/unique/uuid","../hook/css","./event"];window.CustomEvent||t.push("../polyfill/window/customevent"),window.addEventListener||t.push("../polyfill/window/addeventlistener"),window.removeEventListener||t.push("../polyfill/window/removeeventlistener"),window.dispatchEvent||t.push("../polyfill/window/dispatchevent"),Element.prototype.matches||t.push("../polyfill/element/matches"),document.querySelector||t.push("../polyfill/document/queryselector"),document.querySelectorAll||t.push("../polyfill/document/queryselectorall"),String.prototype.trim||t.push("../polyfill/string/trim"),window.qoopido.register("dom/element",e,t)}(function(e,t,n,r,o,i,s){"use strict";function u(e){var t,n,r;for(t in A)n=A[t],(!n.regex||n.regex.test(e))&&(r=n);return r}function a(e,t,n){var r=this,o=u(e),s=i.createEvent(o.type);s[o.method](e,"load"===e?!1:!0,!0,t),n&&(s._quid=n,s.isDelegate=!0),r.element.dispatchEvent(s)}function l(e){var t;if("string"==typeof e)try{w.test(e)===!0?(t=e.replace(w,"$1").toLowerCase(),e=i.createElement(t)):e=i.querySelector(e)}catch(n){e=null}if(!e)throw new Error("[Qoopido.js] Element could not be resolved");return e}function c(e){return Array.prototype.concat.apply([],Array.prototype.splice.call(e,0)).join(" ").split(x)}function p(e,t){for(var n,r=0;(n=e.path[r])!==s;r++){if(n.matches(t))return e.currentTarget=n,!0;if(n===e.currentTarget)break}return!1}var f="object",d="string",m=e["function/unique/uuid"],h=i.getElementsByTagName("head")[0],g="textContent"in i.createElement("a")?"textContent":"innerText",v="undefined"!=typeof h.previousElementSibling?function(){return this.previousElementSibling}:function(){for(var e=this;e=e.previousSibling;)if(1===e.nodeType)return e},y="undefined"!=typeof h.nextElementSibling?function(){return this.nextElementSibling}:function(){for(var e=this;e=e.nextSibling;)if(1===e.nodeType)return e},w=new RegExp("^<(\\w+)\\s*/>$"),b=new RegExp("^[^-]+"),x=new RegExp(" +","g"),E=e["pool/module"]&&e["pool/module"].create(e["dom/event"],null,!0)||null,_=e["hook/css"],q={},A={custom:{type:"CustomEvent",method:"initCustomEvent"},html:{regex:new RegExp("^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$"),type:"HTMLEvents",method:"initEvent"},mouse:{regex:new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"),type:"MouseEvents",method:"initMouseEvent"}};return e.base.extend({type:null,element:null,_listener:null,_constructor:function(e,t,n){var r,o=this;return e=l(e),r=e._quid,r?o=q[r]:(r=e._quid=m(),o.type=e.tagName,o.element=e,o._listener={},q[r]=o),"object"==typeof t&&null!==t&&o.setAttributes(t),"object"==typeof n&&null!==n&&o.setStyles(n),o!==this&&this.dispose&&this.dispose(),o},_obtain:function(e,t,n){this._constructor(e,t,n)},_dispose:function(){var e,t,n=this;for(e in n._listener)t=e.match(b),n.element.removeEventListener(t,n._listener[e]),delete n._listener[e];n.type=null,n.element=null},getContent:function(e){var t=this.element;return e&&e!==!1?t.innerHTML:t[g]},setContent:function(e,t){var n=this,r=n.element;return t&&t!==!1?r.innerHTML=e:r[g]=e,n},getAttribute:function(e){var t=this;return e&&typeof e===d?t.element.getAttribute(e):void 0},getAttributes:function(){for(var e,t=this,n={},r=c(arguments),o=0;(e=r[o])!==s;o++)n[e]=t.element.getAttribute(e);return n},setAttribute:function(e,t){var n=this;return e&&typeof e===d&&n.element.setAttribute(e,t),n},setAttributes:function(e){var t,n=this;if(e&&typeof e===f&&!e.length)for(t in e)n.element.setAttribute(t,e[t]);return n},removeAttribute:function(e){var t=this;return e&&typeof e===d&&t.element.removeAttribute(e),t},removeAttributes:function(){for(var e,t=this,n=c(arguments),r=0;(e=n[r])!==s;r++)t.element.removeAttribute(e);return t},getStyle:function(e){var t=this;return e&&typeof e===d?_.process("get",t.element,e):void 0},getStyles:function(){for(var e,t=this,n={},r=c(arguments),o=0;(e=r[o])!==s;o++)n[e]=_.process("get",t.element,e);return n},setStyle:function(e,t){var n=this;return e&&typeof e===d&&_.process("set",n.element,e,t),n},setStyles:function(e){var t,n=this;if(e&&typeof e===f&&!e.length)for(t in e)_.process("set",n.element,t,e[t]);return n},removeStyle:function(e){var t=this;return e&&typeof e===d&&t.setStyle(e,""),t},removeStyles:function(){for(var e,t=this,n=c(arguments),r=0;(e=n[r])!==s;r++)t.setStyle(e,"");return t},siblings:function(e){for(var t=this.element,n=t.parentNode.firstChild,r=[];n;n=y.call(n))n===t||e&&!n.matches(e)||r.push(n);return r},siblingsBefore:function(e){for(var t=this.element.previousSibling,n=[];t;t=v.call(t))(!e||t.matches(e))&&n.push(t);return n},siblingsAfter:function(e){for(var t=this.element.nextSibling,n=[];t;t=y.call(t))(!e||t.matches(e))&&n.push(t);return n},previous:function(e){var t=v.call(this.element);if(!e)return t;for(;t;t=v.call(t))if(t.matches(e))return t},next:function(e){var t=y.call(this.element);if(!e)return t;for(;t;t=y.call(t))if(t.matches(e))return t},find:function(e){var t,n,r=this.element;return e=e.trim(),">"===e.charAt(0)?(t=r._quid,r.setAttribute("data-quid",t),e='[data-quid="'+t+'"] '+e,n=r.parentNode.querySelectorAll(e),r.removeAttribute("data-quid")):n=r.querySelectorAll(e),n},parent:function(e){var t;if(!e)return this.element.parentNode;for(t=this.element;t;t=t.parentNode)if(t.matches(e))return t},parents:function(e){for(var t=this.element.parentNode,n=[];t;t=t.parentNode){if(9===t.nodeType)return n;1===t.nodeType&&(!e||t.matches(e))&&n.push(t)}},isVisible:function(){var e=this,t=e.element;return!(t.offsetWidth<=0&&t.offsetHeight<=0||"hidden"===e.getStyle("visibility")||e.getStyle("opacity")<=0)},hasClass:function(e){return e?new RegExp("(?:^|\\s)"+e+"(?:\\s|$)").test(this.element.className):!1},addClass:function(e){var t=this;return e&&!t.hasClass(e)&&(t.element.className+=t.element.className?" "+e:e),t},removeClass:function(e){var t=this;return e&&t.hasClass(e)&&(t.element.className=t.element.className.replace(new RegExp("(?:^|\\s)"+e+"(?!\\S)"),"")),t},toggleClass:function(e){var t=this;return e&&(t.hasClass(e)?t.removeClass(e):t.addClass(e)),t},prepend:function(e){var t=this,n=t.element;if(e)try{e=e.element||l(e),n.firstChild?n.insertBefore(e,n.firstChild):t.append(e)}catch(r){n.insertAdjacentHTML("afterBegin",e)}return t},append:function(e){var t=this,n=t.element;if(e)try{n.appendChild(e.element||l(e))}catch(r){n.insertAdjacentHTML("beforeEnd",e)}return t},prependTo:function(e){var t=this,n=t.element;return e&&((e=e.element||l(e)).firstChild?e.insertBefore(n,e.firstChild):t.appendTo(e)),t},appendTo:function(e){var t=this;return e&&(e.element||l(e)).appendChild(t.element),t},insertBefore:function(e){var t=this,n=t.element;return e&&(e=e.element||l(e)).parentNode.insertBefore(n,e),t},insertAfter:function(e){var t=this,n=t.element;return e&&((e=e.element||l(e)).nextSibling?e.parentNode.insertBefore(n,e.nextSibling):t.appendTo(e.parentNode)),t},replace:function(e){var t=this,n=t.element;return e&&(e=e.element||l(e)).parentNode.replaceChild(n,e),t},replaceWith:function(e){var t=this,n=t.element;return e&&(e=e.element||l(e),n.parentNode.replaceChild(e,n)),t},remove:function(){var e=this,t=e.element;return t.parentNode.removeChild(t),e},on:function(t){var n,r=this,o=r.element,i=arguments.length>2?arguments[1]:null,u=arguments.length>2?arguments[2]:arguments[1],l=u._quid||(u._quid=m()),c=0;for(t=t.split(" ");(n=t[c])!==s;c++){var f=n+"-"+l,d=function(t){var n;t=E&&E.obtain(t)||e["dom/event"].create(t),t.isPropagationStopped||(n=t.delegate,t._quid=m(),(!i||p(t,i))&&u.call(t.currentTarget,t,t.originalEvent.detail),n&&(delete t.delegate,a.call(r,n))),t.dispose&&t.dispose()};d.type=n,r._listener[f]=d,o.addEventListener(n,d)}return r},one:function(e){var t=this,n=arguments.length>3||"string"==typeof arguments[1]?arguments[1]:null,r=arguments.length>3||"function"==typeof arguments[2]?arguments[2]:arguments[1],o=(arguments.length>3?arguments[3]:arguments[2])!==!1,i=function(n){t.off(o===!0?n.type:e,i),r.call(this,n,n.originalEvent.detail)};return r._quid=i._quid=m(),n?t.on(e,n,i):t.on(e,i),t},off:function(e,t){var n,r,o,i=this,u=i.element,a=0;for(e=e.split(" ");(n=e[a])!==s;a++)r=t._quid&&n+"-"+t._quid||null,o=r&&i._listener[r]||null,o?(u.removeEventListener(n,o),delete i._listener[r]):u.removeEventListener(n,t);return i},emit:function(e,t){var n=this;return a.call(n,e,t),n}})}),function(e){window.qoopido.registerSingleton("url",e,["./base"])}(function(e,t,n,r,o,i,s){"use strict";function u(e){var t=i.createElement("a");return t.href=e||"",t}var a,l,c=new RegExp("[?&]?([^=]+)=([^&]*)","g");try{a=location}catch(p){a=u()}return l=new RegExp("".concat("^",a.protocol,"//",a.hostname),"i"),e.base.extend({resolve:function(e){return u(e).href},redirect:function(e,t){t=t||o,t.location.href=this.resolve(e)},getParameter:function(e){for(var t,n={},r=u(e).search.split("+").join(" ");t=c.exec(r);)n[decodeURIComponent(t[1])]=decodeURIComponent(t[2]);return n},isLocal:function(e){return l.test(this.resolve(e))}})}),function(e){window.qoopido.register("transport",e,["./base","./function/merge"])}(function(e,t,n,r,o,i,s){"use strict";var u;return u=e.base.extend({setup:function(t){var n=this;return n._settings=e["function/merge"]({},n._settings,t),n},serialize:function(e,t){var n,r,o,i=[];for(n in e)r=t?"".concat(t,"[",n,"]"):n,o=e[n],i.push("object"==typeof o?this.serialize(o,r):"".concat(encodeURIComponent(r),"=",encodeURIComponent(o)));return i.join("&")}})},window,document),function(e){window.qoopido.registerSingleton("transport/xhr",e,["../transport","../function/merge","../function/unique/string","../url","../promise/defer"])}(function(e,t,n,r,o,i,s){"use strict";function u(e,t,n){var r,o=this,i=o.xhr,s=o.settings;t=s.cache===!1?"".concat(t,t.indexOf("?")>-1?"&":"?","_="+(new Date).getTime()):t,t=n&&"GET"===e?"".concat(t,t.indexOf("?")>-1?"&":"?",n):t;for(r in s.xhrOptions)i[r]=s.xhrOptions[r];if(i.open(e,t,s.async,s.username,s.password),i.setRequestHeader){i.setRequestHeader("Accept",s.accept),n&&"GET"!==e&&i.setRequestHeader("Content-Type",s.contentType);for(r in s.header)i.setRequestHeader(r,s.header[r])}i.timeout=s.timeout,i.onprogress=function(e){a.call(o,e)},i.onreadystatechange=i.onload=function(){l.call(o)},i.onerror=function(){c.call(o)},i.send(n||null),o.timeout=setTimeout(function(){p.call(o)},s.timeout)}function a(e){var t=this;t.timeout&&clearTimeout(t.timeout),t.timeout=setTimeout(function(){p.call(t)},t.settings.timeout)}function l(){var e=this,t=e.xhr,n=e.dfd;(t.readyState===s||4===t.readyState)&&(f.call(e),t.status===s||200===t.status?n.resolve({data:t.responseText,xhr:t}):n.reject({status:t.status,xhr:t}))}function c(){var e=this;f.call(e),e.dfd.reject()}function p(){var e=this;e.xhr.abort(),f.call(e),e.dfd.reject()}function f(){var e=this,t=e.xhr;e.timeout&&clearTimeout(e.timeout),t.onprogress=t.onreadystatechange=t.onerror=null}var d,m=e["promise/defer"],h="undefined"!=typeof o.XMLHttpRequest?function(t){return e.url.isLocal(t)?new o.XMLHttpRequest:o.XDomainRequest?new o.XDomainRequest:new o.XMLHttpRequest}:function(){try{return new ActiveXObject("MSXML2.XMLHTTP.3.0")}catch(e){return null}};return d=e.transport.extend({_settings:{accept:"*/*",timeout:5e3,async:!0,cache:!1,header:{},username:null,password:null,contentType:"application/x-www-form-urlencoded; charset=UTF-8 ",xhrOptions:{}},load:function(t,n,r,o){var i={};return n=e.url.resolve(n),i.url=n,i.id="".concat("xhr-",e["function/unique/string"]()),i.dfd=new m,i.xhr=h(n),i.settings=e["function/merge"]({},this._settings,o),i.timeout=null,u.call(i,t.toUpperCase(),n,r),i.dfd.promise},get:function(e,t,n){return this.load("GET",e,t,n)},post:function(e,t,n){return this.load("POST",e,t,n)},put:function(e,t,n){return this.load("PUT",e,t,n)},"delete":function(e,t,n){return this.load("DELETE",e,t,n)},head:function(e,t,n){return this.load("HEAD",e,t,n)}})},window,document),function(e){var t=["../element","../../proxy","../../function/merge","../../url","../../support","../../support/capability/datauri","../../support/element/canvas/todataurl/png","../../transport/xhr"];window.qoopido.register("dom/element/shrinkimage",e,t)}(function(e,t,n,r,o,i,s){"use strict";function u(t,n){t=e.url.resolve(b.exec(t)[1]),n=n===!0;var r=this,o=e["function/merge"]({},r._settings,e.url.getParameter(t)),i=o.target||(t=t.split("?")[0]).replace(x,"".concat(".q",o.quality,".shrunk"));n||r.removeAttribute(r._settings.attribute).hide(),E.then(function(){if(o.debug===!0)throw new Error("[Qoopido.js] Debug enabled");switch(typeof y[i]){case"object":y[i].one(A,function(e){a.call(r,e.data,n)}),r.emit(_);break;case"string":a.call(r,y[i],n);break;default:y[i]=d.create(i,n?null:r.element).one(P,function(e,o){e.type===A?(y[i]=o,r.emit(q),a.call(r,o,n)):(y[i]=t,a.call(r,t,n))},!1)}})["catch"](function(){y[i]=t,a.call(r,t,n)})}function a(e,t){var n=this;t?(n.setStyle("backgroundImage","url("+e+")"),n.emit(A)):n.one(C,function(){n.show(),n.emit(A)}).setAttribute("src",e)}function l(e){var t=this;e.get(t._url).then(function(e){try{var n=m.parse(e.data);n.width=parseInt(n.width,10),n.height=parseInt(n.height,10),c.call(t,n)}catch(r){t.emit(S)}},function(){t.emit(S)})}function c(e){var t,n,r=this,o=function(o){return t=v&&v.obtain("canvas")||i.createElement("canvas"),t.style.display="none",t.width=e.width,t.height=e.height,n=t.getContext("2d"),n.clearRect(0,0,e.width,e.height),n.drawImage(r.element,0,0,e.width,e.height),r.one(C,s).setAttribute("src",e.alpha),p(o)},s=function(o){var i;return n.globalCompositeOperation="xor",n.drawImage(r.element,0,0,e.width,e.height),i=t.toDataURL("image/png"),u(),r.emit(A,i),p(o)},u=function(){t&&t.dispose&&t.dispose(),r.element.dispose&&r.element.dispose()};r.one(j,function(e){e.type===C?o.call(this,e):(u(),r.emit(S))},!1).setAttribute("src",e.main)}function p(e){return e.preventDefault(),e.stopPropagation(),!1}var f,d,m=o.JSON,h=n.pop(),g={attribute:"data-"+h,quality:80,debug:!1},v=t.pool&&t.pool.dom||null,y={},w=new RegExp('^url\\x28"{0,1}data:image/shrink,(.+?)"{0,1}\\x29$',"i"),b=new RegExp('^(?:url\\x28"{0,1}|)(?:data:image/shrink,|)(.+?)(?:"{0,1}\\x29|)$',"i"),x=new RegExp("\\.png$","i"),E=e.support.testMultiple("/capability/datauri","/element/canvas/todataurl/png"),_="queued",q="cached",A="loaded",S="failed",P="".concat(A," ",S),C="load",T="error",j="".concat(C," ",T);return f=e["dom/element"].extend({_constructor:function(t,n){var r,o,i=f._parent._constructor.call(this,t);return i._settings=n=e["function/merge"]({},g,n),r=i.getAttribute(n.attribute),o=i.getStyle("backgroundImage"),"IMG"===i.type&&u.call(i,r),"none"!==o&&w.test(o)&&u.call(i,o,!0),i},hide:function(){this.setStyles({visibility:"hidden",opacity:0})},show:function(){this.setStyles({visibility:"",opacity:""})}}),d=e["dom/element"].extend({_url:null,_constructor:function(t,n){var r;return n||(n=v&&v.obtain("img")||i.createElement("img")),r=d._parent._constructor.call(this,n),r._url=t,l.call(r,e["transport/xhr"]),r}}),f},window); \ No newline at end of file diff --git a/dist/3.7.3/min/packages/qoopido.shrinkimage.legacy.js b/dist/3.7.3/min/packages/qoopido.shrinkimage.legacy.js new file mode 100644 index 00000000..59628e93 --- /dev/null +++ b/dist/3.7.3/min/packages/qoopido.shrinkimage.legacy.js @@ -0,0 +1,3 @@ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +!function(e,t){t.register?t.register("polyfill/object/defineproperty",e):(t.modules=t.modules||{})["polyfill/object/defineproperty"]=e()}(function(e,t,n,r,o,i,s){"use strict";if(!Object.defineProperty||!function(){try{return Object.defineProperty({},"x",{}),!0}catch(e){return!1}}()){var u=Object.defineProperty,a=Object.prototype.__defineGetter__,c=Object.prototype.__defineSetter__;Object.defineProperty=function(e,t,n){if(u)try{return u(e,t,n)}catch(r){}if(e!==Object(e))throw new TypeError("Object.defineProperty called on non-object");return a&&"get"in n&&a.call(e,t,n.get),c&&"set"in n&&c.call(e,t,n.set),"value"in n&&(e[t]=n.value),e}}return Object.defineProperty},window.qoopido=window.qoopido||{}),function(e,t){if(t.register){var n=[];Object.defineProperty&&function(){try{return Object.defineProperty({},"x",{}),!0}catch(e){return!1}}()||n.push("./defineproperty"),t.register("polyfill/object/defineproperties",e,n)}else(t.modules=t.modules||{})["polyfill/object/defineproperties"]=e()}(function(e,t,n,r,o,i,s){"use strict";return Object.defineProperties||(Object.defineProperties=function(e,t){if(e!==Object(e))throw new TypeError("Object.defineProperties called on non-object");var n;for(n in t)Object.prototype.hasOwnProperty.call(t,n)&&Object.defineProperty(e,n,t[n]);return e}),Object.defineProperties},window.qoopido=window.qoopido||{}),function(e,t){if(t.register){var n=[];Object.defineProperties||n.push("./defineproperties"),t.register("polyfill/object/create",e,n)}else(t.modules=t.modules||{})["polyfill/object/create"]=e()}(function(e,t,n,r,o,i,s){"use strict";return Object.create||(Object.create=function(e,t){function n(){}if("object"!=typeof e)throw new TypeError;n.prototype=e;var r=new n;if(e&&(r.constructor=n),arguments.length>1){if(t!==Object(t))throw new TypeError;Object.defineProperties(r,t)}return r}),Object.create},window.qoopido=window.qoopido||{}),function(e,t){t.register?t.register("polyfill/object/getownpropertynames",e):(t.modules=t.modules||{})["polyfill/object/getownpropertynames"]=e()}(function(e,t,n,r,o,i,s){"use strict";return Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(e){if(e!==Object(e))throw new TypeError("Object.getOwnPropertyNames called on non-object");var t,n=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.push(t);return n}),Object.getOwnPropertyNames},window.qoopido=window.qoopido||{}),function(e,t){t.register?t.register("polyfill/object/getownpropertydescriptor",e):(t.modules=t.modules||{})["polyfill/object/getownpropertydescriptor"]=e()}(function(e,t,n,r,o,i,s){"use strict";if(!Object.getOwnPropertyDescriptor||!function(){try{return Object.getOwnPropertyDescriptor({x:0},"x"),!0}catch(e){return!1}}()){var u=Object.getOwnPropertyDescriptor;Object.getOwnPropertyDescriptor=function(e,t){if(e!==Object(e))throw new TypeError;try{return u.call(Object,e,t)}catch(n){}return Object.prototype.hasOwnProperty.call(e,t)?{value:e[t],enumerable:!0,writable:!0,configurable:!0}:void 0}}return Object.getOwnPropertyDescriptor},window.qoopido=window.qoopido||{}),function(e,t,n,r,o){"use strict";function i(e,i,s,a){var p,d=e.split("/");return l[e]?l[e]:(p=function(){if(s)for(var p,m,g=d.slice(0,-1).join("/"),h=0;(p=s[h])!==o;h++)m=f.test(p),m&&(p=u(g+"/"+p)),!l[p]&&arguments[h]&&(l[p]=arguments[h]),m&&!l[p]&&"undefined"!=typeof console&&console.error("".concat("[Qoopido.js] ",e,": Could not load dependency ",p));return l[e]=i(l,c,d,t,n,r,o),a&&a(l[e]),l[e]},void("undefined"!=typeof module&&module.exports?module.exports=define(p):"function"==typeof define&&define.amd?s?define(s,p):define(p):p()))}function s(e,t,n){i(e,t,n,function(t){l[e]=t.create()})}function u(e){for(var t;(t=e.replace(d,""))!==e;)e=t;return e.replace(m,"")}var a=n.qoopido||(n.qoopido={}),c=a.shared||(a.shared={}),l=a.modules||(a.modules={}),p=[],f=new RegExp("^\\.+\\/"),d=new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."),m=new RegExp("(^\\/)|\\.\\/","g");a.register=i,a.registerSingleton=s,Object.create||p.push("./polyfill/object/create"),Object.getOwnPropertyNames||p.push("./polyfill/object/getownpropertynames"),Object.getOwnPropertyDescriptor&&function(){try{return Object.getOwnPropertyDescriptor({x:0},"x"),!0}catch(e){return!1}}()||p.push("./polyfill/object/getownpropertydescriptor"),i("base",e,p)}(function(e,t,n,r,o,i,s){"use strict";function u(e){for(var t,n={},r=Object.getOwnPropertyNames(e),o=0;(t=r[o])!==s;o++)n[t]=Object.getOwnPropertyDescriptor(e,t);return n}function a(){throw new Error("[Qoopido.js] Operation prohibited")}return{create:function(){var e,t=Object.create(this,u(this));return t._constructor&&(e=t._constructor.apply(t,arguments)),t.create=t.extend=a,e||t},extend:function(e,t){var n;return e=e||{},t=t===!0,e._parent=this,n=Object.create(this,u(e)),t===!0&&(n.extend=a),n}}},navigator,this,document),function(e){window.qoopido.register("polyfill/string/ucfirst",e)}(function(e,t,n,r,o,i,s){"use strict";return String.prototype.ucfirst||(String.prototype.ucfirst=function(){var e=this;return e.charAt(0).toUpperCase()+e.slice(1)}),String.prototype.ucfirst}),function(e){window.qoopido.register("polyfill/string/lcfirst",e)}(function(e,t,n,r,o,i,s){"use strict";return String.prototype.lcfirst||(String.prototype.lcfirst=function(){var e=this;return e.charAt(0).toLowerCase()+e.slice(1)}),String.prototype.lcfirst}),function(e){window.qoopido.register("polyfill/window/getcomputedstyle",e)}(function(e,t,n,r,o,i,s){"use strict";if(o.getComputedStyle)return o.getComputedStyle;var u=new RegExp("(\\-([a-z]){1})","g"),a=function(){return arguments[2].toUpperCase()};return function(e,t){var n=this;return n.getPropertyValue=function(t){return"float"===t&&(t="styleFloat"),u.test(t)&&(t=t.replace(u,a)),e.currentStyle[t]||null},n}}),function(e){window.qoopido.register("polyfill/window/promise",e)}(function(e,t,n,r,o,i,s){"use strict";function u(e,t){var n=_.push([e,t]);1===n&&a()}function a(){o.setTimeout(c,1)}function c(){for(var e,t=0;(e=_[t])!==s;t++)e[0](e[1]);_.length=0}function l(e,t){var n,r=null;try{if(e===t)throw new TypeError("A promises callback cannot return that same promise.");if(("function"==typeof t||"object"==typeof t&&null!==t)&&(r=t.then,"function"==typeof r))return r.call(t,function(r){return n?!0:(n=!0,void(t!==r?d(e,r):m(e,r)))},function(t){return n?!0:(n=!0,void g(e,t))}),!0}catch(o){return n?!0:(g(e,o),!0)}return!1}function p(e,t){function n(e){d(t,e)}function r(e){g(t,e)}try{e(n,r)}catch(o){r(o)}}function f(e,t,n,r){var o,i,s,u,a="function"==typeof n;if(a)try{o=n(r),s=!0}catch(c){u=!0,i=c}else o=r,s=!0;l(t,o)||(a&&s?d(t,o):u?g(t,i):e===E?d(t,o):e===P&&g(t,o))}function d(e,t){e===t?m(e,t):l(e,t)||m(e,t)}function m(e,t){e._state===x&&(e._state=j,e._detail=t,u(h,e))}function g(e,t){e._state===x&&(e._state=j,e._detail=t,u(y,e))}function h(e){w(e,e._state=E)}function y(e){w(e,e._state=P)}function v(e,t,n,r){var o=e._subscribers,i=o.length;o[i]=t,o[i+E]=n,o[i+P]=r}function w(e,t){for(var n,r,o=e._subscribers,i=e._detail,u=0;(n=o[u])!==s;u+=3)r=o[u+t],f(t,n,r,i);e._subscribers=null}function b(e){var t=this;if("function"!=typeof e)throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");t._subscribers=[],p(e,t)}var x=void 0,j=0,E=1,P=2,_=[];return b.prototype={_state:s,_detail:s,_subscribers:s,then:function(e,t){var n=this,r=new b(function(){});return n._state?u(function(){f(n._state,r,arguments[n._state-1],n._detail)}):v(n,r,e,t),r},"catch":function(e){return this.then(null,e)}},o.Promise||(o.Promise=b),o.Promise}),function(e){var t=[];window.Promise||t.push("../polyfill/window/promise"),window.qoopido.register("promise/all",e,t)}(function(e,t,n,r,o,i,s){"use strict";return function(e){if("[object Array]"!==Object.prototype.toString.call(e))throw new TypeError("You must pass an array to all.");return new o.Promise(function(t,n){function r(e){return function(t){o(e,t)}}function o(e,n){u[e]=n,0===--a&&t(u)}var i,u=[],a=e.length,c=0;for(0===a&&t([]);(i=e[c])!==s;c++)i&&"function"==typeof i.then?i.then(r(c),n):o(c,i)})}}),function(e){var t=[];window.Promise||t.push("../polyfill/window/promise"),window.qoopido.register("promise/defer",e,t)}(function(e,t,n,r,o,i,s){"use strict";return function(){var e=this;e.promise=new o.Promise(function(t,n){e.resolve=t,e.reject=n})}}),function(e){window.qoopido.register("function/merge",e)}(function(e,t,n,r,o,i,s){"use strict";return function u(){var e,t,n,r,o,i=arguments[0];for(e=1;(t=arguments[e])!==s;e++)for(n in t)r=i[n],o=t[n],o!==s&&(null!==o&&"object"==typeof o?(r=o.length!==s?r&&"object"==typeof r&&r.length!==s?r:[]:r&&"object"==typeof r&&r.length===s?r:{},i[n]=u(r,o)):i[n]=o);return i}}),function(e){window.qoopido.register("function/unique/string",e)}(function(e,t,n,r,o,i,s){"use strict";function u(e){var t="",n=0;for(e=parseInt(e,10)||12;e>n;n++)t+=c[parseInt(Math.random()*(c.length-1),10)];return t}var a={},c="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");return function(e){var t;do t=u(e);while("undefined"!=typeof a[t]);return a[t]=!0,t}}),function(e){window.qoopido.register("function/unique/uuid",e)}(function(e,t,n,r,o,i,s){"use strict";function u(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(c,function(e){var t=16*Math.random()|0,n="x"===e?t:3&t|8;return n.toString(16)})}var a={},c=new RegExp("[xy]","g");return function(){var e;do e=u();while("undefined"!=typeof a[e]);return a[e]=!0,e}}),function(e){window.qoopido.register("proxy",e,["./base","./function/unique/uuid"])}(function(e,t,n,r,o,i,s){"use strict";return e.base.extend({_constructor:function(t,n){var r=Array.prototype.splice.call(arguments,2),o=function(){return n.apply(t,Array.prototype.slice.call(arguments).concat(r))};return o._quid=e["function/unique/uuid"](),o}})}),function(e){var t=["./base","./promise/all","./promise/defer"];String.prototype.ucfirst||t.push("./polyfill/string/ucfirst"),String.prototype.lcfirst||t.push("./polyfill/string/lcfirst"),window.qoopido.registerSingleton("support",e,t)}(function(e,t,n,r,o,i,s){"use strict";function u(e){return e.replace(p,"$1").lcfirst().replace(f,"").replace(d,g)}var a=e["promise/all"],c=e["promise/defer"],l=new RegExp("^(Moz|WebKit|Khtml|ms|O|Icab)(?=[A-Z])"),p=new RegExp("^(?:webkit|khtml|icab|moz|ms|o)([A-Z])"),f=new RegExp("^-(?:webkit|khtml|icab|moz|ms|o)-"),d=new RegExp("-([a-z])","gi"),m=new RegExp("([A-Z])","g"),g=function(){return arguments[1].ucfirst()},h={prefix:null,method:{},property:{},css:{},promises:{prefix:null,method:{},property:{},css:{},test:{}}};return e.base.extend({test:{},pool:t.pool&&t.pool.dom,testMultiple:function(){for(var e,t=[],n=0;(e=arguments[n])!==s;n++)switch(typeof e){case"string":t.push(this.test[e]());break;case"boolean":var r=new c;e?r.resolve():r.reject(),t.push(r.promise);break;default:t.push(e)}return new a(t)},getPrefix:function(){var e,t=this,n=h.prefix||null;if(null===n){var r=t.pool?t.pool.obtain("div"):i.createElement("div"),o=r.style;n=!1;for(e in o)l.test(e)&&(n=e.match(l)[0]);n===!1&&"WebkitOpacity"in o&&(n="WebKit"),n===!1&&"KhtmlOpacity"in o&&(n="Khtml"),n=h.prefix=n===!1?!1:[n.toLowerCase(),n.toLowerCase().ucfirst(),n],r.dispose&&r.dispose()}return n},getMethod:function(e,t){e=u(e),t=t||o;var n=t.tagName,r=h.method[n]=h.method[n]||{},i=r[e]=h.method[n][e]||null;if(null===i){i=!1;var a,c,l=0,p=e.ucfirst(),f=this.getPrefix();for(a=f!==!1?(e+" "+p+" "+f.join(p+" ")+p).split(" "):[e];(c=a[l])!==s;l++)if(t[c]!==s&&("function"==typeof t[c]||"object"==typeof t[c])){i=c;break}h.method[n][e]=i}return i},getProperty:function(e,t){e=u(e),t=t||o;var n=t.tagName,r=h.property[n]=h.property[n]||{},i=r[e]=h.property[n][e]||null;if(null===i){i=!1;var a,c,l=0,p=e.ucfirst(),f=this.getPrefix();for(a=f!==!1?(e+" "+p+" "+f.join(p+" ")+p).split(" "):[e],l;(c=a[l])!==s;l++)if(t[c]!==s){i=c;break}h.property[n][e]=i}return i},getCssProperty:function(e){e=u(e);var t=this,n=h.css[e]||null;if(null===n){n=!1;var r,o=0,a=t.pool?t.pool.obtain("div"):i.createElement("div"),c=e.ucfirst(),l=this.getPrefix()||[],p=(e+" "+c+" "+l.join(c+" ")+c).split(" "),f="";for(o;(r=p[o])!==s;o++)if(a.style[r]!==s){n=r,o>0&&(f="-");break}n=h.css[e]=n!==!1?[f+n.replace(m,"-$1").toLowerCase(),n]:!1,a.dispose&&a.dispose()}return n},supportsPrefix:function(){return!!this.getPrefix()},supportsMethod:function(e,t){return!!this.getMethod(e,t)},supportsProperty:function(e,t){return!!this.getProperty(e,t)},supportsCssProperty:function(e){return!!this.getCssProperty(e)},testPrefix:function(){var e=h.promises.prefix;if(null===e){var t=new c,n=this.getPrefix();n?t.resolve(n):t.reject(),e=h.promises.prefix=t.promise}return e},testMethod:function(e,t){t=t||o;var n=t.tagName,r=h.promises.method[n]=h.promises.method[n]||{},i=r[e]=h.promises.method[n][e]||null;if(null===i){var s=new c,u=this.getMethod(e,t);u?s.resolve(u):s.reject(),i=h.promises.method[n][e]=s.promise}return i},testProperty:function(e,t){t=t||o;var n=t.tagName,r=h.promises.property[n]=h.promises.property[n]||{},i=r[e]=h.promises.property[n][e]||null;if(null===i){var s=new c,u=this.getProperty(e,t);u?s.resolve(u):s.reject(),i=h.promises.property[n][e]=s.promise}return i},testCssProperty:function(e){var t=h.promises.css[e]||null;if(null===t){var n=new c,r=this.getCssProperty(e);r?n.resolve(r):n.reject(),t=h.promises.css[e]=n.promise}return t},addTest:function(e,t){return this.test[e]=function(){var n=h.promises.test[e]||null;if(null===n){var r=new c,o=Array.prototype.slice.call(arguments);o.splice(0,0,r),t.apply(null,o),n=h.promises.test[e]=r.promise}return n}}})}),function(e){window.qoopido.register("support/capability/datauri",e,["../../support","../../dom/element"])}(function(e,t,n,r,o,i,s){"use strict";var u=e.support;return u.addTest("/capability/datauri",function(t){var n=e["dom/element"].create(u.pool?u.pool.obtain("img"):i.createElement("img"));n.one("error load",function(e){"load"===e.type&&1===n.element.width&&1===n.element.height?t.resolve():t.reject(),n.element.dispose&&n.element.dispose()},!1).setAttribute("src","data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==")})}),function(e){window.qoopido.register("support/element/canvas",e,["../../support"])}(function(e,t,n,r,o,i,s){"use strict";var u=e.support;return u.addTest("/element/canvas",function(e){var t=u.pool?u.pool.obtain("canvas"):i.createElement("canvas");t.getContext&&t.getContext("2d")?e.resolve():e.reject(),t.dispose&&t.dispose()})}),function(e){window.qoopido.register("support/element/canvas/todataurl",e,["../../../support","../canvas"])}(function(e,t,n,r,o,i,s){"use strict";var u=e.support;return u.addTest("/element/canvas/todataurl",function(t){e["support/element/canvas"]().then(function(){var e=u.pool?u.pool.obtain("canvas"):i.createElement("canvas");e.toDataURL!==s?t.resolve():t.reject(),e.dispose&&e.dispose()},function(){t.reject()})})}),function(e){window.qoopido.register("support/element/canvas/todataurl/png",e,["../../../../support","../todataurl"])}(function(e,t,n,r,o,i,s){"use strict";var u=e.support;return u.addTest("/element/canvas/todataurl/png",function(t){e["support/element/canvas/todataurl"]().then(function(){var e=u.pool?u.pool.obtain("canvas"):i.createElement("canvas");0===e.toDataURL("image/png").indexOf("data:image/png")?t.resolve():t.reject(),e.dispose&&e.dispose()},function(){t.reject()})})}),function(e){window.qoopido.registerSingleton("hook/event",e,["../base"])}(function(e,t,n,r,o,i,s){"use strict";function u(e,t,n){for(var r,o=0;(r=n[o])!==s;o++)e[r]=t[r];e._properties=e._properties.concat(n)}var a={general:{properties:"type altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which path".split(" "),process:function(e,t){var n;if(e.originalEvent=t,e.isDefaultPrevented=t.defaultPrevented?!0:!1,e.isPropagationStopped=t.cancelBubble?!0:!1,e.metaKey=t.metaKey&&t.metaKey!==!1?!0:!1,e.target||(e.target=t.srcElement||i),3===e.target.nodeType&&(e.target=e.target.parentNode),!e.path){e.path=[],n=e.target;do e.path.push(n);while(n=n.parentNode);e.path.push(o)}}},mouse:{regex:new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"),properties:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement dataTransfer".split(" "),process:function(e,t){var n,r,o;r=t.fromElement,o=t.button,null===e.pageX&&null!==t.clientX&&(n=e.target.ownerDocument||i,n=n.documentElement||n.body,e.pageX=t.clientX+(n.scrollLeft||0)-(n.clientLeft||0),e.pageY=t.clientY+(n.scrollTop||0)-(n.clientTop||0)),!e.relatedTarget&&r&&(e.relatedTarget=r===e.target?t.toElement:r),e.which||o===s||(e.which=1&o?1:2&o?3:4&o?2:0)}},key:{regex:new RegExp("^(?:key)"),properties:"char charCode key keyCode".split(" "),process:function(e,t){null===e.which&&(e.which=null!==t.charCode?t.charCode:t.keyCode)}}};return e.base.extend({add:function(e,t){return e&&t&&a[e]&&(a[e]=t),this},get:function(e){return e&&a[e]?a[e]:null},process:function(e,t){var n,r,o;for(n in a)r=a[n],o=!r.regex||r.regex.test(t.type),o&&(r.properties&&u(e,t,r.properties),r.process&&r.process(e,t),r.delegate&&(e.delegate=r.delegate))}})}),function(e){var t=["../base","../support"];window.getComputedStyle||t.push("../polyfill/window/getcomputedstyle"),window.qoopido.registerSingleton("hook/css",e,t)}(function(e,t,n,r,o,i,s){"use strict";var u=e.support,a=o.getComputedStyle||e["polyfill/window/getcomputedstyle"],c={general:{get:function(e,t){return a(e,null).getPropertyValue(t[0])},set:function(e,t,n){e.style[t[1]]=n}},opacity:u.supportsCssProperty("opacity")?null:{regex:new RegExp("alpha\\(opacity=(.*)\\)","i"),get:function(e,t,n){return n=a(e,null).getPropertyValue("filter").toString().match(this.regex),n=n?n[1]/100:1},set:function(e,t,n){var r=e.style;r.zoom=1,r.filter="alpha(opacity="+(100*n+.5>>0)+")"}}};return e.base.extend({add:function(e,t){return e&&t&&c[e]&&(c[e]=t),this},get:function(e){return e&&c[e]?c[e]:null},process:function(e,t,n,r){var o;return n=u.getCssProperty(n,t)||null,n?((o=this.get(n[1]))&&o[e]||this.get("general")[e])(t,n,r):void 0}})}),function(e){window.qoopido.register("dom/event",e,["../base","../hook/event"])}(function(e,t,n,r,o,i,s){"use strict";var u=e["hook/event"];return e.base.extend({originalEvent:null,isDelegate:!1,isDefaultPrevented:!1,isPropagationStopped:!1,isImmediatePropagationStopped:!1,_properties:null,_constructor:function(e){var t=this;return t._properties=[],t._obtain(e),t},_obtain:function(e){u.process(this,e)},_dispose:function(){for(var e,t=this,n=0;(e=t._properties[n])!==s;n++)delete t[e];delete t.delegate,t.originalEvent=null,t.isDelegate=!1,t.isDefaultPrevented=!1,t.isPropagationStopped=!1,t.isImmediatePropagationStopped=!1,t._properties.length=0},preventDefault:function(){var e=this,t=e.originalEvent;t.cancelable!==!1&&(e.isDefaultPrevented=!0,t.preventDefault?t.preventDefault():t.returnValue=!1)},stopPropagation:function(){var e=this,t=e.originalEvent;e.isPropagationStopped=!0,t.stopPropagation&&t.stopPropagation(),t.cancelBubble=!0},stopImmediatePropagation:function(){var e=this,t=e.originalEvent;e.isImmediatePropagationStopped=!0,t.stopImmediatePropagation&&t.stopImmediatePropagation(),e.stopPropagation()}})}),function(e){var t=["../base","../function/unique/uuid","../hook/css","./event"];window.CustomEvent||t.push("../polyfill/window/customevent"),window.addEventListener||t.push("../polyfill/window/addeventlistener"),window.removeEventListener||t.push("../polyfill/window/removeeventlistener"),window.dispatchEvent||t.push("../polyfill/window/dispatchevent"),Element.prototype.matches||t.push("../polyfill/element/matches"),document.querySelector||t.push("../polyfill/document/queryselector"),document.querySelectorAll||t.push("../polyfill/document/queryselectorall"),String.prototype.trim||t.push("../polyfill/string/trim"),window.qoopido.register("dom/element",e,t)}(function(e,t,n,r,o,i,s){"use strict";function u(e){var t,n,r;for(t in _)n=_[t],(!n.regex||n.regex.test(e))&&(r=n);return r}function a(e,t,n){var r=this,o=u(e),s=i.createEvent(o.type);s[o.method](e,"load"===e?!1:!0,!0,t),n&&(s._quid=n,s.isDelegate=!0),r.element.dispatchEvent(s)}function c(e){var t;if("string"==typeof e)try{w.test(e)===!0?(t=e.replace(w,"$1").toLowerCase(),e=i.createElement(t)):e=i.querySelector(e)}catch(n){e=null}if(!e)throw new Error("[Qoopido.js] Element could not be resolved");return e}function l(e){return Array.prototype.concat.apply([],Array.prototype.splice.call(e,0)).join(" ").split(x)}function p(e,t){for(var n,r=0;(n=e.path[r])!==s;r++){if(n.matches(t))return e.currentTarget=n,!0;if(n===e.currentTarget)break}return!1}var f="object",d="string",m=e["function/unique/uuid"],g=i.getElementsByTagName("head")[0],h="textContent"in i.createElement("a")?"textContent":"innerText",y="undefined"!=typeof g.previousElementSibling?function(){return this.previousElementSibling}:function(){for(var e=this;e=e.previousSibling;)if(1===e.nodeType)return e},v="undefined"!=typeof g.nextElementSibling?function(){return this.nextElementSibling}:function(){for(var e=this;e=e.nextSibling;)if(1===e.nodeType)return e},w=new RegExp("^<(\\w+)\\s*/>$"),b=new RegExp("^[^-]+"),x=new RegExp(" +","g"),j=e["pool/module"]&&e["pool/module"].create(e["dom/event"],null,!0)||null,E=e["hook/css"],P={},_={custom:{type:"CustomEvent",method:"initCustomEvent"},html:{regex:new RegExp("^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$"),type:"HTMLEvents",method:"initEvent"},mouse:{regex:new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"),type:"MouseEvents",method:"initMouseEvent"}};return e.base.extend({type:null,element:null,_listener:null,_constructor:function(e,t,n){var r,o=this;return e=c(e),r=e._quid,r?o=P[r]:(r=e._quid=m(),o.type=e.tagName,o.element=e,o._listener={},P[r]=o),"object"==typeof t&&null!==t&&o.setAttributes(t),"object"==typeof n&&null!==n&&o.setStyles(n),o!==this&&this.dispose&&this.dispose(),o},_obtain:function(e,t,n){this._constructor(e,t,n)},_dispose:function(){var e,t,n=this;for(e in n._listener)t=e.match(b),n.element.removeEventListener(t,n._listener[e]),delete n._listener[e];n.type=null,n.element=null},getContent:function(e){var t=this.element;return e&&e!==!1?t.innerHTML:t[h]},setContent:function(e,t){var n=this,r=n.element;return t&&t!==!1?r.innerHTML=e:r[h]=e,n},getAttribute:function(e){var t=this;return e&&typeof e===d?t.element.getAttribute(e):void 0},getAttributes:function(){for(var e,t=this,n={},r=l(arguments),o=0;(e=r[o])!==s;o++)n[e]=t.element.getAttribute(e);return n},setAttribute:function(e,t){var n=this;return e&&typeof e===d&&n.element.setAttribute(e,t),n},setAttributes:function(e){var t,n=this;if(e&&typeof e===f&&!e.length)for(t in e)n.element.setAttribute(t,e[t]);return n},removeAttribute:function(e){var t=this;return e&&typeof e===d&&t.element.removeAttribute(e),t},removeAttributes:function(){for(var e,t=this,n=l(arguments),r=0;(e=n[r])!==s;r++)t.element.removeAttribute(e);return t},getStyle:function(e){var t=this;return e&&typeof e===d?E.process("get",t.element,e):void 0},getStyles:function(){for(var e,t=this,n={},r=l(arguments),o=0;(e=r[o])!==s;o++)n[e]=E.process("get",t.element,e);return n},setStyle:function(e,t){var n=this;return e&&typeof e===d&&E.process("set",n.element,e,t),n},setStyles:function(e){var t,n=this;if(e&&typeof e===f&&!e.length)for(t in e)E.process("set",n.element,t,e[t]);return n},removeStyle:function(e){var t=this;return e&&typeof e===d&&t.setStyle(e,""),t},removeStyles:function(){for(var e,t=this,n=l(arguments),r=0;(e=n[r])!==s;r++)t.setStyle(e,"");return t},siblings:function(e){for(var t=this.element,n=t.parentNode.firstChild,r=[];n;n=v.call(n))n===t||e&&!n.matches(e)||r.push(n);return r},siblingsBefore:function(e){for(var t=this.element.previousSibling,n=[];t;t=y.call(t))(!e||t.matches(e))&&n.push(t);return n},siblingsAfter:function(e){for(var t=this.element.nextSibling,n=[];t;t=v.call(t))(!e||t.matches(e))&&n.push(t);return n},previous:function(e){var t=y.call(this.element);if(!e)return t;for(;t;t=y.call(t))if(t.matches(e))return t},next:function(e){var t=v.call(this.element);if(!e)return t;for(;t;t=v.call(t))if(t.matches(e))return t},find:function(e){var t,n,r=this.element;return e=e.trim(),">"===e.charAt(0)?(t=r._quid,r.setAttribute("data-quid",t),e='[data-quid="'+t+'"] '+e,n=r.parentNode.querySelectorAll(e),r.removeAttribute("data-quid")):n=r.querySelectorAll(e),n},parent:function(e){var t;if(!e)return this.element.parentNode;for(t=this.element;t;t=t.parentNode)if(t.matches(e))return t},parents:function(e){for(var t=this.element.parentNode,n=[];t;t=t.parentNode){if(9===t.nodeType)return n;1===t.nodeType&&(!e||t.matches(e))&&n.push(t)}},isVisible:function(){var e=this,t=e.element;return!(t.offsetWidth<=0&&t.offsetHeight<=0||"hidden"===e.getStyle("visibility")||e.getStyle("opacity")<=0)},hasClass:function(e){return e?new RegExp("(?:^|\\s)"+e+"(?:\\s|$)").test(this.element.className):!1},addClass:function(e){var t=this;return e&&!t.hasClass(e)&&(t.element.className+=t.element.className?" "+e:e),t},removeClass:function(e){var t=this;return e&&t.hasClass(e)&&(t.element.className=t.element.className.replace(new RegExp("(?:^|\\s)"+e+"(?!\\S)"),"")),t},toggleClass:function(e){var t=this;return e&&(t.hasClass(e)?t.removeClass(e):t.addClass(e)),t},prepend:function(e){var t=this,n=t.element;if(e)try{e=e.element||c(e),n.firstChild?n.insertBefore(e,n.firstChild):t.append(e)}catch(r){n.insertAdjacentHTML("afterBegin",e)}return t},append:function(e){var t=this,n=t.element;if(e)try{n.appendChild(e.element||c(e))}catch(r){n.insertAdjacentHTML("beforeEnd",e)}return t},prependTo:function(e){var t=this,n=t.element;return e&&((e=e.element||c(e)).firstChild?e.insertBefore(n,e.firstChild):t.appendTo(e)),t},appendTo:function(e){var t=this;return e&&(e.element||c(e)).appendChild(t.element),t},insertBefore:function(e){var t=this,n=t.element;return e&&(e=e.element||c(e)).parentNode.insertBefore(n,e),t},insertAfter:function(e){var t=this,n=t.element;return e&&((e=e.element||c(e)).nextSibling?e.parentNode.insertBefore(n,e.nextSibling):t.appendTo(e.parentNode)),t},replace:function(e){var t=this,n=t.element;return e&&(e=e.element||c(e)).parentNode.replaceChild(n,e),t},replaceWith:function(e){var t=this,n=t.element;return e&&(e=e.element||c(e),n.parentNode.replaceChild(e,n)),t},remove:function(){var e=this,t=e.element;return t.parentNode.removeChild(t),e},on:function(t){var n,r=this,o=r.element,i=arguments.length>2?arguments[1]:null,u=arguments.length>2?arguments[2]:arguments[1],c=u._quid||(u._quid=m()),l=0;for(t=t.split(" ");(n=t[l])!==s;l++){var f=n+"-"+c,d=function(t){var n;t=j&&j.obtain(t)||e["dom/event"].create(t),t.isPropagationStopped||(n=t.delegate,t._quid=m(),(!i||p(t,i))&&u.call(t.currentTarget,t,t.originalEvent.detail),n&&(delete t.delegate,a.call(r,n))),t.dispose&&t.dispose()};d.type=n,r._listener[f]=d,o.addEventListener(n,d)}return r},one:function(e){var t=this,n=arguments.length>3||"string"==typeof arguments[1]?arguments[1]:null,r=arguments.length>3||"function"==typeof arguments[2]?arguments[2]:arguments[1],o=(arguments.length>3?arguments[3]:arguments[2])!==!1,i=function(n){t.off(o===!0?n.type:e,i),r.call(this,n,n.originalEvent.detail)};return r._quid=i._quid=m(),n?t.on(e,n,i):t.on(e,i),t},off:function(e,t){var n,r,o,i=this,u=i.element,a=0;for(e=e.split(" ");(n=e[a])!==s;a++)r=t._quid&&n+"-"+t._quid||null,o=r&&i._listener[r]||null,o?(u.removeEventListener(n,o),delete i._listener[r]):u.removeEventListener(n,t);return i},emit:function(e,t){var n=this;return a.call(n,e,t),n}})}),function(e){window.qoopido.registerSingleton("url",e,["./base"])}(function(e,t,n,r,o,i,s){"use strict";function u(e){var t=i.createElement("a");return t.href=e||"",t}var a,c,l=new RegExp("[?&]?([^=]+)=([^&]*)","g");try{a=location}catch(p){a=u()}return c=new RegExp("".concat("^",a.protocol,"//",a.hostname),"i"),e.base.extend({resolve:function(e){return u(e).href},redirect:function(e,t){t=t||o,t.location.href=this.resolve(e)},getParameter:function(e){for(var t,n={},r=u(e).search.split("+").join(" ");t=l.exec(r);)n[decodeURIComponent(t[1])]=decodeURIComponent(t[2]);return n},isLocal:function(e){return c.test(this.resolve(e))}})}),function(e){window.qoopido.register("transport",e,["./base","./function/merge"])}(function(e,t,n,r,o,i,s){"use strict";var u;return u=e.base.extend({setup:function(t){var n=this;return n._settings=e["function/merge"]({},n._settings,t),n},serialize:function(e,t){var n,r,o,i=[];for(n in e)r=t?"".concat(t,"[",n,"]"):n,o=e[n],i.push("object"==typeof o?this.serialize(o,r):"".concat(encodeURIComponent(r),"=",encodeURIComponent(o)));return i.join("&")}})},window,document),function(e){window.qoopido.registerSingleton("transport/xhr",e,["../transport","../function/merge","../function/unique/string","../url","../promise/defer"])}(function(e,t,n,r,o,i,s){"use strict";function u(e,t,n){var r,o=this,i=o.xhr,s=o.settings;t=s.cache===!1?"".concat(t,t.indexOf("?")>-1?"&":"?","_="+(new Date).getTime()):t,t=n&&"GET"===e?"".concat(t,t.indexOf("?")>-1?"&":"?",n):t;for(r in s.xhrOptions)i[r]=s.xhrOptions[r];if(i.open(e,t,s.async,s.username,s.password),i.setRequestHeader){i.setRequestHeader("Accept",s.accept),n&&"GET"!==e&&i.setRequestHeader("Content-Type",s.contentType);for(r in s.header)i.setRequestHeader(r,s.header[r])}i.timeout=s.timeout,i.onprogress=function(e){a.call(o,e)},i.onreadystatechange=i.onload=function(){c.call(o)},i.onerror=function(){l.call(o)},i.send(n||null),o.timeout=setTimeout(function(){p.call(o)},s.timeout)}function a(e){var t=this;t.timeout&&clearTimeout(t.timeout),t.timeout=setTimeout(function(){p.call(t)},t.settings.timeout)}function c(){var e=this,t=e.xhr,n=e.dfd;(t.readyState===s||4===t.readyState)&&(f.call(e),t.status===s||200===t.status?n.resolve({data:t.responseText,xhr:t}):n.reject({status:t.status,xhr:t}))}function l(){var e=this;f.call(e),e.dfd.reject()}function p(){var e=this;e.xhr.abort(),f.call(e),e.dfd.reject()}function f(){var e=this,t=e.xhr;e.timeout&&clearTimeout(e.timeout),t.onprogress=t.onreadystatechange=t.onerror=null}var d,m=e["promise/defer"],g="undefined"!=typeof o.XMLHttpRequest?function(t){return e.url.isLocal(t)?new o.XMLHttpRequest:o.XDomainRequest?new o.XDomainRequest:new o.XMLHttpRequest}:function(){try{return new ActiveXObject("MSXML2.XMLHTTP.3.0")}catch(e){return null}};return d=e.transport.extend({_settings:{accept:"*/*",timeout:5e3,async:!0,cache:!1,header:{},username:null,password:null,contentType:"application/x-www-form-urlencoded; charset=UTF-8 ",xhrOptions:{}},load:function(t,n,r,o){var i={};return n=e.url.resolve(n),i.url=n,i.id="".concat("xhr-",e["function/unique/string"]()),i.dfd=new m,i.xhr=g(n),i.settings=e["function/merge"]({},this._settings,o),i.timeout=null,u.call(i,t.toUpperCase(),n,r),i.dfd.promise},get:function(e,t,n){return this.load("GET",e,t,n)},post:function(e,t,n){return this.load("POST",e,t,n)},put:function(e,t,n){return this.load("PUT",e,t,n)},"delete":function(e,t,n){return this.load("DELETE",e,t,n)},head:function(e,t,n){return this.load("HEAD",e,t,n)}})},window,document),function(e){var t=["../element","../../proxy","../../function/merge","../../url","../../support","../../support/capability/datauri","../../support/element/canvas/todataurl/png","../../transport/xhr"];window.qoopido.register("dom/element/shrinkimage",e,t)}(function(e,t,n,r,o,i,s){"use strict";function u(t,n){t=e.url.resolve(b.exec(t)[1]),n=n===!0;var r=this,o=e["function/merge"]({},r._settings,e.url.getParameter(t)),i=o.target||(t=t.split("?")[0]).replace(x,"".concat(".q",o.quality,".shrunk"));n||r.removeAttribute(r._settings.attribute).hide(),j.then(function(){if(o.debug===!0)throw new Error("[Qoopido.js] Debug enabled");switch(typeof v[i]){case"object":v[i].one(_,function(e){a.call(r,e.data,n)}),r.emit(E);break;case"string":a.call(r,v[i],n);break;default:v[i]=d.create(i,n?null:r.element).one(q,function(e,o){e.type===_?(v[i]=o,r.emit(P),a.call(r,o,n)):(v[i]=t,a.call(r,t,n))},!1)}})["catch"](function(){v[i]=t,a.call(r,t,n)})}function a(e,t){ +var n=this;t?(n.setStyle("backgroundImage","url("+e+")"),n.emit(_)):n.one(S,function(){n.show(),n.emit(_)}).setAttribute("src",e)}function c(e){var t=this;e.get(t._url).then(function(e){try{var n=m.parse(e.data);n.width=parseInt(n.width,10),n.height=parseInt(n.height,10),l.call(t,n)}catch(r){t.emit(O)}},function(){t.emit(O)})}function l(e){var t,n,r=this,o=function(o){return t=y&&y.obtain("canvas")||i.createElement("canvas"),t.style.display="none",t.width=e.width,t.height=e.height,n=t.getContext("2d"),n.clearRect(0,0,e.width,e.height),n.drawImage(r.element,0,0,e.width,e.height),r.one(S,s).setAttribute("src",e.alpha),p(o)},s=function(o){var i;return n.globalCompositeOperation="xor",n.drawImage(r.element,0,0,e.width,e.height),i=t.toDataURL("image/png"),u(),r.emit(_,i),p(o)},u=function(){t&&t.dispose&&t.dispose(),r.element.dispose&&r.element.dispose()};r.one(C,function(e){e.type===S?o.call(this,e):(u(),r.emit(O))},!1).setAttribute("src",e.main)}function p(e){return e.preventDefault(),e.stopPropagation(),!1}var f,d,m=o.JSON,g=n.pop(),h={attribute:"data-"+g,quality:80,debug:!1},y=t.pool&&t.pool.dom||null,v={},w=new RegExp('^url\\x28"{0,1}data:image/shrink,(.+?)"{0,1}\\x29$',"i"),b=new RegExp('^(?:url\\x28"{0,1}|)(?:data:image/shrink,|)(.+?)(?:"{0,1}\\x29|)$',"i"),x=new RegExp("\\.png$","i"),j=e.support.testMultiple("/capability/datauri","/element/canvas/todataurl/png"),E="queued",P="cached",_="loaded",O="failed",q="".concat(_," ",O),S="load",A="error",C="".concat(S," ",A);return f=e["dom/element"].extend({_constructor:function(t,n){var r,o,i=f._parent._constructor.call(this,t);return i._settings=n=e["function/merge"]({},h,n),r=i.getAttribute(n.attribute),o=i.getStyle("backgroundImage"),"IMG"===i.type&&u.call(i,r),"none"!==o&&w.test(o)&&u.call(i,o,!0),i},hide:function(){this.setStyles({visibility:"hidden",opacity:0})},show:function(){this.setStyles({visibility:"",opacity:""})}}),d=e["dom/element"].extend({_url:null,_constructor:function(t,n){var r;return n||(n=y&&y.obtain("img")||i.createElement("img")),r=d._parent._constructor.call(this,n),r._url=t,c.call(r,e["transport/xhr"]),r}}),f},window); \ No newline at end of file diff --git a/dist/3.7.2/min/particle.js b/dist/3.7.3/min/particle.js similarity index 94% rename from dist/3.7.2/min/particle.js rename to dist/3.7.3/min/particle.js index 1f452cae..21433ff3 100644 --- a/dist/3.7.2/min/particle.js +++ b/dist/3.7.3/min/particle.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){window.qoopido.register("particle",t,["./emitter","./pool/module","./vector/2d"])}(function(t,i,o,e,s,c,n){"use strict";var l,a=t["pool/module"].create(t["vector/2d"],null,!0);return l=t.emitter.extend({_velocity:null,_acceleration:null,position:null,velocity:null,acceleration:null,_constructor:function(t,i){var o=l._parent._constructor.call(this);return this._velocity=a.obtain(0,0),this._acceleration=a.obtain(0,0),this.position=a.obtain(t,i),this.velocity=a.obtain(0,0),this.acceleration=[],o},_obtain:function(t,i){this.position.x=t||0,this.position.y=i||0,this.velocity.x=0,this.velocity.y=0,this.acceleration.length=0},_destroy:function(){this._velocity=this._velocity.dispose(),this._acceleration=this._acceleration.dispose(),this.position=this.position.dispose(),this.velocity=this.velocity.dispose()},update:function(t){t="undefined"!=typeof t?parseFloat(t):1;for(var i,o=0;(i=this.acceleration[o])!==n;o++)this.velocity.add(i);this._velocity.x=this.velocity.x*t,this._velocity.y=this.velocity.y*t,this.position.add(this._velocity)}})}); \ No newline at end of file diff --git a/dist/3.7.2/min/polyfill/array/indexof.js b/dist/3.7.3/min/polyfill/array/indexof.js similarity index 82% rename from dist/3.7.2/min/polyfill/array/indexof.js rename to dist/3.7.3/min/polyfill/array/indexof.js index 40231f06..191fe7f8 100644 --- a/dist/3.7.2/min/polyfill/array/indexof.js +++ b/dist/3.7.3/min/polyfill/array/indexof.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(r){window.qoopido.register("polyfill/array/indexof",r)}(function(r,o,t,i,n,e,f){"use strict";return Array.prototype.indexOf||(Array.prototype.indexOf=function(r){for(var o=this,t=0;o[t]!==f;++t)if(o[t]===r)return t;return-1}),Array.prototype.indexOf}); \ No newline at end of file diff --git a/dist/3.7.2/min/polyfill/document/getelementsbyclassname.js b/dist/3.7.3/min/polyfill/document/getelementsbyclassname.js similarity index 86% rename from dist/3.7.2/min/polyfill/document/getelementsbyclassname.js rename to dist/3.7.3/min/polyfill/document/getelementsbyclassname.js index b7011332..3f36d003 100644 --- a/dist/3.7.2/min/polyfill/document/getelementsbyclassname.js +++ b/dist/3.7.3/min/polyfill/document/getelementsbyclassname.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){var t=[];Object.defineProperty||t.push("./queryselectorall"),window.qoopido.register("polyfill/document/getelementsbyclassname",e,t)}(function(e,t,l,n,s,r,a){"use strict";if(!r.getElementsByClassName){var o=new RegExp("^|\\s+","g");r.getElementsByClassName=function(e){return e=String(e).replace(o,"."),r.querySelectorAll(e)}}return r.getElementsByClassName}); \ No newline at end of file diff --git a/dist/3.7.2/min/polyfill/document/queryselector.js b/dist/3.7.3/min/polyfill/document/queryselector.js similarity index 84% rename from dist/3.7.2/min/polyfill/document/queryselector.js rename to dist/3.7.3/min/polyfill/document/queryselector.js index c31f26ce..53c2e3cf 100644 --- a/dist/3.7.2/min/polyfill/document/queryselector.js +++ b/dist/3.7.3/min/polyfill/document/queryselector.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){var r=[];document.querySelectorAll||r.push("./queryselectorall"),window.qoopido.register("polyfill/document/queryselector",e,r)}(function(e,r,l,t,o,u,c){"use strict";return u.querySelector||(u.querySelector=function(e){var r=u.querySelectorAll(e);return r.length?r[0]:null}),u.querySelector}); \ No newline at end of file diff --git a/dist/3.7.2/min/polyfill/document/queryselectorall.js b/dist/3.7.3/min/polyfill/document/queryselectorall.js similarity index 90% rename from dist/3.7.2/min/polyfill/document/queryselectorall.js rename to dist/3.7.3/min/polyfill/document/queryselectorall.js index fe844f33..b41c2782 100644 --- a/dist/3.7.2/min/polyfill/document/queryselectorall.js +++ b/dist/3.7.3/min/polyfill/document/queryselectorall.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("polyfill/document/queryselectorall",e)}(function(e,t,r,s,l,o,n){"use strict";return o.querySelectorAll||(o.querySelectorAll=function(e){var t,r=l.document.getElementsByTagName("script")[0],s=o.createElement("style"),n=[];for(r.parentNode.insertBefore(s,r),o._qsa=[],s.styleSheet.cssText=e+"{x-qsa:expression(document._qsa && document._qsa.push(this))}",l.scrollBy(0,0),s.parentNode.removeChild(s);o._qsa.length;)t=o._qsa.shift(),t.style.removeAttribute("x-qsa"),n.push(t);try{delete o._qsa}catch(c){o._qsa=null}return n}),o.querySelectorAll}); \ No newline at end of file diff --git a/dist/3.7.2/min/polyfill/element/matches.js b/dist/3.7.3/min/polyfill/element/matches.js similarity index 89% rename from dist/3.7.2/min/polyfill/element/matches.js rename to dist/3.7.3/min/polyfill/element/matches.js index 700a87c9..31adf581 100644 --- a/dist/3.7.2/min/polyfill/element/matches.js +++ b/dist/3.7.3/min/polyfill/element/matches.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){var t=[];document.querySelectorAll||t.push("../document/queryselectorall"),window.qoopido.register("polyfill/element/matches",e,t)}(function(e,t,r,o,c,l,n){"use strict";if(!Element.prototype.matches){var s=Element.prototype;s.matches=s.matchesSelector=s.matchesSelector||s.webkitMatchesSelector||s.mozMatchesSelector||s.msMatchesSelector||s.oMatchesSelector||function(e){for(var t,r=this.parentElement.querySelectorAll(e),o=0;t=r[o++];)if(t===this)return!0;return!1}}return Element.prototype.matches}); \ No newline at end of file diff --git a/dist/3.7.2/min/polyfill/object/create.js b/dist/3.7.3/min/polyfill/object/create.js similarity index 90% rename from dist/3.7.2/min/polyfill/object/create.js rename to dist/3.7.3/min/polyfill/object/create.js index 7c24a73b..89006187 100644 --- a/dist/3.7.2/min/polyfill/object/create.js +++ b/dist/3.7.3/min/polyfill/object/create.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e,t){if(t.register){var r=[];Object.defineProperties||r.push("./defineproperties"),t.register("polyfill/object/create",e,r)}else(t.modules=t.modules||{})["polyfill/object/create"]=e()}(function(e,t,r,o,i,c,n){"use strict";return Object.create||(Object.create=function(e,t){function r(){}if("object"!=typeof e)throw new TypeError;r.prototype=e;var o=new r;if(e&&(o.constructor=r),arguments.length>1){if(t!==Object(t))throw new TypeError;Object.defineProperties(o,t)}return o}),Object.create},window.qoopido=window.qoopido||{}); \ No newline at end of file diff --git a/dist/3.7.2/min/polyfill/object/defineproperties.js b/dist/3.7.3/min/polyfill/object/defineproperties.js similarity index 91% rename from dist/3.7.2/min/polyfill/object/defineproperties.js rename to dist/3.7.3/min/polyfill/object/defineproperties.js index 93c41332..bf41736e 100644 --- a/dist/3.7.2/min/polyfill/object/defineproperties.js +++ b/dist/3.7.3/min/polyfill/object/defineproperties.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e,r){if(r.register){var t=[];Object.defineProperty&&function(){try{return Object.defineProperty({},"x",{}),!0}catch(e){return!1}}()||t.push("./defineproperty"),r.register("polyfill/object/defineproperties",e,t)}else(r.modules=r.modules||{})["polyfill/object/defineproperties"]=e()}(function(e,r,t,o,i,n,p){"use strict";return Object.defineProperties||(Object.defineProperties=function(e,r){if(e!==Object(e))throw new TypeError("Object.defineProperties called on non-object");var t;for(t in r)Object.prototype.hasOwnProperty.call(r,t)&&Object.defineProperty(e,t,r[t]);return e}),Object.defineProperties},window.qoopido=window.qoopido||{}); \ No newline at end of file diff --git a/dist/3.7.2/min/polyfill/object/defineproperty.js b/dist/3.7.3/min/polyfill/object/defineproperty.js similarity index 92% rename from dist/3.7.2/min/polyfill/object/defineproperty.js rename to dist/3.7.3/min/polyfill/object/defineproperty.js index f09b0fc3..b269afac 100644 --- a/dist/3.7.2/min/polyfill/object/defineproperty.js +++ b/dist/3.7.3/min/polyfill/object/defineproperty.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e,t){t.register?t.register("polyfill/object/defineproperty",e):(t.modules=t.modules||{})["polyfill/object/defineproperty"]=e()}(function(e,t,r,o,n,i,c){"use strict";if(!Object.defineProperty||!function(){try{return Object.defineProperty({},"x",{}),!0}catch(e){return!1}}()){var f=Object.defineProperty,p=Object.prototype.__defineGetter__,d=Object.prototype.__defineSetter__;Object.defineProperty=function(e,t,r){if(f)try{return f(e,t,r)}catch(o){}if(e!==Object(e))throw new TypeError("Object.defineProperty called on non-object");return p&&"get"in r&&p.call(e,t,r.get),d&&"set"in r&&d.call(e,t,r.set),"value"in r&&(e[t]=r.value),e}}return Object.defineProperty},window.qoopido=window.qoopido||{}); \ No newline at end of file diff --git a/dist/3.7.2/min/polyfill/object/getownpropertydescriptor.js b/dist/3.7.3/min/polyfill/object/getownpropertydescriptor.js similarity index 91% rename from dist/3.7.2/min/polyfill/object/getownpropertydescriptor.js rename to dist/3.7.3/min/polyfill/object/getownpropertydescriptor.js index 3bb2e16e..6307bb9f 100644 --- a/dist/3.7.2/min/polyfill/object/getownpropertydescriptor.js +++ b/dist/3.7.3/min/polyfill/object/getownpropertydescriptor.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(r,e){e.register?e.register("polyfill/object/getownpropertydescriptor",r):(e.modules=e.modules||{})["polyfill/object/getownpropertydescriptor"]=r()}(function(r,e,t,o,c,n,i){"use strict";if(!Object.getOwnPropertyDescriptor||!function(){try{return Object.getOwnPropertyDescriptor({x:0},"x"),!0}catch(r){return!1}}()){var p=Object.getOwnPropertyDescriptor;Object.getOwnPropertyDescriptor=function(r,e){if(r!==Object(r))throw new TypeError;try{return p.call(Object,r,e)}catch(t){}return Object.prototype.hasOwnProperty.call(r,e)?{value:r[e],enumerable:!0,writable:!0,configurable:!0}:void 0}}return Object.getOwnPropertyDescriptor},window.qoopido=window.qoopido||{}); \ No newline at end of file diff --git a/dist/3.7.2/min/polyfill/object/getownpropertynames.js b/dist/3.7.3/min/polyfill/object/getownpropertynames.js similarity index 89% rename from dist/3.7.2/min/polyfill/object/getownpropertynames.js rename to dist/3.7.3/min/polyfill/object/getownpropertynames.js index 181a55f9..f0674891 100644 --- a/dist/3.7.2/min/polyfill/object/getownpropertynames.js +++ b/dist/3.7.3/min/polyfill/object/getownpropertynames.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e,o){o.register?o.register("polyfill/object/getownpropertynames",e):(o.modules=o.modules||{})["polyfill/object/getownpropertynames"]=e()}(function(e,o,t,r,n,p,c){"use strict";return Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(e){if(e!==Object(e))throw new TypeError("Object.getOwnPropertyNames called on non-object");var o,t=[];for(o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.push(o);return t}),Object.getOwnPropertyNames},window.qoopido=window.qoopido||{}); \ No newline at end of file diff --git a/dist/3.7.2/min/polyfill/object/getprototypeof.js b/dist/3.7.3/min/polyfill/object/getprototypeof.js similarity index 88% rename from dist/3.7.2/min/polyfill/object/getprototypeof.js rename to dist/3.7.3/min/polyfill/object/getprototypeof.js index d8077c43..7b2eebb2 100644 --- a/dist/3.7.2/min/polyfill/object/getprototypeof.js +++ b/dist/3.7.3/min/polyfill/object/getprototypeof.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(o,t){t.register?t.register("polyfill/object/getprototypeof",o):(t.modules=t.modules||{})["polyfill/object/getprototypeof"]=o()}(function(o,t,e,r,p,n,c){"use strict";return Object.getPrototypeOf||(Object.getPrototypeOf={}.__proto__===Object.prototype&&[].__proto__===Array.prototype?function(o){return o.__proto__}:function(o){return o.constructor?o.constructor.prototype:null}),Object.getPrototypeOf},window.qoopido=window.qoopido||{}); \ No newline at end of file diff --git a/dist/3.7.2/min/polyfill/object/keys.js b/dist/3.7.3/min/polyfill/object/keys.js similarity index 84% rename from dist/3.7.2/min/polyfill/object/keys.js rename to dist/3.7.3/min/polyfill/object/keys.js index b61ba9ed..98391c67 100644 --- a/dist/3.7.2/min/polyfill/object/keys.js +++ b/dist/3.7.3/min/polyfill/object/keys.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("polyfill/object/keys",e)}(function(e,t,o,r,n,c,i){"use strict";return Object.keys||(Object.keys=function(e){if(e!==Object(e))throw new TypeError("Object.keys called on non-object");var t,o=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&o.push(t);return o}),Object.keys}); \ No newline at end of file diff --git a/dist/3.7.2/min/polyfill/string/lcfirst.js b/dist/3.7.3/min/polyfill/string/lcfirst.js similarity index 82% rename from dist/3.7.2/min/polyfill/string/lcfirst.js rename to dist/3.7.3/min/polyfill/string/lcfirst.js index 5b9ca786..ad9b1c7c 100644 --- a/dist/3.7.2/min/polyfill/string/lcfirst.js +++ b/dist/3.7.3/min/polyfill/string/lcfirst.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){window.qoopido.register("polyfill/string/lcfirst",t)}(function(t,r,i,o,n,e,s){"use strict";return String.prototype.lcfirst||(String.prototype.lcfirst=function(){var t=this;return t.charAt(0).toLowerCase()+t.slice(1)}),String.prototype.lcfirst}); \ No newline at end of file diff --git a/dist/3.7.2/min/polyfill/string/trim.js b/dist/3.7.3/min/polyfill/string/trim.js similarity index 83% rename from dist/3.7.2/min/polyfill/string/trim.js rename to dist/3.7.3/min/polyfill/string/trim.js index 04f7e5b7..29e638b9 100644 --- a/dist/3.7.2/min/polyfill/string/trim.js +++ b/dist/3.7.3/min/polyfill/string/trim.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){window.qoopido.register("polyfill/string/trim",t)}(function(t,r,i,n,o,e,p){"use strict";if(!String.prototype.trim){var u=new RegExp("^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$","g");String.prototype.trim=function(){return this.replace(u,"")}}return String.prototype.trim}); \ No newline at end of file diff --git a/dist/3.7.2/min/polyfill/string/ucfirst.js b/dist/3.7.3/min/polyfill/string/ucfirst.js similarity index 82% rename from dist/3.7.2/min/polyfill/string/ucfirst.js rename to dist/3.7.3/min/polyfill/string/ucfirst.js index 1e52367b..3bece5f2 100644 --- a/dist/3.7.2/min/polyfill/string/ucfirst.js +++ b/dist/3.7.3/min/polyfill/string/ucfirst.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){window.qoopido.register("polyfill/string/ucfirst",t)}(function(t,r,i,o,n,e,s){"use strict";return String.prototype.ucfirst||(String.prototype.ucfirst=function(){var t=this;return t.charAt(0).toUpperCase()+t.slice(1)}),String.prototype.ucfirst}); \ No newline at end of file diff --git a/dist/3.7.2/min/polyfill/window/addeventlistener.js b/dist/3.7.3/min/polyfill/window/addeventlistener.js similarity index 94% rename from dist/3.7.2/min/polyfill/window/addeventlistener.js rename to dist/3.7.3/min/polyfill/window/addeventlistener.js index 3b0dba71..26e18e53 100644 --- a/dist/3.7.2/min/polyfill/window/addeventlistener.js +++ b/dist/3.7.3/min/polyfill/window/addeventlistener.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){var t=[];Array.prototype.indexOf||t.push("../array/indexof"),window.qoopido.register("polyfill/window/addeventlistener",e,t)}(function(e,t,n,a,r,o,i){"use strict";return r.addEventListener||(r.addEventListener=Window.prototype.addEventListener=HTMLDocument.prototype.addEventListener=Element.prototype.addEventListener=function(e,t){var n=this;n._events||(n._events={}),n._events[e]||(n._events[e]=function(e){var t,a=n._events[e.type].list,r=Array.prototype.concat.call([],a),l=0;for(e.preventDefault=function(){e.cancelable!==!1&&(e.returnValue=!1)},e.stopPropagation=function(){e.cancelBubble=!0},e.stopImmediatePropagation=function(){e.cancelBubble=!0,e.cancelImmediate=!0},e.currentTarget=n,e.relatedTarget=e.fromElement||null,e.target=e.srcElement||n,e.timeStamp=(new Date).getTime(),e.clientX&&(e.pageX=e.clientX+o.documentElement.scrollLeft,e.pageY=e.clientY+o.documentElement.scrollTop);(t=r[l])!==i&&!e.cancelImmediate;++l)a.indexOf(t)>-1&&t.call(n,e)},n._events[e].list=[],n.attachEvent&&n.attachEvent("on"+e,n._events[e])),n._events[e].list.push(t)}),r.addEventListener}); \ No newline at end of file diff --git a/dist/3.7.2/min/polyfill/window/customevent.js b/dist/3.7.3/min/polyfill/window/customevent.js similarity index 91% rename from dist/3.7.2/min/polyfill/window/customevent.js rename to dist/3.7.3/min/polyfill/window/customevent.js index 22dcf61a..23e1d007 100644 --- a/dist/3.7.2/min/polyfill/window/customevent.js +++ b/dist/3.7.3/min/polyfill/window/customevent.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("polyfill/window/customevent",e)}(function(e,t,n,o,r,u,b){"use strict";if(!r.CustomEvent){var c=u.createEvent?function(e,t,n){var o=u.createEvent("Event"),r=t&&t.bubbles!==b?t.bubbles:!1,c=t&&t.cancelable!==b?t.cancelable:!0;return o.initEvent(e,r,c),o.detail=n,o}:function(e,t,n){var o=u.createEventObject();return o.type=e,o.bubbles=t&&t.bubbles!==b?t.bubbles:!1,o.cancelable=t&&t.cancelable!==b?t.cancelable:!0,o.detail=n,o};r.CustomEvent=Window.prototype.CustomEvent=function(e,t,n){if(!e)throw new Error("Not enough arguments");return c(e,t,n)}}return r.CustomEvent}); \ No newline at end of file diff --git a/dist/3.7.2/min/polyfill/window/dispatchevent.js b/dist/3.7.3/min/polyfill/window/dispatchevent.js similarity index 92% rename from dist/3.7.2/min/polyfill/window/dispatchevent.js rename to dist/3.7.3/min/polyfill/window/dispatchevent.js index d9a56589..4986605d 100644 --- a/dist/3.7.2/min/polyfill/window/dispatchevent.js +++ b/dist/3.7.3/min/polyfill/window/dispatchevent.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){window.qoopido.register("polyfill/window/dispatchevent",t)}(function(t,e,n,o,r,i,c){"use strict";return r.dispatchEvent||(r.dispatchEvent=Window.prototype.dispatchEvent=HTMLDocument.prototype.dispatchEvent=Element.prototype.dispatchEvent=function(t){if(!arguments.length)throw new Error("Not enough arguments");if(!t||"string"!=typeof t.type)throw new Error("DOM Events Exception 0");var e=this,n=t.type;try{if(!t.bubbles){t.cancelBubble=!0;var o=function(t){t.cancelBubble=!0,(e||r).detachEvent("on"+n,o)};this.attachEvent("on"+n,o)}this.fireEvent("on"+n,t)}catch(i){t.target=e;do t.currentTarget=e,e._events&&e._events[n]&&e._events[n].call(e,t),e["on"+n]&&e["on"+n].call(e,t),e=9===e.nodeType?e.parentWindow:e.parentNode;while(e&&!t.cancelBubble)}return!0}),r.dispatchEvent}); \ No newline at end of file diff --git a/dist/3.7.2/min/polyfill/window/getcomputedstyle.js b/dist/3.7.3/min/polyfill/window/getcomputedstyle.js similarity index 87% rename from dist/3.7.2/min/polyfill/window/getcomputedstyle.js rename to dist/3.7.3/min/polyfill/window/getcomputedstyle.js index eb324059..2a185d55 100644 --- a/dist/3.7.2/min/polyfill/window/getcomputedstyle.js +++ b/dist/3.7.3/min/polyfill/window/getcomputedstyle.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){window.qoopido.register("polyfill/window/getcomputedstyle",t)}(function(t,e,r,n,o,u,l){"use strict";if(o.getComputedStyle)return o.getComputedStyle;var i=new RegExp("(\\-([a-z]){1})","g"),p=function(){return arguments[2].toUpperCase()};return function(t,e){var r=this;return r.getPropertyValue=function(e){return"float"===e&&(e="styleFloat"),i.test(e)&&(e=e.replace(i,p)),t.currentStyle[e]||null},r}}); \ No newline at end of file diff --git a/dist/3.7.2/min/polyfill/window/matchmedia.js b/dist/3.7.3/min/polyfill/window/matchmedia.js similarity index 97% rename from dist/3.7.2/min/polyfill/window/matchmedia.js rename to dist/3.7.3/min/polyfill/window/matchmedia.js index 49b5ca60..4214e1e6 100644 --- a/dist/3.7.2/min/polyfill/window/matchmedia.js +++ b/dist/3.7.3/min/polyfill/window/matchmedia.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){var t=[];window.getComputedStyle||t.push("polyfill/window/getcomputedstyle"),Array.prototype.indexOf||t.push("../array/indexof"),window.qoopido.register("polyfill/window/matchmedia",e,t)}(function(e,t,i,n,r,o,a){"use strict";function l(){var e=r.innerWidth||f.clientWidth,t=r.innerHeight||f.clientHeight,i=r.screen.width,n=r.screen.height,o=r.screen.colorDepth,a=r.devicePixelRatio;y.width=e,y.height=t,y["aspect-ratio"]=(e/t).toFixed(2),y.color=o,y["color-index"]=Math.pow(2,o),y["device-aspect-ratio"]=(i/n).toFixed(2),y["device-height"]=n,y["device-width"]=i,y["device-pixel-ratio"]=a||1,y.resolution=a&&96*a||r.screen.deviceXDPI||96,y.orientation=t>=e?"portrait":"landscape"}function s(e){var t,i,n={matches:!1,media:e,addListener:function(e){e&&i.push(e)},removeListener:function(e){for(var t,n=0;(t=i[n])!==a;n++)t===e&&i.splice(n,1)}};return n.matches=""===e?!0:d(e),x.push({mql:n,listeners:[]}),t=x.length-1,v[e]=t,i=x[t].listeners,n}function d(e){var t=-1!==e.indexOf(",")&&e.split(",")||[e],i=t.length-1,n=i,r=null,o=null,a="",l=0,s=!1,d="",c="",m=null,p=0,h=0,u=null,f="",x="",v="",w="",b="",q=!1;if(""===e)return!0;do if(r=t[n-i],s=!1,o=r.match(g.type),o&&(a=o[0],l=o.index),!o||-1===r.substring(0,l).indexOf("(")&&(l||!o[3]&&a!==o.input))q=!1;else{if(c=r,s="not"===o[1],l||(d=o[2],c=r.substring(a.length)),q=d===y.type||"all"===d||""===d,m=-1!==c.indexOf(" and ")&&c.split(" and ")||[c],p=m.length-1,h=p,q&&p>=0&&""!==c)do{if(u=m[p].match(g.media),!u||!y[u[3]]){q=!1;break}if(f=u[2],x=u[5],w=x,v=u[7],b=y[u[3]],v&&(w="px"===v?Number(x):"em"===v||"rem"===v?16*x:u[8]?(x/u[8]).toFixed(2):"dppx"===v?96*x:"dpcm"===v?.3937*x:Number(x)),q="min-"===f&&w?b>=w:"max-"===f&&w?w>=b:w?b===w:!!b,!q)break}while(p--);if(q)break}while(i--);return s?!q:q}function c(){var e,t,i=!1,n=0,o=0;if(x.length>0)for(l();(e=x[n])!==a;n++)if(i=d(e.mql.media),(i&&!e.mql.matches||!i&&e.mql.matches)&&(e.mql.matches=i,e.listeners))for(;(t=e.listeners[o])!==a;o++)t.call(r,e.mql)}function m(){r.clearTimeout(h),h=r.setTimeout(c,10)}function p(){var t,i=r.document.getElementsByTagName("script")[0],n=o.createElement("style"),l=["screen","print","speech","projection","handheld","tv","braille","embossed","tty"],s="#"+u+" { position: relative; z-index: 0; }",d="",c=r.addEventListener||(d="on")&&r.attachEvent,p=0;for(n.type="text/css",n.id=u,i.parentNode.insertBefore(n,i);(t=l[p])!==a;p++)s+="@media "+t+" { #"+u+" { position: relative; z-index: "+p+" } }";n.styleSheet?n.styleSheet.cssText=s:n.textContent=s,y.type=l[1*(r.getComputedStyle||e["polyfill/window/getcomputedstyle"])(n).zIndex||0],n.parentNode.removeChild(n),c(d+"resize",m),c(d+"orientationchange",m)}var h,u="qoopidoPolyfillWindowMatchmedia",f=o.documentElement,x=[],v={},y={},g={type:/\s*(only|not)?\s*(screen|print|[a-z\-]+)\s*(and)?\s*/i,media:/^\s*\(\s*(-[a-z]+-)?(min-|max-)?([a-z\-]+)\s*(:?\s*([0-9]+(\.[0-9]+)?|portrait|landscape)(px|em|dppx|dpcm|rem|%|in|cm|mm|ex|pt|pc|\/([0-9]+(\.[0-9]+)?))?)?\s*\)\s*$/};return r.matchMedia||(p(),l(),r.matchMedia=function(e){var t=v[e]||!1;return t===!1?s(e):x[t].mql}),r.matchMedia}); \ No newline at end of file diff --git a/dist/3.7.2/min/polyfill/window/promise.js b/dist/3.7.3/min/polyfill/window/promise.js similarity index 96% rename from dist/3.7.2/min/polyfill/window/promise.js rename to dist/3.7.3/min/polyfill/window/promise.js index ffe50730..a820ae34 100644 --- a/dist/3.7.2/min/polyfill/window/promise.js +++ b/dist/3.7.3/min/polyfill/window/promise.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){window.qoopido.register("polyfill/window/promise",t)}(function(t,n,r,e,o,i,u){"use strict";function s(t,n){var r=j.push([t,n]);1===r&&c()}function c(){o.setTimeout(f,1)}function f(){for(var t,n=0;(t=j[n])!==u;n++)t[0](t[1]);j.length=0}function a(t,n){var r,e=null;try{if(t===n)throw new TypeError("A promises callback cannot return that same promise.");if(("function"==typeof n||"object"==typeof n&&null!==n)&&(e=n.then,"function"==typeof e))return e.call(n,function(e){return r?!0:(r=!0,void(n!==e?h(t,e):p(t,e)))},function(n){return r?!0:(r=!0,void v(t,n))}),!0}catch(o){return r?!0:(v(t,o),!0)}return!1}function l(t,n){function r(t){h(n,t)}function e(t){v(n,t)}try{t(r,e)}catch(o){e(o)}}function _(t,n,r,e){var o,i,u,s,c="function"==typeof r;if(c)try{o=r(e),u=!0}catch(f){s=!0,i=f}else o=e,u=!0;a(n,o)||(c&&u?h(n,o):s?v(n,i):t===T?h(n,o):t===E&&v(n,o))}function h(t,n){t===n?p(t,n):a(t,n)||p(t,n)}function p(t,n){t._state===g&&(t._state=P,t._detail=n,s(b,t))}function v(t,n){t._state===g&&(t._state=P,t._detail=n,s(m,t))}function b(t){d(t,t._state=T)}function m(t){d(t,t._state=E)}function y(t,n,r,e){var o=t._subscribers,i=o.length;o[i]=n,o[i+T]=r,o[i+E]=e}function d(t,n){for(var r,e,o=t._subscribers,i=t._detail,s=0;(r=o[s])!==u;s+=3)e=o[s+n],_(n,r,e,i);t._subscribers=null}function w(t){var n=this;if("function"!=typeof t)throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");n._subscribers=[],l(t,n)}var g=void 0,P=0,T=1,E=2,j=[];return w.prototype={_state:u,_detail:u,_subscribers:u,then:function(t,n){var r=this,e=new w(function(){});return r._state?s(function(){_(r._state,e,arguments[r._state-1],r._detail)}):y(r,e,t,n),e},"catch":function(t){return this.then(null,t)}},o.Promise||(o.Promise=w),o.Promise}); \ No newline at end of file diff --git a/dist/3.7.2/min/polyfill/window/removeeventlistener.js b/dist/3.7.3/min/polyfill/window/removeeventlistener.js similarity index 90% rename from dist/3.7.2/min/polyfill/window/removeeventlistener.js rename to dist/3.7.3/min/polyfill/window/removeeventlistener.js index d62016ee..45171b8e 100644 --- a/dist/3.7.2/min/polyfill/window/removeeventlistener.js +++ b/dist/3.7.3/min/polyfill/window/removeeventlistener.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){var t=[];Array.prototype.indexOf||t.push("../array/indexof"),window.qoopido.register("polyfill/window/removeeventlistener",e,t)}(function(e,t,n,r,o,i,v){"use strict";return o.removeEventListener||(o.removeEventListener=Window.prototype.removeEventListener=HTMLDocument.prototype.removeEventListener=Element.prototype.removeEventListener=function(e,t){var n=this;if(n._events&&n._events[e]&&n._events[e].list){var r=n._events[e].list.indexOf(t);r>-1&&(n._events[e].list.splice(r,1),n._events[e].list.length||n.detachEvent&&n.detachEvent("on"+e,n._events[e]))}}),o.removeEventListener}); \ No newline at end of file diff --git a/dist/3.7.2/min/pool.js b/dist/3.7.3/min/pool.js similarity index 96% rename from dist/3.7.2/min/pool.js rename to dist/3.7.3/min/pool.js index 235d4bff..16729905 100644 --- a/dist/3.7.2/min/pool.js +++ b/dist/3.7.3/min/pool.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("pool",e,["./base","./function/merge","./function/unique/uuid"])}(function(e,t,i,n,o,u,r){"use strict";function s(){var e,t,i,n=this,o=n.metrics,u=n._settings,r=n._queue,s=n._variables,a=1;if(r.length>0&&(s.durationAverage>0&&(a=~~((a=u.frameBudget/s.durationAverage)<1?1:a)),(e=Math.min(r.length,(t=r.splice(0,a)).length))>0))if(o.inPool+e<=u.maxPoolsize){i=(new Date).getTime();for(var l=0;e>l;l++){var c=t[l],d=c._puid,_=c.dispose;c=n._dispose(c),c._puid=d,c.dispose=_,n._getPool.call(n,c).push(c)}o.inPool+=e,o.inQueue-=e,s.durationSamples+=e,s.durationTotal+=(new Date).getTime()-i,s.durationAverage=s.durationTotal/s.durationSamples}else{if("function"==typeof n._destroy)for(var p=0;e>p;p++)n._destroy(t[p]);t.length=0,o.inQueue-=e,o.destroyed+=e}}var a,l={interval:1e3/60,frameBudget:.5,maxPoolsize:1e3};return a=e.base.extend({metrics:null,_settings:null,_pool:null,_queue:null,_variables:null,_constructor:function(t){var i=this;return i.metrics={total:0,inPool:0,inUse:0,inQueue:0,recycled:0,destroyed:0},i._settings=e["function/merge"]({},l,t),i._pool=i._initPool(),i._queue=[],i._variables={durationSamples:0,durationTotal:0,durationAverage:0},setInterval(function(){s.call(i)},i._settings.interval),i},_initPool:function(){return[]},_initElement:function(t){var i=this;return t._puid=e["function/unique/uuid"](),t.dispose=function(){i.dispose(t)},i.metrics.total++,t},_getPool:function(){return this._pool},obtain:function(){var e=this,t=e._getPool.apply(e,arguments).pop();return t?(e.metrics.inPool--,e.metrics.recycled++):t=e._initElement(e._obtain.apply(e,arguments)),"function"==typeof t._obtain&&t._obtain.apply(t,arguments),e.metrics.inUse++,t},dispose:function(e){var t=this,i=t._queue;return e._puid||(e=t._initElement(e),t.metrics.inUse++),"function"==typeof e._dispose&&e._dispose(),i.push(e),t.metrics.inUse--,t.metrics.inQueue++,null}})}); \ No newline at end of file diff --git a/dist/3.7.2/min/pool/array.js b/dist/3.7.3/min/pool/array.js similarity index 81% rename from dist/3.7.2/min/pool/array.js rename to dist/3.7.3/min/pool/array.js index d529c41b..479a7db1 100644 --- a/dist/3.7.2/min/pool/array.js +++ b/dist/3.7.3/min/pool/array.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(o){window.qoopido.register("pool/array",o,["../pool"])}(function(o,n,r,t,e,i,p){"use strict";var u=o.pool.extend({_dispose:function(o){return o.length=0,o},_obtain:function(){return[]}});return n.pool=n.pool||{},n.pool.array=u.create(),u}); \ No newline at end of file diff --git a/dist/3.7.2/min/pool/dom.js b/dist/3.7.3/min/pool/dom.js similarity index 90% rename from dist/3.7.2/min/pool/dom.js rename to dist/3.7.3/min/pool/dom.js index 280d0375..8f5bf53d 100644 --- a/dist/3.7.2/min/pool/dom.js +++ b/dist/3.7.3/min/pool/dom.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(o){window.qoopido.register("pool/dom",o,["../pool"])}(function(o,t,e,r,n,i,p){"use strict";var l=o.pool.extend({_initPool:function(){return{}},_getPool:function(o){var t=this;return"string"!=typeof o&&(o=o.tagName.toLowerCase()),t._pool[o]=t._pool[o]||[]},_dispose:function(o){var t;o.parentNode&&o.parentNode.removeChild(o);for(t in o)if(Object.prototype.hasOwnProperty.call(o,t))try{o.removeAttribute(t)}catch(e){o.property=null}return o},_obtain:function(o){return i.createElement(o)}});return t.pool=t.pool||{},t.pool.dom=l.create(),l}); \ No newline at end of file diff --git a/dist/3.7.2/min/pool/module.js b/dist/3.7.3/min/pool/module.js similarity index 91% rename from dist/3.7.2/min/pool/module.js rename to dist/3.7.3/min/pool/module.js index 04a03f2d..018daec4 100644 --- a/dist/3.7.2/min/pool/module.js +++ b/dist/3.7.3/min/pool/module.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(o){window.qoopido.register("pool/module",o,["../pool","../function/unique/uuid"])}(function(o,u,t,n,e,i,r){"use strict";var l=o["function/unique/uuid"],d=o.pool.extend({_module:null,_destroy:null,_constructor:function(o,t,n){var e=this,i=o._puid||(o._puid=l()),r=n&&(u.pool||(u.pool={}))&&(u.pool.module||(u.pool.module={}));return n===!0&&r[i]?r[i]:(e=d._parent._constructor.call(this,t),e._module=o,"function"==typeof o._destroy&&(e._destroy=function(o){o._destroy()}),n===!0&&(r[i]=e),e)},_dispose:function(o){return o},_obtain:function(){return this._module.create.apply(this._module,arguments)}});return d}); \ No newline at end of file diff --git a/dist/3.7.2/min/pool/object.js b/dist/3.7.3/min/pool/object.js similarity index 92% rename from dist/3.7.2/min/pool/object.js rename to dist/3.7.3/min/pool/object.js index e6e4f5a7..2af5c1d6 100644 --- a/dist/3.7.2/min/pool/object.js +++ b/dist/3.7.3/min/pool/object.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("pool/object",e,["../pool"])}(function(e,t,o,r,n,l,p){"use strict";var i,c=null===Object.prototype.__proto__,d=c?"__proto__":"prototype",u=c?null:function(){var e=l.createElement("iframe"),t=l.body||l.documentElement;e.style.display="none",t.appendChild(e),e.src="javascript:";var o=e.contentWindow.Object.prototype;return t.removeChild(e),e=null,delete o.constructor,delete o.hasOwnProperty,delete o.propertyIsEnumerable,delete o.isPrototypeOf,delete o.toLocaleString,delete o.toString,delete o.valueOf,o.__proto__=null,o}();return i=e.pool.extend({getModel:function(){return u},_dispose:function(e){var t;e[d]=u;for(t in e)delete e[t];return e},_obtain:function(){return{}}}),t.pool=t.pool||{},t.pool.object=i.create(),i}); \ No newline at end of file diff --git a/dist/3.7.2/min/promise/all.js b/dist/3.7.3/min/promise/all.js similarity index 89% rename from dist/3.7.2/min/promise/all.js rename to dist/3.7.3/min/promise/all.js index 9fcdf148..7ded9d3e 100644 --- a/dist/3.7.2/min/promise/all.js +++ b/dist/3.7.3/min/promise/all.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(n){var o=[];window.Promise||o.push("../polyfill/window/promise"),window.qoopido.register("promise/all",n,o)}(function(n,o,t,r,i,e,u){"use strict";return function(n){if("[object Array]"!==Object.prototype.toString.call(n))throw new TypeError("You must pass an array to all.");return new i.Promise(function(o,t){function r(n){return function(o){i(n,o)}}function i(n,t){c[n]=t,0===--f&&o(c)}var e,c=[],f=n.length,s=0;for(0===f&&o([]);(e=n[s])!==u;s++)e&&"function"==typeof e.then?e.then(r(s),t):i(s,e)})}}); \ No newline at end of file diff --git a/dist/3.7.2/min/promise/defer.js b/dist/3.7.3/min/promise/defer.js similarity index 82% rename from dist/3.7.2/min/promise/defer.js rename to dist/3.7.3/min/promise/defer.js index 4f2fa33e..e0c53a14 100644 --- a/dist/3.7.2/min/promise/defer.js +++ b/dist/3.7.3/min/promise/defer.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(i){var o=[];window.Promise||o.push("../polyfill/window/promise"),window.qoopido.register("promise/defer",i,o)}(function(i,o,e,r,n,s,t){"use strict";return function(){var i=this;i.promise=new n.Promise(function(o,e){i.resolve=o,i.reject=e})}}); \ No newline at end of file diff --git a/dist/3.7.2/min/promise/race.js b/dist/3.7.3/min/promise/race.js similarity index 87% rename from dist/3.7.2/min/promise/race.js rename to dist/3.7.3/min/promise/race.js index d605e314..60b25145 100644 --- a/dist/3.7.2/min/promise/race.js +++ b/dist/3.7.3/min/promise/race.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(o){var r=[];window.Promise||r.push("../polyfill/window/promise"),window.qoopido.register("promise/race",o,r)}(function(o,r,t,n,e,i,s){"use strict";return function(o){if("[object Array]"!==Object.prototype.toString.call(o))throw new TypeError("You must pass an array to all.");return new e.Promise(function(r,t){for(var n,e=0;(n=o[e])!==s;e++)n&&"function"==typeof n.then?n.then(r,t):r(n)})}}); \ No newline at end of file diff --git a/dist/3.7.2/min/proxy.js b/dist/3.7.3/min/proxy.js similarity index 85% rename from dist/3.7.2/min/proxy.js rename to dist/3.7.3/min/proxy.js index 93e90c61..3cbf5455 100644 --- a/dist/3.7.2/min/proxy.js +++ b/dist/3.7.3/min/proxy.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(n){window.qoopido.register("proxy",n,["./base","./function/unique/uuid"])}(function(n,t,u,r,e,o,i){"use strict";return n.base.extend({_constructor:function(t,u){var r=Array.prototype.splice.call(arguments,2),e=function(){return u.apply(t,Array.prototype.slice.call(arguments).concat(r))};return e._quid=n["function/unique/uuid"](),e}})}); \ No newline at end of file diff --git a/dist/3.7.2/min/renderer.js b/dist/3.7.3/min/renderer.js similarity index 94% rename from dist/3.7.2/min/renderer.js rename to dist/3.7.3/min/renderer.js index 4f9555a9..72040ccd 100644 --- a/dist/3.7.2/min/renderer.js +++ b/dist/3.7.3/min/renderer.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.registerSingleton("renderer",e,["./emitter","./support","./dom/element"])}(function(e,t,i,n,r,a,o){"use strict";function c(e){return r.setTimeout(e,y)}function u(){var e=this;a[v]?d&&(s=(new Date).getTime(),e.paused=!0,k(d),d=null,e.emit("suspend")):d||(e.paused=!1,s&&(l=(new Date).getTime()-s,f+=l,g+=l,e.emit("resume",l)),e._tick())}var m,s,l,d,g,p,f,h,_=e.support,w=e["dom/element"].create(a),T=r[_.getMethod("requestAnimationFrame")]||c,k=r[_.getMethod("cancelAnimationFrame")]||clearTimeout,v=_.getProperty("hidden",a),D=60,y=1e3/D,b=0;return m=e.emitter.extend({framerate:0,ratio:1,paused:!1,_tick:null,_constructor:function(){var e=m._parent._constructor.call(this);return g=f=(new Date).getTime(),e._tick=function(){e.paused===!1&&(p=(new Date).getTime(),h=p-g,e.ratio=(p-f)/y,e.framerate=D/e.ratio,h>=1e3&&(g=p,b=0),f=p,b+=1,e.emit("tick",e.framerate,e.ratio),d=T(e._tick))},w.on("".concat("visibilitychange ",_.getPrefix()[0],"visibilitychange"),function(){u.call(e)}),u.call(e),e}})}); \ No newline at end of file diff --git a/dist/3.7.2/min/support.js b/dist/3.7.3/min/support.js similarity index 98% rename from dist/3.7.2/min/support.js rename to dist/3.7.3/min/support.js index 039daa37..1e0a2e82 100644 --- a/dist/3.7.2/min/support.js +++ b/dist/3.7.3/min/support.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){var t=["./base","./promise/all","./promise/defer"];String.prototype.ucfirst||t.push("./polyfill/string/ucfirst"),String.prototype.lcfirst||t.push("./polyfill/string/lcfirst"),window.qoopido.registerSingleton("support",e,t)}(function(e,t,r,s,o,i,p){"use strict";function n(e){return e.replace(a,"$1").lcfirst().replace(c,"").replace(m,g)}var l=e["promise/all"],u=e["promise/defer"],f=new RegExp("^(Moz|WebKit|Khtml|ms|O|Icab)(?=[A-Z])"),a=new RegExp("^(?:webkit|khtml|icab|moz|ms|o)([A-Z])"),c=new RegExp("^-(?:webkit|khtml|icab|moz|ms|o)-"),m=new RegExp("-([a-z])","gi"),h=new RegExp("([A-Z])","g"),g=function(){return arguments[1].ucfirst()},y={prefix:null,method:{},property:{},css:{},promises:{prefix:null,method:{},property:{},css:{},test:{}}};return e.base.extend({test:{},pool:t.pool&&t.pool.dom,testMultiple:function(){for(var e,t=[],r=0;(e=arguments[r])!==p;r++)switch(typeof e){case"string":t.push(this.test[e]());break;case"boolean":var s=new u;e?s.resolve():s.reject(),t.push(s.promise);break;default:t.push(e)}return new l(t)},getPrefix:function(){var e,t=this,r=y.prefix||null;if(null===r){var s=t.pool?t.pool.obtain("div"):i.createElement("div"),o=s.style;r=!1;for(e in o)f.test(e)&&(r=e.match(f)[0]);r===!1&&"WebkitOpacity"in o&&(r="WebKit"),r===!1&&"KhtmlOpacity"in o&&(r="Khtml"),r=y.prefix=r===!1?!1:[r.toLowerCase(),r.toLowerCase().ucfirst(),r],s.dispose&&s.dispose()}return r},getMethod:function(e,t){e=n(e),t=t||o;var r=t.tagName,s=y.method[r]=y.method[r]||{},i=s[e]=y.method[r][e]||null;if(null===i){i=!1;var l,u,f=0,a=e.ucfirst(),c=this.getPrefix();for(l=c!==!1?(e+" "+a+" "+c.join(a+" ")+a).split(" "):[e];(u=l[f])!==p;f++)if(t[u]!==p&&("function"==typeof t[u]||"object"==typeof t[u])){i=u;break}y.method[r][e]=i}return i},getProperty:function(e,t){e=n(e),t=t||o;var r=t.tagName,s=y.property[r]=y.property[r]||{},i=s[e]=y.property[r][e]||null;if(null===i){i=!1;var l,u,f=0,a=e.ucfirst(),c=this.getPrefix();for(l=c!==!1?(e+" "+a+" "+c.join(a+" ")+a).split(" "):[e],f;(u=l[f])!==p;f++)if(t[u]!==p){i=u;break}y.property[r][e]=i}return i},getCssProperty:function(e){e=n(e);var t=this,r=y.css[e]||null;if(null===r){r=!1;var s,o=0,l=t.pool?t.pool.obtain("div"):i.createElement("div"),u=e.ucfirst(),f=this.getPrefix()||[],a=(e+" "+u+" "+f.join(u+" ")+u).split(" "),c="";for(o;(s=a[o])!==p;o++)if(l.style[s]!==p){r=s,o>0&&(c="-");break}r=y.css[e]=r!==!1?[c+r.replace(h,"-$1").toLowerCase(),r]:!1,l.dispose&&l.dispose()}return r},supportsPrefix:function(){return!!this.getPrefix()},supportsMethod:function(e,t){return!!this.getMethod(e,t)},supportsProperty:function(e,t){return!!this.getProperty(e,t)},supportsCssProperty:function(e){return!!this.getCssProperty(e)},testPrefix:function(){var e=y.promises.prefix;if(null===e){var t=new u,r=this.getPrefix();r?t.resolve(r):t.reject(),e=y.promises.prefix=t.promise}return e},testMethod:function(e,t){t=t||o;var r=t.tagName,s=y.promises.method[r]=y.promises.method[r]||{},i=s[e]=y.promises.method[r][e]||null;if(null===i){var p=new u,n=this.getMethod(e,t);n?p.resolve(n):p.reject(),i=y.promises.method[r][e]=p.promise}return i},testProperty:function(e,t){t=t||o;var r=t.tagName,s=y.promises.property[r]=y.promises.property[r]||{},i=s[e]=y.promises.property[r][e]||null;if(null===i){var p=new u,n=this.getProperty(e,t);n?p.resolve(n):p.reject(),i=y.promises.property[r][e]=p.promise}return i},testCssProperty:function(e){var t=y.promises.css[e]||null;if(null===t){var r=new u,s=this.getCssProperty(e);s?r.resolve(s):r.reject(),t=y.promises.css[e]=r.promise}return t},addTest:function(e,t){return this.test[e]=function(){var r=y.promises.test[e]||null;if(null===r){var s=new u,o=Array.prototype.slice.call(arguments);o.splice(0,0,s),t.apply(null,o),r=y.promises.test[e]=s.promise}return r}}})}); \ No newline at end of file diff --git a/dist/3.7.2/min/support/capability/datauri.js b/dist/3.7.3/min/support/capability/datauri.js similarity index 90% rename from dist/3.7.2/min/support/capability/datauri.js rename to dist/3.7.3/min/support/capability/datauri.js index 44d3996b..c7b7e7db 100644 --- a/dist/3.7.2/min/support/capability/datauri.js +++ b/dist/3.7.3/min/support/capability/datauri.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("support/capability/datauri",e,["../../support","../../dom/element"])}(function(e,t,o,i,A,r,a){"use strict";var n=e.support;return n.addTest("/capability/datauri",function(t){var o=e["dom/element"].create(n.pool?n.pool.obtain("img"):r.createElement("img"));o.one("error load",function(e){"load"===e.type&&1===o.element.width&&1===o.element.height?t.resolve():t.reject(),o.element.dispose&&o.element.dispose()},!1).setAttribute("src","data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==")})}); \ No newline at end of file diff --git a/dist/3.7.2/min/support/capability/touch.js b/dist/3.7.3/min/support/capability/touch.js similarity index 84% rename from dist/3.7.2/min/support/capability/touch.js rename to dist/3.7.3/min/support/capability/touch.js index d531e8a3..dfd12286 100644 --- a/dist/3.7.2/min/support/capability/touch.js +++ b/dist/3.7.3/min/support/capability/touch.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(o){window.qoopido.register("support/capability/touch",o,["../../support"])}(function(o,t,c,u,n,i,s){"use strict";return o.support.addTest("/capability/touch",function(o){"ontouchstart"in n||n.DocumentTouch&&i instanceof DocumentTouch||u.maxTouchPoints>0||u.msMaxTouchPoints>0?o.resolve():o.reject()})}); \ No newline at end of file diff --git a/dist/3.7.2/min/support/css/borderradius.js b/dist/3.7.3/min/support/css/borderradius.js similarity index 84% rename from dist/3.7.2/min/support/css/borderradius.js rename to dist/3.7.3/min/support/css/borderradius.js index 47c296e4..574e55ba 100644 --- a/dist/3.7.2/min/support/css/borderradius.js +++ b/dist/3.7.3/min/support/css/borderradius.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(r){window.qoopido.register("support/css/borderradius",r,["../../support"])}(function(r,s,o,t,e,p,u){"use strict";return r.support.addTest("/css/borderradius",function(s){r.support.supportsCssProperty("border-radius")?s.resolve(r.support.getCssProperty("border-radius")):s.reject()})}); \ No newline at end of file diff --git a/dist/3.7.2/min/support/css/boxshadow.js b/dist/3.7.3/min/support/css/boxshadow.js similarity index 83% rename from dist/3.7.2/min/support/css/boxshadow.js rename to dist/3.7.3/min/support/css/boxshadow.js index f7a03e4c..76230f12 100644 --- a/dist/3.7.2/min/support/css/boxshadow.js +++ b/dist/3.7.3/min/support/css/boxshadow.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(o){window.qoopido.register("support/css/boxshadow",o,["../../support"])}(function(o,s,t,r,p,e,u){"use strict";return o.support.addTest("/css/boxshadow",function(s){o.support.supportsCssProperty("box-shadow")?s.resolve(o.support.getCssProperty("box-shadow")):s.reject()})}); \ No newline at end of file diff --git a/dist/3.7.2/min/support/css/rem.js b/dist/3.7.3/min/support/css/rem.js similarity index 85% rename from dist/3.7.2/min/support/css/rem.js rename to dist/3.7.3/min/support/css/rem.js index d16703e7..001b4e79 100644 --- a/dist/3.7.2/min/support/css/rem.js +++ b/dist/3.7.3/min/support/css/rem.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("support/css/rem",e,["../../support"])}(function(e,t,o,s,r,i,n){"use strict";var p=e.support;return p.addTest("/css/rem",function(e){var t=p.pool?p.pool.obtain("div"):i.createElement("div");try{t.style.fontSize="3rem"}catch(o){}/rem/.test(t.style.fontSize)?e.resolve():e.reject(),t.dispose&&t.dispose()})}); \ No newline at end of file diff --git a/dist/3.7.2/min/support/css/rgba.js b/dist/3.7.3/min/support/css/rgba.js similarity index 86% rename from dist/3.7.2/min/support/css/rgba.js rename to dist/3.7.3/min/support/css/rgba.js index 55f6e12c..e2e03fc6 100644 --- a/dist/3.7.2/min/support/css/rgba.js +++ b/dist/3.7.3/min/support/css/rgba.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(o){window.qoopido.register("support/css/rgba",o,["../../support"])}(function(o,r,t,s,e,a,c){"use strict";var i=o.support;return i.addTest("/css/rgba",function(o){var r=i.pool?i.pool.obtain("div"):a.createElement("div");try{r.style.backgroundColor="rgba(0,0,0,.5)"}catch(t){}/rgba/.test(r.style.backgroundColor)?o.resolve():o.reject(),r.dispose&&r.dispose()})}); \ No newline at end of file diff --git a/dist/3.7.2/min/support/css/textshadow.js b/dist/3.7.3/min/support/css/textshadow.js similarity index 83% rename from dist/3.7.2/min/support/css/textshadow.js rename to dist/3.7.3/min/support/css/textshadow.js index f336fb47..31420cdd 100644 --- a/dist/3.7.2/min/support/css/textshadow.js +++ b/dist/3.7.3/min/support/css/textshadow.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){window.qoopido.register("support/css/textshadow",t,["../../support"])}(function(t,s,o,r,e,p,u){"use strict";return t.support.addTest("/css/textshadow",function(s){t.support.supportsCssProperty("text-shadow")?s.resolve(t.support.getCssProperty("text-shadow")):s.reject()})}); \ No newline at end of file diff --git a/dist/3.7.2/min/support/css/transform.js b/dist/3.7.3/min/support/css/transform.js similarity index 83% rename from dist/3.7.2/min/support/css/transform.js rename to dist/3.7.3/min/support/css/transform.js index 9a6c1a47..8a76bc1f 100644 --- a/dist/3.7.2/min/support/css/transform.js +++ b/dist/3.7.3/min/support/css/transform.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(r){window.qoopido.register("support/css/transform",r,["../../support"])}(function(r,s,t,o,p,e,n){"use strict";return r.support.addTest("/css/transform",function(s){r.support.supportsCssProperty("transform")?s.resolve(r.support.getCssProperty("transform")):s.reject()})}); \ No newline at end of file diff --git a/dist/3.7.2/min/support/css/transform/2d.js b/dist/3.7.3/min/support/css/transform/2d.js similarity index 89% rename from dist/3.7.2/min/support/css/transform/2d.js rename to dist/3.7.3/min/support/css/transform/2d.js index 805acac1..28043b51 100644 --- a/dist/3.7.2/min/support/css/transform/2d.js +++ b/dist/3.7.3/min/support/css/transform/2d.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){window.qoopido.register("support/css/transform/2d",t,["../../../support","../transform"])}(function(t,r,o,s,e,n,p){"use strict";var c=t.support;return c.addTest("/css/transform/2d",function(r){t["support/css/transform"]().then(function(){var o=c.pool?c.pool.obtain("div"):n.createElement("div"),s=t.support.getCssProperty("transform");try{o.style[s]="rotate(30deg)"}catch(e){}/rotate/.test(o.style[s])?r.resolve():r.reject(),o.dispose&&o.dispose()},function(){r.reject()})})}); \ No newline at end of file diff --git a/dist/3.7.2/min/support/css/transform/3d.js b/dist/3.7.3/min/support/css/transform/3d.js similarity index 89% rename from dist/3.7.2/min/support/css/transform/3d.js rename to dist/3.7.3/min/support/css/transform/3d.js index 2dd075e0..8f0e90ab 100644 --- a/dist/3.7.2/min/support/css/transform/3d.js +++ b/dist/3.7.3/min/support/css/transform/3d.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){window.qoopido.register("support/css/transform/3d",t,["../../../support","../transform"])}(function(t,s,r,o,e,n,p){"use strict";var a=t.support;return a.addTest("/css/transform/3d",function(s){t["support/css/transform"]().then(function(){var r=a.pool?a.pool.obtain("div"):n.createElement("div"),o=t.support.getCssProperty("transform");try{r.style[o]="translate3d(0,0,0)"}catch(e){}/translate3d/.test(r.style[o])?s.resolve():s.reject(),r.dispose&&r.dispose()},function(){s.reject()})})}); \ No newline at end of file diff --git a/dist/3.7.2/min/support/css/transition.js b/dist/3.7.3/min/support/css/transition.js similarity index 83% rename from dist/3.7.2/min/support/css/transition.js rename to dist/3.7.3/min/support/css/transition.js index aa543c39..448b1eeb 100644 --- a/dist/3.7.2/min/support/css/transition.js +++ b/dist/3.7.3/min/support/css/transition.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){window.qoopido.register("support/css/transition",t,["../../support"])}(function(t,s,r,o,n,i,p){"use strict";return t.support.addTest("/css/transition",function(s){t.support.supportsCssProperty("transition")?s.resolve(t.support.getCssProperty("transition")):s.reject()})}); \ No newline at end of file diff --git a/dist/3.7.2/min/support/element/canvas.js b/dist/3.7.3/min/support/element/canvas.js similarity index 85% rename from dist/3.7.2/min/support/element/canvas.js rename to dist/3.7.3/min/support/element/canvas.js index 23c03960..5eda5645 100644 --- a/dist/3.7.2/min/support/element/canvas.js +++ b/dist/3.7.3/min/support/element/canvas.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("support/element/canvas",e,["../../support"])}(function(e,t,o,n,s,a,r){"use strict";var p=e.support;return p.addTest("/element/canvas",function(e){var t=p.pool?p.pool.obtain("canvas"):a.createElement("canvas");t.getContext&&t.getContext("2d")?e.resolve():e.reject(),t.dispose&&t.dispose()})}); \ No newline at end of file diff --git a/dist/3.7.2/min/support/element/canvas/todataurl.js b/dist/3.7.3/min/support/element/canvas/todataurl.js similarity index 87% rename from dist/3.7.2/min/support/element/canvas/todataurl.js rename to dist/3.7.3/min/support/element/canvas/todataurl.js index e78621de..5ed5714b 100644 --- a/dist/3.7.2/min/support/element/canvas/todataurl.js +++ b/dist/3.7.3/min/support/element/canvas/todataurl.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){window.qoopido.register("support/element/canvas/todataurl",t,["../../../support","../canvas"])}(function(t,e,n,o,a,s,r){"use strict";var c=t.support;return c.addTest("/element/canvas/todataurl",function(e){t["support/element/canvas"]().then(function(){var t=c.pool?c.pool.obtain("canvas"):s.createElement("canvas");t.toDataURL!==r?e.resolve():e.reject(),t.dispose&&t.dispose()},function(){e.reject()})})}); \ No newline at end of file diff --git a/dist/3.7.2/min/support/element/canvas/todataurl/jpeg.js b/dist/3.7.3/min/support/element/canvas/todataurl/jpeg.js similarity index 89% rename from dist/3.7.2/min/support/element/canvas/todataurl/jpeg.js rename to dist/3.7.3/min/support/element/canvas/todataurl/jpeg.js index f75d0f37..60755f8f 100644 --- a/dist/3.7.2/min/support/element/canvas/todataurl/jpeg.js +++ b/dist/3.7.3/min/support/element/canvas/todataurl/jpeg.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("support/element/canvas/todataurl/jpeg",e,["../../../../support","../todataurl"])}(function(e,t,a,o,n,r,s){"use strict";var p=e.support;return p.addTest("/element/canvas/todataurl/jpeg",function(t){e["support/element/canvas/todataurl"]().then(function(){var e=p.pool?p.pool.obtain("canvas"):r.createElement("canvas");0===e.toDataURL("image/jpeg").indexOf("data:image/jpeg")?t.resolve():t.reject(),e.dispose&&e.dispose()},function(){t.reject()})})}); \ No newline at end of file diff --git a/dist/3.7.2/min/support/element/canvas/todataurl/png.js b/dist/3.7.3/min/support/element/canvas/todataurl/png.js similarity index 89% rename from dist/3.7.2/min/support/element/canvas/todataurl/png.js rename to dist/3.7.3/min/support/element/canvas/todataurl/png.js index 60c15043..8dc5f20e 100644 --- a/dist/3.7.2/min/support/element/canvas/todataurl/png.js +++ b/dist/3.7.3/min/support/element/canvas/todataurl/png.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){window.qoopido.register("support/element/canvas/todataurl/png",t,["../../../../support","../todataurl"])}(function(t,e,a,n,o,r,s){"use strict";var p=t.support;return p.addTest("/element/canvas/todataurl/png",function(e){t["support/element/canvas/todataurl"]().then(function(){var t=p.pool?p.pool.obtain("canvas"):r.createElement("canvas");0===t.toDataURL("image/png").indexOf("data:image/png")?e.resolve():e.reject(),t.dispose&&t.dispose()},function(){e.reject()})})}); \ No newline at end of file diff --git a/dist/3.7.2/min/support/element/canvas/todataurl/webp.js b/dist/3.7.3/min/support/element/canvas/todataurl/webp.js similarity index 89% rename from dist/3.7.2/min/support/element/canvas/todataurl/webp.js rename to dist/3.7.3/min/support/element/canvas/todataurl/webp.js index a66de6f2..8e2a952a 100644 --- a/dist/3.7.2/min/support/element/canvas/todataurl/webp.js +++ b/dist/3.7.3/min/support/element/canvas/todataurl/webp.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("support/element/canvas/todataurl/webp",e,["../../../../support","../todataurl"])}(function(e,t,a,o,n,r,s){"use strict";var p=e.support;return p.addTest("/element/canvas/todataurl/webp",function(t){e["support/element/canvas/todataurl"]().then(function(){var e=p.pool?p.pool.obtain("canvas"):r.createElement("canvas");0===e.toDataURL("image/webp").indexOf("data:image/webp")?t.resolve():t.reject(),e.dispose&&e.dispose()},function(){t.reject()})})}); \ No newline at end of file diff --git a/dist/3.7.2/min/support/element/svg.js b/dist/3.7.3/min/support/element/svg.js similarity index 83% rename from dist/3.7.2/min/support/element/svg.js rename to dist/3.7.3/min/support/element/svg.js index 38811353..6e6aebe1 100644 --- a/dist/3.7.2/min/support/element/svg.js +++ b/dist/3.7.3/min/support/element/svg.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("support/element/svg",e,["../../support"])}(function(e,t,r,n,o,s,c){"use strict";return e.support.addTest("/element/svg",function(e){s.createElementNS&&s.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect?e.resolve():e.reject()})}); \ No newline at end of file diff --git a/dist/3.7.2/min/support/element/video.js b/dist/3.7.3/min/support/element/video.js similarity index 84% rename from dist/3.7.2/min/support/element/video.js rename to dist/3.7.3/min/support/element/video.js index 1a329b59..363714b8 100644 --- a/dist/3.7.2/min/support/element/video.js +++ b/dist/3.7.3/min/support/element/video.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("support/element/video",e,["../../support"])}(function(e,o,t,i,n,r,p){"use strict";var s=e.support;return s.addTest("/element/video",function(e){var o=s.pool?s.pool.obtain("video"):r.createElement("video");o.canPlayType?e.resolve():e.reject(),o.dispose&&o.dispose()})}); \ No newline at end of file diff --git a/dist/3.7.2/min/support/element/video/mp4.js b/dist/3.7.3/min/support/element/video/mp4.js similarity index 88% rename from dist/3.7.2/min/support/element/video/mp4.js rename to dist/3.7.3/min/support/element/video/mp4.js index 38b6c7ed..60518fb4 100644 --- a/dist/3.7.2/min/support/element/video/mp4.js +++ b/dist/3.7.3/min/support/element/video/mp4.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("support/element/video/mp4",e,["../../../support","../video"])}(function(e,o,t,i,n,p,r){"use strict";var d=e.support;return d.addTest("/element/video/mp4",function(o){e["support/element/video"]().then(function(){var e=d.pool?d.pool.obtain("video"):p.createElement("video");e.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"')?o.resolve():o.reject(),e.dispose&&e.dispose()},function(){o.reject()})})}); \ No newline at end of file diff --git a/dist/3.7.2/min/support/element/video/ogg.js b/dist/3.7.3/min/support/element/video/ogg.js similarity index 88% rename from dist/3.7.2/min/support/element/video/ogg.js rename to dist/3.7.3/min/support/element/video/ogg.js index f39d86f9..b17e5758 100644 --- a/dist/3.7.2/min/support/element/video/ogg.js +++ b/dist/3.7.3/min/support/element/video/ogg.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("support/element/video/ogg",e,["../../../support","../video"])}(function(e,o,t,i,n,r,s){"use strict";var d=e.support;return d.addTest("/element/video/ogg",function(o){e["support/element/video"]().then(function(){var e=d.pool?d.pool.obtain("video"):r.createElement("video");e.canPlayType('video/ogg; codecs="theora, vorbis"')?o.resolve():o.reject(),e.dispose&&e.dispose()},function(){o.reject()})})}); \ No newline at end of file diff --git a/dist/3.7.2/min/support/element/video/webm.js b/dist/3.7.3/min/support/element/video/webm.js similarity index 88% rename from dist/3.7.2/min/support/element/video/webm.js rename to dist/3.7.3/min/support/element/video/webm.js index b2da8cc1..c3d5943d 100644 --- a/dist/3.7.2/min/support/element/video/webm.js +++ b/dist/3.7.3/min/support/element/video/webm.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("support/element/video/webm",e,["../../../support","../video"])}(function(e,o,t,i,n,r,p){"use strict";var s=e.support;return s.addTest("/element/video/webm",function(o){e["support/element/video"]().then(function(){var e=s.pool?s.pool.obtain("video"):r.createElement("video");e.canPlayType('video/webm; codecs="vp8, vorbis"')?o.resolve():o.reject(),e.dispose&&e.dispose()},function(){o.reject()})})}); \ No newline at end of file diff --git a/dist/3.7.2/min/transport.js b/dist/3.7.3/min/transport.js similarity index 88% rename from dist/3.7.2/min/transport.js rename to dist/3.7.3/min/transport.js index d78c17a7..c24b7049 100644 --- a/dist/3.7.2/min/transport.js +++ b/dist/3.7.3/min/transport.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(n){window.qoopido.register("transport",n,["./base","./function/merge"])}(function(n,e,t,o,i,r,s){"use strict";var c;return c=n.base.extend({setup:function(e){var t=this;return t._settings=n["function/merge"]({},t._settings,e),t},serialize:function(n,e){var t,o,i,r=[];for(t in n)o=e?"".concat(e,"[",t,"]"):t,i=n[t],r.push("object"==typeof i?this.serialize(i,o):"".concat(encodeURIComponent(o),"=",encodeURIComponent(i)));return r.join("&")}})},window,document); \ No newline at end of file diff --git a/dist/3.7.2/min/transport/jsonp.js b/dist/3.7.3/min/transport/jsonp.js similarity index 96% rename from dist/3.7.2/min/transport/jsonp.js rename to dist/3.7.3/min/transport/jsonp.js index 2ee326a9..78ad045b 100644 --- a/dist/3.7.2/min/transport/jsonp.js +++ b/dist/3.7.3/min/transport/jsonp.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){window.qoopido.registerSingleton("transport/jsonp",t,["../transport","../function/merge","../function/unique/uuid","../url","../dom/element","../promise/defer"])}(function(t,e,i,n,o,c,r){"use strict";function s(t,e){var i=this,n=i.dfd,c=i.script,r=i.settings;e="object"==typeof e?i.serialize(e):e,t="".concat(t,t.indexOf("?")>-1?"&":"?","".concat(r.callback,"=",i.id)),t=r.cache===!1?"".concat(t,t.indexOf("?")>-1?"&":"?","".concat("_=",(new Date).getTime().toString())):t,t=e?"".concat(t,t.indexOf("?")>-1?"&":"?",e):t,o[i.id]=function(t){try{delete o[i.id]}catch(e){o[i.id]=null}u.call(i),n.resolve(t)},c.on("load readystatechange",function(t){a.call(i,t)}).one("error",function(){l.call(i)}).setAttribute("src",t),g.appendChild(c.element),i.timeout=setTimeout(function(){d.call(i)},r.timeout)}function a(t){var e=this,i=e.dfd;t.readyState&&"loaded"!==t.readyState&&"complete"!==t.readyState||e.script.off()&&e.script.element.dispose&&e.script.element.dispose(),e.timeout&&clearTimeout(e.timeout),e.timeout=setTimeout(function(){d.call(e)},e.settings.timeout),i.notify(t)}function l(){var t=this;u.call(t),t.dfd.reject()}function d(){var t=this;u.call(t),t.dfd.reject(!1)}function u(){var t=this;t.timeout&&clearTimeout(t.timeout),t.script.off()&&t.script.element.dispose&&t.script.element.dispose()}var m,f=t["promise/defer"],p=e.pool&&e.pool.dom,g=c.getElementsByTagName("head")[0];return m=t.transport.extend({_settings:{callback:"callback",cache:!1,timeout:5e3},load:function(e,i,n){var o={};return e=t.url.resolve(e),o.id="".concat("jsonp-",t["function/unique/string"]()),o.dfd=new f,o.script=t["dom/element"].create(p?p.obtain("script"):c.createElement("script")),o.settings=t["function/merge"]({},this._settings,n),o.timeout=null,o.script.setAttribute("async",!0),s.call(o,e,i),o.dfd.promise}})},window,document); \ No newline at end of file diff --git a/dist/3.7.2/min/transport/xhr.js b/dist/3.7.3/min/transport/xhr.js similarity index 97% rename from dist/3.7.2/min/transport/xhr.js rename to dist/3.7.3/min/transport/xhr.js index 33e68442..b57e168a 100644 --- a/dist/3.7.2/min/transport/xhr.js +++ b/dist/3.7.3/min/transport/xhr.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){window.qoopido.registerSingleton("transport/xhr",t,["../transport","../function/merge","../function/unique/string","../url","../promise/defer"])}(function(t,e,n,r,o,i,u){"use strict";function s(t,e,n){var r,o=this,i=o.xhr,u=o.settings;e=u.cache===!1?"".concat(e,e.indexOf("?")>-1?"&":"?","_="+(new Date).getTime()):e,e=n&&"GET"===t?"".concat(e,e.indexOf("?")>-1?"&":"?",n):e;for(r in u.xhrOptions)i[r]=u.xhrOptions[r];if(i.open(t,e,u.async,u.username,u.password),i.setRequestHeader){i.setRequestHeader("Accept",u.accept),n&&"GET"!==t&&i.setRequestHeader("Content-Type",u.contentType);for(r in u.header)i.setRequestHeader(r,u.header[r])}i.timeout=u.timeout,i.onprogress=function(t){a.call(o,t)},i.onreadystatechange=i.onload=function(){c.call(o)},i.onerror=function(){l.call(o)},i.send(n||null),o.timeout=setTimeout(function(){d.call(o)},u.timeout)}function a(t){var e=this;e.timeout&&clearTimeout(e.timeout),e.timeout=setTimeout(function(){d.call(e)},e.settings.timeout)}function c(){var t=this,e=t.xhr,n=t.dfd;(e.readyState===u||4===e.readyState)&&(f.call(t),e.status===u||200===e.status?n.resolve({data:e.responseText,xhr:e}):n.reject({status:e.status,xhr:e}))}function l(){var t=this;f.call(t),t.dfd.reject()}function d(){var t=this;t.xhr.abort(),f.call(t),t.dfd.reject()}function f(){var t=this,e=t.xhr;t.timeout&&clearTimeout(t.timeout),e.onprogress=e.onreadystatechange=e.onerror=null}var h,p=t["promise/defer"],m="undefined"!=typeof o.XMLHttpRequest?function(e){return t.url.isLocal(e)?new o.XMLHttpRequest:o.XDomainRequest?new o.XDomainRequest:new o.XMLHttpRequest}:function(){try{return new ActiveXObject("MSXML2.XMLHTTP.3.0")}catch(t){return null}};return h=t.transport.extend({_settings:{accept:"*/*",timeout:5e3,async:!0,cache:!1,header:{},username:null,password:null,contentType:"application/x-www-form-urlencoded; charset=UTF-8 ",xhrOptions:{}},load:function(e,n,r,o){var i={};return n=t.url.resolve(n),i.url=n,i.id="".concat("xhr-",t["function/unique/string"]()),i.dfd=new p,i.xhr=m(n),i.settings=t["function/merge"]({},this._settings,o),i.timeout=null,s.call(i,e.toUpperCase(),n,r),i.dfd.promise},get:function(t,e,n){return this.load("GET",t,e,n)},post:function(t,e,n){return this.load("POST",t,e,n)},put:function(t,e,n){return this.load("PUT",t,e,n)},"delete":function(t,e,n){return this.load("DELETE",t,e,n)},head:function(t,e,n){return this.load("HEAD",t,e,n)}})},window,document); \ No newline at end of file diff --git a/dist/3.7.2/min/url.js b/dist/3.7.3/min/url.js similarity index 91% rename from dist/3.7.2/min/url.js rename to dist/3.7.3/min/url.js index 4e6e0b92..bd8dc061 100644 --- a/dist/3.7.2/min/url.js +++ b/dist/3.7.3/min/url.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.registerSingleton("url",e,["./base"])}(function(e,t,n,o,r,c,i){"use strict";function a(e){var t=c.createElement("a");return t.href=e||"",t}var s,u,f=new RegExp("[?&]?([^=]+)=([^&]*)","g");try{s=location}catch(l){s=a()}return u=new RegExp("".concat("^",s.protocol,"//",s.hostname),"i"),e.base.extend({resolve:function(e){return a(e).href},redirect:function(e,t){t=t||r,t.location.href=this.resolve(e)},getParameter:function(e){for(var t,n={},o=a(e).search.split("+").join(" ");t=f.exec(o);)n[decodeURIComponent(t[1])]=decodeURIComponent(t[2]);return n},isLocal:function(e){return u.test(this.resolve(e))}})}); \ No newline at end of file diff --git a/dist/3.7.2/min/vector/2d.js b/dist/3.7.3/min/vector/2d.js similarity index 95% rename from dist/3.7.2/min/vector/2d.js rename to dist/3.7.3/min/vector/2d.js index e5397211..c336172c 100644 --- a/dist/3.7.2/min/vector/2d.js +++ b/dist/3.7.3/min/vector/2d.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){window.qoopido.register("vector/2d",t,["../base"])}(function(t,i,s,h,e,n,o){"use strict";var y,r=180/Math.PI,u=Math.PI/180,c=i.pool&&i.pool.object;return y=t.base.extend({_temp:null,x:null,y:null,_constructor:function(t,i){return this._temp=c?c.obtain():{},this._temp.x=0,this._temp.y=0,this.x=t||0,this.y=i||0,this},_obtain:function(t,i){this.x=t||0,this.y=i||0},_destroy:function(){this._temp=this._temp.dispose&&this._temp.dispose()},getAngle:function(t){return t?Math.atan2(this.y,this.x):Math.atan2(this.y,this.x)*r%360},getLength:function(t){return t?this.x*this.x+this.y*this.y:Math.sqrt(this.x*this.x+this.y*this.y)},rotate:function(t,i){var s=Math.cos(t*(i?1:u)),h=Math.sin(t*(i?1:u));return this._temp.x=this.x,this._temp.y=this.y,this.x=this._temp.x*s-this._temp.y*h,this.y=this._temp.x*h+this._temp.y*s,this},invert:function(){return this.x=-this.x,this.y=-this.y,this},add:function(t){return this.x+="object"==typeof t?t.x:t,this.y+="object"==typeof t?t.y:t,this},subtract:function(t){return this.x-="object"==typeof t?t.x:t,this.y-="object"==typeof t?t.y:t,this},multiply:function(t){return this.x*="object"==typeof t?t.x:t,this.y*="object"==typeof t?t.y:t,this},divide:function(t){return this.x/="object"==typeof t?t.x:t,this.y/="object"==typeof t?t.y:t,this}})}); \ No newline at end of file diff --git a/dist/3.7.2/min/widget/image/adapt.js b/dist/3.7.3/min/widget/image/adapt.js similarity index 97% rename from dist/3.7.2/min/widget/image/adapt.js rename to dist/3.7.3/min/widget/image/adapt.js index bf78a79b..3def360e 100644 --- a/dist/3.7.2/min/widget/image/adapt.js +++ b/dist/3.7.3/min/widget/image/adapt.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("widget/image/adapt",e,["../../dom/element","../../dom/element/emerge","../../component/sense"])}(function(e,t,i,n,a,o,r){"use strict";function l(e){var t=this;return t._container.setStyle("paddingBottom",100*e+"%"),t}function c(e,t){var i=this;e.mql=h.create(t).on("matched dematched",function(){d.call(i)})}function d(){for(var e,t,i,n,o,c,d=this,s=0;(e=d._candidates[s])!==r;s++)if(!e.mql||e.mql.matches&&e.mql.matches()===!0){l.call(d,e.ratio),d._visible===!0&&(t=d._image||(d._image=A.create("",{src:"data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",alt:d._caption},{position:"absolute",display:"block",width:"100%",height:"100%",top:"0",left:"0",margin:"0",padding:"0"}).appendTo(d._container)),i=t.element.getBoundingClientRect(),n=Math.round(i.width),o=Math.round(i.width*e.ratio),c=e.url.replace(g,"$1."+n+"x"+o+"@"+(a.devicePixelRatio||1)+".$2"),t.setAttribute("src",c));break}}function s(){for(var e,t=0;(e=_[t])!==r;t++)d.call(e)}function m(){a.clearTimeout(p),p=a.setTimeout(s,200)}var u,p,g=new RegExp("(.+?).(jpg|jpeg|png|gif|webp)$"),A=e["dom/element"],h=e["component/sense"],_=[];return u=e["dom/element/emerge"].extend({_visible:!1,_candidates:null,_container:null,_image:null,_caption:null,_constructor:function(e,t){var i,n,a,o,s=u._parent._constructor.call(this,e,t),m=0;for(i=parseFloat(s.getAttribute("data-ratio")||1),n=s.find('[itemprop="source"],[itemprop="contentUrl"]'),s._candidates=[],s._container=A.create("
").setStyles({position:"relative",display:"block",width:"100%",height:0,padding:0}).appendTo(s),s._caption=(o=s.find('[itemprop="caption"]')[0])?o.getAttribute("content"):null,l.call(s,i);(a=n[m])!==r;m++){var p=parseFloat(a.getAttribute("data-ratio")||i),g=a.getAttribute("data-media")||null;s._candidates.push({ratio:p,url:a.getAttribute("content"),mql:g}),g&&c.call(s,s._candidates[s._candidates.length-1],g)}return s.on("emerged demerged",function(e){s._visible="emerged"===e.type?!0:!1,d.call(s)}),_.push(s),s}}),A.create(a).on("resize orientationchange",m),u}); \ No newline at end of file diff --git a/dist/3.7.2/min/worker.js b/dist/3.7.3/min/worker.js similarity index 96% rename from dist/3.7.2/min/worker.js rename to dist/3.7.3/min/worker.js index 8f641de3..291bfe4f 100644 --- a/dist/3.7.2/min/worker.js +++ b/dist/3.7.3/min/worker.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("worker",e,["./base","./support","./promise/defer"])}(function(e,t,s,n,r,o,p){"use strict";var u=e["promise/defer"],i=new RegExp("Blob$","i"),a=e.support.supportsMethod("Worker"),c=e.support.supportsMethod("URL")?r[e.support.getMethod("URL")]:null,l=e.support.getMethod("Blob")||e.support.getMethod("BlobBuilder"),f="var self = this, regex = new RegExp(',\\s+', 'g'); self.addEventListener('message', function(pEvent) { self.postMessage({ type: 'result', result: self.process(pEvent.data.func).apply(null, pEvent.data.args)}); }, false); self.postProgress = function(pProgress) { self.postMessage({ type: 'progress', progress: pProgress}); }; self.process = function(pFunction) { var functionArguments = pFunction.substring(pFunction.indexOf('(') + 1, pFunction.indexOf(')')).replace(regex, ',').split(','); functionArguments.push(pFunction.substring(pFunction.indexOf('{') + 1, pFunction.lastIndexOf('}'))); return Function.apply(null, functionArguments); };",g=null;return a&&c&&l&&(g=c.createObjectURL(i.test(l)===!0?new r[l]([f],{type:"text/javascript"}):(new r[l]).append(f).getBlob("text/javascript"))),e.base.extend({execute:function(e,t){var s=new u;if(t=t||[],g){var n=new Worker(g);n.addEventListener("message",function(e){switch(e.data.type){case"result":s.resolve(e.data.result)}},!1),n.addEventListener("error",function(e){s.reject(e)},!1),n.postMessage({func:e.toString(),args:t})}else setTimeout(function(){try{s.resolve(e.apply(null,t))}catch(n){s.reject()}},0);return s.promise}})}); \ No newline at end of file diff --git a/dist/latest/max/asset.js b/dist/latest/max/asset.js index 832c5fd2..5494ffea 100644 --- a/dist/latest/max/asset.js +++ b/dist/latest/max/asset.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/base.js b/dist/latest/max/base.js index c1aad9a0..50fbc5e3 100644 --- a/dist/latest/max/base.js +++ b/dist/latest/max/base.js @@ -1,14 +1,14 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js * * Copyright (c) 2015 Dirk Lueth */ -(function(definition, global, navigator, window, document, undefined) { +(function(definition, navigator, global, document, undefined) { "use strict"; function register(id, definition, dependencies, callback) { var namespace = id.split("/"), initialize; @@ -31,7 +31,7 @@ } } } - modules[id] = definition(modules, shared, namespace, navigator, window, document, undefined); + modules[id] = definition(modules, shared, namespace, navigator, global, document, undefined); if (callback) { callback(modules[id]); } @@ -50,10 +50,9 @@ modules[id] = module.create(); }); } - var qoopido = global.qoopido || (global.qoopido = { - register: register, - registerSingleton: registerSingleton - }), shared = qoopido.shared || (qoopido.shared = {}), modules = qoopido.modules || (qoopido.modules = {}), dependencies = [], isInternal = new RegExp("^\\.+\\/"), regexCanonicalize = new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."), removeNeutral = new RegExp("(^\\/)|\\.\\/", "g"); + var qoopido = global.qoopido || (global.qoopido = {}), shared = qoopido.shared || (qoopido.shared = {}), modules = qoopido.modules || (qoopido.modules = {}), dependencies = [], isInternal = new RegExp("^\\.+\\/"), regexCanonicalize = new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."), removeNeutral = new RegExp("(^\\/)|\\.\\/", "g"); + qoopido.register = register; + qoopido.registerSingleton = registerSingleton; function canonicalize(path) { var collapsed; while ((collapsed = path.replace(regexCanonicalize, "")) !== path) { @@ -113,4 +112,4 @@ return instance; } }; -}, this, navigator, window, document); \ No newline at end of file +}, navigator, this, document); \ No newline at end of file diff --git a/dist/latest/max/component/iterator.js b/dist/latest/max/component/iterator.js index 90378983..70aac983 100644 --- a/dist/latest/max/component/iterator.js +++ b/dist/latest/max/component/iterator.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/component/remux.js b/dist/latest/max/component/remux.js index 62464ef3..9e1710f3 100644 --- a/dist/latest/max/component/remux.js +++ b/dist/latest/max/component/remux.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/component/sense.js b/dist/latest/max/component/sense.js index 7e865893..ef31535e 100644 --- a/dist/latest/max/component/sense.js +++ b/dist/latest/max/component/sense.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/dom/collection.js b/dist/latest/max/dom/collection.js index 72141f28..9bb6835b 100644 --- a/dist/latest/max/dom/collection.js +++ b/dist/latest/max/dom/collection.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/dom/element.js b/dist/latest/max/dom/element.js index c4004388..12b2ea9b 100644 --- a/dist/latest/max/dom/element.js +++ b/dist/latest/max/dom/element.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/dom/element/emerge.js b/dist/latest/max/dom/element/emerge.js index 04971155..72ea390a 100644 --- a/dist/latest/max/dom/element/emerge.js +++ b/dist/latest/max/dom/element/emerge.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/dom/element/lazyimage.js b/dist/latest/max/dom/element/lazyimage.js index a84dcf8a..4919cb38 100644 --- a/dist/latest/max/dom/element/lazyimage.js +++ b/dist/latest/max/dom/element/lazyimage.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/dom/element/shrinkimage.js b/dist/latest/max/dom/element/shrinkimage.js index 6dfc18ea..18c90fc3 100644 --- a/dist/latest/max/dom/element/shrinkimage.js +++ b/dist/latest/max/dom/element/shrinkimage.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/dom/event.js b/dist/latest/max/dom/event.js index 8a57094f..f9ded10c 100644 --- a/dist/latest/max/dom/event.js +++ b/dist/latest/max/dom/event.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/emitter.js b/dist/latest/max/emitter.js index d27da22e..20e20ad5 100644 --- a/dist/latest/max/emitter.js +++ b/dist/latest/max/emitter.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/function/load/css.js b/dist/latest/max/function/load/css.js index 88db6d6f..38af4f55 100644 --- a/dist/latest/max/function/load/css.js +++ b/dist/latest/max/function/load/css.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/function/merge.js b/dist/latest/max/function/merge.js index e4a76894..1784bc8b 100644 --- a/dist/latest/max/function/merge.js +++ b/dist/latest/max/function/merge.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/function/proximity.js b/dist/latest/max/function/proximity.js index a0f51b93..9db3786f 100644 --- a/dist/latest/max/function/proximity.js +++ b/dist/latest/max/function/proximity.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/function/unique/string.js b/dist/latest/max/function/unique/string.js index eee99fba..a3ceac9d 100644 --- a/dist/latest/max/function/unique/string.js +++ b/dist/latest/max/function/unique/string.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/function/unique/uuid.js b/dist/latest/max/function/unique/uuid.js index 16073074..4f7bdd6c 100644 --- a/dist/latest/max/function/unique/uuid.js +++ b/dist/latest/max/function/unique/uuid.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/hook/css.js b/dist/latest/max/hook/css.js index 75ac4c86..625e0760 100644 --- a/dist/latest/max/hook/css.js +++ b/dist/latest/max/hook/css.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/hook/event.js b/dist/latest/max/hook/event.js index 329e1e00..84777161 100644 --- a/dist/latest/max/hook/event.js +++ b/dist/latest/max/hook/event.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/jquery/extension/selector.js b/dist/latest/max/jquery/extension/selector.js index ec1b2d66..5cdb1d04 100644 --- a/dist/latest/max/jquery/extension/selector.js +++ b/dist/latest/max/jquery/extension/selector.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/jquery/function/prefetch.js b/dist/latest/max/jquery/function/prefetch.js index ff9dc036..1d349153 100644 --- a/dist/latest/max/jquery/function/prefetch.js +++ b/dist/latest/max/jquery/function/prefetch.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/jquery/plugin/emerge.js b/dist/latest/max/jquery/plugin/emerge.js index 4f3ccb7a..f888e3cf 100644 --- a/dist/latest/max/jquery/plugin/emerge.js +++ b/dist/latest/max/jquery/plugin/emerge.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/jquery/plugin/lazyimage.js b/dist/latest/max/jquery/plugin/lazyimage.js index c51469e8..c45bfeaa 100644 --- a/dist/latest/max/jquery/plugin/lazyimage.js +++ b/dist/latest/max/jquery/plugin/lazyimage.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/jquery/plugin/shrinkimage.js b/dist/latest/max/jquery/plugin/shrinkimage.js index 28c18dd1..e206e0a1 100644 --- a/dist/latest/max/jquery/plugin/shrinkimage.js +++ b/dist/latest/max/jquery/plugin/shrinkimage.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/packages/qoopido.base.js b/dist/latest/max/packages/qoopido.base.js new file mode 100644 index 00000000..50fbc5e3 --- /dev/null +++ b/dist/latest/max/packages/qoopido.base.js @@ -0,0 +1,115 @@ +/*! +* Qoopido.js library +* +* version: 3.7.3 +* date: 2015-08-05 +* author: Dirk Lueth +* website: https://github.com/dlueth/qoopido.js +* +* Copyright (c) 2015 Dirk Lueth +*/ +(function(definition, navigator, global, document, undefined) { + "use strict"; + function register(id, definition, dependencies, callback) { + var namespace = id.split("/"), initialize; + if (modules[id]) { + return modules[id]; + } + initialize = function() { + if (dependencies) { + var path = namespace.slice(0, -1).join("/"), i = 0, dependency, internal; + for (;(dependency = dependencies[i]) !== undefined; i++) { + internal = isInternal.test(dependency); + if (internal) { + dependency = canonicalize(path + "/" + dependency); + } + if (!modules[dependency] && arguments[i]) { + modules[dependency] = arguments[i]; + } + if (internal && !modules[dependency] && typeof console !== "undefined") { + console.error("".concat("[Qoopido.js] ", id, ": Could not load dependency ", dependency)); + } + } + } + modules[id] = definition(modules, shared, namespace, navigator, global, document, undefined); + if (callback) { + callback(modules[id]); + } + return modules[id]; + }; + if (typeof module !== "undefined" && module.exports) { + module.exports = define(initialize); + } else if (typeof define === "function" && define.amd) { + dependencies ? define(dependencies, initialize) : define(initialize); + } else { + initialize(); + } + } + function registerSingleton(id, definition, dependencies) { + register(id, definition, dependencies, function(module) { + modules[id] = module.create(); + }); + } + var qoopido = global.qoopido || (global.qoopido = {}), shared = qoopido.shared || (qoopido.shared = {}), modules = qoopido.modules || (qoopido.modules = {}), dependencies = [], isInternal = new RegExp("^\\.+\\/"), regexCanonicalize = new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."), removeNeutral = new RegExp("(^\\/)|\\.\\/", "g"); + qoopido.register = register; + qoopido.registerSingleton = registerSingleton; + function canonicalize(path) { + var collapsed; + while ((collapsed = path.replace(regexCanonicalize, "")) !== path) { + path = collapsed; + } + return path.replace(removeNeutral, ""); + } + if (!Object.create) { + dependencies.push("./polyfill/object/create"); + } + if (!Object.getOwnPropertyNames) { + dependencies.push("./polyfill/object/getownpropertynames"); + } + if (!Object.getOwnPropertyDescriptor || !function() { + try { + Object.getOwnPropertyDescriptor({ + x: 0 + }, "x"); + return true; + } catch (exception) { + return false; + } + }()) { + dependencies.push("./polyfill/object/getownpropertydescriptor"); + } + register("base", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + function getOwnPropertyDescriptors(object) { + var descriptors = {}, properties = Object.getOwnPropertyNames(object), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + descriptors[property] = Object.getOwnPropertyDescriptor(object, property); + } + return descriptors; + } + function prohibitCall() { + throw new Error("[Qoopido.js] Operation prohibited"); + } + return { + create: function() { + var instance = Object.create(this, getOwnPropertyDescriptors(this)), result; + if (instance._constructor) { + result = instance._constructor.apply(instance, arguments); + } + instance.create = instance.extend = prohibitCall; + return result || instance; + }, + extend: function(properties, final) { + var instance; + properties = properties || {}; + final = final === true; + properties._parent = this; + instance = Object.create(this, getOwnPropertyDescriptors(properties)); + if (final === true) { + instance.extend = prohibitCall; + } + return instance; + } + }; +}, navigator, this, document); \ No newline at end of file diff --git a/dist/latest/max/packages/qoopido.base.legacy.js b/dist/latest/max/packages/qoopido.base.legacy.js new file mode 100644 index 00000000..15a8ca67 --- /dev/null +++ b/dist/latest/max/packages/qoopido.base.legacy.js @@ -0,0 +1,286 @@ +/*! +* Qoopido.js library +* +* version: 3.7.3 +* date: 2015-08-05 +* author: Dirk Lueth +* website: https://github.com/dlueth/qoopido.js +* +* Copyright (c) 2015 Dirk Lueth +*/ +(function(definition, qoopido) { + if (qoopido.register) { + qoopido.register("polyfill/object/defineproperty", definition); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/defineproperty"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.defineProperty || !function() { + try { + Object.defineProperty({}, "x", {}); + return true; + } catch (exception) { + return false; + } + }()) { + var defineProperty = Object.defineProperty, defineGetter = Object.prototype.__defineGetter__, defineSetter = Object.prototype.__defineSetter__; + Object.defineProperty = function(obj, prop, desc) { + if (defineProperty) { + try { + return defineProperty(obj, prop, desc); + } catch (exception) {} + } + if (obj !== Object(obj)) { + throw new TypeError("Object.defineProperty called on non-object"); + } + if (defineGetter && "get" in desc) { + defineGetter.call(obj, prop, desc.get); + } + if (defineSetter && "set" in desc) { + defineSetter.call(obj, prop, desc.set); + } + if ("value" in desc) { + obj[prop] = desc.value; + } + return obj; + }; + } + return Object.defineProperty; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + var dependencies = []; + if (!Object.defineProperty || !function() { + try { + Object.defineProperty({}, "x", {}); + return true; + } catch (exception) { + return false; + } + }()) { + dependencies.push("./defineproperty"); + } + qoopido.register("polyfill/object/defineproperties", definition, dependencies); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/defineproperties"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.defineProperties) { + Object.defineProperties = function(obj, properties) { + if (obj !== Object(obj)) { + throw new TypeError("Object.defineProperties called on non-object"); + } + var name; + for (name in properties) { + if (Object.prototype.hasOwnProperty.call(properties, name)) { + Object.defineProperty(obj, name, properties[name]); + } + } + return obj; + }; + } + return Object.defineProperties; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + var dependencies = []; + if (!Object.defineProperties) { + dependencies.push("./defineproperties"); + } + qoopido.register("polyfill/object/create", definition, dependencies); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/create"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.create) { + Object.create = function(prototype, properties) { + if (typeof prototype !== "object") { + throw new TypeError(); + } + function Constructor() {} + Constructor.prototype = prototype; + var obj = new Constructor(); + if (prototype) { + obj.constructor = Constructor; + } + if (arguments.length > 1) { + if (properties !== Object(properties)) { + throw new TypeError(); + } + Object.defineProperties(obj, properties); + } + return obj; + }; + } + return Object.create; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + qoopido.register("polyfill/object/getownpropertynames", definition); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/getownpropertynames"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.getOwnPropertyNames) { + Object.getOwnPropertyNames = function(obj) { + if (obj !== Object(obj)) { + throw new TypeError("Object.getOwnPropertyNames called on non-object"); + } + var props = [], p; + for (p in obj) { + if (Object.prototype.hasOwnProperty.call(obj, p)) { + props.push(p); + } + } + return props; + }; + } + return Object.getOwnPropertyNames; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + qoopido.register("polyfill/object/getownpropertydescriptor", definition); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/getownpropertydescriptor"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.getOwnPropertyDescriptor || !function() { + try { + Object.getOwnPropertyDescriptor({ + x: 0 + }, "x"); + return true; + } catch (exception) { + return false; + } + }()) { + var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; + Object.getOwnPropertyDescriptor = function(obj, property) { + if (obj !== Object(obj)) { + throw new TypeError(); + } + try { + return getOwnPropertyDescriptor.call(Object, obj, property); + } catch (exception) {} + if (Object.prototype.hasOwnProperty.call(obj, property)) { + return { + value: obj[property], + enumerable: true, + writable: true, + configurable: true + }; + } + }; + } + return Object.getOwnPropertyDescriptor; +}, window.qoopido = window.qoopido || {}); +(function(definition, navigator, global, document, undefined) { + "use strict"; + function register(id, definition, dependencies, callback) { + var namespace = id.split("/"), initialize; + if (modules[id]) { + return modules[id]; + } + initialize = function() { + if (dependencies) { + var path = namespace.slice(0, -1).join("/"), i = 0, dependency, internal; + for (;(dependency = dependencies[i]) !== undefined; i++) { + internal = isInternal.test(dependency); + if (internal) { + dependency = canonicalize(path + "/" + dependency); + } + if (!modules[dependency] && arguments[i]) { + modules[dependency] = arguments[i]; + } + if (internal && !modules[dependency] && typeof console !== "undefined") { + console.error("".concat("[Qoopido.js] ", id, ": Could not load dependency ", dependency)); + } + } + } + modules[id] = definition(modules, shared, namespace, navigator, global, document, undefined); + if (callback) { + callback(modules[id]); + } + return modules[id]; + }; + if (typeof module !== "undefined" && module.exports) { + module.exports = define(initialize); + } else if (typeof define === "function" && define.amd) { + dependencies ? define(dependencies, initialize) : define(initialize); + } else { + initialize(); + } + } + function registerSingleton(id, definition, dependencies) { + register(id, definition, dependencies, function(module) { + modules[id] = module.create(); + }); + } + var qoopido = global.qoopido || (global.qoopido = {}), shared = qoopido.shared || (qoopido.shared = {}), modules = qoopido.modules || (qoopido.modules = {}), dependencies = [], isInternal = new RegExp("^\\.+\\/"), regexCanonicalize = new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."), removeNeutral = new RegExp("(^\\/)|\\.\\/", "g"); + qoopido.register = register; + qoopido.registerSingleton = registerSingleton; + function canonicalize(path) { + var collapsed; + while ((collapsed = path.replace(regexCanonicalize, "")) !== path) { + path = collapsed; + } + return path.replace(removeNeutral, ""); + } + if (!Object.create) { + dependencies.push("./polyfill/object/create"); + } + if (!Object.getOwnPropertyNames) { + dependencies.push("./polyfill/object/getownpropertynames"); + } + if (!Object.getOwnPropertyDescriptor || !function() { + try { + Object.getOwnPropertyDescriptor({ + x: 0 + }, "x"); + return true; + } catch (exception) { + return false; + } + }()) { + dependencies.push("./polyfill/object/getownpropertydescriptor"); + } + register("base", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + function getOwnPropertyDescriptors(object) { + var descriptors = {}, properties = Object.getOwnPropertyNames(object), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + descriptors[property] = Object.getOwnPropertyDescriptor(object, property); + } + return descriptors; + } + function prohibitCall() { + throw new Error("[Qoopido.js] Operation prohibited"); + } + return { + create: function() { + var instance = Object.create(this, getOwnPropertyDescriptors(this)), result; + if (instance._constructor) { + result = instance._constructor.apply(instance, arguments); + } + instance.create = instance.extend = prohibitCall; + return result || instance; + }, + extend: function(properties, final) { + var instance; + properties = properties || {}; + final = final === true; + properties._parent = this; + instance = Object.create(this, getOwnPropertyDescriptors(properties)); + if (final === true) { + instance.extend = prohibitCall; + } + return instance; + } + }; +}, navigator, this, document); \ No newline at end of file diff --git a/dist/latest/max/packages/qoopido.emerge.js b/dist/latest/max/packages/qoopido.emerge.js new file mode 100644 index 00000000..fbbc6f7f --- /dev/null +++ b/dist/latest/max/packages/qoopido.emerge.js @@ -0,0 +1,1453 @@ +/*! +* Qoopido.js library +* +* version: 3.7.3 +* date: 2015-08-05 +* author: Dirk Lueth +* website: https://github.com/dlueth/qoopido.js +* +* Copyright (c) 2015 Dirk Lueth +*/ +(function(definition, navigator, global, document, undefined) { + "use strict"; + function register(id, definition, dependencies, callback) { + var namespace = id.split("/"), initialize; + if (modules[id]) { + return modules[id]; + } + initialize = function() { + if (dependencies) { + var path = namespace.slice(0, -1).join("/"), i = 0, dependency, internal; + for (;(dependency = dependencies[i]) !== undefined; i++) { + internal = isInternal.test(dependency); + if (internal) { + dependency = canonicalize(path + "/" + dependency); + } + if (!modules[dependency] && arguments[i]) { + modules[dependency] = arguments[i]; + } + if (internal && !modules[dependency] && typeof console !== "undefined") { + console.error("".concat("[Qoopido.js] ", id, ": Could not load dependency ", dependency)); + } + } + } + modules[id] = definition(modules, shared, namespace, navigator, global, document, undefined); + if (callback) { + callback(modules[id]); + } + return modules[id]; + }; + if (typeof module !== "undefined" && module.exports) { + module.exports = define(initialize); + } else if (typeof define === "function" && define.amd) { + dependencies ? define(dependencies, initialize) : define(initialize); + } else { + initialize(); + } + } + function registerSingleton(id, definition, dependencies) { + register(id, definition, dependencies, function(module) { + modules[id] = module.create(); + }); + } + var qoopido = global.qoopido || (global.qoopido = {}), shared = qoopido.shared || (qoopido.shared = {}), modules = qoopido.modules || (qoopido.modules = {}), dependencies = [], isInternal = new RegExp("^\\.+\\/"), regexCanonicalize = new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."), removeNeutral = new RegExp("(^\\/)|\\.\\/", "g"); + qoopido.register = register; + qoopido.registerSingleton = registerSingleton; + function canonicalize(path) { + var collapsed; + while ((collapsed = path.replace(regexCanonicalize, "")) !== path) { + path = collapsed; + } + return path.replace(removeNeutral, ""); + } + if (!Object.create) { + dependencies.push("./polyfill/object/create"); + } + if (!Object.getOwnPropertyNames) { + dependencies.push("./polyfill/object/getownpropertynames"); + } + if (!Object.getOwnPropertyDescriptor || !function() { + try { + Object.getOwnPropertyDescriptor({ + x: 0 + }, "x"); + return true; + } catch (exception) { + return false; + } + }()) { + dependencies.push("./polyfill/object/getownpropertydescriptor"); + } + register("base", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + function getOwnPropertyDescriptors(object) { + var descriptors = {}, properties = Object.getOwnPropertyNames(object), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + descriptors[property] = Object.getOwnPropertyDescriptor(object, property); + } + return descriptors; + } + function prohibitCall() { + throw new Error("[Qoopido.js] Operation prohibited"); + } + return { + create: function() { + var instance = Object.create(this, getOwnPropertyDescriptors(this)), result; + if (instance._constructor) { + result = instance._constructor.apply(instance, arguments); + } + instance.create = instance.extend = prohibitCall; + return result || instance; + }, + extend: function(properties, final) { + var instance; + properties = properties || {}; + final = final === true; + properties._parent = this; + instance = Object.create(this, getOwnPropertyDescriptors(properties)); + if (final === true) { + instance.extend = prohibitCall; + } + return instance; + } + }; +}, navigator, this, document); +(function(definition) { + window.qoopido.register("polyfill/string/ucfirst", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!String.prototype.ucfirst) { + String.prototype.ucfirst = function() { + var self = this; + return self.charAt(0).toUpperCase() + self.slice(1); + }; + } + return String.prototype.ucfirst; +}); +(function(definition) { + window.qoopido.register("polyfill/string/lcfirst", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!String.prototype.lcfirst) { + String.prototype.lcfirst = function() { + var self = this; + return self.charAt(0).toLowerCase() + self.slice(1); + }; + } + return String.prototype.lcfirst; +}); +(function(definition) { + window.qoopido.register("polyfill/window/promise", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var STATE_PENDING = void 0, STATE_SEALED = 0, STATE_FULFILLED = 1, STATE_REJECTED = 2, queue = []; + function addCallback(fn, arg) { + var length = queue.push([ fn, arg ]); + if (length === 1) { + scheduleFlushCallbacks(); + } + } + function scheduleFlushCallbacks() { + window.setTimeout(flushCallbacks, 1); + } + function flushCallbacks() { + var i = 0, tuple; + for (;(tuple = queue[i]) !== undefined; i++) { + tuple[0](tuple[1]); + } + queue.length = 0; + } + function handleThenable(promise, value) { + var then = null, resolved; + try { + if (promise === value) { + throw new TypeError("A promises callback cannot return that same promise."); + } + if (typeof value === "function" || typeof value === "object" && value !== null) { + then = value.then; + if (typeof then === "function") { + then.call(value, function(val) { + if (resolved) { + return true; + } + resolved = true; + if (value !== val) { + resolve(promise, val); + } else { + fulfill(promise, val); + } + }, function(val) { + if (resolved) { + return true; + } + resolved = true; + reject(promise, val); + }); + return true; + } + } + } catch (exception) { + if (resolved) { + return true; + } + reject(promise, exception); + return true; + } + return false; + } + function invokeResolver(resolver, promise) { + function resolvePromise(value) { + resolve(promise, value); + } + function rejectPromise(reason) { + reject(promise, reason); + } + try { + resolver(resolvePromise, rejectPromise); + } catch (exception) { + rejectPromise(exception); + } + } + function invokeCallback(settled, promise, callback, detail) { + var hasCallback = typeof callback === "function", value, error, succeeded, failed; + if (hasCallback) { + try { + value = callback(detail); + succeeded = true; + } catch (exception) { + failed = true; + error = exception; + } + } else { + value = detail; + succeeded = true; + } + if (handleThenable(promise, value)) { + return; + } else if (hasCallback && succeeded) { + resolve(promise, value); + } else if (failed) { + reject(promise, error); + } else if (settled === STATE_FULFILLED) { + resolve(promise, value); + } else if (settled === STATE_REJECTED) { + reject(promise, value); + } + } + function resolve(promise, value) { + if (promise === value) { + fulfill(promise, value); + } else if (!handleThenable(promise, value)) { + fulfill(promise, value); + } + } + function fulfill(promise, value) { + if (promise._state !== STATE_PENDING) { + return; + } + promise._state = STATE_SEALED; + promise._detail = value; + addCallback(publishFulfillment, promise); + } + function reject(promise, reason) { + if (promise._state !== STATE_PENDING) { + return; + } + promise._state = STATE_SEALED; + promise._detail = reason; + addCallback(publishRejection, promise); + } + function publishFulfillment(promise) { + publish(promise, promise._state = STATE_FULFILLED); + } + function publishRejection(promise) { + publish(promise, promise._state = STATE_REJECTED); + } + function subscribe(parent, child, onFulfillment, onRejection) { + var subscribers = parent._subscribers, length = subscribers.length; + subscribers[length] = child; + subscribers[length + STATE_FULFILLED] = onFulfillment; + subscribers[length + STATE_REJECTED] = onRejection; + } + function publish(promise, settled) { + var child, callback, subscribers = promise._subscribers, detail = promise._detail, i = 0; + for (;(child = subscribers[i]) !== undefined; i += 3) { + callback = subscribers[i + settled]; + invokeCallback(settled, child, callback, detail); + } + promise._subscribers = null; + } + function Promise(resolver) { + var self = this; + if (typeof resolver !== "function") { + throw new TypeError("You must pass a resolver function as the first argument to the promise constructor"); + } + self._subscribers = []; + invokeResolver(resolver, self); + } + Promise.prototype = { + _state: undefined, + _detail: undefined, + _subscribers: undefined, + then: function(onFulfilled, onRejected) { + var self = this, thenPromise = new Promise(function() {}); + if (self._state) { + addCallback(function invokePromiseCallback() { + invokeCallback(self._state, thenPromise, arguments[self._state - 1], self._detail); + }); + } else { + subscribe(self, thenPromise, onFulfilled, onRejected); + } + return thenPromise; + }, + "catch": function(onRejected) { + return this.then(null, onRejected); + } + }; + if (!window.Promise) { + window.Promise = Promise; + } + return window.Promise; +}); +(function(definition) { + var dependencies = []; + if (!window.Promise) { + dependencies.push("../polyfill/window/promise"); + } + window.qoopido.register("promise/all", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + return function all(promises) { + if (Object.prototype.toString.call(promises) !== "[object Array]") { + throw new TypeError("You must pass an array to all."); + } + return new window.Promise(function(resolve, reject) { + var results = [], remaining = promises.length, i = 0, promise; + if (remaining === 0) { + resolve([]); + } + function resolver(index) { + return function(value) { + resolveAll(index, value); + }; + } + function resolveAll(index, value) { + results[index] = value; + if (--remaining === 0) { + resolve(results); + } + } + for (;(promise = promises[i]) !== undefined; i++) { + if (promise && typeof promise.then === "function") { + promise.then(resolver(i), reject); + } else { + resolveAll(i, promise); + } + } + }); + }; +}); +(function(definition) { + var dependencies = []; + if (!window.Promise) { + dependencies.push("../polyfill/window/promise"); + } + window.qoopido.register("promise/defer", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + return function defer() { + var self = this; + self.promise = new window.Promise(function(resolve, reject) { + self.resolve = resolve; + self.reject = reject; + }); + }; +}); +(function(definition) { + var dependencies = [ "./base", "./promise/all", "./promise/defer" ]; + if (!String.prototype.ucfirst) { + dependencies.push("./polyfill/string/ucfirst"); + } + if (!String.prototype.lcfirst) { + dependencies.push("./polyfill/string/lcfirst"); + } + window.qoopido.registerSingleton("support", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var CombinedPromise = modules["promise/all"], DeferredPromise = modules["promise/defer"], matchPrefix = new RegExp("^(Moz|WebKit|Khtml|ms|O|Icab)(?=[A-Z])"), removeJsPrefix = new RegExp("^(?:webkit|khtml|icab|moz|ms|o)([A-Z])"), removeCssPrefix = new RegExp("^-(?:webkit|khtml|icab|moz|ms|o)-"), convertToCamelCase = new RegExp("-([a-z])", "gi"), convertToHyphens = new RegExp("([A-Z])", "g"), callbackUcfirst = function() { + return arguments[1].ucfirst(); + }, lookup = { + prefix: null, + method: {}, + property: {}, + css: {}, + promises: { + prefix: null, + method: {}, + property: {}, + css: {}, + test: {} + } + }; + function normalize(value) { + return value.replace(removeJsPrefix, "$1").lcfirst().replace(removeCssPrefix, "").replace(convertToCamelCase, callbackUcfirst); + } + return modules["base"].extend({ + test: {}, + pool: shared.pool && shared.pool.dom, + testMultiple: function() { + var test, tests = [], i = 0; + for (;(test = arguments[i]) !== undefined; i++) { + switch (typeof test) { + case "string": + tests.push(this.test[test]()); + break; + + case "boolean": + var deferred = new DeferredPromise(); + !!test ? deferred.resolve() : deferred.reject(); + tests.push(deferred.promise); + break; + + default: + tests.push(test); + break; + } + } + return new CombinedPromise(tests); + }, + getPrefix: function() { + var self = this, stored = lookup.prefix || null, property; + if (stored === null) { + var sample = self.pool ? self.pool.obtain("div") : document.createElement("div"), styles = sample.style; + stored = false; + for (property in styles) { + if (matchPrefix.test(property)) { + stored = property.match(matchPrefix)[0]; + } + } + if (stored === false && "WebkitOpacity" in styles) { + stored = "WebKit"; + } + if (stored === false && "KhtmlOpacity" in styles) { + stored = "Khtml"; + } + stored = lookup.prefix = stored === false ? false : [ stored.toLowerCase(), stored.toLowerCase().ucfirst(), stored ]; + sample.dispose && sample.dispose(); + } + return stored; + }, + getMethod: function(pMethod, pElement) { + pMethod = normalize(pMethod); + pElement = pElement || window; + var type = pElement.tagName, pointer = lookup.method[type] = lookup.method[type] || {}, stored = pointer[pMethod] = lookup.method[type][pMethod] || null; + if (stored === null) { + stored = false; + var candidates, candidate, i = 0, uMethod = pMethod.ucfirst(), prefixes = this.getPrefix(); + if (prefixes !== false) { + candidates = (pMethod + " " + uMethod + " " + prefixes.join(uMethod + " ") + uMethod).split(" "); + } else { + candidates = [ pMethod ]; + } + for (;(candidate = candidates[i]) !== undefined; i++) { + if (pElement[candidate] !== undefined && (typeof pElement[candidate] === "function" || typeof pElement[candidate] === "object")) { + stored = candidate; + break; + } + } + lookup.method[type][pMethod] = stored; + } + return stored; + }, + getProperty: function(pProperty, pElement) { + pProperty = normalize(pProperty); + pElement = pElement || window; + var type = pElement.tagName, pointer = lookup.property[type] = lookup.property[type] || {}, stored = pointer[pProperty] = lookup.property[type][pProperty] || null; + if (stored === null) { + stored = false; + var candidates, candidate, i = 0, uProperty = pProperty.ucfirst(), prefixes = this.getPrefix(); + if (prefixes !== false) { + candidates = (pProperty + " " + uProperty + " " + prefixes.join(uProperty + " ") + uProperty).split(" "); + } else { + candidates = [ pProperty ]; + } + for (i; (candidate = candidates[i]) !== undefined; i++) { + if (pElement[candidate] !== undefined) { + stored = candidate; + break; + } + } + lookup.property[type][pProperty] = stored; + } + return stored; + }, + getCssProperty: function(pProperty) { + pProperty = normalize(pProperty); + var self = this, stored = lookup.css[pProperty] || null; + if (stored === null) { + stored = false; + var candidate, i = 0, sample = self.pool ? self.pool.obtain("div") : document.createElement("div"), uProperty = pProperty.ucfirst(), prefixes = this.getPrefix() || [], candidates = (pProperty + " " + uProperty + " " + prefixes.join(uProperty + " ") + uProperty).split(" "), prefix = ""; + for (i; (candidate = candidates[i]) !== undefined; i++) { + if (sample.style[candidate] !== undefined) { + stored = candidate; + if (i > 0) { + prefix = "-"; + } + break; + } + } + stored = lookup.css[pProperty] = stored !== false ? [ prefix + stored.replace(convertToHyphens, "-$1").toLowerCase(), stored ] : false; + sample.dispose && sample.dispose(); + } + return stored; + }, + supportsPrefix: function() { + return !!this.getPrefix(); + }, + supportsMethod: function(pMethod, pElement) { + return !!this.getMethod(pMethod, pElement); + }, + supportsProperty: function(pProperty, pElement) { + return !!this.getProperty(pProperty, pElement); + }, + supportsCssProperty: function(pProperty) { + return !!this.getCssProperty(pProperty); + }, + testPrefix: function() { + var stored = lookup.promises.prefix; + if (stored === null) { + var deferred = new DeferredPromise(), prefix = this.getPrefix(); + !!prefix ? deferred.resolve(prefix) : deferred.reject(); + stored = lookup.promises.prefix = deferred.promise; + } + return stored; + }, + testMethod: function(pMethod, pElement) { + pElement = pElement || window; + var type = pElement.tagName, pointer = lookup.promises.method[type] = lookup.promises.method[type] || {}, stored = pointer[pMethod] = lookup.promises.method[type][pMethod] || null; + if (stored === null) { + var deferred = new DeferredPromise(), method = this.getMethod(pMethod, pElement); + !!method ? deferred.resolve(method) : deferred.reject(); + stored = lookup.promises.method[type][pMethod] = deferred.promise; + } + return stored; + }, + testProperty: function(pProperty, pElement) { + pElement = pElement || window; + var type = pElement.tagName, pointer = lookup.promises.property[type] = lookup.promises.property[type] || {}, stored = pointer[pProperty] = lookup.promises.property[type][pProperty] || null; + if (stored === null) { + var deferred = new DeferredPromise(), property = this.getProperty(pProperty, pElement); + !!property ? deferred.resolve(property) : deferred.reject(); + stored = lookup.promises.property[type][pProperty] = deferred.promise; + } + return stored; + }, + testCssProperty: function(pProperty) { + var stored = lookup.promises.css[pProperty] || null; + if (stored === null) { + var deferred = new DeferredPromise(), property = this.getCssProperty(pProperty); + !!property ? deferred.resolve(property) : deferred.reject(); + stored = lookup.promises.css[pProperty] = deferred.promise; + } + return stored; + }, + addTest: function(pId, pTest) { + return this.test[pId] = function() { + var stored = lookup.promises.test[pId] || null; + if (stored === null) { + var deferred = new DeferredPromise(), parameter = Array.prototype.slice.call(arguments); + parameter.splice(0, 0, deferred); + pTest.apply(null, parameter); + stored = lookup.promises.test[pId] = deferred.promise; + } + return stored; + }; + } + }); +}); +(function(definition) { + window.qoopido.register("function/merge", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + return function merge() { + var target = arguments[0], i, properties, property, tgt, src; + for (i = 1; (properties = arguments[i]) !== undefined; i++) { + for (property in properties) { + tgt = target[property]; + src = properties[property]; + if (src !== undefined) { + if (src !== null && typeof src === "object") { + if (src.length !== undefined) { + tgt = tgt && typeof tgt === "object" && tgt.length !== undefined ? tgt : []; + } else { + tgt = tgt && typeof tgt === "object" && tgt.length === undefined ? tgt : {}; + } + target[property] = merge(tgt, src); + } else { + target[property] = src; + } + } + } + } + return target; + }; +}); +(function(definition) { + window.qoopido.register("function/unique/uuid", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var lookup = {}, regex = new RegExp("[xy]", "g"); + function generateUuid() { + return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(regex, function(c) { + var r = Math.random() * 16 | 0, v = c === "x" ? r : r & 3 | 8; + return v.toString(16); + }); + } + return function() { + var result; + do { + result = generateUuid(); + } while (typeof lookup[result] !== "undefined"); + lookup[result] = true; + return result; + }; +}); +(function(definition) { + window.qoopido.registerSingleton("hook/event", definition, [ "../base" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + function transferProperties(event, originalEvent, properties) { + var i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + event[property] = originalEvent[property]; + } + event._properties = event._properties.concat(properties); + } + var hooks = { + general: { + properties: "type altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which path".split(" "), + process: function(event, originalEvent) { + var pointer; + event.originalEvent = originalEvent; + event.isDefaultPrevented = originalEvent.defaultPrevented ? true : false; + event.isPropagationStopped = originalEvent.cancelBubble ? true : false; + event.metaKey = originalEvent.metaKey && originalEvent.metaKey !== false ? true : false; + if (!event.target) { + event.target = originalEvent.srcElement || document; + } + if (event.target.nodeType === 3) { + event.target = event.target.parentNode; + } + if (!event.path) { + event.path = []; + pointer = event.target; + do { + event.path.push(pointer); + } while (pointer = pointer.parentNode); + event.path.push(window); + } + } + }, + mouse: { + regex: new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"), + properties: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement dataTransfer".split(" "), + process: function(event, originalEvent) { + var pointer, fromElement, which; + fromElement = originalEvent.fromElement; + which = originalEvent.button; + if (event.pageX === null && originalEvent.clientX !== null) { + pointer = event.target.ownerDocument || document; + pointer = pointer.documentElement || pointer.body; + event.pageX = originalEvent.clientX + (pointer.scrollLeft || 0) - (pointer.clientLeft || 0); + event.pageY = originalEvent.clientY + (pointer.scrollTop || 0) - (pointer.clientTop || 0); + } + if (!event.relatedTarget && fromElement) { + event.relatedTarget = fromElement === event.target ? originalEvent.toElement : fromElement; + } + if (!event.which && which !== undefined) { + event.which = which & 1 ? 1 : which & 2 ? 3 : which & 4 ? 2 : 0; + } + } + }, + key: { + regex: new RegExp("^(?:key)"), + properties: "char charCode key keyCode".split(" "), + process: function(event, originalEvent) { + if (event.which === null) { + event.which = originalEvent.charCode !== null ? originalEvent.charCode : originalEvent.keyCode; + } + } + } + }; + return modules["base"].extend({ + add: function(property, hook) { + if (property && hook && hooks[property]) { + hooks[property] = hook; + } + return this; + }, + get: function(property) { + if (property && hooks[property]) { + return hooks[property]; + } + return null; + }, + process: function(event, originalEvent) { + var id, hook, isMatch; + for (id in hooks) { + hook = hooks[id]; + isMatch = !hook.regex || hook.regex.test(originalEvent.type); + if (isMatch) { + if (hook.properties) { + transferProperties(event, originalEvent, hook.properties); + } + if (hook.process) { + hook.process(event, originalEvent); + } + if (hook.delegate) { + event.delegate = hook.delegate; + } + } + } + } + }); +}); +(function(definition) { + var dependencies = [ "../base", "../support" ]; + if (!window.getComputedStyle) { + dependencies.push("../polyfill/window/getcomputedstyle"); + } + window.qoopido.registerSingleton("hook/css", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var mSupport = modules["support"], getComputedStyle = window.getComputedStyle || modules["polyfill/window/getcomputedstyle"], hooks = { + general: { + get: function(element, property) { + return getComputedStyle(element, null).getPropertyValue(property[0]); + }, + set: function(element, property, value) { + element.style[property[1]] = value; + } + }, + opacity: !mSupport.supportsCssProperty("opacity") ? { + regex: new RegExp("alpha\\(opacity=(.*)\\)", "i"), + get: function(element, property, value) { + value = getComputedStyle(element, null).getPropertyValue("filter").toString().match(this.regex); + if (value) { + value = value[1] / 100; + } else { + value = 1; + } + return value; + }, + set: function(element, property, value) { + var style = element.style; + style.zoom = 1; + style.filter = "alpha(opacity=" + (value * 100 + .5 >> 0) + ")"; + } + } : null + }; + return modules["base"].extend({ + add: function(property, hook) { + if (property && hook && hooks[property]) { + hooks[property] = hook; + } + return this; + }, + get: function(property) { + if (property && hooks[property]) { + return hooks[property]; + } + return null; + }, + process: function(method, element, property, value) { + var hook; + property = mSupport.getCssProperty(property, element) || null; + if (property) { + return ((hook = this.get(property[1])) && hook[method] || this.get("general")[method])(element, property, value); + } + } + }); +}); +(function(definition) { + window.qoopido.register("dom/event", definition, [ "../base", "../hook/event" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var hooks = modules["hook/event"]; + return modules["base"].extend({ + originalEvent: null, + isDelegate: false, + isDefaultPrevented: false, + isPropagationStopped: false, + isImmediatePropagationStopped: false, + _properties: null, + _constructor: function(event) { + var self = this; + self._properties = []; + self._obtain(event); + return self; + }, + _obtain: function(event) { + hooks.process(this, event); + }, + _dispose: function() { + var self = this, i = 0, property; + for (;(property = self._properties[i]) !== undefined; i++) { + delete self[property]; + } + delete self.delegate; + self.originalEvent = null; + self.isDelegate = false; + self.isDefaultPrevented = false; + self.isPropagationStopped = false; + self.isImmediatePropagationStopped = false; + self._properties.length = 0; + }, + preventDefault: function() { + var self = this, event = self.originalEvent; + if (event.cancelable !== false) { + self.isDefaultPrevented = true; + if (event.preventDefault) { + event.preventDefault(); + } else { + event.returnValue = false; + } + } + }, + stopPropagation: function() { + var self = this, event = self.originalEvent; + self.isPropagationStopped = true; + if (event.stopPropagation) { + event.stopPropagation(); + } + event.cancelBubble = true; + }, + stopImmediatePropagation: function() { + var self = this, event = self.originalEvent; + self.isImmediatePropagationStopped = true; + if (event.stopImmediatePropagation) { + event.stopImmediatePropagation(); + } + self.stopPropagation(); + } + }); +}); +(function(definition) { + var dependencies = [ "../base", "../function/unique/uuid", "../hook/css", "./event" ]; + if (!window.CustomEvent) { + dependencies.push("../polyfill/window/customevent"); + } + if (!window.addEventListener) { + dependencies.push("../polyfill/window/addeventlistener"); + } + if (!window.removeEventListener) { + dependencies.push("../polyfill/window/removeeventlistener"); + } + if (!window.dispatchEvent) { + dependencies.push("../polyfill/window/dispatchevent"); + } + if (!Element.prototype.matches) { + dependencies.push("../polyfill/element/matches"); + } + if (!document.querySelector) { + dependencies.push("../polyfill/document/queryselector"); + } + if (!document.querySelectorAll) { + dependencies.push("../polyfill/document/queryselectorall"); + } + if (!String.prototype.trim) { + dependencies.push("../polyfill/string/trim"); + } + window.qoopido.register("dom/element", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var stringObject = "object", stringString = "string", generateUuid = modules["function/unique/uuid"], head = document.getElementsByTagName("head")[0], contentAttribute = "textContent" in document.createElement("a") ? "textContent" : "innerText", previousSibling = typeof head.previousElementSibling !== "undefined" ? function previousSibling() { + return this.previousElementSibling; + } : function previousSibling() { + var element = this; + while (element = element.previousSibling) { + if (element.nodeType === 1) { + return element; + } + } + }, nextSibling = typeof head.nextElementSibling !== "undefined" ? function nextSibling() { + return this.nextElementSibling; + } : function nextSibling() { + var element = this; + while (element = element.nextSibling) { + if (element.nodeType === 1) { + return element; + } + } + }, isTag = new RegExp("^<(\\w+)\\s*/>$"), matchEvent = new RegExp("^[^-]+"), splitList = new RegExp(" +", "g"), pool = modules["pool/module"] && modules["pool/module"].create(modules["dom/event"], null, true) || null, hooks = modules["hook/css"], storage = {}, events = { + custom: { + type: "CustomEvent", + method: "initCustomEvent" + }, + html: { + regex: new RegExp("^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$"), + type: "HTMLEvents", + method: "initEvent" + }, + mouse: { + regex: new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"), + type: "MouseEvents", + method: "initMouseEvent" + } + }; + function resolveEvent(type) { + var id, prototype, candidate; + for (id in events) { + prototype = events[id]; + if (!prototype.regex || prototype.regex.test(type)) { + candidate = prototype; + } + } + return candidate; + } + function emitEvent(type, detail, uuid) { + var self = this, prototype = resolveEvent(type), event = document.createEvent(prototype.type); + event[prototype.method](type, type === "load" ? false : true, true, detail); + if (uuid) { + event._quid = uuid; + event.isDelegate = true; + } + self.element.dispatchEvent(event); + } + function resolveElement(element) { + var tag; + if (typeof element === "string") { + try { + if (isTag.test(element) === true) { + tag = element.replace(isTag, "$1").toLowerCase(); + element = document.createElement(tag); + } else { + element = document.querySelector(element); + } + } catch (exception) { + element = null; + } + } + if (!element) { + throw new Error("[Qoopido.js] Element could not be resolved"); + } + return element; + } + function resolveArguments(parameters) { + return Array.prototype.concat.apply([], Array.prototype.splice.call(parameters, 0)).join(" ").split(splitList); + } + function matchesDelegate(event, delegate) { + var i = 0, pointer; + for (;(pointer = event.path[i]) !== undefined; i++) { + if (pointer.matches(delegate)) { + event.currentTarget = pointer; + return true; + } + if (pointer === event.currentTarget) { + break; + } + } + return false; + } + return modules["base"].extend({ + type: null, + element: null, + _listener: null, + _constructor: function(element, attributes, styles) { + var self = this, uuid; + element = resolveElement(element); + uuid = element._quid; + if (!uuid) { + uuid = element._quid = generateUuid(); + self.type = element.tagName; + self.element = element; + self._listener = {}; + storage[uuid] = self; + } else { + self = storage[uuid]; + } + if (typeof attributes === "object" && attributes !== null) { + self.setAttributes(attributes); + } + if (typeof styles === "object" && styles !== null) { + self.setStyles(styles); + } + if (self !== this) { + this.dispose && this.dispose(); + } + return self; + }, + _obtain: function(element, attributes, styles) { + this._constructor(element, attributes, styles); + }, + _dispose: function() { + var self = this, id, event; + for (id in self._listener) { + event = id.match(matchEvent); + self.element.removeEventListener(event, self._listener[id]); + delete self._listener[id]; + } + self.type = null; + self.element = null; + }, + getContent: function(html) { + var element = this.element; + return html && html !== false ? element.innerHTML : element[contentAttribute]; + }, + setContent: function(content, html) { + var self = this, element = self.element; + if (html && html !== false) { + element.innerHTML = content; + } else { + element[contentAttribute] = content; + } + return self; + }, + getAttribute: function(attribute) { + var self = this; + if (attribute && typeof attribute === stringString) { + return self.element.getAttribute(attribute); + } + }, + getAttributes: function() { + var self = this, result = {}, attributes = resolveArguments(arguments), i = 0, attribute; + for (;(attribute = attributes[i]) !== undefined; i++) { + result[attribute] = self.element.getAttribute(attribute); + } + return result; + }, + setAttribute: function(attribute, value) { + var self = this; + if (attribute && typeof attribute === stringString) { + self.element.setAttribute(attribute, value); + } + return self; + }, + setAttributes: function(attributes) { + var self = this, attribute; + if (attributes && typeof attributes === stringObject && !attributes.length) { + for (attribute in attributes) { + self.element.setAttribute(attribute, attributes[attribute]); + } + } + return self; + }, + removeAttribute: function(attribute) { + var self = this; + if (attribute && typeof attribute === stringString) { + self.element.removeAttribute(attribute); + } + return self; + }, + removeAttributes: function() { + var self = this, attributes = resolveArguments(arguments), i = 0, attribute; + for (;(attribute = attributes[i]) !== undefined; i++) { + self.element.removeAttribute(attribute); + } + return self; + }, + getStyle: function(property) { + var self = this; + if (property && typeof property === stringString) { + return hooks.process("get", self.element, property); + } + }, + getStyles: function() { + var self = this, result = {}, properties = resolveArguments(arguments), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + result[property] = hooks.process("get", self.element, property); + } + return result; + }, + setStyle: function(property, value) { + var self = this; + if (property && typeof property === stringString) { + hooks.process("set", self.element, property, value); + } + return self; + }, + setStyles: function(properties) { + var self = this, property; + if (properties && typeof properties === stringObject && !properties.length) { + for (property in properties) { + hooks.process("set", self.element, property, properties[property]); + } + } + return self; + }, + removeStyle: function(property) { + var self = this; + if (property && typeof property === stringString) { + self.setStyle(property, ""); + } + return self; + }, + removeStyles: function() { + var self = this, properties = resolveArguments(arguments), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + self.setStyle(property, ""); + } + return self; + }, + siblings: function(selector) { + var element = this.element, pointer = element.parentNode.firstChild, siblings = []; + for (;pointer; pointer = nextSibling.call(pointer)) { + if (pointer !== element && (!selector || pointer.matches(selector))) { + siblings.push(pointer); + } + } + return siblings; + }, + siblingsBefore: function(selector) { + var pointer = this.element.previousSibling, siblings = []; + for (;pointer; pointer = previousSibling.call(pointer)) { + if (!selector || pointer.matches(selector)) { + siblings.push(pointer); + } + } + return siblings; + }, + siblingsAfter: function(selector) { + var pointer = this.element.nextSibling, siblings = []; + for (;pointer; pointer = nextSibling.call(pointer)) { + if (!selector || pointer.matches(selector)) { + siblings.push(pointer); + } + } + return siblings; + }, + previous: function(selector) { + var pointer = previousSibling.call(this.element); + if (!selector) { + return pointer; + } else { + for (;pointer; pointer = previousSibling.call(pointer)) { + if (pointer.matches(selector)) { + return pointer; + } + } + } + }, + next: function(selector) { + var pointer = nextSibling.call(this.element); + if (!selector) { + return pointer; + } else { + for (;pointer; pointer = nextSibling.call(pointer)) { + if (pointer.matches(selector)) { + return pointer; + } + } + } + }, + find: function(selector) { + var self = this.element, uuid, matches; + selector = selector.trim(); + if (selector.charAt(0) === ">") { + uuid = self._quid; + self.setAttribute("data-quid", uuid); + selector = '[data-quid="' + uuid + '"] ' + selector; + matches = self.parentNode.querySelectorAll(selector); + self.removeAttribute("data-quid"); + } else { + matches = self.querySelectorAll(selector); + } + return matches; + }, + parent: function(selector) { + var pointer; + if (!selector) { + return this.element.parentNode; + } else { + pointer = this.element; + for (;pointer; pointer = pointer.parentNode) { + if (pointer.matches(selector)) { + return pointer; + } + } + } + }, + parents: function(selector) { + var pointer = this.element.parentNode, parents = []; + for (;pointer; pointer = pointer.parentNode) { + if (pointer.nodeType === 9) { + return parents; + } else if (pointer.nodeType === 1) { + if (!selector || pointer.matches(selector)) { + parents.push(pointer); + } + } + } + }, + isVisible: function() { + var self = this, element = self.element; + return !(element.offsetWidth <= 0 && element.offsetHeight <= 0 || self.getStyle("visibility") === "hidden" || self.getStyle("opacity") <= 0); + }, + hasClass: function(name) { + return name ? new RegExp("(?:^|\\s)" + name + "(?:\\s|$)").test(this.element.className) : false; + }, + addClass: function(name) { + var self = this; + if (name && !self.hasClass(name)) { + self.element.className += self.element.className ? " " + name : name; + } + return self; + }, + removeClass: function(name) { + var self = this; + if (name && self.hasClass(name)) { + self.element.className = self.element.className.replace(new RegExp("(?:^|\\s)" + name + "(?!\\S)"), ""); + } + return self; + }, + toggleClass: function(name) { + var self = this; + if (name) { + self.hasClass(name) ? self.removeClass(name) : self.addClass(name); + } + return self; + }, + prepend: function(element) { + var self = this, target = self.element; + if (element) { + try { + element = element.element || resolveElement(element); + target.firstChild ? target.insertBefore(element, target.firstChild) : self.append(element); + } catch (exception) { + target.insertAdjacentHTML("afterBegin", element); + } + } + return self; + }, + append: function(element) { + var self = this, target = self.element; + if (element) { + try { + target.appendChild(element.element || resolveElement(element)); + } catch (exception) { + target.insertAdjacentHTML("beforeEnd", element); + } + } + return self; + }, + prependTo: function(target) { + var self = this, element = self.element; + if (target) { + (target = target.element || resolveElement(target)).firstChild ? target.insertBefore(element, target.firstChild) : self.appendTo(target); + } + return self; + }, + appendTo: function(target) { + var self = this; + if (target) { + (target.element || resolveElement(target)).appendChild(self.element); + } + return self; + }, + insertBefore: function(target) { + var self = this, element = self.element; + if (target) { + (target = target.element || resolveElement(target)).parentNode.insertBefore(element, target); + } + return self; + }, + insertAfter: function(target) { + var self = this, element = self.element; + if (target) { + (target = target.element || resolveElement(target)).nextSibling ? target.parentNode.insertBefore(element, target.nextSibling) : self.appendTo(target.parentNode); + } + return self; + }, + replace: function(target) { + var self = this, element = self.element; + if (target) { + (target = target.element || resolveElement(target)).parentNode.replaceChild(element, target); + } + return self; + }, + replaceWith: function(element) { + var self = this, target = self.element; + if (element) { + element = element.element || resolveElement(element); + target.parentNode.replaceChild(element, target); + } + return self; + }, + remove: function() { + var self = this, element = self.element; + element.parentNode.removeChild(element); + return self; + }, + on: function(events) { + var self = this, element = self.element, delegate = arguments.length > 2 ? arguments[1] : null, fn = arguments.length > 2 ? arguments[2] : arguments[1], uuid = fn._quid || (fn._quid = generateUuid()), i = 0, event; + events = events.split(" "); + for (;(event = events[i]) !== undefined; i++) { + var id = event + "-" + uuid, listener = function(event) { + var delegateTo; + event = pool && pool.obtain(event) || modules["dom/event"].create(event); + if (!event.isPropagationStopped) { + delegateTo = event.delegate; + event._quid = generateUuid(); + if (!delegate || matchesDelegate(event, delegate)) { + fn.call(event.currentTarget, event, event.originalEvent.detail); + } + if (delegateTo) { + delete event.delegate; + emitEvent.call(self, delegateTo); + } + } + event.dispose && event.dispose(); + }; + listener.type = event; + self._listener[id] = listener; + element.addEventListener(event, listener); + } + return self; + }, + one: function(events) { + var self = this, delegate = arguments.length > 3 || typeof arguments[1] === "string" ? arguments[1] : null, fn = arguments.length > 3 || typeof arguments[2] === "function" ? arguments[2] : arguments[1], each = (arguments.length > 3 ? arguments[3] : arguments[2]) !== false, listener = function(event) { + self.off(each === true ? event.type : events, listener); + fn.call(this, event, event.originalEvent.detail); + }; + fn._quid = listener._quid = generateUuid(); + if (delegate) { + self.on(events, delegate, listener); + } else { + self.on(events, listener); + } + return self; + }, + off: function(events, fn) { + var self = this, element = self.element, i = 0, event, id, listener; + events = events.split(" "); + for (;(event = events[i]) !== undefined; i++) { + id = fn._quid && event + "-" + fn._quid || null; + listener = id && self._listener[id] || null; + if (listener) { + element.removeEventListener(event, listener); + delete self._listener[id]; + } else { + element.removeEventListener(event, fn); + } + } + return self; + }, + emit: function(event, data) { + var self = this; + emitEvent.call(self, event, data); + return self; + } + }); +}); +(function(definition) { + window.qoopido.register("dom/element/emerge", definition, [ "../element", "../../function/merge", "../../function/unique/uuid" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var defaults = { + interval: 50, + threshold: "auto", + recur: true, + auto: 1, + visibility: true + }, documentElement = window.document.documentElement, viewport = {}, intervals = {}, elements = {}, prototype, EVENT_EMERGED = "emerged", EVENT_DEMERGED = "demerged", DOM_RESIZE = "resize orientationchange"; + window = modules["dom/element"].create(window); + if (document.compatMode !== "CSS1Compat") { + throw "[Qoopido.js] Not in standards mode"; + } + function tick(interval) { + var index, pointer = elements[interval]; + for (index in pointer) { + if (index !== "length") { + checkState.call(pointer[index]); + } + } + if (pointer.length === 0) { + window.element.clearInterval(intervals[interval]); + delete intervals[interval]; + } + } + function globalOnResize() { + viewport.left = 0; + viewport.top = 0; + viewport.right = window.innerWidth || documentElement.clientWidth; + viewport.bottom = window.innerHeight || documentElement.clientHeight; + } + function instanceOnResize() { + var self = this, treshold = self._settings.threshold, x = treshold !== undefined ? treshold : documentElement.clientWidth * self._settings.auto, y = treshold !== undefined ? treshold : documentElement.clientHeight * self._settings.auto; + self._viewport.left = viewport.left - x; + self._viewport.top = viewport.top - y; + self._viewport.right = viewport.right + x; + self._viewport.bottom = viewport.bottom + y; + } + function checkState() { + var self = this, state = false, priority = 2, boundaries; + if (self.isVisible() && (self.getStyle("visibility") !== "hidden" || self._settings.visibility === false)) { + boundaries = self.element.getBoundingClientRect(); + if ((boundaries.bottom >= self._viewport.top && boundaries.bottom <= self._viewport.bottom || boundaries.top >= self._viewport.top && boundaries.top <= self._viewport.bottom || self._viewport.bottom >= boundaries.top && self._viewport.bottom <= boundaries.bottom || self._viewport.top >= boundaries.top && self._viewport.top <= boundaries.bottom) && (boundaries.left >= self._viewport.left && boundaries.left <= self._viewport.right || boundaries.right >= self._viewport.left && boundaries.right <= self._viewport.right || self._viewport.left >= boundaries.left && self._viewport.left <= boundaries.right || self._viewport.right >= boundaries.left && self._viewport.right <= boundaries.right)) { + if (self._settings.threshold === 0 || (boundaries.bottom >= viewport.top && boundaries.bottom <= viewport.bottom || boundaries.top >= viewport.top && boundaries.top <= viewport.bottom || viewport.bottom >= boundaries.top && viewport.bottom <= boundaries.bottom || viewport.top >= boundaries.top && viewport.top <= boundaries.bottom) && (boundaries.left >= viewport.left && boundaries.left <= viewport.right || boundaries.right >= viewport.left && boundaries.right <= viewport.right || viewport.left >= boundaries.left && viewport.left <= boundaries.right || viewport.right >= boundaries.left && viewport.right <= boundaries.right)) { + priority = 1; + } + state = true; + } + } + if (state !== self._state || state === true && priority !== self._priority) { + setState.call(self, state, priority); + } + } + function setState(state, priority) { + var self = this; + self._state = state; + self._priority = priority; + if (self._settings.recur !== true) { + self.remove(); + } + if (state === true) { + self.emit(EVENT_EMERGED, priority); + } else { + self.emit(EVENT_DEMERGED); + } + } + prototype = modules["dom/element"].extend({ + _quid: null, + _viewport: null, + _settings: null, + _state: null, + _priority: null, + _constructor: function(element, settings) { + var self = prototype._parent._constructor.call(this, element); + settings = modules["function/merge"]({}, defaults, settings || {}); + if (settings.threshold === "auto") { + delete settings.threshold; + } + if (intervals[settings.interval] === undefined) { + elements[settings.interval] = elements[settings.interval] || { + length: 0 + }; + intervals[settings.interval] = window.element.setInterval(function() { + tick(settings.interval); + }, settings.interval); + } + self._quid = modules["function/unique/uuid"](); + self._viewport = {}; + self._settings = settings; + self._state = false; + self._priority = 2; + elements[settings.interval][self._quid] = self; + elements[settings.interval].length++; + window.on(DOM_RESIZE, function() { + instanceOnResize.call(self); + }); + instanceOnResize.call(self); + return self; + }, + remove: function() { + var self = this; + delete elements[self._settings.interval][self._quid]; + elements[self._settings.interval].length--; + } + }); + window.on(DOM_RESIZE, globalOnResize); + globalOnResize(); + return prototype; +}); \ No newline at end of file diff --git a/dist/latest/max/packages/qoopido.emerge.legacy.js b/dist/latest/max/packages/qoopido.emerge.legacy.js new file mode 100644 index 00000000..aed5e61f --- /dev/null +++ b/dist/latest/max/packages/qoopido.emerge.legacy.js @@ -0,0 +1,1649 @@ +/*! +* Qoopido.js library +* +* version: 3.7.3 +* date: 2015-08-05 +* author: Dirk Lueth +* website: https://github.com/dlueth/qoopido.js +* +* Copyright (c) 2015 Dirk Lueth +*/ +(function(definition, qoopido) { + if (qoopido.register) { + qoopido.register("polyfill/object/defineproperty", definition); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/defineproperty"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.defineProperty || !function() { + try { + Object.defineProperty({}, "x", {}); + return true; + } catch (exception) { + return false; + } + }()) { + var defineProperty = Object.defineProperty, defineGetter = Object.prototype.__defineGetter__, defineSetter = Object.prototype.__defineSetter__; + Object.defineProperty = function(obj, prop, desc) { + if (defineProperty) { + try { + return defineProperty(obj, prop, desc); + } catch (exception) {} + } + if (obj !== Object(obj)) { + throw new TypeError("Object.defineProperty called on non-object"); + } + if (defineGetter && "get" in desc) { + defineGetter.call(obj, prop, desc.get); + } + if (defineSetter && "set" in desc) { + defineSetter.call(obj, prop, desc.set); + } + if ("value" in desc) { + obj[prop] = desc.value; + } + return obj; + }; + } + return Object.defineProperty; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + var dependencies = []; + if (!Object.defineProperty || !function() { + try { + Object.defineProperty({}, "x", {}); + return true; + } catch (exception) { + return false; + } + }()) { + dependencies.push("./defineproperty"); + } + qoopido.register("polyfill/object/defineproperties", definition, dependencies); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/defineproperties"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.defineProperties) { + Object.defineProperties = function(obj, properties) { + if (obj !== Object(obj)) { + throw new TypeError("Object.defineProperties called on non-object"); + } + var name; + for (name in properties) { + if (Object.prototype.hasOwnProperty.call(properties, name)) { + Object.defineProperty(obj, name, properties[name]); + } + } + return obj; + }; + } + return Object.defineProperties; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + var dependencies = []; + if (!Object.defineProperties) { + dependencies.push("./defineproperties"); + } + qoopido.register("polyfill/object/create", definition, dependencies); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/create"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.create) { + Object.create = function(prototype, properties) { + if (typeof prototype !== "object") { + throw new TypeError(); + } + function Constructor() {} + Constructor.prototype = prototype; + var obj = new Constructor(); + if (prototype) { + obj.constructor = Constructor; + } + if (arguments.length > 1) { + if (properties !== Object(properties)) { + throw new TypeError(); + } + Object.defineProperties(obj, properties); + } + return obj; + }; + } + return Object.create; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + qoopido.register("polyfill/object/getownpropertynames", definition); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/getownpropertynames"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.getOwnPropertyNames) { + Object.getOwnPropertyNames = function(obj) { + if (obj !== Object(obj)) { + throw new TypeError("Object.getOwnPropertyNames called on non-object"); + } + var props = [], p; + for (p in obj) { + if (Object.prototype.hasOwnProperty.call(obj, p)) { + props.push(p); + } + } + return props; + }; + } + return Object.getOwnPropertyNames; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + qoopido.register("polyfill/object/getownpropertydescriptor", definition); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/getownpropertydescriptor"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.getOwnPropertyDescriptor || !function() { + try { + Object.getOwnPropertyDescriptor({ + x: 0 + }, "x"); + return true; + } catch (exception) { + return false; + } + }()) { + var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; + Object.getOwnPropertyDescriptor = function(obj, property) { + if (obj !== Object(obj)) { + throw new TypeError(); + } + try { + return getOwnPropertyDescriptor.call(Object, obj, property); + } catch (exception) {} + if (Object.prototype.hasOwnProperty.call(obj, property)) { + return { + value: obj[property], + enumerable: true, + writable: true, + configurable: true + }; + } + }; + } + return Object.getOwnPropertyDescriptor; +}, window.qoopido = window.qoopido || {}); +(function(definition, navigator, global, document, undefined) { + "use strict"; + function register(id, definition, dependencies, callback) { + var namespace = id.split("/"), initialize; + if (modules[id]) { + return modules[id]; + } + initialize = function() { + if (dependencies) { + var path = namespace.slice(0, -1).join("/"), i = 0, dependency, internal; + for (;(dependency = dependencies[i]) !== undefined; i++) { + internal = isInternal.test(dependency); + if (internal) { + dependency = canonicalize(path + "/" + dependency); + } + if (!modules[dependency] && arguments[i]) { + modules[dependency] = arguments[i]; + } + if (internal && !modules[dependency] && typeof console !== "undefined") { + console.error("".concat("[Qoopido.js] ", id, ": Could not load dependency ", dependency)); + } + } + } + modules[id] = definition(modules, shared, namespace, navigator, global, document, undefined); + if (callback) { + callback(modules[id]); + } + return modules[id]; + }; + if (typeof module !== "undefined" && module.exports) { + module.exports = define(initialize); + } else if (typeof define === "function" && define.amd) { + dependencies ? define(dependencies, initialize) : define(initialize); + } else { + initialize(); + } + } + function registerSingleton(id, definition, dependencies) { + register(id, definition, dependencies, function(module) { + modules[id] = module.create(); + }); + } + var qoopido = global.qoopido || (global.qoopido = {}), shared = qoopido.shared || (qoopido.shared = {}), modules = qoopido.modules || (qoopido.modules = {}), dependencies = [], isInternal = new RegExp("^\\.+\\/"), regexCanonicalize = new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."), removeNeutral = new RegExp("(^\\/)|\\.\\/", "g"); + qoopido.register = register; + qoopido.registerSingleton = registerSingleton; + function canonicalize(path) { + var collapsed; + while ((collapsed = path.replace(regexCanonicalize, "")) !== path) { + path = collapsed; + } + return path.replace(removeNeutral, ""); + } + if (!Object.create) { + dependencies.push("./polyfill/object/create"); + } + if (!Object.getOwnPropertyNames) { + dependencies.push("./polyfill/object/getownpropertynames"); + } + if (!Object.getOwnPropertyDescriptor || !function() { + try { + Object.getOwnPropertyDescriptor({ + x: 0 + }, "x"); + return true; + } catch (exception) { + return false; + } + }()) { + dependencies.push("./polyfill/object/getownpropertydescriptor"); + } + register("base", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + function getOwnPropertyDescriptors(object) { + var descriptors = {}, properties = Object.getOwnPropertyNames(object), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + descriptors[property] = Object.getOwnPropertyDescriptor(object, property); + } + return descriptors; + } + function prohibitCall() { + throw new Error("[Qoopido.js] Operation prohibited"); + } + return { + create: function() { + var instance = Object.create(this, getOwnPropertyDescriptors(this)), result; + if (instance._constructor) { + result = instance._constructor.apply(instance, arguments); + } + instance.create = instance.extend = prohibitCall; + return result || instance; + }, + extend: function(properties, final) { + var instance; + properties = properties || {}; + final = final === true; + properties._parent = this; + instance = Object.create(this, getOwnPropertyDescriptors(properties)); + if (final === true) { + instance.extend = prohibitCall; + } + return instance; + } + }; +}, navigator, this, document); +(function(definition) { + window.qoopido.register("polyfill/string/ucfirst", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!String.prototype.ucfirst) { + String.prototype.ucfirst = function() { + var self = this; + return self.charAt(0).toUpperCase() + self.slice(1); + }; + } + return String.prototype.ucfirst; +}); +(function(definition) { + window.qoopido.register("polyfill/string/lcfirst", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!String.prototype.lcfirst) { + String.prototype.lcfirst = function() { + var self = this; + return self.charAt(0).toLowerCase() + self.slice(1); + }; + } + return String.prototype.lcfirst; +}); +(function(definition) { + window.qoopido.register("polyfill/window/getcomputedstyle", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!window.getComputedStyle) { + var getComputedStyleRegex = new RegExp("(\\-([a-z]){1})", "g"), getComputedStyleCallback = function() { + return arguments[2].toUpperCase(); + }; + return function(element, pseudo) { + var self = this; + self.getPropertyValue = function(property) { + if (property === "float") { + property = "styleFloat"; + } + if (getComputedStyleRegex.test(property)) { + property = property.replace(getComputedStyleRegex, getComputedStyleCallback); + } + return element.currentStyle[property] || null; + }; + return self; + }; + } else { + return window.getComputedStyle; + } +}); +(function(definition) { + window.qoopido.register("polyfill/window/promise", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var STATE_PENDING = void 0, STATE_SEALED = 0, STATE_FULFILLED = 1, STATE_REJECTED = 2, queue = []; + function addCallback(fn, arg) { + var length = queue.push([ fn, arg ]); + if (length === 1) { + scheduleFlushCallbacks(); + } + } + function scheduleFlushCallbacks() { + window.setTimeout(flushCallbacks, 1); + } + function flushCallbacks() { + var i = 0, tuple; + for (;(tuple = queue[i]) !== undefined; i++) { + tuple[0](tuple[1]); + } + queue.length = 0; + } + function handleThenable(promise, value) { + var then = null, resolved; + try { + if (promise === value) { + throw new TypeError("A promises callback cannot return that same promise."); + } + if (typeof value === "function" || typeof value === "object" && value !== null) { + then = value.then; + if (typeof then === "function") { + then.call(value, function(val) { + if (resolved) { + return true; + } + resolved = true; + if (value !== val) { + resolve(promise, val); + } else { + fulfill(promise, val); + } + }, function(val) { + if (resolved) { + return true; + } + resolved = true; + reject(promise, val); + }); + return true; + } + } + } catch (exception) { + if (resolved) { + return true; + } + reject(promise, exception); + return true; + } + return false; + } + function invokeResolver(resolver, promise) { + function resolvePromise(value) { + resolve(promise, value); + } + function rejectPromise(reason) { + reject(promise, reason); + } + try { + resolver(resolvePromise, rejectPromise); + } catch (exception) { + rejectPromise(exception); + } + } + function invokeCallback(settled, promise, callback, detail) { + var hasCallback = typeof callback === "function", value, error, succeeded, failed; + if (hasCallback) { + try { + value = callback(detail); + succeeded = true; + } catch (exception) { + failed = true; + error = exception; + } + } else { + value = detail; + succeeded = true; + } + if (handleThenable(promise, value)) { + return; + } else if (hasCallback && succeeded) { + resolve(promise, value); + } else if (failed) { + reject(promise, error); + } else if (settled === STATE_FULFILLED) { + resolve(promise, value); + } else if (settled === STATE_REJECTED) { + reject(promise, value); + } + } + function resolve(promise, value) { + if (promise === value) { + fulfill(promise, value); + } else if (!handleThenable(promise, value)) { + fulfill(promise, value); + } + } + function fulfill(promise, value) { + if (promise._state !== STATE_PENDING) { + return; + } + promise._state = STATE_SEALED; + promise._detail = value; + addCallback(publishFulfillment, promise); + } + function reject(promise, reason) { + if (promise._state !== STATE_PENDING) { + return; + } + promise._state = STATE_SEALED; + promise._detail = reason; + addCallback(publishRejection, promise); + } + function publishFulfillment(promise) { + publish(promise, promise._state = STATE_FULFILLED); + } + function publishRejection(promise) { + publish(promise, promise._state = STATE_REJECTED); + } + function subscribe(parent, child, onFulfillment, onRejection) { + var subscribers = parent._subscribers, length = subscribers.length; + subscribers[length] = child; + subscribers[length + STATE_FULFILLED] = onFulfillment; + subscribers[length + STATE_REJECTED] = onRejection; + } + function publish(promise, settled) { + var child, callback, subscribers = promise._subscribers, detail = promise._detail, i = 0; + for (;(child = subscribers[i]) !== undefined; i += 3) { + callback = subscribers[i + settled]; + invokeCallback(settled, child, callback, detail); + } + promise._subscribers = null; + } + function Promise(resolver) { + var self = this; + if (typeof resolver !== "function") { + throw new TypeError("You must pass a resolver function as the first argument to the promise constructor"); + } + self._subscribers = []; + invokeResolver(resolver, self); + } + Promise.prototype = { + _state: undefined, + _detail: undefined, + _subscribers: undefined, + then: function(onFulfilled, onRejected) { + var self = this, thenPromise = new Promise(function() {}); + if (self._state) { + addCallback(function invokePromiseCallback() { + invokeCallback(self._state, thenPromise, arguments[self._state - 1], self._detail); + }); + } else { + subscribe(self, thenPromise, onFulfilled, onRejected); + } + return thenPromise; + }, + "catch": function(onRejected) { + return this.then(null, onRejected); + } + }; + if (!window.Promise) { + window.Promise = Promise; + } + return window.Promise; +}); +(function(definition) { + var dependencies = []; + if (!window.Promise) { + dependencies.push("../polyfill/window/promise"); + } + window.qoopido.register("promise/all", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + return function all(promises) { + if (Object.prototype.toString.call(promises) !== "[object Array]") { + throw new TypeError("You must pass an array to all."); + } + return new window.Promise(function(resolve, reject) { + var results = [], remaining = promises.length, i = 0, promise; + if (remaining === 0) { + resolve([]); + } + function resolver(index) { + return function(value) { + resolveAll(index, value); + }; + } + function resolveAll(index, value) { + results[index] = value; + if (--remaining === 0) { + resolve(results); + } + } + for (;(promise = promises[i]) !== undefined; i++) { + if (promise && typeof promise.then === "function") { + promise.then(resolver(i), reject); + } else { + resolveAll(i, promise); + } + } + }); + }; +}); +(function(definition) { + var dependencies = []; + if (!window.Promise) { + dependencies.push("../polyfill/window/promise"); + } + window.qoopido.register("promise/defer", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + return function defer() { + var self = this; + self.promise = new window.Promise(function(resolve, reject) { + self.resolve = resolve; + self.reject = reject; + }); + }; +}); +(function(definition) { + var dependencies = [ "./base", "./promise/all", "./promise/defer" ]; + if (!String.prototype.ucfirst) { + dependencies.push("./polyfill/string/ucfirst"); + } + if (!String.prototype.lcfirst) { + dependencies.push("./polyfill/string/lcfirst"); + } + window.qoopido.registerSingleton("support", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var CombinedPromise = modules["promise/all"], DeferredPromise = modules["promise/defer"], matchPrefix = new RegExp("^(Moz|WebKit|Khtml|ms|O|Icab)(?=[A-Z])"), removeJsPrefix = new RegExp("^(?:webkit|khtml|icab|moz|ms|o)([A-Z])"), removeCssPrefix = new RegExp("^-(?:webkit|khtml|icab|moz|ms|o)-"), convertToCamelCase = new RegExp("-([a-z])", "gi"), convertToHyphens = new RegExp("([A-Z])", "g"), callbackUcfirst = function() { + return arguments[1].ucfirst(); + }, lookup = { + prefix: null, + method: {}, + property: {}, + css: {}, + promises: { + prefix: null, + method: {}, + property: {}, + css: {}, + test: {} + } + }; + function normalize(value) { + return value.replace(removeJsPrefix, "$1").lcfirst().replace(removeCssPrefix, "").replace(convertToCamelCase, callbackUcfirst); + } + return modules["base"].extend({ + test: {}, + pool: shared.pool && shared.pool.dom, + testMultiple: function() { + var test, tests = [], i = 0; + for (;(test = arguments[i]) !== undefined; i++) { + switch (typeof test) { + case "string": + tests.push(this.test[test]()); + break; + + case "boolean": + var deferred = new DeferredPromise(); + !!test ? deferred.resolve() : deferred.reject(); + tests.push(deferred.promise); + break; + + default: + tests.push(test); + break; + } + } + return new CombinedPromise(tests); + }, + getPrefix: function() { + var self = this, stored = lookup.prefix || null, property; + if (stored === null) { + var sample = self.pool ? self.pool.obtain("div") : document.createElement("div"), styles = sample.style; + stored = false; + for (property in styles) { + if (matchPrefix.test(property)) { + stored = property.match(matchPrefix)[0]; + } + } + if (stored === false && "WebkitOpacity" in styles) { + stored = "WebKit"; + } + if (stored === false && "KhtmlOpacity" in styles) { + stored = "Khtml"; + } + stored = lookup.prefix = stored === false ? false : [ stored.toLowerCase(), stored.toLowerCase().ucfirst(), stored ]; + sample.dispose && sample.dispose(); + } + return stored; + }, + getMethod: function(pMethod, pElement) { + pMethod = normalize(pMethod); + pElement = pElement || window; + var type = pElement.tagName, pointer = lookup.method[type] = lookup.method[type] || {}, stored = pointer[pMethod] = lookup.method[type][pMethod] || null; + if (stored === null) { + stored = false; + var candidates, candidate, i = 0, uMethod = pMethod.ucfirst(), prefixes = this.getPrefix(); + if (prefixes !== false) { + candidates = (pMethod + " " + uMethod + " " + prefixes.join(uMethod + " ") + uMethod).split(" "); + } else { + candidates = [ pMethod ]; + } + for (;(candidate = candidates[i]) !== undefined; i++) { + if (pElement[candidate] !== undefined && (typeof pElement[candidate] === "function" || typeof pElement[candidate] === "object")) { + stored = candidate; + break; + } + } + lookup.method[type][pMethod] = stored; + } + return stored; + }, + getProperty: function(pProperty, pElement) { + pProperty = normalize(pProperty); + pElement = pElement || window; + var type = pElement.tagName, pointer = lookup.property[type] = lookup.property[type] || {}, stored = pointer[pProperty] = lookup.property[type][pProperty] || null; + if (stored === null) { + stored = false; + var candidates, candidate, i = 0, uProperty = pProperty.ucfirst(), prefixes = this.getPrefix(); + if (prefixes !== false) { + candidates = (pProperty + " " + uProperty + " " + prefixes.join(uProperty + " ") + uProperty).split(" "); + } else { + candidates = [ pProperty ]; + } + for (i; (candidate = candidates[i]) !== undefined; i++) { + if (pElement[candidate] !== undefined) { + stored = candidate; + break; + } + } + lookup.property[type][pProperty] = stored; + } + return stored; + }, + getCssProperty: function(pProperty) { + pProperty = normalize(pProperty); + var self = this, stored = lookup.css[pProperty] || null; + if (stored === null) { + stored = false; + var candidate, i = 0, sample = self.pool ? self.pool.obtain("div") : document.createElement("div"), uProperty = pProperty.ucfirst(), prefixes = this.getPrefix() || [], candidates = (pProperty + " " + uProperty + " " + prefixes.join(uProperty + " ") + uProperty).split(" "), prefix = ""; + for (i; (candidate = candidates[i]) !== undefined; i++) { + if (sample.style[candidate] !== undefined) { + stored = candidate; + if (i > 0) { + prefix = "-"; + } + break; + } + } + stored = lookup.css[pProperty] = stored !== false ? [ prefix + stored.replace(convertToHyphens, "-$1").toLowerCase(), stored ] : false; + sample.dispose && sample.dispose(); + } + return stored; + }, + supportsPrefix: function() { + return !!this.getPrefix(); + }, + supportsMethod: function(pMethod, pElement) { + return !!this.getMethod(pMethod, pElement); + }, + supportsProperty: function(pProperty, pElement) { + return !!this.getProperty(pProperty, pElement); + }, + supportsCssProperty: function(pProperty) { + return !!this.getCssProperty(pProperty); + }, + testPrefix: function() { + var stored = lookup.promises.prefix; + if (stored === null) { + var deferred = new DeferredPromise(), prefix = this.getPrefix(); + !!prefix ? deferred.resolve(prefix) : deferred.reject(); + stored = lookup.promises.prefix = deferred.promise; + } + return stored; + }, + testMethod: function(pMethod, pElement) { + pElement = pElement || window; + var type = pElement.tagName, pointer = lookup.promises.method[type] = lookup.promises.method[type] || {}, stored = pointer[pMethod] = lookup.promises.method[type][pMethod] || null; + if (stored === null) { + var deferred = new DeferredPromise(), method = this.getMethod(pMethod, pElement); + !!method ? deferred.resolve(method) : deferred.reject(); + stored = lookup.promises.method[type][pMethod] = deferred.promise; + } + return stored; + }, + testProperty: function(pProperty, pElement) { + pElement = pElement || window; + var type = pElement.tagName, pointer = lookup.promises.property[type] = lookup.promises.property[type] || {}, stored = pointer[pProperty] = lookup.promises.property[type][pProperty] || null; + if (stored === null) { + var deferred = new DeferredPromise(), property = this.getProperty(pProperty, pElement); + !!property ? deferred.resolve(property) : deferred.reject(); + stored = lookup.promises.property[type][pProperty] = deferred.promise; + } + return stored; + }, + testCssProperty: function(pProperty) { + var stored = lookup.promises.css[pProperty] || null; + if (stored === null) { + var deferred = new DeferredPromise(), property = this.getCssProperty(pProperty); + !!property ? deferred.resolve(property) : deferred.reject(); + stored = lookup.promises.css[pProperty] = deferred.promise; + } + return stored; + }, + addTest: function(pId, pTest) { + return this.test[pId] = function() { + var stored = lookup.promises.test[pId] || null; + if (stored === null) { + var deferred = new DeferredPromise(), parameter = Array.prototype.slice.call(arguments); + parameter.splice(0, 0, deferred); + pTest.apply(null, parameter); + stored = lookup.promises.test[pId] = deferred.promise; + } + return stored; + }; + } + }); +}); +(function(definition) { + window.qoopido.register("function/merge", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + return function merge() { + var target = arguments[0], i, properties, property, tgt, src; + for (i = 1; (properties = arguments[i]) !== undefined; i++) { + for (property in properties) { + tgt = target[property]; + src = properties[property]; + if (src !== undefined) { + if (src !== null && typeof src === "object") { + if (src.length !== undefined) { + tgt = tgt && typeof tgt === "object" && tgt.length !== undefined ? tgt : []; + } else { + tgt = tgt && typeof tgt === "object" && tgt.length === undefined ? tgt : {}; + } + target[property] = merge(tgt, src); + } else { + target[property] = src; + } + } + } + } + return target; + }; +}); +(function(definition) { + window.qoopido.register("function/unique/uuid", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var lookup = {}, regex = new RegExp("[xy]", "g"); + function generateUuid() { + return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(regex, function(c) { + var r = Math.random() * 16 | 0, v = c === "x" ? r : r & 3 | 8; + return v.toString(16); + }); + } + return function() { + var result; + do { + result = generateUuid(); + } while (typeof lookup[result] !== "undefined"); + lookup[result] = true; + return result; + }; +}); +(function(definition) { + window.qoopido.registerSingleton("hook/event", definition, [ "../base" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + function transferProperties(event, originalEvent, properties) { + var i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + event[property] = originalEvent[property]; + } + event._properties = event._properties.concat(properties); + } + var hooks = { + general: { + properties: "type altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which path".split(" "), + process: function(event, originalEvent) { + var pointer; + event.originalEvent = originalEvent; + event.isDefaultPrevented = originalEvent.defaultPrevented ? true : false; + event.isPropagationStopped = originalEvent.cancelBubble ? true : false; + event.metaKey = originalEvent.metaKey && originalEvent.metaKey !== false ? true : false; + if (!event.target) { + event.target = originalEvent.srcElement || document; + } + if (event.target.nodeType === 3) { + event.target = event.target.parentNode; + } + if (!event.path) { + event.path = []; + pointer = event.target; + do { + event.path.push(pointer); + } while (pointer = pointer.parentNode); + event.path.push(window); + } + } + }, + mouse: { + regex: new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"), + properties: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement dataTransfer".split(" "), + process: function(event, originalEvent) { + var pointer, fromElement, which; + fromElement = originalEvent.fromElement; + which = originalEvent.button; + if (event.pageX === null && originalEvent.clientX !== null) { + pointer = event.target.ownerDocument || document; + pointer = pointer.documentElement || pointer.body; + event.pageX = originalEvent.clientX + (pointer.scrollLeft || 0) - (pointer.clientLeft || 0); + event.pageY = originalEvent.clientY + (pointer.scrollTop || 0) - (pointer.clientTop || 0); + } + if (!event.relatedTarget && fromElement) { + event.relatedTarget = fromElement === event.target ? originalEvent.toElement : fromElement; + } + if (!event.which && which !== undefined) { + event.which = which & 1 ? 1 : which & 2 ? 3 : which & 4 ? 2 : 0; + } + } + }, + key: { + regex: new RegExp("^(?:key)"), + properties: "char charCode key keyCode".split(" "), + process: function(event, originalEvent) { + if (event.which === null) { + event.which = originalEvent.charCode !== null ? originalEvent.charCode : originalEvent.keyCode; + } + } + } + }; + return modules["base"].extend({ + add: function(property, hook) { + if (property && hook && hooks[property]) { + hooks[property] = hook; + } + return this; + }, + get: function(property) { + if (property && hooks[property]) { + return hooks[property]; + } + return null; + }, + process: function(event, originalEvent) { + var id, hook, isMatch; + for (id in hooks) { + hook = hooks[id]; + isMatch = !hook.regex || hook.regex.test(originalEvent.type); + if (isMatch) { + if (hook.properties) { + transferProperties(event, originalEvent, hook.properties); + } + if (hook.process) { + hook.process(event, originalEvent); + } + if (hook.delegate) { + event.delegate = hook.delegate; + } + } + } + } + }); +}); +(function(definition) { + var dependencies = [ "../base", "../support" ]; + if (!window.getComputedStyle) { + dependencies.push("../polyfill/window/getcomputedstyle"); + } + window.qoopido.registerSingleton("hook/css", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var mSupport = modules["support"], getComputedStyle = window.getComputedStyle || modules["polyfill/window/getcomputedstyle"], hooks = { + general: { + get: function(element, property) { + return getComputedStyle(element, null).getPropertyValue(property[0]); + }, + set: function(element, property, value) { + element.style[property[1]] = value; + } + }, + opacity: !mSupport.supportsCssProperty("opacity") ? { + regex: new RegExp("alpha\\(opacity=(.*)\\)", "i"), + get: function(element, property, value) { + value = getComputedStyle(element, null).getPropertyValue("filter").toString().match(this.regex); + if (value) { + value = value[1] / 100; + } else { + value = 1; + } + return value; + }, + set: function(element, property, value) { + var style = element.style; + style.zoom = 1; + style.filter = "alpha(opacity=" + (value * 100 + .5 >> 0) + ")"; + } + } : null + }; + return modules["base"].extend({ + add: function(property, hook) { + if (property && hook && hooks[property]) { + hooks[property] = hook; + } + return this; + }, + get: function(property) { + if (property && hooks[property]) { + return hooks[property]; + } + return null; + }, + process: function(method, element, property, value) { + var hook; + property = mSupport.getCssProperty(property, element) || null; + if (property) { + return ((hook = this.get(property[1])) && hook[method] || this.get("general")[method])(element, property, value); + } + } + }); +}); +(function(definition) { + window.qoopido.register("dom/event", definition, [ "../base", "../hook/event" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var hooks = modules["hook/event"]; + return modules["base"].extend({ + originalEvent: null, + isDelegate: false, + isDefaultPrevented: false, + isPropagationStopped: false, + isImmediatePropagationStopped: false, + _properties: null, + _constructor: function(event) { + var self = this; + self._properties = []; + self._obtain(event); + return self; + }, + _obtain: function(event) { + hooks.process(this, event); + }, + _dispose: function() { + var self = this, i = 0, property; + for (;(property = self._properties[i]) !== undefined; i++) { + delete self[property]; + } + delete self.delegate; + self.originalEvent = null; + self.isDelegate = false; + self.isDefaultPrevented = false; + self.isPropagationStopped = false; + self.isImmediatePropagationStopped = false; + self._properties.length = 0; + }, + preventDefault: function() { + var self = this, event = self.originalEvent; + if (event.cancelable !== false) { + self.isDefaultPrevented = true; + if (event.preventDefault) { + event.preventDefault(); + } else { + event.returnValue = false; + } + } + }, + stopPropagation: function() { + var self = this, event = self.originalEvent; + self.isPropagationStopped = true; + if (event.stopPropagation) { + event.stopPropagation(); + } + event.cancelBubble = true; + }, + stopImmediatePropagation: function() { + var self = this, event = self.originalEvent; + self.isImmediatePropagationStopped = true; + if (event.stopImmediatePropagation) { + event.stopImmediatePropagation(); + } + self.stopPropagation(); + } + }); +}); +(function(definition) { + var dependencies = [ "../base", "../function/unique/uuid", "../hook/css", "./event" ]; + if (!window.CustomEvent) { + dependencies.push("../polyfill/window/customevent"); + } + if (!window.addEventListener) { + dependencies.push("../polyfill/window/addeventlistener"); + } + if (!window.removeEventListener) { + dependencies.push("../polyfill/window/removeeventlistener"); + } + if (!window.dispatchEvent) { + dependencies.push("../polyfill/window/dispatchevent"); + } + if (!Element.prototype.matches) { + dependencies.push("../polyfill/element/matches"); + } + if (!document.querySelector) { + dependencies.push("../polyfill/document/queryselector"); + } + if (!document.querySelectorAll) { + dependencies.push("../polyfill/document/queryselectorall"); + } + if (!String.prototype.trim) { + dependencies.push("../polyfill/string/trim"); + } + window.qoopido.register("dom/element", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var stringObject = "object", stringString = "string", generateUuid = modules["function/unique/uuid"], head = document.getElementsByTagName("head")[0], contentAttribute = "textContent" in document.createElement("a") ? "textContent" : "innerText", previousSibling = typeof head.previousElementSibling !== "undefined" ? function previousSibling() { + return this.previousElementSibling; + } : function previousSibling() { + var element = this; + while (element = element.previousSibling) { + if (element.nodeType === 1) { + return element; + } + } + }, nextSibling = typeof head.nextElementSibling !== "undefined" ? function nextSibling() { + return this.nextElementSibling; + } : function nextSibling() { + var element = this; + while (element = element.nextSibling) { + if (element.nodeType === 1) { + return element; + } + } + }, isTag = new RegExp("^<(\\w+)\\s*/>$"), matchEvent = new RegExp("^[^-]+"), splitList = new RegExp(" +", "g"), pool = modules["pool/module"] && modules["pool/module"].create(modules["dom/event"], null, true) || null, hooks = modules["hook/css"], storage = {}, events = { + custom: { + type: "CustomEvent", + method: "initCustomEvent" + }, + html: { + regex: new RegExp("^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$"), + type: "HTMLEvents", + method: "initEvent" + }, + mouse: { + regex: new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"), + type: "MouseEvents", + method: "initMouseEvent" + } + }; + function resolveEvent(type) { + var id, prototype, candidate; + for (id in events) { + prototype = events[id]; + if (!prototype.regex || prototype.regex.test(type)) { + candidate = prototype; + } + } + return candidate; + } + function emitEvent(type, detail, uuid) { + var self = this, prototype = resolveEvent(type), event = document.createEvent(prototype.type); + event[prototype.method](type, type === "load" ? false : true, true, detail); + if (uuid) { + event._quid = uuid; + event.isDelegate = true; + } + self.element.dispatchEvent(event); + } + function resolveElement(element) { + var tag; + if (typeof element === "string") { + try { + if (isTag.test(element) === true) { + tag = element.replace(isTag, "$1").toLowerCase(); + element = document.createElement(tag); + } else { + element = document.querySelector(element); + } + } catch (exception) { + element = null; + } + } + if (!element) { + throw new Error("[Qoopido.js] Element could not be resolved"); + } + return element; + } + function resolveArguments(parameters) { + return Array.prototype.concat.apply([], Array.prototype.splice.call(parameters, 0)).join(" ").split(splitList); + } + function matchesDelegate(event, delegate) { + var i = 0, pointer; + for (;(pointer = event.path[i]) !== undefined; i++) { + if (pointer.matches(delegate)) { + event.currentTarget = pointer; + return true; + } + if (pointer === event.currentTarget) { + break; + } + } + return false; + } + return modules["base"].extend({ + type: null, + element: null, + _listener: null, + _constructor: function(element, attributes, styles) { + var self = this, uuid; + element = resolveElement(element); + uuid = element._quid; + if (!uuid) { + uuid = element._quid = generateUuid(); + self.type = element.tagName; + self.element = element; + self._listener = {}; + storage[uuid] = self; + } else { + self = storage[uuid]; + } + if (typeof attributes === "object" && attributes !== null) { + self.setAttributes(attributes); + } + if (typeof styles === "object" && styles !== null) { + self.setStyles(styles); + } + if (self !== this) { + this.dispose && this.dispose(); + } + return self; + }, + _obtain: function(element, attributes, styles) { + this._constructor(element, attributes, styles); + }, + _dispose: function() { + var self = this, id, event; + for (id in self._listener) { + event = id.match(matchEvent); + self.element.removeEventListener(event, self._listener[id]); + delete self._listener[id]; + } + self.type = null; + self.element = null; + }, + getContent: function(html) { + var element = this.element; + return html && html !== false ? element.innerHTML : element[contentAttribute]; + }, + setContent: function(content, html) { + var self = this, element = self.element; + if (html && html !== false) { + element.innerHTML = content; + } else { + element[contentAttribute] = content; + } + return self; + }, + getAttribute: function(attribute) { + var self = this; + if (attribute && typeof attribute === stringString) { + return self.element.getAttribute(attribute); + } + }, + getAttributes: function() { + var self = this, result = {}, attributes = resolveArguments(arguments), i = 0, attribute; + for (;(attribute = attributes[i]) !== undefined; i++) { + result[attribute] = self.element.getAttribute(attribute); + } + return result; + }, + setAttribute: function(attribute, value) { + var self = this; + if (attribute && typeof attribute === stringString) { + self.element.setAttribute(attribute, value); + } + return self; + }, + setAttributes: function(attributes) { + var self = this, attribute; + if (attributes && typeof attributes === stringObject && !attributes.length) { + for (attribute in attributes) { + self.element.setAttribute(attribute, attributes[attribute]); + } + } + return self; + }, + removeAttribute: function(attribute) { + var self = this; + if (attribute && typeof attribute === stringString) { + self.element.removeAttribute(attribute); + } + return self; + }, + removeAttributes: function() { + var self = this, attributes = resolveArguments(arguments), i = 0, attribute; + for (;(attribute = attributes[i]) !== undefined; i++) { + self.element.removeAttribute(attribute); + } + return self; + }, + getStyle: function(property) { + var self = this; + if (property && typeof property === stringString) { + return hooks.process("get", self.element, property); + } + }, + getStyles: function() { + var self = this, result = {}, properties = resolveArguments(arguments), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + result[property] = hooks.process("get", self.element, property); + } + return result; + }, + setStyle: function(property, value) { + var self = this; + if (property && typeof property === stringString) { + hooks.process("set", self.element, property, value); + } + return self; + }, + setStyles: function(properties) { + var self = this, property; + if (properties && typeof properties === stringObject && !properties.length) { + for (property in properties) { + hooks.process("set", self.element, property, properties[property]); + } + } + return self; + }, + removeStyle: function(property) { + var self = this; + if (property && typeof property === stringString) { + self.setStyle(property, ""); + } + return self; + }, + removeStyles: function() { + var self = this, properties = resolveArguments(arguments), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + self.setStyle(property, ""); + } + return self; + }, + siblings: function(selector) { + var element = this.element, pointer = element.parentNode.firstChild, siblings = []; + for (;pointer; pointer = nextSibling.call(pointer)) { + if (pointer !== element && (!selector || pointer.matches(selector))) { + siblings.push(pointer); + } + } + return siblings; + }, + siblingsBefore: function(selector) { + var pointer = this.element.previousSibling, siblings = []; + for (;pointer; pointer = previousSibling.call(pointer)) { + if (!selector || pointer.matches(selector)) { + siblings.push(pointer); + } + } + return siblings; + }, + siblingsAfter: function(selector) { + var pointer = this.element.nextSibling, siblings = []; + for (;pointer; pointer = nextSibling.call(pointer)) { + if (!selector || pointer.matches(selector)) { + siblings.push(pointer); + } + } + return siblings; + }, + previous: function(selector) { + var pointer = previousSibling.call(this.element); + if (!selector) { + return pointer; + } else { + for (;pointer; pointer = previousSibling.call(pointer)) { + if (pointer.matches(selector)) { + return pointer; + } + } + } + }, + next: function(selector) { + var pointer = nextSibling.call(this.element); + if (!selector) { + return pointer; + } else { + for (;pointer; pointer = nextSibling.call(pointer)) { + if (pointer.matches(selector)) { + return pointer; + } + } + } + }, + find: function(selector) { + var self = this.element, uuid, matches; + selector = selector.trim(); + if (selector.charAt(0) === ">") { + uuid = self._quid; + self.setAttribute("data-quid", uuid); + selector = '[data-quid="' + uuid + '"] ' + selector; + matches = self.parentNode.querySelectorAll(selector); + self.removeAttribute("data-quid"); + } else { + matches = self.querySelectorAll(selector); + } + return matches; + }, + parent: function(selector) { + var pointer; + if (!selector) { + return this.element.parentNode; + } else { + pointer = this.element; + for (;pointer; pointer = pointer.parentNode) { + if (pointer.matches(selector)) { + return pointer; + } + } + } + }, + parents: function(selector) { + var pointer = this.element.parentNode, parents = []; + for (;pointer; pointer = pointer.parentNode) { + if (pointer.nodeType === 9) { + return parents; + } else if (pointer.nodeType === 1) { + if (!selector || pointer.matches(selector)) { + parents.push(pointer); + } + } + } + }, + isVisible: function() { + var self = this, element = self.element; + return !(element.offsetWidth <= 0 && element.offsetHeight <= 0 || self.getStyle("visibility") === "hidden" || self.getStyle("opacity") <= 0); + }, + hasClass: function(name) { + return name ? new RegExp("(?:^|\\s)" + name + "(?:\\s|$)").test(this.element.className) : false; + }, + addClass: function(name) { + var self = this; + if (name && !self.hasClass(name)) { + self.element.className += self.element.className ? " " + name : name; + } + return self; + }, + removeClass: function(name) { + var self = this; + if (name && self.hasClass(name)) { + self.element.className = self.element.className.replace(new RegExp("(?:^|\\s)" + name + "(?!\\S)"), ""); + } + return self; + }, + toggleClass: function(name) { + var self = this; + if (name) { + self.hasClass(name) ? self.removeClass(name) : self.addClass(name); + } + return self; + }, + prepend: function(element) { + var self = this, target = self.element; + if (element) { + try { + element = element.element || resolveElement(element); + target.firstChild ? target.insertBefore(element, target.firstChild) : self.append(element); + } catch (exception) { + target.insertAdjacentHTML("afterBegin", element); + } + } + return self; + }, + append: function(element) { + var self = this, target = self.element; + if (element) { + try { + target.appendChild(element.element || resolveElement(element)); + } catch (exception) { + target.insertAdjacentHTML("beforeEnd", element); + } + } + return self; + }, + prependTo: function(target) { + var self = this, element = self.element; + if (target) { + (target = target.element || resolveElement(target)).firstChild ? target.insertBefore(element, target.firstChild) : self.appendTo(target); + } + return self; + }, + appendTo: function(target) { + var self = this; + if (target) { + (target.element || resolveElement(target)).appendChild(self.element); + } + return self; + }, + insertBefore: function(target) { + var self = this, element = self.element; + if (target) { + (target = target.element || resolveElement(target)).parentNode.insertBefore(element, target); + } + return self; + }, + insertAfter: function(target) { + var self = this, element = self.element; + if (target) { + (target = target.element || resolveElement(target)).nextSibling ? target.parentNode.insertBefore(element, target.nextSibling) : self.appendTo(target.parentNode); + } + return self; + }, + replace: function(target) { + var self = this, element = self.element; + if (target) { + (target = target.element || resolveElement(target)).parentNode.replaceChild(element, target); + } + return self; + }, + replaceWith: function(element) { + var self = this, target = self.element; + if (element) { + element = element.element || resolveElement(element); + target.parentNode.replaceChild(element, target); + } + return self; + }, + remove: function() { + var self = this, element = self.element; + element.parentNode.removeChild(element); + return self; + }, + on: function(events) { + var self = this, element = self.element, delegate = arguments.length > 2 ? arguments[1] : null, fn = arguments.length > 2 ? arguments[2] : arguments[1], uuid = fn._quid || (fn._quid = generateUuid()), i = 0, event; + events = events.split(" "); + for (;(event = events[i]) !== undefined; i++) { + var id = event + "-" + uuid, listener = function(event) { + var delegateTo; + event = pool && pool.obtain(event) || modules["dom/event"].create(event); + if (!event.isPropagationStopped) { + delegateTo = event.delegate; + event._quid = generateUuid(); + if (!delegate || matchesDelegate(event, delegate)) { + fn.call(event.currentTarget, event, event.originalEvent.detail); + } + if (delegateTo) { + delete event.delegate; + emitEvent.call(self, delegateTo); + } + } + event.dispose && event.dispose(); + }; + listener.type = event; + self._listener[id] = listener; + element.addEventListener(event, listener); + } + return self; + }, + one: function(events) { + var self = this, delegate = arguments.length > 3 || typeof arguments[1] === "string" ? arguments[1] : null, fn = arguments.length > 3 || typeof arguments[2] === "function" ? arguments[2] : arguments[1], each = (arguments.length > 3 ? arguments[3] : arguments[2]) !== false, listener = function(event) { + self.off(each === true ? event.type : events, listener); + fn.call(this, event, event.originalEvent.detail); + }; + fn._quid = listener._quid = generateUuid(); + if (delegate) { + self.on(events, delegate, listener); + } else { + self.on(events, listener); + } + return self; + }, + off: function(events, fn) { + var self = this, element = self.element, i = 0, event, id, listener; + events = events.split(" "); + for (;(event = events[i]) !== undefined; i++) { + id = fn._quid && event + "-" + fn._quid || null; + listener = id && self._listener[id] || null; + if (listener) { + element.removeEventListener(event, listener); + delete self._listener[id]; + } else { + element.removeEventListener(event, fn); + } + } + return self; + }, + emit: function(event, data) { + var self = this; + emitEvent.call(self, event, data); + return self; + } + }); +}); +(function(definition) { + window.qoopido.register("dom/element/emerge", definition, [ "../element", "../../function/merge", "../../function/unique/uuid" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var defaults = { + interval: 50, + threshold: "auto", + recur: true, + auto: 1, + visibility: true + }, documentElement = window.document.documentElement, viewport = {}, intervals = {}, elements = {}, prototype, EVENT_EMERGED = "emerged", EVENT_DEMERGED = "demerged", DOM_RESIZE = "resize orientationchange"; + window = modules["dom/element"].create(window); + if (document.compatMode !== "CSS1Compat") { + throw "[Qoopido.js] Not in standards mode"; + } + function tick(interval) { + var index, pointer = elements[interval]; + for (index in pointer) { + if (index !== "length") { + checkState.call(pointer[index]); + } + } + if (pointer.length === 0) { + window.element.clearInterval(intervals[interval]); + delete intervals[interval]; + } + } + function globalOnResize() { + viewport.left = 0; + viewport.top = 0; + viewport.right = window.innerWidth || documentElement.clientWidth; + viewport.bottom = window.innerHeight || documentElement.clientHeight; + } + function instanceOnResize() { + var self = this, treshold = self._settings.threshold, x = treshold !== undefined ? treshold : documentElement.clientWidth * self._settings.auto, y = treshold !== undefined ? treshold : documentElement.clientHeight * self._settings.auto; + self._viewport.left = viewport.left - x; + self._viewport.top = viewport.top - y; + self._viewport.right = viewport.right + x; + self._viewport.bottom = viewport.bottom + y; + } + function checkState() { + var self = this, state = false, priority = 2, boundaries; + if (self.isVisible() && (self.getStyle("visibility") !== "hidden" || self._settings.visibility === false)) { + boundaries = self.element.getBoundingClientRect(); + if ((boundaries.bottom >= self._viewport.top && boundaries.bottom <= self._viewport.bottom || boundaries.top >= self._viewport.top && boundaries.top <= self._viewport.bottom || self._viewport.bottom >= boundaries.top && self._viewport.bottom <= boundaries.bottom || self._viewport.top >= boundaries.top && self._viewport.top <= boundaries.bottom) && (boundaries.left >= self._viewport.left && boundaries.left <= self._viewport.right || boundaries.right >= self._viewport.left && boundaries.right <= self._viewport.right || self._viewport.left >= boundaries.left && self._viewport.left <= boundaries.right || self._viewport.right >= boundaries.left && self._viewport.right <= boundaries.right)) { + if (self._settings.threshold === 0 || (boundaries.bottom >= viewport.top && boundaries.bottom <= viewport.bottom || boundaries.top >= viewport.top && boundaries.top <= viewport.bottom || viewport.bottom >= boundaries.top && viewport.bottom <= boundaries.bottom || viewport.top >= boundaries.top && viewport.top <= boundaries.bottom) && (boundaries.left >= viewport.left && boundaries.left <= viewport.right || boundaries.right >= viewport.left && boundaries.right <= viewport.right || viewport.left >= boundaries.left && viewport.left <= boundaries.right || viewport.right >= boundaries.left && viewport.right <= boundaries.right)) { + priority = 1; + } + state = true; + } + } + if (state !== self._state || state === true && priority !== self._priority) { + setState.call(self, state, priority); + } + } + function setState(state, priority) { + var self = this; + self._state = state; + self._priority = priority; + if (self._settings.recur !== true) { + self.remove(); + } + if (state === true) { + self.emit(EVENT_EMERGED, priority); + } else { + self.emit(EVENT_DEMERGED); + } + } + prototype = modules["dom/element"].extend({ + _quid: null, + _viewport: null, + _settings: null, + _state: null, + _priority: null, + _constructor: function(element, settings) { + var self = prototype._parent._constructor.call(this, element); + settings = modules["function/merge"]({}, defaults, settings || {}); + if (settings.threshold === "auto") { + delete settings.threshold; + } + if (intervals[settings.interval] === undefined) { + elements[settings.interval] = elements[settings.interval] || { + length: 0 + }; + intervals[settings.interval] = window.element.setInterval(function() { + tick(settings.interval); + }, settings.interval); + } + self._quid = modules["function/unique/uuid"](); + self._viewport = {}; + self._settings = settings; + self._state = false; + self._priority = 2; + elements[settings.interval][self._quid] = self; + elements[settings.interval].length++; + window.on(DOM_RESIZE, function() { + instanceOnResize.call(self); + }); + instanceOnResize.call(self); + return self; + }, + remove: function() { + var self = this; + delete elements[self._settings.interval][self._quid]; + elements[self._settings.interval].length--; + } + }); + window.on(DOM_RESIZE, globalOnResize); + globalOnResize(); + return prototype; +}); \ No newline at end of file diff --git a/dist/latest/max/packages/qoopido.emitter.js b/dist/latest/max/packages/qoopido.emitter.js new file mode 100644 index 00000000..06d79b4f --- /dev/null +++ b/dist/latest/max/packages/qoopido.emitter.js @@ -0,0 +1,201 @@ +/*! +* Qoopido.js library +* +* version: 3.7.3 +* date: 2015-08-05 +* author: Dirk Lueth +* website: https://github.com/dlueth/qoopido.js +* +* Copyright (c) 2015 Dirk Lueth +*/ +(function(definition, navigator, global, document, undefined) { + "use strict"; + function register(id, definition, dependencies, callback) { + var namespace = id.split("/"), initialize; + if (modules[id]) { + return modules[id]; + } + initialize = function() { + if (dependencies) { + var path = namespace.slice(0, -1).join("/"), i = 0, dependency, internal; + for (;(dependency = dependencies[i]) !== undefined; i++) { + internal = isInternal.test(dependency); + if (internal) { + dependency = canonicalize(path + "/" + dependency); + } + if (!modules[dependency] && arguments[i]) { + modules[dependency] = arguments[i]; + } + if (internal && !modules[dependency] && typeof console !== "undefined") { + console.error("".concat("[Qoopido.js] ", id, ": Could not load dependency ", dependency)); + } + } + } + modules[id] = definition(modules, shared, namespace, navigator, global, document, undefined); + if (callback) { + callback(modules[id]); + } + return modules[id]; + }; + if (typeof module !== "undefined" && module.exports) { + module.exports = define(initialize); + } else if (typeof define === "function" && define.amd) { + dependencies ? define(dependencies, initialize) : define(initialize); + } else { + initialize(); + } + } + function registerSingleton(id, definition, dependencies) { + register(id, definition, dependencies, function(module) { + modules[id] = module.create(); + }); + } + var qoopido = global.qoopido || (global.qoopido = {}), shared = qoopido.shared || (qoopido.shared = {}), modules = qoopido.modules || (qoopido.modules = {}), dependencies = [], isInternal = new RegExp("^\\.+\\/"), regexCanonicalize = new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."), removeNeutral = new RegExp("(^\\/)|\\.\\/", "g"); + qoopido.register = register; + qoopido.registerSingleton = registerSingleton; + function canonicalize(path) { + var collapsed; + while ((collapsed = path.replace(regexCanonicalize, "")) !== path) { + path = collapsed; + } + return path.replace(removeNeutral, ""); + } + if (!Object.create) { + dependencies.push("./polyfill/object/create"); + } + if (!Object.getOwnPropertyNames) { + dependencies.push("./polyfill/object/getownpropertynames"); + } + if (!Object.getOwnPropertyDescriptor || !function() { + try { + Object.getOwnPropertyDescriptor({ + x: 0 + }, "x"); + return true; + } catch (exception) { + return false; + } + }()) { + dependencies.push("./polyfill/object/getownpropertydescriptor"); + } + register("base", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + function getOwnPropertyDescriptors(object) { + var descriptors = {}, properties = Object.getOwnPropertyNames(object), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + descriptors[property] = Object.getOwnPropertyDescriptor(object, property); + } + return descriptors; + } + function prohibitCall() { + throw new Error("[Qoopido.js] Operation prohibited"); + } + return { + create: function() { + var instance = Object.create(this, getOwnPropertyDescriptors(this)), result; + if (instance._constructor) { + result = instance._constructor.apply(instance, arguments); + } + instance.create = instance.extend = prohibitCall; + return result || instance; + }, + extend: function(properties, final) { + var instance; + properties = properties || {}; + final = final === true; + properties._parent = this; + instance = Object.create(this, getOwnPropertyDescriptors(properties)); + if (final === true) { + instance.extend = prohibitCall; + } + return instance; + } + }; +}, navigator, this, document); +(function(definition) { + window.qoopido.register("emitter", definition, [ "./base" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var excludeMethods = /^(_|extend$|create$|on$|one$|off$|emit$|get.+)/; + function map(context, method) { + var event = method.charAt(0).toUpperCase() + method.slice(1); + context._mapped[method] = context[method]; + return function() { + var args = Array.prototype.slice.call(arguments), returnValue; + context.emit.apply(context, [ "pre" + event, args ]); + returnValue = context._mapped[method].apply(context, args); + context.emit.apply(context, [ "post" + event, args, returnValue ]); + return returnValue; + }; + } + return modules["base"].extend({ + _mapped: null, + _listener: null, + _temp: null, + _constructor: function() { + var self = this, method; + self._mapped = {}; + self._listener = {}; + for (method in self) { + if (typeof self[method] === "function" && excludeMethods.test(method) === false) { + self[method] = map(self, method); + } + } + return self; + }, + on: function(events, fn) { + var self = this, i = 0, event; + events = events.split(" "); + for (;(event = events[i]) !== undefined; i++) { + (self._listener[event] = self._listener[event] || []).push(fn); + } + return self; + }, + one: function(events, fn, each) { + each = each !== false; + var self = this; + self.on(events, function listener(event) { + self.off(each === true ? event : events, listener); + fn.apply(this, arguments); + }); + return self; + }, + off: function(events, fn) { + var self = this, i = 0, event, j, listener; + if (events) { + events = events.split(" "); + for (;(event = events[i]) !== undefined; i++) { + self._listener[event] = self._listener[event] || []; + if (fn) { + for (j = 0; (listener = self._listener[event][j]) !== undefined; j++) { + if (listener === fn) { + self._listener[event].splice(j, 1); + j--; + } + } + } else { + self._listener[event].length = 0; + } + } + } else { + for (event in self._listener) { + self._listener[event].length = 0; + } + } + return self; + }, + emit: function(event) { + var self = this, i = 0, listener; + if (event !== undefined) { + self._listener[event] = self._listener[event] || []; + self._temp = self._listener[event].slice(); + for (;(listener = self._temp[i]) !== undefined; i++) { + listener.apply(self, arguments); + } + self._temp.length = 0; + } + return self; + } + }); +}); \ No newline at end of file diff --git a/dist/latest/max/packages/qoopido.emitter.legacy.js b/dist/latest/max/packages/qoopido.emitter.legacy.js new file mode 100644 index 00000000..75dee908 --- /dev/null +++ b/dist/latest/max/packages/qoopido.emitter.legacy.js @@ -0,0 +1,372 @@ +/*! +* Qoopido.js library +* +* version: 3.7.3 +* date: 2015-08-05 +* author: Dirk Lueth +* website: https://github.com/dlueth/qoopido.js +* +* Copyright (c) 2015 Dirk Lueth +*/ +(function(definition, qoopido) { + if (qoopido.register) { + qoopido.register("polyfill/object/defineproperty", definition); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/defineproperty"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.defineProperty || !function() { + try { + Object.defineProperty({}, "x", {}); + return true; + } catch (exception) { + return false; + } + }()) { + var defineProperty = Object.defineProperty, defineGetter = Object.prototype.__defineGetter__, defineSetter = Object.prototype.__defineSetter__; + Object.defineProperty = function(obj, prop, desc) { + if (defineProperty) { + try { + return defineProperty(obj, prop, desc); + } catch (exception) {} + } + if (obj !== Object(obj)) { + throw new TypeError("Object.defineProperty called on non-object"); + } + if (defineGetter && "get" in desc) { + defineGetter.call(obj, prop, desc.get); + } + if (defineSetter && "set" in desc) { + defineSetter.call(obj, prop, desc.set); + } + if ("value" in desc) { + obj[prop] = desc.value; + } + return obj; + }; + } + return Object.defineProperty; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + var dependencies = []; + if (!Object.defineProperty || !function() { + try { + Object.defineProperty({}, "x", {}); + return true; + } catch (exception) { + return false; + } + }()) { + dependencies.push("./defineproperty"); + } + qoopido.register("polyfill/object/defineproperties", definition, dependencies); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/defineproperties"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.defineProperties) { + Object.defineProperties = function(obj, properties) { + if (obj !== Object(obj)) { + throw new TypeError("Object.defineProperties called on non-object"); + } + var name; + for (name in properties) { + if (Object.prototype.hasOwnProperty.call(properties, name)) { + Object.defineProperty(obj, name, properties[name]); + } + } + return obj; + }; + } + return Object.defineProperties; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + var dependencies = []; + if (!Object.defineProperties) { + dependencies.push("./defineproperties"); + } + qoopido.register("polyfill/object/create", definition, dependencies); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/create"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.create) { + Object.create = function(prototype, properties) { + if (typeof prototype !== "object") { + throw new TypeError(); + } + function Constructor() {} + Constructor.prototype = prototype; + var obj = new Constructor(); + if (prototype) { + obj.constructor = Constructor; + } + if (arguments.length > 1) { + if (properties !== Object(properties)) { + throw new TypeError(); + } + Object.defineProperties(obj, properties); + } + return obj; + }; + } + return Object.create; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + qoopido.register("polyfill/object/getownpropertynames", definition); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/getownpropertynames"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.getOwnPropertyNames) { + Object.getOwnPropertyNames = function(obj) { + if (obj !== Object(obj)) { + throw new TypeError("Object.getOwnPropertyNames called on non-object"); + } + var props = [], p; + for (p in obj) { + if (Object.prototype.hasOwnProperty.call(obj, p)) { + props.push(p); + } + } + return props; + }; + } + return Object.getOwnPropertyNames; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + qoopido.register("polyfill/object/getownpropertydescriptor", definition); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/getownpropertydescriptor"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.getOwnPropertyDescriptor || !function() { + try { + Object.getOwnPropertyDescriptor({ + x: 0 + }, "x"); + return true; + } catch (exception) { + return false; + } + }()) { + var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; + Object.getOwnPropertyDescriptor = function(obj, property) { + if (obj !== Object(obj)) { + throw new TypeError(); + } + try { + return getOwnPropertyDescriptor.call(Object, obj, property); + } catch (exception) {} + if (Object.prototype.hasOwnProperty.call(obj, property)) { + return { + value: obj[property], + enumerable: true, + writable: true, + configurable: true + }; + } + }; + } + return Object.getOwnPropertyDescriptor; +}, window.qoopido = window.qoopido || {}); +(function(definition, navigator, global, document, undefined) { + "use strict"; + function register(id, definition, dependencies, callback) { + var namespace = id.split("/"), initialize; + if (modules[id]) { + return modules[id]; + } + initialize = function() { + if (dependencies) { + var path = namespace.slice(0, -1).join("/"), i = 0, dependency, internal; + for (;(dependency = dependencies[i]) !== undefined; i++) { + internal = isInternal.test(dependency); + if (internal) { + dependency = canonicalize(path + "/" + dependency); + } + if (!modules[dependency] && arguments[i]) { + modules[dependency] = arguments[i]; + } + if (internal && !modules[dependency] && typeof console !== "undefined") { + console.error("".concat("[Qoopido.js] ", id, ": Could not load dependency ", dependency)); + } + } + } + modules[id] = definition(modules, shared, namespace, navigator, global, document, undefined); + if (callback) { + callback(modules[id]); + } + return modules[id]; + }; + if (typeof module !== "undefined" && module.exports) { + module.exports = define(initialize); + } else if (typeof define === "function" && define.amd) { + dependencies ? define(dependencies, initialize) : define(initialize); + } else { + initialize(); + } + } + function registerSingleton(id, definition, dependencies) { + register(id, definition, dependencies, function(module) { + modules[id] = module.create(); + }); + } + var qoopido = global.qoopido || (global.qoopido = {}), shared = qoopido.shared || (qoopido.shared = {}), modules = qoopido.modules || (qoopido.modules = {}), dependencies = [], isInternal = new RegExp("^\\.+\\/"), regexCanonicalize = new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."), removeNeutral = new RegExp("(^\\/)|\\.\\/", "g"); + qoopido.register = register; + qoopido.registerSingleton = registerSingleton; + function canonicalize(path) { + var collapsed; + while ((collapsed = path.replace(regexCanonicalize, "")) !== path) { + path = collapsed; + } + return path.replace(removeNeutral, ""); + } + if (!Object.create) { + dependencies.push("./polyfill/object/create"); + } + if (!Object.getOwnPropertyNames) { + dependencies.push("./polyfill/object/getownpropertynames"); + } + if (!Object.getOwnPropertyDescriptor || !function() { + try { + Object.getOwnPropertyDescriptor({ + x: 0 + }, "x"); + return true; + } catch (exception) { + return false; + } + }()) { + dependencies.push("./polyfill/object/getownpropertydescriptor"); + } + register("base", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + function getOwnPropertyDescriptors(object) { + var descriptors = {}, properties = Object.getOwnPropertyNames(object), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + descriptors[property] = Object.getOwnPropertyDescriptor(object, property); + } + return descriptors; + } + function prohibitCall() { + throw new Error("[Qoopido.js] Operation prohibited"); + } + return { + create: function() { + var instance = Object.create(this, getOwnPropertyDescriptors(this)), result; + if (instance._constructor) { + result = instance._constructor.apply(instance, arguments); + } + instance.create = instance.extend = prohibitCall; + return result || instance; + }, + extend: function(properties, final) { + var instance; + properties = properties || {}; + final = final === true; + properties._parent = this; + instance = Object.create(this, getOwnPropertyDescriptors(properties)); + if (final === true) { + instance.extend = prohibitCall; + } + return instance; + } + }; +}, navigator, this, document); +(function(definition) { + window.qoopido.register("emitter", definition, [ "./base" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var excludeMethods = /^(_|extend$|create$|on$|one$|off$|emit$|get.+)/; + function map(context, method) { + var event = method.charAt(0).toUpperCase() + method.slice(1); + context._mapped[method] = context[method]; + return function() { + var args = Array.prototype.slice.call(arguments), returnValue; + context.emit.apply(context, [ "pre" + event, args ]); + returnValue = context._mapped[method].apply(context, args); + context.emit.apply(context, [ "post" + event, args, returnValue ]); + return returnValue; + }; + } + return modules["base"].extend({ + _mapped: null, + _listener: null, + _temp: null, + _constructor: function() { + var self = this, method; + self._mapped = {}; + self._listener = {}; + for (method in self) { + if (typeof self[method] === "function" && excludeMethods.test(method) === false) { + self[method] = map(self, method); + } + } + return self; + }, + on: function(events, fn) { + var self = this, i = 0, event; + events = events.split(" "); + for (;(event = events[i]) !== undefined; i++) { + (self._listener[event] = self._listener[event] || []).push(fn); + } + return self; + }, + one: function(events, fn, each) { + each = each !== false; + var self = this; + self.on(events, function listener(event) { + self.off(each === true ? event : events, listener); + fn.apply(this, arguments); + }); + return self; + }, + off: function(events, fn) { + var self = this, i = 0, event, j, listener; + if (events) { + events = events.split(" "); + for (;(event = events[i]) !== undefined; i++) { + self._listener[event] = self._listener[event] || []; + if (fn) { + for (j = 0; (listener = self._listener[event][j]) !== undefined; j++) { + if (listener === fn) { + self._listener[event].splice(j, 1); + j--; + } + } + } else { + self._listener[event].length = 0; + } + } + } else { + for (event in self._listener) { + self._listener[event].length = 0; + } + } + return self; + }, + emit: function(event) { + var self = this, i = 0, listener; + if (event !== undefined) { + self._listener[event] = self._listener[event] || []; + self._temp = self._listener[event].slice(); + for (;(listener = self._temp[i]) !== undefined; i++) { + listener.apply(self, arguments); + } + self._temp.length = 0; + } + return self; + } + }); +}); \ No newline at end of file diff --git a/dist/latest/max/packages/qoopido.lazyimage.js b/dist/latest/max/packages/qoopido.lazyimage.js new file mode 100644 index 00000000..8aa60f2a --- /dev/null +++ b/dist/latest/max/packages/qoopido.lazyimage.js @@ -0,0 +1,1489 @@ +/*! +* Qoopido.js library +* +* version: 3.7.3 +* date: 2015-08-05 +* author: Dirk Lueth +* website: https://github.com/dlueth/qoopido.js +* +* Copyright (c) 2015 Dirk Lueth +*/ +(function(definition, navigator, global, document, undefined) { + "use strict"; + function register(id, definition, dependencies, callback) { + var namespace = id.split("/"), initialize; + if (modules[id]) { + return modules[id]; + } + initialize = function() { + if (dependencies) { + var path = namespace.slice(0, -1).join("/"), i = 0, dependency, internal; + for (;(dependency = dependencies[i]) !== undefined; i++) { + internal = isInternal.test(dependency); + if (internal) { + dependency = canonicalize(path + "/" + dependency); + } + if (!modules[dependency] && arguments[i]) { + modules[dependency] = arguments[i]; + } + if (internal && !modules[dependency] && typeof console !== "undefined") { + console.error("".concat("[Qoopido.js] ", id, ": Could not load dependency ", dependency)); + } + } + } + modules[id] = definition(modules, shared, namespace, navigator, global, document, undefined); + if (callback) { + callback(modules[id]); + } + return modules[id]; + }; + if (typeof module !== "undefined" && module.exports) { + module.exports = define(initialize); + } else if (typeof define === "function" && define.amd) { + dependencies ? define(dependencies, initialize) : define(initialize); + } else { + initialize(); + } + } + function registerSingleton(id, definition, dependencies) { + register(id, definition, dependencies, function(module) { + modules[id] = module.create(); + }); + } + var qoopido = global.qoopido || (global.qoopido = {}), shared = qoopido.shared || (qoopido.shared = {}), modules = qoopido.modules || (qoopido.modules = {}), dependencies = [], isInternal = new RegExp("^\\.+\\/"), regexCanonicalize = new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."), removeNeutral = new RegExp("(^\\/)|\\.\\/", "g"); + qoopido.register = register; + qoopido.registerSingleton = registerSingleton; + function canonicalize(path) { + var collapsed; + while ((collapsed = path.replace(regexCanonicalize, "")) !== path) { + path = collapsed; + } + return path.replace(removeNeutral, ""); + } + if (!Object.create) { + dependencies.push("./polyfill/object/create"); + } + if (!Object.getOwnPropertyNames) { + dependencies.push("./polyfill/object/getownpropertynames"); + } + if (!Object.getOwnPropertyDescriptor || !function() { + try { + Object.getOwnPropertyDescriptor({ + x: 0 + }, "x"); + return true; + } catch (exception) { + return false; + } + }()) { + dependencies.push("./polyfill/object/getownpropertydescriptor"); + } + register("base", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + function getOwnPropertyDescriptors(object) { + var descriptors = {}, properties = Object.getOwnPropertyNames(object), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + descriptors[property] = Object.getOwnPropertyDescriptor(object, property); + } + return descriptors; + } + function prohibitCall() { + throw new Error("[Qoopido.js] Operation prohibited"); + } + return { + create: function() { + var instance = Object.create(this, getOwnPropertyDescriptors(this)), result; + if (instance._constructor) { + result = instance._constructor.apply(instance, arguments); + } + instance.create = instance.extend = prohibitCall; + return result || instance; + }, + extend: function(properties, final) { + var instance; + properties = properties || {}; + final = final === true; + properties._parent = this; + instance = Object.create(this, getOwnPropertyDescriptors(properties)); + if (final === true) { + instance.extend = prohibitCall; + } + return instance; + } + }; +}, navigator, this, document); +(function(definition) { + window.qoopido.register("polyfill/string/ucfirst", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!String.prototype.ucfirst) { + String.prototype.ucfirst = function() { + var self = this; + return self.charAt(0).toUpperCase() + self.slice(1); + }; + } + return String.prototype.ucfirst; +}); +(function(definition) { + window.qoopido.register("polyfill/string/lcfirst", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!String.prototype.lcfirst) { + String.prototype.lcfirst = function() { + var self = this; + return self.charAt(0).toLowerCase() + self.slice(1); + }; + } + return String.prototype.lcfirst; +}); +(function(definition) { + window.qoopido.register("polyfill/window/promise", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var STATE_PENDING = void 0, STATE_SEALED = 0, STATE_FULFILLED = 1, STATE_REJECTED = 2, queue = []; + function addCallback(fn, arg) { + var length = queue.push([ fn, arg ]); + if (length === 1) { + scheduleFlushCallbacks(); + } + } + function scheduleFlushCallbacks() { + window.setTimeout(flushCallbacks, 1); + } + function flushCallbacks() { + var i = 0, tuple; + for (;(tuple = queue[i]) !== undefined; i++) { + tuple[0](tuple[1]); + } + queue.length = 0; + } + function handleThenable(promise, value) { + var then = null, resolved; + try { + if (promise === value) { + throw new TypeError("A promises callback cannot return that same promise."); + } + if (typeof value === "function" || typeof value === "object" && value !== null) { + then = value.then; + if (typeof then === "function") { + then.call(value, function(val) { + if (resolved) { + return true; + } + resolved = true; + if (value !== val) { + resolve(promise, val); + } else { + fulfill(promise, val); + } + }, function(val) { + if (resolved) { + return true; + } + resolved = true; + reject(promise, val); + }); + return true; + } + } + } catch (exception) { + if (resolved) { + return true; + } + reject(promise, exception); + return true; + } + return false; + } + function invokeResolver(resolver, promise) { + function resolvePromise(value) { + resolve(promise, value); + } + function rejectPromise(reason) { + reject(promise, reason); + } + try { + resolver(resolvePromise, rejectPromise); + } catch (exception) { + rejectPromise(exception); + } + } + function invokeCallback(settled, promise, callback, detail) { + var hasCallback = typeof callback === "function", value, error, succeeded, failed; + if (hasCallback) { + try { + value = callback(detail); + succeeded = true; + } catch (exception) { + failed = true; + error = exception; + } + } else { + value = detail; + succeeded = true; + } + if (handleThenable(promise, value)) { + return; + } else if (hasCallback && succeeded) { + resolve(promise, value); + } else if (failed) { + reject(promise, error); + } else if (settled === STATE_FULFILLED) { + resolve(promise, value); + } else if (settled === STATE_REJECTED) { + reject(promise, value); + } + } + function resolve(promise, value) { + if (promise === value) { + fulfill(promise, value); + } else if (!handleThenable(promise, value)) { + fulfill(promise, value); + } + } + function fulfill(promise, value) { + if (promise._state !== STATE_PENDING) { + return; + } + promise._state = STATE_SEALED; + promise._detail = value; + addCallback(publishFulfillment, promise); + } + function reject(promise, reason) { + if (promise._state !== STATE_PENDING) { + return; + } + promise._state = STATE_SEALED; + promise._detail = reason; + addCallback(publishRejection, promise); + } + function publishFulfillment(promise) { + publish(promise, promise._state = STATE_FULFILLED); + } + function publishRejection(promise) { + publish(promise, promise._state = STATE_REJECTED); + } + function subscribe(parent, child, onFulfillment, onRejection) { + var subscribers = parent._subscribers, length = subscribers.length; + subscribers[length] = child; + subscribers[length + STATE_FULFILLED] = onFulfillment; + subscribers[length + STATE_REJECTED] = onRejection; + } + function publish(promise, settled) { + var child, callback, subscribers = promise._subscribers, detail = promise._detail, i = 0; + for (;(child = subscribers[i]) !== undefined; i += 3) { + callback = subscribers[i + settled]; + invokeCallback(settled, child, callback, detail); + } + promise._subscribers = null; + } + function Promise(resolver) { + var self = this; + if (typeof resolver !== "function") { + throw new TypeError("You must pass a resolver function as the first argument to the promise constructor"); + } + self._subscribers = []; + invokeResolver(resolver, self); + } + Promise.prototype = { + _state: undefined, + _detail: undefined, + _subscribers: undefined, + then: function(onFulfilled, onRejected) { + var self = this, thenPromise = new Promise(function() {}); + if (self._state) { + addCallback(function invokePromiseCallback() { + invokeCallback(self._state, thenPromise, arguments[self._state - 1], self._detail); + }); + } else { + subscribe(self, thenPromise, onFulfilled, onRejected); + } + return thenPromise; + }, + "catch": function(onRejected) { + return this.then(null, onRejected); + } + }; + if (!window.Promise) { + window.Promise = Promise; + } + return window.Promise; +}); +(function(definition) { + var dependencies = []; + if (!window.Promise) { + dependencies.push("../polyfill/window/promise"); + } + window.qoopido.register("promise/all", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + return function all(promises) { + if (Object.prototype.toString.call(promises) !== "[object Array]") { + throw new TypeError("You must pass an array to all."); + } + return new window.Promise(function(resolve, reject) { + var results = [], remaining = promises.length, i = 0, promise; + if (remaining === 0) { + resolve([]); + } + function resolver(index) { + return function(value) { + resolveAll(index, value); + }; + } + function resolveAll(index, value) { + results[index] = value; + if (--remaining === 0) { + resolve(results); + } + } + for (;(promise = promises[i]) !== undefined; i++) { + if (promise && typeof promise.then === "function") { + promise.then(resolver(i), reject); + } else { + resolveAll(i, promise); + } + } + }); + }; +}); +(function(definition) { + var dependencies = []; + if (!window.Promise) { + dependencies.push("../polyfill/window/promise"); + } + window.qoopido.register("promise/defer", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + return function defer() { + var self = this; + self.promise = new window.Promise(function(resolve, reject) { + self.resolve = resolve; + self.reject = reject; + }); + }; +}); +(function(definition) { + var dependencies = [ "./base", "./promise/all", "./promise/defer" ]; + if (!String.prototype.ucfirst) { + dependencies.push("./polyfill/string/ucfirst"); + } + if (!String.prototype.lcfirst) { + dependencies.push("./polyfill/string/lcfirst"); + } + window.qoopido.registerSingleton("support", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var CombinedPromise = modules["promise/all"], DeferredPromise = modules["promise/defer"], matchPrefix = new RegExp("^(Moz|WebKit|Khtml|ms|O|Icab)(?=[A-Z])"), removeJsPrefix = new RegExp("^(?:webkit|khtml|icab|moz|ms|o)([A-Z])"), removeCssPrefix = new RegExp("^-(?:webkit|khtml|icab|moz|ms|o)-"), convertToCamelCase = new RegExp("-([a-z])", "gi"), convertToHyphens = new RegExp("([A-Z])", "g"), callbackUcfirst = function() { + return arguments[1].ucfirst(); + }, lookup = { + prefix: null, + method: {}, + property: {}, + css: {}, + promises: { + prefix: null, + method: {}, + property: {}, + css: {}, + test: {} + } + }; + function normalize(value) { + return value.replace(removeJsPrefix, "$1").lcfirst().replace(removeCssPrefix, "").replace(convertToCamelCase, callbackUcfirst); + } + return modules["base"].extend({ + test: {}, + pool: shared.pool && shared.pool.dom, + testMultiple: function() { + var test, tests = [], i = 0; + for (;(test = arguments[i]) !== undefined; i++) { + switch (typeof test) { + case "string": + tests.push(this.test[test]()); + break; + + case "boolean": + var deferred = new DeferredPromise(); + !!test ? deferred.resolve() : deferred.reject(); + tests.push(deferred.promise); + break; + + default: + tests.push(test); + break; + } + } + return new CombinedPromise(tests); + }, + getPrefix: function() { + var self = this, stored = lookup.prefix || null, property; + if (stored === null) { + var sample = self.pool ? self.pool.obtain("div") : document.createElement("div"), styles = sample.style; + stored = false; + for (property in styles) { + if (matchPrefix.test(property)) { + stored = property.match(matchPrefix)[0]; + } + } + if (stored === false && "WebkitOpacity" in styles) { + stored = "WebKit"; + } + if (stored === false && "KhtmlOpacity" in styles) { + stored = "Khtml"; + } + stored = lookup.prefix = stored === false ? false : [ stored.toLowerCase(), stored.toLowerCase().ucfirst(), stored ]; + sample.dispose && sample.dispose(); + } + return stored; + }, + getMethod: function(pMethod, pElement) { + pMethod = normalize(pMethod); + pElement = pElement || window; + var type = pElement.tagName, pointer = lookup.method[type] = lookup.method[type] || {}, stored = pointer[pMethod] = lookup.method[type][pMethod] || null; + if (stored === null) { + stored = false; + var candidates, candidate, i = 0, uMethod = pMethod.ucfirst(), prefixes = this.getPrefix(); + if (prefixes !== false) { + candidates = (pMethod + " " + uMethod + " " + prefixes.join(uMethod + " ") + uMethod).split(" "); + } else { + candidates = [ pMethod ]; + } + for (;(candidate = candidates[i]) !== undefined; i++) { + if (pElement[candidate] !== undefined && (typeof pElement[candidate] === "function" || typeof pElement[candidate] === "object")) { + stored = candidate; + break; + } + } + lookup.method[type][pMethod] = stored; + } + return stored; + }, + getProperty: function(pProperty, pElement) { + pProperty = normalize(pProperty); + pElement = pElement || window; + var type = pElement.tagName, pointer = lookup.property[type] = lookup.property[type] || {}, stored = pointer[pProperty] = lookup.property[type][pProperty] || null; + if (stored === null) { + stored = false; + var candidates, candidate, i = 0, uProperty = pProperty.ucfirst(), prefixes = this.getPrefix(); + if (prefixes !== false) { + candidates = (pProperty + " " + uProperty + " " + prefixes.join(uProperty + " ") + uProperty).split(" "); + } else { + candidates = [ pProperty ]; + } + for (i; (candidate = candidates[i]) !== undefined; i++) { + if (pElement[candidate] !== undefined) { + stored = candidate; + break; + } + } + lookup.property[type][pProperty] = stored; + } + return stored; + }, + getCssProperty: function(pProperty) { + pProperty = normalize(pProperty); + var self = this, stored = lookup.css[pProperty] || null; + if (stored === null) { + stored = false; + var candidate, i = 0, sample = self.pool ? self.pool.obtain("div") : document.createElement("div"), uProperty = pProperty.ucfirst(), prefixes = this.getPrefix() || [], candidates = (pProperty + " " + uProperty + " " + prefixes.join(uProperty + " ") + uProperty).split(" "), prefix = ""; + for (i; (candidate = candidates[i]) !== undefined; i++) { + if (sample.style[candidate] !== undefined) { + stored = candidate; + if (i > 0) { + prefix = "-"; + } + break; + } + } + stored = lookup.css[pProperty] = stored !== false ? [ prefix + stored.replace(convertToHyphens, "-$1").toLowerCase(), stored ] : false; + sample.dispose && sample.dispose(); + } + return stored; + }, + supportsPrefix: function() { + return !!this.getPrefix(); + }, + supportsMethod: function(pMethod, pElement) { + return !!this.getMethod(pMethod, pElement); + }, + supportsProperty: function(pProperty, pElement) { + return !!this.getProperty(pProperty, pElement); + }, + supportsCssProperty: function(pProperty) { + return !!this.getCssProperty(pProperty); + }, + testPrefix: function() { + var stored = lookup.promises.prefix; + if (stored === null) { + var deferred = new DeferredPromise(), prefix = this.getPrefix(); + !!prefix ? deferred.resolve(prefix) : deferred.reject(); + stored = lookup.promises.prefix = deferred.promise; + } + return stored; + }, + testMethod: function(pMethod, pElement) { + pElement = pElement || window; + var type = pElement.tagName, pointer = lookup.promises.method[type] = lookup.promises.method[type] || {}, stored = pointer[pMethod] = lookup.promises.method[type][pMethod] || null; + if (stored === null) { + var deferred = new DeferredPromise(), method = this.getMethod(pMethod, pElement); + !!method ? deferred.resolve(method) : deferred.reject(); + stored = lookup.promises.method[type][pMethod] = deferred.promise; + } + return stored; + }, + testProperty: function(pProperty, pElement) { + pElement = pElement || window; + var type = pElement.tagName, pointer = lookup.promises.property[type] = lookup.promises.property[type] || {}, stored = pointer[pProperty] = lookup.promises.property[type][pProperty] || null; + if (stored === null) { + var deferred = new DeferredPromise(), property = this.getProperty(pProperty, pElement); + !!property ? deferred.resolve(property) : deferred.reject(); + stored = lookup.promises.property[type][pProperty] = deferred.promise; + } + return stored; + }, + testCssProperty: function(pProperty) { + var stored = lookup.promises.css[pProperty] || null; + if (stored === null) { + var deferred = new DeferredPromise(), property = this.getCssProperty(pProperty); + !!property ? deferred.resolve(property) : deferred.reject(); + stored = lookup.promises.css[pProperty] = deferred.promise; + } + return stored; + }, + addTest: function(pId, pTest) { + return this.test[pId] = function() { + var stored = lookup.promises.test[pId] || null; + if (stored === null) { + var deferred = new DeferredPromise(), parameter = Array.prototype.slice.call(arguments); + parameter.splice(0, 0, deferred); + pTest.apply(null, parameter); + stored = lookup.promises.test[pId] = deferred.promise; + } + return stored; + }; + } + }); +}); +(function(definition) { + window.qoopido.register("function/merge", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + return function merge() { + var target = arguments[0], i, properties, property, tgt, src; + for (i = 1; (properties = arguments[i]) !== undefined; i++) { + for (property in properties) { + tgt = target[property]; + src = properties[property]; + if (src !== undefined) { + if (src !== null && typeof src === "object") { + if (src.length !== undefined) { + tgt = tgt && typeof tgt === "object" && tgt.length !== undefined ? tgt : []; + } else { + tgt = tgt && typeof tgt === "object" && tgt.length === undefined ? tgt : {}; + } + target[property] = merge(tgt, src); + } else { + target[property] = src; + } + } + } + } + return target; + }; +}); +(function(definition) { + window.qoopido.register("function/unique/uuid", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var lookup = {}, regex = new RegExp("[xy]", "g"); + function generateUuid() { + return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(regex, function(c) { + var r = Math.random() * 16 | 0, v = c === "x" ? r : r & 3 | 8; + return v.toString(16); + }); + } + return function() { + var result; + do { + result = generateUuid(); + } while (typeof lookup[result] !== "undefined"); + lookup[result] = true; + return result; + }; +}); +(function(definition) { + window.qoopido.registerSingleton("hook/event", definition, [ "../base" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + function transferProperties(event, originalEvent, properties) { + var i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + event[property] = originalEvent[property]; + } + event._properties = event._properties.concat(properties); + } + var hooks = { + general: { + properties: "type altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which path".split(" "), + process: function(event, originalEvent) { + var pointer; + event.originalEvent = originalEvent; + event.isDefaultPrevented = originalEvent.defaultPrevented ? true : false; + event.isPropagationStopped = originalEvent.cancelBubble ? true : false; + event.metaKey = originalEvent.metaKey && originalEvent.metaKey !== false ? true : false; + if (!event.target) { + event.target = originalEvent.srcElement || document; + } + if (event.target.nodeType === 3) { + event.target = event.target.parentNode; + } + if (!event.path) { + event.path = []; + pointer = event.target; + do { + event.path.push(pointer); + } while (pointer = pointer.parentNode); + event.path.push(window); + } + } + }, + mouse: { + regex: new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"), + properties: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement dataTransfer".split(" "), + process: function(event, originalEvent) { + var pointer, fromElement, which; + fromElement = originalEvent.fromElement; + which = originalEvent.button; + if (event.pageX === null && originalEvent.clientX !== null) { + pointer = event.target.ownerDocument || document; + pointer = pointer.documentElement || pointer.body; + event.pageX = originalEvent.clientX + (pointer.scrollLeft || 0) - (pointer.clientLeft || 0); + event.pageY = originalEvent.clientY + (pointer.scrollTop || 0) - (pointer.clientTop || 0); + } + if (!event.relatedTarget && fromElement) { + event.relatedTarget = fromElement === event.target ? originalEvent.toElement : fromElement; + } + if (!event.which && which !== undefined) { + event.which = which & 1 ? 1 : which & 2 ? 3 : which & 4 ? 2 : 0; + } + } + }, + key: { + regex: new RegExp("^(?:key)"), + properties: "char charCode key keyCode".split(" "), + process: function(event, originalEvent) { + if (event.which === null) { + event.which = originalEvent.charCode !== null ? originalEvent.charCode : originalEvent.keyCode; + } + } + } + }; + return modules["base"].extend({ + add: function(property, hook) { + if (property && hook && hooks[property]) { + hooks[property] = hook; + } + return this; + }, + get: function(property) { + if (property && hooks[property]) { + return hooks[property]; + } + return null; + }, + process: function(event, originalEvent) { + var id, hook, isMatch; + for (id in hooks) { + hook = hooks[id]; + isMatch = !hook.regex || hook.regex.test(originalEvent.type); + if (isMatch) { + if (hook.properties) { + transferProperties(event, originalEvent, hook.properties); + } + if (hook.process) { + hook.process(event, originalEvent); + } + if (hook.delegate) { + event.delegate = hook.delegate; + } + } + } + } + }); +}); +(function(definition) { + var dependencies = [ "../base", "../support" ]; + if (!window.getComputedStyle) { + dependencies.push("../polyfill/window/getcomputedstyle"); + } + window.qoopido.registerSingleton("hook/css", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var mSupport = modules["support"], getComputedStyle = window.getComputedStyle || modules["polyfill/window/getcomputedstyle"], hooks = { + general: { + get: function(element, property) { + return getComputedStyle(element, null).getPropertyValue(property[0]); + }, + set: function(element, property, value) { + element.style[property[1]] = value; + } + }, + opacity: !mSupport.supportsCssProperty("opacity") ? { + regex: new RegExp("alpha\\(opacity=(.*)\\)", "i"), + get: function(element, property, value) { + value = getComputedStyle(element, null).getPropertyValue("filter").toString().match(this.regex); + if (value) { + value = value[1] / 100; + } else { + value = 1; + } + return value; + }, + set: function(element, property, value) { + var style = element.style; + style.zoom = 1; + style.filter = "alpha(opacity=" + (value * 100 + .5 >> 0) + ")"; + } + } : null + }; + return modules["base"].extend({ + add: function(property, hook) { + if (property && hook && hooks[property]) { + hooks[property] = hook; + } + return this; + }, + get: function(property) { + if (property && hooks[property]) { + return hooks[property]; + } + return null; + }, + process: function(method, element, property, value) { + var hook; + property = mSupport.getCssProperty(property, element) || null; + if (property) { + return ((hook = this.get(property[1])) && hook[method] || this.get("general")[method])(element, property, value); + } + } + }); +}); +(function(definition) { + window.qoopido.register("dom/event", definition, [ "../base", "../hook/event" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var hooks = modules["hook/event"]; + return modules["base"].extend({ + originalEvent: null, + isDelegate: false, + isDefaultPrevented: false, + isPropagationStopped: false, + isImmediatePropagationStopped: false, + _properties: null, + _constructor: function(event) { + var self = this; + self._properties = []; + self._obtain(event); + return self; + }, + _obtain: function(event) { + hooks.process(this, event); + }, + _dispose: function() { + var self = this, i = 0, property; + for (;(property = self._properties[i]) !== undefined; i++) { + delete self[property]; + } + delete self.delegate; + self.originalEvent = null; + self.isDelegate = false; + self.isDefaultPrevented = false; + self.isPropagationStopped = false; + self.isImmediatePropagationStopped = false; + self._properties.length = 0; + }, + preventDefault: function() { + var self = this, event = self.originalEvent; + if (event.cancelable !== false) { + self.isDefaultPrevented = true; + if (event.preventDefault) { + event.preventDefault(); + } else { + event.returnValue = false; + } + } + }, + stopPropagation: function() { + var self = this, event = self.originalEvent; + self.isPropagationStopped = true; + if (event.stopPropagation) { + event.stopPropagation(); + } + event.cancelBubble = true; + }, + stopImmediatePropagation: function() { + var self = this, event = self.originalEvent; + self.isImmediatePropagationStopped = true; + if (event.stopImmediatePropagation) { + event.stopImmediatePropagation(); + } + self.stopPropagation(); + } + }); +}); +(function(definition) { + var dependencies = [ "../base", "../function/unique/uuid", "../hook/css", "./event" ]; + if (!window.CustomEvent) { + dependencies.push("../polyfill/window/customevent"); + } + if (!window.addEventListener) { + dependencies.push("../polyfill/window/addeventlistener"); + } + if (!window.removeEventListener) { + dependencies.push("../polyfill/window/removeeventlistener"); + } + if (!window.dispatchEvent) { + dependencies.push("../polyfill/window/dispatchevent"); + } + if (!Element.prototype.matches) { + dependencies.push("../polyfill/element/matches"); + } + if (!document.querySelector) { + dependencies.push("../polyfill/document/queryselector"); + } + if (!document.querySelectorAll) { + dependencies.push("../polyfill/document/queryselectorall"); + } + if (!String.prototype.trim) { + dependencies.push("../polyfill/string/trim"); + } + window.qoopido.register("dom/element", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var stringObject = "object", stringString = "string", generateUuid = modules["function/unique/uuid"], head = document.getElementsByTagName("head")[0], contentAttribute = "textContent" in document.createElement("a") ? "textContent" : "innerText", previousSibling = typeof head.previousElementSibling !== "undefined" ? function previousSibling() { + return this.previousElementSibling; + } : function previousSibling() { + var element = this; + while (element = element.previousSibling) { + if (element.nodeType === 1) { + return element; + } + } + }, nextSibling = typeof head.nextElementSibling !== "undefined" ? function nextSibling() { + return this.nextElementSibling; + } : function nextSibling() { + var element = this; + while (element = element.nextSibling) { + if (element.nodeType === 1) { + return element; + } + } + }, isTag = new RegExp("^<(\\w+)\\s*/>$"), matchEvent = new RegExp("^[^-]+"), splitList = new RegExp(" +", "g"), pool = modules["pool/module"] && modules["pool/module"].create(modules["dom/event"], null, true) || null, hooks = modules["hook/css"], storage = {}, events = { + custom: { + type: "CustomEvent", + method: "initCustomEvent" + }, + html: { + regex: new RegExp("^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$"), + type: "HTMLEvents", + method: "initEvent" + }, + mouse: { + regex: new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"), + type: "MouseEvents", + method: "initMouseEvent" + } + }; + function resolveEvent(type) { + var id, prototype, candidate; + for (id in events) { + prototype = events[id]; + if (!prototype.regex || prototype.regex.test(type)) { + candidate = prototype; + } + } + return candidate; + } + function emitEvent(type, detail, uuid) { + var self = this, prototype = resolveEvent(type), event = document.createEvent(prototype.type); + event[prototype.method](type, type === "load" ? false : true, true, detail); + if (uuid) { + event._quid = uuid; + event.isDelegate = true; + } + self.element.dispatchEvent(event); + } + function resolveElement(element) { + var tag; + if (typeof element === "string") { + try { + if (isTag.test(element) === true) { + tag = element.replace(isTag, "$1").toLowerCase(); + element = document.createElement(tag); + } else { + element = document.querySelector(element); + } + } catch (exception) { + element = null; + } + } + if (!element) { + throw new Error("[Qoopido.js] Element could not be resolved"); + } + return element; + } + function resolveArguments(parameters) { + return Array.prototype.concat.apply([], Array.prototype.splice.call(parameters, 0)).join(" ").split(splitList); + } + function matchesDelegate(event, delegate) { + var i = 0, pointer; + for (;(pointer = event.path[i]) !== undefined; i++) { + if (pointer.matches(delegate)) { + event.currentTarget = pointer; + return true; + } + if (pointer === event.currentTarget) { + break; + } + } + return false; + } + return modules["base"].extend({ + type: null, + element: null, + _listener: null, + _constructor: function(element, attributes, styles) { + var self = this, uuid; + element = resolveElement(element); + uuid = element._quid; + if (!uuid) { + uuid = element._quid = generateUuid(); + self.type = element.tagName; + self.element = element; + self._listener = {}; + storage[uuid] = self; + } else { + self = storage[uuid]; + } + if (typeof attributes === "object" && attributes !== null) { + self.setAttributes(attributes); + } + if (typeof styles === "object" && styles !== null) { + self.setStyles(styles); + } + if (self !== this) { + this.dispose && this.dispose(); + } + return self; + }, + _obtain: function(element, attributes, styles) { + this._constructor(element, attributes, styles); + }, + _dispose: function() { + var self = this, id, event; + for (id in self._listener) { + event = id.match(matchEvent); + self.element.removeEventListener(event, self._listener[id]); + delete self._listener[id]; + } + self.type = null; + self.element = null; + }, + getContent: function(html) { + var element = this.element; + return html && html !== false ? element.innerHTML : element[contentAttribute]; + }, + setContent: function(content, html) { + var self = this, element = self.element; + if (html && html !== false) { + element.innerHTML = content; + } else { + element[contentAttribute] = content; + } + return self; + }, + getAttribute: function(attribute) { + var self = this; + if (attribute && typeof attribute === stringString) { + return self.element.getAttribute(attribute); + } + }, + getAttributes: function() { + var self = this, result = {}, attributes = resolveArguments(arguments), i = 0, attribute; + for (;(attribute = attributes[i]) !== undefined; i++) { + result[attribute] = self.element.getAttribute(attribute); + } + return result; + }, + setAttribute: function(attribute, value) { + var self = this; + if (attribute && typeof attribute === stringString) { + self.element.setAttribute(attribute, value); + } + return self; + }, + setAttributes: function(attributes) { + var self = this, attribute; + if (attributes && typeof attributes === stringObject && !attributes.length) { + for (attribute in attributes) { + self.element.setAttribute(attribute, attributes[attribute]); + } + } + return self; + }, + removeAttribute: function(attribute) { + var self = this; + if (attribute && typeof attribute === stringString) { + self.element.removeAttribute(attribute); + } + return self; + }, + removeAttributes: function() { + var self = this, attributes = resolveArguments(arguments), i = 0, attribute; + for (;(attribute = attributes[i]) !== undefined; i++) { + self.element.removeAttribute(attribute); + } + return self; + }, + getStyle: function(property) { + var self = this; + if (property && typeof property === stringString) { + return hooks.process("get", self.element, property); + } + }, + getStyles: function() { + var self = this, result = {}, properties = resolveArguments(arguments), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + result[property] = hooks.process("get", self.element, property); + } + return result; + }, + setStyle: function(property, value) { + var self = this; + if (property && typeof property === stringString) { + hooks.process("set", self.element, property, value); + } + return self; + }, + setStyles: function(properties) { + var self = this, property; + if (properties && typeof properties === stringObject && !properties.length) { + for (property in properties) { + hooks.process("set", self.element, property, properties[property]); + } + } + return self; + }, + removeStyle: function(property) { + var self = this; + if (property && typeof property === stringString) { + self.setStyle(property, ""); + } + return self; + }, + removeStyles: function() { + var self = this, properties = resolveArguments(arguments), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + self.setStyle(property, ""); + } + return self; + }, + siblings: function(selector) { + var element = this.element, pointer = element.parentNode.firstChild, siblings = []; + for (;pointer; pointer = nextSibling.call(pointer)) { + if (pointer !== element && (!selector || pointer.matches(selector))) { + siblings.push(pointer); + } + } + return siblings; + }, + siblingsBefore: function(selector) { + var pointer = this.element.previousSibling, siblings = []; + for (;pointer; pointer = previousSibling.call(pointer)) { + if (!selector || pointer.matches(selector)) { + siblings.push(pointer); + } + } + return siblings; + }, + siblingsAfter: function(selector) { + var pointer = this.element.nextSibling, siblings = []; + for (;pointer; pointer = nextSibling.call(pointer)) { + if (!selector || pointer.matches(selector)) { + siblings.push(pointer); + } + } + return siblings; + }, + previous: function(selector) { + var pointer = previousSibling.call(this.element); + if (!selector) { + return pointer; + } else { + for (;pointer; pointer = previousSibling.call(pointer)) { + if (pointer.matches(selector)) { + return pointer; + } + } + } + }, + next: function(selector) { + var pointer = nextSibling.call(this.element); + if (!selector) { + return pointer; + } else { + for (;pointer; pointer = nextSibling.call(pointer)) { + if (pointer.matches(selector)) { + return pointer; + } + } + } + }, + find: function(selector) { + var self = this.element, uuid, matches; + selector = selector.trim(); + if (selector.charAt(0) === ">") { + uuid = self._quid; + self.setAttribute("data-quid", uuid); + selector = '[data-quid="' + uuid + '"] ' + selector; + matches = self.parentNode.querySelectorAll(selector); + self.removeAttribute("data-quid"); + } else { + matches = self.querySelectorAll(selector); + } + return matches; + }, + parent: function(selector) { + var pointer; + if (!selector) { + return this.element.parentNode; + } else { + pointer = this.element; + for (;pointer; pointer = pointer.parentNode) { + if (pointer.matches(selector)) { + return pointer; + } + } + } + }, + parents: function(selector) { + var pointer = this.element.parentNode, parents = []; + for (;pointer; pointer = pointer.parentNode) { + if (pointer.nodeType === 9) { + return parents; + } else if (pointer.nodeType === 1) { + if (!selector || pointer.matches(selector)) { + parents.push(pointer); + } + } + } + }, + isVisible: function() { + var self = this, element = self.element; + return !(element.offsetWidth <= 0 && element.offsetHeight <= 0 || self.getStyle("visibility") === "hidden" || self.getStyle("opacity") <= 0); + }, + hasClass: function(name) { + return name ? new RegExp("(?:^|\\s)" + name + "(?:\\s|$)").test(this.element.className) : false; + }, + addClass: function(name) { + var self = this; + if (name && !self.hasClass(name)) { + self.element.className += self.element.className ? " " + name : name; + } + return self; + }, + removeClass: function(name) { + var self = this; + if (name && self.hasClass(name)) { + self.element.className = self.element.className.replace(new RegExp("(?:^|\\s)" + name + "(?!\\S)"), ""); + } + return self; + }, + toggleClass: function(name) { + var self = this; + if (name) { + self.hasClass(name) ? self.removeClass(name) : self.addClass(name); + } + return self; + }, + prepend: function(element) { + var self = this, target = self.element; + if (element) { + try { + element = element.element || resolveElement(element); + target.firstChild ? target.insertBefore(element, target.firstChild) : self.append(element); + } catch (exception) { + target.insertAdjacentHTML("afterBegin", element); + } + } + return self; + }, + append: function(element) { + var self = this, target = self.element; + if (element) { + try { + target.appendChild(element.element || resolveElement(element)); + } catch (exception) { + target.insertAdjacentHTML("beforeEnd", element); + } + } + return self; + }, + prependTo: function(target) { + var self = this, element = self.element; + if (target) { + (target = target.element || resolveElement(target)).firstChild ? target.insertBefore(element, target.firstChild) : self.appendTo(target); + } + return self; + }, + appendTo: function(target) { + var self = this; + if (target) { + (target.element || resolveElement(target)).appendChild(self.element); + } + return self; + }, + insertBefore: function(target) { + var self = this, element = self.element; + if (target) { + (target = target.element || resolveElement(target)).parentNode.insertBefore(element, target); + } + return self; + }, + insertAfter: function(target) { + var self = this, element = self.element; + if (target) { + (target = target.element || resolveElement(target)).nextSibling ? target.parentNode.insertBefore(element, target.nextSibling) : self.appendTo(target.parentNode); + } + return self; + }, + replace: function(target) { + var self = this, element = self.element; + if (target) { + (target = target.element || resolveElement(target)).parentNode.replaceChild(element, target); + } + return self; + }, + replaceWith: function(element) { + var self = this, target = self.element; + if (element) { + element = element.element || resolveElement(element); + target.parentNode.replaceChild(element, target); + } + return self; + }, + remove: function() { + var self = this, element = self.element; + element.parentNode.removeChild(element); + return self; + }, + on: function(events) { + var self = this, element = self.element, delegate = arguments.length > 2 ? arguments[1] : null, fn = arguments.length > 2 ? arguments[2] : arguments[1], uuid = fn._quid || (fn._quid = generateUuid()), i = 0, event; + events = events.split(" "); + for (;(event = events[i]) !== undefined; i++) { + var id = event + "-" + uuid, listener = function(event) { + var delegateTo; + event = pool && pool.obtain(event) || modules["dom/event"].create(event); + if (!event.isPropagationStopped) { + delegateTo = event.delegate; + event._quid = generateUuid(); + if (!delegate || matchesDelegate(event, delegate)) { + fn.call(event.currentTarget, event, event.originalEvent.detail); + } + if (delegateTo) { + delete event.delegate; + emitEvent.call(self, delegateTo); + } + } + event.dispose && event.dispose(); + }; + listener.type = event; + self._listener[id] = listener; + element.addEventListener(event, listener); + } + return self; + }, + one: function(events) { + var self = this, delegate = arguments.length > 3 || typeof arguments[1] === "string" ? arguments[1] : null, fn = arguments.length > 3 || typeof arguments[2] === "function" ? arguments[2] : arguments[1], each = (arguments.length > 3 ? arguments[3] : arguments[2]) !== false, listener = function(event) { + self.off(each === true ? event.type : events, listener); + fn.call(this, event, event.originalEvent.detail); + }; + fn._quid = listener._quid = generateUuid(); + if (delegate) { + self.on(events, delegate, listener); + } else { + self.on(events, listener); + } + return self; + }, + off: function(events, fn) { + var self = this, element = self.element, i = 0, event, id, listener; + events = events.split(" "); + for (;(event = events[i]) !== undefined; i++) { + id = fn._quid && event + "-" + fn._quid || null; + listener = id && self._listener[id] || null; + if (listener) { + element.removeEventListener(event, listener); + delete self._listener[id]; + } else { + element.removeEventListener(event, fn); + } + } + return self; + }, + emit: function(event, data) { + var self = this; + emitEvent.call(self, event, data); + return self; + } + }); +}); +(function(definition) { + window.qoopido.register("dom/element/emerge", definition, [ "../element", "../../function/merge", "../../function/unique/uuid" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var defaults = { + interval: 50, + threshold: "auto", + recur: true, + auto: 1, + visibility: true + }, documentElement = window.document.documentElement, viewport = {}, intervals = {}, elements = {}, prototype, EVENT_EMERGED = "emerged", EVENT_DEMERGED = "demerged", DOM_RESIZE = "resize orientationchange"; + window = modules["dom/element"].create(window); + if (document.compatMode !== "CSS1Compat") { + throw "[Qoopido.js] Not in standards mode"; + } + function tick(interval) { + var index, pointer = elements[interval]; + for (index in pointer) { + if (index !== "length") { + checkState.call(pointer[index]); + } + } + if (pointer.length === 0) { + window.element.clearInterval(intervals[interval]); + delete intervals[interval]; + } + } + function globalOnResize() { + viewport.left = 0; + viewport.top = 0; + viewport.right = window.innerWidth || documentElement.clientWidth; + viewport.bottom = window.innerHeight || documentElement.clientHeight; + } + function instanceOnResize() { + var self = this, treshold = self._settings.threshold, x = treshold !== undefined ? treshold : documentElement.clientWidth * self._settings.auto, y = treshold !== undefined ? treshold : documentElement.clientHeight * self._settings.auto; + self._viewport.left = viewport.left - x; + self._viewport.top = viewport.top - y; + self._viewport.right = viewport.right + x; + self._viewport.bottom = viewport.bottom + y; + } + function checkState() { + var self = this, state = false, priority = 2, boundaries; + if (self.isVisible() && (self.getStyle("visibility") !== "hidden" || self._settings.visibility === false)) { + boundaries = self.element.getBoundingClientRect(); + if ((boundaries.bottom >= self._viewport.top && boundaries.bottom <= self._viewport.bottom || boundaries.top >= self._viewport.top && boundaries.top <= self._viewport.bottom || self._viewport.bottom >= boundaries.top && self._viewport.bottom <= boundaries.bottom || self._viewport.top >= boundaries.top && self._viewport.top <= boundaries.bottom) && (boundaries.left >= self._viewport.left && boundaries.left <= self._viewport.right || boundaries.right >= self._viewport.left && boundaries.right <= self._viewport.right || self._viewport.left >= boundaries.left && self._viewport.left <= boundaries.right || self._viewport.right >= boundaries.left && self._viewport.right <= boundaries.right)) { + if (self._settings.threshold === 0 || (boundaries.bottom >= viewport.top && boundaries.bottom <= viewport.bottom || boundaries.top >= viewport.top && boundaries.top <= viewport.bottom || viewport.bottom >= boundaries.top && viewport.bottom <= boundaries.bottom || viewport.top >= boundaries.top && viewport.top <= boundaries.bottom) && (boundaries.left >= viewport.left && boundaries.left <= viewport.right || boundaries.right >= viewport.left && boundaries.right <= viewport.right || viewport.left >= boundaries.left && viewport.left <= boundaries.right || viewport.right >= boundaries.left && viewport.right <= boundaries.right)) { + priority = 1; + } + state = true; + } + } + if (state !== self._state || state === true && priority !== self._priority) { + setState.call(self, state, priority); + } + } + function setState(state, priority) { + var self = this; + self._state = state; + self._priority = priority; + if (self._settings.recur !== true) { + self.remove(); + } + if (state === true) { + self.emit(EVENT_EMERGED, priority); + } else { + self.emit(EVENT_DEMERGED); + } + } + prototype = modules["dom/element"].extend({ + _quid: null, + _viewport: null, + _settings: null, + _state: null, + _priority: null, + _constructor: function(element, settings) { + var self = prototype._parent._constructor.call(this, element); + settings = modules["function/merge"]({}, defaults, settings || {}); + if (settings.threshold === "auto") { + delete settings.threshold; + } + if (intervals[settings.interval] === undefined) { + elements[settings.interval] = elements[settings.interval] || { + length: 0 + }; + intervals[settings.interval] = window.element.setInterval(function() { + tick(settings.interval); + }, settings.interval); + } + self._quid = modules["function/unique/uuid"](); + self._viewport = {}; + self._settings = settings; + self._state = false; + self._priority = 2; + elements[settings.interval][self._quid] = self; + elements[settings.interval].length++; + window.on(DOM_RESIZE, function() { + instanceOnResize.call(self); + }); + instanceOnResize.call(self); + return self; + }, + remove: function() { + var self = this; + delete elements[self._settings.interval][self._quid]; + elements[self._settings.interval].length--; + } + }); + window.on(DOM_RESIZE, globalOnResize); + globalOnResize(); + return prototype; +}); +(function(definition) { + window.qoopido.register("dom/element/lazyimage", definition, [ "./emerge", "../../function/merge" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var defaults = { + interval: 50, + threshold: "auto", + attribute: "data-lazyimage" + }, queue = 0, prototype, EVENT_REQUESTED = "requested", EVENT_LOADED = "loaded", EVENT_FAILED = "failed", EVENT_EMERGED = "emerged", DOM_LOAD = "load", DOM_ERROR = "error", DOM_STATE = "".concat(DOM_LOAD, " ", DOM_ERROR); + function load() { + var self = this, attribute = self._settings.attribute; + queue += 1; + self.emit(EVENT_REQUESTED).one(DOM_STATE, function(event) { + if (event.type === DOM_LOAD) { + self.emit(EVENT_LOADED); + } else { + self.emit(EVENT_FAILED); + } + queue -= 1; + }, false).setAttribute("src", self.getAttribute(attribute)).removeAttribute(attribute); + } + prototype = modules["dom/element/emerge"].extend({ + _constructor: function(element, settings) { + var self = prototype._parent._constructor.call(this, element, modules["function/merge"]({}, defaults, settings || {})); + self.on(EVENT_EMERGED, function onEmerge(event) { + if (queue === 0 || event.data === 1) { + self.remove(); + self.off(EVENT_EMERGED, onEmerge); + load.call(self); + } + }); + return self; + } + }); + return prototype; +}); \ No newline at end of file diff --git a/dist/latest/max/packages/qoopido.lazyimage.legacy.js b/dist/latest/max/packages/qoopido.lazyimage.legacy.js new file mode 100644 index 00000000..6fbcf4f2 --- /dev/null +++ b/dist/latest/max/packages/qoopido.lazyimage.legacy.js @@ -0,0 +1,1685 @@ +/*! +* Qoopido.js library +* +* version: 3.7.3 +* date: 2015-08-05 +* author: Dirk Lueth +* website: https://github.com/dlueth/qoopido.js +* +* Copyright (c) 2015 Dirk Lueth +*/ +(function(definition, qoopido) { + if (qoopido.register) { + qoopido.register("polyfill/object/defineproperty", definition); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/defineproperty"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.defineProperty || !function() { + try { + Object.defineProperty({}, "x", {}); + return true; + } catch (exception) { + return false; + } + }()) { + var defineProperty = Object.defineProperty, defineGetter = Object.prototype.__defineGetter__, defineSetter = Object.prototype.__defineSetter__; + Object.defineProperty = function(obj, prop, desc) { + if (defineProperty) { + try { + return defineProperty(obj, prop, desc); + } catch (exception) {} + } + if (obj !== Object(obj)) { + throw new TypeError("Object.defineProperty called on non-object"); + } + if (defineGetter && "get" in desc) { + defineGetter.call(obj, prop, desc.get); + } + if (defineSetter && "set" in desc) { + defineSetter.call(obj, prop, desc.set); + } + if ("value" in desc) { + obj[prop] = desc.value; + } + return obj; + }; + } + return Object.defineProperty; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + var dependencies = []; + if (!Object.defineProperty || !function() { + try { + Object.defineProperty({}, "x", {}); + return true; + } catch (exception) { + return false; + } + }()) { + dependencies.push("./defineproperty"); + } + qoopido.register("polyfill/object/defineproperties", definition, dependencies); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/defineproperties"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.defineProperties) { + Object.defineProperties = function(obj, properties) { + if (obj !== Object(obj)) { + throw new TypeError("Object.defineProperties called on non-object"); + } + var name; + for (name in properties) { + if (Object.prototype.hasOwnProperty.call(properties, name)) { + Object.defineProperty(obj, name, properties[name]); + } + } + return obj; + }; + } + return Object.defineProperties; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + var dependencies = []; + if (!Object.defineProperties) { + dependencies.push("./defineproperties"); + } + qoopido.register("polyfill/object/create", definition, dependencies); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/create"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.create) { + Object.create = function(prototype, properties) { + if (typeof prototype !== "object") { + throw new TypeError(); + } + function Constructor() {} + Constructor.prototype = prototype; + var obj = new Constructor(); + if (prototype) { + obj.constructor = Constructor; + } + if (arguments.length > 1) { + if (properties !== Object(properties)) { + throw new TypeError(); + } + Object.defineProperties(obj, properties); + } + return obj; + }; + } + return Object.create; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + qoopido.register("polyfill/object/getownpropertynames", definition); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/getownpropertynames"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.getOwnPropertyNames) { + Object.getOwnPropertyNames = function(obj) { + if (obj !== Object(obj)) { + throw new TypeError("Object.getOwnPropertyNames called on non-object"); + } + var props = [], p; + for (p in obj) { + if (Object.prototype.hasOwnProperty.call(obj, p)) { + props.push(p); + } + } + return props; + }; + } + return Object.getOwnPropertyNames; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + qoopido.register("polyfill/object/getownpropertydescriptor", definition); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/getownpropertydescriptor"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.getOwnPropertyDescriptor || !function() { + try { + Object.getOwnPropertyDescriptor({ + x: 0 + }, "x"); + return true; + } catch (exception) { + return false; + } + }()) { + var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; + Object.getOwnPropertyDescriptor = function(obj, property) { + if (obj !== Object(obj)) { + throw new TypeError(); + } + try { + return getOwnPropertyDescriptor.call(Object, obj, property); + } catch (exception) {} + if (Object.prototype.hasOwnProperty.call(obj, property)) { + return { + value: obj[property], + enumerable: true, + writable: true, + configurable: true + }; + } + }; + } + return Object.getOwnPropertyDescriptor; +}, window.qoopido = window.qoopido || {}); +(function(definition, navigator, global, document, undefined) { + "use strict"; + function register(id, definition, dependencies, callback) { + var namespace = id.split("/"), initialize; + if (modules[id]) { + return modules[id]; + } + initialize = function() { + if (dependencies) { + var path = namespace.slice(0, -1).join("/"), i = 0, dependency, internal; + for (;(dependency = dependencies[i]) !== undefined; i++) { + internal = isInternal.test(dependency); + if (internal) { + dependency = canonicalize(path + "/" + dependency); + } + if (!modules[dependency] && arguments[i]) { + modules[dependency] = arguments[i]; + } + if (internal && !modules[dependency] && typeof console !== "undefined") { + console.error("".concat("[Qoopido.js] ", id, ": Could not load dependency ", dependency)); + } + } + } + modules[id] = definition(modules, shared, namespace, navigator, global, document, undefined); + if (callback) { + callback(modules[id]); + } + return modules[id]; + }; + if (typeof module !== "undefined" && module.exports) { + module.exports = define(initialize); + } else if (typeof define === "function" && define.amd) { + dependencies ? define(dependencies, initialize) : define(initialize); + } else { + initialize(); + } + } + function registerSingleton(id, definition, dependencies) { + register(id, definition, dependencies, function(module) { + modules[id] = module.create(); + }); + } + var qoopido = global.qoopido || (global.qoopido = {}), shared = qoopido.shared || (qoopido.shared = {}), modules = qoopido.modules || (qoopido.modules = {}), dependencies = [], isInternal = new RegExp("^\\.+\\/"), regexCanonicalize = new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."), removeNeutral = new RegExp("(^\\/)|\\.\\/", "g"); + qoopido.register = register; + qoopido.registerSingleton = registerSingleton; + function canonicalize(path) { + var collapsed; + while ((collapsed = path.replace(regexCanonicalize, "")) !== path) { + path = collapsed; + } + return path.replace(removeNeutral, ""); + } + if (!Object.create) { + dependencies.push("./polyfill/object/create"); + } + if (!Object.getOwnPropertyNames) { + dependencies.push("./polyfill/object/getownpropertynames"); + } + if (!Object.getOwnPropertyDescriptor || !function() { + try { + Object.getOwnPropertyDescriptor({ + x: 0 + }, "x"); + return true; + } catch (exception) { + return false; + } + }()) { + dependencies.push("./polyfill/object/getownpropertydescriptor"); + } + register("base", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + function getOwnPropertyDescriptors(object) { + var descriptors = {}, properties = Object.getOwnPropertyNames(object), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + descriptors[property] = Object.getOwnPropertyDescriptor(object, property); + } + return descriptors; + } + function prohibitCall() { + throw new Error("[Qoopido.js] Operation prohibited"); + } + return { + create: function() { + var instance = Object.create(this, getOwnPropertyDescriptors(this)), result; + if (instance._constructor) { + result = instance._constructor.apply(instance, arguments); + } + instance.create = instance.extend = prohibitCall; + return result || instance; + }, + extend: function(properties, final) { + var instance; + properties = properties || {}; + final = final === true; + properties._parent = this; + instance = Object.create(this, getOwnPropertyDescriptors(properties)); + if (final === true) { + instance.extend = prohibitCall; + } + return instance; + } + }; +}, navigator, this, document); +(function(definition) { + window.qoopido.register("polyfill/string/ucfirst", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!String.prototype.ucfirst) { + String.prototype.ucfirst = function() { + var self = this; + return self.charAt(0).toUpperCase() + self.slice(1); + }; + } + return String.prototype.ucfirst; +}); +(function(definition) { + window.qoopido.register("polyfill/string/lcfirst", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!String.prototype.lcfirst) { + String.prototype.lcfirst = function() { + var self = this; + return self.charAt(0).toLowerCase() + self.slice(1); + }; + } + return String.prototype.lcfirst; +}); +(function(definition) { + window.qoopido.register("polyfill/window/getcomputedstyle", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!window.getComputedStyle) { + var getComputedStyleRegex = new RegExp("(\\-([a-z]){1})", "g"), getComputedStyleCallback = function() { + return arguments[2].toUpperCase(); + }; + return function(element, pseudo) { + var self = this; + self.getPropertyValue = function(property) { + if (property === "float") { + property = "styleFloat"; + } + if (getComputedStyleRegex.test(property)) { + property = property.replace(getComputedStyleRegex, getComputedStyleCallback); + } + return element.currentStyle[property] || null; + }; + return self; + }; + } else { + return window.getComputedStyle; + } +}); +(function(definition) { + window.qoopido.register("polyfill/window/promise", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var STATE_PENDING = void 0, STATE_SEALED = 0, STATE_FULFILLED = 1, STATE_REJECTED = 2, queue = []; + function addCallback(fn, arg) { + var length = queue.push([ fn, arg ]); + if (length === 1) { + scheduleFlushCallbacks(); + } + } + function scheduleFlushCallbacks() { + window.setTimeout(flushCallbacks, 1); + } + function flushCallbacks() { + var i = 0, tuple; + for (;(tuple = queue[i]) !== undefined; i++) { + tuple[0](tuple[1]); + } + queue.length = 0; + } + function handleThenable(promise, value) { + var then = null, resolved; + try { + if (promise === value) { + throw new TypeError("A promises callback cannot return that same promise."); + } + if (typeof value === "function" || typeof value === "object" && value !== null) { + then = value.then; + if (typeof then === "function") { + then.call(value, function(val) { + if (resolved) { + return true; + } + resolved = true; + if (value !== val) { + resolve(promise, val); + } else { + fulfill(promise, val); + } + }, function(val) { + if (resolved) { + return true; + } + resolved = true; + reject(promise, val); + }); + return true; + } + } + } catch (exception) { + if (resolved) { + return true; + } + reject(promise, exception); + return true; + } + return false; + } + function invokeResolver(resolver, promise) { + function resolvePromise(value) { + resolve(promise, value); + } + function rejectPromise(reason) { + reject(promise, reason); + } + try { + resolver(resolvePromise, rejectPromise); + } catch (exception) { + rejectPromise(exception); + } + } + function invokeCallback(settled, promise, callback, detail) { + var hasCallback = typeof callback === "function", value, error, succeeded, failed; + if (hasCallback) { + try { + value = callback(detail); + succeeded = true; + } catch (exception) { + failed = true; + error = exception; + } + } else { + value = detail; + succeeded = true; + } + if (handleThenable(promise, value)) { + return; + } else if (hasCallback && succeeded) { + resolve(promise, value); + } else if (failed) { + reject(promise, error); + } else if (settled === STATE_FULFILLED) { + resolve(promise, value); + } else if (settled === STATE_REJECTED) { + reject(promise, value); + } + } + function resolve(promise, value) { + if (promise === value) { + fulfill(promise, value); + } else if (!handleThenable(promise, value)) { + fulfill(promise, value); + } + } + function fulfill(promise, value) { + if (promise._state !== STATE_PENDING) { + return; + } + promise._state = STATE_SEALED; + promise._detail = value; + addCallback(publishFulfillment, promise); + } + function reject(promise, reason) { + if (promise._state !== STATE_PENDING) { + return; + } + promise._state = STATE_SEALED; + promise._detail = reason; + addCallback(publishRejection, promise); + } + function publishFulfillment(promise) { + publish(promise, promise._state = STATE_FULFILLED); + } + function publishRejection(promise) { + publish(promise, promise._state = STATE_REJECTED); + } + function subscribe(parent, child, onFulfillment, onRejection) { + var subscribers = parent._subscribers, length = subscribers.length; + subscribers[length] = child; + subscribers[length + STATE_FULFILLED] = onFulfillment; + subscribers[length + STATE_REJECTED] = onRejection; + } + function publish(promise, settled) { + var child, callback, subscribers = promise._subscribers, detail = promise._detail, i = 0; + for (;(child = subscribers[i]) !== undefined; i += 3) { + callback = subscribers[i + settled]; + invokeCallback(settled, child, callback, detail); + } + promise._subscribers = null; + } + function Promise(resolver) { + var self = this; + if (typeof resolver !== "function") { + throw new TypeError("You must pass a resolver function as the first argument to the promise constructor"); + } + self._subscribers = []; + invokeResolver(resolver, self); + } + Promise.prototype = { + _state: undefined, + _detail: undefined, + _subscribers: undefined, + then: function(onFulfilled, onRejected) { + var self = this, thenPromise = new Promise(function() {}); + if (self._state) { + addCallback(function invokePromiseCallback() { + invokeCallback(self._state, thenPromise, arguments[self._state - 1], self._detail); + }); + } else { + subscribe(self, thenPromise, onFulfilled, onRejected); + } + return thenPromise; + }, + "catch": function(onRejected) { + return this.then(null, onRejected); + } + }; + if (!window.Promise) { + window.Promise = Promise; + } + return window.Promise; +}); +(function(definition) { + var dependencies = []; + if (!window.Promise) { + dependencies.push("../polyfill/window/promise"); + } + window.qoopido.register("promise/all", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + return function all(promises) { + if (Object.prototype.toString.call(promises) !== "[object Array]") { + throw new TypeError("You must pass an array to all."); + } + return new window.Promise(function(resolve, reject) { + var results = [], remaining = promises.length, i = 0, promise; + if (remaining === 0) { + resolve([]); + } + function resolver(index) { + return function(value) { + resolveAll(index, value); + }; + } + function resolveAll(index, value) { + results[index] = value; + if (--remaining === 0) { + resolve(results); + } + } + for (;(promise = promises[i]) !== undefined; i++) { + if (promise && typeof promise.then === "function") { + promise.then(resolver(i), reject); + } else { + resolveAll(i, promise); + } + } + }); + }; +}); +(function(definition) { + var dependencies = []; + if (!window.Promise) { + dependencies.push("../polyfill/window/promise"); + } + window.qoopido.register("promise/defer", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + return function defer() { + var self = this; + self.promise = new window.Promise(function(resolve, reject) { + self.resolve = resolve; + self.reject = reject; + }); + }; +}); +(function(definition) { + var dependencies = [ "./base", "./promise/all", "./promise/defer" ]; + if (!String.prototype.ucfirst) { + dependencies.push("./polyfill/string/ucfirst"); + } + if (!String.prototype.lcfirst) { + dependencies.push("./polyfill/string/lcfirst"); + } + window.qoopido.registerSingleton("support", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var CombinedPromise = modules["promise/all"], DeferredPromise = modules["promise/defer"], matchPrefix = new RegExp("^(Moz|WebKit|Khtml|ms|O|Icab)(?=[A-Z])"), removeJsPrefix = new RegExp("^(?:webkit|khtml|icab|moz|ms|o)([A-Z])"), removeCssPrefix = new RegExp("^-(?:webkit|khtml|icab|moz|ms|o)-"), convertToCamelCase = new RegExp("-([a-z])", "gi"), convertToHyphens = new RegExp("([A-Z])", "g"), callbackUcfirst = function() { + return arguments[1].ucfirst(); + }, lookup = { + prefix: null, + method: {}, + property: {}, + css: {}, + promises: { + prefix: null, + method: {}, + property: {}, + css: {}, + test: {} + } + }; + function normalize(value) { + return value.replace(removeJsPrefix, "$1").lcfirst().replace(removeCssPrefix, "").replace(convertToCamelCase, callbackUcfirst); + } + return modules["base"].extend({ + test: {}, + pool: shared.pool && shared.pool.dom, + testMultiple: function() { + var test, tests = [], i = 0; + for (;(test = arguments[i]) !== undefined; i++) { + switch (typeof test) { + case "string": + tests.push(this.test[test]()); + break; + + case "boolean": + var deferred = new DeferredPromise(); + !!test ? deferred.resolve() : deferred.reject(); + tests.push(deferred.promise); + break; + + default: + tests.push(test); + break; + } + } + return new CombinedPromise(tests); + }, + getPrefix: function() { + var self = this, stored = lookup.prefix || null, property; + if (stored === null) { + var sample = self.pool ? self.pool.obtain("div") : document.createElement("div"), styles = sample.style; + stored = false; + for (property in styles) { + if (matchPrefix.test(property)) { + stored = property.match(matchPrefix)[0]; + } + } + if (stored === false && "WebkitOpacity" in styles) { + stored = "WebKit"; + } + if (stored === false && "KhtmlOpacity" in styles) { + stored = "Khtml"; + } + stored = lookup.prefix = stored === false ? false : [ stored.toLowerCase(), stored.toLowerCase().ucfirst(), stored ]; + sample.dispose && sample.dispose(); + } + return stored; + }, + getMethod: function(pMethod, pElement) { + pMethod = normalize(pMethod); + pElement = pElement || window; + var type = pElement.tagName, pointer = lookup.method[type] = lookup.method[type] || {}, stored = pointer[pMethod] = lookup.method[type][pMethod] || null; + if (stored === null) { + stored = false; + var candidates, candidate, i = 0, uMethod = pMethod.ucfirst(), prefixes = this.getPrefix(); + if (prefixes !== false) { + candidates = (pMethod + " " + uMethod + " " + prefixes.join(uMethod + " ") + uMethod).split(" "); + } else { + candidates = [ pMethod ]; + } + for (;(candidate = candidates[i]) !== undefined; i++) { + if (pElement[candidate] !== undefined && (typeof pElement[candidate] === "function" || typeof pElement[candidate] === "object")) { + stored = candidate; + break; + } + } + lookup.method[type][pMethod] = stored; + } + return stored; + }, + getProperty: function(pProperty, pElement) { + pProperty = normalize(pProperty); + pElement = pElement || window; + var type = pElement.tagName, pointer = lookup.property[type] = lookup.property[type] || {}, stored = pointer[pProperty] = lookup.property[type][pProperty] || null; + if (stored === null) { + stored = false; + var candidates, candidate, i = 0, uProperty = pProperty.ucfirst(), prefixes = this.getPrefix(); + if (prefixes !== false) { + candidates = (pProperty + " " + uProperty + " " + prefixes.join(uProperty + " ") + uProperty).split(" "); + } else { + candidates = [ pProperty ]; + } + for (i; (candidate = candidates[i]) !== undefined; i++) { + if (pElement[candidate] !== undefined) { + stored = candidate; + break; + } + } + lookup.property[type][pProperty] = stored; + } + return stored; + }, + getCssProperty: function(pProperty) { + pProperty = normalize(pProperty); + var self = this, stored = lookup.css[pProperty] || null; + if (stored === null) { + stored = false; + var candidate, i = 0, sample = self.pool ? self.pool.obtain("div") : document.createElement("div"), uProperty = pProperty.ucfirst(), prefixes = this.getPrefix() || [], candidates = (pProperty + " " + uProperty + " " + prefixes.join(uProperty + " ") + uProperty).split(" "), prefix = ""; + for (i; (candidate = candidates[i]) !== undefined; i++) { + if (sample.style[candidate] !== undefined) { + stored = candidate; + if (i > 0) { + prefix = "-"; + } + break; + } + } + stored = lookup.css[pProperty] = stored !== false ? [ prefix + stored.replace(convertToHyphens, "-$1").toLowerCase(), stored ] : false; + sample.dispose && sample.dispose(); + } + return stored; + }, + supportsPrefix: function() { + return !!this.getPrefix(); + }, + supportsMethod: function(pMethod, pElement) { + return !!this.getMethod(pMethod, pElement); + }, + supportsProperty: function(pProperty, pElement) { + return !!this.getProperty(pProperty, pElement); + }, + supportsCssProperty: function(pProperty) { + return !!this.getCssProperty(pProperty); + }, + testPrefix: function() { + var stored = lookup.promises.prefix; + if (stored === null) { + var deferred = new DeferredPromise(), prefix = this.getPrefix(); + !!prefix ? deferred.resolve(prefix) : deferred.reject(); + stored = lookup.promises.prefix = deferred.promise; + } + return stored; + }, + testMethod: function(pMethod, pElement) { + pElement = pElement || window; + var type = pElement.tagName, pointer = lookup.promises.method[type] = lookup.promises.method[type] || {}, stored = pointer[pMethod] = lookup.promises.method[type][pMethod] || null; + if (stored === null) { + var deferred = new DeferredPromise(), method = this.getMethod(pMethod, pElement); + !!method ? deferred.resolve(method) : deferred.reject(); + stored = lookup.promises.method[type][pMethod] = deferred.promise; + } + return stored; + }, + testProperty: function(pProperty, pElement) { + pElement = pElement || window; + var type = pElement.tagName, pointer = lookup.promises.property[type] = lookup.promises.property[type] || {}, stored = pointer[pProperty] = lookup.promises.property[type][pProperty] || null; + if (stored === null) { + var deferred = new DeferredPromise(), property = this.getProperty(pProperty, pElement); + !!property ? deferred.resolve(property) : deferred.reject(); + stored = lookup.promises.property[type][pProperty] = deferred.promise; + } + return stored; + }, + testCssProperty: function(pProperty) { + var stored = lookup.promises.css[pProperty] || null; + if (stored === null) { + var deferred = new DeferredPromise(), property = this.getCssProperty(pProperty); + !!property ? deferred.resolve(property) : deferred.reject(); + stored = lookup.promises.css[pProperty] = deferred.promise; + } + return stored; + }, + addTest: function(pId, pTest) { + return this.test[pId] = function() { + var stored = lookup.promises.test[pId] || null; + if (stored === null) { + var deferred = new DeferredPromise(), parameter = Array.prototype.slice.call(arguments); + parameter.splice(0, 0, deferred); + pTest.apply(null, parameter); + stored = lookup.promises.test[pId] = deferred.promise; + } + return stored; + }; + } + }); +}); +(function(definition) { + window.qoopido.register("function/merge", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + return function merge() { + var target = arguments[0], i, properties, property, tgt, src; + for (i = 1; (properties = arguments[i]) !== undefined; i++) { + for (property in properties) { + tgt = target[property]; + src = properties[property]; + if (src !== undefined) { + if (src !== null && typeof src === "object") { + if (src.length !== undefined) { + tgt = tgt && typeof tgt === "object" && tgt.length !== undefined ? tgt : []; + } else { + tgt = tgt && typeof tgt === "object" && tgt.length === undefined ? tgt : {}; + } + target[property] = merge(tgt, src); + } else { + target[property] = src; + } + } + } + } + return target; + }; +}); +(function(definition) { + window.qoopido.register("function/unique/uuid", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var lookup = {}, regex = new RegExp("[xy]", "g"); + function generateUuid() { + return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(regex, function(c) { + var r = Math.random() * 16 | 0, v = c === "x" ? r : r & 3 | 8; + return v.toString(16); + }); + } + return function() { + var result; + do { + result = generateUuid(); + } while (typeof lookup[result] !== "undefined"); + lookup[result] = true; + return result; + }; +}); +(function(definition) { + window.qoopido.registerSingleton("hook/event", definition, [ "../base" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + function transferProperties(event, originalEvent, properties) { + var i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + event[property] = originalEvent[property]; + } + event._properties = event._properties.concat(properties); + } + var hooks = { + general: { + properties: "type altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which path".split(" "), + process: function(event, originalEvent) { + var pointer; + event.originalEvent = originalEvent; + event.isDefaultPrevented = originalEvent.defaultPrevented ? true : false; + event.isPropagationStopped = originalEvent.cancelBubble ? true : false; + event.metaKey = originalEvent.metaKey && originalEvent.metaKey !== false ? true : false; + if (!event.target) { + event.target = originalEvent.srcElement || document; + } + if (event.target.nodeType === 3) { + event.target = event.target.parentNode; + } + if (!event.path) { + event.path = []; + pointer = event.target; + do { + event.path.push(pointer); + } while (pointer = pointer.parentNode); + event.path.push(window); + } + } + }, + mouse: { + regex: new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"), + properties: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement dataTransfer".split(" "), + process: function(event, originalEvent) { + var pointer, fromElement, which; + fromElement = originalEvent.fromElement; + which = originalEvent.button; + if (event.pageX === null && originalEvent.clientX !== null) { + pointer = event.target.ownerDocument || document; + pointer = pointer.documentElement || pointer.body; + event.pageX = originalEvent.clientX + (pointer.scrollLeft || 0) - (pointer.clientLeft || 0); + event.pageY = originalEvent.clientY + (pointer.scrollTop || 0) - (pointer.clientTop || 0); + } + if (!event.relatedTarget && fromElement) { + event.relatedTarget = fromElement === event.target ? originalEvent.toElement : fromElement; + } + if (!event.which && which !== undefined) { + event.which = which & 1 ? 1 : which & 2 ? 3 : which & 4 ? 2 : 0; + } + } + }, + key: { + regex: new RegExp("^(?:key)"), + properties: "char charCode key keyCode".split(" "), + process: function(event, originalEvent) { + if (event.which === null) { + event.which = originalEvent.charCode !== null ? originalEvent.charCode : originalEvent.keyCode; + } + } + } + }; + return modules["base"].extend({ + add: function(property, hook) { + if (property && hook && hooks[property]) { + hooks[property] = hook; + } + return this; + }, + get: function(property) { + if (property && hooks[property]) { + return hooks[property]; + } + return null; + }, + process: function(event, originalEvent) { + var id, hook, isMatch; + for (id in hooks) { + hook = hooks[id]; + isMatch = !hook.regex || hook.regex.test(originalEvent.type); + if (isMatch) { + if (hook.properties) { + transferProperties(event, originalEvent, hook.properties); + } + if (hook.process) { + hook.process(event, originalEvent); + } + if (hook.delegate) { + event.delegate = hook.delegate; + } + } + } + } + }); +}); +(function(definition) { + var dependencies = [ "../base", "../support" ]; + if (!window.getComputedStyle) { + dependencies.push("../polyfill/window/getcomputedstyle"); + } + window.qoopido.registerSingleton("hook/css", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var mSupport = modules["support"], getComputedStyle = window.getComputedStyle || modules["polyfill/window/getcomputedstyle"], hooks = { + general: { + get: function(element, property) { + return getComputedStyle(element, null).getPropertyValue(property[0]); + }, + set: function(element, property, value) { + element.style[property[1]] = value; + } + }, + opacity: !mSupport.supportsCssProperty("opacity") ? { + regex: new RegExp("alpha\\(opacity=(.*)\\)", "i"), + get: function(element, property, value) { + value = getComputedStyle(element, null).getPropertyValue("filter").toString().match(this.regex); + if (value) { + value = value[1] / 100; + } else { + value = 1; + } + return value; + }, + set: function(element, property, value) { + var style = element.style; + style.zoom = 1; + style.filter = "alpha(opacity=" + (value * 100 + .5 >> 0) + ")"; + } + } : null + }; + return modules["base"].extend({ + add: function(property, hook) { + if (property && hook && hooks[property]) { + hooks[property] = hook; + } + return this; + }, + get: function(property) { + if (property && hooks[property]) { + return hooks[property]; + } + return null; + }, + process: function(method, element, property, value) { + var hook; + property = mSupport.getCssProperty(property, element) || null; + if (property) { + return ((hook = this.get(property[1])) && hook[method] || this.get("general")[method])(element, property, value); + } + } + }); +}); +(function(definition) { + window.qoopido.register("dom/event", definition, [ "../base", "../hook/event" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var hooks = modules["hook/event"]; + return modules["base"].extend({ + originalEvent: null, + isDelegate: false, + isDefaultPrevented: false, + isPropagationStopped: false, + isImmediatePropagationStopped: false, + _properties: null, + _constructor: function(event) { + var self = this; + self._properties = []; + self._obtain(event); + return self; + }, + _obtain: function(event) { + hooks.process(this, event); + }, + _dispose: function() { + var self = this, i = 0, property; + for (;(property = self._properties[i]) !== undefined; i++) { + delete self[property]; + } + delete self.delegate; + self.originalEvent = null; + self.isDelegate = false; + self.isDefaultPrevented = false; + self.isPropagationStopped = false; + self.isImmediatePropagationStopped = false; + self._properties.length = 0; + }, + preventDefault: function() { + var self = this, event = self.originalEvent; + if (event.cancelable !== false) { + self.isDefaultPrevented = true; + if (event.preventDefault) { + event.preventDefault(); + } else { + event.returnValue = false; + } + } + }, + stopPropagation: function() { + var self = this, event = self.originalEvent; + self.isPropagationStopped = true; + if (event.stopPropagation) { + event.stopPropagation(); + } + event.cancelBubble = true; + }, + stopImmediatePropagation: function() { + var self = this, event = self.originalEvent; + self.isImmediatePropagationStopped = true; + if (event.stopImmediatePropagation) { + event.stopImmediatePropagation(); + } + self.stopPropagation(); + } + }); +}); +(function(definition) { + var dependencies = [ "../base", "../function/unique/uuid", "../hook/css", "./event" ]; + if (!window.CustomEvent) { + dependencies.push("../polyfill/window/customevent"); + } + if (!window.addEventListener) { + dependencies.push("../polyfill/window/addeventlistener"); + } + if (!window.removeEventListener) { + dependencies.push("../polyfill/window/removeeventlistener"); + } + if (!window.dispatchEvent) { + dependencies.push("../polyfill/window/dispatchevent"); + } + if (!Element.prototype.matches) { + dependencies.push("../polyfill/element/matches"); + } + if (!document.querySelector) { + dependencies.push("../polyfill/document/queryselector"); + } + if (!document.querySelectorAll) { + dependencies.push("../polyfill/document/queryselectorall"); + } + if (!String.prototype.trim) { + dependencies.push("../polyfill/string/trim"); + } + window.qoopido.register("dom/element", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var stringObject = "object", stringString = "string", generateUuid = modules["function/unique/uuid"], head = document.getElementsByTagName("head")[0], contentAttribute = "textContent" in document.createElement("a") ? "textContent" : "innerText", previousSibling = typeof head.previousElementSibling !== "undefined" ? function previousSibling() { + return this.previousElementSibling; + } : function previousSibling() { + var element = this; + while (element = element.previousSibling) { + if (element.nodeType === 1) { + return element; + } + } + }, nextSibling = typeof head.nextElementSibling !== "undefined" ? function nextSibling() { + return this.nextElementSibling; + } : function nextSibling() { + var element = this; + while (element = element.nextSibling) { + if (element.nodeType === 1) { + return element; + } + } + }, isTag = new RegExp("^<(\\w+)\\s*/>$"), matchEvent = new RegExp("^[^-]+"), splitList = new RegExp(" +", "g"), pool = modules["pool/module"] && modules["pool/module"].create(modules["dom/event"], null, true) || null, hooks = modules["hook/css"], storage = {}, events = { + custom: { + type: "CustomEvent", + method: "initCustomEvent" + }, + html: { + regex: new RegExp("^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$"), + type: "HTMLEvents", + method: "initEvent" + }, + mouse: { + regex: new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"), + type: "MouseEvents", + method: "initMouseEvent" + } + }; + function resolveEvent(type) { + var id, prototype, candidate; + for (id in events) { + prototype = events[id]; + if (!prototype.regex || prototype.regex.test(type)) { + candidate = prototype; + } + } + return candidate; + } + function emitEvent(type, detail, uuid) { + var self = this, prototype = resolveEvent(type), event = document.createEvent(prototype.type); + event[prototype.method](type, type === "load" ? false : true, true, detail); + if (uuid) { + event._quid = uuid; + event.isDelegate = true; + } + self.element.dispatchEvent(event); + } + function resolveElement(element) { + var tag; + if (typeof element === "string") { + try { + if (isTag.test(element) === true) { + tag = element.replace(isTag, "$1").toLowerCase(); + element = document.createElement(tag); + } else { + element = document.querySelector(element); + } + } catch (exception) { + element = null; + } + } + if (!element) { + throw new Error("[Qoopido.js] Element could not be resolved"); + } + return element; + } + function resolveArguments(parameters) { + return Array.prototype.concat.apply([], Array.prototype.splice.call(parameters, 0)).join(" ").split(splitList); + } + function matchesDelegate(event, delegate) { + var i = 0, pointer; + for (;(pointer = event.path[i]) !== undefined; i++) { + if (pointer.matches(delegate)) { + event.currentTarget = pointer; + return true; + } + if (pointer === event.currentTarget) { + break; + } + } + return false; + } + return modules["base"].extend({ + type: null, + element: null, + _listener: null, + _constructor: function(element, attributes, styles) { + var self = this, uuid; + element = resolveElement(element); + uuid = element._quid; + if (!uuid) { + uuid = element._quid = generateUuid(); + self.type = element.tagName; + self.element = element; + self._listener = {}; + storage[uuid] = self; + } else { + self = storage[uuid]; + } + if (typeof attributes === "object" && attributes !== null) { + self.setAttributes(attributes); + } + if (typeof styles === "object" && styles !== null) { + self.setStyles(styles); + } + if (self !== this) { + this.dispose && this.dispose(); + } + return self; + }, + _obtain: function(element, attributes, styles) { + this._constructor(element, attributes, styles); + }, + _dispose: function() { + var self = this, id, event; + for (id in self._listener) { + event = id.match(matchEvent); + self.element.removeEventListener(event, self._listener[id]); + delete self._listener[id]; + } + self.type = null; + self.element = null; + }, + getContent: function(html) { + var element = this.element; + return html && html !== false ? element.innerHTML : element[contentAttribute]; + }, + setContent: function(content, html) { + var self = this, element = self.element; + if (html && html !== false) { + element.innerHTML = content; + } else { + element[contentAttribute] = content; + } + return self; + }, + getAttribute: function(attribute) { + var self = this; + if (attribute && typeof attribute === stringString) { + return self.element.getAttribute(attribute); + } + }, + getAttributes: function() { + var self = this, result = {}, attributes = resolveArguments(arguments), i = 0, attribute; + for (;(attribute = attributes[i]) !== undefined; i++) { + result[attribute] = self.element.getAttribute(attribute); + } + return result; + }, + setAttribute: function(attribute, value) { + var self = this; + if (attribute && typeof attribute === stringString) { + self.element.setAttribute(attribute, value); + } + return self; + }, + setAttributes: function(attributes) { + var self = this, attribute; + if (attributes && typeof attributes === stringObject && !attributes.length) { + for (attribute in attributes) { + self.element.setAttribute(attribute, attributes[attribute]); + } + } + return self; + }, + removeAttribute: function(attribute) { + var self = this; + if (attribute && typeof attribute === stringString) { + self.element.removeAttribute(attribute); + } + return self; + }, + removeAttributes: function() { + var self = this, attributes = resolveArguments(arguments), i = 0, attribute; + for (;(attribute = attributes[i]) !== undefined; i++) { + self.element.removeAttribute(attribute); + } + return self; + }, + getStyle: function(property) { + var self = this; + if (property && typeof property === stringString) { + return hooks.process("get", self.element, property); + } + }, + getStyles: function() { + var self = this, result = {}, properties = resolveArguments(arguments), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + result[property] = hooks.process("get", self.element, property); + } + return result; + }, + setStyle: function(property, value) { + var self = this; + if (property && typeof property === stringString) { + hooks.process("set", self.element, property, value); + } + return self; + }, + setStyles: function(properties) { + var self = this, property; + if (properties && typeof properties === stringObject && !properties.length) { + for (property in properties) { + hooks.process("set", self.element, property, properties[property]); + } + } + return self; + }, + removeStyle: function(property) { + var self = this; + if (property && typeof property === stringString) { + self.setStyle(property, ""); + } + return self; + }, + removeStyles: function() { + var self = this, properties = resolveArguments(arguments), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + self.setStyle(property, ""); + } + return self; + }, + siblings: function(selector) { + var element = this.element, pointer = element.parentNode.firstChild, siblings = []; + for (;pointer; pointer = nextSibling.call(pointer)) { + if (pointer !== element && (!selector || pointer.matches(selector))) { + siblings.push(pointer); + } + } + return siblings; + }, + siblingsBefore: function(selector) { + var pointer = this.element.previousSibling, siblings = []; + for (;pointer; pointer = previousSibling.call(pointer)) { + if (!selector || pointer.matches(selector)) { + siblings.push(pointer); + } + } + return siblings; + }, + siblingsAfter: function(selector) { + var pointer = this.element.nextSibling, siblings = []; + for (;pointer; pointer = nextSibling.call(pointer)) { + if (!selector || pointer.matches(selector)) { + siblings.push(pointer); + } + } + return siblings; + }, + previous: function(selector) { + var pointer = previousSibling.call(this.element); + if (!selector) { + return pointer; + } else { + for (;pointer; pointer = previousSibling.call(pointer)) { + if (pointer.matches(selector)) { + return pointer; + } + } + } + }, + next: function(selector) { + var pointer = nextSibling.call(this.element); + if (!selector) { + return pointer; + } else { + for (;pointer; pointer = nextSibling.call(pointer)) { + if (pointer.matches(selector)) { + return pointer; + } + } + } + }, + find: function(selector) { + var self = this.element, uuid, matches; + selector = selector.trim(); + if (selector.charAt(0) === ">") { + uuid = self._quid; + self.setAttribute("data-quid", uuid); + selector = '[data-quid="' + uuid + '"] ' + selector; + matches = self.parentNode.querySelectorAll(selector); + self.removeAttribute("data-quid"); + } else { + matches = self.querySelectorAll(selector); + } + return matches; + }, + parent: function(selector) { + var pointer; + if (!selector) { + return this.element.parentNode; + } else { + pointer = this.element; + for (;pointer; pointer = pointer.parentNode) { + if (pointer.matches(selector)) { + return pointer; + } + } + } + }, + parents: function(selector) { + var pointer = this.element.parentNode, parents = []; + for (;pointer; pointer = pointer.parentNode) { + if (pointer.nodeType === 9) { + return parents; + } else if (pointer.nodeType === 1) { + if (!selector || pointer.matches(selector)) { + parents.push(pointer); + } + } + } + }, + isVisible: function() { + var self = this, element = self.element; + return !(element.offsetWidth <= 0 && element.offsetHeight <= 0 || self.getStyle("visibility") === "hidden" || self.getStyle("opacity") <= 0); + }, + hasClass: function(name) { + return name ? new RegExp("(?:^|\\s)" + name + "(?:\\s|$)").test(this.element.className) : false; + }, + addClass: function(name) { + var self = this; + if (name && !self.hasClass(name)) { + self.element.className += self.element.className ? " " + name : name; + } + return self; + }, + removeClass: function(name) { + var self = this; + if (name && self.hasClass(name)) { + self.element.className = self.element.className.replace(new RegExp("(?:^|\\s)" + name + "(?!\\S)"), ""); + } + return self; + }, + toggleClass: function(name) { + var self = this; + if (name) { + self.hasClass(name) ? self.removeClass(name) : self.addClass(name); + } + return self; + }, + prepend: function(element) { + var self = this, target = self.element; + if (element) { + try { + element = element.element || resolveElement(element); + target.firstChild ? target.insertBefore(element, target.firstChild) : self.append(element); + } catch (exception) { + target.insertAdjacentHTML("afterBegin", element); + } + } + return self; + }, + append: function(element) { + var self = this, target = self.element; + if (element) { + try { + target.appendChild(element.element || resolveElement(element)); + } catch (exception) { + target.insertAdjacentHTML("beforeEnd", element); + } + } + return self; + }, + prependTo: function(target) { + var self = this, element = self.element; + if (target) { + (target = target.element || resolveElement(target)).firstChild ? target.insertBefore(element, target.firstChild) : self.appendTo(target); + } + return self; + }, + appendTo: function(target) { + var self = this; + if (target) { + (target.element || resolveElement(target)).appendChild(self.element); + } + return self; + }, + insertBefore: function(target) { + var self = this, element = self.element; + if (target) { + (target = target.element || resolveElement(target)).parentNode.insertBefore(element, target); + } + return self; + }, + insertAfter: function(target) { + var self = this, element = self.element; + if (target) { + (target = target.element || resolveElement(target)).nextSibling ? target.parentNode.insertBefore(element, target.nextSibling) : self.appendTo(target.parentNode); + } + return self; + }, + replace: function(target) { + var self = this, element = self.element; + if (target) { + (target = target.element || resolveElement(target)).parentNode.replaceChild(element, target); + } + return self; + }, + replaceWith: function(element) { + var self = this, target = self.element; + if (element) { + element = element.element || resolveElement(element); + target.parentNode.replaceChild(element, target); + } + return self; + }, + remove: function() { + var self = this, element = self.element; + element.parentNode.removeChild(element); + return self; + }, + on: function(events) { + var self = this, element = self.element, delegate = arguments.length > 2 ? arguments[1] : null, fn = arguments.length > 2 ? arguments[2] : arguments[1], uuid = fn._quid || (fn._quid = generateUuid()), i = 0, event; + events = events.split(" "); + for (;(event = events[i]) !== undefined; i++) { + var id = event + "-" + uuid, listener = function(event) { + var delegateTo; + event = pool && pool.obtain(event) || modules["dom/event"].create(event); + if (!event.isPropagationStopped) { + delegateTo = event.delegate; + event._quid = generateUuid(); + if (!delegate || matchesDelegate(event, delegate)) { + fn.call(event.currentTarget, event, event.originalEvent.detail); + } + if (delegateTo) { + delete event.delegate; + emitEvent.call(self, delegateTo); + } + } + event.dispose && event.dispose(); + }; + listener.type = event; + self._listener[id] = listener; + element.addEventListener(event, listener); + } + return self; + }, + one: function(events) { + var self = this, delegate = arguments.length > 3 || typeof arguments[1] === "string" ? arguments[1] : null, fn = arguments.length > 3 || typeof arguments[2] === "function" ? arguments[2] : arguments[1], each = (arguments.length > 3 ? arguments[3] : arguments[2]) !== false, listener = function(event) { + self.off(each === true ? event.type : events, listener); + fn.call(this, event, event.originalEvent.detail); + }; + fn._quid = listener._quid = generateUuid(); + if (delegate) { + self.on(events, delegate, listener); + } else { + self.on(events, listener); + } + return self; + }, + off: function(events, fn) { + var self = this, element = self.element, i = 0, event, id, listener; + events = events.split(" "); + for (;(event = events[i]) !== undefined; i++) { + id = fn._quid && event + "-" + fn._quid || null; + listener = id && self._listener[id] || null; + if (listener) { + element.removeEventListener(event, listener); + delete self._listener[id]; + } else { + element.removeEventListener(event, fn); + } + } + return self; + }, + emit: function(event, data) { + var self = this; + emitEvent.call(self, event, data); + return self; + } + }); +}); +(function(definition) { + window.qoopido.register("dom/element/emerge", definition, [ "../element", "../../function/merge", "../../function/unique/uuid" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var defaults = { + interval: 50, + threshold: "auto", + recur: true, + auto: 1, + visibility: true + }, documentElement = window.document.documentElement, viewport = {}, intervals = {}, elements = {}, prototype, EVENT_EMERGED = "emerged", EVENT_DEMERGED = "demerged", DOM_RESIZE = "resize orientationchange"; + window = modules["dom/element"].create(window); + if (document.compatMode !== "CSS1Compat") { + throw "[Qoopido.js] Not in standards mode"; + } + function tick(interval) { + var index, pointer = elements[interval]; + for (index in pointer) { + if (index !== "length") { + checkState.call(pointer[index]); + } + } + if (pointer.length === 0) { + window.element.clearInterval(intervals[interval]); + delete intervals[interval]; + } + } + function globalOnResize() { + viewport.left = 0; + viewport.top = 0; + viewport.right = window.innerWidth || documentElement.clientWidth; + viewport.bottom = window.innerHeight || documentElement.clientHeight; + } + function instanceOnResize() { + var self = this, treshold = self._settings.threshold, x = treshold !== undefined ? treshold : documentElement.clientWidth * self._settings.auto, y = treshold !== undefined ? treshold : documentElement.clientHeight * self._settings.auto; + self._viewport.left = viewport.left - x; + self._viewport.top = viewport.top - y; + self._viewport.right = viewport.right + x; + self._viewport.bottom = viewport.bottom + y; + } + function checkState() { + var self = this, state = false, priority = 2, boundaries; + if (self.isVisible() && (self.getStyle("visibility") !== "hidden" || self._settings.visibility === false)) { + boundaries = self.element.getBoundingClientRect(); + if ((boundaries.bottom >= self._viewport.top && boundaries.bottom <= self._viewport.bottom || boundaries.top >= self._viewport.top && boundaries.top <= self._viewport.bottom || self._viewport.bottom >= boundaries.top && self._viewport.bottom <= boundaries.bottom || self._viewport.top >= boundaries.top && self._viewport.top <= boundaries.bottom) && (boundaries.left >= self._viewport.left && boundaries.left <= self._viewport.right || boundaries.right >= self._viewport.left && boundaries.right <= self._viewport.right || self._viewport.left >= boundaries.left && self._viewport.left <= boundaries.right || self._viewport.right >= boundaries.left && self._viewport.right <= boundaries.right)) { + if (self._settings.threshold === 0 || (boundaries.bottom >= viewport.top && boundaries.bottom <= viewport.bottom || boundaries.top >= viewport.top && boundaries.top <= viewport.bottom || viewport.bottom >= boundaries.top && viewport.bottom <= boundaries.bottom || viewport.top >= boundaries.top && viewport.top <= boundaries.bottom) && (boundaries.left >= viewport.left && boundaries.left <= viewport.right || boundaries.right >= viewport.left && boundaries.right <= viewport.right || viewport.left >= boundaries.left && viewport.left <= boundaries.right || viewport.right >= boundaries.left && viewport.right <= boundaries.right)) { + priority = 1; + } + state = true; + } + } + if (state !== self._state || state === true && priority !== self._priority) { + setState.call(self, state, priority); + } + } + function setState(state, priority) { + var self = this; + self._state = state; + self._priority = priority; + if (self._settings.recur !== true) { + self.remove(); + } + if (state === true) { + self.emit(EVENT_EMERGED, priority); + } else { + self.emit(EVENT_DEMERGED); + } + } + prototype = modules["dom/element"].extend({ + _quid: null, + _viewport: null, + _settings: null, + _state: null, + _priority: null, + _constructor: function(element, settings) { + var self = prototype._parent._constructor.call(this, element); + settings = modules["function/merge"]({}, defaults, settings || {}); + if (settings.threshold === "auto") { + delete settings.threshold; + } + if (intervals[settings.interval] === undefined) { + elements[settings.interval] = elements[settings.interval] || { + length: 0 + }; + intervals[settings.interval] = window.element.setInterval(function() { + tick(settings.interval); + }, settings.interval); + } + self._quid = modules["function/unique/uuid"](); + self._viewport = {}; + self._settings = settings; + self._state = false; + self._priority = 2; + elements[settings.interval][self._quid] = self; + elements[settings.interval].length++; + window.on(DOM_RESIZE, function() { + instanceOnResize.call(self); + }); + instanceOnResize.call(self); + return self; + }, + remove: function() { + var self = this; + delete elements[self._settings.interval][self._quid]; + elements[self._settings.interval].length--; + } + }); + window.on(DOM_RESIZE, globalOnResize); + globalOnResize(); + return prototype; +}); +(function(definition) { + window.qoopido.register("dom/element/lazyimage", definition, [ "./emerge", "../../function/merge" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var defaults = { + interval: 50, + threshold: "auto", + attribute: "data-lazyimage" + }, queue = 0, prototype, EVENT_REQUESTED = "requested", EVENT_LOADED = "loaded", EVENT_FAILED = "failed", EVENT_EMERGED = "emerged", DOM_LOAD = "load", DOM_ERROR = "error", DOM_STATE = "".concat(DOM_LOAD, " ", DOM_ERROR); + function load() { + var self = this, attribute = self._settings.attribute; + queue += 1; + self.emit(EVENT_REQUESTED).one(DOM_STATE, function(event) { + if (event.type === DOM_LOAD) { + self.emit(EVENT_LOADED); + } else { + self.emit(EVENT_FAILED); + } + queue -= 1; + }, false).setAttribute("src", self.getAttribute(attribute)).removeAttribute(attribute); + } + prototype = modules["dom/element/emerge"].extend({ + _constructor: function(element, settings) { + var self = prototype._parent._constructor.call(this, element, modules["function/merge"]({}, defaults, settings || {})); + self.on(EVENT_EMERGED, function onEmerge(event) { + if (queue === 0 || event.data === 1) { + self.remove(); + self.off(EVENT_EMERGED, onEmerge); + load.call(self); + } + }); + return self; + } + }); + return prototype; +}); \ No newline at end of file diff --git a/dist/latest/max/packages/qoopido.remux.js b/dist/latest/max/packages/qoopido.remux.js new file mode 100644 index 00000000..72285a62 --- /dev/null +++ b/dist/latest/max/packages/qoopido.remux.js @@ -0,0 +1,519 @@ +/*! +* Qoopido.js library +* +* version: 3.7.3 +* date: 2015-08-05 +* author: Dirk Lueth +* website: https://github.com/dlueth/qoopido.js +* +* Copyright (c) 2015 Dirk Lueth +*/ +(function(definition, navigator, global, document, undefined) { + "use strict"; + function register(id, definition, dependencies, callback) { + var namespace = id.split("/"), initialize; + if (modules[id]) { + return modules[id]; + } + initialize = function() { + if (dependencies) { + var path = namespace.slice(0, -1).join("/"), i = 0, dependency, internal; + for (;(dependency = dependencies[i]) !== undefined; i++) { + internal = isInternal.test(dependency); + if (internal) { + dependency = canonicalize(path + "/" + dependency); + } + if (!modules[dependency] && arguments[i]) { + modules[dependency] = arguments[i]; + } + if (internal && !modules[dependency] && typeof console !== "undefined") { + console.error("".concat("[Qoopido.js] ", id, ": Could not load dependency ", dependency)); + } + } + } + modules[id] = definition(modules, shared, namespace, navigator, global, document, undefined); + if (callback) { + callback(modules[id]); + } + return modules[id]; + }; + if (typeof module !== "undefined" && module.exports) { + module.exports = define(initialize); + } else if (typeof define === "function" && define.amd) { + dependencies ? define(dependencies, initialize) : define(initialize); + } else { + initialize(); + } + } + function registerSingleton(id, definition, dependencies) { + register(id, definition, dependencies, function(module) { + modules[id] = module.create(); + }); + } + var qoopido = global.qoopido || (global.qoopido = {}), shared = qoopido.shared || (qoopido.shared = {}), modules = qoopido.modules || (qoopido.modules = {}), dependencies = [], isInternal = new RegExp("^\\.+\\/"), regexCanonicalize = new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."), removeNeutral = new RegExp("(^\\/)|\\.\\/", "g"); + qoopido.register = register; + qoopido.registerSingleton = registerSingleton; + function canonicalize(path) { + var collapsed; + while ((collapsed = path.replace(regexCanonicalize, "")) !== path) { + path = collapsed; + } + return path.replace(removeNeutral, ""); + } + if (!Object.create) { + dependencies.push("./polyfill/object/create"); + } + if (!Object.getOwnPropertyNames) { + dependencies.push("./polyfill/object/getownpropertynames"); + } + if (!Object.getOwnPropertyDescriptor || !function() { + try { + Object.getOwnPropertyDescriptor({ + x: 0 + }, "x"); + return true; + } catch (exception) { + return false; + } + }()) { + dependencies.push("./polyfill/object/getownpropertydescriptor"); + } + register("base", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + function getOwnPropertyDescriptors(object) { + var descriptors = {}, properties = Object.getOwnPropertyNames(object), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + descriptors[property] = Object.getOwnPropertyDescriptor(object, property); + } + return descriptors; + } + function prohibitCall() { + throw new Error("[Qoopido.js] Operation prohibited"); + } + return { + create: function() { + var instance = Object.create(this, getOwnPropertyDescriptors(this)), result; + if (instance._constructor) { + result = instance._constructor.apply(instance, arguments); + } + instance.create = instance.extend = prohibitCall; + return result || instance; + }, + extend: function(properties, final) { + var instance; + properties = properties || {}; + final = final === true; + properties._parent = this; + instance = Object.create(this, getOwnPropertyDescriptors(properties)); + if (final === true) { + instance.extend = prohibitCall; + } + return instance; + } + }; +}, navigator, this, document); +(function(definition) { + var dependencies = []; + if (!window.getComputedStyle) { + dependencies.push("polyfill/window/getcomputedstyle"); + } + if (!Array.prototype.indexOf) { + dependencies.push("../array/indexof"); + } + window.qoopido.register("polyfill/window/matchmedia", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var identifier = "qoopidoPolyfillWindowMatchmedia", viewport = document.documentElement, queries = [], lookup = {}, features = {}, regex = { + type: /\s*(only|not)?\s*(screen|print|[a-z\-]+)\s*(and)?\s*/i, + media: /^\s*\(\s*(-[a-z]+-)?(min-|max-)?([a-z\-]+)\s*(:?\s*([0-9]+(\.[0-9]+)?|portrait|landscape)(px|em|dppx|dpcm|rem|%|in|cm|mm|ex|pt|pc|\/([0-9]+(\.[0-9]+)?))?)?\s*\)\s*$/ + }, timeout; + function detectFeatures() { + var ww = window.innerWidth || viewport.clientWidth, wh = window.innerHeight || viewport.clientHeight, dw = window.screen.width, dh = window.screen.height, cd = window.screen.colorDepth, pr = window.devicePixelRatio; + features["width"] = ww; + features["height"] = wh; + features["aspect-ratio"] = (ww / wh).toFixed(2); + features["color"] = cd; + features["color-index"] = Math.pow(2, cd); + features["device-aspect-ratio"] = (dw / dh).toFixed(2); + features["device-height"] = dh; + features["device-width"] = dw; + features["device-pixel-ratio"] = pr || 1; + features["resolution"] = pr && pr * 96 || window.screen.deviceXDPI || 96; + features["orientation"] = wh >= ww ? "portrait" : "landscape"; + } + function createQuery(query) { + var mql = { + matches: false, + media: query, + addListener: function addListener(listener) { + listener && listeners.push(listener); + }, + removeListener: function removeListener(listener) { + var i = 0, pointer; + for (;(pointer = listeners[i]) !== undefined; i++) { + if (pointer === listener) { + listeners.splice(i, 1); + } + } + } + }, index, listeners; + if (query === "") { + mql.matches = true; + } else { + mql.matches = checkQueryMatch(query); + } + queries.push({ + mql: mql, + listeners: [] + }); + index = queries.length - 1; + lookup[query] = index; + listeners = queries[index].listeners; + return mql; + } + function checkQueryMatch(query) { + var mql = query.indexOf(",") !== -1 && query.split(",") || [ query ], mqIndex = mql.length - 1, mqLength = mqIndex, mq = null, negateType = null, negateTypeFound = "", negateTypeIndex = 0, negate = false, type = "", exprListStr = "", exprList = null, exprIndex = 0, exprLength = 0, expr = null, prefix = "", length = "", unit = "", value = "", feature = "", match = false; + if (query === "") { + return true; + } + do { + mq = mql[mqLength - mqIndex]; + negate = false; + negateType = mq.match(regex.type); + if (negateType) { + negateTypeFound = negateType[0]; + negateTypeIndex = negateType.index; + } + if (!negateType || mq.substring(0, negateTypeIndex).indexOf("(") === -1 && (negateTypeIndex || !negateType[3] && negateTypeFound !== negateType.input)) { + match = false; + continue; + } + exprListStr = mq; + negate = negateType[1] === "not"; + if (!negateTypeIndex) { + type = negateType[2]; + exprListStr = mq.substring(negateTypeFound.length); + } + match = type === features.type || type === "all" || type === ""; + exprList = exprListStr.indexOf(" and ") !== -1 && exprListStr.split(" and ") || [ exprListStr ]; + exprIndex = exprList.length - 1; + exprLength = exprIndex; + if (match && exprIndex >= 0 && exprListStr !== "") { + do { + expr = exprList[exprIndex].match(regex.media); + if (!expr || !features[expr[3]]) { + match = false; + break; + } + prefix = expr[2]; + length = expr[5]; + value = length; + unit = expr[7]; + feature = features[expr[3]]; + if (unit) { + if (unit === "px") { + value = Number(length); + } else if (unit === "em" || unit === "rem") { + value = 16 * length; + } else if (expr[8]) { + value = (length / expr[8]).toFixed(2); + } else if (unit === "dppx") { + value = length * 96; + } else if (unit === "dpcm") { + value = length * .3937; + } else { + value = Number(length); + } + } + if (prefix === "min-" && value) { + match = feature >= value; + } else if (prefix === "max-" && value) { + match = feature <= value; + } else if (value) { + match = feature === value; + } else { + match = !!feature; + } + if (!match) { + break; + } + } while (exprIndex--); + } + if (match) { + break; + } + } while (mqIndex--); + return negate ? !match : match; + } + function delayedOnResize() { + var match = false, i = 0, j = 0, query, listener; + if (queries.length > 0) { + detectFeatures(); + for (;(query = queries[i]) !== undefined; i++) { + match = checkQueryMatch(query.mql.media); + if (match && !query.mql.matches || !match && query.mql.matches) { + query.mql.matches = match; + if (query.listeners) { + for (;(listener = query.listeners[j]) !== undefined; j++) { + listener.call(window, query.mql); + } + } + } + } + } + } + function delayOnResize() { + window.clearTimeout(timeout); + timeout = window.setTimeout(delayedOnResize, 10); + } + function initialize() { + var target = window.document.getElementsByTagName("script")[0], style = document.createElement("style"), types = [ "screen", "print", "speech", "projection", "handheld", "tv", "braille", "embossed", "tty" ], cssText = "#" + identifier + " { position: relative; z-index: 0; }", prefix = "", addListener = window.addEventListener || (prefix = "on") && window.attachEvent, i = 0, pointer; + style.type = "text/css"; + style.id = identifier; + target.parentNode.insertBefore(style, target); + for (;(pointer = types[i]) !== undefined; i++) { + cssText += "@media " + pointer + " { #" + identifier + " { position: relative; z-index: " + i + " } }"; + } + if (style.styleSheet) { + style.styleSheet.cssText = cssText; + } else { + style.textContent = cssText; + } + features.type = types[(window.getComputedStyle || modules["polyfill/window/getcomputedstyle"])(style).zIndex * 1 || 0]; + style.parentNode.removeChild(style); + addListener(prefix + "resize", delayOnResize); + addListener(prefix + "orientationchange", delayOnResize); + } + if (!window.matchMedia) { + initialize(); + detectFeatures(); + window.matchMedia = function(query) { + var index = lookup[query] || false; + if (index === false) { + return createQuery(query); + } else { + return queries[index].mql; + } + }; + } + return window.matchMedia; +}); +(function(definition) { + window.qoopido.register("emitter", definition, [ "./base" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var excludeMethods = /^(_|extend$|create$|on$|one$|off$|emit$|get.+)/; + function map(context, method) { + var event = method.charAt(0).toUpperCase() + method.slice(1); + context._mapped[method] = context[method]; + return function() { + var args = Array.prototype.slice.call(arguments), returnValue; + context.emit.apply(context, [ "pre" + event, args ]); + returnValue = context._mapped[method].apply(context, args); + context.emit.apply(context, [ "post" + event, args, returnValue ]); + return returnValue; + }; + } + return modules["base"].extend({ + _mapped: null, + _listener: null, + _temp: null, + _constructor: function() { + var self = this, method; + self._mapped = {}; + self._listener = {}; + for (method in self) { + if (typeof self[method] === "function" && excludeMethods.test(method) === false) { + self[method] = map(self, method); + } + } + return self; + }, + on: function(events, fn) { + var self = this, i = 0, event; + events = events.split(" "); + for (;(event = events[i]) !== undefined; i++) { + (self._listener[event] = self._listener[event] || []).push(fn); + } + return self; + }, + one: function(events, fn, each) { + each = each !== false; + var self = this; + self.on(events, function listener(event) { + self.off(each === true ? event : events, listener); + fn.apply(this, arguments); + }); + return self; + }, + off: function(events, fn) { + var self = this, i = 0, event, j, listener; + if (events) { + events = events.split(" "); + for (;(event = events[i]) !== undefined; i++) { + self._listener[event] = self._listener[event] || []; + if (fn) { + for (j = 0; (listener = self._listener[event][j]) !== undefined; j++) { + if (listener === fn) { + self._listener[event].splice(j, 1); + j--; + } + } + } else { + self._listener[event].length = 0; + } + } + } else { + for (event in self._listener) { + self._listener[event].length = 0; + } + } + return self; + }, + emit: function(event) { + var self = this, i = 0, listener; + if (event !== undefined) { + self._listener[event] = self._listener[event] || []; + self._temp = self._listener[event].slice(); + for (;(listener = self._temp[i]) !== undefined; i++) { + listener.apply(self, arguments); + } + self._temp.length = 0; + } + return self; + } + }); +}); +(function(definition) { + var dependencies = [ "../emitter" ]; + if (!window.matchMedia) { + dependencies.push("../polyfill/window/matchmedia"); + } + window.qoopido.register("component/sense", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var prototype, queries = {}; + function onQueryStateChange() { + var self = this, mql = self.mql; + if (mql.matches === true) { + self.emit("matched"); + } else { + self.emit("dematched"); + } + } + prototype = modules["emitter"].extend({ + mql: null, + _constructor: function(query) { + var self = prototype._parent._constructor.call(this), mql = self.mql = queries[query] || (queries[query] = window.matchMedia(query)), listener = function() { + onQueryStateChange.call(self); + }; + mql.addListener(listener); + window.setTimeout(listener, 0); + return self; + }, + matches: function() { + return this.mql.matches; + } + }); + return prototype; +}); +(function(definition) { + window.qoopido.registerSingleton("component/remux", definition, [ "../emitter", "./sense" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var prototype, html = document.getElementsByTagName("html")[0], base = 16, state = { + fontsize: null, + layout: null, + ratio: {} + }, current = { + fontsize: null, + layout: null + }; + function updateState(layout, fontsize) { + var self = this; + if (layout && fontsize) { + html.className = layout; + html.style.fontSize = fontsize + "px"; + state.layout = layout; + state.fontsize = fontsize; + if (current.fontsize !== state.fontsize || current.layout !== state.layout) { + state.ratio.device = window.devicePixelRatio || 1; + state.ratio.fontsize = state.fontsize / base; + state.ratio.total = state.ratio.device * state.ratio.fontsize; + if (current.layout !== state.layout) { + self.emit("layoutchanged", state); + } + if (current.fontsize !== state.fontsize) { + self.emit("fontsizechanged", state); + } + self.emit("statechanged", state); + current.fontsize = state.fontsize; + current.layout = state.layout; + } + } + return self; + } + function addQuery(query, layout, fontsize) { + var self = this; + window.setTimeout(function() { + modules["component/sense"].create(query).on("matched", function() { + updateState.call(self, layout, fontsize); + }); + }, 0); + } + prototype = modules["emitter"].extend({ + _constructor: function() { + var self = prototype._parent._constructor.call(this), pBase = parseInt(html.getAttribute("data-base"), 10); + if (isNaN(pBase) === false) { + base = pBase; + } + return self; + }, + getState: function() { + return state; + }, + getLayout: function() { + return state.layout; + }, + getFontsize: function() { + return state.fontsize; + }, + setLayout: function(layout, fontsize) { + var self = this; + updateState.call(self, layout, fontsize); + return self; + }, + addLayout: function(pId, pLayout) { + var self = this, parameter, id, layout, size, min, max, lMin, lMax; + if (arguments.length > 1) { + parameter = {}; + parameter[pId] = pLayout; + } else { + parameter = arguments[0]; + } + for (id in parameter) { + layout = parameter[id]; + for (size = layout.min; size <= layout.max; size++) { + lMin = Math.round(layout.width * (size / base)); + lMax = Math.round(layout.width * ((size + 1) / base)) - 1; + addQuery.call(self, "screen and (min-width: " + lMin + "px) and (max-width: " + lMax + "px )", id, size); + min = !min || lMin < min.width ? { + width: lMin, + fontsize: size, + layout: id + } : min; + max = !max || lMax >= max.width ? { + width: lMax, + fontsize: size, + layout: id + } : max; + } + } + addQuery.call(self, "screen and (max-width: " + (min.width - 1) + "px)", min.layout, min.fontsize); + addQuery.call(self, "screen and (min-width: " + (max.width + 1) + "px)", max.layout, max.fontsize); + return self; + } + }); + return prototype; +}); \ No newline at end of file diff --git a/dist/latest/max/packages/qoopido.remux.legacy.js b/dist/latest/max/packages/qoopido.remux.legacy.js new file mode 100644 index 00000000..7f67de41 --- /dev/null +++ b/dist/latest/max/packages/qoopido.remux.legacy.js @@ -0,0 +1,715 @@ +/*! +* Qoopido.js library +* +* version: 3.7.3 +* date: 2015-08-05 +* author: Dirk Lueth +* website: https://github.com/dlueth/qoopido.js +* +* Copyright (c) 2015 Dirk Lueth +*/ +(function(definition, qoopido) { + if (qoopido.register) { + qoopido.register("polyfill/object/defineproperty", definition); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/defineproperty"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.defineProperty || !function() { + try { + Object.defineProperty({}, "x", {}); + return true; + } catch (exception) { + return false; + } + }()) { + var defineProperty = Object.defineProperty, defineGetter = Object.prototype.__defineGetter__, defineSetter = Object.prototype.__defineSetter__; + Object.defineProperty = function(obj, prop, desc) { + if (defineProperty) { + try { + return defineProperty(obj, prop, desc); + } catch (exception) {} + } + if (obj !== Object(obj)) { + throw new TypeError("Object.defineProperty called on non-object"); + } + if (defineGetter && "get" in desc) { + defineGetter.call(obj, prop, desc.get); + } + if (defineSetter && "set" in desc) { + defineSetter.call(obj, prop, desc.set); + } + if ("value" in desc) { + obj[prop] = desc.value; + } + return obj; + }; + } + return Object.defineProperty; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + var dependencies = []; + if (!Object.defineProperty || !function() { + try { + Object.defineProperty({}, "x", {}); + return true; + } catch (exception) { + return false; + } + }()) { + dependencies.push("./defineproperty"); + } + qoopido.register("polyfill/object/defineproperties", definition, dependencies); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/defineproperties"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.defineProperties) { + Object.defineProperties = function(obj, properties) { + if (obj !== Object(obj)) { + throw new TypeError("Object.defineProperties called on non-object"); + } + var name; + for (name in properties) { + if (Object.prototype.hasOwnProperty.call(properties, name)) { + Object.defineProperty(obj, name, properties[name]); + } + } + return obj; + }; + } + return Object.defineProperties; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + var dependencies = []; + if (!Object.defineProperties) { + dependencies.push("./defineproperties"); + } + qoopido.register("polyfill/object/create", definition, dependencies); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/create"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.create) { + Object.create = function(prototype, properties) { + if (typeof prototype !== "object") { + throw new TypeError(); + } + function Constructor() {} + Constructor.prototype = prototype; + var obj = new Constructor(); + if (prototype) { + obj.constructor = Constructor; + } + if (arguments.length > 1) { + if (properties !== Object(properties)) { + throw new TypeError(); + } + Object.defineProperties(obj, properties); + } + return obj; + }; + } + return Object.create; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + qoopido.register("polyfill/object/getownpropertynames", definition); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/getownpropertynames"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.getOwnPropertyNames) { + Object.getOwnPropertyNames = function(obj) { + if (obj !== Object(obj)) { + throw new TypeError("Object.getOwnPropertyNames called on non-object"); + } + var props = [], p; + for (p in obj) { + if (Object.prototype.hasOwnProperty.call(obj, p)) { + props.push(p); + } + } + return props; + }; + } + return Object.getOwnPropertyNames; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + qoopido.register("polyfill/object/getownpropertydescriptor", definition); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/getownpropertydescriptor"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.getOwnPropertyDescriptor || !function() { + try { + Object.getOwnPropertyDescriptor({ + x: 0 + }, "x"); + return true; + } catch (exception) { + return false; + } + }()) { + var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; + Object.getOwnPropertyDescriptor = function(obj, property) { + if (obj !== Object(obj)) { + throw new TypeError(); + } + try { + return getOwnPropertyDescriptor.call(Object, obj, property); + } catch (exception) {} + if (Object.prototype.hasOwnProperty.call(obj, property)) { + return { + value: obj[property], + enumerable: true, + writable: true, + configurable: true + }; + } + }; + } + return Object.getOwnPropertyDescriptor; +}, window.qoopido = window.qoopido || {}); +(function(definition, navigator, global, document, undefined) { + "use strict"; + function register(id, definition, dependencies, callback) { + var namespace = id.split("/"), initialize; + if (modules[id]) { + return modules[id]; + } + initialize = function() { + if (dependencies) { + var path = namespace.slice(0, -1).join("/"), i = 0, dependency, internal; + for (;(dependency = dependencies[i]) !== undefined; i++) { + internal = isInternal.test(dependency); + if (internal) { + dependency = canonicalize(path + "/" + dependency); + } + if (!modules[dependency] && arguments[i]) { + modules[dependency] = arguments[i]; + } + if (internal && !modules[dependency] && typeof console !== "undefined") { + console.error("".concat("[Qoopido.js] ", id, ": Could not load dependency ", dependency)); + } + } + } + modules[id] = definition(modules, shared, namespace, navigator, global, document, undefined); + if (callback) { + callback(modules[id]); + } + return modules[id]; + }; + if (typeof module !== "undefined" && module.exports) { + module.exports = define(initialize); + } else if (typeof define === "function" && define.amd) { + dependencies ? define(dependencies, initialize) : define(initialize); + } else { + initialize(); + } + } + function registerSingleton(id, definition, dependencies) { + register(id, definition, dependencies, function(module) { + modules[id] = module.create(); + }); + } + var qoopido = global.qoopido || (global.qoopido = {}), shared = qoopido.shared || (qoopido.shared = {}), modules = qoopido.modules || (qoopido.modules = {}), dependencies = [], isInternal = new RegExp("^\\.+\\/"), regexCanonicalize = new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."), removeNeutral = new RegExp("(^\\/)|\\.\\/", "g"); + qoopido.register = register; + qoopido.registerSingleton = registerSingleton; + function canonicalize(path) { + var collapsed; + while ((collapsed = path.replace(regexCanonicalize, "")) !== path) { + path = collapsed; + } + return path.replace(removeNeutral, ""); + } + if (!Object.create) { + dependencies.push("./polyfill/object/create"); + } + if (!Object.getOwnPropertyNames) { + dependencies.push("./polyfill/object/getownpropertynames"); + } + if (!Object.getOwnPropertyDescriptor || !function() { + try { + Object.getOwnPropertyDescriptor({ + x: 0 + }, "x"); + return true; + } catch (exception) { + return false; + } + }()) { + dependencies.push("./polyfill/object/getownpropertydescriptor"); + } + register("base", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + function getOwnPropertyDescriptors(object) { + var descriptors = {}, properties = Object.getOwnPropertyNames(object), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + descriptors[property] = Object.getOwnPropertyDescriptor(object, property); + } + return descriptors; + } + function prohibitCall() { + throw new Error("[Qoopido.js] Operation prohibited"); + } + return { + create: function() { + var instance = Object.create(this, getOwnPropertyDescriptors(this)), result; + if (instance._constructor) { + result = instance._constructor.apply(instance, arguments); + } + instance.create = instance.extend = prohibitCall; + return result || instance; + }, + extend: function(properties, final) { + var instance; + properties = properties || {}; + final = final === true; + properties._parent = this; + instance = Object.create(this, getOwnPropertyDescriptors(properties)); + if (final === true) { + instance.extend = prohibitCall; + } + return instance; + } + }; +}, navigator, this, document); +(function(definition) { + window.qoopido.register("polyfill/window/getcomputedstyle", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!window.getComputedStyle) { + var getComputedStyleRegex = new RegExp("(\\-([a-z]){1})", "g"), getComputedStyleCallback = function() { + return arguments[2].toUpperCase(); + }; + return function(element, pseudo) { + var self = this; + self.getPropertyValue = function(property) { + if (property === "float") { + property = "styleFloat"; + } + if (getComputedStyleRegex.test(property)) { + property = property.replace(getComputedStyleRegex, getComputedStyleCallback); + } + return element.currentStyle[property] || null; + }; + return self; + }; + } else { + return window.getComputedStyle; + } +}); +(function(definition) { + var dependencies = []; + if (!window.getComputedStyle) { + dependencies.push("polyfill/window/getcomputedstyle"); + } + if (!Array.prototype.indexOf) { + dependencies.push("../array/indexof"); + } + window.qoopido.register("polyfill/window/matchmedia", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var identifier = "qoopidoPolyfillWindowMatchmedia", viewport = document.documentElement, queries = [], lookup = {}, features = {}, regex = { + type: /\s*(only|not)?\s*(screen|print|[a-z\-]+)\s*(and)?\s*/i, + media: /^\s*\(\s*(-[a-z]+-)?(min-|max-)?([a-z\-]+)\s*(:?\s*([0-9]+(\.[0-9]+)?|portrait|landscape)(px|em|dppx|dpcm|rem|%|in|cm|mm|ex|pt|pc|\/([0-9]+(\.[0-9]+)?))?)?\s*\)\s*$/ + }, timeout; + function detectFeatures() { + var ww = window.innerWidth || viewport.clientWidth, wh = window.innerHeight || viewport.clientHeight, dw = window.screen.width, dh = window.screen.height, cd = window.screen.colorDepth, pr = window.devicePixelRatio; + features["width"] = ww; + features["height"] = wh; + features["aspect-ratio"] = (ww / wh).toFixed(2); + features["color"] = cd; + features["color-index"] = Math.pow(2, cd); + features["device-aspect-ratio"] = (dw / dh).toFixed(2); + features["device-height"] = dh; + features["device-width"] = dw; + features["device-pixel-ratio"] = pr || 1; + features["resolution"] = pr && pr * 96 || window.screen.deviceXDPI || 96; + features["orientation"] = wh >= ww ? "portrait" : "landscape"; + } + function createQuery(query) { + var mql = { + matches: false, + media: query, + addListener: function addListener(listener) { + listener && listeners.push(listener); + }, + removeListener: function removeListener(listener) { + var i = 0, pointer; + for (;(pointer = listeners[i]) !== undefined; i++) { + if (pointer === listener) { + listeners.splice(i, 1); + } + } + } + }, index, listeners; + if (query === "") { + mql.matches = true; + } else { + mql.matches = checkQueryMatch(query); + } + queries.push({ + mql: mql, + listeners: [] + }); + index = queries.length - 1; + lookup[query] = index; + listeners = queries[index].listeners; + return mql; + } + function checkQueryMatch(query) { + var mql = query.indexOf(",") !== -1 && query.split(",") || [ query ], mqIndex = mql.length - 1, mqLength = mqIndex, mq = null, negateType = null, negateTypeFound = "", negateTypeIndex = 0, negate = false, type = "", exprListStr = "", exprList = null, exprIndex = 0, exprLength = 0, expr = null, prefix = "", length = "", unit = "", value = "", feature = "", match = false; + if (query === "") { + return true; + } + do { + mq = mql[mqLength - mqIndex]; + negate = false; + negateType = mq.match(regex.type); + if (negateType) { + negateTypeFound = negateType[0]; + negateTypeIndex = negateType.index; + } + if (!negateType || mq.substring(0, negateTypeIndex).indexOf("(") === -1 && (negateTypeIndex || !negateType[3] && negateTypeFound !== negateType.input)) { + match = false; + continue; + } + exprListStr = mq; + negate = negateType[1] === "not"; + if (!negateTypeIndex) { + type = negateType[2]; + exprListStr = mq.substring(negateTypeFound.length); + } + match = type === features.type || type === "all" || type === ""; + exprList = exprListStr.indexOf(" and ") !== -1 && exprListStr.split(" and ") || [ exprListStr ]; + exprIndex = exprList.length - 1; + exprLength = exprIndex; + if (match && exprIndex >= 0 && exprListStr !== "") { + do { + expr = exprList[exprIndex].match(regex.media); + if (!expr || !features[expr[3]]) { + match = false; + break; + } + prefix = expr[2]; + length = expr[5]; + value = length; + unit = expr[7]; + feature = features[expr[3]]; + if (unit) { + if (unit === "px") { + value = Number(length); + } else if (unit === "em" || unit === "rem") { + value = 16 * length; + } else if (expr[8]) { + value = (length / expr[8]).toFixed(2); + } else if (unit === "dppx") { + value = length * 96; + } else if (unit === "dpcm") { + value = length * .3937; + } else { + value = Number(length); + } + } + if (prefix === "min-" && value) { + match = feature >= value; + } else if (prefix === "max-" && value) { + match = feature <= value; + } else if (value) { + match = feature === value; + } else { + match = !!feature; + } + if (!match) { + break; + } + } while (exprIndex--); + } + if (match) { + break; + } + } while (mqIndex--); + return negate ? !match : match; + } + function delayedOnResize() { + var match = false, i = 0, j = 0, query, listener; + if (queries.length > 0) { + detectFeatures(); + for (;(query = queries[i]) !== undefined; i++) { + match = checkQueryMatch(query.mql.media); + if (match && !query.mql.matches || !match && query.mql.matches) { + query.mql.matches = match; + if (query.listeners) { + for (;(listener = query.listeners[j]) !== undefined; j++) { + listener.call(window, query.mql); + } + } + } + } + } + } + function delayOnResize() { + window.clearTimeout(timeout); + timeout = window.setTimeout(delayedOnResize, 10); + } + function initialize() { + var target = window.document.getElementsByTagName("script")[0], style = document.createElement("style"), types = [ "screen", "print", "speech", "projection", "handheld", "tv", "braille", "embossed", "tty" ], cssText = "#" + identifier + " { position: relative; z-index: 0; }", prefix = "", addListener = window.addEventListener || (prefix = "on") && window.attachEvent, i = 0, pointer; + style.type = "text/css"; + style.id = identifier; + target.parentNode.insertBefore(style, target); + for (;(pointer = types[i]) !== undefined; i++) { + cssText += "@media " + pointer + " { #" + identifier + " { position: relative; z-index: " + i + " } }"; + } + if (style.styleSheet) { + style.styleSheet.cssText = cssText; + } else { + style.textContent = cssText; + } + features.type = types[(window.getComputedStyle || modules["polyfill/window/getcomputedstyle"])(style).zIndex * 1 || 0]; + style.parentNode.removeChild(style); + addListener(prefix + "resize", delayOnResize); + addListener(prefix + "orientationchange", delayOnResize); + } + if (!window.matchMedia) { + initialize(); + detectFeatures(); + window.matchMedia = function(query) { + var index = lookup[query] || false; + if (index === false) { + return createQuery(query); + } else { + return queries[index].mql; + } + }; + } + return window.matchMedia; +}); +(function(definition) { + window.qoopido.register("emitter", definition, [ "./base" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var excludeMethods = /^(_|extend$|create$|on$|one$|off$|emit$|get.+)/; + function map(context, method) { + var event = method.charAt(0).toUpperCase() + method.slice(1); + context._mapped[method] = context[method]; + return function() { + var args = Array.prototype.slice.call(arguments), returnValue; + context.emit.apply(context, [ "pre" + event, args ]); + returnValue = context._mapped[method].apply(context, args); + context.emit.apply(context, [ "post" + event, args, returnValue ]); + return returnValue; + }; + } + return modules["base"].extend({ + _mapped: null, + _listener: null, + _temp: null, + _constructor: function() { + var self = this, method; + self._mapped = {}; + self._listener = {}; + for (method in self) { + if (typeof self[method] === "function" && excludeMethods.test(method) === false) { + self[method] = map(self, method); + } + } + return self; + }, + on: function(events, fn) { + var self = this, i = 0, event; + events = events.split(" "); + for (;(event = events[i]) !== undefined; i++) { + (self._listener[event] = self._listener[event] || []).push(fn); + } + return self; + }, + one: function(events, fn, each) { + each = each !== false; + var self = this; + self.on(events, function listener(event) { + self.off(each === true ? event : events, listener); + fn.apply(this, arguments); + }); + return self; + }, + off: function(events, fn) { + var self = this, i = 0, event, j, listener; + if (events) { + events = events.split(" "); + for (;(event = events[i]) !== undefined; i++) { + self._listener[event] = self._listener[event] || []; + if (fn) { + for (j = 0; (listener = self._listener[event][j]) !== undefined; j++) { + if (listener === fn) { + self._listener[event].splice(j, 1); + j--; + } + } + } else { + self._listener[event].length = 0; + } + } + } else { + for (event in self._listener) { + self._listener[event].length = 0; + } + } + return self; + }, + emit: function(event) { + var self = this, i = 0, listener; + if (event !== undefined) { + self._listener[event] = self._listener[event] || []; + self._temp = self._listener[event].slice(); + for (;(listener = self._temp[i]) !== undefined; i++) { + listener.apply(self, arguments); + } + self._temp.length = 0; + } + return self; + } + }); +}); +(function(definition) { + var dependencies = [ "../emitter" ]; + if (!window.matchMedia) { + dependencies.push("../polyfill/window/matchmedia"); + } + window.qoopido.register("component/sense", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var prototype, queries = {}; + function onQueryStateChange() { + var self = this, mql = self.mql; + if (mql.matches === true) { + self.emit("matched"); + } else { + self.emit("dematched"); + } + } + prototype = modules["emitter"].extend({ + mql: null, + _constructor: function(query) { + var self = prototype._parent._constructor.call(this), mql = self.mql = queries[query] || (queries[query] = window.matchMedia(query)), listener = function() { + onQueryStateChange.call(self); + }; + mql.addListener(listener); + window.setTimeout(listener, 0); + return self; + }, + matches: function() { + return this.mql.matches; + } + }); + return prototype; +}); +(function(definition) { + window.qoopido.registerSingleton("component/remux", definition, [ "../emitter", "./sense" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var prototype, html = document.getElementsByTagName("html")[0], base = 16, state = { + fontsize: null, + layout: null, + ratio: {} + }, current = { + fontsize: null, + layout: null + }; + function updateState(layout, fontsize) { + var self = this; + if (layout && fontsize) { + html.className = layout; + html.style.fontSize = fontsize + "px"; + state.layout = layout; + state.fontsize = fontsize; + if (current.fontsize !== state.fontsize || current.layout !== state.layout) { + state.ratio.device = window.devicePixelRatio || 1; + state.ratio.fontsize = state.fontsize / base; + state.ratio.total = state.ratio.device * state.ratio.fontsize; + if (current.layout !== state.layout) { + self.emit("layoutchanged", state); + } + if (current.fontsize !== state.fontsize) { + self.emit("fontsizechanged", state); + } + self.emit("statechanged", state); + current.fontsize = state.fontsize; + current.layout = state.layout; + } + } + return self; + } + function addQuery(query, layout, fontsize) { + var self = this; + window.setTimeout(function() { + modules["component/sense"].create(query).on("matched", function() { + updateState.call(self, layout, fontsize); + }); + }, 0); + } + prototype = modules["emitter"].extend({ + _constructor: function() { + var self = prototype._parent._constructor.call(this), pBase = parseInt(html.getAttribute("data-base"), 10); + if (isNaN(pBase) === false) { + base = pBase; + } + return self; + }, + getState: function() { + return state; + }, + getLayout: function() { + return state.layout; + }, + getFontsize: function() { + return state.fontsize; + }, + setLayout: function(layout, fontsize) { + var self = this; + updateState.call(self, layout, fontsize); + return self; + }, + addLayout: function(pId, pLayout) { + var self = this, parameter, id, layout, size, min, max, lMin, lMax; + if (arguments.length > 1) { + parameter = {}; + parameter[pId] = pLayout; + } else { + parameter = arguments[0]; + } + for (id in parameter) { + layout = parameter[id]; + for (size = layout.min; size <= layout.max; size++) { + lMin = Math.round(layout.width * (size / base)); + lMax = Math.round(layout.width * ((size + 1) / base)) - 1; + addQuery.call(self, "screen and (min-width: " + lMin + "px) and (max-width: " + lMax + "px )", id, size); + min = !min || lMin < min.width ? { + width: lMin, + fontsize: size, + layout: id + } : min; + max = !max || lMax >= max.width ? { + width: lMax, + fontsize: size, + layout: id + } : max; + } + } + addQuery.call(self, "screen and (max-width: " + (min.width - 1) + "px)", min.layout, min.fontsize); + addQuery.call(self, "screen and (min-width: " + (max.width + 1) + "px)", max.layout, max.fontsize); + return self; + } + }); + return prototype; +}); \ No newline at end of file diff --git a/dist/latest/max/packages/qoopido.sense.js b/dist/latest/max/packages/qoopido.sense.js new file mode 100644 index 00000000..df6a0ed5 --- /dev/null +++ b/dist/latest/max/packages/qoopido.sense.js @@ -0,0 +1,420 @@ +/*! +* Qoopido.js library +* +* version: 3.7.3 +* date: 2015-08-05 +* author: Dirk Lueth +* website: https://github.com/dlueth/qoopido.js +* +* Copyright (c) 2015 Dirk Lueth +*/ +(function(definition, navigator, global, document, undefined) { + "use strict"; + function register(id, definition, dependencies, callback) { + var namespace = id.split("/"), initialize; + if (modules[id]) { + return modules[id]; + } + initialize = function() { + if (dependencies) { + var path = namespace.slice(0, -1).join("/"), i = 0, dependency, internal; + for (;(dependency = dependencies[i]) !== undefined; i++) { + internal = isInternal.test(dependency); + if (internal) { + dependency = canonicalize(path + "/" + dependency); + } + if (!modules[dependency] && arguments[i]) { + modules[dependency] = arguments[i]; + } + if (internal && !modules[dependency] && typeof console !== "undefined") { + console.error("".concat("[Qoopido.js] ", id, ": Could not load dependency ", dependency)); + } + } + } + modules[id] = definition(modules, shared, namespace, navigator, global, document, undefined); + if (callback) { + callback(modules[id]); + } + return modules[id]; + }; + if (typeof module !== "undefined" && module.exports) { + module.exports = define(initialize); + } else if (typeof define === "function" && define.amd) { + dependencies ? define(dependencies, initialize) : define(initialize); + } else { + initialize(); + } + } + function registerSingleton(id, definition, dependencies) { + register(id, definition, dependencies, function(module) { + modules[id] = module.create(); + }); + } + var qoopido = global.qoopido || (global.qoopido = {}), shared = qoopido.shared || (qoopido.shared = {}), modules = qoopido.modules || (qoopido.modules = {}), dependencies = [], isInternal = new RegExp("^\\.+\\/"), regexCanonicalize = new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."), removeNeutral = new RegExp("(^\\/)|\\.\\/", "g"); + qoopido.register = register; + qoopido.registerSingleton = registerSingleton; + function canonicalize(path) { + var collapsed; + while ((collapsed = path.replace(regexCanonicalize, "")) !== path) { + path = collapsed; + } + return path.replace(removeNeutral, ""); + } + if (!Object.create) { + dependencies.push("./polyfill/object/create"); + } + if (!Object.getOwnPropertyNames) { + dependencies.push("./polyfill/object/getownpropertynames"); + } + if (!Object.getOwnPropertyDescriptor || !function() { + try { + Object.getOwnPropertyDescriptor({ + x: 0 + }, "x"); + return true; + } catch (exception) { + return false; + } + }()) { + dependencies.push("./polyfill/object/getownpropertydescriptor"); + } + register("base", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + function getOwnPropertyDescriptors(object) { + var descriptors = {}, properties = Object.getOwnPropertyNames(object), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + descriptors[property] = Object.getOwnPropertyDescriptor(object, property); + } + return descriptors; + } + function prohibitCall() { + throw new Error("[Qoopido.js] Operation prohibited"); + } + return { + create: function() { + var instance = Object.create(this, getOwnPropertyDescriptors(this)), result; + if (instance._constructor) { + result = instance._constructor.apply(instance, arguments); + } + instance.create = instance.extend = prohibitCall; + return result || instance; + }, + extend: function(properties, final) { + var instance; + properties = properties || {}; + final = final === true; + properties._parent = this; + instance = Object.create(this, getOwnPropertyDescriptors(properties)); + if (final === true) { + instance.extend = prohibitCall; + } + return instance; + } + }; +}, navigator, this, document); +(function(definition) { + var dependencies = []; + if (!window.getComputedStyle) { + dependencies.push("polyfill/window/getcomputedstyle"); + } + if (!Array.prototype.indexOf) { + dependencies.push("../array/indexof"); + } + window.qoopido.register("polyfill/window/matchmedia", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var identifier = "qoopidoPolyfillWindowMatchmedia", viewport = document.documentElement, queries = [], lookup = {}, features = {}, regex = { + type: /\s*(only|not)?\s*(screen|print|[a-z\-]+)\s*(and)?\s*/i, + media: /^\s*\(\s*(-[a-z]+-)?(min-|max-)?([a-z\-]+)\s*(:?\s*([0-9]+(\.[0-9]+)?|portrait|landscape)(px|em|dppx|dpcm|rem|%|in|cm|mm|ex|pt|pc|\/([0-9]+(\.[0-9]+)?))?)?\s*\)\s*$/ + }, timeout; + function detectFeatures() { + var ww = window.innerWidth || viewport.clientWidth, wh = window.innerHeight || viewport.clientHeight, dw = window.screen.width, dh = window.screen.height, cd = window.screen.colorDepth, pr = window.devicePixelRatio; + features["width"] = ww; + features["height"] = wh; + features["aspect-ratio"] = (ww / wh).toFixed(2); + features["color"] = cd; + features["color-index"] = Math.pow(2, cd); + features["device-aspect-ratio"] = (dw / dh).toFixed(2); + features["device-height"] = dh; + features["device-width"] = dw; + features["device-pixel-ratio"] = pr || 1; + features["resolution"] = pr && pr * 96 || window.screen.deviceXDPI || 96; + features["orientation"] = wh >= ww ? "portrait" : "landscape"; + } + function createQuery(query) { + var mql = { + matches: false, + media: query, + addListener: function addListener(listener) { + listener && listeners.push(listener); + }, + removeListener: function removeListener(listener) { + var i = 0, pointer; + for (;(pointer = listeners[i]) !== undefined; i++) { + if (pointer === listener) { + listeners.splice(i, 1); + } + } + } + }, index, listeners; + if (query === "") { + mql.matches = true; + } else { + mql.matches = checkQueryMatch(query); + } + queries.push({ + mql: mql, + listeners: [] + }); + index = queries.length - 1; + lookup[query] = index; + listeners = queries[index].listeners; + return mql; + } + function checkQueryMatch(query) { + var mql = query.indexOf(",") !== -1 && query.split(",") || [ query ], mqIndex = mql.length - 1, mqLength = mqIndex, mq = null, negateType = null, negateTypeFound = "", negateTypeIndex = 0, negate = false, type = "", exprListStr = "", exprList = null, exprIndex = 0, exprLength = 0, expr = null, prefix = "", length = "", unit = "", value = "", feature = "", match = false; + if (query === "") { + return true; + } + do { + mq = mql[mqLength - mqIndex]; + negate = false; + negateType = mq.match(regex.type); + if (negateType) { + negateTypeFound = negateType[0]; + negateTypeIndex = negateType.index; + } + if (!negateType || mq.substring(0, negateTypeIndex).indexOf("(") === -1 && (negateTypeIndex || !negateType[3] && negateTypeFound !== negateType.input)) { + match = false; + continue; + } + exprListStr = mq; + negate = negateType[1] === "not"; + if (!negateTypeIndex) { + type = negateType[2]; + exprListStr = mq.substring(negateTypeFound.length); + } + match = type === features.type || type === "all" || type === ""; + exprList = exprListStr.indexOf(" and ") !== -1 && exprListStr.split(" and ") || [ exprListStr ]; + exprIndex = exprList.length - 1; + exprLength = exprIndex; + if (match && exprIndex >= 0 && exprListStr !== "") { + do { + expr = exprList[exprIndex].match(regex.media); + if (!expr || !features[expr[3]]) { + match = false; + break; + } + prefix = expr[2]; + length = expr[5]; + value = length; + unit = expr[7]; + feature = features[expr[3]]; + if (unit) { + if (unit === "px") { + value = Number(length); + } else if (unit === "em" || unit === "rem") { + value = 16 * length; + } else if (expr[8]) { + value = (length / expr[8]).toFixed(2); + } else if (unit === "dppx") { + value = length * 96; + } else if (unit === "dpcm") { + value = length * .3937; + } else { + value = Number(length); + } + } + if (prefix === "min-" && value) { + match = feature >= value; + } else if (prefix === "max-" && value) { + match = feature <= value; + } else if (value) { + match = feature === value; + } else { + match = !!feature; + } + if (!match) { + break; + } + } while (exprIndex--); + } + if (match) { + break; + } + } while (mqIndex--); + return negate ? !match : match; + } + function delayedOnResize() { + var match = false, i = 0, j = 0, query, listener; + if (queries.length > 0) { + detectFeatures(); + for (;(query = queries[i]) !== undefined; i++) { + match = checkQueryMatch(query.mql.media); + if (match && !query.mql.matches || !match && query.mql.matches) { + query.mql.matches = match; + if (query.listeners) { + for (;(listener = query.listeners[j]) !== undefined; j++) { + listener.call(window, query.mql); + } + } + } + } + } + } + function delayOnResize() { + window.clearTimeout(timeout); + timeout = window.setTimeout(delayedOnResize, 10); + } + function initialize() { + var target = window.document.getElementsByTagName("script")[0], style = document.createElement("style"), types = [ "screen", "print", "speech", "projection", "handheld", "tv", "braille", "embossed", "tty" ], cssText = "#" + identifier + " { position: relative; z-index: 0; }", prefix = "", addListener = window.addEventListener || (prefix = "on") && window.attachEvent, i = 0, pointer; + style.type = "text/css"; + style.id = identifier; + target.parentNode.insertBefore(style, target); + for (;(pointer = types[i]) !== undefined; i++) { + cssText += "@media " + pointer + " { #" + identifier + " { position: relative; z-index: " + i + " } }"; + } + if (style.styleSheet) { + style.styleSheet.cssText = cssText; + } else { + style.textContent = cssText; + } + features.type = types[(window.getComputedStyle || modules["polyfill/window/getcomputedstyle"])(style).zIndex * 1 || 0]; + style.parentNode.removeChild(style); + addListener(prefix + "resize", delayOnResize); + addListener(prefix + "orientationchange", delayOnResize); + } + if (!window.matchMedia) { + initialize(); + detectFeatures(); + window.matchMedia = function(query) { + var index = lookup[query] || false; + if (index === false) { + return createQuery(query); + } else { + return queries[index].mql; + } + }; + } + return window.matchMedia; +}); +(function(definition) { + window.qoopido.register("emitter", definition, [ "./base" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var excludeMethods = /^(_|extend$|create$|on$|one$|off$|emit$|get.+)/; + function map(context, method) { + var event = method.charAt(0).toUpperCase() + method.slice(1); + context._mapped[method] = context[method]; + return function() { + var args = Array.prototype.slice.call(arguments), returnValue; + context.emit.apply(context, [ "pre" + event, args ]); + returnValue = context._mapped[method].apply(context, args); + context.emit.apply(context, [ "post" + event, args, returnValue ]); + return returnValue; + }; + } + return modules["base"].extend({ + _mapped: null, + _listener: null, + _temp: null, + _constructor: function() { + var self = this, method; + self._mapped = {}; + self._listener = {}; + for (method in self) { + if (typeof self[method] === "function" && excludeMethods.test(method) === false) { + self[method] = map(self, method); + } + } + return self; + }, + on: function(events, fn) { + var self = this, i = 0, event; + events = events.split(" "); + for (;(event = events[i]) !== undefined; i++) { + (self._listener[event] = self._listener[event] || []).push(fn); + } + return self; + }, + one: function(events, fn, each) { + each = each !== false; + var self = this; + self.on(events, function listener(event) { + self.off(each === true ? event : events, listener); + fn.apply(this, arguments); + }); + return self; + }, + off: function(events, fn) { + var self = this, i = 0, event, j, listener; + if (events) { + events = events.split(" "); + for (;(event = events[i]) !== undefined; i++) { + self._listener[event] = self._listener[event] || []; + if (fn) { + for (j = 0; (listener = self._listener[event][j]) !== undefined; j++) { + if (listener === fn) { + self._listener[event].splice(j, 1); + j--; + } + } + } else { + self._listener[event].length = 0; + } + } + } else { + for (event in self._listener) { + self._listener[event].length = 0; + } + } + return self; + }, + emit: function(event) { + var self = this, i = 0, listener; + if (event !== undefined) { + self._listener[event] = self._listener[event] || []; + self._temp = self._listener[event].slice(); + for (;(listener = self._temp[i]) !== undefined; i++) { + listener.apply(self, arguments); + } + self._temp.length = 0; + } + return self; + } + }); +}); +(function(definition) { + var dependencies = [ "../emitter" ]; + if (!window.matchMedia) { + dependencies.push("../polyfill/window/matchmedia"); + } + window.qoopido.register("component/sense", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var prototype, queries = {}; + function onQueryStateChange() { + var self = this, mql = self.mql; + if (mql.matches === true) { + self.emit("matched"); + } else { + self.emit("dematched"); + } + } + prototype = modules["emitter"].extend({ + mql: null, + _constructor: function(query) { + var self = prototype._parent._constructor.call(this), mql = self.mql = queries[query] || (queries[query] = window.matchMedia(query)), listener = function() { + onQueryStateChange.call(self); + }; + mql.addListener(listener); + window.setTimeout(listener, 0); + return self; + }, + matches: function() { + return this.mql.matches; + } + }); + return prototype; +}); \ No newline at end of file diff --git a/dist/latest/max/packages/qoopido.sense.legacy.js b/dist/latest/max/packages/qoopido.sense.legacy.js new file mode 100644 index 00000000..f50b1180 --- /dev/null +++ b/dist/latest/max/packages/qoopido.sense.legacy.js @@ -0,0 +1,616 @@ +/*! +* Qoopido.js library +* +* version: 3.7.3 +* date: 2015-08-05 +* author: Dirk Lueth +* website: https://github.com/dlueth/qoopido.js +* +* Copyright (c) 2015 Dirk Lueth +*/ +(function(definition, qoopido) { + if (qoopido.register) { + qoopido.register("polyfill/object/defineproperty", definition); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/defineproperty"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.defineProperty || !function() { + try { + Object.defineProperty({}, "x", {}); + return true; + } catch (exception) { + return false; + } + }()) { + var defineProperty = Object.defineProperty, defineGetter = Object.prototype.__defineGetter__, defineSetter = Object.prototype.__defineSetter__; + Object.defineProperty = function(obj, prop, desc) { + if (defineProperty) { + try { + return defineProperty(obj, prop, desc); + } catch (exception) {} + } + if (obj !== Object(obj)) { + throw new TypeError("Object.defineProperty called on non-object"); + } + if (defineGetter && "get" in desc) { + defineGetter.call(obj, prop, desc.get); + } + if (defineSetter && "set" in desc) { + defineSetter.call(obj, prop, desc.set); + } + if ("value" in desc) { + obj[prop] = desc.value; + } + return obj; + }; + } + return Object.defineProperty; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + var dependencies = []; + if (!Object.defineProperty || !function() { + try { + Object.defineProperty({}, "x", {}); + return true; + } catch (exception) { + return false; + } + }()) { + dependencies.push("./defineproperty"); + } + qoopido.register("polyfill/object/defineproperties", definition, dependencies); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/defineproperties"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.defineProperties) { + Object.defineProperties = function(obj, properties) { + if (obj !== Object(obj)) { + throw new TypeError("Object.defineProperties called on non-object"); + } + var name; + for (name in properties) { + if (Object.prototype.hasOwnProperty.call(properties, name)) { + Object.defineProperty(obj, name, properties[name]); + } + } + return obj; + }; + } + return Object.defineProperties; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + var dependencies = []; + if (!Object.defineProperties) { + dependencies.push("./defineproperties"); + } + qoopido.register("polyfill/object/create", definition, dependencies); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/create"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.create) { + Object.create = function(prototype, properties) { + if (typeof prototype !== "object") { + throw new TypeError(); + } + function Constructor() {} + Constructor.prototype = prototype; + var obj = new Constructor(); + if (prototype) { + obj.constructor = Constructor; + } + if (arguments.length > 1) { + if (properties !== Object(properties)) { + throw new TypeError(); + } + Object.defineProperties(obj, properties); + } + return obj; + }; + } + return Object.create; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + qoopido.register("polyfill/object/getownpropertynames", definition); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/getownpropertynames"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.getOwnPropertyNames) { + Object.getOwnPropertyNames = function(obj) { + if (obj !== Object(obj)) { + throw new TypeError("Object.getOwnPropertyNames called on non-object"); + } + var props = [], p; + for (p in obj) { + if (Object.prototype.hasOwnProperty.call(obj, p)) { + props.push(p); + } + } + return props; + }; + } + return Object.getOwnPropertyNames; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + qoopido.register("polyfill/object/getownpropertydescriptor", definition); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/getownpropertydescriptor"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.getOwnPropertyDescriptor || !function() { + try { + Object.getOwnPropertyDescriptor({ + x: 0 + }, "x"); + return true; + } catch (exception) { + return false; + } + }()) { + var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; + Object.getOwnPropertyDescriptor = function(obj, property) { + if (obj !== Object(obj)) { + throw new TypeError(); + } + try { + return getOwnPropertyDescriptor.call(Object, obj, property); + } catch (exception) {} + if (Object.prototype.hasOwnProperty.call(obj, property)) { + return { + value: obj[property], + enumerable: true, + writable: true, + configurable: true + }; + } + }; + } + return Object.getOwnPropertyDescriptor; +}, window.qoopido = window.qoopido || {}); +(function(definition, navigator, global, document, undefined) { + "use strict"; + function register(id, definition, dependencies, callback) { + var namespace = id.split("/"), initialize; + if (modules[id]) { + return modules[id]; + } + initialize = function() { + if (dependencies) { + var path = namespace.slice(0, -1).join("/"), i = 0, dependency, internal; + for (;(dependency = dependencies[i]) !== undefined; i++) { + internal = isInternal.test(dependency); + if (internal) { + dependency = canonicalize(path + "/" + dependency); + } + if (!modules[dependency] && arguments[i]) { + modules[dependency] = arguments[i]; + } + if (internal && !modules[dependency] && typeof console !== "undefined") { + console.error("".concat("[Qoopido.js] ", id, ": Could not load dependency ", dependency)); + } + } + } + modules[id] = definition(modules, shared, namespace, navigator, global, document, undefined); + if (callback) { + callback(modules[id]); + } + return modules[id]; + }; + if (typeof module !== "undefined" && module.exports) { + module.exports = define(initialize); + } else if (typeof define === "function" && define.amd) { + dependencies ? define(dependencies, initialize) : define(initialize); + } else { + initialize(); + } + } + function registerSingleton(id, definition, dependencies) { + register(id, definition, dependencies, function(module) { + modules[id] = module.create(); + }); + } + var qoopido = global.qoopido || (global.qoopido = {}), shared = qoopido.shared || (qoopido.shared = {}), modules = qoopido.modules || (qoopido.modules = {}), dependencies = [], isInternal = new RegExp("^\\.+\\/"), regexCanonicalize = new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."), removeNeutral = new RegExp("(^\\/)|\\.\\/", "g"); + qoopido.register = register; + qoopido.registerSingleton = registerSingleton; + function canonicalize(path) { + var collapsed; + while ((collapsed = path.replace(regexCanonicalize, "")) !== path) { + path = collapsed; + } + return path.replace(removeNeutral, ""); + } + if (!Object.create) { + dependencies.push("./polyfill/object/create"); + } + if (!Object.getOwnPropertyNames) { + dependencies.push("./polyfill/object/getownpropertynames"); + } + if (!Object.getOwnPropertyDescriptor || !function() { + try { + Object.getOwnPropertyDescriptor({ + x: 0 + }, "x"); + return true; + } catch (exception) { + return false; + } + }()) { + dependencies.push("./polyfill/object/getownpropertydescriptor"); + } + register("base", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + function getOwnPropertyDescriptors(object) { + var descriptors = {}, properties = Object.getOwnPropertyNames(object), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + descriptors[property] = Object.getOwnPropertyDescriptor(object, property); + } + return descriptors; + } + function prohibitCall() { + throw new Error("[Qoopido.js] Operation prohibited"); + } + return { + create: function() { + var instance = Object.create(this, getOwnPropertyDescriptors(this)), result; + if (instance._constructor) { + result = instance._constructor.apply(instance, arguments); + } + instance.create = instance.extend = prohibitCall; + return result || instance; + }, + extend: function(properties, final) { + var instance; + properties = properties || {}; + final = final === true; + properties._parent = this; + instance = Object.create(this, getOwnPropertyDescriptors(properties)); + if (final === true) { + instance.extend = prohibitCall; + } + return instance; + } + }; +}, navigator, this, document); +(function(definition) { + window.qoopido.register("polyfill/window/getcomputedstyle", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!window.getComputedStyle) { + var getComputedStyleRegex = new RegExp("(\\-([a-z]){1})", "g"), getComputedStyleCallback = function() { + return arguments[2].toUpperCase(); + }; + return function(element, pseudo) { + var self = this; + self.getPropertyValue = function(property) { + if (property === "float") { + property = "styleFloat"; + } + if (getComputedStyleRegex.test(property)) { + property = property.replace(getComputedStyleRegex, getComputedStyleCallback); + } + return element.currentStyle[property] || null; + }; + return self; + }; + } else { + return window.getComputedStyle; + } +}); +(function(definition) { + var dependencies = []; + if (!window.getComputedStyle) { + dependencies.push("polyfill/window/getcomputedstyle"); + } + if (!Array.prototype.indexOf) { + dependencies.push("../array/indexof"); + } + window.qoopido.register("polyfill/window/matchmedia", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var identifier = "qoopidoPolyfillWindowMatchmedia", viewport = document.documentElement, queries = [], lookup = {}, features = {}, regex = { + type: /\s*(only|not)?\s*(screen|print|[a-z\-]+)\s*(and)?\s*/i, + media: /^\s*\(\s*(-[a-z]+-)?(min-|max-)?([a-z\-]+)\s*(:?\s*([0-9]+(\.[0-9]+)?|portrait|landscape)(px|em|dppx|dpcm|rem|%|in|cm|mm|ex|pt|pc|\/([0-9]+(\.[0-9]+)?))?)?\s*\)\s*$/ + }, timeout; + function detectFeatures() { + var ww = window.innerWidth || viewport.clientWidth, wh = window.innerHeight || viewport.clientHeight, dw = window.screen.width, dh = window.screen.height, cd = window.screen.colorDepth, pr = window.devicePixelRatio; + features["width"] = ww; + features["height"] = wh; + features["aspect-ratio"] = (ww / wh).toFixed(2); + features["color"] = cd; + features["color-index"] = Math.pow(2, cd); + features["device-aspect-ratio"] = (dw / dh).toFixed(2); + features["device-height"] = dh; + features["device-width"] = dw; + features["device-pixel-ratio"] = pr || 1; + features["resolution"] = pr && pr * 96 || window.screen.deviceXDPI || 96; + features["orientation"] = wh >= ww ? "portrait" : "landscape"; + } + function createQuery(query) { + var mql = { + matches: false, + media: query, + addListener: function addListener(listener) { + listener && listeners.push(listener); + }, + removeListener: function removeListener(listener) { + var i = 0, pointer; + for (;(pointer = listeners[i]) !== undefined; i++) { + if (pointer === listener) { + listeners.splice(i, 1); + } + } + } + }, index, listeners; + if (query === "") { + mql.matches = true; + } else { + mql.matches = checkQueryMatch(query); + } + queries.push({ + mql: mql, + listeners: [] + }); + index = queries.length - 1; + lookup[query] = index; + listeners = queries[index].listeners; + return mql; + } + function checkQueryMatch(query) { + var mql = query.indexOf(",") !== -1 && query.split(",") || [ query ], mqIndex = mql.length - 1, mqLength = mqIndex, mq = null, negateType = null, negateTypeFound = "", negateTypeIndex = 0, negate = false, type = "", exprListStr = "", exprList = null, exprIndex = 0, exprLength = 0, expr = null, prefix = "", length = "", unit = "", value = "", feature = "", match = false; + if (query === "") { + return true; + } + do { + mq = mql[mqLength - mqIndex]; + negate = false; + negateType = mq.match(regex.type); + if (negateType) { + negateTypeFound = negateType[0]; + negateTypeIndex = negateType.index; + } + if (!negateType || mq.substring(0, negateTypeIndex).indexOf("(") === -1 && (negateTypeIndex || !negateType[3] && negateTypeFound !== negateType.input)) { + match = false; + continue; + } + exprListStr = mq; + negate = negateType[1] === "not"; + if (!negateTypeIndex) { + type = negateType[2]; + exprListStr = mq.substring(negateTypeFound.length); + } + match = type === features.type || type === "all" || type === ""; + exprList = exprListStr.indexOf(" and ") !== -1 && exprListStr.split(" and ") || [ exprListStr ]; + exprIndex = exprList.length - 1; + exprLength = exprIndex; + if (match && exprIndex >= 0 && exprListStr !== "") { + do { + expr = exprList[exprIndex].match(regex.media); + if (!expr || !features[expr[3]]) { + match = false; + break; + } + prefix = expr[2]; + length = expr[5]; + value = length; + unit = expr[7]; + feature = features[expr[3]]; + if (unit) { + if (unit === "px") { + value = Number(length); + } else if (unit === "em" || unit === "rem") { + value = 16 * length; + } else if (expr[8]) { + value = (length / expr[8]).toFixed(2); + } else if (unit === "dppx") { + value = length * 96; + } else if (unit === "dpcm") { + value = length * .3937; + } else { + value = Number(length); + } + } + if (prefix === "min-" && value) { + match = feature >= value; + } else if (prefix === "max-" && value) { + match = feature <= value; + } else if (value) { + match = feature === value; + } else { + match = !!feature; + } + if (!match) { + break; + } + } while (exprIndex--); + } + if (match) { + break; + } + } while (mqIndex--); + return negate ? !match : match; + } + function delayedOnResize() { + var match = false, i = 0, j = 0, query, listener; + if (queries.length > 0) { + detectFeatures(); + for (;(query = queries[i]) !== undefined; i++) { + match = checkQueryMatch(query.mql.media); + if (match && !query.mql.matches || !match && query.mql.matches) { + query.mql.matches = match; + if (query.listeners) { + for (;(listener = query.listeners[j]) !== undefined; j++) { + listener.call(window, query.mql); + } + } + } + } + } + } + function delayOnResize() { + window.clearTimeout(timeout); + timeout = window.setTimeout(delayedOnResize, 10); + } + function initialize() { + var target = window.document.getElementsByTagName("script")[0], style = document.createElement("style"), types = [ "screen", "print", "speech", "projection", "handheld", "tv", "braille", "embossed", "tty" ], cssText = "#" + identifier + " { position: relative; z-index: 0; }", prefix = "", addListener = window.addEventListener || (prefix = "on") && window.attachEvent, i = 0, pointer; + style.type = "text/css"; + style.id = identifier; + target.parentNode.insertBefore(style, target); + for (;(pointer = types[i]) !== undefined; i++) { + cssText += "@media " + pointer + " { #" + identifier + " { position: relative; z-index: " + i + " } }"; + } + if (style.styleSheet) { + style.styleSheet.cssText = cssText; + } else { + style.textContent = cssText; + } + features.type = types[(window.getComputedStyle || modules["polyfill/window/getcomputedstyle"])(style).zIndex * 1 || 0]; + style.parentNode.removeChild(style); + addListener(prefix + "resize", delayOnResize); + addListener(prefix + "orientationchange", delayOnResize); + } + if (!window.matchMedia) { + initialize(); + detectFeatures(); + window.matchMedia = function(query) { + var index = lookup[query] || false; + if (index === false) { + return createQuery(query); + } else { + return queries[index].mql; + } + }; + } + return window.matchMedia; +}); +(function(definition) { + window.qoopido.register("emitter", definition, [ "./base" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var excludeMethods = /^(_|extend$|create$|on$|one$|off$|emit$|get.+)/; + function map(context, method) { + var event = method.charAt(0).toUpperCase() + method.slice(1); + context._mapped[method] = context[method]; + return function() { + var args = Array.prototype.slice.call(arguments), returnValue; + context.emit.apply(context, [ "pre" + event, args ]); + returnValue = context._mapped[method].apply(context, args); + context.emit.apply(context, [ "post" + event, args, returnValue ]); + return returnValue; + }; + } + return modules["base"].extend({ + _mapped: null, + _listener: null, + _temp: null, + _constructor: function() { + var self = this, method; + self._mapped = {}; + self._listener = {}; + for (method in self) { + if (typeof self[method] === "function" && excludeMethods.test(method) === false) { + self[method] = map(self, method); + } + } + return self; + }, + on: function(events, fn) { + var self = this, i = 0, event; + events = events.split(" "); + for (;(event = events[i]) !== undefined; i++) { + (self._listener[event] = self._listener[event] || []).push(fn); + } + return self; + }, + one: function(events, fn, each) { + each = each !== false; + var self = this; + self.on(events, function listener(event) { + self.off(each === true ? event : events, listener); + fn.apply(this, arguments); + }); + return self; + }, + off: function(events, fn) { + var self = this, i = 0, event, j, listener; + if (events) { + events = events.split(" "); + for (;(event = events[i]) !== undefined; i++) { + self._listener[event] = self._listener[event] || []; + if (fn) { + for (j = 0; (listener = self._listener[event][j]) !== undefined; j++) { + if (listener === fn) { + self._listener[event].splice(j, 1); + j--; + } + } + } else { + self._listener[event].length = 0; + } + } + } else { + for (event in self._listener) { + self._listener[event].length = 0; + } + } + return self; + }, + emit: function(event) { + var self = this, i = 0, listener; + if (event !== undefined) { + self._listener[event] = self._listener[event] || []; + self._temp = self._listener[event].slice(); + for (;(listener = self._temp[i]) !== undefined; i++) { + listener.apply(self, arguments); + } + self._temp.length = 0; + } + return self; + } + }); +}); +(function(definition) { + var dependencies = [ "../emitter" ]; + if (!window.matchMedia) { + dependencies.push("../polyfill/window/matchmedia"); + } + window.qoopido.register("component/sense", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var prototype, queries = {}; + function onQueryStateChange() { + var self = this, mql = self.mql; + if (mql.matches === true) { + self.emit("matched"); + } else { + self.emit("dematched"); + } + } + prototype = modules["emitter"].extend({ + mql: null, + _constructor: function(query) { + var self = prototype._parent._constructor.call(this), mql = self.mql = queries[query] || (queries[query] = window.matchMedia(query)), listener = function() { + onQueryStateChange.call(self); + }; + mql.addListener(listener); + window.setTimeout(listener, 0); + return self; + }, + matches: function() { + return this.mql.matches; + } + }); + return prototype; +}); \ No newline at end of file diff --git a/dist/latest/max/packages/qoopido.shrinkimage.js b/dist/latest/max/packages/qoopido.shrinkimage.js new file mode 100644 index 00000000..bb18f2c3 --- /dev/null +++ b/dist/latest/max/packages/qoopido.shrinkimage.js @@ -0,0 +1,1789 @@ +/*! +* Qoopido.js library +* +* version: 3.7.3 +* date: 2015-08-05 +* author: Dirk Lueth +* website: https://github.com/dlueth/qoopido.js +* +* Copyright (c) 2015 Dirk Lueth +*/ +(function(definition, navigator, global, document, undefined) { + "use strict"; + function register(id, definition, dependencies, callback) { + var namespace = id.split("/"), initialize; + if (modules[id]) { + return modules[id]; + } + initialize = function() { + if (dependencies) { + var path = namespace.slice(0, -1).join("/"), i = 0, dependency, internal; + for (;(dependency = dependencies[i]) !== undefined; i++) { + internal = isInternal.test(dependency); + if (internal) { + dependency = canonicalize(path + "/" + dependency); + } + if (!modules[dependency] && arguments[i]) { + modules[dependency] = arguments[i]; + } + if (internal && !modules[dependency] && typeof console !== "undefined") { + console.error("".concat("[Qoopido.js] ", id, ": Could not load dependency ", dependency)); + } + } + } + modules[id] = definition(modules, shared, namespace, navigator, global, document, undefined); + if (callback) { + callback(modules[id]); + } + return modules[id]; + }; + if (typeof module !== "undefined" && module.exports) { + module.exports = define(initialize); + } else if (typeof define === "function" && define.amd) { + dependencies ? define(dependencies, initialize) : define(initialize); + } else { + initialize(); + } + } + function registerSingleton(id, definition, dependencies) { + register(id, definition, dependencies, function(module) { + modules[id] = module.create(); + }); + } + var qoopido = global.qoopido || (global.qoopido = {}), shared = qoopido.shared || (qoopido.shared = {}), modules = qoopido.modules || (qoopido.modules = {}), dependencies = [], isInternal = new RegExp("^\\.+\\/"), regexCanonicalize = new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."), removeNeutral = new RegExp("(^\\/)|\\.\\/", "g"); + qoopido.register = register; + qoopido.registerSingleton = registerSingleton; + function canonicalize(path) { + var collapsed; + while ((collapsed = path.replace(regexCanonicalize, "")) !== path) { + path = collapsed; + } + return path.replace(removeNeutral, ""); + } + if (!Object.create) { + dependencies.push("./polyfill/object/create"); + } + if (!Object.getOwnPropertyNames) { + dependencies.push("./polyfill/object/getownpropertynames"); + } + if (!Object.getOwnPropertyDescriptor || !function() { + try { + Object.getOwnPropertyDescriptor({ + x: 0 + }, "x"); + return true; + } catch (exception) { + return false; + } + }()) { + dependencies.push("./polyfill/object/getownpropertydescriptor"); + } + register("base", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + function getOwnPropertyDescriptors(object) { + var descriptors = {}, properties = Object.getOwnPropertyNames(object), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + descriptors[property] = Object.getOwnPropertyDescriptor(object, property); + } + return descriptors; + } + function prohibitCall() { + throw new Error("[Qoopido.js] Operation prohibited"); + } + return { + create: function() { + var instance = Object.create(this, getOwnPropertyDescriptors(this)), result; + if (instance._constructor) { + result = instance._constructor.apply(instance, arguments); + } + instance.create = instance.extend = prohibitCall; + return result || instance; + }, + extend: function(properties, final) { + var instance; + properties = properties || {}; + final = final === true; + properties._parent = this; + instance = Object.create(this, getOwnPropertyDescriptors(properties)); + if (final === true) { + instance.extend = prohibitCall; + } + return instance; + } + }; +}, navigator, this, document); +(function(definition) { + window.qoopido.register("polyfill/string/ucfirst", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!String.prototype.ucfirst) { + String.prototype.ucfirst = function() { + var self = this; + return self.charAt(0).toUpperCase() + self.slice(1); + }; + } + return String.prototype.ucfirst; +}); +(function(definition) { + window.qoopido.register("polyfill/string/lcfirst", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!String.prototype.lcfirst) { + String.prototype.lcfirst = function() { + var self = this; + return self.charAt(0).toLowerCase() + self.slice(1); + }; + } + return String.prototype.lcfirst; +}); +(function(definition) { + window.qoopido.register("polyfill/window/promise", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var STATE_PENDING = void 0, STATE_SEALED = 0, STATE_FULFILLED = 1, STATE_REJECTED = 2, queue = []; + function addCallback(fn, arg) { + var length = queue.push([ fn, arg ]); + if (length === 1) { + scheduleFlushCallbacks(); + } + } + function scheduleFlushCallbacks() { + window.setTimeout(flushCallbacks, 1); + } + function flushCallbacks() { + var i = 0, tuple; + for (;(tuple = queue[i]) !== undefined; i++) { + tuple[0](tuple[1]); + } + queue.length = 0; + } + function handleThenable(promise, value) { + var then = null, resolved; + try { + if (promise === value) { + throw new TypeError("A promises callback cannot return that same promise."); + } + if (typeof value === "function" || typeof value === "object" && value !== null) { + then = value.then; + if (typeof then === "function") { + then.call(value, function(val) { + if (resolved) { + return true; + } + resolved = true; + if (value !== val) { + resolve(promise, val); + } else { + fulfill(promise, val); + } + }, function(val) { + if (resolved) { + return true; + } + resolved = true; + reject(promise, val); + }); + return true; + } + } + } catch (exception) { + if (resolved) { + return true; + } + reject(promise, exception); + return true; + } + return false; + } + function invokeResolver(resolver, promise) { + function resolvePromise(value) { + resolve(promise, value); + } + function rejectPromise(reason) { + reject(promise, reason); + } + try { + resolver(resolvePromise, rejectPromise); + } catch (exception) { + rejectPromise(exception); + } + } + function invokeCallback(settled, promise, callback, detail) { + var hasCallback = typeof callback === "function", value, error, succeeded, failed; + if (hasCallback) { + try { + value = callback(detail); + succeeded = true; + } catch (exception) { + failed = true; + error = exception; + } + } else { + value = detail; + succeeded = true; + } + if (handleThenable(promise, value)) { + return; + } else if (hasCallback && succeeded) { + resolve(promise, value); + } else if (failed) { + reject(promise, error); + } else if (settled === STATE_FULFILLED) { + resolve(promise, value); + } else if (settled === STATE_REJECTED) { + reject(promise, value); + } + } + function resolve(promise, value) { + if (promise === value) { + fulfill(promise, value); + } else if (!handleThenable(promise, value)) { + fulfill(promise, value); + } + } + function fulfill(promise, value) { + if (promise._state !== STATE_PENDING) { + return; + } + promise._state = STATE_SEALED; + promise._detail = value; + addCallback(publishFulfillment, promise); + } + function reject(promise, reason) { + if (promise._state !== STATE_PENDING) { + return; + } + promise._state = STATE_SEALED; + promise._detail = reason; + addCallback(publishRejection, promise); + } + function publishFulfillment(promise) { + publish(promise, promise._state = STATE_FULFILLED); + } + function publishRejection(promise) { + publish(promise, promise._state = STATE_REJECTED); + } + function subscribe(parent, child, onFulfillment, onRejection) { + var subscribers = parent._subscribers, length = subscribers.length; + subscribers[length] = child; + subscribers[length + STATE_FULFILLED] = onFulfillment; + subscribers[length + STATE_REJECTED] = onRejection; + } + function publish(promise, settled) { + var child, callback, subscribers = promise._subscribers, detail = promise._detail, i = 0; + for (;(child = subscribers[i]) !== undefined; i += 3) { + callback = subscribers[i + settled]; + invokeCallback(settled, child, callback, detail); + } + promise._subscribers = null; + } + function Promise(resolver) { + var self = this; + if (typeof resolver !== "function") { + throw new TypeError("You must pass a resolver function as the first argument to the promise constructor"); + } + self._subscribers = []; + invokeResolver(resolver, self); + } + Promise.prototype = { + _state: undefined, + _detail: undefined, + _subscribers: undefined, + then: function(onFulfilled, onRejected) { + var self = this, thenPromise = new Promise(function() {}); + if (self._state) { + addCallback(function invokePromiseCallback() { + invokeCallback(self._state, thenPromise, arguments[self._state - 1], self._detail); + }); + } else { + subscribe(self, thenPromise, onFulfilled, onRejected); + } + return thenPromise; + }, + "catch": function(onRejected) { + return this.then(null, onRejected); + } + }; + if (!window.Promise) { + window.Promise = Promise; + } + return window.Promise; +}); +(function(definition) { + var dependencies = []; + if (!window.Promise) { + dependencies.push("../polyfill/window/promise"); + } + window.qoopido.register("promise/all", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + return function all(promises) { + if (Object.prototype.toString.call(promises) !== "[object Array]") { + throw new TypeError("You must pass an array to all."); + } + return new window.Promise(function(resolve, reject) { + var results = [], remaining = promises.length, i = 0, promise; + if (remaining === 0) { + resolve([]); + } + function resolver(index) { + return function(value) { + resolveAll(index, value); + }; + } + function resolveAll(index, value) { + results[index] = value; + if (--remaining === 0) { + resolve(results); + } + } + for (;(promise = promises[i]) !== undefined; i++) { + if (promise && typeof promise.then === "function") { + promise.then(resolver(i), reject); + } else { + resolveAll(i, promise); + } + } + }); + }; +}); +(function(definition) { + var dependencies = []; + if (!window.Promise) { + dependencies.push("../polyfill/window/promise"); + } + window.qoopido.register("promise/defer", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + return function defer() { + var self = this; + self.promise = new window.Promise(function(resolve, reject) { + self.resolve = resolve; + self.reject = reject; + }); + }; +}); +(function(definition) { + window.qoopido.register("function/merge", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + return function merge() { + var target = arguments[0], i, properties, property, tgt, src; + for (i = 1; (properties = arguments[i]) !== undefined; i++) { + for (property in properties) { + tgt = target[property]; + src = properties[property]; + if (src !== undefined) { + if (src !== null && typeof src === "object") { + if (src.length !== undefined) { + tgt = tgt && typeof tgt === "object" && tgt.length !== undefined ? tgt : []; + } else { + tgt = tgt && typeof tgt === "object" && tgt.length === undefined ? tgt : {}; + } + target[property] = merge(tgt, src); + } else { + target[property] = src; + } + } + } + } + return target; + }; +}); +(function(definition) { + window.qoopido.register("function/unique/string", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var lookup = {}, characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""); + function generateString(length) { + var result = "", i = 0; + length = parseInt(length, 10) || 12; + for (;i < length; i++) { + result += characters[parseInt(Math.random() * (characters.length - 1), 10)]; + } + return result; + } + return function(length) { + var result; + do { + result = generateString(length); + } while (typeof lookup[result] !== "undefined"); + lookup[result] = true; + return result; + }; +}); +(function(definition) { + window.qoopido.register("function/unique/uuid", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var lookup = {}, regex = new RegExp("[xy]", "g"); + function generateUuid() { + return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(regex, function(c) { + var r = Math.random() * 16 | 0, v = c === "x" ? r : r & 3 | 8; + return v.toString(16); + }); + } + return function() { + var result; + do { + result = generateUuid(); + } while (typeof lookup[result] !== "undefined"); + lookup[result] = true; + return result; + }; +}); +(function(definition) { + window.qoopido.register("proxy", definition, [ "./base", "./function/unique/uuid" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + return modules["base"].extend({ + _constructor: function(context, fn) { + var args = Array.prototype.splice.call(arguments, 2), proxy = function() { + return fn.apply(context, Array.prototype.slice.call(arguments).concat(args)); + }; + proxy._quid = modules["function/unique/uuid"](); + return proxy; + } + }); +}); +(function(definition) { + var dependencies = [ "./base", "./promise/all", "./promise/defer" ]; + if (!String.prototype.ucfirst) { + dependencies.push("./polyfill/string/ucfirst"); + } + if (!String.prototype.lcfirst) { + dependencies.push("./polyfill/string/lcfirst"); + } + window.qoopido.registerSingleton("support", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var CombinedPromise = modules["promise/all"], DeferredPromise = modules["promise/defer"], matchPrefix = new RegExp("^(Moz|WebKit|Khtml|ms|O|Icab)(?=[A-Z])"), removeJsPrefix = new RegExp("^(?:webkit|khtml|icab|moz|ms|o)([A-Z])"), removeCssPrefix = new RegExp("^-(?:webkit|khtml|icab|moz|ms|o)-"), convertToCamelCase = new RegExp("-([a-z])", "gi"), convertToHyphens = new RegExp("([A-Z])", "g"), callbackUcfirst = function() { + return arguments[1].ucfirst(); + }, lookup = { + prefix: null, + method: {}, + property: {}, + css: {}, + promises: { + prefix: null, + method: {}, + property: {}, + css: {}, + test: {} + } + }; + function normalize(value) { + return value.replace(removeJsPrefix, "$1").lcfirst().replace(removeCssPrefix, "").replace(convertToCamelCase, callbackUcfirst); + } + return modules["base"].extend({ + test: {}, + pool: shared.pool && shared.pool.dom, + testMultiple: function() { + var test, tests = [], i = 0; + for (;(test = arguments[i]) !== undefined; i++) { + switch (typeof test) { + case "string": + tests.push(this.test[test]()); + break; + + case "boolean": + var deferred = new DeferredPromise(); + !!test ? deferred.resolve() : deferred.reject(); + tests.push(deferred.promise); + break; + + default: + tests.push(test); + break; + } + } + return new CombinedPromise(tests); + }, + getPrefix: function() { + var self = this, stored = lookup.prefix || null, property; + if (stored === null) { + var sample = self.pool ? self.pool.obtain("div") : document.createElement("div"), styles = sample.style; + stored = false; + for (property in styles) { + if (matchPrefix.test(property)) { + stored = property.match(matchPrefix)[0]; + } + } + if (stored === false && "WebkitOpacity" in styles) { + stored = "WebKit"; + } + if (stored === false && "KhtmlOpacity" in styles) { + stored = "Khtml"; + } + stored = lookup.prefix = stored === false ? false : [ stored.toLowerCase(), stored.toLowerCase().ucfirst(), stored ]; + sample.dispose && sample.dispose(); + } + return stored; + }, + getMethod: function(pMethod, pElement) { + pMethod = normalize(pMethod); + pElement = pElement || window; + var type = pElement.tagName, pointer = lookup.method[type] = lookup.method[type] || {}, stored = pointer[pMethod] = lookup.method[type][pMethod] || null; + if (stored === null) { + stored = false; + var candidates, candidate, i = 0, uMethod = pMethod.ucfirst(), prefixes = this.getPrefix(); + if (prefixes !== false) { + candidates = (pMethod + " " + uMethod + " " + prefixes.join(uMethod + " ") + uMethod).split(" "); + } else { + candidates = [ pMethod ]; + } + for (;(candidate = candidates[i]) !== undefined; i++) { + if (pElement[candidate] !== undefined && (typeof pElement[candidate] === "function" || typeof pElement[candidate] === "object")) { + stored = candidate; + break; + } + } + lookup.method[type][pMethod] = stored; + } + return stored; + }, + getProperty: function(pProperty, pElement) { + pProperty = normalize(pProperty); + pElement = pElement || window; + var type = pElement.tagName, pointer = lookup.property[type] = lookup.property[type] || {}, stored = pointer[pProperty] = lookup.property[type][pProperty] || null; + if (stored === null) { + stored = false; + var candidates, candidate, i = 0, uProperty = pProperty.ucfirst(), prefixes = this.getPrefix(); + if (prefixes !== false) { + candidates = (pProperty + " " + uProperty + " " + prefixes.join(uProperty + " ") + uProperty).split(" "); + } else { + candidates = [ pProperty ]; + } + for (i; (candidate = candidates[i]) !== undefined; i++) { + if (pElement[candidate] !== undefined) { + stored = candidate; + break; + } + } + lookup.property[type][pProperty] = stored; + } + return stored; + }, + getCssProperty: function(pProperty) { + pProperty = normalize(pProperty); + var self = this, stored = lookup.css[pProperty] || null; + if (stored === null) { + stored = false; + var candidate, i = 0, sample = self.pool ? self.pool.obtain("div") : document.createElement("div"), uProperty = pProperty.ucfirst(), prefixes = this.getPrefix() || [], candidates = (pProperty + " " + uProperty + " " + prefixes.join(uProperty + " ") + uProperty).split(" "), prefix = ""; + for (i; (candidate = candidates[i]) !== undefined; i++) { + if (sample.style[candidate] !== undefined) { + stored = candidate; + if (i > 0) { + prefix = "-"; + } + break; + } + } + stored = lookup.css[pProperty] = stored !== false ? [ prefix + stored.replace(convertToHyphens, "-$1").toLowerCase(), stored ] : false; + sample.dispose && sample.dispose(); + } + return stored; + }, + supportsPrefix: function() { + return !!this.getPrefix(); + }, + supportsMethod: function(pMethod, pElement) { + return !!this.getMethod(pMethod, pElement); + }, + supportsProperty: function(pProperty, pElement) { + return !!this.getProperty(pProperty, pElement); + }, + supportsCssProperty: function(pProperty) { + return !!this.getCssProperty(pProperty); + }, + testPrefix: function() { + var stored = lookup.promises.prefix; + if (stored === null) { + var deferred = new DeferredPromise(), prefix = this.getPrefix(); + !!prefix ? deferred.resolve(prefix) : deferred.reject(); + stored = lookup.promises.prefix = deferred.promise; + } + return stored; + }, + testMethod: function(pMethod, pElement) { + pElement = pElement || window; + var type = pElement.tagName, pointer = lookup.promises.method[type] = lookup.promises.method[type] || {}, stored = pointer[pMethod] = lookup.promises.method[type][pMethod] || null; + if (stored === null) { + var deferred = new DeferredPromise(), method = this.getMethod(pMethod, pElement); + !!method ? deferred.resolve(method) : deferred.reject(); + stored = lookup.promises.method[type][pMethod] = deferred.promise; + } + return stored; + }, + testProperty: function(pProperty, pElement) { + pElement = pElement || window; + var type = pElement.tagName, pointer = lookup.promises.property[type] = lookup.promises.property[type] || {}, stored = pointer[pProperty] = lookup.promises.property[type][pProperty] || null; + if (stored === null) { + var deferred = new DeferredPromise(), property = this.getProperty(pProperty, pElement); + !!property ? deferred.resolve(property) : deferred.reject(); + stored = lookup.promises.property[type][pProperty] = deferred.promise; + } + return stored; + }, + testCssProperty: function(pProperty) { + var stored = lookup.promises.css[pProperty] || null; + if (stored === null) { + var deferred = new DeferredPromise(), property = this.getCssProperty(pProperty); + !!property ? deferred.resolve(property) : deferred.reject(); + stored = lookup.promises.css[pProperty] = deferred.promise; + } + return stored; + }, + addTest: function(pId, pTest) { + return this.test[pId] = function() { + var stored = lookup.promises.test[pId] || null; + if (stored === null) { + var deferred = new DeferredPromise(), parameter = Array.prototype.slice.call(arguments); + parameter.splice(0, 0, deferred); + pTest.apply(null, parameter); + stored = lookup.promises.test[pId] = deferred.promise; + } + return stored; + }; + } + }); +}); +(function(definition) { + window.qoopido.register("support/capability/datauri", definition, [ "../../support", "../../dom/element" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var support = modules["support"]; + return support.addTest("/capability/datauri", function(deferred) { + var sample = modules["dom/element"].create(support.pool ? support.pool.obtain("img") : document.createElement("img")); + sample.one("error load", function(event) { + if (event.type === "load" && sample.element.width === 1 && sample.element.height === 1) { + deferred.resolve(); + } else { + deferred.reject(); + } + sample.element.dispose && sample.element.dispose(); + }, false).setAttribute("src", "data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="); + }); +}); +(function(definition) { + window.qoopido.register("support/element/canvas", definition, [ "../../support" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var support = modules["support"]; + return support.addTest("/element/canvas", function(deferred) { + var sample = support.pool ? support.pool.obtain("canvas") : document.createElement("canvas"); + sample.getContext && sample.getContext("2d") ? deferred.resolve() : deferred.reject(); + sample.dispose && sample.dispose(); + }); +}); +(function(definition) { + window.qoopido.register("support/element/canvas/todataurl", definition, [ "../../../support", "../canvas" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var support = modules["support"]; + return support.addTest("/element/canvas/todataurl", function(deferred) { + modules["support/element/canvas"]().then(function() { + var sample = support.pool ? support.pool.obtain("canvas") : document.createElement("canvas"); + sample.toDataURL !== undefined ? deferred.resolve() : deferred.reject(); + sample.dispose && sample.dispose(); + }, function() { + deferred.reject(); + }); + }); +}); +(function(definition) { + window.qoopido.register("support/element/canvas/todataurl/png", definition, [ "../../../../support", "../todataurl" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var support = modules["support"]; + return support.addTest("/element/canvas/todataurl/png", function(deferred) { + modules["support/element/canvas/todataurl"]().then(function() { + var sample = support.pool ? support.pool.obtain("canvas") : document.createElement("canvas"); + sample.toDataURL("image/png").indexOf("data:image/png") === 0 ? deferred.resolve() : deferred.reject(); + sample.dispose && sample.dispose(); + }, function() { + deferred.reject(); + }); + }); +}); +(function(definition) { + window.qoopido.registerSingleton("hook/event", definition, [ "../base" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + function transferProperties(event, originalEvent, properties) { + var i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + event[property] = originalEvent[property]; + } + event._properties = event._properties.concat(properties); + } + var hooks = { + general: { + properties: "type altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which path".split(" "), + process: function(event, originalEvent) { + var pointer; + event.originalEvent = originalEvent; + event.isDefaultPrevented = originalEvent.defaultPrevented ? true : false; + event.isPropagationStopped = originalEvent.cancelBubble ? true : false; + event.metaKey = originalEvent.metaKey && originalEvent.metaKey !== false ? true : false; + if (!event.target) { + event.target = originalEvent.srcElement || document; + } + if (event.target.nodeType === 3) { + event.target = event.target.parentNode; + } + if (!event.path) { + event.path = []; + pointer = event.target; + do { + event.path.push(pointer); + } while (pointer = pointer.parentNode); + event.path.push(window); + } + } + }, + mouse: { + regex: new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"), + properties: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement dataTransfer".split(" "), + process: function(event, originalEvent) { + var pointer, fromElement, which; + fromElement = originalEvent.fromElement; + which = originalEvent.button; + if (event.pageX === null && originalEvent.clientX !== null) { + pointer = event.target.ownerDocument || document; + pointer = pointer.documentElement || pointer.body; + event.pageX = originalEvent.clientX + (pointer.scrollLeft || 0) - (pointer.clientLeft || 0); + event.pageY = originalEvent.clientY + (pointer.scrollTop || 0) - (pointer.clientTop || 0); + } + if (!event.relatedTarget && fromElement) { + event.relatedTarget = fromElement === event.target ? originalEvent.toElement : fromElement; + } + if (!event.which && which !== undefined) { + event.which = which & 1 ? 1 : which & 2 ? 3 : which & 4 ? 2 : 0; + } + } + }, + key: { + regex: new RegExp("^(?:key)"), + properties: "char charCode key keyCode".split(" "), + process: function(event, originalEvent) { + if (event.which === null) { + event.which = originalEvent.charCode !== null ? originalEvent.charCode : originalEvent.keyCode; + } + } + } + }; + return modules["base"].extend({ + add: function(property, hook) { + if (property && hook && hooks[property]) { + hooks[property] = hook; + } + return this; + }, + get: function(property) { + if (property && hooks[property]) { + return hooks[property]; + } + return null; + }, + process: function(event, originalEvent) { + var id, hook, isMatch; + for (id in hooks) { + hook = hooks[id]; + isMatch = !hook.regex || hook.regex.test(originalEvent.type); + if (isMatch) { + if (hook.properties) { + transferProperties(event, originalEvent, hook.properties); + } + if (hook.process) { + hook.process(event, originalEvent); + } + if (hook.delegate) { + event.delegate = hook.delegate; + } + } + } + } + }); +}); +(function(definition) { + var dependencies = [ "../base", "../support" ]; + if (!window.getComputedStyle) { + dependencies.push("../polyfill/window/getcomputedstyle"); + } + window.qoopido.registerSingleton("hook/css", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var mSupport = modules["support"], getComputedStyle = window.getComputedStyle || modules["polyfill/window/getcomputedstyle"], hooks = { + general: { + get: function(element, property) { + return getComputedStyle(element, null).getPropertyValue(property[0]); + }, + set: function(element, property, value) { + element.style[property[1]] = value; + } + }, + opacity: !mSupport.supportsCssProperty("opacity") ? { + regex: new RegExp("alpha\\(opacity=(.*)\\)", "i"), + get: function(element, property, value) { + value = getComputedStyle(element, null).getPropertyValue("filter").toString().match(this.regex); + if (value) { + value = value[1] / 100; + } else { + value = 1; + } + return value; + }, + set: function(element, property, value) { + var style = element.style; + style.zoom = 1; + style.filter = "alpha(opacity=" + (value * 100 + .5 >> 0) + ")"; + } + } : null + }; + return modules["base"].extend({ + add: function(property, hook) { + if (property && hook && hooks[property]) { + hooks[property] = hook; + } + return this; + }, + get: function(property) { + if (property && hooks[property]) { + return hooks[property]; + } + return null; + }, + process: function(method, element, property, value) { + var hook; + property = mSupport.getCssProperty(property, element) || null; + if (property) { + return ((hook = this.get(property[1])) && hook[method] || this.get("general")[method])(element, property, value); + } + } + }); +}); +(function(definition) { + window.qoopido.register("dom/event", definition, [ "../base", "../hook/event" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var hooks = modules["hook/event"]; + return modules["base"].extend({ + originalEvent: null, + isDelegate: false, + isDefaultPrevented: false, + isPropagationStopped: false, + isImmediatePropagationStopped: false, + _properties: null, + _constructor: function(event) { + var self = this; + self._properties = []; + self._obtain(event); + return self; + }, + _obtain: function(event) { + hooks.process(this, event); + }, + _dispose: function() { + var self = this, i = 0, property; + for (;(property = self._properties[i]) !== undefined; i++) { + delete self[property]; + } + delete self.delegate; + self.originalEvent = null; + self.isDelegate = false; + self.isDefaultPrevented = false; + self.isPropagationStopped = false; + self.isImmediatePropagationStopped = false; + self._properties.length = 0; + }, + preventDefault: function() { + var self = this, event = self.originalEvent; + if (event.cancelable !== false) { + self.isDefaultPrevented = true; + if (event.preventDefault) { + event.preventDefault(); + } else { + event.returnValue = false; + } + } + }, + stopPropagation: function() { + var self = this, event = self.originalEvent; + self.isPropagationStopped = true; + if (event.stopPropagation) { + event.stopPropagation(); + } + event.cancelBubble = true; + }, + stopImmediatePropagation: function() { + var self = this, event = self.originalEvent; + self.isImmediatePropagationStopped = true; + if (event.stopImmediatePropagation) { + event.stopImmediatePropagation(); + } + self.stopPropagation(); + } + }); +}); +(function(definition) { + var dependencies = [ "../base", "../function/unique/uuid", "../hook/css", "./event" ]; + if (!window.CustomEvent) { + dependencies.push("../polyfill/window/customevent"); + } + if (!window.addEventListener) { + dependencies.push("../polyfill/window/addeventlistener"); + } + if (!window.removeEventListener) { + dependencies.push("../polyfill/window/removeeventlistener"); + } + if (!window.dispatchEvent) { + dependencies.push("../polyfill/window/dispatchevent"); + } + if (!Element.prototype.matches) { + dependencies.push("../polyfill/element/matches"); + } + if (!document.querySelector) { + dependencies.push("../polyfill/document/queryselector"); + } + if (!document.querySelectorAll) { + dependencies.push("../polyfill/document/queryselectorall"); + } + if (!String.prototype.trim) { + dependencies.push("../polyfill/string/trim"); + } + window.qoopido.register("dom/element", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var stringObject = "object", stringString = "string", generateUuid = modules["function/unique/uuid"], head = document.getElementsByTagName("head")[0], contentAttribute = "textContent" in document.createElement("a") ? "textContent" : "innerText", previousSibling = typeof head.previousElementSibling !== "undefined" ? function previousSibling() { + return this.previousElementSibling; + } : function previousSibling() { + var element = this; + while (element = element.previousSibling) { + if (element.nodeType === 1) { + return element; + } + } + }, nextSibling = typeof head.nextElementSibling !== "undefined" ? function nextSibling() { + return this.nextElementSibling; + } : function nextSibling() { + var element = this; + while (element = element.nextSibling) { + if (element.nodeType === 1) { + return element; + } + } + }, isTag = new RegExp("^<(\\w+)\\s*/>$"), matchEvent = new RegExp("^[^-]+"), splitList = new RegExp(" +", "g"), pool = modules["pool/module"] && modules["pool/module"].create(modules["dom/event"], null, true) || null, hooks = modules["hook/css"], storage = {}, events = { + custom: { + type: "CustomEvent", + method: "initCustomEvent" + }, + html: { + regex: new RegExp("^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$"), + type: "HTMLEvents", + method: "initEvent" + }, + mouse: { + regex: new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"), + type: "MouseEvents", + method: "initMouseEvent" + } + }; + function resolveEvent(type) { + var id, prototype, candidate; + for (id in events) { + prototype = events[id]; + if (!prototype.regex || prototype.regex.test(type)) { + candidate = prototype; + } + } + return candidate; + } + function emitEvent(type, detail, uuid) { + var self = this, prototype = resolveEvent(type), event = document.createEvent(prototype.type); + event[prototype.method](type, type === "load" ? false : true, true, detail); + if (uuid) { + event._quid = uuid; + event.isDelegate = true; + } + self.element.dispatchEvent(event); + } + function resolveElement(element) { + var tag; + if (typeof element === "string") { + try { + if (isTag.test(element) === true) { + tag = element.replace(isTag, "$1").toLowerCase(); + element = document.createElement(tag); + } else { + element = document.querySelector(element); + } + } catch (exception) { + element = null; + } + } + if (!element) { + throw new Error("[Qoopido.js] Element could not be resolved"); + } + return element; + } + function resolveArguments(parameters) { + return Array.prototype.concat.apply([], Array.prototype.splice.call(parameters, 0)).join(" ").split(splitList); + } + function matchesDelegate(event, delegate) { + var i = 0, pointer; + for (;(pointer = event.path[i]) !== undefined; i++) { + if (pointer.matches(delegate)) { + event.currentTarget = pointer; + return true; + } + if (pointer === event.currentTarget) { + break; + } + } + return false; + } + return modules["base"].extend({ + type: null, + element: null, + _listener: null, + _constructor: function(element, attributes, styles) { + var self = this, uuid; + element = resolveElement(element); + uuid = element._quid; + if (!uuid) { + uuid = element._quid = generateUuid(); + self.type = element.tagName; + self.element = element; + self._listener = {}; + storage[uuid] = self; + } else { + self = storage[uuid]; + } + if (typeof attributes === "object" && attributes !== null) { + self.setAttributes(attributes); + } + if (typeof styles === "object" && styles !== null) { + self.setStyles(styles); + } + if (self !== this) { + this.dispose && this.dispose(); + } + return self; + }, + _obtain: function(element, attributes, styles) { + this._constructor(element, attributes, styles); + }, + _dispose: function() { + var self = this, id, event; + for (id in self._listener) { + event = id.match(matchEvent); + self.element.removeEventListener(event, self._listener[id]); + delete self._listener[id]; + } + self.type = null; + self.element = null; + }, + getContent: function(html) { + var element = this.element; + return html && html !== false ? element.innerHTML : element[contentAttribute]; + }, + setContent: function(content, html) { + var self = this, element = self.element; + if (html && html !== false) { + element.innerHTML = content; + } else { + element[contentAttribute] = content; + } + return self; + }, + getAttribute: function(attribute) { + var self = this; + if (attribute && typeof attribute === stringString) { + return self.element.getAttribute(attribute); + } + }, + getAttributes: function() { + var self = this, result = {}, attributes = resolveArguments(arguments), i = 0, attribute; + for (;(attribute = attributes[i]) !== undefined; i++) { + result[attribute] = self.element.getAttribute(attribute); + } + return result; + }, + setAttribute: function(attribute, value) { + var self = this; + if (attribute && typeof attribute === stringString) { + self.element.setAttribute(attribute, value); + } + return self; + }, + setAttributes: function(attributes) { + var self = this, attribute; + if (attributes && typeof attributes === stringObject && !attributes.length) { + for (attribute in attributes) { + self.element.setAttribute(attribute, attributes[attribute]); + } + } + return self; + }, + removeAttribute: function(attribute) { + var self = this; + if (attribute && typeof attribute === stringString) { + self.element.removeAttribute(attribute); + } + return self; + }, + removeAttributes: function() { + var self = this, attributes = resolveArguments(arguments), i = 0, attribute; + for (;(attribute = attributes[i]) !== undefined; i++) { + self.element.removeAttribute(attribute); + } + return self; + }, + getStyle: function(property) { + var self = this; + if (property && typeof property === stringString) { + return hooks.process("get", self.element, property); + } + }, + getStyles: function() { + var self = this, result = {}, properties = resolveArguments(arguments), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + result[property] = hooks.process("get", self.element, property); + } + return result; + }, + setStyle: function(property, value) { + var self = this; + if (property && typeof property === stringString) { + hooks.process("set", self.element, property, value); + } + return self; + }, + setStyles: function(properties) { + var self = this, property; + if (properties && typeof properties === stringObject && !properties.length) { + for (property in properties) { + hooks.process("set", self.element, property, properties[property]); + } + } + return self; + }, + removeStyle: function(property) { + var self = this; + if (property && typeof property === stringString) { + self.setStyle(property, ""); + } + return self; + }, + removeStyles: function() { + var self = this, properties = resolveArguments(arguments), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + self.setStyle(property, ""); + } + return self; + }, + siblings: function(selector) { + var element = this.element, pointer = element.parentNode.firstChild, siblings = []; + for (;pointer; pointer = nextSibling.call(pointer)) { + if (pointer !== element && (!selector || pointer.matches(selector))) { + siblings.push(pointer); + } + } + return siblings; + }, + siblingsBefore: function(selector) { + var pointer = this.element.previousSibling, siblings = []; + for (;pointer; pointer = previousSibling.call(pointer)) { + if (!selector || pointer.matches(selector)) { + siblings.push(pointer); + } + } + return siblings; + }, + siblingsAfter: function(selector) { + var pointer = this.element.nextSibling, siblings = []; + for (;pointer; pointer = nextSibling.call(pointer)) { + if (!selector || pointer.matches(selector)) { + siblings.push(pointer); + } + } + return siblings; + }, + previous: function(selector) { + var pointer = previousSibling.call(this.element); + if (!selector) { + return pointer; + } else { + for (;pointer; pointer = previousSibling.call(pointer)) { + if (pointer.matches(selector)) { + return pointer; + } + } + } + }, + next: function(selector) { + var pointer = nextSibling.call(this.element); + if (!selector) { + return pointer; + } else { + for (;pointer; pointer = nextSibling.call(pointer)) { + if (pointer.matches(selector)) { + return pointer; + } + } + } + }, + find: function(selector) { + var self = this.element, uuid, matches; + selector = selector.trim(); + if (selector.charAt(0) === ">") { + uuid = self._quid; + self.setAttribute("data-quid", uuid); + selector = '[data-quid="' + uuid + '"] ' + selector; + matches = self.parentNode.querySelectorAll(selector); + self.removeAttribute("data-quid"); + } else { + matches = self.querySelectorAll(selector); + } + return matches; + }, + parent: function(selector) { + var pointer; + if (!selector) { + return this.element.parentNode; + } else { + pointer = this.element; + for (;pointer; pointer = pointer.parentNode) { + if (pointer.matches(selector)) { + return pointer; + } + } + } + }, + parents: function(selector) { + var pointer = this.element.parentNode, parents = []; + for (;pointer; pointer = pointer.parentNode) { + if (pointer.nodeType === 9) { + return parents; + } else if (pointer.nodeType === 1) { + if (!selector || pointer.matches(selector)) { + parents.push(pointer); + } + } + } + }, + isVisible: function() { + var self = this, element = self.element; + return !(element.offsetWidth <= 0 && element.offsetHeight <= 0 || self.getStyle("visibility") === "hidden" || self.getStyle("opacity") <= 0); + }, + hasClass: function(name) { + return name ? new RegExp("(?:^|\\s)" + name + "(?:\\s|$)").test(this.element.className) : false; + }, + addClass: function(name) { + var self = this; + if (name && !self.hasClass(name)) { + self.element.className += self.element.className ? " " + name : name; + } + return self; + }, + removeClass: function(name) { + var self = this; + if (name && self.hasClass(name)) { + self.element.className = self.element.className.replace(new RegExp("(?:^|\\s)" + name + "(?!\\S)"), ""); + } + return self; + }, + toggleClass: function(name) { + var self = this; + if (name) { + self.hasClass(name) ? self.removeClass(name) : self.addClass(name); + } + return self; + }, + prepend: function(element) { + var self = this, target = self.element; + if (element) { + try { + element = element.element || resolveElement(element); + target.firstChild ? target.insertBefore(element, target.firstChild) : self.append(element); + } catch (exception) { + target.insertAdjacentHTML("afterBegin", element); + } + } + return self; + }, + append: function(element) { + var self = this, target = self.element; + if (element) { + try { + target.appendChild(element.element || resolveElement(element)); + } catch (exception) { + target.insertAdjacentHTML("beforeEnd", element); + } + } + return self; + }, + prependTo: function(target) { + var self = this, element = self.element; + if (target) { + (target = target.element || resolveElement(target)).firstChild ? target.insertBefore(element, target.firstChild) : self.appendTo(target); + } + return self; + }, + appendTo: function(target) { + var self = this; + if (target) { + (target.element || resolveElement(target)).appendChild(self.element); + } + return self; + }, + insertBefore: function(target) { + var self = this, element = self.element; + if (target) { + (target = target.element || resolveElement(target)).parentNode.insertBefore(element, target); + } + return self; + }, + insertAfter: function(target) { + var self = this, element = self.element; + if (target) { + (target = target.element || resolveElement(target)).nextSibling ? target.parentNode.insertBefore(element, target.nextSibling) : self.appendTo(target.parentNode); + } + return self; + }, + replace: function(target) { + var self = this, element = self.element; + if (target) { + (target = target.element || resolveElement(target)).parentNode.replaceChild(element, target); + } + return self; + }, + replaceWith: function(element) { + var self = this, target = self.element; + if (element) { + element = element.element || resolveElement(element); + target.parentNode.replaceChild(element, target); + } + return self; + }, + remove: function() { + var self = this, element = self.element; + element.parentNode.removeChild(element); + return self; + }, + on: function(events) { + var self = this, element = self.element, delegate = arguments.length > 2 ? arguments[1] : null, fn = arguments.length > 2 ? arguments[2] : arguments[1], uuid = fn._quid || (fn._quid = generateUuid()), i = 0, event; + events = events.split(" "); + for (;(event = events[i]) !== undefined; i++) { + var id = event + "-" + uuid, listener = function(event) { + var delegateTo; + event = pool && pool.obtain(event) || modules["dom/event"].create(event); + if (!event.isPropagationStopped) { + delegateTo = event.delegate; + event._quid = generateUuid(); + if (!delegate || matchesDelegate(event, delegate)) { + fn.call(event.currentTarget, event, event.originalEvent.detail); + } + if (delegateTo) { + delete event.delegate; + emitEvent.call(self, delegateTo); + } + } + event.dispose && event.dispose(); + }; + listener.type = event; + self._listener[id] = listener; + element.addEventListener(event, listener); + } + return self; + }, + one: function(events) { + var self = this, delegate = arguments.length > 3 || typeof arguments[1] === "string" ? arguments[1] : null, fn = arguments.length > 3 || typeof arguments[2] === "function" ? arguments[2] : arguments[1], each = (arguments.length > 3 ? arguments[3] : arguments[2]) !== false, listener = function(event) { + self.off(each === true ? event.type : events, listener); + fn.call(this, event, event.originalEvent.detail); + }; + fn._quid = listener._quid = generateUuid(); + if (delegate) { + self.on(events, delegate, listener); + } else { + self.on(events, listener); + } + return self; + }, + off: function(events, fn) { + var self = this, element = self.element, i = 0, event, id, listener; + events = events.split(" "); + for (;(event = events[i]) !== undefined; i++) { + id = fn._quid && event + "-" + fn._quid || null; + listener = id && self._listener[id] || null; + if (listener) { + element.removeEventListener(event, listener); + delete self._listener[id]; + } else { + element.removeEventListener(event, fn); + } + } + return self; + }, + emit: function(event, data) { + var self = this; + emitEvent.call(self, event, data); + return self; + } + }); +}); +(function(definition) { + window.qoopido.registerSingleton("url", definition, [ "./base" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var urlCurrent, regexLocal, regexParameter = new RegExp("[?&]?([^=]+)=([^&]*)", "g"); + try { + urlCurrent = location; + } catch (exception) { + urlCurrent = getResolver(); + } + regexLocal = new RegExp("".concat("^", urlCurrent.protocol, "//", urlCurrent.hostname), "i"); + function getResolver(url) { + var resolver = document.createElement("a"); + resolver.href = url || ""; + return resolver; + } + return modules["base"].extend({ + resolve: function(url) { + return getResolver(url).href; + }, + redirect: function redirect(url, target) { + target = target || window; + target.location.href = this.resolve(url); + }, + getParameter: function(url) { + var params = {}, querystring = getResolver(url).search.split("+").join(" "), tokens; + while (tokens = regexParameter.exec(querystring)) { + params[decodeURIComponent(tokens[1])] = decodeURIComponent(tokens[2]); + } + return params; + }, + isLocal: function(url) { + return regexLocal.test(this.resolve(url)); + } + }); +}); +(function(definition) { + window.qoopido.register("transport", definition, [ "./base", "./function/merge" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var prototype; + prototype = modules["base"].extend({ + setup: function(options) { + var self = this; + self._settings = modules["function/merge"]({}, self._settings, options); + return self; + }, + serialize: function(obj, prefix) { + var parameter = [], id, key, value; + for (id in obj) { + key = prefix ? "".concat(prefix, "[", id, "]") : id; + value = obj[id]; + parameter.push(typeof value === "object" ? this.serialize(value, key) : "".concat(encodeURIComponent(key), "=", encodeURIComponent(value))); + } + return parameter.join("&"); + } + }); + return prototype; +}, window, document); +(function(definition) { + window.qoopido.registerSingleton("transport/xhr", definition, [ "../transport", "../function/merge", "../function/unique/string", "../url", "../promise/defer" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var prototype, DeferredPromise = modules["promise/defer"], getXhr = typeof window.XMLHttpRequest !== "undefined" ? function(url) { + if (modules["url"].isLocal(url)) { + return new window.XMLHttpRequest(); + } else { + return window.XDomainRequest ? new window.XDomainRequest() : new window.XMLHttpRequest(); + } + } : function() { + try { + return new ActiveXObject("MSXML2.XMLHTTP.3.0"); + } catch (exception) { + return null; + } + }; + function sendRequest(method, url, content) { + var self = this, xhr = self.xhr, settings = self.settings, id; + url = settings.cache === false ? "".concat(url, url.indexOf("?") > -1 ? "&" : "?", "_=" + new Date().getTime()) : url; + url = content && method === "GET" ? "".concat(url, url.indexOf("?") > -1 ? "&" : "?", content) : url; + for (id in settings.xhrOptions) { + xhr[id] = settings.xhrOptions[id]; + } + xhr.open(method, url, settings.async, settings.username, settings.password); + if (xhr.setRequestHeader) { + xhr.setRequestHeader("Accept", settings.accept); + if (content && method !== "GET") { + xhr.setRequestHeader("Content-Type", settings.contentType); + } + for (id in settings.header) { + xhr.setRequestHeader(id, settings.header[id]); + } + } + xhr.timeout = settings.timeout; + xhr.onprogress = function(event) { + onProgress.call(self, event); + }; + xhr.onreadystatechange = xhr.onload = function() { + onReadyStateChange.call(self); + }; + xhr.onerror = function() { + onError.call(self); + }; + xhr.send(content || null); + self.timeout = setTimeout(function() { + onTimeout.call(self); + }, settings.timeout); + } + function onProgress(event) { + var self = this; + if (self.timeout) { + clearTimeout(self.timeout); + } + self.timeout = setTimeout(function() { + onTimeout.call(self); + }, self.settings.timeout); + } + function onReadyStateChange() { + var self = this, xhr = self.xhr, dfd = self.dfd; + if (xhr.readyState === undefined || xhr.readyState === 4) { + clear.call(self); + if (xhr.status === undefined || xhr.status === 200) { + dfd.resolve({ + data: xhr.responseText, + xhr: xhr + }); + } else { + dfd.reject({ + status: xhr.status, + xhr: xhr + }); + } + } + } + function onError() { + var self = this; + clear.call(self); + self.dfd.reject(); + } + function onTimeout() { + var self = this; + self.xhr.abort(); + clear.call(self); + self.dfd.reject(); + } + function clear() { + var self = this, xhr = self.xhr; + if (self.timeout) { + clearTimeout(self.timeout); + } + xhr.onprogress = xhr.onreadystatechange = xhr.onerror = null; + } + prototype = modules["transport"].extend({ + _settings: { + accept: "*/*", + timeout: 5e3, + async: true, + cache: false, + header: {}, + username: null, + password: null, + contentType: "application/x-www-form-urlencoded; charset=UTF-8 ", + xhrOptions: {} + }, + load: function(method, url, data, options) { + var context = {}; + url = modules["url"].resolve(url); + context.url = url; + context.id = "".concat("xhr-", modules["function/unique/string"]()); + context.dfd = new DeferredPromise(); + context.xhr = getXhr(url); + context.settings = modules["function/merge"]({}, this._settings, options); + context.timeout = null; + sendRequest.call(context, method.toUpperCase(), url, data); + return context.dfd.promise; + }, + get: function(url, data, options) { + return this.load("GET", url, data, options); + }, + post: function(url, data, options) { + return this.load("POST", url, data, options); + }, + put: function(url, data, options) { + return this.load("PUT", url, data, options); + }, + "delete": function(url, data, options) { + return this.load("DELETE", url, data, options); + }, + head: function(url, data, options) { + return this.load("HEAD", url, data, options); + } + }); + return prototype; +}, window, document); +(function(definition) { + var dependencies = [ "../element", "../../proxy", "../../function/merge", "../../url", "../../support", "../../support/capability/datauri", "../../support/element/canvas/todataurl/png", "../../transport/xhr" ]; + window.qoopido.register("dom/element/shrinkimage", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var JSON = window.JSON, name = namespace.pop(), defaults = { + attribute: "data-" + name, + quality: 80, + debug: false + }, pool = shared.pool && shared.pool.dom || null, lookup = {}, regexBackground = new RegExp('^url\\x28"{0,1}data:image/shrink,(.+?)"{0,1}\\x29$', "i"), regexPath = new RegExp('^(?:url\\x28"{0,1}|)(?:data:image/shrink,|)(.+?)(?:"{0,1}\\x29|)$', "i"), regexSuffix = new RegExp("\\.png$", "i"), supported = modules["support"].testMultiple("/capability/datauri", "/element/canvas/todataurl/png"), prototype, loader, EVENT_QUEUED = "queued", EVENT_CACHED = "cached", EVENT_LOADED = "loaded", EVENT_FAILED = "failed", EVENT_STATE = "".concat(EVENT_LOADED, " ", EVENT_FAILED), DOM_LOAD = "load", DOM_ERROR = "error", DOM_STATE = "".concat(DOM_LOAD, " ", DOM_ERROR); + function processMain(url, isBackground) { + url = modules["url"].resolve(regexPath.exec(url)[1]); + isBackground = isBackground === true; + var self = this, settings = modules["function/merge"]({}, self._settings, modules["url"].getParameter(url)), target = settings.target || (url = url.split("?")[0]).replace(regexSuffix, "".concat(".q", settings.quality, ".shrunk")); + if (!isBackground) { + self.removeAttribute(self._settings.attribute).hide(); + } + supported.then(function() { + if (settings.debug === true) { + throw new Error("[Qoopido.js] Debug enabled"); + } + switch (typeof lookup[target]) { + case "object": + lookup[target].one(EVENT_LOADED, function(event) { + assign.call(self, event.data, isBackground); + }); + self.emit(EVENT_QUEUED); + break; + + case "string": + assign.call(self, lookup[target], isBackground); + break; + + default: + lookup[target] = loader.create(target, !isBackground ? self.element : null).one(EVENT_STATE, function(event, data) { + if (event.type === EVENT_LOADED) { + lookup[target] = data; + self.emit(EVENT_CACHED); + assign.call(self, data, isBackground); + } else { + lookup[target] = url; + assign.call(self, url, isBackground); + } + }, false); + break; + } + })["catch"](function() { + lookup[target] = url; + assign.call(self, url, isBackground); + }); + } + function assign(source, isBackground) { + var self = this; + if (isBackground) { + self.setStyle("backgroundImage", "url(" + source + ")"); + self.emit(EVENT_LOADED); + } else { + self.one(DOM_LOAD, function() { + self.show(); + self.emit(EVENT_LOADED); + }).setAttribute("src", source); + } + } + function processTransport(transport) { + var self = this; + transport.get(self._url).then(function(response) { + try { + var data = JSON.parse(response.data); + data.width = parseInt(data.width, 10); + data.height = parseInt(data.height, 10); + processData.call(self, data); + } catch (exception) { + self.emit(EVENT_FAILED); + } + }, function() { + self.emit(EVENT_FAILED); + }); + } + function processData(data) { + var canvas, context, self = this, onLoadMain = function(event) { + canvas = pool && pool.obtain("canvas") || document.createElement("canvas"); + canvas.style.display = "none"; + canvas.width = data.width; + canvas.height = data.height; + context = canvas.getContext("2d"); + context.clearRect(0, 0, data.width, data.height); + context.drawImage(self.element, 0, 0, data.width, data.height); + self.one(DOM_LOAD, onLoadAlpha).setAttribute("src", data.alpha); + return suppressEvent(event); + }, onLoadAlpha = function(event) { + var result; + context.globalCompositeOperation = "xor"; + context.drawImage(self.element, 0, 0, data.width, data.height); + result = canvas.toDataURL("image/png"); + dispose(); + self.emit(EVENT_LOADED, result); + return suppressEvent(event); + }, dispose = function() { + if (canvas) { + canvas.dispose && canvas.dispose(); + } + self.element.dispose && self.element.dispose(); + }; + self.one(DOM_STATE, function(event) { + if (event.type === DOM_LOAD) { + onLoadMain.call(this, event); + } else { + dispose(); + self.emit(EVENT_FAILED); + } + }, false).setAttribute("src", data.main); + } + function suppressEvent(event) { + event.preventDefault(); + event.stopPropagation(); + return false; + } + prototype = modules["dom/element"].extend({ + _constructor: function(element, settings) { + var self = prototype._parent._constructor.call(this, element), foreground, background; + self._settings = settings = modules["function/merge"]({}, defaults, settings); + foreground = self.getAttribute(settings.attribute); + background = self.getStyle("backgroundImage"); + if (self.type === "IMG") { + processMain.call(self, foreground); + } + if (background !== "none" && regexBackground.test(background)) { + processMain.call(self, background, true); + } + return self; + }, + hide: function() { + this.setStyles({ + visibility: "hidden", + opacity: 0 + }); + }, + show: function() { + this.setStyles({ + visibility: "", + opacity: "" + }); + } + }); + loader = modules["dom/element"].extend({ + _url: null, + _constructor: function(url, element) { + var self; + if (!element) { + element = pool && pool.obtain("img") || document.createElement("img"); + } + self = loader._parent._constructor.call(this, element); + self._url = url; + processTransport.call(self, modules["transport/xhr"]); + return self; + } + }); + return prototype; +}, window); \ No newline at end of file diff --git a/dist/latest/max/packages/qoopido.shrinkimage.legacy.js b/dist/latest/max/packages/qoopido.shrinkimage.legacy.js new file mode 100644 index 00000000..0249fb66 --- /dev/null +++ b/dist/latest/max/packages/qoopido.shrinkimage.legacy.js @@ -0,0 +1,1985 @@ +/*! +* Qoopido.js library +* +* version: 3.7.3 +* date: 2015-08-05 +* author: Dirk Lueth +* website: https://github.com/dlueth/qoopido.js +* +* Copyright (c) 2015 Dirk Lueth +*/ +(function(definition, qoopido) { + if (qoopido.register) { + qoopido.register("polyfill/object/defineproperty", definition); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/defineproperty"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.defineProperty || !function() { + try { + Object.defineProperty({}, "x", {}); + return true; + } catch (exception) { + return false; + } + }()) { + var defineProperty = Object.defineProperty, defineGetter = Object.prototype.__defineGetter__, defineSetter = Object.prototype.__defineSetter__; + Object.defineProperty = function(obj, prop, desc) { + if (defineProperty) { + try { + return defineProperty(obj, prop, desc); + } catch (exception) {} + } + if (obj !== Object(obj)) { + throw new TypeError("Object.defineProperty called on non-object"); + } + if (defineGetter && "get" in desc) { + defineGetter.call(obj, prop, desc.get); + } + if (defineSetter && "set" in desc) { + defineSetter.call(obj, prop, desc.set); + } + if ("value" in desc) { + obj[prop] = desc.value; + } + return obj; + }; + } + return Object.defineProperty; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + var dependencies = []; + if (!Object.defineProperty || !function() { + try { + Object.defineProperty({}, "x", {}); + return true; + } catch (exception) { + return false; + } + }()) { + dependencies.push("./defineproperty"); + } + qoopido.register("polyfill/object/defineproperties", definition, dependencies); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/defineproperties"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.defineProperties) { + Object.defineProperties = function(obj, properties) { + if (obj !== Object(obj)) { + throw new TypeError("Object.defineProperties called on non-object"); + } + var name; + for (name in properties) { + if (Object.prototype.hasOwnProperty.call(properties, name)) { + Object.defineProperty(obj, name, properties[name]); + } + } + return obj; + }; + } + return Object.defineProperties; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + var dependencies = []; + if (!Object.defineProperties) { + dependencies.push("./defineproperties"); + } + qoopido.register("polyfill/object/create", definition, dependencies); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/create"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.create) { + Object.create = function(prototype, properties) { + if (typeof prototype !== "object") { + throw new TypeError(); + } + function Constructor() {} + Constructor.prototype = prototype; + var obj = new Constructor(); + if (prototype) { + obj.constructor = Constructor; + } + if (arguments.length > 1) { + if (properties !== Object(properties)) { + throw new TypeError(); + } + Object.defineProperties(obj, properties); + } + return obj; + }; + } + return Object.create; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + qoopido.register("polyfill/object/getownpropertynames", definition); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/getownpropertynames"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.getOwnPropertyNames) { + Object.getOwnPropertyNames = function(obj) { + if (obj !== Object(obj)) { + throw new TypeError("Object.getOwnPropertyNames called on non-object"); + } + var props = [], p; + for (p in obj) { + if (Object.prototype.hasOwnProperty.call(obj, p)) { + props.push(p); + } + } + return props; + }; + } + return Object.getOwnPropertyNames; +}, window.qoopido = window.qoopido || {}); +(function(definition, qoopido) { + if (qoopido.register) { + qoopido.register("polyfill/object/getownpropertydescriptor", definition); + } else { + (qoopido.modules = qoopido.modules || {})["polyfill/object/getownpropertydescriptor"] = definition(); + } +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!Object.getOwnPropertyDescriptor || !function() { + try { + Object.getOwnPropertyDescriptor({ + x: 0 + }, "x"); + return true; + } catch (exception) { + return false; + } + }()) { + var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; + Object.getOwnPropertyDescriptor = function(obj, property) { + if (obj !== Object(obj)) { + throw new TypeError(); + } + try { + return getOwnPropertyDescriptor.call(Object, obj, property); + } catch (exception) {} + if (Object.prototype.hasOwnProperty.call(obj, property)) { + return { + value: obj[property], + enumerable: true, + writable: true, + configurable: true + }; + } + }; + } + return Object.getOwnPropertyDescriptor; +}, window.qoopido = window.qoopido || {}); +(function(definition, navigator, global, document, undefined) { + "use strict"; + function register(id, definition, dependencies, callback) { + var namespace = id.split("/"), initialize; + if (modules[id]) { + return modules[id]; + } + initialize = function() { + if (dependencies) { + var path = namespace.slice(0, -1).join("/"), i = 0, dependency, internal; + for (;(dependency = dependencies[i]) !== undefined; i++) { + internal = isInternal.test(dependency); + if (internal) { + dependency = canonicalize(path + "/" + dependency); + } + if (!modules[dependency] && arguments[i]) { + modules[dependency] = arguments[i]; + } + if (internal && !modules[dependency] && typeof console !== "undefined") { + console.error("".concat("[Qoopido.js] ", id, ": Could not load dependency ", dependency)); + } + } + } + modules[id] = definition(modules, shared, namespace, navigator, global, document, undefined); + if (callback) { + callback(modules[id]); + } + return modules[id]; + }; + if (typeof module !== "undefined" && module.exports) { + module.exports = define(initialize); + } else if (typeof define === "function" && define.amd) { + dependencies ? define(dependencies, initialize) : define(initialize); + } else { + initialize(); + } + } + function registerSingleton(id, definition, dependencies) { + register(id, definition, dependencies, function(module) { + modules[id] = module.create(); + }); + } + var qoopido = global.qoopido || (global.qoopido = {}), shared = qoopido.shared || (qoopido.shared = {}), modules = qoopido.modules || (qoopido.modules = {}), dependencies = [], isInternal = new RegExp("^\\.+\\/"), regexCanonicalize = new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."), removeNeutral = new RegExp("(^\\/)|\\.\\/", "g"); + qoopido.register = register; + qoopido.registerSingleton = registerSingleton; + function canonicalize(path) { + var collapsed; + while ((collapsed = path.replace(regexCanonicalize, "")) !== path) { + path = collapsed; + } + return path.replace(removeNeutral, ""); + } + if (!Object.create) { + dependencies.push("./polyfill/object/create"); + } + if (!Object.getOwnPropertyNames) { + dependencies.push("./polyfill/object/getownpropertynames"); + } + if (!Object.getOwnPropertyDescriptor || !function() { + try { + Object.getOwnPropertyDescriptor({ + x: 0 + }, "x"); + return true; + } catch (exception) { + return false; + } + }()) { + dependencies.push("./polyfill/object/getownpropertydescriptor"); + } + register("base", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + function getOwnPropertyDescriptors(object) { + var descriptors = {}, properties = Object.getOwnPropertyNames(object), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + descriptors[property] = Object.getOwnPropertyDescriptor(object, property); + } + return descriptors; + } + function prohibitCall() { + throw new Error("[Qoopido.js] Operation prohibited"); + } + return { + create: function() { + var instance = Object.create(this, getOwnPropertyDescriptors(this)), result; + if (instance._constructor) { + result = instance._constructor.apply(instance, arguments); + } + instance.create = instance.extend = prohibitCall; + return result || instance; + }, + extend: function(properties, final) { + var instance; + properties = properties || {}; + final = final === true; + properties._parent = this; + instance = Object.create(this, getOwnPropertyDescriptors(properties)); + if (final === true) { + instance.extend = prohibitCall; + } + return instance; + } + }; +}, navigator, this, document); +(function(definition) { + window.qoopido.register("polyfill/string/ucfirst", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!String.prototype.ucfirst) { + String.prototype.ucfirst = function() { + var self = this; + return self.charAt(0).toUpperCase() + self.slice(1); + }; + } + return String.prototype.ucfirst; +}); +(function(definition) { + window.qoopido.register("polyfill/string/lcfirst", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!String.prototype.lcfirst) { + String.prototype.lcfirst = function() { + var self = this; + return self.charAt(0).toLowerCase() + self.slice(1); + }; + } + return String.prototype.lcfirst; +}); +(function(definition) { + window.qoopido.register("polyfill/window/getcomputedstyle", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + if (!window.getComputedStyle) { + var getComputedStyleRegex = new RegExp("(\\-([a-z]){1})", "g"), getComputedStyleCallback = function() { + return arguments[2].toUpperCase(); + }; + return function(element, pseudo) { + var self = this; + self.getPropertyValue = function(property) { + if (property === "float") { + property = "styleFloat"; + } + if (getComputedStyleRegex.test(property)) { + property = property.replace(getComputedStyleRegex, getComputedStyleCallback); + } + return element.currentStyle[property] || null; + }; + return self; + }; + } else { + return window.getComputedStyle; + } +}); +(function(definition) { + window.qoopido.register("polyfill/window/promise", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var STATE_PENDING = void 0, STATE_SEALED = 0, STATE_FULFILLED = 1, STATE_REJECTED = 2, queue = []; + function addCallback(fn, arg) { + var length = queue.push([ fn, arg ]); + if (length === 1) { + scheduleFlushCallbacks(); + } + } + function scheduleFlushCallbacks() { + window.setTimeout(flushCallbacks, 1); + } + function flushCallbacks() { + var i = 0, tuple; + for (;(tuple = queue[i]) !== undefined; i++) { + tuple[0](tuple[1]); + } + queue.length = 0; + } + function handleThenable(promise, value) { + var then = null, resolved; + try { + if (promise === value) { + throw new TypeError("A promises callback cannot return that same promise."); + } + if (typeof value === "function" || typeof value === "object" && value !== null) { + then = value.then; + if (typeof then === "function") { + then.call(value, function(val) { + if (resolved) { + return true; + } + resolved = true; + if (value !== val) { + resolve(promise, val); + } else { + fulfill(promise, val); + } + }, function(val) { + if (resolved) { + return true; + } + resolved = true; + reject(promise, val); + }); + return true; + } + } + } catch (exception) { + if (resolved) { + return true; + } + reject(promise, exception); + return true; + } + return false; + } + function invokeResolver(resolver, promise) { + function resolvePromise(value) { + resolve(promise, value); + } + function rejectPromise(reason) { + reject(promise, reason); + } + try { + resolver(resolvePromise, rejectPromise); + } catch (exception) { + rejectPromise(exception); + } + } + function invokeCallback(settled, promise, callback, detail) { + var hasCallback = typeof callback === "function", value, error, succeeded, failed; + if (hasCallback) { + try { + value = callback(detail); + succeeded = true; + } catch (exception) { + failed = true; + error = exception; + } + } else { + value = detail; + succeeded = true; + } + if (handleThenable(promise, value)) { + return; + } else if (hasCallback && succeeded) { + resolve(promise, value); + } else if (failed) { + reject(promise, error); + } else if (settled === STATE_FULFILLED) { + resolve(promise, value); + } else if (settled === STATE_REJECTED) { + reject(promise, value); + } + } + function resolve(promise, value) { + if (promise === value) { + fulfill(promise, value); + } else if (!handleThenable(promise, value)) { + fulfill(promise, value); + } + } + function fulfill(promise, value) { + if (promise._state !== STATE_PENDING) { + return; + } + promise._state = STATE_SEALED; + promise._detail = value; + addCallback(publishFulfillment, promise); + } + function reject(promise, reason) { + if (promise._state !== STATE_PENDING) { + return; + } + promise._state = STATE_SEALED; + promise._detail = reason; + addCallback(publishRejection, promise); + } + function publishFulfillment(promise) { + publish(promise, promise._state = STATE_FULFILLED); + } + function publishRejection(promise) { + publish(promise, promise._state = STATE_REJECTED); + } + function subscribe(parent, child, onFulfillment, onRejection) { + var subscribers = parent._subscribers, length = subscribers.length; + subscribers[length] = child; + subscribers[length + STATE_FULFILLED] = onFulfillment; + subscribers[length + STATE_REJECTED] = onRejection; + } + function publish(promise, settled) { + var child, callback, subscribers = promise._subscribers, detail = promise._detail, i = 0; + for (;(child = subscribers[i]) !== undefined; i += 3) { + callback = subscribers[i + settled]; + invokeCallback(settled, child, callback, detail); + } + promise._subscribers = null; + } + function Promise(resolver) { + var self = this; + if (typeof resolver !== "function") { + throw new TypeError("You must pass a resolver function as the first argument to the promise constructor"); + } + self._subscribers = []; + invokeResolver(resolver, self); + } + Promise.prototype = { + _state: undefined, + _detail: undefined, + _subscribers: undefined, + then: function(onFulfilled, onRejected) { + var self = this, thenPromise = new Promise(function() {}); + if (self._state) { + addCallback(function invokePromiseCallback() { + invokeCallback(self._state, thenPromise, arguments[self._state - 1], self._detail); + }); + } else { + subscribe(self, thenPromise, onFulfilled, onRejected); + } + return thenPromise; + }, + "catch": function(onRejected) { + return this.then(null, onRejected); + } + }; + if (!window.Promise) { + window.Promise = Promise; + } + return window.Promise; +}); +(function(definition) { + var dependencies = []; + if (!window.Promise) { + dependencies.push("../polyfill/window/promise"); + } + window.qoopido.register("promise/all", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + return function all(promises) { + if (Object.prototype.toString.call(promises) !== "[object Array]") { + throw new TypeError("You must pass an array to all."); + } + return new window.Promise(function(resolve, reject) { + var results = [], remaining = promises.length, i = 0, promise; + if (remaining === 0) { + resolve([]); + } + function resolver(index) { + return function(value) { + resolveAll(index, value); + }; + } + function resolveAll(index, value) { + results[index] = value; + if (--remaining === 0) { + resolve(results); + } + } + for (;(promise = promises[i]) !== undefined; i++) { + if (promise && typeof promise.then === "function") { + promise.then(resolver(i), reject); + } else { + resolveAll(i, promise); + } + } + }); + }; +}); +(function(definition) { + var dependencies = []; + if (!window.Promise) { + dependencies.push("../polyfill/window/promise"); + } + window.qoopido.register("promise/defer", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + return function defer() { + var self = this; + self.promise = new window.Promise(function(resolve, reject) { + self.resolve = resolve; + self.reject = reject; + }); + }; +}); +(function(definition) { + window.qoopido.register("function/merge", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + return function merge() { + var target = arguments[0], i, properties, property, tgt, src; + for (i = 1; (properties = arguments[i]) !== undefined; i++) { + for (property in properties) { + tgt = target[property]; + src = properties[property]; + if (src !== undefined) { + if (src !== null && typeof src === "object") { + if (src.length !== undefined) { + tgt = tgt && typeof tgt === "object" && tgt.length !== undefined ? tgt : []; + } else { + tgt = tgt && typeof tgt === "object" && tgt.length === undefined ? tgt : {}; + } + target[property] = merge(tgt, src); + } else { + target[property] = src; + } + } + } + } + return target; + }; +}); +(function(definition) { + window.qoopido.register("function/unique/string", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var lookup = {}, characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""); + function generateString(length) { + var result = "", i = 0; + length = parseInt(length, 10) || 12; + for (;i < length; i++) { + result += characters[parseInt(Math.random() * (characters.length - 1), 10)]; + } + return result; + } + return function(length) { + var result; + do { + result = generateString(length); + } while (typeof lookup[result] !== "undefined"); + lookup[result] = true; + return result; + }; +}); +(function(definition) { + window.qoopido.register("function/unique/uuid", definition); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var lookup = {}, regex = new RegExp("[xy]", "g"); + function generateUuid() { + return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(regex, function(c) { + var r = Math.random() * 16 | 0, v = c === "x" ? r : r & 3 | 8; + return v.toString(16); + }); + } + return function() { + var result; + do { + result = generateUuid(); + } while (typeof lookup[result] !== "undefined"); + lookup[result] = true; + return result; + }; +}); +(function(definition) { + window.qoopido.register("proxy", definition, [ "./base", "./function/unique/uuid" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + return modules["base"].extend({ + _constructor: function(context, fn) { + var args = Array.prototype.splice.call(arguments, 2), proxy = function() { + return fn.apply(context, Array.prototype.slice.call(arguments).concat(args)); + }; + proxy._quid = modules["function/unique/uuid"](); + return proxy; + } + }); +}); +(function(definition) { + var dependencies = [ "./base", "./promise/all", "./promise/defer" ]; + if (!String.prototype.ucfirst) { + dependencies.push("./polyfill/string/ucfirst"); + } + if (!String.prototype.lcfirst) { + dependencies.push("./polyfill/string/lcfirst"); + } + window.qoopido.registerSingleton("support", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var CombinedPromise = modules["promise/all"], DeferredPromise = modules["promise/defer"], matchPrefix = new RegExp("^(Moz|WebKit|Khtml|ms|O|Icab)(?=[A-Z])"), removeJsPrefix = new RegExp("^(?:webkit|khtml|icab|moz|ms|o)([A-Z])"), removeCssPrefix = new RegExp("^-(?:webkit|khtml|icab|moz|ms|o)-"), convertToCamelCase = new RegExp("-([a-z])", "gi"), convertToHyphens = new RegExp("([A-Z])", "g"), callbackUcfirst = function() { + return arguments[1].ucfirst(); + }, lookup = { + prefix: null, + method: {}, + property: {}, + css: {}, + promises: { + prefix: null, + method: {}, + property: {}, + css: {}, + test: {} + } + }; + function normalize(value) { + return value.replace(removeJsPrefix, "$1").lcfirst().replace(removeCssPrefix, "").replace(convertToCamelCase, callbackUcfirst); + } + return modules["base"].extend({ + test: {}, + pool: shared.pool && shared.pool.dom, + testMultiple: function() { + var test, tests = [], i = 0; + for (;(test = arguments[i]) !== undefined; i++) { + switch (typeof test) { + case "string": + tests.push(this.test[test]()); + break; + + case "boolean": + var deferred = new DeferredPromise(); + !!test ? deferred.resolve() : deferred.reject(); + tests.push(deferred.promise); + break; + + default: + tests.push(test); + break; + } + } + return new CombinedPromise(tests); + }, + getPrefix: function() { + var self = this, stored = lookup.prefix || null, property; + if (stored === null) { + var sample = self.pool ? self.pool.obtain("div") : document.createElement("div"), styles = sample.style; + stored = false; + for (property in styles) { + if (matchPrefix.test(property)) { + stored = property.match(matchPrefix)[0]; + } + } + if (stored === false && "WebkitOpacity" in styles) { + stored = "WebKit"; + } + if (stored === false && "KhtmlOpacity" in styles) { + stored = "Khtml"; + } + stored = lookup.prefix = stored === false ? false : [ stored.toLowerCase(), stored.toLowerCase().ucfirst(), stored ]; + sample.dispose && sample.dispose(); + } + return stored; + }, + getMethod: function(pMethod, pElement) { + pMethod = normalize(pMethod); + pElement = pElement || window; + var type = pElement.tagName, pointer = lookup.method[type] = lookup.method[type] || {}, stored = pointer[pMethod] = lookup.method[type][pMethod] || null; + if (stored === null) { + stored = false; + var candidates, candidate, i = 0, uMethod = pMethod.ucfirst(), prefixes = this.getPrefix(); + if (prefixes !== false) { + candidates = (pMethod + " " + uMethod + " " + prefixes.join(uMethod + " ") + uMethod).split(" "); + } else { + candidates = [ pMethod ]; + } + for (;(candidate = candidates[i]) !== undefined; i++) { + if (pElement[candidate] !== undefined && (typeof pElement[candidate] === "function" || typeof pElement[candidate] === "object")) { + stored = candidate; + break; + } + } + lookup.method[type][pMethod] = stored; + } + return stored; + }, + getProperty: function(pProperty, pElement) { + pProperty = normalize(pProperty); + pElement = pElement || window; + var type = pElement.tagName, pointer = lookup.property[type] = lookup.property[type] || {}, stored = pointer[pProperty] = lookup.property[type][pProperty] || null; + if (stored === null) { + stored = false; + var candidates, candidate, i = 0, uProperty = pProperty.ucfirst(), prefixes = this.getPrefix(); + if (prefixes !== false) { + candidates = (pProperty + " " + uProperty + " " + prefixes.join(uProperty + " ") + uProperty).split(" "); + } else { + candidates = [ pProperty ]; + } + for (i; (candidate = candidates[i]) !== undefined; i++) { + if (pElement[candidate] !== undefined) { + stored = candidate; + break; + } + } + lookup.property[type][pProperty] = stored; + } + return stored; + }, + getCssProperty: function(pProperty) { + pProperty = normalize(pProperty); + var self = this, stored = lookup.css[pProperty] || null; + if (stored === null) { + stored = false; + var candidate, i = 0, sample = self.pool ? self.pool.obtain("div") : document.createElement("div"), uProperty = pProperty.ucfirst(), prefixes = this.getPrefix() || [], candidates = (pProperty + " " + uProperty + " " + prefixes.join(uProperty + " ") + uProperty).split(" "), prefix = ""; + for (i; (candidate = candidates[i]) !== undefined; i++) { + if (sample.style[candidate] !== undefined) { + stored = candidate; + if (i > 0) { + prefix = "-"; + } + break; + } + } + stored = lookup.css[pProperty] = stored !== false ? [ prefix + stored.replace(convertToHyphens, "-$1").toLowerCase(), stored ] : false; + sample.dispose && sample.dispose(); + } + return stored; + }, + supportsPrefix: function() { + return !!this.getPrefix(); + }, + supportsMethod: function(pMethod, pElement) { + return !!this.getMethod(pMethod, pElement); + }, + supportsProperty: function(pProperty, pElement) { + return !!this.getProperty(pProperty, pElement); + }, + supportsCssProperty: function(pProperty) { + return !!this.getCssProperty(pProperty); + }, + testPrefix: function() { + var stored = lookup.promises.prefix; + if (stored === null) { + var deferred = new DeferredPromise(), prefix = this.getPrefix(); + !!prefix ? deferred.resolve(prefix) : deferred.reject(); + stored = lookup.promises.prefix = deferred.promise; + } + return stored; + }, + testMethod: function(pMethod, pElement) { + pElement = pElement || window; + var type = pElement.tagName, pointer = lookup.promises.method[type] = lookup.promises.method[type] || {}, stored = pointer[pMethod] = lookup.promises.method[type][pMethod] || null; + if (stored === null) { + var deferred = new DeferredPromise(), method = this.getMethod(pMethod, pElement); + !!method ? deferred.resolve(method) : deferred.reject(); + stored = lookup.promises.method[type][pMethod] = deferred.promise; + } + return stored; + }, + testProperty: function(pProperty, pElement) { + pElement = pElement || window; + var type = pElement.tagName, pointer = lookup.promises.property[type] = lookup.promises.property[type] || {}, stored = pointer[pProperty] = lookup.promises.property[type][pProperty] || null; + if (stored === null) { + var deferred = new DeferredPromise(), property = this.getProperty(pProperty, pElement); + !!property ? deferred.resolve(property) : deferred.reject(); + stored = lookup.promises.property[type][pProperty] = deferred.promise; + } + return stored; + }, + testCssProperty: function(pProperty) { + var stored = lookup.promises.css[pProperty] || null; + if (stored === null) { + var deferred = new DeferredPromise(), property = this.getCssProperty(pProperty); + !!property ? deferred.resolve(property) : deferred.reject(); + stored = lookup.promises.css[pProperty] = deferred.promise; + } + return stored; + }, + addTest: function(pId, pTest) { + return this.test[pId] = function() { + var stored = lookup.promises.test[pId] || null; + if (stored === null) { + var deferred = new DeferredPromise(), parameter = Array.prototype.slice.call(arguments); + parameter.splice(0, 0, deferred); + pTest.apply(null, parameter); + stored = lookup.promises.test[pId] = deferred.promise; + } + return stored; + }; + } + }); +}); +(function(definition) { + window.qoopido.register("support/capability/datauri", definition, [ "../../support", "../../dom/element" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var support = modules["support"]; + return support.addTest("/capability/datauri", function(deferred) { + var sample = modules["dom/element"].create(support.pool ? support.pool.obtain("img") : document.createElement("img")); + sample.one("error load", function(event) { + if (event.type === "load" && sample.element.width === 1 && sample.element.height === 1) { + deferred.resolve(); + } else { + deferred.reject(); + } + sample.element.dispose && sample.element.dispose(); + }, false).setAttribute("src", "data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="); + }); +}); +(function(definition) { + window.qoopido.register("support/element/canvas", definition, [ "../../support" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var support = modules["support"]; + return support.addTest("/element/canvas", function(deferred) { + var sample = support.pool ? support.pool.obtain("canvas") : document.createElement("canvas"); + sample.getContext && sample.getContext("2d") ? deferred.resolve() : deferred.reject(); + sample.dispose && sample.dispose(); + }); +}); +(function(definition) { + window.qoopido.register("support/element/canvas/todataurl", definition, [ "../../../support", "../canvas" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var support = modules["support"]; + return support.addTest("/element/canvas/todataurl", function(deferred) { + modules["support/element/canvas"]().then(function() { + var sample = support.pool ? support.pool.obtain("canvas") : document.createElement("canvas"); + sample.toDataURL !== undefined ? deferred.resolve() : deferred.reject(); + sample.dispose && sample.dispose(); + }, function() { + deferred.reject(); + }); + }); +}); +(function(definition) { + window.qoopido.register("support/element/canvas/todataurl/png", definition, [ "../../../../support", "../todataurl" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var support = modules["support"]; + return support.addTest("/element/canvas/todataurl/png", function(deferred) { + modules["support/element/canvas/todataurl"]().then(function() { + var sample = support.pool ? support.pool.obtain("canvas") : document.createElement("canvas"); + sample.toDataURL("image/png").indexOf("data:image/png") === 0 ? deferred.resolve() : deferred.reject(); + sample.dispose && sample.dispose(); + }, function() { + deferred.reject(); + }); + }); +}); +(function(definition) { + window.qoopido.registerSingleton("hook/event", definition, [ "../base" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + function transferProperties(event, originalEvent, properties) { + var i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + event[property] = originalEvent[property]; + } + event._properties = event._properties.concat(properties); + } + var hooks = { + general: { + properties: "type altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which path".split(" "), + process: function(event, originalEvent) { + var pointer; + event.originalEvent = originalEvent; + event.isDefaultPrevented = originalEvent.defaultPrevented ? true : false; + event.isPropagationStopped = originalEvent.cancelBubble ? true : false; + event.metaKey = originalEvent.metaKey && originalEvent.metaKey !== false ? true : false; + if (!event.target) { + event.target = originalEvent.srcElement || document; + } + if (event.target.nodeType === 3) { + event.target = event.target.parentNode; + } + if (!event.path) { + event.path = []; + pointer = event.target; + do { + event.path.push(pointer); + } while (pointer = pointer.parentNode); + event.path.push(window); + } + } + }, + mouse: { + regex: new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"), + properties: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement dataTransfer".split(" "), + process: function(event, originalEvent) { + var pointer, fromElement, which; + fromElement = originalEvent.fromElement; + which = originalEvent.button; + if (event.pageX === null && originalEvent.clientX !== null) { + pointer = event.target.ownerDocument || document; + pointer = pointer.documentElement || pointer.body; + event.pageX = originalEvent.clientX + (pointer.scrollLeft || 0) - (pointer.clientLeft || 0); + event.pageY = originalEvent.clientY + (pointer.scrollTop || 0) - (pointer.clientTop || 0); + } + if (!event.relatedTarget && fromElement) { + event.relatedTarget = fromElement === event.target ? originalEvent.toElement : fromElement; + } + if (!event.which && which !== undefined) { + event.which = which & 1 ? 1 : which & 2 ? 3 : which & 4 ? 2 : 0; + } + } + }, + key: { + regex: new RegExp("^(?:key)"), + properties: "char charCode key keyCode".split(" "), + process: function(event, originalEvent) { + if (event.which === null) { + event.which = originalEvent.charCode !== null ? originalEvent.charCode : originalEvent.keyCode; + } + } + } + }; + return modules["base"].extend({ + add: function(property, hook) { + if (property && hook && hooks[property]) { + hooks[property] = hook; + } + return this; + }, + get: function(property) { + if (property && hooks[property]) { + return hooks[property]; + } + return null; + }, + process: function(event, originalEvent) { + var id, hook, isMatch; + for (id in hooks) { + hook = hooks[id]; + isMatch = !hook.regex || hook.regex.test(originalEvent.type); + if (isMatch) { + if (hook.properties) { + transferProperties(event, originalEvent, hook.properties); + } + if (hook.process) { + hook.process(event, originalEvent); + } + if (hook.delegate) { + event.delegate = hook.delegate; + } + } + } + } + }); +}); +(function(definition) { + var dependencies = [ "../base", "../support" ]; + if (!window.getComputedStyle) { + dependencies.push("../polyfill/window/getcomputedstyle"); + } + window.qoopido.registerSingleton("hook/css", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var mSupport = modules["support"], getComputedStyle = window.getComputedStyle || modules["polyfill/window/getcomputedstyle"], hooks = { + general: { + get: function(element, property) { + return getComputedStyle(element, null).getPropertyValue(property[0]); + }, + set: function(element, property, value) { + element.style[property[1]] = value; + } + }, + opacity: !mSupport.supportsCssProperty("opacity") ? { + regex: new RegExp("alpha\\(opacity=(.*)\\)", "i"), + get: function(element, property, value) { + value = getComputedStyle(element, null).getPropertyValue("filter").toString().match(this.regex); + if (value) { + value = value[1] / 100; + } else { + value = 1; + } + return value; + }, + set: function(element, property, value) { + var style = element.style; + style.zoom = 1; + style.filter = "alpha(opacity=" + (value * 100 + .5 >> 0) + ")"; + } + } : null + }; + return modules["base"].extend({ + add: function(property, hook) { + if (property && hook && hooks[property]) { + hooks[property] = hook; + } + return this; + }, + get: function(property) { + if (property && hooks[property]) { + return hooks[property]; + } + return null; + }, + process: function(method, element, property, value) { + var hook; + property = mSupport.getCssProperty(property, element) || null; + if (property) { + return ((hook = this.get(property[1])) && hook[method] || this.get("general")[method])(element, property, value); + } + } + }); +}); +(function(definition) { + window.qoopido.register("dom/event", definition, [ "../base", "../hook/event" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var hooks = modules["hook/event"]; + return modules["base"].extend({ + originalEvent: null, + isDelegate: false, + isDefaultPrevented: false, + isPropagationStopped: false, + isImmediatePropagationStopped: false, + _properties: null, + _constructor: function(event) { + var self = this; + self._properties = []; + self._obtain(event); + return self; + }, + _obtain: function(event) { + hooks.process(this, event); + }, + _dispose: function() { + var self = this, i = 0, property; + for (;(property = self._properties[i]) !== undefined; i++) { + delete self[property]; + } + delete self.delegate; + self.originalEvent = null; + self.isDelegate = false; + self.isDefaultPrevented = false; + self.isPropagationStopped = false; + self.isImmediatePropagationStopped = false; + self._properties.length = 0; + }, + preventDefault: function() { + var self = this, event = self.originalEvent; + if (event.cancelable !== false) { + self.isDefaultPrevented = true; + if (event.preventDefault) { + event.preventDefault(); + } else { + event.returnValue = false; + } + } + }, + stopPropagation: function() { + var self = this, event = self.originalEvent; + self.isPropagationStopped = true; + if (event.stopPropagation) { + event.stopPropagation(); + } + event.cancelBubble = true; + }, + stopImmediatePropagation: function() { + var self = this, event = self.originalEvent; + self.isImmediatePropagationStopped = true; + if (event.stopImmediatePropagation) { + event.stopImmediatePropagation(); + } + self.stopPropagation(); + } + }); +}); +(function(definition) { + var dependencies = [ "../base", "../function/unique/uuid", "../hook/css", "./event" ]; + if (!window.CustomEvent) { + dependencies.push("../polyfill/window/customevent"); + } + if (!window.addEventListener) { + dependencies.push("../polyfill/window/addeventlistener"); + } + if (!window.removeEventListener) { + dependencies.push("../polyfill/window/removeeventlistener"); + } + if (!window.dispatchEvent) { + dependencies.push("../polyfill/window/dispatchevent"); + } + if (!Element.prototype.matches) { + dependencies.push("../polyfill/element/matches"); + } + if (!document.querySelector) { + dependencies.push("../polyfill/document/queryselector"); + } + if (!document.querySelectorAll) { + dependencies.push("../polyfill/document/queryselectorall"); + } + if (!String.prototype.trim) { + dependencies.push("../polyfill/string/trim"); + } + window.qoopido.register("dom/element", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var stringObject = "object", stringString = "string", generateUuid = modules["function/unique/uuid"], head = document.getElementsByTagName("head")[0], contentAttribute = "textContent" in document.createElement("a") ? "textContent" : "innerText", previousSibling = typeof head.previousElementSibling !== "undefined" ? function previousSibling() { + return this.previousElementSibling; + } : function previousSibling() { + var element = this; + while (element = element.previousSibling) { + if (element.nodeType === 1) { + return element; + } + } + }, nextSibling = typeof head.nextElementSibling !== "undefined" ? function nextSibling() { + return this.nextElementSibling; + } : function nextSibling() { + var element = this; + while (element = element.nextSibling) { + if (element.nodeType === 1) { + return element; + } + } + }, isTag = new RegExp("^<(\\w+)\\s*/>$"), matchEvent = new RegExp("^[^-]+"), splitList = new RegExp(" +", "g"), pool = modules["pool/module"] && modules["pool/module"].create(modules["dom/event"], null, true) || null, hooks = modules["hook/css"], storage = {}, events = { + custom: { + type: "CustomEvent", + method: "initCustomEvent" + }, + html: { + regex: new RegExp("^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$"), + type: "HTMLEvents", + method: "initEvent" + }, + mouse: { + regex: new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"), + type: "MouseEvents", + method: "initMouseEvent" + } + }; + function resolveEvent(type) { + var id, prototype, candidate; + for (id in events) { + prototype = events[id]; + if (!prototype.regex || prototype.regex.test(type)) { + candidate = prototype; + } + } + return candidate; + } + function emitEvent(type, detail, uuid) { + var self = this, prototype = resolveEvent(type), event = document.createEvent(prototype.type); + event[prototype.method](type, type === "load" ? false : true, true, detail); + if (uuid) { + event._quid = uuid; + event.isDelegate = true; + } + self.element.dispatchEvent(event); + } + function resolveElement(element) { + var tag; + if (typeof element === "string") { + try { + if (isTag.test(element) === true) { + tag = element.replace(isTag, "$1").toLowerCase(); + element = document.createElement(tag); + } else { + element = document.querySelector(element); + } + } catch (exception) { + element = null; + } + } + if (!element) { + throw new Error("[Qoopido.js] Element could not be resolved"); + } + return element; + } + function resolveArguments(parameters) { + return Array.prototype.concat.apply([], Array.prototype.splice.call(parameters, 0)).join(" ").split(splitList); + } + function matchesDelegate(event, delegate) { + var i = 0, pointer; + for (;(pointer = event.path[i]) !== undefined; i++) { + if (pointer.matches(delegate)) { + event.currentTarget = pointer; + return true; + } + if (pointer === event.currentTarget) { + break; + } + } + return false; + } + return modules["base"].extend({ + type: null, + element: null, + _listener: null, + _constructor: function(element, attributes, styles) { + var self = this, uuid; + element = resolveElement(element); + uuid = element._quid; + if (!uuid) { + uuid = element._quid = generateUuid(); + self.type = element.tagName; + self.element = element; + self._listener = {}; + storage[uuid] = self; + } else { + self = storage[uuid]; + } + if (typeof attributes === "object" && attributes !== null) { + self.setAttributes(attributes); + } + if (typeof styles === "object" && styles !== null) { + self.setStyles(styles); + } + if (self !== this) { + this.dispose && this.dispose(); + } + return self; + }, + _obtain: function(element, attributes, styles) { + this._constructor(element, attributes, styles); + }, + _dispose: function() { + var self = this, id, event; + for (id in self._listener) { + event = id.match(matchEvent); + self.element.removeEventListener(event, self._listener[id]); + delete self._listener[id]; + } + self.type = null; + self.element = null; + }, + getContent: function(html) { + var element = this.element; + return html && html !== false ? element.innerHTML : element[contentAttribute]; + }, + setContent: function(content, html) { + var self = this, element = self.element; + if (html && html !== false) { + element.innerHTML = content; + } else { + element[contentAttribute] = content; + } + return self; + }, + getAttribute: function(attribute) { + var self = this; + if (attribute && typeof attribute === stringString) { + return self.element.getAttribute(attribute); + } + }, + getAttributes: function() { + var self = this, result = {}, attributes = resolveArguments(arguments), i = 0, attribute; + for (;(attribute = attributes[i]) !== undefined; i++) { + result[attribute] = self.element.getAttribute(attribute); + } + return result; + }, + setAttribute: function(attribute, value) { + var self = this; + if (attribute && typeof attribute === stringString) { + self.element.setAttribute(attribute, value); + } + return self; + }, + setAttributes: function(attributes) { + var self = this, attribute; + if (attributes && typeof attributes === stringObject && !attributes.length) { + for (attribute in attributes) { + self.element.setAttribute(attribute, attributes[attribute]); + } + } + return self; + }, + removeAttribute: function(attribute) { + var self = this; + if (attribute && typeof attribute === stringString) { + self.element.removeAttribute(attribute); + } + return self; + }, + removeAttributes: function() { + var self = this, attributes = resolveArguments(arguments), i = 0, attribute; + for (;(attribute = attributes[i]) !== undefined; i++) { + self.element.removeAttribute(attribute); + } + return self; + }, + getStyle: function(property) { + var self = this; + if (property && typeof property === stringString) { + return hooks.process("get", self.element, property); + } + }, + getStyles: function() { + var self = this, result = {}, properties = resolveArguments(arguments), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + result[property] = hooks.process("get", self.element, property); + } + return result; + }, + setStyle: function(property, value) { + var self = this; + if (property && typeof property === stringString) { + hooks.process("set", self.element, property, value); + } + return self; + }, + setStyles: function(properties) { + var self = this, property; + if (properties && typeof properties === stringObject && !properties.length) { + for (property in properties) { + hooks.process("set", self.element, property, properties[property]); + } + } + return self; + }, + removeStyle: function(property) { + var self = this; + if (property && typeof property === stringString) { + self.setStyle(property, ""); + } + return self; + }, + removeStyles: function() { + var self = this, properties = resolveArguments(arguments), i = 0, property; + for (;(property = properties[i]) !== undefined; i++) { + self.setStyle(property, ""); + } + return self; + }, + siblings: function(selector) { + var element = this.element, pointer = element.parentNode.firstChild, siblings = []; + for (;pointer; pointer = nextSibling.call(pointer)) { + if (pointer !== element && (!selector || pointer.matches(selector))) { + siblings.push(pointer); + } + } + return siblings; + }, + siblingsBefore: function(selector) { + var pointer = this.element.previousSibling, siblings = []; + for (;pointer; pointer = previousSibling.call(pointer)) { + if (!selector || pointer.matches(selector)) { + siblings.push(pointer); + } + } + return siblings; + }, + siblingsAfter: function(selector) { + var pointer = this.element.nextSibling, siblings = []; + for (;pointer; pointer = nextSibling.call(pointer)) { + if (!selector || pointer.matches(selector)) { + siblings.push(pointer); + } + } + return siblings; + }, + previous: function(selector) { + var pointer = previousSibling.call(this.element); + if (!selector) { + return pointer; + } else { + for (;pointer; pointer = previousSibling.call(pointer)) { + if (pointer.matches(selector)) { + return pointer; + } + } + } + }, + next: function(selector) { + var pointer = nextSibling.call(this.element); + if (!selector) { + return pointer; + } else { + for (;pointer; pointer = nextSibling.call(pointer)) { + if (pointer.matches(selector)) { + return pointer; + } + } + } + }, + find: function(selector) { + var self = this.element, uuid, matches; + selector = selector.trim(); + if (selector.charAt(0) === ">") { + uuid = self._quid; + self.setAttribute("data-quid", uuid); + selector = '[data-quid="' + uuid + '"] ' + selector; + matches = self.parentNode.querySelectorAll(selector); + self.removeAttribute("data-quid"); + } else { + matches = self.querySelectorAll(selector); + } + return matches; + }, + parent: function(selector) { + var pointer; + if (!selector) { + return this.element.parentNode; + } else { + pointer = this.element; + for (;pointer; pointer = pointer.parentNode) { + if (pointer.matches(selector)) { + return pointer; + } + } + } + }, + parents: function(selector) { + var pointer = this.element.parentNode, parents = []; + for (;pointer; pointer = pointer.parentNode) { + if (pointer.nodeType === 9) { + return parents; + } else if (pointer.nodeType === 1) { + if (!selector || pointer.matches(selector)) { + parents.push(pointer); + } + } + } + }, + isVisible: function() { + var self = this, element = self.element; + return !(element.offsetWidth <= 0 && element.offsetHeight <= 0 || self.getStyle("visibility") === "hidden" || self.getStyle("opacity") <= 0); + }, + hasClass: function(name) { + return name ? new RegExp("(?:^|\\s)" + name + "(?:\\s|$)").test(this.element.className) : false; + }, + addClass: function(name) { + var self = this; + if (name && !self.hasClass(name)) { + self.element.className += self.element.className ? " " + name : name; + } + return self; + }, + removeClass: function(name) { + var self = this; + if (name && self.hasClass(name)) { + self.element.className = self.element.className.replace(new RegExp("(?:^|\\s)" + name + "(?!\\S)"), ""); + } + return self; + }, + toggleClass: function(name) { + var self = this; + if (name) { + self.hasClass(name) ? self.removeClass(name) : self.addClass(name); + } + return self; + }, + prepend: function(element) { + var self = this, target = self.element; + if (element) { + try { + element = element.element || resolveElement(element); + target.firstChild ? target.insertBefore(element, target.firstChild) : self.append(element); + } catch (exception) { + target.insertAdjacentHTML("afterBegin", element); + } + } + return self; + }, + append: function(element) { + var self = this, target = self.element; + if (element) { + try { + target.appendChild(element.element || resolveElement(element)); + } catch (exception) { + target.insertAdjacentHTML("beforeEnd", element); + } + } + return self; + }, + prependTo: function(target) { + var self = this, element = self.element; + if (target) { + (target = target.element || resolveElement(target)).firstChild ? target.insertBefore(element, target.firstChild) : self.appendTo(target); + } + return self; + }, + appendTo: function(target) { + var self = this; + if (target) { + (target.element || resolveElement(target)).appendChild(self.element); + } + return self; + }, + insertBefore: function(target) { + var self = this, element = self.element; + if (target) { + (target = target.element || resolveElement(target)).parentNode.insertBefore(element, target); + } + return self; + }, + insertAfter: function(target) { + var self = this, element = self.element; + if (target) { + (target = target.element || resolveElement(target)).nextSibling ? target.parentNode.insertBefore(element, target.nextSibling) : self.appendTo(target.parentNode); + } + return self; + }, + replace: function(target) { + var self = this, element = self.element; + if (target) { + (target = target.element || resolveElement(target)).parentNode.replaceChild(element, target); + } + return self; + }, + replaceWith: function(element) { + var self = this, target = self.element; + if (element) { + element = element.element || resolveElement(element); + target.parentNode.replaceChild(element, target); + } + return self; + }, + remove: function() { + var self = this, element = self.element; + element.parentNode.removeChild(element); + return self; + }, + on: function(events) { + var self = this, element = self.element, delegate = arguments.length > 2 ? arguments[1] : null, fn = arguments.length > 2 ? arguments[2] : arguments[1], uuid = fn._quid || (fn._quid = generateUuid()), i = 0, event; + events = events.split(" "); + for (;(event = events[i]) !== undefined; i++) { + var id = event + "-" + uuid, listener = function(event) { + var delegateTo; + event = pool && pool.obtain(event) || modules["dom/event"].create(event); + if (!event.isPropagationStopped) { + delegateTo = event.delegate; + event._quid = generateUuid(); + if (!delegate || matchesDelegate(event, delegate)) { + fn.call(event.currentTarget, event, event.originalEvent.detail); + } + if (delegateTo) { + delete event.delegate; + emitEvent.call(self, delegateTo); + } + } + event.dispose && event.dispose(); + }; + listener.type = event; + self._listener[id] = listener; + element.addEventListener(event, listener); + } + return self; + }, + one: function(events) { + var self = this, delegate = arguments.length > 3 || typeof arguments[1] === "string" ? arguments[1] : null, fn = arguments.length > 3 || typeof arguments[2] === "function" ? arguments[2] : arguments[1], each = (arguments.length > 3 ? arguments[3] : arguments[2]) !== false, listener = function(event) { + self.off(each === true ? event.type : events, listener); + fn.call(this, event, event.originalEvent.detail); + }; + fn._quid = listener._quid = generateUuid(); + if (delegate) { + self.on(events, delegate, listener); + } else { + self.on(events, listener); + } + return self; + }, + off: function(events, fn) { + var self = this, element = self.element, i = 0, event, id, listener; + events = events.split(" "); + for (;(event = events[i]) !== undefined; i++) { + id = fn._quid && event + "-" + fn._quid || null; + listener = id && self._listener[id] || null; + if (listener) { + element.removeEventListener(event, listener); + delete self._listener[id]; + } else { + element.removeEventListener(event, fn); + } + } + return self; + }, + emit: function(event, data) { + var self = this; + emitEvent.call(self, event, data); + return self; + } + }); +}); +(function(definition) { + window.qoopido.registerSingleton("url", definition, [ "./base" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var urlCurrent, regexLocal, regexParameter = new RegExp("[?&]?([^=]+)=([^&]*)", "g"); + try { + urlCurrent = location; + } catch (exception) { + urlCurrent = getResolver(); + } + regexLocal = new RegExp("".concat("^", urlCurrent.protocol, "//", urlCurrent.hostname), "i"); + function getResolver(url) { + var resolver = document.createElement("a"); + resolver.href = url || ""; + return resolver; + } + return modules["base"].extend({ + resolve: function(url) { + return getResolver(url).href; + }, + redirect: function redirect(url, target) { + target = target || window; + target.location.href = this.resolve(url); + }, + getParameter: function(url) { + var params = {}, querystring = getResolver(url).search.split("+").join(" "), tokens; + while (tokens = regexParameter.exec(querystring)) { + params[decodeURIComponent(tokens[1])] = decodeURIComponent(tokens[2]); + } + return params; + }, + isLocal: function(url) { + return regexLocal.test(this.resolve(url)); + } + }); +}); +(function(definition) { + window.qoopido.register("transport", definition, [ "./base", "./function/merge" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var prototype; + prototype = modules["base"].extend({ + setup: function(options) { + var self = this; + self._settings = modules["function/merge"]({}, self._settings, options); + return self; + }, + serialize: function(obj, prefix) { + var parameter = [], id, key, value; + for (id in obj) { + key = prefix ? "".concat(prefix, "[", id, "]") : id; + value = obj[id]; + parameter.push(typeof value === "object" ? this.serialize(value, key) : "".concat(encodeURIComponent(key), "=", encodeURIComponent(value))); + } + return parameter.join("&"); + } + }); + return prototype; +}, window, document); +(function(definition) { + window.qoopido.registerSingleton("transport/xhr", definition, [ "../transport", "../function/merge", "../function/unique/string", "../url", "../promise/defer" ]); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var prototype, DeferredPromise = modules["promise/defer"], getXhr = typeof window.XMLHttpRequest !== "undefined" ? function(url) { + if (modules["url"].isLocal(url)) { + return new window.XMLHttpRequest(); + } else { + return window.XDomainRequest ? new window.XDomainRequest() : new window.XMLHttpRequest(); + } + } : function() { + try { + return new ActiveXObject("MSXML2.XMLHTTP.3.0"); + } catch (exception) { + return null; + } + }; + function sendRequest(method, url, content) { + var self = this, xhr = self.xhr, settings = self.settings, id; + url = settings.cache === false ? "".concat(url, url.indexOf("?") > -1 ? "&" : "?", "_=" + new Date().getTime()) : url; + url = content && method === "GET" ? "".concat(url, url.indexOf("?") > -1 ? "&" : "?", content) : url; + for (id in settings.xhrOptions) { + xhr[id] = settings.xhrOptions[id]; + } + xhr.open(method, url, settings.async, settings.username, settings.password); + if (xhr.setRequestHeader) { + xhr.setRequestHeader("Accept", settings.accept); + if (content && method !== "GET") { + xhr.setRequestHeader("Content-Type", settings.contentType); + } + for (id in settings.header) { + xhr.setRequestHeader(id, settings.header[id]); + } + } + xhr.timeout = settings.timeout; + xhr.onprogress = function(event) { + onProgress.call(self, event); + }; + xhr.onreadystatechange = xhr.onload = function() { + onReadyStateChange.call(self); + }; + xhr.onerror = function() { + onError.call(self); + }; + xhr.send(content || null); + self.timeout = setTimeout(function() { + onTimeout.call(self); + }, settings.timeout); + } + function onProgress(event) { + var self = this; + if (self.timeout) { + clearTimeout(self.timeout); + } + self.timeout = setTimeout(function() { + onTimeout.call(self); + }, self.settings.timeout); + } + function onReadyStateChange() { + var self = this, xhr = self.xhr, dfd = self.dfd; + if (xhr.readyState === undefined || xhr.readyState === 4) { + clear.call(self); + if (xhr.status === undefined || xhr.status === 200) { + dfd.resolve({ + data: xhr.responseText, + xhr: xhr + }); + } else { + dfd.reject({ + status: xhr.status, + xhr: xhr + }); + } + } + } + function onError() { + var self = this; + clear.call(self); + self.dfd.reject(); + } + function onTimeout() { + var self = this; + self.xhr.abort(); + clear.call(self); + self.dfd.reject(); + } + function clear() { + var self = this, xhr = self.xhr; + if (self.timeout) { + clearTimeout(self.timeout); + } + xhr.onprogress = xhr.onreadystatechange = xhr.onerror = null; + } + prototype = modules["transport"].extend({ + _settings: { + accept: "*/*", + timeout: 5e3, + async: true, + cache: false, + header: {}, + username: null, + password: null, + contentType: "application/x-www-form-urlencoded; charset=UTF-8 ", + xhrOptions: {} + }, + load: function(method, url, data, options) { + var context = {}; + url = modules["url"].resolve(url); + context.url = url; + context.id = "".concat("xhr-", modules["function/unique/string"]()); + context.dfd = new DeferredPromise(); + context.xhr = getXhr(url); + context.settings = modules["function/merge"]({}, this._settings, options); + context.timeout = null; + sendRequest.call(context, method.toUpperCase(), url, data); + return context.dfd.promise; + }, + get: function(url, data, options) { + return this.load("GET", url, data, options); + }, + post: function(url, data, options) { + return this.load("POST", url, data, options); + }, + put: function(url, data, options) { + return this.load("PUT", url, data, options); + }, + "delete": function(url, data, options) { + return this.load("DELETE", url, data, options); + }, + head: function(url, data, options) { + return this.load("HEAD", url, data, options); + } + }); + return prototype; +}, window, document); +(function(definition) { + var dependencies = [ "../element", "../../proxy", "../../function/merge", "../../url", "../../support", "../../support/capability/datauri", "../../support/element/canvas/todataurl/png", "../../transport/xhr" ]; + window.qoopido.register("dom/element/shrinkimage", definition, dependencies); +})(function(modules, shared, namespace, navigator, window, document, undefined) { + "use strict"; + var JSON = window.JSON, name = namespace.pop(), defaults = { + attribute: "data-" + name, + quality: 80, + debug: false + }, pool = shared.pool && shared.pool.dom || null, lookup = {}, regexBackground = new RegExp('^url\\x28"{0,1}data:image/shrink,(.+?)"{0,1}\\x29$', "i"), regexPath = new RegExp('^(?:url\\x28"{0,1}|)(?:data:image/shrink,|)(.+?)(?:"{0,1}\\x29|)$', "i"), regexSuffix = new RegExp("\\.png$", "i"), supported = modules["support"].testMultiple("/capability/datauri", "/element/canvas/todataurl/png"), prototype, loader, EVENT_QUEUED = "queued", EVENT_CACHED = "cached", EVENT_LOADED = "loaded", EVENT_FAILED = "failed", EVENT_STATE = "".concat(EVENT_LOADED, " ", EVENT_FAILED), DOM_LOAD = "load", DOM_ERROR = "error", DOM_STATE = "".concat(DOM_LOAD, " ", DOM_ERROR); + function processMain(url, isBackground) { + url = modules["url"].resolve(regexPath.exec(url)[1]); + isBackground = isBackground === true; + var self = this, settings = modules["function/merge"]({}, self._settings, modules["url"].getParameter(url)), target = settings.target || (url = url.split("?")[0]).replace(regexSuffix, "".concat(".q", settings.quality, ".shrunk")); + if (!isBackground) { + self.removeAttribute(self._settings.attribute).hide(); + } + supported.then(function() { + if (settings.debug === true) { + throw new Error("[Qoopido.js] Debug enabled"); + } + switch (typeof lookup[target]) { + case "object": + lookup[target].one(EVENT_LOADED, function(event) { + assign.call(self, event.data, isBackground); + }); + self.emit(EVENT_QUEUED); + break; + + case "string": + assign.call(self, lookup[target], isBackground); + break; + + default: + lookup[target] = loader.create(target, !isBackground ? self.element : null).one(EVENT_STATE, function(event, data) { + if (event.type === EVENT_LOADED) { + lookup[target] = data; + self.emit(EVENT_CACHED); + assign.call(self, data, isBackground); + } else { + lookup[target] = url; + assign.call(self, url, isBackground); + } + }, false); + break; + } + })["catch"](function() { + lookup[target] = url; + assign.call(self, url, isBackground); + }); + } + function assign(source, isBackground) { + var self = this; + if (isBackground) { + self.setStyle("backgroundImage", "url(" + source + ")"); + self.emit(EVENT_LOADED); + } else { + self.one(DOM_LOAD, function() { + self.show(); + self.emit(EVENT_LOADED); + }).setAttribute("src", source); + } + } + function processTransport(transport) { + var self = this; + transport.get(self._url).then(function(response) { + try { + var data = JSON.parse(response.data); + data.width = parseInt(data.width, 10); + data.height = parseInt(data.height, 10); + processData.call(self, data); + } catch (exception) { + self.emit(EVENT_FAILED); + } + }, function() { + self.emit(EVENT_FAILED); + }); + } + function processData(data) { + var canvas, context, self = this, onLoadMain = function(event) { + canvas = pool && pool.obtain("canvas") || document.createElement("canvas"); + canvas.style.display = "none"; + canvas.width = data.width; + canvas.height = data.height; + context = canvas.getContext("2d"); + context.clearRect(0, 0, data.width, data.height); + context.drawImage(self.element, 0, 0, data.width, data.height); + self.one(DOM_LOAD, onLoadAlpha).setAttribute("src", data.alpha); + return suppressEvent(event); + }, onLoadAlpha = function(event) { + var result; + context.globalCompositeOperation = "xor"; + context.drawImage(self.element, 0, 0, data.width, data.height); + result = canvas.toDataURL("image/png"); + dispose(); + self.emit(EVENT_LOADED, result); + return suppressEvent(event); + }, dispose = function() { + if (canvas) { + canvas.dispose && canvas.dispose(); + } + self.element.dispose && self.element.dispose(); + }; + self.one(DOM_STATE, function(event) { + if (event.type === DOM_LOAD) { + onLoadMain.call(this, event); + } else { + dispose(); + self.emit(EVENT_FAILED); + } + }, false).setAttribute("src", data.main); + } + function suppressEvent(event) { + event.preventDefault(); + event.stopPropagation(); + return false; + } + prototype = modules["dom/element"].extend({ + _constructor: function(element, settings) { + var self = prototype._parent._constructor.call(this, element), foreground, background; + self._settings = settings = modules["function/merge"]({}, defaults, settings); + foreground = self.getAttribute(settings.attribute); + background = self.getStyle("backgroundImage"); + if (self.type === "IMG") { + processMain.call(self, foreground); + } + if (background !== "none" && regexBackground.test(background)) { + processMain.call(self, background, true); + } + return self; + }, + hide: function() { + this.setStyles({ + visibility: "hidden", + opacity: 0 + }); + }, + show: function() { + this.setStyles({ + visibility: "", + opacity: "" + }); + } + }); + loader = modules["dom/element"].extend({ + _url: null, + _constructor: function(url, element) { + var self; + if (!element) { + element = pool && pool.obtain("img") || document.createElement("img"); + } + self = loader._parent._constructor.call(this, element); + self._url = url; + processTransport.call(self, modules["transport/xhr"]); + return self; + } + }); + return prototype; +}, window); \ No newline at end of file diff --git a/dist/latest/max/particle.js b/dist/latest/max/particle.js index 3b5eb9ae..f02775ec 100644 --- a/dist/latest/max/particle.js +++ b/dist/latest/max/particle.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/polyfill/array/indexof.js b/dist/latest/max/polyfill/array/indexof.js index 41730585..2afb5b9f 100644 --- a/dist/latest/max/polyfill/array/indexof.js +++ b/dist/latest/max/polyfill/array/indexof.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/polyfill/document/getelementsbyclassname.js b/dist/latest/max/polyfill/document/getelementsbyclassname.js index 729468bc..fdeb42f3 100644 --- a/dist/latest/max/polyfill/document/getelementsbyclassname.js +++ b/dist/latest/max/polyfill/document/getelementsbyclassname.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/polyfill/document/queryselector.js b/dist/latest/max/polyfill/document/queryselector.js index ccbc9787..e00c3075 100644 --- a/dist/latest/max/polyfill/document/queryselector.js +++ b/dist/latest/max/polyfill/document/queryselector.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/polyfill/document/queryselectorall.js b/dist/latest/max/polyfill/document/queryselectorall.js index e216784c..ad41340d 100644 --- a/dist/latest/max/polyfill/document/queryselectorall.js +++ b/dist/latest/max/polyfill/document/queryselectorall.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/polyfill/element/matches.js b/dist/latest/max/polyfill/element/matches.js index f669210f..d903a8f6 100644 --- a/dist/latest/max/polyfill/element/matches.js +++ b/dist/latest/max/polyfill/element/matches.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/polyfill/object/create.js b/dist/latest/max/polyfill/object/create.js index c29c1c86..a7fd11a5 100644 --- a/dist/latest/max/polyfill/object/create.js +++ b/dist/latest/max/polyfill/object/create.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/polyfill/object/defineproperties.js b/dist/latest/max/polyfill/object/defineproperties.js index 741c2753..162f0f13 100644 --- a/dist/latest/max/polyfill/object/defineproperties.js +++ b/dist/latest/max/polyfill/object/defineproperties.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/polyfill/object/defineproperty.js b/dist/latest/max/polyfill/object/defineproperty.js index 475b0bb6..787e0d92 100644 --- a/dist/latest/max/polyfill/object/defineproperty.js +++ b/dist/latest/max/polyfill/object/defineproperty.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/polyfill/object/getownpropertydescriptor.js b/dist/latest/max/polyfill/object/getownpropertydescriptor.js index 6523c138..0964a9af 100644 --- a/dist/latest/max/polyfill/object/getownpropertydescriptor.js +++ b/dist/latest/max/polyfill/object/getownpropertydescriptor.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/polyfill/object/getownpropertynames.js b/dist/latest/max/polyfill/object/getownpropertynames.js index d10d97c2..f607a993 100644 --- a/dist/latest/max/polyfill/object/getownpropertynames.js +++ b/dist/latest/max/polyfill/object/getownpropertynames.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/polyfill/object/getprototypeof.js b/dist/latest/max/polyfill/object/getprototypeof.js index acea70ab..ffafad37 100644 --- a/dist/latest/max/polyfill/object/getprototypeof.js +++ b/dist/latest/max/polyfill/object/getprototypeof.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/polyfill/object/keys.js b/dist/latest/max/polyfill/object/keys.js index afe1ae8a..33b8cdab 100644 --- a/dist/latest/max/polyfill/object/keys.js +++ b/dist/latest/max/polyfill/object/keys.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/polyfill/string/lcfirst.js b/dist/latest/max/polyfill/string/lcfirst.js index 269b92e0..ee16480d 100644 --- a/dist/latest/max/polyfill/string/lcfirst.js +++ b/dist/latest/max/polyfill/string/lcfirst.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/polyfill/string/trim.js b/dist/latest/max/polyfill/string/trim.js index 7d68cc8f..a1a62723 100644 --- a/dist/latest/max/polyfill/string/trim.js +++ b/dist/latest/max/polyfill/string/trim.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/polyfill/string/ucfirst.js b/dist/latest/max/polyfill/string/ucfirst.js index 82437491..9abb4936 100644 --- a/dist/latest/max/polyfill/string/ucfirst.js +++ b/dist/latest/max/polyfill/string/ucfirst.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/polyfill/window/addeventlistener.js b/dist/latest/max/polyfill/window/addeventlistener.js index 1dc5cbf1..ea8c2972 100644 --- a/dist/latest/max/polyfill/window/addeventlistener.js +++ b/dist/latest/max/polyfill/window/addeventlistener.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/polyfill/window/customevent.js b/dist/latest/max/polyfill/window/customevent.js index 739be3b3..5ddbaea2 100644 --- a/dist/latest/max/polyfill/window/customevent.js +++ b/dist/latest/max/polyfill/window/customevent.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/polyfill/window/dispatchevent.js b/dist/latest/max/polyfill/window/dispatchevent.js index 737fbb45..59ded966 100644 --- a/dist/latest/max/polyfill/window/dispatchevent.js +++ b/dist/latest/max/polyfill/window/dispatchevent.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/polyfill/window/getcomputedstyle.js b/dist/latest/max/polyfill/window/getcomputedstyle.js index b268972b..53242d4f 100644 --- a/dist/latest/max/polyfill/window/getcomputedstyle.js +++ b/dist/latest/max/polyfill/window/getcomputedstyle.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/polyfill/window/matchmedia.js b/dist/latest/max/polyfill/window/matchmedia.js index 2c03a37a..9da78f06 100644 --- a/dist/latest/max/polyfill/window/matchmedia.js +++ b/dist/latest/max/polyfill/window/matchmedia.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/polyfill/window/promise.js b/dist/latest/max/polyfill/window/promise.js index d0304424..bb796f67 100644 --- a/dist/latest/max/polyfill/window/promise.js +++ b/dist/latest/max/polyfill/window/promise.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/polyfill/window/removeeventlistener.js b/dist/latest/max/polyfill/window/removeeventlistener.js index 5550e4ee..34ff20d8 100644 --- a/dist/latest/max/polyfill/window/removeeventlistener.js +++ b/dist/latest/max/polyfill/window/removeeventlistener.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/pool.js b/dist/latest/max/pool.js index 018533dc..d37d993c 100644 --- a/dist/latest/max/pool.js +++ b/dist/latest/max/pool.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/pool/array.js b/dist/latest/max/pool/array.js index 8a68be66..002800db 100644 --- a/dist/latest/max/pool/array.js +++ b/dist/latest/max/pool/array.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/pool/dom.js b/dist/latest/max/pool/dom.js index ed62319c..6880de94 100644 --- a/dist/latest/max/pool/dom.js +++ b/dist/latest/max/pool/dom.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/pool/module.js b/dist/latest/max/pool/module.js index 980fcd78..a47bb7bf 100644 --- a/dist/latest/max/pool/module.js +++ b/dist/latest/max/pool/module.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/pool/object.js b/dist/latest/max/pool/object.js index 88bc1d58..f048f771 100644 --- a/dist/latest/max/pool/object.js +++ b/dist/latest/max/pool/object.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/promise/all.js b/dist/latest/max/promise/all.js index 9685f201..7f9ba391 100644 --- a/dist/latest/max/promise/all.js +++ b/dist/latest/max/promise/all.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/promise/defer.js b/dist/latest/max/promise/defer.js index 57d976cc..0eedf4b5 100644 --- a/dist/latest/max/promise/defer.js +++ b/dist/latest/max/promise/defer.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/promise/race.js b/dist/latest/max/promise/race.js index ca9d269e..5120ee5b 100644 --- a/dist/latest/max/promise/race.js +++ b/dist/latest/max/promise/race.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/proxy.js b/dist/latest/max/proxy.js index 9f37c22f..184cb427 100644 --- a/dist/latest/max/proxy.js +++ b/dist/latest/max/proxy.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/renderer.js b/dist/latest/max/renderer.js index f127e249..f170b7f4 100644 --- a/dist/latest/max/renderer.js +++ b/dist/latest/max/renderer.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/support.js b/dist/latest/max/support.js index 5ae7af94..7ce74e79 100644 --- a/dist/latest/max/support.js +++ b/dist/latest/max/support.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/support/capability/datauri.js b/dist/latest/max/support/capability/datauri.js index 0b594465..04256a7d 100644 --- a/dist/latest/max/support/capability/datauri.js +++ b/dist/latest/max/support/capability/datauri.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/support/capability/touch.js b/dist/latest/max/support/capability/touch.js index 960393e4..98cf2f6f 100644 --- a/dist/latest/max/support/capability/touch.js +++ b/dist/latest/max/support/capability/touch.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/support/css/borderradius.js b/dist/latest/max/support/css/borderradius.js index 2532c163..81f74e1d 100644 --- a/dist/latest/max/support/css/borderradius.js +++ b/dist/latest/max/support/css/borderradius.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/support/css/boxshadow.js b/dist/latest/max/support/css/boxshadow.js index 3f67e2f5..80ee4479 100644 --- a/dist/latest/max/support/css/boxshadow.js +++ b/dist/latest/max/support/css/boxshadow.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/support/css/rem.js b/dist/latest/max/support/css/rem.js index da54a0bb..535825d0 100644 --- a/dist/latest/max/support/css/rem.js +++ b/dist/latest/max/support/css/rem.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/support/css/rgba.js b/dist/latest/max/support/css/rgba.js index 561ea118..0834c3ed 100644 --- a/dist/latest/max/support/css/rgba.js +++ b/dist/latest/max/support/css/rgba.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/support/css/textshadow.js b/dist/latest/max/support/css/textshadow.js index e9bc284c..f9e6b917 100644 --- a/dist/latest/max/support/css/textshadow.js +++ b/dist/latest/max/support/css/textshadow.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/support/css/transform.js b/dist/latest/max/support/css/transform.js index 6393d0bf..fa94134f 100644 --- a/dist/latest/max/support/css/transform.js +++ b/dist/latest/max/support/css/transform.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/support/css/transform/2d.js b/dist/latest/max/support/css/transform/2d.js index ed711feb..227e0723 100644 --- a/dist/latest/max/support/css/transform/2d.js +++ b/dist/latest/max/support/css/transform/2d.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/support/css/transform/3d.js b/dist/latest/max/support/css/transform/3d.js index 50076efa..c20e63dd 100644 --- a/dist/latest/max/support/css/transform/3d.js +++ b/dist/latest/max/support/css/transform/3d.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/support/css/transition.js b/dist/latest/max/support/css/transition.js index 2fee1bf4..8f1b1ffb 100644 --- a/dist/latest/max/support/css/transition.js +++ b/dist/latest/max/support/css/transition.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/support/element/canvas.js b/dist/latest/max/support/element/canvas.js index 559352b2..20e6bd68 100644 --- a/dist/latest/max/support/element/canvas.js +++ b/dist/latest/max/support/element/canvas.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/support/element/canvas/todataurl.js b/dist/latest/max/support/element/canvas/todataurl.js index b099a769..83ee9835 100644 --- a/dist/latest/max/support/element/canvas/todataurl.js +++ b/dist/latest/max/support/element/canvas/todataurl.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/support/element/canvas/todataurl/jpeg.js b/dist/latest/max/support/element/canvas/todataurl/jpeg.js index d3c1fe16..c02f8537 100644 --- a/dist/latest/max/support/element/canvas/todataurl/jpeg.js +++ b/dist/latest/max/support/element/canvas/todataurl/jpeg.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/support/element/canvas/todataurl/png.js b/dist/latest/max/support/element/canvas/todataurl/png.js index 5635ebb4..cddf0c6f 100644 --- a/dist/latest/max/support/element/canvas/todataurl/png.js +++ b/dist/latest/max/support/element/canvas/todataurl/png.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/support/element/canvas/todataurl/webp.js b/dist/latest/max/support/element/canvas/todataurl/webp.js index bd240998..ac0e910c 100644 --- a/dist/latest/max/support/element/canvas/todataurl/webp.js +++ b/dist/latest/max/support/element/canvas/todataurl/webp.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/support/element/svg.js b/dist/latest/max/support/element/svg.js index 84c645b3..9fffe4b8 100644 --- a/dist/latest/max/support/element/svg.js +++ b/dist/latest/max/support/element/svg.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/support/element/video.js b/dist/latest/max/support/element/video.js index 8380141d..f6dd3884 100644 --- a/dist/latest/max/support/element/video.js +++ b/dist/latest/max/support/element/video.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/support/element/video/mp4.js b/dist/latest/max/support/element/video/mp4.js index 8cba6629..6c724a42 100644 --- a/dist/latest/max/support/element/video/mp4.js +++ b/dist/latest/max/support/element/video/mp4.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/support/element/video/ogg.js b/dist/latest/max/support/element/video/ogg.js index 72db763b..90466fdb 100644 --- a/dist/latest/max/support/element/video/ogg.js +++ b/dist/latest/max/support/element/video/ogg.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/support/element/video/webm.js b/dist/latest/max/support/element/video/webm.js index 2e0dc01a..7106e90a 100644 --- a/dist/latest/max/support/element/video/webm.js +++ b/dist/latest/max/support/element/video/webm.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/transport.js b/dist/latest/max/transport.js index 702a770c..85464333 100644 --- a/dist/latest/max/transport.js +++ b/dist/latest/max/transport.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/transport/jsonp.js b/dist/latest/max/transport/jsonp.js index a07cd687..49aaf198 100644 --- a/dist/latest/max/transport/jsonp.js +++ b/dist/latest/max/transport/jsonp.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/transport/xhr.js b/dist/latest/max/transport/xhr.js index 3428856e..09f8c876 100644 --- a/dist/latest/max/transport/xhr.js +++ b/dist/latest/max/transport/xhr.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/url.js b/dist/latest/max/url.js index ae82c83e..6e518ce4 100644 --- a/dist/latest/max/url.js +++ b/dist/latest/max/url.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/vector/2d.js b/dist/latest/max/vector/2d.js index 0186c9d4..e21f36cc 100644 --- a/dist/latest/max/vector/2d.js +++ b/dist/latest/max/vector/2d.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/widget/image/adapt.js b/dist/latest/max/widget/image/adapt.js index 51b9c5bb..778c64c4 100644 --- a/dist/latest/max/widget/image/adapt.js +++ b/dist/latest/max/widget/image/adapt.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/max/worker.js b/dist/latest/max/worker.js index 414c0e66..3ff54101 100644 --- a/dist/latest/max/worker.js +++ b/dist/latest/max/worker.js @@ -1,7 +1,7 @@ /*! * Qoopido.js library * -* version: 3.7.2 +* version: 3.7.3 * date: 2015-08-05 * author: Dirk Lueth * website: https://github.com/dlueth/qoopido.js diff --git a/dist/latest/min/asset.js b/dist/latest/min/asset.js index e8217324..4ec29304 100644 --- a/dist/latest/min/asset.js +++ b/dist/latest/min/asset.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("asset",e,["./emitter","./transport/xhr","./promise/defer","./function/unique/uuid"])}(function(e,o,t,r,n,i,u){"use strict";function a(e){m.push(e),1===m.length&&c()}function c(){l(m[0]).then(function(){m.splice(0,1)&&m.length>=1&&c()},function(){m.splice(0,1)&&m.length>=1&&c()})}function l(e){var o=d[e._uuid],t=o.dfd,r=o.url;return v.get(r,null,f).then(function(n){var u=n.data,a=o.id,c=o.version,l=o.storage;e.emit("loaded",r,a,c,u),l&&(i.cookie=o.cookie+"="+encodeURIComponent(c)+"; expires=Fri, 31 Dec 9999 23:59:59 GMT; path=/",localStorage[l.version]=c,localStorage[l.value]=u,e.emit("stored",r,a,c,u,l.version,l.value)),t.resolve(localStorage[l.value])},function(){t.reject()})}var s,d={},v=e["transport/xhr"],f={cache:!0},g=e["promise/defer"],p=e["function/unique/uuid"],h=new RegExp("/","g"),m=[];return s=e.emitter.extend({_uuid:null,_constructor:function(e,o,t){var r=s._parent._constructor.call(this),n=p(),i=d[n]={dfd:new g,url:e};return r._uuid=n,o&&t&&(i.id=o,i.version=t,i.cookie=encodeURIComponent("qoopido[asset]["+o.replace(h,"][")+"]"),i.storage={version:"@"+o,value:"©"+o}),r},fetch:function(){var e=this,o=d[e._uuid],t=o.dfd,r=o.url,n=o.id,i=o.version,u=o.storage,c=u&&u.version&&localStorage[u.version];if(c&&c>=i){var l=localStorage[o.storage.value];e.emit("hit",r,n,i,l),t.resolve(l)}else e.emit("miss",r,n,i),a(e);return t.promise},clear:function(){var e=this,o=d[e._uuid],t=o.storage;return t&&(i.cookie=o.cookie+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/",delete localStorage[t.version],delete localStorage[t.value],e.emit("cleared",o.url,o.id,o.version)),e}})},window,document); \ No newline at end of file diff --git a/dist/latest/min/base.js b/dist/latest/min/base.js index 9dcc288a..b0b475eb 100644 --- a/dist/latest/min/base.js +++ b/dist/latest/min/base.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ -!function(e,t,r,o,n,c){"use strict";function i(e,t,i,u){var s,f=e.split("/");return d[e]?d[e]:(s=function(){if(i)for(var s,g,y=f.slice(0,-1).join("/"),j=0;(s=i[j])!==c;j++)g=l.test(s),g&&(s=p(y+"/"+s)),!d[s]&&arguments[j]&&(d[s]=arguments[j]),g&&!d[s]&&"undefined"!=typeof console&&console.error("".concat("[Qoopido.js] ",e,": Could not load dependency ",s));return d[e]=t(d,a,f,r,o,n,c),u&&u(d[e]),d[e]},void("undefined"!=typeof module&&module.exports?module.exports=define(s):"function"==typeof define&&define.amd?i?define(i,s):define(s):s()))}function u(e,t,r){i(e,t,r,function(t){d[e]=t.create()})}function p(e){for(var t;(t=e.replace(g,""))!==e;)e=t;return e.replace(y,"")}var s=t.qoopido||(t.qoopido={register:i,registerSingleton:u}),a=s.shared||(s.shared={}),d=s.modules||(s.modules={}),f=[],l=new RegExp("^\\.+\\/"),g=new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."),y=new RegExp("(^\\/)|\\.\\/","g");Object.create||f.push("./polyfill/object/create"),Object.getOwnPropertyNames||f.push("./polyfill/object/getownpropertynames"),Object.getOwnPropertyDescriptor&&function(){try{return Object.getOwnPropertyDescriptor({x:0},"x"),!0}catch(e){return!1}}()||f.push("./polyfill/object/getownpropertydescriptor"),i("base",e,f)}(function(e,t,r,o,n,c,i){"use strict";function u(e){for(var t,r={},o=Object.getOwnPropertyNames(e),n=0;(t=o[n])!==i;n++)r[t]=Object.getOwnPropertyDescriptor(e,t);return r}function p(){throw new Error("[Qoopido.js] Operation prohibited")}return{create:function(){var e,t=Object.create(this,u(this));return t._constructor&&(e=t._constructor.apply(t,arguments)),t.create=t.extend=p,e||t},extend:function(e,t){var r;return e=e||{},t=t===!0,e._parent=this,r=Object.create(this,u(e)),t===!0&&(r.extend=p),r}}},this,navigator,window,document); \ No newline at end of file +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +!function(e,t,r,o,n){"use strict";function c(e,c,i,p){var d,l=e.split("/");return a[e]?a[e]:(d=function(){if(i)for(var d,g,y=l.slice(0,-1).join("/"),j=0;(d=i[j])!==n;j++)g=f.test(d),g&&(d=u(y+"/"+d)),!a[d]&&arguments[j]&&(a[d]=arguments[j]),g&&!a[d]&&"undefined"!=typeof console&&console.error("".concat("[Qoopido.js] ",e,": Could not load dependency ",d));return a[e]=c(a,s,l,t,r,o,n),p&&p(a[e]),a[e]},void("undefined"!=typeof module&&module.exports?module.exports=define(d):"function"==typeof define&&define.amd?i?define(i,d):define(d):d()))}function i(e,t,r){c(e,t,r,function(t){a[e]=t.create()})}function u(e){for(var t;(t=e.replace(l,""))!==e;)e=t;return e.replace(g,"")}var p=r.qoopido||(r.qoopido={}),s=p.shared||(p.shared={}),a=p.modules||(p.modules={}),d=[],f=new RegExp("^\\.+\\/"),l=new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."),g=new RegExp("(^\\/)|\\.\\/","g");p.register=c,p.registerSingleton=i,Object.create||d.push("./polyfill/object/create"),Object.getOwnPropertyNames||d.push("./polyfill/object/getownpropertynames"),Object.getOwnPropertyDescriptor&&function(){try{return Object.getOwnPropertyDescriptor({x:0},"x"),!0}catch(e){return!1}}()||d.push("./polyfill/object/getownpropertydescriptor"),c("base",e,d)}(function(e,t,r,o,n,c,i){"use strict";function u(e){for(var t,r={},o=Object.getOwnPropertyNames(e),n=0;(t=o[n])!==i;n++)r[t]=Object.getOwnPropertyDescriptor(e,t);return r}function p(){throw new Error("[Qoopido.js] Operation prohibited")}return{create:function(){var e,t=Object.create(this,u(this));return t._constructor&&(e=t._constructor.apply(t,arguments)),t.create=t.extend=p,e||t},extend:function(e,t){var r;return e=e||{},t=t===!0,e._parent=this,r=Object.create(this,u(e)),t===!0&&(r.extend=p),r}}},navigator,this,document); \ No newline at end of file diff --git a/dist/latest/min/component/iterator.js b/dist/latest/min/component/iterator.js index a831e584..21f42cf0 100644 --- a/dist/latest/min/component/iterator.js +++ b/dist/latest/min/component/iterator.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){window.qoopido.register("component/iterator",t,["../emitter","../function/merge"])}(function(t,e,n,s,a,i,r){"use strict";var u,l={loop:!0,initial:0};return u=t.emitter.extend({_settings:null,_state:null,_constructor:function(e,n){var s=u._parent._constructor.call(this);return s._settings=t["function/merge"]({},l,n||{}),s._state={length:null,index:null,item:null,data:null},e!==r&&null!==e&&s.setData(e),s},getState:function(){var t=this;return t._state},setData:function(t){var e=this;return"object"==typeof t&&t.length&&(e._state.data=t,e._state.length=t.length,null!==e._settings.initial&&e.seek(e._settings.initial)),e},getData:function(){var t=this;return t._state.data},getLength:function(){var t=this;return t._state.length},getIndex:function(){var t=this;return t._state.index},getCurrent:function(){var t=this;return t._state.data[t._state.index]||null},getItem:function(t){var e=this;return e._state.data[t]||null},first:function(){var t=this;return t.seek(0)},last:function(){var t=this;return t.seek(t._state.length-1)},previous:function(){var t,e=this;return t=e._settings.loop===!0?(e._state.index-1)%e._state.length:e._state.index-1,t=e._settings.loop===!0&&0>t?e._state.length+t:t,e.seek(t)},next:function(){var t,e=this;return t=e._settings.loop===!0?(e._state.index+1)%e._state.length:e._state.index+1,e.seek(t)},seek:function(t){var e=this;return t=parseInt(t,10),t!==e._state.index&&e._state.data[t]!==r&&(e._state.index=t,e._state.item=e._state.data[t]),e}})}); \ No newline at end of file diff --git a/dist/latest/min/component/remux.js b/dist/latest/min/component/remux.js index 542e7509..cc011a06 100644 --- a/dist/latest/min/component/remux.js +++ b/dist/latest/min/component/remux.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){window.qoopido.registerSingleton("component/remux",t,["../emitter","./sense"])}(function(t,n,e,i,o,a,u){"use strict";function r(t,n){var e=this;return t&&n&&(c.className=t,c.style.fontSize=n+"px",d.layout=t,d.fontsize=n,(h.fontsize!==d.fontsize||h.layout!==d.layout)&&(d.ratio.device=o.devicePixelRatio||1,d.ratio.fontsize=d.fontsize/f,d.ratio.total=d.ratio.device*d.ratio.fontsize,h.layout!==d.layout&&e.emit("layoutchanged",d),h.fontsize!==d.fontsize&&e.emit("fontsizechanged",d),e.emit("statechanged",d),h.fontsize=d.fontsize,h.layout=d.layout)),e}function s(n,e,i){var a=this;o.setTimeout(function(){t["component/sense"].create(n).on("matched",function(){r.call(a,e,i)})},0)}var l,c=a.getElementsByTagName("html")[0],f=16,d={fontsize:null,layout:null,ratio:{}},h={fontsize:null,layout:null};return l=t.emitter.extend({_constructor:function(){var t=l._parent._constructor.call(this),n=parseInt(c.getAttribute("data-base"),10);return isNaN(n)===!1&&(f=n),t},getState:function(){return d},getLayout:function(){return d.layout},getFontsize:function(){return d.fontsize},setLayout:function(t,n){var e=this;return r.call(e,t,n),e},addLayout:function(t,n){var e,i,o,a,u,r,l,c,d=this;arguments.length>1?(e={},e[t]=n):e=arguments[0];for(i in e)for(o=e[i],a=o.min;a<=o.max;a++)l=Math.round(o.width*(a/f)),c=Math.round(o.width*((a+1)/f))-1,s.call(d,"screen and (min-width: "+l+"px) and (max-width: "+c+"px )",i,a),u=!u||l=r.width?{width:c,fontsize:a,layout:i}:r;return s.call(d,"screen and (max-width: "+(u.width-1)+"px)",u.layout,u.fontsize),s.call(d,"screen and (min-width: "+(r.width+1)+"px)",r.layout,r.fontsize),d}})}); \ No newline at end of file diff --git a/dist/latest/min/component/sense.js b/dist/latest/min/component/sense.js index c39ef8a7..5bbf020d 100644 --- a/dist/latest/min/component/sense.js +++ b/dist/latest/min/component/sense.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){var e=["../emitter"];window.matchMedia||e.push("../polyfill/window/matchmedia"),window.qoopido.register("component/sense",t,e)}(function(t,e,n,i,c,r,o){"use strict";function a(){var t=this,e=t.mql;t.emit(e.matches===!0?"matched":"dematched")}var m,s={};return m=t.emitter.extend({mql:null,_constructor:function(t){var e=m._parent._constructor.call(this),n=e.mql=s[t]||(s[t]=c.matchMedia(t)),i=function(){a.call(e)};return n.addListener(i),c.setTimeout(i,0),e},matches:function(){return this.mql.matches}})}); \ No newline at end of file diff --git a/dist/latest/min/dom/collection.js b/dist/latest/min/dom/collection.js index a2e321ea..e15ba178 100644 --- a/dist/latest/min/dom/collection.js +++ b/dist/latest/min/dom/collection.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("dom/collection",e,["../base","./element"])}(function(e,t,n,r,l,o,s){"use strict";function i(){for(var e,t=this,n=t.elements,r=o.createDocumentFragment(),l=0;(e=n[l])!==s;l++)r.appendChild(e.element);return r}function c(e){for(var t,n=this,r=n.elements,l=Array.prototype.slice.call(arguments,1),o=0;(t=r[o])!==s;o++)t[e].apply(t,l);return n}function a(e,t){var n=this;return e=e&&e.element?e:p&&p.obtain(e)||u.create(e),e&&(e[t].call(e,i.call(n)),e.dispose&&e.dispose()),n}var u=e["dom/element"],p=e["pool/module"]&&e["pool/module"].create(u,null,!0)||null;return e.base.extend({elements:null,_constructor:function(e,t,n){var r,l,i,c,a=this;if(a.elements=[],e&&"string"==typeof e)for(r=e.split(","),e=[],i=0;(l=r[i])!==s;i++)try{e=e.concat(Array.prototype.slice.call(o.querySelectorAll(l)))}catch(f){}for(i=0;(c=e[i])!==s;i++)a.elements.push(p&&p.obtain(c)||u.create(c));return"object"==typeof t&&null!==t&&a.setAttributes(t),"object"==typeof n&&null!==n&&a.setStyles(n),a},get:function(e){return this.elements[e]||null},each:function(e){for(var t,n=this,r=n.elements,l=0;(t=r[l])!==s;l++)e.call(t,l);return n},setAttribute:function(e,t){return c.call(this,"setAttribute",e,t)},setAttributes:function(e){return c.call(this,"setAttributes",e)},removeAttribute:function(e){return c.call(this,"removeAttribute",e)},removeAttributes:function(e){return c.call(this,"removeAttributes",e)},setStyle:function(e,t){return c.call(this,"setStyle",e,t)},setStyles:function(e){return c.call(this,"setStyles",e)},removeStyle:function(e){return c.call(this,"removeStyle",e)},removeStyles:function(e){return c.call(this,"removeStyles",e)},addClass:function(e){return c.call(this,"addClass",e)},removeClass:function(e){return c.call(this,"removeClass",e)},toggleClass:function(e){return c.call(this,"toggleClass",e)},prependTo:function(e){return a.call(this,e,"prepend")},appendTo:function(e){return a.call(this,e,"append")},insertBefore:function(e){var t=this;return e=e&&e.element?e:p&&p.obtain(e)||u.create(e),e&&(e.element.parentNode.insertBefore(i.call(t),e.element),e.dispose&&e.dispose()),t},insertAfter:function(e){var t=this;return e=e&&e.element?e:p&&p.obtain(e)||u.create(e),e&&(e.element.nextSibling?e.element.parentNode.insertBefore(i.call(t),e.element.nextSibling):e.element.appendChild(i.call(t)),e.dispose&&e.dispose()),t},replace:function(e){for(var t,n=this,r=n.elements,l=0;(t=r[l])!==s;l++)0===l?t.replace(e):t.insertAfter(r[l-1]);return n},hide:function(){return c.call(this,"hide")},show:function(){return c.call(this,"show")},remove:function(e){var t,n,r=this,l=r.elements;if(!e&&0!==e||(n=r.elements[e])===s)for(t=l.length-1;(n=l[t])!==s;t--)n.remove(),n.dispose&&n.dispose(),l.pop();else n.remove(),n.dispose&&n.dispose(),l.splice(e,1);return r},on:function(){return c.apply(this,["on"].concat(Array.prototype.slice.call(arguments)))},one:function(e){return c.apply(this,["one"].concat(Array.prototype.slice.call(arguments)))},off:function(e,t){return c.apply(this,["off"].concat(Array.prototype.slice.call(arguments)))},emit:function(e,t){return c.apply(this,["emit"].concat(Array.prototype.slice.call(arguments)))}})}); \ No newline at end of file diff --git a/dist/latest/min/dom/element.js b/dist/latest/min/dom/element.js index 88f1f57c..01884a71 100644 --- a/dist/latest/min/dom/element.js +++ b/dist/latest/min/dom/element.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){var t=["../base","../function/unique/uuid","../hook/css","./event"];window.CustomEvent||t.push("../polyfill/window/customevent"),window.addEventListener||t.push("../polyfill/window/addeventlistener"),window.removeEventListener||t.push("../polyfill/window/removeeventlistener"),window.dispatchEvent||t.push("../polyfill/window/dispatchevent"),Element.prototype.matches||t.push("../polyfill/element/matches"),document.querySelector||t.push("../polyfill/document/queryselector"),document.querySelectorAll||t.push("../polyfill/document/queryselectorall"),String.prototype.trim||t.push("../polyfill/string/trim"),window.qoopido.register("dom/element",e,t)}(function(e,t,n,r,i,o,s){"use strict";function l(e){var t,n,r;for(t in q)n=q[t],(!n.regex||n.regex.test(e))&&(r=n);return r}function u(e,t,n){var r=this,i=l(e),s=o.createEvent(i.type);s[i.method](e,"load"===e?!1:!0,!0,t),n&&(s._quid=n,s.isDelegate=!0),r.element.dispatchEvent(s)}function a(e){var t;if("string"==typeof e)try{b.test(e)===!0?(t=e.replace(b,"$1").toLowerCase(),e=o.createElement(t)):e=o.querySelector(e)}catch(n){e=null}if(!e)throw new Error("[Qoopido.js] Element could not be resolved");return e}function c(e){return Array.prototype.concat.apply([],Array.prototype.splice.call(e,0)).join(" ").split(w)}function f(e,t){for(var n,r=0;(n=e.path[r])!==s;r++){if(n.matches(t))return e.currentTarget=n,!0;if(n===e.currentTarget)break}return!1}var m="object",p="string",d=e["function/unique/uuid"],h=o.getElementsByTagName("head")[0],v="textContent"in o.createElement("a")?"textContent":"innerText",g="undefined"!=typeof h.previousElementSibling?function(){return this.previousElementSibling}:function(){for(var e=this;e=e.previousSibling;)if(1===e.nodeType)return e},y="undefined"!=typeof h.nextElementSibling?function(){return this.nextElementSibling}:function(){for(var e=this;e=e.nextSibling;)if(1===e.nodeType)return e},b=new RegExp("^<(\\w+)\\s*/>$"),E=new RegExp("^[^-]+"),w=new RegExp(" +","g"),S=e["pool/module"]&&e["pool/module"].create(e["dom/event"],null,!0)||null,C=e["hook/css"],A={},q={custom:{type:"CustomEvent",method:"initCustomEvent"},html:{regex:new RegExp("^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$"),type:"HTMLEvents",method:"initEvent"},mouse:{regex:new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"),type:"MouseEvents",method:"initMouseEvent"}};return e.base.extend({type:null,element:null,_listener:null,_constructor:function(e,t,n){var r,i=this;return e=a(e),r=e._quid,r?i=A[r]:(r=e._quid=d(),i.type=e.tagName,i.element=e,i._listener={},A[r]=i),"object"==typeof t&&null!==t&&i.setAttributes(t),"object"==typeof n&&null!==n&&i.setStyles(n),i!==this&&this.dispose&&this.dispose(),i},_obtain:function(e,t,n){this._constructor(e,t,n)},_dispose:function(){var e,t,n=this;for(e in n._listener)t=e.match(E),n.element.removeEventListener(t,n._listener[e]),delete n._listener[e];n.type=null,n.element=null},getContent:function(e){var t=this.element;return e&&e!==!1?t.innerHTML:t[v]},setContent:function(e,t){var n=this,r=n.element;return t&&t!==!1?r.innerHTML=e:r[v]=e,n},getAttribute:function(e){var t=this;return e&&typeof e===p?t.element.getAttribute(e):void 0},getAttributes:function(){for(var e,t=this,n={},r=c(arguments),i=0;(e=r[i])!==s;i++)n[e]=t.element.getAttribute(e);return n},setAttribute:function(e,t){var n=this;return e&&typeof e===p&&n.element.setAttribute(e,t),n},setAttributes:function(e){var t,n=this;if(e&&typeof e===m&&!e.length)for(t in e)n.element.setAttribute(t,e[t]);return n},removeAttribute:function(e){var t=this;return e&&typeof e===p&&t.element.removeAttribute(e),t},removeAttributes:function(){for(var e,t=this,n=c(arguments),r=0;(e=n[r])!==s;r++)t.element.removeAttribute(e);return t},getStyle:function(e){var t=this;return e&&typeof e===p?C.process("get",t.element,e):void 0},getStyles:function(){for(var e,t=this,n={},r=c(arguments),i=0;(e=r[i])!==s;i++)n[e]=C.process("get",t.element,e);return n},setStyle:function(e,t){var n=this;return e&&typeof e===p&&C.process("set",n.element,e,t),n},setStyles:function(e){var t,n=this;if(e&&typeof e===m&&!e.length)for(t in e)C.process("set",n.element,t,e[t]);return n},removeStyle:function(e){var t=this;return e&&typeof e===p&&t.setStyle(e,""),t},removeStyles:function(){for(var e,t=this,n=c(arguments),r=0;(e=n[r])!==s;r++)t.setStyle(e,"");return t},siblings:function(e){for(var t=this.element,n=t.parentNode.firstChild,r=[];n;n=y.call(n))n===t||e&&!n.matches(e)||r.push(n);return r},siblingsBefore:function(e){for(var t=this.element.previousSibling,n=[];t;t=g.call(t))(!e||t.matches(e))&&n.push(t);return n},siblingsAfter:function(e){for(var t=this.element.nextSibling,n=[];t;t=y.call(t))(!e||t.matches(e))&&n.push(t);return n},previous:function(e){var t=g.call(this.element);if(!e)return t;for(;t;t=g.call(t))if(t.matches(e))return t},next:function(e){var t=y.call(this.element);if(!e)return t;for(;t;t=y.call(t))if(t.matches(e))return t},find:function(e){var t,n,r=this.element;return e=e.trim(),">"===e.charAt(0)?(t=r._quid,r.setAttribute("data-quid",t),e='[data-quid="'+t+'"] '+e,n=r.parentNode.querySelectorAll(e),r.removeAttribute("data-quid")):n=r.querySelectorAll(e),n},parent:function(e){var t;if(!e)return this.element.parentNode;for(t=this.element;t;t=t.parentNode)if(t.matches(e))return t},parents:function(e){for(var t=this.element.parentNode,n=[];t;t=t.parentNode){if(9===t.nodeType)return n;1===t.nodeType&&(!e||t.matches(e))&&n.push(t)}},isVisible:function(){var e=this,t=e.element;return!(t.offsetWidth<=0&&t.offsetHeight<=0||"hidden"===e.getStyle("visibility")||e.getStyle("opacity")<=0)},hasClass:function(e){return e?new RegExp("(?:^|\\s)"+e+"(?:\\s|$)").test(this.element.className):!1},addClass:function(e){var t=this;return e&&!t.hasClass(e)&&(t.element.className+=t.element.className?" "+e:e),t},removeClass:function(e){var t=this;return e&&t.hasClass(e)&&(t.element.className=t.element.className.replace(new RegExp("(?:^|\\s)"+e+"(?!\\S)"),"")),t},toggleClass:function(e){var t=this;return e&&(t.hasClass(e)?t.removeClass(e):t.addClass(e)),t},prepend:function(e){var t=this,n=t.element;if(e)try{e=e.element||a(e),n.firstChild?n.insertBefore(e,n.firstChild):t.append(e)}catch(r){n.insertAdjacentHTML("afterBegin",e)}return t},append:function(e){var t=this,n=t.element;if(e)try{n.appendChild(e.element||a(e))}catch(r){n.insertAdjacentHTML("beforeEnd",e)}return t},prependTo:function(e){var t=this,n=t.element;return e&&((e=e.element||a(e)).firstChild?e.insertBefore(n,e.firstChild):t.appendTo(e)),t},appendTo:function(e){var t=this;return e&&(e.element||a(e)).appendChild(t.element),t},insertBefore:function(e){var t=this,n=t.element;return e&&(e=e.element||a(e)).parentNode.insertBefore(n,e),t},insertAfter:function(e){var t=this,n=t.element;return e&&((e=e.element||a(e)).nextSibling?e.parentNode.insertBefore(n,e.nextSibling):t.appendTo(e.parentNode)),t},replace:function(e){var t=this,n=t.element;return e&&(e=e.element||a(e)).parentNode.replaceChild(n,e),t},replaceWith:function(e){var t=this,n=t.element;return e&&(e=e.element||a(e),n.parentNode.replaceChild(e,n)),t},remove:function(){var e=this,t=e.element;return t.parentNode.removeChild(t),e},on:function(t){var n,r=this,i=r.element,o=arguments.length>2?arguments[1]:null,l=arguments.length>2?arguments[2]:arguments[1],a=l._quid||(l._quid=d()),c=0;for(t=t.split(" ");(n=t[c])!==s;c++){var m=n+"-"+a,p=function(t){var n;t=S&&S.obtain(t)||e["dom/event"].create(t),t.isPropagationStopped||(n=t.delegate,t._quid=d(),(!o||f(t,o))&&l.call(t.currentTarget,t,t.originalEvent.detail),n&&(delete t.delegate,u.call(r,n))),t.dispose&&t.dispose()};p.type=n,r._listener[m]=p,i.addEventListener(n,p)}return r},one:function(e){var t=this,n=arguments.length>3||"string"==typeof arguments[1]?arguments[1]:null,r=arguments.length>3||"function"==typeof arguments[2]?arguments[2]:arguments[1],i=(arguments.length>3?arguments[3]:arguments[2])!==!1,o=function(n){t.off(i===!0?n.type:e,o),r.call(this,n,n.originalEvent.detail)};return r._quid=o._quid=d(),n?t.on(e,n,o):t.on(e,o),t},off:function(e,t){var n,r,i,o=this,l=o.element,u=0;for(e=e.split(" ");(n=e[u])!==s;u++)r=t._quid&&n+"-"+t._quid||null,i=r&&o._listener[r]||null,i?(l.removeEventListener(n,i),delete o._listener[r]):l.removeEventListener(n,t);return o},emit:function(e,t){var n=this;return u.call(n,e,t),n}})}); \ No newline at end of file diff --git a/dist/latest/min/dom/element/emerge.js b/dist/latest/min/dom/element/emerge.js index f2b2056b..cbc1a847 100644 --- a/dist/latest/min/dom/element/emerge.js +++ b/dist/latest/min/dom/element/emerge.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){window.qoopido.register("dom/element/emerge",t,["../element","../../function/merge","../../function/unique/uuid"])}(function(t,e,i,o,r,n,l){"use strict";function p(t){var e,i=d[t];for(e in i)"length"!==e&&g.call(i[e]);0===i.length&&(r.element.clearInterval(c[t]),delete c[t])}function s(){a.left=0,a.top=0,a.right=r.innerWidth||m.clientWidth,a.bottom=r.innerHeight||m.clientHeight}function h(){var t=this,e=t._settings.threshold,i=e!==l?e:m.clientWidth*t._settings.auto,o=e!==l?e:m.clientHeight*t._settings.auto;t._viewport.left=a.left-i,t._viewport.top=a.top-o,t._viewport.right=a.right+i,t._viewport.bottom=a.bottom+o}function g(){var t,e=this,i=!1,o=2;!e.isVisible()||"hidden"===e.getStyle("visibility")&&e._settings.visibility!==!1||(t=e.element.getBoundingClientRect(),(t.bottom>=e._viewport.top&&t.bottom<=e._viewport.bottom||t.top>=e._viewport.top&&t.top<=e._viewport.bottom||e._viewport.bottom>=t.top&&e._viewport.bottom<=t.bottom||e._viewport.top>=t.top&&e._viewport.top<=t.bottom)&&(t.left>=e._viewport.left&&t.left<=e._viewport.right||t.right>=e._viewport.left&&t.right<=e._viewport.right||e._viewport.left>=t.left&&e._viewport.left<=t.right||e._viewport.right>=t.left&&e._viewport.right<=t.right)&&((0===e._settings.threshold||(t.bottom>=a.top&&t.bottom<=a.bottom||t.top>=a.top&&t.top<=a.bottom||a.bottom>=t.top&&a.bottom<=t.bottom||a.top>=t.top&&a.top<=t.bottom)&&(t.left>=a.left&&t.left<=a.right||t.right>=a.left&&t.right<=a.right||a.left>=t.left&&a.left<=t.right||a.right>=t.left&&a.right<=t.right))&&(o=1),i=!0)),(i!==e._state||i===!0&&o!==e._priority)&&u.call(e,i,o)}function u(t,e){var i=this;i._state=t,i._priority=e,i._settings.recur!==!0&&i.remove(),t===!0?i.emit(f,e):i.emit(w)}var v,_={interval:50,threshold:"auto",recur:!0,auto:1,visibility:!0},m=r.document.documentElement,a={},c={},d={},f="emerged",w="demerged",b="resize orientationchange";if(r=t["dom/element"].create(r),"CSS1Compat"!==n.compatMode)throw"[Qoopido.js] Not in standards mode";return v=t["dom/element"].extend({_quid:null,_viewport:null,_settings:null,_state:null,_priority:null,_constructor:function(e,i){var o=v._parent._constructor.call(this,e);return i=t["function/merge"]({},_,i||{}),"auto"===i.threshold&&delete i.threshold,c[i.interval]===l&&(d[i.interval]=d[i.interval]||{length:0},c[i.interval]=r.element.setInterval(function(){p(i.interval)},i.interval)),o._quid=t["function/unique/uuid"](),o._viewport={},o._settings=i,o._state=!1,o._priority=2,d[i.interval][o._quid]=o,d[i.interval].length++,r.on(b,function(){h.call(o)}),h.call(o),o},remove:function(){var t=this;delete d[t._settings.interval][t._quid],d[t._settings.interval].length--}}),r.on(b,s),s(),v}); \ No newline at end of file diff --git a/dist/latest/min/dom/element/lazyimage.js b/dist/latest/min/dom/element/lazyimage.js index 50c74290..02751eed 100644 --- a/dist/latest/min/dom/element/lazyimage.js +++ b/dist/latest/min/dom/element/lazyimage.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("dom/element/lazyimage",e,["./emerge","../../function/merge"])}(function(e,t,r,n,o,i,a){"use strict";function u(){var e=this,t=e._settings.attribute;d+=1,e.emit(l).one(h,function(t){e.emit(t.type===v?s:f),d-=1},!1).setAttribute("src",e.getAttribute(t)).removeAttribute(t)}var c,m={interval:50,threshold:"auto",attribute:"data-lazyimage"},d=0,l="requested",s="loaded",f="failed",g="emerged",v="load",b="error",h="".concat(v," ",b);return c=e["dom/element/emerge"].extend({_constructor:function(t,r){var n=c._parent._constructor.call(this,t,e["function/merge"]({},m,r||{}));return n.on(g,function o(e){(0===d||1===e.data)&&(n.remove(),n.off(g,o),u.call(n))}),n}})}); \ No newline at end of file diff --git a/dist/latest/min/dom/element/shrinkimage.js b/dist/latest/min/dom/element/shrinkimage.js index 4d1c32f4..757ecbc0 100644 --- a/dist/latest/min/dom/element/shrinkimage.js +++ b/dist/latest/min/dom/element/shrinkimage.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){var e=["../element","../../proxy","../../function/merge","../../url","../../support","../../support/capability/datauri","../../support/element/canvas/todataurl/png","../../transport/xhr"];window.qoopido.register("dom/element/shrinkimage",t,e)}(function(t,e,n,i,a,r,o){"use strict";function l(e,n){e=t.url.resolve(v.exec(e)[1]),n=n===!0;var i=this,a=t["function/merge"]({},i._settings,t.url.getParameter(e)),r=a.target||(e=e.split("?")[0]).replace(x,"".concat(".q",a.quality,".shrunk"));n||i.removeAttribute(i._settings.attribute).hide(),_.then(function(){if(a.debug===!0)throw new Error("[Qoopido.js] Debug enabled");switch(typeof w[r]){case"object":w[r].one(E,function(t){c.call(i,t.data,n)}),i.emit(k);break;case"string":c.call(i,w[r],n);break;default:w[r]=h.create(r,n?null:i.element).one(A,function(t,a){t.type===E?(w[r]=a,i.emit(I),c.call(i,a,n)):(w[r]=e,c.call(i,e,n))},!1)}})["catch"](function(){w[r]=e,c.call(i,e,n)})}function c(t,e){var n=this;e?(n.setStyle("backgroundImage","url("+t+")"),n.emit(E)):n.one(R,function(){n.show(),n.emit(E)}).setAttribute("src",t)}function u(t){var e=this;t.get(e._url).then(function(t){try{var n=g.parse(t.data);n.width=parseInt(n.width,10),n.height=parseInt(n.height,10),s.call(e,n)}catch(i){e.emit(q)}},function(){e.emit(q)})}function s(t){var e,n,i=this,a=function(a){return e=b&&b.obtain("canvas")||r.createElement("canvas"),e.style.display="none",e.width=t.width,e.height=t.height,n=e.getContext("2d"),n.clearRect(0,0,t.width,t.height),n.drawImage(i.element,0,0,t.width,t.height),i.one(R,o).setAttribute("src",t.alpha),p(a)},o=function(a){var r;return n.globalCompositeOperation="xor",n.drawImage(i.element,0,0,t.width,t.height),r=e.toDataURL("image/png"),l(),i.emit(E,r),p(a)},l=function(){e&&e.dispose&&e.dispose(),i.element.dispose&&i.element.dispose()};i.one(D,function(t){t.type===R?a.call(this,t):(l(),i.emit(q))},!1).setAttribute("src",t.main)}function p(t){return t.preventDefault(),t.stopPropagation(),!1}var d,h,g=a.JSON,m=n.pop(),f={attribute:"data-"+m,quality:80,debug:!1},b=e.pool&&e.pool.dom||null,w={},y=new RegExp('^url\\x28"{0,1}data:image/shrink,(.+?)"{0,1}\\x29$',"i"),v=new RegExp('^(?:url\\x28"{0,1}|)(?:data:image/shrink,|)(.+?)(?:"{0,1}\\x29|)$',"i"),x=new RegExp("\\.png$","i"),_=t.support.testMultiple("/capability/datauri","/element/canvas/todataurl/png"),k="queued",I="cached",E="loaded",q="failed",A="".concat(E," ",q),R="load",S="error",D="".concat(R," ",S);return d=t["dom/element"].extend({_constructor:function(e,n){var i,a,r=d._parent._constructor.call(this,e);return r._settings=n=t["function/merge"]({},f,n),i=r.getAttribute(n.attribute),a=r.getStyle("backgroundImage"),"IMG"===r.type&&l.call(r,i),"none"!==a&&y.test(a)&&l.call(r,a,!0),r},hide:function(){this.setStyles({visibility:"hidden",opacity:0})},show:function(){this.setStyles({visibility:"",opacity:""})}}),h=t["dom/element"].extend({_url:null,_constructor:function(e,n){var i;return n||(n=b&&b.obtain("img")||r.createElement("img")),i=h._parent._constructor.call(this,n),i._url=e,u.call(i,t["transport/xhr"]),i}}),d},window); \ No newline at end of file diff --git a/dist/latest/min/dom/event.js b/dist/latest/min/dom/event.js index 07030c20..13ec030d 100644 --- a/dist/latest/min/dom/event.js +++ b/dist/latest/min/dom/event.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("dom/event",e,["../base","../hook/event"])}(function(e,t,o,i,n,a,r){"use strict";var p=e["hook/event"];return e.base.extend({originalEvent:null,isDelegate:!1,isDefaultPrevented:!1,isPropagationStopped:!1,isImmediatePropagationStopped:!1,_properties:null,_constructor:function(e){var t=this;return t._properties=[],t._obtain(e),t},_obtain:function(e){p.process(this,e)},_dispose:function(){for(var e,t=this,o=0;(e=t._properties[o])!==r;o++)delete t[e];delete t.delegate,t.originalEvent=null,t.isDelegate=!1,t.isDefaultPrevented=!1,t.isPropagationStopped=!1,t.isImmediatePropagationStopped=!1,t._properties.length=0},preventDefault:function(){var e=this,t=e.originalEvent;t.cancelable!==!1&&(e.isDefaultPrevented=!0,t.preventDefault?t.preventDefault():t.returnValue=!1)},stopPropagation:function(){var e=this,t=e.originalEvent;e.isPropagationStopped=!0,t.stopPropagation&&t.stopPropagation(),t.cancelBubble=!0},stopImmediatePropagation:function(){var e=this,t=e.originalEvent;e.isImmediatePropagationStopped=!0,t.stopImmediatePropagation&&t.stopImmediatePropagation(),e.stopPropagation()}})}); \ No newline at end of file diff --git a/dist/latest/min/emitter.js b/dist/latest/min/emitter.js index 1b174581..5f5611a2 100644 --- a/dist/latest/min/emitter.js +++ b/dist/latest/min/emitter.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("emitter",e,["./base"])}(function(e,t,n,r,i,s,l){"use strict";function o(e,t){var n=t.charAt(0).toUpperCase()+t.slice(1);return e._mapped[t]=e[t],function(){var r,i=Array.prototype.slice.call(arguments);return e.emit.apply(e,["pre"+n,i]),r=e._mapped[t].apply(e,i),e.emit.apply(e,["post"+n,i,r]),r}}var p=/^(_|extend$|create$|on$|one$|off$|emit$|get.+)/;return e.base.extend({_mapped:null,_listener:null,_temp:null,_constructor:function(){var e,t=this;t._mapped={},t._listener={};for(e in t)"function"==typeof t[e]&&p.test(e)===!1&&(t[e]=o(t,e));return t},on:function(e,t){var n,r=this,i=0;for(e=e.split(" ");(n=e[i])!==l;i++)(r._listener[n]=r._listener[n]||[]).push(t);return r},one:function(e,t,n){n=n!==!1;var r=this;return r.on(e,function i(s){r.off(n===!0?s:e,i),t.apply(this,arguments)}),r},off:function(e,t){var n,r,i,s=this,o=0;if(e)for(e=e.split(" ");(n=e[o])!==l;o++)if(s._listener[n]=s._listener[n]||[],t)for(r=0;(i=s._listener[n][r])!==l;r++)i===t&&(s._listener[n].splice(r,1),r--);else s._listener[n].length=0;else for(n in s._listener)s._listener[n].length=0;return s},emit:function(e){var t,n=this,r=0;if(e!==l){for(n._listener[e]=n._listener[e]||[],n._temp=n._listener[e].slice();(t=n._temp[r])!==l;r++)t.apply(n,arguments);n._temp.length=0}return n}})}); \ No newline at end of file diff --git a/dist/latest/min/function/load/css.js b/dist/latest/min/function/load/css.js index d4d785cb..8ed95531 100644 --- a/dist/latest/min/function/load/css.js +++ b/dist/latest/min/function/load/css.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("function/load/css",e)}(function(e,t,n,i,o,r,s){"use strict";var a={};return function(e,t){t=t||"all";var n,i=e+":"+t,s=a[i];return s||(s=a[i]=r.createElement("link"),n=r.getElementsByTagName("script")[0],s.rel="stylesheet",s.media="only x",s.href=e,n.parentNode.insertBefore(s,n),o.setTimeout(function(){s.media=t})),s}},window,document); \ No newline at end of file diff --git a/dist/latest/min/function/merge.js b/dist/latest/min/function/merge.js index 61312fa3..e8aa4f6d 100644 --- a/dist/latest/min/function/merge.js +++ b/dist/latest/min/function/merge.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){window.qoopido.register("function/merge",t)}(function(t,e,n,o,r,u,f){"use strict";return function i(){var t,e,n,o,r,u=arguments[0];for(t=1;(e=arguments[t])!==f;t++)for(n in e)o=u[n],r=e[n],r!==f&&(null!==r&&"object"==typeof r?(o=r.length!==f?o&&"object"==typeof o&&o.length!==f?o:[]:o&&"object"==typeof o&&o.length===f?o:{},u[n]=i(o,r)):u[n]=r);return u}}); \ No newline at end of file diff --git a/dist/latest/min/function/proximity.js b/dist/latest/min/function/proximity.js index 6516299a..a48f03b5 100644 --- a/dist/latest/min/function/proximity.js +++ b/dist/latest/min/function/proximity.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){window.qoopido.register("function/proximity",t)}(function(t,a,o,r,e,y,x){"use strict";return function(t,a){var o=!1;return t="object"==typeof t&&null!==t?t:{x:x,y:x},a="object"==typeof a&&null!==a?a:{x:x,y:x},t.x!==x&&t.y!==x&&a.x!==x&&a.y!==x&&(t.x=parseFloat(t.x),t.y=parseFloat(t.y),a.x=parseFloat(a.x),a.y=parseFloat(a.y),o={x:parseFloat(Math.abs(a.x-t.x)),y:parseFloat(Math.abs(a.y-t.y)),total:parseFloat(Math.sqrt(Math.pow(a.x-t.x,2)+Math.pow(a.y-t.y,2)))}),o}}); \ No newline at end of file diff --git a/dist/latest/min/function/unique/string.js b/dist/latest/min/function/unique/string.js index bd8e2c4b..69ace740 100644 --- a/dist/latest/min/function/unique/string.js +++ b/dist/latest/min/function/unique/string.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(n){window.qoopido.register("function/unique/string",n)}(function(n,t,r,e,i,o,u){"use strict";function f(n){var t="",r=0;for(n=parseInt(n,10)||12;n>r;r++)t+=s[parseInt(Math.random()*(s.length-1),10)];return t}var a={},s="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");return function(n){var t;do t=f(n);while("undefined"!=typeof a[t]);return a[t]=!0,t}}); \ No newline at end of file diff --git a/dist/latest/min/function/unique/uuid.js b/dist/latest/min/function/unique/uuid.js index 75a643d8..82f81223 100644 --- a/dist/latest/min/function/unique/uuid.js +++ b/dist/latest/min/function/unique/uuid.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(x){window.qoopido.register("function/unique/uuid",x)}(function(x,n,r,t,e,u,i){"use strict";function o(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(f,function(x){var n=16*Math.random()|0,r="x"===x?n:3&n|8;return r.toString(16)})}var c={},f=new RegExp("[xy]","g");return function(){var x;do x=o();while("undefined"!=typeof c[x]);return c[x]=!0,x}}); \ No newline at end of file diff --git a/dist/latest/min/hook/css.js b/dist/latest/min/hook/css.js index 211c05a8..16f9a443 100644 --- a/dist/latest/min/hook/css.js +++ b/dist/latest/min/hook/css.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){var e=["../base","../support"];window.getComputedStyle||e.push("../polyfill/window/getcomputedstyle"),window.qoopido.registerSingleton("hook/css",t,e)}(function(t,e,o,n,r,i,l){"use strict";var u=t.support,s=r.getComputedStyle||t["polyfill/window/getcomputedstyle"],p={general:{get:function(t,e){return s(t,null).getPropertyValue(e[0])},set:function(t,e,o){t.style[e[1]]=o}},opacity:u.supportsCssProperty("opacity")?null:{regex:new RegExp("alpha\\(opacity=(.*)\\)","i"),get:function(t,e,o){return o=s(t,null).getPropertyValue("filter").toString().match(this.regex),o=o?o[1]/100:1},set:function(t,e,o){var n=t.style;n.zoom=1,n.filter="alpha(opacity="+(100*o+.5>>0)+")"}}};return t.base.extend({add:function(t,e){return t&&e&&p[t]&&(p[t]=e),this},get:function(t){return t&&p[t]?p[t]:null},process:function(t,e,o,n){var r;return o=u.getCssProperty(o,e)||null,o?((r=this.get(o[1]))&&r[t]||this.get("general")[t])(e,o,n):void 0}})}); \ No newline at end of file diff --git a/dist/latest/min/hook/event.js b/dist/latest/min/hook/event.js index 330fb477..f63199c3 100644 --- a/dist/latest/min/hook/event.js +++ b/dist/latest/min/hook/event.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.registerSingleton("hook/event",e,["../base"])}(function(e,t,r,n,o,a,c){"use strict";function l(e,t,r){for(var n,o=0;(n=r[o])!==c;o++)e[n]=t[n];e._properties=e._properties.concat(r)}var i={general:{properties:"type altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which path".split(" "),process:function(e,t){var r;if(e.originalEvent=t,e.isDefaultPrevented=t.defaultPrevented?!0:!1,e.isPropagationStopped=t.cancelBubble?!0:!1,e.metaKey=t.metaKey&&t.metaKey!==!1?!0:!1,e.target||(e.target=t.srcElement||a),3===e.target.nodeType&&(e.target=e.target.parentNode),!e.path){e.path=[],r=e.target;do e.path.push(r);while(r=r.parentNode);e.path.push(o)}}},mouse:{regex:new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"),properties:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement dataTransfer".split(" "),process:function(e,t){var r,n,o;n=t.fromElement,o=t.button,null===e.pageX&&null!==t.clientX&&(r=e.target.ownerDocument||a,r=r.documentElement||r.body,e.pageX=t.clientX+(r.scrollLeft||0)-(r.clientLeft||0),e.pageY=t.clientY+(r.scrollTop||0)-(r.clientTop||0)),!e.relatedTarget&&n&&(e.relatedTarget=n===e.target?t.toElement:n),e.which||o===c||(e.which=1&o?1:2&o?3:4&o?2:0)}},key:{regex:new RegExp("^(?:key)"),properties:"char charCode key keyCode".split(" "),process:function(e,t){null===e.which&&(e.which=null!==t.charCode?t.charCode:t.keyCode)}}};return e.base.extend({add:function(e,t){return e&&t&&i[e]&&(i[e]=t),this},get:function(e){return e&&i[e]?i[e]:null},process:function(e,t){var r,n,o;for(r in i)n=i[r],o=!n.regex||n.regex.test(t.type),o&&(n.properties&&l(e,t,n.properties),n.process&&n.process(e,t),n.delegate&&(e.delegate=n.delegate))}})}); \ No newline at end of file diff --git a/dist/latest/min/jquery/extension/selector.js b/dist/latest/min/jquery/extension/selector.js index 78326c2a..6a1f512e 100644 --- a/dist/latest/min/jquery/extension/selector.js +++ b/dist/latest/min/jquery/extension/selector.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){window.qoopido.register("jquery/extension/selector",t,["jquery"])}(function(t,e,r,n,o,i,f){"use strict";var u=t.jquery||o.jQuery,s=u(o),h=u(i);return u.extend(u.expr[":"],{loaded:function(t){return u(t).data("loaded")},scrollable:function(t,e,r){return"auto"===u(t).css("overflow")},width:function(t,e,r){return r[3]&&/^(<|>)\d+$/.test(r[3])?">"===r[3].substr(0,1)?u(t).width()>r[3].substr(1):u(t).width())\d+$/.test(r[3])?">"===r[3].substr(0,1)?u(t).height()>r[3].substr(1):u(t).height()r.offset().left+r.width()):!1},external:function(t){return t.href?t.hostname&&t.hostname!==o.location.hostname:!1},inView:function(t){t=u(t);var e=s,r=h,n=t.offset(),o={top:r.scrollTop(),height:r.scrollLeft()};return!(n.top>e.height()+o.top||n.top+t.height()e.width()+o.left||n.left+t.width()r.width()*r.height()):!1},isBold:function(t){return"700"===u(t).css("fontWeight")},color:function(t,e,r){return r[3]?u(t).css("color")===r[3]:!1},hasId:function(t){return t=u(t),t.attr("id")!==f&&""!==t.attr("id")}}),u}); \ No newline at end of file diff --git a/dist/latest/min/jquery/function/prefetch.js b/dist/latest/min/jquery/function/prefetch.js index 36c29d60..3fba30d7 100644 --- a/dist/latest/min/jquery/function/prefetch.js +++ b/dist/latest/min/jquery/function/prefetch.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("jquery/function/prefetch",e,["jquery"])}(function(e,r,n,t,i,u,f){"use strict";var o=e.jquery||i.jQuery,c=o("head"),p=[];return o.prefetch=function(){var e=o.unique(o('a[rel="prefetch"]').removeAttr("rel").map(function(){return o(this).attr("href")}));e.each(function(e,r){-1===o.inArray(r,p)&&(o("",{rel:"prefetch",href:r}).appendTo(c),o("",{rel:"prerender",href:r}).appendTo(c))})},o}); \ No newline at end of file diff --git a/dist/latest/min/jquery/plugin/emerge.js b/dist/latest/min/jquery/plugin/emerge.js index d6240c9f..31ca67c9 100644 --- a/dist/latest/min/jquery/plugin/emerge.js +++ b/dist/latest/min/jquery/plugin/emerge.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("jquery/plugins/emerge",e,["../../dom/element/emerge","jquery"])}(function(e,r,t,n,o,c,i){"use strict";var u,g=e.jquery||o.jQuery,a=t.pop(),d="emerged",m="demerged",s="".concat(d,".",a),f="".concat(m,".",a);return g.fn[a]=function(e){return this.each(function(){u.create(this,e)})},u=e["dom/element/emerge"].extend({_constructor:function(e,r){var t=u._parent._constructor.call(this,e,r),n=g(e);return t.on(d,function(e){n.trigger(s,{priority:e.data})}),t.on(m,function(){n.trigger(f)}),t}})}); \ No newline at end of file diff --git a/dist/latest/min/jquery/plugin/lazyimage.js b/dist/latest/min/jquery/plugin/lazyimage.js index c1908629..73fdf830 100644 --- a/dist/latest/min/jquery/plugin/lazyimage.js +++ b/dist/latest/min/jquery/plugin/lazyimage.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("jquery/plugins/lazyimage",e,["../../dom/element/lazyimage","jquery"])}(function(e,n,t,r,o,i,c){"use strict";var u,a=e.jquery||o.jQuery,s=t.pop(),g="requested",l="loaded",d="".concat(g,".",s),f="".concat(l,".",s);return a.fn[s]=function(e){return this.each(function(){u.create(this,e)})},u=e["dom/element/lazyimage"].extend({_constructor:function(e,n){var t=u._parent._constructor.call(this,e,n),r=a(e);return t.on(g,function(){r.trigger(d)}),t.on(l,function(){r.trigger(f)}),t}})}); \ No newline at end of file diff --git a/dist/latest/min/jquery/plugin/shrinkimage.js b/dist/latest/min/jquery/plugin/shrinkimage.js index 6db8a6e3..cb1cf290 100644 --- a/dist/latest/min/jquery/plugin/shrinkimage.js +++ b/dist/latest/min/jquery/plugin/shrinkimage.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(n){window.qoopido.register("jquery/plugins/shrinkimage",n,["../../dom/element/shrinkimage","jquery"])}(function(n,t,e,r,o,i,c){"use strict";var u,a=n.jquery||o.jQuery,g=e.pop(),s="queued",f="cached",d="loaded",h="failed",l="".concat(s,".",g),m="".concat(f,".",g),p="".concat(d,".",g),q="".concat(h,".",g);return a.fn[g]=function(n){return this.each(function(){u.create(this,n)})},u=n["dom/element/shrinkimage"].extend({_constructor:function(n,t){var e=u._parent._constructor.call(this,n,t),r=a(n);return e.on(s,function(){r.trigger(l)}),e.on(f,function(){r.trigger(m)}),e.on(d,function(){r.trigger(p)}),e.on(h,function(){r.trigger(q)}),e}})}); \ No newline at end of file diff --git a/dist/latest/min/packages/qoopido.base.js b/dist/latest/min/packages/qoopido.base.js new file mode 100644 index 00000000..b0b475eb --- /dev/null +++ b/dist/latest/min/packages/qoopido.base.js @@ -0,0 +1,2 @@ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +!function(e,t,r,o,n){"use strict";function c(e,c,i,p){var d,l=e.split("/");return a[e]?a[e]:(d=function(){if(i)for(var d,g,y=l.slice(0,-1).join("/"),j=0;(d=i[j])!==n;j++)g=f.test(d),g&&(d=u(y+"/"+d)),!a[d]&&arguments[j]&&(a[d]=arguments[j]),g&&!a[d]&&"undefined"!=typeof console&&console.error("".concat("[Qoopido.js] ",e,": Could not load dependency ",d));return a[e]=c(a,s,l,t,r,o,n),p&&p(a[e]),a[e]},void("undefined"!=typeof module&&module.exports?module.exports=define(d):"function"==typeof define&&define.amd?i?define(i,d):define(d):d()))}function i(e,t,r){c(e,t,r,function(t){a[e]=t.create()})}function u(e){for(var t;(t=e.replace(l,""))!==e;)e=t;return e.replace(g,"")}var p=r.qoopido||(r.qoopido={}),s=p.shared||(p.shared={}),a=p.modules||(p.modules={}),d=[],f=new RegExp("^\\.+\\/"),l=new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."),g=new RegExp("(^\\/)|\\.\\/","g");p.register=c,p.registerSingleton=i,Object.create||d.push("./polyfill/object/create"),Object.getOwnPropertyNames||d.push("./polyfill/object/getownpropertynames"),Object.getOwnPropertyDescriptor&&function(){try{return Object.getOwnPropertyDescriptor({x:0},"x"),!0}catch(e){return!1}}()||d.push("./polyfill/object/getownpropertydescriptor"),c("base",e,d)}(function(e,t,r,o,n,c,i){"use strict";function u(e){for(var t,r={},o=Object.getOwnPropertyNames(e),n=0;(t=o[n])!==i;n++)r[t]=Object.getOwnPropertyDescriptor(e,t);return r}function p(){throw new Error("[Qoopido.js] Operation prohibited")}return{create:function(){var e,t=Object.create(this,u(this));return t._constructor&&(e=t._constructor.apply(t,arguments)),t.create=t.extend=p,e||t},extend:function(e,t){var r;return e=e||{},t=t===!0,e._parent=this,r=Object.create(this,u(e)),t===!0&&(r.extend=p),r}}},navigator,this,document); \ No newline at end of file diff --git a/dist/latest/min/packages/qoopido.base.legacy.js b/dist/latest/min/packages/qoopido.base.legacy.js new file mode 100644 index 00000000..cfcbf42a --- /dev/null +++ b/dist/latest/min/packages/qoopido.base.legacy.js @@ -0,0 +1,2 @@ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +!function(e,t){t.register?t.register("polyfill/object/defineproperty",e):(t.modules=t.modules||{})["polyfill/object/defineproperty"]=e()}(function(e,t,r,o,n,i,c){"use strict";if(!Object.defineProperty||!function(){try{return Object.defineProperty({},"x",{}),!0}catch(e){return!1}}()){var p=Object.defineProperty,s=Object.prototype.__defineGetter__,u=Object.prototype.__defineSetter__;Object.defineProperty=function(e,t,r){if(p)try{return p(e,t,r)}catch(o){}if(e!==Object(e))throw new TypeError("Object.defineProperty called on non-object");return s&&"get"in r&&s.call(e,t,r.get),u&&"set"in r&&u.call(e,t,r.set),"value"in r&&(e[t]=r.value),e}}return Object.defineProperty},window.qoopido=window.qoopido||{}),function(e,t){if(t.register){var r=[];Object.defineProperty&&function(){try{return Object.defineProperty({},"x",{}),!0}catch(e){return!1}}()||r.push("./defineproperty"),t.register("polyfill/object/defineproperties",e,r)}else(t.modules=t.modules||{})["polyfill/object/defineproperties"]=e()}(function(e,t,r,o,n,i,c){"use strict";return Object.defineProperties||(Object.defineProperties=function(e,t){if(e!==Object(e))throw new TypeError("Object.defineProperties called on non-object");var r;for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&Object.defineProperty(e,r,t[r]);return e}),Object.defineProperties},window.qoopido=window.qoopido||{}),function(e,t){if(t.register){var r=[];Object.defineProperties||r.push("./defineproperties"),t.register("polyfill/object/create",e,r)}else(t.modules=t.modules||{})["polyfill/object/create"]=e()}(function(e,t,r,o,n,i,c){"use strict";return Object.create||(Object.create=function(e,t){function r(){}if("object"!=typeof e)throw new TypeError;r.prototype=e;var o=new r;if(e&&(o.constructor=r),arguments.length>1){if(t!==Object(t))throw new TypeError;Object.defineProperties(o,t)}return o}),Object.create},window.qoopido=window.qoopido||{}),function(e,t){t.register?t.register("polyfill/object/getownpropertynames",e):(t.modules=t.modules||{})["polyfill/object/getownpropertynames"]=e()}(function(e,t,r,o,n,i,c){"use strict";return Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(e){if(e!==Object(e))throw new TypeError("Object.getOwnPropertyNames called on non-object");var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.push(t);return r}),Object.getOwnPropertyNames},window.qoopido=window.qoopido||{}),function(e,t){t.register?t.register("polyfill/object/getownpropertydescriptor",e):(t.modules=t.modules||{})["polyfill/object/getownpropertydescriptor"]=e()}(function(e,t,r,o,n,i,c){"use strict";if(!Object.getOwnPropertyDescriptor||!function(){try{return Object.getOwnPropertyDescriptor({x:0},"x"),!0}catch(e){return!1}}()){var p=Object.getOwnPropertyDescriptor;Object.getOwnPropertyDescriptor=function(e,t){if(e!==Object(e))throw new TypeError;try{return p.call(Object,e,t)}catch(r){}return Object.prototype.hasOwnProperty.call(e,t)?{value:e[t],enumerable:!0,writable:!0,configurable:!0}:void 0}}return Object.getOwnPropertyDescriptor},window.qoopido=window.qoopido||{}),function(e,t,r,o,n){"use strict";function i(e,i,c,s){var d,a=e.split("/");return f[e]?f[e]:(d=function(){if(c)for(var d,y,b=a.slice(0,-1).join("/"),j=0;(d=c[j])!==n;j++)y=l.test(d),y&&(d=p(b+"/"+d)),!f[d]&&arguments[j]&&(f[d]=arguments[j]),y&&!f[d]&&"undefined"!=typeof console&&console.error("".concat("[Qoopido.js] ",e,": Could not load dependency ",d));return f[e]=i(f,u,a,t,r,o,n),s&&s(f[e]),f[e]},void("undefined"!=typeof module&&module.exports?module.exports=define(d):"function"==typeof define&&define.amd?c?define(c,d):define(d):d()))}function c(e,t,r){i(e,t,r,function(t){f[e]=t.create()})}function p(e){for(var t;(t=e.replace(a,""))!==e;)e=t;return e.replace(y,"")}var s=r.qoopido||(r.qoopido={}),u=s.shared||(s.shared={}),f=s.modules||(s.modules={}),d=[],l=new RegExp("^\\.+\\/"),a=new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."),y=new RegExp("(^\\/)|\\.\\/","g");s.register=i,s.registerSingleton=c,Object.create||d.push("./polyfill/object/create"),Object.getOwnPropertyNames||d.push("./polyfill/object/getownpropertynames"),Object.getOwnPropertyDescriptor&&function(){try{return Object.getOwnPropertyDescriptor({x:0},"x"),!0}catch(e){return!1}}()||d.push("./polyfill/object/getownpropertydescriptor"),i("base",e,d)}(function(e,t,r,o,n,i,c){"use strict";function p(e){for(var t,r={},o=Object.getOwnPropertyNames(e),n=0;(t=o[n])!==c;n++)r[t]=Object.getOwnPropertyDescriptor(e,t);return r}function s(){throw new Error("[Qoopido.js] Operation prohibited")}return{create:function(){var e,t=Object.create(this,p(this));return t._constructor&&(e=t._constructor.apply(t,arguments)),t.create=t.extend=s,e||t},extend:function(e,t){var r;return e=e||{},t=t===!0,e._parent=this,r=Object.create(this,p(e)),t===!0&&(r.extend=s),r}}},navigator,this,document); \ No newline at end of file diff --git a/dist/latest/min/packages/qoopido.emerge.js b/dist/latest/min/packages/qoopido.emerge.js new file mode 100644 index 00000000..60e34c10 --- /dev/null +++ b/dist/latest/min/packages/qoopido.emerge.js @@ -0,0 +1,2 @@ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +!function(e,t,r,n,o){"use strict";function i(e,i,s,u){var c,d=e.split("/");return p[e]?p[e]:(c=function(){if(s)for(var c,m,h=d.slice(0,-1).join("/"),g=0;(c=s[g])!==o;g++)m=f.test(c),m&&(c=l(h+"/"+c)),!p[c]&&arguments[g]&&(p[c]=arguments[g]),m&&!p[c]&&"undefined"!=typeof console&&console.error("".concat("[Qoopido.js] ",e,": Could not load dependency ",c));return p[e]=i(p,a,d,t,r,n,o),u&&u(p[e]),p[e]},void("undefined"!=typeof module&&module.exports?module.exports=define(c):"function"==typeof define&&define.amd?s?define(s,c):define(c):c()))}function s(e,t,r){i(e,t,r,function(t){p[e]=t.create()})}function l(e){for(var t;(t=e.replace(d,""))!==e;)e=t;return e.replace(m,"")}var u=r.qoopido||(r.qoopido={}),a=u.shared||(u.shared={}),p=u.modules||(u.modules={}),c=[],f=new RegExp("^\\.+\\/"),d=new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."),m=new RegExp("(^\\/)|\\.\\/","g");u.register=i,u.registerSingleton=s,Object.create||c.push("./polyfill/object/create"),Object.getOwnPropertyNames||c.push("./polyfill/object/getownpropertynames"),Object.getOwnPropertyDescriptor&&function(){try{return Object.getOwnPropertyDescriptor({x:0},"x"),!0}catch(e){return!1}}()||c.push("./polyfill/object/getownpropertydescriptor"),i("base",e,c)}(function(e,t,r,n,o,i,s){"use strict";function l(e){for(var t,r={},n=Object.getOwnPropertyNames(e),o=0;(t=n[o])!==s;o++)r[t]=Object.getOwnPropertyDescriptor(e,t);return r}function u(){throw new Error("[Qoopido.js] Operation prohibited")}return{create:function(){var e,t=Object.create(this,l(this));return t._constructor&&(e=t._constructor.apply(t,arguments)),t.create=t.extend=u,e||t},extend:function(e,t){var r;return e=e||{},t=t===!0,e._parent=this,r=Object.create(this,l(e)),t===!0&&(r.extend=u),r}}},navigator,this,document),function(e){window.qoopido.register("polyfill/string/ucfirst",e)}(function(e,t,r,n,o,i,s){"use strict";return String.prototype.ucfirst||(String.prototype.ucfirst=function(){var e=this;return e.charAt(0).toUpperCase()+e.slice(1)}),String.prototype.ucfirst}),function(e){window.qoopido.register("polyfill/string/lcfirst",e)}(function(e,t,r,n,o,i,s){"use strict";return String.prototype.lcfirst||(String.prototype.lcfirst=function(){var e=this;return e.charAt(0).toLowerCase()+e.slice(1)}),String.prototype.lcfirst}),function(e){window.qoopido.register("polyfill/window/promise",e)}(function(e,t,r,n,o,i,s){"use strict";function l(e,t){var r=P.push([e,t]);1===r&&u()}function u(){o.setTimeout(a,1)}function a(){for(var e,t=0;(e=P[t])!==s;t++)e[0](e[1]);P.length=0}function p(e,t){var r,n=null;try{if(e===t)throw new TypeError("A promises callback cannot return that same promise.");if(("function"==typeof t||"object"==typeof t&&null!==t)&&(n=t.then,"function"==typeof n))return n.call(t,function(n){return r?!0:(r=!0,void(t!==n?d(e,n):m(e,n)))},function(t){return r?!0:(r=!0,void h(e,t))}),!0}catch(o){return r?!0:(h(e,o),!0)}return!1}function c(e,t){function r(e){d(t,e)}function n(e){h(t,e)}try{e(r,n)}catch(o){n(o)}}function f(e,t,r,n){var o,i,s,l,u="function"==typeof r;if(u)try{o=r(n),s=!0}catch(a){l=!0,i=a}else o=n,s=!0;p(t,o)||(u&&s?d(t,o):l?h(t,i):e===E?d(t,o):e===S&&h(t,o))}function d(e,t){e===t?m(e,t):p(e,t)||m(e,t)}function m(e,t){e._state===_&&(e._state=x,e._detail=t,l(g,e))}function h(e,t){e._state===_&&(e._state=x,e._detail=t,l(v,e))}function g(e){w(e,e._state=E)}function v(e){w(e,e._state=S)}function y(e,t,r,n){var o=e._subscribers,i=o.length;o[i]=t,o[i+E]=r,o[i+S]=n}function w(e,t){for(var r,n,o=e._subscribers,i=e._detail,l=0;(r=o[l])!==s;l+=3)n=o[l+t],f(t,r,n,i);e._subscribers=null}function b(e){var t=this;if("function"!=typeof e)throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");t._subscribers=[],c(e,t)}var _=void 0,x=0,E=1,S=2,P=[];return b.prototype={_state:s,_detail:s,_subscribers:s,then:function(e,t){var r=this,n=new b(function(){});return r._state?l(function(){f(r._state,n,arguments[r._state-1],r._detail)}):y(r,n,e,t),n},"catch":function(e){return this.then(null,e)}},o.Promise||(o.Promise=b),o.Promise}),function(e){var t=[];window.Promise||t.push("../polyfill/window/promise"),window.qoopido.register("promise/all",e,t)}(function(e,t,r,n,o,i,s){"use strict";return function(e){if("[object Array]"!==Object.prototype.toString.call(e))throw new TypeError("You must pass an array to all.");return new o.Promise(function(t,r){function n(e){return function(t){o(e,t)}}function o(e,r){l[e]=r,0===--u&&t(l)}var i,l=[],u=e.length,a=0;for(0===u&&t([]);(i=e[a])!==s;a++)i&&"function"==typeof i.then?i.then(n(a),r):o(a,i)})}}),function(e){var t=[];window.Promise||t.push("../polyfill/window/promise"),window.qoopido.register("promise/defer",e,t)}(function(e,t,r,n,o,i,s){"use strict";return function(){var e=this;e.promise=new o.Promise(function(t,r){e.resolve=t,e.reject=r})}}),function(e){var t=["./base","./promise/all","./promise/defer"];String.prototype.ucfirst||t.push("./polyfill/string/ucfirst"),String.prototype.lcfirst||t.push("./polyfill/string/lcfirst"),window.qoopido.registerSingleton("support",e,t)}(function(e,t,r,n,o,i,s){"use strict";function l(e){return e.replace(c,"$1").lcfirst().replace(f,"").replace(d,h)}var u=e["promise/all"],a=e["promise/defer"],p=new RegExp("^(Moz|WebKit|Khtml|ms|O|Icab)(?=[A-Z])"),c=new RegExp("^(?:webkit|khtml|icab|moz|ms|o)([A-Z])"),f=new RegExp("^-(?:webkit|khtml|icab|moz|ms|o)-"),d=new RegExp("-([a-z])","gi"),m=new RegExp("([A-Z])","g"),h=function(){return arguments[1].ucfirst()},g={prefix:null,method:{},property:{},css:{},promises:{prefix:null,method:{},property:{},css:{},test:{}}};return e.base.extend({test:{},pool:t.pool&&t.pool.dom,testMultiple:function(){for(var e,t=[],r=0;(e=arguments[r])!==s;r++)switch(typeof e){case"string":t.push(this.test[e]());break;case"boolean":var n=new a;e?n.resolve():n.reject(),t.push(n.promise);break;default:t.push(e)}return new u(t)},getPrefix:function(){var e,t=this,r=g.prefix||null;if(null===r){var n=t.pool?t.pool.obtain("div"):i.createElement("div"),o=n.style;r=!1;for(e in o)p.test(e)&&(r=e.match(p)[0]);r===!1&&"WebkitOpacity"in o&&(r="WebKit"),r===!1&&"KhtmlOpacity"in o&&(r="Khtml"),r=g.prefix=r===!1?!1:[r.toLowerCase(),r.toLowerCase().ucfirst(),r],n.dispose&&n.dispose()}return r},getMethod:function(e,t){e=l(e),t=t||o;var r=t.tagName,n=g.method[r]=g.method[r]||{},i=n[e]=g.method[r][e]||null;if(null===i){i=!1;var u,a,p=0,c=e.ucfirst(),f=this.getPrefix();for(u=f!==!1?(e+" "+c+" "+f.join(c+" ")+c).split(" "):[e];(a=u[p])!==s;p++)if(t[a]!==s&&("function"==typeof t[a]||"object"==typeof t[a])){i=a;break}g.method[r][e]=i}return i},getProperty:function(e,t){e=l(e),t=t||o;var r=t.tagName,n=g.property[r]=g.property[r]||{},i=n[e]=g.property[r][e]||null;if(null===i){i=!1;var u,a,p=0,c=e.ucfirst(),f=this.getPrefix();for(u=f!==!1?(e+" "+c+" "+f.join(c+" ")+c).split(" "):[e],p;(a=u[p])!==s;p++)if(t[a]!==s){i=a;break}g.property[r][e]=i}return i},getCssProperty:function(e){e=l(e);var t=this,r=g.css[e]||null;if(null===r){r=!1;var n,o=0,u=t.pool?t.pool.obtain("div"):i.createElement("div"),a=e.ucfirst(),p=this.getPrefix()||[],c=(e+" "+a+" "+p.join(a+" ")+a).split(" "),f="";for(o;(n=c[o])!==s;o++)if(u.style[n]!==s){r=n,o>0&&(f="-");break}r=g.css[e]=r!==!1?[f+r.replace(m,"-$1").toLowerCase(),r]:!1,u.dispose&&u.dispose()}return r},supportsPrefix:function(){return!!this.getPrefix()},supportsMethod:function(e,t){return!!this.getMethod(e,t)},supportsProperty:function(e,t){return!!this.getProperty(e,t)},supportsCssProperty:function(e){return!!this.getCssProperty(e)},testPrefix:function(){var e=g.promises.prefix;if(null===e){var t=new a,r=this.getPrefix();r?t.resolve(r):t.reject(),e=g.promises.prefix=t.promise}return e},testMethod:function(e,t){t=t||o;var r=t.tagName,n=g.promises.method[r]=g.promises.method[r]||{},i=n[e]=g.promises.method[r][e]||null;if(null===i){var s=new a,l=this.getMethod(e,t);l?s.resolve(l):s.reject(),i=g.promises.method[r][e]=s.promise}return i},testProperty:function(e,t){t=t||o;var r=t.tagName,n=g.promises.property[r]=g.promises.property[r]||{},i=n[e]=g.promises.property[r][e]||null;if(null===i){var s=new a,l=this.getProperty(e,t);l?s.resolve(l):s.reject(),i=g.promises.property[r][e]=s.promise}return i},testCssProperty:function(e){var t=g.promises.css[e]||null;if(null===t){var r=new a,n=this.getCssProperty(e);n?r.resolve(n):r.reject(),t=g.promises.css[e]=r.promise}return t},addTest:function(e,t){return this.test[e]=function(){var r=g.promises.test[e]||null;if(null===r){var n=new a,o=Array.prototype.slice.call(arguments);o.splice(0,0,n),t.apply(null,o),r=g.promises.test[e]=n.promise}return r}}})}),function(e){window.qoopido.register("function/merge",e)}(function(e,t,r,n,o,i,s){"use strict";return function l(){var e,t,r,n,o,i=arguments[0];for(e=1;(t=arguments[e])!==s;e++)for(r in t)n=i[r],o=t[r],o!==s&&(null!==o&&"object"==typeof o?(n=o.length!==s?n&&"object"==typeof n&&n.length!==s?n:[]:n&&"object"==typeof n&&n.length===s?n:{},i[r]=l(n,o)):i[r]=o);return i}}),function(e){window.qoopido.register("function/unique/uuid",e)}(function(e,t,r,n,o,i,s){"use strict";function l(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(a,function(e){var t=16*Math.random()|0,r="x"===e?t:3&t|8;return r.toString(16)})}var u={},a=new RegExp("[xy]","g");return function(){var e;do e=l();while("undefined"!=typeof u[e]);return u[e]=!0,e}}),function(e){window.qoopido.registerSingleton("hook/event",e,["../base"])}(function(e,t,r,n,o,i,s){"use strict";function l(e,t,r){for(var n,o=0;(n=r[o])!==s;o++)e[n]=t[n];e._properties=e._properties.concat(r)}var u={general:{properties:"type altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which path".split(" "),process:function(e,t){var r;if(e.originalEvent=t,e.isDefaultPrevented=t.defaultPrevented?!0:!1,e.isPropagationStopped=t.cancelBubble?!0:!1,e.metaKey=t.metaKey&&t.metaKey!==!1?!0:!1,e.target||(e.target=t.srcElement||i),3===e.target.nodeType&&(e.target=e.target.parentNode),!e.path){e.path=[],r=e.target;do e.path.push(r);while(r=r.parentNode);e.path.push(o)}}},mouse:{regex:new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"),properties:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement dataTransfer".split(" "),process:function(e,t){var r,n,o;n=t.fromElement,o=t.button,null===e.pageX&&null!==t.clientX&&(r=e.target.ownerDocument||i,r=r.documentElement||r.body,e.pageX=t.clientX+(r.scrollLeft||0)-(r.clientLeft||0),e.pageY=t.clientY+(r.scrollTop||0)-(r.clientTop||0)),!e.relatedTarget&&n&&(e.relatedTarget=n===e.target?t.toElement:n),e.which||o===s||(e.which=1&o?1:2&o?3:4&o?2:0)}},key:{regex:new RegExp("^(?:key)"),properties:"char charCode key keyCode".split(" "),process:function(e,t){null===e.which&&(e.which=null!==t.charCode?t.charCode:t.keyCode)}}};return e.base.extend({add:function(e,t){return e&&t&&u[e]&&(u[e]=t),this},get:function(e){return e&&u[e]?u[e]:null},process:function(e,t){var r,n,o;for(r in u)n=u[r],o=!n.regex||n.regex.test(t.type),o&&(n.properties&&l(e,t,n.properties),n.process&&n.process(e,t),n.delegate&&(e.delegate=n.delegate))}})}),function(e){var t=["../base","../support"];window.getComputedStyle||t.push("../polyfill/window/getcomputedstyle"),window.qoopido.registerSingleton("hook/css",e,t)}(function(e,t,r,n,o,i,s){"use strict";var l=e.support,u=o.getComputedStyle||e["polyfill/window/getcomputedstyle"],a={general:{get:function(e,t){return u(e,null).getPropertyValue(t[0])},set:function(e,t,r){e.style[t[1]]=r}},opacity:l.supportsCssProperty("opacity")?null:{regex:new RegExp("alpha\\(opacity=(.*)\\)","i"),get:function(e,t,r){return r=u(e,null).getPropertyValue("filter").toString().match(this.regex),r=r?r[1]/100:1},set:function(e,t,r){var n=e.style;n.zoom=1,n.filter="alpha(opacity="+(100*r+.5>>0)+")"}}};return e.base.extend({add:function(e,t){return e&&t&&a[e]&&(a[e]=t),this},get:function(e){return e&&a[e]?a[e]:null},process:function(e,t,r,n){var o;return r=l.getCssProperty(r,t)||null,r?((o=this.get(r[1]))&&o[e]||this.get("general")[e])(t,r,n):void 0}})}),function(e){window.qoopido.register("dom/event",e,["../base","../hook/event"])}(function(e,t,r,n,o,i,s){"use strict";var l=e["hook/event"];return e.base.extend({originalEvent:null,isDelegate:!1,isDefaultPrevented:!1,isPropagationStopped:!1,isImmediatePropagationStopped:!1,_properties:null,_constructor:function(e){var t=this;return t._properties=[],t._obtain(e),t},_obtain:function(e){l.process(this,e)},_dispose:function(){for(var e,t=this,r=0;(e=t._properties[r])!==s;r++)delete t[e];delete t.delegate,t.originalEvent=null,t.isDelegate=!1,t.isDefaultPrevented=!1,t.isPropagationStopped=!1,t.isImmediatePropagationStopped=!1,t._properties.length=0},preventDefault:function(){var e=this,t=e.originalEvent;t.cancelable!==!1&&(e.isDefaultPrevented=!0,t.preventDefault?t.preventDefault():t.returnValue=!1)},stopPropagation:function(){var e=this,t=e.originalEvent;e.isPropagationStopped=!0,t.stopPropagation&&t.stopPropagation(),t.cancelBubble=!0},stopImmediatePropagation:function(){var e=this,t=e.originalEvent;e.isImmediatePropagationStopped=!0,t.stopImmediatePropagation&&t.stopImmediatePropagation(),e.stopPropagation()}})}),function(e){var t=["../base","../function/unique/uuid","../hook/css","./event"];window.CustomEvent||t.push("../polyfill/window/customevent"),window.addEventListener||t.push("../polyfill/window/addeventlistener"),window.removeEventListener||t.push("../polyfill/window/removeeventlistener"),window.dispatchEvent||t.push("../polyfill/window/dispatchevent"),Element.prototype.matches||t.push("../polyfill/element/matches"),document.querySelector||t.push("../polyfill/document/queryselector"),document.querySelectorAll||t.push("../polyfill/document/queryselectorall"),String.prototype.trim||t.push("../polyfill/string/trim"),window.qoopido.register("dom/element",e,t)}(function(e,t,r,n,o,i,s){"use strict";function l(e){var t,r,n;for(t in P)r=P[t],(!r.regex||r.regex.test(e))&&(n=r);return n}function u(e,t,r){var n=this,o=l(e),s=i.createEvent(o.type);s[o.method](e,"load"===e?!1:!0,!0,t),r&&(s._quid=r,s.isDelegate=!0),n.element.dispatchEvent(s)}function a(e){var t;if("string"==typeof e)try{w.test(e)===!0?(t=e.replace(w,"$1").toLowerCase(),e=i.createElement(t)):e=i.querySelector(e)}catch(r){e=null}if(!e)throw new Error("[Qoopido.js] Element could not be resolved");return e}function p(e){return Array.prototype.concat.apply([],Array.prototype.splice.call(e,0)).join(" ").split(_)}function c(e,t){for(var r,n=0;(r=e.path[n])!==s;n++){if(r.matches(t))return e.currentTarget=r,!0;if(r===e.currentTarget)break}return!1}var f="object",d="string",m=e["function/unique/uuid"],h=i.getElementsByTagName("head")[0],g="textContent"in i.createElement("a")?"textContent":"innerText",v="undefined"!=typeof h.previousElementSibling?function(){return this.previousElementSibling}:function(){for(var e=this;e=e.previousSibling;)if(1===e.nodeType)return e},y="undefined"!=typeof h.nextElementSibling?function(){return this.nextElementSibling}:function(){for(var e=this;e=e.nextSibling;)if(1===e.nodeType)return e},w=new RegExp("^<(\\w+)\\s*/>$"),b=new RegExp("^[^-]+"),_=new RegExp(" +","g"),x=e["pool/module"]&&e["pool/module"].create(e["dom/event"],null,!0)||null,E=e["hook/css"],S={},P={custom:{type:"CustomEvent",method:"initCustomEvent"},html:{regex:new RegExp("^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$"),type:"HTMLEvents",method:"initEvent"},mouse:{regex:new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"),type:"MouseEvents",method:"initMouseEvent"}};return e.base.extend({type:null,element:null,_listener:null,_constructor:function(e,t,r){var n,o=this;return e=a(e),n=e._quid,n?o=S[n]:(n=e._quid=m(),o.type=e.tagName,o.element=e,o._listener={},S[n]=o),"object"==typeof t&&null!==t&&o.setAttributes(t),"object"==typeof r&&null!==r&&o.setStyles(r),o!==this&&this.dispose&&this.dispose(),o},_obtain:function(e,t,r){this._constructor(e,t,r)},_dispose:function(){var e,t,r=this;for(e in r._listener)t=e.match(b),r.element.removeEventListener(t,r._listener[e]),delete r._listener[e];r.type=null,r.element=null},getContent:function(e){var t=this.element;return e&&e!==!1?t.innerHTML:t[g]},setContent:function(e,t){var r=this,n=r.element;return t&&t!==!1?n.innerHTML=e:n[g]=e,r},getAttribute:function(e){var t=this;return e&&typeof e===d?t.element.getAttribute(e):void 0},getAttributes:function(){for(var e,t=this,r={},n=p(arguments),o=0;(e=n[o])!==s;o++)r[e]=t.element.getAttribute(e);return r},setAttribute:function(e,t){var r=this;return e&&typeof e===d&&r.element.setAttribute(e,t),r},setAttributes:function(e){var t,r=this;if(e&&typeof e===f&&!e.length)for(t in e)r.element.setAttribute(t,e[t]);return r},removeAttribute:function(e){var t=this;return e&&typeof e===d&&t.element.removeAttribute(e),t},removeAttributes:function(){for(var e,t=this,r=p(arguments),n=0;(e=r[n])!==s;n++)t.element.removeAttribute(e);return t},getStyle:function(e){var t=this;return e&&typeof e===d?E.process("get",t.element,e):void 0},getStyles:function(){for(var e,t=this,r={},n=p(arguments),o=0;(e=n[o])!==s;o++)r[e]=E.process("get",t.element,e);return r},setStyle:function(e,t){var r=this;return e&&typeof e===d&&E.process("set",r.element,e,t),r},setStyles:function(e){var t,r=this;if(e&&typeof e===f&&!e.length)for(t in e)E.process("set",r.element,t,e[t]);return r},removeStyle:function(e){var t=this;return e&&typeof e===d&&t.setStyle(e,""),t},removeStyles:function(){for(var e,t=this,r=p(arguments),n=0;(e=r[n])!==s;n++)t.setStyle(e,"");return t},siblings:function(e){for(var t=this.element,r=t.parentNode.firstChild,n=[];r;r=y.call(r))r===t||e&&!r.matches(e)||n.push(r);return n},siblingsBefore:function(e){for(var t=this.element.previousSibling,r=[];t;t=v.call(t))(!e||t.matches(e))&&r.push(t);return r},siblingsAfter:function(e){for(var t=this.element.nextSibling,r=[];t;t=y.call(t))(!e||t.matches(e))&&r.push(t);return r},previous:function(e){var t=v.call(this.element);if(!e)return t;for(;t;t=v.call(t))if(t.matches(e))return t},next:function(e){var t=y.call(this.element);if(!e)return t;for(;t;t=y.call(t))if(t.matches(e))return t},find:function(e){var t,r,n=this.element;return e=e.trim(),">"===e.charAt(0)?(t=n._quid,n.setAttribute("data-quid",t),e='[data-quid="'+t+'"] '+e,r=n.parentNode.querySelectorAll(e),n.removeAttribute("data-quid")):r=n.querySelectorAll(e),r},parent:function(e){var t;if(!e)return this.element.parentNode;for(t=this.element;t;t=t.parentNode)if(t.matches(e))return t},parents:function(e){for(var t=this.element.parentNode,r=[];t;t=t.parentNode){if(9===t.nodeType)return r;1===t.nodeType&&(!e||t.matches(e))&&r.push(t)}},isVisible:function(){var e=this,t=e.element;return!(t.offsetWidth<=0&&t.offsetHeight<=0||"hidden"===e.getStyle("visibility")||e.getStyle("opacity")<=0)},hasClass:function(e){return e?new RegExp("(?:^|\\s)"+e+"(?:\\s|$)").test(this.element.className):!1},addClass:function(e){var t=this;return e&&!t.hasClass(e)&&(t.element.className+=t.element.className?" "+e:e),t},removeClass:function(e){var t=this;return e&&t.hasClass(e)&&(t.element.className=t.element.className.replace(new RegExp("(?:^|\\s)"+e+"(?!\\S)"),"")),t},toggleClass:function(e){var t=this;return e&&(t.hasClass(e)?t.removeClass(e):t.addClass(e)),t},prepend:function(e){var t=this,r=t.element;if(e)try{e=e.element||a(e),r.firstChild?r.insertBefore(e,r.firstChild):t.append(e)}catch(n){r.insertAdjacentHTML("afterBegin",e)}return t},append:function(e){var t=this,r=t.element;if(e)try{r.appendChild(e.element||a(e))}catch(n){r.insertAdjacentHTML("beforeEnd",e)}return t},prependTo:function(e){var t=this,r=t.element;return e&&((e=e.element||a(e)).firstChild?e.insertBefore(r,e.firstChild):t.appendTo(e)),t},appendTo:function(e){var t=this;return e&&(e.element||a(e)).appendChild(t.element),t},insertBefore:function(e){var t=this,r=t.element;return e&&(e=e.element||a(e)).parentNode.insertBefore(r,e),t},insertAfter:function(e){var t=this,r=t.element;return e&&((e=e.element||a(e)).nextSibling?e.parentNode.insertBefore(r,e.nextSibling):t.appendTo(e.parentNode)),t},replace:function(e){var t=this,r=t.element;return e&&(e=e.element||a(e)).parentNode.replaceChild(r,e),t},replaceWith:function(e){var t=this,r=t.element;return e&&(e=e.element||a(e),r.parentNode.replaceChild(e,r)),t},remove:function(){var e=this,t=e.element;return t.parentNode.removeChild(t),e},on:function(t){var r,n=this,o=n.element,i=arguments.length>2?arguments[1]:null,l=arguments.length>2?arguments[2]:arguments[1],a=l._quid||(l._quid=m()),p=0;for(t=t.split(" ");(r=t[p])!==s;p++){var f=r+"-"+a,d=function(t){var r;t=x&&x.obtain(t)||e["dom/event"].create(t),t.isPropagationStopped||(r=t.delegate,t._quid=m(),(!i||c(t,i))&&l.call(t.currentTarget,t,t.originalEvent.detail),r&&(delete t.delegate,u.call(n,r))),t.dispose&&t.dispose()};d.type=r,n._listener[f]=d,o.addEventListener(r,d)}return n},one:function(e){var t=this,r=arguments.length>3||"string"==typeof arguments[1]?arguments[1]:null,n=arguments.length>3||"function"==typeof arguments[2]?arguments[2]:arguments[1],o=(arguments.length>3?arguments[3]:arguments[2])!==!1,i=function(r){t.off(o===!0?r.type:e,i),n.call(this,r,r.originalEvent.detail)};return n._quid=i._quid=m(),r?t.on(e,r,i):t.on(e,i),t},off:function(e,t){var r,n,o,i=this,l=i.element,u=0;for(e=e.split(" ");(r=e[u])!==s;u++)n=t._quid&&r+"-"+t._quid||null,o=n&&i._listener[n]||null,o?(l.removeEventListener(r,o),delete i._listener[n]):l.removeEventListener(r,t);return i},emit:function(e,t){var r=this;return u.call(r,e,t),r}})}),function(e){window.qoopido.register("dom/element/emerge",e,["../element","../../function/merge","../../function/unique/uuid"])}(function(e,t,r,n,o,i,s){"use strict";function l(e){var t,r=v[e];for(t in r)"length"!==t&&p.call(r[t]);0===r.length&&(o.element.clearInterval(g[e]),delete g[e])}function u(){h.left=0,h.top=0,h.right=o.innerWidth||m.clientWidth,h.bottom=o.innerHeight||m.clientHeight}function a(){var e=this,t=e._settings.threshold,r=t!==s?t:m.clientWidth*e._settings.auto,n=t!==s?t:m.clientHeight*e._settings.auto;e._viewport.left=h.left-r,e._viewport.top=h.top-n,e._viewport.right=h.right+r,e._viewport.bottom=h.bottom+n}function p(){var e,t=this,r=!1,n=2;!t.isVisible()||"hidden"===t.getStyle("visibility")&&t._settings.visibility!==!1||(e=t.element.getBoundingClientRect(),(e.bottom>=t._viewport.top&&e.bottom<=t._viewport.bottom||e.top>=t._viewport.top&&e.top<=t._viewport.bottom||t._viewport.bottom>=e.top&&t._viewport.bottom<=e.bottom||t._viewport.top>=e.top&&t._viewport.top<=e.bottom)&&(e.left>=t._viewport.left&&e.left<=t._viewport.right||e.right>=t._viewport.left&&e.right<=t._viewport.right||t._viewport.left>=e.left&&t._viewport.left<=e.right||t._viewport.right>=e.left&&t._viewport.right<=e.right)&&((0===t._settings.threshold||(e.bottom>=h.top&&e.bottom<=h.bottom||e.top>=h.top&&e.top<=h.bottom||h.bottom>=e.top&&h.bottom<=e.bottom||h.top>=e.top&&h.top<=e.bottom)&&(e.left>=h.left&&e.left<=h.right||e.right>=h.left&&e.right<=h.right||h.left>=e.left&&h.left<=e.right||h.right>=e.left&&h.right<=e.right))&&(n=1),r=!0)),(r!==t._state||r===!0&&n!==t._priority)&&c.call(t,r,n)}function c(e,t){var r=this;r._state=e,r._priority=t,r._settings.recur!==!0&&r.remove(),e===!0?r.emit(y,t):r.emit(w)}var f,d={interval:50,threshold:"auto",recur:!0,auto:1,visibility:!0},m=o.document.documentElement,h={},g={},v={},y="emerged",w="demerged",b="resize orientationchange";if(o=e["dom/element"].create(o),"CSS1Compat"!==i.compatMode)throw"[Qoopido.js] Not in standards mode";return f=e["dom/element"].extend({_quid:null,_viewport:null,_settings:null,_state:null,_priority:null,_constructor:function(t,r){var n=f._parent._constructor.call(this,t);return r=e["function/merge"]({},d,r||{}),"auto"===r.threshold&&delete r.threshold,g[r.interval]===s&&(v[r.interval]=v[r.interval]||{length:0},g[r.interval]=o.element.setInterval(function(){l(r.interval)},r.interval)),n._quid=e["function/unique/uuid"](),n._viewport={},n._settings=r,n._state=!1,n._priority=2,v[r.interval][n._quid]=n,v[r.interval].length++,o.on(b,function(){a.call(n)}),a.call(n),n},remove:function(){var e=this;delete v[e._settings.interval][e._quid],v[e._settings.interval].length--}}),o.on(b,u),u(),f}); \ No newline at end of file diff --git a/dist/latest/min/packages/qoopido.emerge.legacy.js b/dist/latest/min/packages/qoopido.emerge.legacy.js new file mode 100644 index 00000000..035f68c2 --- /dev/null +++ b/dist/latest/min/packages/qoopido.emerge.legacy.js @@ -0,0 +1,2 @@ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +!function(e,t){t.register?t.register("polyfill/object/defineproperty",e):(t.modules=t.modules||{})["polyfill/object/defineproperty"]=e()}(function(e,t,r,n,o,i,s){"use strict";if(!Object.defineProperty||!function(){try{return Object.defineProperty({},"x",{}),!0}catch(e){return!1}}()){var l=Object.defineProperty,u=Object.prototype.__defineGetter__,p=Object.prototype.__defineSetter__;Object.defineProperty=function(e,t,r){if(l)try{return l(e,t,r)}catch(n){}if(e!==Object(e))throw new TypeError("Object.defineProperty called on non-object");return u&&"get"in r&&u.call(e,t,r.get),p&&"set"in r&&p.call(e,t,r.set),"value"in r&&(e[t]=r.value),e}}return Object.defineProperty},window.qoopido=window.qoopido||{}),function(e,t){if(t.register){var r=[];Object.defineProperty&&function(){try{return Object.defineProperty({},"x",{}),!0}catch(e){return!1}}()||r.push("./defineproperty"),t.register("polyfill/object/defineproperties",e,r)}else(t.modules=t.modules||{})["polyfill/object/defineproperties"]=e()}(function(e,t,r,n,o,i,s){"use strict";return Object.defineProperties||(Object.defineProperties=function(e,t){if(e!==Object(e))throw new TypeError("Object.defineProperties called on non-object");var r;for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&Object.defineProperty(e,r,t[r]);return e}),Object.defineProperties},window.qoopido=window.qoopido||{}),function(e,t){if(t.register){var r=[];Object.defineProperties||r.push("./defineproperties"),t.register("polyfill/object/create",e,r)}else(t.modules=t.modules||{})["polyfill/object/create"]=e()}(function(e,t,r,n,o,i,s){"use strict";return Object.create||(Object.create=function(e,t){function r(){}if("object"!=typeof e)throw new TypeError;r.prototype=e;var n=new r;if(e&&(n.constructor=r),arguments.length>1){if(t!==Object(t))throw new TypeError;Object.defineProperties(n,t)}return n}),Object.create},window.qoopido=window.qoopido||{}),function(e,t){t.register?t.register("polyfill/object/getownpropertynames",e):(t.modules=t.modules||{})["polyfill/object/getownpropertynames"]=e()}(function(e,t,r,n,o,i,s){"use strict";return Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(e){if(e!==Object(e))throw new TypeError("Object.getOwnPropertyNames called on non-object");var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.push(t);return r}),Object.getOwnPropertyNames},window.qoopido=window.qoopido||{}),function(e,t){t.register?t.register("polyfill/object/getownpropertydescriptor",e):(t.modules=t.modules||{})["polyfill/object/getownpropertydescriptor"]=e()}(function(e,t,r,n,o,i,s){"use strict";if(!Object.getOwnPropertyDescriptor||!function(){try{return Object.getOwnPropertyDescriptor({x:0},"x"),!0}catch(e){return!1}}()){var l=Object.getOwnPropertyDescriptor;Object.getOwnPropertyDescriptor=function(e,t){if(e!==Object(e))throw new TypeError;try{return l.call(Object,e,t)}catch(r){}return Object.prototype.hasOwnProperty.call(e,t)?{value:e[t],enumerable:!0,writable:!0,configurable:!0}:void 0}}return Object.getOwnPropertyDescriptor},window.qoopido=window.qoopido||{}),function(e,t,r,n,o){"use strict";function i(e,i,s,u){var a,d=e.split("/");return c[e]?c[e]:(a=function(){if(s)for(var a,m,g=d.slice(0,-1).join("/"),h=0;(a=s[h])!==o;h++)m=f.test(a),m&&(a=l(g+"/"+a)),!c[a]&&arguments[h]&&(c[a]=arguments[h]),m&&!c[a]&&"undefined"!=typeof console&&console.error("".concat("[Qoopido.js] ",e,": Could not load dependency ",a));return c[e]=i(c,p,d,t,r,n,o),u&&u(c[e]),c[e]},void("undefined"!=typeof module&&module.exports?module.exports=define(a):"function"==typeof define&&define.amd?s?define(s,a):define(a):a()))}function s(e,t,r){i(e,t,r,function(t){c[e]=t.create()})}function l(e){for(var t;(t=e.replace(d,""))!==e;)e=t;return e.replace(m,"")}var u=r.qoopido||(r.qoopido={}),p=u.shared||(u.shared={}),c=u.modules||(u.modules={}),a=[],f=new RegExp("^\\.+\\/"),d=new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."),m=new RegExp("(^\\/)|\\.\\/","g");u.register=i,u.registerSingleton=s,Object.create||a.push("./polyfill/object/create"),Object.getOwnPropertyNames||a.push("./polyfill/object/getownpropertynames"),Object.getOwnPropertyDescriptor&&function(){try{return Object.getOwnPropertyDescriptor({x:0},"x"),!0}catch(e){return!1}}()||a.push("./polyfill/object/getownpropertydescriptor"),i("base",e,a)}(function(e,t,r,n,o,i,s){"use strict";function l(e){for(var t,r={},n=Object.getOwnPropertyNames(e),o=0;(t=n[o])!==s;o++)r[t]=Object.getOwnPropertyDescriptor(e,t);return r}function u(){throw new Error("[Qoopido.js] Operation prohibited")}return{create:function(){var e,t=Object.create(this,l(this));return t._constructor&&(e=t._constructor.apply(t,arguments)),t.create=t.extend=u,e||t},extend:function(e,t){var r;return e=e||{},t=t===!0,e._parent=this,r=Object.create(this,l(e)),t===!0&&(r.extend=u),r}}},navigator,this,document),function(e){window.qoopido.register("polyfill/string/ucfirst",e)}(function(e,t,r,n,o,i,s){"use strict";return String.prototype.ucfirst||(String.prototype.ucfirst=function(){var e=this;return e.charAt(0).toUpperCase()+e.slice(1)}),String.prototype.ucfirst}),function(e){window.qoopido.register("polyfill/string/lcfirst",e)}(function(e,t,r,n,o,i,s){"use strict";return String.prototype.lcfirst||(String.prototype.lcfirst=function(){var e=this;return e.charAt(0).toLowerCase()+e.slice(1)}),String.prototype.lcfirst}),function(e){window.qoopido.register("polyfill/window/getcomputedstyle",e)}(function(e,t,r,n,o,i,s){"use strict";if(o.getComputedStyle)return o.getComputedStyle;var l=new RegExp("(\\-([a-z]){1})","g"),u=function(){return arguments[2].toUpperCase()};return function(e,t){var r=this;return r.getPropertyValue=function(t){return"float"===t&&(t="styleFloat"),l.test(t)&&(t=t.replace(l,u)),e.currentStyle[t]||null},r}}),function(e){window.qoopido.register("polyfill/window/promise",e)}(function(e,t,r,n,o,i,s){"use strict";function l(e,t){var r=E.push([e,t]);1===r&&u()}function u(){o.setTimeout(p,1)}function p(){for(var e,t=0;(e=E[t])!==s;t++)e[0](e[1]);E.length=0}function c(e,t){var r,n=null;try{if(e===t)throw new TypeError("A promises callback cannot return that same promise.");if(("function"==typeof t||"object"==typeof t&&null!==t)&&(n=t.then,"function"==typeof n))return n.call(t,function(n){return r?!0:(r=!0,void(t!==n?d(e,n):m(e,n)))},function(t){return r?!0:(r=!0,void g(e,t))}),!0}catch(o){return r?!0:(g(e,o),!0)}return!1}function a(e,t){function r(e){d(t,e)}function n(e){g(t,e)}try{e(r,n)}catch(o){n(o)}}function f(e,t,r,n){var o,i,s,l,u="function"==typeof r;if(u)try{o=r(n),s=!0}catch(p){l=!0,i=p}else o=n,s=!0;c(t,o)||(u&&s?d(t,o):l?g(t,i):e===j?d(t,o):e===P&&g(t,o))}function d(e,t){e===t?m(e,t):c(e,t)||m(e,t)}function m(e,t){e._state===_&&(e._state=x,e._detail=t,l(h,e))}function g(e,t){e._state===_&&(e._state=x,e._detail=t,l(v,e))}function h(e){w(e,e._state=j)}function v(e){w(e,e._state=P)}function y(e,t,r,n){var o=e._subscribers,i=o.length;o[i]=t,o[i+j]=r,o[i+P]=n}function w(e,t){for(var r,n,o=e._subscribers,i=e._detail,l=0;(r=o[l])!==s;l+=3)n=o[l+t],f(t,r,n,i);e._subscribers=null}function b(e){var t=this;if("function"!=typeof e)throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");t._subscribers=[],a(e,t)}var _=void 0,x=0,j=1,P=2,E=[];return b.prototype={_state:s,_detail:s,_subscribers:s,then:function(e,t){var r=this,n=new b(function(){});return r._state?l(function(){f(r._state,n,arguments[r._state-1],r._detail)}):y(r,n,e,t),n},"catch":function(e){return this.then(null,e)}},o.Promise||(o.Promise=b),o.Promise}),function(e){var t=[];window.Promise||t.push("../polyfill/window/promise"),window.qoopido.register("promise/all",e,t)}(function(e,t,r,n,o,i,s){"use strict";return function(e){if("[object Array]"!==Object.prototype.toString.call(e))throw new TypeError("You must pass an array to all.");return new o.Promise(function(t,r){function n(e){return function(t){o(e,t)}}function o(e,r){l[e]=r,0===--u&&t(l)}var i,l=[],u=e.length,p=0;for(0===u&&t([]);(i=e[p])!==s;p++)i&&"function"==typeof i.then?i.then(n(p),r):o(p,i)})}}),function(e){var t=[];window.Promise||t.push("../polyfill/window/promise"),window.qoopido.register("promise/defer",e,t)}(function(e,t,r,n,o,i,s){"use strict";return function(){var e=this;e.promise=new o.Promise(function(t,r){e.resolve=t,e.reject=r})}}),function(e){var t=["./base","./promise/all","./promise/defer"];String.prototype.ucfirst||t.push("./polyfill/string/ucfirst"),String.prototype.lcfirst||t.push("./polyfill/string/lcfirst"),window.qoopido.registerSingleton("support",e,t)}(function(e,t,r,n,o,i,s){"use strict";function l(e){return e.replace(a,"$1").lcfirst().replace(f,"").replace(d,g)}var u=e["promise/all"],p=e["promise/defer"],c=new RegExp("^(Moz|WebKit|Khtml|ms|O|Icab)(?=[A-Z])"),a=new RegExp("^(?:webkit|khtml|icab|moz|ms|o)([A-Z])"),f=new RegExp("^-(?:webkit|khtml|icab|moz|ms|o)-"),d=new RegExp("-([a-z])","gi"),m=new RegExp("([A-Z])","g"),g=function(){return arguments[1].ucfirst()},h={prefix:null,method:{},property:{},css:{},promises:{prefix:null,method:{},property:{},css:{},test:{}}};return e.base.extend({test:{},pool:t.pool&&t.pool.dom,testMultiple:function(){for(var e,t=[],r=0;(e=arguments[r])!==s;r++)switch(typeof e){case"string":t.push(this.test[e]());break;case"boolean":var n=new p;e?n.resolve():n.reject(),t.push(n.promise);break;default:t.push(e)}return new u(t)},getPrefix:function(){var e,t=this,r=h.prefix||null;if(null===r){var n=t.pool?t.pool.obtain("div"):i.createElement("div"),o=n.style;r=!1;for(e in o)c.test(e)&&(r=e.match(c)[0]);r===!1&&"WebkitOpacity"in o&&(r="WebKit"),r===!1&&"KhtmlOpacity"in o&&(r="Khtml"),r=h.prefix=r===!1?!1:[r.toLowerCase(),r.toLowerCase().ucfirst(),r],n.dispose&&n.dispose()}return r},getMethod:function(e,t){e=l(e),t=t||o;var r=t.tagName,n=h.method[r]=h.method[r]||{},i=n[e]=h.method[r][e]||null;if(null===i){i=!1;var u,p,c=0,a=e.ucfirst(),f=this.getPrefix();for(u=f!==!1?(e+" "+a+" "+f.join(a+" ")+a).split(" "):[e];(p=u[c])!==s;c++)if(t[p]!==s&&("function"==typeof t[p]||"object"==typeof t[p])){i=p;break}h.method[r][e]=i}return i},getProperty:function(e,t){e=l(e),t=t||o;var r=t.tagName,n=h.property[r]=h.property[r]||{},i=n[e]=h.property[r][e]||null;if(null===i){i=!1;var u,p,c=0,a=e.ucfirst(),f=this.getPrefix();for(u=f!==!1?(e+" "+a+" "+f.join(a+" ")+a).split(" "):[e],c;(p=u[c])!==s;c++)if(t[p]!==s){i=p;break}h.property[r][e]=i}return i},getCssProperty:function(e){e=l(e);var t=this,r=h.css[e]||null;if(null===r){r=!1;var n,o=0,u=t.pool?t.pool.obtain("div"):i.createElement("div"),p=e.ucfirst(),c=this.getPrefix()||[],a=(e+" "+p+" "+c.join(p+" ")+p).split(" "),f="";for(o;(n=a[o])!==s;o++)if(u.style[n]!==s){r=n,o>0&&(f="-");break}r=h.css[e]=r!==!1?[f+r.replace(m,"-$1").toLowerCase(),r]:!1,u.dispose&&u.dispose()}return r},supportsPrefix:function(){return!!this.getPrefix()},supportsMethod:function(e,t){return!!this.getMethod(e,t)},supportsProperty:function(e,t){return!!this.getProperty(e,t)},supportsCssProperty:function(e){return!!this.getCssProperty(e)},testPrefix:function(){var e=h.promises.prefix;if(null===e){var t=new p,r=this.getPrefix();r?t.resolve(r):t.reject(),e=h.promises.prefix=t.promise}return e},testMethod:function(e,t){t=t||o;var r=t.tagName,n=h.promises.method[r]=h.promises.method[r]||{},i=n[e]=h.promises.method[r][e]||null;if(null===i){var s=new p,l=this.getMethod(e,t);l?s.resolve(l):s.reject(),i=h.promises.method[r][e]=s.promise}return i},testProperty:function(e,t){t=t||o;var r=t.tagName,n=h.promises.property[r]=h.promises.property[r]||{},i=n[e]=h.promises.property[r][e]||null;if(null===i){var s=new p,l=this.getProperty(e,t);l?s.resolve(l):s.reject(),i=h.promises.property[r][e]=s.promise}return i},testCssProperty:function(e){var t=h.promises.css[e]||null;if(null===t){var r=new p,n=this.getCssProperty(e);n?r.resolve(n):r.reject(),t=h.promises.css[e]=r.promise}return t},addTest:function(e,t){return this.test[e]=function(){var r=h.promises.test[e]||null;if(null===r){var n=new p,o=Array.prototype.slice.call(arguments);o.splice(0,0,n),t.apply(null,o),r=h.promises.test[e]=n.promise}return r}}})}),function(e){window.qoopido.register("function/merge",e)}(function(e,t,r,n,o,i,s){"use strict";return function l(){var e,t,r,n,o,i=arguments[0];for(e=1;(t=arguments[e])!==s;e++)for(r in t)n=i[r],o=t[r],o!==s&&(null!==o&&"object"==typeof o?(n=o.length!==s?n&&"object"==typeof n&&n.length!==s?n:[]:n&&"object"==typeof n&&n.length===s?n:{},i[r]=l(n,o)):i[r]=o);return i}}),function(e){window.qoopido.register("function/unique/uuid",e)}(function(e,t,r,n,o,i,s){"use strict";function l(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(p,function(e){var t=16*Math.random()|0,r="x"===e?t:3&t|8;return r.toString(16)})}var u={},p=new RegExp("[xy]","g");return function(){var e;do e=l();while("undefined"!=typeof u[e]);return u[e]=!0,e}}),function(e){window.qoopido.registerSingleton("hook/event",e,["../base"])}(function(e,t,r,n,o,i,s){"use strict";function l(e,t,r){for(var n,o=0;(n=r[o])!==s;o++)e[n]=t[n];e._properties=e._properties.concat(r)}var u={general:{properties:"type altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which path".split(" "),process:function(e,t){var r;if(e.originalEvent=t,e.isDefaultPrevented=t.defaultPrevented?!0:!1,e.isPropagationStopped=t.cancelBubble?!0:!1,e.metaKey=t.metaKey&&t.metaKey!==!1?!0:!1,e.target||(e.target=t.srcElement||i),3===e.target.nodeType&&(e.target=e.target.parentNode),!e.path){e.path=[],r=e.target;do e.path.push(r);while(r=r.parentNode);e.path.push(o)}}},mouse:{regex:new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"),properties:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement dataTransfer".split(" "),process:function(e,t){var r,n,o;n=t.fromElement,o=t.button,null===e.pageX&&null!==t.clientX&&(r=e.target.ownerDocument||i,r=r.documentElement||r.body,e.pageX=t.clientX+(r.scrollLeft||0)-(r.clientLeft||0),e.pageY=t.clientY+(r.scrollTop||0)-(r.clientTop||0)),!e.relatedTarget&&n&&(e.relatedTarget=n===e.target?t.toElement:n),e.which||o===s||(e.which=1&o?1:2&o?3:4&o?2:0)}},key:{regex:new RegExp("^(?:key)"),properties:"char charCode key keyCode".split(" "),process:function(e,t){null===e.which&&(e.which=null!==t.charCode?t.charCode:t.keyCode)}}};return e.base.extend({add:function(e,t){return e&&t&&u[e]&&(u[e]=t),this},get:function(e){return e&&u[e]?u[e]:null},process:function(e,t){var r,n,o;for(r in u)n=u[r],o=!n.regex||n.regex.test(t.type),o&&(n.properties&&l(e,t,n.properties),n.process&&n.process(e,t),n.delegate&&(e.delegate=n.delegate))}})}),function(e){var t=["../base","../support"];window.getComputedStyle||t.push("../polyfill/window/getcomputedstyle"),window.qoopido.registerSingleton("hook/css",e,t)}(function(e,t,r,n,o,i,s){"use strict";var l=e.support,u=o.getComputedStyle||e["polyfill/window/getcomputedstyle"],p={general:{get:function(e,t){return u(e,null).getPropertyValue(t[0])},set:function(e,t,r){e.style[t[1]]=r}},opacity:l.supportsCssProperty("opacity")?null:{regex:new RegExp("alpha\\(opacity=(.*)\\)","i"),get:function(e,t,r){return r=u(e,null).getPropertyValue("filter").toString().match(this.regex),r=r?r[1]/100:1},set:function(e,t,r){var n=e.style;n.zoom=1,n.filter="alpha(opacity="+(100*r+.5>>0)+")"}}};return e.base.extend({add:function(e,t){return e&&t&&p[e]&&(p[e]=t),this},get:function(e){return e&&p[e]?p[e]:null},process:function(e,t,r,n){var o;return r=l.getCssProperty(r,t)||null,r?((o=this.get(r[1]))&&o[e]||this.get("general")[e])(t,r,n):void 0}})}),function(e){window.qoopido.register("dom/event",e,["../base","../hook/event"])}(function(e,t,r,n,o,i,s){"use strict";var l=e["hook/event"];return e.base.extend({originalEvent:null,isDelegate:!1,isDefaultPrevented:!1,isPropagationStopped:!1,isImmediatePropagationStopped:!1,_properties:null,_constructor:function(e){var t=this;return t._properties=[],t._obtain(e),t},_obtain:function(e){l.process(this,e)},_dispose:function(){for(var e,t=this,r=0;(e=t._properties[r])!==s;r++)delete t[e];delete t.delegate,t.originalEvent=null,t.isDelegate=!1,t.isDefaultPrevented=!1,t.isPropagationStopped=!1,t.isImmediatePropagationStopped=!1,t._properties.length=0},preventDefault:function(){var e=this,t=e.originalEvent;t.cancelable!==!1&&(e.isDefaultPrevented=!0,t.preventDefault?t.preventDefault():t.returnValue=!1)},stopPropagation:function(){var e=this,t=e.originalEvent;e.isPropagationStopped=!0,t.stopPropagation&&t.stopPropagation(),t.cancelBubble=!0},stopImmediatePropagation:function(){var e=this,t=e.originalEvent;e.isImmediatePropagationStopped=!0,t.stopImmediatePropagation&&t.stopImmediatePropagation(),e.stopPropagation()}})}),function(e){var t=["../base","../function/unique/uuid","../hook/css","./event"];window.CustomEvent||t.push("../polyfill/window/customevent"),window.addEventListener||t.push("../polyfill/window/addeventlistener"),window.removeEventListener||t.push("../polyfill/window/removeeventlistener"),window.dispatchEvent||t.push("../polyfill/window/dispatchevent"),Element.prototype.matches||t.push("../polyfill/element/matches"),document.querySelector||t.push("../polyfill/document/queryselector"),document.querySelectorAll||t.push("../polyfill/document/queryselectorall"),String.prototype.trim||t.push("../polyfill/string/trim"),window.qoopido.register("dom/element",e,t)}(function(e,t,r,n,o,i,s){"use strict";function l(e){var t,r,n;for(t in E)r=E[t],(!r.regex||r.regex.test(e))&&(n=r);return n}function u(e,t,r){var n=this,o=l(e),s=i.createEvent(o.type);s[o.method](e,"load"===e?!1:!0,!0,t),r&&(s._quid=r,s.isDelegate=!0),n.element.dispatchEvent(s)}function p(e){var t;if("string"==typeof e)try{w.test(e)===!0?(t=e.replace(w,"$1").toLowerCase(),e=i.createElement(t)):e=i.querySelector(e)}catch(r){e=null}if(!e)throw new Error("[Qoopido.js] Element could not be resolved");return e}function c(e){return Array.prototype.concat.apply([],Array.prototype.splice.call(e,0)).join(" ").split(_)}function a(e,t){for(var r,n=0;(r=e.path[n])!==s;n++){if(r.matches(t))return e.currentTarget=r,!0;if(r===e.currentTarget)break}return!1}var f="object",d="string",m=e["function/unique/uuid"],g=i.getElementsByTagName("head")[0],h="textContent"in i.createElement("a")?"textContent":"innerText",v="undefined"!=typeof g.previousElementSibling?function(){return this.previousElementSibling}:function(){for(var e=this;e=e.previousSibling;)if(1===e.nodeType)return e},y="undefined"!=typeof g.nextElementSibling?function(){return this.nextElementSibling}:function(){for(var e=this;e=e.nextSibling;)if(1===e.nodeType)return e},w=new RegExp("^<(\\w+)\\s*/>$"),b=new RegExp("^[^-]+"),_=new RegExp(" +","g"),x=e["pool/module"]&&e["pool/module"].create(e["dom/event"],null,!0)||null,j=e["hook/css"],P={},E={custom:{type:"CustomEvent",method:"initCustomEvent"},html:{regex:new RegExp("^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$"),type:"HTMLEvents",method:"initEvent"},mouse:{regex:new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"),type:"MouseEvents",method:"initMouseEvent"}};return e.base.extend({type:null,element:null,_listener:null,_constructor:function(e,t,r){var n,o=this;return e=p(e),n=e._quid,n?o=P[n]:(n=e._quid=m(),o.type=e.tagName,o.element=e,o._listener={},P[n]=o),"object"==typeof t&&null!==t&&o.setAttributes(t),"object"==typeof r&&null!==r&&o.setStyles(r),o!==this&&this.dispose&&this.dispose(),o},_obtain:function(e,t,r){this._constructor(e,t,r)},_dispose:function(){var e,t,r=this;for(e in r._listener)t=e.match(b),r.element.removeEventListener(t,r._listener[e]),delete r._listener[e];r.type=null,r.element=null},getContent:function(e){var t=this.element;return e&&e!==!1?t.innerHTML:t[h]},setContent:function(e,t){var r=this,n=r.element;return t&&t!==!1?n.innerHTML=e:n[h]=e,r},getAttribute:function(e){var t=this;return e&&typeof e===d?t.element.getAttribute(e):void 0},getAttributes:function(){for(var e,t=this,r={},n=c(arguments),o=0;(e=n[o])!==s;o++)r[e]=t.element.getAttribute(e);return r},setAttribute:function(e,t){var r=this;return e&&typeof e===d&&r.element.setAttribute(e,t),r},setAttributes:function(e){var t,r=this;if(e&&typeof e===f&&!e.length)for(t in e)r.element.setAttribute(t,e[t]);return r},removeAttribute:function(e){var t=this;return e&&typeof e===d&&t.element.removeAttribute(e),t},removeAttributes:function(){for(var e,t=this,r=c(arguments),n=0;(e=r[n])!==s;n++)t.element.removeAttribute(e);return t},getStyle:function(e){var t=this;return e&&typeof e===d?j.process("get",t.element,e):void 0},getStyles:function(){for(var e,t=this,r={},n=c(arguments),o=0;(e=n[o])!==s;o++)r[e]=j.process("get",t.element,e);return r},setStyle:function(e,t){var r=this;return e&&typeof e===d&&j.process("set",r.element,e,t),r},setStyles:function(e){var t,r=this;if(e&&typeof e===f&&!e.length)for(t in e)j.process("set",r.element,t,e[t]);return r},removeStyle:function(e){var t=this;return e&&typeof e===d&&t.setStyle(e,""),t},removeStyles:function(){for(var e,t=this,r=c(arguments),n=0;(e=r[n])!==s;n++)t.setStyle(e,"");return t},siblings:function(e){for(var t=this.element,r=t.parentNode.firstChild,n=[];r;r=y.call(r))r===t||e&&!r.matches(e)||n.push(r);return n},siblingsBefore:function(e){for(var t=this.element.previousSibling,r=[];t;t=v.call(t))(!e||t.matches(e))&&r.push(t);return r},siblingsAfter:function(e){for(var t=this.element.nextSibling,r=[];t;t=y.call(t))(!e||t.matches(e))&&r.push(t);return r},previous:function(e){var t=v.call(this.element);if(!e)return t;for(;t;t=v.call(t))if(t.matches(e))return t},next:function(e){var t=y.call(this.element);if(!e)return t;for(;t;t=y.call(t))if(t.matches(e))return t},find:function(e){var t,r,n=this.element;return e=e.trim(),">"===e.charAt(0)?(t=n._quid,n.setAttribute("data-quid",t),e='[data-quid="'+t+'"] '+e,r=n.parentNode.querySelectorAll(e),n.removeAttribute("data-quid")):r=n.querySelectorAll(e),r},parent:function(e){var t;if(!e)return this.element.parentNode;for(t=this.element;t;t=t.parentNode)if(t.matches(e))return t},parents:function(e){for(var t=this.element.parentNode,r=[];t;t=t.parentNode){if(9===t.nodeType)return r;1===t.nodeType&&(!e||t.matches(e))&&r.push(t)}},isVisible:function(){var e=this,t=e.element;return!(t.offsetWidth<=0&&t.offsetHeight<=0||"hidden"===e.getStyle("visibility")||e.getStyle("opacity")<=0)},hasClass:function(e){return e?new RegExp("(?:^|\\s)"+e+"(?:\\s|$)").test(this.element.className):!1},addClass:function(e){var t=this;return e&&!t.hasClass(e)&&(t.element.className+=t.element.className?" "+e:e),t},removeClass:function(e){var t=this;return e&&t.hasClass(e)&&(t.element.className=t.element.className.replace(new RegExp("(?:^|\\s)"+e+"(?!\\S)"),"")),t},toggleClass:function(e){var t=this;return e&&(t.hasClass(e)?t.removeClass(e):t.addClass(e)),t},prepend:function(e){var t=this,r=t.element;if(e)try{e=e.element||p(e),r.firstChild?r.insertBefore(e,r.firstChild):t.append(e)}catch(n){r.insertAdjacentHTML("afterBegin",e)}return t},append:function(e){var t=this,r=t.element;if(e)try{r.appendChild(e.element||p(e))}catch(n){r.insertAdjacentHTML("beforeEnd",e)}return t},prependTo:function(e){var t=this,r=t.element;return e&&((e=e.element||p(e)).firstChild?e.insertBefore(r,e.firstChild):t.appendTo(e)),t},appendTo:function(e){var t=this;return e&&(e.element||p(e)).appendChild(t.element),t},insertBefore:function(e){var t=this,r=t.element;return e&&(e=e.element||p(e)).parentNode.insertBefore(r,e),t},insertAfter:function(e){var t=this,r=t.element;return e&&((e=e.element||p(e)).nextSibling?e.parentNode.insertBefore(r,e.nextSibling):t.appendTo(e.parentNode)),t},replace:function(e){var t=this,r=t.element;return e&&(e=e.element||p(e)).parentNode.replaceChild(r,e),t},replaceWith:function(e){var t=this,r=t.element;return e&&(e=e.element||p(e),r.parentNode.replaceChild(e,r)),t},remove:function(){var e=this,t=e.element;return t.parentNode.removeChild(t),e},on:function(t){var r,n=this,o=n.element,i=arguments.length>2?arguments[1]:null,l=arguments.length>2?arguments[2]:arguments[1],p=l._quid||(l._quid=m()),c=0;for(t=t.split(" ");(r=t[c])!==s;c++){var f=r+"-"+p,d=function(t){var r;t=x&&x.obtain(t)||e["dom/event"].create(t),t.isPropagationStopped||(r=t.delegate,t._quid=m(),(!i||a(t,i))&&l.call(t.currentTarget,t,t.originalEvent.detail),r&&(delete t.delegate,u.call(n,r))),t.dispose&&t.dispose()};d.type=r,n._listener[f]=d,o.addEventListener(r,d)}return n},one:function(e){var t=this,r=arguments.length>3||"string"==typeof arguments[1]?arguments[1]:null,n=arguments.length>3||"function"==typeof arguments[2]?arguments[2]:arguments[1],o=(arguments.length>3?arguments[3]:arguments[2])!==!1,i=function(r){t.off(o===!0?r.type:e,i),n.call(this,r,r.originalEvent.detail)};return n._quid=i._quid=m(),r?t.on(e,r,i):t.on(e,i),t},off:function(e,t){var r,n,o,i=this,l=i.element,u=0;for(e=e.split(" ");(r=e[u])!==s;u++)n=t._quid&&r+"-"+t._quid||null,o=n&&i._listener[n]||null,o?(l.removeEventListener(r,o),delete i._listener[n]):l.removeEventListener(r,t);return i},emit:function(e,t){var r=this;return u.call(r,e,t),r}})}),function(e){window.qoopido.register("dom/element/emerge",e,["../element","../../function/merge","../../function/unique/uuid"])}(function(e,t,r,n,o,i,s){"use strict";function l(e){var t,r=v[e];for(t in r)"length"!==t&&c.call(r[t]);0===r.length&&(o.element.clearInterval(h[e]),delete h[e])}function u(){g.left=0,g.top=0,g.right=o.innerWidth||m.clientWidth,g.bottom=o.innerHeight||m.clientHeight}function p(){var e=this,t=e._settings.threshold,r=t!==s?t:m.clientWidth*e._settings.auto,n=t!==s?t:m.clientHeight*e._settings.auto;e._viewport.left=g.left-r,e._viewport.top=g.top-n,e._viewport.right=g.right+r,e._viewport.bottom=g.bottom+n}function c(){var e,t=this,r=!1,n=2;!t.isVisible()||"hidden"===t.getStyle("visibility")&&t._settings.visibility!==!1||(e=t.element.getBoundingClientRect(),(e.bottom>=t._viewport.top&&e.bottom<=t._viewport.bottom||e.top>=t._viewport.top&&e.top<=t._viewport.bottom||t._viewport.bottom>=e.top&&t._viewport.bottom<=e.bottom||t._viewport.top>=e.top&&t._viewport.top<=e.bottom)&&(e.left>=t._viewport.left&&e.left<=t._viewport.right||e.right>=t._viewport.left&&e.right<=t._viewport.right||t._viewport.left>=e.left&&t._viewport.left<=e.right||t._viewport.right>=e.left&&t._viewport.right<=e.right)&&((0===t._settings.threshold||(e.bottom>=g.top&&e.bottom<=g.bottom||e.top>=g.top&&e.top<=g.bottom||g.bottom>=e.top&&g.bottom<=e.bottom||g.top>=e.top&&g.top<=e.bottom)&&(e.left>=g.left&&e.left<=g.right||e.right>=g.left&&e.right<=g.right||g.left>=e.left&&g.left<=e.right||g.right>=e.left&&g.right<=e.right))&&(n=1),r=!0)),(r!==t._state||r===!0&&n!==t._priority)&&a.call(t,r,n)}function a(e,t){var r=this;r._state=e,r._priority=t,r._settings.recur!==!0&&r.remove(),e===!0?r.emit(y,t):r.emit(w)}var f,d={interval:50,threshold:"auto",recur:!0,auto:1,visibility:!0},m=o.document.documentElement,g={},h={},v={},y="emerged",w="demerged",b="resize orientationchange";if(o=e["dom/element"].create(o),"CSS1Compat"!==i.compatMode)throw"[Qoopido.js] Not in standards mode";return f=e["dom/element"].extend({_quid:null,_viewport:null,_settings:null,_state:null,_priority:null,_constructor:function(t,r){var n=f._parent._constructor.call(this,t);return r=e["function/merge"]({},d,r||{}),"auto"===r.threshold&&delete r.threshold,h[r.interval]===s&&(v[r.interval]=v[r.interval]||{length:0},h[r.interval]=o.element.setInterval(function(){l(r.interval)},r.interval)),n._quid=e["function/unique/uuid"](),n._viewport={},n._settings=r,n._state=!1,n._priority=2,v[r.interval][n._quid]=n,v[r.interval].length++,o.on(b,function(){p.call(n)}),p.call(n),n},remove:function(){var e=this;delete v[e._settings.interval][e._quid],v[e._settings.interval].length--}}),o.on(b,u),u(),f}); \ No newline at end of file diff --git a/dist/latest/min/packages/qoopido.emitter.js b/dist/latest/min/packages/qoopido.emitter.js new file mode 100644 index 00000000..adca17d7 --- /dev/null +++ b/dist/latest/min/packages/qoopido.emitter.js @@ -0,0 +1,2 @@ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +!function(e,t,r,n,o){"use strict";function i(e,i,s,c){var a,d=e.split("/");return l[e]?l[e]:(a=function(){if(s)for(var a,m,_=d.slice(0,-1).join("/"),g=0;(a=s[g])!==o;g++)m=f.test(a),m&&(a=p(_+"/"+a)),!l[a]&&arguments[g]&&(l[a]=arguments[g]),m&&!l[a]&&"undefined"!=typeof console&&console.error("".concat("[Qoopido.js] ",e,": Could not load dependency ",a));return l[e]=i(l,u,d,t,r,n,o),c&&c(l[e]),l[e]},void("undefined"!=typeof module&&module.exports?module.exports=define(a):"function"==typeof define&&define.amd?s?define(s,a):define(a):a()))}function s(e,t,r){i(e,t,r,function(t){l[e]=t.create()})}function p(e){for(var t;(t=e.replace(d,""))!==e;)e=t;return e.replace(m,"")}var c=r.qoopido||(r.qoopido={}),u=c.shared||(c.shared={}),l=c.modules||(c.modules={}),a=[],f=new RegExp("^\\.+\\/"),d=new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."),m=new RegExp("(^\\/)|\\.\\/","g");c.register=i,c.registerSingleton=s,Object.create||a.push("./polyfill/object/create"),Object.getOwnPropertyNames||a.push("./polyfill/object/getownpropertynames"),Object.getOwnPropertyDescriptor&&function(){try{return Object.getOwnPropertyDescriptor({x:0},"x"),!0}catch(e){return!1}}()||a.push("./polyfill/object/getownpropertydescriptor"),i("base",e,a)}(function(e,t,r,n,o,i,s){"use strict";function p(e){for(var t,r={},n=Object.getOwnPropertyNames(e),o=0;(t=n[o])!==s;o++)r[t]=Object.getOwnPropertyDescriptor(e,t);return r}function c(){throw new Error("[Qoopido.js] Operation prohibited")}return{create:function(){var e,t=Object.create(this,p(this));return t._constructor&&(e=t._constructor.apply(t,arguments)),t.create=t.extend=c,e||t},extend:function(e,t){var r;return e=e||{},t=t===!0,e._parent=this,r=Object.create(this,p(e)),t===!0&&(r.extend=c),r}}},navigator,this,document),function(e){window.qoopido.register("emitter",e,["./base"])}(function(e,t,r,n,o,i,s){"use strict";function p(e,t){var r=t.charAt(0).toUpperCase()+t.slice(1);return e._mapped[t]=e[t],function(){var n,o=Array.prototype.slice.call(arguments);return e.emit.apply(e,["pre"+r,o]),n=e._mapped[t].apply(e,o),e.emit.apply(e,["post"+r,o,n]),n}}var c=/^(_|extend$|create$|on$|one$|off$|emit$|get.+)/;return e.base.extend({_mapped:null,_listener:null,_temp:null,_constructor:function(){var e,t=this;t._mapped={},t._listener={};for(e in t)"function"==typeof t[e]&&c.test(e)===!1&&(t[e]=p(t,e));return t},on:function(e,t){var r,n=this,o=0;for(e=e.split(" ");(r=e[o])!==s;o++)(n._listener[r]=n._listener[r]||[]).push(t);return n},one:function(e,t,r){r=r!==!1;var n=this;return n.on(e,function o(i){n.off(r===!0?i:e,o),t.apply(this,arguments)}),n},off:function(e,t){var r,n,o,i=this,p=0;if(e)for(e=e.split(" ");(r=e[p])!==s;p++)if(i._listener[r]=i._listener[r]||[],t)for(n=0;(o=i._listener[r][n])!==s;n++)o===t&&(i._listener[r].splice(n,1),n--);else i._listener[r].length=0;else for(r in i._listener)i._listener[r].length=0;return i},emit:function(e){var t,r=this,n=0;if(e!==s){for(r._listener[e]=r._listener[e]||[],r._temp=r._listener[e].slice();(t=r._temp[n])!==s;n++)t.apply(r,arguments);r._temp.length=0}return r}})}); \ No newline at end of file diff --git a/dist/latest/min/packages/qoopido.emitter.legacy.js b/dist/latest/min/packages/qoopido.emitter.legacy.js new file mode 100644 index 00000000..402dfe7c --- /dev/null +++ b/dist/latest/min/packages/qoopido.emitter.legacy.js @@ -0,0 +1,2 @@ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +!function(e,t){t.register?t.register("polyfill/object/defineproperty",e):(t.modules=t.modules||{})["polyfill/object/defineproperty"]=e()}(function(e,t,r,o,n,i,c){"use strict";if(!Object.defineProperty||!function(){try{return Object.defineProperty({},"x",{}),!0}catch(e){return!1}}()){var p=Object.defineProperty,s=Object.prototype.__defineGetter__,u=Object.prototype.__defineSetter__;Object.defineProperty=function(e,t,r){if(p)try{return p(e,t,r)}catch(o){}if(e!==Object(e))throw new TypeError("Object.defineProperty called on non-object");return s&&"get"in r&&s.call(e,t,r.get),u&&"set"in r&&u.call(e,t,r.set),"value"in r&&(e[t]=r.value),e}}return Object.defineProperty},window.qoopido=window.qoopido||{}),function(e,t){if(t.register){var r=[];Object.defineProperty&&function(){try{return Object.defineProperty({},"x",{}),!0}catch(e){return!1}}()||r.push("./defineproperty"),t.register("polyfill/object/defineproperties",e,r)}else(t.modules=t.modules||{})["polyfill/object/defineproperties"]=e()}(function(e,t,r,o,n,i,c){"use strict";return Object.defineProperties||(Object.defineProperties=function(e,t){if(e!==Object(e))throw new TypeError("Object.defineProperties called on non-object");var r;for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&Object.defineProperty(e,r,t[r]);return e}),Object.defineProperties},window.qoopido=window.qoopido||{}),function(e,t){if(t.register){var r=[];Object.defineProperties||r.push("./defineproperties"),t.register("polyfill/object/create",e,r)}else(t.modules=t.modules||{})["polyfill/object/create"]=e()}(function(e,t,r,o,n,i,c){"use strict";return Object.create||(Object.create=function(e,t){function r(){}if("object"!=typeof e)throw new TypeError;r.prototype=e;var o=new r;if(e&&(o.constructor=r),arguments.length>1){if(t!==Object(t))throw new TypeError;Object.defineProperties(o,t)}return o}),Object.create},window.qoopido=window.qoopido||{}),function(e,t){t.register?t.register("polyfill/object/getownpropertynames",e):(t.modules=t.modules||{})["polyfill/object/getownpropertynames"]=e()}(function(e,t,r,o,n,i,c){"use strict";return Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(e){if(e!==Object(e))throw new TypeError("Object.getOwnPropertyNames called on non-object");var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.push(t);return r}),Object.getOwnPropertyNames},window.qoopido=window.qoopido||{}),function(e,t){t.register?t.register("polyfill/object/getownpropertydescriptor",e):(t.modules=t.modules||{})["polyfill/object/getownpropertydescriptor"]=e()}(function(e,t,r,o,n,i,c){"use strict";if(!Object.getOwnPropertyDescriptor||!function(){try{return Object.getOwnPropertyDescriptor({x:0},"x"),!0}catch(e){return!1}}()){var p=Object.getOwnPropertyDescriptor;Object.getOwnPropertyDescriptor=function(e,t){if(e!==Object(e))throw new TypeError;try{return p.call(Object,e,t)}catch(r){}return Object.prototype.hasOwnProperty.call(e,t)?{value:e[t],enumerable:!0,writable:!0,configurable:!0}:void 0}}return Object.getOwnPropertyDescriptor},window.qoopido=window.qoopido||{}),function(e,t,r,o,n){"use strict";function i(e,i,c,s){var f,d=e.split("/");return l[e]?l[e]:(f=function(){if(c)for(var f,y,b=d.slice(0,-1).join("/"),j=0;(f=c[j])!==n;j++)y=a.test(f),y&&(f=p(b+"/"+f)),!l[f]&&arguments[j]&&(l[f]=arguments[j]),y&&!l[f]&&"undefined"!=typeof console&&console.error("".concat("[Qoopido.js] ",e,": Could not load dependency ",f));return l[e]=i(l,u,d,t,r,o,n),s&&s(l[e]),l[e]},void("undefined"!=typeof module&&module.exports?module.exports=define(f):"function"==typeof define&&define.amd?c?define(c,f):define(f):f()))}function c(e,t,r){i(e,t,r,function(t){l[e]=t.create()})}function p(e){for(var t;(t=e.replace(d,""))!==e;)e=t;return e.replace(y,"")}var s=r.qoopido||(r.qoopido={}),u=s.shared||(s.shared={}),l=s.modules||(s.modules={}),f=[],a=new RegExp("^\\.+\\/"),d=new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."),y=new RegExp("(^\\/)|\\.\\/","g");s.register=i,s.registerSingleton=c,Object.create||f.push("./polyfill/object/create"),Object.getOwnPropertyNames||f.push("./polyfill/object/getownpropertynames"),Object.getOwnPropertyDescriptor&&function(){try{return Object.getOwnPropertyDescriptor({x:0},"x"),!0}catch(e){return!1}}()||f.push("./polyfill/object/getownpropertydescriptor"),i("base",e,f)}(function(e,t,r,o,n,i,c){"use strict";function p(e){for(var t,r={},o=Object.getOwnPropertyNames(e),n=0;(t=o[n])!==c;n++)r[t]=Object.getOwnPropertyDescriptor(e,t);return r}function s(){throw new Error("[Qoopido.js] Operation prohibited")}return{create:function(){var e,t=Object.create(this,p(this));return t._constructor&&(e=t._constructor.apply(t,arguments)),t.create=t.extend=s,e||t},extend:function(e,t){var r;return e=e||{},t=t===!0,e._parent=this,r=Object.create(this,p(e)),t===!0&&(r.extend=s),r}}},navigator,this,document),function(e){window.qoopido.register("emitter",e,["./base"])}(function(e,t,r,o,n,i,c){"use strict";function p(e,t){var r=t.charAt(0).toUpperCase()+t.slice(1);return e._mapped[t]=e[t],function(){var o,n=Array.prototype.slice.call(arguments);return e.emit.apply(e,["pre"+r,n]),o=e._mapped[t].apply(e,n),e.emit.apply(e,["post"+r,n,o]),o}}var s=/^(_|extend$|create$|on$|one$|off$|emit$|get.+)/;return e.base.extend({_mapped:null,_listener:null,_temp:null,_constructor:function(){var e,t=this;t._mapped={},t._listener={};for(e in t)"function"==typeof t[e]&&s.test(e)===!1&&(t[e]=p(t,e));return t},on:function(e,t){var r,o=this,n=0;for(e=e.split(" ");(r=e[n])!==c;n++)(o._listener[r]=o._listener[r]||[]).push(t);return o},one:function(e,t,r){r=r!==!1;var o=this;return o.on(e,function n(i){o.off(r===!0?i:e,n),t.apply(this,arguments)}),o},off:function(e,t){var r,o,n,i=this,p=0;if(e)for(e=e.split(" ");(r=e[p])!==c;p++)if(i._listener[r]=i._listener[r]||[],t)for(o=0;(n=i._listener[r][o])!==c;o++)n===t&&(i._listener[r].splice(o,1),o--);else i._listener[r].length=0;else for(r in i._listener)i._listener[r].length=0;return i},emit:function(e){var t,r=this,o=0;if(e!==c){for(r._listener[e]=r._listener[e]||[],r._temp=r._listener[e].slice();(t=r._temp[o])!==c;o++)t.apply(r,arguments);r._temp.length=0}return r}})}); \ No newline at end of file diff --git a/dist/latest/min/packages/qoopido.lazyimage.js b/dist/latest/min/packages/qoopido.lazyimage.js new file mode 100644 index 00000000..08a09bb0 --- /dev/null +++ b/dist/latest/min/packages/qoopido.lazyimage.js @@ -0,0 +1,2 @@ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +!function(e,t,r,n,o){"use strict";function i(e,i,s,u){var c,d=e.split("/");return p[e]?p[e]:(c=function(){if(s)for(var c,m,h=d.slice(0,-1).join("/"),g=0;(c=s[g])!==o;g++)m=f.test(c),m&&(c=l(h+"/"+c)),!p[c]&&arguments[g]&&(p[c]=arguments[g]),m&&!p[c]&&"undefined"!=typeof console&&console.error("".concat("[Qoopido.js] ",e,": Could not load dependency ",c));return p[e]=i(p,a,d,t,r,n,o),u&&u(p[e]),p[e]},void("undefined"!=typeof module&&module.exports?module.exports=define(c):"function"==typeof define&&define.amd?s?define(s,c):define(c):c()))}function s(e,t,r){i(e,t,r,function(t){p[e]=t.create()})}function l(e){for(var t;(t=e.replace(d,""))!==e;)e=t;return e.replace(m,"")}var u=r.qoopido||(r.qoopido={}),a=u.shared||(u.shared={}),p=u.modules||(u.modules={}),c=[],f=new RegExp("^\\.+\\/"),d=new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."),m=new RegExp("(^\\/)|\\.\\/","g");u.register=i,u.registerSingleton=s,Object.create||c.push("./polyfill/object/create"),Object.getOwnPropertyNames||c.push("./polyfill/object/getownpropertynames"),Object.getOwnPropertyDescriptor&&function(){try{return Object.getOwnPropertyDescriptor({x:0},"x"),!0}catch(e){return!1}}()||c.push("./polyfill/object/getownpropertydescriptor"),i("base",e,c)}(function(e,t,r,n,o,i,s){"use strict";function l(e){for(var t,r={},n=Object.getOwnPropertyNames(e),o=0;(t=n[o])!==s;o++)r[t]=Object.getOwnPropertyDescriptor(e,t);return r}function u(){throw new Error("[Qoopido.js] Operation prohibited")}return{create:function(){var e,t=Object.create(this,l(this));return t._constructor&&(e=t._constructor.apply(t,arguments)),t.create=t.extend=u,e||t},extend:function(e,t){var r;return e=e||{},t=t===!0,e._parent=this,r=Object.create(this,l(e)),t===!0&&(r.extend=u),r}}},navigator,this,document),function(e){window.qoopido.register("polyfill/string/ucfirst",e)}(function(e,t,r,n,o,i,s){"use strict";return String.prototype.ucfirst||(String.prototype.ucfirst=function(){var e=this;return e.charAt(0).toUpperCase()+e.slice(1)}),String.prototype.ucfirst}),function(e){window.qoopido.register("polyfill/string/lcfirst",e)}(function(e,t,r,n,o,i,s){"use strict";return String.prototype.lcfirst||(String.prototype.lcfirst=function(){var e=this;return e.charAt(0).toLowerCase()+e.slice(1)}),String.prototype.lcfirst}),function(e){window.qoopido.register("polyfill/window/promise",e)}(function(e,t,r,n,o,i,s){"use strict";function l(e,t){var r=P.push([e,t]);1===r&&u()}function u(){o.setTimeout(a,1)}function a(){for(var e,t=0;(e=P[t])!==s;t++)e[0](e[1]);P.length=0}function p(e,t){var r,n=null;try{if(e===t)throw new TypeError("A promises callback cannot return that same promise.");if(("function"==typeof t||"object"==typeof t&&null!==t)&&(n=t.then,"function"==typeof n))return n.call(t,function(n){return r?!0:(r=!0,void(t!==n?d(e,n):m(e,n)))},function(t){return r?!0:(r=!0,void h(e,t))}),!0}catch(o){return r?!0:(h(e,o),!0)}return!1}function c(e,t){function r(e){d(t,e)}function n(e){h(t,e)}try{e(r,n)}catch(o){n(o)}}function f(e,t,r,n){var o,i,s,l,u="function"==typeof r;if(u)try{o=r(n),s=!0}catch(a){l=!0,i=a}else o=n,s=!0;p(t,o)||(u&&s?d(t,o):l?h(t,i):e===E?d(t,o):e===S&&h(t,o))}function d(e,t){e===t?m(e,t):p(e,t)||m(e,t)}function m(e,t){e._state===_&&(e._state=x,e._detail=t,l(g,e))}function h(e,t){e._state===_&&(e._state=x,e._detail=t,l(v,e))}function g(e){w(e,e._state=E)}function v(e){w(e,e._state=S)}function y(e,t,r,n){var o=e._subscribers,i=o.length;o[i]=t,o[i+E]=r,o[i+S]=n}function w(e,t){for(var r,n,o=e._subscribers,i=e._detail,l=0;(r=o[l])!==s;l+=3)n=o[l+t],f(t,r,n,i);e._subscribers=null}function b(e){var t=this;if("function"!=typeof e)throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");t._subscribers=[],c(e,t)}var _=void 0,x=0,E=1,S=2,P=[];return b.prototype={_state:s,_detail:s,_subscribers:s,then:function(e,t){var r=this,n=new b(function(){});return r._state?l(function(){f(r._state,n,arguments[r._state-1],r._detail)}):y(r,n,e,t),n},"catch":function(e){return this.then(null,e)}},o.Promise||(o.Promise=b),o.Promise}),function(e){var t=[];window.Promise||t.push("../polyfill/window/promise"),window.qoopido.register("promise/all",e,t)}(function(e,t,r,n,o,i,s){"use strict";return function(e){if("[object Array]"!==Object.prototype.toString.call(e))throw new TypeError("You must pass an array to all.");return new o.Promise(function(t,r){function n(e){return function(t){o(e,t)}}function o(e,r){l[e]=r,0===--u&&t(l)}var i,l=[],u=e.length,a=0;for(0===u&&t([]);(i=e[a])!==s;a++)i&&"function"==typeof i.then?i.then(n(a),r):o(a,i)})}}),function(e){var t=[];window.Promise||t.push("../polyfill/window/promise"),window.qoopido.register("promise/defer",e,t)}(function(e,t,r,n,o,i,s){"use strict";return function(){var e=this;e.promise=new o.Promise(function(t,r){e.resolve=t,e.reject=r})}}),function(e){var t=["./base","./promise/all","./promise/defer"];String.prototype.ucfirst||t.push("./polyfill/string/ucfirst"),String.prototype.lcfirst||t.push("./polyfill/string/lcfirst"),window.qoopido.registerSingleton("support",e,t)}(function(e,t,r,n,o,i,s){"use strict";function l(e){return e.replace(c,"$1").lcfirst().replace(f,"").replace(d,h)}var u=e["promise/all"],a=e["promise/defer"],p=new RegExp("^(Moz|WebKit|Khtml|ms|O|Icab)(?=[A-Z])"),c=new RegExp("^(?:webkit|khtml|icab|moz|ms|o)([A-Z])"),f=new RegExp("^-(?:webkit|khtml|icab|moz|ms|o)-"),d=new RegExp("-([a-z])","gi"),m=new RegExp("([A-Z])","g"),h=function(){return arguments[1].ucfirst()},g={prefix:null,method:{},property:{},css:{},promises:{prefix:null,method:{},property:{},css:{},test:{}}};return e.base.extend({test:{},pool:t.pool&&t.pool.dom,testMultiple:function(){for(var e,t=[],r=0;(e=arguments[r])!==s;r++)switch(typeof e){case"string":t.push(this.test[e]());break;case"boolean":var n=new a;e?n.resolve():n.reject(),t.push(n.promise);break;default:t.push(e)}return new u(t)},getPrefix:function(){var e,t=this,r=g.prefix||null;if(null===r){var n=t.pool?t.pool.obtain("div"):i.createElement("div"),o=n.style;r=!1;for(e in o)p.test(e)&&(r=e.match(p)[0]);r===!1&&"WebkitOpacity"in o&&(r="WebKit"),r===!1&&"KhtmlOpacity"in o&&(r="Khtml"),r=g.prefix=r===!1?!1:[r.toLowerCase(),r.toLowerCase().ucfirst(),r],n.dispose&&n.dispose()}return r},getMethod:function(e,t){e=l(e),t=t||o;var r=t.tagName,n=g.method[r]=g.method[r]||{},i=n[e]=g.method[r][e]||null;if(null===i){i=!1;var u,a,p=0,c=e.ucfirst(),f=this.getPrefix();for(u=f!==!1?(e+" "+c+" "+f.join(c+" ")+c).split(" "):[e];(a=u[p])!==s;p++)if(t[a]!==s&&("function"==typeof t[a]||"object"==typeof t[a])){i=a;break}g.method[r][e]=i}return i},getProperty:function(e,t){e=l(e),t=t||o;var r=t.tagName,n=g.property[r]=g.property[r]||{},i=n[e]=g.property[r][e]||null;if(null===i){i=!1;var u,a,p=0,c=e.ucfirst(),f=this.getPrefix();for(u=f!==!1?(e+" "+c+" "+f.join(c+" ")+c).split(" "):[e],p;(a=u[p])!==s;p++)if(t[a]!==s){i=a;break}g.property[r][e]=i}return i},getCssProperty:function(e){e=l(e);var t=this,r=g.css[e]||null;if(null===r){r=!1;var n,o=0,u=t.pool?t.pool.obtain("div"):i.createElement("div"),a=e.ucfirst(),p=this.getPrefix()||[],c=(e+" "+a+" "+p.join(a+" ")+a).split(" "),f="";for(o;(n=c[o])!==s;o++)if(u.style[n]!==s){r=n,o>0&&(f="-");break}r=g.css[e]=r!==!1?[f+r.replace(m,"-$1").toLowerCase(),r]:!1,u.dispose&&u.dispose()}return r},supportsPrefix:function(){return!!this.getPrefix()},supportsMethod:function(e,t){return!!this.getMethod(e,t)},supportsProperty:function(e,t){return!!this.getProperty(e,t)},supportsCssProperty:function(e){return!!this.getCssProperty(e)},testPrefix:function(){var e=g.promises.prefix;if(null===e){var t=new a,r=this.getPrefix();r?t.resolve(r):t.reject(),e=g.promises.prefix=t.promise}return e},testMethod:function(e,t){t=t||o;var r=t.tagName,n=g.promises.method[r]=g.promises.method[r]||{},i=n[e]=g.promises.method[r][e]||null;if(null===i){var s=new a,l=this.getMethod(e,t);l?s.resolve(l):s.reject(),i=g.promises.method[r][e]=s.promise}return i},testProperty:function(e,t){t=t||o;var r=t.tagName,n=g.promises.property[r]=g.promises.property[r]||{},i=n[e]=g.promises.property[r][e]||null;if(null===i){var s=new a,l=this.getProperty(e,t);l?s.resolve(l):s.reject(),i=g.promises.property[r][e]=s.promise}return i},testCssProperty:function(e){var t=g.promises.css[e]||null;if(null===t){var r=new a,n=this.getCssProperty(e);n?r.resolve(n):r.reject(),t=g.promises.css[e]=r.promise}return t},addTest:function(e,t){return this.test[e]=function(){var r=g.promises.test[e]||null;if(null===r){var n=new a,o=Array.prototype.slice.call(arguments);o.splice(0,0,n),t.apply(null,o),r=g.promises.test[e]=n.promise}return r}}})}),function(e){window.qoopido.register("function/merge",e)}(function(e,t,r,n,o,i,s){"use strict";return function l(){var e,t,r,n,o,i=arguments[0];for(e=1;(t=arguments[e])!==s;e++)for(r in t)n=i[r],o=t[r],o!==s&&(null!==o&&"object"==typeof o?(n=o.length!==s?n&&"object"==typeof n&&n.length!==s?n:[]:n&&"object"==typeof n&&n.length===s?n:{},i[r]=l(n,o)):i[r]=o);return i}}),function(e){window.qoopido.register("function/unique/uuid",e)}(function(e,t,r,n,o,i,s){"use strict";function l(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(a,function(e){var t=16*Math.random()|0,r="x"===e?t:3&t|8;return r.toString(16)})}var u={},a=new RegExp("[xy]","g");return function(){var e;do e=l();while("undefined"!=typeof u[e]);return u[e]=!0,e}}),function(e){window.qoopido.registerSingleton("hook/event",e,["../base"])}(function(e,t,r,n,o,i,s){"use strict";function l(e,t,r){for(var n,o=0;(n=r[o])!==s;o++)e[n]=t[n];e._properties=e._properties.concat(r)}var u={general:{properties:"type altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which path".split(" "),process:function(e,t){var r;if(e.originalEvent=t,e.isDefaultPrevented=t.defaultPrevented?!0:!1,e.isPropagationStopped=t.cancelBubble?!0:!1,e.metaKey=t.metaKey&&t.metaKey!==!1?!0:!1,e.target||(e.target=t.srcElement||i),3===e.target.nodeType&&(e.target=e.target.parentNode),!e.path){e.path=[],r=e.target;do e.path.push(r);while(r=r.parentNode);e.path.push(o)}}},mouse:{regex:new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"),properties:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement dataTransfer".split(" "),process:function(e,t){var r,n,o;n=t.fromElement,o=t.button,null===e.pageX&&null!==t.clientX&&(r=e.target.ownerDocument||i,r=r.documentElement||r.body,e.pageX=t.clientX+(r.scrollLeft||0)-(r.clientLeft||0),e.pageY=t.clientY+(r.scrollTop||0)-(r.clientTop||0)),!e.relatedTarget&&n&&(e.relatedTarget=n===e.target?t.toElement:n),e.which||o===s||(e.which=1&o?1:2&o?3:4&o?2:0)}},key:{regex:new RegExp("^(?:key)"),properties:"char charCode key keyCode".split(" "),process:function(e,t){null===e.which&&(e.which=null!==t.charCode?t.charCode:t.keyCode)}}};return e.base.extend({add:function(e,t){return e&&t&&u[e]&&(u[e]=t),this},get:function(e){return e&&u[e]?u[e]:null},process:function(e,t){var r,n,o;for(r in u)n=u[r],o=!n.regex||n.regex.test(t.type),o&&(n.properties&&l(e,t,n.properties),n.process&&n.process(e,t),n.delegate&&(e.delegate=n.delegate))}})}),function(e){var t=["../base","../support"];window.getComputedStyle||t.push("../polyfill/window/getcomputedstyle"),window.qoopido.registerSingleton("hook/css",e,t)}(function(e,t,r,n,o,i,s){"use strict";var l=e.support,u=o.getComputedStyle||e["polyfill/window/getcomputedstyle"],a={general:{get:function(e,t){return u(e,null).getPropertyValue(t[0])},set:function(e,t,r){e.style[t[1]]=r}},opacity:l.supportsCssProperty("opacity")?null:{regex:new RegExp("alpha\\(opacity=(.*)\\)","i"),get:function(e,t,r){return r=u(e,null).getPropertyValue("filter").toString().match(this.regex),r=r?r[1]/100:1},set:function(e,t,r){var n=e.style;n.zoom=1,n.filter="alpha(opacity="+(100*r+.5>>0)+")"}}};return e.base.extend({add:function(e,t){return e&&t&&a[e]&&(a[e]=t),this},get:function(e){return e&&a[e]?a[e]:null},process:function(e,t,r,n){var o;return r=l.getCssProperty(r,t)||null,r?((o=this.get(r[1]))&&o[e]||this.get("general")[e])(t,r,n):void 0}})}),function(e){window.qoopido.register("dom/event",e,["../base","../hook/event"])}(function(e,t,r,n,o,i,s){"use strict";var l=e["hook/event"];return e.base.extend({originalEvent:null,isDelegate:!1,isDefaultPrevented:!1,isPropagationStopped:!1,isImmediatePropagationStopped:!1,_properties:null,_constructor:function(e){var t=this;return t._properties=[],t._obtain(e),t},_obtain:function(e){l.process(this,e)},_dispose:function(){for(var e,t=this,r=0;(e=t._properties[r])!==s;r++)delete t[e];delete t.delegate,t.originalEvent=null,t.isDelegate=!1,t.isDefaultPrevented=!1,t.isPropagationStopped=!1,t.isImmediatePropagationStopped=!1,t._properties.length=0},preventDefault:function(){var e=this,t=e.originalEvent;t.cancelable!==!1&&(e.isDefaultPrevented=!0,t.preventDefault?t.preventDefault():t.returnValue=!1)},stopPropagation:function(){var e=this,t=e.originalEvent;e.isPropagationStopped=!0,t.stopPropagation&&t.stopPropagation(),t.cancelBubble=!0},stopImmediatePropagation:function(){var e=this,t=e.originalEvent;e.isImmediatePropagationStopped=!0,t.stopImmediatePropagation&&t.stopImmediatePropagation(),e.stopPropagation()}})}),function(e){var t=["../base","../function/unique/uuid","../hook/css","./event"];window.CustomEvent||t.push("../polyfill/window/customevent"),window.addEventListener||t.push("../polyfill/window/addeventlistener"),window.removeEventListener||t.push("../polyfill/window/removeeventlistener"),window.dispatchEvent||t.push("../polyfill/window/dispatchevent"),Element.prototype.matches||t.push("../polyfill/element/matches"),document.querySelector||t.push("../polyfill/document/queryselector"),document.querySelectorAll||t.push("../polyfill/document/queryselectorall"),String.prototype.trim||t.push("../polyfill/string/trim"),window.qoopido.register("dom/element",e,t)}(function(e,t,r,n,o,i,s){"use strict";function l(e){var t,r,n;for(t in P)r=P[t],(!r.regex||r.regex.test(e))&&(n=r);return n}function u(e,t,r){var n=this,o=l(e),s=i.createEvent(o.type);s[o.method](e,"load"===e?!1:!0,!0,t),r&&(s._quid=r,s.isDelegate=!0),n.element.dispatchEvent(s)}function a(e){var t;if("string"==typeof e)try{w.test(e)===!0?(t=e.replace(w,"$1").toLowerCase(),e=i.createElement(t)):e=i.querySelector(e)}catch(r){e=null}if(!e)throw new Error("[Qoopido.js] Element could not be resolved");return e}function p(e){return Array.prototype.concat.apply([],Array.prototype.splice.call(e,0)).join(" ").split(_)}function c(e,t){for(var r,n=0;(r=e.path[n])!==s;n++){if(r.matches(t))return e.currentTarget=r,!0;if(r===e.currentTarget)break}return!1}var f="object",d="string",m=e["function/unique/uuid"],h=i.getElementsByTagName("head")[0],g="textContent"in i.createElement("a")?"textContent":"innerText",v="undefined"!=typeof h.previousElementSibling?function(){return this.previousElementSibling}:function(){for(var e=this;e=e.previousSibling;)if(1===e.nodeType)return e},y="undefined"!=typeof h.nextElementSibling?function(){return this.nextElementSibling}:function(){for(var e=this;e=e.nextSibling;)if(1===e.nodeType)return e},w=new RegExp("^<(\\w+)\\s*/>$"),b=new RegExp("^[^-]+"),_=new RegExp(" +","g"),x=e["pool/module"]&&e["pool/module"].create(e["dom/event"],null,!0)||null,E=e["hook/css"],S={},P={custom:{type:"CustomEvent",method:"initCustomEvent"},html:{regex:new RegExp("^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$"),type:"HTMLEvents",method:"initEvent"},mouse:{regex:new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"),type:"MouseEvents",method:"initMouseEvent"}};return e.base.extend({type:null,element:null,_listener:null,_constructor:function(e,t,r){var n,o=this;return e=a(e),n=e._quid,n?o=S[n]:(n=e._quid=m(),o.type=e.tagName,o.element=e,o._listener={},S[n]=o),"object"==typeof t&&null!==t&&o.setAttributes(t),"object"==typeof r&&null!==r&&o.setStyles(r),o!==this&&this.dispose&&this.dispose(),o},_obtain:function(e,t,r){this._constructor(e,t,r)},_dispose:function(){var e,t,r=this;for(e in r._listener)t=e.match(b),r.element.removeEventListener(t,r._listener[e]),delete r._listener[e];r.type=null,r.element=null},getContent:function(e){var t=this.element;return e&&e!==!1?t.innerHTML:t[g]},setContent:function(e,t){var r=this,n=r.element;return t&&t!==!1?n.innerHTML=e:n[g]=e,r},getAttribute:function(e){var t=this;return e&&typeof e===d?t.element.getAttribute(e):void 0},getAttributes:function(){for(var e,t=this,r={},n=p(arguments),o=0;(e=n[o])!==s;o++)r[e]=t.element.getAttribute(e);return r},setAttribute:function(e,t){var r=this;return e&&typeof e===d&&r.element.setAttribute(e,t),r},setAttributes:function(e){var t,r=this;if(e&&typeof e===f&&!e.length)for(t in e)r.element.setAttribute(t,e[t]);return r},removeAttribute:function(e){var t=this;return e&&typeof e===d&&t.element.removeAttribute(e),t},removeAttributes:function(){for(var e,t=this,r=p(arguments),n=0;(e=r[n])!==s;n++)t.element.removeAttribute(e);return t},getStyle:function(e){var t=this;return e&&typeof e===d?E.process("get",t.element,e):void 0},getStyles:function(){for(var e,t=this,r={},n=p(arguments),o=0;(e=n[o])!==s;o++)r[e]=E.process("get",t.element,e);return r},setStyle:function(e,t){var r=this;return e&&typeof e===d&&E.process("set",r.element,e,t),r},setStyles:function(e){var t,r=this;if(e&&typeof e===f&&!e.length)for(t in e)E.process("set",r.element,t,e[t]);return r},removeStyle:function(e){var t=this;return e&&typeof e===d&&t.setStyle(e,""),t},removeStyles:function(){for(var e,t=this,r=p(arguments),n=0;(e=r[n])!==s;n++)t.setStyle(e,"");return t},siblings:function(e){for(var t=this.element,r=t.parentNode.firstChild,n=[];r;r=y.call(r))r===t||e&&!r.matches(e)||n.push(r);return n},siblingsBefore:function(e){for(var t=this.element.previousSibling,r=[];t;t=v.call(t))(!e||t.matches(e))&&r.push(t);return r},siblingsAfter:function(e){for(var t=this.element.nextSibling,r=[];t;t=y.call(t))(!e||t.matches(e))&&r.push(t);return r},previous:function(e){var t=v.call(this.element);if(!e)return t;for(;t;t=v.call(t))if(t.matches(e))return t},next:function(e){var t=y.call(this.element);if(!e)return t;for(;t;t=y.call(t))if(t.matches(e))return t},find:function(e){var t,r,n=this.element;return e=e.trim(),">"===e.charAt(0)?(t=n._quid,n.setAttribute("data-quid",t),e='[data-quid="'+t+'"] '+e,r=n.parentNode.querySelectorAll(e),n.removeAttribute("data-quid")):r=n.querySelectorAll(e),r},parent:function(e){var t;if(!e)return this.element.parentNode;for(t=this.element;t;t=t.parentNode)if(t.matches(e))return t},parents:function(e){for(var t=this.element.parentNode,r=[];t;t=t.parentNode){if(9===t.nodeType)return r;1===t.nodeType&&(!e||t.matches(e))&&r.push(t)}},isVisible:function(){var e=this,t=e.element;return!(t.offsetWidth<=0&&t.offsetHeight<=0||"hidden"===e.getStyle("visibility")||e.getStyle("opacity")<=0)},hasClass:function(e){return e?new RegExp("(?:^|\\s)"+e+"(?:\\s|$)").test(this.element.className):!1},addClass:function(e){var t=this;return e&&!t.hasClass(e)&&(t.element.className+=t.element.className?" "+e:e),t},removeClass:function(e){var t=this;return e&&t.hasClass(e)&&(t.element.className=t.element.className.replace(new RegExp("(?:^|\\s)"+e+"(?!\\S)"),"")),t},toggleClass:function(e){var t=this;return e&&(t.hasClass(e)?t.removeClass(e):t.addClass(e)),t},prepend:function(e){var t=this,r=t.element;if(e)try{e=e.element||a(e),r.firstChild?r.insertBefore(e,r.firstChild):t.append(e)}catch(n){r.insertAdjacentHTML("afterBegin",e)}return t},append:function(e){var t=this,r=t.element;if(e)try{r.appendChild(e.element||a(e))}catch(n){r.insertAdjacentHTML("beforeEnd",e)}return t},prependTo:function(e){var t=this,r=t.element;return e&&((e=e.element||a(e)).firstChild?e.insertBefore(r,e.firstChild):t.appendTo(e)),t},appendTo:function(e){var t=this;return e&&(e.element||a(e)).appendChild(t.element),t},insertBefore:function(e){var t=this,r=t.element;return e&&(e=e.element||a(e)).parentNode.insertBefore(r,e),t},insertAfter:function(e){var t=this,r=t.element;return e&&((e=e.element||a(e)).nextSibling?e.parentNode.insertBefore(r,e.nextSibling):t.appendTo(e.parentNode)),t},replace:function(e){var t=this,r=t.element;return e&&(e=e.element||a(e)).parentNode.replaceChild(r,e),t},replaceWith:function(e){var t=this,r=t.element;return e&&(e=e.element||a(e),r.parentNode.replaceChild(e,r)),t},remove:function(){var e=this,t=e.element;return t.parentNode.removeChild(t),e},on:function(t){var r,n=this,o=n.element,i=arguments.length>2?arguments[1]:null,l=arguments.length>2?arguments[2]:arguments[1],a=l._quid||(l._quid=m()),p=0;for(t=t.split(" ");(r=t[p])!==s;p++){var f=r+"-"+a,d=function(t){var r;t=x&&x.obtain(t)||e["dom/event"].create(t),t.isPropagationStopped||(r=t.delegate,t._quid=m(),(!i||c(t,i))&&l.call(t.currentTarget,t,t.originalEvent.detail),r&&(delete t.delegate,u.call(n,r))),t.dispose&&t.dispose()};d.type=r,n._listener[f]=d,o.addEventListener(r,d)}return n},one:function(e){var t=this,r=arguments.length>3||"string"==typeof arguments[1]?arguments[1]:null,n=arguments.length>3||"function"==typeof arguments[2]?arguments[2]:arguments[1],o=(arguments.length>3?arguments[3]:arguments[2])!==!1,i=function(r){t.off(o===!0?r.type:e,i),n.call(this,r,r.originalEvent.detail)};return n._quid=i._quid=m(),r?t.on(e,r,i):t.on(e,i),t},off:function(e,t){var r,n,o,i=this,l=i.element,u=0;for(e=e.split(" ");(r=e[u])!==s;u++)n=t._quid&&r+"-"+t._quid||null,o=n&&i._listener[n]||null,o?(l.removeEventListener(r,o),delete i._listener[n]):l.removeEventListener(r,t);return i},emit:function(e,t){var r=this;return u.call(r,e,t),r}})}),function(e){window.qoopido.register("dom/element/emerge",e,["../element","../../function/merge","../../function/unique/uuid"])}(function(e,t,r,n,o,i,s){"use strict";function l(e){var t,r=v[e];for(t in r)"length"!==t&&p.call(r[t]);0===r.length&&(o.element.clearInterval(g[e]),delete g[e])}function u(){h.left=0,h.top=0,h.right=o.innerWidth||m.clientWidth,h.bottom=o.innerHeight||m.clientHeight}function a(){var e=this,t=e._settings.threshold,r=t!==s?t:m.clientWidth*e._settings.auto,n=t!==s?t:m.clientHeight*e._settings.auto;e._viewport.left=h.left-r,e._viewport.top=h.top-n,e._viewport.right=h.right+r,e._viewport.bottom=h.bottom+n}function p(){var e,t=this,r=!1,n=2;!t.isVisible()||"hidden"===t.getStyle("visibility")&&t._settings.visibility!==!1||(e=t.element.getBoundingClientRect(),(e.bottom>=t._viewport.top&&e.bottom<=t._viewport.bottom||e.top>=t._viewport.top&&e.top<=t._viewport.bottom||t._viewport.bottom>=e.top&&t._viewport.bottom<=e.bottom||t._viewport.top>=e.top&&t._viewport.top<=e.bottom)&&(e.left>=t._viewport.left&&e.left<=t._viewport.right||e.right>=t._viewport.left&&e.right<=t._viewport.right||t._viewport.left>=e.left&&t._viewport.left<=e.right||t._viewport.right>=e.left&&t._viewport.right<=e.right)&&((0===t._settings.threshold||(e.bottom>=h.top&&e.bottom<=h.bottom||e.top>=h.top&&e.top<=h.bottom||h.bottom>=e.top&&h.bottom<=e.bottom||h.top>=e.top&&h.top<=e.bottom)&&(e.left>=h.left&&e.left<=h.right||e.right>=h.left&&e.right<=h.right||h.left>=e.left&&h.left<=e.right||h.right>=e.left&&h.right<=e.right))&&(n=1),r=!0)),(r!==t._state||r===!0&&n!==t._priority)&&c.call(t,r,n)}function c(e,t){var r=this;r._state=e,r._priority=t,r._settings.recur!==!0&&r.remove(),e===!0?r.emit(y,t):r.emit(w)}var f,d={interval:50,threshold:"auto",recur:!0,auto:1,visibility:!0},m=o.document.documentElement,h={},g={},v={},y="emerged",w="demerged",b="resize orientationchange";if(o=e["dom/element"].create(o),"CSS1Compat"!==i.compatMode)throw"[Qoopido.js] Not in standards mode";return f=e["dom/element"].extend({_quid:null,_viewport:null,_settings:null,_state:null,_priority:null,_constructor:function(t,r){var n=f._parent._constructor.call(this,t);return r=e["function/merge"]({},d,r||{}),"auto"===r.threshold&&delete r.threshold,g[r.interval]===s&&(v[r.interval]=v[r.interval]||{length:0},g[r.interval]=o.element.setInterval(function(){l(r.interval)},r.interval)),n._quid=e["function/unique/uuid"](),n._viewport={},n._settings=r,n._state=!1,n._priority=2,v[r.interval][n._quid]=n,v[r.interval].length++,o.on(b,function(){a.call(n)}),a.call(n),n},remove:function(){var e=this;delete v[e._settings.interval][e._quid],v[e._settings.interval].length--}}),o.on(b,u),u(),f}),function(e){window.qoopido.register("dom/element/lazyimage",e,["./emerge","../../function/merge"])}(function(e,t,r,n,o,i,s){"use strict";function l(){var e=this,t=e._settings.attribute;p+=1,e.emit(c).one(v,function(t){e.emit(t.type===h?f:d),p-=1},!1).setAttribute("src",e.getAttribute(t)).removeAttribute(t)}var u,a={interval:50,threshold:"auto",attribute:"data-lazyimage"},p=0,c="requested",f="loaded",d="failed",m="emerged",h="load",g="error",v="".concat(h," ",g);return u=e["dom/element/emerge"].extend({_constructor:function(t,r){var n=u._parent._constructor.call(this,t,e["function/merge"]({},a,r||{}));return n.on(m,function o(e){(0===p||1===e.data)&&(n.remove(),n.off(m,o),l.call(n))}),n}})}); \ No newline at end of file diff --git a/dist/latest/min/packages/qoopido.lazyimage.legacy.js b/dist/latest/min/packages/qoopido.lazyimage.legacy.js new file mode 100644 index 00000000..b50eb3c7 --- /dev/null +++ b/dist/latest/min/packages/qoopido.lazyimage.legacy.js @@ -0,0 +1,2 @@ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +!function(e,t){t.register?t.register("polyfill/object/defineproperty",e):(t.modules=t.modules||{})["polyfill/object/defineproperty"]=e()}(function(e,t,r,n,o,i,s){"use strict";if(!Object.defineProperty||!function(){try{return Object.defineProperty({},"x",{}),!0}catch(e){return!1}}()){var l=Object.defineProperty,u=Object.prototype.__defineGetter__,c=Object.prototype.__defineSetter__;Object.defineProperty=function(e,t,r){if(l)try{return l(e,t,r)}catch(n){}if(e!==Object(e))throw new TypeError("Object.defineProperty called on non-object");return u&&"get"in r&&u.call(e,t,r.get),c&&"set"in r&&c.call(e,t,r.set),"value"in r&&(e[t]=r.value),e}}return Object.defineProperty},window.qoopido=window.qoopido||{}),function(e,t){if(t.register){var r=[];Object.defineProperty&&function(){try{return Object.defineProperty({},"x",{}),!0}catch(e){return!1}}()||r.push("./defineproperty"),t.register("polyfill/object/defineproperties",e,r)}else(t.modules=t.modules||{})["polyfill/object/defineproperties"]=e()}(function(e,t,r,n,o,i,s){"use strict";return Object.defineProperties||(Object.defineProperties=function(e,t){if(e!==Object(e))throw new TypeError("Object.defineProperties called on non-object");var r;for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&Object.defineProperty(e,r,t[r]);return e}),Object.defineProperties},window.qoopido=window.qoopido||{}),function(e,t){if(t.register){var r=[];Object.defineProperties||r.push("./defineproperties"),t.register("polyfill/object/create",e,r)}else(t.modules=t.modules||{})["polyfill/object/create"]=e()}(function(e,t,r,n,o,i,s){"use strict";return Object.create||(Object.create=function(e,t){function r(){}if("object"!=typeof e)throw new TypeError;r.prototype=e;var n=new r;if(e&&(n.constructor=r),arguments.length>1){if(t!==Object(t))throw new TypeError;Object.defineProperties(n,t)}return n}),Object.create},window.qoopido=window.qoopido||{}),function(e,t){t.register?t.register("polyfill/object/getownpropertynames",e):(t.modules=t.modules||{})["polyfill/object/getownpropertynames"]=e()}(function(e,t,r,n,o,i,s){"use strict";return Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(e){if(e!==Object(e))throw new TypeError("Object.getOwnPropertyNames called on non-object");var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.push(t);return r}),Object.getOwnPropertyNames},window.qoopido=window.qoopido||{}),function(e,t){t.register?t.register("polyfill/object/getownpropertydescriptor",e):(t.modules=t.modules||{})["polyfill/object/getownpropertydescriptor"]=e()}(function(e,t,r,n,o,i,s){"use strict";if(!Object.getOwnPropertyDescriptor||!function(){try{return Object.getOwnPropertyDescriptor({x:0},"x"),!0}catch(e){return!1}}()){var l=Object.getOwnPropertyDescriptor;Object.getOwnPropertyDescriptor=function(e,t){if(e!==Object(e))throw new TypeError;try{return l.call(Object,e,t)}catch(r){}return Object.prototype.hasOwnProperty.call(e,t)?{value:e[t],enumerable:!0,writable:!0,configurable:!0}:void 0}}return Object.getOwnPropertyDescriptor},window.qoopido=window.qoopido||{}),function(e,t,r,n,o){"use strict";function i(e,i,s,u){var p,d=e.split("/");return a[e]?a[e]:(p=function(){if(s)for(var p,m,g=d.slice(0,-1).join("/"),h=0;(p=s[h])!==o;h++)m=f.test(p),m&&(p=l(g+"/"+p)),!a[p]&&arguments[h]&&(a[p]=arguments[h]),m&&!a[p]&&"undefined"!=typeof console&&console.error("".concat("[Qoopido.js] ",e,": Could not load dependency ",p));return a[e]=i(a,c,d,t,r,n,o),u&&u(a[e]),a[e]},void("undefined"!=typeof module&&module.exports?module.exports=define(p):"function"==typeof define&&define.amd?s?define(s,p):define(p):p()))}function s(e,t,r){i(e,t,r,function(t){a[e]=t.create()})}function l(e){for(var t;(t=e.replace(d,""))!==e;)e=t;return e.replace(m,"")}var u=r.qoopido||(r.qoopido={}),c=u.shared||(u.shared={}),a=u.modules||(u.modules={}),p=[],f=new RegExp("^\\.+\\/"),d=new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."),m=new RegExp("(^\\/)|\\.\\/","g");u.register=i,u.registerSingleton=s,Object.create||p.push("./polyfill/object/create"),Object.getOwnPropertyNames||p.push("./polyfill/object/getownpropertynames"),Object.getOwnPropertyDescriptor&&function(){try{return Object.getOwnPropertyDescriptor({x:0},"x"),!0}catch(e){return!1}}()||p.push("./polyfill/object/getownpropertydescriptor"),i("base",e,p)}(function(e,t,r,n,o,i,s){"use strict";function l(e){for(var t,r={},n=Object.getOwnPropertyNames(e),o=0;(t=n[o])!==s;o++)r[t]=Object.getOwnPropertyDescriptor(e,t);return r}function u(){throw new Error("[Qoopido.js] Operation prohibited")}return{create:function(){var e,t=Object.create(this,l(this));return t._constructor&&(e=t._constructor.apply(t,arguments)),t.create=t.extend=u,e||t},extend:function(e,t){var r;return e=e||{},t=t===!0,e._parent=this,r=Object.create(this,l(e)),t===!0&&(r.extend=u),r}}},navigator,this,document),function(e){window.qoopido.register("polyfill/string/ucfirst",e)}(function(e,t,r,n,o,i,s){"use strict";return String.prototype.ucfirst||(String.prototype.ucfirst=function(){var e=this;return e.charAt(0).toUpperCase()+e.slice(1)}),String.prototype.ucfirst}),function(e){window.qoopido.register("polyfill/string/lcfirst",e)}(function(e,t,r,n,o,i,s){"use strict";return String.prototype.lcfirst||(String.prototype.lcfirst=function(){var e=this;return e.charAt(0).toLowerCase()+e.slice(1)}),String.prototype.lcfirst}),function(e){window.qoopido.register("polyfill/window/getcomputedstyle",e)}(function(e,t,r,n,o,i,s){"use strict";if(o.getComputedStyle)return o.getComputedStyle;var l=new RegExp("(\\-([a-z]){1})","g"),u=function(){return arguments[2].toUpperCase()};return function(e,t){var r=this;return r.getPropertyValue=function(t){return"float"===t&&(t="styleFloat"),l.test(t)&&(t=t.replace(l,u)),e.currentStyle[t]||null},r}}),function(e){window.qoopido.register("polyfill/window/promise",e)}(function(e,t,r,n,o,i,s){"use strict";function l(e,t){var r=E.push([e,t]);1===r&&u()}function u(){o.setTimeout(c,1)}function c(){for(var e,t=0;(e=E[t])!==s;t++)e[0](e[1]);E.length=0}function a(e,t){var r,n=null;try{if(e===t)throw new TypeError("A promises callback cannot return that same promise.");if(("function"==typeof t||"object"==typeof t&&null!==t)&&(n=t.then,"function"==typeof n))return n.call(t,function(n){return r?!0:(r=!0,void(t!==n?d(e,n):m(e,n)))},function(t){return r?!0:(r=!0,void g(e,t))}),!0}catch(o){return r?!0:(g(e,o),!0)}return!1}function p(e,t){function r(e){d(t,e)}function n(e){g(t,e)}try{e(r,n)}catch(o){n(o)}}function f(e,t,r,n){var o,i,s,l,u="function"==typeof r;if(u)try{o=r(n),s=!0}catch(c){l=!0,i=c}else o=n,s=!0;a(t,o)||(u&&s?d(t,o):l?g(t,i):e===j?d(t,o):e===P&&g(t,o))}function d(e,t){e===t?m(e,t):a(e,t)||m(e,t)}function m(e,t){e._state===_&&(e._state=x,e._detail=t,l(h,e))}function g(e,t){e._state===_&&(e._state=x,e._detail=t,l(v,e))}function h(e){w(e,e._state=j)}function v(e){w(e,e._state=P)}function y(e,t,r,n){var o=e._subscribers,i=o.length;o[i]=t,o[i+j]=r,o[i+P]=n}function w(e,t){for(var r,n,o=e._subscribers,i=e._detail,l=0;(r=o[l])!==s;l+=3)n=o[l+t],f(t,r,n,i);e._subscribers=null}function b(e){var t=this;if("function"!=typeof e)throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");t._subscribers=[],p(e,t)}var _=void 0,x=0,j=1,P=2,E=[];return b.prototype={_state:s,_detail:s,_subscribers:s,then:function(e,t){var r=this,n=new b(function(){});return r._state?l(function(){f(r._state,n,arguments[r._state-1],r._detail)}):y(r,n,e,t),n},"catch":function(e){return this.then(null,e)}},o.Promise||(o.Promise=b),o.Promise}),function(e){var t=[];window.Promise||t.push("../polyfill/window/promise"),window.qoopido.register("promise/all",e,t)}(function(e,t,r,n,o,i,s){"use strict";return function(e){if("[object Array]"!==Object.prototype.toString.call(e))throw new TypeError("You must pass an array to all.");return new o.Promise(function(t,r){function n(e){return function(t){o(e,t)}}function o(e,r){l[e]=r,0===--u&&t(l)}var i,l=[],u=e.length,c=0;for(0===u&&t([]);(i=e[c])!==s;c++)i&&"function"==typeof i.then?i.then(n(c),r):o(c,i)})}}),function(e){var t=[];window.Promise||t.push("../polyfill/window/promise"),window.qoopido.register("promise/defer",e,t)}(function(e,t,r,n,o,i,s){"use strict";return function(){var e=this;e.promise=new o.Promise(function(t,r){e.resolve=t,e.reject=r})}}),function(e){var t=["./base","./promise/all","./promise/defer"];String.prototype.ucfirst||t.push("./polyfill/string/ucfirst"),String.prototype.lcfirst||t.push("./polyfill/string/lcfirst"),window.qoopido.registerSingleton("support",e,t)}(function(e,t,r,n,o,i,s){"use strict";function l(e){return e.replace(p,"$1").lcfirst().replace(f,"").replace(d,g)}var u=e["promise/all"],c=e["promise/defer"],a=new RegExp("^(Moz|WebKit|Khtml|ms|O|Icab)(?=[A-Z])"),p=new RegExp("^(?:webkit|khtml|icab|moz|ms|o)([A-Z])"),f=new RegExp("^-(?:webkit|khtml|icab|moz|ms|o)-"),d=new RegExp("-([a-z])","gi"),m=new RegExp("([A-Z])","g"),g=function(){return arguments[1].ucfirst()},h={prefix:null,method:{},property:{},css:{},promises:{prefix:null,method:{},property:{},css:{},test:{}}};return e.base.extend({test:{},pool:t.pool&&t.pool.dom,testMultiple:function(){for(var e,t=[],r=0;(e=arguments[r])!==s;r++)switch(typeof e){case"string":t.push(this.test[e]());break;case"boolean":var n=new c;e?n.resolve():n.reject(),t.push(n.promise);break;default:t.push(e)}return new u(t)},getPrefix:function(){var e,t=this,r=h.prefix||null;if(null===r){var n=t.pool?t.pool.obtain("div"):i.createElement("div"),o=n.style;r=!1;for(e in o)a.test(e)&&(r=e.match(a)[0]);r===!1&&"WebkitOpacity"in o&&(r="WebKit"),r===!1&&"KhtmlOpacity"in o&&(r="Khtml"),r=h.prefix=r===!1?!1:[r.toLowerCase(),r.toLowerCase().ucfirst(),r],n.dispose&&n.dispose()}return r},getMethod:function(e,t){e=l(e),t=t||o;var r=t.tagName,n=h.method[r]=h.method[r]||{},i=n[e]=h.method[r][e]||null;if(null===i){i=!1;var u,c,a=0,p=e.ucfirst(),f=this.getPrefix();for(u=f!==!1?(e+" "+p+" "+f.join(p+" ")+p).split(" "):[e];(c=u[a])!==s;a++)if(t[c]!==s&&("function"==typeof t[c]||"object"==typeof t[c])){i=c;break}h.method[r][e]=i}return i},getProperty:function(e,t){e=l(e),t=t||o;var r=t.tagName,n=h.property[r]=h.property[r]||{},i=n[e]=h.property[r][e]||null;if(null===i){i=!1;var u,c,a=0,p=e.ucfirst(),f=this.getPrefix();for(u=f!==!1?(e+" "+p+" "+f.join(p+" ")+p).split(" "):[e],a;(c=u[a])!==s;a++)if(t[c]!==s){i=c;break}h.property[r][e]=i}return i},getCssProperty:function(e){e=l(e);var t=this,r=h.css[e]||null;if(null===r){r=!1;var n,o=0,u=t.pool?t.pool.obtain("div"):i.createElement("div"),c=e.ucfirst(),a=this.getPrefix()||[],p=(e+" "+c+" "+a.join(c+" ")+c).split(" "),f="";for(o;(n=p[o])!==s;o++)if(u.style[n]!==s){r=n,o>0&&(f="-");break}r=h.css[e]=r!==!1?[f+r.replace(m,"-$1").toLowerCase(),r]:!1,u.dispose&&u.dispose()}return r},supportsPrefix:function(){return!!this.getPrefix()},supportsMethod:function(e,t){return!!this.getMethod(e,t)},supportsProperty:function(e,t){return!!this.getProperty(e,t)},supportsCssProperty:function(e){return!!this.getCssProperty(e)},testPrefix:function(){var e=h.promises.prefix;if(null===e){var t=new c,r=this.getPrefix();r?t.resolve(r):t.reject(),e=h.promises.prefix=t.promise}return e},testMethod:function(e,t){t=t||o;var r=t.tagName,n=h.promises.method[r]=h.promises.method[r]||{},i=n[e]=h.promises.method[r][e]||null;if(null===i){var s=new c,l=this.getMethod(e,t);l?s.resolve(l):s.reject(),i=h.promises.method[r][e]=s.promise}return i},testProperty:function(e,t){t=t||o;var r=t.tagName,n=h.promises.property[r]=h.promises.property[r]||{},i=n[e]=h.promises.property[r][e]||null;if(null===i){var s=new c,l=this.getProperty(e,t);l?s.resolve(l):s.reject(),i=h.promises.property[r][e]=s.promise}return i},testCssProperty:function(e){var t=h.promises.css[e]||null;if(null===t){var r=new c,n=this.getCssProperty(e);n?r.resolve(n):r.reject(),t=h.promises.css[e]=r.promise}return t},addTest:function(e,t){return this.test[e]=function(){var r=h.promises.test[e]||null;if(null===r){var n=new c,o=Array.prototype.slice.call(arguments);o.splice(0,0,n),t.apply(null,o),r=h.promises.test[e]=n.promise}return r}}})}),function(e){window.qoopido.register("function/merge",e)}(function(e,t,r,n,o,i,s){"use strict";return function l(){var e,t,r,n,o,i=arguments[0];for(e=1;(t=arguments[e])!==s;e++)for(r in t)n=i[r],o=t[r],o!==s&&(null!==o&&"object"==typeof o?(n=o.length!==s?n&&"object"==typeof n&&n.length!==s?n:[]:n&&"object"==typeof n&&n.length===s?n:{},i[r]=l(n,o)):i[r]=o);return i}}),function(e){window.qoopido.register("function/unique/uuid",e)}(function(e,t,r,n,o,i,s){"use strict";function l(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(c,function(e){var t=16*Math.random()|0,r="x"===e?t:3&t|8;return r.toString(16)})}var u={},c=new RegExp("[xy]","g");return function(){var e;do e=l();while("undefined"!=typeof u[e]);return u[e]=!0,e}}),function(e){window.qoopido.registerSingleton("hook/event",e,["../base"])}(function(e,t,r,n,o,i,s){"use strict";function l(e,t,r){for(var n,o=0;(n=r[o])!==s;o++)e[n]=t[n];e._properties=e._properties.concat(r)}var u={general:{properties:"type altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which path".split(" "),process:function(e,t){var r;if(e.originalEvent=t,e.isDefaultPrevented=t.defaultPrevented?!0:!1,e.isPropagationStopped=t.cancelBubble?!0:!1,e.metaKey=t.metaKey&&t.metaKey!==!1?!0:!1,e.target||(e.target=t.srcElement||i),3===e.target.nodeType&&(e.target=e.target.parentNode),!e.path){e.path=[],r=e.target;do e.path.push(r);while(r=r.parentNode);e.path.push(o)}}},mouse:{regex:new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"),properties:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement dataTransfer".split(" "),process:function(e,t){var r,n,o;n=t.fromElement,o=t.button,null===e.pageX&&null!==t.clientX&&(r=e.target.ownerDocument||i,r=r.documentElement||r.body,e.pageX=t.clientX+(r.scrollLeft||0)-(r.clientLeft||0),e.pageY=t.clientY+(r.scrollTop||0)-(r.clientTop||0)),!e.relatedTarget&&n&&(e.relatedTarget=n===e.target?t.toElement:n),e.which||o===s||(e.which=1&o?1:2&o?3:4&o?2:0)}},key:{regex:new RegExp("^(?:key)"),properties:"char charCode key keyCode".split(" "),process:function(e,t){null===e.which&&(e.which=null!==t.charCode?t.charCode:t.keyCode)}}};return e.base.extend({add:function(e,t){return e&&t&&u[e]&&(u[e]=t),this},get:function(e){return e&&u[e]?u[e]:null},process:function(e,t){var r,n,o;for(r in u)n=u[r],o=!n.regex||n.regex.test(t.type),o&&(n.properties&&l(e,t,n.properties),n.process&&n.process(e,t),n.delegate&&(e.delegate=n.delegate))}})}),function(e){var t=["../base","../support"];window.getComputedStyle||t.push("../polyfill/window/getcomputedstyle"),window.qoopido.registerSingleton("hook/css",e,t)}(function(e,t,r,n,o,i,s){"use strict";var l=e.support,u=o.getComputedStyle||e["polyfill/window/getcomputedstyle"],c={general:{get:function(e,t){return u(e,null).getPropertyValue(t[0])},set:function(e,t,r){e.style[t[1]]=r}},opacity:l.supportsCssProperty("opacity")?null:{regex:new RegExp("alpha\\(opacity=(.*)\\)","i"),get:function(e,t,r){return r=u(e,null).getPropertyValue("filter").toString().match(this.regex),r=r?r[1]/100:1},set:function(e,t,r){var n=e.style;n.zoom=1,n.filter="alpha(opacity="+(100*r+.5>>0)+")"}}};return e.base.extend({add:function(e,t){return e&&t&&c[e]&&(c[e]=t),this},get:function(e){return e&&c[e]?c[e]:null},process:function(e,t,r,n){var o;return r=l.getCssProperty(r,t)||null,r?((o=this.get(r[1]))&&o[e]||this.get("general")[e])(t,r,n):void 0}})}),function(e){window.qoopido.register("dom/event",e,["../base","../hook/event"])}(function(e,t,r,n,o,i,s){"use strict";var l=e["hook/event"];return e.base.extend({originalEvent:null,isDelegate:!1,isDefaultPrevented:!1,isPropagationStopped:!1,isImmediatePropagationStopped:!1,_properties:null,_constructor:function(e){var t=this;return t._properties=[],t._obtain(e),t},_obtain:function(e){l.process(this,e)},_dispose:function(){for(var e,t=this,r=0;(e=t._properties[r])!==s;r++)delete t[e];delete t.delegate,t.originalEvent=null,t.isDelegate=!1,t.isDefaultPrevented=!1,t.isPropagationStopped=!1,t.isImmediatePropagationStopped=!1,t._properties.length=0},preventDefault:function(){var e=this,t=e.originalEvent;t.cancelable!==!1&&(e.isDefaultPrevented=!0,t.preventDefault?t.preventDefault():t.returnValue=!1)},stopPropagation:function(){var e=this,t=e.originalEvent;e.isPropagationStopped=!0,t.stopPropagation&&t.stopPropagation(),t.cancelBubble=!0},stopImmediatePropagation:function(){var e=this,t=e.originalEvent;e.isImmediatePropagationStopped=!0,t.stopImmediatePropagation&&t.stopImmediatePropagation(),e.stopPropagation()}})}),function(e){var t=["../base","../function/unique/uuid","../hook/css","./event"];window.CustomEvent||t.push("../polyfill/window/customevent"),window.addEventListener||t.push("../polyfill/window/addeventlistener"),window.removeEventListener||t.push("../polyfill/window/removeeventlistener"),window.dispatchEvent||t.push("../polyfill/window/dispatchevent"),Element.prototype.matches||t.push("../polyfill/element/matches"),document.querySelector||t.push("../polyfill/document/queryselector"),document.querySelectorAll||t.push("../polyfill/document/queryselectorall"),String.prototype.trim||t.push("../polyfill/string/trim"),window.qoopido.register("dom/element",e,t)}(function(e,t,r,n,o,i,s){"use strict";function l(e){var t,r,n;for(t in E)r=E[t],(!r.regex||r.regex.test(e))&&(n=r);return n}function u(e,t,r){var n=this,o=l(e),s=i.createEvent(o.type);s[o.method](e,"load"===e?!1:!0,!0,t),r&&(s._quid=r,s.isDelegate=!0),n.element.dispatchEvent(s)}function c(e){var t;if("string"==typeof e)try{w.test(e)===!0?(t=e.replace(w,"$1").toLowerCase(),e=i.createElement(t)):e=i.querySelector(e)}catch(r){e=null}if(!e)throw new Error("[Qoopido.js] Element could not be resolved");return e}function a(e){return Array.prototype.concat.apply([],Array.prototype.splice.call(e,0)).join(" ").split(_)}function p(e,t){for(var r,n=0;(r=e.path[n])!==s;n++){if(r.matches(t))return e.currentTarget=r,!0;if(r===e.currentTarget)break}return!1}var f="object",d="string",m=e["function/unique/uuid"],g=i.getElementsByTagName("head")[0],h="textContent"in i.createElement("a")?"textContent":"innerText",v="undefined"!=typeof g.previousElementSibling?function(){return this.previousElementSibling}:function(){for(var e=this;e=e.previousSibling;)if(1===e.nodeType)return e},y="undefined"!=typeof g.nextElementSibling?function(){return this.nextElementSibling}:function(){for(var e=this;e=e.nextSibling;)if(1===e.nodeType)return e},w=new RegExp("^<(\\w+)\\s*/>$"),b=new RegExp("^[^-]+"),_=new RegExp(" +","g"),x=e["pool/module"]&&e["pool/module"].create(e["dom/event"],null,!0)||null,j=e["hook/css"],P={},E={custom:{type:"CustomEvent",method:"initCustomEvent"},html:{regex:new RegExp("^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$"),type:"HTMLEvents",method:"initEvent"},mouse:{regex:new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"),type:"MouseEvents",method:"initMouseEvent"}};return e.base.extend({type:null,element:null,_listener:null,_constructor:function(e,t,r){var n,o=this;return e=c(e),n=e._quid,n?o=P[n]:(n=e._quid=m(),o.type=e.tagName,o.element=e,o._listener={},P[n]=o),"object"==typeof t&&null!==t&&o.setAttributes(t),"object"==typeof r&&null!==r&&o.setStyles(r),o!==this&&this.dispose&&this.dispose(),o},_obtain:function(e,t,r){this._constructor(e,t,r)},_dispose:function(){var e,t,r=this;for(e in r._listener)t=e.match(b),r.element.removeEventListener(t,r._listener[e]),delete r._listener[e];r.type=null,r.element=null},getContent:function(e){var t=this.element;return e&&e!==!1?t.innerHTML:t[h]},setContent:function(e,t){var r=this,n=r.element;return t&&t!==!1?n.innerHTML=e:n[h]=e,r},getAttribute:function(e){var t=this;return e&&typeof e===d?t.element.getAttribute(e):void 0},getAttributes:function(){for(var e,t=this,r={},n=a(arguments),o=0;(e=n[o])!==s;o++)r[e]=t.element.getAttribute(e);return r},setAttribute:function(e,t){var r=this;return e&&typeof e===d&&r.element.setAttribute(e,t),r},setAttributes:function(e){var t,r=this;if(e&&typeof e===f&&!e.length)for(t in e)r.element.setAttribute(t,e[t]);return r},removeAttribute:function(e){var t=this;return e&&typeof e===d&&t.element.removeAttribute(e),t},removeAttributes:function(){for(var e,t=this,r=a(arguments),n=0;(e=r[n])!==s;n++)t.element.removeAttribute(e);return t},getStyle:function(e){var t=this;return e&&typeof e===d?j.process("get",t.element,e):void 0},getStyles:function(){for(var e,t=this,r={},n=a(arguments),o=0;(e=n[o])!==s;o++)r[e]=j.process("get",t.element,e);return r},setStyle:function(e,t){var r=this;return e&&typeof e===d&&j.process("set",r.element,e,t),r},setStyles:function(e){var t,r=this;if(e&&typeof e===f&&!e.length)for(t in e)j.process("set",r.element,t,e[t]);return r},removeStyle:function(e){var t=this;return e&&typeof e===d&&t.setStyle(e,""),t},removeStyles:function(){for(var e,t=this,r=a(arguments),n=0;(e=r[n])!==s;n++)t.setStyle(e,"");return t},siblings:function(e){for(var t=this.element,r=t.parentNode.firstChild,n=[];r;r=y.call(r))r===t||e&&!r.matches(e)||n.push(r);return n},siblingsBefore:function(e){for(var t=this.element.previousSibling,r=[];t;t=v.call(t))(!e||t.matches(e))&&r.push(t);return r},siblingsAfter:function(e){for(var t=this.element.nextSibling,r=[];t;t=y.call(t))(!e||t.matches(e))&&r.push(t);return r},previous:function(e){var t=v.call(this.element);if(!e)return t;for(;t;t=v.call(t))if(t.matches(e))return t},next:function(e){var t=y.call(this.element);if(!e)return t;for(;t;t=y.call(t))if(t.matches(e))return t},find:function(e){var t,r,n=this.element;return e=e.trim(),">"===e.charAt(0)?(t=n._quid,n.setAttribute("data-quid",t),e='[data-quid="'+t+'"] '+e,r=n.parentNode.querySelectorAll(e),n.removeAttribute("data-quid")):r=n.querySelectorAll(e),r},parent:function(e){var t;if(!e)return this.element.parentNode;for(t=this.element;t;t=t.parentNode)if(t.matches(e))return t},parents:function(e){for(var t=this.element.parentNode,r=[];t;t=t.parentNode){if(9===t.nodeType)return r;1===t.nodeType&&(!e||t.matches(e))&&r.push(t)}},isVisible:function(){var e=this,t=e.element;return!(t.offsetWidth<=0&&t.offsetHeight<=0||"hidden"===e.getStyle("visibility")||e.getStyle("opacity")<=0)},hasClass:function(e){return e?new RegExp("(?:^|\\s)"+e+"(?:\\s|$)").test(this.element.className):!1},addClass:function(e){var t=this;return e&&!t.hasClass(e)&&(t.element.className+=t.element.className?" "+e:e),t},removeClass:function(e){var t=this;return e&&t.hasClass(e)&&(t.element.className=t.element.className.replace(new RegExp("(?:^|\\s)"+e+"(?!\\S)"),"")),t},toggleClass:function(e){var t=this;return e&&(t.hasClass(e)?t.removeClass(e):t.addClass(e)),t},prepend:function(e){var t=this,r=t.element;if(e)try{e=e.element||c(e),r.firstChild?r.insertBefore(e,r.firstChild):t.append(e)}catch(n){r.insertAdjacentHTML("afterBegin",e)}return t},append:function(e){var t=this,r=t.element;if(e)try{r.appendChild(e.element||c(e))}catch(n){r.insertAdjacentHTML("beforeEnd",e)}return t},prependTo:function(e){var t=this,r=t.element;return e&&((e=e.element||c(e)).firstChild?e.insertBefore(r,e.firstChild):t.appendTo(e)),t},appendTo:function(e){var t=this;return e&&(e.element||c(e)).appendChild(t.element),t},insertBefore:function(e){var t=this,r=t.element;return e&&(e=e.element||c(e)).parentNode.insertBefore(r,e),t},insertAfter:function(e){var t=this,r=t.element;return e&&((e=e.element||c(e)).nextSibling?e.parentNode.insertBefore(r,e.nextSibling):t.appendTo(e.parentNode)),t},replace:function(e){var t=this,r=t.element;return e&&(e=e.element||c(e)).parentNode.replaceChild(r,e),t},replaceWith:function(e){var t=this,r=t.element;return e&&(e=e.element||c(e),r.parentNode.replaceChild(e,r)),t},remove:function(){var e=this,t=e.element;return t.parentNode.removeChild(t),e},on:function(t){var r,n=this,o=n.element,i=arguments.length>2?arguments[1]:null,l=arguments.length>2?arguments[2]:arguments[1],c=l._quid||(l._quid=m()),a=0;for(t=t.split(" ");(r=t[a])!==s;a++){var f=r+"-"+c,d=function(t){var r;t=x&&x.obtain(t)||e["dom/event"].create(t),t.isPropagationStopped||(r=t.delegate,t._quid=m(),(!i||p(t,i))&&l.call(t.currentTarget,t,t.originalEvent.detail),r&&(delete t.delegate,u.call(n,r))),t.dispose&&t.dispose()};d.type=r,n._listener[f]=d,o.addEventListener(r,d)}return n},one:function(e){var t=this,r=arguments.length>3||"string"==typeof arguments[1]?arguments[1]:null,n=arguments.length>3||"function"==typeof arguments[2]?arguments[2]:arguments[1],o=(arguments.length>3?arguments[3]:arguments[2])!==!1,i=function(r){t.off(o===!0?r.type:e,i),n.call(this,r,r.originalEvent.detail)};return n._quid=i._quid=m(),r?t.on(e,r,i):t.on(e,i),t},off:function(e,t){var r,n,o,i=this,l=i.element,u=0;for(e=e.split(" ");(r=e[u])!==s;u++)n=t._quid&&r+"-"+t._quid||null,o=n&&i._listener[n]||null,o?(l.removeEventListener(r,o),delete i._listener[n]):l.removeEventListener(r,t);return i},emit:function(e,t){var r=this;return u.call(r,e,t),r}})}),function(e){window.qoopido.register("dom/element/emerge",e,["../element","../../function/merge","../../function/unique/uuid"])}(function(e,t,r,n,o,i,s){"use strict";function l(e){var t,r=v[e];for(t in r)"length"!==t&&a.call(r[t]);0===r.length&&(o.element.clearInterval(h[e]),delete h[e])}function u(){g.left=0,g.top=0,g.right=o.innerWidth||m.clientWidth,g.bottom=o.innerHeight||m.clientHeight}function c(){var e=this,t=e._settings.threshold,r=t!==s?t:m.clientWidth*e._settings.auto,n=t!==s?t:m.clientHeight*e._settings.auto;e._viewport.left=g.left-r,e._viewport.top=g.top-n,e._viewport.right=g.right+r,e._viewport.bottom=g.bottom+n}function a(){var e,t=this,r=!1,n=2;!t.isVisible()||"hidden"===t.getStyle("visibility")&&t._settings.visibility!==!1||(e=t.element.getBoundingClientRect(),(e.bottom>=t._viewport.top&&e.bottom<=t._viewport.bottom||e.top>=t._viewport.top&&e.top<=t._viewport.bottom||t._viewport.bottom>=e.top&&t._viewport.bottom<=e.bottom||t._viewport.top>=e.top&&t._viewport.top<=e.bottom)&&(e.left>=t._viewport.left&&e.left<=t._viewport.right||e.right>=t._viewport.left&&e.right<=t._viewport.right||t._viewport.left>=e.left&&t._viewport.left<=e.right||t._viewport.right>=e.left&&t._viewport.right<=e.right)&&((0===t._settings.threshold||(e.bottom>=g.top&&e.bottom<=g.bottom||e.top>=g.top&&e.top<=g.bottom||g.bottom>=e.top&&g.bottom<=e.bottom||g.top>=e.top&&g.top<=e.bottom)&&(e.left>=g.left&&e.left<=g.right||e.right>=g.left&&e.right<=g.right||g.left>=e.left&&g.left<=e.right||g.right>=e.left&&g.right<=e.right))&&(n=1),r=!0)),(r!==t._state||r===!0&&n!==t._priority)&&p.call(t,r,n)}function p(e,t){var r=this;r._state=e,r._priority=t,r._settings.recur!==!0&&r.remove(),e===!0?r.emit(y,t):r.emit(w)}var f,d={interval:50,threshold:"auto",recur:!0,auto:1,visibility:!0},m=o.document.documentElement,g={},h={},v={},y="emerged",w="demerged",b="resize orientationchange";if(o=e["dom/element"].create(o),"CSS1Compat"!==i.compatMode)throw"[Qoopido.js] Not in standards mode";return f=e["dom/element"].extend({_quid:null,_viewport:null,_settings:null,_state:null,_priority:null,_constructor:function(t,r){var n=f._parent._constructor.call(this,t);return r=e["function/merge"]({},d,r||{}),"auto"===r.threshold&&delete r.threshold,h[r.interval]===s&&(v[r.interval]=v[r.interval]||{length:0},h[r.interval]=o.element.setInterval(function(){l(r.interval)},r.interval)),n._quid=e["function/unique/uuid"](),n._viewport={},n._settings=r,n._state=!1,n._priority=2,v[r.interval][n._quid]=n,v[r.interval].length++,o.on(b,function(){c.call(n)}),c.call(n),n},remove:function(){var e=this;delete v[e._settings.interval][e._quid],v[e._settings.interval].length--}}),o.on(b,u),u(),f}),function(e){window.qoopido.register("dom/element/lazyimage",e,["./emerge","../../function/merge"])}(function(e,t,r,n,o,i,s){"use strict";function l(){var e=this,t=e._settings.attribute;a+=1,e.emit(p).one(v,function(t){e.emit(t.type===g?f:d),a-=1},!1).setAttribute("src",e.getAttribute(t)).removeAttribute(t)}var u,c={interval:50,threshold:"auto",attribute:"data-lazyimage"},a=0,p="requested",f="loaded",d="failed",m="emerged",g="load",h="error",v="".concat(g," ",h);return u=e["dom/element/emerge"].extend({_constructor:function(t,r){var n=u._parent._constructor.call(this,t,e["function/merge"]({},c,r||{}));return n.on(m,function o(e){(0===a||1===e.data)&&(n.remove(),n.off(m,o),l.call(n))}),n}})}); \ No newline at end of file diff --git a/dist/latest/min/packages/qoopido.remux.js b/dist/latest/min/packages/qoopido.remux.js new file mode 100644 index 00000000..d888c2e1 --- /dev/null +++ b/dist/latest/min/packages/qoopido.remux.js @@ -0,0 +1,2 @@ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +!function(e,t,n,i,r){"use strict";function o(e,o,a,c){var d,f=e.split("/");return u[e]?u[e]:(d=function(){if(a)for(var d,m,h=f.slice(0,-1).join("/"),y=0;(d=a[y])!==r;y++)m=p.test(d),m&&(d=s(h+"/"+d)),!u[d]&&arguments[y]&&(u[d]=arguments[y]),m&&!u[d]&&"undefined"!=typeof console&&console.error("".concat("[Qoopido.js] ",e,": Could not load dependency ",d));return u[e]=o(u,l,f,t,n,i,r),c&&c(u[e]),u[e]},void("undefined"!=typeof module&&module.exports?module.exports=define(d):"function"==typeof define&&define.amd?a?define(a,d):define(d):d()))}function a(e,t,n){o(e,t,n,function(t){u[e]=t.create()})}function s(e){for(var t;(t=e.replace(f,""))!==e;)e=t;return e.replace(m,"")}var c=n.qoopido||(n.qoopido={}),l=c.shared||(c.shared={}),u=c.modules||(c.modules={}),d=[],p=new RegExp("^\\.+\\/"),f=new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."),m=new RegExp("(^\\/)|\\.\\/","g");c.register=o,c.registerSingleton=a,Object.create||d.push("./polyfill/object/create"),Object.getOwnPropertyNames||d.push("./polyfill/object/getownpropertynames"),Object.getOwnPropertyDescriptor&&function(){try{return Object.getOwnPropertyDescriptor({x:0},"x"),!0}catch(e){return!1}}()||d.push("./polyfill/object/getownpropertydescriptor"),o("base",e,d)}(function(e,t,n,i,r,o,a){"use strict";function s(e){for(var t,n={},i=Object.getOwnPropertyNames(e),r=0;(t=i[r])!==a;r++)n[t]=Object.getOwnPropertyDescriptor(e,t);return n}function c(){throw new Error("[Qoopido.js] Operation prohibited")}return{create:function(){var e,t=Object.create(this,s(this));return t._constructor&&(e=t._constructor.apply(t,arguments)),t.create=t.extend=c,e||t},extend:function(e,t){var n;return e=e||{},t=t===!0,e._parent=this,n=Object.create(this,s(e)),t===!0&&(n.extend=c),n}}},navigator,this,document),function(e){var t=[];window.getComputedStyle||t.push("polyfill/window/getcomputedstyle"),Array.prototype.indexOf||t.push("../array/indexof"),window.qoopido.register("polyfill/window/matchmedia",e,t)}(function(e,t,n,i,r,o,a){"use strict";function s(){var e=r.innerWidth||h.clientWidth,t=r.innerHeight||h.clientHeight,n=r.screen.width,i=r.screen.height,o=r.screen.colorDepth,a=r.devicePixelRatio;v.width=e,v.height=t,v["aspect-ratio"]=(e/t).toFixed(2),v.color=o,v["color-index"]=Math.pow(2,o),v["device-aspect-ratio"]=(n/i).toFixed(2),v["device-height"]=i,v["device-width"]=n,v["device-pixel-ratio"]=a||1,v.resolution=a&&96*a||r.screen.deviceXDPI||96,v.orientation=t>=e?"portrait":"landscape"}function c(e){var t,n,i={matches:!1,media:e,addListener:function(e){e&&n.push(e)},removeListener:function(e){for(var t,i=0;(t=n[i])!==a;i++)t===e&&n.splice(i,1)}};return i.matches=""===e?!0:l(e),y.push({mql:i,listeners:[]}),t=y.length-1,g[e]=t,n=y[t].listeners,i}function l(e){var t=-1!==e.indexOf(",")&&e.split(",")||[e],n=t.length-1,i=n,r=null,o=null,a="",s=0,c=!1,l="",u="",d=null,p=0,f=0,m=null,h="",y="",g="",x="",_="",z=!1;if(""===e)return!0;do if(r=t[i-n],c=!1,o=r.match(w.type),o&&(a=o[0],s=o.index),!o||-1===r.substring(0,s).indexOf("(")&&(s||!o[3]&&a!==o.input))z=!1;else{if(u=r,c="not"===o[1],s||(l=o[2],u=r.substring(a.length)),z=l===v.type||"all"===l||""===l,d=-1!==u.indexOf(" and ")&&u.split(" and ")||[u],p=d.length-1,f=p,z&&p>=0&&""!==u)do{if(m=d[p].match(w.media),!m||!v[m[3]]){z=!1;break}if(h=m[2],y=m[5],x=y,g=m[7],_=v[m[3]],g&&(x="px"===g?Number(y):"em"===g||"rem"===g?16*y:m[8]?(y/m[8]).toFixed(2):"dppx"===g?96*y:"dpcm"===g?.3937*y:Number(y)),z="min-"===h&&x?_>=x:"max-"===h&&x?x>=_:x?_===x:!!_,!z)break}while(p--);if(z)break}while(n--);return c?!z:z}function u(){var e,t,n=!1,i=0,o=0;if(y.length>0)for(s();(e=y[i])!==a;i++)if(n=l(e.mql.media),(n&&!e.mql.matches||!n&&e.mql.matches)&&(e.mql.matches=n,e.listeners))for(;(t=e.listeners[o])!==a;o++)t.call(r,e.mql)}function d(){r.clearTimeout(f),f=r.setTimeout(u,10)}function p(){var t,n=r.document.getElementsByTagName("script")[0],i=o.createElement("style"),s=["screen","print","speech","projection","handheld","tv","braille","embossed","tty"],c="#"+m+" { position: relative; z-index: 0; }",l="",u=r.addEventListener||(l="on")&&r.attachEvent,p=0;for(i.type="text/css",i.id=m,n.parentNode.insertBefore(i,n);(t=s[p])!==a;p++)c+="@media "+t+" { #"+m+" { position: relative; z-index: "+p+" } }";i.styleSheet?i.styleSheet.cssText=c:i.textContent=c,v.type=s[1*(r.getComputedStyle||e["polyfill/window/getcomputedstyle"])(i).zIndex||0],i.parentNode.removeChild(i),u(l+"resize",d),u(l+"orientationchange",d)}var f,m="qoopidoPolyfillWindowMatchmedia",h=o.documentElement,y=[],g={},v={},w={type:/\s*(only|not)?\s*(screen|print|[a-z\-]+)\s*(and)?\s*/i,media:/^\s*\(\s*(-[a-z]+-)?(min-|max-)?([a-z\-]+)\s*(:?\s*([0-9]+(\.[0-9]+)?|portrait|landscape)(px|em|dppx|dpcm|rem|%|in|cm|mm|ex|pt|pc|\/([0-9]+(\.[0-9]+)?))?)?\s*\)\s*$/};return r.matchMedia||(p(),s(),r.matchMedia=function(e){var t=g[e]||!1;return t===!1?c(e):y[t].mql}),r.matchMedia}),function(e){window.qoopido.register("emitter",e,["./base"])}(function(e,t,n,i,r,o,a){"use strict";function s(e,t){var n=t.charAt(0).toUpperCase()+t.slice(1);return e._mapped[t]=e[t],function(){var i,r=Array.prototype.slice.call(arguments);return e.emit.apply(e,["pre"+n,r]),i=e._mapped[t].apply(e,r),e.emit.apply(e,["post"+n,r,i]),i}}var c=/^(_|extend$|create$|on$|one$|off$|emit$|get.+)/;return e.base.extend({_mapped:null,_listener:null,_temp:null,_constructor:function(){var e,t=this;t._mapped={},t._listener={};for(e in t)"function"==typeof t[e]&&c.test(e)===!1&&(t[e]=s(t,e));return t},on:function(e,t){var n,i=this,r=0;for(e=e.split(" ");(n=e[r])!==a;r++)(i._listener[n]=i._listener[n]||[]).push(t);return i},one:function(e,t,n){n=n!==!1;var i=this;return i.on(e,function r(o){i.off(n===!0?o:e,r),t.apply(this,arguments)}),i},off:function(e,t){var n,i,r,o=this,s=0;if(e)for(e=e.split(" ");(n=e[s])!==a;s++)if(o._listener[n]=o._listener[n]||[],t)for(i=0;(r=o._listener[n][i])!==a;i++)r===t&&(o._listener[n].splice(i,1),i--);else o._listener[n].length=0;else for(n in o._listener)o._listener[n].length=0;return o},emit:function(e){var t,n=this,i=0;if(e!==a){for(n._listener[e]=n._listener[e]||[],n._temp=n._listener[e].slice();(t=n._temp[i])!==a;i++)t.apply(n,arguments);n._temp.length=0}return n}})}),function(e){var t=["../emitter"];window.matchMedia||t.push("../polyfill/window/matchmedia"),window.qoopido.register("component/sense",e,t)}(function(e,t,n,i,r,o,a){"use strict";function s(){var e=this,t=e.mql;e.emit(t.matches===!0?"matched":"dematched")}var c,l={};return c=e.emitter.extend({mql:null,_constructor:function(e){var t=c._parent._constructor.call(this),n=t.mql=l[e]||(l[e]=r.matchMedia(e)),i=function(){s.call(t)};return n.addListener(i),r.setTimeout(i,0),t},matches:function(){return this.mql.matches}})}),function(e){window.qoopido.registerSingleton("component/remux",e,["../emitter","./sense"])}(function(e,t,n,i,r,o,a){"use strict";function s(e,t){var n=this;return e&&t&&(u.className=e,u.style.fontSize=t+"px",p.layout=e,p.fontsize=t,(f.fontsize!==p.fontsize||f.layout!==p.layout)&&(p.ratio.device=r.devicePixelRatio||1,p.ratio.fontsize=p.fontsize/d,p.ratio.total=p.ratio.device*p.ratio.fontsize,f.layout!==p.layout&&n.emit("layoutchanged",p),f.fontsize!==p.fontsize&&n.emit("fontsizechanged",p),n.emit("statechanged",p),f.fontsize=p.fontsize,f.layout=p.layout)),n}function c(t,n,i){var o=this;r.setTimeout(function(){e["component/sense"].create(t).on("matched",function(){s.call(o,n,i)})},0)}var l,u=o.getElementsByTagName("html")[0],d=16,p={fontsize:null,layout:null,ratio:{}},f={fontsize:null,layout:null};return l=e.emitter.extend({_constructor:function(){var e=l._parent._constructor.call(this),t=parseInt(u.getAttribute("data-base"),10);return isNaN(t)===!1&&(d=t),e},getState:function(){return p},getLayout:function(){return p.layout},getFontsize:function(){return p.fontsize},setLayout:function(e,t){var n=this;return s.call(n,e,t),n},addLayout:function(e,t){var n,i,r,o,a,s,l,u,p=this;arguments.length>1?(n={},n[e]=t):n=arguments[0];for(i in n)for(r=n[i],o=r.min;o<=r.max;o++)l=Math.round(r.width*(o/d)),u=Math.round(r.width*((o+1)/d))-1,c.call(p,"screen and (min-width: "+l+"px) and (max-width: "+u+"px )",i,o),a=!a||l=s.width?{width:u,fontsize:o,layout:i}:s;return c.call(p,"screen and (max-width: "+(a.width-1)+"px)",a.layout,a.fontsize),c.call(p,"screen and (min-width: "+(s.width+1)+"px)",s.layout,s.fontsize),p}})}); \ No newline at end of file diff --git a/dist/latest/min/packages/qoopido.remux.legacy.js b/dist/latest/min/packages/qoopido.remux.legacy.js new file mode 100644 index 00000000..f34cfdcc --- /dev/null +++ b/dist/latest/min/packages/qoopido.remux.legacy.js @@ -0,0 +1,2 @@ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +!function(e,t){t.register?t.register("polyfill/object/defineproperty",e):(t.modules=t.modules||{})["polyfill/object/defineproperty"]=e()}(function(e,t,r,n,o,i,c){"use strict";if(!Object.defineProperty||!function(){try{return Object.defineProperty({},"x",{}),!0}catch(e){return!1}}()){var s=Object.defineProperty,a=Object.prototype.__defineGetter__,l=Object.prototype.__defineSetter__;Object.defineProperty=function(e,t,r){if(s)try{return s(e,t,r)}catch(n){}if(e!==Object(e))throw new TypeError("Object.defineProperty called on non-object");return a&&"get"in r&&a.call(e,t,r.get),l&&"set"in r&&l.call(e,t,r.set),"value"in r&&(e[t]=r.value),e}}return Object.defineProperty},window.qoopido=window.qoopido||{}),function(e,t){if(t.register){var r=[];Object.defineProperty&&function(){try{return Object.defineProperty({},"x",{}),!0}catch(e){return!1}}()||r.push("./defineproperty"),t.register("polyfill/object/defineproperties",e,r)}else(t.modules=t.modules||{})["polyfill/object/defineproperties"]=e()}(function(e,t,r,n,o,i,c){"use strict";return Object.defineProperties||(Object.defineProperties=function(e,t){if(e!==Object(e))throw new TypeError("Object.defineProperties called on non-object");var r;for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&Object.defineProperty(e,r,t[r]);return e}),Object.defineProperties},window.qoopido=window.qoopido||{}),function(e,t){if(t.register){var r=[];Object.defineProperties||r.push("./defineproperties"),t.register("polyfill/object/create",e,r)}else(t.modules=t.modules||{})["polyfill/object/create"]=e()}(function(e,t,r,n,o,i,c){"use strict";return Object.create||(Object.create=function(e,t){function r(){}if("object"!=typeof e)throw new TypeError;r.prototype=e;var n=new r;if(e&&(n.constructor=r),arguments.length>1){if(t!==Object(t))throw new TypeError;Object.defineProperties(n,t)}return n}),Object.create},window.qoopido=window.qoopido||{}),function(e,t){t.register?t.register("polyfill/object/getownpropertynames",e):(t.modules=t.modules||{})["polyfill/object/getownpropertynames"]=e()}(function(e,t,r,n,o,i,c){"use strict";return Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(e){if(e!==Object(e))throw new TypeError("Object.getOwnPropertyNames called on non-object");var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.push(t);return r}),Object.getOwnPropertyNames},window.qoopido=window.qoopido||{}),function(e,t){t.register?t.register("polyfill/object/getownpropertydescriptor",e):(t.modules=t.modules||{})["polyfill/object/getownpropertydescriptor"]=e()}(function(e,t,r,n,o,i,c){"use strict";if(!Object.getOwnPropertyDescriptor||!function(){try{return Object.getOwnPropertyDescriptor({x:0},"x"),!0}catch(e){return!1}}()){var s=Object.getOwnPropertyDescriptor;Object.getOwnPropertyDescriptor=function(e,t){if(e!==Object(e))throw new TypeError;try{return s.call(Object,e,t)}catch(r){}return Object.prototype.hasOwnProperty.call(e,t)?{value:e[t],enumerable:!0,writable:!0,configurable:!0}:void 0}}return Object.getOwnPropertyDescriptor},window.qoopido=window.qoopido||{}),function(e,t,r,n,o){"use strict";function i(e,i,c,a){var p,f=e.split("/");return u[e]?u[e]:(p=function(){if(c)for(var p,m,y=f.slice(0,-1).join("/"),h=0;(p=c[h])!==o;h++)m=d.test(p),m&&(p=s(y+"/"+p)),!u[p]&&arguments[h]&&(u[p]=arguments[h]),m&&!u[p]&&"undefined"!=typeof console&&console.error("".concat("[Qoopido.js] ",e,": Could not load dependency ",p));return u[e]=i(u,l,f,t,r,n,o),a&&a(u[e]),u[e]},void("undefined"!=typeof module&&module.exports?module.exports=define(p):"function"==typeof define&&define.amd?c?define(c,p):define(p):p()))}function c(e,t,r){i(e,t,r,function(t){u[e]=t.create()})}function s(e){for(var t;(t=e.replace(f,""))!==e;)e=t;return e.replace(m,"")}var a=r.qoopido||(r.qoopido={}),l=a.shared||(a.shared={}),u=a.modules||(a.modules={}),p=[],d=new RegExp("^\\.+\\/"),f=new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."),m=new RegExp("(^\\/)|\\.\\/","g");a.register=i,a.registerSingleton=c,Object.create||p.push("./polyfill/object/create"),Object.getOwnPropertyNames||p.push("./polyfill/object/getownpropertynames"),Object.getOwnPropertyDescriptor&&function(){try{return Object.getOwnPropertyDescriptor({x:0},"x"),!0}catch(e){return!1}}()||p.push("./polyfill/object/getownpropertydescriptor"),i("base",e,p)}(function(e,t,r,n,o,i,c){"use strict";function s(e){for(var t,r={},n=Object.getOwnPropertyNames(e),o=0;(t=n[o])!==c;o++)r[t]=Object.getOwnPropertyDescriptor(e,t);return r}function a(){throw new Error("[Qoopido.js] Operation prohibited")}return{create:function(){var e,t=Object.create(this,s(this));return t._constructor&&(e=t._constructor.apply(t,arguments)),t.create=t.extend=a,e||t},extend:function(e,t){var r;return e=e||{},t=t===!0,e._parent=this,r=Object.create(this,s(e)),t===!0&&(r.extend=a),r}}},navigator,this,document),function(e){window.qoopido.register("polyfill/window/getcomputedstyle",e)}(function(e,t,r,n,o,i,c){"use strict";if(o.getComputedStyle)return o.getComputedStyle;var s=new RegExp("(\\-([a-z]){1})","g"),a=function(){return arguments[2].toUpperCase()};return function(e,t){var r=this;return r.getPropertyValue=function(t){return"float"===t&&(t="styleFloat"),s.test(t)&&(t=t.replace(s,a)),e.currentStyle[t]||null},r}}),function(e){var t=[];window.getComputedStyle||t.push("polyfill/window/getcomputedstyle"),Array.prototype.indexOf||t.push("../array/indexof"),window.qoopido.register("polyfill/window/matchmedia",e,t)}(function(e,t,r,n,o,i,c){"use strict";function s(){var e=o.innerWidth||y.clientWidth,t=o.innerHeight||y.clientHeight,r=o.screen.width,n=o.screen.height,i=o.screen.colorDepth,c=o.devicePixelRatio;g.width=e,g.height=t,g["aspect-ratio"]=(e/t).toFixed(2),g.color=i,g["color-index"]=Math.pow(2,i),g["device-aspect-ratio"]=(r/n).toFixed(2),g["device-height"]=n,g["device-width"]=r,g["device-pixel-ratio"]=c||1,g.resolution=c&&96*c||o.screen.deviceXDPI||96,g.orientation=t>=e?"portrait":"landscape"}function a(e){var t,r,n={matches:!1,media:e,addListener:function(e){e&&r.push(e)},removeListener:function(e){for(var t,n=0;(t=r[n])!==c;n++)t===e&&r.splice(n,1)}};return n.matches=""===e?!0:l(e),h.push({mql:n,listeners:[]}),t=h.length-1,w[e]=t,r=h[t].listeners,n}function l(e){var t=-1!==e.indexOf(",")&&e.split(",")||[e],r=t.length-1,n=r,o=null,i=null,c="",s=0,a=!1,l="",u="",p=null,d=0,f=0,m=null,y="",h="",w="",O="",j="",v=!1;if(""===e)return!0;do if(o=t[n-r],a=!1,i=o.match(b.type),i&&(c=i[0],s=i.index),!i||-1===o.substring(0,s).indexOf("(")&&(s||!i[3]&&c!==i.input))v=!1;else{if(u=o,a="not"===i[1],s||(l=i[2],u=o.substring(c.length)),v=l===g.type||"all"===l||""===l,p=-1!==u.indexOf(" and ")&&u.split(" and ")||[u],d=p.length-1,f=d,v&&d>=0&&""!==u)do{if(m=p[d].match(b.media),!m||!g[m[3]]){v=!1;break}if(y=m[2],h=m[5],O=h,w=m[7],j=g[m[3]],w&&(O="px"===w?Number(h):"em"===w||"rem"===w?16*h:m[8]?(h/m[8]).toFixed(2):"dppx"===w?96*h:"dpcm"===w?.3937*h:Number(h)),v="min-"===y&&O?j>=O:"max-"===y&&O?O>=j:O?j===O:!!j,!v)break}while(d--);if(v)break}while(r--);return a?!v:v}function u(){var e,t,r=!1,n=0,i=0;if(h.length>0)for(s();(e=h[n])!==c;n++)if(r=l(e.mql.media),(r&&!e.mql.matches||!r&&e.mql.matches)&&(e.mql.matches=r,e.listeners))for(;(t=e.listeners[i])!==c;i++)t.call(o,e.mql)}function p(){o.clearTimeout(f),f=o.setTimeout(u,10)}function d(){var t,r=o.document.getElementsByTagName("script")[0],n=i.createElement("style"),s=["screen","print","speech","projection","handheld","tv","braille","embossed","tty"],a="#"+m+" { position: relative; z-index: 0; }",l="",u=o.addEventListener||(l="on")&&o.attachEvent,d=0;for(n.type="text/css",n.id=m,r.parentNode.insertBefore(n,r);(t=s[d])!==c;d++)a+="@media "+t+" { #"+m+" { position: relative; z-index: "+d+" } }";n.styleSheet?n.styleSheet.cssText=a:n.textContent=a,g.type=s[1*(o.getComputedStyle||e["polyfill/window/getcomputedstyle"])(n).zIndex||0],n.parentNode.removeChild(n),u(l+"resize",p),u(l+"orientationchange",p)}var f,m="qoopidoPolyfillWindowMatchmedia",y=i.documentElement,h=[],w={},g={},b={type:/\s*(only|not)?\s*(screen|print|[a-z\-]+)\s*(and)?\s*/i,media:/^\s*\(\s*(-[a-z]+-)?(min-|max-)?([a-z\-]+)\s*(:?\s*([0-9]+(\.[0-9]+)?|portrait|landscape)(px|em|dppx|dpcm|rem|%|in|cm|mm|ex|pt|pc|\/([0-9]+(\.[0-9]+)?))?)?\s*\)\s*$/};return o.matchMedia||(d(),s(),o.matchMedia=function(e){var t=w[e]||!1;return t===!1?a(e):h[t].mql}),o.matchMedia}),function(e){window.qoopido.register("emitter",e,["./base"])}(function(e,t,r,n,o,i,c){"use strict";function s(e,t){var r=t.charAt(0).toUpperCase()+t.slice(1);return e._mapped[t]=e[t],function(){var n,o=Array.prototype.slice.call(arguments);return e.emit.apply(e,["pre"+r,o]),n=e._mapped[t].apply(e,o),e.emit.apply(e,["post"+r,o,n]),n}}var a=/^(_|extend$|create$|on$|one$|off$|emit$|get.+)/;return e.base.extend({_mapped:null,_listener:null,_temp:null,_constructor:function(){var e,t=this;t._mapped={},t._listener={};for(e in t)"function"==typeof t[e]&&a.test(e)===!1&&(t[e]=s(t,e));return t},on:function(e,t){var r,n=this,o=0;for(e=e.split(" ");(r=e[o])!==c;o++)(n._listener[r]=n._listener[r]||[]).push(t);return n},one:function(e,t,r){r=r!==!1;var n=this;return n.on(e,function o(i){n.off(r===!0?i:e,o),t.apply(this,arguments)}),n},off:function(e,t){var r,n,o,i=this,s=0;if(e)for(e=e.split(" ");(r=e[s])!==c;s++)if(i._listener[r]=i._listener[r]||[],t)for(n=0;(o=i._listener[r][n])!==c;n++)o===t&&(i._listener[r].splice(n,1),n--);else i._listener[r].length=0;else for(r in i._listener)i._listener[r].length=0;return i},emit:function(e){var t,r=this,n=0;if(e!==c){for(r._listener[e]=r._listener[e]||[],r._temp=r._listener[e].slice();(t=r._temp[n])!==c;n++)t.apply(r,arguments);r._temp.length=0}return r}})}),function(e){var t=["../emitter"];window.matchMedia||t.push("../polyfill/window/matchmedia"),window.qoopido.register("component/sense",e,t)}(function(e,t,r,n,o,i,c){"use strict";function s(){var e=this,t=e.mql;e.emit(t.matches===!0?"matched":"dematched")}var a,l={};return a=e.emitter.extend({mql:null,_constructor:function(e){var t=a._parent._constructor.call(this),r=t.mql=l[e]||(l[e]=o.matchMedia(e)),n=function(){s.call(t)};return r.addListener(n),o.setTimeout(n,0),t},matches:function(){return this.mql.matches}})}),function(e){window.qoopido.registerSingleton("component/remux",e,["../emitter","./sense"])}(function(e,t,r,n,o,i,c){"use strict";function s(e,t){var r=this;return e&&t&&(u.className=e,u.style.fontSize=t+"px",d.layout=e,d.fontsize=t,(f.fontsize!==d.fontsize||f.layout!==d.layout)&&(d.ratio.device=o.devicePixelRatio||1,d.ratio.fontsize=d.fontsize/p,d.ratio.total=d.ratio.device*d.ratio.fontsize,f.layout!==d.layout&&r.emit("layoutchanged",d),f.fontsize!==d.fontsize&&r.emit("fontsizechanged",d),r.emit("statechanged",d),f.fontsize=d.fontsize,f.layout=d.layout)),r}function a(t,r,n){var i=this;o.setTimeout(function(){e["component/sense"].create(t).on("matched",function(){s.call(i,r,n)})},0)}var l,u=i.getElementsByTagName("html")[0],p=16,d={fontsize:null,layout:null,ratio:{}},f={fontsize:null,layout:null};return l=e.emitter.extend({_constructor:function(){var e=l._parent._constructor.call(this),t=parseInt(u.getAttribute("data-base"),10);return isNaN(t)===!1&&(p=t),e},getState:function(){return d},getLayout:function(){return d.layout},getFontsize:function(){return d.fontsize},setLayout:function(e,t){var r=this;return s.call(r,e,t),r},addLayout:function(e,t){var r,n,o,i,c,s,l,u,d=this;arguments.length>1?(r={},r[e]=t):r=arguments[0];for(n in r)for(o=r[n],i=o.min;i<=o.max;i++)l=Math.round(o.width*(i/p)),u=Math.round(o.width*((i+1)/p))-1,a.call(d,"screen and (min-width: "+l+"px) and (max-width: "+u+"px )",n,i),c=!c||l=s.width?{width:u,fontsize:i,layout:n}:s;return a.call(d,"screen and (max-width: "+(c.width-1)+"px)",c.layout,c.fontsize),a.call(d,"screen and (min-width: "+(s.width+1)+"px)",s.layout,s.fontsize),d}})}); \ No newline at end of file diff --git a/dist/latest/min/packages/qoopido.sense.js b/dist/latest/min/packages/qoopido.sense.js new file mode 100644 index 00000000..df0388f5 --- /dev/null +++ b/dist/latest/min/packages/qoopido.sense.js @@ -0,0 +1,2 @@ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +!function(e,t,n,r,i){"use strict";function o(e,o,s,a){var d,m=e.split("/");return p[e]?p[e]:(d=function(){if(s)for(var d,f,h=m.slice(0,-1).join("/"),g=0;(d=s[g])!==i;g++)f=u.test(d),f&&(d=c(h+"/"+d)),!p[d]&&arguments[g]&&(p[d]=arguments[g]),f&&!p[d]&&"undefined"!=typeof console&&console.error("".concat("[Qoopido.js] ",e,": Could not load dependency ",d));return p[e]=o(p,l,m,t,n,r,i),a&&a(p[e]),p[e]},void("undefined"!=typeof module&&module.exports?module.exports=define(d):"function"==typeof define&&define.amd?s?define(s,d):define(d):d()))}function s(e,t,n){o(e,t,n,function(t){p[e]=t.create()})}function c(e){for(var t;(t=e.replace(m,""))!==e;)e=t;return e.replace(f,"")}var a=n.qoopido||(n.qoopido={}),l=a.shared||(a.shared={}),p=a.modules||(a.modules={}),d=[],u=new RegExp("^\\.+\\/"),m=new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."),f=new RegExp("(^\\/)|\\.\\/","g");a.register=o,a.registerSingleton=s,Object.create||d.push("./polyfill/object/create"),Object.getOwnPropertyNames||d.push("./polyfill/object/getownpropertynames"),Object.getOwnPropertyDescriptor&&function(){try{return Object.getOwnPropertyDescriptor({x:0},"x"),!0}catch(e){return!1}}()||d.push("./polyfill/object/getownpropertydescriptor"),o("base",e,d)}(function(e,t,n,r,i,o,s){"use strict";function c(e){for(var t,n={},r=Object.getOwnPropertyNames(e),i=0;(t=r[i])!==s;i++)n[t]=Object.getOwnPropertyDescriptor(e,t);return n}function a(){throw new Error("[Qoopido.js] Operation prohibited")}return{create:function(){var e,t=Object.create(this,c(this));return t._constructor&&(e=t._constructor.apply(t,arguments)),t.create=t.extend=a,e||t},extend:function(e,t){var n;return e=e||{},t=t===!0,e._parent=this,n=Object.create(this,c(e)),t===!0&&(n.extend=a),n}}},navigator,this,document),function(e){var t=[];window.getComputedStyle||t.push("polyfill/window/getcomputedstyle"),Array.prototype.indexOf||t.push("../array/indexof"),window.qoopido.register("polyfill/window/matchmedia",e,t)}(function(e,t,n,r,i,o,s){"use strict";function c(){var e=i.innerWidth||h.clientWidth,t=i.innerHeight||h.clientHeight,n=i.screen.width,r=i.screen.height,o=i.screen.colorDepth,s=i.devicePixelRatio;v.width=e,v.height=t,v["aspect-ratio"]=(e/t).toFixed(2),v.color=o,v["color-index"]=Math.pow(2,o),v["device-aspect-ratio"]=(n/r).toFixed(2),v["device-height"]=r,v["device-width"]=n,v["device-pixel-ratio"]=s||1,v.resolution=s&&96*s||i.screen.deviceXDPI||96,v.orientation=t>=e?"portrait":"landscape"}function a(e){var t,n,r={matches:!1,media:e,addListener:function(e){e&&n.push(e)},removeListener:function(e){for(var t,r=0;(t=n[r])!==s;r++)t===e&&n.splice(r,1)}};return r.matches=""===e?!0:l(e),g.push({mql:r,listeners:[]}),t=g.length-1,y[e]=t,n=g[t].listeners,r}function l(e){var t=-1!==e.indexOf(",")&&e.split(",")||[e],n=t.length-1,r=n,i=null,o=null,s="",c=0,a=!1,l="",p="",d=null,u=0,m=0,f=null,h="",g="",y="",w="",_="",b=!1;if(""===e)return!0;do if(i=t[r-n],a=!1,o=i.match(x.type),o&&(s=o[0],c=o.index),!o||-1===i.substring(0,c).indexOf("(")&&(c||!o[3]&&s!==o.input))b=!1;else{if(p=i,a="not"===o[1],c||(l=o[2],p=i.substring(s.length)),b=l===v.type||"all"===l||""===l,d=-1!==p.indexOf(" and ")&&p.split(" and ")||[p],u=d.length-1,m=u,b&&u>=0&&""!==p)do{if(f=d[u].match(x.media),!f||!v[f[3]]){b=!1;break}if(h=f[2],g=f[5],w=g,y=f[7],_=v[f[3]],y&&(w="px"===y?Number(g):"em"===y||"rem"===y?16*g:f[8]?(g/f[8]).toFixed(2):"dppx"===y?96*g:"dpcm"===y?.3937*g:Number(g)),b="min-"===h&&w?_>=w:"max-"===h&&w?w>=_:w?_===w:!!_,!b)break}while(u--);if(b)break}while(n--);return a?!b:b}function p(){var e,t,n=!1,r=0,o=0;if(g.length>0)for(c();(e=g[r])!==s;r++)if(n=l(e.mql.media),(n&&!e.mql.matches||!n&&e.mql.matches)&&(e.mql.matches=n,e.listeners))for(;(t=e.listeners[o])!==s;o++)t.call(i,e.mql)}function d(){i.clearTimeout(m),m=i.setTimeout(p,10)}function u(){var t,n=i.document.getElementsByTagName("script")[0],r=o.createElement("style"),c=["screen","print","speech","projection","handheld","tv","braille","embossed","tty"],a="#"+f+" { position: relative; z-index: 0; }",l="",p=i.addEventListener||(l="on")&&i.attachEvent,u=0;for(r.type="text/css",r.id=f,n.parentNode.insertBefore(r,n);(t=c[u])!==s;u++)a+="@media "+t+" { #"+f+" { position: relative; z-index: "+u+" } }";r.styleSheet?r.styleSheet.cssText=a:r.textContent=a,v.type=c[1*(i.getComputedStyle||e["polyfill/window/getcomputedstyle"])(r).zIndex||0],r.parentNode.removeChild(r),p(l+"resize",d),p(l+"orientationchange",d)}var m,f="qoopidoPolyfillWindowMatchmedia",h=o.documentElement,g=[],y={},v={},x={type:/\s*(only|not)?\s*(screen|print|[a-z\-]+)\s*(and)?\s*/i,media:/^\s*\(\s*(-[a-z]+-)?(min-|max-)?([a-z\-]+)\s*(:?\s*([0-9]+(\.[0-9]+)?|portrait|landscape)(px|em|dppx|dpcm|rem|%|in|cm|mm|ex|pt|pc|\/([0-9]+(\.[0-9]+)?))?)?\s*\)\s*$/};return i.matchMedia||(u(),c(),i.matchMedia=function(e){var t=y[e]||!1;return t===!1?a(e):g[t].mql}),i.matchMedia}),function(e){window.qoopido.register("emitter",e,["./base"])}(function(e,t,n,r,i,o,s){"use strict";function c(e,t){var n=t.charAt(0).toUpperCase()+t.slice(1);return e._mapped[t]=e[t],function(){var r,i=Array.prototype.slice.call(arguments);return e.emit.apply(e,["pre"+n,i]),r=e._mapped[t].apply(e,i),e.emit.apply(e,["post"+n,i,r]),r}}var a=/^(_|extend$|create$|on$|one$|off$|emit$|get.+)/;return e.base.extend({_mapped:null,_listener:null,_temp:null,_constructor:function(){var e,t=this;t._mapped={},t._listener={};for(e in t)"function"==typeof t[e]&&a.test(e)===!1&&(t[e]=c(t,e));return t},on:function(e,t){var n,r=this,i=0;for(e=e.split(" ");(n=e[i])!==s;i++)(r._listener[n]=r._listener[n]||[]).push(t);return r},one:function(e,t,n){n=n!==!1;var r=this;return r.on(e,function i(o){r.off(n===!0?o:e,i),t.apply(this,arguments)}),r},off:function(e,t){var n,r,i,o=this,c=0;if(e)for(e=e.split(" ");(n=e[c])!==s;c++)if(o._listener[n]=o._listener[n]||[],t)for(r=0;(i=o._listener[n][r])!==s;r++)i===t&&(o._listener[n].splice(r,1),r--);else o._listener[n].length=0;else for(n in o._listener)o._listener[n].length=0;return o},emit:function(e){var t,n=this,r=0;if(e!==s){for(n._listener[e]=n._listener[e]||[],n._temp=n._listener[e].slice();(t=n._temp[r])!==s;r++)t.apply(n,arguments);n._temp.length=0}return n}})}),function(e){var t=["../emitter"];window.matchMedia||t.push("../polyfill/window/matchmedia"),window.qoopido.register("component/sense",e,t)}(function(e,t,n,r,i,o,s){"use strict";function c(){var e=this,t=e.mql;e.emit(t.matches===!0?"matched":"dematched")}var a,l={};return a=e.emitter.extend({mql:null,_constructor:function(e){var t=a._parent._constructor.call(this),n=t.mql=l[e]||(l[e]=i.matchMedia(e)),r=function(){c.call(t)};return n.addListener(r),i.setTimeout(r,0),t},matches:function(){return this.mql.matches}})}); \ No newline at end of file diff --git a/dist/latest/min/packages/qoopido.sense.legacy.js b/dist/latest/min/packages/qoopido.sense.legacy.js new file mode 100644 index 00000000..7799ca2f --- /dev/null +++ b/dist/latest/min/packages/qoopido.sense.legacy.js @@ -0,0 +1,2 @@ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +!function(e,t){t.register?t.register("polyfill/object/defineproperty",e):(t.modules=t.modules||{})["polyfill/object/defineproperty"]=e()}(function(e,t,r,n,o,i,c){"use strict";if(!Object.defineProperty||!function(){try{return Object.defineProperty({},"x",{}),!0}catch(e){return!1}}()){var s=Object.defineProperty,p=Object.prototype.__defineGetter__,l=Object.prototype.__defineSetter__;Object.defineProperty=function(e,t,r){if(s)try{return s(e,t,r)}catch(n){}if(e!==Object(e))throw new TypeError("Object.defineProperty called on non-object");return p&&"get"in r&&p.call(e,t,r.get),l&&"set"in r&&l.call(e,t,r.set),"value"in r&&(e[t]=r.value),e}}return Object.defineProperty},window.qoopido=window.qoopido||{}),function(e,t){if(t.register){var r=[];Object.defineProperty&&function(){try{return Object.defineProperty({},"x",{}),!0}catch(e){return!1}}()||r.push("./defineproperty"),t.register("polyfill/object/defineproperties",e,r)}else(t.modules=t.modules||{})["polyfill/object/defineproperties"]=e()}(function(e,t,r,n,o,i,c){"use strict";return Object.defineProperties||(Object.defineProperties=function(e,t){if(e!==Object(e))throw new TypeError("Object.defineProperties called on non-object");var r;for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&Object.defineProperty(e,r,t[r]);return e}),Object.defineProperties},window.qoopido=window.qoopido||{}),function(e,t){if(t.register){var r=[];Object.defineProperties||r.push("./defineproperties"),t.register("polyfill/object/create",e,r)}else(t.modules=t.modules||{})["polyfill/object/create"]=e()}(function(e,t,r,n,o,i,c){"use strict";return Object.create||(Object.create=function(e,t){function r(){}if("object"!=typeof e)throw new TypeError;r.prototype=e;var n=new r;if(e&&(n.constructor=r),arguments.length>1){if(t!==Object(t))throw new TypeError;Object.defineProperties(n,t)}return n}),Object.create},window.qoopido=window.qoopido||{}),function(e,t){t.register?t.register("polyfill/object/getownpropertynames",e):(t.modules=t.modules||{})["polyfill/object/getownpropertynames"]=e()}(function(e,t,r,n,o,i,c){"use strict";return Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(e){if(e!==Object(e))throw new TypeError("Object.getOwnPropertyNames called on non-object");var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.push(t);return r}),Object.getOwnPropertyNames},window.qoopido=window.qoopido||{}),function(e,t){t.register?t.register("polyfill/object/getownpropertydescriptor",e):(t.modules=t.modules||{})["polyfill/object/getownpropertydescriptor"]=e()}(function(e,t,r,n,o,i,c){"use strict";if(!Object.getOwnPropertyDescriptor||!function(){try{return Object.getOwnPropertyDescriptor({x:0},"x"),!0}catch(e){return!1}}()){var s=Object.getOwnPropertyDescriptor;Object.getOwnPropertyDescriptor=function(e,t){if(e!==Object(e))throw new TypeError;try{return s.call(Object,e,t)}catch(r){}return Object.prototype.hasOwnProperty.call(e,t)?{value:e[t],enumerable:!0,writable:!0,configurable:!0}:void 0}}return Object.getOwnPropertyDescriptor},window.qoopido=window.qoopido||{}),function(e,t,r,n,o){"use strict";function i(e,i,c,p){var u,f=e.split("/");return a[e]?a[e]:(u=function(){if(c)for(var u,m,y=f.slice(0,-1).join("/"),h=0;(u=c[h])!==o;h++)m=d.test(u),m&&(u=s(y+"/"+u)),!a[u]&&arguments[h]&&(a[u]=arguments[h]),m&&!a[u]&&"undefined"!=typeof console&&console.error("".concat("[Qoopido.js] ",e,": Could not load dependency ",u));return a[e]=i(a,l,f,t,r,n,o),p&&p(a[e]),a[e]},void("undefined"!=typeof module&&module.exports?module.exports=define(u):"function"==typeof define&&define.amd?c?define(c,u):define(u):u()))}function c(e,t,r){i(e,t,r,function(t){a[e]=t.create()})}function s(e){for(var t;(t=e.replace(f,""))!==e;)e=t;return e.replace(m,"")}var p=r.qoopido||(r.qoopido={}),l=p.shared||(p.shared={}),a=p.modules||(p.modules={}),u=[],d=new RegExp("^\\.+\\/"),f=new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."),m=new RegExp("(^\\/)|\\.\\/","g");p.register=i,p.registerSingleton=c,Object.create||u.push("./polyfill/object/create"),Object.getOwnPropertyNames||u.push("./polyfill/object/getownpropertynames"),Object.getOwnPropertyDescriptor&&function(){try{return Object.getOwnPropertyDescriptor({x:0},"x"),!0}catch(e){return!1}}()||u.push("./polyfill/object/getownpropertydescriptor"),i("base",e,u)}(function(e,t,r,n,o,i,c){"use strict";function s(e){for(var t,r={},n=Object.getOwnPropertyNames(e),o=0;(t=n[o])!==c;o++)r[t]=Object.getOwnPropertyDescriptor(e,t);return r}function p(){throw new Error("[Qoopido.js] Operation prohibited")}return{create:function(){var e,t=Object.create(this,s(this));return t._constructor&&(e=t._constructor.apply(t,arguments)),t.create=t.extend=p,e||t},extend:function(e,t){var r;return e=e||{},t=t===!0,e._parent=this,r=Object.create(this,s(e)),t===!0&&(r.extend=p),r}}},navigator,this,document),function(e){window.qoopido.register("polyfill/window/getcomputedstyle",e)}(function(e,t,r,n,o,i,c){"use strict";if(o.getComputedStyle)return o.getComputedStyle;var s=new RegExp("(\\-([a-z]){1})","g"),p=function(){return arguments[2].toUpperCase()};return function(e,t){var r=this;return r.getPropertyValue=function(t){return"float"===t&&(t="styleFloat"),s.test(t)&&(t=t.replace(s,p)),e.currentStyle[t]||null},r}}),function(e){var t=[];window.getComputedStyle||t.push("polyfill/window/getcomputedstyle"),Array.prototype.indexOf||t.push("../array/indexof"),window.qoopido.register("polyfill/window/matchmedia",e,t)}(function(e,t,r,n,o,i,c){"use strict";function s(){var e=o.innerWidth||y.clientWidth,t=o.innerHeight||y.clientHeight,r=o.screen.width,n=o.screen.height,i=o.screen.colorDepth,c=o.devicePixelRatio;g.width=e,g.height=t,g["aspect-ratio"]=(e/t).toFixed(2),g.color=i,g["color-index"]=Math.pow(2,i),g["device-aspect-ratio"]=(r/n).toFixed(2),g["device-height"]=n,g["device-width"]=r,g["device-pixel-ratio"]=c||1,g.resolution=c&&96*c||o.screen.deviceXDPI||96,g.orientation=t>=e?"portrait":"landscape"}function p(e){var t,r,n={matches:!1,media:e,addListener:function(e){e&&r.push(e)},removeListener:function(e){for(var t,n=0;(t=r[n])!==c;n++)t===e&&r.splice(n,1)}};return n.matches=""===e?!0:l(e),h.push({mql:n,listeners:[]}),t=h.length-1,w[e]=t,r=h[t].listeners,n}function l(e){var t=-1!==e.indexOf(",")&&e.split(",")||[e],r=t.length-1,n=r,o=null,i=null,c="",s=0,p=!1,l="",a="",u=null,d=0,f=0,m=null,y="",h="",w="",O="",j="",v=!1;if(""===e)return!0;do if(o=t[n-r],p=!1,i=o.match(b.type),i&&(c=i[0],s=i.index),!i||-1===o.substring(0,s).indexOf("(")&&(s||!i[3]&&c!==i.input))v=!1;else{if(a=o,p="not"===i[1],s||(l=i[2],a=o.substring(c.length)),v=l===g.type||"all"===l||""===l,u=-1!==a.indexOf(" and ")&&a.split(" and ")||[a],d=u.length-1,f=d,v&&d>=0&&""!==a)do{if(m=u[d].match(b.media),!m||!g[m[3]]){v=!1;break}if(y=m[2],h=m[5],O=h,w=m[7],j=g[m[3]],w&&(O="px"===w?Number(h):"em"===w||"rem"===w?16*h:m[8]?(h/m[8]).toFixed(2):"dppx"===w?96*h:"dpcm"===w?.3937*h:Number(h)),v="min-"===y&&O?j>=O:"max-"===y&&O?O>=j:O?j===O:!!j,!v)break}while(d--);if(v)break}while(r--);return p?!v:v}function a(){var e,t,r=!1,n=0,i=0;if(h.length>0)for(s();(e=h[n])!==c;n++)if(r=l(e.mql.media),(r&&!e.mql.matches||!r&&e.mql.matches)&&(e.mql.matches=r,e.listeners))for(;(t=e.listeners[i])!==c;i++)t.call(o,e.mql)}function u(){o.clearTimeout(f),f=o.setTimeout(a,10)}function d(){var t,r=o.document.getElementsByTagName("script")[0],n=i.createElement("style"),s=["screen","print","speech","projection","handheld","tv","braille","embossed","tty"],p="#"+m+" { position: relative; z-index: 0; }",l="",a=o.addEventListener||(l="on")&&o.attachEvent,d=0;for(n.type="text/css",n.id=m,r.parentNode.insertBefore(n,r);(t=s[d])!==c;d++)p+="@media "+t+" { #"+m+" { position: relative; z-index: "+d+" } }";n.styleSheet?n.styleSheet.cssText=p:n.textContent=p,g.type=s[1*(o.getComputedStyle||e["polyfill/window/getcomputedstyle"])(n).zIndex||0],n.parentNode.removeChild(n),a(l+"resize",u),a(l+"orientationchange",u)}var f,m="qoopidoPolyfillWindowMatchmedia",y=i.documentElement,h=[],w={},g={},b={type:/\s*(only|not)?\s*(screen|print|[a-z\-]+)\s*(and)?\s*/i,media:/^\s*\(\s*(-[a-z]+-)?(min-|max-)?([a-z\-]+)\s*(:?\s*([0-9]+(\.[0-9]+)?|portrait|landscape)(px|em|dppx|dpcm|rem|%|in|cm|mm|ex|pt|pc|\/([0-9]+(\.[0-9]+)?))?)?\s*\)\s*$/};return o.matchMedia||(d(),s(),o.matchMedia=function(e){var t=w[e]||!1;return t===!1?p(e):h[t].mql}),o.matchMedia}),function(e){window.qoopido.register("emitter",e,["./base"])}(function(e,t,r,n,o,i,c){"use strict";function s(e,t){var r=t.charAt(0).toUpperCase()+t.slice(1);return e._mapped[t]=e[t],function(){var n,o=Array.prototype.slice.call(arguments);return e.emit.apply(e,["pre"+r,o]),n=e._mapped[t].apply(e,o),e.emit.apply(e,["post"+r,o,n]),n}}var p=/^(_|extend$|create$|on$|one$|off$|emit$|get.+)/;return e.base.extend({_mapped:null,_listener:null,_temp:null,_constructor:function(){var e,t=this;t._mapped={},t._listener={};for(e in t)"function"==typeof t[e]&&p.test(e)===!1&&(t[e]=s(t,e));return t},on:function(e,t){var r,n=this,o=0;for(e=e.split(" ");(r=e[o])!==c;o++)(n._listener[r]=n._listener[r]||[]).push(t);return n},one:function(e,t,r){r=r!==!1;var n=this;return n.on(e,function o(i){n.off(r===!0?i:e,o),t.apply(this,arguments)}),n},off:function(e,t){var r,n,o,i=this,s=0;if(e)for(e=e.split(" ");(r=e[s])!==c;s++)if(i._listener[r]=i._listener[r]||[],t)for(n=0;(o=i._listener[r][n])!==c;n++)o===t&&(i._listener[r].splice(n,1),n--);else i._listener[r].length=0;else for(r in i._listener)i._listener[r].length=0;return i},emit:function(e){var t,r=this,n=0;if(e!==c){for(r._listener[e]=r._listener[e]||[],r._temp=r._listener[e].slice();(t=r._temp[n])!==c;n++)t.apply(r,arguments);r._temp.length=0}return r}})}),function(e){var t=["../emitter"];window.matchMedia||t.push("../polyfill/window/matchmedia"),window.qoopido.register("component/sense",e,t)}(function(e,t,r,n,o,i,c){"use strict";function s(){var e=this,t=e.mql;e.emit(t.matches===!0?"matched":"dematched")}var p,l={};return p=e.emitter.extend({mql:null,_constructor:function(e){var t=p._parent._constructor.call(this),r=t.mql=l[e]||(l[e]=o.matchMedia(e)),n=function(){s.call(t)};return r.addListener(n),o.setTimeout(n,0),t},matches:function(){return this.mql.matches}})}); \ No newline at end of file diff --git a/dist/latest/min/packages/qoopido.shrinkimage.js b/dist/latest/min/packages/qoopido.shrinkimage.js new file mode 100644 index 00000000..fbaea9db --- /dev/null +++ b/dist/latest/min/packages/qoopido.shrinkimage.js @@ -0,0 +1,2 @@ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +!function(e,t,n,r,o){"use strict";function i(e,i,s,a){var p,d=e.split("/");return c[e]?c[e]:(p=function(){if(s)for(var p,m,h=d.slice(0,-1).join("/"),g=0;(p=s[g])!==o;g++)m=f.test(p),m&&(p=u(h+"/"+p)),!c[p]&&arguments[g]&&(c[p]=arguments[g]),m&&!c[p]&&"undefined"!=typeof console&&console.error("".concat("[Qoopido.js] ",e,": Could not load dependency ",p));return c[e]=i(c,l,d,t,n,r,o),a&&a(c[e]),c[e]},void("undefined"!=typeof module&&module.exports?module.exports=define(p):"function"==typeof define&&define.amd?s?define(s,p):define(p):p()))}function s(e,t,n){i(e,t,n,function(t){c[e]=t.create()})}function u(e){for(var t;(t=e.replace(d,""))!==e;)e=t;return e.replace(m,"")}var a=n.qoopido||(n.qoopido={}),l=a.shared||(a.shared={}),c=a.modules||(a.modules={}),p=[],f=new RegExp("^\\.+\\/"),d=new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."),m=new RegExp("(^\\/)|\\.\\/","g");a.register=i,a.registerSingleton=s,Object.create||p.push("./polyfill/object/create"),Object.getOwnPropertyNames||p.push("./polyfill/object/getownpropertynames"),Object.getOwnPropertyDescriptor&&function(){try{return Object.getOwnPropertyDescriptor({x:0},"x"),!0}catch(e){return!1}}()||p.push("./polyfill/object/getownpropertydescriptor"),i("base",e,p)}(function(e,t,n,r,o,i,s){"use strict";function u(e){for(var t,n={},r=Object.getOwnPropertyNames(e),o=0;(t=r[o])!==s;o++)n[t]=Object.getOwnPropertyDescriptor(e,t);return n}function a(){throw new Error("[Qoopido.js] Operation prohibited")}return{create:function(){var e,t=Object.create(this,u(this));return t._constructor&&(e=t._constructor.apply(t,arguments)),t.create=t.extend=a,e||t},extend:function(e,t){var n;return e=e||{},t=t===!0,e._parent=this,n=Object.create(this,u(e)),t===!0&&(n.extend=a),n}}},navigator,this,document),function(e){window.qoopido.register("polyfill/string/ucfirst",e)}(function(e,t,n,r,o,i,s){"use strict";return String.prototype.ucfirst||(String.prototype.ucfirst=function(){var e=this;return e.charAt(0).toUpperCase()+e.slice(1)}),String.prototype.ucfirst}),function(e){window.qoopido.register("polyfill/string/lcfirst",e)}(function(e,t,n,r,o,i,s){"use strict";return String.prototype.lcfirst||(String.prototype.lcfirst=function(){var e=this;return e.charAt(0).toLowerCase()+e.slice(1)}),String.prototype.lcfirst}),function(e){window.qoopido.register("polyfill/window/promise",e)}(function(e,t,n,r,o,i,s){"use strict";function u(e,t){var n=A.push([e,t]);1===n&&a()}function a(){o.setTimeout(l,1)}function l(){for(var e,t=0;(e=A[t])!==s;t++)e[0](e[1]);A.length=0}function c(e,t){var n,r=null;try{if(e===t)throw new TypeError("A promises callback cannot return that same promise.");if(("function"==typeof t||"object"==typeof t&&null!==t)&&(r=t.then,"function"==typeof r))return r.call(t,function(r){return n?!0:(n=!0,void(t!==r?d(e,r):m(e,r)))},function(t){return n?!0:(n=!0,void h(e,t))}),!0}catch(o){return n?!0:(h(e,o),!0)}return!1}function p(e,t){function n(e){d(t,e)}function r(e){h(t,e)}try{e(n,r)}catch(o){r(o)}}function f(e,t,n,r){var o,i,s,u,a="function"==typeof n;if(a)try{o=n(r),s=!0}catch(l){u=!0,i=l}else o=r,s=!0;c(t,o)||(a&&s?d(t,o):u?h(t,i):e===_?d(t,o):e===q&&h(t,o))}function d(e,t){e===t?m(e,t):c(e,t)||m(e,t)}function m(e,t){e._state===x&&(e._state=E,e._detail=t,u(g,e))}function h(e,t){e._state===x&&(e._state=E,e._detail=t,u(v,e))}function g(e){w(e,e._state=_)}function v(e){w(e,e._state=q)}function y(e,t,n,r){var o=e._subscribers,i=o.length;o[i]=t,o[i+_]=n,o[i+q]=r}function w(e,t){for(var n,r,o=e._subscribers,i=e._detail,u=0;(n=o[u])!==s;u+=3)r=o[u+t],f(t,n,r,i);e._subscribers=null}function b(e){var t=this;if("function"!=typeof e)throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");t._subscribers=[],p(e,t)}var x=void 0,E=0,_=1,q=2,A=[];return b.prototype={_state:s,_detail:s,_subscribers:s,then:function(e,t){var n=this,r=new b(function(){});return n._state?u(function(){f(n._state,r,arguments[n._state-1],n._detail)}):y(n,r,e,t),r},"catch":function(e){return this.then(null,e)}},o.Promise||(o.Promise=b),o.Promise}),function(e){var t=[];window.Promise||t.push("../polyfill/window/promise"),window.qoopido.register("promise/all",e,t)}(function(e,t,n,r,o,i,s){"use strict";return function(e){if("[object Array]"!==Object.prototype.toString.call(e))throw new TypeError("You must pass an array to all.");return new o.Promise(function(t,n){function r(e){return function(t){o(e,t)}}function o(e,n){u[e]=n,0===--a&&t(u)}var i,u=[],a=e.length,l=0;for(0===a&&t([]);(i=e[l])!==s;l++)i&&"function"==typeof i.then?i.then(r(l),n):o(l,i)})}}),function(e){var t=[];window.Promise||t.push("../polyfill/window/promise"),window.qoopido.register("promise/defer",e,t)}(function(e,t,n,r,o,i,s){"use strict";return function(){var e=this;e.promise=new o.Promise(function(t,n){e.resolve=t,e.reject=n})}}),function(e){window.qoopido.register("function/merge",e)}(function(e,t,n,r,o,i,s){"use strict";return function u(){var e,t,n,r,o,i=arguments[0];for(e=1;(t=arguments[e])!==s;e++)for(n in t)r=i[n],o=t[n],o!==s&&(null!==o&&"object"==typeof o?(r=o.length!==s?r&&"object"==typeof r&&r.length!==s?r:[]:r&&"object"==typeof r&&r.length===s?r:{},i[n]=u(r,o)):i[n]=o);return i}}),function(e){window.qoopido.register("function/unique/string",e)}(function(e,t,n,r,o,i,s){"use strict";function u(e){var t="",n=0;for(e=parseInt(e,10)||12;e>n;n++)t+=l[parseInt(Math.random()*(l.length-1),10)];return t}var a={},l="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");return function(e){var t;do t=u(e);while("undefined"!=typeof a[t]);return a[t]=!0,t}}),function(e){window.qoopido.register("function/unique/uuid",e)}(function(e,t,n,r,o,i,s){"use strict";function u(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(l,function(e){var t=16*Math.random()|0,n="x"===e?t:3&t|8;return n.toString(16)})}var a={},l=new RegExp("[xy]","g");return function(){var e;do e=u();while("undefined"!=typeof a[e]);return a[e]=!0,e}}),function(e){window.qoopido.register("proxy",e,["./base","./function/unique/uuid"])}(function(e,t,n,r,o,i,s){"use strict";return e.base.extend({_constructor:function(t,n){var r=Array.prototype.splice.call(arguments,2),o=function(){return n.apply(t,Array.prototype.slice.call(arguments).concat(r))};return o._quid=e["function/unique/uuid"](),o}})}),function(e){var t=["./base","./promise/all","./promise/defer"];String.prototype.ucfirst||t.push("./polyfill/string/ucfirst"),String.prototype.lcfirst||t.push("./polyfill/string/lcfirst"),window.qoopido.registerSingleton("support",e,t)}(function(e,t,n,r,o,i,s){"use strict";function u(e){return e.replace(p,"$1").lcfirst().replace(f,"").replace(d,h)}var a=e["promise/all"],l=e["promise/defer"],c=new RegExp("^(Moz|WebKit|Khtml|ms|O|Icab)(?=[A-Z])"),p=new RegExp("^(?:webkit|khtml|icab|moz|ms|o)([A-Z])"),f=new RegExp("^-(?:webkit|khtml|icab|moz|ms|o)-"),d=new RegExp("-([a-z])","gi"),m=new RegExp("([A-Z])","g"),h=function(){return arguments[1].ucfirst()},g={prefix:null,method:{},property:{},css:{},promises:{prefix:null,method:{},property:{},css:{},test:{}}};return e.base.extend({test:{},pool:t.pool&&t.pool.dom,testMultiple:function(){for(var e,t=[],n=0;(e=arguments[n])!==s;n++)switch(typeof e){case"string":t.push(this.test[e]());break;case"boolean":var r=new l;e?r.resolve():r.reject(),t.push(r.promise);break;default:t.push(e)}return new a(t)},getPrefix:function(){var e,t=this,n=g.prefix||null;if(null===n){var r=t.pool?t.pool.obtain("div"):i.createElement("div"),o=r.style;n=!1;for(e in o)c.test(e)&&(n=e.match(c)[0]);n===!1&&"WebkitOpacity"in o&&(n="WebKit"),n===!1&&"KhtmlOpacity"in o&&(n="Khtml"),n=g.prefix=n===!1?!1:[n.toLowerCase(),n.toLowerCase().ucfirst(),n],r.dispose&&r.dispose()}return n},getMethod:function(e,t){e=u(e),t=t||o;var n=t.tagName,r=g.method[n]=g.method[n]||{},i=r[e]=g.method[n][e]||null;if(null===i){i=!1;var a,l,c=0,p=e.ucfirst(),f=this.getPrefix();for(a=f!==!1?(e+" "+p+" "+f.join(p+" ")+p).split(" "):[e];(l=a[c])!==s;c++)if(t[l]!==s&&("function"==typeof t[l]||"object"==typeof t[l])){i=l;break}g.method[n][e]=i}return i},getProperty:function(e,t){e=u(e),t=t||o;var n=t.tagName,r=g.property[n]=g.property[n]||{},i=r[e]=g.property[n][e]||null;if(null===i){i=!1;var a,l,c=0,p=e.ucfirst(),f=this.getPrefix();for(a=f!==!1?(e+" "+p+" "+f.join(p+" ")+p).split(" "):[e],c;(l=a[c])!==s;c++)if(t[l]!==s){i=l;break}g.property[n][e]=i}return i},getCssProperty:function(e){e=u(e);var t=this,n=g.css[e]||null;if(null===n){n=!1;var r,o=0,a=t.pool?t.pool.obtain("div"):i.createElement("div"),l=e.ucfirst(),c=this.getPrefix()||[],p=(e+" "+l+" "+c.join(l+" ")+l).split(" "),f="";for(o;(r=p[o])!==s;o++)if(a.style[r]!==s){n=r,o>0&&(f="-");break}n=g.css[e]=n!==!1?[f+n.replace(m,"-$1").toLowerCase(),n]:!1,a.dispose&&a.dispose()}return n},supportsPrefix:function(){return!!this.getPrefix()},supportsMethod:function(e,t){return!!this.getMethod(e,t)},supportsProperty:function(e,t){return!!this.getProperty(e,t)},supportsCssProperty:function(e){return!!this.getCssProperty(e)},testPrefix:function(){var e=g.promises.prefix;if(null===e){var t=new l,n=this.getPrefix();n?t.resolve(n):t.reject(),e=g.promises.prefix=t.promise}return e},testMethod:function(e,t){t=t||o;var n=t.tagName,r=g.promises.method[n]=g.promises.method[n]||{},i=r[e]=g.promises.method[n][e]||null;if(null===i){var s=new l,u=this.getMethod(e,t);u?s.resolve(u):s.reject(),i=g.promises.method[n][e]=s.promise}return i},testProperty:function(e,t){t=t||o;var n=t.tagName,r=g.promises.property[n]=g.promises.property[n]||{},i=r[e]=g.promises.property[n][e]||null;if(null===i){var s=new l,u=this.getProperty(e,t);u?s.resolve(u):s.reject(),i=g.promises.property[n][e]=s.promise}return i},testCssProperty:function(e){var t=g.promises.css[e]||null;if(null===t){var n=new l,r=this.getCssProperty(e);r?n.resolve(r):n.reject(),t=g.promises.css[e]=n.promise}return t},addTest:function(e,t){return this.test[e]=function(){var n=g.promises.test[e]||null;if(null===n){var r=new l,o=Array.prototype.slice.call(arguments);o.splice(0,0,r),t.apply(null,o),n=g.promises.test[e]=r.promise}return n}}})}),function(e){window.qoopido.register("support/capability/datauri",e,["../../support","../../dom/element"])}(function(e,t,n,r,o,i,s){"use strict";var u=e.support;return u.addTest("/capability/datauri",function(t){var n=e["dom/element"].create(u.pool?u.pool.obtain("img"):i.createElement("img"));n.one("error load",function(e){"load"===e.type&&1===n.element.width&&1===n.element.height?t.resolve():t.reject(),n.element.dispose&&n.element.dispose()},!1).setAttribute("src","data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==")})}),function(e){window.qoopido.register("support/element/canvas",e,["../../support"])}(function(e,t,n,r,o,i,s){"use strict";var u=e.support;return u.addTest("/element/canvas",function(e){var t=u.pool?u.pool.obtain("canvas"):i.createElement("canvas");t.getContext&&t.getContext("2d")?e.resolve():e.reject(),t.dispose&&t.dispose()})}),function(e){window.qoopido.register("support/element/canvas/todataurl",e,["../../../support","../canvas"])}(function(e,t,n,r,o,i,s){"use strict";var u=e.support;return u.addTest("/element/canvas/todataurl",function(t){e["support/element/canvas"]().then(function(){var e=u.pool?u.pool.obtain("canvas"):i.createElement("canvas");e.toDataURL!==s?t.resolve():t.reject(),e.dispose&&e.dispose()},function(){t.reject()})})}),function(e){window.qoopido.register("support/element/canvas/todataurl/png",e,["../../../../support","../todataurl"])}(function(e,t,n,r,o,i,s){"use strict";var u=e.support;return u.addTest("/element/canvas/todataurl/png",function(t){e["support/element/canvas/todataurl"]().then(function(){var e=u.pool?u.pool.obtain("canvas"):i.createElement("canvas");0===e.toDataURL("image/png").indexOf("data:image/png")?t.resolve():t.reject(),e.dispose&&e.dispose()},function(){t.reject()})})}),function(e){window.qoopido.registerSingleton("hook/event",e,["../base"])}(function(e,t,n,r,o,i,s){"use strict";function u(e,t,n){for(var r,o=0;(r=n[o])!==s;o++)e[r]=t[r];e._properties=e._properties.concat(n)}var a={general:{properties:"type altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which path".split(" "),process:function(e,t){var n;if(e.originalEvent=t,e.isDefaultPrevented=t.defaultPrevented?!0:!1,e.isPropagationStopped=t.cancelBubble?!0:!1,e.metaKey=t.metaKey&&t.metaKey!==!1?!0:!1,e.target||(e.target=t.srcElement||i),3===e.target.nodeType&&(e.target=e.target.parentNode),!e.path){e.path=[],n=e.target;do e.path.push(n);while(n=n.parentNode);e.path.push(o)}}},mouse:{regex:new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"),properties:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement dataTransfer".split(" "),process:function(e,t){var n,r,o;r=t.fromElement,o=t.button,null===e.pageX&&null!==t.clientX&&(n=e.target.ownerDocument||i,n=n.documentElement||n.body,e.pageX=t.clientX+(n.scrollLeft||0)-(n.clientLeft||0),e.pageY=t.clientY+(n.scrollTop||0)-(n.clientTop||0)),!e.relatedTarget&&r&&(e.relatedTarget=r===e.target?t.toElement:r),e.which||o===s||(e.which=1&o?1:2&o?3:4&o?2:0)}},key:{regex:new RegExp("^(?:key)"),properties:"char charCode key keyCode".split(" "),process:function(e,t){null===e.which&&(e.which=null!==t.charCode?t.charCode:t.keyCode)}}};return e.base.extend({add:function(e,t){return e&&t&&a[e]&&(a[e]=t),this},get:function(e){return e&&a[e]?a[e]:null},process:function(e,t){var n,r,o;for(n in a)r=a[n],o=!r.regex||r.regex.test(t.type),o&&(r.properties&&u(e,t,r.properties),r.process&&r.process(e,t),r.delegate&&(e.delegate=r.delegate))}})}),function(e){var t=["../base","../support"];window.getComputedStyle||t.push("../polyfill/window/getcomputedstyle"),window.qoopido.registerSingleton("hook/css",e,t)}(function(e,t,n,r,o,i,s){"use strict";var u=e.support,a=o.getComputedStyle||e["polyfill/window/getcomputedstyle"],l={general:{get:function(e,t){return a(e,null).getPropertyValue(t[0])},set:function(e,t,n){e.style[t[1]]=n}},opacity:u.supportsCssProperty("opacity")?null:{regex:new RegExp("alpha\\(opacity=(.*)\\)","i"),get:function(e,t,n){return n=a(e,null).getPropertyValue("filter").toString().match(this.regex),n=n?n[1]/100:1},set:function(e,t,n){var r=e.style;r.zoom=1,r.filter="alpha(opacity="+(100*n+.5>>0)+")"}}};return e.base.extend({add:function(e,t){return e&&t&&l[e]&&(l[e]=t),this},get:function(e){return e&&l[e]?l[e]:null},process:function(e,t,n,r){var o;return n=u.getCssProperty(n,t)||null,n?((o=this.get(n[1]))&&o[e]||this.get("general")[e])(t,n,r):void 0}})}),function(e){window.qoopido.register("dom/event",e,["../base","../hook/event"])}(function(e,t,n,r,o,i,s){"use strict";var u=e["hook/event"];return e.base.extend({originalEvent:null,isDelegate:!1,isDefaultPrevented:!1,isPropagationStopped:!1,isImmediatePropagationStopped:!1,_properties:null,_constructor:function(e){var t=this;return t._properties=[],t._obtain(e),t},_obtain:function(e){u.process(this,e)},_dispose:function(){for(var e,t=this,n=0;(e=t._properties[n])!==s;n++)delete t[e];delete t.delegate,t.originalEvent=null,t.isDelegate=!1,t.isDefaultPrevented=!1,t.isPropagationStopped=!1,t.isImmediatePropagationStopped=!1,t._properties.length=0},preventDefault:function(){var e=this,t=e.originalEvent;t.cancelable!==!1&&(e.isDefaultPrevented=!0,t.preventDefault?t.preventDefault():t.returnValue=!1)},stopPropagation:function(){var e=this,t=e.originalEvent;e.isPropagationStopped=!0,t.stopPropagation&&t.stopPropagation(),t.cancelBubble=!0},stopImmediatePropagation:function(){var e=this,t=e.originalEvent;e.isImmediatePropagationStopped=!0,t.stopImmediatePropagation&&t.stopImmediatePropagation(),e.stopPropagation()}})}),function(e){var t=["../base","../function/unique/uuid","../hook/css","./event"];window.CustomEvent||t.push("../polyfill/window/customevent"),window.addEventListener||t.push("../polyfill/window/addeventlistener"),window.removeEventListener||t.push("../polyfill/window/removeeventlistener"),window.dispatchEvent||t.push("../polyfill/window/dispatchevent"),Element.prototype.matches||t.push("../polyfill/element/matches"),document.querySelector||t.push("../polyfill/document/queryselector"),document.querySelectorAll||t.push("../polyfill/document/queryselectorall"),String.prototype.trim||t.push("../polyfill/string/trim"),window.qoopido.register("dom/element",e,t)}(function(e,t,n,r,o,i,s){"use strict";function u(e){var t,n,r;for(t in A)n=A[t],(!n.regex||n.regex.test(e))&&(r=n);return r}function a(e,t,n){var r=this,o=u(e),s=i.createEvent(o.type);s[o.method](e,"load"===e?!1:!0,!0,t),n&&(s._quid=n,s.isDelegate=!0),r.element.dispatchEvent(s)}function l(e){var t;if("string"==typeof e)try{w.test(e)===!0?(t=e.replace(w,"$1").toLowerCase(),e=i.createElement(t)):e=i.querySelector(e)}catch(n){e=null}if(!e)throw new Error("[Qoopido.js] Element could not be resolved");return e}function c(e){return Array.prototype.concat.apply([],Array.prototype.splice.call(e,0)).join(" ").split(x)}function p(e,t){for(var n,r=0;(n=e.path[r])!==s;r++){if(n.matches(t))return e.currentTarget=n,!0;if(n===e.currentTarget)break}return!1}var f="object",d="string",m=e["function/unique/uuid"],h=i.getElementsByTagName("head")[0],g="textContent"in i.createElement("a")?"textContent":"innerText",v="undefined"!=typeof h.previousElementSibling?function(){return this.previousElementSibling}:function(){for(var e=this;e=e.previousSibling;)if(1===e.nodeType)return e},y="undefined"!=typeof h.nextElementSibling?function(){return this.nextElementSibling}:function(){for(var e=this;e=e.nextSibling;)if(1===e.nodeType)return e},w=new RegExp("^<(\\w+)\\s*/>$"),b=new RegExp("^[^-]+"),x=new RegExp(" +","g"),E=e["pool/module"]&&e["pool/module"].create(e["dom/event"],null,!0)||null,_=e["hook/css"],q={},A={custom:{type:"CustomEvent",method:"initCustomEvent"},html:{regex:new RegExp("^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$"),type:"HTMLEvents",method:"initEvent"},mouse:{regex:new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"),type:"MouseEvents",method:"initMouseEvent"}};return e.base.extend({type:null,element:null,_listener:null,_constructor:function(e,t,n){var r,o=this;return e=l(e),r=e._quid,r?o=q[r]:(r=e._quid=m(),o.type=e.tagName,o.element=e,o._listener={},q[r]=o),"object"==typeof t&&null!==t&&o.setAttributes(t),"object"==typeof n&&null!==n&&o.setStyles(n),o!==this&&this.dispose&&this.dispose(),o},_obtain:function(e,t,n){this._constructor(e,t,n)},_dispose:function(){var e,t,n=this;for(e in n._listener)t=e.match(b),n.element.removeEventListener(t,n._listener[e]),delete n._listener[e];n.type=null,n.element=null},getContent:function(e){var t=this.element;return e&&e!==!1?t.innerHTML:t[g]},setContent:function(e,t){var n=this,r=n.element;return t&&t!==!1?r.innerHTML=e:r[g]=e,n},getAttribute:function(e){var t=this;return e&&typeof e===d?t.element.getAttribute(e):void 0},getAttributes:function(){for(var e,t=this,n={},r=c(arguments),o=0;(e=r[o])!==s;o++)n[e]=t.element.getAttribute(e);return n},setAttribute:function(e,t){var n=this;return e&&typeof e===d&&n.element.setAttribute(e,t),n},setAttributes:function(e){var t,n=this;if(e&&typeof e===f&&!e.length)for(t in e)n.element.setAttribute(t,e[t]);return n},removeAttribute:function(e){var t=this;return e&&typeof e===d&&t.element.removeAttribute(e),t},removeAttributes:function(){for(var e,t=this,n=c(arguments),r=0;(e=n[r])!==s;r++)t.element.removeAttribute(e);return t},getStyle:function(e){var t=this;return e&&typeof e===d?_.process("get",t.element,e):void 0},getStyles:function(){for(var e,t=this,n={},r=c(arguments),o=0;(e=r[o])!==s;o++)n[e]=_.process("get",t.element,e);return n},setStyle:function(e,t){var n=this;return e&&typeof e===d&&_.process("set",n.element,e,t),n},setStyles:function(e){var t,n=this;if(e&&typeof e===f&&!e.length)for(t in e)_.process("set",n.element,t,e[t]);return n},removeStyle:function(e){var t=this;return e&&typeof e===d&&t.setStyle(e,""),t},removeStyles:function(){for(var e,t=this,n=c(arguments),r=0;(e=n[r])!==s;r++)t.setStyle(e,"");return t},siblings:function(e){for(var t=this.element,n=t.parentNode.firstChild,r=[];n;n=y.call(n))n===t||e&&!n.matches(e)||r.push(n);return r},siblingsBefore:function(e){for(var t=this.element.previousSibling,n=[];t;t=v.call(t))(!e||t.matches(e))&&n.push(t);return n},siblingsAfter:function(e){for(var t=this.element.nextSibling,n=[];t;t=y.call(t))(!e||t.matches(e))&&n.push(t);return n},previous:function(e){var t=v.call(this.element);if(!e)return t;for(;t;t=v.call(t))if(t.matches(e))return t},next:function(e){var t=y.call(this.element);if(!e)return t;for(;t;t=y.call(t))if(t.matches(e))return t},find:function(e){var t,n,r=this.element;return e=e.trim(),">"===e.charAt(0)?(t=r._quid,r.setAttribute("data-quid",t),e='[data-quid="'+t+'"] '+e,n=r.parentNode.querySelectorAll(e),r.removeAttribute("data-quid")):n=r.querySelectorAll(e),n},parent:function(e){var t;if(!e)return this.element.parentNode;for(t=this.element;t;t=t.parentNode)if(t.matches(e))return t},parents:function(e){for(var t=this.element.parentNode,n=[];t;t=t.parentNode){if(9===t.nodeType)return n;1===t.nodeType&&(!e||t.matches(e))&&n.push(t)}},isVisible:function(){var e=this,t=e.element;return!(t.offsetWidth<=0&&t.offsetHeight<=0||"hidden"===e.getStyle("visibility")||e.getStyle("opacity")<=0)},hasClass:function(e){return e?new RegExp("(?:^|\\s)"+e+"(?:\\s|$)").test(this.element.className):!1},addClass:function(e){var t=this;return e&&!t.hasClass(e)&&(t.element.className+=t.element.className?" "+e:e),t},removeClass:function(e){var t=this;return e&&t.hasClass(e)&&(t.element.className=t.element.className.replace(new RegExp("(?:^|\\s)"+e+"(?!\\S)"),"")),t},toggleClass:function(e){var t=this;return e&&(t.hasClass(e)?t.removeClass(e):t.addClass(e)),t},prepend:function(e){var t=this,n=t.element;if(e)try{e=e.element||l(e),n.firstChild?n.insertBefore(e,n.firstChild):t.append(e)}catch(r){n.insertAdjacentHTML("afterBegin",e)}return t},append:function(e){var t=this,n=t.element;if(e)try{n.appendChild(e.element||l(e))}catch(r){n.insertAdjacentHTML("beforeEnd",e)}return t},prependTo:function(e){var t=this,n=t.element;return e&&((e=e.element||l(e)).firstChild?e.insertBefore(n,e.firstChild):t.appendTo(e)),t},appendTo:function(e){var t=this;return e&&(e.element||l(e)).appendChild(t.element),t},insertBefore:function(e){var t=this,n=t.element;return e&&(e=e.element||l(e)).parentNode.insertBefore(n,e),t},insertAfter:function(e){var t=this,n=t.element;return e&&((e=e.element||l(e)).nextSibling?e.parentNode.insertBefore(n,e.nextSibling):t.appendTo(e.parentNode)),t},replace:function(e){var t=this,n=t.element;return e&&(e=e.element||l(e)).parentNode.replaceChild(n,e),t},replaceWith:function(e){var t=this,n=t.element;return e&&(e=e.element||l(e),n.parentNode.replaceChild(e,n)),t},remove:function(){var e=this,t=e.element;return t.parentNode.removeChild(t),e},on:function(t){var n,r=this,o=r.element,i=arguments.length>2?arguments[1]:null,u=arguments.length>2?arguments[2]:arguments[1],l=u._quid||(u._quid=m()),c=0;for(t=t.split(" ");(n=t[c])!==s;c++){var f=n+"-"+l,d=function(t){var n;t=E&&E.obtain(t)||e["dom/event"].create(t),t.isPropagationStopped||(n=t.delegate,t._quid=m(),(!i||p(t,i))&&u.call(t.currentTarget,t,t.originalEvent.detail),n&&(delete t.delegate,a.call(r,n))),t.dispose&&t.dispose()};d.type=n,r._listener[f]=d,o.addEventListener(n,d)}return r},one:function(e){var t=this,n=arguments.length>3||"string"==typeof arguments[1]?arguments[1]:null,r=arguments.length>3||"function"==typeof arguments[2]?arguments[2]:arguments[1],o=(arguments.length>3?arguments[3]:arguments[2])!==!1,i=function(n){t.off(o===!0?n.type:e,i),r.call(this,n,n.originalEvent.detail)};return r._quid=i._quid=m(),n?t.on(e,n,i):t.on(e,i),t},off:function(e,t){var n,r,o,i=this,u=i.element,a=0;for(e=e.split(" ");(n=e[a])!==s;a++)r=t._quid&&n+"-"+t._quid||null,o=r&&i._listener[r]||null,o?(u.removeEventListener(n,o),delete i._listener[r]):u.removeEventListener(n,t);return i},emit:function(e,t){var n=this;return a.call(n,e,t),n}})}),function(e){window.qoopido.registerSingleton("url",e,["./base"])}(function(e,t,n,r,o,i,s){"use strict";function u(e){var t=i.createElement("a");return t.href=e||"",t}var a,l,c=new RegExp("[?&]?([^=]+)=([^&]*)","g");try{a=location}catch(p){a=u()}return l=new RegExp("".concat("^",a.protocol,"//",a.hostname),"i"),e.base.extend({resolve:function(e){return u(e).href},redirect:function(e,t){t=t||o,t.location.href=this.resolve(e)},getParameter:function(e){for(var t,n={},r=u(e).search.split("+").join(" ");t=c.exec(r);)n[decodeURIComponent(t[1])]=decodeURIComponent(t[2]);return n},isLocal:function(e){return l.test(this.resolve(e))}})}),function(e){window.qoopido.register("transport",e,["./base","./function/merge"])}(function(e,t,n,r,o,i,s){"use strict";var u;return u=e.base.extend({setup:function(t){var n=this;return n._settings=e["function/merge"]({},n._settings,t),n},serialize:function(e,t){var n,r,o,i=[];for(n in e)r=t?"".concat(t,"[",n,"]"):n,o=e[n],i.push("object"==typeof o?this.serialize(o,r):"".concat(encodeURIComponent(r),"=",encodeURIComponent(o)));return i.join("&")}})},window,document),function(e){window.qoopido.registerSingleton("transport/xhr",e,["../transport","../function/merge","../function/unique/string","../url","../promise/defer"])}(function(e,t,n,r,o,i,s){"use strict";function u(e,t,n){var r,o=this,i=o.xhr,s=o.settings;t=s.cache===!1?"".concat(t,t.indexOf("?")>-1?"&":"?","_="+(new Date).getTime()):t,t=n&&"GET"===e?"".concat(t,t.indexOf("?")>-1?"&":"?",n):t;for(r in s.xhrOptions)i[r]=s.xhrOptions[r];if(i.open(e,t,s.async,s.username,s.password),i.setRequestHeader){i.setRequestHeader("Accept",s.accept),n&&"GET"!==e&&i.setRequestHeader("Content-Type",s.contentType);for(r in s.header)i.setRequestHeader(r,s.header[r])}i.timeout=s.timeout,i.onprogress=function(e){a.call(o,e)},i.onreadystatechange=i.onload=function(){l.call(o)},i.onerror=function(){c.call(o)},i.send(n||null),o.timeout=setTimeout(function(){p.call(o)},s.timeout)}function a(e){var t=this;t.timeout&&clearTimeout(t.timeout),t.timeout=setTimeout(function(){p.call(t)},t.settings.timeout)}function l(){var e=this,t=e.xhr,n=e.dfd;(t.readyState===s||4===t.readyState)&&(f.call(e),t.status===s||200===t.status?n.resolve({data:t.responseText,xhr:t}):n.reject({status:t.status,xhr:t}))}function c(){var e=this;f.call(e),e.dfd.reject()}function p(){var e=this;e.xhr.abort(),f.call(e),e.dfd.reject()}function f(){var e=this,t=e.xhr;e.timeout&&clearTimeout(e.timeout),t.onprogress=t.onreadystatechange=t.onerror=null}var d,m=e["promise/defer"],h="undefined"!=typeof o.XMLHttpRequest?function(t){return e.url.isLocal(t)?new o.XMLHttpRequest:o.XDomainRequest?new o.XDomainRequest:new o.XMLHttpRequest}:function(){try{return new ActiveXObject("MSXML2.XMLHTTP.3.0")}catch(e){return null}};return d=e.transport.extend({_settings:{accept:"*/*",timeout:5e3,async:!0,cache:!1,header:{},username:null,password:null,contentType:"application/x-www-form-urlencoded; charset=UTF-8 ",xhrOptions:{}},load:function(t,n,r,o){var i={};return n=e.url.resolve(n),i.url=n,i.id="".concat("xhr-",e["function/unique/string"]()),i.dfd=new m,i.xhr=h(n),i.settings=e["function/merge"]({},this._settings,o),i.timeout=null,u.call(i,t.toUpperCase(),n,r),i.dfd.promise},get:function(e,t,n){return this.load("GET",e,t,n)},post:function(e,t,n){return this.load("POST",e,t,n)},put:function(e,t,n){return this.load("PUT",e,t,n)},"delete":function(e,t,n){return this.load("DELETE",e,t,n)},head:function(e,t,n){return this.load("HEAD",e,t,n)}})},window,document),function(e){var t=["../element","../../proxy","../../function/merge","../../url","../../support","../../support/capability/datauri","../../support/element/canvas/todataurl/png","../../transport/xhr"];window.qoopido.register("dom/element/shrinkimage",e,t)}(function(e,t,n,r,o,i,s){"use strict";function u(t,n){t=e.url.resolve(b.exec(t)[1]),n=n===!0;var r=this,o=e["function/merge"]({},r._settings,e.url.getParameter(t)),i=o.target||(t=t.split("?")[0]).replace(x,"".concat(".q",o.quality,".shrunk"));n||r.removeAttribute(r._settings.attribute).hide(),E.then(function(){if(o.debug===!0)throw new Error("[Qoopido.js] Debug enabled");switch(typeof y[i]){case"object":y[i].one(A,function(e){a.call(r,e.data,n)}),r.emit(_);break;case"string":a.call(r,y[i],n);break;default:y[i]=d.create(i,n?null:r.element).one(P,function(e,o){e.type===A?(y[i]=o,r.emit(q),a.call(r,o,n)):(y[i]=t,a.call(r,t,n))},!1)}})["catch"](function(){y[i]=t,a.call(r,t,n)})}function a(e,t){var n=this;t?(n.setStyle("backgroundImage","url("+e+")"),n.emit(A)):n.one(C,function(){n.show(),n.emit(A)}).setAttribute("src",e)}function l(e){var t=this;e.get(t._url).then(function(e){try{var n=m.parse(e.data);n.width=parseInt(n.width,10),n.height=parseInt(n.height,10),c.call(t,n)}catch(r){t.emit(S)}},function(){t.emit(S)})}function c(e){var t,n,r=this,o=function(o){return t=v&&v.obtain("canvas")||i.createElement("canvas"),t.style.display="none",t.width=e.width,t.height=e.height,n=t.getContext("2d"),n.clearRect(0,0,e.width,e.height),n.drawImage(r.element,0,0,e.width,e.height),r.one(C,s).setAttribute("src",e.alpha),p(o)},s=function(o){var i;return n.globalCompositeOperation="xor",n.drawImage(r.element,0,0,e.width,e.height),i=t.toDataURL("image/png"),u(),r.emit(A,i),p(o)},u=function(){t&&t.dispose&&t.dispose(),r.element.dispose&&r.element.dispose()};r.one(j,function(e){e.type===C?o.call(this,e):(u(),r.emit(S))},!1).setAttribute("src",e.main)}function p(e){return e.preventDefault(),e.stopPropagation(),!1}var f,d,m=o.JSON,h=n.pop(),g={attribute:"data-"+h,quality:80,debug:!1},v=t.pool&&t.pool.dom||null,y={},w=new RegExp('^url\\x28"{0,1}data:image/shrink,(.+?)"{0,1}\\x29$',"i"),b=new RegExp('^(?:url\\x28"{0,1}|)(?:data:image/shrink,|)(.+?)(?:"{0,1}\\x29|)$',"i"),x=new RegExp("\\.png$","i"),E=e.support.testMultiple("/capability/datauri","/element/canvas/todataurl/png"),_="queued",q="cached",A="loaded",S="failed",P="".concat(A," ",S),C="load",T="error",j="".concat(C," ",T);return f=e["dom/element"].extend({_constructor:function(t,n){var r,o,i=f._parent._constructor.call(this,t);return i._settings=n=e["function/merge"]({},g,n),r=i.getAttribute(n.attribute),o=i.getStyle("backgroundImage"),"IMG"===i.type&&u.call(i,r),"none"!==o&&w.test(o)&&u.call(i,o,!0),i},hide:function(){this.setStyles({visibility:"hidden",opacity:0})},show:function(){this.setStyles({visibility:"",opacity:""})}}),d=e["dom/element"].extend({_url:null,_constructor:function(t,n){var r;return n||(n=v&&v.obtain("img")||i.createElement("img")),r=d._parent._constructor.call(this,n),r._url=t,l.call(r,e["transport/xhr"]),r}}),f},window); \ No newline at end of file diff --git a/dist/latest/min/packages/qoopido.shrinkimage.legacy.js b/dist/latest/min/packages/qoopido.shrinkimage.legacy.js new file mode 100644 index 00000000..59628e93 --- /dev/null +++ b/dist/latest/min/packages/qoopido.shrinkimage.legacy.js @@ -0,0 +1,3 @@ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +!function(e,t){t.register?t.register("polyfill/object/defineproperty",e):(t.modules=t.modules||{})["polyfill/object/defineproperty"]=e()}(function(e,t,n,r,o,i,s){"use strict";if(!Object.defineProperty||!function(){try{return Object.defineProperty({},"x",{}),!0}catch(e){return!1}}()){var u=Object.defineProperty,a=Object.prototype.__defineGetter__,c=Object.prototype.__defineSetter__;Object.defineProperty=function(e,t,n){if(u)try{return u(e,t,n)}catch(r){}if(e!==Object(e))throw new TypeError("Object.defineProperty called on non-object");return a&&"get"in n&&a.call(e,t,n.get),c&&"set"in n&&c.call(e,t,n.set),"value"in n&&(e[t]=n.value),e}}return Object.defineProperty},window.qoopido=window.qoopido||{}),function(e,t){if(t.register){var n=[];Object.defineProperty&&function(){try{return Object.defineProperty({},"x",{}),!0}catch(e){return!1}}()||n.push("./defineproperty"),t.register("polyfill/object/defineproperties",e,n)}else(t.modules=t.modules||{})["polyfill/object/defineproperties"]=e()}(function(e,t,n,r,o,i,s){"use strict";return Object.defineProperties||(Object.defineProperties=function(e,t){if(e!==Object(e))throw new TypeError("Object.defineProperties called on non-object");var n;for(n in t)Object.prototype.hasOwnProperty.call(t,n)&&Object.defineProperty(e,n,t[n]);return e}),Object.defineProperties},window.qoopido=window.qoopido||{}),function(e,t){if(t.register){var n=[];Object.defineProperties||n.push("./defineproperties"),t.register("polyfill/object/create",e,n)}else(t.modules=t.modules||{})["polyfill/object/create"]=e()}(function(e,t,n,r,o,i,s){"use strict";return Object.create||(Object.create=function(e,t){function n(){}if("object"!=typeof e)throw new TypeError;n.prototype=e;var r=new n;if(e&&(r.constructor=n),arguments.length>1){if(t!==Object(t))throw new TypeError;Object.defineProperties(r,t)}return r}),Object.create},window.qoopido=window.qoopido||{}),function(e,t){t.register?t.register("polyfill/object/getownpropertynames",e):(t.modules=t.modules||{})["polyfill/object/getownpropertynames"]=e()}(function(e,t,n,r,o,i,s){"use strict";return Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(e){if(e!==Object(e))throw new TypeError("Object.getOwnPropertyNames called on non-object");var t,n=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.push(t);return n}),Object.getOwnPropertyNames},window.qoopido=window.qoopido||{}),function(e,t){t.register?t.register("polyfill/object/getownpropertydescriptor",e):(t.modules=t.modules||{})["polyfill/object/getownpropertydescriptor"]=e()}(function(e,t,n,r,o,i,s){"use strict";if(!Object.getOwnPropertyDescriptor||!function(){try{return Object.getOwnPropertyDescriptor({x:0},"x"),!0}catch(e){return!1}}()){var u=Object.getOwnPropertyDescriptor;Object.getOwnPropertyDescriptor=function(e,t){if(e!==Object(e))throw new TypeError;try{return u.call(Object,e,t)}catch(n){}return Object.prototype.hasOwnProperty.call(e,t)?{value:e[t],enumerable:!0,writable:!0,configurable:!0}:void 0}}return Object.getOwnPropertyDescriptor},window.qoopido=window.qoopido||{}),function(e,t,n,r,o){"use strict";function i(e,i,s,a){var p,d=e.split("/");return l[e]?l[e]:(p=function(){if(s)for(var p,m,g=d.slice(0,-1).join("/"),h=0;(p=s[h])!==o;h++)m=f.test(p),m&&(p=u(g+"/"+p)),!l[p]&&arguments[h]&&(l[p]=arguments[h]),m&&!l[p]&&"undefined"!=typeof console&&console.error("".concat("[Qoopido.js] ",e,": Could not load dependency ",p));return l[e]=i(l,c,d,t,n,r,o),a&&a(l[e]),l[e]},void("undefined"!=typeof module&&module.exports?module.exports=define(p):"function"==typeof define&&define.amd?s?define(s,p):define(p):p()))}function s(e,t,n){i(e,t,n,function(t){l[e]=t.create()})}function u(e){for(var t;(t=e.replace(d,""))!==e;)e=t;return e.replace(m,"")}var a=n.qoopido||(n.qoopido={}),c=a.shared||(a.shared={}),l=a.modules||(a.modules={}),p=[],f=new RegExp("^\\.+\\/"),d=new RegExp("(?:\\/|)[^\\/]*\\/\\.\\."),m=new RegExp("(^\\/)|\\.\\/","g");a.register=i,a.registerSingleton=s,Object.create||p.push("./polyfill/object/create"),Object.getOwnPropertyNames||p.push("./polyfill/object/getownpropertynames"),Object.getOwnPropertyDescriptor&&function(){try{return Object.getOwnPropertyDescriptor({x:0},"x"),!0}catch(e){return!1}}()||p.push("./polyfill/object/getownpropertydescriptor"),i("base",e,p)}(function(e,t,n,r,o,i,s){"use strict";function u(e){for(var t,n={},r=Object.getOwnPropertyNames(e),o=0;(t=r[o])!==s;o++)n[t]=Object.getOwnPropertyDescriptor(e,t);return n}function a(){throw new Error("[Qoopido.js] Operation prohibited")}return{create:function(){var e,t=Object.create(this,u(this));return t._constructor&&(e=t._constructor.apply(t,arguments)),t.create=t.extend=a,e||t},extend:function(e,t){var n;return e=e||{},t=t===!0,e._parent=this,n=Object.create(this,u(e)),t===!0&&(n.extend=a),n}}},navigator,this,document),function(e){window.qoopido.register("polyfill/string/ucfirst",e)}(function(e,t,n,r,o,i,s){"use strict";return String.prototype.ucfirst||(String.prototype.ucfirst=function(){var e=this;return e.charAt(0).toUpperCase()+e.slice(1)}),String.prototype.ucfirst}),function(e){window.qoopido.register("polyfill/string/lcfirst",e)}(function(e,t,n,r,o,i,s){"use strict";return String.prototype.lcfirst||(String.prototype.lcfirst=function(){var e=this;return e.charAt(0).toLowerCase()+e.slice(1)}),String.prototype.lcfirst}),function(e){window.qoopido.register("polyfill/window/getcomputedstyle",e)}(function(e,t,n,r,o,i,s){"use strict";if(o.getComputedStyle)return o.getComputedStyle;var u=new RegExp("(\\-([a-z]){1})","g"),a=function(){return arguments[2].toUpperCase()};return function(e,t){var n=this;return n.getPropertyValue=function(t){return"float"===t&&(t="styleFloat"),u.test(t)&&(t=t.replace(u,a)),e.currentStyle[t]||null},n}}),function(e){window.qoopido.register("polyfill/window/promise",e)}(function(e,t,n,r,o,i,s){"use strict";function u(e,t){var n=_.push([e,t]);1===n&&a()}function a(){o.setTimeout(c,1)}function c(){for(var e,t=0;(e=_[t])!==s;t++)e[0](e[1]);_.length=0}function l(e,t){var n,r=null;try{if(e===t)throw new TypeError("A promises callback cannot return that same promise.");if(("function"==typeof t||"object"==typeof t&&null!==t)&&(r=t.then,"function"==typeof r))return r.call(t,function(r){return n?!0:(n=!0,void(t!==r?d(e,r):m(e,r)))},function(t){return n?!0:(n=!0,void g(e,t))}),!0}catch(o){return n?!0:(g(e,o),!0)}return!1}function p(e,t){function n(e){d(t,e)}function r(e){g(t,e)}try{e(n,r)}catch(o){r(o)}}function f(e,t,n,r){var o,i,s,u,a="function"==typeof n;if(a)try{o=n(r),s=!0}catch(c){u=!0,i=c}else o=r,s=!0;l(t,o)||(a&&s?d(t,o):u?g(t,i):e===E?d(t,o):e===P&&g(t,o))}function d(e,t){e===t?m(e,t):l(e,t)||m(e,t)}function m(e,t){e._state===x&&(e._state=j,e._detail=t,u(h,e))}function g(e,t){e._state===x&&(e._state=j,e._detail=t,u(y,e))}function h(e){w(e,e._state=E)}function y(e){w(e,e._state=P)}function v(e,t,n,r){var o=e._subscribers,i=o.length;o[i]=t,o[i+E]=n,o[i+P]=r}function w(e,t){for(var n,r,o=e._subscribers,i=e._detail,u=0;(n=o[u])!==s;u+=3)r=o[u+t],f(t,n,r,i);e._subscribers=null}function b(e){var t=this;if("function"!=typeof e)throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");t._subscribers=[],p(e,t)}var x=void 0,j=0,E=1,P=2,_=[];return b.prototype={_state:s,_detail:s,_subscribers:s,then:function(e,t){var n=this,r=new b(function(){});return n._state?u(function(){f(n._state,r,arguments[n._state-1],n._detail)}):v(n,r,e,t),r},"catch":function(e){return this.then(null,e)}},o.Promise||(o.Promise=b),o.Promise}),function(e){var t=[];window.Promise||t.push("../polyfill/window/promise"),window.qoopido.register("promise/all",e,t)}(function(e,t,n,r,o,i,s){"use strict";return function(e){if("[object Array]"!==Object.prototype.toString.call(e))throw new TypeError("You must pass an array to all.");return new o.Promise(function(t,n){function r(e){return function(t){o(e,t)}}function o(e,n){u[e]=n,0===--a&&t(u)}var i,u=[],a=e.length,c=0;for(0===a&&t([]);(i=e[c])!==s;c++)i&&"function"==typeof i.then?i.then(r(c),n):o(c,i)})}}),function(e){var t=[];window.Promise||t.push("../polyfill/window/promise"),window.qoopido.register("promise/defer",e,t)}(function(e,t,n,r,o,i,s){"use strict";return function(){var e=this;e.promise=new o.Promise(function(t,n){e.resolve=t,e.reject=n})}}),function(e){window.qoopido.register("function/merge",e)}(function(e,t,n,r,o,i,s){"use strict";return function u(){var e,t,n,r,o,i=arguments[0];for(e=1;(t=arguments[e])!==s;e++)for(n in t)r=i[n],o=t[n],o!==s&&(null!==o&&"object"==typeof o?(r=o.length!==s?r&&"object"==typeof r&&r.length!==s?r:[]:r&&"object"==typeof r&&r.length===s?r:{},i[n]=u(r,o)):i[n]=o);return i}}),function(e){window.qoopido.register("function/unique/string",e)}(function(e,t,n,r,o,i,s){"use strict";function u(e){var t="",n=0;for(e=parseInt(e,10)||12;e>n;n++)t+=c[parseInt(Math.random()*(c.length-1),10)];return t}var a={},c="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");return function(e){var t;do t=u(e);while("undefined"!=typeof a[t]);return a[t]=!0,t}}),function(e){window.qoopido.register("function/unique/uuid",e)}(function(e,t,n,r,o,i,s){"use strict";function u(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(c,function(e){var t=16*Math.random()|0,n="x"===e?t:3&t|8;return n.toString(16)})}var a={},c=new RegExp("[xy]","g");return function(){var e;do e=u();while("undefined"!=typeof a[e]);return a[e]=!0,e}}),function(e){window.qoopido.register("proxy",e,["./base","./function/unique/uuid"])}(function(e,t,n,r,o,i,s){"use strict";return e.base.extend({_constructor:function(t,n){var r=Array.prototype.splice.call(arguments,2),o=function(){return n.apply(t,Array.prototype.slice.call(arguments).concat(r))};return o._quid=e["function/unique/uuid"](),o}})}),function(e){var t=["./base","./promise/all","./promise/defer"];String.prototype.ucfirst||t.push("./polyfill/string/ucfirst"),String.prototype.lcfirst||t.push("./polyfill/string/lcfirst"),window.qoopido.registerSingleton("support",e,t)}(function(e,t,n,r,o,i,s){"use strict";function u(e){return e.replace(p,"$1").lcfirst().replace(f,"").replace(d,g)}var a=e["promise/all"],c=e["promise/defer"],l=new RegExp("^(Moz|WebKit|Khtml|ms|O|Icab)(?=[A-Z])"),p=new RegExp("^(?:webkit|khtml|icab|moz|ms|o)([A-Z])"),f=new RegExp("^-(?:webkit|khtml|icab|moz|ms|o)-"),d=new RegExp("-([a-z])","gi"),m=new RegExp("([A-Z])","g"),g=function(){return arguments[1].ucfirst()},h={prefix:null,method:{},property:{},css:{},promises:{prefix:null,method:{},property:{},css:{},test:{}}};return e.base.extend({test:{},pool:t.pool&&t.pool.dom,testMultiple:function(){for(var e,t=[],n=0;(e=arguments[n])!==s;n++)switch(typeof e){case"string":t.push(this.test[e]());break;case"boolean":var r=new c;e?r.resolve():r.reject(),t.push(r.promise);break;default:t.push(e)}return new a(t)},getPrefix:function(){var e,t=this,n=h.prefix||null;if(null===n){var r=t.pool?t.pool.obtain("div"):i.createElement("div"),o=r.style;n=!1;for(e in o)l.test(e)&&(n=e.match(l)[0]);n===!1&&"WebkitOpacity"in o&&(n="WebKit"),n===!1&&"KhtmlOpacity"in o&&(n="Khtml"),n=h.prefix=n===!1?!1:[n.toLowerCase(),n.toLowerCase().ucfirst(),n],r.dispose&&r.dispose()}return n},getMethod:function(e,t){e=u(e),t=t||o;var n=t.tagName,r=h.method[n]=h.method[n]||{},i=r[e]=h.method[n][e]||null;if(null===i){i=!1;var a,c,l=0,p=e.ucfirst(),f=this.getPrefix();for(a=f!==!1?(e+" "+p+" "+f.join(p+" ")+p).split(" "):[e];(c=a[l])!==s;l++)if(t[c]!==s&&("function"==typeof t[c]||"object"==typeof t[c])){i=c;break}h.method[n][e]=i}return i},getProperty:function(e,t){e=u(e),t=t||o;var n=t.tagName,r=h.property[n]=h.property[n]||{},i=r[e]=h.property[n][e]||null;if(null===i){i=!1;var a,c,l=0,p=e.ucfirst(),f=this.getPrefix();for(a=f!==!1?(e+" "+p+" "+f.join(p+" ")+p).split(" "):[e],l;(c=a[l])!==s;l++)if(t[c]!==s){i=c;break}h.property[n][e]=i}return i},getCssProperty:function(e){e=u(e);var t=this,n=h.css[e]||null;if(null===n){n=!1;var r,o=0,a=t.pool?t.pool.obtain("div"):i.createElement("div"),c=e.ucfirst(),l=this.getPrefix()||[],p=(e+" "+c+" "+l.join(c+" ")+c).split(" "),f="";for(o;(r=p[o])!==s;o++)if(a.style[r]!==s){n=r,o>0&&(f="-");break}n=h.css[e]=n!==!1?[f+n.replace(m,"-$1").toLowerCase(),n]:!1,a.dispose&&a.dispose()}return n},supportsPrefix:function(){return!!this.getPrefix()},supportsMethod:function(e,t){return!!this.getMethod(e,t)},supportsProperty:function(e,t){return!!this.getProperty(e,t)},supportsCssProperty:function(e){return!!this.getCssProperty(e)},testPrefix:function(){var e=h.promises.prefix;if(null===e){var t=new c,n=this.getPrefix();n?t.resolve(n):t.reject(),e=h.promises.prefix=t.promise}return e},testMethod:function(e,t){t=t||o;var n=t.tagName,r=h.promises.method[n]=h.promises.method[n]||{},i=r[e]=h.promises.method[n][e]||null;if(null===i){var s=new c,u=this.getMethod(e,t);u?s.resolve(u):s.reject(),i=h.promises.method[n][e]=s.promise}return i},testProperty:function(e,t){t=t||o;var n=t.tagName,r=h.promises.property[n]=h.promises.property[n]||{},i=r[e]=h.promises.property[n][e]||null;if(null===i){var s=new c,u=this.getProperty(e,t);u?s.resolve(u):s.reject(),i=h.promises.property[n][e]=s.promise}return i},testCssProperty:function(e){var t=h.promises.css[e]||null;if(null===t){var n=new c,r=this.getCssProperty(e);r?n.resolve(r):n.reject(),t=h.promises.css[e]=n.promise}return t},addTest:function(e,t){return this.test[e]=function(){var n=h.promises.test[e]||null;if(null===n){var r=new c,o=Array.prototype.slice.call(arguments);o.splice(0,0,r),t.apply(null,o),n=h.promises.test[e]=r.promise}return n}}})}),function(e){window.qoopido.register("support/capability/datauri",e,["../../support","../../dom/element"])}(function(e,t,n,r,o,i,s){"use strict";var u=e.support;return u.addTest("/capability/datauri",function(t){var n=e["dom/element"].create(u.pool?u.pool.obtain("img"):i.createElement("img"));n.one("error load",function(e){"load"===e.type&&1===n.element.width&&1===n.element.height?t.resolve():t.reject(),n.element.dispose&&n.element.dispose()},!1).setAttribute("src","data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==")})}),function(e){window.qoopido.register("support/element/canvas",e,["../../support"])}(function(e,t,n,r,o,i,s){"use strict";var u=e.support;return u.addTest("/element/canvas",function(e){var t=u.pool?u.pool.obtain("canvas"):i.createElement("canvas");t.getContext&&t.getContext("2d")?e.resolve():e.reject(),t.dispose&&t.dispose()})}),function(e){window.qoopido.register("support/element/canvas/todataurl",e,["../../../support","../canvas"])}(function(e,t,n,r,o,i,s){"use strict";var u=e.support;return u.addTest("/element/canvas/todataurl",function(t){e["support/element/canvas"]().then(function(){var e=u.pool?u.pool.obtain("canvas"):i.createElement("canvas");e.toDataURL!==s?t.resolve():t.reject(),e.dispose&&e.dispose()},function(){t.reject()})})}),function(e){window.qoopido.register("support/element/canvas/todataurl/png",e,["../../../../support","../todataurl"])}(function(e,t,n,r,o,i,s){"use strict";var u=e.support;return u.addTest("/element/canvas/todataurl/png",function(t){e["support/element/canvas/todataurl"]().then(function(){var e=u.pool?u.pool.obtain("canvas"):i.createElement("canvas");0===e.toDataURL("image/png").indexOf("data:image/png")?t.resolve():t.reject(),e.dispose&&e.dispose()},function(){t.reject()})})}),function(e){window.qoopido.registerSingleton("hook/event",e,["../base"])}(function(e,t,n,r,o,i,s){"use strict";function u(e,t,n){for(var r,o=0;(r=n[o])!==s;o++)e[r]=t[r];e._properties=e._properties.concat(n)}var a={general:{properties:"type altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which path".split(" "),process:function(e,t){var n;if(e.originalEvent=t,e.isDefaultPrevented=t.defaultPrevented?!0:!1,e.isPropagationStopped=t.cancelBubble?!0:!1,e.metaKey=t.metaKey&&t.metaKey!==!1?!0:!1,e.target||(e.target=t.srcElement||i),3===e.target.nodeType&&(e.target=e.target.parentNode),!e.path){e.path=[],n=e.target;do e.path.push(n);while(n=n.parentNode);e.path.push(o)}}},mouse:{regex:new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"),properties:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement dataTransfer".split(" "),process:function(e,t){var n,r,o;r=t.fromElement,o=t.button,null===e.pageX&&null!==t.clientX&&(n=e.target.ownerDocument||i,n=n.documentElement||n.body,e.pageX=t.clientX+(n.scrollLeft||0)-(n.clientLeft||0),e.pageY=t.clientY+(n.scrollTop||0)-(n.clientTop||0)),!e.relatedTarget&&r&&(e.relatedTarget=r===e.target?t.toElement:r),e.which||o===s||(e.which=1&o?1:2&o?3:4&o?2:0)}},key:{regex:new RegExp("^(?:key)"),properties:"char charCode key keyCode".split(" "),process:function(e,t){null===e.which&&(e.which=null!==t.charCode?t.charCode:t.keyCode)}}};return e.base.extend({add:function(e,t){return e&&t&&a[e]&&(a[e]=t),this},get:function(e){return e&&a[e]?a[e]:null},process:function(e,t){var n,r,o;for(n in a)r=a[n],o=!r.regex||r.regex.test(t.type),o&&(r.properties&&u(e,t,r.properties),r.process&&r.process(e,t),r.delegate&&(e.delegate=r.delegate))}})}),function(e){var t=["../base","../support"];window.getComputedStyle||t.push("../polyfill/window/getcomputedstyle"),window.qoopido.registerSingleton("hook/css",e,t)}(function(e,t,n,r,o,i,s){"use strict";var u=e.support,a=o.getComputedStyle||e["polyfill/window/getcomputedstyle"],c={general:{get:function(e,t){return a(e,null).getPropertyValue(t[0])},set:function(e,t,n){e.style[t[1]]=n}},opacity:u.supportsCssProperty("opacity")?null:{regex:new RegExp("alpha\\(opacity=(.*)\\)","i"),get:function(e,t,n){return n=a(e,null).getPropertyValue("filter").toString().match(this.regex),n=n?n[1]/100:1},set:function(e,t,n){var r=e.style;r.zoom=1,r.filter="alpha(opacity="+(100*n+.5>>0)+")"}}};return e.base.extend({add:function(e,t){return e&&t&&c[e]&&(c[e]=t),this},get:function(e){return e&&c[e]?c[e]:null},process:function(e,t,n,r){var o;return n=u.getCssProperty(n,t)||null,n?((o=this.get(n[1]))&&o[e]||this.get("general")[e])(t,n,r):void 0}})}),function(e){window.qoopido.register("dom/event",e,["../base","../hook/event"])}(function(e,t,n,r,o,i,s){"use strict";var u=e["hook/event"];return e.base.extend({originalEvent:null,isDelegate:!1,isDefaultPrevented:!1,isPropagationStopped:!1,isImmediatePropagationStopped:!1,_properties:null,_constructor:function(e){var t=this;return t._properties=[],t._obtain(e),t},_obtain:function(e){u.process(this,e)},_dispose:function(){for(var e,t=this,n=0;(e=t._properties[n])!==s;n++)delete t[e];delete t.delegate,t.originalEvent=null,t.isDelegate=!1,t.isDefaultPrevented=!1,t.isPropagationStopped=!1,t.isImmediatePropagationStopped=!1,t._properties.length=0},preventDefault:function(){var e=this,t=e.originalEvent;t.cancelable!==!1&&(e.isDefaultPrevented=!0,t.preventDefault?t.preventDefault():t.returnValue=!1)},stopPropagation:function(){var e=this,t=e.originalEvent;e.isPropagationStopped=!0,t.stopPropagation&&t.stopPropagation(),t.cancelBubble=!0},stopImmediatePropagation:function(){var e=this,t=e.originalEvent;e.isImmediatePropagationStopped=!0,t.stopImmediatePropagation&&t.stopImmediatePropagation(),e.stopPropagation()}})}),function(e){var t=["../base","../function/unique/uuid","../hook/css","./event"];window.CustomEvent||t.push("../polyfill/window/customevent"),window.addEventListener||t.push("../polyfill/window/addeventlistener"),window.removeEventListener||t.push("../polyfill/window/removeeventlistener"),window.dispatchEvent||t.push("../polyfill/window/dispatchevent"),Element.prototype.matches||t.push("../polyfill/element/matches"),document.querySelector||t.push("../polyfill/document/queryselector"),document.querySelectorAll||t.push("../polyfill/document/queryselectorall"),String.prototype.trim||t.push("../polyfill/string/trim"),window.qoopido.register("dom/element",e,t)}(function(e,t,n,r,o,i,s){"use strict";function u(e){var t,n,r;for(t in _)n=_[t],(!n.regex||n.regex.test(e))&&(r=n);return r}function a(e,t,n){var r=this,o=u(e),s=i.createEvent(o.type);s[o.method](e,"load"===e?!1:!0,!0,t),n&&(s._quid=n,s.isDelegate=!0),r.element.dispatchEvent(s)}function c(e){var t;if("string"==typeof e)try{w.test(e)===!0?(t=e.replace(w,"$1").toLowerCase(),e=i.createElement(t)):e=i.querySelector(e)}catch(n){e=null}if(!e)throw new Error("[Qoopido.js] Element could not be resolved");return e}function l(e){return Array.prototype.concat.apply([],Array.prototype.splice.call(e,0)).join(" ").split(x)}function p(e,t){for(var n,r=0;(n=e.path[r])!==s;r++){if(n.matches(t))return e.currentTarget=n,!0;if(n===e.currentTarget)break}return!1}var f="object",d="string",m=e["function/unique/uuid"],g=i.getElementsByTagName("head")[0],h="textContent"in i.createElement("a")?"textContent":"innerText",y="undefined"!=typeof g.previousElementSibling?function(){return this.previousElementSibling}:function(){for(var e=this;e=e.previousSibling;)if(1===e.nodeType)return e},v="undefined"!=typeof g.nextElementSibling?function(){return this.nextElementSibling}:function(){for(var e=this;e=e.nextSibling;)if(1===e.nodeType)return e},w=new RegExp("^<(\\w+)\\s*/>$"),b=new RegExp("^[^-]+"),x=new RegExp(" +","g"),j=e["pool/module"]&&e["pool/module"].create(e["dom/event"],null,!0)||null,E=e["hook/css"],P={},_={custom:{type:"CustomEvent",method:"initCustomEvent"},html:{regex:new RegExp("^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$"),type:"HTMLEvents",method:"initEvent"},mouse:{regex:new RegExp("^(?:mouse|pointer|contextmenu|touch|click|dblclick|drag|drop)"),type:"MouseEvents",method:"initMouseEvent"}};return e.base.extend({type:null,element:null,_listener:null,_constructor:function(e,t,n){var r,o=this;return e=c(e),r=e._quid,r?o=P[r]:(r=e._quid=m(),o.type=e.tagName,o.element=e,o._listener={},P[r]=o),"object"==typeof t&&null!==t&&o.setAttributes(t),"object"==typeof n&&null!==n&&o.setStyles(n),o!==this&&this.dispose&&this.dispose(),o},_obtain:function(e,t,n){this._constructor(e,t,n)},_dispose:function(){var e,t,n=this;for(e in n._listener)t=e.match(b),n.element.removeEventListener(t,n._listener[e]),delete n._listener[e];n.type=null,n.element=null},getContent:function(e){var t=this.element;return e&&e!==!1?t.innerHTML:t[h]},setContent:function(e,t){var n=this,r=n.element;return t&&t!==!1?r.innerHTML=e:r[h]=e,n},getAttribute:function(e){var t=this;return e&&typeof e===d?t.element.getAttribute(e):void 0},getAttributes:function(){for(var e,t=this,n={},r=l(arguments),o=0;(e=r[o])!==s;o++)n[e]=t.element.getAttribute(e);return n},setAttribute:function(e,t){var n=this;return e&&typeof e===d&&n.element.setAttribute(e,t),n},setAttributes:function(e){var t,n=this;if(e&&typeof e===f&&!e.length)for(t in e)n.element.setAttribute(t,e[t]);return n},removeAttribute:function(e){var t=this;return e&&typeof e===d&&t.element.removeAttribute(e),t},removeAttributes:function(){for(var e,t=this,n=l(arguments),r=0;(e=n[r])!==s;r++)t.element.removeAttribute(e);return t},getStyle:function(e){var t=this;return e&&typeof e===d?E.process("get",t.element,e):void 0},getStyles:function(){for(var e,t=this,n={},r=l(arguments),o=0;(e=r[o])!==s;o++)n[e]=E.process("get",t.element,e);return n},setStyle:function(e,t){var n=this;return e&&typeof e===d&&E.process("set",n.element,e,t),n},setStyles:function(e){var t,n=this;if(e&&typeof e===f&&!e.length)for(t in e)E.process("set",n.element,t,e[t]);return n},removeStyle:function(e){var t=this;return e&&typeof e===d&&t.setStyle(e,""),t},removeStyles:function(){for(var e,t=this,n=l(arguments),r=0;(e=n[r])!==s;r++)t.setStyle(e,"");return t},siblings:function(e){for(var t=this.element,n=t.parentNode.firstChild,r=[];n;n=v.call(n))n===t||e&&!n.matches(e)||r.push(n);return r},siblingsBefore:function(e){for(var t=this.element.previousSibling,n=[];t;t=y.call(t))(!e||t.matches(e))&&n.push(t);return n},siblingsAfter:function(e){for(var t=this.element.nextSibling,n=[];t;t=v.call(t))(!e||t.matches(e))&&n.push(t);return n},previous:function(e){var t=y.call(this.element);if(!e)return t;for(;t;t=y.call(t))if(t.matches(e))return t},next:function(e){var t=v.call(this.element);if(!e)return t;for(;t;t=v.call(t))if(t.matches(e))return t},find:function(e){var t,n,r=this.element;return e=e.trim(),">"===e.charAt(0)?(t=r._quid,r.setAttribute("data-quid",t),e='[data-quid="'+t+'"] '+e,n=r.parentNode.querySelectorAll(e),r.removeAttribute("data-quid")):n=r.querySelectorAll(e),n},parent:function(e){var t;if(!e)return this.element.parentNode;for(t=this.element;t;t=t.parentNode)if(t.matches(e))return t},parents:function(e){for(var t=this.element.parentNode,n=[];t;t=t.parentNode){if(9===t.nodeType)return n;1===t.nodeType&&(!e||t.matches(e))&&n.push(t)}},isVisible:function(){var e=this,t=e.element;return!(t.offsetWidth<=0&&t.offsetHeight<=0||"hidden"===e.getStyle("visibility")||e.getStyle("opacity")<=0)},hasClass:function(e){return e?new RegExp("(?:^|\\s)"+e+"(?:\\s|$)").test(this.element.className):!1},addClass:function(e){var t=this;return e&&!t.hasClass(e)&&(t.element.className+=t.element.className?" "+e:e),t},removeClass:function(e){var t=this;return e&&t.hasClass(e)&&(t.element.className=t.element.className.replace(new RegExp("(?:^|\\s)"+e+"(?!\\S)"),"")),t},toggleClass:function(e){var t=this;return e&&(t.hasClass(e)?t.removeClass(e):t.addClass(e)),t},prepend:function(e){var t=this,n=t.element;if(e)try{e=e.element||c(e),n.firstChild?n.insertBefore(e,n.firstChild):t.append(e)}catch(r){n.insertAdjacentHTML("afterBegin",e)}return t},append:function(e){var t=this,n=t.element;if(e)try{n.appendChild(e.element||c(e))}catch(r){n.insertAdjacentHTML("beforeEnd",e)}return t},prependTo:function(e){var t=this,n=t.element;return e&&((e=e.element||c(e)).firstChild?e.insertBefore(n,e.firstChild):t.appendTo(e)),t},appendTo:function(e){var t=this;return e&&(e.element||c(e)).appendChild(t.element),t},insertBefore:function(e){var t=this,n=t.element;return e&&(e=e.element||c(e)).parentNode.insertBefore(n,e),t},insertAfter:function(e){var t=this,n=t.element;return e&&((e=e.element||c(e)).nextSibling?e.parentNode.insertBefore(n,e.nextSibling):t.appendTo(e.parentNode)),t},replace:function(e){var t=this,n=t.element;return e&&(e=e.element||c(e)).parentNode.replaceChild(n,e),t},replaceWith:function(e){var t=this,n=t.element;return e&&(e=e.element||c(e),n.parentNode.replaceChild(e,n)),t},remove:function(){var e=this,t=e.element;return t.parentNode.removeChild(t),e},on:function(t){var n,r=this,o=r.element,i=arguments.length>2?arguments[1]:null,u=arguments.length>2?arguments[2]:arguments[1],c=u._quid||(u._quid=m()),l=0;for(t=t.split(" ");(n=t[l])!==s;l++){var f=n+"-"+c,d=function(t){var n;t=j&&j.obtain(t)||e["dom/event"].create(t),t.isPropagationStopped||(n=t.delegate,t._quid=m(),(!i||p(t,i))&&u.call(t.currentTarget,t,t.originalEvent.detail),n&&(delete t.delegate,a.call(r,n))),t.dispose&&t.dispose()};d.type=n,r._listener[f]=d,o.addEventListener(n,d)}return r},one:function(e){var t=this,n=arguments.length>3||"string"==typeof arguments[1]?arguments[1]:null,r=arguments.length>3||"function"==typeof arguments[2]?arguments[2]:arguments[1],o=(arguments.length>3?arguments[3]:arguments[2])!==!1,i=function(n){t.off(o===!0?n.type:e,i),r.call(this,n,n.originalEvent.detail)};return r._quid=i._quid=m(),n?t.on(e,n,i):t.on(e,i),t},off:function(e,t){var n,r,o,i=this,u=i.element,a=0;for(e=e.split(" ");(n=e[a])!==s;a++)r=t._quid&&n+"-"+t._quid||null,o=r&&i._listener[r]||null,o?(u.removeEventListener(n,o),delete i._listener[r]):u.removeEventListener(n,t);return i},emit:function(e,t){var n=this;return a.call(n,e,t),n}})}),function(e){window.qoopido.registerSingleton("url",e,["./base"])}(function(e,t,n,r,o,i,s){"use strict";function u(e){var t=i.createElement("a");return t.href=e||"",t}var a,c,l=new RegExp("[?&]?([^=]+)=([^&]*)","g");try{a=location}catch(p){a=u()}return c=new RegExp("".concat("^",a.protocol,"//",a.hostname),"i"),e.base.extend({resolve:function(e){return u(e).href},redirect:function(e,t){t=t||o,t.location.href=this.resolve(e)},getParameter:function(e){for(var t,n={},r=u(e).search.split("+").join(" ");t=l.exec(r);)n[decodeURIComponent(t[1])]=decodeURIComponent(t[2]);return n},isLocal:function(e){return c.test(this.resolve(e))}})}),function(e){window.qoopido.register("transport",e,["./base","./function/merge"])}(function(e,t,n,r,o,i,s){"use strict";var u;return u=e.base.extend({setup:function(t){var n=this;return n._settings=e["function/merge"]({},n._settings,t),n},serialize:function(e,t){var n,r,o,i=[];for(n in e)r=t?"".concat(t,"[",n,"]"):n,o=e[n],i.push("object"==typeof o?this.serialize(o,r):"".concat(encodeURIComponent(r),"=",encodeURIComponent(o)));return i.join("&")}})},window,document),function(e){window.qoopido.registerSingleton("transport/xhr",e,["../transport","../function/merge","../function/unique/string","../url","../promise/defer"])}(function(e,t,n,r,o,i,s){"use strict";function u(e,t,n){var r,o=this,i=o.xhr,s=o.settings;t=s.cache===!1?"".concat(t,t.indexOf("?")>-1?"&":"?","_="+(new Date).getTime()):t,t=n&&"GET"===e?"".concat(t,t.indexOf("?")>-1?"&":"?",n):t;for(r in s.xhrOptions)i[r]=s.xhrOptions[r];if(i.open(e,t,s.async,s.username,s.password),i.setRequestHeader){i.setRequestHeader("Accept",s.accept),n&&"GET"!==e&&i.setRequestHeader("Content-Type",s.contentType);for(r in s.header)i.setRequestHeader(r,s.header[r])}i.timeout=s.timeout,i.onprogress=function(e){a.call(o,e)},i.onreadystatechange=i.onload=function(){c.call(o)},i.onerror=function(){l.call(o)},i.send(n||null),o.timeout=setTimeout(function(){p.call(o)},s.timeout)}function a(e){var t=this;t.timeout&&clearTimeout(t.timeout),t.timeout=setTimeout(function(){p.call(t)},t.settings.timeout)}function c(){var e=this,t=e.xhr,n=e.dfd;(t.readyState===s||4===t.readyState)&&(f.call(e),t.status===s||200===t.status?n.resolve({data:t.responseText,xhr:t}):n.reject({status:t.status,xhr:t}))}function l(){var e=this;f.call(e),e.dfd.reject()}function p(){var e=this;e.xhr.abort(),f.call(e),e.dfd.reject()}function f(){var e=this,t=e.xhr;e.timeout&&clearTimeout(e.timeout),t.onprogress=t.onreadystatechange=t.onerror=null}var d,m=e["promise/defer"],g="undefined"!=typeof o.XMLHttpRequest?function(t){return e.url.isLocal(t)?new o.XMLHttpRequest:o.XDomainRequest?new o.XDomainRequest:new o.XMLHttpRequest}:function(){try{return new ActiveXObject("MSXML2.XMLHTTP.3.0")}catch(e){return null}};return d=e.transport.extend({_settings:{accept:"*/*",timeout:5e3,async:!0,cache:!1,header:{},username:null,password:null,contentType:"application/x-www-form-urlencoded; charset=UTF-8 ",xhrOptions:{}},load:function(t,n,r,o){var i={};return n=e.url.resolve(n),i.url=n,i.id="".concat("xhr-",e["function/unique/string"]()),i.dfd=new m,i.xhr=g(n),i.settings=e["function/merge"]({},this._settings,o),i.timeout=null,u.call(i,t.toUpperCase(),n,r),i.dfd.promise},get:function(e,t,n){return this.load("GET",e,t,n)},post:function(e,t,n){return this.load("POST",e,t,n)},put:function(e,t,n){return this.load("PUT",e,t,n)},"delete":function(e,t,n){return this.load("DELETE",e,t,n)},head:function(e,t,n){return this.load("HEAD",e,t,n)}})},window,document),function(e){var t=["../element","../../proxy","../../function/merge","../../url","../../support","../../support/capability/datauri","../../support/element/canvas/todataurl/png","../../transport/xhr"];window.qoopido.register("dom/element/shrinkimage",e,t)}(function(e,t,n,r,o,i,s){"use strict";function u(t,n){t=e.url.resolve(b.exec(t)[1]),n=n===!0;var r=this,o=e["function/merge"]({},r._settings,e.url.getParameter(t)),i=o.target||(t=t.split("?")[0]).replace(x,"".concat(".q",o.quality,".shrunk"));n||r.removeAttribute(r._settings.attribute).hide(),j.then(function(){if(o.debug===!0)throw new Error("[Qoopido.js] Debug enabled");switch(typeof v[i]){case"object":v[i].one(_,function(e){a.call(r,e.data,n)}),r.emit(E);break;case"string":a.call(r,v[i],n);break;default:v[i]=d.create(i,n?null:r.element).one(q,function(e,o){e.type===_?(v[i]=o,r.emit(P),a.call(r,o,n)):(v[i]=t,a.call(r,t,n))},!1)}})["catch"](function(){v[i]=t,a.call(r,t,n)})}function a(e,t){ +var n=this;t?(n.setStyle("backgroundImage","url("+e+")"),n.emit(_)):n.one(S,function(){n.show(),n.emit(_)}).setAttribute("src",e)}function c(e){var t=this;e.get(t._url).then(function(e){try{var n=m.parse(e.data);n.width=parseInt(n.width,10),n.height=parseInt(n.height,10),l.call(t,n)}catch(r){t.emit(O)}},function(){t.emit(O)})}function l(e){var t,n,r=this,o=function(o){return t=y&&y.obtain("canvas")||i.createElement("canvas"),t.style.display="none",t.width=e.width,t.height=e.height,n=t.getContext("2d"),n.clearRect(0,0,e.width,e.height),n.drawImage(r.element,0,0,e.width,e.height),r.one(S,s).setAttribute("src",e.alpha),p(o)},s=function(o){var i;return n.globalCompositeOperation="xor",n.drawImage(r.element,0,0,e.width,e.height),i=t.toDataURL("image/png"),u(),r.emit(_,i),p(o)},u=function(){t&&t.dispose&&t.dispose(),r.element.dispose&&r.element.dispose()};r.one(C,function(e){e.type===S?o.call(this,e):(u(),r.emit(O))},!1).setAttribute("src",e.main)}function p(e){return e.preventDefault(),e.stopPropagation(),!1}var f,d,m=o.JSON,g=n.pop(),h={attribute:"data-"+g,quality:80,debug:!1},y=t.pool&&t.pool.dom||null,v={},w=new RegExp('^url\\x28"{0,1}data:image/shrink,(.+?)"{0,1}\\x29$',"i"),b=new RegExp('^(?:url\\x28"{0,1}|)(?:data:image/shrink,|)(.+?)(?:"{0,1}\\x29|)$',"i"),x=new RegExp("\\.png$","i"),j=e.support.testMultiple("/capability/datauri","/element/canvas/todataurl/png"),E="queued",P="cached",_="loaded",O="failed",q="".concat(_," ",O),S="load",A="error",C="".concat(S," ",A);return f=e["dom/element"].extend({_constructor:function(t,n){var r,o,i=f._parent._constructor.call(this,t);return i._settings=n=e["function/merge"]({},h,n),r=i.getAttribute(n.attribute),o=i.getStyle("backgroundImage"),"IMG"===i.type&&u.call(i,r),"none"!==o&&w.test(o)&&u.call(i,o,!0),i},hide:function(){this.setStyles({visibility:"hidden",opacity:0})},show:function(){this.setStyles({visibility:"",opacity:""})}}),d=e["dom/element"].extend({_url:null,_constructor:function(t,n){var r;return n||(n=y&&y.obtain("img")||i.createElement("img")),r=d._parent._constructor.call(this,n),r._url=t,c.call(r,e["transport/xhr"]),r}}),f},window); \ No newline at end of file diff --git a/dist/latest/min/particle.js b/dist/latest/min/particle.js index 1f452cae..21433ff3 100644 --- a/dist/latest/min/particle.js +++ b/dist/latest/min/particle.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){window.qoopido.register("particle",t,["./emitter","./pool/module","./vector/2d"])}(function(t,i,o,e,s,c,n){"use strict";var l,a=t["pool/module"].create(t["vector/2d"],null,!0);return l=t.emitter.extend({_velocity:null,_acceleration:null,position:null,velocity:null,acceleration:null,_constructor:function(t,i){var o=l._parent._constructor.call(this);return this._velocity=a.obtain(0,0),this._acceleration=a.obtain(0,0),this.position=a.obtain(t,i),this.velocity=a.obtain(0,0),this.acceleration=[],o},_obtain:function(t,i){this.position.x=t||0,this.position.y=i||0,this.velocity.x=0,this.velocity.y=0,this.acceleration.length=0},_destroy:function(){this._velocity=this._velocity.dispose(),this._acceleration=this._acceleration.dispose(),this.position=this.position.dispose(),this.velocity=this.velocity.dispose()},update:function(t){t="undefined"!=typeof t?parseFloat(t):1;for(var i,o=0;(i=this.acceleration[o])!==n;o++)this.velocity.add(i);this._velocity.x=this.velocity.x*t,this._velocity.y=this.velocity.y*t,this.position.add(this._velocity)}})}); \ No newline at end of file diff --git a/dist/latest/min/polyfill/array/indexof.js b/dist/latest/min/polyfill/array/indexof.js index 40231f06..191fe7f8 100644 --- a/dist/latest/min/polyfill/array/indexof.js +++ b/dist/latest/min/polyfill/array/indexof.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(r){window.qoopido.register("polyfill/array/indexof",r)}(function(r,o,t,i,n,e,f){"use strict";return Array.prototype.indexOf||(Array.prototype.indexOf=function(r){for(var o=this,t=0;o[t]!==f;++t)if(o[t]===r)return t;return-1}),Array.prototype.indexOf}); \ No newline at end of file diff --git a/dist/latest/min/polyfill/document/getelementsbyclassname.js b/dist/latest/min/polyfill/document/getelementsbyclassname.js index b7011332..3f36d003 100644 --- a/dist/latest/min/polyfill/document/getelementsbyclassname.js +++ b/dist/latest/min/polyfill/document/getelementsbyclassname.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){var t=[];Object.defineProperty||t.push("./queryselectorall"),window.qoopido.register("polyfill/document/getelementsbyclassname",e,t)}(function(e,t,l,n,s,r,a){"use strict";if(!r.getElementsByClassName){var o=new RegExp("^|\\s+","g");r.getElementsByClassName=function(e){return e=String(e).replace(o,"."),r.querySelectorAll(e)}}return r.getElementsByClassName}); \ No newline at end of file diff --git a/dist/latest/min/polyfill/document/queryselector.js b/dist/latest/min/polyfill/document/queryselector.js index c31f26ce..53c2e3cf 100644 --- a/dist/latest/min/polyfill/document/queryselector.js +++ b/dist/latest/min/polyfill/document/queryselector.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){var r=[];document.querySelectorAll||r.push("./queryselectorall"),window.qoopido.register("polyfill/document/queryselector",e,r)}(function(e,r,l,t,o,u,c){"use strict";return u.querySelector||(u.querySelector=function(e){var r=u.querySelectorAll(e);return r.length?r[0]:null}),u.querySelector}); \ No newline at end of file diff --git a/dist/latest/min/polyfill/document/queryselectorall.js b/dist/latest/min/polyfill/document/queryselectorall.js index fe844f33..b41c2782 100644 --- a/dist/latest/min/polyfill/document/queryselectorall.js +++ b/dist/latest/min/polyfill/document/queryselectorall.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("polyfill/document/queryselectorall",e)}(function(e,t,r,s,l,o,n){"use strict";return o.querySelectorAll||(o.querySelectorAll=function(e){var t,r=l.document.getElementsByTagName("script")[0],s=o.createElement("style"),n=[];for(r.parentNode.insertBefore(s,r),o._qsa=[],s.styleSheet.cssText=e+"{x-qsa:expression(document._qsa && document._qsa.push(this))}",l.scrollBy(0,0),s.parentNode.removeChild(s);o._qsa.length;)t=o._qsa.shift(),t.style.removeAttribute("x-qsa"),n.push(t);try{delete o._qsa}catch(c){o._qsa=null}return n}),o.querySelectorAll}); \ No newline at end of file diff --git a/dist/latest/min/polyfill/element/matches.js b/dist/latest/min/polyfill/element/matches.js index 700a87c9..31adf581 100644 --- a/dist/latest/min/polyfill/element/matches.js +++ b/dist/latest/min/polyfill/element/matches.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){var t=[];document.querySelectorAll||t.push("../document/queryselectorall"),window.qoopido.register("polyfill/element/matches",e,t)}(function(e,t,r,o,c,l,n){"use strict";if(!Element.prototype.matches){var s=Element.prototype;s.matches=s.matchesSelector=s.matchesSelector||s.webkitMatchesSelector||s.mozMatchesSelector||s.msMatchesSelector||s.oMatchesSelector||function(e){for(var t,r=this.parentElement.querySelectorAll(e),o=0;t=r[o++];)if(t===this)return!0;return!1}}return Element.prototype.matches}); \ No newline at end of file diff --git a/dist/latest/min/polyfill/object/create.js b/dist/latest/min/polyfill/object/create.js index 7c24a73b..89006187 100644 --- a/dist/latest/min/polyfill/object/create.js +++ b/dist/latest/min/polyfill/object/create.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e,t){if(t.register){var r=[];Object.defineProperties||r.push("./defineproperties"),t.register("polyfill/object/create",e,r)}else(t.modules=t.modules||{})["polyfill/object/create"]=e()}(function(e,t,r,o,i,c,n){"use strict";return Object.create||(Object.create=function(e,t){function r(){}if("object"!=typeof e)throw new TypeError;r.prototype=e;var o=new r;if(e&&(o.constructor=r),arguments.length>1){if(t!==Object(t))throw new TypeError;Object.defineProperties(o,t)}return o}),Object.create},window.qoopido=window.qoopido||{}); \ No newline at end of file diff --git a/dist/latest/min/polyfill/object/defineproperties.js b/dist/latest/min/polyfill/object/defineproperties.js index 93c41332..bf41736e 100644 --- a/dist/latest/min/polyfill/object/defineproperties.js +++ b/dist/latest/min/polyfill/object/defineproperties.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e,r){if(r.register){var t=[];Object.defineProperty&&function(){try{return Object.defineProperty({},"x",{}),!0}catch(e){return!1}}()||t.push("./defineproperty"),r.register("polyfill/object/defineproperties",e,t)}else(r.modules=r.modules||{})["polyfill/object/defineproperties"]=e()}(function(e,r,t,o,i,n,p){"use strict";return Object.defineProperties||(Object.defineProperties=function(e,r){if(e!==Object(e))throw new TypeError("Object.defineProperties called on non-object");var t;for(t in r)Object.prototype.hasOwnProperty.call(r,t)&&Object.defineProperty(e,t,r[t]);return e}),Object.defineProperties},window.qoopido=window.qoopido||{}); \ No newline at end of file diff --git a/dist/latest/min/polyfill/object/defineproperty.js b/dist/latest/min/polyfill/object/defineproperty.js index f09b0fc3..b269afac 100644 --- a/dist/latest/min/polyfill/object/defineproperty.js +++ b/dist/latest/min/polyfill/object/defineproperty.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e,t){t.register?t.register("polyfill/object/defineproperty",e):(t.modules=t.modules||{})["polyfill/object/defineproperty"]=e()}(function(e,t,r,o,n,i,c){"use strict";if(!Object.defineProperty||!function(){try{return Object.defineProperty({},"x",{}),!0}catch(e){return!1}}()){var f=Object.defineProperty,p=Object.prototype.__defineGetter__,d=Object.prototype.__defineSetter__;Object.defineProperty=function(e,t,r){if(f)try{return f(e,t,r)}catch(o){}if(e!==Object(e))throw new TypeError("Object.defineProperty called on non-object");return p&&"get"in r&&p.call(e,t,r.get),d&&"set"in r&&d.call(e,t,r.set),"value"in r&&(e[t]=r.value),e}}return Object.defineProperty},window.qoopido=window.qoopido||{}); \ No newline at end of file diff --git a/dist/latest/min/polyfill/object/getownpropertydescriptor.js b/dist/latest/min/polyfill/object/getownpropertydescriptor.js index 3bb2e16e..6307bb9f 100644 --- a/dist/latest/min/polyfill/object/getownpropertydescriptor.js +++ b/dist/latest/min/polyfill/object/getownpropertydescriptor.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(r,e){e.register?e.register("polyfill/object/getownpropertydescriptor",r):(e.modules=e.modules||{})["polyfill/object/getownpropertydescriptor"]=r()}(function(r,e,t,o,c,n,i){"use strict";if(!Object.getOwnPropertyDescriptor||!function(){try{return Object.getOwnPropertyDescriptor({x:0},"x"),!0}catch(r){return!1}}()){var p=Object.getOwnPropertyDescriptor;Object.getOwnPropertyDescriptor=function(r,e){if(r!==Object(r))throw new TypeError;try{return p.call(Object,r,e)}catch(t){}return Object.prototype.hasOwnProperty.call(r,e)?{value:r[e],enumerable:!0,writable:!0,configurable:!0}:void 0}}return Object.getOwnPropertyDescriptor},window.qoopido=window.qoopido||{}); \ No newline at end of file diff --git a/dist/latest/min/polyfill/object/getownpropertynames.js b/dist/latest/min/polyfill/object/getownpropertynames.js index 181a55f9..f0674891 100644 --- a/dist/latest/min/polyfill/object/getownpropertynames.js +++ b/dist/latest/min/polyfill/object/getownpropertynames.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e,o){o.register?o.register("polyfill/object/getownpropertynames",e):(o.modules=o.modules||{})["polyfill/object/getownpropertynames"]=e()}(function(e,o,t,r,n,p,c){"use strict";return Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(e){if(e!==Object(e))throw new TypeError("Object.getOwnPropertyNames called on non-object");var o,t=[];for(o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.push(o);return t}),Object.getOwnPropertyNames},window.qoopido=window.qoopido||{}); \ No newline at end of file diff --git a/dist/latest/min/polyfill/object/getprototypeof.js b/dist/latest/min/polyfill/object/getprototypeof.js index d8077c43..7b2eebb2 100644 --- a/dist/latest/min/polyfill/object/getprototypeof.js +++ b/dist/latest/min/polyfill/object/getprototypeof.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(o,t){t.register?t.register("polyfill/object/getprototypeof",o):(t.modules=t.modules||{})["polyfill/object/getprototypeof"]=o()}(function(o,t,e,r,p,n,c){"use strict";return Object.getPrototypeOf||(Object.getPrototypeOf={}.__proto__===Object.prototype&&[].__proto__===Array.prototype?function(o){return o.__proto__}:function(o){return o.constructor?o.constructor.prototype:null}),Object.getPrototypeOf},window.qoopido=window.qoopido||{}); \ No newline at end of file diff --git a/dist/latest/min/polyfill/object/keys.js b/dist/latest/min/polyfill/object/keys.js index b61ba9ed..98391c67 100644 --- a/dist/latest/min/polyfill/object/keys.js +++ b/dist/latest/min/polyfill/object/keys.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("polyfill/object/keys",e)}(function(e,t,o,r,n,c,i){"use strict";return Object.keys||(Object.keys=function(e){if(e!==Object(e))throw new TypeError("Object.keys called on non-object");var t,o=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&o.push(t);return o}),Object.keys}); \ No newline at end of file diff --git a/dist/latest/min/polyfill/string/lcfirst.js b/dist/latest/min/polyfill/string/lcfirst.js index 5b9ca786..ad9b1c7c 100644 --- a/dist/latest/min/polyfill/string/lcfirst.js +++ b/dist/latest/min/polyfill/string/lcfirst.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){window.qoopido.register("polyfill/string/lcfirst",t)}(function(t,r,i,o,n,e,s){"use strict";return String.prototype.lcfirst||(String.prototype.lcfirst=function(){var t=this;return t.charAt(0).toLowerCase()+t.slice(1)}),String.prototype.lcfirst}); \ No newline at end of file diff --git a/dist/latest/min/polyfill/string/trim.js b/dist/latest/min/polyfill/string/trim.js index 04f7e5b7..29e638b9 100644 --- a/dist/latest/min/polyfill/string/trim.js +++ b/dist/latest/min/polyfill/string/trim.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){window.qoopido.register("polyfill/string/trim",t)}(function(t,r,i,n,o,e,p){"use strict";if(!String.prototype.trim){var u=new RegExp("^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$","g");String.prototype.trim=function(){return this.replace(u,"")}}return String.prototype.trim}); \ No newline at end of file diff --git a/dist/latest/min/polyfill/string/ucfirst.js b/dist/latest/min/polyfill/string/ucfirst.js index 1e52367b..3bece5f2 100644 --- a/dist/latest/min/polyfill/string/ucfirst.js +++ b/dist/latest/min/polyfill/string/ucfirst.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){window.qoopido.register("polyfill/string/ucfirst",t)}(function(t,r,i,o,n,e,s){"use strict";return String.prototype.ucfirst||(String.prototype.ucfirst=function(){var t=this;return t.charAt(0).toUpperCase()+t.slice(1)}),String.prototype.ucfirst}); \ No newline at end of file diff --git a/dist/latest/min/polyfill/window/addeventlistener.js b/dist/latest/min/polyfill/window/addeventlistener.js index 3b0dba71..26e18e53 100644 --- a/dist/latest/min/polyfill/window/addeventlistener.js +++ b/dist/latest/min/polyfill/window/addeventlistener.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){var t=[];Array.prototype.indexOf||t.push("../array/indexof"),window.qoopido.register("polyfill/window/addeventlistener",e,t)}(function(e,t,n,a,r,o,i){"use strict";return r.addEventListener||(r.addEventListener=Window.prototype.addEventListener=HTMLDocument.prototype.addEventListener=Element.prototype.addEventListener=function(e,t){var n=this;n._events||(n._events={}),n._events[e]||(n._events[e]=function(e){var t,a=n._events[e.type].list,r=Array.prototype.concat.call([],a),l=0;for(e.preventDefault=function(){e.cancelable!==!1&&(e.returnValue=!1)},e.stopPropagation=function(){e.cancelBubble=!0},e.stopImmediatePropagation=function(){e.cancelBubble=!0,e.cancelImmediate=!0},e.currentTarget=n,e.relatedTarget=e.fromElement||null,e.target=e.srcElement||n,e.timeStamp=(new Date).getTime(),e.clientX&&(e.pageX=e.clientX+o.documentElement.scrollLeft,e.pageY=e.clientY+o.documentElement.scrollTop);(t=r[l])!==i&&!e.cancelImmediate;++l)a.indexOf(t)>-1&&t.call(n,e)},n._events[e].list=[],n.attachEvent&&n.attachEvent("on"+e,n._events[e])),n._events[e].list.push(t)}),r.addEventListener}); \ No newline at end of file diff --git a/dist/latest/min/polyfill/window/customevent.js b/dist/latest/min/polyfill/window/customevent.js index 22dcf61a..23e1d007 100644 --- a/dist/latest/min/polyfill/window/customevent.js +++ b/dist/latest/min/polyfill/window/customevent.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("polyfill/window/customevent",e)}(function(e,t,n,o,r,u,b){"use strict";if(!r.CustomEvent){var c=u.createEvent?function(e,t,n){var o=u.createEvent("Event"),r=t&&t.bubbles!==b?t.bubbles:!1,c=t&&t.cancelable!==b?t.cancelable:!0;return o.initEvent(e,r,c),o.detail=n,o}:function(e,t,n){var o=u.createEventObject();return o.type=e,o.bubbles=t&&t.bubbles!==b?t.bubbles:!1,o.cancelable=t&&t.cancelable!==b?t.cancelable:!0,o.detail=n,o};r.CustomEvent=Window.prototype.CustomEvent=function(e,t,n){if(!e)throw new Error("Not enough arguments");return c(e,t,n)}}return r.CustomEvent}); \ No newline at end of file diff --git a/dist/latest/min/polyfill/window/dispatchevent.js b/dist/latest/min/polyfill/window/dispatchevent.js index d9a56589..4986605d 100644 --- a/dist/latest/min/polyfill/window/dispatchevent.js +++ b/dist/latest/min/polyfill/window/dispatchevent.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){window.qoopido.register("polyfill/window/dispatchevent",t)}(function(t,e,n,o,r,i,c){"use strict";return r.dispatchEvent||(r.dispatchEvent=Window.prototype.dispatchEvent=HTMLDocument.prototype.dispatchEvent=Element.prototype.dispatchEvent=function(t){if(!arguments.length)throw new Error("Not enough arguments");if(!t||"string"!=typeof t.type)throw new Error("DOM Events Exception 0");var e=this,n=t.type;try{if(!t.bubbles){t.cancelBubble=!0;var o=function(t){t.cancelBubble=!0,(e||r).detachEvent("on"+n,o)};this.attachEvent("on"+n,o)}this.fireEvent("on"+n,t)}catch(i){t.target=e;do t.currentTarget=e,e._events&&e._events[n]&&e._events[n].call(e,t),e["on"+n]&&e["on"+n].call(e,t),e=9===e.nodeType?e.parentWindow:e.parentNode;while(e&&!t.cancelBubble)}return!0}),r.dispatchEvent}); \ No newline at end of file diff --git a/dist/latest/min/polyfill/window/getcomputedstyle.js b/dist/latest/min/polyfill/window/getcomputedstyle.js index eb324059..2a185d55 100644 --- a/dist/latest/min/polyfill/window/getcomputedstyle.js +++ b/dist/latest/min/polyfill/window/getcomputedstyle.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){window.qoopido.register("polyfill/window/getcomputedstyle",t)}(function(t,e,r,n,o,u,l){"use strict";if(o.getComputedStyle)return o.getComputedStyle;var i=new RegExp("(\\-([a-z]){1})","g"),p=function(){return arguments[2].toUpperCase()};return function(t,e){var r=this;return r.getPropertyValue=function(e){return"float"===e&&(e="styleFloat"),i.test(e)&&(e=e.replace(i,p)),t.currentStyle[e]||null},r}}); \ No newline at end of file diff --git a/dist/latest/min/polyfill/window/matchmedia.js b/dist/latest/min/polyfill/window/matchmedia.js index 49b5ca60..4214e1e6 100644 --- a/dist/latest/min/polyfill/window/matchmedia.js +++ b/dist/latest/min/polyfill/window/matchmedia.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){var t=[];window.getComputedStyle||t.push("polyfill/window/getcomputedstyle"),Array.prototype.indexOf||t.push("../array/indexof"),window.qoopido.register("polyfill/window/matchmedia",e,t)}(function(e,t,i,n,r,o,a){"use strict";function l(){var e=r.innerWidth||f.clientWidth,t=r.innerHeight||f.clientHeight,i=r.screen.width,n=r.screen.height,o=r.screen.colorDepth,a=r.devicePixelRatio;y.width=e,y.height=t,y["aspect-ratio"]=(e/t).toFixed(2),y.color=o,y["color-index"]=Math.pow(2,o),y["device-aspect-ratio"]=(i/n).toFixed(2),y["device-height"]=n,y["device-width"]=i,y["device-pixel-ratio"]=a||1,y.resolution=a&&96*a||r.screen.deviceXDPI||96,y.orientation=t>=e?"portrait":"landscape"}function s(e){var t,i,n={matches:!1,media:e,addListener:function(e){e&&i.push(e)},removeListener:function(e){for(var t,n=0;(t=i[n])!==a;n++)t===e&&i.splice(n,1)}};return n.matches=""===e?!0:d(e),x.push({mql:n,listeners:[]}),t=x.length-1,v[e]=t,i=x[t].listeners,n}function d(e){var t=-1!==e.indexOf(",")&&e.split(",")||[e],i=t.length-1,n=i,r=null,o=null,a="",l=0,s=!1,d="",c="",m=null,p=0,h=0,u=null,f="",x="",v="",w="",b="",q=!1;if(""===e)return!0;do if(r=t[n-i],s=!1,o=r.match(g.type),o&&(a=o[0],l=o.index),!o||-1===r.substring(0,l).indexOf("(")&&(l||!o[3]&&a!==o.input))q=!1;else{if(c=r,s="not"===o[1],l||(d=o[2],c=r.substring(a.length)),q=d===y.type||"all"===d||""===d,m=-1!==c.indexOf(" and ")&&c.split(" and ")||[c],p=m.length-1,h=p,q&&p>=0&&""!==c)do{if(u=m[p].match(g.media),!u||!y[u[3]]){q=!1;break}if(f=u[2],x=u[5],w=x,v=u[7],b=y[u[3]],v&&(w="px"===v?Number(x):"em"===v||"rem"===v?16*x:u[8]?(x/u[8]).toFixed(2):"dppx"===v?96*x:"dpcm"===v?.3937*x:Number(x)),q="min-"===f&&w?b>=w:"max-"===f&&w?w>=b:w?b===w:!!b,!q)break}while(p--);if(q)break}while(i--);return s?!q:q}function c(){var e,t,i=!1,n=0,o=0;if(x.length>0)for(l();(e=x[n])!==a;n++)if(i=d(e.mql.media),(i&&!e.mql.matches||!i&&e.mql.matches)&&(e.mql.matches=i,e.listeners))for(;(t=e.listeners[o])!==a;o++)t.call(r,e.mql)}function m(){r.clearTimeout(h),h=r.setTimeout(c,10)}function p(){var t,i=r.document.getElementsByTagName("script")[0],n=o.createElement("style"),l=["screen","print","speech","projection","handheld","tv","braille","embossed","tty"],s="#"+u+" { position: relative; z-index: 0; }",d="",c=r.addEventListener||(d="on")&&r.attachEvent,p=0;for(n.type="text/css",n.id=u,i.parentNode.insertBefore(n,i);(t=l[p])!==a;p++)s+="@media "+t+" { #"+u+" { position: relative; z-index: "+p+" } }";n.styleSheet?n.styleSheet.cssText=s:n.textContent=s,y.type=l[1*(r.getComputedStyle||e["polyfill/window/getcomputedstyle"])(n).zIndex||0],n.parentNode.removeChild(n),c(d+"resize",m),c(d+"orientationchange",m)}var h,u="qoopidoPolyfillWindowMatchmedia",f=o.documentElement,x=[],v={},y={},g={type:/\s*(only|not)?\s*(screen|print|[a-z\-]+)\s*(and)?\s*/i,media:/^\s*\(\s*(-[a-z]+-)?(min-|max-)?([a-z\-]+)\s*(:?\s*([0-9]+(\.[0-9]+)?|portrait|landscape)(px|em|dppx|dpcm|rem|%|in|cm|mm|ex|pt|pc|\/([0-9]+(\.[0-9]+)?))?)?\s*\)\s*$/};return r.matchMedia||(p(),l(),r.matchMedia=function(e){var t=v[e]||!1;return t===!1?s(e):x[t].mql}),r.matchMedia}); \ No newline at end of file diff --git a/dist/latest/min/polyfill/window/promise.js b/dist/latest/min/polyfill/window/promise.js index ffe50730..a820ae34 100644 --- a/dist/latest/min/polyfill/window/promise.js +++ b/dist/latest/min/polyfill/window/promise.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){window.qoopido.register("polyfill/window/promise",t)}(function(t,n,r,e,o,i,u){"use strict";function s(t,n){var r=j.push([t,n]);1===r&&c()}function c(){o.setTimeout(f,1)}function f(){for(var t,n=0;(t=j[n])!==u;n++)t[0](t[1]);j.length=0}function a(t,n){var r,e=null;try{if(t===n)throw new TypeError("A promises callback cannot return that same promise.");if(("function"==typeof n||"object"==typeof n&&null!==n)&&(e=n.then,"function"==typeof e))return e.call(n,function(e){return r?!0:(r=!0,void(n!==e?h(t,e):p(t,e)))},function(n){return r?!0:(r=!0,void v(t,n))}),!0}catch(o){return r?!0:(v(t,o),!0)}return!1}function l(t,n){function r(t){h(n,t)}function e(t){v(n,t)}try{t(r,e)}catch(o){e(o)}}function _(t,n,r,e){var o,i,u,s,c="function"==typeof r;if(c)try{o=r(e),u=!0}catch(f){s=!0,i=f}else o=e,u=!0;a(n,o)||(c&&u?h(n,o):s?v(n,i):t===T?h(n,o):t===E&&v(n,o))}function h(t,n){t===n?p(t,n):a(t,n)||p(t,n)}function p(t,n){t._state===g&&(t._state=P,t._detail=n,s(b,t))}function v(t,n){t._state===g&&(t._state=P,t._detail=n,s(m,t))}function b(t){d(t,t._state=T)}function m(t){d(t,t._state=E)}function y(t,n,r,e){var o=t._subscribers,i=o.length;o[i]=n,o[i+T]=r,o[i+E]=e}function d(t,n){for(var r,e,o=t._subscribers,i=t._detail,s=0;(r=o[s])!==u;s+=3)e=o[s+n],_(n,r,e,i);t._subscribers=null}function w(t){var n=this;if("function"!=typeof t)throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");n._subscribers=[],l(t,n)}var g=void 0,P=0,T=1,E=2,j=[];return w.prototype={_state:u,_detail:u,_subscribers:u,then:function(t,n){var r=this,e=new w(function(){});return r._state?s(function(){_(r._state,e,arguments[r._state-1],r._detail)}):y(r,e,t,n),e},"catch":function(t){return this.then(null,t)}},o.Promise||(o.Promise=w),o.Promise}); \ No newline at end of file diff --git a/dist/latest/min/polyfill/window/removeeventlistener.js b/dist/latest/min/polyfill/window/removeeventlistener.js index d62016ee..45171b8e 100644 --- a/dist/latest/min/polyfill/window/removeeventlistener.js +++ b/dist/latest/min/polyfill/window/removeeventlistener.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){var t=[];Array.prototype.indexOf||t.push("../array/indexof"),window.qoopido.register("polyfill/window/removeeventlistener",e,t)}(function(e,t,n,r,o,i,v){"use strict";return o.removeEventListener||(o.removeEventListener=Window.prototype.removeEventListener=HTMLDocument.prototype.removeEventListener=Element.prototype.removeEventListener=function(e,t){var n=this;if(n._events&&n._events[e]&&n._events[e].list){var r=n._events[e].list.indexOf(t);r>-1&&(n._events[e].list.splice(r,1),n._events[e].list.length||n.detachEvent&&n.detachEvent("on"+e,n._events[e]))}}),o.removeEventListener}); \ No newline at end of file diff --git a/dist/latest/min/pool.js b/dist/latest/min/pool.js index 235d4bff..16729905 100644 --- a/dist/latest/min/pool.js +++ b/dist/latest/min/pool.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("pool",e,["./base","./function/merge","./function/unique/uuid"])}(function(e,t,i,n,o,u,r){"use strict";function s(){var e,t,i,n=this,o=n.metrics,u=n._settings,r=n._queue,s=n._variables,a=1;if(r.length>0&&(s.durationAverage>0&&(a=~~((a=u.frameBudget/s.durationAverage)<1?1:a)),(e=Math.min(r.length,(t=r.splice(0,a)).length))>0))if(o.inPool+e<=u.maxPoolsize){i=(new Date).getTime();for(var l=0;e>l;l++){var c=t[l],d=c._puid,_=c.dispose;c=n._dispose(c),c._puid=d,c.dispose=_,n._getPool.call(n,c).push(c)}o.inPool+=e,o.inQueue-=e,s.durationSamples+=e,s.durationTotal+=(new Date).getTime()-i,s.durationAverage=s.durationTotal/s.durationSamples}else{if("function"==typeof n._destroy)for(var p=0;e>p;p++)n._destroy(t[p]);t.length=0,o.inQueue-=e,o.destroyed+=e}}var a,l={interval:1e3/60,frameBudget:.5,maxPoolsize:1e3};return a=e.base.extend({metrics:null,_settings:null,_pool:null,_queue:null,_variables:null,_constructor:function(t){var i=this;return i.metrics={total:0,inPool:0,inUse:0,inQueue:0,recycled:0,destroyed:0},i._settings=e["function/merge"]({},l,t),i._pool=i._initPool(),i._queue=[],i._variables={durationSamples:0,durationTotal:0,durationAverage:0},setInterval(function(){s.call(i)},i._settings.interval),i},_initPool:function(){return[]},_initElement:function(t){var i=this;return t._puid=e["function/unique/uuid"](),t.dispose=function(){i.dispose(t)},i.metrics.total++,t},_getPool:function(){return this._pool},obtain:function(){var e=this,t=e._getPool.apply(e,arguments).pop();return t?(e.metrics.inPool--,e.metrics.recycled++):t=e._initElement(e._obtain.apply(e,arguments)),"function"==typeof t._obtain&&t._obtain.apply(t,arguments),e.metrics.inUse++,t},dispose:function(e){var t=this,i=t._queue;return e._puid||(e=t._initElement(e),t.metrics.inUse++),"function"==typeof e._dispose&&e._dispose(),i.push(e),t.metrics.inUse--,t.metrics.inQueue++,null}})}); \ No newline at end of file diff --git a/dist/latest/min/pool/array.js b/dist/latest/min/pool/array.js index d529c41b..479a7db1 100644 --- a/dist/latest/min/pool/array.js +++ b/dist/latest/min/pool/array.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(o){window.qoopido.register("pool/array",o,["../pool"])}(function(o,n,r,t,e,i,p){"use strict";var u=o.pool.extend({_dispose:function(o){return o.length=0,o},_obtain:function(){return[]}});return n.pool=n.pool||{},n.pool.array=u.create(),u}); \ No newline at end of file diff --git a/dist/latest/min/pool/dom.js b/dist/latest/min/pool/dom.js index 280d0375..8f5bf53d 100644 --- a/dist/latest/min/pool/dom.js +++ b/dist/latest/min/pool/dom.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(o){window.qoopido.register("pool/dom",o,["../pool"])}(function(o,t,e,r,n,i,p){"use strict";var l=o.pool.extend({_initPool:function(){return{}},_getPool:function(o){var t=this;return"string"!=typeof o&&(o=o.tagName.toLowerCase()),t._pool[o]=t._pool[o]||[]},_dispose:function(o){var t;o.parentNode&&o.parentNode.removeChild(o);for(t in o)if(Object.prototype.hasOwnProperty.call(o,t))try{o.removeAttribute(t)}catch(e){o.property=null}return o},_obtain:function(o){return i.createElement(o)}});return t.pool=t.pool||{},t.pool.dom=l.create(),l}); \ No newline at end of file diff --git a/dist/latest/min/pool/module.js b/dist/latest/min/pool/module.js index 04a03f2d..018daec4 100644 --- a/dist/latest/min/pool/module.js +++ b/dist/latest/min/pool/module.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(o){window.qoopido.register("pool/module",o,["../pool","../function/unique/uuid"])}(function(o,u,t,n,e,i,r){"use strict";var l=o["function/unique/uuid"],d=o.pool.extend({_module:null,_destroy:null,_constructor:function(o,t,n){var e=this,i=o._puid||(o._puid=l()),r=n&&(u.pool||(u.pool={}))&&(u.pool.module||(u.pool.module={}));return n===!0&&r[i]?r[i]:(e=d._parent._constructor.call(this,t),e._module=o,"function"==typeof o._destroy&&(e._destroy=function(o){o._destroy()}),n===!0&&(r[i]=e),e)},_dispose:function(o){return o},_obtain:function(){return this._module.create.apply(this._module,arguments)}});return d}); \ No newline at end of file diff --git a/dist/latest/min/pool/object.js b/dist/latest/min/pool/object.js index e6e4f5a7..2af5c1d6 100644 --- a/dist/latest/min/pool/object.js +++ b/dist/latest/min/pool/object.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("pool/object",e,["../pool"])}(function(e,t,o,r,n,l,p){"use strict";var i,c=null===Object.prototype.__proto__,d=c?"__proto__":"prototype",u=c?null:function(){var e=l.createElement("iframe"),t=l.body||l.documentElement;e.style.display="none",t.appendChild(e),e.src="javascript:";var o=e.contentWindow.Object.prototype;return t.removeChild(e),e=null,delete o.constructor,delete o.hasOwnProperty,delete o.propertyIsEnumerable,delete o.isPrototypeOf,delete o.toLocaleString,delete o.toString,delete o.valueOf,o.__proto__=null,o}();return i=e.pool.extend({getModel:function(){return u},_dispose:function(e){var t;e[d]=u;for(t in e)delete e[t];return e},_obtain:function(){return{}}}),t.pool=t.pool||{},t.pool.object=i.create(),i}); \ No newline at end of file diff --git a/dist/latest/min/promise/all.js b/dist/latest/min/promise/all.js index 9fcdf148..7ded9d3e 100644 --- a/dist/latest/min/promise/all.js +++ b/dist/latest/min/promise/all.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(n){var o=[];window.Promise||o.push("../polyfill/window/promise"),window.qoopido.register("promise/all",n,o)}(function(n,o,t,r,i,e,u){"use strict";return function(n){if("[object Array]"!==Object.prototype.toString.call(n))throw new TypeError("You must pass an array to all.");return new i.Promise(function(o,t){function r(n){return function(o){i(n,o)}}function i(n,t){c[n]=t,0===--f&&o(c)}var e,c=[],f=n.length,s=0;for(0===f&&o([]);(e=n[s])!==u;s++)e&&"function"==typeof e.then?e.then(r(s),t):i(s,e)})}}); \ No newline at end of file diff --git a/dist/latest/min/promise/defer.js b/dist/latest/min/promise/defer.js index 4f2fa33e..e0c53a14 100644 --- a/dist/latest/min/promise/defer.js +++ b/dist/latest/min/promise/defer.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(i){var o=[];window.Promise||o.push("../polyfill/window/promise"),window.qoopido.register("promise/defer",i,o)}(function(i,o,e,r,n,s,t){"use strict";return function(){var i=this;i.promise=new n.Promise(function(o,e){i.resolve=o,i.reject=e})}}); \ No newline at end of file diff --git a/dist/latest/min/promise/race.js b/dist/latest/min/promise/race.js index d605e314..60b25145 100644 --- a/dist/latest/min/promise/race.js +++ b/dist/latest/min/promise/race.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(o){var r=[];window.Promise||r.push("../polyfill/window/promise"),window.qoopido.register("promise/race",o,r)}(function(o,r,t,n,e,i,s){"use strict";return function(o){if("[object Array]"!==Object.prototype.toString.call(o))throw new TypeError("You must pass an array to all.");return new e.Promise(function(r,t){for(var n,e=0;(n=o[e])!==s;e++)n&&"function"==typeof n.then?n.then(r,t):r(n)})}}); \ No newline at end of file diff --git a/dist/latest/min/proxy.js b/dist/latest/min/proxy.js index 93e90c61..3cbf5455 100644 --- a/dist/latest/min/proxy.js +++ b/dist/latest/min/proxy.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(n){window.qoopido.register("proxy",n,["./base","./function/unique/uuid"])}(function(n,t,u,r,e,o,i){"use strict";return n.base.extend({_constructor:function(t,u){var r=Array.prototype.splice.call(arguments,2),e=function(){return u.apply(t,Array.prototype.slice.call(arguments).concat(r))};return e._quid=n["function/unique/uuid"](),e}})}); \ No newline at end of file diff --git a/dist/latest/min/renderer.js b/dist/latest/min/renderer.js index 4f9555a9..72040ccd 100644 --- a/dist/latest/min/renderer.js +++ b/dist/latest/min/renderer.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.registerSingleton("renderer",e,["./emitter","./support","./dom/element"])}(function(e,t,i,n,r,a,o){"use strict";function c(e){return r.setTimeout(e,y)}function u(){var e=this;a[v]?d&&(s=(new Date).getTime(),e.paused=!0,k(d),d=null,e.emit("suspend")):d||(e.paused=!1,s&&(l=(new Date).getTime()-s,f+=l,g+=l,e.emit("resume",l)),e._tick())}var m,s,l,d,g,p,f,h,_=e.support,w=e["dom/element"].create(a),T=r[_.getMethod("requestAnimationFrame")]||c,k=r[_.getMethod("cancelAnimationFrame")]||clearTimeout,v=_.getProperty("hidden",a),D=60,y=1e3/D,b=0;return m=e.emitter.extend({framerate:0,ratio:1,paused:!1,_tick:null,_constructor:function(){var e=m._parent._constructor.call(this);return g=f=(new Date).getTime(),e._tick=function(){e.paused===!1&&(p=(new Date).getTime(),h=p-g,e.ratio=(p-f)/y,e.framerate=D/e.ratio,h>=1e3&&(g=p,b=0),f=p,b+=1,e.emit("tick",e.framerate,e.ratio),d=T(e._tick))},w.on("".concat("visibilitychange ",_.getPrefix()[0],"visibilitychange"),function(){u.call(e)}),u.call(e),e}})}); \ No newline at end of file diff --git a/dist/latest/min/support.js b/dist/latest/min/support.js index 039daa37..1e0a2e82 100644 --- a/dist/latest/min/support.js +++ b/dist/latest/min/support.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){var t=["./base","./promise/all","./promise/defer"];String.prototype.ucfirst||t.push("./polyfill/string/ucfirst"),String.prototype.lcfirst||t.push("./polyfill/string/lcfirst"),window.qoopido.registerSingleton("support",e,t)}(function(e,t,r,s,o,i,p){"use strict";function n(e){return e.replace(a,"$1").lcfirst().replace(c,"").replace(m,g)}var l=e["promise/all"],u=e["promise/defer"],f=new RegExp("^(Moz|WebKit|Khtml|ms|O|Icab)(?=[A-Z])"),a=new RegExp("^(?:webkit|khtml|icab|moz|ms|o)([A-Z])"),c=new RegExp("^-(?:webkit|khtml|icab|moz|ms|o)-"),m=new RegExp("-([a-z])","gi"),h=new RegExp("([A-Z])","g"),g=function(){return arguments[1].ucfirst()},y={prefix:null,method:{},property:{},css:{},promises:{prefix:null,method:{},property:{},css:{},test:{}}};return e.base.extend({test:{},pool:t.pool&&t.pool.dom,testMultiple:function(){for(var e,t=[],r=0;(e=arguments[r])!==p;r++)switch(typeof e){case"string":t.push(this.test[e]());break;case"boolean":var s=new u;e?s.resolve():s.reject(),t.push(s.promise);break;default:t.push(e)}return new l(t)},getPrefix:function(){var e,t=this,r=y.prefix||null;if(null===r){var s=t.pool?t.pool.obtain("div"):i.createElement("div"),o=s.style;r=!1;for(e in o)f.test(e)&&(r=e.match(f)[0]);r===!1&&"WebkitOpacity"in o&&(r="WebKit"),r===!1&&"KhtmlOpacity"in o&&(r="Khtml"),r=y.prefix=r===!1?!1:[r.toLowerCase(),r.toLowerCase().ucfirst(),r],s.dispose&&s.dispose()}return r},getMethod:function(e,t){e=n(e),t=t||o;var r=t.tagName,s=y.method[r]=y.method[r]||{},i=s[e]=y.method[r][e]||null;if(null===i){i=!1;var l,u,f=0,a=e.ucfirst(),c=this.getPrefix();for(l=c!==!1?(e+" "+a+" "+c.join(a+" ")+a).split(" "):[e];(u=l[f])!==p;f++)if(t[u]!==p&&("function"==typeof t[u]||"object"==typeof t[u])){i=u;break}y.method[r][e]=i}return i},getProperty:function(e,t){e=n(e),t=t||o;var r=t.tagName,s=y.property[r]=y.property[r]||{},i=s[e]=y.property[r][e]||null;if(null===i){i=!1;var l,u,f=0,a=e.ucfirst(),c=this.getPrefix();for(l=c!==!1?(e+" "+a+" "+c.join(a+" ")+a).split(" "):[e],f;(u=l[f])!==p;f++)if(t[u]!==p){i=u;break}y.property[r][e]=i}return i},getCssProperty:function(e){e=n(e);var t=this,r=y.css[e]||null;if(null===r){r=!1;var s,o=0,l=t.pool?t.pool.obtain("div"):i.createElement("div"),u=e.ucfirst(),f=this.getPrefix()||[],a=(e+" "+u+" "+f.join(u+" ")+u).split(" "),c="";for(o;(s=a[o])!==p;o++)if(l.style[s]!==p){r=s,o>0&&(c="-");break}r=y.css[e]=r!==!1?[c+r.replace(h,"-$1").toLowerCase(),r]:!1,l.dispose&&l.dispose()}return r},supportsPrefix:function(){return!!this.getPrefix()},supportsMethod:function(e,t){return!!this.getMethod(e,t)},supportsProperty:function(e,t){return!!this.getProperty(e,t)},supportsCssProperty:function(e){return!!this.getCssProperty(e)},testPrefix:function(){var e=y.promises.prefix;if(null===e){var t=new u,r=this.getPrefix();r?t.resolve(r):t.reject(),e=y.promises.prefix=t.promise}return e},testMethod:function(e,t){t=t||o;var r=t.tagName,s=y.promises.method[r]=y.promises.method[r]||{},i=s[e]=y.promises.method[r][e]||null;if(null===i){var p=new u,n=this.getMethod(e,t);n?p.resolve(n):p.reject(),i=y.promises.method[r][e]=p.promise}return i},testProperty:function(e,t){t=t||o;var r=t.tagName,s=y.promises.property[r]=y.promises.property[r]||{},i=s[e]=y.promises.property[r][e]||null;if(null===i){var p=new u,n=this.getProperty(e,t);n?p.resolve(n):p.reject(),i=y.promises.property[r][e]=p.promise}return i},testCssProperty:function(e){var t=y.promises.css[e]||null;if(null===t){var r=new u,s=this.getCssProperty(e);s?r.resolve(s):r.reject(),t=y.promises.css[e]=r.promise}return t},addTest:function(e,t){return this.test[e]=function(){var r=y.promises.test[e]||null;if(null===r){var s=new u,o=Array.prototype.slice.call(arguments);o.splice(0,0,s),t.apply(null,o),r=y.promises.test[e]=s.promise}return r}}})}); \ No newline at end of file diff --git a/dist/latest/min/support/capability/datauri.js b/dist/latest/min/support/capability/datauri.js index 44d3996b..c7b7e7db 100644 --- a/dist/latest/min/support/capability/datauri.js +++ b/dist/latest/min/support/capability/datauri.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("support/capability/datauri",e,["../../support","../../dom/element"])}(function(e,t,o,i,A,r,a){"use strict";var n=e.support;return n.addTest("/capability/datauri",function(t){var o=e["dom/element"].create(n.pool?n.pool.obtain("img"):r.createElement("img"));o.one("error load",function(e){"load"===e.type&&1===o.element.width&&1===o.element.height?t.resolve():t.reject(),o.element.dispose&&o.element.dispose()},!1).setAttribute("src","data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==")})}); \ No newline at end of file diff --git a/dist/latest/min/support/capability/touch.js b/dist/latest/min/support/capability/touch.js index d531e8a3..dfd12286 100644 --- a/dist/latest/min/support/capability/touch.js +++ b/dist/latest/min/support/capability/touch.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(o){window.qoopido.register("support/capability/touch",o,["../../support"])}(function(o,t,c,u,n,i,s){"use strict";return o.support.addTest("/capability/touch",function(o){"ontouchstart"in n||n.DocumentTouch&&i instanceof DocumentTouch||u.maxTouchPoints>0||u.msMaxTouchPoints>0?o.resolve():o.reject()})}); \ No newline at end of file diff --git a/dist/latest/min/support/css/borderradius.js b/dist/latest/min/support/css/borderradius.js index 47c296e4..574e55ba 100644 --- a/dist/latest/min/support/css/borderradius.js +++ b/dist/latest/min/support/css/borderradius.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(r){window.qoopido.register("support/css/borderradius",r,["../../support"])}(function(r,s,o,t,e,p,u){"use strict";return r.support.addTest("/css/borderradius",function(s){r.support.supportsCssProperty("border-radius")?s.resolve(r.support.getCssProperty("border-radius")):s.reject()})}); \ No newline at end of file diff --git a/dist/latest/min/support/css/boxshadow.js b/dist/latest/min/support/css/boxshadow.js index f7a03e4c..76230f12 100644 --- a/dist/latest/min/support/css/boxshadow.js +++ b/dist/latest/min/support/css/boxshadow.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(o){window.qoopido.register("support/css/boxshadow",o,["../../support"])}(function(o,s,t,r,p,e,u){"use strict";return o.support.addTest("/css/boxshadow",function(s){o.support.supportsCssProperty("box-shadow")?s.resolve(o.support.getCssProperty("box-shadow")):s.reject()})}); \ No newline at end of file diff --git a/dist/latest/min/support/css/rem.js b/dist/latest/min/support/css/rem.js index d16703e7..001b4e79 100644 --- a/dist/latest/min/support/css/rem.js +++ b/dist/latest/min/support/css/rem.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("support/css/rem",e,["../../support"])}(function(e,t,o,s,r,i,n){"use strict";var p=e.support;return p.addTest("/css/rem",function(e){var t=p.pool?p.pool.obtain("div"):i.createElement("div");try{t.style.fontSize="3rem"}catch(o){}/rem/.test(t.style.fontSize)?e.resolve():e.reject(),t.dispose&&t.dispose()})}); \ No newline at end of file diff --git a/dist/latest/min/support/css/rgba.js b/dist/latest/min/support/css/rgba.js index 55f6e12c..e2e03fc6 100644 --- a/dist/latest/min/support/css/rgba.js +++ b/dist/latest/min/support/css/rgba.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(o){window.qoopido.register("support/css/rgba",o,["../../support"])}(function(o,r,t,s,e,a,c){"use strict";var i=o.support;return i.addTest("/css/rgba",function(o){var r=i.pool?i.pool.obtain("div"):a.createElement("div");try{r.style.backgroundColor="rgba(0,0,0,.5)"}catch(t){}/rgba/.test(r.style.backgroundColor)?o.resolve():o.reject(),r.dispose&&r.dispose()})}); \ No newline at end of file diff --git a/dist/latest/min/support/css/textshadow.js b/dist/latest/min/support/css/textshadow.js index f336fb47..31420cdd 100644 --- a/dist/latest/min/support/css/textshadow.js +++ b/dist/latest/min/support/css/textshadow.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){window.qoopido.register("support/css/textshadow",t,["../../support"])}(function(t,s,o,r,e,p,u){"use strict";return t.support.addTest("/css/textshadow",function(s){t.support.supportsCssProperty("text-shadow")?s.resolve(t.support.getCssProperty("text-shadow")):s.reject()})}); \ No newline at end of file diff --git a/dist/latest/min/support/css/transform.js b/dist/latest/min/support/css/transform.js index 9a6c1a47..8a76bc1f 100644 --- a/dist/latest/min/support/css/transform.js +++ b/dist/latest/min/support/css/transform.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(r){window.qoopido.register("support/css/transform",r,["../../support"])}(function(r,s,t,o,p,e,n){"use strict";return r.support.addTest("/css/transform",function(s){r.support.supportsCssProperty("transform")?s.resolve(r.support.getCssProperty("transform")):s.reject()})}); \ No newline at end of file diff --git a/dist/latest/min/support/css/transform/2d.js b/dist/latest/min/support/css/transform/2d.js index 805acac1..28043b51 100644 --- a/dist/latest/min/support/css/transform/2d.js +++ b/dist/latest/min/support/css/transform/2d.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){window.qoopido.register("support/css/transform/2d",t,["../../../support","../transform"])}(function(t,r,o,s,e,n,p){"use strict";var c=t.support;return c.addTest("/css/transform/2d",function(r){t["support/css/transform"]().then(function(){var o=c.pool?c.pool.obtain("div"):n.createElement("div"),s=t.support.getCssProperty("transform");try{o.style[s]="rotate(30deg)"}catch(e){}/rotate/.test(o.style[s])?r.resolve():r.reject(),o.dispose&&o.dispose()},function(){r.reject()})})}); \ No newline at end of file diff --git a/dist/latest/min/support/css/transform/3d.js b/dist/latest/min/support/css/transform/3d.js index 2dd075e0..8f0e90ab 100644 --- a/dist/latest/min/support/css/transform/3d.js +++ b/dist/latest/min/support/css/transform/3d.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){window.qoopido.register("support/css/transform/3d",t,["../../../support","../transform"])}(function(t,s,r,o,e,n,p){"use strict";var a=t.support;return a.addTest("/css/transform/3d",function(s){t["support/css/transform"]().then(function(){var r=a.pool?a.pool.obtain("div"):n.createElement("div"),o=t.support.getCssProperty("transform");try{r.style[o]="translate3d(0,0,0)"}catch(e){}/translate3d/.test(r.style[o])?s.resolve():s.reject(),r.dispose&&r.dispose()},function(){s.reject()})})}); \ No newline at end of file diff --git a/dist/latest/min/support/css/transition.js b/dist/latest/min/support/css/transition.js index aa543c39..448b1eeb 100644 --- a/dist/latest/min/support/css/transition.js +++ b/dist/latest/min/support/css/transition.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){window.qoopido.register("support/css/transition",t,["../../support"])}(function(t,s,r,o,n,i,p){"use strict";return t.support.addTest("/css/transition",function(s){t.support.supportsCssProperty("transition")?s.resolve(t.support.getCssProperty("transition")):s.reject()})}); \ No newline at end of file diff --git a/dist/latest/min/support/element/canvas.js b/dist/latest/min/support/element/canvas.js index 23c03960..5eda5645 100644 --- a/dist/latest/min/support/element/canvas.js +++ b/dist/latest/min/support/element/canvas.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("support/element/canvas",e,["../../support"])}(function(e,t,o,n,s,a,r){"use strict";var p=e.support;return p.addTest("/element/canvas",function(e){var t=p.pool?p.pool.obtain("canvas"):a.createElement("canvas");t.getContext&&t.getContext("2d")?e.resolve():e.reject(),t.dispose&&t.dispose()})}); \ No newline at end of file diff --git a/dist/latest/min/support/element/canvas/todataurl.js b/dist/latest/min/support/element/canvas/todataurl.js index e78621de..5ed5714b 100644 --- a/dist/latest/min/support/element/canvas/todataurl.js +++ b/dist/latest/min/support/element/canvas/todataurl.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){window.qoopido.register("support/element/canvas/todataurl",t,["../../../support","../canvas"])}(function(t,e,n,o,a,s,r){"use strict";var c=t.support;return c.addTest("/element/canvas/todataurl",function(e){t["support/element/canvas"]().then(function(){var t=c.pool?c.pool.obtain("canvas"):s.createElement("canvas");t.toDataURL!==r?e.resolve():e.reject(),t.dispose&&t.dispose()},function(){e.reject()})})}); \ No newline at end of file diff --git a/dist/latest/min/support/element/canvas/todataurl/jpeg.js b/dist/latest/min/support/element/canvas/todataurl/jpeg.js index f75d0f37..60755f8f 100644 --- a/dist/latest/min/support/element/canvas/todataurl/jpeg.js +++ b/dist/latest/min/support/element/canvas/todataurl/jpeg.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("support/element/canvas/todataurl/jpeg",e,["../../../../support","../todataurl"])}(function(e,t,a,o,n,r,s){"use strict";var p=e.support;return p.addTest("/element/canvas/todataurl/jpeg",function(t){e["support/element/canvas/todataurl"]().then(function(){var e=p.pool?p.pool.obtain("canvas"):r.createElement("canvas");0===e.toDataURL("image/jpeg").indexOf("data:image/jpeg")?t.resolve():t.reject(),e.dispose&&e.dispose()},function(){t.reject()})})}); \ No newline at end of file diff --git a/dist/latest/min/support/element/canvas/todataurl/png.js b/dist/latest/min/support/element/canvas/todataurl/png.js index 60c15043..8dc5f20e 100644 --- a/dist/latest/min/support/element/canvas/todataurl/png.js +++ b/dist/latest/min/support/element/canvas/todataurl/png.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){window.qoopido.register("support/element/canvas/todataurl/png",t,["../../../../support","../todataurl"])}(function(t,e,a,n,o,r,s){"use strict";var p=t.support;return p.addTest("/element/canvas/todataurl/png",function(e){t["support/element/canvas/todataurl"]().then(function(){var t=p.pool?p.pool.obtain("canvas"):r.createElement("canvas");0===t.toDataURL("image/png").indexOf("data:image/png")?e.resolve():e.reject(),t.dispose&&t.dispose()},function(){e.reject()})})}); \ No newline at end of file diff --git a/dist/latest/min/support/element/canvas/todataurl/webp.js b/dist/latest/min/support/element/canvas/todataurl/webp.js index a66de6f2..8e2a952a 100644 --- a/dist/latest/min/support/element/canvas/todataurl/webp.js +++ b/dist/latest/min/support/element/canvas/todataurl/webp.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("support/element/canvas/todataurl/webp",e,["../../../../support","../todataurl"])}(function(e,t,a,o,n,r,s){"use strict";var p=e.support;return p.addTest("/element/canvas/todataurl/webp",function(t){e["support/element/canvas/todataurl"]().then(function(){var e=p.pool?p.pool.obtain("canvas"):r.createElement("canvas");0===e.toDataURL("image/webp").indexOf("data:image/webp")?t.resolve():t.reject(),e.dispose&&e.dispose()},function(){t.reject()})})}); \ No newline at end of file diff --git a/dist/latest/min/support/element/svg.js b/dist/latest/min/support/element/svg.js index 38811353..6e6aebe1 100644 --- a/dist/latest/min/support/element/svg.js +++ b/dist/latest/min/support/element/svg.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("support/element/svg",e,["../../support"])}(function(e,t,r,n,o,s,c){"use strict";return e.support.addTest("/element/svg",function(e){s.createElementNS&&s.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect?e.resolve():e.reject()})}); \ No newline at end of file diff --git a/dist/latest/min/support/element/video.js b/dist/latest/min/support/element/video.js index 1a329b59..363714b8 100644 --- a/dist/latest/min/support/element/video.js +++ b/dist/latest/min/support/element/video.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("support/element/video",e,["../../support"])}(function(e,o,t,i,n,r,p){"use strict";var s=e.support;return s.addTest("/element/video",function(e){var o=s.pool?s.pool.obtain("video"):r.createElement("video");o.canPlayType?e.resolve():e.reject(),o.dispose&&o.dispose()})}); \ No newline at end of file diff --git a/dist/latest/min/support/element/video/mp4.js b/dist/latest/min/support/element/video/mp4.js index 38b6c7ed..60518fb4 100644 --- a/dist/latest/min/support/element/video/mp4.js +++ b/dist/latest/min/support/element/video/mp4.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("support/element/video/mp4",e,["../../../support","../video"])}(function(e,o,t,i,n,p,r){"use strict";var d=e.support;return d.addTest("/element/video/mp4",function(o){e["support/element/video"]().then(function(){var e=d.pool?d.pool.obtain("video"):p.createElement("video");e.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"')?o.resolve():o.reject(),e.dispose&&e.dispose()},function(){o.reject()})})}); \ No newline at end of file diff --git a/dist/latest/min/support/element/video/ogg.js b/dist/latest/min/support/element/video/ogg.js index f39d86f9..b17e5758 100644 --- a/dist/latest/min/support/element/video/ogg.js +++ b/dist/latest/min/support/element/video/ogg.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("support/element/video/ogg",e,["../../../support","../video"])}(function(e,o,t,i,n,r,s){"use strict";var d=e.support;return d.addTest("/element/video/ogg",function(o){e["support/element/video"]().then(function(){var e=d.pool?d.pool.obtain("video"):r.createElement("video");e.canPlayType('video/ogg; codecs="theora, vorbis"')?o.resolve():o.reject(),e.dispose&&e.dispose()},function(){o.reject()})})}); \ No newline at end of file diff --git a/dist/latest/min/support/element/video/webm.js b/dist/latest/min/support/element/video/webm.js index b2da8cc1..c3d5943d 100644 --- a/dist/latest/min/support/element/video/webm.js +++ b/dist/latest/min/support/element/video/webm.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("support/element/video/webm",e,["../../../support","../video"])}(function(e,o,t,i,n,r,p){"use strict";var s=e.support;return s.addTest("/element/video/webm",function(o){e["support/element/video"]().then(function(){var e=s.pool?s.pool.obtain("video"):r.createElement("video");e.canPlayType('video/webm; codecs="vp8, vorbis"')?o.resolve():o.reject(),e.dispose&&e.dispose()},function(){o.reject()})})}); \ No newline at end of file diff --git a/dist/latest/min/transport.js b/dist/latest/min/transport.js index d78c17a7..c24b7049 100644 --- a/dist/latest/min/transport.js +++ b/dist/latest/min/transport.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(n){window.qoopido.register("transport",n,["./base","./function/merge"])}(function(n,e,t,o,i,r,s){"use strict";var c;return c=n.base.extend({setup:function(e){var t=this;return t._settings=n["function/merge"]({},t._settings,e),t},serialize:function(n,e){var t,o,i,r=[];for(t in n)o=e?"".concat(e,"[",t,"]"):t,i=n[t],r.push("object"==typeof i?this.serialize(i,o):"".concat(encodeURIComponent(o),"=",encodeURIComponent(i)));return r.join("&")}})},window,document); \ No newline at end of file diff --git a/dist/latest/min/transport/jsonp.js b/dist/latest/min/transport/jsonp.js index 2ee326a9..78ad045b 100644 --- a/dist/latest/min/transport/jsonp.js +++ b/dist/latest/min/transport/jsonp.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){window.qoopido.registerSingleton("transport/jsonp",t,["../transport","../function/merge","../function/unique/uuid","../url","../dom/element","../promise/defer"])}(function(t,e,i,n,o,c,r){"use strict";function s(t,e){var i=this,n=i.dfd,c=i.script,r=i.settings;e="object"==typeof e?i.serialize(e):e,t="".concat(t,t.indexOf("?")>-1?"&":"?","".concat(r.callback,"=",i.id)),t=r.cache===!1?"".concat(t,t.indexOf("?")>-1?"&":"?","".concat("_=",(new Date).getTime().toString())):t,t=e?"".concat(t,t.indexOf("?")>-1?"&":"?",e):t,o[i.id]=function(t){try{delete o[i.id]}catch(e){o[i.id]=null}u.call(i),n.resolve(t)},c.on("load readystatechange",function(t){a.call(i,t)}).one("error",function(){l.call(i)}).setAttribute("src",t),g.appendChild(c.element),i.timeout=setTimeout(function(){d.call(i)},r.timeout)}function a(t){var e=this,i=e.dfd;t.readyState&&"loaded"!==t.readyState&&"complete"!==t.readyState||e.script.off()&&e.script.element.dispose&&e.script.element.dispose(),e.timeout&&clearTimeout(e.timeout),e.timeout=setTimeout(function(){d.call(e)},e.settings.timeout),i.notify(t)}function l(){var t=this;u.call(t),t.dfd.reject()}function d(){var t=this;u.call(t),t.dfd.reject(!1)}function u(){var t=this;t.timeout&&clearTimeout(t.timeout),t.script.off()&&t.script.element.dispose&&t.script.element.dispose()}var m,f=t["promise/defer"],p=e.pool&&e.pool.dom,g=c.getElementsByTagName("head")[0];return m=t.transport.extend({_settings:{callback:"callback",cache:!1,timeout:5e3},load:function(e,i,n){var o={};return e=t.url.resolve(e),o.id="".concat("jsonp-",t["function/unique/string"]()),o.dfd=new f,o.script=t["dom/element"].create(p?p.obtain("script"):c.createElement("script")),o.settings=t["function/merge"]({},this._settings,n),o.timeout=null,o.script.setAttribute("async",!0),s.call(o,e,i),o.dfd.promise}})},window,document); \ No newline at end of file diff --git a/dist/latest/min/transport/xhr.js b/dist/latest/min/transport/xhr.js index 33e68442..b57e168a 100644 --- a/dist/latest/min/transport/xhr.js +++ b/dist/latest/min/transport/xhr.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){window.qoopido.registerSingleton("transport/xhr",t,["../transport","../function/merge","../function/unique/string","../url","../promise/defer"])}(function(t,e,n,r,o,i,u){"use strict";function s(t,e,n){var r,o=this,i=o.xhr,u=o.settings;e=u.cache===!1?"".concat(e,e.indexOf("?")>-1?"&":"?","_="+(new Date).getTime()):e,e=n&&"GET"===t?"".concat(e,e.indexOf("?")>-1?"&":"?",n):e;for(r in u.xhrOptions)i[r]=u.xhrOptions[r];if(i.open(t,e,u.async,u.username,u.password),i.setRequestHeader){i.setRequestHeader("Accept",u.accept),n&&"GET"!==t&&i.setRequestHeader("Content-Type",u.contentType);for(r in u.header)i.setRequestHeader(r,u.header[r])}i.timeout=u.timeout,i.onprogress=function(t){a.call(o,t)},i.onreadystatechange=i.onload=function(){c.call(o)},i.onerror=function(){l.call(o)},i.send(n||null),o.timeout=setTimeout(function(){d.call(o)},u.timeout)}function a(t){var e=this;e.timeout&&clearTimeout(e.timeout),e.timeout=setTimeout(function(){d.call(e)},e.settings.timeout)}function c(){var t=this,e=t.xhr,n=t.dfd;(e.readyState===u||4===e.readyState)&&(f.call(t),e.status===u||200===e.status?n.resolve({data:e.responseText,xhr:e}):n.reject({status:e.status,xhr:e}))}function l(){var t=this;f.call(t),t.dfd.reject()}function d(){var t=this;t.xhr.abort(),f.call(t),t.dfd.reject()}function f(){var t=this,e=t.xhr;t.timeout&&clearTimeout(t.timeout),e.onprogress=e.onreadystatechange=e.onerror=null}var h,p=t["promise/defer"],m="undefined"!=typeof o.XMLHttpRequest?function(e){return t.url.isLocal(e)?new o.XMLHttpRequest:o.XDomainRequest?new o.XDomainRequest:new o.XMLHttpRequest}:function(){try{return new ActiveXObject("MSXML2.XMLHTTP.3.0")}catch(t){return null}};return h=t.transport.extend({_settings:{accept:"*/*",timeout:5e3,async:!0,cache:!1,header:{},username:null,password:null,contentType:"application/x-www-form-urlencoded; charset=UTF-8 ",xhrOptions:{}},load:function(e,n,r,o){var i={};return n=t.url.resolve(n),i.url=n,i.id="".concat("xhr-",t["function/unique/string"]()),i.dfd=new p,i.xhr=m(n),i.settings=t["function/merge"]({},this._settings,o),i.timeout=null,s.call(i,e.toUpperCase(),n,r),i.dfd.promise},get:function(t,e,n){return this.load("GET",t,e,n)},post:function(t,e,n){return this.load("POST",t,e,n)},put:function(t,e,n){return this.load("PUT",t,e,n)},"delete":function(t,e,n){return this.load("DELETE",t,e,n)},head:function(t,e,n){return this.load("HEAD",t,e,n)}})},window,document); \ No newline at end of file diff --git a/dist/latest/min/url.js b/dist/latest/min/url.js index 4e6e0b92..bd8dc061 100644 --- a/dist/latest/min/url.js +++ b/dist/latest/min/url.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.registerSingleton("url",e,["./base"])}(function(e,t,n,o,r,c,i){"use strict";function a(e){var t=c.createElement("a");return t.href=e||"",t}var s,u,f=new RegExp("[?&]?([^=]+)=([^&]*)","g");try{s=location}catch(l){s=a()}return u=new RegExp("".concat("^",s.protocol,"//",s.hostname),"i"),e.base.extend({resolve:function(e){return a(e).href},redirect:function(e,t){t=t||r,t.location.href=this.resolve(e)},getParameter:function(e){for(var t,n={},o=a(e).search.split("+").join(" ");t=f.exec(o);)n[decodeURIComponent(t[1])]=decodeURIComponent(t[2]);return n},isLocal:function(e){return u.test(this.resolve(e))}})}); \ No newline at end of file diff --git a/dist/latest/min/vector/2d.js b/dist/latest/min/vector/2d.js index e5397211..c336172c 100644 --- a/dist/latest/min/vector/2d.js +++ b/dist/latest/min/vector/2d.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(t){window.qoopido.register("vector/2d",t,["../base"])}(function(t,i,s,h,e,n,o){"use strict";var y,r=180/Math.PI,u=Math.PI/180,c=i.pool&&i.pool.object;return y=t.base.extend({_temp:null,x:null,y:null,_constructor:function(t,i){return this._temp=c?c.obtain():{},this._temp.x=0,this._temp.y=0,this.x=t||0,this.y=i||0,this},_obtain:function(t,i){this.x=t||0,this.y=i||0},_destroy:function(){this._temp=this._temp.dispose&&this._temp.dispose()},getAngle:function(t){return t?Math.atan2(this.y,this.x):Math.atan2(this.y,this.x)*r%360},getLength:function(t){return t?this.x*this.x+this.y*this.y:Math.sqrt(this.x*this.x+this.y*this.y)},rotate:function(t,i){var s=Math.cos(t*(i?1:u)),h=Math.sin(t*(i?1:u));return this._temp.x=this.x,this._temp.y=this.y,this.x=this._temp.x*s-this._temp.y*h,this.y=this._temp.x*h+this._temp.y*s,this},invert:function(){return this.x=-this.x,this.y=-this.y,this},add:function(t){return this.x+="object"==typeof t?t.x:t,this.y+="object"==typeof t?t.y:t,this},subtract:function(t){return this.x-="object"==typeof t?t.x:t,this.y-="object"==typeof t?t.y:t,this},multiply:function(t){return this.x*="object"==typeof t?t.x:t,this.y*="object"==typeof t?t.y:t,this},divide:function(t){return this.x/="object"==typeof t?t.x:t,this.y/="object"==typeof t?t.y:t,this}})}); \ No newline at end of file diff --git a/dist/latest/min/widget/image/adapt.js b/dist/latest/min/widget/image/adapt.js index bf78a79b..3def360e 100644 --- a/dist/latest/min/widget/image/adapt.js +++ b/dist/latest/min/widget/image/adapt.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("widget/image/adapt",e,["../../dom/element","../../dom/element/emerge","../../component/sense"])}(function(e,t,i,n,a,o,r){"use strict";function l(e){var t=this;return t._container.setStyle("paddingBottom",100*e+"%"),t}function c(e,t){var i=this;e.mql=h.create(t).on("matched dematched",function(){d.call(i)})}function d(){for(var e,t,i,n,o,c,d=this,s=0;(e=d._candidates[s])!==r;s++)if(!e.mql||e.mql.matches&&e.mql.matches()===!0){l.call(d,e.ratio),d._visible===!0&&(t=d._image||(d._image=A.create("",{src:"data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",alt:d._caption},{position:"absolute",display:"block",width:"100%",height:"100%",top:"0",left:"0",margin:"0",padding:"0"}).appendTo(d._container)),i=t.element.getBoundingClientRect(),n=Math.round(i.width),o=Math.round(i.width*e.ratio),c=e.url.replace(g,"$1."+n+"x"+o+"@"+(a.devicePixelRatio||1)+".$2"),t.setAttribute("src",c));break}}function s(){for(var e,t=0;(e=_[t])!==r;t++)d.call(e)}function m(){a.clearTimeout(p),p=a.setTimeout(s,200)}var u,p,g=new RegExp("(.+?).(jpg|jpeg|png|gif|webp)$"),A=e["dom/element"],h=e["component/sense"],_=[];return u=e["dom/element/emerge"].extend({_visible:!1,_candidates:null,_container:null,_image:null,_caption:null,_constructor:function(e,t){var i,n,a,o,s=u._parent._constructor.call(this,e,t),m=0;for(i=parseFloat(s.getAttribute("data-ratio")||1),n=s.find('[itemprop="source"],[itemprop="contentUrl"]'),s._candidates=[],s._container=A.create("
").setStyles({position:"relative",display:"block",width:"100%",height:0,padding:0}).appendTo(s),s._caption=(o=s.find('[itemprop="caption"]')[0])?o.getAttribute("content"):null,l.call(s,i);(a=n[m])!==r;m++){var p=parseFloat(a.getAttribute("data-ratio")||i),g=a.getAttribute("data-media")||null;s._candidates.push({ratio:p,url:a.getAttribute("content"),mql:g}),g&&c.call(s,s._candidates[s._candidates.length-1],g)}return s.on("emerged demerged",function(e){s._visible="emerged"===e.type?!0:!1,d.call(s)}),_.push(s),s}}),A.create(a).on("resize orientationchange",m),u}); \ No newline at end of file diff --git a/dist/latest/min/worker.js b/dist/latest/min/worker.js index 8f641de3..291bfe4f 100644 --- a/dist/latest/min/worker.js +++ b/dist/latest/min/worker.js @@ -1,2 +1,2 @@ -/*! Qoopido.js library 3.7.2, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ +/*! Qoopido.js library 3.7.3, 2015-08-05 | https://github.com/dlueth/qoopido.js | (c) 2015 Dirk Lueth */ !function(e){window.qoopido.register("worker",e,["./base","./support","./promise/defer"])}(function(e,t,s,n,r,o,p){"use strict";var u=e["promise/defer"],i=new RegExp("Blob$","i"),a=e.support.supportsMethod("Worker"),c=e.support.supportsMethod("URL")?r[e.support.getMethod("URL")]:null,l=e.support.getMethod("Blob")||e.support.getMethod("BlobBuilder"),f="var self = this, regex = new RegExp(',\\s+', 'g'); self.addEventListener('message', function(pEvent) { self.postMessage({ type: 'result', result: self.process(pEvent.data.func).apply(null, pEvent.data.args)}); }, false); self.postProgress = function(pProgress) { self.postMessage({ type: 'progress', progress: pProgress}); }; self.process = function(pFunction) { var functionArguments = pFunction.substring(pFunction.indexOf('(') + 1, pFunction.indexOf(')')).replace(regex, ',').split(','); functionArguments.push(pFunction.substring(pFunction.indexOf('{') + 1, pFunction.lastIndexOf('}'))); return Function.apply(null, functionArguments); };",g=null;return a&&c&&l&&(g=c.createObjectURL(i.test(l)===!0?new r[l]([f],{type:"text/javascript"}):(new r[l]).append(f).getBlob("text/javascript"))),e.base.extend({execute:function(e,t){var s=new u;if(t=t||[],g){var n=new Worker(g);n.addEventListener("message",function(e){switch(e.data.type){case"result":s.resolve(e.data.result)}},!1),n.addEventListener("error",function(e){s.reject(e)},!1),n.postMessage({func:e.toString(),args:t})}else setTimeout(function(){try{s.resolve(e.apply(null,t))}catch(n){s.reject()}},0);return s.promise}})}); \ No newline at end of file diff --git a/package.json b/package.json index 385e9201..f3beac43 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "qoopido.js", "title": "Qoopido.js library", "description": "Modular library of dry, extendable and AMD compatible JavaScript modules", - "version": "3.7.2", + "version": "3.7.3", "homepage": "https://github.com/dlueth/qoopido.js", "author": { "name": "Dirk Lueth",