From 42a14b8a09d812dbd7d1b05f145e6881376f320b Mon Sep 17 00:00:00 2001 From: obscuren Date: Sat, 20 Jun 2015 14:37:00 +0200 Subject: mist: R.I.P. /"""""/""""""". / / \ __ / / \ || /____ / \ || | | In Loving | || | | Memory | || | | | || | | 2014-2015 | || | | * * * * | _||_ | | *\/* *\/* | | TT | | | *_\_ / ...""""""| || |.""....""""""""."" | | \/.."""""..."""\ || /.""".......""""... | |...."""""""........""""""^^^^"......."""""""".." |......"""""""""""""""........"""""...."""""..""-Jeff W. --- cmd/mist/assets/muted/muted.js | 78 ------------------------------------------ 1 file changed, 78 deletions(-) delete mode 100644 cmd/mist/assets/muted/muted.js (limited to 'cmd/mist/assets/muted/muted.js') diff --git a/cmd/mist/assets/muted/muted.js b/cmd/mist/assets/muted/muted.js deleted file mode 100644 index 467411577..000000000 --- a/cmd/mist/assets/muted/muted.js +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) 2013-2014, Jeffrey Wilcke. All rights reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this library; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, -// MA 02110-1301 USA - -// Helper function for generating pseudo callbacks and sending data to the QML part of the application -function postData(data, cb) { - data._seed = Math.floor(Math.random() * 1000000) - if(cb) { - Muted._callbacks[data._seed] = cb; - } - - if(data.args === undefined) { - data.args = []; - } - - navigator.qt.postMessage(JSON.stringify(data)); -} - -window.Muted = { - prototype: Object(), -} - -window.Muted._callbacks = {} -window.Muted._onCallbacks = {} - -function debug(/**/) { - console.log("hello world") - - var args = arguments; - var msg = "" - for(var i = 0; i < args.length; i++){ - if(typeof args[i] == "object") { - msg += " " + JSON.stringify(args[i]) - } else { - msg += args[i] - } - } - - document.querySelector("#debugger").innerHTML += "
"+msg+"
"; -} -console.log = function() { - var args = [] - for(var i = 0; i < arguments.length; i++) { - args.push(arguments[i]); - } - postData({call:"log", args:args}) -} - -navigator.qt.onmessage = function(ev) { - var data = JSON.parse(ev.data) - - if(data._event !== undefined) { - Muted.trigger(data._event, data.data); - } else { - if(data._seed) { - var cb = Muted._callbacks[data._seed]; - if(cb) { - // Call the callback - cb(data.data); - // Remove the "trigger" callback - delete Muted._callbacks[ev._seed]; - } - } - } -} -- cgit v1.2.3