<commit_before>module.exports = function() {
  $(function(){
    var ready = new Date() > new Date("2015-04-14T03:30:00-07:00")
    var disabled = localStorage.getItem('disable-private-modules-banner')

    if (!ready || disabled || location.pathname === "/private-modules") {
      return
    }

    $('#notification-banner').show()

    $('#notification-banner a').click(function (e) {
      localStorage.setItem('disable-private-modules-banner', true)

      if ($(this).hasClass("banner-close")) {
        $('#notification-banner').slideUp()
        e.preventDefault()
      }
    })

  })
}
<commit_msg>don’t show banner on the billing page<commit_after>module.exports = function() {
  $(function(){
    var ready = new Date() > new Date("2015-04-14T03:30:00-07:00")
    var disabled = localStorage.getItem('disable-private-modules-banner')

    if (
      !ready
      || disabled
      || location.pathname === "/private-modules"
      || location.pathname === "/settings/billing"
    ) {
      return
    }

    $('#notification-banner').show()

    $('#notification-banner a').click(function (e) {
      localStorage.setItem('disable-private-modules-banner', true)

      if ($(this).hasClass("banner-close")) {
        $('#notification-banner').slideUp()
        e.preventDefault()
      }
    })

  })
}
<|endoftext|>


<commit_before>/*
 * Copyright (c) 2009-2016. Authors: see NOTICE file.
 *
 * 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.
 */

/**
 * Created by hoyoux on 09.02.15.
 */
var ProjectCommandsView = Backbone.View.extend({

    tagName: 'ul',
    className: 'nav',
    initialize: function (options) {
        if(options != undefined) {
            // Since 1.1.0, Backbone Views no longer automatically attach options passed to the constructor as this.options
            this.options = options;
            this.idProject = options.idProject;
            this.collection = options.collection;
            this.splitByDay = options.splitByDay;
            this.displayAll = options.displayAll;
        }
    },
    render: function () {
        var self = this;
        require([
                "text!application/templates/command/CommandAnnotation.tpl.html",
                "text!application/templates/command/CommandGeneric.tpl.html",
                "text!application/templates/command/CommandImageInstance.tpl.html"],
            function (commandAnnotationTpl, commandGenericTpl, commandImageInstanceTpl) {

                var dateCreated = new Date();
                self.collection.each(function(command){

                    var commandView = new ProjectCommandView({ idProject: self.idProject, command: command, displayAll: self.displayAll });
                    var result = commandView.render(commandAnnotationTpl, commandGenericTpl, commandImageInstanceTpl);
                    if(result != null){

                        if(self.splitByDay) {
                            dateCreated.setTime(command.get('created'));
                            var shortDate = dateCreated.toLocaleDateString();
                            if(self.startDate!=shortDate) {
                                self.startDate=shortDate;
                                self.$el.append('
'+shortDate+'
');
                            }
                        }

                        self.$el.append(result.el);
                    }
                });
            }
        );
        return this;
    }
});

var ProjectCommandView = Backbone.View.extend({

    tagName: 'li',
    initialize: function (options) {
        if(options != undefined) {
            // Since 1.1.0, Backbone Views no longer automatically attach options passed to the constructor as this.options
            this.options = options;
            this.command= options.command;
            this.idProject= options.idProject;
            this.displayAll = options.displayAll;
        }
    },
    render: function (commandAnnotationTpl, commandGenericTpl, commandImageInstanceTpl) {
        var self = this;
        this.el = this.decodeCommandAction(this.command, commandAnnotationTpl, commandGenericTpl, commandImageInstanceTpl);
        if(this.el == "undefined") {
            return null;
        }
        return this; // returning this for chaining..
    },
    decodeCommandAction : function(commandHistory,commandAnnotationTpl, commandGenericTpl, commandImageInstanceTpl) {
        var self = this;
        var jsonCommand = $.parseJSON(commandHistory.get("data"));
        var dateCreated = new Date();
        dateCreated.setTime(commandHistory.get('created'));
        var dateStr = dateCreated.toLocaleDateString() + " " + dateCreated.toLocaleTimeString();

        if (commandHistory.get('className') == "be.cytomine.command.AddCommand") {
            if (commandHistory.get('serviceName') == "userAnnotationService") {
                var cropStyle = "block";
                var cropURL = jsonCommand.cropURL;
                return _.template(commandAnnotationTpl,
                    {   idProject: self.idProject,
                        idAnnotation: jsonCommand.id,
                        idImage: jsonCommand.image,
                        imageFilename: jsonCommand.imageFilename,
                        icon: "add.png",
                        text: commandHistory.get("prefixAction") + " " + commandHistory.get('action'),
                        datestr: dateStr,
                        cropURL: cropURL,
                        cropStyle: cropStyle
                    });
            }
            else if (commandHistory.get('serviceName') == "reviewedAnnotationService") {
                var cropStyle = "block";
                var cropURL = jsonCommand.cropURL;
                return _.template(commandAnnotationTpl,
                    {   idProject: self.idProject,
                        idAnnotation: jsonCommand.id,
                        idImage: jsonCommand.image,
                        imageFilename: jsonCommand.imageFilename,
                        icon: "add.png",
                        text: commandHistory.get("prefixAction") + " " + commandHistory.get('action'),
                        datestr: dateStr,
                        cropURL: cropURL,
                        cropStyle: cropStyle
                    });
            }
            else if (commandHistory.get('serviceName') == "algoAnnotationService") {
                var cropStyle = "block";
                var cropURL = jsonCommand.cropURL;
                return _.template(commandAnnotationTpl,
                    {   idProject: self.idProject,
                        idAnnotation: jsonCommand.id,
                        idImage: jsonCommand.image,
                        imageFilename: jsonCommand.imageFilename,
                        icon: "add.png",
                        text: commandHistory.get("prefixAction") + " " + commandHistory.get('action'),
                        datestr: dateStr,
                        cropURL: cropURL,
                        cropStyle: cropStyle
                    });
            }
            else if (commandHistory.get('serviceName') == "annotationTermService") {
                return _.template(commandGenericTpl, {icon: "ui-icon-plus", text: commandHistory.get("prefixAction") + " " + commandHistory.get('action'), datestr: dateStr, image: ""});
            }
            else if (commandHistory.get('serviceName') == "imageInstanceService") {
                var cropStyle = "block";
                var cropURL = jsonCommand.thumb;
                return _.template(commandImageInstanceTpl, {idProject: self.idProject, idImage: jsonCommand.id, imageFilename: jsonCommand.filename, icon: "add.png", text: commandHistory.get("prefixAction") + " " + commandHistory.get('action'), datestr: dateStr, cropURL: cropURL, cropStyle: cropStyle});
            }
            else if (commandHistory.get('serviceName') == "jobService") {
                return _.template(commandGenericTpl, {icon: "ui-icon-plus", text: commandHistory.get('action'), datestr: dateStr, image: ""});
            }
        }

        else if (commandHistory.get('className') == "be.cytomine.command.EditCommand") {

            if (commandHistory.get('serviceName') == "userAnnotationService") {
                var cropStyle = "";
                var cropURL = jsonCommand.newUserAnnotation.cropURL;
                return _.template(commandAnnotationTpl, {idProject: self.idProject, idAnnotation: jsonCommand.newUserAnnotation.id, idImage: jsonCommand.newUserAnnotation.image, imageFilename: jsonCommand.newUserAnnotation.imageFilename, icon: "delete.gif", text: commandHistory.get("prefixAction") + " " + commandHistory.get('action'), datestr: dateStr, cropURL: cropURL, cropStyle: cropStyle});
            }
            else if (commandHistory.get('serviceName') == "reviewedAnnotationService") {
                var cropStyle = "";
                var cropURL = jsonCommand.newReviewedAnnotation.cropURL;
                return _.template(commandAnnotationTpl, {idProject: self.idProject, idAnnotation: jsonCommand.newReviewedAnnotation.id, idImage: jsonCommand.newReviewedAnnotation.image, imageFilename: jsonCommand.newReviewedAnnotation.imageFilename, icon: "delete.gif", text: commandHistory.get("prefixAction") + " " + commandHistory.get('action'), datestr: dateStr, cropURL: cropURL, cropStyle: cropStyle});
            }
            else if (commandHistory.get('serviceName') == "algoAnnotationService") {
                var cropStyle = "";
                var cropURL = jsonCommand.newAnnotation.cropURL;
                return _.template(commandAnnotationTpl, {idProject: self.idProject, idAnnotation: jsonCommand.newAnnotation.id, idImage: jsonCommand.newAnnotation.image, imageFilename: jsonCommand.newAnnotation.imageFilename, icon: "delete.gif", text: commandHistory.get("prefixAction") + " " + commandHistory.get('action'), datestr: dateStr, cropURL: cropURL, cropStyle: cropStyle});
            }
            else if (commandHistory.get('serviceName') == "annotationTermService") {
                return _.template(commandGenericTpl, {icon: "ui-icon-pencil", text: commandHistory.get("prefixAction") + " " + commandHistory.get('action'), datestr: dateStr, image: ""});
            }
            else if (commandHistory.get('serviceName') == "imageInstanceService") {
                if (jsonCommand.newImageInstance.deleted != null && jsonCommand.previousImageInstance.deleted == null) {
                    commandHistory.set('action', commandHistory.get('action') + " (deletion)");
                }
            }
        }

        else if (commandHistory.get('className') == "be.cytomine.command.DeleteCommand") {
            if (commandHistory.get('serviceName') == "userAnnotationService") {
                var cropStyle = "";
                var cropURL = jsonCommand.cropURL;
                return _.template(commandAnnotationTpl, {idProject: self.idProject, idAnnotation: jsonCommand.id, idImage: jsonCommand.image, imageFilename: jsonCommand.imageFilename, icon: "delete.gif", text: commandHistory.get("prefixAction") + " " + commandHistory.get('action'), datestr: dateStr, cropURL: cropURL, cropStyle: cropStyle});

            }
            else if (commandHistory.get('serviceName') == "reviewedAnnotationService") {
                var cropStyle = "";
                var cropURL = jsonCommand.cropURL;
                return _.template(commandAnnotationTpl, {idProject: self.idProject, idAnnotation: jsonCommand.id, idImage: jsonCommand.image, imageFilename: jsonCommand.imageFilename, icon: "delete.gif", text: commandHistory.get("prefixAction") + " " + commandHistory.get('action'), datestr: dateStr, cropURL: cropURL, cropStyle: cropStyle});
            }
            else if (commandHistory.get('serviceName') == "algoAnnotationService") {
                var cropStyle = "";
                var cropURL = jsonCommand.cropURL;
                return _.template(commandAnnotationTpl, {idProject: self.idProject, idAnnotation: jsonCommand.id, idImage: jsonCommand.image, imageFilename: jsonCommand.imageFilename, icon: "delete.gif", text: commandHistory.get("prefixAction") + " " + commandHistory.get('action'), datestr: dateStr, cropURL: cropURL, cropStyle: cropStyle});
            }
            else if (commandHistory.get('serviceName') == "annotationTermService") {
                return _.template(commandGenericTpl, {icon: "ui-icon-trash", text: commandHistory.get("prefixAction") + " " + commandHistory.get('action'), datestr: dateStr, image: ""});

            }
            else if (commandHistory.get('serviceName') == "imageInstanceService") {
                var cropStyle = "block";
                var cropURL = jsonCommand.thumb;
                return _.template(commandImageInstanceTpl, {idProject: self.idProject, idImage: jsonCommand.id, imageFilename: jsonCommand.filename, icon: "delete.gif", text: commandHistory.get("prefixAction") + " " + commandHistory.get('action'), datestr: dateStr, cropURL: cropURL, cropStyle: cropStyle});

            }
        }
        if (self.displayAll) {
            return _.template(commandGenericTpl, {text: commandHistory.get('action'), datestr: dateStr});
        }
        return "undefined";
    }
});<commit_msg>Use small crop instead of huge in the command histories<commit_after>/*
 * Copyright (c) 2009-2016. Authors: see NOTICE file.
 *
 * 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.
 */

/**
 * Created by hoyoux on 09.02.15.
 */
var ProjectCommandsView = Backbone.View.extend({

    tagName: 'ul',
    className: 'nav',
    initialize: function (options) {
        if(options != undefined) {
            // Since 1.1.0, Backbone Views no longer automatically attach options passed to the constructor as this.options
            this.options = options;
            this.idProject = options.idProject;
            this.collection = options.collection;
            this.splitByDay = options.splitByDay;
            this.displayAll = options.displayAll;
        }
    },
    render: function () {
        var self = this;
        require([
                "text!application/templates/command/CommandAnnotation.tpl.html",
                "text!application/templates/command/CommandGeneric.tpl.html",
                "text!application/templates/command/CommandImageInstance.tpl.html"],
            function (commandAnnotationTpl, commandGenericTpl, commandImageInstanceTpl) {

                var dateCreated = new Date();
                self.collection.each(function(command){

                    var commandView = new ProjectCommandView({ idProject: self.idProject, command: command, displayAll: self.displayAll });
                    var result = commandView.render(commandAnnotationTpl, commandGenericTpl, commandImageInstanceTpl);
                    if(result != null){

                        if(self.splitByDay) {
                            dateCreated.setTime(command.get('created'));
                            var shortDate = dateCreated.toLocaleDateString();
                            if(self.startDate!=shortDate) {
                                self.startDate=shortDate;
                                self.$el.append('
'+shortDate+'
');
                            }
                        }

                        self.$el.append(result.el);
                    }
                });
            }
        );
        return this;
    }
});

var ProjectCommandView = Backbone.View.extend({

    tagName: 'li',
    initialize: function (options) {
        if(options != undefined) {
            // Since 1.1.0, Backbone Views no longer automatically attach options passed to the constructor as this.options
            this.options = options;
            this.command= options.command;
            this.idProject= options.idProject;
            this.displayAll = options.displayAll;
        }
    },
    render: function (commandAnnotationTpl, commandGenericTpl, commandImageInstanceTpl) {
        var self = this;
        this.el = this.decodeCommandAction(this.command, commandAnnotationTpl, commandGenericTpl, commandImageInstanceTpl);
        if(this.el == "undefined") {
            return null;
        }
        return this; // returning this for chaining..
    },
    decodeCommandAction : function(commandHistory,commandAnnotationTpl, commandGenericTpl, commandImageInstanceTpl) {
        var self = this;
        var jsonCommand = $.parseJSON(commandHistory.get("data"));
        var dateCreated = new Date();
        dateCreated.setTime(commandHistory.get('created'));
        var dateStr = dateCreated.toLocaleDateString() + " " + dateCreated.toLocaleTimeString();

        if (commandHistory.get('className') == "be.cytomine.command.AddCommand") {
            if (commandHistory.get('serviceName') == "userAnnotationService") {
                var cropStyle = "block";
                var cropURL = jsonCommand.smallCropURL;
                return _.template(commandAnnotationTpl,
                    {   idProject: self.idProject,
                        idAnnotation: jsonCommand.id,
                        idImage: jsonCommand.image,
                        imageFilename: jsonCommand.imageFilename,
                        icon: "add.png",
                        text: commandHistory.get("prefixAction") + " " + commandHistory.get('action'),
                        datestr: dateStr,
                        cropURL: cropURL,
                        cropStyle: cropStyle
                    });
            }
            else if (commandHistory.get('serviceName') == "reviewedAnnotationService") {
                var cropStyle = "block";
                var cropURL = jsonCommand.smallCropURL;
                return _.template(commandAnnotationTpl,
                    {   idProject: self.idProject,
                        idAnnotation: jsonCommand.id,
                        idImage: jsonCommand.image,
                        imageFilename: jsonCommand.imageFilename,
                        icon: "add.png",
                        text: commandHistory.get("prefixAction") + " " + commandHistory.get('action'),
                        datestr: dateStr,
                        cropURL: cropURL,
                        cropStyle: cropStyle
                    });
            }
            else if (commandHistory.get('serviceName') == "algoAnnotationService") {
                var cropStyle = "block";
                var cropURL = jsonCommand.smallCropURL;
                return _.template(commandAnnotationTpl,
                    {   idProject: self.idProject,
                        idAnnotation: jsonCommand.id,
                        idImage: jsonCommand.image,
                        imageFilename: jsonCommand.imageFilename,
                        icon: "add.png",
                        text: commandHistory.get("prefixAction") + " " + commandHistory.get('action'),
                        datestr: dateStr,
                        cropURL: cropURL,
                        cropStyle: cropStyle
                    });
            }
            else if (commandHistory.get('serviceName') == "annotationTermService") {
                return _.template(commandGenericTpl, {icon: "ui-icon-plus", text: commandHistory.get("prefixAction") + " " + commandHistory.get('action'), datestr: dateStr, image: ""});
            }
            else if (commandHistory.get('serviceName') == "imageInstanceService") {
                var cropStyle = "block";
                var cropURL = jsonCommand.thumb;
                return _.template(commandImageInstanceTpl, {idProject: self.idProject, idImage: jsonCommand.id, imageFilename: jsonCommand.filename, icon: "add.png", text: commandHistory.get("prefixAction") + " " + commandHistory.get('action'), datestr: dateStr, cropURL: cropURL, cropStyle: cropStyle});
            }
            else if (commandHistory.get('serviceName') == "jobService") {
                return _.template(commandGenericTpl, {icon: "ui-icon-plus", text: commandHistory.get('action'), datestr: dateStr, image: ""});
            }
        }

        else if (commandHistory.get('className') == "be.cytomine.command.EditCommand") {

            if (commandHistory.get('serviceName') == "userAnnotationService") {
                var cropStyle = "";
                var cropURL = jsonCommand.newUserAnnotation.smallCropURL;
                return _.template(commandAnnotationTpl, {idProject: self.idProject, idAnnotation: jsonCommand.newUserAnnotation.id, idImage: jsonCommand.newUserAnnotation.image, imageFilename: jsonCommand.newUserAnnotation.imageFilename, icon: "delete.gif", text: commandHistory.get("prefixAction") + " " + commandHistory.get('action'), datestr: dateStr, cropURL: cropURL, cropStyle: cropStyle});
            }
            else if (commandHistory.get('serviceName') == "reviewedAnnotationService") {
                var cropStyle = "";
                var cropURL = jsonCommand.newReviewedAnnotation.smallCropURL;
                return _.template(commandAnnotationTpl, {idProject: self.idProject, idAnnotation: jsonCommand.newReviewedAnnotation.id, idImage: jsonCommand.newReviewedAnnotation.image, imageFilename: jsonCommand.newReviewedAnnotation.imageFilename, icon: "delete.gif", text: commandHistory.get("prefixAction") + " " + commandHistory.get('action'), datestr: dateStr, cropURL: cropURL, cropStyle: cropStyle});
            }
            else if (commandHistory.get('serviceName') == "algoAnnotationService") {
                var cropStyle = "";
                var cropURL = jsonCommand.newAnnotation.smallCropURL;
                return _.template(commandAnnotationTpl, {idProject: self.idProject, idAnnotation: jsonCommand.newAnnotation.id, idImage: jsonCommand.newAnnotation.image, imageFilename: jsonCommand.newAnnotation.imageFilename, icon: "delete.gif", text: commandHistory.get("prefixAction") + " " + commandHistory.get('action'), datestr: dateStr, cropURL: cropURL, cropStyle: cropStyle});
            }
            else if (commandHistory.get('serviceName') == "annotationTermService") {
                return _.template(commandGenericTpl, {icon: "ui-icon-pencil", text: commandHistory.get("prefixAction") + " " + commandHistory.get('action'), datestr: dateStr, image: ""});
            }
            else if (commandHistory.get('serviceName') == "imageInstanceService") {
                if (jsonCommand.newImageInstance.deleted != null && jsonCommand.previousImageInstance.deleted == null) {
                    commandHistory.set('action', commandHistory.get('action') + " (deletion)");
                }
            }
        }

        else if (commandHistory.get('className') == "be.cytomine.command.DeleteCommand") {
            if (commandHistory.get('serviceName') == "userAnnotationService") {
                var cropStyle = "";
                var cropURL = jsonCommand.smallCropURL;
                return _.template(commandAnnotationTpl, {idProject: self.idProject, idAnnotation: jsonCommand.id, idImage: jsonCommand.image, imageFilename: jsonCommand.imageFilename, icon: "delete.gif", text: commandHistory.get("prefixAction") + " " + commandHistory.get('action'), datestr: dateStr, cropURL: cropURL, cropStyle: cropStyle});

            }
            else if (commandHistory.get('serviceName') == "reviewedAnnotationService") {
                var cropStyle = "";
                var cropURL = jsonCommand.smallCropURL;
                return _.template(commandAnnotationTpl, {idProject: self.idProject, idAnnotation: jsonCommand.id, idImage: jsonCommand.image, imageFilename: jsonCommand.imageFilename, icon: "delete.gif", text: commandHistory.get("prefixAction") + " " + commandHistory.get('action'), datestr: dateStr, cropURL: cropURL, cropStyle: cropStyle});
            }
            else if (commandHistory.get('serviceName') == "algoAnnotationService") {
                var cropStyle = "";
                var cropURL = jsonCommand.smallCropURL;
                return _.template(commandAnnotationTpl, {idProject: self.idProject, idAnnotation: jsonCommand.id, idImage: jsonCommand.image, imageFilename: jsonCommand.imageFilename, icon: "delete.gif", text: commandHistory.get("prefixAction") + " " + commandHistory.get('action'), datestr: dateStr, cropURL: cropURL, cropStyle: cropStyle});
            }
            else if (commandHistory.get('serviceName') == "annotationTermService") {
                return _.template(commandGenericTpl, {icon: "ui-icon-trash", text: commandHistory.get("prefixAction") + " " + commandHistory.get('action'), datestr: dateStr, image: ""});

            }
            else if (commandHistory.get('serviceName') == "imageInstanceService") {
                var cropStyle = "block";
                var cropURL = jsonCommand.thumb;
                return _.template(commandImageInstanceTpl, {idProject: self.idProject, idImage: jsonCommand.id, imageFilename: jsonCommand.filename, icon: "delete.gif", text: commandHistory.get("prefixAction") + " " + commandHistory.get('action'), datestr: dateStr, cropURL: cropURL, cropStyle: cropStyle});

            }
        }
        if (self.displayAll) {
            return _.template(commandGenericTpl, {text: commandHistory.get('action'), datestr: dateStr});
        }
        return "undefined";
    }
});<|endoftext|>


<commit_before>"use strict";

let PageOrder = Vue.component(
	'page-order',
	{
		template: `

Ordering

To make an order, please email me with the product names you would like to buy and I will arrange a Paypal invoice — no Paypal account required. (Something more automated should be coming soon!) Anything listed in the <router-link :to="\{ path: '/catalog'}">Catalog</router-link> or further down on this page is available to buy both online and in person at anime conventions. Let me know if you want priority shipping.

All prices are in US Dollars.

Customers not satisfied with the quality of their purchased magnets should contact me within one week of receiving them, along with a photo or scan of the unsatisfactory magnets. Such magnets may be eligible for free replacement. (Please save the packaging if you have a complaint, as the batch number can help me understand what problems you might be having.)

Shipping

Shipping rates: $3 to the US ($6.50 for priority), $9 to Canada, and $13 elsewhere. Priority to other countries is much more expensive and not much faster than first class mail, but can be arranged if required — please email me for a price estimate.

Packages to the US usually arrive 2-4 days after shipping, and international orders usually arrive in 7-10 days, though packages can of course be randomly delayed, particularly when customs become involved. If prompt arrival is important, consider that priority mail has guarantees for delivery dates whereas first class mail does not.

Orders will be shipped within one or two days, but orders involving custom work will be shipped when the custom work is done.

I am not responsible for VAT or any other import fees, so please be aware of your country’s policies for international mail. (I am also unwilling to lie about the value of the package on custom forms.)

Magnets

Anything listed as in-stock in the <router-link :to="\{ path: '/catalog'}">General Catalog</router-link> is available to order online or at anime conventions where I have an Artist Alley table. (For a list of conventions I am attending, see the <router-link :to="\{ path: '/'}">Info</router-link> section.) Retired characters are not available for purchase except as a special order, which follow the procedure for POD magnets specified in the <router-link :to="\{ path: '/custom'}">Custom</router-link> section.

Substitutions are not possible for characters in a set. Nor are partial set sales possible, except in the case of already-orphaned magnets. (See below for information about orphans.)

Grab Bags

I have a variety of blind grab bags available online, as well as at conventions that allow them, as an affordable way to acquire characters in bulk. You will not be able to see what characters are included until you open the bag, but I sometimes limit the category of the bag to help narrow things down. (See the <router-link :to="\{ path: '/catalog'}">Catalog</router-link> to learn about what characters are available in each of the six color-coded categories.)

Grab Bags are $5, and include at least 3 characters at a value of at least $10.

Super Grab Bags are $20, and include at least 13 characters at a value of at least $50.

I make grab bags in batches known to contain no duplicate products. So while I don’t know exactly what each bag contains, I am theoretically able to prevent duplicates when grab bags are ordered together (provided they aren’t ordered in too-great of a quantity). If you want bags from a specific batch please let me know when you order.

All bags contain new, undamaged products.

Grab Bags Currrently In Stock

							Category
							Type
							Qty
							Batch #

							Anime / Manga
							Super Grab Bag
							4x
							A1

							Grab Bag
							10x
							A2

							7x
							A3

							Game and Pokémon
							Super Grab Bag
							1x
							V0

							4x
							V1

							Grab Bag
							18x
							V2

							14x
							V3

							Western Animation
							Super Grab Bag
							1x
							W1

							Grab Bag
							2x
							W2

							all categories
							Super Grab Bag
							1x
							00

Combos

At conventions I offer discounts for certain combinations of sets. These are now also available online!

All 8 Classic Doctors: $28

First Doctor through Eighth Doctor. Save $4!

All Doctor Who characters: $48

First Doctor through Twelfth Doctor plus DW Companions Set 2. (DW Companions Set 1 is sold out and retired, unfortunately.) Save $12!

All My Little Pony characters: $49

Every My Little Pony character I have in stock. Save $23!

All Pokémon characters: $85

Every Pokémon character I have in stock. Currently includes 15 trainers and 37 Pokémon! Save $54!

All Anime/Manga characters: $288

All in-stock Anime/Manga characters (currently 100 total), 25% off! Save $96!

All Video Game characters: $157.50

All in-stock Video Game characters (currently 53 total), 25% off! Save $52.50!

EVERY MAGNET I HAVE IN STOCK: $499

WOW! All in-stock characters for $1.75 each! This is currently 285 characters! I’ll even throw in some extra, never-released characters! THIS IS MORE THAN 50% OFF! YOU’LL DROWN IN MAGNETS!

Discounted Sets

Previously convention-exclusive, discounted sets are now available online! Discounted sets are not flawed enough to be discarded but are flawed enough to warrant being sold at a reduced rate. Sometimes it’s as simple as a fleck of dust under the lamination layer that causes a bubble, or a misalignment of the cut edge by 1-1.5 mm.

Coming Soon!

Orphaned Singless

Sets with damaged pieces may leave orphaned characters/heads/bodies/accessories which are otherwise flawless. Such pieces were normally used at conventions are part of the “demo board” but are now available online! NOTE: Unlike magnets from the convention demo board, these orphans are in new condition unless mentioned otherwise.

Coming Soon!

		`
	}
);
<commit_msg>inventory update<commit_after>"use strict";

let PageOrder = Vue.component(
	'page-order',
	{
		template: `

Ordering

To make an order, please email me with the product names you would like to buy and I will arrange a Paypal invoice — no Paypal account required. (Something more automated should be coming soon!) Anything listed in the <router-link :to="\{ path: '/catalog'}">Catalog</router-link> or further down on this page is available to buy both online and in person at anime conventions. Let me know if you want priority shipping.

All prices are in US Dollars.

Customers not satisfied with the quality of their purchased magnets should contact me within one week of receiving them, along with a photo or scan of the unsatisfactory magnets. Such magnets may be eligible for free replacement. (Please save the packaging if you have a complaint, as the batch number can help me understand what problems you might be having.)

Shipping

Shipping rates: $3 to the US ($6.50 for priority), $9 to Canada, and $13 elsewhere. Priority to other countries is much more expensive and not much faster than first class mail, but can be arranged if required — please email me for a price estimate.

Packages to the US usually arrive 2-4 days after shipping, and international orders usually arrive in 7-10 days, though packages can of course be randomly delayed, particularly when customs become involved. If prompt arrival is important, consider that priority mail has guarantees for delivery dates whereas first class mail does not.

Orders will be shipped within one or two days, but orders involving custom work will be shipped when the custom work is done.

I am not responsible for VAT or any other import fees, so please be aware of your country’s policies for international mail. (I am also unwilling to lie about the value of the package on custom forms.)

Magnets

Anything listed as in-stock in the <router-link :to="\{ path: '/catalog'}">General Catalog</router-link> is available to order online or at anime conventions where I have an Artist Alley table. (For a list of conventions I am attending, see the <router-link :to="\{ path: '/'}">Info</router-link> section.) Retired characters are not available for purchase except as a special order, which follow the procedure for POD magnets specified in the <router-link :to="\{ path: '/custom'}">Custom</router-link> section.

Substitutions are not possible for characters in a set. Nor are partial set sales possible, except in the case of already-orphaned magnets. (See below for information about orphans.)

Grab Bags

I have a variety of blind grab bags available online, as well as at conventions that allow them, as an affordable way to acquire characters in bulk. You will not be able to see what characters are included until you open the bag, but I sometimes limit the category of the bag to help narrow things down. (See the <router-link :to="\{ path: '/catalog'}">Catalog</router-link> to learn about what characters are available in each of the six color-coded categories.)

Grab Bags are $5, and include at least 3 characters at a value of at least $10.

Super Grab Bags are $20, and include at least 13 characters at a value of at least $50.

I make grab bags in batches known to contain no duplicate products. So while I don’t know exactly what each bag contains, I am theoretically able to prevent duplicates when grab bags are ordered together (provided they aren’t ordered in too-great of a quantity). If you want bags from a specific batch please let me know when you order.

All bags contain new, undamaged products.

Grab Bags Currrently In Stock

							Category
							Type
							Qty
							Batch #

							Anime / Manga
							Super Grab Bag
							4x
							A1

							Grab Bag
							10x
							A2

							7x
							A3

							Game and Pokémon
							Super Grab Bag
							1x
							V0

							4x
							V1

							Grab Bag
							18x
							V2

							14x
							V3

							Western Animation
							Super Grab Bag
							1x
							W1

							Grab Bag
							2x
							W2

							all categories
							Super Grab Bag
							1x
							00

Combos

At conventions I offer discounts for certain combinations of sets. These are now also available online!

All 8 Classic Doctors: $28

First Doctor through Eighth Doctor. Save $4!

All Doctor Who characters: $48

First Doctor through Twelfth Doctor plus DW Companions Set 2. (DW Companions Set 1 is sold out and retired, unfortunately.) Save $12!

All My Little Pony characters: $49

Every My Little Pony character I have in stock. Save $23!

All Pokémon characters: $85

Every Pokémon character I have in stock. Currently includes 15 trainers and 37 Pokémon! Save $54!

All Anime/Manga characters: $282

All in-stock Anime/Manga characters (currently 98 total), 25% off! Save $94!

All Video Game characters: $157.50

All in-stock Video Game characters (currently 53 total), 25% off! Save $52.50!

EVERY MAGNET I HAVE IN STOCK: $490

WOW! All in-stock characters for $1.75 each! This is currently 280 characters! I’ll even throw in some extra, never-released characters! THIS IS MORE THAN 50% OFF! YOU’LL DROWN IN MAGNETS!

Discounted Sets

Previously convention-exclusive, discounted sets are now available online! Discounted sets are not flawed enough to be discarded but are flawed enough to warrant being sold at a reduced rate. Sometimes it’s as simple as a fleck of dust under the lamination layer that causes a bubble, or a misalignment of the cut edge by 1-1.5 mm.

Coming Soon!

Orphaned Singless

Sets with damaged pieces may leave orphaned characters/heads/bodies/accessories which are otherwise flawless. Such pieces were normally used at conventions are part of the “demo board” but are now available online! NOTE: Unlike magnets from the convention demo board, these orphans are in new condition unless mentioned otherwise.

Coming Soon!

		`
	}
);
<|endoftext|>


<commit_before>angular.
  module('Departamento').
  component('listarDepartamento', {
    templateUrl: '/app/Departamento/departamento.template.html',
    controller: ['ApiDepartamento', 'MatWebGlobals',function Entrar(ApiDepartamento,MatWebGlobals) {
      this.nome_departamento = "";
	var ctrl = this;
	ctrl.departamentos = [];
      this.pesquisar = function()
      {
       	ApiDepartamento.Listar({id_campus: 1 , nome: ctrl.nome_departamento, pagina: 0, quantidade: 1000 },function(resultado) {
		          ctrl.departamentos = resultado.corpo
			console.log(ctrl.departamentos)
		}, function(erro){
   			ctrl.erro = erro.data.mensagem
			console.log(ctrl.erro)
   		} );
   	  }
    }]
  }).
  component('listarDepartpcampus', {
    templateUrl: '/app/Departamento/departPcampus.template.html',
    controller: ['ApiDepartamentoPCampus', 'MatWebGlobals', '$routeParams', function Listar(ApiDepartamentoPCampus,MatWebGlobals,$routeParams) {
        this.formulario = {id_campus: $routeParams.Id_campus , 'nome': '', 'pagina': 0, 'quantidade': 1000 };
        console.log($routeParams.Id_campus);
        var ctrl = this;
        this.listar = function()
        {
            ApiDepartamentoPCampus.Listar(this.formulario,function(resultado) {
                ctrl.departamentos = resultado.corpo;
                console.log(MatWebGlobals);
                console.log(ctrl.departamentos);
            }, function(error){
                ctrl.error = error.data.mensagem;
            });
        }
        this.listar();
    }]
});

<commit_msg>listar departamentos por campus<commit_after>angular.
  module('Departamento').
  component('listarDepartamento', {
    templateUrl: '/app/Departamento/departamento.template.html',
    controller: ['ApiDepartamento', 'MatWebGlobals',function Entrar(ApiDepartamento,MatWebGlobals) {
      this.nome_departamento = "";
	var ctrl = this;
	ctrl.departamentos = [];
      this.pesquisar = function()
      {
       	ApiDepartamento.Listar({id_campus: 1 , nome: ctrl.nome_departamento, pagina: 0, quantidade: 1000 },function(resultado) {
		          ctrl.departamentos = resultado.corpo
			console.log(ctrl.departamentos)
		}, function(erro){
   			ctrl.erro = erro.data.mensagem
			console.log(ctrl.erro)
   		} );
   	  }
    }]
  }).
  component('listarDepartpcampus', {
    templateUrl: '/app/Departamento/departPcampus.template.html',
    controller: ['ApiDepartamentoPCampus', 'MatWebGlobals', '$routeParams', function Listar(ApiDepartamentoPCampus,MatWebGlobals,$routeParams) {
        this.formulario = {id_campus: $routeParams.Id_campus , 'nome': '', 'pagina': 0, 'quantidade': 1000 };
        console.log($routeParams.Id_campus);
        var ctrl = this;
        this.listar = function()
        {
            ApiDepartamentoPCampus.Listar(this.formulario,function(resultado) {
                ctrl.departamentos = resultado.corpo;
                for(var i = 0; campi = null; i < MatWebGlobals.campus.length; i++) {
                    if (MatWebGlobals.campus[i].id = $routeParams.Id_campus) {
                        campi = MatWebGlobals.campus[i];
                        break;
                    }
                };
                console.log(campi);
            }, function(error){
                ctrl.error = error.data.mensagem;
            });
        }
        this.listar();
    }]
});

<|endoftext|>


<commit_before>module.exports = HttpConnection;

var request = require('requestretry');
var HttpConfig = require("./HttpConfig");
var PaymayaApiError = require("./PaymayaApiError");

function HttpConnection(httpConfig) {
	this._httpConfig = httpConfig;
};

HttpConnection.prototype = {

	/* PUBLIC FUNCTIONS */
	execute: function(data, callback) {
		var httpOptions = {
		  url: this._httpConfig.getUrl(),
		  method: this._httpConfig.getMethod(),
		  headers: this._httpConfig.getHeaders(),
		  maxAttempts: this._httpConfig.getMaximumRequestAttempt()
		};

		if(data) {
		  httpOptions['body'] = JSON.stringify(data);
		}

		request(httpOptions, function(err, response, body) {
		  if(err) {
		    return callback(err);
		  }

		  if(!body && response.statusCode >= 400) {
		    var err = new PaymayaApiError(response.statusCode);
		    return callback(err);
		  }

		  if(typeof body != 'object') {
		    body = JSON.parse(body);
		  }

		  if(body.error) {
		    var err = new PaymayaApiError(response.statusCode, body.error);
		    return callback(err.message);
		  }

		  if(body.message) {
		  	return callback(body.message);
		  }

		  callback(null, body);
		});
	}
};<commit_msg>Modify displaying of error message<commit_after>module.exports = HttpConnection;

var request = require('requestretry');
var HttpConfig = require("./HttpConfig");
var PaymayaApiError = require("./PaymayaApiError");

function HttpConnection(httpConfig) {
	this._httpConfig = httpConfig;
};

HttpConnection.prototype = {

	/* PUBLIC FUNCTIONS */
	execute: function(data, callback) {
		var httpOptions = {
		  url: this._httpConfig.getUrl(),
		  method: this._httpConfig.getMethod(),
		  headers: this._httpConfig.getHeaders(),
		  maxAttempts: this._httpConfig.getMaximumRequestAttempt()
		};

		if(data) {
		  httpOptions['body'] = JSON.stringify(data);
		}

		request(httpOptions, function(err, response, body) {
		  if(err) {
		    return callback(err);
		  }

		  if(!body && response.statusCode >= 400) {
		    var err = new PaymayaApiError(response.statusCode);
		    return callback(err);
		  }

		  if(typeof body != 'object') {
		    body = JSON.parse(body);
		  }

		  if(body.error) {
		    var err = new PaymayaApiError(response.statusCode, body.error);
		    return callback(err.message);
		  }

		  if(body.message && response.statusCode != 200) {
		  	return callback(body.message);
		  }

		  callback(null, body);
		});
	}
};<|endoftext|>


<commit_before>angular.module('ngQuestionnaires.questionnaires')

  .controller('questionnaireNewCtrl', [
    '$scope',
    '$cacheFactory',
    '$location',
    'title',
    'action',
    function ($scope, $cacheFactory, $location, title, action) {

      var questionnaire = $cacheFactory.get('data').get('questionnaire');

      function navigate() {
        $cacheFactory.get('data').remove('questionnaire');
        $location.path('/questionnaires/list');
      }

      $scope.setTitle(title);
      $scope.action = action;

      if (questionnaire !== undefined) {
        $scope.questionnaire = questionnaire;
        $cacheFactory.get('data').remove('questionnaire');
      }

      $scope.addQuestion = function () {
        $cacheFactory.get('data').put('questionnaire', $scope.questionnaire);
        $location.path('/questions/new')
          .search({referrer: $location.path()});
      };

      $scope.save = function () {
        $scope.questionnaire.userId = $scope.user.id;
        $scope.questionnaires.add($scope.questionnaire, function (err) {
          if (err) {
            $scope.setAlert('danger', err);
          } else {
            $scope.setAlert('success', $scope.questionnaire.title + ' saved successfully');
            navigate();
          }
          $scope.$apply();
        });
      };

      $scope.cancel = navigate;

    }
  ])

  .controller('questionnaireEditCtrl', [
    '$scope',
    '$cacheFactory',
    '$location',
    '$routeParams',
    'title',
    'action',
    function ($scope, $cacheFactory, $location, $routeParams, title, action) {

      var questionnaire = $cacheFactory.get('data').get('questionnaire'),
        navigate = function () {
          $cacheFactory.get('data').remove('questionnaire');
          $location.path('/questionnaires/show/' + $scope.questionnaire.$id);
        };

      $scope.setTitle(title);
      $scope.action = action;

      if (questionnaire === undefined) {
        $scope.$watch(function () {
          return $scope.questionnaires.getByName($routeParams.id);
        }, function (questionnaire) {
          $scope.questionnaire = questionnaire;
        });
      } else {
        $scope.questionnaire = questionnaire;
        $cacheFactory.get('data').remove('questionnaire');
      }

      $scope.addQuestion = function () {
        $cacheFactory.get('data').put('questionnaire', $scope.questionnaire);
        $location.path('/questions/new')
          .search({
            referrer: $location.path(),
            id: $routeParams.id
          });
      };

      $scope.update = function () {
        $scope.questionnaires.update($scope.questionnaire, function (err) {
          if (err) {
            $scope.setAlert('danger', err);
          } else {
            $scope.setAlert('success', $scope.questionnaire.title + ' updated successfully');
            navigate();
          }
          $scope.$apply();
        });
      };

      $scope.cancel = navigate;

    }
  ]);
<commit_msg>Fixed referrer search parameter passed from new/edit questionnaire to new question<commit_after>angular.module('ngQuestionnaires.questionnaires')

  .controller('questionnaireNewCtrl', [
    '$scope',
    '$cacheFactory',
    '$location',
    'title',
    'action',
    function ($scope, $cacheFactory, $location, title, action) {

      var questionnaire = $cacheFactory.get('data').get('questionnaire');

      function navigate() {
        $cacheFactory.get('data').remove('questionnaire');
        $location.path('/questionnaires/list');
      }

      $scope.setTitle(title);
      $scope.action = action;

      if (questionnaire !== undefined) {
        $scope.questionnaire = questionnaire;
        $cacheFactory.get('data').remove('questionnaire');
      }

      $scope.addQuestion = function () {
        var referrer = $location.path();
        $cacheFactory.get('data').put('questionnaire', $scope.questionnaire);
        $location.path('/questions/new')
          .search({referrer: referrer});
      };

      $scope.save = function () {
        $scope.questionnaire.userId = $scope.user.id;
        $scope.questionnaires.add($scope.questionnaire, function (err) {
          if (err) {
            $scope.setAlert('danger', err);
          } else {
            $scope.setAlert('success', $scope.questionnaire.title + ' saved successfully');
            navigate();
          }
          $scope.$apply();
        });
      };

      $scope.cancel = navigate;

    }
  ])

  .controller('questionnaireEditCtrl', [
    '$scope',
    '$cacheFactory',
    '$location',
    '$routeParams',
    'title',
    'action',
    function ($scope, $cacheFactory, $location, $routeParams, title, action) {

      var questionnaire = $cacheFactory.get('data').get('questionnaire'),
        navigate = function () {
          $cacheFactory.get('data').remove('questionnaire');
          $location.path('/questionnaires/show/' + $scope.questionnaire.$id);
        };

      $scope.setTitle(title);
      $scope.action = action;

      if (questionnaire === undefined) {
        $scope.$watch(function () {
          return $scope.questionnaires.getByName($routeParams.id);
        }, function (questionnaire) {
          $scope.questionnaire = questionnaire;
        });
      } else {
        $scope.questionnaire = questionnaire;
        $cacheFactory.get('data').remove('questionnaire');
      }

      $scope.addQuestion = function () {
        var referrer = $location.path();
        $cacheFactory.get('data').put('questionnaire', $scope.questionnaire);
        $location.path('/questions/new')
          .search({
            referrer: referrer,
            id: $routeParams.id
          });
      };

      $scope.update = function () {
        $scope.questionnaires.update($scope.questionnaire, function (err) {
          if (err) {
            $scope.setAlert('danger', err);
          } else {
            $scope.setAlert('success', $scope.questionnaire.title + ' updated successfully');
            navigate();
          }
          $scope.$apply();
        });
      };

      $scope.cancel = navigate;

    }
  ]);
<|endoftext|>


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

    var classList = {
        tooltipWrapper: 'tl-wrapper',
        tooltipArrowWrapper: 'tl-arrow-wrapper',
        tooltipArrow: 'tl-arrow',
        tooltipTextWrapper: 'tl-text-wrapper',
        top: 'top',
        bottom: 'bottom',
        infoContainer: 'info-container',
        mouseover: 'mouseover'
    };

    var isTouchDevice = function(){
            return (('ontouchstart' in window)
                    || (navigator.MaxTouchPoints > 0)
                    || (navigator.msMaxTouchPoints > 0));
        },
        getElementsByAttribute = function (parent, attr){
            var matchingElements = [];
            var allElements = parent.getElementsByTagName('*');
            for (var i = 0, l = allElements.length; i < l; i++) {
                if (allElements[i].getAttribute(attr) !== null){
                    matchingElements.push(allElements[i]);
                }
            }
            return matchingElements;
        };

    var Tooltip = (function(){
        var tooltip;

        function init(){
            var domElement = 'div',
                tooltipElement = document.createElement(domElement),
                arrowWrapper = document.createElement(domElement),
                arrow = document.createElement(domElement),
                textWrapper = document.createElement(domElement);

            buildMarkup();

            bindEvents();

            return {
                show: show,
                hide: hide,
                element: tooltipElement
            };

            function show(container, element, text){
                if(text !== ''){
                    container.appendChild(tooltipElement);
                    textWrapper.textContent = text;
                    arrow.style.display = 'block';
                    tooltipElement.style.display = 'block';
                    var infoContainer = element.getElementsByClassName(classList.infoContainer)[0],
                        infoContainerHeight = infoContainer.offsetHeight,
                        arrowHalfWidth = 0,
                        windowWidth = window.innerWidth,
                        spotBounds = {
                            width: element.offsetWidth,
                            height: element.offsetHeight,
                            clientTop: element.getBoundingClientRect().top,
                            clientLeft: element.getBoundingClientRect().left,
                            top: element.offsetTop,
                            left: element.offsetLeft,
                            centerPosition: {
                                top: element.offsetTop + element.offsetHeight / 2,
                                left: element.offsetLeft + element.offsetWidth / 2
                            }
                        },
                        tooltipBounds = {
                            width: tooltipElement.offsetWidth,
                            heigth: tooltipElement.offsetHeight,
                            top: 0,
                            left: 0
                        },
                        tooltipClientRect = null;

                    if (tooltipBounds.heigth < spotBounds.clientTop + infoContainerHeight){
                        tooltipElement.classList.remove(classList.bottom);
                        tooltipElement.classList.add(classList.top);
                        tooltipBounds.top = spotBounds.centerPosition.top - infoContainerHeight - tooltipBounds.heigth;
                        tooltipElement.style.top = tooltipBounds.top + 'px';
                    } else {
                        tooltipElement.classList.remove(classList.top);
                        tooltipElement.classList.add(classList.bottom);
                        tooltipBounds.top = spotBounds.centerPosition.top + infoContainerHeight;
                        tooltipElement.style.top = tooltipBounds.top + 'px';
                    }

                    arrowHalfWidth = arrow.offsetWidth / 2
                    tooltipBounds.left = spotBounds.centerPosition.left - tooltipBounds.width * 0.5;
                    arrow.style.left = spotBounds.centerPosition.left - tooltipBounds.left - arrowHalfWidth + 'px';

                    tooltipElement.style.left = tooltipBounds.left + 'px';
                    tooltipClientRect = tooltipElement.getBoundingClientRect();
                    if(tooltipClientRect.bottom > window.innerHeight){
                        tooltipElement.style.top = tooltipBounds.top - (tooltipClientRect.bottom - window.innerHeight) + 'px';
                        arrow.style.display = 'none';
                    }
                    if (tooltipClientRect.left < 0) {
                        tooltipElement.style.left =  tooltipBounds.left - tooltipClientRect.left + 'px';
                        arrow.style.left = spotBounds.centerPosition.left - tooltipBounds.left + tooltipClientRect.left - arrowHalfWidth + 'px';
                    } if (tooltipClientRect.right > windowWidth){
                        tooltipElement.style.left = tooltipBounds.left + (windowWidth - tooltipClientRect.right) + 'px';
                        arrow.style.left = spotBounds.centerPosition.left - tooltipBounds.left - (windowWidth - tooltipClientRect.right) - arrowHalfWidth + 'px';
                    }
                }
            }

            function hide(){
                var parentNode = tooltipElement.parentNode;
                if (parentNode){
                    parentNode.removeChild(tooltipElement);
                } else {
                    tooltipElement.style.display = 'block';
                }
            }

            function buildMarkup(){
                tooltipElement.classList.add(classList.tooltipWrapper);
                arrowWrapper.classList.add(classList.tooltipArrowWrapper);
                arrow.classList.add(classList.tooltipArrow);
                textWrapper.classList.add(classList.tooltipTextWrapper);

                arrowWrapper.appendChild(arrow);
                tooltipElement.appendChild(arrowWrapper);
                tooltipElement.appendChild(textWrapper);
            }

            function bindEvents(){
                if (isTouchDevice()){
                    tooltipElement.addEventListener('click', function(event){
                        event.stopPropagation();
                    });
                    document.addEventListener('click', function(event){
                        hide();
                    });
                } else{
                    tooltipElement.addEventListener('mouseover', function(){
                        tooltipElement.classList.add(classList.mouseover);
                    });

                    tooltipElement.addEventListener('mouseout', function(event){
                        var e = event.toElement || event.relatedTarget;
                        if (e && (e.parentNode == this || e == this)) {
                           return;
                        }
                        tooltipElement.classList.remove(classList.mouseover);
                        hide();
                    });
                }
            }
        }

        return {
            getInstance: function(){
                if (!tooltip){
                    tooltip = init();
                }
                return tooltip;
            }
        };
    })();

    var Spot = function(element, container, ratio){
        var that = this;
        that.element = element;
        that.defaultTopStyle = parseFloat(element.style.top);
        that.defaultLeftStyle = parseFloat(element.style.left);
        that.defaultWidthStyle = parseFloat(element.style.width);
        that.defaultHeightStyle = parseFloat(element.style.height);
        that.text = element.getAttribute('data-text');

        var tooltip = Tooltip.getInstance();

        that.hide = function (){
            element.style.display = 'none';
        }

        that.show = function() {
            that.element.style.display = 'inline-block';
        };

        that.updatePosition = function(ratio){
            that.element.style.top = that.defaultTopStyle * ratio + 'px';
            that.element.style.left = that.defaultLeftStyle * ratio + 'px';
            that.element.style.width = that.defaultWidthStyle * ratio + 'px';
            that.element.style.height = that.defaultHeightStyle * ratio + 'px';
        };

        init();

        function init(){
            var infoElement = document.createElement('span');
            infoElement.classList.add(classList.infoContainer);
            that.element.appendChild(infoElement);
            that.hide();
            if (isTouchDevice()){
                that.element.addEventListener('click', function(event){
                    tooltip.show(container, that.element, that.text);
                    event.stopPropagation();
                });

            } else {
                that.element.addEventListener('mouseover', function () {
                    tooltip.show(container, that.element, that.text);
                });

                that.element.addEventListener('mouseout', function (event) {
                    var e = event.toElement || event.relatedTarget;
                    if (e && (e.parentNode == this || e == this || e == tooltip.element)) {
                       return;
                    }

                    setTimeout(function(){
                        if (!tooltip.element.classList.contains(classList.mouseover)){
                            tooltip.hide();
                        }
                    }, 10);
                });
            }
        }
    };

    window.HotspotOnImage = function(element) {
        var that = this,
            resizeTimer,
            refreshRate = 250;
        that.element = element;
        that.renderedImage = that.element.getElementsByTagName('img')[0];
        that.spots = [];
        that.ratio = 1;
        that.defaultImageWidth = 0;

        init();

        function init(){
            generateSpots();
            loadImage();
        }

        function loadImage(){
            var image = new Image();
            image.onload = function(){
                that.defaultImageWidth = this.width;
                that.ratio = that.renderedImage.offsetWidth / that.defaultImageWidth;
                updateSpotsPosition();
            };
            image.src = that.renderedImage.getAttribute('src');
        }

        function generateSpots(){
            var spots = getElementsByAttribute(that.element, 'data-id');
            eachSpots(spots, function(spot){
                that.spots.push(new Spot(spot, that.element, that.ratio));
            });
        }

        function updateSpotsPosition(){
            that.ratio = that.renderedImage.offsetWidth / that.defaultImageWidth;
            eachSpots(that.spots, function(spot){
                spot.updatePosition(that.ratio);
                spot.show();
            });
        }

        function eachSpots(spots, callback){
            var spotsLength = spots.length;
            for (var i = 0; i < spotsLength; i++){
                if (typeof callback === 'function'){
                    callback.call(this, spots[i]);
                }
            }
        }

        window.addEventListener('resize', function(){
            eachSpots(that.spots, function(spot){ spot.hide(); });
            clearTimeout(resizeTimer);
            resizeTimer = setTimeout(updateSpotsPosition, 250);
        });
    };

})();<commit_msg>Horizontal scroll appears for hints placed near right browser border.<commit_after>(function(){
    'use strict';

    var classList = {
        tooltipWrapper: 'tl-wrapper',
        tooltipArrowWrapper: 'tl-arrow-wrapper',
        tooltipArrow: 'tl-arrow',
        tooltipTextWrapper: 'tl-text-wrapper',
        top: 'top',
        bottom: 'bottom',
        infoContainer: 'info-container',
        mouseover: 'mouseover'
    };

    var isTouchDevice = function(){
            return (('ontouchstart' in window)
                    || (navigator.MaxTouchPoints > 0)
                    || (navigator.msMaxTouchPoints > 0));
        },
        getElementsByAttribute = function (parent, attr){
            var matchingElements = [];
            var allElements = parent.getElementsByTagName('*');
            for (var i = 0, l = allElements.length; i < l; i++) {
                if (allElements[i].getAttribute(attr) !== null){
                    matchingElements.push(allElements[i]);
                }
            }
            return matchingElements;
        };

    var Tooltip = (function(){
        var tooltip;

        function init(){
            var domElement = 'div',
                tooltipElement = document.createElement(domElement),
                arrowWrapper = document.createElement(domElement),
                arrow = document.createElement(domElement),
                textWrapper = document.createElement(domElement);

            buildMarkup();

            bindEvents();

            return {
                show: show,
                hide: hide,
                element: tooltipElement
            };

            function show(container, element, text){
                if(text !== ''){
                    container.appendChild(tooltipElement);
                    textWrapper.textContent = text;
                    arrow.style.display = 'block';
                    tooltipElement.style.display = 'block';
                    var infoContainer = element.getElementsByClassName(classList.infoContainer)[0],
                        infoContainerHeight = infoContainer.offsetHeight,
                        arrowHalfWidth = 0,
                        windowWidth = window.innerWidth,
                        browserScrollWidth = 20,
                        spotBounds = {
                            width: element.offsetWidth,
                            height: element.offsetHeight,
                            clientTop: element.getBoundingClientRect().top,
                            clientLeft: element.getBoundingClientRect().left,
                            top: element.offsetTop,
                            left: element.offsetLeft,
                            centerPosition: {
                                top: element.offsetTop + element.offsetHeight / 2,
                                left: element.offsetLeft + element.offsetWidth / 2
                            }
                        },
                        tooltipBounds = {
                            width: tooltipElement.offsetWidth,
                            heigth: tooltipElement.offsetHeight,
                            top: 0,
                            left: 0
                        },
                        tooltipClientRect = null;

                    if (tooltipBounds.heigth < spotBounds.clientTop + infoContainerHeight){
                        tooltipElement.classList.remove(classList.bottom);
                        tooltipElement.classList.add(classList.top);
                        tooltipBounds.top = spotBounds.centerPosition.top - infoContainerHeight - tooltipBounds.heigth;
                        tooltipElement.style.top = tooltipBounds.top + 'px';
                    } else {
                        tooltipElement.classList.remove(classList.top);
                        tooltipElement.classList.add(classList.bottom);
                        tooltipBounds.top = spotBounds.centerPosition.top + infoContainerHeight;
                        tooltipElement.style.top = tooltipBounds.top + 'px';
                    }

                    arrowHalfWidth = arrow.offsetWidth / 2
                    tooltipBounds.left = spotBounds.centerPosition.left - tooltipBounds.width * 0.5;
                    arrow.style.left = spotBounds.centerPosition.left - tooltipBounds.left - arrowHalfWidth + 'px';

                    tooltipElement.style.left = tooltipBounds.left + 'px';
                    tooltipClientRect = tooltipElement.getBoundingClientRect();
                    if(tooltipClientRect.bottom > window.innerHeight){
                        tooltipElement.style.top = tooltipBounds.top - (tooltipClientRect.bottom - window.innerHeight) + 'px';
                        arrow.style.display = 'none';
                    }
                    if (tooltipClientRect.left < 0) {
                        tooltipElement.style.left =  tooltipBounds.left - tooltipClientRect.left + 'px';
                        arrow.style.left = spotBounds.centerPosition.left - tooltipBounds.left + tooltipClientRect.left - arrowHalfWidth + 'px';
                    } if (tooltipClientRect.right > windowWidth){
                        tooltipElement.style.left = tooltipBounds.left + (windowWidth - tooltipClientRect.right) - browserScrollWidth + 'px';
                        arrow.style.left = spotBounds.centerPosition.left - tooltipBounds.left - (windowWidth - tooltipClientRect.right) + browserScrollWidth - arrowHalfWidth + 'px';
                    }
                }
            }

            function hide(){
                var parentNode = tooltipElement.parentNode;
                if (parentNode){
                    parentNode.removeChild(tooltipElement);
                } else {
                    tooltipElement.style.display = 'block';
                }
            }

            function buildMarkup(){
                tooltipElement.classList.add(classList.tooltipWrapper);
                arrowWrapper.classList.add(classList.tooltipArrowWrapper);
                arrow.classList.add(classList.tooltipArrow);
                textWrapper.classList.add(classList.tooltipTextWrapper);

                arrowWrapper.appendChild(arrow);
                tooltipElement.appendChild(arrowWrapper);
                tooltipElement.appendChild(textWrapper);
            }

            function bindEvents(){
                if (isTouchDevice()){
                    tooltipElement.addEventListener('click', function(event){
                        event.stopPropagation();
                    });
                    document.addEventListener('click', function(event){
                        hide();
                    });
                } else{
                    tooltipElement.addEventListener('mouseover', function(){
                        tooltipElement.classList.add(classList.mouseover);
                    });

                    tooltipElement.addEventListener('mouseout', function(event){
                        var e = event.toElement || event.relatedTarget;
                        if (e && (e.parentNode == this || e == this)) {
                           return;
                        }
                        tooltipElement.classList.remove(classList.mouseover);
                        hide();
                    });
                }
            }
        }

        return {
            getInstance: function(){
                if (!tooltip){
                    tooltip = init();
                }
                return tooltip;
            }
        };
    })();

    var Spot = function(element, container, ratio){
        var that = this;
        that.element = element;
        that.defaultTopStyle = parseFloat(element.style.top);
        that.defaultLeftStyle = parseFloat(element.style.left);
        that.defaultWidthStyle = parseFloat(element.style.width);
        that.defaultHeightStyle = parseFloat(element.style.height);
        that.text = element.getAttribute('data-text');

        var tooltip = Tooltip.getInstance();

        that.hide = function (){
            element.style.display = 'none';
        }

        that.show = function() {
            that.element.style.display = 'inline-block';
        };

        that.updatePosition = function(ratio){
            that.element.style.top = that.defaultTopStyle * ratio + 'px';
            that.element.style.left = that.defaultLeftStyle * ratio + 'px';
            that.element.style.width = that.defaultWidthStyle * ratio + 'px';
            that.element.style.height = that.defaultHeightStyle * ratio + 'px';
        };

        init();

        function init(){
            var infoElement = document.createElement('span');
            infoElement.classList.add(classList.infoContainer);
            that.element.appendChild(infoElement);
            that.hide();
            if (isTouchDevice()){
                that.element.addEventListener('click', function(event){
                    tooltip.show(container, that.element, that.text);
                    event.stopPropagation();
                });

            } else {
                that.element.addEventListener('mouseover', function () {
                    tooltip.show(container, that.element, that.text);
                });

                that.element.addEventListener('mouseout', function (event) {
                    var e = event.toElement || event.relatedTarget;
                    if (e && (e.parentNode == this || e == this || e == tooltip.element)) {
                       return;
                    }

                    setTimeout(function(){
                        if (!tooltip.element.classList.contains(classList.mouseover)){
                            tooltip.hide();
                        }
                    }, 10);
                });
            }
        }
    };

    window.HotspotOnImage = function(element) {
        var that = this,
            resizeTimer,
            refreshRate = 250;
        that.element = element;
        that.renderedImage = that.element.getElementsByTagName('img')[0];
        that.spots = [];
        that.ratio = 1;
        that.defaultImageWidth = 0;

        init();

        function init(){
            generateSpots();
            loadImage();
        }

        function loadImage(){
            var image = new Image();
            image.onload = function(){
                that.defaultImageWidth = this.width;
                that.ratio = that.renderedImage.offsetWidth / that.defaultImageWidth;
                updateSpotsPosition();
            };
            image.src = that.renderedImage.getAttribute('src');
        }

        function generateSpots(){
            var spots = getElementsByAttribute(that.element, 'data-id');
            eachSpots(spots, function(spot){
                that.spots.push(new Spot(spot, that.element, that.ratio));
            });
        }

        function updateSpotsPosition(){
            that.ratio = that.renderedImage.offsetWidth / that.defaultImageWidth;
            eachSpots(that.spots, function(spot){
                spot.updatePosition(that.ratio);
                spot.show();
            });
        }

        function eachSpots(spots, callback){
            var spotsLength = spots.length;
            for (var i = 0; i < spotsLength; i++){
                if (typeof callback === 'function'){
                    callback.call(this, spots[i]);
                }
            }
        }

        window.addEventListener('resize', function(){
            eachSpots(that.spots, function(spot){ spot.hide(); });
            clearTimeout(resizeTimer);
            resizeTimer = setTimeout(updateSpotsPosition, 250);
        });
    };

})();(function(){
    'use strict';

    var classList = {
        tooltipWrapper: 'tl-wrapper',
        tooltipArrowWrapper: 'tl-arrow-wrapper',
        tooltipArrow: 'tl-arrow',
        tooltipTextWrapper: 'tl-text-wrapper',
        top: 'top',
        bottom: 'bottom',
        infoContainer: 'info-container',
        mouseover: 'mouseover'
    };

    var isTouchDevice = function(){
            return (('ontouchstart' in window)
                    || (navigator.MaxTouchPoints > 0)
                    || (navigator.msMaxTouchPoints > 0));
        },
        getElementsByAttribute = function (parent, attr){
            var matchingElements = [];
            var allElements = parent.getElementsByTagName('*');
            for (var i = 0, l = allElements.length; i < l; i++) {
                if (allElements[i].getAttribute(attr) !== null){
                    matchingElements.push(allElements[i]);
                }
            }
            return matchingElements;
        };

    var Tooltip = (function(){
        var tooltip;

        function init(){
            var domElement = 'div',
                tooltipElement = document.createElement(domElement),
                arrowWrapper = document.createElement(domElement),
                arrow = document.createElement(domElement),
                textWrapper = document.createElement(domElement);

            buildMarkup();

            bindEvents();

            return {
                show: show,
                hide: hide,
                element: tooltipElement
            };

            function show(container, element, text){
                if(text !== ''){
                    container.appendChild(tooltipElement);
                    textWrapper.textContent = text;
                    arrow.style.display = 'block';
                    tooltipElement.style.display = 'block';
                    var infoContainer = element.getElementsByClassName(classList.infoContainer)[0],
                        infoContainerHeight = infoContainer.offsetHeight,
                        arrowHalfWidth = 0,
                        windowWidth = window.innerWidth,
                        browserScrollWidth = 20,
                        spotBounds = {
                            width: element.offsetWidth,
                            height: element.offsetHeight,
                            clientTop: element.getBoundingClientRect().top,
                            clientLeft: element.getBoundingClientRect().left,
                            top: element.offsetTop,
                            left: element.offsetLeft,
                            centerPosition: {
                                top: element.offsetTop + element.offsetHeight / 2,
                                left: element.offsetLeft + element.offsetWidth / 2
                            }
                        },
                        tooltipBounds = {
                            width: tooltipElement.offsetWidth,
                            heigth: tooltipElement.offsetHeight,
                            top: 0,
                            left: 0
                        },
                        tooltipClientRect = null;

                    if (tooltipBounds.heigth < spotBounds.clientTop + infoContainerHeight){
                        tooltipElement.classList.remove(classList.bottom);
                        tooltipElement.classList.add(classList.top);
                        tooltipBounds.top = spotBounds.centerPosition.top - infoContainerHeight - tooltipBounds.heigth;
                        tooltipElement.style.top = tooltipBounds.top + 'px';
                    } else {
                        tooltipElement.classList.remove(classList.top);
                        tooltipElement.classList.add(classList.bottom);
                        tooltipBounds.top = spotBounds.centerPosition.top + infoContainerHeight;
                        tooltipElement.style.top = tooltipBounds.top + 'px';
                    }

                    arrowHalfWidth = arrow.offsetWidth / 2
                    tooltipBounds.left = spotBounds.centerPosition.left - tooltipBounds.width * 0.5;
                    arrow.style.left = spotBounds.centerPosition.left - tooltipBounds.left - arrowHalfWidth + 'px';

                    tooltipElement.style.left = tooltipBounds.left + 'px';
                    tooltipClientRect = tooltipElement.getBoundingClientRect();
                    if(tooltipClientRect.bottom > window.innerHeight){
                        tooltipElement.style.top = tooltipBounds.top - (tooltipClientRect.bottom - window.innerHeight) + 'px';
                        arrow.style.display = 'none';
                    }
                    if (tooltipClientRect.left < 0) {
                        tooltipElement.style.left =  tooltipBounds.left - tooltipClientRect.left + 'px';
                        arrow.style.left = spotBounds.centerPosition.left - tooltipBounds.left + tooltipClientRect.left - arrowHalfWidth + 'px';
                    } if (tooltipClientRect.right > windowWidth){
                        tooltipElement.style.left = tooltipBounds.left + (windowWidth - tooltipClientRect.right) - browserScrollWidth + 'px';
                        arrow.style.left = spotBounds.centerPosition.left - tooltipBounds.left - (windowWidth - tooltipClientRect.right) + browserScrollWidth - arrowHalfWidth + 'px';
                    }
                }
            }

            function hide(){
                var parentNode = tooltipElement.parentNode;
                if (parentNode){
                    parentNode.removeChild(tooltipElement);
                } else {
                    tooltipElement.style.display = 'block';
                }
            }

            function buildMarkup(){
                tooltipElement.classList.add(classList.tooltipWrapper);
                arrowWrapper.classList.add(classList.tooltipArrowWrapper);
                arrow.classList.add(classList.tooltipArrow);
                textWrapper.classList.add(classList.tooltipTextWrapper);

                arrowWrapper.appendChild(arrow);
                tooltipElement.appendChild(arrowWrapper);
                tooltipElement.appendChild(textWrapper);
            }

            function bindEvents(){
                if (isTouchDevice()){
                    tooltipElement.addEventListener('click', function(event){
                        event.stopPropagation();
                    });
                    document.addEventListener('click', function(event){
                        hide();
                    });
                } else{
                    tooltipElement.addEventListener('mouseover', function(){
                        tooltipElement.classList.add(classList.mouseover);
                    });

                    tooltipElement.addEventListener('mouseout', function(event){
                        var e = event.toElement || event.relatedTarget;
                        if (e && (e.parentNode == this || e == this)) {
                           return;
                        }
                        tooltipElement.classList.remove(classList.mouseover);
                        hide();
                    });
                }
            }
        }

        return {
            getInstance: function(){
                if (!tooltip){
                    tooltip = init();
                }
                return tooltip;
            }
        };
    })();

    var Spot = function(element, container, ratio){
        var that = this;
        that.element = element;
        that.defaultTopStyle = parseFloat(element.style.top);
        that.defaultLeftStyle = parseFloat(element.style.left);
        that.defaultWidthStyle = parseFloat(element.style.width);
        that.defaultHeightStyle = parseFloat(element.style.height);
        that.text = element.getAttribute('data-text');

        var tooltip = Tooltip.getInstance();

        that.hide = function (){
            element.style.display = 'none';
        }

        that.show = function() {
            that.element.style.display = 'inline-block';
        };

        that.updatePosition = function(ratio){
            that.element.style.top = that.defaultTopStyle * ratio + 'px';
            that.element.style.left = that.defaultLeftStyle * ratio + 'px';
            that.element.style.width = that.defaultWidthStyle * ratio + 'px';
            that.element.style.height = that.defaultHeightStyle * ratio + 'px';
        };

        init();

        function init(){
            var infoElement = document.createElement('span');
            infoElement.classList.add(classList.infoContainer);
            that.element.appendChild(infoElement);
            that.hide();
            if (isTouchDevice()){
                that.element.addEventListener('click', function(event){
                    tooltip.show(container, that.element, that.text);
                    event.stopPropagation();
                });

            } else {
                that.element.addEventListener('mouseover', function () {
                    tooltip.show(container, that.element, that.text);
                });

                that.element.addEventListener('mouseout', function (event) {
                    var e = event.toElement || event.relatedTarget;
                    if (e && (e.parentNode == this || e == this || e == tooltip.element)) {
                       return;
                    }

                    setTimeout(function(){
                        if (!tooltip.element.classList.contains(classList.mouseover)){
                            tooltip.hide();
                        }
                    }, 10);
                });
            }
        }
    };

    window.HotspotOnImage = function(element) {
        var that = this,
            resizeTimer,
            refreshRate = 250;
        that.element = element;
        that.renderedImage = that.element.getElementsByTagName('img')[0];
        that.spots = [];
        that.ratio = 1;
        that.defaultImageWidth = 0;

        init();

        function init(){
            generateSpots();
            loadImage();
        }

        function loadImage(){
            var image = new Image();
            image.onload = function(){
                that.defaultImageWidth = this.width;
                that.ratio = that.renderedImage.offsetWidth / that.defaultImageWidth;
                updateSpotsPosition();
            };
            image.src = that.renderedImage.getAttribute('src');
        }

        function generateSpots(){
            var spots = getElementsByAttribute(that.element, 'data-id');
            eachSpots(spots, function(spot){
                that.spots.push(new Spot(spot, that.element, that.ratio));
            });
        }

        function updateSpotsPosition(){
            that.ratio = that.renderedImage.offsetWidth / that.defaultImageWidth;
            eachSpots(that.spots, function(spot){
                spot.updatePosition(that.ratio);
                spot.show();
            });
        }

        function eachSpots(spots, callback){
            var spotsLength = spots.length;
            for (var i = 0; i < spotsLength; i++){
                if (typeof callback === 'function'){
                    callback.call(this, spots[i]);
                }
            }
        }

        window.addEventListener('resize', function(){
            eachSpots(that.spots, function(spot){ spot.hide(); });
            clearTimeout(resizeTimer);
            resizeTimer = setTimeout(updateSpotsPosition, 250);
        });
    };

})();<|endoftext|>


<commit_before>import EmberHandlebars from "ember-handlebars-compiler";
import Ember from "ember-metal/core"; // to add to globals

import { runLoadHooks } from "ember-runtime/system/lazy_load";
import bootstrap from "ember-handlebars/loader";

import {
  makeBoundHelper,
  registerBoundHelper,
  helperMissingHelper,
  blockHelperMissingHelper
} from "ember-handlebars/ext";

// side effect of extending StringUtils of htmlSafe
import "ember-handlebars/string";

import {
  bind,
  _triageMustacheHelper,
  resolveHelper,
  bindHelper,
  boundIfHelper,
  unboundIfHelper,
  withHelper,
  ifHelper,
  unlessHelper,
  bindAttrHelper,
  bindAttrHelperDeprecated,
  bindClasses
} from "ember-handlebars/helpers/binding";

import collectionHelper from "ember-handlebars/helpers/collection";
import {
  ViewHelper,
  viewHelper
} from "ember-handlebars/helpers/view";
import unboundHelper from "ember-handlebars/helpers/unbound";
import {
  logHelper,
  debuggerHelper
} from "ember-handlebars/helpers/debug";
import {
  EachView,
  eachHelper
} from "ember-handlebars/helpers/each";
import templateHelper from "ember-handlebars/helpers/template";
import partialHelper from "ember-handlebars/helpers/partial";
import yieldHelper from "ember-handlebars/helpers/yield";
import locHelper from "ember-handlebars/helpers/loc";

import Checkbox from "ember-handlebars/controls/checkbox";
import {
  Select,
  SelectOption,
  SelectOptgroup
} from "ember-handlebars/controls/select";
import TextArea from "ember-handlebars/controls/text_area";
import TextField from "ember-handlebars/controls/text_field";
import TextSupport from "ember-handlebars/controls/text_support";
import {
  inputHelper,
  textareaHelper
} from "ember-handlebars/controls";

import ComponentLookup from "ember-handlebars/component_lookup";
import {
  _HandlebarsBoundView,
  SimpleHandlebarsView
} from "ember-handlebars/views/handlebars_bound_view";
import _MetamorphView from "ember-handlebars/views/metamorph_view";
import {
  _SimpleMetamorphView,
  _Metamorph
} from "ember-handlebars/views/metamorph_view";

/**
Ember Handlebars

@module ember
@submodule ember-handlebars
@requires ember-views
*/

// Ember.Handlebars.Globals
EmberHandlebars.bootstrap = bootstrap;
EmberHandlebars.makeBoundHelper = makeBoundHelper;
EmberHandlebars.registerBoundHelper = registerBoundHelper;
EmberHandlebars.resolveHelper = resolveHelper;
EmberHandlebars.bind = bind;
EmberHandlebars.bindClasses = bindClasses;
EmberHandlebars.EachView = EachView;
EmberHandlebars.ViewHelper = ViewHelper;

