mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-24 01:16:15 -04:00
Move vendor libraries to /vendors folder and exclude from LGTM
This commit is contained in:
parent
0bb3e65020
commit
1b8cd0747d
32 changed files with 79 additions and 75 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
const Changeset = require('./Changeset');
|
||||
const ChangesetUtils = require('./ChangesetUtils');
|
||||
const _ = require('./underscore');
|
||||
const _ = require('./vendors/underscore');
|
||||
|
||||
const lineMarkerAttribute = 'lmkr';
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
*/
|
||||
let documentAttributeManager;
|
||||
|
||||
const browser = require('./browser');
|
||||
const browser = require('./vendors/browser');
|
||||
const padutils = require('./pad_utils').padutils;
|
||||
const Ace2Common = require('./ace2_common');
|
||||
const $ = require('./rjquery').$;
|
||||
|
|
|
@ -28,7 +28,7 @@ const AttribPool = require('./AttributePool');
|
|||
const Changeset = require('./Changeset');
|
||||
const linestylefilter = require('./linestylefilter').linestylefilter;
|
||||
const colorutils = require('./colorutils').colorutils;
|
||||
const _ = require('./underscore');
|
||||
const _ = require('./vendors/underscore');
|
||||
const hooks = require('./pluginfw/hooks');
|
||||
|
||||
// These parameters were global, now they are injected. A reference to the
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
// These parameters were global, now they are injected. A reference to the
|
||||
// Timeslider controller would probably be more appropriate.
|
||||
const _ = require('./underscore');
|
||||
const _ = require('./vendors/underscore');
|
||||
const padmodals = require('./pad_modals').padmodals;
|
||||
const colorutils = require('./colorutils').colorutils;
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
const chat = require('./chat').chat;
|
||||
const hooks = require('./pluginfw/hooks');
|
||||
const browser = require('./browser');
|
||||
const browser = require('./vendors/browser');
|
||||
|
||||
// Dependency fill on init. This exists for `pad.socket` only.
|
||||
// TODO: bind directly to the socket.
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
const Security = require('./security');
|
||||
const hooks = require('./pluginfw/hooks');
|
||||
const _ = require('./underscore');
|
||||
const _ = require('./vendors/underscore');
|
||||
const lineAttributeMarker = require('./linestylefilter').lineAttributeMarker;
|
||||
const noop = () => {};
|
||||
|
||||
|
|
|
@ -26,9 +26,9 @@ let socket;
|
|||
|
||||
// These jQuery things should create local references, but for now `require()`
|
||||
// assigns to the global `$` and augments it with plugins.
|
||||
require('./jquery');
|
||||
require('./farbtastic');
|
||||
require('./gritter');
|
||||
require('./vendors/jquery');
|
||||
require('./vendors/farbtastic');
|
||||
require('./vendors/gritter');
|
||||
|
||||
const Cookies = require('./pad_utils').Cookies;
|
||||
const chat = require('./chat').chat;
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
const browser = require('./browser');
|
||||
const browser = require('./vendors/browser');
|
||||
const hooks = require('./pluginfw/hooks');
|
||||
const padutils = require('./pad_utils').padutils;
|
||||
const padeditor = require('./pad_editor').padeditor;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
'use strict';
|
||||
// Provides a require'able version of jQuery without leaking $ and jQuery;
|
||||
window.$ = require('./jquery');
|
||||
window.$ = require('./vendors/jquery');
|
||||
const jq = window.$.noConflict(true);
|
||||
exports.jQuery = exports.$ = jq;
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
*/
|
||||
|
||||
const Ace2Common = require('./ace2_common');
|
||||
const _ = require('./underscore');
|
||||
const _ = require('./vendors/underscore');
|
||||
|
||||
const noop = Ace2Common.noop;
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
// These jQuery things should create local references, but for now `require()`
|
||||
// assigns to the global `$` and augments it with plugins.
|
||||
require('./jquery');
|
||||
require('./vendors/jquery');
|
||||
|
||||
const Cookies = require('./pad_utils').Cookies;
|
||||
const randomString = require('./pad_utils').randomString;
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
*/
|
||||
|
||||
const Changeset = require('./Changeset');
|
||||
const _ = require('./underscore');
|
||||
const _ = require('./vendors/underscore');
|
||||
|
||||
const undoModule = (() => {
|
||||
const stack = (() => {
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
// WARNING: This file may have been modified from original.
|
||||
// TODO: Check requirement of this file, this afaik was to cover weird edge cases
|
||||
// that have probably been fixed in browsers.
|
||||
|
||||
/*!
|
||||
* Bowser - a browser detector
|
||||
* https://github.com/ded/bowser
|
||||
|
@ -303,4 +307,4 @@
|
|||
bowser._detect = detect;
|
||||
|
||||
return bowser
|
||||
});
|
||||
});
|
|
@ -1,3 +1,6 @@
|
|||
// WARNING: This file has been modified from original.
|
||||
// TODO: Replace with https://github.com/Simonwep/pickr
|
||||
|
||||
// Farbtastic 2.0 alpha
|
||||
// Original can be found at:
|
||||
// https://github.com/mattfarina/farbtastic/blob/71ca15f4a09c8e5a08a1b0d1cf37ef028adf22f0/src/farbtastic.js
|
|
@ -1,3 +1,5 @@
|
|||
// WARNING: This file has been modified from the Original
|
||||
|
||||
/*
|
||||
* Gritter for jQuery
|
||||
* http://www.boedesign.com/
|
|
@ -1,3 +1,5 @@
|
|||
// WARNING: This file has been modified from the Original
|
||||
|
||||
/**
|
||||
* Copyright (c) 2012 Marcel Klehr
|
||||
* Copyright (c) 2011-2012 Fabien Cazenave, Mozilla
|
28
src/static/js/vendors/nice-select.js
vendored
28
src/static/js/vendors/nice-select.js
vendored
|
@ -1,3 +1,6 @@
|
|||
// WARNING: This file has been modified from the Original
|
||||
// TODO: Nice Select seems relatively abandoned, we should consider other options.
|
||||
|
||||
/* jQuery Nice Select - v1.1.0
|
||||
https://github.com/hernansartorio/jquery-nice-select
|
||||
Made by Hernán Sartorio */
|
||||
|
@ -60,14 +63,14 @@
|
|||
.addClass($select.attr('class') || '')
|
||||
.addClass($select.attr('disabled') ? 'disabled' : '')
|
||||
.attr('tabindex', $select.attr('disabled') ? null : '0')
|
||||
.html('<span class="current"></span><ul class="list thin-scrollbar"></ul>')
|
||||
.html('<span class="current"></span><ul class="list"></ul>')
|
||||
);
|
||||
|
||||
var $dropdown = $select.next();
|
||||
var $options = $select.find('option');
|
||||
var $selected = $select.find('option:selected');
|
||||
|
||||
$dropdown.find('.current').html($selected.data('display') || $selected.text());
|
||||
$dropdown.find('.current').html($selected.data('display') || $selected.text());
|
||||
|
||||
$options.each(function(i) {
|
||||
var $option = $(this);
|
||||
|
@ -94,31 +97,12 @@
|
|||
var $dropdown = $(this);
|
||||
|
||||
$('.nice-select').not($dropdown).removeClass('open');
|
||||
|
||||
$dropdown.toggleClass('open');
|
||||
|
||||
if ($dropdown.hasClass('open')) {
|
||||
$dropdown.find('.option');
|
||||
$dropdown.find('.focus').removeClass('focus');
|
||||
$dropdown.find('.selected').addClass('focus');
|
||||
if ($dropdown.closest('.toolbar').length > 0) {
|
||||
$dropdown.find('.list').css('left', $dropdown.offset().left);
|
||||
$dropdown.find('.list').css('top', $dropdown.offset().top + $dropdown.outerHeight());
|
||||
$dropdown.find('.list').css('min-width', $dropdown.outerWidth() + 'px');
|
||||
}
|
||||
|
||||
$listHeight = $dropdown.find('.list').outerHeight();
|
||||
$top = $dropdown.parent().offset().top;
|
||||
$bottom = $('body').height() - $top;
|
||||
$maxListHeight = $bottom - $dropdown.outerHeight() - 20;
|
||||
if ($maxListHeight < 200) {
|
||||
$dropdown.addClass('reverse');
|
||||
$maxListHeight = 250;
|
||||
} else {
|
||||
$dropdown.removeClass('reverse')
|
||||
}
|
||||
$dropdown.find('.list').css('max-height', $maxListHeight + 'px');
|
||||
|
||||
} else {
|
||||
$dropdown.focus();
|
||||
}
|
||||
|
@ -206,4 +190,4 @@
|
|||
|
||||
};
|
||||
|
||||
}(jQuery));
|
||||
}(jQuery));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue