Sha256: 73e1aa19b6793fdb9dbf98ed4a5546d9b9a176c7920afbb60826546a43cac75c

Contents?: true

Size: 1.1 KB

Versions: 7

Compression:

Stored size: 1.1 KB

Contents

const atomeCommunication = {
    controller_sender: function (msg) {
        var json_msg = JSON.parse(msg);

        if (window.webkit) {
            try {
                window.webkit.messageHandlers.toggleMessageHandler.postMessage(json_msg);
            } catch (error) {
                console.log('no server, unable to post message')
            }

        } else {
            try {
                window.chrome.webview.postMessage(json_msg);
            } catch (error) {
                console.log('no server, unable to post message')
            }
        }
    },
    controller_listener: function () {
        if (window.webkit) {
            try {
                ///
            } catch (error) {
                console.log('no server, unable to receive message')
            }
        } else {

            try {
                window.chrome.webview.addEventListener('message', arg => {
                    Opal.Object.$response_listener(arg.data)
                });
            } catch (error) {
                console.log('no server, unable to receive message')
            }


        }
    },
}

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
atome-0.5.4.1.9 vendor/assets/src/js/atome/atome_helpers/atome_communication.js
atome-0.5.4.1.7 vendor/assets/src/js/atome/atome_helpers/atome_communication.js
atome-0.5.4.1.3 vendor/assets/src/js/atome/atome_helpers/atome_communication.js
atome-0.5.4.1.2 vendor/assets/src/js/atome/atome_helpers/atome_communication.js
atome-0.5.4.1.1 vendor/assets/src/js/atome/atome_helpers/atome_communication.js
atome-0.5.4.1.0 vendor/assets/src/js/atome/atome_helpers/atome_communication.js
atome-0.5.4.0.9 vendor/assets/src/js/atome/atome_helpers/atome_communication.js