// Ember Globals
Ember.Handlebars = EmberHandlebars;
Ember.ComponentLookup = ComponentLookup;
Ember._SimpleHandlebarsView = SimpleHandlebarsView;
Ember._HandlebarsBoundView = _HandlebarsBoundView;
Ember._SimpleMetamorphView = _SimpleMetamorphView;
Ember._MetamorphView = _MetamorphView;
Ember._Metamorph = _Metamorph;
Ember.TextSupport = TextSupport;
Ember.Checkbox = Checkbox;
Ember.Select = Select;
Ember.SelectOption = SelectOption;
Ember.SelectOptgroup = SelectOptgroup;
Ember.TextArea = TextArea;
Ember.TextField = TextField;
Ember.TextSupport = TextSupport;

// register helpers
EmberHandlebars.registerHelper('helperMissing', helperMissingHelper);
EmberHandlebars.registerHelper('blockHelperMissing', blockHelperMissingHelper);
EmberHandlebars.registerHelper('bind', bindHelper);
EmberHandlebars.registerHelper('boundIf', boundIfHelper);
EmberHandlebars.registerHelper('_triageMustache', _triageMustacheHelper);
EmberHandlebars.registerHelper('unboundIf', unboundIfHelper);
EmberHandlebars.registerHelper('with', withHelper);
EmberHandlebars.registerHelper('if', ifHelper);
EmberHandlebars.registerHelper('unless', unlessHelper);
EmberHandlebars.registerHelper('bind-attr', bindAttrHelper);
EmberHandlebars.registerHelper('bindAttr', bindAttrHelperDeprecated);
EmberHandlebars.registerHelper('collection', collectionHelper);
EmberHandlebars.registerHelper("log", logHelper);
EmberHandlebars.registerHelper("debugger", debuggerHelper);
EmberHandlebars.registerHelper("each", eachHelper);
EmberHandlebars.registerHelper("loc", locHelper);
EmberHandlebars.registerHelper("partial", partialHelper);
EmberHandlebars.registerHelper("template", templateHelper);
EmberHandlebars.registerHelper("yield", yieldHelper);
EmberHandlebars.registerHelper("view", viewHelper);
EmberHandlebars.registerHelper("unbound", unboundHelper);
EmberHandlebars.registerHelper("input", inputHelper);
EmberHandlebars.registerHelper("textarea", textareaHelper);

