(function () { 'use strict'; define( [ 'require', 'util', 'lexer-input', 'tabwidth-input', 'thumbnail-view', 'uploader', 'tablesorter', 'jquery', 'jquery.lazyload', 'bootstrap', 'jquery.checkboxes' ], function ( require, Util, LexerInput, TabwidthInput, ThumbnailView, Uploader, TableSorter, $ ) { var ui = { lazyLoadingImages: 'img.lazyload' }; var App = { // Gets called for every request (before page load) initialize: function () { this.setupLineHighlight(); }, /* * Gets called for every request after page load * config contains app config attributes passed from php */ onPageLoaded: function () { Util.highlightLineFromHash(); Util.setTabwidthFromLocalStorage(); TabwidthInput.initialize(); LexerInput.initialize(); ThumbnailView.initialize(); Uploader.initialize(); TableSorter.initialize(); this.configureTooltips(); this.setupHistoryPopovers(); this.setupToggleSelectAllEvent(); this.setupLineWrapToggle(); this.setupLazyLoadingImages(); this.setupTableRangeSelect(); }, setupTableRangeSelect: function () { $('#upload_history').checkboxes('range', true); }, setupLineHighlight: function () { $(window).on('hashchange', Util.highlightLineFromHash); }, configureTooltips: function () { $('[rel="tooltip"]').tooltip({ placement: 'bottom', container: 'body', }); }, setupHistoryPopovers: function () { $('#upload_history a').popover({ trigger: 'hover', placement: 'bottom', html: true, viewport: '#upload_history', template: '