<commit_before>define('app/views/log_list', ['app/views/mistscreen'],
    //
    //  Log List View
    //
    //  @returns Class
    //
    function (PageView) {

        'use strict';

        var MIN_LOGS_DISPLAYED = 30;
        var MAX_LOGS_REQUESTED = 300;
        var LOGS_REQUEST_INTERVAL = 500;
        var EVENT_TYPES = ['job', 'shell', 'request', 'session', 'incident'];

        return PageView.extend({

            //
            //
            //  Properties
            //
            //

            forceFlag: 'all',
            filterString: '',
            noMoreLogs: false,
            lastLogTimestamp: null,

            showErrors: null,

            includeTypes: [],
            includeFilters: [],
            includeEmails: [],

            excludeTypes: [],
            excludeFilters: [],
            excludeEmails: [],

            //
            //
            //  Initialization
            //
            //

            load: function () {
                this._initializeController();
                this._initializeScrolling();
                this._initializeSocket();
                this._updateLogTime();
                this.search();
                Mist.l = this;
            }.on('didInsertElement'),

            unload: function () {
                this._initializeController();
                Mist.get('logs').off('logs', this, this.handleResponse);
                Mist.get('logs').off('event', this, this.handleStream);
            }.on('willDestroyElement'),

            //
            //
            //  Methods
            //
            //

            search: function () {
                if (!Mist.logs.socket.socket.connected)  {
                    Ember.run.later(this, function () {
                        this.search();
                    }, 350);
                    return;
                }
                if (this.get('noMoreLogs'))
                    return;
                this.set('fetchingHistory', true);
                this._processFilterString();
                Mist.logs.emit('get_logs',  this._generatePayload());
            },

            handleResponse: function (logs) {
                if (logs.length)
                    this.set('lastLogTimestamp', logs[logs.length - 1].time);
                else
                    this.set('noMoreLogs', true);
                this.set('fetchingHistory', false);
                Ember.run(this, function () {
                    Mist.logsController._appendContent(
                        this.filter(logs)
                    );
                });
                if (logs.length && Mist.logsController.content.length < MIN_LOGS_DISPLAYED) {
                    this.set('disableScrollFetch', true);
                    Ember.run.later(this, function () {
                        this.search();
                    }, LOGS_REQUEST_INTERVAL);
                } else {
                    this.set('disableScrollFetch', false);
                }
            },

            handleStream: function (log) {
                Ember.run(this, function () {
                    Mist.logsController._prependContent(
                        this.filter([log])
                    )
                });
            },

            filter: function (logs) {

                logs = slice(logs);

                if (this.get('showErrors') != null)
                    this._filterErrors(logs, this.get('showErrors'));

                if (this.get('includeTypes').length)
                    this._filterInTypes(logs, this.get('includeTypes'));

                if (this.get('excludeTypes').length)
                    this._filterOutTypes(logs, this.get('excludeTypes'));

                if (this.get('includeEmails').length)
                    this._filterInEmails(logs, this.get('includeEmails'));

                if (this.get('excludeEmails').length)
                    this._filterOutEmails(logs, this.get('excludeEmails'));

                if (this.get('includeTerms').length)
                    this._filterInTerms(logs, this.get('includeTerms'));

                if (this.get('excludeTerms').length)
                    this._filterOutTerms(logs, this.get('excludeTerms'));

                var forceFlag = this.get('forceFlag');
                if (forceFlag != 'all') {
                    if (forceFlag == 'error')
                        this._filterErrors(logs, forceFlag);
                    else
                        this._filterInTypes(logs, forceFlag);
                }

                return logs;
            },

            //
            //
            //  Pseudo-Private Methods
            //
            //

            _initializeSocket: function () {
                Mist.get('logs').on('logs', this, this.handleResponse);
                Mist.get('logs').on('event', this, this.handleStream);
            },

            _initializeController: function () {
                Mist.logsController.clear();
            },

            _initializeScrolling: function () {
                var that = this;
                Ember.run.later(function () {
                    $(window).on('scroll', function (e) {
                        Ember.run.once(function () {
                            if (Mist.isScrolledToBottom() &&
                                !that.disableScrollFetch &&
                                !that.fetchingHistory) {
                                    that.search();
                            }
                        });
                    });
               }, 1000);
            },

            _processFilterString: function () {

                // Prepare filter
                var filter = this.get('filterString').trim().toLowerCase().split(' ').map(function (term) {
                    return term.trim();
                }).unique().removeObject("");

                // Extract include terms
                var includeTerms = filter.filter(function (word) {
                    return word.charAt(0) !== '!';
                });
                filter = filter.removeObjects(includeTerms);

                // Extract exclude terms
                var excludeTerms = filter.map(function (word) {
                    return word.slice(1); // remove "!" char
                });

                // Extract include types
                var includeTypes = includeTerms.filter(function (term) {
                    return EVENT_TYPES.indexOf(term) > -1;
                }, this);
                includeTerms.removeObjects(includeTypes);

                // Extract exclude types
                var excludeTypes = excludeTerms.filter(function (term) {
                    return EVENT_TYPES.indexOf(term) > -1;
                }, this);
                excludeTerms.removeObjects(excludeTypes);

                // Extract include emails
                var includeEmails = includeTerms.filter(function (term) {
                    var result = term.match(EMAIL_REGEX);
                    return result ? result[0] : false;
                });
                includeTerms.removeObjects(includeEmails);

                // Extract exclude emails
                var excludeEmails = excludeTerms.filter(function (term) {
                    var result = term.match(EMAIL_REGEX);
                    return result ? result[0] : false;
                });
                excludeTerms.removeObjects(excludeEmails);

                // Show Errors
                var showErrors = null;
                if (includeTerms.indexOf('error') > -1) {
                    showErrors = true;
                    includeTerms.removeObject('error');
                }
                if (excludeTerms.indexOf('error') > -1) {
                    showErrors =  false;
                    excludeTerms.removeObject('error');
                }

                this.setProperties({
                    showErrors: showErrors,
                    includeTerms: includeTerms,
                    excludeTerms: excludeTerms,
                    includeTypes: includeTypes,
                    excludeTypes: excludeTypes,
                    includeEmails: includeEmails,
                    excludeEmails: excludeEmails,
                });
            },

            _updateLogTime: function () {
                if (this.$()) {
                    Ember.run(this, function () {
                        Mist.logsController.content.forEach(function (log) {
                            log.propertyWillChange('time');
                            log.propertyDidChange('time');
                        });
                    });
                    Ember.run.later(this, this._updateLogTime, 10 * TIME_MAP.SECOND);
                }
            },

            _generatePayload: function () {

                var payload = {limit: MAX_LOGS_REQUESTED};

                if (this.get('showErrors') != null)
                    payload.error = this.get('showErrors');

                if (this.get('includeTypes').length == 1 &&
                    !this.get('excludeTypes').length)
                        payload.event_type = this.get('includeTypes')[0];

                if (this.get('includeEmails').length == 1 &&
                    !this.get('excludeEmails').length)
                        payload.email = this.get('includeEmails')[0];

                if (this.get('lastLogTimestamp'))
                    payload.stop = this.get('lastLogTimestamp');

                var forceFlag = this.get('forceFlag');
                if (forceFlag != 'all') {
                    if (forceFlag == 'error')
                        payload.error = true;
                    else
                        payload.event_type = forceFlag;
                }

                return payload;
            },

            _filterErrors: function (logs, showErrors) {
                logs.removeObjects(
                    logs.rejectBy('error', showErrors)
                );
            },

            _filterInTypes: function (logs, types) {
                logs.removeObjects(
                    logs.filter(function (log) {
                        return types.indexOf(log.type) == -1;
                    })
                );
            },

            _filterOutTypes: function (logs, types) {
                types.forEach(function (type) {
                    logs.removeObjects(
                        logs.filterBy('type', type)
                    );
                });
            },

            _filterInEmails: function (logs, emails) {
                logs.removeObjects(
                    logs.filter(function (log) {
                        return emails.indexOf(log.email) == -1;
                    })
                );
            },

            _filterOutEmails: function (logs, emails) {
                emails.forEach(function (email) {
                    logs.removeObjects(
                        logs.filterBy('email', email)
                    );
                });
            },

            _filterInTerms: function (logs, terms) {
                logs.removeObjects(
                    logs.filter(function (log) {
                        return terms.some(function (term) {
                            return !forIn(log, function (value) {
                                return textInString(term, value);
                            })
                        })
                    })
                );
            },

            _filterOutTerms: function (logs, terms) {
                logs.removeObjects(
                    logs.filter(function (log) {
                        return terms.some(function (term) {
                            return forIn(log, function (value) {
                                return textInString(term, value);
                            });
                        })
                    })
                );
            },

            actions: {

                updateFilterFlags: function (flag) {
                    var newFilterString = this.get('filterString');
                    var flags = slice(EVENT_TYPES);
                    flags.push('error');
                    flags.forEach(function (f) {
                        newFilterString = newFilterString.replace('!'+f, '').replace(f, '');
                    });
                    this.set('filterString', newFilterString.trim().replace(/\s\s/g, ' '));
                    this.set('forceFlag', flag);
                    this.newSearch(1);
                }
            },

            newSearch: function (interval) {
               var that = this;
               clearTimeout(this.searchLock);
               this.set('searchLock', setTimeout(function () {
                   Mist.logsController.clear();
                   that.set('noMoreLogs', false);
                   that.set('lastLogTimestamp', null);
                   that.search();
               }, interval || 700))
           },

            //
            //
            //  Observers
            //
            //

            filterStringObserver: function () {
                Ember.run.once(this, 'newSearch');
            }.observes('filterString')
        });

        function textInString (text, str) {
            if (typeof str != 'string')
                return false;
            return str.toLowerCase().indexOf(text) > -1;
        }
    }
);
<commit_msg>fix logic mistake<commit_after>define('app/views/log_list', ['app/views/mistscreen'],
    //
    //  Log List View
    //
    //  @returns Class
    //
    function (PageView) {

        'use strict';

        var MIN_LOGS_DISPLAYED = 30;
        var MAX_LOGS_REQUESTED = 300;
        var LOGS_REQUEST_INTERVAL = 500;
        var EVENT_TYPES = ['job', 'shell', 'request', 'session', 'incident'];

        return PageView.extend({

            //
            //
            //  Properties
            //
            //

            forceFlag: 'all',
            filterString: '',
            noMoreLogs: false,
            lastLogTimestamp: null,

            showErrors: null,

            includeTypes: [],
            includeFilters: [],
            includeEmails: [],

            excludeTypes: [],
            excludeFilters: [],
            excludeEmails: [],

            //
            //
            //  Initialization
            //
            //

            load: function () {
                this._initializeController();
                this._initializeScrolling();
                this._initializeSocket();
                this._updateLogTime();
                this.search();
                Mist.l = this;
            }.on('didInsertElement'),

            unload: function () {
                this._initializeController();
                Mist.get('logs').off('logs', this, this.handleResponse);
                Mist.get('logs').off('event', this, this.handleStream);
            }.on('willDestroyElement'),

            //
            //
            //  Methods
            //
            //

            search: function () {
                if (!Mist.logs.socket.socket.connected)  {
                    Ember.run.later(this, function () {
                        this.search();
                    }, 350);
                    return;
                }
                if (this.get('noMoreLogs'))
                    return;
                this.set('fetchingHistory', true);
                this._processFilterString();
                Mist.logs.emit('get_logs',  this._generatePayload());
            },

            handleResponse: function (logs) {
                if (logs.length)
                    this.set('lastLogTimestamp', logs[logs.length - 1].time);
                else
                    this.set('noMoreLogs', true);
                this.set('fetchingHistory', false);
                Ember.run(this, function () {
                    Mist.logsController._appendContent(
                        this.filter(logs)
                    );
                });
                if (logs.length && Mist.logsController.content.length < MIN_LOGS_DISPLAYED) {
                    this.set('disableScrollFetch', true);
                    Ember.run.later(this, function () {
                        this.search();
                    }, LOGS_REQUEST_INTERVAL);
                } else {
                    this.set('disableScrollFetch', false);
                }
            },

            handleStream: function (log) {
                Ember.run(this, function () {
                    Mist.logsController._prependContent(
                        this.filter([log])
                    )
                });
            },

            filter: function (logs) {

                logs = slice(logs);

                if (this.get('showErrors') != null)
                    this._filterErrors(logs, this.get('showErrors'));

                if (this.get('includeTypes').length)
                    this._filterInTypes(logs, this.get('includeTypes'));

                if (this.get('excludeTypes').length)
                    this._filterOutTypes(logs, this.get('excludeTypes'));

                if (this.get('includeEmails').length)
                    this._filterInEmails(logs, this.get('includeEmails'));

                if (this.get('excludeEmails').length)
                    this._filterOutEmails(logs, this.get('excludeEmails'));

                if (this.get('includeTerms').length)
                    this._filterInTerms(logs, this.get('includeTerms'));

                if (this.get('excludeTerms').length)
                    this._filterOutTerms(logs, this.get('excludeTerms'));

                var forceFlag = this.get('forceFlag');
                if (forceFlag != 'all') {
                    if (forceFlag == 'error')
                        this._filterErrors(logs, true);
                    else
                        this._filterInTypes(logs, forceFlag);
                }

                return logs;
            },

            //
            //
            //  Pseudo-Private Methods
            //
            //

            _initializeSocket: function () {
                Mist.get('logs').on('logs', this, this.handleResponse);
                Mist.get('logs').on('event', this, this.handleStream);
            },

            _initializeController: function () {
                Mist.logsController.clear();
            },

            _initializeScrolling: function () {
                var that = this;
                Ember.run.later(function () {
                    $(window).on('scroll', function (e) {
                        Ember.run.once(function () {
                            if (Mist.isScrolledToBottom() &&
                                !that.disableScrollFetch &&
                                !that.fetchingHistory) {
                                    that.search();
                            }
                        });
                    });
               }, 1000);
            },

            _processFilterString: function () {

                // Prepare filter
                var filter = this.get('filterString').trim().toLowerCase().split(' ').map(function (term) {
                    return term.trim();
                }).unique().removeObject("");

                // Extract include terms
                var includeTerms = filter.filter(function (word) {
                    return word.charAt(0) !== '!';
                });
                filter = filter.removeObjects(includeTerms);

                // Extract exclude terms
                var excludeTerms = filter.map(function (word) {
                    return word.slice(1); // remove "!" char
                });

                // Extract include types
                var includeTypes = includeTerms.filter(function (term) {
                    return EVENT_TYPES.indexOf(term) > -1;
                }, this);
                includeTerms.removeObjects(includeTypes);

                // Extract exclude types
                var excludeTypes = excludeTerms.filter(function (term) {
                    return EVENT_TYPES.indexOf(term) > -1;
                }, this);
                excludeTerms.removeObjects(excludeTypes);

                // Extract include emails
                var includeEmails = includeTerms.filter(function (term) {
                    var result = term.match(EMAIL_REGEX);
                    return result ? result[0] : false;
                });
                includeTerms.removeObjects(includeEmails);

                // Extract exclude emails
                var excludeEmails = excludeTerms.filter(function (term) {
                    var result = term.match(EMAIL_REGEX);
                    return result ? result[0] : false;
                });
                excludeTerms.removeObjects(excludeEmails);

                // Show Errors
                var showErrors = null;
                if (includeTerms.indexOf('error') > -1) {
                    showErrors = true;
                    includeTerms.removeObject('error');
                }
                if (excludeTerms.indexOf('error') > -1) {
                    showErrors =  false;
                    excludeTerms.removeObject('error');
                }

                this.setProperties({
                    showErrors: showErrors,
                    includeTerms: includeTerms,
                    excludeTerms: excludeTerms,
                    includeTypes: includeTypes,
                    excludeTypes: excludeTypes,
                    includeEmails: includeEmails,
                    excludeEmails: excludeEmails,
                });
            },

            _updateLogTime: function () {
                if (this.$()) {
                    Ember.run(this, function () {
                        Mist.logsController.content.forEach(function (log) {
                            log.propertyWillChange('time');
                            log.propertyDidChange('time');
                        });
                    });
                    Ember.run.later(this, this._updateLogTime, 10 * TIME_MAP.SECOND);
                }
            },

            _generatePayload: function () {

                var payload = {limit: MAX_LOGS_REQUESTED};

                if (this.get('showErrors') != null)
                    payload.error = this.get('showErrors');

                if (this.get('includeTypes').length == 1 &&
                    !this.get('excludeTypes').length)
                        payload.event_type = this.get('includeTypes')[0];

                if (this.get('includeEmails').length == 1 &&
                    !this.get('excludeEmails').length)
                        payload.email = this.get('includeEmails')[0];

                if (this.get('lastLogTimestamp'))
                    payload.stop = this.get('lastLogTimestamp');

                var forceFlag = this.get('forceFlag');
                if (forceFlag != 'all') {
                    if (forceFlag == 'error')
                        payload.error = true;
                    else
                        payload.event_type = forceFlag;
                }

                return payload;
            },

            _filterErrors: function (logs, showErrors) {
                logs.removeObjects(
                    logs.rejectBy('error', showErrors)
                );
            },

            _filterInTypes: function (logs, types) {
                logs.removeObjects(
                    logs.filter(function (log) {
                        return types.indexOf(log.type) == -1;
                    })
                );
            },

            _filterOutTypes: function (logs, types) {
                types.forEach(function (type) {
                    logs.removeObjects(
                        logs.filterBy('type', type)
                    );
                });
            },

            _filterInEmails: function (logs, emails) {
                logs.removeObjects(
                    logs.filter(function (log) {
                        return emails.indexOf(log.email) == -1;
                    })
                );
            },

            _filterOutEmails: function (logs, emails) {
                emails.forEach(function (email) {
                    logs.removeObjects(
                        logs.filterBy('email', email)
                    );
                });
            },

            _filterInTerms: function (logs, terms) {
                logs.removeObjects(
                    logs.filter(function (log) {
                        return terms.some(function (term) {
                            return !forIn(log, function (value) {
                                return textInString(term, value);
                            })
                        })
                    })
                );
            },

            _filterOutTerms: function (logs, terms) {
                logs.removeObjects(
                    logs.filter(function (log) {
                        return terms.some(function (term) {
                            return forIn(log, function (value) {
                                return textInString(term, value);
                            });
                        })
                    })
                );
            },

            actions: {

                updateFilterFlags: function (flag) {
                    var newFilterString = this.get('filterString');
                    var flags = slice(EVENT_TYPES);
                    flags.push('error');
                    flags.forEach(function (f) {
                        newFilterString = newFilterString.replace('!'+f, '').replace(f, '');
                    });
                    this.set('filterString', newFilterString.trim().replace(/\s\s/g, ' '));
                    this.set('forceFlag', flag);
                    this.newSearch(1);
                }
            },

            newSearch: function (interval) {
               var that = this;
               clearTimeout(this.searchLock);
               this.set('searchLock', setTimeout(function () {
                   Mist.logsController.clear();
                   that.set('noMoreLogs', false);
                   that.set('lastLogTimestamp', null);
                   that.search();
               }, interval || 700))
           },

            //
            //
            //  Observers
            //
            //

            filterStringObserver: function () {
                Ember.run.once(this, 'newSearch');
            }.observes('filterString')
        });

        function textInString (text, str) {
            if (typeof str != 'string')
                return false;
            return str.toLowerCase().indexOf(text) > -1;
        }
    }
);
<|endoftext|>