// run load hooks
runLoadHooks('Ember.Handlebars', EmberHandlebars);

export default EmberHandlebars;
<commit_msg>Ensure Ember.Handlebars.get is exported.<commit_after>import EmberHandlebars from "ember-handlebars-compiler";
import Ember from "ember-metal/core"; // to add to globals

import { runLoadHooks } from "ember-runtime/system/lazy_load";
import bootstrap from "ember-handlebars/loader";

import {
  makeBoundHelper,
  registerBoundHelper,
  helperMissingHelper,
  blockHelperMissingHelper,
  handlebarsGet
} from "ember-handlebars/ext";

// side effect of extending StringUtils of htmlSafe
import "ember-handlebars/string";

import {
  bind,
  _triageMustacheHelper,
  resolveHelper,
  bindHelper,
  boundIfHelper,
  unboundIfHelper,
  withHelper,
  ifHelper,
  unlessHelper,
  bindAttrHelper,
  bindAttrHelperDeprecated,
  bindClasses
} from "ember-handlebars/helpers/binding";

import collectionHelper from "ember-handlebars/helpers/collection";
import {
  ViewHelper,
  viewHelper
} from "ember-handlebars/helpers/view";
import unboundHelper from "ember-handlebars/helpers/unbound";
import {
  logHelper,
  debuggerHelper
} from "ember-handlebars/helpers/debug";
import {
  EachView,
  eachHelper
} from "ember-handlebars/helpers/each";
import templateHelper from "ember-handlebars/helpers/template";
import partialHelper from "ember-handlebars/helpers/partial";
import yieldHelper from "ember-handlebars/helpers/yield";
import locHelper from "ember-handlebars/helpers/loc";

