Remove unused vendor assets
This commit is contained in:
parent
f81cd0d528
commit
80287dcfce
|
@ -1,279 +0,0 @@
|
|||
/*
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2013 Louis Acresti
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
(function (global) {
|
||||
'use strict';
|
||||
|
||||
var cheet,
|
||||
sequences = {},
|
||||
keys = {
|
||||
backspace: 8,
|
||||
tab: 9,
|
||||
enter: 13,
|
||||
'return': 13,
|
||||
shift: 16,
|
||||
'⇧': 16,
|
||||
control: 17,
|
||||
ctrl: 17,
|
||||
'⌃': 17,
|
||||
alt: 18,
|
||||
option: 18,
|
||||
'⌥': 18,
|
||||
pause: 19,
|
||||
capslock: 20,
|
||||
esc: 27,
|
||||
space: 32,
|
||||
pageup: 33,
|
||||
pagedown: 34,
|
||||
end: 35,
|
||||
home: 36,
|
||||
left: 37,
|
||||
L: 37,
|
||||
'←': 37,
|
||||
up: 38,
|
||||
U: 38,
|
||||
'↑': 38,
|
||||
right: 39,
|
||||
R: 39,
|
||||
'→': 39,
|
||||
down: 40,
|
||||
D: 40,
|
||||
'↓': 40,
|
||||
insert: 45,
|
||||
'delete': 46,
|
||||
'0': 48,
|
||||
'1': 49,
|
||||
'2': 50,
|
||||
'3': 51,
|
||||
'4': 52,
|
||||
'5': 53,
|
||||
'6': 54,
|
||||
'7': 55,
|
||||
'8': 56,
|
||||
'9': 57,
|
||||
a: 65,
|
||||
b: 66,
|
||||
c: 67,
|
||||
d: 68,
|
||||
e: 69,
|
||||
f: 70,
|
||||
g: 71,
|
||||
h: 72,
|
||||
i: 73,
|
||||
j: 74,
|
||||
k: 75,
|
||||
l: 76,
|
||||
m: 77,
|
||||
n: 78,
|
||||
o: 79,
|
||||
p: 80,
|
||||
q: 81,
|
||||
r: 82,
|
||||
s: 83,
|
||||
t: 84,
|
||||
u: 85,
|
||||
v: 86,
|
||||
w: 87,
|
||||
x: 88,
|
||||
y: 89,
|
||||
z: 90,
|
||||
'⌘': 91,
|
||||
command: 91,
|
||||
kp_0: 96,
|
||||
kp_1: 97,
|
||||
kp_2: 98,
|
||||
kp_3: 99,
|
||||
kp_4: 100,
|
||||
kp_5: 101,
|
||||
kp_6: 102,
|
||||
kp_7: 103,
|
||||
kp_8: 104,
|
||||
kp_9: 105,
|
||||
kp_multiply: 106,
|
||||
kp_plus: 107,
|
||||
kp_minus: 109,
|
||||
kp_decimal: 110,
|
||||
kp_divide: 111,
|
||||
f1: 112,
|
||||
f2: 113,
|
||||
f3: 114,
|
||||
f4: 115,
|
||||
f5: 116,
|
||||
f6: 117,
|
||||
f7: 118,
|
||||
f8: 119,
|
||||
f9: 120,
|
||||
f10: 121,
|
||||
f11: 122,
|
||||
f12: 123,
|
||||
equal: 187,
|
||||
'=': 187,
|
||||
comma: 188,
|
||||
',': 188,
|
||||
minus: 189,
|
||||
'-': 189,
|
||||
period: 190,
|
||||
'.': 190
|
||||
},
|
||||
Sequence,
|
||||
NOOP = function NOOP() {},
|
||||
held = {};
|
||||
|
||||
Sequence = function Sequence (str, next, fail, done) {
|
||||
var i;
|
||||
|
||||
this.str = str;
|
||||
this.next = next ? next : NOOP;
|
||||
this.fail = fail ? fail : NOOP;
|
||||
this.done = done ? done : NOOP;
|
||||
|
||||
this.seq = str.split(' ');
|
||||
this.keys = [];
|
||||
|
||||
for (i=0; i<this.seq.length; ++i) {
|
||||
this.keys.push(keys[this.seq[i]]);
|
||||
}
|
||||
|
||||
this.idx = 0;
|
||||
};
|
||||
|
||||
Sequence.prototype.keydown = function keydown (keyCode) {
|
||||
var i = this.idx;
|
||||
if (keyCode !== this.keys[i]) {
|
||||
if (i > 0) {
|
||||
this.reset();
|
||||
this.fail(this.str);
|
||||
cheet.__fail(this.str);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
this.next(this.str, this.seq[i], i, this.seq);
|
||||
cheet.__next(this.str, this.seq[i], i, this.seq);
|
||||
|
||||
if (++this.idx === this.keys.length) {
|
||||
this.done(this.str);
|
||||
cheet.__done(this.str);
|
||||
this.reset();
|
||||
}
|
||||
};
|
||||
|
||||
Sequence.prototype.reset = function () {
|
||||
this.idx = 0;
|
||||
};
|
||||
|
||||
cheet = function cheet (str, handlers) {
|
||||
var next, fail, done;
|
||||
|
||||
if (typeof handlers === 'function') {
|
||||
done = handlers;
|
||||
} else if (handlers !== null && handlers !== undefined) {
|
||||
next = handlers.next;
|
||||
fail = handlers.fail;
|
||||
done = handlers.done;
|
||||
}
|
||||
|
||||
sequences[str] = new Sequence(str, next, fail, done);
|
||||
};
|
||||
|
||||
cheet.disable = function disable (str) {
|
||||
delete sequences[str];
|
||||
};
|
||||
|
||||
function keydown (e) {
|
||||
var id,
|
||||
k = e ? e.keyCode : event.keyCode;
|
||||
|
||||
if (held[k]) return;
|
||||
held[k] = true;
|
||||
|
||||
for (id in sequences) {
|
||||
sequences[id].keydown(k);
|
||||
}
|
||||
}
|
||||
|
||||
function keyup (e) {
|
||||
var k = e ? e.keyCode : event.keyCode;
|
||||
held[k] = false;
|
||||
}
|
||||
|
||||
function resetHeldKeys (e) {
|
||||
var k;
|
||||
for (k in held) {
|
||||
held[k] = false;
|
||||
}
|
||||
}
|
||||
|
||||
function on (obj, type, fn) {
|
||||
if (obj.addEventListener) {
|
||||
obj.addEventListener(type, fn, false);
|
||||
} else if (obj.attachEvent) {
|
||||
obj['e' + type + fn] = fn;
|
||||
obj[type + fn] = function () {
|
||||
obj['e' + type + fn](window.event);
|
||||
};
|
||||
obj.attachEvent('on' + type, obj[type + fn]);
|
||||
}
|
||||
}
|
||||
|
||||
on(window, 'keydown', keydown);
|
||||
on(window, 'keyup', keyup);
|
||||
on(window, 'blur', resetHeldKeys);
|
||||
on(window, 'focus', resetHeldKeys);
|
||||
|
||||
cheet.__next = NOOP;
|
||||
cheet.next = function next (fn) {
|
||||
cheet.__next = fn === null ? NOOP : fn;
|
||||
};
|
||||
|
||||
cheet.__fail = NOOP;
|
||||
cheet.fail = function fail (fn) {
|
||||
cheet.__fail = fn === null ? NOOP : fn;
|
||||
};
|
||||
|
||||
cheet.__done = NOOP;
|
||||
cheet.done = function done (fn) {
|
||||
cheet.__done = fn === null ? NOOP : fn;
|
||||
};
|
||||
|
||||
cheet.reset = function reset (id) {
|
||||
var seq = sequences[id];
|
||||
if (!(seq instanceof Sequence)) {
|
||||
console.warn('cheet: Unknown sequence: ' + id);
|
||||
return;
|
||||
}
|
||||
|
||||
seq.reset();
|
||||
};
|
||||
|
||||
global.cheet = cheet;
|
||||
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define([], function () { return cheet; });
|
||||
} else if (typeof module !== 'undefined' && module !== null) {
|
||||
module.exports = cheet;
|
||||
}
|
||||
|
||||
})(this);
|
|
@ -1,417 +0,0 @@
|
|||
// Generated by CoffeeScript 1.8.0
|
||||
|
||||
/*
|
||||
* jQuery Guillotine Plugin v1.3.0
|
||||
* http://matiasgagliano.github.com/guillotine/
|
||||
*
|
||||
* Copyright 2014, Matías Gagliano.
|
||||
* Dual licensed under the MIT or GPLv3 licenses.
|
||||
* http://opensource.org/licenses/MIT
|
||||
* http://opensource.org/licenses/GPL-3.0
|
||||
*
|
||||
*/
|
||||
|
||||
(function() {
|
||||
"use strict";
|
||||
var $, Guillotine, canTransform, defaults, events, getPointerPosition, hardwareAccelerate, isTouch, pluginName, scope, touchRegExp, validEvent, whitelist,
|
||||
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
|
||||
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
|
||||
|
||||
$ = jQuery;
|
||||
|
||||
pluginName = 'guillotine';
|
||||
|
||||
scope = 'guillotine';
|
||||
|
||||
events = {
|
||||
start: "touchstart." + scope + " mousedown." + scope + " pointerdown." + scope,
|
||||
move: "touchmove." + scope + " mousemove." + scope + " pointermove." + scope,
|
||||
stop: "touchend." + scope + " mouseup." + scope + " pointerup." + scope
|
||||
};
|
||||
|
||||
defaults = {
|
||||
width: 400,
|
||||
height: 300,
|
||||
zoomStep: 0.1,
|
||||
init: null,
|
||||
eventOnChange: null,
|
||||
onChange: null
|
||||
};
|
||||
|
||||
touchRegExp = /touch/i;
|
||||
|
||||
isTouch = function(e) {
|
||||
return touchRegExp.test(e.type);
|
||||
};
|
||||
|
||||
validEvent = function(e) {
|
||||
if (isTouch(e)) {
|
||||
return e.originalEvent.changedTouches.length === 1;
|
||||
} else {
|
||||
return e.which === 1;
|
||||
}
|
||||
};
|
||||
|
||||
getPointerPosition = function(e) {
|
||||
if (isTouch(e)) {
|
||||
e = e.originalEvent.touches[0];
|
||||
}
|
||||
return {
|
||||
x: e.pageX,
|
||||
y: e.pageY
|
||||
};
|
||||
};
|
||||
|
||||
canTransform = function() {
|
||||
var hasTransform, helper, prefix, prefixes, prop, test, tests, value, _i, _len;
|
||||
hasTransform = false;
|
||||
prefixes = 'webkit,Moz,O,ms,Khtml'.split(',');
|
||||
tests = {
|
||||
transform: 'transform'
|
||||
};
|
||||
for (_i = 0, _len = prefixes.length; _i < _len; _i++) {
|
||||
prefix = prefixes[_i];
|
||||
tests[prefix + 'Transform'] = "-" + (prefix.toLowerCase()) + "-transform";
|
||||
}
|
||||
helper = document.createElement('img');
|
||||
document.body.insertBefore(helper, null);
|
||||
for (test in tests) {
|
||||
prop = tests[test];
|
||||
if (helper.style[test] === void 0) {
|
||||
continue;
|
||||
}
|
||||
helper.style[test] = 'rotate(90deg)';
|
||||
value = window.getComputedStyle(helper).getPropertyValue(prop);
|
||||
if ((value != null) && value.length && value !== 'none') {
|
||||
hasTransform = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
document.body.removeChild(helper);
|
||||
canTransform = hasTransform ? (function() {
|
||||
return true;
|
||||
}) : (function() {
|
||||
return false;
|
||||
});
|
||||
return canTransform();
|
||||
};
|
||||
|
||||
hardwareAccelerate = function(el) {
|
||||
return $(el).css({
|
||||
'-webkit-perspective': 1000,
|
||||
'perspective': 1000,
|
||||
'-webkit-backface-visibility': 'hidden',
|
||||
'backface-visibility': 'hidden'
|
||||
});
|
||||
};
|
||||
|
||||
Guillotine = (function() {
|
||||
function Guillotine(element, options) {
|
||||
this._drag = __bind(this._drag, this);
|
||||
this._unbind = __bind(this._unbind, this);
|
||||
this._start = __bind(this._start, this);
|
||||
var _ref;
|
||||
this.op = $.extend(true, {}, defaults, options, $(element).data(pluginName));
|
||||
this.enabled = true;
|
||||
this.zoomInFactor = 1 + this.op.zoomStep;
|
||||
this.zoomOutFactor = 1 / this.zoomInFactor;
|
||||
_ref = [0, 0, 0, 0, 0], this.width = _ref[0], this.height = _ref[1], this.left = _ref[2], this.top = _ref[3], this.angle = _ref[4];
|
||||
this.data = {
|
||||
scale: 1,
|
||||
angle: 0,
|
||||
x: 0,
|
||||
y: 0,
|
||||
w: this.op.width,
|
||||
h: this.op.height
|
||||
};
|
||||
this._wrap(element);
|
||||
if (this.op.init != null) {
|
||||
this._init();
|
||||
}
|
||||
if (this.width < 1 || this.height < 1) {
|
||||
this._fit() && this._center();
|
||||
}
|
||||
hardwareAccelerate(this.$el);
|
||||
this.$el.on(events.start, this._start);
|
||||
}
|
||||
|
||||
Guillotine.prototype._wrap = function(element) {
|
||||
var canvas, el, guillotine, height, img, paddingTop, width, _ref, _ref1, _ref2;
|
||||
el = $(element);
|
||||
if (el.prop('tagName') === 'IMG') {
|
||||
img = document.createElement('img');
|
||||
img.src = el.attr('src');
|
||||
_ref = [img.width, img.height], width = _ref[0], height = _ref[1];
|
||||
} else {
|
||||
_ref1 = [el.width(), el.height()], width = _ref1[0], height = _ref1[1];
|
||||
}
|
||||
_ref2 = [width / this.op.width, height / this.op.height], this.width = _ref2[0], this.height = _ref2[1];
|
||||
canvas = $('<div>').addClass('guillotine-canvas');
|
||||
canvas.css({
|
||||
width: this.width * 100 + '%',
|
||||
height: this.height * 100 + '%',
|
||||
top: 0,
|
||||
left: 0
|
||||
});
|
||||
canvas = el.wrap(canvas).parent();
|
||||
paddingTop = this.op.height / this.op.width * 100 + '%';
|
||||
guillotine = $('<div>').addClass('guillotine-window');
|
||||
guillotine.css({
|
||||
width: '100%',
|
||||
height: 'auto',
|
||||
'padding-top': paddingTop
|
||||
});
|
||||
guillotine = canvas.wrap(guillotine).parent();
|
||||
this.$el = el;
|
||||
this.el = el[0];
|
||||
this.$canvas = canvas;
|
||||
this.canvas = canvas[0];
|
||||
this.$gllt = guillotine;
|
||||
this.gllt = guillotine[0];
|
||||
return this.$document = $(element.ownerDocument);
|
||||
};
|
||||
|
||||
Guillotine.prototype._unwrap = function() {
|
||||
this.$el.removeAttr('style');
|
||||
this.$el.insertBefore(this.gllt);
|
||||
return this.$gllt.remove();
|
||||
};
|
||||
|
||||
Guillotine.prototype._init = function() {
|
||||
var angle, o, scale;
|
||||
o = this.op.init;
|
||||
if ((scale = parseFloat(o.scale))) {
|
||||
this._zoom(scale);
|
||||
}
|
||||
if ((angle = parseInt(o.angle))) {
|
||||
this._rotate(angle);
|
||||
}
|
||||
return this._offset(parseInt(o.x) / this.op.width || 0, parseInt(o.y) / this.op.height || 0);
|
||||
};
|
||||
|
||||
Guillotine.prototype._start = function(e) {
|
||||
if (!(this.enabled && validEvent(e))) {
|
||||
return;
|
||||
}
|
||||
e.preventDefault();
|
||||
e.stopImmediatePropagation();
|
||||
this.p = getPointerPosition(e);
|
||||
return this._bind();
|
||||
};
|
||||
|
||||
Guillotine.prototype._bind = function() {
|
||||
this.$document.on(events.move, this._drag);
|
||||
return this.$document.on(events.stop, this._unbind);
|
||||
};
|
||||
|
||||
Guillotine.prototype._unbind = function(e) {
|
||||
this.$document.off(events.move, this._drag);
|
||||
this.$document.off(events.stop, this._unbind);
|
||||
if (e != null) {
|
||||
return this._trigger('drag');
|
||||
}
|
||||
};
|
||||
|
||||
Guillotine.prototype._trigger = function(action) {
|
||||
if (this.op.eventOnChange != null) {
|
||||
this.$el.trigger(this.op.eventOnChange, [this.data, action]);
|
||||
}
|
||||
if (typeof this.op.onChange === 'function') {
|
||||
return this.op.onChange.call(this.el, this.data, action);
|
||||
}
|
||||
};
|
||||
|
||||
Guillotine.prototype._drag = function(e) {
|
||||
var dx, dy, left, p, top;
|
||||
e.preventDefault();
|
||||
e.stopImmediatePropagation();
|
||||
p = getPointerPosition(e);
|
||||
dx = p.x - this.p.x;
|
||||
dy = p.y - this.p.y;
|
||||
this.p = p;
|
||||
left = dx === 0 ? null : this.left - dx / this.gllt.clientWidth;
|
||||
top = dy === 0 ? null : this.top - dy / this.gllt.clientHeight;
|
||||
return this._offset(left, top);
|
||||
};
|
||||
|
||||
Guillotine.prototype._offset = function(left, top) {
|
||||
if (left || left === 0) {
|
||||
if (left < 0) {
|
||||
left = 0;
|
||||
}
|
||||
if (left > this.width - 1) {
|
||||
left = this.width - 1;
|
||||
}
|
||||
this.canvas.style.left = (-left * 100).toFixed(2) + '%';
|
||||
this.left = left;
|
||||
this.data.x = Math.round(left * this.op.width);
|
||||
}
|
||||
if (top || top === 0) {
|
||||
if (top < 0) {
|
||||
top = 0;
|
||||
}
|
||||
if (top > this.height - 1) {
|
||||
top = this.height - 1;
|
||||
}
|
||||
this.canvas.style.top = (-top * 100).toFixed(2) + '%';
|
||||
this.top = top;
|
||||
return this.data.y = Math.round(top * this.op.height);
|
||||
}
|
||||
};
|
||||
|
||||
Guillotine.prototype._zoom = function(factor) {
|
||||
var h, left, top, w, _ref;
|
||||
if (factor <= 0 || factor === 1) {
|
||||
return;
|
||||
}
|
||||
_ref = [this.width, this.height], w = _ref[0], h = _ref[1];
|
||||
if (w * factor > 1 && h * factor > 1) {
|
||||
this.width *= factor;
|
||||
this.height *= factor;
|
||||
this.canvas.style.width = (this.width * 100).toFixed(2) + '%';
|
||||
this.canvas.style.height = (this.height * 100).toFixed(2) + '%';
|
||||
this.data.scale *= factor;
|
||||
} else {
|
||||
this._fit();
|
||||
factor = this.width / w;
|
||||
}
|
||||
left = (this.left + 0.5) * factor - 0.5;
|
||||
top = (this.top + 0.5) * factor - 0.5;
|
||||
return this._offset(left, top);
|
||||
};
|
||||
|
||||
Guillotine.prototype._fit = function() {
|
||||
var prevWidth, relativeRatio;
|
||||
prevWidth = this.width;
|
||||
relativeRatio = this.height / this.width;
|
||||
if (relativeRatio > 1) {
|
||||
this.width = 1;
|
||||
this.height = relativeRatio;
|
||||
} else {
|
||||
this.width = 1 / relativeRatio;
|
||||
this.height = 1;
|
||||
}
|
||||
this.canvas.style.width = (this.width * 100).toFixed(2) + '%';
|
||||
this.canvas.style.height = (this.height * 100).toFixed(2) + '%';
|
||||
return this.data.scale *= this.width / prevWidth;
|
||||
};
|
||||
|
||||
Guillotine.prototype._center = function() {
|
||||
return this._offset((this.width - 1) / 2, (this.height - 1) / 2);
|
||||
};
|
||||
|
||||
Guillotine.prototype._rotate = function(angle) {
|
||||
var canvasRatio, glltRatio, h, w, _ref, _ref1, _ref2;
|
||||
if (!canTransform()) {
|
||||
return;
|
||||
}
|
||||
if (!(angle !== 0 && angle % 90 === 0)) {
|
||||
return;
|
||||
}
|
||||
this.angle = (this.angle + angle) % 360;
|
||||
if (this.angle < 0) {
|
||||
this.angle = 360 + this.angle;
|
||||
}
|
||||
if (angle % 180 !== 0) {
|
||||
glltRatio = this.op.height / this.op.width;
|
||||
_ref = [this.height * glltRatio, this.width / glltRatio], this.width = _ref[0], this.height = _ref[1];
|
||||
if (this.width >= 1 && this.height >= 1) {
|
||||
this.canvas.style.width = this.width * 100 + '%';
|
||||
this.canvas.style.height = this.height * 100 + '%';
|
||||
} else {
|
||||
this._fit();
|
||||
}
|
||||
}
|
||||
_ref1 = [1, 1], w = _ref1[0], h = _ref1[1];
|
||||
if (this.angle % 180 !== 0) {
|
||||
canvasRatio = this.height / this.width * glltRatio;
|
||||
_ref2 = [canvasRatio, 1 / canvasRatio], w = _ref2[0], h = _ref2[1];
|
||||
}
|
||||
this.el.style.width = w * 100 + '%';
|
||||
this.el.style.height = h * 100 + '%';
|
||||
this.el.style.left = (1 - w) / 2 * 100 + '%';
|
||||
this.el.style.top = (1 - h) / 2 * 100 + '%';
|
||||
this.$el.css({
|
||||
transform: "rotate(" + this.angle + "deg)"
|
||||
});
|
||||
this._center();
|
||||
return this.data.angle = this.angle;
|
||||
};
|
||||
|
||||
Guillotine.prototype.rotateLeft = function() {
|
||||
return this.enabled && (this._rotate(-90), this._trigger('rotateLeft'));
|
||||
};
|
||||
|
||||
Guillotine.prototype.rotateRight = function() {
|
||||
return this.enabled && (this._rotate(90), this._trigger('rotateRight'));
|
||||
};
|
||||
|
||||
Guillotine.prototype.center = function() {
|
||||
return this.enabled && (this._center(), this._trigger('center'));
|
||||
};
|
||||
|
||||
Guillotine.prototype.fit = function() {
|
||||
return this.enabled && (this._fit(), this._center(), this._trigger('fit'));
|
||||
};
|
||||
|
||||
Guillotine.prototype.zoomIn = function() {
|
||||
return this.enabled && (this._zoom(this.zoomInFactor), this._trigger('zoomIn'));
|
||||
};
|
||||
|
||||
Guillotine.prototype.zoomOut = function() {
|
||||
return this.enabled && (this._zoom(this.zoomOutFactor), this._trigger('zoomOut'));
|
||||
};
|
||||
|
||||
Guillotine.prototype.getData = function() {
|
||||
return this.data;
|
||||
};
|
||||
|
||||
Guillotine.prototype.enable = function() {
|
||||
return this.enabled = true;
|
||||
};
|
||||
|
||||
Guillotine.prototype.disable = function() {
|
||||
return this.enabled = false;
|
||||
};
|
||||
|
||||
Guillotine.prototype.remove = function() {
|
||||
this._unbind();
|
||||
this._unwrap();
|
||||
this.disable();
|
||||
this.$el.off(events.start, this._start);
|
||||
return this.$el.removeData(pluginName + 'Instance');
|
||||
};
|
||||
|
||||
return Guillotine;
|
||||
|
||||
})();
|
||||
|
||||
whitelist = ['rotateLeft', 'rotateRight', 'center', 'fit', 'zoomIn', 'zoomOut', 'instance', 'getData', 'enable', 'disable', 'remove'];
|
||||
|
||||
$.fn[pluginName] = function(options) {
|
||||
if (typeof options !== 'string') {
|
||||
return this.each(function() {
|
||||
var guillotine;
|
||||
if (!$.data(this, pluginName + 'Instance')) {
|
||||
guillotine = new Guillotine(this, options);
|
||||
return $.data(this, pluginName + 'Instance', guillotine);
|
||||
}
|
||||
});
|
||||
} else if (__indexOf.call(whitelist, options) >= 0) {
|
||||
if (options === 'instance') {
|
||||
return $.data(this[0], pluginName + 'Instance');
|
||||
}
|
||||
if (options === 'getData') {
|
||||
return $.data(this[0], pluginName + 'Instance')[options]();
|
||||
}
|
||||
return this.each(function() {
|
||||
var guillotine;
|
||||
guillotine = $.data(this, pluginName + 'Instance');
|
||||
if (guillotine) {
|
||||
return guillotine[options]();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
}).call(this);
|
|
@ -1,28 +0,0 @@
|
|||
.guillotine-window {
|
||||
display: block;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.guillotine-canvas {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
text-align: center;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
.guillotine-canvas > * {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
max-width: none;
|
||||
max-height: none;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
border: none !important;
|
||||
}
|
Loading…
Reference in New Issue