<commit_before>'use strict';

describe('PIXI.Container', function ()
{
    describe('parent', function ()
    {
        it('should be present when adding children to Container', function ()
        {
            var container = new PIXI.Container();
            var child = new PIXI.DisplayObject();

            expect(container.children.length).to.be.equals(0);
            container.addChild(child);
            expect(container.children.length).to.be.equals(1);
            expect(child.parent).to.be.equals(container);
        });
    });

    describe('events', function ()
    {
        it('should trigger "added" and "removed" events on it\'s children', function ()
        {
            var container = new PIXI.Container();
            var child = new PIXI.DisplayObject();
            var triggeredAdded = false;
            var triggeredRemoved = false;

            child.on('added', function (to)
            {
                triggeredAdded = true;
                expect(container.children.length).to.be.equals(1);
                expect(child.parent).to.be.equals(to);
            });
            child.on('removed', function (from)
            {
                triggeredRemoved = true;
                expect(container.children.length).to.be.equals(0);
                expect(child.parent).to.be.null;
                expect(container).to.be.equals(from);
            });

            container.addChild(child);
            expect(triggeredAdded).to.be.true;
            expect(triggeredRemoved).to.be.false;

            container.removeChild(child);
            expect(triggeredRemoved).to.be.true;
        });
    });
});
<commit_msg>grammar<commit_after>'use strict';

