| |
| /* |
| * weinre is available under *either* the terms of the modified BSD license *or* the |
| * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text. |
| * |
| * Copyright (c) 2011 IBM Corporation |
| */ |
| |
| requireClass ../common/Weinre |
| requireClass ../target/Timeline |
| |
| //----------------------------------------------------------------------------- |
| class WiInspectorImpl |
| |
| //----------------------------------------------------------------------------- |
| method reloadPage(callback) |
| if (callback) { |
| Weinre.WeinreTargetCommands.sendClientCallback(callback) |
| } |
| |
| window.location.reload() |
| |
| //----------------------------------------------------------------------------- |
| method highlightDOMNode(/*int*/ nodeId, callback) |
| var node = Weinre.nodeStore.getNode(nodeId) |
| if (!node) { |
| Weinre.logWarning(arguments.callee.signature + " passed an invalid nodeId: " + nodeId) |
| return |
| } |
| |
| Weinre.elementHighlighter.on(node) |
| |
| if (callback) { |
| Weinre.WeinreTargetCommands.sendClientCallback(callback) |
| } |
| |
| //----------------------------------------------------------------------------- |
| method hideDOMNodeHighlight(callback) |
| Weinre.elementHighlighter.off() |
| |
| if (callback) { |
| Weinre.WeinreTargetCommands.sendClientCallback(callback) |
| } |
| |
| //----------------------------------------------------------------------------- |
| method startTimelineProfiler(callback) |
| Timeline.start() |
| |
| Weinre.wi.TimelineNotify.timelineProfilerWasStarted() |
| |
| if (callback) { |
| Weinre.WeinreTargetCommands.sendClientCallback(callback) |
| } |
| |
| |
| //----------------------------------------------------------------------------- |
| method stopTimelineProfiler(callback) |
| Timeline.stop() |
| |
| Weinre.wi.TimelineNotify.timelineProfilerWasStopped() |
| |
| if (callback) { |
| Weinre.WeinreTargetCommands.sendClientCallback(callback) |
| } |
| |