import Checkbox from "ember-handlebars/controls/checkbox";
import {
  Select,
  SelectOption,
  SelectOptgroup
} from "ember-handlebars/controls/select";
import TextArea from "ember-handlebars/controls/text_area";
import TextField from "ember-handlebars/controls/text_field";
import TextSupport from "ember-handlebars/controls/text_support";
import {
  inputHelper,
  textareaHelper
} from "ember-handlebars/controls";

import ComponentLookup from "ember-handlebars/component_lookup";
import {
  _HandlebarsBoundView,
  SimpleHandlebarsView
} from "ember-handlebars/views/handlebars_bound_view";
import _MetamorphView from "ember-handlebars/views/metamorph_view";
import {
  _SimpleMetamorphView,
  _Metamorph
} from "ember-handlebars/views/metamorph_view";

/**
Ember Handlebars

@module ember
@submodule ember-handlebars
@requires ember-views
*/

// Ember.Handlebars.Globals
EmberHandlebars.bootstrap = bootstrap;
EmberHandlebars.makeBoundHelper = makeBoundHelper;
EmberHandlebars.registerBoundHelper = registerBoundHelper;
EmberHandlebars.resolveHelper = resolveHelper;
EmberHandlebars.bind = bind;
EmberHandlebars.bindClasses = bindClasses;
EmberHandlebars.EachView = EachView;
EmberHandlebars.ViewHelper = ViewHelper;