describe('PIXI.Container', function ()
{
    describe('parent', function ()
    {
        it('should be present when adding children to Container', function ()
        {
            var container = new PIXI.Container();
            var child = new PIXI.DisplayObject();

            expect(container.children.length).to.be.equals(0);
            container.addChild(child);
            expect(container.children.length).to.be.equals(1);
            expect(child.parent).to.be.equals(container);
        });
    });

    describe('events', function ()
    {
        it('should trigger "added" and "removed" events on its children', function ()
        {
            var container = new PIXI.Container();
            var child = new PIXI.DisplayObject();
            var triggeredAdded = false;
            var triggeredRemoved = false;

            child.on('added', function (to)
            {
                triggeredAdded = true;
                expect(container.children.length).to.be.equals(1);
                expect(child.parent).to.be.equals(to);
            });
            child.on('removed', function (from)
            {
                triggeredRemoved = true;
                expect(container.children.length).to.be.equals(0);
                expect(child.parent).to.be.null;
                expect(container).to.be.equals(from);
            });

            container.addChild(child);
            expect(triggeredAdded).to.be.true;
            expect(triggeredRemoved).to.be.false;

            container.removeChild(child);
            expect(triggeredRemoved).to.be.true;
        });
    });
});
<|endoftext|>


<commit_before>enyo.kind({
	name: "App",
	classes: "onyx",
	components: [
		{kind: "onyx.Toolbar", content: "Onyx Widget Sampler"},
		{style: "padding: 10px;", components: [
			{classes: "divider", content: "Header"},
			{kind: "onyx.Toolbar", components: [
				{kind: "onyx.Grabber"},
				{content: "Header"},
				{kind: "onyx.Button", content: "Button"},
				{kind: "onyx.Button", content: "Down", classes: "active"},
				{kind: "onyx.Button", content: "Button"},
				{kind: "onyx.InputDecorator", components: [
					{kind: "onyx.Input", placeholder: "Input"}
				]},
				{kind: "onyx.Button", content: "Right"},
				{kind: "onyx.InputDecorator", components: [
					{kind: "onyx.Input", placeholder: "Right Input"}
				]},
				{kind: "onyx.Button", content: "More Right"}
			]},
			{tag: "br"},
			{classes: "divider", content: "Popups"},
			{classes: "tools", defaultKind: "onyx.Button", components: [
				{kind: "onyx.Button", content: "Popup...", ontap: "showPopup", popup: "popup"},
				{kind: "onyx.Button", content: "Modal Popup...", ontap: "showPopup", popup: "modalPopup"}
			]},
			{name: "popup", kind: "onyx.Popup", centered: true, floating: true, style: "padding: 10px; font-size: 30px;", content: "Popup..."},
			{name: "modalPopup", kind: "onyx.Popup", centered: true, modal: true, floating: true, style: "padding: 10px; font-size: 30px;", content: "Modal Popup..."},
			{tag: "br"},
			{classes: "divider", content: "RadioGroup"},
			{kind: "onyx.RadioGroup", components: [
				{content: "Alpha", active: true},
				{content: "Beta"},
				{content: "Gamma"}
			]},
			{tag: "br"},
			{classes: "divider", content: "TabGroup"},
			{kind: "onyx.RadioGroup", controlClasses: "onyx-tabbutton", components: [
				{content: "Alpha", active: true},
				{content: "Beta"},
				{content: "Gamma"}
			]},
			{tag: "br"},
			{classes: "divider", content: "Buttons"},
			{classes: "tools", defaultKind: "onyx.Button", components: [
				{content: "Button"}
			]},
			{classes: "tools", defaultKind: "onyx.Button", components: [
				{content: "Affirmative", classes: "onyx-affirmative"},
				{content: "Negative", classes: "onyx-negative"},
				{content: "Blue", classes: "onyx-blue"},
				{content: "Custom", style: "background-color: purple; color: #F1F1F1;"}
			]},
			{classes: "tools", defaultKind: "onyx.Button", components: [
				{content: "Active", classes: "active"},
				{content: "Disabled", disabled: true},
				{content: "Active Disabled", classes: "active", disabled: true}
			]},
			{classes: "tools", defaultKind: "onyx.Button", components: [
				{content: "Tall Button", style: "height: 70px;"}
			]},
			{tag: "br"},
			{classes: "divider", content: "Button Group"},
			{kind: "Group", classes: "tools group", defaultKind: "onyx.Button", highlander: true, components: [
				{content: "Button A", active: true, classes: "onyx-affirmative"},
				{content: "Button B", classes: "onyx-negative"},
				{content: "Button C", classes: "onyx-blue"}
			]},
			{tag: "br"},
			{classes: "divider", content: "Icon Button"},
			{kind: "onyx.IconButton", src: "images/menu-icon-bookmark.png"},
			{tag: "br"},
			{tag: "br"},
			{classes: "divider", content: "Grouped Icon Buttons"},
			{kind: "Group", components: [
				{kind: "onyx.IconButton", active: true, src: "images/menu-icon-bookmark.png"},
				{kind: "onyx.IconButton", src: "images/menu-icon-bookmark.png"},
				{kind: "onyx.IconButton", src: "images/menu-icon-bookmark.png"}
			]},
			{tag: "br"},
			{classes: "divider", content: "Icon Buttons in Toolbar"},
			{kind: "onyx.Toolbar", defaultKind: "onyx.IconButton", components: [
				{src: "images/menu-icon-bookmark.png"},
				{src: "images/menu-icon-bookmark.png"},
				{src: "images/menu-icon-bookmark.png"},
				{kind: "Control"},
				{kind: "Group", tag: null, defaultKind: "onyx.IconButton", components: [
					{active: true, src: "images/menu-icon-bookmark.png"},
					{src: "images/menu-icon-bookmark.png"},
					{src: "images/menu-icon-bookmark.png"}
				]}
			]},
			{tag: "br"},
			{classes: "divider", content: "Toggle Buttons"},
			{classes: "tools", defaultKind: "onyx.ToggleButton", components: [
				{value: true},
				{},
				{}
			]},
			{tag: "br"},
			{classes: "divider", content: "Toggle Buttons Group"},
			{kind: "Group", classes: "tools group", defaultKind: "onyx.ToggleButton", highlander: true, components: [
				{},
				{value: true},
				{}
			]},
			{tag: "br"},
			{classes: "divider", content: "Checkboxes"},
			{classes: "tools", defaultKind: "onyx.Checkbox", components: [
				{},
				{},
				{value: true}
			]},
			{tag: "br"},
			{classes: "divider", content: "Checkboxes Group"},
			{kind: "Group", classes: "tools group", defaultKind: "onyx.Checkbox", highlander: true, components: [
				{value: true},
				{},
				{}
			]},
			{tag: "br"},
			{classes: "divider", content: "Inputs"},
			{classes: "onyx-toolbar-inline", components: [
				{kind: "onyx.InputDecorator", components: [
					{kind: "onyx.Input", defaultFocus: false, placeholder: "Enter text here"}
				]},
				{kind: "onyx.InputDecorator", components: [
					{kind: "onyx.Input", placeholder: "Search term"},
					{kind: "Image", src: "images/search-input-search.png"}
				]}
			]},
			{classes: "divider", content: "RichTexts"},
			{classes: "onyx-toolbar-inline", components: [
				{kind: "onyx.InputDecorator", components: [
					{kind: "onyx.RichText", style: "width: 200px;", defaultFocus: false, placeholder: "Enter text here"}
				]},
				{kind: "onyx.InputDecorator", components: [
					{kind: "onyx.RichText", style: "width: 200px;", placeholder: "Search term"},
					{kind: "Image", src: "images/search-input-search.png"}
				]}
			]},
			{classes: "divider", content: "TextAreas"},
			{classes: "onyx-toolbar-inline", components: [
				{kind: "onyx.InputDecorator", components: [
					{kind: "onyx.TextArea", defaultFocus: false, placeholder: "Enter text here"}
				]},
				{kind: "onyx.InputDecorator", components: [
					{kind: "onyx.TextArea", placeholder: "Search term"},
					{kind: "Image", src: "images/search-input-search.png"}
				]}
			]},
			{tag: "br"},
			{classes: "divider", content: "Groupboxes"},
			{kind: "onyx.Groupbox", components: [
				{kind: "onyx.GroupboxHeader", content: "Header"},
				{content: "I'm a group item!", style: "padding: 8px;"},
				{content: "I'm a group item!", style: "padding: 8px;"}
			]},
			{tag: "br"},
			{kind: "onyx.Groupbox", components: [
				{content: "I'm a group item!", style: "padding: 8px;"}
			]},
			{tag: "br"},
			{kind: "onyx.Groupbox", components: [
				{kind: "onyx.GroupboxHeader", content: "Header"},
				{kind: "onyx.InputDecorator", components: [
					{kind: "onyx.Input", style: "width: 100%", placeholder: "Enter text here"}
				]},
				{kind: "onyx.InputDecorator", components: [
					{kind: "onyx.Input", style: "width: 100%", value: "Middle"}
				]},
				{kind: "onyx.InputDecorator", components: [
					{kind: "onyx.Input", style: "width: 100%", value: "Last"}
				]}
			]},
			{tag: "br"},
			{kind: "onyx.Groupbox", components: [
				{kind: "onyx.InputDecorator", components: [
					{kind: "onyx.Input", style: "width: 100%", placeholder: "Enter text here"}
				]}
			]},
			{kind: "onyx.Groupbox", components: [
				{kind: "onyx.InputDecorator", components: [
					{kind: "onyx.Input", attributes: { type: "password" }, style: "width: 100%", placeholder: "Enter Password"}
				]}
			]},
			{tag: "br"},
			{classes: "divider", content: "Progress Bars"},
			{kind: "onyx.ProgressBar", progress: 25},
			{kind: "onyx.ProgressBar", animateStripes: false, barClasses: "onyx-light", progress: 50},
			{kind: "onyx.ProgressBar", showStripes: false, progress: 75},
			{tag: "br"},
			{classes: "divider", content: "Progress Buttons"},
			{kind: "onyx.ProgressButton", progress: 25, components: [
				{content: "0"},
				{content: "100", style: "float: right;"}
			]},
			{kind: "onyx.ProgressButton", animateStripes: false, barClasses: "onyx-dark", progress: 50},
			{kind: "onyx.ProgressButton", showStripes: false, progress: 75},
			{tag: "br"},
			{classes: "divider", content: "Sliders"},
			{kind: "onyx.Slider", value: 50},
			{tag: "br"},
			{kind: "onyx.Slider", lockBar: false, value: 50, style: "width: 200px;"},
			{tag: "br"},
			{classes: "divider", content: "Slideable"},
			{style: "border: 1px solid silver; height: 200px; position: relative; overflow: hidden; margin: 10px;", components: [
				{kind: "onyx.Slideable", value: -60, min: -60, unit: "%", classes: "enyo-fit", style: "width: 200px; background: #404040;", components: [
					{kind: "onyx.Grabber", style: "position: absolute; bottom: 14px; right: 14px;"}
				]},
				{kind: "onyx.Slideable", value: 60, max: 60, unit: "%", classes: "enyo-fit", style: "left: auto; width: 200px; background: #1E5D89;", components: [
					{kind: "onyx.Grabber", style: "position: absolute; bottom: 14px; left: 14px;"}
				]}
			]}
		]}
	],
	showPopup: function(inSender) {
		var p = this.$[inSender.popup];
		if (p) {
			p.show();
		}
	}
});
<commit_msg>Fix OnyxSampler/App.js use of password<commit_after>enyo.kind({
	name: "App",
	classes: "onyx",
	components: [
		{kind: "onyx.Toolbar", content: "Onyx Widget Sampler"},
		{style: "padding: 10px;", components: [
			{classes: "divider", content: "Header"},
			{kind: "onyx.Toolbar", components: [
				{kind: "onyx.Grabber"},
				{content: "Header"},
				{kind: "onyx.Button", content: "Button"},
				{kind: "onyx.Button", content: "Down", classes: "active"},
				{kind: "onyx.Button", content: "Button"},
				{kind: "onyx.InputDecorator", components: [
					{kind: "onyx.Input", placeholder: "Input"}
				]},
				{kind: "onyx.Button", content: "Right"},
				{kind: "onyx.InputDecorator", components: [
					{kind: "onyx.Input", placeholder: "Right Input"}
				]},
				{kind: "onyx.Button", content: "More Right"}
			]},
			{tag: "br"},
			{classes: "divider", content: "Popups"},
			{classes: "tools", defaultKind: "onyx.Button", components: [
				{kind: "onyx.Button", content: "Popup...", ontap: "showPopup", popup: "popup"},
				{kind: "onyx.Button", content: "Modal Popup...", ontap: "showPopup", popup: "modalPopup"}
			]},
			{name: "popup", kind: "onyx.Popup", centered: true, floating: true, style: "padding: 10px; font-size: 30px;", content: "Popup..."},
			{name: "modalPopup", kind: "onyx.Popup", centered: true, modal: true, floating: true, style: "padding: 10px; font-size: 30px;", content: "Modal Popup..."},
			{tag: "br"},
			{classes: "divider", content: "RadioGroup"},
			{kind: "onyx.RadioGroup", components: [
				{content: "Alpha", active: true},
				{content: "Beta"},
				{content: "Gamma"}
			]},
			{tag: "br"},
			{classes: "divider", content: "TabGroup"},
			{kind: "onyx.RadioGroup", controlClasses: "onyx-tabbutton", components: [
				{content: "Alpha", active: true},
				{content: "Beta"},
				{content: "Gamma"}
			]},
			{tag: "br"},
			{classes: "divider", content: "Buttons"},
			{classes: "tools", defaultKind: "onyx.Button", components: [
				{content: "Button"}
			]},
			{classes: "tools", defaultKind: "onyx.Button", components: [
				{content: "Affirmative", classes: "onyx-affirmative"},
				{content: "Negative", classes: "onyx-negative"},
				{content: "Blue", classes: "onyx-blue"},
				{content: "Custom", style: "background-color: purple; color: #F1F1F1;"}
			]},
			{classes: "tools", defaultKind: "onyx.Button", components: [
				{content: "Active", classes: "active"},
				{content: "Disabled", disabled: true},
				{content: "Active Disabled", classes: "active", disabled: true}
			]},
			{classes: "tools", defaultKind: "onyx.Button", components: [
				{content: "Tall Button", style: "height: 70px;"}
			]},
			{tag: "br"},
			{classes: "divider", content: "Button Group"},
			{kind: "Group", classes: "tools group", defaultKind: "onyx.Button", highlander: true, components: [
				{content: "Button A", active: true, classes: "onyx-affirmative"},
				{content: "Button B", classes: "onyx-negative"},
				{content: "Button C", classes: "onyx-blue"}
			]},
			{tag: "br"},
			{classes: "divider", content: "Icon Button"},
			{kind: "onyx.IconButton", src: "images/menu-icon-bookmark.png"},
			{tag: "br"},
			{tag: "br"},
			{classes: "divider", content: "Grouped Icon Buttons"},
			{kind: "Group", components: [
				{kind: "onyx.IconButton", active: true, src: "images/menu-icon-bookmark.png"},
				{kind: "onyx.IconButton", src: "images/menu-icon-bookmark.png"},
				{kind: "onyx.IconButton", src: "images/menu-icon-bookmark.png"}
			]},
			{tag: "br"},
			{classes: "divider", content: "Icon Buttons in Toolbar"},
			{kind: "onyx.Toolbar", defaultKind: "onyx.IconButton", components: [
				{src: "images/menu-icon-bookmark.png"},
				{src: "images/menu-icon-bookmark.png"},
				{src: "images/menu-icon-bookmark.png"},
				{kind: "Control"},
				{kind: "Group", tag: null, defaultKind: "onyx.IconButton", components: [
					{active: true, src: "images/menu-icon-bookmark.png"},
					{src: "images/menu-icon-bookmark.png"},
					{src: "images/menu-icon-bookmark.png"}
				]}
			]},
			{tag: "br"},
			{classes: "divider", content: "Toggle Buttons"},
			{classes: "tools", defaultKind: "onyx.ToggleButton", components: [
				{value: true},
				{},
				{}
			]},
			{tag: "br"},
			{classes: "divider", content: "Toggle Buttons Group"},
			{kind: "Group", classes: "tools group", defaultKind: "onyx.ToggleButton", highlander: true, components: [
				{},
				{value: true},
				{}
			]},
			{tag: "br"},
			{classes: "divider", content: "Checkboxes"},
			{classes: "tools", defaultKind: "onyx.Checkbox", components: [
				{},
				{},
				{value: true}
			]},
			{tag: "br"},
			{classes: "divider", content: "Checkboxes Group"},
			{kind: "Group", classes: "tools group", defaultKind: "onyx.Checkbox", highlander: true, components: [
				{value: true},
				{},
				{}
			]},
			{tag: "br"},
			{classes: "divider", content: "Inputs"},
			{classes: "onyx-toolbar-inline", components: [
				{kind: "onyx.InputDecorator", components: [
					{kind: "onyx.Input", defaultFocus: false, placeholder: "Enter text here"}
				]},
				{kind: "onyx.InputDecorator", components: [
					{kind: "onyx.Input", placeholder: "Search term"},
					{kind: "Image", src: "images/search-input-search.png"}
				]}
			]},
			{classes: "divider", content: "RichTexts"},
			{classes: "onyx-toolbar-inline", components: [
				{kind: "onyx.InputDecorator", components: [
					{kind: "onyx.RichText", style: "width: 200px;", defaultFocus: false, placeholder: "Enter text here"}
				]},
				{kind: "onyx.InputDecorator", components: [
					{kind: "onyx.RichText", style: "width: 200px;", placeholder: "Search term"},
					{kind: "Image", src: "images/search-input-search.png"}
				]}
			]},
			{classes: "divider", content: "TextAreas"},
			{classes: "onyx-toolbar-inline", components: [
				{kind: "onyx.InputDecorator", components: [
					{kind: "onyx.TextArea", defaultFocus: false, placeholder: "Enter text here"}
				]},
				{kind: "onyx.InputDecorator", components: [
					{kind: "onyx.TextArea", placeholder: "Search term"},
					{kind: "Image", src: "images/search-input-search.png"}
				]}
			]},
			{tag: "br"},
			{classes: "divider", content: "Groupboxes"},
			{kind: "onyx.Groupbox", components: [
				{kind: "onyx.GroupboxHeader", content: "Header"},
				{content: "I'm a group item!", style: "padding: 8px;"},
				{content: "I'm a group item!", style: "padding: 8px;"}
			]},
			{tag: "br"},
			{kind: "onyx.Groupbox", components: [
				{content: "I'm a group item!", style: "padding: 8px;"}
			]},
			{tag: "br"},
			{kind: "onyx.Groupbox", components: [
				{kind: "onyx.GroupboxHeader", content: "Header"},
				{kind: "onyx.InputDecorator", components: [
					{kind: "onyx.Input", style: "width: 100%", placeholder: "Enter text here"}
				]},
				{kind: "onyx.InputDecorator", components: [
					{kind: "onyx.Input", style: "width: 100%", value: "Middle"}
				]},
				{kind: "onyx.InputDecorator", components: [
					{kind: "onyx.Input", style: "width: 100%", value: "Last"}
				]}
			]},
			{tag: "br"},
			{kind: "onyx.Groupbox", components: [
				{kind: "onyx.InputDecorator", components: [
					{kind: "onyx.Input", style: "width: 100%", placeholder: "Enter text here"}
				]}
			]},
			{kind: "onyx.Groupbox", components: [
				{kind: "onyx.InputDecorator", components: [
					{kind: "onyx.Input", type: "password", style: "width: 100%", placeholder: "Enter Password"}
				]}
			]},
			{tag: "br"},
			{classes: "divider", content: "Progress Bars"},
			{kind: "onyx.ProgressBar", progress: 25},
			{kind: "onyx.ProgressBar", animateStripes: false, barClasses: "onyx-light", progress: 50},
			{kind: "onyx.ProgressBar", showStripes: false, progress: 75},
			{tag: "br"},
			{classes: "divider", content: "Progress Buttons"},
			{kind: "onyx.ProgressButton", progress: 25, components: [
				{content: "0"},
				{content: "100", style: "float: right;"}
			]},
			{kind: "onyx.ProgressButton", animateStripes: false, barClasses: "onyx-dark", progress: 50},
			{kind: "onyx.ProgressButton", showStripes: false, progress: 75},
			{tag: "br"},
			{classes: "divider", content: "Sliders"},
			{kind: "onyx.Slider", value: 50},
			{tag: "br"},
			{kind: "onyx.Slider", lockBar: false, value: 50, style: "width: 200px;"},
			{tag: "br"},
			{classes: "divider", content: "Slideable"},
			{style: "border: 1px solid silver; height: 200px; position: relative; overflow: hidden; margin: 10px;", components: [
				{kind: "onyx.Slideable", value: -60, min: -60, unit: "%", classes: "enyo-fit", style: "width: 200px; background: #404040;", components: [
					{kind: "onyx.Grabber", style: "position: absolute; bottom: 14px; right: 14px;"}
				]},
				{kind: "onyx.Slideable", value: 60, max: 60, unit: "%", classes: "enyo-fit", style: "left: auto; width: 200px; background: #1E5D89;", components: [
					{kind: "onyx.Grabber", style: "position: absolute; bottom: 14px; left: 14px;"}
				]}
			]}
		]}
	],
	showPopup: function(inSender) {
		var p = this.$[inSender.popup];
		if (p) {
			p.show();
		}
	}
});
<|endoftext|>


