;
webview.on('dom-ready', function () {
if (options.contextMenu) {
@@ -323,26 +324,26 @@ function Navigation(options) {
NAV._stopLoading(currtab);
});
webview.on('enter-html-full-screen', function () {
- jq('.nav-views-view.active').siblings().not('script').hide();
- jq('.nav-views-view.active').parents().not('script').siblings().hide();
+ $('.nav-views-view.active').siblings().not('script').hide();
+ $('.nav-views-view.active').parents().not('script').siblings().hide();
});
webview.on('leave-html-full-screen', function () {
- jq('.nav-views-view.active').siblings().not('script').show();
- jq('.nav-views-view.active').parents().siblings().not('script').show();
+ $('.nav-views-view.active').siblings().not('script').show();
+ $('.nav-views-view.active').parents().siblings().not('script').show();
});
webview.on('load-commit', function () {
NAV._updateCtrls();
});
webview[0].addEventListener('did-navigate', (res) => {
- if(currtab[0] === jq('.nav-tabs-tab.active')[0])
+ if(currtab[0] === $('.nav-tabs-tab.active')[0])
NAV._updateUrl(res.url);
});
webview[0].addEventListener('did-fail-load', (res) => {
- if(currtab[0] === jq('.nav-tabs-tab.active')[0])
+ if(currtab[0] === $('.nav-tabs-tab.active')[0])
NAV._updateUrl(res.validatedURL);
});
webview[0].addEventListener('did-navigate-in-page', (res) => {
- if(currtab[0] === jq('.nav-tabs-tab.active')[0])
+ if(currtab[0] === $('.nav-tabs-tab.active')[0])
NAV._updateUrl(res.url);
});
webview[0].addEventListener("new-window", (res) => {
@@ -353,10 +354,10 @@ function Navigation(options) {
}
});
webview[0].addEventListener('page-favicon-updated', (res) => {
- currtab.find('.nav-tabs-favicon').replaceWith(jq(''));
+ currtab.find('.nav-tabs-favicon').replaceWith($(''));
});
webview[0].addEventListener('did-fail-load', (res) => {
- if (res.validatedURL == jq('#nav-ctrls-url').val() && res.errorCode != -3) {
+ if (res.validatedURL == $('#nav-ctrls-url').val() && res.errorCode != -3) {
this.executeJavaScript('document.body.innerHTML=' +
'' +
'
Oops, this page failed to load correctly.
' +
@@ -377,10 +378,10 @@ function Navigation(options) {
//
this._updateUrl = function (url) {
url = url || null;
- let urlInput = jq('#nav-ctrls-url');
+ let urlInput = $('#nav-ctrls-url');
if (url == null) {
- if (jq('.nav-views-view').length) {
- url = (jq('.nav-views-view.active')[0] as WebviewTag).getURL();
+ if ($('.nav-views-view').length) {
+ url = ($('.nav-views-view.active')[0] as WebviewTag).getURL();
} else {
url = '';
}
@@ -438,12 +439,12 @@ Navigation.prototype.newTab = function (url, options) {
}
// validate options.id
- jq('.nav-tabs-tab, .nav-views-view').removeClass('active');
- if (jq('#' + options.id).length) {
+ $('.nav-tabs-tab, .nav-views-view').removeClass('active');
+ if ($('#' + options.id).length) {
console.log('ERROR[electron-navigation][func "newTab();"]: The ID "' + options.id + '" already exists. Please use another one.');
return false;
}
- if (!(/^[A-Za-z]+[\w\-\:\.]*jq/.test(options.id))) {
+ if (!(/^[A-Za-z]+[\w\-\:\.]*$/.test(options.id))) {
console.log('ERROR[electron-navigation][func "newTab();"]: The ID "' + options.id + '" is not valid. Please use another one.');
return false;
}
@@ -470,29 +471,29 @@ Navigation.prototype.newTab = function (url, options) {
// finish tab
tab += '';
// add tab to correct position
- if (jq('#nav-body-tabs').has('#nav-tabs-add').length) {
- jq('#nav-tabs-add').before(tab);
+ if ($('#nav-body-tabs').has('#nav-tabs-add').length) {
+ $('#nav-tabs-add').before(tab);
} else {
- jq('#nav-body-tabs').append(tab);
+ $('#nav-body-tabs').append(tab);
}
// add webview
- let composedWebviewTag = ` {
- composedWebviewTag += ` jq{key}="jq{options.webviewAttributes[key]}"`;
+ composedWebviewTag += ` ${key}="${options.webviewAttributes[key]}"`;
});
}
- jq('#nav-body-views').append(`jq{composedWebviewTag}>`);
+ $('#nav-body-views').append(`${composedWebviewTag}>`);
// enable reload button
- jq('#nav-ctrls-reload').removeClass('disabled');
+ $('#nav-ctrls-reload').removeClass('disabled');
// update url and add events
this._updateUrl(this._purifyUrl(url));
@@ -510,10 +511,10 @@ Navigation.prototype.newTab = function (url, options) {
Navigation.prototype.changeTab = function (url, id) {
id = id || null;
if (id == null) {
- jq('.nav-views-view.active').attr('src', this._purifyUrl(url));
+ $('.nav-views-view.active').attr('src', this._purifyUrl(url));
} else {
- if (jq('#' + id).length) {
- jq('#' + id).attr('src', this._purifyUrl(url));
+ if ($('#' + id).length) {
+ $('#' + id).attr('src', this._purifyUrl(url));
} else {
console.log('ERROR[electron-navigation][func "changeTab();"]: Cannot find the ID "' + id + '"');
}
@@ -527,11 +528,11 @@ Navigation.prototype.closeTab = function (id) {
var session;
if (id == null) {
- session = jq('.nav-tabs-tab.active, .nav-views-view.active');
+ session = $('.nav-tabs-tab.active, .nav-views-view.active');
} else {
- if (jq('#' + id).length) {
- var sessionID = jq('#' + id).data('session');
- session = jq('.nav-tabs-tab, .nav-views-view').filter('[data-session="' + sessionID + '"]');
+ if ($('#' + id).length) {
+ var sessionID = $('#' + id).data('session');
+ session = $('.nav-tabs-tab, .nav-views-view').filter('[data-session="' + sessionID + '"]');
} else {
console.log('ERROR[electron-navigation][func "closeTab();"]: Cannot find the ID "' + id + '"');
return false;
@@ -555,10 +556,10 @@ Navigation.prototype.closeTab = function (id) {
Navigation.prototype.back = function (id) {
id = id || null;
if (id == null) {
- (jq('.nav-views-view.active')[0] as WebviewTag).goBack();
+ ($('.nav-views-view.active')[0] as WebviewTag).goBack();
} else {
- if (jq('#' + id).length) {
- (jq('#' + id)[0] as WebviewTag).goBack();
+ if ($('#' + id).length) {
+ ($('#' + id)[0] as WebviewTag).goBack();
} else {
console.log('ERROR[electron-navigation][func "back();"]: Cannot find the ID "' + id + '"');
}
@@ -570,10 +571,10 @@ Navigation.prototype.back = function (id) {
Navigation.prototype.forward = function (id) {
id = id || null;
if (id == null) {
- (jq('.nav-views-view.active')[0] as WebviewTag).goForward();
+ ($('.nav-views-view.active')[0] as WebviewTag).goForward();
} else {
- if (jq('#' + id).length) {
- (jq('#' + id)[0] as WebviewTag).goForward();
+ if ($('#' + id).length) {
+ ($('#' + id)[0] as WebviewTag).goForward();
} else {
console.log('ERROR[electron-navigation][func "forward();"]: Cannot find the ID "' + id + '"');
}
@@ -585,10 +586,10 @@ Navigation.prototype.forward = function (id) {
Navigation.prototype.reload = function (id) {
id = id || null;
if (id == null) {
- (jq('.nav-views-view.active')[0] as WebviewTag).reload();
+ ($('.nav-views-view.active')[0] as WebviewTag).reload();
} else {
- if (jq('#' + id).length) {
- (jq('#' + id)[0] as WebviewTag).reload();
+ if ($('#' + id).length) {
+ ($('#' + id)[0] as WebviewTag).reload();
} else {
console.log('ERROR[electron-navigation][func "reload();"]: Cannot find the ID "' + id + '"');
}
@@ -600,10 +601,10 @@ Navigation.prototype.reload = function (id) {
Navigation.prototype.stop = function (id) {
id = id || null;
if (id == null) {
- (jq('.nav-views-view.active')[0] as WebviewTag).stop();
+ ($('.nav-views-view.active')[0] as WebviewTag).stop();
} else {
- if (jq('#' + id).length) {
- (jq('#' + id)[0] as WebviewTag).stop();
+ if ($('#' + id).length) {
+ ($('#' + id)[0] as WebviewTag).stop();
} else {
console.log('ERROR[electron-navigation][func "stop();"]: Cannot find the ID "' + id + '"');
}
@@ -616,7 +617,7 @@ Navigation.prototype.listen = function (id, callback) {
let webview = null;
//check id
- if (jq('#' + id).length) {
+ if ($('#' + id).length) {
webview = document.getElementById(id);
} else {
console.log('ERROR[electron-navigation][func "listen();"]: Cannot find the ID "' + id + '"');
@@ -644,7 +645,7 @@ Navigation.prototype.send = function (id, channel, args) {
let webview = null;
// check id
- if (jq('#' + id).length) {
+ if ($('#' + id).length) {
webview = document.getElementById(id);
} else {
console.log('ERROR[electron-navigation][func "send();"]: Cannot find the ID "' + id + '"');
@@ -670,9 +671,9 @@ Navigation.prototype.openDevTools = function (id) {
// check id
if (id == null) {
- webview = jq('.nav-views-view.active')[0];
+ webview = $('.nav-views-view.active')[0];
} else {
- if (jq('#' + id).length) {
+ if ($('#' + id).length) {
webview = document.getElementById(id);
} else {
console.log('ERROR[electron-navigation][func "openDevTools();"]: Cannot find the ID "' + id + '"');
@@ -699,9 +700,9 @@ Navigation.prototype.printTab = function (id, opts) {
// check id
if (id == null) {
- webview = jq('.nav-views-view.active')[0]
+ webview = $('.nav-views-view.active')[0]
} else {
- if (jq('#' + id).length) {
+ if ($('#' + id).length) {
webview = document.getElementById(id)
} else {
console.log('ERROR[electron-navigation][func "printTab();"]: Cannot find the ID "' + id + '"')
@@ -718,11 +719,11 @@ Navigation.prototype.printTab = function (id, opts) {
// toggle next available tab
//
Navigation.prototype.nextTab = function () {
- var tabs = jq('.nav-tabs-tab').toArray();
- var activeTabIndex = tabs.indexOf(jq('.nav-tabs-tab.active')[0]);
+ var tabs = $('.nav-tabs-tab').toArray();
+ var activeTabIndex = tabs.indexOf($('.nav-tabs-tab.active')[0]);
var nexti = activeTabIndex + 1;
if (nexti > tabs.length - 1) nexti = 0;
- jq(jq('.nav-tabs-tab')[nexti]).trigger('click');
+ $($('.nav-tabs-tab')[nexti]).trigger('click');
return false
} //:nextTab()
//:prevTab()
@@ -730,33 +731,33 @@ Navigation.prototype.nextTab = function () {
// toggle previous available tab
//
Navigation.prototype.prevTab = function () {
- var tabs = jq('.nav-tabs-tab').toArray();
- var activeTabIndex = tabs.indexOf(jq('.nav-tabs-tab.active')[0]);
+ var tabs = $('.nav-tabs-tab').toArray();
+ var activeTabIndex = tabs.indexOf($('.nav-tabs-tab.active')[0]);
var nexti = activeTabIndex - 1;
if (nexti < 0) nexti = tabs.length - 1;
- jq(jq('.nav-tabs-tab')[nexti]).trigger('click');
+ $($('.nav-tabs-tab')[nexti]).trigger('click');
return false
} //:prevTab()
// go to a tab by index or keyword
//
Navigation.prototype.goToTab = function (index) {
- let jqactiveTabAndView = jq('#nav-body-tabs .nav-tabs-tab.active, #nav-body-views .nav-views-view.active');
- let jqtabAndViewToActivate;
+ let $activeTabAndView = $('#nav-body-tabs .nav-tabs-tab.active, #nav-body-views .nav-views-view.active');
+ let $tabAndViewToActivate;
if (index == 'previous') {
- jqtabAndViewToActivate = jqactiveTabAndView.prev('#nav-body-tabs .nav-tabs-tab, #nav-body-views .nav-views-view');
+ $tabAndViewToActivate = $activeTabAndView.prev('#nav-body-tabs .nav-tabs-tab, #nav-body-views .nav-views-view');
} else if (index == 'next') {
- jqtabAndViewToActivate = jqactiveTabAndView.next('#nav-body-tabs .nav-tabs-tab, #nav-body-views .nav-views-view');
+ $tabAndViewToActivate = $activeTabAndView.next('#nav-body-tabs .nav-tabs-tab, #nav-body-views .nav-views-view');
} else if (index == 'last') {
- jqtabAndViewToActivate = jq('#nav-body-tabs .nav-tabs-tab:last-of-type, #nav-body-views .nav-views-view:last-of-type');
+ $tabAndViewToActivate = $('#nav-body-tabs .nav-tabs-tab:last-of-type, #nav-body-views .nav-views-view:last-of-type');
} else {
- jqtabAndViewToActivate = jq('#nav-body-tabs .nav-tabs-tab:nth-of-type(' + index + '), #nav-body-views .nav-views-view:nth-of-type(' + index + ')');
+ $tabAndViewToActivate = $('#nav-body-tabs .nav-tabs-tab:nth-of-type(' + index + '), #nav-body-views .nav-views-view:nth-of-type(' + index + ')');
}
- if (jqtabAndViewToActivate.length) {
- jq('#nav-ctrls-url').blur();
- jqactiveTabAndView.removeClass('active');
- jqtabAndViewToActivate.addClass('active');
+ if ($tabAndViewToActivate.length) {
+ $('#nav-ctrls-url').blur();
+ $activeTabAndView.removeClass('active');
+ $tabAndViewToActivate.addClass('active');
this._updateUrl();
this._updateCtrls();
diff --git a/modules/core/url-preview/index.ts b/modules/core/url-preview/index.ts
index b1b6401..b2e32cd 100644
--- a/modules/core/url-preview/index.ts
+++ b/modules/core/url-preview/index.ts
@@ -42,7 +42,7 @@ export async function open_preview(url: string) {
global_window.setMenuBarVisibility(false);
global_window.setMenu(null);
global_window.loadFile(path.join(__dirname, "html", "index.html")).then(() => {
- global_window.webContents.openDevTools();
+ //global_window.webContents.openDevTools();
});
global_window.on('close', event => {
global_window = undefined;
diff --git a/package.json b/package.json
index 10afb5c..f6a6407 100644
--- a/package.json
+++ b/package.json
@@ -10,7 +10,8 @@
"start-d": "electron . --disable-hardware-acceleration --debug -t -u http://clientapi.teaspeak.dev/",
"start-wd": "electron . --disable-hardware-acceleration --debug -t -s -u http://localhost/TeaWeb/client-api/environment/",
"start-d1": "electron . --disable-hardware-acceleration --debug -t --gdb -s -u=http://clientapi.teaspeak.dev/ --updater-ui-loader_type=0",
- "start-n": "electron . -t --disable-hardware-acceleration --no-single-instance -u=https://clientapi.teaspeak.de/ -d --updater-ui-loader_type=0",
+ "start-n": "electron . -t --disable-hardware-acceleration --no-single-instance -u=https://clientapi.teaspeak.de/ -d",
+ "start-nd": "electron . -t --disable-hardware-acceleration --no-single-instance -u=http://clientapi.teaspeak.dev/ -d",
"start-01": "electron . --updater-channel=test -u=http://dev.clientapi.teaspeak.de/ -d --updater-ui-loader_type=0 --updater-local-version=1.0.1",
"start-s": "electron . --disable-hardware-acceleration --debug --updater-ui-ignore-version -t -u http://localhost:8081/",
"dtest": "electron . dtest",