// Ember Globals
Ember.Handlebars = EmberHandlebars;
EmberHandlebars.get = handlebarsGet;
Ember.ComponentLookup = ComponentLookup;
Ember._SimpleHandlebarsView = SimpleHandlebarsView;
Ember._HandlebarsBoundView = _HandlebarsBoundView;
Ember._SimpleMetamorphView = _SimpleMetamorphView;
Ember._MetamorphView = _MetamorphView;
Ember._Metamorph = _Metamorph;
Ember.TextSupport = TextSupport;
Ember.Checkbox = Checkbox;
Ember.Select = Select;
Ember.SelectOption = SelectOption;
Ember.SelectOptgroup = SelectOptgroup;
Ember.TextArea = TextArea;
Ember.TextField = TextField;
Ember.TextSupport = TextSupport;

// register helpers
EmberHandlebars.registerHelper('helperMissing', helperMissingHelper);
EmberHandlebars.registerHelper('blockHelperMissing', blockHelperMissingHelper);
EmberHandlebars.registerHelper('bind', bindHelper);
EmberHandlebars.registerHelper('boundIf', boundIfHelper);
EmberHandlebars.registerHelper('_triageMustache', _triageMustacheHelper);
EmberHandlebars.registerHelper('unboundIf', unboundIfHelper);
EmberHandlebars.registerHelper('with', withHelper);
EmberHandlebars.registerHelper('if', ifHelper);
EmberHandlebars.registerHelper('unless', unlessHelper);
EmberHandlebars.registerHelper('bind-attr', bindAttrHelper);
EmberHandlebars.registerHelper('bindAttr', bindAttrHelperDeprecated);
EmberHandlebars.registerHelper('collection', collectionHelper);
EmberHandlebars.registerHelper("log", logHelper);
EmberHandlebars.registerHelper("debugger", debuggerHelper);
EmberHandlebars.registerHelper("each", eachHelper);
EmberHandlebars.registerHelper("loc", locHelper);
EmberHandlebars.registerHelper("partial", partialHelper);
EmberHandlebars.registerHelper("template", templateHelper);
EmberHandlebars.registerHelper("yield", yieldHelper);
EmberHandlebars.registerHelper("view", viewHelper);
EmberHandlebars.registerHelper("unbound", unboundHelper);
EmberHandlebars.registerHelper("input", inputHelper);
EmberHandlebars.registerHelper("textarea", textareaHelper);

// run load hooks
runLoadHooks('Ember.Handlebars', EmberHandlebars);

export default EmberHandlebars;
<|endoftext|>