<commit_before>(function (arguman) {

    arguman.utils = {
        adder: function (a, b) {
            return a + b
        }
    };

    arguman.KeyboardManager = Class.extend({
        currentElement: null,
        init: function (options) {
            $.extend(this, options);
            this.$el = $(this.el);
            this.bindEvents();
            this.setInitial();
        },
        up: function () {
            this.select(
                this.currentElement.parent().parent(),
                true
            )
        },
        down: function () {
            this.select(
                this.currentElement.find("ul").find(".child-premise").first(),
                true
            )
        },
        left: function () {
            this.select(
                this.currentElement.prev(),
                true
            );
        },
        right: function () {
            this.select(
                this.currentElement.next(),
                true
            );
        },
        select: function (leaf, scroll) {
            if (leaf.is(".child-premise")) {
                this.$el.find(".premise").removeClass("focused");
                this.currentElement = leaf;
                leaf.find(".premise").first().addClass("focused");
                if (scroll) {
                    this.scrollTo(leaf);
                }
            }
        },
        needsScroll: function () {
            var maxHeight = Math.max.apply(this,
                this.$el.find(".premise")
                    .toArray()
                    .map(function (el) {
                    return $(el).offset().top + $(el).height();
            }));

            return (this.$el.width() > window.innerWidth ||
                    maxHeight > window.innerHeight)
        },
        scrollTo: function (el) {
           if (this.needsScroll()) {
               var center = el.offset().left +  (el.width()/2);
               $('html, body').animate({
                   scrollTop: el.offset().top - 200,
                   scrollLeft: center - (window.innerWidth / 2)
               }, 150);
           }
        },
        setInitial: function () {
            if (this.needsScroll()) {
                this.select(this.$el.find(".child-premise").first(), false);
            }
        },
        bindEvents: function () {
            $(document).keydown(function(e) {
                switch(e.which) {
                    case 37:
                    this.left();
                    break;

                    case 38:
                    this.up();
                    break;

                    case 39:
                    this.right();
                    break;

                    case 40:
                    this.down();
                    break;

                    default: return; // exit this handler for other keys
                }
                e.preventDefault(); // prevent the default action (scroll / move caret)
            }.bind(this));

            if (this.needsScroll()) {
                this.$el.find(".premise-content").on('click', function (event) {
                    this.select($(event.target).parents(".child-premise").eq(0))
                }.bind(this));
                $(this.info).show();
                $(window).on("scroll", function () {
                    $(this.info).fadeOut(100);
                }.bind(this));
            } else {
                $(this.info).hide();
            }

        }
    });

    arguman.CollapsibleTree = Class.extend({

        premiseWidth: 260,

        init: function (options) {
            $.extend(this, options);
            this.$el = $(this.el);
        },

        setTreeWidth: function () {
            /*
             * Set full width to container, and reduce the width with
             * positions of last premise.
             * */

            if (this.$el.hasClass("empty")) {
                return;
            }

            var root = this.$el.find(".root"),
                mainContention = $(this.mainContention);
            var treeWidth = parseInt(this.$el.data("width")) * (this.premiseWidth * 2);
            this.width = treeWidth;
            this.$el.width(treeWidth);

            var mainPremises = root.next().children();

            if (mainPremises.length) {
                var premises = root.parent().find("li");

                var maxPosition = Math.max.apply(this,
                    premises.toArray().map(function (premise) {
                        return $(premise).offset().left
                    }));

                this.width = (maxPosition + this.premiseWidth + 50);
                this.$el.width(this.width);
                mainContention.css({
                    "margin-left": (root.position().left) - (mainContention.width() / 2)
                });
            }

            if (this.width < window.innerWidth) {
                this.$el.css({
                    "margin-left": (window.innerWidth / 2) - (this.width / 2)
                });
                mainContention.css({
                    "margin-left": (window.innerWidth / 2) - (mainContention.width() / 2)
                });
            }

        },

        render: function () {
            this.setTreeWidth();
            this.$el.css("visibility", "visible");
        }
    });

    arguman.Zoom = Class.extend({
        canvas: '#app',
        currentSize: function () {
            return parseFloat($(this.canvas).css('zoom')) || 1
        },
        zoomOut: function () {
            var current = this.currentSize();
            $(this.canvas).css('zoom', current - 0.1);
            $('#zoomIn').show();
            $(this.canvas).css('padding-top', function (index, curValue) {
                return parseInt(curValue, 10) + 40 + 'px';
            });
        },
        zoomIn: function () {
            var current = this.currentSize();
            $('#app').css('zoom', current + 0.1);
            if (parseFloat($(this.canvas).css('zoom')) >= 1) {
                $('#zoomIn').hide();
            }
            $(this.canvas).css('padding-top', function (index, curValue) {
                return parseInt(curValue, 10) - 40 + 'px';
            });
        },
        init: function () {
            $('#zoomIn').on('click', $.proxy(this, 'zoomIn'));
            $('#zoomOut').on('click', $.proxy(this, 'zoomOut'));
        }
    });

})(window.arguman || (window.arguman = {}));<commit_msg>Don't scroll for main premises for keyboard navigation<commit_after>(function (arguman) {

    arguman.utils = {
        adder: function (a, b) {
            return a + b
        }
    };

    arguman.KeyboardManager = Class.extend({
        currentElement: null,
        init: function (options) {
            $.extend(this, options);
            this.$el = $(this.el);
            this.bindEvents();
            this.setInitial();
        },
        up: function () {
            this.select(
                this.currentElement.parent().parent(),
                true
            )
        },
        down: function () {
            this.select(
                this.currentElement.find("ul").find(".child-premise").first(),
                true
            )
        },
        left: function () {
            this.select(
                this.currentElement.prev(),
                true
            );
        },
        right: function () {
            this.select(
                this.currentElement.next(),
                true
            );
        },
        select: function (leaf, scroll) {
            if (leaf.is(".child-premise")) {
                this.$el.find(".premise").removeClass("focused");
                this.currentElement = leaf;
                leaf.find(".premise").first().addClass("focused");
                if (scroll) {
                    this.scrollTo(leaf);
                }
            }
        },
        needsScroll: function () {
            var maxHeight = Math.max.apply(this,
                this.$el.find(".premise")
                    .toArray()
                    .map(function (el) {
                    return $(el).offset().top + $(el).height();
            }));

            return (this.$el.width() > window.innerWidth ||
                    maxHeight > window.innerHeight)
        },
        scrollTo: function (el) {
           if (this.needsScroll()) {
               var center = el.offset().left +  (el.width()/2);
               $('html, body').animate({
                   scrollTop: el.is('.main-premise') ? 0 : el.offset().top - 200,
                   scrollLeft: center - (window.innerWidth / 2)
               }, 150);
           }
        },
        setInitial: function () {
            if (this.needsScroll()) {
                this.select(this.$el.find(".child-premise").first(), false);
            }
        },
        bindEvents: function () {
            $(document).keydown(function(e) {
                switch(e.which) {
                    case 37:
                    this.left();
                    break;

                    case 38:
                    this.up();
                    break;

                    case 39:
                    this.right();
                    break;

                    case 40:
                    this.down();
                    break;

                    default: return; // exit this handler for other keys
                }
                e.preventDefault(); // prevent the default action (scroll / move caret)
            }.bind(this));

            if (this.needsScroll()) {
                this.$el.find(".premise-content").on('click', function (event) {
                    this.select($(event.target).parents(".child-premise").eq(0))
                }.bind(this));
                $(this.info).show();
                $(window).on("scroll", function () {
                    $(this.info).fadeOut(100);
                }.bind(this));
            } else {
                $(this.info).hide();
            }

        }
    });

    arguman.CollapsibleTree = Class.extend({

        premiseWidth: 260,

        init: function (options) {
            $.extend(this, options);
            this.$el = $(this.el);
        },

        setTreeWidth: function () {
            /*
             * Set full width to container, and reduce the width with
             * positions of last premise.
             * */

            if (this.$el.hasClass("empty")) {
                return;
            }

            var root = this.$el.find(".root"),
                mainContention = $(this.mainContention);
            var treeWidth = parseInt(this.$el.data("width")) * (this.premiseWidth * 2);
            this.width = treeWidth;
            this.$el.width(treeWidth);

            var mainPremises = root.next().children();

            if (mainPremises.length) {
                var premises = root.parent().find("li");

                var maxPosition = Math.max.apply(this,
                    premises.toArray().map(function (premise) {
                        return $(premise).offset().left
                    }));

                this.width = (maxPosition + this.premiseWidth + 50);
                this.$el.width(this.width);
                mainContention.css({
                    "margin-left": (root.position().left) - (mainContention.width() / 2)
                });
            }

            if (this.width < window.innerWidth) {
                this.$el.css({
                    "margin-left": (window.innerWidth / 2) - (this.width / 2)
                });
                mainContention.css({
                    "margin-left": (window.innerWidth / 2) - (mainContention.width() / 2)
                });
            }

        },

        render: function () {
            this.setTreeWidth();
            this.$el.css("visibility", "visible");
        }
    });

    arguman.Zoom = Class.extend({
        canvas: '#app',
        currentSize: function () {
            return parseFloat($(this.canvas).css('zoom')) || 1
        },
        zoomOut: function () {
            var current = this.currentSize();
            $(this.canvas).css('zoom', current - 0.1);
            $('#zoomIn').show();
            $(this.canvas).css('padding-top', function (index, curValue) {
                return parseInt(curValue, 10) + 40 + 'px';
            });
        },
        zoomIn: function () {
            var current = this.currentSize();
            $('#app').css('zoom', current + 0.1);
            if (parseFloat($(this.canvas).css('zoom')) >= 1) {
                $('#zoomIn').hide();
            }
            $(this.canvas).css('padding-top', function (index, curValue) {
                return parseInt(curValue, 10) - 40 + 'px';
            });
        },
        init: function () {
            $('#zoomIn').on('click', $.proxy(this, 'zoomIn'));
            $('#zoomOut').on('click', $.proxy(this, 'zoomOut'));
        }
    });

})(window.arguman || (window.arguman = {}));<|endoftext|>


