diff --git a/.dockerignore b/.dockerignore
index 937e0109..627bba19 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -19,15 +19,6 @@ cssnano.config.js
bin/release.js
-modules/jquery/dist
-modules/jquery/external
-modules/jquery/src
-
-!modules/jquery/dist/jquery.min.js
-
-modules/execon
-modules/emitify
-
client
legacy
server_
diff --git a/.gitignore b/.gitignore
index aec49128..c629c5b4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,14 +5,6 @@ node_modules
npm-debug.log*
coverage
-modules/jquery-mouse-wheel
-
-modules/jquery/dist
-modules/jquery/external
-modules/jquery/src
-
-!modules/jquery/dist/jquery.min.js
-
modules/execon
modules/emitify
diff --git a/.npmignore b/.npmignore
index e1db1c85..8ce4ae85 100644
--- a/.npmignore
+++ b/.npmignore
@@ -13,14 +13,6 @@ yarn.lock
now.json
cssnano.config.js
-modules/jquery-mouse-wheel
-
-modules/jquery/dist
-modules/jquery/external
-modules/jquery/src
-
-!modules/jquery/dist/jquery.min.js
-
app.json
bower.json
manifest.yml
diff --git a/bower.json b/bower.json
index c847e0d9..c42f405e 100644
--- a/bower.json
+++ b/bower.json
@@ -28,7 +28,6 @@
"test"
],
"dependencies": {
- "olark": "^1.0.0",
- "jquery": "3.3.1"
+ "olark": "^1.0.0"
}
}
diff --git a/client/client.js b/client/client.js
index 3594f776..f3c3be07 100644
--- a/client/client.js
+++ b/client/client.js
@@ -134,12 +134,11 @@ function CloudCmdProto(DOM) {
const {
load,
- loadJquery,
} = DOM;
- const funcBefore = (callback) => {
+ const funcBefore = (callback) => {
const src = prefix + CloudCmd.DIRCLIENT_MODULES + 'polyfill.js';
- loadJquery(wraptile(load.js, src, callback));
+ load.js(src, callback));
};
CloudCmd.PREFIX = prefix;
diff --git a/client/dom/index.js b/client/dom/index.js
index 8db8e9cf..af69bee8 100644
--- a/client/dom/index.js
+++ b/client/dom/index.js
@@ -54,17 +54,6 @@ function CmdProto() {
loadRemote(name, options, callback);
return DOM;
};
- /**
- * load jquery from google cdn or local copy
- * @param callback
- */
- this.loadJquery = function(callback) {
- DOM.loadRemote('jquery', {
- name : '$'
- }, callback);
-
- return DOM;
- };
this.loadSocket = function(callback) {
DOM.loadRemote('socket', {
diff --git a/client/modules/create-element.js b/client/modules/create-element.js
new file mode 100644
index 00000000..0255f8ae
--- /dev/null
+++ b/client/modules/create-element.js
@@ -0,0 +1,40 @@
+'use strict';
+
+const query = (a) => document.querySelector(`[data-name="${a}"]`);
+const isStr = (a) => typeof a === 'string';
+
+module.exports = (name, {innerHTML, className, dataName, textContent, parent} = {}) => {
+ parent = parent || document.body;
+ className = className || '';
+ dataName = dataName || '';
+
+ const elFound = isElementPresent(dataName);
+
+ if (elFound)
+ return elFound;
+
+ const el = document.createElement(name);
+
+ if (isStr(innerHTML))
+ el.innerHTML = innerHTML;
+
+ if (isStr(textContent))
+ el.textContent = textContent;
+
+ el.className = className;
+ el.dataset.name = dataName;
+
+ parent.appendChild(el);
+
+ return el;
+};
+
+module.exports.isElementPresent = isElementPresent;
+
+function isElementPresent(dataName) {
+ if (!dataName)
+ return;
+
+ return query(dataName);
+}
+
diff --git a/client/modules/view.js b/client/modules/view.js
index 24aa9dbd..d67a9178 100644
--- a/client/modules/view.js
+++ b/client/modules/view.js
@@ -1,6 +1,6 @@
'use strict';
-/* global CloudCmd, DOM, $ */
+/* global CloudCmd, DOM */
require('../../css/view.css');
@@ -11,6 +11,7 @@ const currify = require('currify/legacy');
const {promisify} = require('es6-promisify');
const modal = require('@cloudcmd/modal');
+const createElement = require('./create-element')
const {time} = require('../../common/util');
const {FS} = require('../../common/cloudfunc');
@@ -70,7 +71,6 @@ module.exports.init = promisify((fn) => {
Loading = true;
exec.series([
- DOM.loadJquery,
loadAll,
(callback) => {
Loading = false;
@@ -95,11 +95,15 @@ function show(data, options) {
if (!options || options.bindKeys !== false)
Events.addKey(listener);
- El = $('
');
+ El = createElement('div', {
+ className: 'view',
+ });
+
+ El.tabindex = 0;
if (data) {
- const element = $(El).append(data);
- modal.open(element[0], initConfig(Config, options));
+ El.append(data);
+ modal.open(El, initConfig(Config, options));
return;
}
@@ -151,12 +155,15 @@ function viewFile() {
if (CloudCmd.config('showFileName'))
options.title = Info.name;
- modal.open(El.append(element)[0], options);
+ El.append(element);
+ modal.open(El, options);
});
}
function initConfig(Config, options) {
- const config = Object.assign({}, Config);
+ const config = {
+ ...Config
+ };
if (!options)
return config;
diff --git a/json/modules.json b/json/modules.json
index 579c8a4d..0c7439d8 100644
--- a/json/modules.json
+++ b/json/modules.json
@@ -18,11 +18,6 @@
"cloud"
],
"remote": [{
- "name": "jquery",
- "version": "3.3.1",
- "local": "/modules/jquery/dist/jquery.min.js",
- "remote": "https://code.jquery.com/jquery-{{ version }}.min.js"
- }, {
"name": "socket",
"version": "2.1.1",
"local": "/socket.io/socket.io.js",
diff --git a/modules/jquery/.bower.json b/modules/jquery/.bower.json
deleted file mode 100644
index 69272f92..00000000
--- a/modules/jquery/.bower.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "name": "jquery",
- "main": "dist/jquery.js",
- "license": "MIT",
- "ignore": [
- "package.json"
- ],
- "keywords": [
- "jquery",
- "javascript",
- "browser",
- "library"
- ],
- "homepage": "https://github.com/jquery/jquery-dist",
- "version": "3.3.1",
- "_release": "3.3.1",
- "_resolution": {
- "type": "version",
- "tag": "3.3.1",
- "commit": "9e8ec3d10fad04748176144f108d7355662ae75e"
- },
- "_source": "https://github.com/jquery/jquery-dist.git",
- "_target": "3.3.1",
- "_originalSource": "jquery"
-}
\ No newline at end of file
diff --git a/modules/jquery/AUTHORS.txt b/modules/jquery/AUTHORS.txt
deleted file mode 100644
index 4bb5da15..00000000
--- a/modules/jquery/AUTHORS.txt
+++ /dev/null
@@ -1,313 +0,0 @@
-Authors ordered by first contribution.
-
-John Resig
-Gilles van den Hoven
-Michael Geary
-Stefan Petre
-Yehuda Katz
-Corey Jewett
-Klaus Hartl
-Franck Marcia
-Jörn Zaefferer
-Paul Bakaus
-Brandon Aaron
-Mike Alsup
-Dave Methvin
-Ed Engelhardt
-Sean Catchpole
-Paul Mclanahan
-David Serduke
-Richard D. Worth
-Scott González
-Ariel Flesler
-Jon Evans
-TJ Holowaychuk
-Michael Bensoussan
-Robert Katić
-Louis-Rémi Babé
-Earle Castledine
-Damian Janowski
-Rich Dougherty
-Kim Dalsgaard
-Andrea Giammarchi
-Mark Gibson
-Karl Swedberg
-Justin Meyer
-Ben Alman
-James Padolsey
-David Petersen
-Batiste Bieler
-Alexander Farkas
-Rick Waldron
-Filipe Fortes
-Neeraj Singh
-Paul Irish
-Iraê Carvalho
-Matt Curry
-Michael Monteleone
-Noah Sloan
-Tom Viner
-Douglas Neiner
-Adam J. Sontag
-Dave Reed
-Ralph Whitbeck
-Carl Fürstenberg
-Jacob Wright
-J. Ryan Stinnett
-unknown
-temp01
-Heungsub Lee
-Colin Snover
-Ryan W Tenney
-Pinhook
-Ron Otten
-Jephte Clain
-Anton Matzneller
-Alex Sexton
-Dan Heberden
-Henri Wiechers
-Russell Holbrook
-Julian Aubourg
-Gianni Alessandro Chiappetta
-Scott Jehl
-James Burke
-Jonas Pfenniger
-Xavi Ramirez
-Jared Grippe
-Sylvester Keil
-Brandon Sterne
-Mathias Bynens
-Timmy Willison <4timmywil@gmail.com>
-Corey Frang
-Digitalxero
-Anton Kovalyov
-David Murdoch
-Josh Varner
-Charles McNulty
-Jordan Boesch
-Jess Thrysoee
-Michael Murray
-Lee Carpenter
-Alexis Abril
-Rob Morgan
-John Firebaugh
-Sam Bisbee
-Gilmore Davidson
-Brian Brennan
-Xavier Montillet
-Daniel Pihlstrom
-Sahab Yazdani
-avaly
-Scott Hughes
-Mike Sherov
-Greg Hazel
-Schalk Neethling
-Denis Knauf
-Timo Tijhof
-Steen Nielsen
-Anton Ryzhov
-Shi Chuan
-Berker Peksag
-Toby Brain
-Matt Mueller
-Justin
-Daniel Herman
-Oleg Gaidarenko
-Richard Gibson
-Rafaël Blais Masson
-cmc3cn <59194618@qq.com>
-Joe Presbrey
-Sindre Sorhus
-Arne de Bree
-Vladislav Zarakovsky
-Andrew E Monat
-Oskari
-Joao Henrique de Andrade Bruni
-tsinha
-Matt Farmer
-Trey Hunner
-Jason Moon
-Jeffery To
-Kris Borchers
-Vladimir Zhuravlev
-Jacob Thornton
-Chad Killingsworth
-Nowres Rafid
-David Benjamin
-Uri Gilad
-Chris Faulkner
-Elijah Manor
-Daniel Chatfield
-Nikita Govorov
-Wesley Walser
-Mike Pennisi
-Markus Staab
-Dave Riddle
-Callum Macrae
-Benjamin Truyman
-James Huston
-Erick Ruiz de Chávez
-David Bonner
-Akintayo Akinwunmi
-MORGAN
-Ismail Khair
-Carl Danley
-Mike Petrovich
-Greg Lavallee
-Daniel Gálvez
-Sai Lung Wong
-Tom H Fuertes
-Roland Eckl
-Jay Merrifield
-Allen J Schmidt Jr
-Jonathan Sampson
-Marcel Greter
-Matthias Jäggli
-David Fox
-Yiming He
-Devin Cooper
-Paul Ramos
-Rod Vagg
-Bennett Sorbo
-Sebastian Burkhard
-Zachary Adam Kaplan
-nanto_vi
-nanto
-Danil Somsikov
-Ryunosuke SATO
-Jean Boussier
-Adam Coulombe
-Andrew Plummer
-Mark Raddatz
-Isaac Z. Schlueter
-Karl Sieburg
-Pascal Borreli
-Nguyen Phuc Lam
-Dmitry Gusev
-Michał Gołębiowski-Owczarek
-Li Xudong
-Steven Benner
-Tom H Fuertes
-Renato Oliveira dos Santos
-ros3cin
-Jason Bedard
-Kyle Robinson Young
-Chris Talkington
-Eddie Monge
-Terry Jones
-Jason Merino
-Jeremy Dunck
-Chris Price
-Guy Bedford
-Amey Sakhadeo
-Mike Sidorov
-Anthony Ryan
-Dominik D. Geyer
-George Kats
-Lihan Li
-Ronny Springer
-Chris Antaki
-Marian Sollmann
-njhamann
-Ilya Kantor
-David Hong
-John Paul
-Jakob Stoeck
-Christopher Jones
-Forbes Lindesay
-S. Andrew Sheppard
-Leonardo Balter
-Roman Reiß
-Benjy Cui
-Rodrigo Rosenfeld Rosas
-John Hoven
-Philip Jägenstedt
-Christian Kosmowski
-Liang Peng
-TJ VanToll
-Senya Pugach
-Aurelio De Rosa
-Nazar Mokrynskyi
-Amit Merchant
-Jason Bedard
-Arthur Verschaeve
-Dan Hart
-Bin Xin
-David Corbacho
-Veaceslav Grimalschi
-Daniel Husar
-Frederic Hemberger
-Ben Toews
-Aditya Raghavan
-Victor Homyakov
-Shivaji Varma
-Nicolas HENRY
-Anne-Gaelle Colom
-George Mauer
-Leonardo Braga
-Stephen Edgar
-Thomas Tortorini
-Winston Howes
-Jon Hester
-Alexander O'Mara
-Bastian Buchholz
-Arthur Stolyar
-Calvin Metcalf
-Mu Haibao
-Richard McDaniel