<commit_before>/*
 * Naver v3.0.8 - 2014-05-06
 * A jQuery plugin for responsive navigation. Part of the Formstone Library.
 * http://formstone.it/naver/
 *
 * Copyright 2014 Ben Plum; MIT Licensed
 */

;(function ($, window) {
	"use strict";

	/**
	 * @options
	 * @param customClass [string] <''> "Class applied to instance"
	 * @param label [boolean] <true> "Display handle width label"
	 * @param labels.closed [string] <'Navigation'> "Closed state text"
	 * @param labels.open [string] <'Close'> "Open state text"
	 * @param maxWidth [string] <'980px'> "Width at which to auto-disable plugin"
	 */
	var options = {
		customClass: "",
		label: true,
		labels: {
			closed: "Menu",
			open: "Cerrar"
		},
		maxWidth: "980px"
	};

	/**
	 * @events
	 * @event open.naver "Navigation opened"
	 * @event close.naver "Navigation closed"
	 */

	var pub = {

		/**
		 * @method
		 * @name close
		 * @description Closes instance
		 * @example $(".target").naver("close");
		 */
		close: function(e) {
			return $(this).each(function(i, nav) {
				var data = $(nav).data("naver");

				if (data && data.$nav.hasClass("enabled")) {
					data.$wrapper.css({
						height: 0
					});
					if (data.label) {
						data.$handle.html(data.labels.closed);
					}
					data.$nav.removeClass("open")
							 .trigger("close.naver");
				}
			});
		},

		/**
		 * @method
		 * @name defaults
		 * @description Sets default plugin options
		 * @param opts [object] <{}> "Options object"
		 * @example $.naver("defaults", opts);
		 */
		defaults: function(opts) {
			options = $.extend(true, options, opts || {});
			return $(this);
		},

		/**
		 * @method
		 * @name disable
		 * @description Disables instance
		 * @example $(".target").naver("disable");
		 */
		disable: function() {
			return $(this).each(function(i, nav) {
				var data = $(nav).data("naver");

				if (data) {
					data.$nav.removeClass("enabled");
					data.$wrapper.css({ height: "" });
				}
			});
		},

		/**
		 * @method
		 * @name destroy
		 * @description Destroys instance
		 * @example $(".target").naver("destroy");
		 */
		destroy: function() {
			return $(this).each(function(i, nav) {
				var data = $(nav).data("naver");

				if (data) {
					data.$handle.remove();
					data.$container.contents()
								   .unwrap()
								   .unwrap();

					data.$nav.removeClass("enabled disabled naver " + data.customClass)
							 .off(".naver")
							 .removeData("naver");
				}
			});
		},

		/**
		 * @method
		 * @name enable
		 * @description Enables instance
		 * @example $(".target").naver("enable");
		 */
		enable: function() {
			return $(this).each(function(i, nav) {
				var data = $(nav).data("naver");

				if (data) {
					data.$nav.addClass("enabled");
					pub.close.apply(data.$nav);
				}
			});
		},

		/**
		 * @method
		 * @name open
		 * @description Opens instance
		 * @example $(".target").naver("open");
		 */
		open: function() {
			return $(this).each(function(i, nav) {
				var data = $(nav).data("naver");

				if (data && data.$nav.hasClass("enabled")) {
					data.$wrapper.css({
						height: data.$container.outerHeight(true)
					});
					if (data.label) {
						data.$handle.html(data.labels.open);
					}
					data.$nav.addClass("open")
							 .trigger("open.naver");
				}
			});
		}
	};

	/**
	 * @method private
	 * @name _init
	 * @description Initializes plugin
	 * @param opts [object] "Initialization options"
	 */
	function _init(opts) {
		// Settings
		opts = $.extend(true, {}, options, opts);

		// Apply to each element
		var $items = $(this);
		for (var i = 0, count = $items.length; i < count; i++) {
			_build($items.eq(i), opts);
		}
		return $items;
	}

	/**
	 * @method private
	 * @name _build
	 * @description Builds each instance
	 * @param $nav [jQuery object] "Target jQuery object"
	 * @param opts [object] <{}> "Options object"
	 */
	function _build($nav, opts) {
		if (!$nav.data("naver")) {
			// Extend Options
			opts = $.extend(true, {}, opts, $nav.data("naver-options"));

			var $handle = $nav.find(".naver-handle").length ? $nav.find(".naver-handle").detach() : $('');

			$nav.addClass("naver " + opts.customClass)
				.wrapInner('

')
				.wrapInner('

')
				.prepend($handle);

			var data = $.extend(true, {
				$nav: $nav,
				$container: $nav.find(".naver-container"),
				$wrapper: $nav.find(".naver-wrapper"),
				$handle: $nav.find(".naver-handle")
			}, opts);

			data.$handle.text((opts.label) ? opts.labels.closed : '');
			data.$nav.on("touchstart.naver", ".naver-handle", data, _onTouchStart)
					 .on("click.naver", ".naver-handle", data, _onClick)
					 .data("naver", data);

			// Navtive MQ Support
			if (window.matchMedia !== undefined) {
				data.mediaQuery = window.matchMedia("(max-width:" + (data.maxWidth === Infinity ? "100000px" : data.maxWidth) + ")");
				// Make sure we stay in context
				data.mediaQuery.addListener(function() {
					_onRespond.apply(data.$nav);
				});
				_onRespond.apply(data.$nav);
			}
		}
	}

	/**
	 * @method private
	 * @name _onTouchStart
	 * @description Handles touchstart to selected item
	 * @param e [object] "Event data"
	 */
	function _onTouchStart(e) {
		e.stopPropagation();

		var data = e.data,
			oe = e.originalEvent;

		_clearTimer(data.timer);

		data.touchStartX = oe.touches[0].clientX;
		data.touchStartY = oe.touches[0].clientY;

		data.$nav.on("touchmove.naver", ".naver-handle", data, _onTouchMove)
				 .on("touchend.naver", ".naver-handle", data, _onTouchEnd);
	}

	/**
	 * @method private
	 * @name _onTouchMove
	 * @description Handles touchmove to selected item
	 * @param e [object] "Event data"
	 */
	function _onTouchMove(e) {
		var data = e.data,
			oe = e.originalEvent;

		if (Math.abs(oe.touches[0].clientX - data.touchStartX) > 10 || Math.abs(oe.touches[0].clientY - data.touchStartY) > 10) {
			data.$nav.off("touchmove.naver touchend.naver");
		}
	}

	/**
	 * @method private
	 * @name _onTouchEnd
	 * @description Handles touchend to selected item
	 * @param e [object] "Event data"
	 */
	function _onTouchEnd(e) {
		e.preventDefault();
		e.stopPropagation();

		var data = e.data;

		data.$nav.off("touchmove.naver touchend.naver click.naver");

		// prevent ghosty clicks
		data.timer = _startTimer(data.timer, 1000, function() {
			data.$nav.on("click.naver", ".naver-handle", data, _onClick);
		});

		_onClick(e);
	}

	/**
	 * @method private
	 * @name _onClick
	 * @description Handles click nav click
	 * @param e [object] "Event data"
	 */
	function _onClick(e) {
		e.preventDefault();
		e.stopPropagation();

		var $target = $(e.currentTarget),
			data = e.data;

		// Close other open instances
		$(".naver").not(data.$nav)
				   .naver("close");

		if (data.$nav.hasClass("open")) {
			pub.close.apply(data.$nav);
		} else {
			pub.open.apply(data.$nav);
		}
	}

	/**
	 * @method private
	 * @name _onRespond
	 * @description Handles media query match change
	 */
	function _onRespond() {
		var data = $(this).data("naver");

		if (data.mediaQuery.matches) {
			pub.enable.apply(data.$nav);
		} else {
			pub.disable.apply(data.$nav);
		}
	}

	/**
	 * @method private
	 * @name _startTimer
	 * @description Starts an internal timer
	 * @param timer [int] "Timer ID"
	 * @param time [int] "Time until execution"
	 * @param callback [int] "Function to execute"
	 * @param interval [boolean] "Flag for recurring interval"
	 */
	function _startTimer(timer, time, func, interval) {
		_clearTimer(timer, interval);
		if (interval === true) {
			return setInterval(func, time);
		} else {
			return setTimeout(func, time);
		}
	}

	/**
	 * @method private
	 * @name _clearTimer
	 * @description Clears an internal timer
	 * @param timer [int] "Timer ID"
	 */
	function _clearTimer(timer) {
		if (timer !== null) {
			clearInterval(timer);
			timer = null;
		}
	}

	$.fn.naver = function(method) {
		if (pub[method]) {
			return pub[method].apply(this, Array.prototype.slice.call(arguments, 1));
		} else if (typeof method === 'object' || !method) {
			return _init.apply(this, arguments);
		}
		return this;
	};

	$.naver = function(method) {
		if (method === "defaults") {
			pub.defaults.apply(this, Array.prototype.slice.call(arguments, 1));
		}
	};
})(jQuery, window);<commit_msg>Responsive with bootstrap steps<commit_after>/*
 * Naver v3.0.8 - 2014-05-06
 * A jQuery plugin for responsive navigation. Part of the Formstone Library.
 * http://formstone.it/naver/
 *
 * Copyright 2014 Ben Plum; MIT Licensed
 */

;(function ($, window) {
	"use strict";

	/**
	 * @options
	 * @param customClass [string] <''> "Class applied to instance"
	 * @param label [boolean] <true> "Display handle width label"
	 * @param labels.closed [string] <'Navigation'> "Closed state text"
	 * @param labels.open [string] <'Close'> "Open state text"
	 * @param maxWidth [string] <'980px'> "Width at which to auto-disable plugin"
	 */
	var options = {
		customClass: "",
		label: true,
		labels: {
			closed: "Menu",
			open: "Cerrar"
		},
		maxWidth: "992px"
	};

	/**
	 * @events
	 * @event open.naver "Navigation opened"
	 * @event close.naver "Navigation closed"
	 */

	var pub = {

		/**
		 * @method
		 * @name close
		 * @description Closes instance
		 * @example $(".target").naver("close");
		 */
		close: function(e) {
			return $(this).each(function(i, nav) {
				var data = $(nav).data("naver");

				if (data && data.$nav.hasClass("enabled")) {
					data.$wrapper.css({
						height: 0
					});
					if (data.label) {
						data.$handle.html(data.labels.closed);
					}
					data.$nav.removeClass("open")
							 .trigger("close.naver");
				}
			});
		},

		/**
		 * @method
		 * @name defaults
		 * @description Sets default plugin options
		 * @param opts [object] <{}> "Options object"
		 * @example $.naver("defaults", opts);
		 */
		defaults: function(opts) {
			options = $.extend(true, options, opts || {});
			return $(this);
		},

		/**
		 * @method
		 * @name disable
		 * @description Disables instance
		 * @example $(".target").naver("disable");
		 */
		disable: function() {
			return $(this).each(function(i, nav) {
				var data = $(nav).data("naver");

				if (data) {
					data.$nav.removeClass("enabled");
					data.$wrapper.css({ height: "" });
				}
			});
		},

		/**
		 * @method
		 * @name destroy
		 * @description Destroys instance
		 * @example $(".target").naver("destroy");
		 */
		destroy: function() {
			return $(this).each(function(i, nav) {
				var data = $(nav).data("naver");

				if (data) {
					data.$handle.remove();
					data.$container.contents()
								   .unwrap()
								   .unwrap();

					data.$nav.removeClass("enabled disabled naver " + data.customClass)
							 .off(".naver")
							 .removeData("naver");
				}
			});
		},

		/**
		 * @method
		 * @name enable
		 * @description Enables instance
		 * @example $(".target").naver("enable");
		 */
		enable: function() {
			return $(this).each(function(i, nav) {
				var data = $(nav).data("naver");

				if (data) {
					data.$nav.addClass("enabled");
					pub.close.apply(data.$nav);
				}
			});
		},

		/**
		 * @method
		 * @name open
		 * @description Opens instance
		 * @example $(".target").naver("open");
		 */
		open: function() {
			return $(this).each(function(i, nav) {
				var data = $(nav).data("naver");

				if (data && data.$nav.hasClass("enabled")) {
					data.$wrapper.css({
						height: data.$container.outerHeight(true)
					});
					if (data.label) {
						data.$handle.html(data.labels.open);
					}
					data.$nav.addClass("open")
							 .trigger("open.naver");
				}
			});
		}
	};

	/**
	 * @method private
	 * @name _init
	 * @description Initializes plugin
	 * @param opts [object] "Initialization options"
	 */
	function _init(opts) {
		// Settings
		opts = $.extend(true, {}, options, opts);

		// Apply to each element
		var $items = $(this);
		for (var i = 0, count = $items.length; i < count; i++) {
			_build($items.eq(i), opts);
		}
		return $items;
	}

	/**
	 * @method private
	 * @name _build
	 * @description Builds each instance
	 * @param $nav [jQuery object] "Target jQuery object"
	 * @param opts [object] <{}> "Options object"
	 */
	function _build($nav, opts) {
		if (!$nav.data("naver")) {
			// Extend Options
			opts = $.extend(true, {}, opts, $nav.data("naver-options"));

			var $handle = $nav.find(".naver-handle").length ? $nav.find(".naver-handle").detach() : $('');

			$nav.addClass("naver " + opts.customClass)
				.wrapInner('

')
				.wrapInner('

')
				.prepend($handle);

			var data = $.extend(true, {
				$nav: $nav,
				$container: $nav.find(".naver-container"),
				$wrapper: $nav.find(".naver-wrapper"),
				$handle: $nav.find(".naver-handle")
			}, opts);

			data.$handle.text((opts.label) ? opts.labels.closed : '');
			data.$nav.on("touchstart.naver", ".naver-handle", data, _onTouchStart)
					 .on("click.naver", ".naver-handle", data, _onClick)
					 .data("naver", data);

			// Navtive MQ Support
			if (window.matchMedia !== undefined) {
				data.mediaQuery = window.matchMedia("(max-width:" + (data.maxWidth === Infinity ? "100000px" : data.maxWidth) + ")");
				// Make sure we stay in context
				data.mediaQuery.addListener(function() {
					_onRespond.apply(data.$nav);
				});
				_onRespond.apply(data.$nav);
			}
		}
	}

	/**
	 * @method private
	 * @name _onTouchStart
	 * @description Handles touchstart to selected item
	 * @param e [object] "Event data"
	 */
	function _onTouchStart(e) {
		e.stopPropagation();

		var data = e.data,
			oe = e.originalEvent;

		_clearTimer(data.timer);

		data.touchStartX = oe.touches[0].clientX;
		data.touchStartY = oe.touches[0].clientY;

		data.$nav.on("touchmove.naver", ".naver-handle", data, _onTouchMove)
				 .on("touchend.naver", ".naver-handle", data, _onTouchEnd);
	}

	/**
	 * @method private
	 * @name _onTouchMove
	 * @description Handles touchmove to selected item
	 * @param e [object] "Event data"
	 */
	function _onTouchMove(e) {
		var data = e.data,
			oe = e.originalEvent;

		if (Math.abs(oe.touches[0].clientX - data.touchStartX) > 10 || Math.abs(oe.touches[0].clientY - data.touchStartY) > 10) {
			data.$nav.off("touchmove.naver touchend.naver");
		}
	}

	/**
	 * @method private
	 * @name _onTouchEnd
	 * @description Handles touchend to selected item
	 * @param e [object] "Event data"
	 */
	function _onTouchEnd(e) {
		e.preventDefault();
		e.stopPropagation();

		var data = e.data;

		data.$nav.off("touchmove.naver touchend.naver click.naver");

		// prevent ghosty clicks
		data.timer = _startTimer(data.timer, 1000, function() {
			data.$nav.on("click.naver", ".naver-handle", data, _onClick);
		});

		_onClick(e);
	}

	/**
	 * @method private
	 * @name _onClick
	 * @description Handles click nav click
	 * @param e [object] "Event data"
	 */
	function _onClick(e) {
		e.preventDefault();
		e.stopPropagation();

		var $target = $(e.currentTarget),
			data = e.data;

		// Close other open instances
		$(".naver").not(data.$nav)
				   .naver("close");

		if (data.$nav.hasClass("open")) {
			pub.close.apply(data.$nav);
		} else {
			pub.open.apply(data.$nav);
		}
	}

	/**
	 * @method private
	 * @name _onRespond
	 * @description Handles media query match change
	 */
	function _onRespond() {
		var data = $(this).data("naver");

		if (data.mediaQuery.matches) {
			pub.enable.apply(data.$nav);
		} else {
			pub.disable.apply(data.$nav);
		}
	}

	/**
	 * @method private
	 * @name _startTimer
	 * @description Starts an internal timer
	 * @param timer [int] "Timer ID"
	 * @param time [int] "Time until execution"
	 * @param callback [int] "Function to execute"
	 * @param interval [boolean] "Flag for recurring interval"
	 */
	function _startTimer(timer, time, func, interval) {
		_clearTimer(timer, interval);
		if (interval === true) {
			return setInterval(func, time);
		} else {
			return setTimeout(func, time);
		}
	}

	/**
	 * @method private
	 * @name _clearTimer
	 * @description Clears an internal timer
	 * @param timer [int] "Timer ID"
	 */
	function _clearTimer(timer) {
		if (timer !== null) {
			clearInterval(timer);
			timer = null;
		}
	}

	$.fn.naver = function(method) {
		if (pub[method]) {
			return pub[method].apply(this, Array.prototype.slice.call(arguments, 1));
		} else if (typeof method === 'object' || !method) {
			return _init.apply(this, arguments);
		}
		return this;
	};

	$.naver = function(method) {
		if (method === "defaults") {
			pub.defaults.apply(this, Array.prototype.slice.call(arguments, 1));
		}
	};
})(jQuery, window);<|endoftext|>


<commit_before>/**
 * 控制端函数
 */
(function($win, $doc, $B, Slide, loadJS, undefined) {
    var $slides = Slide.$slides;

    // function doItem(direction) {
    //     return Slide[direction === 'prev' ? 'buildPrevItem' : 'buildNextItem'](true);
    // }

    function getType(obj) {
        return ({}).toString.call(obj).slice(8, -1)
    }

    var Control = {
        state: 'unbind',
        methods: {},
        init: function() {
            this.bindListener();
        },
        bindListener: function() {
            var t = this;
            //监听用户端发出的广播
            $B.on('slide change ID', function(json) {
                    var slideID = json.slideID;
                    //发送请求
                    t.sendUpdate(slideID, json.direction);

                }).on('slide do build', function(json) {
                    var slideID = json.slideID;
                    var buildItem = json.build;
                    var direction = json.direction;
                    //发送请求
                    t.sendUpdateItem(slideID, buildItem, direction);
                }).on('slide event keyup', function(e) {
                    t.sendKeyEvent(e.keyCode);
                }).on('show paint', function(e) {
                    t.sendKeyEvent(80);
                }).on('remove paint', function() {
                    t.sendKeyEvent(67);
                }).on('paint points', function(points) {
                    var data = {
                        points: points,
                        screen: {
                            width: $doc.body.offsetWidth,
                            height: $doc.body.offsetHeight
                        }
                    };
                    t.send_('broadcast', ['paint points', data]);
                })
                //监听控制来的广播
                .on('from control order', function(json) {
                    var fnName = json.fnName;
                    var args = json.args;
                    Slide.proxyFn(fnName, args);
                }).on('from control update', function(json) {
                    Slide[json.direction](true);
                    // doSlide(json.direction, json.id, false);
                }).on('from control updateItem', function(json) {
                    Slide[json.direction](true);
                    //doItem(json.direction) && doSlide(json.id, false);
                }).on('from control key event', function(json) {
                    t.createKeyEvent_(json.keyCode);
                })
        },
        createKeyEvent_: function(keyCode) {
            var evt = document.createEvent('Event');
            evt.initEvent('keyup', true, true);
            evt.keyCode = keyCode;
            evt.isFromControl = true;

            document.dispatchEvent(evt);
        },
        send_: function(fnName, args) {
            var methods = this.methods;
            var method;
            args = getType(args) === 'Array' ? args : [args];
            for (var i in methods) {
                method = methods[i];
                method = method[fnName];
                typeof method === 'function' && method.apply(Slide, args);
            }
        },
        sendUpdate: function(slideID, direction) {
            this.send_('update', [slideID, direction]);
        },
        sendUpdateItem: function(id, buildItem, direction) {
            this.send_('updateItem', [id, buildItem, direction]);
        },
        sendKeyEvent: function(keycode) {
            this.send_('keyEvent', [keycode]);
        },

        //添加一个新的监控
        add: function(name, factory, override) {
            var methods = this.methods;

            if (override || !methods[name]) {
                methods[name] = factory(Slide, $B);
                //必须包括4个函数一个是监控翻页的update
                //另外一个是updateItem
                //一个是init
                //keyEvent;
            }
        },
        load: function(type, args) {
            var url = Slide.dir + 'nodeppt.control.' + type + '.js';
            loadJS(url, function() {
                Slide.Control.methods[type].init(args);
            });
        }
    };
    Control.init();
    Slide.Control = Control;
}(window, document, MixJS.event.broadcast, Slide, MixJS.loadJS));
<commit_msg>可改变画笔颜色、粗细<commit_after>/**
 * 控制端函数
 */
(function($win, $doc, $B, Slide, loadJS, undefined) {
    var $slides = Slide.$slides;

    // function doItem(direction) {
    //     return Slide[direction === 'prev' ? 'buildPrevItem' : 'buildNextItem'](true);
    // }

    function getType(obj) {
        return ({}).toString.call(obj).slice(8, -1)
    }

    var Control = {
        state: 'unbind',
        methods: {},
        init: function() {
            this.bindListener();
        },
        bindListener: function() {
            var t = this;
            //监听用户端发出的广播
            $B.on('slide change ID', function(json) {
                    var slideID = json.slideID;
                    //发送请求
                    t.sendUpdate(slideID, json.direction);

                }).on('slide do build', function(json) {
                    var slideID = json.slideID;
                    var buildItem = json.build;
                    var direction = json.direction;
                    //发送请求
                    t.sendUpdateItem(slideID, buildItem, direction);
                }).on('slide event keyup', function(e) {
                    t.sendKeyEvent(e.keyCode);
                }).on('show paint', function(e) {
                    t.sendKeyEvent(80);
                }).on('remove paint', function() {
                    t.sendKeyEvent(67);
                }).on('paint points', function(points) {
                    var data = {
                        pencolor: $doc.getElementById("drawBoard").context.strokeStyle, //画笔颜色
                        penlineWidth: $doc.getElementById("drawBoard").context.lineWidth,  //画笔宽度
                        points: points,
                        screen: {
                            width: $doc.body.offsetWidth,
                            height: $doc.body.offsetHeight
                        }
                    };
                    t.send_('broadcast', ['paint points', data]);
                })
                //监听控制来的广播
                .on('from control order', function(json) {
                    var fnName = json.fnName;
                    var args = json.args;
                    Slide.proxyFn(fnName, args);
                }).on('from control update', function(json) {
                    Slide[json.direction](true);
                    // doSlide(json.direction, json.id, false);
                }).on('from control updateItem', function(json) {
                    Slide[json.direction](true);
                    //doItem(json.direction) && doSlide(json.id, false);
                }).on('from control key event', function(json) {
                    t.createKeyEvent_(json.keyCode);
                })
        },
        createKeyEvent_: function(keyCode) {
            var evt = document.createEvent('Event');
            evt.initEvent('keyup', true, true);
            evt.keyCode = keyCode;
            evt.isFromControl = true;

            document.dispatchEvent(evt);
        },
        send_: function(fnName, args) {
            var methods = this.methods;
            var method;
            args = getType(args) === 'Array' ? args : [args];
            for (var i in methods) {
                method = methods[i];
                method = method[fnName];
                typeof method === 'function' && method.apply(Slide, args);
            }
        },
        sendUpdate: function(slideID, direction) {
            this.send_('update', [slideID, direction]);
        },
        sendUpdateItem: function(id, buildItem, direction) {
            this.send_('updateItem', [id, buildItem, direction]);
        },
        sendKeyEvent: function(keycode) {
            this.send_('keyEvent', [keycode]);
        },

        //添加一个新的监控
        add: function(name, factory, override) {
            var methods = this.methods;

            if (override || !methods[name]) {
                methods[name] = factory(Slide, $B);
                //必须包括4个函数一个是监控翻页的update
                //另外一个是updateItem
                //一个是init
                //keyEvent;
            }
        },
        load: function(type, args) {
            var url = Slide.dir + 'nodeppt.control.' + type + '.js';
            loadJS(url, function() {
                Slide.Control.methods[type].init(args);
            });
        }
    };
    Control.init();
    Slide.Control = Control;
}(window, document, MixJS.event.broadcast, Slide, MixJS.loadJS));
<|endoftext|>


<commit_before>
jQuery(document).ready(function() {
  // Add the 'less than IE9' class to appropriate version of IE by checking for their support of cssFloat (true in v9)
  if (!jQuery.support.cssFloat) { jQuery('html').addClass('lt-ie9').addClass('no-js'); }

  jQuery(document).foundation(function (response) {
    // console.log(response.errors); < this line will produce error in ie9!
    if (window.console) console.log(response.errors);
  });

  // The Echo extension puts an item in personal tools that Foreground really should have in the top menu
  // to make this easier, we move it here and loaded earlier to speed up transform
  jQuery("#pt-notifications").prependTo("#echo-notifications");

  // Append font-awesome icons
  jQuery('[id^=ca-nstab] a').prepend('

')
  jQuery('li#ca-talk a').prepend('

')
  jQuery('li#ca-edit a').prepend('

')
  jQuery('li#ca-viewsource a').prepend('

')
  jQuery('li#ca-form_edit a').prepend('

')
  jQuery('li#ca-history a').prepend('

')
  jQuery('li#ca-delete a').prepend('

')
  jQuery('li#ca-move a').prepend('

')
  jQuery('li#ca-protect a').prepend('

')
  jQuery('li#ca-unprotect a').prepend('

')
  jQuery('li#ca-watch a').prepend('

')
  jQuery('li#ca-unwatch a').prepend('

')
  jQuery('li#ca-purge a').prepend('

')
  jQuery('li#ca-undelete a').prepend('

')
  jQuery('li#ca-ask_delete_permanently a').prepend('

')

if ( jQuery( '#ca-addsection' ).length ) {
  jQuery('li#ca-addsection a').html('

' + jQuery('li#ca-addsection a').attr('title').replace(/\[.+/g,""))
}

  jQuery('li#pt-uls a').prepend('

')
  jQuery('li#pt-userpage a').prepend('

')
  jQuery('li#pt-mytalk a').prepend('

')
  jQuery('li#pt-adminlinks a').prepend('

')
  jQuery('li#pt-preferences a').prepend('

')
  jQuery('li#pt-watchlist a').prepend('

')
  jQuery('li#pt-mycontris a').prepend('

')
  jQuery('li#pt-logout a').prepend('

')

  jQuery('li#t-smwbrowselink a').prepend('

')
  jQuery('li#t-whatlinkshere a').prepend('

')
  jQuery('li#t-blockip a').prepend('

')
  jQuery('li#t-recentchangeslinked a').prepend('

')
  jQuery('li#t-contributions a').prepend('

')
  jQuery('li#t-log a').prepend('

')
  jQuery('li#t-emailuser a').prepend('

')
  jQuery('li#t-userrights a').prepend('

')
  jQuery('li#t-upload a').prepend('

')
  jQuery('li#t-specialpages a').prepend('

')
  jQuery('li#t-print a').prepend('

')
  jQuery('li#t-permalink a').prepend('

')
  jQuery('li#t-info a').prepend('

')
  jQuery('li#feedlinks a').prepend('

')

  jQuery('ul#toolbox-dropdown.dropdown>li#n-recentchanges a').prepend('

')
  jQuery('ul#toolbox-dropdown.dropdown>li#n-help a').prepend('

')

  // Turn categories into labels
  jQuery('#mw-normal-catlinks ul li a').addClass('label');

  // Make the Page Action button respond to hover
  jQuery('a.button.dropdown').mouseenter(function(){
    jQuery('ul#drop1').addClass('open').addClass('right').css('top', '32px').css('left', '785px');
  });
  jQuery('ul#drop1').mouseleave(function(){
    jQuery('ul#drop1').removeClass('open').css('top', '-9999px').css('left', '785px');
  });

});<commit_msg>Better icon for page history.<commit_after>
jQuery(document).ready(function() {
  // Add the 'less than IE9' class to appropriate version of IE by checking for their support of cssFloat (true in v9)
  if (!jQuery.support.cssFloat) { jQuery('html').addClass('lt-ie9').addClass('no-js'); }

  jQuery(document).foundation(function (response) {
    // console.log(response.errors); < this line will produce error in ie9!
    if (window.console) console.log(response.errors);
  });

  // The Echo extension puts an item in personal tools that Foreground really should have in the top menu
  // to make this easier, we move it here and loaded earlier to speed up transform
  jQuery("#pt-notifications").prependTo("#echo-notifications");

  // Append font-awesome icons
  jQuery('[id^=ca-nstab] a').prepend('

')
  jQuery('li#ca-talk a').prepend('

')
  jQuery('li#ca-edit a').prepend('

')
  jQuery('li#ca-viewsource a').prepend('

')
  jQuery('li#ca-form_edit a').prepend('

')
  jQuery('li#ca-history a').prepend('

')
  jQuery('li#ca-delete a').prepend('

')
  jQuery('li#ca-move a').prepend('

')
  jQuery('li#ca-protect a').prepend('

')
  jQuery('li#ca-unprotect a').prepend('

')
  jQuery('li#ca-watch a').prepend('

')
  jQuery('li#ca-unwatch a').prepend('

')
  jQuery('li#ca-purge a').prepend('

')
  jQuery('li#ca-undelete a').prepend('

')
  jQuery('li#ca-ask_delete_permanently a').prepend('

')

if ( jQuery( '#ca-addsection' ).length ) {
  jQuery('li#ca-addsection a').html('

' + jQuery('li#ca-addsection a').attr('title').replace(/\[.+/g,""))
}

  jQuery('li#pt-uls a').prepend('

')
  jQuery('li#pt-userpage a').prepend('

')
  jQuery('li#pt-mytalk a').prepend('

')
  jQuery('li#pt-adminlinks a').prepend('

')
  jQuery('li#pt-preferences a').prepend('

')
  jQuery('li#pt-watchlist a').prepend('

')
  jQuery('li#pt-mycontris a').prepend('

')
  jQuery('li#pt-logout a').prepend('

')

  jQuery('li#t-smwbrowselink a').prepend('

')
  jQuery('li#t-whatlinkshere a').prepend('

')
  jQuery('li#t-blockip a').prepend('

')
  jQuery('li#t-recentchangeslinked a').prepend('

')
  jQuery('li#t-contributions a').prepend('

')
  jQuery('li#t-log a').prepend('

')
  jQuery('li#t-emailuser a').prepend('

')
  jQuery('li#t-userrights a').prepend('

')
  jQuery('li#t-upload a').prepend('

')
  jQuery('li#t-specialpages a').prepend('

')
  jQuery('li#t-print a').prepend('

')
  jQuery('li#t-permalink a').prepend('

')
  jQuery('li#t-info a').prepend('

')
  jQuery('li#feedlinks a').prepend('

')

  jQuery('ul#toolbox-dropdown.dropdown>li#n-recentchanges a').prepend('

')
  jQuery('ul#toolbox-dropdown.dropdown>li#n-help a').prepend('

')

  // Turn categories into labels
  jQuery('#mw-normal-catlinks ul li a').addClass('label');

  // Make the Page Action button respond to hover
  jQuery('a.button.dropdown').mouseenter(function(){
    jQuery('ul#drop1').addClass('open').addClass('right').css('top', '32px').css('left', '785px');
  });
  jQuery('ul#drop1').mouseleave(function(){
    jQuery('ul#drop1').removeClass('open').css('top', '-9999px').css('left', '785px');
  });

});<|endoftext|>


<commit_before>var reducible = require("reducible/reducible")
var setTimeout = require("timers").setTimeout
var clearTimeout = require("timers").clearTimeout
var now = require("date-now")

var invoker = require("./lib/invoker")
var gapi = require("./lib/gapi")

module.exports = Room

/* Room representation for a google plus hangout.

    The people reducible is populated from participant changed
    events.

*/
function Room(host) {
    var hangout = gapi.hangout
    var id = hangout.getHangoutId()

    var people = reducible(function (next, state) {
        var invoke = invoker(next, state, cleanup)

        hangout.onParticipantsAdded.add(onAdd)

        hangout.onParticipantsRemoved.add(onRemove)

        hangout.getParticipants().forEach(add)

        var timer = setTimeout(function loop() {
            hangout.getParticipants().forEach(add)

            timer = setTimeout(loop, 1000)
        }, 1000)

        function onAdd(event) {
            event.addedParticipants.forEach(add)
        }

        function onRemove(event) {
            event.removedParticipants.forEach(remove)
        }

        function add(par) {
            invoke({
                id: par.person.id
                , imageUri: par.person.image.url
                , name: par.person.displayName
                , online: true
                , ts: now()
            })
        }

        function remove(par) {
            invoke({
                id: par.person.id
                , online: false
            })
        }

        function cleanup(callback) {
            clearTimeout(timer)
            hangout.onParticipantsAdded.remove(onAdd)
            hangout.onParticipantsRemoved.remove(onRemove)

            callback(null)
        }
    })

    return {
        id: id
        , host: host
        , people: people
    }
}
<commit_msg>pass gapi into gapiRoom<commit_after>var reducible = require("reducible/reducible")
var setTimeout = require("timers").setTimeout
var clearTimeout = require("timers").clearTimeout
var now = require("date-now")

var invoker = require("./lib/invoker")

module.exports = Room

/* Room representation for a google plus hangout.

    The people reducible is populated from participant changed
    events.

*/
function Room(host, gapi) {
    var hangout = gapi.hangout
    var id = hangout.getHangoutId()

    var people = reducible(function (next, state) {
        var invoke = invoker(next, state, cleanup)

        hangout.onParticipantsAdded.add(onAdd)

        hangout.onParticipantsRemoved.add(onRemove)

        hangout.getParticipants().forEach(add)

        var timer = setTimeout(function loop() {
            hangout.getParticipants().forEach(add)

            timer = setTimeout(loop, 1000)
        }, 1000)

        function onAdd(event) {
            event.addedParticipants.forEach(add)
        }

        function onRemove(event) {
            event.removedParticipants.forEach(remove)
        }

        function add(par) {
            invoke({
                id: par.person.id
                , imageUri: par.person.image.url
                , name: par.person.displayName
                , online: true
                , ts: now()
            })
        }

        function remove(par) {
            invoke({
                id: par.person.id
                , online: false
            })
        }

        function cleanup(callback) {
            clearTimeout(timer)
            hangout.onParticipantsAdded.remove(onAdd)
            hangout.onParticipantsRemoved.remove(onRemove)

            callback(null)
        }
    })

    return {
        id: id
        , host: host
        , people: people
    }
}
<|endoftext|>


<commit_before>// Pulls the JSON data from csv-to-json.js and api-to-json.js and outputs them for ED3D

//Define Categories
var systemsData = {
	"categories": {
		"Points of Interest": {
			"100": {
				"name": "System",
				"color": "F7F7F7"
			},
			"101": {
				"name": "MegaShips",
				"color": "F7F7F7"
			}
		},
		"Barnacles": {
			"200": {
				"name": "Barnacle",
				"color": "F7F7F7"
			}
			// Disabled until output shows status
			/*			"200": {
			"name": "Ripe",
			"color": "F7F7F7"
			},
			"201": {
			"name": "Dead",
			"color": "F7F7F7"
			} */
		},
		"Brain Trees": {
			"300": {
				"name": "Brain Tree",
				"color": "F7F7F7"
			}
		},
		"Guardian Ruins": {
			"400": {
				"name": "Alpha",
				"color": "F7F7F7"
			},
			"401": {
				"name": "Beta",
				"color": "F7F7F7"
			},
			"402": {
				"name": "Gamma",
				"color": "F7F7F7"
			}
		},
		"Thargoid Structures": {
			"500": {
				"name": "Active",
				"color": "F7F7F7"
			},
			"501": {
				"name": "Inactive",
				"color": "F7F7F7"
			}
		}
	},
	"systems": [{
			"name": "Sol",
			"coords": {
				"x": "0",
				"y": "0",
				"z": "0"
			},
			"cat": [
				"100"
			]
		}, {
			"name": "Merope",
			"coords": {
				"x": "-78.59375",
				"y": "-149.625",
				"z": "-340.53125"
			},
			"cat": [
				"100"
			]
		}, {
			"name": "HIP 22460",
			"coords": {
				"x": "-41.3125",
				"y": "-58.96875",
				"z": "-354.78125"
			},
			"cat": [
				"100"
			]
		}, {
			"name": "Col 173 Sector LJ-F C12-0 (The Cete)",
			"coords": {
				"x": "1202.125",
				"y": "-213.40625",
				"z": "-165.5625"
			},
			"cat": [
				"101"
			]
		},
	]
};

// Lets get data from CSV Files
function formatBN(data) {
	//Here you format BN JSON to ED3D acceptable object

	// this is assuming data is an array []
	for (var i = 0; i < data.length; i++) {
		var bnSite = {};
		bnSite["name"] = data[1];

		//Ripe or Dead Status not enabled yet, pending CSV fixes
		bnSite["cat"] = [200];
		bnSite["coords"] = {
			"x": data[5],
			"y": data[6],
			"z": data[7]
		};

		// We can then push the site to the object that stores all systems
		systemsData["systems"].push(bnSite);

	}

}

function formatBT(data) {
	//Here you format BT JSON to ED3D acceptable object

	// this is assuming data is an array []
	for (var i = 0; i < data.length; i++) {
		var btSite = {};
		btSite["name"] = data[1];
		btSite["cat"] = [300];
		btSite["coords"] = {
			"x": data[5],
			"y": data[6],
			"z": data[7]
		};

		// We can then push the site to the object that stores all systems
		systemsData["systems"].push(btSite);

	}

}

function formatTS(data) {
	//Here you format TS JSON to ED3D acceptable object

	// this is assuming data is an array []
	for (var i = 0; i < data.length; i++) {
		var tsSite = {};
		tsSite["name"] = data[1];

		//Check if Site is Active or Inactive, set Category to match
		if (data[8].toString().toLowerCase() == "y") {
			tsSite["cat"] = [500];
		} else {
			tsSite["cat"] = [501];
		}
		tsSite["coords"] = {
			"x": data[5],
			"y": data[6],
			"z": data[7]
		};

		// We can then push the site to the object that stores all systems
		systemsData["systems"].push(tsSite);

	}

}

function parseData(url, callBack, resolvePromise) {
    Papa.parse(url, {
        download: true,
        header: true,
        complete: function (results) {

            console.log(results);  // This is probably your data
            console.log(results.data); // This is probably undefined
            callBack(results.data);

            // after we called the callback
            // (which is synchronous, so we know it's safe here)
            // we can resolve the promise

            resolvePromise();
        }
    });
}

var p1 = new Promise(function (resolve, reject) {
		parseData("https://docs.google.com/spreadsheets/d/e/2PACX-1vTCGOwaRT8ESad9j0GAQ7tMMNj8ObxipFW8fop3eaZ-HoCVo_k9dQsHVvs1oFvARrY5SC6o4uDAWKQA/pub?gid=0&single=true&output=csv", formatBN, resolve);
	});

var p2 = new Promise(function (resolve, reject) {
		parseData("https://docs.google.com/spreadsheets/d/e/2PACX-1vRdEQQByWyU8MlzfJw9SzEsaM9c_zDV_RJ49Fiox842EEELrUHpMPexLYhjqNB8SOzB564jJ_oLdBx2/pub?gid=0&single=true&output=csv", formatBT, resolve);
	});

var p3 = new Promise(function (resolve, reject) {
		parseData("https://docs.google.com/spreadsheets/d/e/2PACX-1vR4-rhi1p4BU7AlOSj7_78Kvk5Ox6vb39vzzlWU3yI-dqlaLxk-CFLWvAFKc-J7WhomFiQ_u0P7Stxz/pub?gid=0&single=true&output=csv", formatTS, resolve);
	});

Promise.all([p1,p2,p3]).then( function() {
    Ed3d.init({
        container   : 'edmap',
        jsonPath    : systemData,
        withHudPanel : true,
        hudMultipleSelect : true,
        effectScaleSystem : [50,10000],
        startAnim: false,
        showGalaxyInfos: true,
        cameraPos: [25,14100,-12900],
        systemColor: '#FF9D00'
    })
});
<commit_msg>Fix SystemsData?<commit_after>// Pulls the JSON data from csv-to-json.js and api-to-json.js and outputs them for ED3D

//Define Categories
var systemsData = {
	"categories": {
		"Points of Interest": {
			"100": {
				"name": "System",
				"color": "F7F7F7"
			},
			"101": {
				"name": "MegaShips",
				"color": "F7F7F7"
			}
		},
		"Barnacles": {
			"200": {
				"name": "Barnacle",
				"color": "F7F7F7"
			}
			// Disabled until output shows status
			/*			"200": {
			"name": "Ripe",
			"color": "F7F7F7"
			},
			"201": {
			"name": "Dead",
			"color": "F7F7F7"
			} */
		},
		"Brain Trees": {
			"300": {
				"name": "Brain Tree",
				"color": "F7F7F7"
			}
		},
		"Guardian Ruins": {
			"400": {
				"name": "Alpha",
				"color": "F7F7F7"
			},
			"401": {
				"name": "Beta",
				"color": "F7F7F7"
			},
			"402": {
				"name": "Gamma",
				"color": "F7F7F7"
			}
		},
		"Thargoid Structures": {
			"500": {
				"name": "Active",
				"color": "F7F7F7"
			},
			"501": {
				"name": "Inactive",
				"color": "F7F7F7"
			}
		}
	},
	"systems": [{
			"name": "Sol",
			"coords": {
				"x": "0",
				"y": "0",
				"z": "0"
			},
			"cat": [
				"100"
			]
		}, {
			"name": "Merope",
			"coords": {
				"x": "-78.59375",
				"y": "-149.625",
				"z": "-340.53125"
			},
			"cat": [
				"100"
			]
		}, {
			"name": "HIP 22460",
			"coords": {
				"x": "-41.3125",
				"y": "-58.96875",
				"z": "-354.78125"
			},
			"cat": [
				"100"
			]
		}, {
			"name": "Col 173 Sector LJ-F C12-0 (The Cete)",
			"coords": {
				"x": "1202.125",
				"y": "-213.40625",
				"z": "-165.5625"
			},
			"cat": [
				"101"
			]
		},
	]
};

// Lets get data from CSV Files
function formatBN(data) {
	//Here you format BN JSON to ED3D acceptable object

	// this is assuming data is an array []
	for (var i = 0; i < data.length; i++) {
		var bnSite = {};
		bnSite["name"] = data[1];

		//Ripe or Dead Status not enabled yet, pending CSV fixes
		bnSite["cat"] = [200];
		bnSite["coords"] = {
			"x": data[5],
			"y": data[6],
			"z": data[7]
		};

		// We can then push the site to the object that stores all systems
		systemsData.["systems"].push(bnSite);

	}

}

function formatBT(data) {
	//Here you format BT JSON to ED3D acceptable object

	// this is assuming data is an array []
	for (var i = 0; i < data.length; i++) {
		var btSite = {};
		btSite["name"] = data[1];
		btSite["cat"] = [300];
		btSite["coords"] = {
			"x": data[5],
			"y": data[6],
			"z": data[7]
		};

		// We can then push the site to the object that stores all systems
		systemsData.["systems"].push(btSite);

	}

}

function formatTS(data) {
	//Here you format TS JSON to ED3D acceptable object

	// this is assuming data is an array []
	for (var i = 0; i < data.length; i++) {
		var tsSite = {};
		tsSite["name"] = data[1];

		//Check if Site is Active or Inactive, set Category to match
		if (data[8].toString().toLowerCase() == "y") {
			tsSite["cat"] = [500];
		} else {
			tsSite["cat"] = [501];
		}
		tsSite["coords"] = {
			"x": data[5],
			"y": data[6],
			"z": data[7]
		};

		// We can then push the site to the object that stores all systems
		systemsData.["systems"].push(tsSite);

	}

}

function parseData(url, callBack, resolvePromise) {
    Papa.parse(url, {
        download: true,
        header: true,
        complete: function (results) {

            console.log(results);  // This is probably your data
            console.log(results.data); // This is probably undefined
            callBack(results.data);

            // after we called the callback
            // (which is synchronous, so we know it's safe here)
            // we can resolve the promise

            resolvePromise();
        }
    });
}

var p1 = new Promise(function (resolve, reject) {
		parseData("https://docs.google.com/spreadsheets/d/e/2PACX-1vTCGOwaRT8ESad9j0GAQ7tMMNj8ObxipFW8fop3eaZ-HoCVo_k9dQsHVvs1oFvARrY5SC6o4uDAWKQA/pub?gid=0&single=true&output=csv", formatBN, resolve);
	});

var p2 = new Promise(function (resolve, reject) {
		parseData("https://docs.google.com/spreadsheets/d/e/2PACX-1vRdEQQByWyU8MlzfJw9SzEsaM9c_zDV_RJ49Fiox842EEELrUHpMPexLYhjqNB8SOzB564jJ_oLdBx2/pub?gid=0&single=true&output=csv", formatBT, resolve);
	});

var p3 = new Promise(function (resolve, reject) {
		parseData("https://docs.google.com/spreadsheets/d/e/2PACX-1vR4-rhi1p4BU7AlOSj7_78Kvk5Ox6vb39vzzlWU3yI-dqlaLxk-CFLWvAFKc-J7WhomFiQ_u0P7Stxz/pub?gid=0&single=true&output=csv", formatTS, resolve);
	});

Promise.all([p1,p2,p3]).then( function() {
    Ed3d.init({
        container   : 'edmap',
        jsonPath    : systemData,
        withHudPanel : true,
        hudMultipleSelect : true,
        effectScaleSystem : [50,10000],
        startAnim: false,
        showGalaxyInfos: true,
        cameraPos: [25,14100,-12900],
        systemColor: '#FF9D00'
    })
});
<|endoftext|>


<commit_before>(function () {

var defaultBgImage = "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAALCAYAAAByF90EAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAZpJREFUeNp8kr9Lw0AUx5ukTdMfaWvALlKyKKWNGBBxkIjUSagoKbQ4Z01HcayD0MFJcChF7f9Q6lJQQRycpLM4tC4luhVd1Kbn90ojJUYPPlzu7r1vvvfeMYQQ3x9DBPJk/gAvoA+8E6iQByJYKxaLeiAQuGEYZhCNRh/T6fQRUjivHPcGDwSglkolHQJvEDpF8gaEzFAo1Adn/wnR5CWw3mq1dhuNRikYDN5D6AR7i7lcbp7GVavVAsdxtmmaBaznADMtRBcrNDmZTHb8fj9xYFk2jzMJrq4hmsX3ajwe79K4VCp1q6rqMYQ5R2jGsqzNRCLxzPM8mSYcDhuTZuQzmcwydRyLxazpGFEUrxyhWcMw9nEV4kaSpG6tVlMm9hfq9fqeVxxMbY0LrOv6IYpIvBAEgcDtAeI0RVGaXjEoQZmF7U9ZlpvD4fALdfC5wR+f2u12p1KpZHu93rb73LZt32g0evhpH+5eph2hDiKRCEG7x8DNu6ZpF5gHzh6FOqENgZHzX+8IIwsuwevkBf8Ffel3YMfJ/RZgALTrMYKs/GM2AAAAAElFTkSuQmCC)";

// new layout
var target = document.getElementsByClassName("clone-options")[0];
if (target)
    newLayout(target);
else
    oldLayout();

function oldLayout() {
    // this is just github!
    if (!document.getElementsByClassName("native-clones").length || !document.getElementsByClassName("public_clone_url").length)
    	return;

    // find the target element
    var target = document.getElementsByClassName("native-clones")[0].getElementsByTagName("li")[0];

    // create a new element
    var li = document.createElement("li");
    var btn = document.createElement("a");
    btn.className = "minibutton";
    btn.href = "#";
    btn.target = "_blank";

    var span = document.createElement("span");
    span.innerHTML = "Cloud9";

    span.style["background-repeat"] = "no-repeat";
    span.style["background-position"] = "left 4px";
    span.style["padding-left"] = "21px";
    span.style["background-image"] = defaultBgImage;
    span.style["margin-left"] = "3px";
    span.style["padding-top"] = "3px";

    btn.appendChild(span);

    /*
    btn.style["background-image"] = "-webkit-gradient(linear, 0% 0%, 0% 100%, from(#15BD3F), to(#1F8739))";
    btn.style["color"] = "white";
    btn.style["text-shadow"] = "1px 1px 0 #009000";
    */

    li.appendChild(btn);

    // adjust URL textbox width
    document.getElementsByClassName("url-field")[0].style.width = '290px';

    // hover state, has to change the background image
    btn.addEventListener("mousemove", function () {
    	span.style["background-image"] = "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAALCAYAAAByF90EAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAaBJREFUeNqUkr9LAmEYx+88iSQaLogbGnKwxaIgoiGIoMXAo9AharRBhMIpAlfbWgxyK/8A3YLGEuKGptAhxGgQHaQLRE/PH3envn1f8UTMpB748N77vN/ny/Pc+7LM7zELFvurBmRQBIT5R9DirUQi4dF1PdntdpVarfaezWYvCSHcXwymwDRYi8fjHhjUYHSD4h0YnTYajSK4nWRAi1fBtiiKBz6f77DVar3A6Bq5lWQy6aCiUCjkbbfbnWg06sV2AbDDJnSzQYtlWU4ZhkFMOp2OG2dz6OoJpk58b1YqlRzVFQqF53Q6fQXjwai8IAi75XI5r2kaGaZer59QAUZzZzKZddqxoiifw5pqtfpoGs3HYrFzjEJGKZVKuUAgsNzXLfn9/qNxOnS1Z4FA4Xl+Bq0zo9hsNnskEnlDtxfQCcFg8HicjmVZBzXS8/n8vdVqNTACMwra/3C5XKlwOOy02+3i6DnHcYzFYnkd/HHMfkZvpNlsElVVCa67B7pRJUmKYVXMHAXPoHchiLsfbwBJJ3gAX2RyaEAC+2bttwADAPspjX3615JXAAAAAElFTkSuQmCC)";
    });
    btn.addEventListener("mouseout", function () {
    	span.style["background-image"] = defaultBgImage;
    });

    btn.addEventListener("click", function () {
    	// what's the clone URL?
    	var cloneUrl;
    	var privateClone = document.getElementsByClassName("private_clone_url")[0];

    	if (privateClone)
    		cloneUrl = privateClone.getElementsByTagName("a")[0].href;
    	else
    		cloneUrl = document.getElementsByClassName("public_clone_url")[0].getElementsByTagName("a")[0].href;

    	cloneUrl = cloneUrl.substring(cloneUrl.indexOf("git@"));

    	var fileMatch = document.location.href.match(/\bblob\b\/(?:[^\/]+)\/(.*)/);
    	if (fileMatch) {
    		cloneUrl += "&file=" + fileMatch[1];
    	}

    	btn.href = "https://c9.io/open/git/?url=" + cloneUrl;

    	return true;
    });

    // and add it to the DOM
    target.parentNode.insertBefore(li, target);
}

function newLayout(target) {
    var link = document.createElement("a");
    link.className = "minibutton sidebar-button c9-button";
    link.title = "Open this repository in Cloud9";
    link.rel = "nofollow";
    link.target = "_blank";

    var isPrivate = document.getElementsByClassName("private").length > 0;
    var user = document.querySelectorAll(".author>a>span")[0].textContent;
    var repo = document.querySelectorAll(".js-current-repository")[0].textContent;

    if (isPrivate)
        var url = "git@github.com:" + user + "/" + repo + ".git";
    else
        var url = "git://github.com/" + user + "/" + repo + ".git";

    link.href = "https://c9.io/open/git/?url=" + url;

    var icon = document.createElement("span");

    link.appendChild(icon);
    link.appendChild(document.createTextNode("Clone in Cloud9"));

    target.parentNode.insertBefore(link, target.nextSibling);
}

})();
<commit_msg>Use simpler functions to get elements from the document<commit_after>(function () {

var defaultBgImage = "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAALCAYAAAByF90EAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAZpJREFUeNp8kr9Lw0AUx5ukTdMfaWvALlKyKKWNGBBxkIjUSagoKbQ4Z01HcayD0MFJcChF7f9Q6lJQQRycpLM4tC4luhVd1Kbn90ojJUYPPlzu7r1vvvfeMYQQ3x9DBPJk/gAvoA+8E6iQByJYKxaLeiAQuGEYZhCNRh/T6fQRUjivHPcGDwSglkolHQJvEDpF8gaEzFAo1Adn/wnR5CWw3mq1dhuNRikYDN5D6AR7i7lcbp7GVavVAsdxtmmaBaznADMtRBcrNDmZTHb8fj9xYFk2jzMJrq4hmsX3ajwe79K4VCp1q6rqMYQ5R2jGsqzNRCLxzPM8mSYcDhuTZuQzmcwydRyLxazpGFEUrxyhWcMw9nEV4kaSpG6tVlMm9hfq9fqeVxxMbY0LrOv6IYpIvBAEgcDtAeI0RVGaXjEoQZmF7U9ZlpvD4fALdfC5wR+f2u12p1KpZHu93rb73LZt32g0evhpH+5eph2hDiKRCEG7x8DNu6ZpF5gHzh6FOqENgZHzX+8IIwsuwevkBf8Ffel3YMfJ/RZgALTrMYKs/GM2AAAAAElFTkSuQmCC)";

// new layout
var target = document.getElementsByClassName("clone-options")[0];
if (target)
    newLayout(target);
else
    oldLayout();

function oldLayout() {
    // this is just github!
    if (!document.getElementsByClassName("native-clones").length || !document.getElementsByClassName("public_clone_url").length)
    	return;

    // find the target element
    var target = document.getElementsByClassName("native-clones")[0].getElementsByTagName("li")[0];

    // create a new element
    var li = document.createElement("li");
    var btn = document.createElement("a");
    btn.className = "minibutton";
    btn.href = "#";
    btn.target = "_blank";

    var span = document.createElement("span");
    span.innerHTML = "Cloud9";

    span.style["background-repeat"] = "no-repeat";
    span.style["background-position"] = "left 4px";
    span.style["padding-left"] = "21px";
    span.style["background-image"] = defaultBgImage;
    span.style["margin-left"] = "3px";
    span.style["padding-top"] = "3px";

    btn.appendChild(span);

    /*
    btn.style["background-image"] = "-webkit-gradient(linear, 0% 0%, 0% 100%, from(#15BD3F), to(#1F8739))";
    btn.style["color"] = "white";
    btn.style["text-shadow"] = "1px 1px 0 #009000";
    */

    li.appendChild(btn);

    // adjust URL textbox width
    document.getElementsByClassName("url-field")[0].style.width = '290px';

    // hover state, has to change the background image
    btn.addEventListener("mousemove", function () {
    	span.style["background-image"] = "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAALCAYAAAByF90EAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAaBJREFUeNqUkr9LAmEYx+88iSQaLogbGnKwxaIgoiGIoMXAo9AharRBhMIpAlfbWgxyK/8A3YLGEuKGptAhxGgQHaQLRE/PH3envn1f8UTMpB748N77vN/ny/Pc+7LM7zELFvurBmRQBIT5R9DirUQi4dF1PdntdpVarfaezWYvCSHcXwymwDRYi8fjHhjUYHSD4h0YnTYajSK4nWRAi1fBtiiKBz6f77DVar3A6Bq5lWQy6aCiUCjkbbfbnWg06sV2AbDDJnSzQYtlWU4ZhkFMOp2OG2dz6OoJpk58b1YqlRzVFQqF53Q6fQXjwai8IAi75XI5r2kaGaZer59QAUZzZzKZddqxoiifw5pqtfpoGs3HYrFzjEJGKZVKuUAgsNzXLfn9/qNxOnS1Z4FA4Xl+Bq0zo9hsNnskEnlDtxfQCcFg8HicjmVZBzXS8/n8vdVqNTACMwra/3C5XKlwOOy02+3i6DnHcYzFYnkd/HHMfkZvpNlsElVVCa67B7pRJUmKYVXMHAXPoHchiLsfbwBJJ3gAX2RyaEAC+2bttwADAPspjX3615JXAAAAAElFTkSuQmCC)";
    });
    btn.addEventListener("mouseout", function () {
    	span.style["background-image"] = defaultBgImage;
    });

    btn.addEventListener("click", function () {
    	// what's the clone URL?
    	var cloneUrl;
    	var privateClone = document.getElementsByClassName("private_clone_url")[0];

    	if (privateClone)
    		cloneUrl = privateClone.getElementsByTagName("a")[0].href;
    	else
    		cloneUrl = document.getElementsByClassName("public_clone_url")[0].getElementsByTagName("a")[0].href;

    	cloneUrl = cloneUrl.substring(cloneUrl.indexOf("git@"));

    	var fileMatch = document.location.href.match(/\bblob\b\/(?:[^\/]+)\/(.*)/);
    	if (fileMatch) {
    		cloneUrl += "&file=" + fileMatch[1];
    	}

    	btn.href = "https://c9.io/open/git/?url=" + cloneUrl;

    	return true;
    });

    // and add it to the DOM
    target.parentNode.insertBefore(li, target);
}

function newLayout(target) {
    var link = document.createElement("a");
    link.className = "minibutton sidebar-button c9-button";
    link.title = "Open this repository in Cloud9";
    link.rel = "nofollow";
    link.target = "_blank";

    var isPrivate = document.getElementsByClassName("private").length > 0;
    var user = document.querySelector(".author>a>span").textContent;
    var repo = document.getElementsByClassName(
        "js-current-repository")[0].textContent;

    if (isPrivate)
        var url = "git@github.com:" + user + "/" + repo + ".git";
    else
        var url = "git://github.com/" + user + "/" + repo + ".git";

    link.href = "https://c9.io/open/git/?url=" + url;

    var icon = document.createElement("span");

    link.appendChild(icon);
    link.appendChild(document.createTextNode("Clone in Cloud9"));

    target.parentNode.insertBefore(link, target.nextSibling);
}

})();
<|endoftext|>


<commit_before>'use strict';

var matrixToCSS = require('matrix-to-css');
var mat4 = require('gl-mat4');
var createMesh = require('gl-mesh');
var glslify = require('glslify');

module.exports = function(element, opts) {
  return new GLCSS3D(element, opts);
};

function GLCSS3D(element, opts) {
  if (!element) throw new Error('gl-css3d requires element');

  var domElement = document.createElement('div');
  domElement.style.transformStyle = domElement.style.webkitTransformStyle = 'preserve-3d';
  domElement.style.overflow = 'hidden';
  domElement.style.pointerEvents = 'none';
  domElement.style.position = 'absolute';
  domElement.style.zIndex = '-1'; // below WebGL canvas
  domElement.style.top = '0';
  domElement.style.left = '0';
  domElement.style.margin = '0';
  domElement.style.padding = '0';

  var cameraElement = document.createElement('div');
  cameraElement.style.position = 'absolute';
  cameraElement.style.transformStyle = cameraElement.style.webkitTransformStyle = 'preserve-3d';
  //cameraElement.style.display = 'none';
  cameraElement.style.pointerEvents = 'auto'; // allow mouse interaction

  cameraElement.appendChild(element);

  domElement.appendChild(cameraElement);
  document.body.appendChild(domElement);

  this.domElement = domElement;
  this.cameraElement = cameraElement;

  opts = opts || {};

  this.planeWidth = opts.planeWidth || 2; // assume -1 to +1
  this.planeHeight = opts.planeHeight || 2;
  //this.tint = opts.tint || [0.5,0,0,0]; // reddish tint, etc.. useful? (note gl blending mode)
  this.tint = opts.tint || [0,0,0,0]; // fully transparent
  this.blend = (opts.blend !== undefined) ? opts.blend : false; // overwrite transparent color
  this.flipX = (opts.flipX !== undefined) ? opts.flipX : true;
  this.flipY = (opts.flipY !== undefined) ? opts.flipY : true;

  this.cutoutMesh = null;
  this.cutoutShader = null;
  this.gl = null;
}

GLCSS3D.prototype.ginit = function(gl) {
  this.gl = gl;
  var hx = this.planeWidth / 2;
  var hy = this.planeHeight / 2;
  this.cutoutMesh = createMesh(gl,
        [
        [2, 1, 0],
        [3, 1, 2]
         ],
        { "position": [
          [-hx, -hy, 0],
          [-hx, +hy, 0],
          [+hx, -hy, 0],
          [+hx, +hy, 0]] })

  this.cutoutShader = glslify({
      inline: true,
      vertex: "\
  attribute vec3 position;\
  \
  uniform mat4 projection;\
  uniform mat4 view;\
  \
  void main() {\
    gl_Position = projection * view * vec4(position, 1.0);\
  }",

    // color it all transparent so CSS element is visible through
    fragment: "\
  precision highp float;\
  uniform vec4 color;\
  \
  void main() {\
    gl_FragColor = color;\
  }"})(gl)
};

GLCSS3D.prototype.updatePerspective = function(cameraFOVradians, width, height) {
  // CSS world perspective - only needs to change on gl-resize (not each rendering tick)
  var fovPx = 0.5 / Math.tan(cameraFOVradians / 2) * height;
  this.domElement.style.perspective = this.domElement.style.webkitPerspective = fovPx + 'px';
  //domElement.style.perspectiveOrigin = '50% 50%'; // already is the default
  this.domElement.style.width = width + 'px';
  this.domElement.style.height = height + 'px';

  this.fovPx = fovPx;

  // CSS camera element child
  this.cameraElement.style.width = width + 'px';
  this.cameraElement.style.height = height + 'px';

  this.width = width;
  this.height = height;
};

var cssMatrix = mat4.create();

GLCSS3D.prototype.updateView = function(view) {
  var scaleX = this.planeWidth / this.width;
  var scaleY = this.planeHeight / this.height;
  var scaleZ = 1;
  if (this.flipX) scaleX = -scaleX;
  if (this.flipY) scaleY = -scaleY;
  mat4.scale(cssMatrix, view, [scaleX, scaleY, scaleZ]);

  // three.js CSS3Renderer getCameraCSSMatrix inverts these to fix flipped rotation orientation
  // TODO: matrix transformation instead?
  cssMatrix[1] = -cssMatrix[1];
  cssMatrix[5] = -cssMatrix[5];
  cssMatrix[9] = -cssMatrix[9];
  cssMatrix[13] = -cssMatrix[13];

  this.cameraElement.style.transform = this.cameraElement.style.webkitTransform = 'translateZ('+this.fovPx+'px) ' + matrixToCSS(cssMatrix);
};

GLCSS3D.prototype.renderCutout = function(view, proj) {
  this.cutoutShader.bind()
  this.cutoutShader.attributes.position.location = 0

  this.cutoutShader.uniforms.projection = proj
  this.cutoutShader.uniforms.view = view
  this.cutoutShader.uniforms.color = this.tint

  this.cutoutMesh.bind(this.cutoutShader)

  if (!this.blend) this.gl.disable(this.gl.BLEND);
  this.cutoutMesh.draw()
  if (!this.blend) this.gl.enable(this.gl.BLEND); // TODO: use module to push/restore gl state?

  this.cutoutMesh.unbind()
};

GLCSS3D.prototype.render = function(view, proj) {
  this.updateView(view);
  this.renderCutout(view, proj);
};
<commit_msg>Add backface of mesh by default. Closes https://github.com/deathcap/voxel-webview/issues/11<commit_after>'use strict';

var matrixToCSS = require('matrix-to-css');
var mat4 = require('gl-mat4');
var createMesh = require('gl-mesh');
var glslify = require('glslify');

module.exports = function(element, opts) {
  return new GLCSS3D(element, opts);
};

function GLCSS3D(element, opts) {
  if (!element) throw new Error('gl-css3d requires element');

  var domElement = document.createElement('div');
  domElement.style.transformStyle = domElement.style.webkitTransformStyle = 'preserve-3d';
  domElement.style.overflow = 'hidden';
  domElement.style.pointerEvents = 'none';
  domElement.style.position = 'absolute';
  domElement.style.zIndex = '-1'; // below WebGL canvas
  domElement.style.top = '0';
  domElement.style.left = '0';
  domElement.style.margin = '0';
  domElement.style.padding = '0';

  var cameraElement = document.createElement('div');
  cameraElement.style.position = 'absolute';
  cameraElement.style.transformStyle = cameraElement.style.webkitTransformStyle = 'preserve-3d';
  //cameraElement.style.display = 'none';
  cameraElement.style.pointerEvents = 'auto'; // allow mouse interaction

  cameraElement.appendChild(element);

  domElement.appendChild(cameraElement);
  document.body.appendChild(domElement);

  this.domElement = domElement;
  this.cameraElement = cameraElement;

  opts = opts || {};

  this.planeWidth = opts.planeWidth || 2; // assume -1 to +1
  this.planeHeight = opts.planeHeight || 2;
  //this.tint = opts.tint || [0.5,0,0,0]; // reddish tint, etc.. useful? (note gl blending mode)
  this.tint = opts.tint || [0,0,0,0]; // fully transparent
  this.blend = (opts.blend !== undefined) ? opts.blend : false; // overwrite transparent color
  this.flipX = (opts.flipX !== undefined) ? opts.flipX : true;
  this.flipY = (opts.flipY !== undefined) ? opts.flipY : true;
  this.backface = (opts.backface !== undefined) ? opts.backface : true;

  this.cutoutMesh = null;
  this.cutoutShader = null;
  this.gl = null;
}

GLCSS3D.prototype.ginit = function(gl) {
  this.gl = gl;
  var hx = this.planeWidth / 2;
  var hy = this.planeHeight / 2;

  var indices =
    // triangles forming a rectangle for the front face
    [
        [2, 1, 0],
        [3, 1, 2]
    ];

  if (this.backface) {
    indices.push([0, 1, 2]);
    indices.push([2, 1, 3]);
  }

  this.cutoutMesh = createMesh(gl, indices,
        { "position": [
          [-hx, -hy, 0],
          [-hx, +hy, 0],
          [+hx, -hy, 0],
          [+hx, +hy, 0]] })

  this.cutoutShader = glslify({
      inline: true,
      vertex: "\
  attribute vec3 position;\
  \
  uniform mat4 projection;\
  uniform mat4 view;\
  \
  void main() {\
    gl_Position = projection * view * vec4(position, 1.0);\
  }",

    // color it all transparent so CSS element is visible through
    fragment: "\
  precision highp float;\
  uniform vec4 color;\
  \
  void main() {\
    gl_FragColor = color;\
  }"})(gl)
};

GLCSS3D.prototype.updatePerspective = function(cameraFOVradians, width, height) {
  // CSS world perspective - only needs to change on gl-resize (not each rendering tick)
  var fovPx = 0.5 / Math.tan(cameraFOVradians / 2) * height;
  this.domElement.style.perspective = this.domElement.style.webkitPerspective = fovPx + 'px';
  //domElement.style.perspectiveOrigin = '50% 50%'; // already is the default
  this.domElement.style.width = width + 'px';
  this.domElement.style.height = height + 'px';

  this.fovPx = fovPx;

  // CSS camera element child
  this.cameraElement.style.width = width + 'px';
  this.cameraElement.style.height = height + 'px';

  this.width = width;
  this.height = height;
};

var cssMatrix = mat4.create();

GLCSS3D.prototype.updateView = function(view) {
  var scaleX = this.planeWidth / this.width;
  var scaleY = this.planeHeight / this.height;
  var scaleZ = 1;
  if (this.flipX) scaleX = -scaleX;
  if (this.flipY) scaleY = -scaleY;
  mat4.scale(cssMatrix, view, [scaleX, scaleY, scaleZ]);

  // three.js CSS3Renderer getCameraCSSMatrix inverts these to fix flipped rotation orientation
  // TODO: matrix transformation instead?
  cssMatrix[1] = -cssMatrix[1];
  cssMatrix[5] = -cssMatrix[5];
  cssMatrix[9] = -cssMatrix[9];
  cssMatrix[13] = -cssMatrix[13];

  this.cameraElement.style.transform = this.cameraElement.style.webkitTransform = 'translateZ('+this.fovPx+'px) ' + matrixToCSS(cssMatrix);
};

GLCSS3D.prototype.renderCutout = function(view, proj) {
  this.cutoutShader.bind()
  this.cutoutShader.attributes.position.location = 0

  this.cutoutShader.uniforms.projection = proj
  this.cutoutShader.uniforms.view = view
  this.cutoutShader.uniforms.color = this.tint

  this.cutoutMesh.bind(this.cutoutShader)

  if (!this.blend) this.gl.disable(this.gl.BLEND);
  this.cutoutMesh.draw()
  if (!this.blend) this.gl.enable(this.gl.BLEND); // TODO: use module to push/restore gl state?

  this.cutoutMesh.unbind()
};

GLCSS3D.prototype.render = function(view, proj) {
  this.updateView(view);
  this.renderCutout(view, proj);
};
<|endoftext|>


<commit_before>(function () {
    'use strict';

    /**
     * @ngdoc directive
     * @name talend.widget.directive:TalendDatetimePicker
     * @description This directive create a datetimepicker element.

     * Key action :
     *

     *
ESC : close the dropdown

     *

     * @restrict EA
     * @usage
     */
    function TalendDatetimePicker() {

        return {
            restrict: 'E',
            replace: true,
            transclude: true,
            templateUrl: 'components/widgets/datetimepicker/datetimepicker.html',
            scope: {
                closeOnSelect: '=',
                onOpen: '&',
                value: '=ngModel'
            },
            bindToController: true,
            controller: function () {
            },
            controllerAs: 'ctrl',
            link: function (scope, element, attributes) {

              Date.parseDate = function(input, format ){
                return moment(input,format).toDate();
              };
              Date.prototype.dateFormat = function( format ){
                return moment(this).format(format);
              };

              var format = attributes.format?attributes.format:'DD/MM/YYYY hh:mm:ss';
              var formatTime = attributes.formatTime?attributes.formatTime:'hh:mm:ss';
              var formatDate = attributes.formatDate?attributes.formatDate:'DD/MM/YYYY';

              var dateInput = angular.element('.datetimepicker');
              dateInput.datetimepicker({
                    format: format,
                    formatTime: formatTime,
                    formatDate:formatDate
                  }
              );

              /**
               * @ngdoc method
               * @name hideCalendar
               * @methodOf talend.widget.directive:TalendDatetimePicker
               * @description [PRIVATE] hide calendar widget
               */
              function hideCalendar(){
                dateInput.datetimepicker("hide");
              };

              /**
               * @ngdoc method
               * @name attachKeyMap
               * @methodOf talend.widget.directive:TalendDatetimePicker
               * @description [PRIVATE] Attach ESC actions
               *

               *
ESC : hide the calendar

               *

               */
               function attachKeyMap() {
                dateInput.bind('keydown', function (event) {

                  // hide calendar on 'ESC' keydown
                  if (event.keyCode === 27) {
                    hideCalendar();
                    event.stopPropagation();
                  }
                });
              };

              attachKeyMap();

            }
        };

    }

    angular.module('talend.widget')
        .directive('talendDatetimePicker', TalendDatetimePicker);
})();
<commit_msg>[TDP-173] fix gulp warning<commit_after>(function () {
    'use strict';

    /**
     * @ngdoc directive
     * @name talend.widget.directive:TalendDatetimePicker
     * @description This directive create a datetimepicker element.

     * Key action :
     *

     *
ESC : close the dropdown

     *

     * @restrict EA
     * @usage
     */
    function TalendDatetimePicker() {

        return {
            restrict: 'E',
            replace: true,
            transclude: true,
            templateUrl: 'components/widgets/datetimepicker/datetimepicker.html',
            scope: {
                closeOnSelect: '=',
                onOpen: '&',
                value: '=ngModel'
            },
            bindToController: true,
            controller: function () {
            },
            controllerAs: 'ctrl',
            link: function (scope, element, attributes) {

              Date.parseDate = function(input, format ){
                return moment(input,format).toDate();
              };
              Date.prototype.dateFormat = function( format ){
                return moment(this).format(format);
              };

              var format = attributes.format?attributes.format:'DD/MM/YYYY hh:mm:ss';
              var formatTime = attributes.formatTime?attributes.formatTime:'hh:mm:ss';
              var formatDate = attributes.formatDate?attributes.formatDate:'DD/MM/YYYY';

              var dateInput = angular.element('.datetimepicker');
              dateInput.datetimepicker({
                    format: format,
                    formatTime: formatTime,
                    formatDate:formatDate
                  }
              );

              /**
               * @ngdoc method
               * @name hideCalendar
               * @methodOf talend.widget.directive:TalendDatetimePicker
               * @description [PRIVATE] hide calendar widget
               */
              var hideCalendar = function(){
                dateInput.datetimepicker('hide4');
              };

              /**
               * @ngdoc method
               * @name attachKeyMap
               * @methodOf talend.widget.directive:TalendDatetimePicker
               * @description [PRIVATE] Attach ESC actions
               *

               *
ESC : hide the calendar

               *

               */
               var attachKeyMap = function() {
                 dateInput.bind('keydown', function (event) {

                  // hide calendar on 'ESC' keydown
                   if (event.keyCode === 27) {
                     hideCalendar();
                     event.stopPropagation();
                   }
                });
              };

              attachKeyMap();

            }
        };

    }

    angular.module('talend.widget')
        .directive('talendDatetimePicker', TalendDatetimePicker);
})();
<|endoftext|>


<commit_before>/*
*	MAIN JS FILE for Willsong Ghost Theme
*
*	If you want to edit, add or remove any functionality
*	feel free to contact the author marcos@aftertype.com
*
*	Require.js is used for performance optimization,
*	call the required scripts on context
*	and execute extra Services.
*/

requirejs.config({
	paths: {
    jquery: 'jquery',
		velocity: '//cdn.jsdelivr.net/velocity/1.1.0/', //jquery.velocity.min & velocity.ui.min.
		fitvids: '//cdn.jsdelivr.net/fitvids/1.1.0/jquery.fitvids',
		prettify: '//cdn.jsdelivr.net/prettify/0.1/prettify',
		livefyre: '//zor.livefyre.com/wjs/v3.0/javascripts/livefyre',
		adds: 'adds'
	}
});

requirejs(
[
  'jquery',
	'velocity/velocity.min',
	'fitvids'
],
function ($){
// ===============================
// Start User Config.
// ===============================
var _uconfig = {
  _userCustomScripts: [],
  socialProfiles: [],
  widgetsConfig: {
    _active: false
  },
  commentsSystem: {
    _active: true,
    type: 'disqus',
    idOrShortname: 'akveo',
    appID: 'akveo'
  }
};

if (_uconfig._userCustomScripts.length > 0) {
	require(_uconfig._userCustomScripts, function(){});
};

// ===============================
// Define recurrernt vars.
// ===============================
var _window = $(window),
	_body = $('body'),
	_topMenu = $('#top-menu-wsong'),
	_mobileMenuBtn = $('#mobile-menu-btn-wsong'),
	_mobileMenuIcon = $('#mobile-menu-btn-wsong span'),
	_inPostContent = $('#in-post-content'),
	_inPostImage = $('#in-post-content img'),
	_cTemplate = '';

// ===============================
// Get current template
// ===============================
if (_body.hasClass('home-template')) {_cTemplate = 'home'};
if (_body.hasClass('post-template')) {_cTemplate = 'post-page'};

// ===============================
// DynaWidgets
// ===============================
if (_uconfig.widgetsConfig._active) {
require(['adds/dynawidgets'], function (dynarender){
	dynarender( _uconfig.widgetsConfig );
});
};

// ===============================
// SocialProfiles
// ===============================
if (_uconfig.socialProfiles._active) {
	$.each(_uconfig.socialProfiles.items, function (key, profile){
		var sLink = '';
		$('#dynasocial-links').append(sLink);
	});
};

// ===============================
// Comments System
// ===============================
if (_uconfig.commentsSystem._active) {
	require(['adds/dynacomments'], function (dynacomments){
		if (_uconfig.commentsSystem.type == 'disqus') {
			dynacomments.disqus(_uconfig.commentsSystem.idOrShortname);
		};

		if (_uconfig.commentsSystem.type == 'livefyre') {
			require(['livefyre'], function (){
				dynacomments.livefyre(_uconfig.commentsSystem.idOrShortname);
			});
		};

		if (_uconfig.commentsSystem.type == 'facebook') {
			dynacomments.facebook(_uconfig.commentsSystem.appID);
		};
	});
} else {
	$('#dynacomments').remove();
};

// ===============================
// Parallax
// ===============================

// Element Schemas to parallax
var scrollTop = _window.scrollTop(),
	homeHeadHeight = $('#inside-head-wsong').height() + 134,
	blogCover = {
		alias: $('#inside-head-cover-wsong'),
		slowness: 0.4
	},
	diffElems = {
		alias: $('.diffuse-elements'),
		slowness: 0.5
	};

// Functions to run the parallax
function updateParallax(){
	window.requestAnimationFrame(function(){
		setScrollTops();
		animateElements();
	});
}

function setScrollTops() {
	scrollTop = _window.scrollTop();
}

function animateElements() {
	blogCover.alias.css({
		'opacity' : 0.2 + ( 0.8 * (scrollTop / homeHeadHeight)),
		'padding-top' : scrollTop * blogCover.slowness
	});
	diffElems.alias.css({
		'opacity' : 1 - (scrollTop / homeHeadHeight)
	});
}

// Run Parallax
scrollIntervalID = setInterval(updateParallax, 10);

// ===============================
// Mobile Menu
// ===============================
_mobileMenuBtn.click(function (){
	_topMenu.toggleClass('mmenushow');
	_mobileMenuBtn.toggleClass('giro');
	_mobileMenuIcon.toggleClass('fa-reorder fa-times');
});

// ===============================
// Styling Helpers
// ===============================
if (_cTemplate = 'post-page') {
	_inPostImage.each(function (index){
		if($(this).width() < 656){
			$(this).addClass('small-image');
		};
	});

	require(['fitvids'], function(){
		$('#in-post-content').fitVids();
	});

	require(['prettify'], function(){
		$('pre').addClass('prettyprint');
		prettyPrint();
	});
};

});<commit_msg>Github acc added.<commit_after>/*
*	MAIN JS FILE for Willsong Ghost Theme
*
*	If you want to edit, add or remove any functionality
*	feel free to contact the author marcos@aftertype.com
*
*	Require.js is used for performance optimization,
*	call the required scripts on context
*	and execute extra Services.
*/

requirejs.config({
	paths: {
    jquery: 'jquery',
		velocity: '//cdn.jsdelivr.net/velocity/1.1.0/', //jquery.velocity.min & velocity.ui.min.
		fitvids: '//cdn.jsdelivr.net/fitvids/1.1.0/jquery.fitvids',
		prettify: '//cdn.jsdelivr.net/prettify/0.1/prettify',
		livefyre: '//zor.livefyre.com/wjs/v3.0/javascripts/livefyre',
		adds: 'adds'
	}
});

requirejs(
[
  'jquery',
	'velocity/velocity.min',
	'fitvids'
],
function ($){
// ===============================
// Start User Config.
// ===============================
var _uconfig = {
  _userCustomScripts: [],
  socialProfiles: {
    _active: true,
    items: [
      {
        site: 'github',
        url: '//github.com/akveo'
      }
    ]
  },
  widgetsConfig: {
    _active: false
  },
  commentsSystem: {
    _active: true,
    type: 'disqus',
    idOrShortname: 'akveo',
    appID: 'akveo'
  }
};

if (_uconfig._userCustomScripts.length > 0) {
	require(_uconfig._userCustomScripts, function(){});
};

// ===============================
// Define recurrernt vars.
// ===============================
var _window = $(window),
	_body = $('body'),
	_topMenu = $('#top-menu-wsong'),
	_mobileMenuBtn = $('#mobile-menu-btn-wsong'),
	_mobileMenuIcon = $('#mobile-menu-btn-wsong span'),
	_inPostContent = $('#in-post-content'),
	_inPostImage = $('#in-post-content img'),
	_cTemplate = '';

// ===============================
// Get current template
// ===============================
if (_body.hasClass('home-template')) {_cTemplate = 'home'};
if (_body.hasClass('post-template')) {_cTemplate = 'post-page'};

// ===============================
// DynaWidgets
// ===============================
if (_uconfig.widgetsConfig._active) {
require(['adds/dynawidgets'], function (dynarender){
	dynarender( _uconfig.widgetsConfig );
});
};

// ===============================
// SocialProfiles
// ===============================
if (_uconfig.socialProfiles._active) {
	$.each(_uconfig.socialProfiles.items, function (key, profile){
		var sLink = '';
		$('#dynasocial-links').append(sLink);
	});
};

// ===============================
// Comments System
// ===============================
if (_uconfig.commentsSystem._active) {
	require(['adds/dynacomments'], function (dynacomments){
		if (_uconfig.commentsSystem.type == 'disqus') {
			dynacomments.disqus(_uconfig.commentsSystem.idOrShortname);
		};

		if (_uconfig.commentsSystem.type == 'livefyre') {
			require(['livefyre'], function (){
				dynacomments.livefyre(_uconfig.commentsSystem.idOrShortname);
			});
		};

		if (_uconfig.commentsSystem.type == 'facebook') {
			dynacomments.facebook(_uconfig.commentsSystem.appID);
		};
	});
} else {
	$('#dynacomments').remove();
};

// ===============================
// Parallax
// ===============================

// Element Schemas to parallax
var scrollTop = _window.scrollTop(),
	homeHeadHeight = $('#inside-head-wsong').height() + 134,
	blogCover = {
		alias: $('#inside-head-cover-wsong'),
		slowness: 0.4
	},
	diffElems = {
		alias: $('.diffuse-elements'),
		slowness: 0.5
	};

// Functions to run the parallax
function updateParallax(){
	window.requestAnimationFrame(function(){
		setScrollTops();
		animateElements();
	});
}

function setScrollTops() {
	scrollTop = _window.scrollTop();
}

function animateElements() {
	blogCover.alias.css({
		'opacity' : 0.2 + ( 0.8 * (scrollTop / homeHeadHeight)),
		'padding-top' : scrollTop * blogCover.slowness
	});
	diffElems.alias.css({
		'opacity' : 1 - (scrollTop / homeHeadHeight)
	});
}

// Run Parallax
scrollIntervalID = setInterval(updateParallax, 10);

// ===============================
// Mobile Menu
// ===============================
_mobileMenuBtn.click(function (){
	_topMenu.toggleClass('mmenushow');
	_mobileMenuBtn.toggleClass('giro');
	_mobileMenuIcon.toggleClass('fa-reorder fa-times');
});

// ===============================
// Styling Helpers
// ===============================
if (_cTemplate = 'post-page') {
	_inPostImage.each(function (index){
		if($(this).width() < 656){
			$(this).addClass('small-image');
		};
	});

	require(['fitvids'], function(){
		$('#in-post-content').fitVids();
	});

	require(['prettify'], function(){
		$('pre').addClass('prettyprint');
		prettyPrint();
	});
};

});<|endoftext|>


<commit_before>const errors = require('@tryghost/errors');
const ghostBookshelf = require('./base');

const MemberStatusEvent = ghostBookshelf.Model.extend({
    tableName: 'members_status_events',

    member() {
        return this.belongsTo('Member', 'member_id', 'id');
    },

    customQuery(qb, options) {
        if (options.aggregateStatusCounts) {
            if (options.limit || options.filter) {
                throw new errors.IncorrectUsageError('aggregateStatusCounts does not work when passed a filter or limit');
            }
            const knex = ghostBookshelf.knex;
            return qb.clear('select')
                .select(knex.raw('DATE(created_at) as date'))
                .select(knex.raw(`SUM(
                    CASE WHEN to_status IN ('paid', 'comped') THEN 1
                    WHEN from_status IN ('paid', 'comped') THEN -1
                    ELSE 0
                    END
                ) as paid_delta`))
                .select(knex.raw(`0 as comped_delta`))
                .select(knex.raw(`SUM(
                    CASE WHEN to_status='free' THEN 1
                    WHEN from_status='free' THEN -1
                    ELSE 0 END
                ) as free_delta`))
                .groupByRaw('DATE(created_at)')
                .orderByRaw('DATE(created_at)');
        }
    }
}, {
    permittedOptions(methodName) {
        const options = ghostBookshelf.Model.permittedOptions.call(this, methodName);

        if (methodName === 'findAll') {
            return options.concat('aggregateStatusCounts');
        }

        return options;
    },
    async edit() {
        throw new errors.IncorrectUsageError('Cannot edit MemberStatusEvent');
    },

    async destroy() {
        throw new errors.IncorrectUsageError('Cannot destroy MemberStatusEvent');
    }
});

const MemberStatusEvents = ghostBookshelf.Collection.extend({
    model: MemberStatusEvent
});

module.exports = {
    MemberStatusEvent: ghostBookshelf.model('MemberStatusEvent', MemberStatusEvent),
    MemberStatusEvents: ghostBookshelf.collection('MemberStatusEvents', MemberStatusEvents)
};
<commit_msg>Readded support for comped status in event aggregate (#13142)<commit_after>const errors = require('@tryghost/errors');
const ghostBookshelf = require('./base');

const MemberStatusEvent = ghostBookshelf.Model.extend({
    tableName: 'members_status_events',

    member() {
        return this.belongsTo('Member', 'member_id', 'id');
    },

    customQuery(qb, options) {
        if (options.aggregateStatusCounts) {
            if (options.limit || options.filter) {
                throw new errors.IncorrectUsageError('aggregateStatusCounts does not work when passed a filter or limit');
            }
            const knex = ghostBookshelf.knex;
            return qb.clear('select')
                .select(knex.raw('DATE(created_at) as date'))
                .select(knex.raw(`SUM(
                    CASE WHEN to_status='paid' THEN 1
                    WHEN from_status='paid' THEN -1
                    ELSE 0 END
                ) as paid_delta`))
                .select(knex.raw(`SUM(
                    CASE WHEN to_status='comped' THEN 1
                    WHEN from_status='comped' THEN -1
                    ELSE 0 END
                ) as comped_delta`))
                .select(knex.raw(`SUM(
                    CASE WHEN to_status='free' THEN 1
                    WHEN from_status='free' THEN -1
                    ELSE 0 END
                ) as free_delta`))
                .groupByRaw('DATE(created_at)')
                .orderByRaw('DATE(created_at)');
        }
    }
}, {
    permittedOptions(methodName) {
        const options = ghostBookshelf.Model.permittedOptions.call(this, methodName);

        if (methodName === 'findAll') {
            return options.concat('aggregateStatusCounts');
        }

        return options;
    },
    async edit() {
        throw new errors.IncorrectUsageError('Cannot edit MemberStatusEvent');
    },

    async destroy() {
        throw new errors.IncorrectUsageError('Cannot destroy MemberStatusEvent');
    }
});

const MemberStatusEvents = ghostBookshelf.Collection.extend({
    model: MemberStatusEvent
});

module.exports = {
    MemberStatusEvent: ghostBookshelf.model('MemberStatusEvent', MemberStatusEvent),
    MemberStatusEvents: ghostBookshelf.collection('MemberStatusEvents', MemberStatusEvents)
};
<|endoftext|>


<commit_before>import fromMask from './creator/fromMask';
import fromExtrema from './creator/fromExtrema';
import fromPoints from './creator/fromPoints';
import createROI from './createROI';
import extendObject from 'extend';

export default class ROIManager {

    constructor(image, options = {}) {
        this._image = image;
        this._options = options;
        if (!this._options.lebel) this._options.label = 'default';
        this._layers = {};
        this._painted = null;
    }

    generateROIFromExtrema(options = {}) {
        let opt = extendObject({}, this._options, options);
        let roiMap = fromExtrema.call(this._image, options);
        this._layers[opt.label] = new ROILayer(roiMap, opt);
    }

    generateROIFromPoints(points, options = {}) {
        let opt = extendObject({}, this._options, options);
        let roiMap = fromPoints.call(this._image, points, options);
        this._layers[opt.label] = new ROILayer(roiMap, opt);
    }

    putMask(mask, options = {}) {
        let opt = extendObject({}, this._options, options);
        let roiMap = fromMask.call(this._image, mask, options);
        this._layers[opt.label] = new ROILayer(roiMap, opt);
    }

    getROIMap(options = {}) {
        let opt = extendObject({}, this._options, options);
        if (!this._layers[opt.label]) return;
        return this._layers[opt.label].roiMap;
    }

    getROIIDs(options = {}) {
        let rois = this.getROI(options);
        if (!rois) return;
        let ids = new Array(rois.length);
        for (let i = 0; i < rois.length; i++) {
            ids[i] = rois[i].id;
        }
        return ids;
    }

    getROI({
        label = this._options.label,
        positive = true,
        negative = true,
        minSurface = 0,
        maxSurface = Number.POSITIVE_INFINITY
        } = {}) {

        let allROIs = this._layers[label].roi;
        let rois = new Array(allROIs.length);
        let ptr = 0;
        for (let i = 0; i < allROIs.length; i++) {
            let roi = allROIs[i];
            if (((roi.id < 0 && negative) || roi.id > 0 && positive)
                && roi.surface > minSurface
                && roi.surface < maxSurface) {
                rois[ptr++] = roi;
            }
        }
        rois.length = ptr;
        return rois;
    }

    getROIMasks(options = {}) {
        let rois = this.getROI(options);
        let masks = new Array(rois.length);
        for (let i = 0; i < rois.length; i++) {
            masks[i] = rois[i].mask;
        }
        return masks;
    }

    getPixels(options = {}) {
        let opt = extendObject({}, this._options, options);
        if (this._layers[opt.label]) {
            return this._layers[opt.label].roiMap.pixels;
        }
    }

    paint(options = {}) {
        if (!this._painted) this._painted = this._image.rgba8();
        let masks = this.getROIMasks(options);
        this._painted.paintMasks(masks, options);
        return this._painted;
    }

    resetPainted(image) {
        this._painted = image;
    }
}

class ROILayer {
    constructor(roiMap, options) {
        this.roiMap = roiMap;
        this.options = options;
        this.roi = createROI(this.roiMap);
    }
}
<commit_msg>Add getMask to ROIManager to get a mask based on the selection or ROI<commit_after>import fromMask from './creator/fromMask';
import fromExtrema from './creator/fromExtrema';
import fromPoints from './creator/fromPoints';
import createROI from './createROI';
import extendObject from 'extend';
import Image from '../image';

export default class ROIManager {

    constructor(image, options = {}) {
        this._image = image;
        this._options = options;
        if (!this._options.lebel) this._options.label = 'default';
        this._layers = {};
        this._painted = null;
    }

    generateROIFromExtrema(options = {}) {
        let opt = extendObject({}, this._options, options);
        let roiMap = fromExtrema.call(this._image, options);
        this._layers[opt.label] = new ROILayer(roiMap, opt);
    }

    generateROIFromPoints(points, options = {}) {
        let opt = extendObject({}, this._options, options);
        let roiMap = fromPoints.call(this._image, points, options);
        this._layers[opt.label] = new ROILayer(roiMap, opt);
    }

    putMask(mask, options = {}) {
        let opt = extendObject({}, this._options, options);
        let roiMap = fromMask.call(this._image, mask, options);
        this._layers[opt.label] = new ROILayer(roiMap, opt);
    }

    getROIMap(options = {}) {
        let opt = extendObject({}, this._options, options);
        if (!this._layers[opt.label]) return;
        return this._layers[opt.label].roiMap;
    }

    getROIIDs(options = {}) {
        let rois = this.getROI(options);
        if (!rois) return;
        let ids = new Array(rois.length);
        for (let i = 0; i < rois.length; i++) {
            ids[i] = rois[i].id;
        }
        return ids;
    }

    getROI({
        label = this._options.label,
        positive = true,
        negative = true,
        minSurface = 0,
        maxSurface = Number.POSITIVE_INFINITY
        } = {}) {

        let allROIs = this._layers[label].roi;
        let rois = new Array(allROIs.length);
        let ptr = 0;
        for (let i = 0; i < allROIs.length; i++) {
            let roi = allROIs[i];
            if (((roi.id < 0 && negative) || roi.id > 0 && positive)
                && roi.surface > minSurface
                && roi.surface < maxSurface) {
                rois[ptr++] = roi;
            }
        }
        rois.length = ptr;
        return rois;
    }

    getROIMasks(options = {}) {
        let rois = this.getROI(options);
        let masks = new Array(rois.length);
        for (let i = 0; i < rois.length; i++) {
            masks[i] = rois[i].mask;
        }
        return masks;
    }

    getPixels(options = {}) {
        let opt = extendObject({}, this._options, options);
        if (this._layers[opt.label]) {
            return this._layers[opt.label].roiMap.pixels;
        }
    }

    paint(options = {}) {
        if (!this._painted) this._painted = this._image.rgba8();
        let masks = this.getROIMasks(options);
        this._painted.paintMasks(masks, options);
        return this._painted;
    }

    // return a mask corresponding to all the selected masks
    getMask(options = {}) {
        let mask = Image.create(this._image.width, this._image.height, {kind:'BINARY'});
        let masks = this.getROIMasks(options);
        for (let i = 0; i < masks.length; i++) {
            let roi = masks[i];
            // we need to find the parent image to calculate the relative position

            for (let x = 0; x < roi.width; x++) {
                for (let y = 0; y < roi.height; y++) {
                    if (roi.getBitXY(x, y)) {
                        mask.setBitXY(x + roi.position[0], y + roi.position[1]);
                    }
                }
            }
        }
        return mask;
    }

    resetPainted(image) {
        this._painted = image;
    }
}

class ROILayer {
    constructor(roiMap, options) {
        this.roiMap = roiMap;
        this.options = options;
        this.roi = createROI(this.roiMap);
    }
}
<|endoftext|>


<commit_before>/*
Copyright 2019 New Vector Ltd

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

import Promise from 'bluebird';

/**
 * Check if an IndexedDB database exists. The only way to do so is to try opening it, so
 * we do that and then delete it did not exist before.
 *
 * @param {Object} indexedDB The `indexedDB` interface
 * @param {string} dbName The database name to test for
 * @returns {boolean} Whether the database exists
 */
export function exists(indexedDB, dbName) {
    return new Promise((resolve, reject) => {
        let exists = true;
        const req = indexedDB.open(dbName);
        req.onupgradeneeded = () => {
            // Since we did not provide an explicit version when opening, this event
            // should only fire if the DB did not exist before at any version.
            exists = false;
        };
        req.onblocked = () => reject();
        req.onsuccess = () => {
            if (!exists) {
                // The DB did not exist before, but has been created as part of this
                // existence check. Delete it now to restore previous state. Delete can
                // actually take a while to complete in some browsers, so don't wait for
                // it. This won't block future open calls that a store might issue next to
                // properly set up the DB.
                indexedDB.deleteDatabase(dbName);
            }
            resolve(exists);
        };
        req.onerror = ev => reject(ev.target.error);
    });
}
<commit_msg>Close the DB right away<commit_after>/*
Copyright 2019 New Vector Ltd

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

import Promise from 'bluebird';

/**
 * Check if an IndexedDB database exists. The only way to do so is to try opening it, so
 * we do that and then delete it did not exist before.
 *
 * @param {Object} indexedDB The `indexedDB` interface
 * @param {string} dbName The database name to test for
 * @returns {boolean} Whether the database exists
 */
export function exists(indexedDB, dbName) {
    return new Promise((resolve, reject) => {
        let exists = true;
        const req = indexedDB.open(dbName);
        req.onupgradeneeded = () => {
            // Since we did not provide an explicit version when opening, this event
            // should only fire if the DB did not exist before at any version.
            exists = false;
        };
        req.onblocked = () => reject();
        req.onsuccess = () => {
            const db = req.result;
            db.close();
            if (!exists) {
                // The DB did not exist before, but has been created as part of this
                // existence check. Delete it now to restore previous state. Delete can
                // actually take a while to complete in some browsers, so don't wait for
                // it. This won't block future open calls that a store might issue next to
                // properly set up the DB.
                indexedDB.deleteDatabase(dbName);
            }
            resolve(exists);
        };
        req.onerror = ev => reject(ev.target.error);
    });
}
<|endoftext|>


<commit_before>export default {
	delay: 0,
	distance: '0',
	duration: 600,
	easing: 'cubic-bezier(0.6, 0.2, 0.1, 1)',
	interval: 0,
	opacity: 0,
	origin: 'bottom',
	rotate: {
		x: 0,
		y: 0,
		z: 0
	},
	scale: 1,
	cleanup: true,
	container: document.documentElement,
	desktop: true,
	mobile: true,
	reset: false,
	useDelay: 'always',
	viewFactor: 0.0,
	viewOffset: {
		top: 0,
		right: 0,
		bottom: 0,
		left: 0
	},
	afterReset() {},
	afterReveal() {},
	beforeReset() {},
	beforeReveal() {}
}
<commit_msg>tune the default easing bezier curve<commit_after>export default {
	delay: 0,
	distance: '0',
	duration: 600,
	easing: 'cubic-bezier(0.5, 0, 0, 1)',
	interval: 0,
	opacity: 0,
	origin: 'bottom',
	rotate: {
		x: 0,
		y: 0,
		z: 0
	},
	scale: 1,
	cleanup: true,
	container: document.documentElement,
	desktop: true,
	mobile: true,
	reset: false,
	useDelay: 'always',
	viewFactor: 0.0,
	viewOffset: {
		top: 0,
		right: 0,
		bottom: 0,
		left: 0
	},
	afterReset() {},
	afterReveal() {},
	beforeReset() {},
	beforeReveal() {}
}
<|endoftext|>


<commit_before>/**
 * This namespace contains a renderer plugin for handling mouse, pointer, and touch events.
 *
 * Do not instantiate this plugin directly. It is available from the `renderer.plugins` property.
 * See {@link PIXI.CanvasRenderer#plugins} or {@link PIXI.WebGLRenderer#plugins}.
 * @namespace PIXI.interaction
 */
export { default as InteractionData } from './InteractionData';
export { default as InteractionManager } from './InteractionManager';
export { default as interactiveTarget } from './interactiveTarget';
<commit_msg>Update index.js (#4120)<commit_after>/**
 * This namespace contains a renderer plugin for handling mouse, pointer, and touch events.
 *
 * Do not instantiate this plugin directly. It is available from the `renderer.plugins` property.
 * See {@link PIXI.CanvasRenderer#plugins} or {@link PIXI.WebGLRenderer#plugins}.
 * @namespace PIXI.interaction
 */
export { default as InteractionData } from './InteractionData';
export { default as InteractionManager } from './InteractionManager';
export { default as interactiveTarget } from './interactiveTarget';
export { default as InteractionTrackingData } from './InteractionTrackingData';
export { default as InteractionEvent } from './InteractionEvent';
<|endoftext|>