<commit_before>

//
// The complete quiz for the night
//

var round_index = 0;

var nextRound = function() {
	round_index++;
	if(round_index >= rounds.length) {
		round_index = rounds.length - 1;
	}
	game.nodes = rounds[round_index];
};

var previousRound = function() {
	round_index--;

	if(round_index < 0) {
		round_index = 0;
	}
	game.nodes = rounds[round_index];
};

var width = getCanvas().width;
var height = getCanvas().height;

var halfW = width / 2;
var halfH = height / 2;

var centerX = halfW;
var centerY = halfH;

var rounds = [];

//two empty rounds to init things
rounds.push([]);
rounds.push([]);

// fixed green nav
rounds.push([
	new FixedLight({ colour:"green", x: centerX , y: centerY})
]);

// fixed red nav
rounds.push([
	new FixedLight({ colour:"red", x: centerX , y: centerY})
]);

// yacht coming towards us
rounds.push([
	new FixedLight({ colour:"red", x: centerX - 15, y: centerY}),
	new FixedLight({ colour:"green", x: centerX + 15, y: centerY})
]);

// powered vessel coming towards us
rounds.push([
	new FixedLight({ colour:"red", x: centerX - 15, y: centerY}),
	new FixedLight({ colour:"green", x: centerX + 15, y: centerY}),
	new FixedLight({ colour:"white", x: centerX , y: centerY - 30})
]);
<commit_msg>Add key movements through quiz<commit_after>

