summaryrefslogtreecommitdiffstats
path: root/data/js/application.js
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2015-06-04 23:10:31 +0200
committerFlorian Pritz <bluewind@xinu.at>2015-06-05 21:23:49 +0200
commitd088234d67f3aa422796d922e08a07949dc53d83 (patch)
treea964821b6b725dd26becbb3e91acf8d7dd5e0014 /data/js/application.js
parent048410164d2a17bbb588e43351e44eeb81610960 (diff)
Move public files to ./public_html
./data/local is not moved because it contains likely untracked files and moving it would throw an error when updating. Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'data/js/application.js')
-rw-r--r--data/js/application.js93
1 files changed, 0 insertions, 93 deletions
diff --git a/data/js/application.js b/data/js/application.js
deleted file mode 100644
index 310362dd9..000000000
--- a/data/js/application.js
+++ /dev/null
@@ -1,93 +0,0 @@
-(function () {
-'use strict';
-define(
- [
- 'require',
- 'util',
- 'lexer-input',
- 'tabwidth-input',
- 'thumbnail-view',
- 'uploader',
- 'tablesorter',
- 'jquery',
- 'jquery.lazyload',
- 'bootstrap'
- ],
- 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.setupToggleSelectAllEvent();
- this.setupLineWrapToggle();
- this.setupLazyLoadingImages();
- },
-
- setupLineHighlight: function () {
- $(window).on('hashchange', Util.highlightLineFromHash);
- },
-
- configureTooltips: function () {
- $('[rel="tooltip"]').tooltip({
- placement: 'bottom',
- container: 'body',
- });
- },
-
- setupToggleSelectAllEvent: function () {
- $('#history-all').on('click', function(event) {
- // Suppress click event on table heading
- event.stopImmediatePropagation();
- });
- $('#history-all').on('change', function(event) {
- var checked = $(event.target).prop('checked');
- $('.delete-history').prop('checked', checked);
- });
- },
-
- setupLineWrapToggle: function () {
- var linesWrapped = localStorage.getItem('lines_wrapped') || 'true';
- Util.setLineWrap(linesWrapped === 'true');
-
- $('.linewrap-toggle').on('click', _.bind(Util.toggleLineWrap, Util));
- },
-
- setupLazyLoadingImages: function () {
- if ($(ui.lazyLoadingImages).length > 0) {
- $(ui.lazyLoadingImages).show().lazyload({treshold: 200});
- }
- }
- };
-
- return App;
- }
-);
-})();