61 lines
193 KiB
JavaScript
61 lines
193 KiB
JavaScript
|
/*
|
||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||
|
* or more contributor license agreements. See the NOTICE file
|
||
|
* distributed with this work for additional information
|
||
|
* regarding copyright ownership. The ASF licenses this file
|
||
|
* to you under the Apache License, Version 2.0 (the
|
||
|
* "License"); you may not use this file except in compliance
|
||
|
* with the License. You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing,
|
||
|
* software distributed under the License is distributed on an
|
||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||
|
* KIND, either express or implied. See the License for the
|
||
|
* specific language governing permissions and limitations
|
||
|
* under the License.
|
||
|
*/
|
||
|
;(function(){
|
||
|
;eval("/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n//----------------------------------------------------------------------------\n// an implementation of the require() function as specified for use with\n// CommonJS Modules - see http://commonjs.org/specs/modules/1.0.html\n//----------------------------------------------------------------------------\n\n//----------------------------------------------------------------------------\n// inspired from David Flanagan's require() function documented here:\n// http://www.davidflanagan.com/2009/11/a-module-loader.html\n//----------------------------------------------------------------------------\n\n//----------------------------------------------------------------------------\n// only supports \"preloaded\" modules ala define() (AMD)\n// http://wiki.commonjs.org/wiki/Modules/AsynchronousDefinition\n// but the id parameter is required\n//----------------------------------------------------------------------------\n\n//----------------------------------------------------------------------------\n// function wrapper\n//----------------------------------------------------------------------------\n(function(){\n\n//----------------------------------------------------------------------------\n// some constants\n//----------------------------------------------------------------------------\nvar PROGRAM = \"modjewel\"\nvar VERSION = \"2.0.0\"\nvar global = this\n\n//----------------------------------------------------------------------------\n// if require() is already defined, leave\n//----------------------------------------------------------------------------\nif (global.modjewel) {\n log(\"modjewel global variable already defined\")\n return\n}\n\nglobal.modjewel = null\n\n//----------------------------------------------------------------------------\n// \"globals\" (local to this function scope though)\n//----------------------------------------------------------------------------\nvar ModuleStore\nvar ModulePreloadStore\nvar MainModule\nvar WarnOnRecursiveRequire = false\n\n//----------------------------------------------------------------------------\n// the require function\n//----------------------------------------------------------------------------\nfunction get_require(currentModule) {\n var result = function require(moduleId) {\n\n if (moduleId.match(/^\\.{1,2}\\//)) {\n moduleId = normalize(currentModule, moduleId)\n }\n\n if (hop(ModuleStore, moduleId)) {\n var module = ModuleStore[moduleId]\n if (module.__isLoading) {\n if (WarnOnRecursiveRequire) {\n var fromModule = currentModule ? currentModule.id : \"<root>\"\n console.log(\"module '\" + moduleId + \"' recursively require()d from '\" + fromModule + \"', problem?\")\n }\n }\n\n currentModule.moduleIdsRequired.push(moduleId)\n\n return module.exports\n }\n\n if (!hop(ModulePreloadStore, moduleId)) {\n var fromModule = currentModule ? currentModule.id : \"<root>\"\n error(\"module '\" + moduleId + \"' not found from '\" + fromModule + \"', must be define()'d first\")\n }\n\n var factory = ModulePreloadStore[moduleId][0]\n
|
||
|
modjewel.require('modjewel').warnOnRecursiveRequire(true);
|
||
|
;eval(";modjewel.define(\"weinre/common/Binding\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar Binding, Ex;\n\nEx = require('./Ex');\n\nmodule.exports = Binding = (function() {\n function Binding(receiver, method) {\n if (!receiver) {\n throw new Ex(arguments, \"receiver argument for Binding constructor was null\");\n }\n if (typeof method === \"string\") {\n method = receiver[method];\n }\n if (typeof method === !\"function\") {\n throw new Ex(arguments, \"method argument didn't specify a function\");\n }\n return function() {\n return method.apply(receiver, [].slice.call(arguments));\n };\n }\n\n return Binding;\n\n})();\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n\n//@ sourceURL=weinre/common/Binding.amd.js")
|
||
|
;eval(";modjewel.define(\"weinre/common/Callback\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar Callback, CallbackIndex, CallbackTable, ConnectorChannel, Ex;\n\nEx = require('./Ex');\n\nCallbackTable = {};\n\nCallbackIndex = 1;\n\nConnectorChannel = \"???\";\n\nmodule.exports = Callback = (function() {\n function Callback() {\n throw new Ex(arguments, \"this class is not intended to be instantiated\");\n }\n\n Callback.setConnectorChannel = function(connectorChannel) {\n return ConnectorChannel = \"\" + connectorChannel;\n };\n\n Callback.register = function(callback) {\n var data, func, index, receiver;\n if (typeof callback === \"function\") {\n callback = [null, callback];\n }\n if (typeof callback.slice !== \"function\") {\n throw new Ex(arguments, \"callback must be an array or function\");\n }\n receiver = callback[0];\n func = callback[1];\n data = callback.slice(2);\n if (typeof func === \"string\") {\n func = receiver[func];\n }\n if (typeof func !== \"function\") {\n throw new Ex(arguments, \"callback function was null or not found\");\n }\n index = ConnectorChannel + \"::\" + CallbackIndex;\n CallbackIndex++;\n if (CallbackIndex >= 65536 * 65536) {\n CallbackIndex = 1;\n }\n CallbackTable[index] = [receiver, func, data];\n return index;\n };\n\n Callback.deregister = function(index) {\n return delete CallbackTable[index];\n };\n\n Callback.invoke = function(index, args) {\n var callback, e, func, funcName, receiver;\n callback = CallbackTable[index];\n if (!callback) {\n throw new Ex(arguments, \"callback \" + index + \" not registered or already invoked\");\n }\n receiver = callback[0];\n func = callback[1];\n args = callback[2].concat(args);\n try {\n return func.apply(receiver, args);\n } catch (_error) {\n e = _error;\n funcName = func.name || func.signature;\n if (!funcName) {\n funcName = \"<unnamed>\";\n }\n return require(\"./Weinre\").logError(arguments.callee.signature + (\" exception invoking callback: \" + funcName + \"(\" + (args.join(',')) + \"): \") + e);\n } finally {\n Callback.deregister(index);\n }\n };\n\n return Callback;\n\n})();\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n\n//@ sourceURL=weinre/common/Callback.amd.js")
|
||
|
;eval(";modjewel.define(\"weinre/common/Debug\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar Debug;\n\nmodule.exports = new (Debug = (function() {\n function Debug() {\n this._printCalledArgs = {};\n }\n\n Debug.prototype.log = function(message) {\n var console;\n console = window.console.__original || window.console;\n return console.log(\"\" + (this.timeStamp()) + \": \" + message);\n };\n\n Debug.prototype.logCall = function(context, intf, method, args, message) {\n var printArgs, signature;\n if (message) {\n message = \": \" + message;\n } else {\n message = \"\";\n }\n signature = this.signature(intf, method);\n printArgs = this._printCalledArgs[signature];\n if (printArgs) {\n args = JSON.stringify(args, null, 4);\n } else {\n args = \"\";\n }\n return this.log(\"\" + context + \" \" + signature + \"(\" + args + \")\" + message);\n };\n\n Debug.prototype.logCallArgs = function(intf, method) {\n return this._printCalledArgs[this.signature(intf, method)] = true;\n };\n\n Debug.prototype.signature = function(intf, method) {\n return \"\" + intf + \".\" + method;\n };\n\n Debug.prototype.timeStamp = function() {\n var date, mins, secs;\n date = new Date();\n mins = \"\" + (date.getMinutes());\n secs = \"\" + (date.getSeconds());\n if (mins.length === 1) {\n mins = \"0\" + mins;\n }\n if (secs.length === 1) {\n secs = \"0\" + secs;\n }\n return \"\" + mins + \":\" + secs;\n };\n\n return Debug;\n\n})());\n\n});\n\n//@ sourceURL=weinre/common/Debug.amd.js")
|
||
|
;eval(";modjewel.define(\"weinre/common/EventListeners\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar EventListeners, Ex, Weinre;\n\nEx = require('./Ex');\n\nWeinre = require('./Weinre');\n\nmodule.exports = EventListeners = (function() {\n function EventListeners() {\n this.listeners = [];\n }\n\n EventListeners.prototype.add = function(listener, useCapture) {\n return this.listeners.push([listener, useCapture]);\n };\n\n EventListeners.prototype.remove = function(listener, useCapture) {\n var listeners, _i, _len, _listener;\n listeners = this.listeners.slice();\n for (_i = 0, _len = listeners.length; _i < _len; _i++) {\n _listener = listeners[_i];\n if (_listener[0] !== listener) {\n continue;\n }\n if (_listener[1] !== useCapture) {\n continue;\n }\n this._listeners.splice(i, 1);\n return;\n }\n };\n\n EventListeners.prototype.fire = function(event) {\n var e, listener, listeners, _i, _len, _results;\n listeners = this.listeners.slice();\n _results = [];\n for (_i = 0, _len = listeners.length; _i < _len; _i++) {\n listener = listeners[_i];\n listener = listener[0];\n if (typeof listener === \"function\") {\n try {\n listener.call(null, event);\n } catch (_error) {\n e = _error;\n Weinre.logError(\"\" + arguments.callee.name + \" invocation exception: \" + e);\n }\n continue;\n }\n if (typeof (listener != null ? listener.handleEvent : void 0) !== \"function\") {\n throw new Ex(arguments, \"listener does not implement the handleEvent() method\");\n }\n try {\n _results.push(listener.handleEvent.call(listener, event));\n } catch (_error) {\n e = _error;\n _results.push(Weinre.logError(\"\" + arguments.callee.name + \" invocation exception: \" + e));\n }\n }\n return _results;\n };\n\n return EventListeners;\n\n})();\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n\n//@ sourceURL=weinre/common/EventListeners.amd.js")
|
||
|
;eval(";modjewel.define(\"weinre/common/Ex\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar Ex, StackTrace, prefix;\n\nStackTrace = require('./StackTrace');\n\nmodule.exports = Ex = (function() {\n Ex.catching = function(func) {\n var e;\n try {\n return func.call(this);\n } catch (_error) {\n e = _error;\n console.log(\"runtime error: \" + e);\n return StackTrace.dump(arguments);\n }\n };\n\n function Ex(args, message) {\n if (!args || !args.callee) {\n throw Ex(arguments, \"first parameter must be an Arguments object\");\n }\n StackTrace.dump(args);\n if (message instanceof Error) {\n message = \"threw error: \" + message;\n }\n message = prefix(args, message);\n message;\n }\n\n return Ex;\n\n})();\n\nprefix = function(args, string) {\n if (args.callee.signature) {\n return args.callee.signature + \": \" + string;\n }\n if (args.callee.displayName) {\n return args.callee.displayName + \": \" + string;\n }\n if (args.callee.name) {\n return args.callee.name + \": \" + string;\n }\n return \"<anonymous>\" + \": \" + string;\n};\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n\n//@ sourceURL=weinre/common/Ex.amd.js")
|
||
|
;eval(";modjewel.define(\"weinre/common/HookLib\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar HookLib, HookSite, HookSites, IgnoreHooks, callAfterHooks, callBeforeHooks, callExceptHooks, getHookSite, getHookedFunction;\n\nHookLib = exports;\n\nHookSites = [];\n\nIgnoreHooks = 0;\n\nmodule.exports = HookLib = (function() {\n function HookLib() {}\n\n HookLib.addHookSite = function(object, property) {\n return getHookSite(object, property, true);\n };\n\n HookLib.getHookSite = function(object, property) {\n return getHookSite(object, property, false);\n };\n\n HookLib.ignoreHooks = function(func) {\n var result;\n try {\n IgnoreHooks++;\n result = func.call();\n } finally {\n IgnoreHooks--;\n }\n return result;\n };\n\n return HookLib;\n\n})();\n\ngetHookSite = function(object, property, addIfNotFound) {\n var hookSite, i, _i, _len;\n i = 0;\n for (_i = 0, _len = HookSites.length; _i < _len; _i++) {\n hookSite = HookSites[_i];\n if (hookSite.object !== object) {\n continue;\n }\n if (hookSite.property !== property) {\n continue;\n }\n return hookSite;\n }\n if (!addIfNotFound) {\n return null;\n }\n hookSite = new HookSite(object, property);\n HookSites.push(hookSite);\n return hookSite;\n};\n\nHookSite = (function() {\n function HookSite(object, property) {\n var hookedFunction;\n this.object = object;\n this.property = property;\n this.target = object[property];\n this.hookss = [];\n if (typeof this.target === 'undefined') {\n return;\n } else {\n hookedFunction = getHookedFunction(this.target, this);\n if (!(navigator.userAgent.match(/MSIE/i) && (object === localStorage || object === sessionStorage))) {\n object[property] = hookedFunction;\n }\n }\n }\n\n HookSite.prototype.addHooks = function(hooks) {\n return this.hookss.push(hooks);\n };\n\n HookSite.prototype.removeHooks = function(hooks) {\n var i, _i, _ref;\n for (i = _i = 0, _ref = this.hookss.length; 0 <= _ref ? _i <= _ref : _i >= _ref; i = 0 <= _ref ? ++_i : --_i) {\n if (this.hookss[i] === hooks) {\n this.hookss.splice(i, 1);\n return;\n }\n }\n };\n\n return HookSite;\n\n})();\n\ngetHookedFunction = function(func, hookSite) {\n var hookedFunction;\n hookedFunction = function() {\n var e, result;\n callBeforeHooks(hookSite, this, arguments);\n try {\n result = func.apply(this, arguments);\n } catch (_error) {\n e = _error;\n callExceptHooks(hookSite, this, arguments, e);\n throw e;\n } finally {\n callAfterHooks(hookSite, this, arguments, result);\n }\n return result;\n };\n hookedFunction.displayName = func.displayName || func.name;\n return hookedFunction;\n};\n\ncallBeforeHooks = function(hookSite, receiver, args) {\n var hooks, _i, _len, _ref, _results;\n if (IgnoreHooks > 0) {\n return;\n }\n _ref = hookSite.hookss;\n _results = [];\n for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n hooks = _ref[_i];\n if (hooks.before) {\n _results.push(hooks.before.call(hooks, receiver, args));\n } else {\n _results.push(void 0);\n }\n }\n return _results;\n};\n\ncallAfterHooks = function(hookSite, receiver, args, result) {\n var hooks, _i, _len, _ref, _results;\n if (IgnoreHooks > 0) {\n return;\n }\n _ref = hookSite.hookss;\n _results = [];\n for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n hooks = _ref[_i];\n if (hooks.after) {\n _results.push(hooks.after.call(hooks, receiver, args, result));\n } else {\n _results.push(void 0);\n }\n }\n return _results;\n};\n\ncallExceptHooks = function(hookSite, receiver, args, e) {\n var hooks, _i, _len, _ref, _results;\n if (IgnoreHooks > 0) {\n return;\n }\n _ref = hookSite.hookss;\n _results = [];\n for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n hooks = _ref[_i];\n if (hooks.except) {\n _results.push(hooks.except.call(hooks, receiver, args, e));\n } else {\n _
|
||
|
;eval(";modjewel.define(\"weinre/common/IDGenerator\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar IDGenerator, idName, nextId, nextIdValue;\n\nnextIdValue = 1;\n\nidName = \"__weinre__id\";\n\nmodule.exports = IDGenerator = (function() {\n function IDGenerator() {}\n\n IDGenerator.checkId = function(object) {\n return object[idName];\n };\n\n IDGenerator.getId = function(object, map) {\n var id;\n id = IDGenerator.checkId(object);\n if (!id) {\n id = nextId();\n object[idName] = id;\n }\n if (map) {\n map[id] = object;\n }\n return id;\n };\n\n IDGenerator.next = function() {\n return nextId();\n };\n\n return IDGenerator;\n\n})();\n\nnextId = function() {\n var result;\n result = nextIdValue;\n nextIdValue += 1;\n return result;\n};\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n\n//@ sourceURL=weinre/common/IDGenerator.amd.js")
|
||
|
;eval(";modjewel.define(\"weinre/common/IDLTools\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar Callback, Ex, IDLTools, IDLs, getProxyMethod;\n\nEx = require('./Ex');\n\nCallback = require('./Callback');\n\nIDLs = {};\n\nmodule.exports = IDLTools = (function() {\n function IDLTools() {\n throw new Ex(arguments, \"this class is not intended to be instantiated\");\n }\n\n IDLTools.addIDLs = function(idls) {\n var idl, intf, _i, _len, _results;\n _results = [];\n for (_i = 0, _len = idls.length; _i < _len; _i++) {\n idl = idls[_i];\n _results.push((function() {\n var _j, _len1, _ref, _results1;\n _ref = idl.interfaces;\n _results1 = [];\n for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) {\n intf = _ref[_j];\n IDLs[intf.name] = intf;\n _results1.push(intf.module = idl.name);\n }\n return _results1;\n })());\n }\n return _results;\n };\n\n IDLTools.getIDL = function(name) {\n return IDLs[name];\n };\n\n IDLTools.getIDLsMatching = function(regex) {\n var intf, intfName, results;\n results = [];\n for (intfName in IDLs) {\n intf = IDLs[intfName];\n if (intfName.match(regex)) {\n results.push(intf);\n }\n }\n return results;\n };\n\n IDLTools.validateAgainstIDL = function(klass, interfaceName) {\n var classMethod, error, errors, intf, intfMethod, messagePrefix, printName, propertyName, _i, _j, _len, _len1, _ref, _results;\n intf = IDLTools.getIDL(interfaceName);\n messagePrefix = \"IDL validation for \" + interfaceName + \": \";\n if (null === intf) {\n throw new Ex(arguments, messagePrefix + (\"idl not found: '\" + interfaceName + \"'\"));\n }\n errors = [];\n _ref = intf.methods;\n for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n intfMethod = _ref[_i];\n classMethod = klass.prototype[intfMethod.name];\n printName = klass.name + \"::\" + intfMethod.name;\n if (null === classMethod) {\n errors.push(messagePrefix + (\"method not implemented: '\" + printName + \"'\"));\n continue;\n }\n if (classMethod.length !== intfMethod.parameters.length) {\n if (classMethod.length !== intfMethod.parameters.length + 1) {\n errors.push(messagePrefix + (\"wrong number of parameters: '\" + printName + \"'\"));\n continue;\n }\n }\n }\n for (propertyName in klass.prototype) {\n if (klass.prototype.hasOwnProperty(propertyName)) {\n continue;\n }\n if (propertyName.match(/^_.*/)) {\n continue;\n }\n printName = klass.name + \"::\" + propertyName;\n if (!intf.methods[propertyName]) {\n errors.push(messagePrefix + (\"method should not be implemented: '\" + printName + \"'\"));\n continue;\n }\n }\n if (!errors.length) {\n return;\n }\n _results = [];\n for (_j = 0, _len1 = errors.length; _j < _len1; _j++) {\n error = errors[_j];\n _results.push(require(\"./Weinre\").logError(error));\n }\n return _results;\n };\n\n IDLTools.buildProxyForIDL = function(proxyObject, interfaceName) {\n var intf, intfMethod, messagePrefix, _i, _len, _ref, _results;\n intf = IDLTools.getIDL(interfaceName);\n messagePrefix = \"building proxy for IDL \" + interfaceName + \": \";\n if (null === intf) {\n throw new Ex(arguments, messagePrefix + (\"idl not found: '\" + interfaceName + \"'\"));\n }\n _ref = intf.methods;\n _results = [];\n for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n intfMethod = _ref[_i];\n _results.push(proxyObject[intfMethod.name] = getProxyMethod(intf, intfMethod));\n }\n return _results;\n };\n\n return IDLTools;\n\n})();\n\ngetProxyMethod = function(intf, method) {\n var proxyMethod, result;\n result = proxyMethod = function() {\n var args, callbackId;\n callbackId = null;\n args = [].slice.call(arguments);\n if (args.length > 0) {\n if (typeof args[args.length - 1] === \"function
|
||
|
;eval(";modjewel.define(\"weinre/common/MessageDispatcher\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar Binding, Callback, Ex, IDLTools, InspectorBackend, MessageDispatcher, Verbose, WebSocketXhr, Weinre,\n __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };\n\nWeinre = require('./Weinre');\n\nWebSocketXhr = require('./WebSocketXhr');\n\nIDLTools = require('./IDLTools');\n\nBinding = require('./Binding');\n\nEx = require('./Ex');\n\nCallback = require('./Callback');\n\nVerbose = false;\n\nInspectorBackend = null;\n\nmodule.exports = MessageDispatcher = (function() {\n function MessageDispatcher(url, id) {\n if (!id) {\n id = \"anonymous\";\n }\n this._url = url;\n this._id = id;\n this.error = null;\n this._opening = false;\n this._opened = false;\n this._closed = false;\n this._interfaces = {};\n this._open();\n }\n\n MessageDispatcher.setInspectorBackend = function(inspectorBackend) {\n return InspectorBackend = inspectorBackend;\n };\n\n MessageDispatcher.verbose = function(value) {\n if (arguments.length >= 1) {\n Verbose = !!value;\n }\n return Verbose;\n };\n\n MessageDispatcher.prototype._open = function() {\n if (this._opened || this._opening) {\n return;\n }\n if (this._closed) {\n throw new Ex(arguments, \"socket has already been closed\");\n }\n this._opening = true;\n this._socket = new WebSocketXhr(this._url, this._id);\n this._socket.addEventListener(\"open\", Binding(this, \"_handleOpen\"));\n this._socket.addEventListener(\"error\", Binding(this, \"_handleError\"));\n this._socket.addEventListener(\"message\", Binding(this, \"_handleMessage\"));\n return this._socket.addEventListener(\"close\", Binding(this, \"_handleClose\"));\n };\n\n MessageDispatcher.prototype.close = function() {\n if (this._closed) {\n return;\n }\n this._opened = false;\n this._closed = true;\n return this._socket.close();\n };\n\n MessageDispatcher.prototype.send = function(data) {\n return this._socket.send(data);\n };\n\n MessageDispatcher.prototype.getWebSocket = function() {\n return this._socket;\n };\n\n MessageDispatcher.prototype.registerInterface = function(intfName, intf, validate) {\n if (validate) {\n IDLTools.validateAgainstIDL(intf.constructor, intfName);\n }\n if (this._interfaces[intfName]) {\n throw new Ex(arguments, \"interface \" + intfName + \" has already been registered\");\n }\n return this._interfaces[intfName] = intf;\n };\n\n MessageDispatcher.prototype.createProxy = function(intfName) {\n var proxy, self, __invoke;\n proxy = {};\n IDLTools.buildProxyForIDL(proxy, intfName);\n self = this;\n proxy.__invoke = __invoke = function(intfName, methodName, args) {\n return self._sendMethodInvocation(intfName, methodName, args);\n };\n return proxy;\n };\n\n MessageDispatcher.prototype._sendMethodInvocation = function(intfName, methodName, args) {\n var data;\n if (typeof intfName !== \"string\") {\n throw new Ex(arguments, \"expecting intf parameter to be a string\");\n }\n if (typeof methodName !== \"string\") {\n throw new Ex(arguments, \"expecting method parameter to be a string\");\n }\n data = {\n \"interface\": intfName,\n method: methodName,\n args: args\n };\n data = JSON.stringify(data);\n this._socket.send(data);\n if (Verbose) {\n return Weinre.logDebug(this.constructor.name + (\"[\" + this._url + \"]: send \" + intfName + \".\" + methodName + \"(\" + (JSON.stringify(args)) + \")\"));\n }\n };\n\n MessageDispatcher.prototype.getState = function() {\n if (this._opening) {\n return \"opening\";\n }\n if (this._opened) {\n return \"opened\";\n }\n if (this._closed) {\n return \"closed\";\n }\n return \"unknown\";\n };\n\n MessageDispatcher.prototype.isOpen = function() {\n return thi
|
||
|
;eval(";modjewel.define(\"weinre/common/MethodNamer\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar MethodNamer,\n __hasProp = {}.hasOwnProperty;\n\nmodule.exports = MethodNamer = (function() {\n function MethodNamer() {}\n\n MethodNamer.setNamesForClass = function(aClass) {\n var key, val, _ref, _results;\n for (key in aClass) {\n if (!__hasProp.call(aClass, key)) continue;\n val = aClass[key];\n if (typeof val === \"function\") {\n val.signature = \"\" + aClass.name + \"::\" + key;\n val.displayName = key;\n val.name = key;\n }\n }\n _ref = aClass.prototype;\n _results = [];\n for (key in _ref) {\n if (!__hasProp.call(_ref, key)) continue;\n val = _ref[key];\n if (typeof val === \"function\") {\n val.signature = \"\" + aClass.name + \".\" + key;\n val.displayName = key;\n _results.push(val.name = key);\n } else {\n _results.push(void 0);\n }\n }\n return _results;\n };\n\n return MethodNamer;\n\n})();\n\nMethodNamer.setNamesForClass(module.exports);\n\n});\n\n//@ sourceURL=weinre/common/MethodNamer.amd.js")
|
||
|
;eval(";modjewel.define(\"weinre/common/StackTrace\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar StackTrace, getTrace;\n\nmodule.exports = StackTrace = (function() {\n function StackTrace(args) {\n if (!args || !args.callee) {\n throw Error(\"first parameter to \" + arguments.callee.signature + \" must be an Arguments object\");\n }\n this.trace = getTrace(args);\n }\n\n StackTrace.dump = function(args) {\n var stackTrace;\n args = args || arguments;\n stackTrace = new StackTrace(args);\n return stackTrace.dump();\n };\n\n StackTrace.prototype.dump = function() {\n var frame, _i, _len, _ref, _results;\n console.log(\"StackTrace:\");\n _ref = this.trace;\n _results = [];\n for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n frame = _ref[_i];\n _results.push(console.log(\" \" + frame));\n }\n return _results;\n };\n\n return StackTrace;\n\n})();\n\ngetTrace = function(args) {\n var err, func, result, visitedFuncs;\n result = [];\n visitedFuncs = [];\n func = args.callee;\n while (func) {\n if (func.signature) {\n result.push(func.signature);\n } else if (func.displayName) {\n result.push(func.displayName);\n } else if (func.name) {\n result.push(func.name);\n } else {\n result.push(\"<anonymous>\");\n }\n if (-1 !== visitedFuncs.indexOf(func)) {\n result.push(\"... recursion\");\n return result;\n }\n visitedFuncs.push(func);\n try {\n func = func.caller;\n } catch (_error) {\n err = _error;\n func = null;\n }\n }\n return result;\n};\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n\n//@ sourceURL=weinre/common/StackTrace.amd.js")
|
||
|
;eval(";modjewel.define(\"weinre/common/WebSocketXhr\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar EventListeners, Ex, HookLib, WebSocketXhr, Weinre, _xhrEventHandler;\n\nEx = require('./Ex');\n\nWeinre = require('./Weinre');\n\nHookLib = require('./HookLib');\n\nEventListeners = require('./EventListeners');\n\nmodule.exports = WebSocketXhr = (function() {\n WebSocketXhr.CONNECTING = 0;\n\n WebSocketXhr.OPEN = 1;\n\n WebSocketXhr.CLOSING = 2;\n\n WebSocketXhr.CLOSED = 3;\n\n function WebSocketXhr(url, id) {\n this.initialize(url, id);\n }\n\n WebSocketXhr.prototype.initialize = function(url, id) {\n if (!id) {\n id = \"anonymous\";\n }\n this.readyState = WebSocketXhr.CONNECTING;\n this._url = url;\n this._id = id;\n this._urlChannel = null;\n this._queuedSends = [];\n this._sendInProgress = true;\n this._listeners = {\n open: new EventListeners(),\n message: new EventListeners(),\n error: new EventListeners(),\n close: new EventListeners()\n };\n return this._getChannel();\n };\n\n WebSocketXhr.prototype._getChannel = function() {\n var body;\n body = JSON.stringify({\n id: this._id\n });\n return this._xhr(this._url, \"POST\", body, this._handleXhrResponseGetChannel);\n };\n\n WebSocketXhr.prototype._handleXhrResponseGetChannel = function(xhr) {\n var e, object;\n if (xhr.status !== 200) {\n return this._handleXhrResponseError(xhr);\n }\n try {\n object = JSON.parse(xhr.responseText);\n } catch (_error) {\n e = _error;\n this._fireEventListeners(\"error\", {\n message: \"non-JSON response from channel open request\"\n });\n this.close();\n return;\n }\n if (!object.channel) {\n this._fireEventListeners(\"error\", {\n message: \"channel open request did not include a channel\"\n });\n this.close();\n return;\n }\n this._urlChannel = this._url + \"/\" + object.channel;\n this.readyState = WebSocketXhr.OPEN;\n this._fireEventListeners(\"open\", {\n message: \"open\",\n channel: object.channel\n });\n this._sendInProgress = false;\n this._sendQueued();\n return this._readLoop();\n };\n\n WebSocketXhr.prototype._readLoop = function() {\n if (this.readyState === WebSocketXhr.CLOSED) {\n return;\n }\n if (this.readyState === WebSocketXhr.CLOSING) {\n return;\n }\n return this._xhr(this._urlChannel, \"GET\", \"\", this._handleXhrResponseGet);\n };\n\n WebSocketXhr.prototype._handleXhrResponseGet = function(xhr) {\n var data, datum, e, self, _i, _len, _results;\n self = this;\n if (xhr.status !== 200) {\n return this._handleXhrResponseError(xhr);\n }\n try {\n datum = JSON.parse(xhr.responseText);\n } catch (_error) {\n e = _error;\n this.readyState = WebSocketXhr.CLOSED;\n this._fireEventListeners(\"error\", {\n message: \"non-JSON response from read request\"\n });\n return;\n }\n HookLib.ignoreHooks(function() {\n return setTimeout((function() {\n return self._readLoop();\n }), 0);\n });\n _results = [];\n for (_i = 0, _len = datum.length; _i < _len; _i++) {\n data = datum[_i];\n _results.push(self._fireEventListeners(\"message\", {\n data: data\n }));\n }\n return _results;\n };\n\n WebSocketXhr.prototype.send = function(data) {\n if (typeof data !== \"string\") {\n throw new Ex(arguments, this.constructor.name + \".send\");\n }\n this._queuedSends.push(data);\n if (this._sendInProgress) {\n return;\n }\n return this._sendQueued();\n };\n\n WebSocketXhr.prototype._sendQueued = function() {\n var datum;\n if (this._queuedSends.length === 0) {\n return;\n }\n if (this.readyState === WebSocketXhr.CLOSED) {\n return;\n }\n if (this.readyState === WebSocketXhr.CLOSING) {\n return;\n }\n datum = JSON.stringify(this._queuedSends);\n this._queuedSends = [];\n this._s
|
||
|
;eval(";modjewel.define(\"weinre/common/Weinre\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar ConsoleLogger, Ex, IDLTools, StackTrace, Weinre, consoleLogger, getLogger, logger, _notImplemented, _showNotImplemented;\n\nEx = require('./Ex');\n\nIDLTools = require('./IDLTools');\n\nStackTrace = require('./StackTrace');\n\n_notImplemented = {};\n\n_showNotImplemented = false;\n\nlogger = null;\n\nmodule.exports = Weinre = (function() {\n function Weinre() {\n throw new Ex(arguments, \"this class is not intended to be instantiated\");\n }\n\n Weinre.addIDLs = function(idls) {\n return IDLTools.addIDLs(idls);\n };\n\n Weinre.deprecated = function() {\n return StackTrace.dump(arguments);\n };\n\n Weinre.notImplemented = function(thing) {\n if (_notImplemented[thing]) {\n return;\n }\n _notImplemented[thing] = true;\n if (!_showNotImplemented) {\n return;\n }\n return Weinre.logWarning(thing + \" not implemented\");\n };\n\n Weinre.showNotImplemented = function() {\n var key, _results;\n _showNotImplemented = true;\n _results = [];\n for (key in _notImplemented) {\n _results.push(Weinre.logWarning(key + \" not implemented\"));\n }\n return _results;\n };\n\n Weinre.logError = function(message) {\n return getLogger().logError(message);\n };\n\n Weinre.logWarning = function(message) {\n return getLogger().logWarning(message);\n };\n\n Weinre.logInfo = function(message) {\n return getLogger().logInfo(message);\n };\n\n Weinre.logDebug = function(message) {\n return getLogger().logDebug(message);\n };\n\n return Weinre;\n\n})();\n\nConsoleLogger = (function() {\n function ConsoleLogger() {}\n\n ConsoleLogger.prototype.logError = function(message) {\n return console.log(\"error: \" + message);\n };\n\n ConsoleLogger.prototype.logWarning = function(message) {\n return console.log(\"warning: \" + message);\n };\n\n ConsoleLogger.prototype.logInfo = function(message) {\n return console.log(\"info: \" + message);\n };\n\n ConsoleLogger.prototype.logDebug = function(message) {\n return console.log(\"debug: \" + message);\n };\n\n return ConsoleLogger;\n\n})();\n\nconsoleLogger = new ConsoleLogger();\n\ngetLogger = function() {\n if (logger) {\n return logger;\n }\n if (Weinre.client) {\n logger = Weinre.WeinreClientCommands;\n return logger;\n }\n if (Weinre.target) {\n logger = Weinre.WeinreTargetCommands;\n return logger;\n }\n return consoleLogger;\n};\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n\n//@ sourceURL=weinre/common/Weinre.amd.js")
|
||
|
;eval(";modjewel.define(\"weinre/target/BrowserHacks\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar BrowserHacks;\n\nBrowserHacks = function() {\n if (typeof document.addEventListener === \"undefined\") {\n alert(\"Oops. It seems the page runs in compatibility mode. Please fix it and try again.\");\n return;\n }\n if (typeof window.Element === \"undefined\") {\n window.Element = function() {};\n }\n if (typeof window.Node === \"undefined\") {\n window.Node = function() {};\n }\n if (!Object.getPrototypeOf) {\n Object.getPrototypeOf = function(object) {\n if (!object.__proto__) {\n throw new Error(\"This vm does not support __proto__ and getPrototypeOf. Script requires any of them to operate correctly.\");\n }\n return object.__proto__;\n };\n }\n};\n\nBrowserHacks();\n\n});\n\n//@ sourceURL=weinre/target/BrowserHacks.amd.js")
|
||
|
;eval(";modjewel.define(\"weinre/target/CheckForProblems\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar CheckForProblems, checkForOldPrototypeVersion;\n\nmodule.exports = CheckForProblems = (function() {\n function CheckForProblems() {}\n\n CheckForProblems.check = function() {\n return checkForOldPrototypeVersion();\n };\n\n return CheckForProblems;\n\n})();\n\ncheckForOldPrototypeVersion = function() {\n var badVersion;\n badVersion = false;\n if (typeof Prototype === \"undefined\") {\n return;\n }\n if (!Prototype.Version) {\n return;\n }\n if (Prototype.Version.match(/^1\\.5.*/)) {\n badVersion = true;\n }\n if (Prototype.Version.match(/^1\\.6.*/)) {\n badVersion = true;\n }\n if (badVersion) {\n return alert(\"Sorry, weinre is not support in versions of Prototype earlier than 1.7\");\n }\n};\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n\n//@ sourceURL=weinre/target/CheckForProblems.amd.js")
|
||
|
;eval(";modjewel.define(\"weinre/target/Console\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar Console, MessageLevel, MessageSource, MessageType, OriginalConsole, RemoteConsole, Timeline, UsingRemote, Weinre;\n\nWeinre = require('../common/Weinre');\n\nTimeline = require('../target/Timeline');\n\nUsingRemote = false;\n\nRemoteConsole = null;\n\nOriginalConsole = null;\n\nMessageSource = {\n HTML: 0,\n WML: 1,\n XML: 2,\n JS: 3,\n CSS: 4,\n Other: 5\n};\n\nMessageType = {\n Log: 0,\n Object: 1,\n Trace: 2,\n StartGroup: 3,\n StartGroupCollapsed: 4,\n EndGroup: 5,\n Assert: 6,\n UncaughtException: 7,\n Result: 8\n};\n\nMessageLevel = {\n Tip: 0,\n Log: 1,\n Warning: 2,\n Error: 3,\n Debug: 4\n};\n\nmodule.exports = Console = (function() {\n function Console() {}\n\n Object.defineProperty(Console, 'original', {\n get: function() {\n return OriginalConsole;\n }\n });\n\n Console.useRemote = function(value) {\n var oldValue;\n if (arguments.length === 0) {\n return UsingRemote;\n }\n oldValue = UsingRemote;\n UsingRemote = !!value;\n if (UsingRemote) {\n window.console = RemoteConsole;\n } else {\n window.console = OriginalConsole;\n }\n return oldValue;\n };\n\n Console.prototype._generic = function(level, messageParts) {\n var message, messagePart, parameters, payload, _i, _len;\n message = messageParts[0].toString();\n parameters = [];\n for (_i = 0, _len = messageParts.length; _i < _len; _i++) {\n messagePart = messageParts[_i];\n parameters.push(Weinre.injectedScript.wrapObjectForConsole(messagePart, true));\n }\n payload = {\n source: MessageSource.JS,\n type: MessageType.Log,\n level: level,\n message: message,\n parameters: parameters\n };\n return Weinre.wi.ConsoleNotify.addConsoleMessage(payload);\n };\n\n Console.prototype.log = function() {\n return this._generic(MessageLevel.Log, [].slice.call(arguments));\n };\n\n Console.prototype.debug = function() {\n return this._generic(MessageLevel.Debug, [].slice.call(arguments));\n };\n\n Console.prototype.error = function() {\n return this._generic(MessageLevel.Error, [].slice.call(arguments));\n };\n\n Console.prototype.info = function() {\n return this._generic(MessageLevel.Log, [].slice.call(arguments));\n };\n\n Console.prototype.warn = function() {\n return this._generic(MessageLevel.Warning, [].slice.call(arguments));\n };\n\n Console.prototype.dir = function() {\n return Weinre.notImplemented(arguments.callee.signature);\n };\n\n Console.prototype.dirxml = function() {\n return Weinre.notImplemented(arguments.callee.signature);\n };\n\n Console.prototype.trace = function() {\n return Weinre.notImplemented(arguments.callee.signature);\n };\n\n Console.prototype.assert = function(condition) {\n return Weinre.notImplemented(arguments.callee.signature);\n };\n\n Console.prototype.count = function() {\n return Weinre.notImplemented(arguments.callee.signature);\n };\n\n Console.prototype.markTimeline = function(message) {\n return Timeline.addRecord_Mark(message);\n };\n\n Console.prototype.lastWMLErrorMessage = function() {\n return Weinre.notImplemented(arguments.callee.signature);\n };\n\n Console.prototype.profile = function(title) {\n return Weinre.notImplemented(arguments.callee.signature);\n };\n\n Console.prototype.profileEnd = function(title) {\n return Weinre.notImplemented(arguments.callee.signature);\n };\n\n Console.prototype.time = function(title) {\n return Weinre.notImplemented(arguments.callee.signature);\n };\n\n Console.prototype.timeEnd = function(title) {\n return Weinre.notImplemented(arguments.callee.signature);\n };\n\n Console.prototype.group = function() {\n return Weinre.notImplemented(arguments.callee.signature);\n };\n\n Console.prototype.groupCollapsed = function() {\n return Weinre.notImplemented(arguments.callee.signature);\n };\n\n Console.prototype.groupEnd = function() {\n
|
||
|
;eval(";modjewel.define(\"weinre/target/CSSStore\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar CSSStore, IDGenerator, Weinre, _elementMatchesSelector, _fallbackMatchesSelector, _getMappableId, _getMappableObject, _mozMatchesSelector, _msMatchesSelector, _webkitMatchesSelector;\n\nIDGenerator = require('../common/IDGenerator');\n\nWeinre = require('../common/Weinre');\n\n_elementMatchesSelector = null;\n\nmodule.exports = CSSStore = (function() {\n function CSSStore() {\n this.styleSheetMap = {};\n this.styleRuleMap = {};\n this.styleDeclMap = {};\n this.testElement = document.createElement(\"div\");\n }\n\n CSSStore.prototype.getInlineStyle = function(node) {\n var cssProperty, styleObject, _i, _len, _ref;\n styleObject = this._buildMirrorForStyle(node.style, true);\n _ref = styleObject.cssProperties;\n for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n cssProperty = _ref[_i];\n cssProperty.status = \"style\";\n }\n return styleObject;\n };\n\n CSSStore.prototype.getComputedStyle = function(node) {\n var styleObject;\n if (!node) {\n return {};\n }\n if (node.nodeType !== Node.ELEMENT_NODE) {\n return {};\n }\n styleObject = this._buildMirrorForStyle(window.getComputedStyle(node), false);\n return styleObject;\n };\n\n CSSStore.prototype.getMatchedCSSRules = function(node) {\n var cssRule, err, object, result, styleSheet, _i, _j, _len, _len1, _ref, _ref1;\n result = [];\n try {\n _ref = document.styleSheets;\n for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n styleSheet = _ref[_i];\n if (!styleSheet.cssRules) {\n continue;\n }\n _ref1 = styleSheet.cssRules;\n for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {\n cssRule = _ref1[_j];\n if (!_elementMatchesSelector(node, cssRule.selectorText)) {\n continue;\n }\n object = {};\n object.ruleId = this._getStyleRuleId(cssRule);\n object.selectorText = cssRule.selectorText;\n object.style = this._buildMirrorForStyle(cssRule.style, true);\n result.push(object);\n }\n }\n } catch (_error) {\n err = _error;\n return result;\n }\n return result;\n };\n\n CSSStore.prototype.getStyleAttributes = function(node) {\n var result;\n result = {};\n return result;\n };\n\n CSSStore.prototype.getPseudoElements = function(node) {\n var result;\n result = [];\n return result;\n };\n\n CSSStore.prototype.setPropertyText = function(styleId, propertyIndex, text, overwrite) {\n var compare, i, key, mirror, properties, propertyIndices, propertyMirror, styleDecl;\n styleDecl = Weinre.cssStore._getStyleDecl(styleId);\n if (!styleDecl) {\n Weinre.logWarning(\"requested style not available: \" + styleId);\n return null;\n }\n mirror = styleDecl.__weinre__mirror;\n if (!mirror) {\n Weinre.logWarning(\"requested mirror not available: \" + styleId);\n return null;\n }\n properties = mirror.cssProperties;\n propertyMirror = this._parseProperty(text);\n if (null === propertyMirror) {\n this._removePropertyFromMirror(mirror, propertyIndex);\n properties = mirror.cssProperties;\n } else {\n this._removePropertyFromMirror(mirror, propertyIndex);\n properties = mirror.cssProperties;\n propertyIndices = {};\n i = 0;\n while (i < properties.length) {\n propertyIndices[properties[i].name] = i;\n i++;\n }\n i = 0;\n while (i < propertyMirror.cssProperties.length) {\n if (propertyIndices[propertyMirror.cssProperties[i].name] != null) {\n properties[propertyIndices[propertyMirror.cssProperties[i].name]] = propertyMirror.cssProperties[i];\n } else {\n properties.push(propertyMirror.cssProperties[i]);\n }\n i++;\n }\n for (key in propertyMirror.shorthandValues) {\n mirror.shorthandValues[key] = propertyMirror.shorthandValues
|
||
|
;eval(";modjewel.define(\"weinre/target/ElementHighlighter\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar ElementHighlighter, canvasAvailable, currentHighlighterElement, fromPx, getMetricsForElement, highlighterClass, supportsCanvas;\n\ncanvasAvailable = null;\n\nhighlighterClass = null;\n\ncurrentHighlighterElement = null;\n\nmodule.exports = ElementHighlighter = (function() {\n ElementHighlighter.create = function() {\n if (highlighterClass == null) {\n highlighterClass = require('./ElementHighlighterDivs2');\n }\n return new highlighterClass();\n };\n\n function ElementHighlighter() {\n this.hElement = this.createHighlighterElement();\n this.hElement.__weinreHighlighter = true;\n this.hElement.style.display = \"none\";\n this.hElement.style.zIndex = 10 * 1000 * 1000;\n if (currentHighlighterElement) {\n document.body.removeChild(currentHighlighterElement);\n }\n currentHighlighterElement = this.hElement;\n document.body.appendChild(this.hElement);\n }\n\n ElementHighlighter.prototype.on = function(element) {\n if (null === element) {\n return;\n }\n if (element.nodeType !== Node.ELEMENT_NODE) {\n return;\n }\n this.redraw(getMetricsForElement(element));\n return this.hElement.style.display = \"block\";\n };\n\n ElementHighlighter.prototype.off = function() {\n return this.hElement.style.display = \"none\";\n };\n\n return ElementHighlighter;\n\n})();\n\ngetMetricsForElement = function(element) {\n var cStyle, el, left, metrics, top;\n metrics = {};\n left = 0;\n top = 0;\n el = element;\n while (true) {\n left += el.offsetLeft;\n top += el.offsetTop;\n if (!(el = el.offsetParent)) {\n break;\n }\n }\n metrics.x = left;\n metrics.y = top;\n cStyle = document.defaultView.getComputedStyle(element);\n metrics.width = element.offsetWidth;\n metrics.height = element.offsetHeight;\n metrics.marginLeft = fromPx(cStyle[\"margin-left\"] || cStyle[\"marginLeft\"]);\n metrics.marginRight = fromPx(cStyle[\"margin-right\"] || cStyle[\"marginRight\"]);\n metrics.marginTop = fromPx(cStyle[\"margin-top\"] || cStyle[\"marginTop\"]);\n metrics.marginBottom = fromPx(cStyle[\"margin-bottom\"] || cStyle[\"marginBottom\"]);\n metrics.borderLeft = fromPx(cStyle[\"border-left-width\"] || cStyle[\"borderLeftWidth\"]);\n metrics.borderRight = fromPx(cStyle[\"border-right-width\"] || cStyle[\"borderRightWidth\"]);\n metrics.borderTop = fromPx(cStyle[\"border-top-width\"] || cStyle[\"borderTopWidth\"]);\n metrics.borderBottom = fromPx(cStyle[\"border-bottom-width\"] || cStyle[\"borderBottomWidth\"]);\n metrics.paddingLeft = fromPx(cStyle[\"padding-left\"] || cStyle[\"paddingLeft\"]);\n metrics.paddingRight = fromPx(cStyle[\"padding-right\"] || cStyle[\"paddingRight\"]);\n metrics.paddingTop = fromPx(cStyle[\"padding-top\"] || cStyle[\"paddingTop\"]);\n metrics.paddingBottom = fromPx(cStyle[\"padding-bottom\"] || cStyle[\"paddingBottom\"]);\n metrics.x -= metrics.marginLeft;\n metrics.y -= metrics.marginTop;\n return metrics;\n};\n\nfromPx = function(string) {\n return parseInt(string.replace(/px$/, \"\"));\n};\n\nsupportsCanvas = function() {\n var element;\n element = document.createElement('canvas');\n if (!element.getContext) {\n return false;\n }\n if (element.getContext('2d')) {\n return true;\n }\n return false;\n};\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n\n//@ sourceURL=weinre/target/ElementHighlighter.amd.js")
|
||
|
;eval(";modjewel.define(\"weinre/target/ElementHighlighterDivs2\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar ColorBorder, ColorContent, ColorMargin, ColorPadding, ElementHighlighter, ElementHighlighterDivs2, px,\n __hasProp = {}.hasOwnProperty,\n __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };\n\nElementHighlighter = require('./ElementHighlighter');\n\nColorMargin = 'rgba(246, 178, 107, 0.66)';\n\nColorBorder = 'rgba(255, 229, 153, 0.66)';\n\nColorPadding = 'rgba(147, 196, 125, 0.55)';\n\nColorContent = 'rgba(111, 168, 220, 0.66)';\n\nColorBorder = 'rgba(255, 255, 153, 0.40)';\n\nColorPadding = 'rgba( 0, 255, 0, 0.20)';\n\nColorContent = 'rgba( 0, 0, 255, 0.30)';\n\nmodule.exports = ElementHighlighterDivs2 = (function(_super) {\n __extends(ElementHighlighterDivs2, _super);\n\n function ElementHighlighterDivs2() {\n return ElementHighlighterDivs2.__super__.constructor.apply(this, arguments);\n }\n\n ElementHighlighterDivs2.prototype.createHighlighterElement = function() {\n this.hElement1 = document.createElement(\"weinreHighlighter\");\n this.hElement1.style.position = 'absolute';\n this.hElement1.style.overflow = 'hidden';\n this.hElement2 = document.createElement(\"weinreHighlighter\");\n this.hElement2.style.position = 'absolute';\n this.hElement2.style.display = 'block';\n this.hElement2.style.overflow = 'hidden';\n this.hElement1.appendChild(this.hElement2);\n this.hElement1.style.borderTopStyle = 'solid';\n this.hElement1.style.borderLeftStyle = 'solid';\n this.hElement1.style.borderBottomStyle = 'solid';\n this.hElement1.style.borderRightStyle = 'solid';\n this.hElement1.style.borderTopColor = ColorMargin;\n this.hElement1.style.borderLeftColor = ColorMargin;\n this.hElement1.style.borderBottomColor = ColorMargin;\n this.hElement1.style.borderRightColor = ColorMargin;\n this.hElement1.style.backgroundColor = ColorBorder;\n this.hElement2.style.borderTopStyle = 'solid';\n this.hElement2.style.borderLeftStyle = 'solid';\n this.hElement2.style.borderBottomStyle = 'solid';\n this.hElement2.style.borderRightStyle = 'solid';\n this.hElement2.style.borderTopColor = ColorPadding;\n this.hElement2.style.borderLeftColor = ColorPadding;\n this.hElement2.style.borderBottomColor = ColorPadding;\n this.hElement2.style.borderRightColor = ColorPadding;\n this.hElement2.style.backgroundColor = ColorContent;\n this.hElement1.style.outline = 'black solid thin';\n return this.hElement1;\n };\n\n ElementHighlighterDivs2.prototype.redraw = function(metrics) {\n this.hElement1.style.top = px(metrics.y);\n this.hElement1.style.left = px(metrics.x);\n this.hElement1.style.height = px(metrics.height);\n this.hElement1.style.width = px(metrics.width);\n this.hElement1.style.borderTopWidth = px(metrics.marginTop);\n this.hElement1.style.borderLeftWidth = px(metrics.marginLeft);\n this.hElement1.style.borderBottomWidth = px(metrics.marginBottom);\n this.hElement1.style.borderRightWidth = px(metrics.marginRight);\n this.hElement2.style.top = px(metrics.borderTop);\n this.hElement2.style.left = px(metrics.borderLeft);\n this.hElement2.style.bottom = px(metrics.borderBottom);\n this.hElement2.style.right = px(metrics.borderRight);\n this.hElement2.style.borderTopWidth = px(metrics.paddingTop);\n this.hElement2.style.borderLeftWidth = px(metrics.paddingLeft);\n this.hElement2.style.borderBottomWidth = px(metrics.paddingBottom);\n return this.hElement2.style.borderRightWidth = px(metrics.paddingRight);\n };\n\n return ElementHighlighterDivs2;\n\n})(ElementHighlighter);\n\npx = function(value) {\n return \"\" + value + \"px\";\n};\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n\n//@ sourceURL=we
|
||
|
;eval(";modjewel.define(\"weinre/target/HookSites\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar HookLib, HookSites;\n\nHookLib = require('../common/HookLib');\n\nmodule.exports = HookSites = (function() {\n function HookSites() {}\n\n return HookSites;\n\n})();\n\nHookSites.window_clearInterval = HookLib.addHookSite(window, \"clearInterval\");\n\nHookSites.window_clearTimeout = HookLib.addHookSite(window, \"clearTimeout\");\n\nHookSites.window_setInterval = HookLib.addHookSite(window, \"setInterval\");\n\nHookSites.window_setTimeout = HookLib.addHookSite(window, \"setTimeout\");\n\nHookSites.window_addEventListener = HookLib.addHookSite(window, \"addEventListener\");\n\nHookSites.Node_addEventListener = HookLib.addHookSite(Node.prototype, \"addEventListener\");\n\nHookSites.XMLHttpRequest_open = HookLib.addHookSite(XMLHttpRequest.prototype, \"open\");\n\nHookSites.XMLHttpRequest_send = HookLib.addHookSite(XMLHttpRequest.prototype, \"send\");\n\nHookSites.XMLHttpRequest_addEventListener = HookLib.addHookSite(XMLHttpRequest.prototype, \"addEventListener\");\n\nif (window.openDatabase) {\n HookSites.window_openDatabase = HookLib.addHookSite(window, \"openDatabase\");\n}\n\nif (window.localStorage) {\n HookSites.LocalStorage_setItem = HookLib.addHookSite(window.localStorage, \"setItem\");\n HookSites.LocalStorage_removeItem = HookLib.addHookSite(window.localStorage, \"removeItem\");\n HookSites.LocalStorage_clear = HookLib.addHookSite(window.localStorage, \"clear\");\n}\n\nif (window.sessionStorage) {\n HookSites.SessionStorage_setItem = HookLib.addHookSite(window.sessionStorage, \"setItem\");\n HookSites.SessionStorage_removeItem = HookLib.addHookSite(window.sessionStorage, \"removeItem\");\n HookSites.SessionStorage_clear = HookLib.addHookSite(window.sessionStorage, \"clear\");\n}\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n\n//@ sourceURL=weinre/target/HookSites.amd.js")
|
||
|
;eval("var injectedScriptConstructor = \n/*\n * Copyright (C) 2007 Apple Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n * its contributors may be used to endorse or promote products derived\n * from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n(function (InjectedScriptHost, inspectedWindow, injectedScriptId) {\n\nfunction bind(thisObject, memberFunction)\n{\n var func = memberFunction;\n var args = Array.prototype.slice.call(arguments, 2);\n function bound()\n {\n return func.apply(thisObject, args.concat(Array.prototype.slice.call(arguments, 0)));\n }\n bound.toString = function() {\n return \"bound: \" + func;\n };\n return bound;\n}\n\nvar InjectedScript = function()\n{\n this._lastBoundObjectId = 1;\n this._idToWrappedObject = {};\n this._objectGroups = {};\n}\n\nInjectedScript.prototype = {\n wrapObjectForConsole: function(object, canAccessInspectedWindow)\n {\n if (canAccessInspectedWindow)\n return this._wrapObject(object, \"console\");\n var result = {};\n result.type = typeof object;\n result.description = this._toString(object);\n return result;\n },\n\n _wrapObject: function(object, objectGroupName, abbreviate)\n {\n try {\n var objectId;\n if (typeof object === \"object\" || typeof object === \"function\" || this._isHTMLAllCollection(object)) {\n var id = this._lastBoundObjectId++;\n this._idToWrappedObject[id] = object;\n \n var group = this._objectGroups[objectGroupName];\n if (!group) {\n group = [];\n this._objectGroups[objectGroupName] = group;\n }\n group.push(id);\n objectId = { injectedScriptId: injectedScriptId,\n id: id,\n groupName: objectGroupName };\n }\n return InjectedScript.RemoteObject.fromObject(object, objectId, abbreviate);\n } catch (e) {\n return InjectedScript.RemoteObject.fromObject(\"[ Exception: \" + e.toString() + \" ]\");\n }\n },\n\n _parseObjectId: function(objectId)\n {\n return eval(\"(\" + objectId + \")\");\n },\n\n releaseWrapperObjectGroup: function(objectGroupName)\n {\n var group = this._objectGroups[objectGroupName];\n if (!group)\n return;\n for (var i = 0; i < group.length; i++)\n delete this._idToWrappedObject[group[i]];\n delete this._objectGroups[objectGroupName];\n },\n\n dispatch: function(methodName, args)\n {\n var argsArr
|
||
|
;eval(";modjewel.define(\"weinre/target/InjectedScriptHostImpl\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar InjectedScriptHostImpl, Weinre;\n\nWeinre = require('../common/Weinre');\n\nmodule.exports = InjectedScriptHostImpl = (function() {\n function InjectedScriptHostImpl() {}\n\n InjectedScriptHostImpl.prototype.clearConsoleMessages = function(callback) {\n if (callback) {\n return Weinre.WeinreTargetCommands.sendClientCallback(callback);\n }\n };\n\n InjectedScriptHostImpl.prototype.nodeForId = function(nodeId, callback) {\n return Weinre.nodeStore.getNode(nodeId);\n };\n\n InjectedScriptHostImpl.prototype.pushNodePathToFrontend = function(node, withChildren, selectInUI, callback) {\n var children, nodeId;\n nodeId = Weinre.nodeStore.getNodeId(node);\n children = Weinre.nodeStore.serializeNode(node, 1);\n Weinre.wi.DOMNotify.setChildNodes(nodeId, children);\n if (callback) {\n Weinre.WeinreTargetCommands.sendClientCallback(callback);\n }\n if (selectInUI) {\n return Weinre.wi.InspectorNotify.updateFocusedNode(nodeId);\n }\n };\n\n InjectedScriptHostImpl.prototype.inspectedNode = function(num, callback) {\n var nodeId;\n nodeId = Weinre.nodeStore.getInspectedNode(num);\n return nodeId;\n };\n\n InjectedScriptHostImpl.prototype.internalConstructorName = function(object) {\n var ctor, ctorName, match, pattern;\n ctor = object.constructor;\n ctorName = ctor.fullClassName || ctor.displayName || ctor.name;\n if (ctorName && (ctorName !== \"Object\")) {\n return ctorName;\n }\n pattern = /\\[object (.*)\\]/;\n match = pattern.exec(object.toString());\n if (match) {\n return match[1];\n }\n return \"Object\";\n };\n\n return InjectedScriptHostImpl;\n\n})();\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n\n//@ sourceURL=weinre/target/InjectedScriptHostImpl.amd.js")
|
||
|
;eval(";modjewel.define(\"weinre/target/NetworkRequest\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar Ex, HookLib, HookSites, IDGenerator, Loader, NetworkRequest, StackTrace, Weinre, getFormData, getHeaders, getRequest, getResponse, getXhrEventHandler, splitContentType, trim;\n\nStackTrace = require('../common/StackTrace');\n\nIDGenerator = require('../common/IDGenerator');\n\nHookLib = require('../common/HookLib');\n\nWeinre = require('../common/Weinre');\n\nEx = require('../common/Ex');\n\nHookSites = require('./HookSites');\n\nLoader = {\n url: window.location.href,\n frameId: 0,\n loaderId: 0\n};\n\nmodule.exports = NetworkRequest = (function() {\n function NetworkRequest(xhr, id, method, url, stackTrace) {\n this.xhr = xhr;\n this.id = id;\n this.method = method;\n this.url = url;\n this.stackTrace = stackTrace;\n }\n\n NetworkRequest.prototype.handleSend = function(data) {\n var redirectResponse, request, time;\n Weinre.wi.NetworkNotify.identifierForInitialRequest(this.id, this.url, Loader, this.stackTrace);\n time = Date.now() / 1000.0;\n request = getRequest(this.url, this.method, this.xhr, data);\n redirectResponse = {\n isNull: true\n };\n return Weinre.wi.NetworkNotify.willSendRequest(this.id, time, request, redirectResponse);\n };\n\n NetworkRequest.prototype.handleHeadersReceived = function() {\n var response, time;\n time = Date.now() / 1000.0;\n response = getResponse(this.xhr);\n return Weinre.wi.NetworkNotify.didReceiveResponse(this.id, time, \"XHR\", response);\n };\n\n NetworkRequest.prototype.handleLoading = function() {};\n\n NetworkRequest.prototype.handleDone = function() {\n var description, e, sourceString, status, statusText, success, time;\n sourceString = \"\";\n try {\n sourceString = this.xhr.responseText;\n } catch (_error) {\n e = _error;\n }\n Weinre.wi.NetworkNotify.setInitialContent(this.id, sourceString, \"XHR\");\n time = Date.now() / 1000.0;\n status = this.xhr.status;\n if (status === 0) {\n status = 200;\n }\n statusText = this.xhr.statusText;\n success = status >= 200 && status < 300;\n if (success) {\n return Weinre.wi.NetworkNotify.didFinishLoading(this.id, time);\n } else {\n description = \"\" + status + \" - \" + statusText;\n return Weinre.wi.NetworkNotify.didFailLoading(this.id, time, description);\n }\n };\n\n NetworkRequest.installNativeHooks = function() {\n HookSites.XMLHttpRequest_open.addHooks({\n before: function(receiver, args) {\n var frame, id, method, rawStackTrace, stackTrace, url, xhr, _i, _len;\n xhr = receiver;\n method = args[0];\n url = args[1];\n id = IDGenerator.next();\n rawStackTrace = new StackTrace(args).trace.slice(1);\n stackTrace = [];\n for (_i = 0, _len = rawStackTrace.length; _i < _len; _i++) {\n frame = rawStackTrace[_i];\n stackTrace.push({\n functionName: frame\n });\n }\n xhr.__weinreNetworkRequest__ = new NetworkRequest(xhr, id, method, url, stackTrace);\n return HookLib.ignoreHooks(function() {\n return xhr.addEventListener(\"readystatechange\", getXhrEventHandler(xhr), false);\n });\n }\n });\n return HookSites.XMLHttpRequest_send.addHooks({\n before: function(receiver, args) {\n var data, nr, xhr;\n xhr = receiver;\n data = args[0];\n nr = xhr.__weinreNetworkRequest__;\n if (!nr) {\n return;\n }\n return nr.handleSend(data);\n }\n });\n };\n\n return NetworkRequest;\n\n})();\n\ngetRequest = function(url, method, xhr, data) {\n return {\n url: url,\n httpMethod: method,\n httpHeaderFields: {},\n requestFormData: getFormData(url, data)\n };\n};\n\ngetResponse = function(xhr) {\n var contentLength, contentType, encoding, headers, result, _ref;\n contentType = xhr.getResponseHeader(\"Content-Type\");\n contentType || (contentType = 'a
|
||
|
;eval(";modjewel.define(\"weinre/target/NodeStore\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar Debug, IDGenerator, NodeStore, Weinre, handleDOMAttrModified, handleDOMCharacterDataModified, handleDOMNodeInserted, handleDOMNodeRemoved, handleDOMSubtreeModified;\n\nWeinre = require('../common/Weinre');\n\nIDGenerator = require('../common/IDGenerator');\n\nDebug = require('../common/Debug');\n\nmodule.exports = NodeStore = (function() {\n function NodeStore() {\n this._nodeMap = {};\n this._childrenSent = {};\n this._inspectedNodes = [];\n document.addEventListener(\"DOMSubtreeModified\", handleDOMSubtreeModified, false);\n document.addEventListener(\"DOMNodeInserted\", handleDOMNodeInserted, false);\n document.addEventListener(\"DOMNodeRemoved\", handleDOMNodeRemoved, false);\n document.addEventListener(\"DOMAttrModified\", handleDOMAttrModified, false);\n document.addEventListener(\"DOMCharacterDataModified\", handleDOMCharacterDataModified, false);\n }\n\n NodeStore.prototype.addInspectedNode = function(nodeId) {\n this._inspectedNodes.unshift(nodeId);\n if (this._inspectedNodes.length > 5) {\n return this._inspectedNodes = this._inspectedNodes.slice(0, 5);\n }\n };\n\n NodeStore.prototype.getInspectedNode = function(index) {\n return this._inspectedNodes[index];\n };\n\n NodeStore.prototype.getNode = function(nodeId) {\n return this._nodeMap[nodeId];\n };\n\n NodeStore.prototype.checkNodeId = function(node) {\n return IDGenerator.checkId(node);\n };\n\n NodeStore.prototype.getNodeId = function(node) {\n var id;\n id = this.checkNodeId(node);\n if (id) {\n return id;\n }\n return IDGenerator.getId(node, this._nodeMap);\n };\n\n NodeStore.prototype.getNodeData = function(nodeId, depth) {\n return this.serializeNode(this.getNode(nodeId), depth);\n };\n\n NodeStore.prototype.getPreviousSiblingId = function(node) {\n var id, sib;\n while (true) {\n sib = node.previousSibling;\n if (!sib) {\n return 0;\n }\n id = this.checkNodeId(sib);\n if (id) {\n return id;\n }\n node = sib;\n }\n };\n\n NodeStore.prototype.nextNodeId = function() {\n return \"\" + IDGenerator.next();\n };\n\n NodeStore.prototype.serializeNode = function(node, depth) {\n var children, i, id, localName, nodeData, nodeName, nodeValue;\n nodeName = \"\";\n nodeValue = null;\n localName = null;\n id = this.getNodeId(node);\n switch (node.nodeType) {\n case Node.TEXT_NODE:\n case Node.COMMENT_NODE:\n case Node.CDATA_SECTION_NODE:\n nodeValue = node.nodeValue;\n break;\n case Node.ATTRIBUTE_NODE:\n localName = node.localName;\n break;\n case Node.DOCUMENT_FRAGMENT_NODE:\n break;\n default:\n nodeName = node.nodeName;\n localName = node.localName;\n }\n nodeData = {\n id: id,\n nodeType: node.nodeType,\n nodeName: nodeName,\n localName: localName,\n nodeValue: nodeValue\n };\n if (node.nodeType === Node.ELEMENT_NODE || node.nodeType === Node.DOCUMENT_NODE || node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n nodeData.childNodeCount = this.childNodeCount(node);\n children = this.serializeNodeChildren(node, depth);\n if (children.length) {\n nodeData.children = children;\n }\n if (node.nodeType === Node.ELEMENT_NODE) {\n nodeData.attributes = [];\n i = 0;\n while (i < node.attributes.length) {\n nodeData.attributes.push(node.attributes[i].nodeName);\n nodeData.attributes.push(node.attributes[i].nodeValue);\n i++;\n }\n } else {\n if (node.nodeType === Node.DOCUMENT_NODE) {\n nodeData.documentURL = window.location.href;\n }\n }\n } else if (node.nodeType === Node.DOCUMENT_TYPE_NODE) {\n nodeData.publicId = node.publicId;\n nodeData.systemId = node.systemId;\n nodeData.internalSubset = node.internalSubset;\n } else
|
||
|
;eval(";modjewel.define(\"weinre/target/SqlStepper\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar Binding, SqlStepper, executeSql, ourErrorCallback, runStep;\n\nBinding = require('../common/Binding');\n\nmodule.exports = SqlStepper = (function() {\n function SqlStepper(steps) {\n var context;\n if (!(this instanceof SqlStepper)) {\n return new SqlStepper(steps);\n }\n this.__context = {};\n context = this.__context;\n context.steps = steps;\n }\n\n SqlStepper.prototype.run = function(db, errorCallback) {\n var context;\n context = this.__context;\n if (context.hasBeenRun) {\n throw new Ex(arguments, \"stepper has already been run\");\n }\n context.hasBeenRun = true;\n context.db = db;\n context.errorCallback = errorCallback;\n context.nextStep = 0;\n context.ourErrorCallback = new Binding(this, ourErrorCallback);\n context.runStep = new Binding(this, runStep);\n this.executeSql = new Binding(this, executeSql);\n return db.transaction(context.runStep);\n };\n\n SqlStepper.example = function(db, id) {\n var errorCb, step1, step2, stepper;\n step1 = function() {\n return this.executeSql(\"SELECT name FROM sqlite_master WHERE type='table'\");\n };\n step2 = function(resultSet) {\n var i, name, result, rows;\n rows = resultSet.rows;\n result = [];\n i = 0;\n while (i < rows.length) {\n name = rows.item(i).name;\n if (name === \"__WebKitDatabaseInfoTable__\") {\n i++;\n continue;\n }\n result.push(name);\n i++;\n }\n return console.log((\"[\" + this.id + \"] table names: \") + result.join(\", \"));\n };\n errorCb = function(sqlError) {\n return console.log((\"[\" + this.id + \"] sql error:\" + sqlError.code + \": \") + sqlError.message);\n };\n stepper = new SqlStepper([step1, step2]);\n stepper.id = id;\n return stepper.run(db, errorCb);\n };\n\n return SqlStepper;\n\n})();\n\nexecuteSql = function(statement, data) {\n var context;\n context = this.__context;\n return context.tx.executeSql(statement, data, context.runStep, context.ourErrorCallback);\n};\n\nourErrorCallback = function(tx, sqlError) {\n var context;\n context = this.__context;\n return context.errorCallback.call(this, sqlError);\n};\n\nrunStep = function(tx, resultSet) {\n var context, step;\n context = this.__context;\n if (context.nextStep >= context.steps.length) {\n return;\n }\n context.tx = tx;\n context.currentStep = context.nextStep;\n context.nextStep++;\n step = context.steps[context.currentStep];\n return step.call(this, resultSet);\n};\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n\n//@ sourceURL=weinre/target/SqlStepper.amd.js")
|
||
|
;eval(";modjewel.define(\"weinre/target/Target\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar Binding, CSSStore, Callback, CheckForProblems, ElementHighlighter, Ex, HookLib, InjectedScriptHostImpl, MessageDispatcher, NetworkRequest, NodeStore, Target, Weinre, WeinreExtraClientCommandsImpl, WeinreTargetEventsImpl, WiCSSImpl, WiConsoleImpl, WiDOMImpl, WiDOMStorageImpl, WiDatabaseImpl, WiInspectorImpl, WiRuntimeImpl, currentTime;\n\nrequire('./BrowserHacks');\n\nEx = require('../common/Ex');\n\nBinding = require('../common/Binding');\n\nCallback = require('../common/Callback');\n\nMessageDispatcher = require('../common/MessageDispatcher');\n\nWeinre = require('../common/Weinre');\n\nHookLib = require('../common/HookLib');\n\nCheckForProblems = require('./CheckForProblems');\n\nNodeStore = require('./NodeStore');\n\nCSSStore = require('./CSSStore');\n\nElementHighlighter = require('./ElementHighlighter');\n\nInjectedScriptHostImpl = require('./InjectedScriptHostImpl');\n\nNetworkRequest = require('./NetworkRequest');\n\nWeinreTargetEventsImpl = require('./WeinreTargetEventsImpl');\n\nWeinreExtraClientCommandsImpl = require('./WeinreExtraClientCommandsImpl');\n\nWiConsoleImpl = require('./WiConsoleImpl');\n\nWiCSSImpl = require('./WiCSSImpl');\n\nWiDatabaseImpl = require('./WiDatabaseImpl');\n\nWiDOMImpl = require('./WiDOMImpl');\n\nWiDOMStorageImpl = require('./WiDOMStorageImpl');\n\nWiInspectorImpl = require('./WiInspectorImpl');\n\nWiRuntimeImpl = require('./WiRuntimeImpl');\n\nmodule.exports = Target = (function() {\n function Target() {}\n\n Target.main = function() {\n CheckForProblems.check();\n Weinre.target = new Target();\n return Weinre.target.initialize();\n };\n\n Target.prototype.setWeinreServerURLFromScriptSrc = function(element) {\n var match, message, pattern;\n if (window.WeinreServerURL) {\n return;\n }\n if (element) {\n pattern = /((https?:)?\\/\\/(.*?)\\/)/;\n match = pattern.exec(element.src);\n if (match) {\n window.WeinreServerURL = match[1];\n return;\n }\n }\n message = \"unable to calculate the weinre server url; explicity set the variable window.WeinreServerURL instead\";\n alert(message);\n throw new Ex(arguments, message);\n };\n\n Target.prototype.setWeinreServerIdFromScriptSrc = function(element) {\n var attempt, hash;\n if (window.WeinreServerId) {\n return;\n }\n element = this.getTargetScriptElement();\n hash = \"anonymous\";\n if (element) {\n attempt = element.src.split(\"#\")[1];\n if (attempt) {\n hash = attempt;\n } else {\n attempt = location.hash.split(\"#\")[1];\n if (attempt) {\n hash = attempt;\n }\n }\n }\n return window.WeinreServerId = hash;\n };\n\n Target.prototype.getTargetScriptElement = function() {\n var element, elements, i, j, scripts;\n elements = document.getElementsByTagName(\"script\");\n scripts = [\"target-script.js\", \"target-script-min.js\"];\n i = 0;\n while (i < elements.length) {\n element = elements[i];\n j = 0;\n while (j < scripts.length) {\n if (-1 !== element.src.indexOf(\"/\" + scripts[j])) {\n return element;\n }\n j++;\n }\n i++;\n }\n };\n\n Target.prototype.initialize = function() {\n var element, injectedScriptHost, messageDispatcher;\n element = this.getTargetScriptElement();\n this.setWeinreServerURLFromScriptSrc(element);\n this.setWeinreServerIdFromScriptSrc(element);\n if (window.WeinreServerURL[window.WeinreServerURL.length - 1] !== \"/\") {\n window.WeinreServerURL += \"/\";\n }\n injectedScriptHost = new InjectedScriptHostImpl();\n Weinre.injectedScript = injectedScriptConstructor(injectedScriptHost, window, 0, \"?\");\n window.addEventListener(\"load\", Binding(this, \"onLoaded\"), false);\n document.addEventListener(\"DOMContentLoaded\", Binding(this, \"onDOMContent\"), false);\n this._startTime = currentTime();\n if (document.
|
||
|
;eval(";modjewel.define(\"weinre/target/Timeline\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar Ex, HookLib, HookSites, IDGenerator, Running, StackTrace, Timeline, TimelineRecordType, TimerIntervals, TimerTimeouts, Weinre, addStackTrace, addTimer, getXhrEventHandler, instrumentedTimerCode, removeTimer;\n\nEx = require('../common/Ex');\n\nWeinre = require('../common/Weinre');\n\nIDGenerator = require('../common/IDGenerator');\n\nStackTrace = require('../common/StackTrace');\n\nHookLib = require('../common/HookLib');\n\nHookSites = require('./HookSites');\n\nRunning = false;\n\nTimerTimeouts = {};\n\nTimerIntervals = {};\n\nTimelineRecordType = {\n EventDispatch: 0,\n Layout: 1,\n RecalculateStyles: 2,\n Paint: 3,\n ParseHTML: 4,\n TimerInstall: 5,\n TimerRemove: 6,\n TimerFire: 7,\n XHRReadyStateChange: 8,\n XHRLoad: 9,\n EvaluateScript: 10,\n Mark: 11,\n ResourceSendRequest: 12,\n ResourceReceiveResponse: 13,\n ResourceFinish: 14,\n FunctionCall: 15,\n ReceiveResourceData: 16,\n GCEvent: 17,\n MarkDOMContent: 18,\n MarkLoad: 19,\n ScheduleResourceRequest: 20\n};\n\nmodule.exports = Timeline = (function() {\n function Timeline() {}\n\n Timeline.start = function() {\n return Running = true;\n };\n\n Timeline.stop = function() {\n return Running = false;\n };\n\n Timeline.isRunning = function() {\n return Running;\n };\n\n Timeline.addRecord_Mark = function(message) {\n var record;\n if (!Timeline.isRunning()) {\n return;\n }\n record = {};\n record.type = TimelineRecordType.Mark;\n record.category = {\n name: \"scripting\"\n };\n record.startTime = Date.now();\n record.data = {\n message: message\n };\n addStackTrace(record, 3);\n return Weinre.wi.TimelineNotify.addRecordToTimeline(record);\n };\n\n Timeline.addRecord_EventDispatch = function(event, name, category) {\n var record;\n if (!Timeline.isRunning()) {\n return;\n }\n if (!category) {\n category = \"scripting\";\n }\n record = {};\n record.type = TimelineRecordType.EventDispatch;\n record.category = {\n name: category\n };\n record.startTime = Date.now();\n record.data = {\n type: event.type\n };\n return Weinre.wi.TimelineNotify.addRecordToTimeline(record);\n };\n\n Timeline.addRecord_TimerInstall = function(id, timeout, singleShot) {\n var record;\n if (!Timeline.isRunning()) {\n return;\n }\n record = {};\n record.type = TimelineRecordType.TimerInstall;\n record.category = {\n name: \"scripting\"\n };\n record.startTime = Date.now();\n record.data = {\n timerId: id,\n timeout: timeout,\n singleShot: singleShot\n };\n addStackTrace(record, 4);\n return Weinre.wi.TimelineNotify.addRecordToTimeline(record);\n };\n\n Timeline.addRecord_TimerRemove = function(id, timeout, singleShot) {\n var record;\n if (!Timeline.isRunning()) {\n return;\n }\n record = {};\n record.type = TimelineRecordType.TimerRemove;\n record.category = {\n name: \"scripting\"\n };\n record.startTime = Date.now();\n record.data = {\n timerId: id,\n timeout: timeout,\n singleShot: singleShot\n };\n addStackTrace(record, 4);\n return Weinre.wi.TimelineNotify.addRecordToTimeline(record);\n };\n\n Timeline.addRecord_TimerFire = function(id, timeout, singleShot) {\n var record;\n if (!Timeline.isRunning()) {\n return;\n }\n record = {};\n record.type = TimelineRecordType.TimerFire;\n record.category = {\n name: \"scripting\"\n };\n record.startTime = Date.now();\n record.data = {\n timerId: id,\n timeout: timeout,\n singleShot: singleShot\n };\n return Weinre.wi.TimelineNotify.addRecordToTimeline(record);\n };\n\n Timeline.addRecord_XHRReadyStateChange = function(method, url, id, xhr) {\n var contentLength, contentType, e, record;\n if (!Timeline.isRunning()) {\n return;\n }\n try {\n contentLength = xhr.getRespo
|
||
|
;eval(";modjewel.define(\"weinre/target/WeinreExtraClientCommandsImpl\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar Console, Weinre, WeinreExtraClientCommandsImpl, WiDatabaseImpl;\n\nWeinre = require('../common/Weinre');\n\nWiDatabaseImpl = require('./WiDatabaseImpl');\n\nConsole = require('./Console');\n\nmodule.exports = WeinreExtraClientCommandsImpl = (function() {\n function WeinreExtraClientCommandsImpl() {}\n\n WeinreExtraClientCommandsImpl.prototype.getDatabases = function(callback) {\n var result;\n if (!callback) {\n return;\n }\n result = WiDatabaseImpl.getDatabases();\n return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n };\n\n return WeinreExtraClientCommandsImpl;\n\n})();\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n\n//@ sourceURL=weinre/target/WeinreExtraClientCommandsImpl.amd.js")
|
||
|
;eval(";modjewel.define(\"weinre/target/WeinreTargetEventsImpl\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar Callback, Console, Weinre, WeinreTargetEventsImpl;\n\nWeinre = require('../common/Weinre');\n\nCallback = require('../common/Callback');\n\nConsole = require('./Console');\n\nmodule.exports = WeinreTargetEventsImpl = (function() {\n function WeinreTargetEventsImpl() {}\n\n WeinreTargetEventsImpl.prototype.connectionCreated = function(clientChannel, targetChannel) {\n var message;\n message = (\"weinre: target \" + targetChannel + \" connected to client \") + clientChannel;\n Weinre.logInfo(message);\n return Weinre.target.whenBodyReady(this, [], function() {\n var oldValue;\n oldValue = Console.useRemote(true);\n Weinre.target.setDocument();\n Weinre.wi.TimelineNotify.timelineProfilerWasStopped();\n return Weinre.wi.DOMStorage.initialize();\n });\n };\n\n WeinreTargetEventsImpl.prototype.connectionDestroyed = function(clientChannel, targetChannel) {\n var message, oldValue;\n message = (\"weinre: target \" + targetChannel + \" disconnected from client \") + clientChannel;\n Weinre.logInfo(message);\n return oldValue = Console.useRemote(false);\n };\n\n WeinreTargetEventsImpl.prototype.sendCallback = function(callbackId, result) {\n return Callback.invoke(callbackId, result);\n };\n\n return WeinreTargetEventsImpl;\n\n})();\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n\n//@ sourceURL=weinre/target/WeinreTargetEventsImpl.amd.js")
|
||
|
;eval(";modjewel.define(\"weinre/target/WiConsoleImpl\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar Weinre, WiConsoleImpl;\n\nWeinre = require('../common/Weinre');\n\nmodule.exports = WiConsoleImpl = (function() {\n function WiConsoleImpl() {\n this.messagesEnabled = true;\n }\n\n WiConsoleImpl.prototype.setConsoleMessagesEnabled = function(enabled, callback) {\n var oldValue;\n oldValue = this.messagesEnabled;\n this.messagesEnabled = enabled;\n if (callback) {\n return Weinre.WeinreTargetCommands.sendClientCallback(callback, [oldValue]);\n }\n };\n\n WiConsoleImpl.prototype.clearConsoleMessages = function(callback) {\n Weinre.wi.ConsoleNotify.consoleMessagesCleared();\n if (callback) {\n return Weinre.WeinreTargetCommands.sendClientCallback(callback, []);\n }\n };\n\n WiConsoleImpl.prototype.setMonitoringXHREnabled = function(enabled, callback) {\n if (callback) {\n return Weinre.WeinreTargetCommands.sendClientCallback(callback, []);\n }\n };\n\n return WiConsoleImpl;\n\n})();\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n\n//@ sourceURL=weinre/target/WiConsoleImpl.amd.js")
|
||
|
;eval(";modjewel.define(\"weinre/target/WiCSSImpl\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar Weinre, WiCSSImpl;\n\nWeinre = require('../common/Weinre');\n\nmodule.exports = WiCSSImpl = (function() {\n function WiCSSImpl() {\n this.dummyComputedStyle = false;\n }\n\n WiCSSImpl.prototype.getStylesForNode = function(nodeId, callback) {\n var computedStyle, node, parentNode, parentStyle, result;\n result = {};\n node = Weinre.nodeStore.getNode(nodeId);\n if (!node) {\n Weinre.logWarning(arguments.callee.signature + \" passed an invalid nodeId: \" + nodeId);\n return;\n }\n if (this.dummyComputedStyle) {\n computedStyle = {\n styleId: null,\n properties: [],\n shorthandValues: [],\n cssProperties: []\n };\n } else {\n computedStyle = Weinre.cssStore.getComputedStyle(node);\n }\n result = {\n inlineStyle: Weinre.cssStore.getInlineStyle(node),\n computedStyle: computedStyle,\n matchedCSSRules: Weinre.cssStore.getMatchedCSSRules(node),\n styleAttributes: Weinre.cssStore.getStyleAttributes(node),\n pseudoElements: Weinre.cssStore.getPseudoElements(node),\n inherited: []\n };\n parentNode = node.parentNode;\n while (parentNode) {\n parentStyle = {\n inlineStyle: Weinre.cssStore.getInlineStyle(parentNode),\n matchedCSSRules: Weinre.cssStore.getMatchedCSSRules(parentNode)\n };\n result.inherited.push(parentStyle);\n parentNode = parentNode.parentNode;\n }\n if (callback) {\n return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n }\n };\n\n WiCSSImpl.prototype.getComputedStyleForNode = function(nodeId, callback) {\n var node, result;\n node = Weinre.nodeStore.getNode(nodeId);\n if (!node) {\n Weinre.logWarning(arguments.callee.signature + \" passed an invalid nodeId: \" + nodeId);\n return;\n }\n result = Weinre.cssStore.getComputedStyle(node);\n if (callback) {\n return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n }\n };\n\n WiCSSImpl.prototype.getInlineStyleForNode = function(nodeId, callback) {\n var node, result;\n node = Weinre.nodeStore.getNode(nodeId);\n if (!node) {\n Weinre.logWarning(arguments.callee.signature + \" passed an invalid nodeId: \" + nodeId);\n return;\n }\n result = Weinre.cssStore.getInlineStyle(node);\n if (callback) {\n return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n }\n };\n\n WiCSSImpl.prototype.getAllStyles = function(callback) {\n return Weinre.notImplemented(arguments.callee.signature);\n };\n\n WiCSSImpl.prototype.getStyleSheet = function(styleSheetId, callback) {\n return Weinre.notImplemented(arguments.callee.signature);\n };\n\n WiCSSImpl.prototype.getStyleSheetText = function(styleSheetId, callback) {\n return Weinre.notImplemented(arguments.callee.signature);\n };\n\n WiCSSImpl.prototype.setStyleSheetText = function(styleSheetId, text, callback) {\n return Weinre.notImplemented(arguments.callee.signature);\n };\n\n WiCSSImpl.prototype.setPropertyText = function(styleId, propertyIndex, text, overwrite, callback) {\n var result;\n result = Weinre.cssStore.setPropertyText(styleId, propertyIndex, text, overwrite);\n if (callback) {\n return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n }\n };\n\n WiCSSImpl.prototype.toggleProperty = function(styleId, propertyIndex, disable, callback) {\n var result;\n result = Weinre.cssStore.toggleProperty(styleId, propertyIndex, disable);\n if (callback) {\n return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n }\n };\n\n WiCSSImpl.prototype.setRuleSelector = function(ruleId, selector, callback) {\n return Weinre.notImplemented(arguments.callee.signature);\n };\n\n WiCSSImpl.prototype.addRule = function(contextNodeId, selector, callback) {\n return Weinre.notImplemented(arguments.callee.signature)
|
||
|
;eval(";modjewel.define(\"weinre/target/WiDatabaseImpl\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar HookSites, IDGenerator, SqlStepper, Weinre, WiDatabaseImpl, dbAdd, dbById, dbRecordById, dbRecordByName, executeSQL_error, executeSQL_step_1, executeSQL_step_2, getTableNames_step_1, getTableNames_step_2, id2db, logSqlError, name2db;\n\nWeinre = require('../common/Weinre');\n\nIDGenerator = require('../common/IDGenerator');\n\nHookSites = require('./HookSites');\n\nSqlStepper = require('./SqlStepper');\n\nid2db = {};\n\nname2db = {};\n\nmodule.exports = WiDatabaseImpl = (function() {\n function WiDatabaseImpl() {\n if (!window.openDatabase) {\n return;\n }\n HookSites.window_openDatabase.addHooks({\n after: function(receiver, args, db) {\n var name, version;\n if (!db) {\n return;\n }\n name = args[0];\n version = args[1];\n return dbAdd(db, name, version);\n }\n });\n }\n\n WiDatabaseImpl.getDatabases = function() {\n var id, result;\n result = [];\n for (id in id2db) {\n result.push(id2db[id]);\n }\n return result;\n };\n\n WiDatabaseImpl.prototype.getDatabaseTableNames = function(databaseId, callback) {\n var db, stepper;\n db = dbById(databaseId);\n if (!db) {\n return;\n }\n stepper = SqlStepper([getTableNames_step_1, getTableNames_step_2]);\n stepper.callback = callback;\n return stepper.run(db, logSqlError);\n };\n\n WiDatabaseImpl.prototype.executeSQL = function(databaseId, query, callback) {\n var db, stepper, txid;\n db = dbById(databaseId);\n if (!db) {\n return;\n }\n txid = Weinre.targetDescription.channel + \"-\" + IDGenerator.next();\n stepper = SqlStepper([executeSQL_step_1, executeSQL_step_2]);\n stepper.txid = txid;\n stepper.query = query;\n stepper.callback = callback;\n stepper.run(db, executeSQL_error);\n if (callback) {\n return Weinre.WeinreTargetCommands.sendClientCallback(callback, [true, txid]);\n }\n };\n\n return WiDatabaseImpl;\n\n})();\n\nlogSqlError = function(sqlError) {\n return console.log((\"SQL Error \" + sqlError.code + \": \") + sqlError.message);\n};\n\ngetTableNames_step_1 = function() {\n return this.executeSql(\"SELECT name FROM sqlite_master WHERE type='table'\");\n};\n\ngetTableNames_step_2 = function(resultSet) {\n var i, name, result, rows;\n rows = resultSet.rows;\n result = [];\n i = 0;\n while (i < rows.length) {\n name = rows.item(i).name;\n if (name === \"__WebKitDatabaseInfoTable__\") {\n i++;\n continue;\n }\n result.push(name);\n i++;\n }\n return Weinre.WeinreTargetCommands.sendClientCallback(this.callback, [result]);\n};\n\nexecuteSQL_step_1 = function() {\n return this.executeSql(this.query);\n};\n\nexecuteSQL_step_2 = function(resultSet) {\n var columnNames, i, j, propName, row, rows, values;\n columnNames = [];\n values = [];\n rows = resultSet.rows;\n i = 0;\n while (i < rows.length) {\n row = rows.item(i);\n if (i === 0) {\n for (propName in row) {\n columnNames.push(propName);\n }\n }\n j = 0;\n while (j < columnNames.length) {\n values.push(row[columnNames[j]]);\n j++;\n }\n i++;\n }\n return Weinre.wi.DatabaseNotify.sqlTransactionSucceeded(this.txid, columnNames, values);\n};\n\nexecuteSQL_error = function(sqlError) {\n var error;\n error = {\n code: sqlError.code,\n message: sqlError.message\n };\n return Weinre.wi.DatabaseNotify.sqlTransactionFailed(this.txid, error);\n};\n\ndbById = function(id) {\n var record;\n record = id2db[id];\n if (!record) {\n return null;\n }\n return record.db;\n};\n\ndbRecordById = function(id) {\n return id2db[id];\n};\n\ndbRecordByName = function(name) {\n return name2db[name];\n};\n\ndbAdd = function(db, name, version) {\n var payload, record;\n record = dbRecordByName(name);\n if (record) {\n return record;\n }\n record = {};\n record.id = IDGenerator.next();\n record.domain = window.location.or
|
||
|
;eval(";modjewel.define(\"weinre/target/WiDOMImpl\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar Weinre, WiDOMImpl;\n\nWeinre = require('../common/Weinre');\n\nmodule.exports = WiDOMImpl = (function() {\n function WiDOMImpl() {}\n\n WiDOMImpl.prototype.getChildNodes = function(nodeId, callback) {\n var children, node;\n node = Weinre.nodeStore.getNode(nodeId);\n if (!node) {\n Weinre.logWarning(arguments.callee.signature + \" passed an invalid nodeId: \" + nodeId);\n return;\n }\n children = Weinre.nodeStore.serializeNodeChildren(node, 1);\n Weinre.wi.DOMNotify.setChildNodes(nodeId, children);\n if (callback) {\n return Weinre.WeinreTargetCommands.sendClientCallback(callback);\n }\n };\n\n WiDOMImpl.prototype.setAttribute = function(elementId, name, value, callback) {\n var element;\n element = Weinre.nodeStore.getNode(elementId);\n if (!element) {\n Weinre.logWarning(arguments.callee.signature + \" passed an invalid elementId: \" + elementId);\n return;\n }\n element.setAttribute(name, value);\n if (callback) {\n return Weinre.WeinreTargetCommands.sendClientCallback(callback);\n }\n };\n\n WiDOMImpl.prototype.removeAttribute = function(elementId, name, callback) {\n var element;\n element = Weinre.nodeStore.getNode(elementId);\n if (!element) {\n Weinre.logWarning(arguments.callee.signature + \" passed an invalid elementId: \" + elementId);\n return;\n }\n element.removeAttribute(name);\n if (callback) {\n return Weinre.WeinreTargetCommands.sendClientCallback(callback);\n }\n };\n\n WiDOMImpl.prototype.setTextNodeValue = function(nodeId, value, callback) {\n var node;\n node = Weinre.nodeStore.getNode(nodeId);\n if (!node) {\n Weinre.logWarning(arguments.callee.signature + \" passed an invalid nodeId: \" + nodeId);\n return;\n }\n node.nodeValue = value;\n if (callback) {\n return Weinre.WeinreTargetCommands.sendClientCallback(callback);\n }\n };\n\n WiDOMImpl.prototype.getEventListenersForNode = function(nodeId, callback) {\n return Weinre.notImplemented(arguments.callee.signature);\n };\n\n WiDOMImpl.prototype.copyNode = function(nodeId, callback) {\n return Weinre.notImplemented(arguments.callee.signature);\n };\n\n WiDOMImpl.prototype.removeNode = function(nodeId, callback) {\n var node;\n node = Weinre.nodeStore.getNode(nodeId);\n if (!node) {\n Weinre.logWarning(arguments.callee.signature + \" passed an invalid nodeId: \" + nodeId);\n return;\n }\n if (!node.parentNode) {\n Weinre.logWarning(arguments.callee.signature + \" passed a parentless node: \" + node);\n return;\n }\n node.parentNode.removeChild(node);\n if (callback) {\n return Weinre.WeinreTargetCommands.sendClientCallback(callback);\n }\n };\n\n WiDOMImpl.prototype.changeTagName = function(nodeId, newTagName, callback) {\n return Weinre.notImplemented(arguments.callee.signature);\n };\n\n WiDOMImpl.prototype.getOuterHTML = function(nodeId, callback) {\n var node, value;\n node = Weinre.nodeStore.getNode(nodeId);\n if (!node) {\n Weinre.logWarning(arguments.callee.signature + \" passed an invalid nodeId: \" + nodeId);\n return;\n }\n value = node.outerHTML;\n if (callback) {\n return Weinre.WeinreTargetCommands.sendClientCallback(callback, [value]);\n }\n };\n\n WiDOMImpl.prototype.setOuterHTML = function(nodeId, outerHTML, callback) {\n var node;\n node = Weinre.nodeStore.getNode(nodeId);\n if (!node) {\n Weinre.logWarning(arguments.callee.signature + \" passed an invalid nodeId: \" + nodeId);\n return;\n }\n node.outerHTML = outerHTML;\n if (callback) {\n return Weinre.WeinreTargetCommands.sendClientCallback(callback);\n }\n };\n\n WiDOMImpl.prototype.addInspectedNode = function(nodeId, callback) {\n Weinre.nodeStore.addInspectedNode(nodeId);\n if (callback) {\n return Weinre.WeinreTargetCommands.sendClientCallb
|
||
|
;eval(";modjewel.define(\"weinre/target/WiDOMStorageImpl\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar HookSites, Weinre, WiDOMStorageImpl, _getStorageArea, _storageEventHandler;\n\nWeinre = require('../common/Weinre');\n\nHookSites = require('./HookSites');\n\nmodule.exports = WiDOMStorageImpl = (function() {\n function WiDOMStorageImpl() {}\n\n WiDOMStorageImpl.prototype.getDOMStorageEntries = function(storageId, callback) {\n var i, key, length, result, storageArea, val;\n storageArea = _getStorageArea(storageId);\n if (!storageArea) {\n Weinre.logWarning(arguments.callee.signature + \" passed an invalid storageId: \" + storageId);\n return;\n }\n result = [];\n length = storageArea.length;\n i = 0;\n while (i < length) {\n key = storageArea.key(i);\n val = storageArea.getItem(key);\n result.push([key, val]);\n i++;\n }\n if (callback) {\n return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n }\n };\n\n WiDOMStorageImpl.prototype.setDOMStorageItem = function(storageId, key, value, callback) {\n var e, result, storageArea;\n storageArea = _getStorageArea(storageId);\n if (!storageArea) {\n Weinre.logWarning(arguments.callee.signature + \" passed an invalid storageId: \" + storageId);\n return;\n }\n result = true;\n try {\n HookLib.ignoreHooks(function() {\n if (storageArea === window.localStorage) {\n return localStorage.setItem(key, value);\n } else if (storageArea === window.sessionStorage) {\n return sessionStorage.setItem(key, value);\n }\n });\n } catch (_error) {\n e = _error;\n result = false;\n }\n if (callback) {\n return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n }\n };\n\n WiDOMStorageImpl.prototype.removeDOMStorageItem = function(storageId, key, callback) {\n var e, result, storageArea;\n storageArea = _getStorageArea(storageId);\n if (!storageArea) {\n Weinre.logWarning(arguments.callee.signature + \" passed an invalid storageId: \" + storageId);\n return;\n }\n result = true;\n try {\n HookLib.ignoreHooks(function() {\n if (storageArea === window.localStorage) {\n return localStorage.removeItem(key);\n } else if (storageArea === window.sessionStorage) {\n return sessionStorage.removeItem(key);\n }\n });\n } catch (_error) {\n e = _error;\n result = false;\n }\n if (callback) {\n return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n }\n };\n\n WiDOMStorageImpl.prototype.initialize = function() {\n if (window.localStorage) {\n Weinre.wi.DOMStorageNotify.addDOMStorage({\n id: 1,\n host: window.location.host,\n isLocalStorage: true\n });\n HookSites.LocalStorage_setItem.addHooks({\n after: function() {\n return _storageEventHandler({\n storageArea: window.localStorage\n });\n }\n });\n HookSites.LocalStorage_removeItem.addHooks({\n after: function() {\n return _storageEventHandler({\n storageArea: window.localStorage\n });\n }\n });\n HookSites.LocalStorage_clear.addHooks({\n after: function() {\n return _storageEventHandler({\n storageArea: window.localStorage\n });\n }\n });\n }\n if (window.sessionStorage) {\n Weinre.wi.DOMStorageNotify.addDOMStorage({\n id: 2,\n host: window.location.host,\n isLocalStorage: false\n });\n HookSites.SessionStorage_setItem.addHooks({\n after: function() {\n return _storageEventHandler({\n storageArea: window.sessionStorage\n });\n }\n });\n HookSites.SessionStorage_removeItem.addHooks({\n after: function() {\n return _storageEventHandler({\n storageArea: window.sessionStorage\n
|
||
|
;eval(";modjewel.define(\"weinre/target/WiInspectorImpl\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar Timeline, Weinre, WiInspectorImpl;\n\nWeinre = require('../common/Weinre');\n\nTimeline = require('../target/Timeline');\n\nmodule.exports = WiInspectorImpl = (function() {\n function WiInspectorImpl() {}\n\n WiInspectorImpl.prototype.reloadPage = function(callback) {\n if (callback) {\n Weinre.WeinreTargetCommands.sendClientCallback(callback);\n }\n return window.location.reload();\n };\n\n WiInspectorImpl.prototype.highlightDOMNode = function(nodeId, callback) {\n var node;\n node = Weinre.nodeStore.getNode(nodeId);\n if (!node) {\n Weinre.logWarning(arguments.callee.signature + \" passed an invalid nodeId: \" + nodeId);\n return;\n }\n Weinre.elementHighlighter.on(node);\n if (callback) {\n return Weinre.WeinreTargetCommands.sendClientCallback(callback);\n }\n };\n\n WiInspectorImpl.prototype.hideDOMNodeHighlight = function(callback) {\n Weinre.elementHighlighter.off();\n if (callback) {\n return Weinre.WeinreTargetCommands.sendClientCallback(callback);\n }\n };\n\n WiInspectorImpl.prototype.startTimelineProfiler = function(callback) {\n Timeline.start();\n Weinre.wi.TimelineNotify.timelineProfilerWasStarted();\n if (callback) {\n return Weinre.WeinreTargetCommands.sendClientCallback(callback);\n }\n };\n\n WiInspectorImpl.prototype.stopTimelineProfiler = function(callback) {\n Timeline.stop();\n Weinre.wi.TimelineNotify.timelineProfilerWasStopped();\n if (callback) {\n return Weinre.WeinreTargetCommands.sendClientCallback(callback);\n }\n };\n\n return WiInspectorImpl;\n\n})();\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n\n//@ sourceURL=weinre/target/WiInspectorImpl.amd.js")
|
||
|
;eval(";modjewel.define(\"weinre/target/WiRuntimeImpl\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar Weinre, WiRuntimeImpl;\n\nWeinre = require('../common/Weinre');\n\nmodule.exports = WiRuntimeImpl = (function() {\n function WiRuntimeImpl() {}\n\n WiRuntimeImpl.prototype.evaluate = function(expression, objectGroup, includeCommandLineAPI, callback) {\n var result;\n result = Weinre.injectedScript.evaluate(expression, objectGroup, includeCommandLineAPI);\n if (callback) {\n return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n }\n };\n\n WiRuntimeImpl.prototype.getCompletions = function(expression, includeCommandLineAPI, callback) {\n var result;\n result = Weinre.injectedScript.getCompletions(expression, includeCommandLineAPI);\n if (callback) {\n return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n }\n };\n\n WiRuntimeImpl.prototype.getProperties = function(objectId, ignoreHasOwnProperty, abbreviate, callback) {\n var result;\n objectId = JSON.stringify(objectId);\n result = Weinre.injectedScript.getProperties(objectId, ignoreHasOwnProperty, abbreviate);\n if (callback) {\n return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n }\n };\n\n WiRuntimeImpl.prototype.setPropertyValue = function(objectId, propertyName, expression, callback) {\n var result;\n objectId = JSON.stringify(objectId);\n result = Weinre.injectedScript.setPropertyValue(objectId, propertyName, expression);\n if (callback) {\n return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n }\n };\n\n WiRuntimeImpl.prototype.releaseWrapperObjectGroup = function(injectedScriptId, objectGroup, callback) {\n var result;\n result = Weinre.injectedScript.releaseWrapperObjectGroup(objectGroup);\n if (callback) {\n return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n }\n };\n\n return WiRuntimeImpl;\n\n})();\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n\n//@ sourceURL=weinre/target/WiRuntimeImpl.amd.js")
|
||
|
;eval("modjewel.require('weinre/common/Weinre').addIDLs([{\"interfaces\": [{\"name\": \"InjectedScriptHost\", \"methods\": [{\"name\": \"clearConsoleMessages\", \"parameters\": []}, {\"name\": \"copyText\", \"parameters\": [{\"name\": \"text\"}]}, {\"parameters\": [{\"name\": \"nodeId\"}], \"name\": \"nodeForId\"}, {\"parameters\": [{\"name\": \"node\"}, {\"name\": \"withChildren\"}, {\"name\": \"selectInUI\"}], \"name\": \"pushNodePathToFrontend\"}, {\"name\": \"inspectedNode\", \"parameters\": [{\"name\": \"num\"}]}, {\"parameters\": [{\"name\": \"object\"}], \"name\": \"internalConstructorName\"}, {\"parameters\": [], \"name\": \"currentCallFrame\"}, {\"parameters\": [{\"name\": \"database\"}], \"name\": \"selectDatabase\"}, {\"parameters\": [{\"name\": \"storage\"}], \"name\": \"selectDOMStorage\"}, {\"name\": \"didCreateWorker\", \"parameters\": [{\"name\": \"id\"}, {\"name\": \"url\"}, {\"name\": \"isFakeWorker\"}]}, {\"name\": \"didDestroyWorker\", \"parameters\": [{\"name\": \"id\"}]}, {\"name\": \"nextWorkerId\", \"parameters\": []}]}], \"name\": \"core\"}, {\"interfaces\": [{\"name\": \"Inspector\", \"methods\": [{\"name\": \"addScriptToEvaluateOnLoad\", \"parameters\": [{\"name\": \"scriptSource\"}]}, {\"name\": \"removeAllScriptsToEvaluateOnLoad\", \"parameters\": []}, {\"name\": \"reloadPage\", \"parameters\": [{\"name\": \"ignoreCache\"}]}, {\"name\": \"populateScriptObjects\", \"parameters\": []}, {\"name\": \"openInInspectedWindow\", \"parameters\": [{\"name\": \"url\"}]}, {\"name\": \"setSearchingForNode\", \"parameters\": [{\"name\": \"enabled\"}]}, {\"name\": \"didEvaluateForTestInFrontend\", \"parameters\": [{\"name\": \"testCallId\"}, {\"name\": \"jsonResult\"}]}, {\"name\": \"highlightDOMNode\", \"parameters\": [{\"name\": \"nodeId\"}]}, {\"name\": \"hideDOMNodeHighlight\", \"parameters\": []}, {\"name\": \"highlightFrame\", \"parameters\": [{\"name\": \"frameId\"}]}, {\"name\": \"hideFrameHighlight\", \"parameters\": []}, {\"name\": \"setUserAgentOverride\", \"parameters\": [{\"name\": \"userAgent\"}]}, {\"name\": \"getCookies\", \"parameters\": []}, {\"name\": \"deleteCookie\", \"parameters\": [{\"name\": \"cookieName\"}, {\"name\": \"domain\"}]}, {\"name\": \"startTimelineProfiler\", \"parameters\": []}, {\"name\": \"stopTimelineProfiler\", \"parameters\": []}, {\"name\": \"enableDebugger\", \"parameters\": []}, {\"name\": \"disableDebugger\", \"parameters\": []}, {\"name\": \"enableProfiler\", \"parameters\": []}, {\"name\": \"disableProfiler\", \"parameters\": []}, {\"name\": \"startProfiling\", \"parameters\": []}, {\"name\": \"stopProfiling\", \"parameters\": []}]}, {\"name\": \"Runtime\", \"methods\": [{\"name\": \"evaluate\", \"parameters\": [{\"name\": \"expression\"}, {\"name\": \"objectGroup\"}, {\"name\": \"includeCommandLineAPI\"}]}, {\"name\": \"getCompletions\", \"parameters\": [{\"name\": \"expression\"}, {\"name\": \"includeCommandLineAPI\"}]}, {\"name\": \"getProperties\", \"parameters\": [{\"name\": \"objectId\"}, {\"name\": \"ignoreHasOwnProperty\"}, {\"name\": \"abbreviate\"}]}, {\"name\": \"setPropertyValue\", \"parameters\": [{\"name\": \"objectId\"}, {\"name\": \"propertyName\"}, {\"name\": \"expression\"}]}, {\"name\": \"releaseWrapperObjectGroup\", \"parameters\": [{\"name\": \"injectedScriptId\"}, {\"name\": \"objectGroup\"}]}]}, {\"name\": \"InjectedScript\", \"methods\": [{\"name\": \"evaluateOnSelf\", \"parameters\": [{\"name\": \"functionBody\"}, {\"name\": \"argumentsArray\"}]}]}, {\"name\": \"Console\", \"methods\": [{\"name\": \"setConsoleMessagesEnabled\", \"parameters\": [{\"name\": \"enabled\"}]}, {\"name\": \"clearConsoleMessages\", \"parameters\": []}, {\"name\": \"setMonitoringXHREnabled\", \"parameters\": [{\"name\": \"enabled\"}]}]}, {\"name\": \"Network\", \"methods\": [{\"name\": \"cachedResources\", \"parameters\": []}, {\"name\": \"resourceContent\", \"parameters\": [{\"name\": \"frameId\"}, {\"name\": \"url\"}, {\"name\": \"base64Encode\"}]}, {\"name\": \"setExtraHeaders\", \"parameters\": [{\"name\": \"headers\"}]}]}, {\"name\": \"Database\", \"metho
|
||
|
// modjewel.require('weinre/common/Weinre').showNotImplemented();
|
||
|
modjewel.require('weinre/target/Target').main()
|
||
|
})();
|