//
// The complete quiz for the night
//

$(function() {
	$("body").keydown(function(e) {
		if(e.keyCode === 39) {
			nextRound();
		}
		else if(e.keyCode === 37) {
			previousRound();
		}
	});

});

var round_index = 0;

var nextRound = function() {
	round_index++;
	if(round_index >= rounds.length) {
		round_index = rounds.length - 1;
	}
	game.nodes = rounds[round_index];
};

var previousRound = function() {
	round_index--;

	if(round_index < 0) {
		round_index = 0;
	}
	game.nodes = rounds[round_index];
};

var width = getCanvas().width;
var height = getCanvas().height;

var halfW = width / 2;
var halfH = height / 2;

var centerX = halfW;
var centerY = halfH;

var rounds = [];

//two empty rounds to init things
rounds.push([]);
rounds.push([]);

// fixed green nav yacht
rounds.push([
	new FixedLight({ colour:"green", x: centerX , y: centerY})
]);

// fixed green nav powered vessel
rounds.push([
	new FixedLight({ colour:"green", x: centerX , y: centerY}),
	new FixedLight({ colour:"white", x: centerX - 50 , y: centerY - 50}),
]);

// fixed red nav
rounds.push([
	new FixedLight({ colour:"red", x: centerX , y: centerY})
]);

// yacht coming towards us
rounds.push([
	new FixedLight({ colour:"red", x: centerX - 15, y: centerY}),
	new FixedLight({ colour:"green", x: centerX + 15, y: centerY})
]);

// powered vessel coming towards us
rounds.push([
	new FixedLight({ colour:"red", x: centerX - 15, y: centerY}),
	new FixedLight({ colour:"green", x: centerX + 15, y: centerY}),
	new FixedLight({ colour:"white", x: centerX , y: centerY - 30})
]);
<|endoftext|>


<commit_before>function log(...mess) {
  //console.log(...mess)
}
// Lazy-load - we might not need decimal. It's a peerDependency, so the parent
// library must include it if needed - we don't, because many callers don't need
// it.
let Decimal
export function requireDecimal() {
  return Decimal || (Decimal = (function() {
    // Allow node callers to inject their own decimal.js
    //if (global && global.Decimal) {
    //  log('swarm-numberformat decimal.js: Found global.Decimal')
    //  return global.Decimal
    //}
    // `nwb.config.js: extenals` ensures this points to window.Decimal for umd (`<script src="...">`) builds
    log('swarm-numberformat decimal.js: trying require()')
    return require('decimal.js')
  })())
}
<commit_msg>allow global decimal.js<commit_after>function log(...mess) {
  //console.log(...mess)
}
// Lazy-load - we might not need decimal. It's a peerDependency, so the parent
// library must include it if needed - we don't, because many callers don't need
// it.
let Decimal
export function requireDecimal() {
  return Decimal || (Decimal = (function() {
    // Allow node callers to inject their own decimal.js via global, because I am
    // sick to death of trying to wrangle require/webpack/import/etc.
    if (global && global.Decimal) {
      log('swarm-numberformat decimal.js: Found global.Decimal')
      return global.Decimal
    }
    // `nwb.config.js: extenals` ensures this points to window.Decimal for umd (`<script src="...">`) builds
    log('swarm-numberformat decimal.js: trying require()')
    return require('decimal.js')
  })())
}
<|endoftext|>


<commit_before>$(document).on('pageshow', function () {
	$("#confirmationPopup").popup ("open");

	/*setTimeout (
		function () {
			$("#confirmationPopup").popup ('close');
		},
		3000
	);*/

	$(".ui-popup-container.ui-popup-active").css("max-width", "inherit");
	$(".ui-popup-container.ui-popup-active").css("top", "88px");
	$(".ui-popup-container.ui-popup-active").css("bottom", "100px");
	$(".ui-popup-container.ui-popup-active").css("right", "12px");
	$(".ui-popup-container.ui-popup-active").css("left", "12px");
});<commit_msg>Next best offer JS updated with timeout<commit_after>$(document).on ('pageshow', function () {
	$("#confirmationPopup").popup ("open");

	setTimeout (
		function () {
			$("#confirmationPopup").popup ("close");
		},
		2000
	);

	$(".ui-popup-container.ui-popup-active").css ("max-width", "inherit");
	$(".ui-popup-container.ui-popup-active").css ("top", "88px");
	$(".ui-popup-container.ui-popup-active").css ("bottom", "100px");
	$(".ui-popup-container.ui-popup-active").css ("right", "12px");
	$(".ui-popup-container.ui-popup-active").css ("left", "12px");
});<|endoftext|>


<commit_before>function add_edit_button(map, container, type, icon, callback) {
    $('').appendTo(container).text(icon).attr({
        href: '#',
        title: 'add '+name,
        name: type
    }).on('click', function(e) {
        e.preventDefault();

        // If we are currently adding a feature, don't start drawing another.
        if (currently_adding !== null) {
            return;
        }

        // If we are currently drawing a feature, don't start drawing another.
        if (currently_drawing !== null) {
            // If it is a feature of the same type, cancel it.
            if (currently_drawing === type) {
                $('.leaflet-editbar .current').removeClass('current');
                currently_drawing = null;
                map.editTools.stopDrawing();
            }
            return;
        }

        currently_drawing = type;
        console.log(type);
        $('.leaflet-editbar .current').removeClass('current');
        $('.leaflet-editbar [name='+type+']').addClass('current');
        options = feature_types[type];
        if (options.type == 'polygon') {
            map.editTools.startPolygon(null, options);
        } else if (options.type == 'polyline') {
            map.editTools.startPolyline(null, options);
        }
    });
}

if ($('#mapeditor').length) {
    // Init Map
    var map = L.map('mapeditor', {
        zoom: 2,
        maxZoom: 10,
        minZoom: 1,
        crs: L.CRS.Simple,
        editable: true,
        closePopupOnClick: false,
    });

    $.getJSON('/api/v1/packages/', function(packages) {
        var bounds = [[0, 0], [0, 0]];
        var pkg;
        for(var i=0;i<packages.length;i++) {
            pkg = packages[i];
            if (pkg.bounds === null) continue;
            bounds = [[Math.min(bounds[0][0], pkg.bounds[0][0]), Math.min(bounds[0][1], pkg.bounds[0][1])],
                      [Math.max(bounds[1][0], pkg.bounds[1][0]), Math.max(bounds[1][1], pkg.bounds[1][1])]];
        }
        map.setMaxBounds(bounds);
        map.fitBounds(bounds, {padding: [30, 50]});

        $.getJSON('/api/v1/sources/', function(sources) {
            var layers = {};
            var source;
            for(var i=0;i<sources.length;i++) {
                source = sources[i];
                layers[source.name] = L.imageOverlay('/api/v1/sources/'+source.name+'/image/', source.bounds);
            }
            L.control.layers([], layers).addTo(map);
        });

        $.getJSON('/api/v1/levels/?ordering=-altitude', function(levels) {
            L.LevelControl = L.Control.extend({
                options: {
                    position: 'bottomright'
                },
                onAdd: function (map) {
                    var container = L.DomUtil.create('div', 'leaflet-control leaflet-bar leaflet-levels'), link;
                    var level;
                    for(var i=0;i<levels.length;i++) {
                        level = levels[i];
                        link = L.DomUtil.create('a', (i == levels.length-1) ? 'current' : '', container);
                        link.innerHTML = level.name;
                    }
                    return container;
                }
            });
            map.addControl(new L.LevelControl());
        });
    });

    // Default styles:
    feature_types = {
        building: {
            type: 'polygon',
            color: '#000000',
        },
        room: {
            type: 'polygon',
            color: '#CCCCCC',
        },
        obstacle: {
            type: 'polygon',
            color: '#999999',
        },
        door: {
            type: 'polygon',
            color: '#FF00FF',
        },
        step: {
            type: 'polyline',
            color: '#FF0000',
        },
        elevator: {
            type: 'polygon',
            color: '#99CC00',
        },
    }

    // Add drawing new features
    currently_drawing = null;
    currently_adding = null;
    function add_edit_button(map, container, type, icon, callback) {
        $('').appendTo(container).text(icon).attr({
            href: '#',
            title: 'add '+name,
            name: type
        }).on('click', function(e) {
            e.preventDefault();

            // If we are currently adding a feature, don't start drawing another.
            if (currently_adding !== null) {
                return;
            }

            // If we are currently drawing a feature, don't start drawing another.
            if (currently_drawing !== null) {
                // If it is a feature of the same type, cancel it.
                if (currently_drawing === type) {
                    $('.leaflet-editbar .current').removeClass('current');
                    currently_drawing = null;
                    map.editTools.stopDrawing();
                }
                return;
            }

            currently_drawing = type;
            console.log(type);
            $('.leaflet-editbar .current').removeClass('current');
            $('.leaflet-editbar [name='+type+']').addClass('current');
            options = feature_types[type];
            if (options.type == 'polygon') {
                map.editTools.startPolygon(null, options);
            } else if (options.type == 'polyline') {
                map.editTools.startPolyline(null, options);
            }
        });

    }
    L.DrawControl = L.Control.extend({
        options: {
            position: 'topleft'
        },
        onAdd: function (map) {
            var container = L.DomUtil.create('div', 'leaflet-control leaflet-bar leaflet-editbar');
            add_edit_button(map, container, 'building', '🏠');
            add_edit_button(map, container, 'room', '⬠');
            add_edit_button(map, container, 'obstacle', '⬟');
            add_edit_button(map, container, 'door', '🚪');
            add_edit_button(map, container, 'step', '┌┘');
            add_edit_button(map, container, 'elevator', '▴▾');
            return container;
        }
    });
    map.addControl(new L.DrawControl());
    map.on('editable:drawing:commit', function (e) {
        currently_drawing = null;
        currently_adding = e.layer;
        $('.leaflet-editbar .current').removeClass('current');
        e.layer.disableEdit();
        L.popup({
            closeButton: false,
            autoClose: false,
        }).setContent('').setLatLng(e.layer.getCenter()).openOn(map);
        console.log(e.layer.toGeoJSON());
    }).on('editable:drawing:cancel', function (e) {
        if (currently_drawing === null && currently_adding === null) {
            e.layer.remove();
        }
    });

    L.control.scale({imperial: false}).addTo(map);
}
<commit_msg>more fixes in map.js<commit_after>function add_edit_button(map, container, type, icon, callback) {
    $('').appendTo(container).text(icon).attr({
        href: '#',
        title: 'add '+name,
        name: type
    }).on('click', function(e) {
        e.preventDefault();

        // If we are currently adding a feature, don't start drawing another.
        if (currently_adding !== null) {
            return;
        }

        // If we are currently drawing a feature, don't start drawing another.
        if (currently_drawing !== null) {
            // If it is a feature of the same type, cancel it.
            if (currently_drawing === type) {
                $('.leaflet-editbar .current').removeClass('current');
                currently_drawing = null;
                map.editTools.stopDrawing();
            }
            return;
        }

        currently_drawing = type;
        console.log(type);
        $('.leaflet-editbar .current').removeClass('current');
        $('.leaflet-editbar [name='+type+']').addClass('current');
        options = feature_types[type];
        if (options.type == 'polygon') {
            map.editTools.startPolygon(null, options);
        } else if (options.type == 'polyline') {
            map.editTools.startPolyline(null, options);
        }
    });
}

