[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Gavin D. Smith |
Date: |
Wed, 30 Nov 2022 13:36:38 -0500 (EST) |
branch: old/qt-info
commit 2448e61518b434e121931fb2e8610ae11d147c86
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Thu Apr 11 21:51:15 2019 +0100
* js/info.js: Remove section at end dealing with QWebChannel,
and place in a new file (js/docbrowser/qtinfo.js).
---
ChangeLog | 5 ++++
js/info.js | 95 --------------------------------------------------------------
2 files changed, 5 insertions(+), 95 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 0b6f478d23..e1d47b2bd7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2019-04-11 Gavin Smith <gavinsmith0123@gmail.com>
+
+ * js/info.js: Remove section at end dealing with QWebChannel,
+ and place in a new file (js/docbrowser/qtinfo.js).
+
2019-04-11 Gavin Smith <gavinsmith0123@gmail.com>
Add wc_controlled conditional.
diff --git a/js/info.js b/js/info.js
index 020da8fc54..ad1b511e6d 100644
--- a/js/info.js
+++ b/js/info.js
@@ -2098,98 +2098,3 @@ init ();
// } (window["Modernizr"], window["INFO_CONFIG"]));
/* See comment at top of file */
-
-
-/*----------------------------------.
-| For communication with Qt process |
-`----------------------------------*/
-
-/* object shared with controlling Qt/C++ process */
-var core;
-
-/* Whether we are being controlled via a QWebChannel, and the JavaScript is
- being injected into the HTML pages. Try to keep the use of this
conditional
- to a minimum. */
-var wc_controlled = 0;
-
-/* For use with QWebChannel. To be called after qwebchannel.js has been
- loaded. */
-function wc_init()
-{
- wc_controlled = 1;
-
- if (location.search != "")
- var baseUrl
- =
(/[?&]webChannelBaseUrl=([A-Za-z0-9\-:/\.]+)/.exec(location.search)[1]);
- else
- var baseUrl = "ws://localhost:12345";
-
- var socket = new WebSocket(baseUrl);
-
- socket.onclose = function()
- {
- console.error("web channel closed");
- };
-
- socket.onerror = function(error)
- {
- console.error("web channel error: " + error);
- };
-
- socket.onopen = function()
- {
- new QWebChannel(socket, function(channel)
- {
- window.core = channel.objects.core;
-
- /* Receive signals from Qt/C++ side.
-
- We don't have code to receive "actions" from the C++ side:
- the action message-passing architecture is only used to
- circumvent same-origin policy restrictions on some browsers for
- file: URI's. */
-
- channel.objects.core.setUrl.connect(function(url) {
- alert("asked to go to " + url);
- });
-
- channel.objects.core.set_current_url.connect(function(linkid) {
- store.dispatch (actions.set_current_url (linkid));
- });
- });
- };
-
- var store_dispatch = Store.prototype.dispatch;
- Store.prototype.dispatch = function (action)
- {
- if (!web_channel_override (this, action))
- store_dispatch.call (this, action);
- };
- /* Overriding just the dispatch function works better than
- assigining 'store' to a different object, as store.state
- is used as well. */
-}
-
-
-/* Return true if the standard function doesn't need to be called. */
-function web_channel_override (store, action)
-{
- switch (action.type)
- {
- case "external-manual":
- {
- window.core.external_manual (action.url);
- return 1;
- }
- case "input":
- {
- if (action.input == "index")
- window.core.show_text_input (action.input, store.state.index);
- return 1;
- }
- default:
- {
- return 0;
- }
- }
-}
- branch old/qt-info created (now e2d72c0f4f), Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject],
Gavin D. Smith <=
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30