if ($('#mapeditor').length) {
    // Init Map
    var map = L.map('mapeditor', {
        zoom: 2,
        maxZoom: 10,
        minZoom: 1,
        crs: L.CRS.Simple,
        editable: true,
        closePopupOnClick: false,
    });

    $.getJSON('/api/v1/packages/', function(packages) {
        var bounds = [[0, 0], [0, 0]];
        var pkg;
        for(var i=0;i<packages.length;i++) {
            pkg = packages[i];
            if (pkg.bounds === null) continue;
            bounds = [[Math.min(bounds[0][0], pkg.bounds[0][0]), Math.min(bounds[0][1], pkg.bounds[0][1])],
                      [Math.max(bounds[1][0], pkg.bounds[1][0]), Math.max(bounds[1][1], pkg.bounds[1][1])]];
        }
        map.setMaxBounds(bounds);
        map.fitBounds(bounds, {padding: [30, 50]});

        $.getJSON('/api/v1/sources/', function(sources) {
            var layers = {};
            var source;
            for(var i=0;i<sources.length;i++) {
                source = sources[i];
                layers[source.name] = L.imageOverlay('/api/v1/sources/'+source.name+'/image/', source.bounds);
            }
            L.control.layers([], layers).addTo(map);
        });

        $.getJSON('/api/v1/levels/?ordering=-altitude', function(levels) {
            L.LevelControl = L.Control.extend({
                options: {
                    position: 'bottomright'
                },
                onAdd: function (map) {
                    var container = L.DomUtil.create('div', 'leaflet-control leaflet-bar leaflet-levels'), link;
                    var level;
                    for(var i=0;i<levels.length;i++) {
                        level = levels[i];
                        link = L.DomUtil.create('a', (i == levels.length-1) ? 'current' : '', container);
                        link.innerHTML = level.name;
                    }
                    return container;
                }
            });
            map.addControl(new L.LevelControl());
        });
    });

    // Default styles:
    feature_types = {
        building: {
            type: 'polygon',
            color: '#000000',
        },
        room: {
            type: 'polygon',
            color: '#CCCCCC',
        },
        obstacle: {
            type: 'polygon',
            color: '#999999',
        },
        door: {
            type: 'polygon',
            color: '#FF00FF',
        },
        step: {
            type: 'polyline',
            color: '#FF0000',
        },
        elevator: {
            type: 'polygon',
            color: '#99CC00',
        },
    };

    // Add drawing new features
    currently_drawing = null;
    currently_adding = null;
    L.DrawControl = L.Control.extend({
        options: {
            position: 'topleft'
        },
        onAdd: function (map) {
            var container = L.DomUtil.create('div', 'leaflet-control leaflet-bar leaflet-editbar');
            add_edit_button(map, container, 'building', '🏠');
            add_edit_button(map, container, 'room', '⬠');
            add_edit_button(map, container, 'obstacle', '⬟');
            add_edit_button(map, container, 'door', '🚪');
            add_edit_button(map, container, 'step', '┌┘');
            add_edit_button(map, container, 'elevator', '▴▾');
            return container;
        }
    });
    map.addControl(new L.DrawControl());
    map.on('editable:drawing:commit', function (e) {
        currently_drawing = null;
        currently_adding = e.layer;
        $('.leaflet-editbar .current').removeClass('current');
        e.layer.disableEdit();
        L.popup({
            closeButton: false,
            autoClose: false,
        }).setContent('').setLatLng(e.layer.getCenter()).openOn(map);
        console.log(e.layer.toGeoJSON());
    }).on('editable:drawing:cancel', function (e) {
        if (currently_drawing === null && currently_adding === null) {
            e.layer.remove();
        }
    });

    L.control.scale({imperial: false}).addTo(map);
}
<|endoftext|>


<commit_before>//id canal afk = 167715581150101504
module.exports = (client, message, args, user) => {
    let channel = client.channels.get('167715581150101504');
    if (channel){
    message.member.setVoiceChannel(channel);
    //+message.author.username+
    //message.channel.send(`O usuário @${message.author.username} agora está Away!`).then(msg => {
        message.channel.send('O usuário **'+user+'** agora está Away! :zzz:').then(msg => {
        msg.delete(60000)
      });
    }
    message.delete(60000);
};<commit_msg><commit_after>//id canal afk = 167715581150101504
module.exports = (client, message, args) => {
    let channel = client.channels.get('167715581150101504');
    if (channel){
    message.member.setVoiceChannel(channel);
    //+message.author.username+
    //message.channel.send(`O usuário @${message.author.username} agora está Away!`).then(msg => {
        message.channel.send('O usuário **'+message.author.username+'** agora está Away! :zzz:').then(msg => {
        msg.delete(60000)
      });
    }
    message.delete(60000);
};<|endoftext|>


<commit_before>import h from 'react-hyperscript'

import { Collapsible } from 'reusableComponents/collapsible'
import {
  BackEnd,
  Code,
  FrontEnd,
  Movie,
  Music,
  Pencil,
  People,
  SupaHappy,
  ThumbUp,
  TV
} from 'svg'
import { link } from 'utils//misc'
import { settings } from 'settings'

const { greyDarken } = settings

const li = text => h('li', {}, text)

export const clFrontEnd = h(Collapsible,
  {
    titleIcon: FrontEnd,
    iconColor: greyDarken,
    titleIconSize: 35,
    title: 'Front-end',
    popOut: true
  },
  [
    h('ul', [
      li('HTML5 / CSS3'),
      li('Jade (I mean Pug 🐶...)'),
      li('SCSS / Less / Stylus'),
      li('PostCSS')
    ]),
    h('p', [
      'To organize my stylesheets, I try to follow the ',
      link('https://smacss.com/', 'SMACSS ', 'u-linkSweep.u-highlight'),
      'guidelines and the ',
      link('https://suitcss.github.io/', 'SUIT CSS ', 'u-linkSweep.u-highlight'),
      'naming conventions.'
    ]),
    h('p', [
      'On the JS side, I follow the ',
      link('https://standardjs.com/', 'Standard JS ', 'u-linkSweep.u-highlight'),
      'rules.'
    ]),
    h(
      Collapsible,
      {
        titleIcon: Code,
        iconColor: greyDarken,
        titleIconSize: 35,
        title: 'JS'
      },
      h('ul', [
        li('ES6'),
        li('TypeScript'),
        li('Flux-like architectures')
      ])
    ),
    h(Collapsible,
      {
        titleIcon: Pencil,
        iconColor: greyDarken,
        titleIconSize: 35,
        title: 'Design'
      },
      h('ul', [li('Figma'), li('Sketch'), li('Affinity Designer')])
    )
  ]
)

export const clBackEnd = h(Collapsible,
  {
    titleIcon: BackEnd,
    iconColor: greyDarken,
    titleIconSize: 35,
    title: 'Back-end',
    popOut: true
  },
  [h('ul', [li('Node.js / Express'), li('MongoDB')])]
)

export const clTools = h(Collapsible,
  {
    titleIcon: ThumbUp,
    iconColor: greyDarken,
    titleIconSize: 30,
    title: 'Tools I like',
    popOut: true
  },
  [
    h('ul', [
      li('iTerm2'),
      li('npm / yarn'),
      li('Webpack'),
      li('CSS Modules'),
      li('ESLint / TSLint / Stylelint'),
      li('Homebrew 🍺'),
      li(`Git (GitKraken doesn't hurt ;)`)
    ]),
    h('p', [
      'And if you must know, I work on a ',
      h('span.u-highlight', 'MacBook Pro '),
      'using ',
      h('span.u-highlight', 'Visual Studio Code '),
      'as my code editor.'
    ])
  ]
)

export const clMusic = h(Collapsible,
  {
    titleIcon: Music,
    iconColor: greyDarken,
    titleIconSize: 35,
    title: 'Music',
    popOut: true
  },
  [
    h('p',
      `Music is so many things, it can soothe you, move you, make you move, annoy you or even make you fall asleep, it's just fundamental :)`
    ),
    h(Collapsible, { iconColor: greyDarken, title: 'Rap' }, [
      h('p', 'Of course this is not an exhaustive list :'),
      h('ul', [
        li('Evidence'),
        li('TDE'),
        li(`Chance the Rapper (he's like Kanye West before Kanye became a Kardashian)`),
        li('Joey Bada$$'),
        li('Young Thug'),
        li(`ASAP Mob (not all of 'em...)`),
        li(
          `Cam'ron, The Wu-Tang Clan, The Notorious B.I.G, Kurupt...(never forget what time it is ;)`
        )
      ])
    ]),
    h(Collapsible, { iconColor: greyDarken, title: 'B-Side' }, [
      h('p',
        'All right, now get ready for the dummy mix, no rules, just me, my taste and no filter :'
      ),
      h('ul', [
        li('Jhené Aiko'),
        li('Yuna'),
        li('Frank Ocean'),
        li('Mélat'),
        li(`Blink-182 (didn't even listen to them as a teen, but man they're good)`),
        li('A-Trak'),
        li('...')
      ])
    ])
  ]
)

export const clTVMovies = h(Collapsible,
  {
    titleIcon: TV,
    iconColor: greyDarken,
    titleIconSize: 35,
    title: 'Netflix & ...',
    popOut: true
  },
  [
    h('p', 'Another non exhaustive list :'),
    h('ul', [
      li('Stranger Things'),
      li('Black Mirror'),
      li('Daredevil'),
      li('Mr. Robot'),
      li('Narcos'),
      li('GoT'),
      li('Orange is the new black'),
      li('...')
    ]),
    h(Collapsible,
      {
        titleIcon: Movie,
        iconColor: greyDarken,
        titleIconSize: 35,
        title: 'Movies'
      },
      [
        h('p',
          `Maybe not my favorites of all time, but the ones that pop into my head as I'm writing this.`
        ),
        h('ul', [
          li('Pitch Perfect (nerd alert!)'),
          li('The Nice Guys'),
          li('End of watch'),
          li('50/50'),
          li(`Kingsman`),
          li('22 Jump Street'),
          li('...')
        ])
      ]
    )
  ]
)

export const clPeople = h(Collapsible,
  {
    titleIcon: People,
    iconColor: greyDarken,
    titleIconSize: 35,
    title: 'Following',
    popOut: true
  },
  [
    h('p', 'Some devs I follow, look up to, and/or simply like :'),
    h('ul', [
      h('li', [
        link('http://bit.ly/1KcNPaY', 'Mattias Petter Johansson', 'u-linkSweep')
      ]),
      h('li', [
        link('https://blog.mariusschulz.com/', 'Marius Schulz', 'u-linkSweep')
      ]),
      h('li', [
        link('http://sidebar.io/', 'Sacha Greif', 'u-linkSweep')
      ]),
      h('li', [
        link('https://una.im/', 'Una Kravets', 'u-linkSweep')
      ]),
      h('li', [
        link('https://philipwalton.com/', 'Philip Walton', 'u-linkSweep')
      ]),
      h('li', [
        link('https://pawelgrzybek.com/', 'Pawel Grzybek', 'u-linkSweep')
      ])
    ])
  ]
)

export const clMisc = h(Collapsible,
  {
    titleIcon: SupaHappy,
    iconColor: greyDarken,
    titleIconSize: 35,
    title: 'Misc',
    popOut: true
  },
  [
    h('p', [
      'And of course, I like to have my ',
      h('span.u-highlight', '5 vegetables '),
      'a day (I mean, it feels good when I do...which is like once a month).'
    ]),
    h('p', [
      'And last but not least, I like people (well,',
      h('span.u-highlight', ` some of 'em, `),
      `sometimes..., my heart's not that big 😛), I mean music, tv series, your opinion about what's happening on the other side of the world and stuff is great...`
    ]),
    h('p',
      `But what's greater is when you get to share (and disagree with) all that with someone else, otherwise, what's the point, right?`
    )
  ]
)
<commit_msg>chore: update content<commit_after>import h from 'react-hyperscript'

import { Collapsible } from 'reusableComponents/collapsible'
import {
  BackEnd,
  Code,
  FrontEnd,
  Movie,
  Music,
  Pencil,
  People,
  SupaHappy,
  ThumbUp,
  TV
} from 'svg'
import { link } from 'utils//misc'
import { settings } from 'settings'

const { greyDarken } = settings

const li = text => h('li', {}, text)

export const clFrontEnd = h(Collapsible,
  {
    titleIcon: FrontEnd,
    iconColor: greyDarken,
    titleIconSize: 35,
    title: 'Front-end',
    popOut: true
  },
  [
    h('ul', [
      li('HTML5 / CSS3'),
      li('Jade (I mean Pug 🐶...)'),
      li('SCSS / Less / Stylus'),
      li('PostCSS')
    ]),
    h('p', [
      'To organize my stylesheets, I try to follow the ',
      link('https://sass-guidelin.es/#architecture', 'Sass guidelines ', 'u-linkSweep.u-highlight'),
      'guidelines and the ',
      link('https://github.com/suitcss/suit/blob/master/doc/naming-conventions.md', 'SUIT CSS ', 'u-linkSweep.u-highlight'),
      'naming conventions.'
    ]),
    h('p', [
      'On the JS side, I follow the ',
      link('https://standardjs.com/', 'Standard JS ', 'u-linkSweep.u-highlight'),
      'rules.'
    ]),
    h(
      Collapsible,
      {
        titleIcon: Code,
        iconColor: greyDarken,
        titleIconSize: 35,
        title: 'JS'
      },
      h('ul', [
        li('TypeScript'),
        li('ES6 & beyond'),
        li('Flux-like architectures')
      ])
    ),
    h(Collapsible,
      {
        titleIcon: Pencil,
        iconColor: greyDarken,
        titleIconSize: 35,
        title: 'Design'
      },
      h('ul', [li('Figma'), li('Sketch')])
    )
  ]
)

export const clBackEnd = h(Collapsible,
  {
    titleIcon: BackEnd,
    iconColor: greyDarken,
    titleIconSize: 35,
    title: 'Back-end',
    popOut: true
  },
  [h('ul', [li('Node.js / Express'), li('MongoDB')])]
)

export const clTools = h(Collapsible,
  {
    titleIcon: ThumbUp,
    iconColor: greyDarken,
    titleIconSize: 30,
    title: 'Tools I like',
    popOut: true
  },
  [
    h('ul', [
      li('iTerm2'),
      li('npm / yarn'),
      li('Webpack'),
      li('CSS Modules'),
      li('ESLint / TSLint / Stylelint'),
      li('Homebrew 🍺'),
      li(`Git (GitKraken doesn't hurt ;)`)
    ]),
    h('p', [
      'And if you must know, I work on a ',
      h('span.u-highlight', 'MacBook Pro '),
      'using ',
      h('span.u-highlight', 'Visual Studio Code '),
      'as my code editor.'
    ])
  ]
)

export const clMusic = h(Collapsible,
  {
    titleIcon: Music,
    iconColor: greyDarken,
    titleIconSize: 35,
    title: 'Music',
    popOut: true
  },
  [
    h('p',
      `Music is so many things, it can soothe you, move you, make you move, annoy you or even make you fall asleep, it's just fundamental :)`
    ),
    h(Collapsible, { iconColor: greyDarken, title: 'Rap' }, [
      h('p', 'Of course this is not an exhaustive list :'),
      h('ul', [
        li('Kendrick Lamar'),
        li(`ScHoolboy Q`),
        li('Joey Bada$$'),
        li('Young Thug'),
        li('Drake'),
        li(`ASAP Mob (not all of 'em...)`),
        li(
          `Cam'ron, The Wu-Tang Clan, The Notorious B.I.G, Kurupt...(never forget what time it is ;)`
        )
      ])
    ]),
    h(Collapsible, { iconColor: greyDarken, title: 'B-Side' }, [
      h('p',
        'All right, now get ready for the dummy mix, no rules, just me, my taste and no filter :'
      ),
      h('ul', [
        li('Jhené Aiko'),
        li('Yuna'),
        li('Frank Ocean'),
        li('SZA'),
        li(`Blink-182 (didn't even listen to them as a teen, but man they're good)`),
        li('A-Trak'),
        li('...')
      ])
    ])
  ]
)

export const clTVMovies = h(Collapsible,
  {
    titleIcon: TV,
    iconColor: greyDarken,
    titleIconSize: 35,
    title: 'Netflix & ...',
    popOut: true
  },
  [
    h('p', 'Another non exhaustive list :'),
    h('ul', [
      li('Stranger Things'),
      li('Black Mirror'),
      li('Daredevil'),
      li('Mr. Robot'),
      li('Narcos'),
      li('GoT'),
      li('Orange is the new black'),
      li('...')
    ]),
    h(Collapsible,
      {
        titleIcon: Movie,
        iconColor: greyDarken,
        titleIconSize: 35,
        title: 'Movies'
      },
      [
        h('p',
          `Maybe not my favorites of all time, but the ones that pop into my head as I'm writing this.`
        ),
        h('ul', [
          li('The Fighter'),
          li('The Nice Guys'),
          li('End of watch'),
          li('Logan'),
          li(`Kingsman`),
          li('22 Jump Street'),
          li('...')
        ])
      ]
    )
  ]
)

export const clPeople = h(Collapsible,
  {
    titleIcon: People,
    iconColor: greyDarken,
    titleIconSize: 35,
    title: 'Following',
    popOut: true
  },
  [
    h('p', 'Some devs I follow, look up to, and/or simply like :'),
    h('ul', [
      h('li', [
        link('http://bit.ly/1KcNPaY', 'Mattias Petter Johansson', 'u-linkSweep')
      ]),
      h('li', [
        link('https://blog.mariusschulz.com/', 'Marius Schulz', 'u-linkSweep')
      ]),
      h('li', [
        link('http://sidebar.io/', 'Sacha Greif', 'u-linkSweep')
      ]),
      h('li', [
        link('https://una.im/', 'Una Kravets', 'u-linkSweep')
      ]),
      h('li', [
        link('https://philipwalton.com/', 'Philip Walton', 'u-linkSweep')
      ]),
      h('li', [
        link('https://pawelgrzybek.com/', 'Pawel Grzybek', 'u-linkSweep')
      ])
    ])
  ]
)

export const clMisc = h(Collapsible,
  {
    titleIcon: SupaHappy,
    iconColor: greyDarken,
    titleIconSize: 35,
    title: 'Misc',
    popOut: true
  },
  [
    h('p', [
      'And of course, I like to have my ',
      h('span.u-highlight', '5 vegetables '),
      'a day (I mean, it feels good when I do...which is like once a month).'
    ]),
    h('p', [
      'And last but not least, I like people (well,',
      h('span.u-highlight', ` some of 'em, `),
      `sometimes..., my heart's not that big 😛), I mean music, tv series, your opinion about what's happening on the other side of the world and stuff is great...`
    ]),
    h('p',
      `But what's greater is when you get to share (and disagree with) all that with someone else, otherwise, what's the point, right?`
    )
  ]
)
<|endoftext|>