From 7ce75f83057014e6fcd944cd89756f6aa25e66d0 Mon Sep 17 00:00:00 2001 From: Chris K Date: Thu, 19 Jul 2012 19:29:41 +0200 Subject: [PATCH 01/27] DFL-3226 Lots of info messages "getting readyState has failed in runtime_onload_handler handleReadyState" --- src/ecma-debugger/runtime_onload_handler.js | 161 +++++------ src/ecma-debugger/runtimes.js | 282 +++++++------------- src/ecma-debugger/tabs.js | 11 +- 3 files changed, 192 insertions(+), 262 deletions(-) diff --git a/src/ecma-debugger/runtime_onload_handler.js b/src/ecma-debugger/runtime_onload_handler.js index 69d60c019..813b653a3 100644 --- a/src/ecma-debugger/runtime_onload_handler.js +++ b/src/ecma-debugger/runtime_onload_handler.js @@ -15,124 +15,129 @@ window.cls.EcmascriptDebugger["6.0"].RuntimeOnloadHandler = function() // take into account if the document has finished loading // like e.g the api to get the stylesheets - const - COMPLETE = 'complete', - RUNTIME_ID = 0, - STATE = 1, - DOM_CONTENT_LOADED = 1, - LOAD = 2; - - var - __rts = {}, - __onload_handlers = {}, - __rts_checked = {}, - poll_interval = 50; - - var reset_state_handler = function() + var COMPLETE = "complete"; + var RUNTIME_ID = 0; + var STATE = 1; + var DOM_CONTENT_LOADED = 1; + var LOAD = 2; + var POLL_INTERVAL = 50; + + this._reset_state_handler = function() { - __rts = {}; - __onload_handlers = {}; - __rts_checked = {}; - } + this._rts = {}; + this._onload_handlers = {}; + this._rts_checked = {}; + }; - var poll = function(rt_id) + this._poll = function(rt_id) { - if( blocked_rts[rt_id] ) - { - setTimeout(poll, poll_interval, rt_id); - } + this._rts_is_checking[rt_id] = true; + if (this._blocked_rts[rt_id]) + setTimeout(this._poll.bind(this, rt_id), POLL_INTERVAL); else { - var tag = tagManager.set_callback(null, handleReadyState, [rt_id]); + var tag = this._tagman.set_callback(this, this._handle_ready_state, [rt_id]); var script = "return document.readyState"; - services['ecmascript-debugger'].requestEval(tag, [rt_id, 0, 0, script]); + this._esde.requestEval(tag, [rt_id, 0, 0, script]); } - } + }; - var call_callbacks = function(rt_id) + this._call_callbacks = function(callbacks) { - var onload_handlers = __onload_handlers[rt_id]; - if (onload_handlers) + while (callbacks && callbacks.length) { - for (var i = 0, cb; cb = onload_handlers[i]; i++) - { - cb(); - } + callbacks.shift()() } - __onload_handlers[rt_id] = null; - } + }; - var handleReadyState = function(status, message, rt_id) + this._handle_ready_state = function(status, message, rt_id) { - const STATUS = 0, VALUE = 2; - if (message[STATUS] == 'completed') + var SUCCESS = 0; + var STATUS = 0; + var VALUE = 2; + this._rts_is_checking[rt_id] = false; + if (status == SUCCESS && message[STATUS] == "completed") { - __rts_checked[rt_id] = true; + this._rts_checked[rt_id] = true; if (message[VALUE] == COMPLETE) { - __rts[rt_id] = COMPLETE; - call_callbacks(rt_id); + this._rts[rt_id] = COMPLETE; + this._call_callbacks(this._onload_handlers[rt_id]); } } else - { - opera.postError(ui_strings.S_DRAGONFLY_INFO_MESSAGE + - 'getting readyState has failed in runtime_onload_handler handleReadyState'); - } - } + this._call_callbacks(this._error_handlers[rt_id]); + }; - var register = function(rt_id, callback) + this._register = function(rt_id, callback, error_callback) { - if (!__onload_handlers[rt_id]) + if (!this._onload_handlers[rt_id]) { - __onload_handlers[rt_id] = []; - if (!__rts_checked[rt_id]) - poll(rt_id); + this._onload_handlers[rt_id] = []; + this._error_handlers[rt_id] = []; + if (!this._rts_checked[rt_id] && !this._rts_is_checking[rt_id]) + this._poll(rt_id); } - var onload_handlers = __onload_handlers[rt_id]; + var callbacks = this._onload_handlers[rt_id]; // if the callback already exists, it will be replaced - var i = 0; - for (var cb; (cb = onload_handlers[i]) && cb != callback; i++) {}; - onload_handlers[i] = callback; - } + for (var i = 0, cb; (cb = callbacks[i]) && cb != callback; i++); + callbacks[i] = callback; + if (error_callback) + { + callbacks = this._error_handlers[rt_id]; + for (var i = 0, cb; (cb = callbacks[i]) && cb != callback; i++); + callbacks[i] = error_callback; + } + }; this.is_loaded = function(rt_id) { - return __rts[rt_id] == COMPLETE; + return this._rts[rt_id] == COMPLETE; }; - this.register_onload_handler = function(rt_id, callback) + this.register_onload_handler = function(rt_id, callback, error_callback) { - register(rt_id, callback); - } - - var blocked_rts = {}; + this._register(rt_id, callback, error_callback); + }; - var onThreadStopped = function(msg) + this._on_thread_stopped = function(msg) { - blocked_rts[msg.stop_at.runtime_id] = true; - } + this._blocked_rts[msg.stop_at.runtime_id] = true; + }; - var onThreadContinue = function(msg) + this._on_thread_continue = function(msg) { - blocked_rts[msg.stop_at.runtime_id] = false; - } + this._blocked_rts[msg.stop_at.runtime_id] = false; + }; this._onloadhandler = function(message) { var rt_id = message[RUNTIME_ID]; - __rts_checked[rt_id] = true; + this._rts_checked[rt_id] = true; if (message[STATE] == LOAD) { - __rts[rt_id] = COMPLETE; - if (__onload_handlers[rt_id]) - call_callbacks(rt_id); + this._rts[rt_id] = COMPLETE; + if (this._onload_handlers[rt_id]) + this._call_callbacks(rt_id); } - } + }; - messages.addListener("thread-stopped-event", onThreadStopped); - messages.addListener("thread-continue-event", onThreadContinue); - messages.addListener('reset-state', reset_state_handler); - window.services['ecmascript-debugger'].addListener('readystatechanged', this._onloadhandler.bind(this)); + this._init = function() + { + this._rts = {}; + this._onload_handlers = {}; + this._error_handlers = {}; + this._rts_checked = {}; + this._rts_is_checking = {}; + this._blocked_rts = {}; + this._esde = window.services['ecmascript-debugger']; + this._tagman = window.tag_manager; + var msgs = window.messages; + msgs.addListener("thread-stopped-event", this._on_thread_stopped.bind(this)); + msgs.addListener("thread-continue-event", this._on_thread_continue.bind(this)); + msgs.addListener('reset-state', this._reset_state_handler.bind(this)); + this._esde.addListener('readystatechanged', this._onloadhandler.bind(this)); + }; -} + this._init(); +}; diff --git a/src/ecma-debugger/runtimes.js b/src/ecma-debugger/runtimes.js index bbab258f5..9061ab53e 100644 --- a/src/ecma-debugger/runtimes.js +++ b/src/ecma-debugger/runtimes.js @@ -80,7 +80,7 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) var __threads = []; - var __log_threads = false; + var _log_threads = false; var __windowsFolding = {}; @@ -160,7 +160,7 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) __windows_reloaded = {}; __selected_window = ''; __threads = []; - __log_threads = false; + _log_threads = false; __windowsFolding = {}; __old_selected_window = ''; __selected_runtime_id = ''; @@ -179,12 +179,12 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) __window_ids = {}; __windows_reloaded = {}; __threads = []; - __log_threads = false; + _log_threads = false; __windowsFolding = {}; __selected_runtime_id = ''; __next_runtime_id_to_select = ''; __selected_script = ''; - current_threads = {}; + _thread_queues = {}; updateRuntimeViews(); } }; @@ -565,9 +565,9 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) var log = [EVENT_TYPES[type], ':', NL]; - if (runtime_stopped_queue.length) + if (_runtime_stopped_queue.length) { - log.push(INDENT, runtime_stopped_queue.join(' ')); + log.push(INDENT, _runtime_stopped_queue.join(' ')); } log.push(INDENT, 'runtime id: ', rt_id, NL); log.push(INDENT, 'thread id: ', thread_id, NL); @@ -575,9 +575,9 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) thread.threads = []; for( i = 0; key = __runtimes_arr[i]; i++ ) { - if (cur in current_threads && current_threads[cur].length ) + if (cur in _thread_queues && _thread_queues[cur].length ) { - thread.threads[thread.threads.length] = [cur].concat(current_threads[cur]); + thread.threads[thread.threads.length] = [cur].concat(_thread_queues[cur]); } } */ @@ -615,7 +615,7 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) { case 'log-threads': { - __log_threads = settings[id].get(msg.key); + _log_threads = settings[id].get(msg.key); break; } } @@ -629,7 +629,7 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) var on_services_created = function(msg) { - //__log_threads = window.settings['threads'].get('log-threads'); + //_log_threads = window.settings['threads'].get('log-threads'); } this.setActiveWindowId = function(window_id) @@ -758,20 +758,19 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) // TODO client side therads handling needs a revision - var thread_queues = {}; - var current_threads = {}; + var __thread_queues_obsolete = {}; + var _thread_queues = {}; - var runtime_stopped_queue = []; - var stopped_threads = {}; + var _runtime_stopped_queue = []; + var _stopped_threads = {}; // for debug purpose var print_threads = function(label, msg) { var log = label + ': ' + JSON.stringify(msg) + '\n' + - 'thread_queues: ' + JSON.stringify(thread_queues) + '\n' + - 'current_threads: ' + JSON.stringify(current_threads) + '\n' + - 'runtime_stopped_queue: ' + JSON.stringify(runtime_stopped_queue) + '\n' + - 'stopped_threads: ' + JSON.stringify(stopped_threads) + '\n'; + '_thread_queues: ' + JSON.stringify(_thread_queues) + '\n' + + '_runtime_stopped_queue: ' + JSON.stringify(_runtime_stopped_queue) + '\n' + + '_stopped_threads: ' + JSON.stringify(_stopped_threads) + '\n'; opera.postError(log); }; @@ -779,20 +778,20 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) { const THREAD_ID = 1; // release all stopped events - while (runtime_stopped_queue.length) + while (_runtime_stopped_queue.length) { - var rt_id = runtime_stopped_queue.shift(); - var thread = stopped_threads[rt_id].shift(); + var rt_id = _runtime_stopped_queue.shift(); + var thread = _stopped_threads[rt_id].shift(); if (thread) { var msg = [rt_id, thread[THREAD_ID], 'run']; services['ecmascript-debugger'].requestContinueThread(0, msg); } } - thread_queues = {}; - current_threads = {}; - stopped_threads = {}; - runtime_stopped_queue = []; + __thread_queues_obsolete = {}; + _thread_queues = {}; + _stopped_threads = {}; + _runtime_stopped_queue = []; } var is_runtime_of_debug_context = function(rt_id) @@ -811,15 +810,13 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) var clear_thread_id = function(rt_id, thread_id) { - var cur = '', i = 0; - var thread_queue = thread_queues[rt_id]; - var current_thread = current_threads[rt_id]; + var current_thread = _thread_queues[rt_id]; // it seems that the order of the thread-finished events can get reversed // TODO this is a temporary fix for situations where a threads // finishes in a runtime whre it has never started if (current_thread) { - for (i = 0 ; cur = current_thread[i]; i++) + for (var i = 0 ; cur = current_thread[i]; i++) { if (cur == thread_id) { @@ -827,199 +824,119 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) break; } } - for (i = 0 ; cur = thread_queue[i]; i++) - { - if (cur == thread_id) - { - thread_queue.splice(i, 1); - return true; - } - } } else { opera.postError(ui_strings.S_DRAGONFLY_INFO_MESSAGE + - 'got a thread finished event \n' + - 'in a runtime where the thread \n'+ - 'has never started: '+ rt_id+' '+thread_id); + "got a thread finished event \n" + + "in a runtime where the thread \n"+ + "has never started: "+ rt_id + " " + thread_id); } - return false; - } - -/* - - - 3 - 3 - 0 - inline - - - - 3 - 3 - completed - - - - */ - - - + }; this.onThreadStarted = function(status, message) { - - const - RUNTIME_ID = 0, - THREAD_ID = 1, - PARENT_THREAD_ID = 2, - THREAD_TYPE = 3, - EVENT_NAMESPACE = 4, - EVENT_TYPE = 5; - + var RUNTIME_ID = 0; + var THREAD_ID = 1; + var PARENT_THREAD_ID = 2; var rt_id = message[RUNTIME_ID]; - // workaround for missing filtering - if( is_runtime_of_debug_context(rt_id) ) - { - var id = message[THREAD_ID]; - var parent_thread_id = message[PARENT_THREAD_ID]; - var thread_queue = thread_queues[rt_id] || (thread_queues[rt_id] = []); - var current_thread = current_threads[rt_id] || (current_threads[rt_id] = []); - thread_queue[thread_queue.length] = id; - if (!current_thread.length || - (parent_thread_id !== 0 && - parent_thread_id == current_thread[current_thread.length - 1])) - { - current_thread[current_thread.length] = id; - } - - if (__log_threads) - { - log_thread(THREAD_STARTED, message, rt_id, id); - views.threads.update(); - } - } - else - { - opera.postError(ui_strings.S_DRAGONFLY_INFO_MESSAGE + - 'thread started not debug context') + var id = message[THREAD_ID]; + var parent_thread_id = message[PARENT_THREAD_ID]; + if (!_thread_queues[rt_id]) + _thread_queues[rt_id] = []; + _thread_queues[rt_id].push(id); + if (_log_threads) + { + log_thread(THREAD_STARTED, message, rt_id, id); + views.threads.update(); } - } + }; this.onThreadStoppedAt = function(status, message) { - const - RUNTIME_ID = 0, - THREAD_ID = 1, - SCRIPT_ID = 2, - LINE_NUMBER = 3, - STOPPED_REASON = 4, - BREAKPOINT_ID = 5; - + var RUNTIME_ID = 0; + var THREAD_ID = 1; var rt_id = message[RUNTIME_ID]; var thread_id = message[THREAD_ID]; - - // TODO clean up workaround for missing filtering - if (is_runtime_of_debug_context(rt_id)) + var current_thread = _thread_queues[rt_id]; + if (!stop_at.is_stopped && + (!current_thread /* in case the window was switched */ || + thread_id == current_thread.last)) { - - var current_thread = current_threads[rt_id]; - - // the current thread id must be set in 'thread-started' event - // TODO thread logic - if (!stop_at.is_stopped && - (!current_thread /* in case the window was switched */ || - thread_id == current_thread[current_thread.length - 1])) - { - stop_at.handle(message); - } - else - { - // it is sure to assume that per runtime there can be only one event - if (!stopped_threads[rt_id]) - { - stopped_threads[rt_id] = []; - } - stopped_threads[rt_id].push(message); - runtime_stopped_queue.push(rt_id); - } + stop_at.handle(message); } else { - opera.postError(ui_strings.S_DRAGONFLY_INFO_MESSAGE + - 'thread stopped not in debug context ') - services['ecmascript-debugger'].requestContinueThread(0, [rt_id, - thread_id, - 'run']); + if (!_stopped_threads[rt_id]) + _stopped_threads[rt_id] = []; + _stopped_threads[rt_id].push(message); + _runtime_stopped_queue.push(rt_id); } - if (__log_threads) + if (_log_threads) { log_thread(THREAD_STOPPED_AT, message, rt_id, thread_id); views.threads.update(); } - } + }; this.onThreadFinished = function(status, message) { /* TODO status "completed" | "unhandled-exception" | "aborted" | "cancelled-by-scheduler" */ - - const - RUNTIME_ID = 0, - THREAD_ID = 1, - STATUS = 2; - + var RUNTIME_ID = 0; + var THREAD_ID = 1; + var STATUS = 2; var rt_id = message[RUNTIME_ID]; - // workaround for missing filtering - if (is_runtime_of_debug_context(rt_id)) - { - var thread_id = message[THREAD_ID]; - clear_thread_id(rt_id, thread_id); + var thread_id = message[THREAD_ID]; + clear_thread_id(rt_id, thread_id); + if (message[STATUS] == "cancelled-by-scheduler" && stop_at.is_stopped) + stop_at.on_thread_cancelled(message); - if (message[STATUS] == "cancelled-by-scheduler" && stop_at.is_stopped) - { - stop_at.on_thread_cancelled(message); - } + if (!stop_at.is_stopped && _runtime_stopped_queue.length) + stop_at.handle(_stopped_threads[_runtime_stopped_queue.shift()].shift()); - if (!stop_at.is_stopped && runtime_stopped_queue.length) - { - stop_at.handle(stopped_threads[runtime_stopped_queue.shift()].shift()); - } + if( _log_threads ) + { + log_thread(THREAD_FINISHED, message, rt_id, thread_id); + views.threads.update(); + } + }; - if( __log_threads ) - { - log_thread(THREAD_FINISHED, message, rt_id, thread_id); - views.threads.update(); - } + this.onThreadMigrated = function(status, message) + { + var THREAD_ID = 0; + var FROM_RUNTIME_ID = 1; + var TO_RUNTIME_ID = 2; + var from_rt_id = message[FROM_RUNTIME_ID]; + var to_rt_id = message[TO_RUNTIME_ID]; + var thread_id = message[THREAD_ID]; + var from_thread_queue = _thread_queues[from_rt_id]; + if (from_thread_queue && from_thread_queue.contains(thread_id)) + { + clear_thread_id(from_rt_id, thread_id); + if (!_thread_queues[to_rt_id]) + _thread_queues[to_rt_id] = []; + _thread_queues[to_rt_id].push(thread_id); } else - { opera.postError(ui_strings.S_DRAGONFLY_INFO_MESSAGE + - 'thread finished not in debug context') - } - } + "not possible to migrate thread"); + }; - // messages.post('host-state', {state: 'ready'}); - // fires when stop_at releases the control to the host - // if there is already a event in the queue - // it has to be handled here - var onHostStateChange = function(msg) + // messages.post('host-state', {state: 'ready'}); + // fires when stop_at releases the control to the host + // if there is already a event in the queue + // it has to be handled here + var onHostStateChange = function(msg) + { + if (!stop_at.is_stopped && _runtime_stopped_queue.length) { - if (!stop_at.is_stopped && runtime_stopped_queue.length) - { - stop_at.handle(stopped_threads[runtime_stopped_queue.shift()].shift()); - } + stop_at.handle(_stopped_threads[_runtime_stopped_queue.shift()].shift()); } + } - /* - - 1 - - -*/ this.onRuntimeStopped = function(status, message) { var rt_id = message[0]; @@ -1496,6 +1413,11 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) self.onThreadFinished(status, message); } + ecma_debugger.onThreadMigrated = function(status, message) + { + self.onThreadMigrated(status, message); + } + ecma_debugger.onParseError = function(status, message) { self.onParseError(status, message); diff --git a/src/ecma-debugger/tabs.js b/src/ecma-debugger/tabs.js index 61a8e8e01..152b89858 100644 --- a/src/ecma-debugger/tabs.js +++ b/src/ecma-debugger/tabs.js @@ -116,11 +116,11 @@ cls.EcmascriptDebugger["6.0"].HostTabs = function() if(this._has_changed(rt_ids, __activeTab)) { __activeTab = rt_ids; + cleanUpEventListener(); for (var ev = null, i = 0; ev = activeEvents[i]; i++) { __addEvenetListener(ev.type, ev.cb, ev.prevent_default, ev.stop_propagation); } - cleanUpEventListener(); this.post_messages(); } } @@ -206,7 +206,6 @@ cls.EcmascriptDebugger["6.0"].HostTabs = function() document_map[runtime_id] = node_id; for( ; ev_listener = __get_document_id[runtime_id][i]; i++) { - // __get_document_id[rt_p].push([rt_p, event_type, callback, prevent_default, stop_propagation]) event_type = ev_listener[1]; callback = ev_listener[2]; prevent_default = ev_listener[3]; @@ -225,8 +224,12 @@ cls.EcmascriptDebugger["6.0"].HostTabs = function() } else { - opera.postError(ui_strings.S_DRAGONFLY_INFO_MESSAGE + - 'Error in host_tabs handleAddEventWithDocument'); + cleanUpEventListener(); + if (__activeTab.contains(runtime_id)) + { + opera.postError(ui_strings.S_DRAGONFLY_INFO_MESSAGE + + "Error in host_tabs handleAddEventWithDocument"); + } } } From 345b2822f3066c4252d00f520e20e0a10fed3efe Mon Sep 17 00:00:00 2001 From: Chris K Date: Fri, 20 Jul 2012 16:38:19 +0200 Subject: [PATCH 02/27] DFL-1360 Remeber selected element in DOM view between reloads. --- src/ecma-debugger/dominspection/domdata.js | 46 ++++++++++++++++++--- src/ecma-debugger/runtime_onload_handler.js | 27 +++++++++--- 2 files changed, 61 insertions(+), 12 deletions(-) diff --git a/src/ecma-debugger/dominspection/domdata.js b/src/ecma-debugger/dominspection/domdata.js index e0de6ef08..a5e23180c 100644 --- a/src/ecma-debugger/dominspection/domdata.js +++ b/src/ecma-debugger/dominspection/domdata.js @@ -58,6 +58,7 @@ cls.EcmascriptDebugger["6.0"].DOMData = function(view_id) this._reset_spotlight_timeouts = new Timeouts(); this._is_waiting = false; this._editor_active = false; + this._last_selectors = {}; this._spotlight = function(event) { @@ -111,7 +112,14 @@ cls.EcmascriptDebugger["6.0"].DOMData = function(view_id) { if (!this._data.length && this._element_selected_state == CHECKED) { - this._get_initial_view(this._data_runtime_id); + var rt_id = this._data_runtime_id; + if (runtime_onload_handler.is_loaded(rt_id)) + this._get_initial_view(rt_id); + else + { + var cb = this._get_initial_view.bind(this, rt_id); + runtime_onload_handler.register(rt_id, cb, cb, 500); + } } else if (this._element_selected_state != CHECKED && this._element_selected_state != CHECK_AGAIN_NO_RUNTIME) @@ -212,11 +220,11 @@ cls.EcmascriptDebugger["6.0"].DOMData = function(view_id) this._get_selected_element = function(rt_id) { - var tag = tagManager.set_callback(this, this._on_element_selected, [rt_id, true]); + var tag = tagManager.set_callback(this, this._on_object_selected, [rt_id, true]); window.services['ecmascript-debugger'].requestGetSelectedObject(tag); } - this._on_element_selected = function(status, message, rt_id, show_initial_view) + this._on_object_selected = function(status, message, rt_id, show_initial_view) { // If the window ID is not the debug context, the runtime ID will not be set const OBJECT_ID = 0, WINDOW_ID = 1, RUNTIME_ID = 2; @@ -419,8 +427,13 @@ cls.EcmascriptDebugger["6.0"].DOMData = function(view_id) this._get_initial_view = function(rt_id) { + var last_selector = this._last_selectors[window.runtimes.getActiveWindowId()]; + var query_last_selector = last_selector + ? "document.querySelector(\"" + last_selector + "\") || " + : ""; var tag = tagManager.set_callback(this, this._handle_initial_view, [rt_id]); - var script_data = "return ( document.body || document.documentElement )"; + var script_data = "return (" + query_last_selector + + "document.body || document.documentElement)"; services['ecmascript-debugger'].requestEval(tag, [rt_id, 0, 0, script_data]); } @@ -457,6 +470,22 @@ cls.EcmascriptDebugger["6.0"].DOMData = function(view_id) 'this._handle_snapshot in dom_data has failed'); } + this._on_element_selected = function(msg) + { + var win_id = window.runtimes.getActiveWindowId(); + var css_path = this.get_css_path(msg.obj_id, null, true, false, true); + var is_first = false; + var selector = css_path.reduce(function(sel, ele) + { + sel = sel + ele.name + (is_first ? ":first-child " : " ") + + (ele.combinator ? ele.combinator + " " : ""); + is_first = ele.combinator == ">"; + return sel; + }, ""); + if (selector) + this._last_selectors[win_id] = selector; + }; + /* implementation */ @@ -469,7 +498,10 @@ cls.EcmascriptDebugger["6.0"].DOMData = function(view_id) if (runtime_onload_handler.is_loaded(rt_id)) this._get_initial_view(rt_id); else - runtime_onload_handler.register(rt_id, this._get_initial_view.bind(this, rt_id)); + { + var cb = this._get_initial_view.bind(this, rt_id); + runtime_onload_handler.register(rt_id, cb, cb); + } } this._is_waiting = true; }).bind(this); @@ -490,7 +522,7 @@ cls.EcmascriptDebugger["6.0"].DOMData = function(view_id) { ecma_debugger.onObjectSelected = ecma_debugger.handleGetSelectedObject = - this._on_element_selected.bind(this); + this._on_object_selected.bind(this); } /* initialisation */ @@ -509,6 +541,7 @@ cls.EcmascriptDebugger["6.0"].DOMData = function(view_id) this._set_reset_spotlight_bound = this._set_reset_spotlight.bind(this); this._on_top_runtime_update_bound = this._on_top_runtime_update.bind(this); this._on_dom_editor_active_bound = this._on_dom_editor_active.bind(this); + this._on_element_selected_bound = this._on_element_selected.bind(this); this._init(0, 0); @@ -522,6 +555,7 @@ cls.EcmascriptDebugger["6.0"].DOMData = function(view_id) messages.addListener('top-runtime-updated', this._on_top_runtime_update_bound); messages.addListener('dom-editor-active', this._on_dom_editor_active_bound); messages.addListener('profile-disabled', this._on_profile_disabled_bound); + messages.addListener("element-selected", this._on_element_selected_bound); }; cls.EcmascriptDebugger["6.0"].DOMData.prototype = cls.EcmascriptDebugger["6.0"].InspectableDOMNode.prototype; diff --git a/src/ecma-debugger/runtime_onload_handler.js b/src/ecma-debugger/runtime_onload_handler.js index 813b653a3..1027dbdb7 100644 --- a/src/ecma-debugger/runtime_onload_handler.js +++ b/src/ecma-debugger/runtime_onload_handler.js @@ -26,6 +26,7 @@ window.cls.EcmascriptDebugger["6.0"].RuntimeOnloadHandler = function() { this._rts = {}; this._onload_handlers = {}; + this._error_handlers = {}; this._rts_checked = {}; }; @@ -69,7 +70,7 @@ window.cls.EcmascriptDebugger["6.0"].RuntimeOnloadHandler = function() this._call_callbacks(this._error_handlers[rt_id]); }; - this._register = function(rt_id, callback, error_callback) + this.register = function(rt_id, callback, error_callback, timeout) { if (!this._onload_handlers[rt_id]) { @@ -88,16 +89,29 @@ window.cls.EcmascriptDebugger["6.0"].RuntimeOnloadHandler = function() for (var i = 0, cb; (cb = callbacks[i]) && cb != callback; i++); callbacks[i] = error_callback; } + if (timeout) + { + var handler = this._timeout_handler.bind(this, rt_id, callback); + setTimeout(handler, timeout); + } }; - this.is_loaded = function(rt_id) + this.register_onload_handler = this.register; + + this._timeout_handler = function(rt_id, callback, error_callback) { - return this._rts[rt_id] == COMPLETE; + var cbs = this._onload_handlers[rt_id]; + if (cbs) + { + var pos = cbs.indexOf(callback); + if (pos > -1) + cbs.splice(pos, 1)[0](); + } }; - this.register_onload_handler = function(rt_id, callback, error_callback) + this.is_loaded = function(rt_id) { - this._register(rt_id, callback, error_callback); + return this._rts[rt_id] == COMPLETE; }; this._on_thread_stopped = function(msg) @@ -118,7 +132,7 @@ window.cls.EcmascriptDebugger["6.0"].RuntimeOnloadHandler = function() { this._rts[rt_id] = COMPLETE; if (this._onload_handlers[rt_id]) - this._call_callbacks(rt_id); + this._call_callbacks(this._onload_handlers[rt_id]); } }; @@ -130,6 +144,7 @@ window.cls.EcmascriptDebugger["6.0"].RuntimeOnloadHandler = function() this._rts_checked = {}; this._rts_is_checking = {}; this._blocked_rts = {}; + this._timeouts = {}; this._esde = window.services['ecmascript-debugger']; this._tagman = window.tag_manager; var msgs = window.messages; From 95ab36ed17889087a6c1b80c0eabe89c6fe6505a Mon Sep 17 00:00:00 2001 From: Chris K Date: Fri, 20 Jul 2012 17:28:38 +0200 Subject: [PATCH 03/27] DFL-3358 The tooltip in Scripts must take the runtime of the script to evaluate a selection. --- src/ecma-debugger/jssourcetooltip.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/ecma-debugger/jssourcetooltip.js b/src/ecma-debugger/jssourcetooltip.js index ecf715249..5aa47b54d 100644 --- a/src/ecma-debugger/jssourcetooltip.js +++ b/src/ecma-debugger/jssourcetooltip.js @@ -155,11 +155,16 @@ cls.JSSourceTooltip = function(view) if (script_text != _last_script_text) { + var rt_id = script.runtime_id; + var thread_id = 0; + var frame_index = 0; _last_script_text = script_text; var ex_ctx = window.runtimes.get_execution_context(); - var rt_id = ex_ctx.rt_id; - var thread_id = ex_ctx.thread_id; - var frame_index = ex_ctx.frame_index; + if (ex_ctx.rt_id == rt_id) + { + thread_id = ex_ctx.thread_id; + frame_index = ex_ctx.frame_index; + } var args = [script, line_number, char_offset, box, sel, rt_id, script_text]; var tag = _tagman.set_callback(null, _handle_script, args); var msg = [rt_id, thread_id, frame_index, script_text]; From 1a050296b0be5198a5ebc561d23e699eac8307fe Mon Sep 17 00:00:00 2001 From: Chris K Date: Tue, 24 Jul 2012 18:49:13 +0200 Subject: [PATCH 04/27] Code cleanup. --- src/ecma-debugger/action_handler.js | 59 --- src/ecma-debugger/runtimes.js | 768 ++++++++++------------------ 2 files changed, 281 insertions(+), 546 deletions(-) diff --git a/src/ecma-debugger/action_handler.js b/src/ecma-debugger/action_handler.js index 51fc13877..929d994a4 100644 --- a/src/ecma-debugger/action_handler.js +++ b/src/ecma-debugger/action_handler.js @@ -94,65 +94,6 @@ window.eventHandlers.click['examine-object-2'] = function(event, target) } }; -window.eventHandlers.click['show-scripts'] = function(event) -{ - var runtime_id = event.target.getAttribute('runtime_id'); - var scripts = runtimes.getScripts(runtime_id); - var scripts_container = event.target.parentNode.getElementsByTagName('ul')[0]; - var script = null, i = 0; - - if (scripts_container) - { - event.target.parentNode.removeChild(scripts_container); - event.target.style.removeProperty('background-position'); - runtimes.setUnfolded(runtime_id, 'script', false); - } - else - { - scripts_container = ['ul']; - for ( ; script = scripts[i]; i++) - { - scripts_container.push(templates.scriptLink(script)); - } - scripts_container.splice(scripts_container.length, 0, 'runtime-id', runtime_id); - event.target.parentNode.render(scripts_container); - event.target.style.backgroundPosition = '0 -11px'; - runtimes.setUnfolded(runtime_id, 'script', true); - } -}; - -window.eventHandlers.click['show-stylesheets'] = function(event, target) -{ - var rt_id = target.getAttribute('runtime_id'); - // stylesheets.get_stylesheets will call this function again if data is not avaible - // handleGetAllStylesheets in stylesheets will - // set for this reason __call_count on the event object - var sheets = cls.Stylesheets.get_instance().get_stylesheets(rt_id, arguments); - if (sheets) - { - var container = event.target.parentNode.getElementsByTagName('ul')[0]; - var sheet = null, i = 0; - if (container) - { - target.parentNode.removeChild(container); - target.style.removeProperty('background-position'); - runtimes.setUnfolded(rt_id, 'css', false); - } - else - { - container = ['ul']; - for ( ; sheet = sheets[i]; i++) - { - container.push(templates.sheetLink(sheet, i)); - } - container.splice(container.length, 0, 'runtime-id', rt_id); - event.target.parentNode.render(container); - event.target.style.backgroundPosition = '0 -11px'; - runtimes.setUnfolded(rt_id, 'css', true); - } - } -}; - window.eventHandlers.click['continue'] = function(event) { this.broker.dispatch_action('global', event.target.id); diff --git a/src/ecma-debugger/runtimes.js b/src/ecma-debugger/runtimes.js index 9061ab53e..6d4b94271 100644 --- a/src/ecma-debugger/runtimes.js +++ b/src/ecma-debugger/runtimes.js @@ -48,97 +48,60 @@ cls.EcmascriptDebugger["6.0"].ExtensionRuntime = function(rt) // TODO clean up in regard of protocol 4 cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) { - - const - RUNTIME_LIST = 0, + var RUNTIME_LIST = 0; // sub message RuntimeInfo - RUNTIME_ID = 0, - HTML_FRAME_PATH = 1, - WINDOW_ID = 2, - OBJECT_ID = 3, - URI = 4, - DESCRIPTION = 5, - THREAD_STARTED = 0, - THREAD_STOPPED_AT = 1, - THREAD_FINISHED = 2; - + var RUNTIME_ID = 0; + var HTML_FRAME_PATH = 1; + var WINDOW_ID = 2; + var OBJECT_ID = 3; + var URI = 4; + var DESCRIPTION = 5; + var THREAD_STARTED = 0; + var THREAD_STOPPED_AT = 1; + var THREAD_FINISHED = 2; var SUCCESS = 0; - var __runtimes = {}; - - var __rt_class = cls.EcmascriptDebugger["6.0"].Runtime; - var __dom_rt_class = cls.EcmascriptDebugger["6.0"].DOMRuntime; - var __ext_rt_class = cls.EcmascriptDebugger["6.0"].ExtensionRuntime; - - var __old_runtimes = {}; - - var __runtimes_arr = []; // runtime ids - - var __window_ids = {}; - var __windows_reloaded = {}; - var __selected_window = ''; - - var __threads = []; - - var _log_threads = false; - - var __windowsFolding = {}; - - var __old_selected_window = ''; - - - var view_ids = ['threads']; - - var runtime_views = []; - - var __replaced_scripts = {}; - - var __selected_runtime_id = ''; - - var __next_runtime_id_to_select = ''; - - var __selected_script = ''; - var __selected_script_type = ''; - + var _runtimes = {}; + var _rt_class = cls.EcmascriptDebugger["6.0"].Runtime; + var _dom_rt_class = cls.EcmascriptDebugger["6.0"].DOMRuntime; + var _ext_rt_class = cls.EcmascriptDebugger["6.0"].ExtensionRuntime; + var _old_runtimes = {}; + var _runtime_ids = []; + var _window_ids = {}; + var _windows_reloaded = {}; + var _selected_window = ''; + var _threads = []; + var _old_selected_window = ""; + var _replaced_scripts = {}; + var _selected_runtime_id = ""; + var _next_runtime_id_to_select = ""; + var _selected_script_id = ''; + var _selected_script_type = ""; var _is_first_call_create_all_runtimes_on_debug_context_change = true; - - var __window_top_rt_map = {}; - - var __submitted_scripts = []; - + var _window_top_rt_map = {}; + var _submitted_scripts = []; // used to set the top runtime automatically // on start or on debug context change - var debug_context_frame_path = ''; - - // TODO check if that can be removed completly - var updateRuntimeViews = function() - { - var rt = '', i = 0; - for( ; rt = runtime_views[i]; i++ ) - { - views[rt].update(); - } - } - - var self = this; - var ecma_debugger = window.services['ecmascript-debugger']; + var _debug_context_frame_path = ""; + var _ecma_debugger = window.services['ecmascript-debugger']; var _on_window_updated = function(msg) { - for( var r in __runtimes ) + for( var r in _runtimes ) { - if (__runtimes[r] && __runtimes[r].window_id == msg.window_id && __runtimes[r].is_top) + if (_runtimes[r] && _runtimes[r].window_id == msg.window_id && _runtimes[r].is_top) { - __runtimes[r].title = msg.title; - window.messages.post('top-runtime-updated', {rt: __runtimes[r]}); + _runtimes[r].title = msg.title; + window.messages.post('top-runtime-updated', {rt: _runtimes[r]}); break; } } - } + }; - var _on_debug_context_selected = function(msg) { - self.setActiveWindowId(msg.window_id); - } + this._on_debug_context_selected = function(msg) + { + this.setActiveWindowId(msg.window_id); + }; var is_injected_script = function(script_type) { @@ -149,123 +112,98 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) "User JS", "Extension JS" ].indexOf(script_type) != -1); - } + }; var onResetState = function() { - __runtimes = {}; - __old_runtimes = {}; - __runtimes_arr = []; // runtime ids - __window_ids = {}; - __windows_reloaded = {}; - __selected_window = ''; - __threads = []; - _log_threads = false; - __windowsFolding = {}; - __old_selected_window = ''; - __selected_runtime_id = ''; - __next_runtime_id_to_select = ''; - __selected_script = ''; - updateRuntimeViews(); - } + _runtimes = {}; + _old_runtimes = {}; + _runtime_ids = []; // runtime ids + _window_ids = {}; + _windows_reloaded = {}; + _selected_window = ''; + _threads = []; + _old_selected_window = ''; + _selected_runtime_id = ''; + _next_runtime_id_to_select = ''; + _selected_script_id = ''; + }; var _on_profile_disabled = function(msg) { if (msg.profile == window.app.profiles.DEFAULT) { - __runtimes = {}; - __old_runtimes = {}; - __runtimes_arr = []; // runtime ids - __window_ids = {}; - __windows_reloaded = {}; - __threads = []; - _log_threads = false; - __windowsFolding = {}; - __selected_runtime_id = ''; - __next_runtime_id_to_select = ''; - __selected_script = ''; + _runtimes = {}; + _old_runtimes = {}; + _runtime_ids = []; // runtime ids + _window_ids = {}; + _windows_reloaded = {}; + _threads = []; + _selected_runtime_id = ''; + _next_runtime_id_to_select = ''; + _selected_script_id = ''; _thread_queues = {}; - updateRuntimeViews(); } }; - var _on_profile_enabled = function(msg) + this._on_profile_enabled = function(msg) { if (msg.profile == window.app.profiles.DEFAULT) { - __windows_reloaded = {}; + _windows_reloaded = {}; var dbg_ctx = window.window_manager_data.get_debug_context(); if (dbg_ctx) { - var tag = window.tag_manager.set_callback(null, set_new_debug_context, [dbg_ctx]); - ecma_debugger.requestListRuntimes(tag, [[],1]); + var tag = window.tag_manager.set_callback(this, this._set_new_debug_context, [dbg_ctx]); + _ecma_debugger.requestListRuntimes(tag, [[],1]); } } }; var registerRuntime = function(id) { - - if (!(id in __runtimes)) + if (!(id in _runtimes)) { opera.postError(ui_strings.S_DRAGONFLY_INFO_MESSAGE + 'runtime id does not exist'); - __runtimes[id] = null; + _runtimes[id] = null; var tag = tagManager.set_callback(this, this.handleListRuntimes); services['ecmascript-debugger'].requestListRuntimes(tag, [id]); } - } + }; - var removeRuntime = function(id) + this._remove_runtime = function(id) { + for (var i = 0, cur; cur = _runtime_ids[i] && cur != id; i++); + if (cur) + _runtime_ids.splice(cur, 1); - var sc = null , cur = '', i = 0; - for( ; cur = __runtimes_arr[i] && cur != id; i++); - if(cur) - { - __runtimes_arr.splice(cur, 1); - } - /* - TODO check for existing breakpoints before cleaning up - for( sc in __scripts ) - { - if( __scripts[sc].runtime_id == id ) - { - delete __scripts[sc]; - } - } - */ - if (__selected_runtime_id == id) + if (_selected_runtime_id == id) { - __selected_runtime_id = ''; - if (__runtimes[id] && !__runtimes[id].is_top) + _selected_runtime_id = ''; + if (_runtimes[id] && !_runtimes[id].is_top) { - var rt = __window_top_rt_map[__runtimes[id].window_id]; + var rt = _window_top_rt_map[_runtimes[id].window_id]; if (rt) { - self.setSelectedRuntime(rt); + this.setSelectedRuntime(rt); window['cst-selects']['cmd-runtime-select'].updateElement(); } } } messages.post('runtime-destroyed', {id: id}); - __old_runtimes[id] = __runtimes[id]; - delete __runtimes[id]; - } + _old_runtimes[id] = _runtimes[id]; + delete _runtimes[id]; + }; - var cleanupWindow = function(win_id, rt_id) + this._reset_window = function(win_id) { - // assert there is not yet a child runtime from this new top runtime - // remove all runtimes in that window - var cur = ''; - for( cur in __runtimes ) + for (var cur in _runtimes) { - if( __runtimes[cur] && __runtimes[cur].window_id == win_id ) - { - removeRuntime(__runtimes[cur].runtime_id); - } + if (_runtimes[cur] && _runtimes[cur].window_id == win_id) + this._remove_runtime(_runtimes[cur].runtime_id); } - } + }; // If the script _is_ a console script it is also // removed from the list of console scripts. @@ -273,45 +211,34 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) // would by coincidence create a script as submitted in the console. var is_console_script = function(script) { - var index = __submitted_scripts.indexOf(script); + var index = _submitted_scripts.indexOf(script); if (index > -1) - __submitted_scripts.splice(index, 1); + _submitted_scripts.splice(index, 1); return index != -1; }; this.handleRuntimeStarted = function(xml) { parseRuntime(xml); - } + }; this.handleRuntimesReplay = function(xml) { parseRuntime(xml); - } + }; var isTopRuntime = function(rt) { return (rt.html_frame_path.indexOf('_top') == 0 && rt.html_frame_path.indexOf('[') == -1); - } - - /* - - - 1 - _top - 1 - 1 - http://dev.opera.com/ - + }; - */ var checkOldRuntimes = function(runtime) { var cur = '', old_rt = null; - for( cur in __old_runtimes ) + for( cur in _old_runtimes ) { - old_rt = __old_runtimes[cur]; + old_rt = _old_runtimes[cur]; if( old_rt && old_rt.uri == runtime.uri && old_rt.window_id == runtime.window_id @@ -320,25 +247,24 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) runtime['unfolded-script'] = old_rt['unfolded-script'] || false; runtime['unfolded-css'] = old_rt['unfolded-css'] || false; // the old runtimes are needed to find "known" scripts - // delete __old_runtimes[cur]; + // delete _old_runtimes[cur]; return; } } - } + }; this.handleListRuntimes = function(status, message) { - message[RUNTIME_LIST].forEach(this.handleRuntime, this); - } + message[RUNTIME_LIST].forEach(this._handle_runtime, this); + }; this.onRuntimeStarted = function(status, message) { - this.handleRuntime(message); - } + this._handle_runtime(message); + }; - this.handleRuntime = function(r_t) + this._handle_runtime = function(r_t) { - /* const RUNTIME_LIST = 0, @@ -363,35 +289,27 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) var host_tabs_update_active_tab = false; var host_tabs_set_active_tab = 0; - // with the createAllRuntimes call and the runtime-started event - // it can happen that a runtime get parsed twice - if(runtimeId && !__runtimes[runtimeId] ) + // With the createAllRuntimes call and the runtime-started event + // it can happen that a runtime get parsed twice. + if (runtimeId && !_runtimes[runtimeId]) { - length = __runtimes_arr.length; - for( k = 0; k < length && runtimeId != __runtimes_arr[k]; k++); - if( k == length ) - { - __runtimes_arr[k] = runtimeId; - } - - runtime = new __rt_class(r_t); + if (!_runtime_ids.contains(runtimeId)) + _runtime_ids.push(runtimeId); + var runtime = new _rt_class(r_t); if (!runtime.window_id) - runtime.window_id = __selected_window; + runtime.window_id = _selected_window; checkOldRuntimes(runtime); - if( runtime.is_top = isTopRuntime(runtime) ) + if (runtime.is_top = isTopRuntime(runtime)) { var win_id = runtime.window_id; - if (win_id in __window_ids) - { - cleanupWindow(win_id, runtimeId); - } + if (win_id in _window_ids) + this._reset_window(win_id); else - { - __window_ids[win_id] = true; - } - __window_top_rt_map[runtime.window_id] = runtime; + _window_ids[win_id] = true; + + _window_top_rt_map[runtime.window_id] = runtime; /* pop-ups are top runtimes but part of the debug context. right now we don't get the correct info in the message @@ -399,58 +317,58 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) for now we trust the window manager and our setting to just use one window-id as filter. that basically means that a top runtime with a differnt window id - than __selected_window must actually be a pop-up + than _selected_window must actually be a pop-up */ - if( __selected_window && win_id != __selected_window ) + if (_selected_window && win_id != _selected_window) { /* it is a pop-up, but the id of the opener window is an assumption here, certainly not true in all cases. */ - runtime.opener_window_id = __selected_window; - } - if (!debug_context_frame_path) - { - debug_context_frame_path = runtime.html_frame_path; + runtime.opener_window_id = _selected_window; } - __selected_script = ''; - } - runtime.title = (window.window_manager_data.get_window(win_id) || {}).title; - __runtimes[runtimeId] = runtime; - // TODO check if that is still needed - if(__next_runtime_id_to_select == runtimeId) - { - self.setSelectedRuntime(runtime); - __next_runtime_id_to_select = ''; - } - if( runtime.window_id == __old_selected_window ) - { - self.setActiveWindowId(__old_selected_window); - host_tabs_set_active_tab = __old_selected_window; - __old_selected_window = ''; + if (!_debug_context_frame_path) + _debug_context_frame_path = runtime.html_frame_path; + + _selected_script_id = ""; } - else + + var title = window.window_manager_data.get_window(win_id); + if (title) + runtime.title = title; + _runtimes[runtimeId] = runtime; + // TODO check if that is still needed + if(_next_runtime_id_to_select == runtimeId) { - // TODO still needed? - updateRuntimeViews(); + this.setSelectedRuntime(runtime); + _next_runtime_id_to_select = ""; } - if(__windows_reloaded[runtime.window_id] == 1) + + if (runtime.window_id == _old_selected_window) { - __windows_reloaded[runtime.window_id] = 2; + this.setActiveWindowId(_old_selected_window); + host_tabs_set_active_tab = _old_selected_window; + _old_selected_window = ""; } - if( debug_context_frame_path == runtime.html_frame_path && - __selected_window == runtime.window_id && - runtimeId != __selected_runtime_id ) + + if (_windows_reloaded[runtime.window_id] == 1) + _windows_reloaded[runtime.window_id] = 2; + + if (_debug_context_frame_path == runtime.html_frame_path && + _selected_window == runtime.window_id && + runtimeId != _selected_runtime_id ) { - self.setSelectedRuntimeId(runtimeId); + this.setSelectedRuntimeId(runtimeId); } - if( runtime.window_id == __selected_window || - runtime.opener_window_id == __selected_window ) + + if (runtime.window_id == _selected_window || + runtime.opener_window_id == _selected_window) { host_tabs_update_active_tab = true; } + if(runtime.is_top) { views['js_source'].update(); @@ -458,47 +376,44 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) window['cst-selects']['cmd-runtime-select'].updateElement(); } } + if(host_tabs_set_active_tab) - { host_tabs.setActiveTab(host_tabs_set_active_tab); - } + if(host_tabs_update_active_tab) - { host_tabs.updateActiveTab(); - } - - } + }; this.runtime_has_dom = function(rt_id) { // description is only available in newer Core versions, so if it's undefined it has DOM - return __runtimes[rt_id] && (__runtimes[rt_id].description == "document" || - __runtimes[rt_id].description === undefined); + return _runtimes[rt_id] && (_runtimes[rt_id].description == "document" || + _runtimes[rt_id].description === undefined); }; - var __scripts = {}; + var _scripts = {}; /** checks if that script is already known from a previous runtime * checks first for the url and the for the script data. * Both checks are not really reliable. * TODO we need a better logic to handle this */ - var registerScript = function(script) + this._register_script = function(script) { var sc = null, is_known = false; var new_script_id = script.script_id; - var new_rt = __runtimes[script.runtime_id]; + var new_rt = _runtimes[script.runtime_id]; var old_rt = null; var line_nr = ''; - for (sc in __scripts) + for (sc in _scripts) { - old_rt = __runtimes[__scripts[sc].runtime_id] || - __old_runtimes[__scripts[sc].runtime_id] || {}; + old_rt = _runtimes[_scripts[sc].runtime_id] || + _old_runtimes[_scripts[sc].runtime_id] || {}; // TODO check for script-type as well? if (( - (__scripts[sc].uri && __scripts[sc].uri == script.uri) - || __scripts[sc].script_data == script.script_data + (_scripts[sc].uri && _scripts[sc].uri == script.uri) + || _scripts[sc].script_data == script.script_data ) && old_rt.uri == new_rt.uri && (old_rt.window_id == new_rt.window_id || @@ -510,32 +425,32 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) break; } } - __scripts[new_script_id] = script; + _scripts[new_script_id] = script; if (is_known) { - self._bps.copy_breakpoints(script, __scripts[sc]); - if (__scripts[sc].script_id == __selected_script) + this._bps.copy_breakpoints(script, _scripts[sc]); + if (_scripts[sc].script_id == _selected_script_id) { - __selected_script = new_script_id; + _selected_script_id = new_script_id; } // the script could be in a pop-up window if (old_rt.window_id == new_rt.window_id) { - __replaced_scripts[sc] = script; - delete __scripts[sc]; + _replaced_scripts[sc] = script; + delete _scripts[sc]; } } var callstack_scripts = window.stop_at.get_script_ids_in_callstack(); - if ((!__selected_script && + if ((!_selected_script_id && (!script.is_console_script || callstack_scripts.contains(new_script_id))) || - (is_injected_script(__selected_script_type) && + (is_injected_script(_selected_script_type) && !is_injected_script(script.script_type))) { - __selected_script = new_script_id; - __selected_script_type = script.script_type; + _selected_script_id = new_script_id; + _selected_script_type = script.script_type; views['js_source'].update(); window['cst-selects']['js-script-select'].updateElement(); window['cst-selects']['cmd-runtime-select'].updateElement(); @@ -573,7 +488,7 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) log.push(INDENT, 'thread id: ', thread_id, NL); /* thread.threads = []; - for( i = 0; key = __runtimes_arr[i]; i++ ) + for( i = 0; key = _runtime_ids[i]; i++ ) { if (cur in _thread_queues && _thread_queues[cur].length ) { @@ -602,45 +517,17 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) break; } } - __threads.push(log.join('')); - } - - var onSettingChange = function(msg) - { - var msg_id = msg.id, id = '', i = 0; - for( ; ( id = view_ids[i] ) && id != msg_id; i++); - if( id ) - { - switch (msg.key) - { - case 'log-threads': - { - _log_threads = settings[id].get(msg.key); - break; - } - } - } - } - - var onActiveTab = function(msg) - { - - } - - var on_services_created = function(msg) - { - //_log_threads = window.settings['threads'].get('log-threads'); + _threads.push(log.join('')); } this.setActiveWindowId = function(window_id) { // set the debug context - if (window_id != __selected_window) + if (window_id != _selected_window) { - __selected_window = window_id; + _selected_window = window_id; cleanUpThreadOnContextChange(); settings.runtimes.set('selected-window', window_id); - updateRuntimeViews(); } } @@ -650,9 +537,9 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) // called to create all runtimes on setting or changing the debug context this.createAllRuntimesOnDebugContextChange = function(win_id) { - debug_context_frame_path = ''; - __windows_reloaded = {}; - __selected_script = ''; + _debug_context_frame_path = ''; + _windows_reloaded = {}; + _selected_script_id = ''; /* if( _is_first_call_create_all_runtimes_on_debug_context_change ) { @@ -661,45 +548,45 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) _is_first_call_create_all_runtimes_on_debug_context_change = false; } */ - var tag = tagManager.set_callback(null, set_new_debug_context, [win_id]); - ecma_debugger.requestListRuntimes(tag, [[],1]); + var tag = tagManager.set_callback(this, this._set_new_debug_context, [win_id]); + _ecma_debugger.requestListRuntimes(tag, [[],1]); } - var set_new_debug_context = function(status, message, win_id) + this._set_new_debug_context = function(status, message, win_id) { if (status !== SUCCESS) return; if (message[RUNTIME_LIST]) - message[RUNTIME_LIST].forEach(self.handleRuntime, self); + message[RUNTIME_LIST].forEach(this._handle_runtime, this); host_tabs.setActiveTab(win_id); if (message[RUNTIME_LIST] && message[RUNTIME_LIST].length) { - if (settings.runtimes.get('reload-runtime-automatically')) - self.reloadWindow(); + if (settings.runtimes.get("reload-runtime-automatically")) + this.reloadWindow(); } else { - if (win_id in __window_ids) - cleanupWindow(win_id); + if (win_id in _window_ids) + this._reset_window(win_id); else - __window_ids[win_id] = true; - __selected_runtime_id = ''; - __selected_script = ''; - views['js_source'].update(); - window['cst-selects']['js-script-select'].updateElement(); - window['cst-selects']['cmd-runtime-select'].updateElement(); + _window_ids[win_id] = true; + _selected_runtime_id = ""; + _selected_script_id = ""; + views["js_source"].update(); + window["cst-selects"]["js-script-select"].updateElement(); + window["cst-selects"]["cmd-runtime-select"].updateElement(); } } this.getThreads = function() { - return __threads; + return _threads; } this.clearThreadLog = function() { - __threads = []; + _threads = []; } this.onNewScript = function(status, message) @@ -711,7 +598,7 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) if( is_runtime_of_debug_context(script.runtime_id)) { registerRuntime(script.runtime_id); - registerScript(script); + this._register_script(script); } } @@ -725,9 +612,9 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) CONTEXT = 4, DESCRIPTION = 5; - if(__scripts[message[SCRIPT_ID]]) + if(_scripts[message[SCRIPT_ID]]) { - var error = __scripts[message[SCRIPT_ID]].parse_error = + var error = _scripts[message[SCRIPT_ID]].parse_error = { runtime_id: message[RUNTIME_ID], script_id: message[SCRIPT_ID], @@ -758,7 +645,7 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) // TODO client side therads handling needs a revision - var __thread_queues_obsolete = {}; + var _thread_queues_obsolete = {}; var _thread_queues = {}; var _runtime_stopped_queue = []; @@ -788,7 +675,7 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) services['ecmascript-debugger'].requestContinueThread(0, msg); } } - __thread_queues_obsolete = {}; + _thread_queues_obsolete = {}; _thread_queues = {}; _stopped_threads = {}; _runtime_stopped_queue = []; @@ -802,10 +689,10 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) is part of the debug context */ - var rt = __runtimes[rt_id]; - return rt && (rt.window_id == __selected_window || - (rt = __window_top_rt_map[rt.window_id]) && - rt.opener_window_id == __selected_window); + var rt = _runtimes[rt_id]; + return rt && (rt.window_id == _selected_window || + (rt = _window_top_rt_map[rt.window_id]) && + rt.opener_window_id == _selected_window); } var clear_thread_id = function(rt_id, thread_id) @@ -845,11 +732,6 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) if (!_thread_queues[rt_id]) _thread_queues[rt_id] = []; _thread_queues[rt_id].push(id); - if (_log_threads) - { - log_thread(THREAD_STARTED, message, rt_id, id); - views.threads.update(); - } }; this.onThreadStoppedAt = function(status, message) @@ -872,12 +754,6 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) _stopped_threads[rt_id].push(message); _runtime_stopped_queue.push(rt_id); } - - if (_log_threads) - { - log_thread(THREAD_STOPPED_AT, message, rt_id, thread_id); - views.threads.update(); - } }; this.onThreadFinished = function(status, message) @@ -896,12 +772,6 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) if (!stop_at.is_stopped && _runtime_stopped_queue.length) stop_at.handle(_stopped_threads[_runtime_stopped_queue.shift()].shift()); - - if( _log_threads ) - { - log_thread(THREAD_FINISHED, message, rt_id, thread_id); - views.threads.update(); - } }; this.onThreadMigrated = function(status, message) @@ -942,8 +812,7 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) var rt_id = message[0]; if(rt_id) { - removeRuntime(rt_id); - updateRuntimeViews(); + this._remove_runtime(rt_id); host_tabs.updateActiveTab(); messages.post('runtime-stopped', {id: rt_id} ); } @@ -951,12 +820,12 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) this.getActiveWindowId = function() { - return __selected_window; + return _selected_window; } this.get_dom_runtimes = function(get_scripts) { - var rts = this.getRuntimes(__selected_window); + var rts = this.getRuntimes(_selected_window); var rt = null; for (var i = 0; (rt = rts[i]) && !rt.selected; i++); if (!rt && rts[0]) @@ -976,7 +845,7 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) var owner_rt = rt_map[rt.uri]; if (owner_rt) { - var rt_obj = new __ext_rt_class(rt); + var rt_obj = new _ext_rt_class(rt); if (get_scripts) rt_obj.scripts = this.getScripts(rt_id, true); @@ -988,7 +857,7 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) } else { - var rt_obj = new __dom_rt_class(rt); + var rt_obj = new _dom_rt_class(rt); if (get_scripts) { var scripts = this.getScripts(rt_id, true); @@ -1021,13 +890,13 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) this.getRuntimes = function(window_id) { var ret = [], r = ''; - for( r in __runtimes ) + for( r in _runtimes ) { - if ( __runtimes[r] && __runtimes[r].window_id && - ( __runtimes[r].window_id == window_id || - __runtimes[r].opener_window_id == window_id ) ) + if ( _runtimes[r] && _runtimes[r].window_id && + ( _runtimes[r].window_id == window_id || + _runtimes[r].opener_window_id == window_id ) ) { - ret[ret.length] = __runtimes[r]; + ret[ret.length] = _runtimes[r]; } } return ret; @@ -1035,27 +904,27 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) this.getRuntime = function(rt_id) { - return __runtimes[rt_id] || null; + return _runtimes[rt_id] || null; } this.getRuntimeIdsFromWindow = function(window_id) { // first member is the top runtime var ret = [], r = ''; - for( r in __runtimes ) + for( r in _runtimes ) { - if ( __runtimes[r] && __runtimes[r].window_id && - ( __runtimes[r].window_id == window_id || - __runtimes[r].opener_window_id == window_id ) + if ( _runtimes[r] && _runtimes[r].window_id && + ( _runtimes[r].window_id == window_id || + _runtimes[r].opener_window_id == window_id ) ) { - if(__runtimes[r].is_top && !__runtimes[r].opener_window_id ) + if(_runtimes[r].is_top && !_runtimes[r].opener_window_id ) { - ret = [__runtimes[r].runtime_id].concat(ret); + ret = [_runtimes[r].runtime_id].concat(ret); } else { - ret[ret.length] = __runtimes[r].runtime_id; + ret[ret.length] = _runtimes[r].runtime_id; } } @@ -1065,22 +934,22 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) this.get_runtime_ids = function() { - return this.getRuntimeIdsFromWindow(__selected_window); + return this.getRuntimeIdsFromWindow(_selected_window); }; this.get_dom_runtime_ids = function() { - return this.getRuntimeIdsFromWindow(__selected_window).filter(this.runtime_has_dom); + return this.getRuntimeIdsFromWindow(_selected_window).filter(this.runtime_has_dom); }; this.getRuntimeIdWithURL = function(url) { var r = ''; - for( r in __runtimes ) + for( r in _runtimes ) { - if( __runtimes[r].uri == url ) + if( _runtimes[r].uri == url ) { - return __runtimes[r]; + return _runtimes[r]; } } return null; @@ -1088,11 +957,11 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) this.getURI = function(rt_id) { - for( var r in __runtimes ) + for( var r in _runtimes ) { - if( __runtimes[r].runtime_id == rt_id ) + if( _runtimes[r].runtime_id == rt_id ) { - return __runtimes[r].uri; + return _runtimes[r].uri; } } return ''; @@ -1100,25 +969,25 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) this.getScript = function(scriptId) { - return __scripts[scriptId] || __replaced_scripts[scriptId] || null; + return _scripts[scriptId] || _replaced_scripts[scriptId] || null; } this.getStoppedAt = function(scriptId) { - return __scripts[scriptId] && __scripts[scriptId].stop_ats || null; + return _scripts[scriptId] && _scripts[scriptId].stop_ats || null; } this.getScriptsRuntimeId = function(scriptId) { - return __scripts[scriptId] && __scripts[scriptId].runtime_id || null; + return _scripts[scriptId] && _scripts[scriptId].runtime_id || null; } this.getScriptSource = function(scriptId) { // script_data can be an empty string - if( __scripts[scriptId] ) + if( _scripts[scriptId] ) { - return __scripts[scriptId].script_data + return _scripts[scriptId].script_data } return null; } @@ -1133,9 +1002,9 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) var callstack_scripts = without_console_scripts ? window.stop_at.get_script_ids_in_callstack() : null; - for (var cur in __scripts) + for (var cur in _scripts) { - script = __scripts[cur]; + script = _scripts[cur]; if (script.runtime_id == runtime_id && (!without_console_scripts || !script.is_console_script || @@ -1147,31 +1016,17 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) return ret; } - this.setUnfolded = function(runtime_id, view, is_unfolded) - { - - if( __runtimes[runtime_id] ) - { - __runtimes[runtime_id]['unfolded-' + view] = is_unfolded; - } - } - - this.setWindowUnfolded = function(window_id, is_unfolded) - { - __windowsFolding[window_id] = is_unfolded; - } - this.setObserve = function(runtime_id, observe) { - if( __runtimes[runtime_id] ) + if( _runtimes[runtime_id] ) { - __runtimes[runtime_id]['observe'] = observe; + _runtimes[runtime_id]['observe'] = observe; } } this.getObserve = function(runtime_id) { - return __runtimes[runtime_id] && __runtimes[runtime_id]['observe'] || false; + return _runtimes[runtime_id] && _runtimes[runtime_id]['observe'] || false; } // this is a temporary solution as long as we don't have a concept for tabs @@ -1181,19 +1036,19 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) this.setSelectedRuntime = function(runtime) { var r = ''; - for( r in __runtimes ) + for( r in _runtimes ) { - if( __runtimes[r] == runtime ) + if( _runtimes[r] == runtime ) { - __runtimes[r]['selected'] = true; - __selected_runtime_id = __runtimes[r].runtime_id; + _runtimes[r]['selected'] = true; + _selected_runtime_id = _runtimes[r].runtime_id; } else { // the runtime could be registered but not jet parsed - if( __runtimes[r] ) + if( _runtimes[r] ) { - __runtimes[r]['selected'] = false; + _runtimes[r]['selected'] = false; } } } @@ -1201,47 +1056,35 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) // only one script can be selected at a time this.setSelectedScript = function( script_id ) { - __selected_script = script_id; + _selected_script_id = script_id; window['cst-selects']['js-script-select'].updateElement(); - - - /* - don't understand why this was done in this way - var scripts = this.getScripts(rt_id), script = null, i = 0; - for( ; script = scripts[i]; i++) - { - script.selected = script.script_id == script_id ; - } - */ } this.getSelectedScript = function() { - return __selected_script; + return _selected_script_id; } this.setSelectedRuntimeId = function(id) { - if(__runtimes[id]) + if (_runtimes[id]) { - this.setSelectedRuntime(__runtimes[id]); - // this is not clean - // views.runtimes.update(); + this.setSelectedRuntime(_runtimes[id]); } else { - __next_runtime_id_to_select = id; + _next_runtime_id_to_select = id; } } this.getSelectedRuntimeId = function() { - return __selected_runtime_id; + return _selected_runtime_id; } this.getSelecetdScriptIdFromSelectedRuntime = function() { - var scripts = this.getScripts(__selected_runtime_id), script = null, i = 0; + var scripts = this.getScripts(_selected_runtime_id), script = null, i = 0; for( ; script = scripts[i]; i++) { if( script.selected ) @@ -1254,17 +1097,17 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) this.getRuntimeIdWithScriptId = function(scriptId) { - return __scripts[scriptId] && __scripts[scriptId].runtime_id || null; + return _scripts[scriptId] && _scripts[scriptId].runtime_id || null; } this.reloadWindow = function() { - if (__selected_window) + if (_selected_window) { - if (!__windows_reloaded[__selected_window]) - __windows_reloaded[__selected_window] = 1; + if (!_windows_reloaded[_selected_window]) + _windows_reloaded[_selected_window] = 1; - var rt_id = this.getRuntimeIdsFromWindow(__selected_window)[0]; + var rt_id = this.getRuntimeIdsFromWindow(_selected_window)[0]; if (window.services['ecmascript-debugger'] && window.services['ecmascript-debugger'].is_enabled && // For background processes we can not use the exec service. @@ -1272,7 +1115,7 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) // Background processes so far are e.g. unite services or // extension background processes. // They all use the widget protocol. - ((rt_id && __runtimes[rt_id].uri.indexOf("widget://") != -1) || + ((rt_id && _runtimes[rt_id].uri.indexOf("widget://") != -1) || !(window.services.exec && window.services.exec.is_implemented))) { var msg = [rt_id, 0, 0, 'location.reload()']; @@ -1290,7 +1133,7 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) this.isReloadedWindow = function(window_id) { - return __windows_reloaded[window_id] == 2; + return _windows_reloaded[window_id] == 2; } this.is_runtime_of_reloaded_window = function(rt_id) @@ -1316,9 +1159,9 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) { var script_id = msg.stop_at.script_id; // only scripts from the selected runtime are registered - if( script_id && __scripts[script_id] ) + if( script_id && _scripts[script_id] ) { - var stop_ats = __scripts[script_id].stop_ats; + var stop_ats = _scripts[script_id].stop_ats; stop_ats[stop_ats.length] = msg.stop_at; } @@ -1329,7 +1172,7 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) { var script_id = msg.stop_at.script_id, - stop_ats = __scripts[script_id] && __scripts[script_id].stop_ats, + stop_ats = _scripts[script_id] && _scripts[script_id].stop_ats, stop_at = null, i = 0; @@ -1348,7 +1191,7 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) var _on_console_script_submitted = function(msg) { - __submitted_scripts.push(msg.script); + _submitted_scripts.push(msg.script); }; @@ -1356,79 +1199,30 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) messages.addListener("thread-stopped-event", onThreadStopped); messages.addListener("thread-continue-event", onThreadContinue); - messages.addListener('host-state', onHostStateChange); - messages.addListener('setting-changed', onSettingChange); - messages.addListener('active-tab', onActiveTab); - - messages.addListener('reset-state', onResetState); - messages.addListener('window-updated', _on_window_updated); - messages.addListener('debug-context-selected', _on_debug_context_selected); + messages.addListener('debug-context-selected', this._on_debug_context_selected.bind(this)); messages.addListener('console-script-submitted', _on_console_script_submitted); messages.addListener('profile-disabled', _on_profile_disabled); - messages.addListener('profile-enabled', _on_profile_enabled); - - window.app.addListener('services-created', on_services_created); - - this.bind = function(ecma_debugger) - { - var self = this; - - ecma_debugger.handleEval = function(status, message){}; - - ecma_debugger.handleListRuntimes = function(status, message) - { - self.handleListRuntimes(status, message); - } - - ecma_debugger.onRuntimeStarted = function(status, message) - { - self.onRuntimeStarted(status, message); - } - - ecma_debugger.onRuntimeStopped = function(status, message) - { - self.onRuntimeStopped(status, message); - } - - ecma_debugger.onNewScript = function(status, message) - { - self.onNewScript(status, message); - } - - ecma_debugger.onThreadStarted = function(status, message) - { - self.onThreadStarted(status, message); - } - - ecma_debugger.onThreadStoppedAt = function(status, message) - { - self.onThreadStoppedAt(status, message); - } - - ecma_debugger.onThreadFinished = function(status, message) - { - self.onThreadFinished(status, message); - } - - ecma_debugger.onThreadMigrated = function(status, message) - { - self.onThreadMigrated(status, message); - } - - ecma_debugger.onParseError = function(status, message) - { - self.onParseError(status, message); - } - - ecma_debugger.addListener('window-filter-change', function(msg) - { - self.createAllRuntimesOnDebugContextChange(msg.filter[1][0]); - }); - } - + messages.addListener('profile-enabled', this._on_profile_enabled.bind(this)); + + this.bind = function(_ecma_debugger) + { + _ecma_debugger.handleEval = function(status, message) {}; + _ecma_debugger.handleListRuntimes = this.handleListRuntimes.bind(this); + _ecma_debugger.onRuntimeStarted = this.onRuntimeStarted.bind(this); + _ecma_debugger.onRuntimeStopped = this.onRuntimeStopped.bind(this); + _ecma_debugger.onNewScript = this.onNewScript.bind(this); + _ecma_debugger.onThreadStarted = this.onThreadStarted.bind(this); + _ecma_debugger.onThreadStoppedAt = this.onThreadStoppedAt.bind(this); + _ecma_debugger.onThreadFinished = this.onThreadFinished.bind(this); + _ecma_debugger.onThreadMigrated = this.onThreadMigrated.bind(this); + _ecma_debugger.onParseError = this.onParseError.bind(this); + // TODO looks strange + _ecma_debugger.addListener('window-filter-change', function(msg) + { + this.createAllRuntimesOnDebugContextChange(msg.filter[1][0]); + }.bind(this)); + }; } - - From 27245e8f4a9f7694593b75872d9a8c7837b39ffb Mon Sep 17 00:00:00 2001 From: Chris K Date: Wed, 25 Jul 2012 16:39:30 +0200 Subject: [PATCH 05/27] Code cleanup and select the runtime on selecting a script. --- src/ecma-debugger/runtimes.js | 116 +++++++++++++++------------------- 1 file changed, 51 insertions(+), 65 deletions(-) diff --git a/src/ecma-debugger/runtimes.js b/src/ecma-debugger/runtimes.js index 6d4b94271..e71a6fabc 100644 --- a/src/ecma-debugger/runtimes.js +++ b/src/ecma-debugger/runtimes.js @@ -72,10 +72,11 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) var _selected_window = ''; var _threads = []; var _old_selected_window = ""; + var _scripts = {}; var _replaced_scripts = {}; var _selected_runtime_id = ""; var _next_runtime_id_to_select = ""; - var _selected_script_id = ''; + var _selected_script_id = ""; var _selected_script_type = ""; var _is_first_call_create_all_runtimes_on_debug_context_change = true; var _window_top_rt_map = {}; @@ -114,7 +115,7 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) ].indexOf(script_type) != -1); }; - var onResetState = function() + this._on_reset_state = function() { _runtimes = {}; _old_runtimes = {}; @@ -124,12 +125,12 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) _selected_window = ''; _threads = []; _old_selected_window = ''; - _selected_runtime_id = ''; _next_runtime_id_to_select = ''; - _selected_script_id = ''; + this.setSelectedRuntime(); + this.setSelectedScript(); }; - var _on_profile_disabled = function(msg) + this._on_profile_disabled = function(msg) { if (msg.profile == window.app.profiles.DEFAULT) { @@ -139,10 +140,10 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) _window_ids = {}; _windows_reloaded = {}; _threads = []; - _selected_runtime_id = ''; _next_runtime_id_to_select = ''; - _selected_script_id = ''; _thread_queues = {}; + this.setSelectedRuntime(); + this.setSelectedScript(); } }; @@ -180,15 +181,12 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) if (_selected_runtime_id == id) { - _selected_runtime_id = ''; + this.setSelectedRuntime(); if (_runtimes[id] && !_runtimes[id].is_top) { var rt = _window_top_rt_map[_runtimes[id].window_id]; if (rt) - { this.setSelectedRuntime(rt); - window['cst-selects']['cmd-runtime-select'].updateElement(); - } } } messages.post('runtime-destroyed', {id: id}); @@ -332,15 +330,15 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) if (!_debug_context_frame_path) _debug_context_frame_path = runtime.html_frame_path; - _selected_script_id = ""; + this.setSelectedScript(); } - var title = window.window_manager_data.get_window(win_id); - if (title) - runtime.title = title; + var win = window.window_manager_data.get_window(win_id); + if (win) + runtime.title = win.title; _runtimes[runtimeId] = runtime; // TODO check if that is still needed - if(_next_runtime_id_to_select == runtimeId) + if (_next_runtime_id_to_select == runtimeId) { this.setSelectedRuntime(runtime); _next_runtime_id_to_select = ""; @@ -358,7 +356,7 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) if (_debug_context_frame_path == runtime.html_frame_path && _selected_window == runtime.window_id && - runtimeId != _selected_runtime_id ) + runtimeId != _selected_runtime_id) { this.setSelectedRuntimeId(runtimeId); } @@ -369,12 +367,8 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) host_tabs_update_active_tab = true; } - if(runtime.is_top) - { - views['js_source'].update(); - window['cst-selects']['js-script-select'].updateElement(); - window['cst-selects']['cmd-runtime-select'].updateElement(); - } + if (runtime.is_top) + views["js_source"].update(); } if(host_tabs_set_active_tab) @@ -391,7 +385,7 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) _runtimes[rt_id].description === undefined); }; - var _scripts = {}; + /** checks if that script is already known from a previous runtime * checks first for the url and the for the script data. @@ -430,9 +424,8 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) { this._bps.copy_breakpoints(script, _scripts[sc]); if (_scripts[sc].script_id == _selected_script_id) - { - _selected_script_id = new_script_id; - } + this.setSelectedScript(new_script_id); + // the script could be in a pop-up window if (old_rt.window_id == new_rt.window_id) { @@ -449,11 +442,7 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) (is_injected_script(_selected_script_type) && !is_injected_script(script.script_type))) { - _selected_script_id = new_script_id; - _selected_script_type = script.script_type; - views['js_source'].update(); - window['cst-selects']['js-script-select'].updateElement(); - window['cst-selects']['cmd-runtime-select'].updateElement(); + this.setSelectedScript(new_script_id); } } @@ -539,15 +528,7 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) { _debug_context_frame_path = ''; _windows_reloaded = {}; - _selected_script_id = ''; - /* - if( _is_first_call_create_all_runtimes_on_debug_context_change ) - { - stop_at.setInitialSettings(); - // with the STP 1 design this workaround can be removed - _is_first_call_create_all_runtimes_on_debug_context_change = false; - } - */ + this.setSelectedScript(); var tag = tagManager.set_callback(this, this._set_new_debug_context, [win_id]); _ecma_debugger.requestListRuntimes(tag, [[],1]); } @@ -571,11 +552,8 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) this._reset_window(win_id); else _window_ids[win_id] = true; - _selected_runtime_id = ""; - _selected_script_id = ""; - views["js_source"].update(); - window["cst-selects"]["js-script-select"].updateElement(); - window["cst-selects"]["cmd-runtime-select"].updateElement(); + this.setSelectedRuntime(); + this.setSelectedScript(); } } @@ -1035,29 +1013,41 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) this.setSelectedRuntime = function(runtime) { - var r = ''; - for( r in _runtimes ) + for (var r in _runtimes) { - if( _runtimes[r] == runtime ) + if (_runtimes[r] && _runtimes[r] == runtime) { - _runtimes[r]['selected'] = true; + _runtimes[r]["selected"] = true; _selected_runtime_id = _runtimes[r].runtime_id; } else { // the runtime could be registered but not jet parsed if( _runtimes[r] ) - { - _runtimes[r]['selected'] = false; - } + _runtimes[r]["selected"] = false; } } - } - // only one script can be selected at a time - this.setSelectedScript = function( script_id ) + if (!runtime) + _selected_runtime_id = ""; + + window["cst-selects"]["cmd-runtime-select"].updateElement(); + }; + + this.setSelectedScript = function(script_id) { - _selected_script_id = script_id; - window['cst-selects']['js-script-select'].updateElement(); + if (script_id != _selected_script_id) + { + _selected_script_id = script_id || ""; + var script = script_id && _scripts[script_id]; + if (script) + { + _selected_script_type = script.script_type; + if (script.runtime_id != _selected_runtime_id) + this.setSelectedRuntimeId(script.runtime_id); + } + window["cst-selects"]["js-script-select"].updateElement(); + window.views["js_source"].update(); + } } this.getSelectedScript = function() @@ -1068,14 +1058,10 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) this.setSelectedRuntimeId = function(id) { if (_runtimes[id]) - { this.setSelectedRuntime(_runtimes[id]); - } else - { _next_runtime_id_to_select = id; - } - } + }; this.getSelectedRuntimeId = function() { @@ -1200,11 +1186,11 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) messages.addListener("thread-stopped-event", onThreadStopped); messages.addListener("thread-continue-event", onThreadContinue); messages.addListener('host-state', onHostStateChange); - messages.addListener('reset-state', onResetState); + messages.addListener('reset-state', this._on_reset_state.bind(this)); messages.addListener('window-updated', _on_window_updated); messages.addListener('debug-context-selected', this._on_debug_context_selected.bind(this)); messages.addListener('console-script-submitted', _on_console_script_submitted); - messages.addListener('profile-disabled', _on_profile_disabled); + messages.addListener('profile-disabled', this._on_profile_disabled.bind(this)); messages.addListener('profile-enabled', this._on_profile_enabled.bind(this)); this.bind = function(_ecma_debugger) From 882f570058ecebe21c33614173dcb5fd2c4485de Mon Sep 17 00:00:00 2001 From: Chris K Date: Thu, 26 Jul 2012 15:24:06 +0200 Subject: [PATCH 06/27] Added new method to find specific tokens. --- src/repl/commandtransformer.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/repl/commandtransformer.js b/src/repl/commandtransformer.js index 3b4e546c1..205acee71 100644 --- a/src/repl/commandtransformer.js +++ b/src/repl/commandtransformer.js @@ -96,6 +96,21 @@ cls.HostCommandTransformer = function() { TYPE = 0, VALUE = 1; + this.has_tokens = function(source, target_tokens) + { + var matches = []; + this.parser.tokenize(source, function(token_type, token) + { + for (var i = 0, target_token; token = target_tokens[i]; i++) + { + if (token[TYPE] == target_token[type] && + token[VALUE] == target_token[VALUE]) + matches.push(token); + } + }); + return matches; + }; + this.transform = function(source) { var tokens = []; From dd59a2a1cd54266e83b224ea8516947ad0bc37c2 Mon Sep 17 00:00:00 2001 From: Chris K Date: Thu, 26 Jul 2012 16:31:26 +0200 Subject: [PATCH 07/27] DFL-3360 Stylesheet is missing when debugging certain testcase. --- src/ecma-debugger/dominspection/domdata.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ecma-debugger/dominspection/domdata.js b/src/ecma-debugger/dominspection/domdata.js index a5e23180c..4cbf49a10 100644 --- a/src/ecma-debugger/dominspection/domdata.js +++ b/src/ecma-debugger/dominspection/domdata.js @@ -282,6 +282,7 @@ cls.EcmascriptDebugger["6.0"].DOMData = function(view_id) this._current_target = 0; this._active_window = []; this.target = 0; + window.messages.post("element-selected", {obj_id: 0, rt_id: 0, model: null}); } this._on_active_tab = function(msg) From e64a13d773b04afa2786fee0fa7d929a8a87eb49 Mon Sep 17 00:00:00 2001 From: Chris K Date: Fri, 27 Jul 2012 19:00:28 +0200 Subject: [PATCH 08/27] DFL-3216 Getting the execution context must be smarter. --- .../build_ecmascript_debugger_6_0.js | 1 - src/ecma-debugger/dominspection/domdata.js | 3 - src/ecma-debugger/js-source-view.js | 3 +- src/ecma-debugger/runtimes.js | 6 +- src/repl/commandtransformer.js | 7 +-- src/repl/repl_service.js | 57 ++++++++++++------- src/repl/runtimeselect.js | 56 ++++++++++-------- 7 files changed, 78 insertions(+), 55 deletions(-) diff --git a/src/build-application/build_ecmascript_debugger_6_0.js b/src/build-application/build_ecmascript_debugger_6_0.js index 75abfd168..45f305a99 100644 --- a/src/build-application/build_ecmascript_debugger_6_0.js +++ b/src/build-application/build_ecmascript_debugger_6_0.js @@ -61,7 +61,6 @@ window.app.builders.EcmascriptDebugger["6.0"] = function(service) window.runtime_onload_handler = new namespace.RuntimeOnloadHandler(); /* commandline */ - cls.CommandLineRuntimeSelect.prototype = new CstSelect(); new cls.CommandLineRuntimeSelect('cmd-runtime-select', 'cmd-line-runtimes'); cls.ReplView.create_ui_widgets(); diff --git a/src/ecma-debugger/dominspection/domdata.js b/src/ecma-debugger/dominspection/domdata.js index 4cbf49a10..ac369108b 100644 --- a/src/ecma-debugger/dominspection/domdata.js +++ b/src/ecma-debugger/dominspection/domdata.js @@ -251,7 +251,6 @@ cls.EcmascriptDebugger["6.0"].DOMData = function(view_id) { if (message[WINDOW_ID] == window.window_manager_data.get_debug_context()) { - messages.post("runtime-selected", {id: this._data_runtime_id}); window['cst-selects']['document-select'].updateElement(); this._get_dom_sub(message[RUNTIME_ID], message[OBJECT_ID], true); } @@ -300,7 +299,6 @@ cls.EcmascriptDebugger["6.0"].DOMData = function(view_id) this._on_reset_state(); // the first field is the top runtime this._data_runtime_id = msg.activeTab[0]; - messages.post("runtime-selected", {id: this._data_runtime_id}); window['cst-selects']['document-select'].updateElement(); this._active_window = msg.activeTab.slice(); if (window.views[this._view_id].isvisible()) @@ -411,7 +409,6 @@ cls.EcmascriptDebugger["6.0"].DOMData = function(view_id) if (rt_id != this._data_runtime_id) { this._data_runtime_id = rt_id; - messages.post("runtime-selected", {id: this._data_runtime_id}); window['cst-selects']['document-select'].updateElement(); } if (obj_id) diff --git a/src/ecma-debugger/js-source-view.js b/src/ecma-debugger/js-source-view.js index 1323c81ee..29a2bf33c 100644 --- a/src/ecma-debugger/js-source-view.js +++ b/src/ecma-debugger/js-source-view.js @@ -534,7 +534,6 @@ cls.JsSourceView = function(id, name, container_class) if (!is_current_script || is_parse_error) { var script_obj = runtimes.getScript(script_id); - if (script_obj) { if (!script_obj.line_arr) @@ -832,7 +831,7 @@ cls.JsSourceView = function(id, name, container_class) __timeout_clear_view = 0; view_invalid = true; __view_is_destroyed = true; - runtimes.setSelectedScript(-1); + runtimes.setSelectedScript(); } var onRuntimeDestroyed = function(msg) diff --git a/src/ecma-debugger/runtimes.js b/src/ecma-debugger/runtimes.js index e71a6fabc..ee4c158c6 100644 --- a/src/ecma-debugger/runtimes.js +++ b/src/ecma-debugger/runtimes.js @@ -76,7 +76,7 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) var _replaced_scripts = {}; var _selected_runtime_id = ""; var _next_runtime_id_to_select = ""; - var _selected_script_id = ""; + var _selected_script_id = 0; var _selected_script_type = ""; var _is_first_call_create_all_runtimes_on_debug_context_change = true; var _window_top_rt_map = {}; @@ -1030,14 +1030,14 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version) if (!runtime) _selected_runtime_id = ""; - window["cst-selects"]["cmd-runtime-select"].updateElement(); + window.messages.post("runtime-selected", {id: _selected_runtime_id}); }; this.setSelectedScript = function(script_id) { if (script_id != _selected_script_id) { - _selected_script_id = script_id || ""; + _selected_script_id = script_id || 0; var script = script_id && _scripts[script_id]; if (script) { diff --git a/src/repl/commandtransformer.js b/src/repl/commandtransformer.js index 205acee71..e84532ce8 100644 --- a/src/repl/commandtransformer.js +++ b/src/repl/commandtransformer.js @@ -101,11 +101,10 @@ cls.HostCommandTransformer = function() { var matches = []; this.parser.tokenize(source, function(token_type, token) { - for (var i = 0, target_token; token = target_tokens[i]; i++) + for (var i = 0, target_token; target_token = target_tokens[i]; i++) { - if (token[TYPE] == target_token[type] && - token[VALUE] == target_token[VALUE]) - matches.push(token); + if (token_type == target_token[TYPE] && token == target_token[VALUE]) + matches.push([token_type, token]); } }); return matches; diff --git a/src/repl/repl_service.js b/src/repl/repl_service.js index dce6b1e2e..8f050ccfa 100644 --- a/src/repl/repl_service.js +++ b/src/repl/repl_service.js @@ -20,6 +20,12 @@ cls.ReplService = function(view, data) const RE_DOM_OBJECT = cls.InlineExpander.RE_DOM_OBJECT; const IS_EXPAND_INLINE_KEY = "expand-objects-inline"; const CLASS_NAME = 4; + var ELEMENT_IDENTIFIERS = + [ + [window.cls.SimpleJSParser.IDENTIFIER, "$0"], + [window.cls.SimpleJSParser.IDENTIFIER, "$1"], + ]; + var get_value = function(token) { var VALUE = 1; return token[VALUE]; }; this._on_consolemessage_bound = function(msg) { @@ -270,7 +276,7 @@ cls.ReplService = function(view, data) // has enabled showing errors in the repl. The error message // will still be printed, but as a result of the console-log // event. - if (!settings.command_line.get('show-js-errors-in-repl')) { + if (!settings.command_line.get("show-js-errors-in-repl")) { this._handle_raw(msg[0]); } } @@ -298,7 +304,7 @@ cls.ReplService = function(view, data) else { this._prev_selected = this._cur_selected; - this._cur_selected = msg.obj_id; + this._cur_selected = msg; } }.bind(this); @@ -344,7 +350,7 @@ cls.ReplService = function(view, data) val = type; break; case "string": - val = '"' + val + '"'; + val = "\"" + val + "\""; break; } @@ -364,6 +370,7 @@ cls.ReplService = function(view, data) this.evaluate_input = function(input) { + var $_identifiers = this._transformer.has_tokens(input, ELEMENT_IDENTIFIERS).map(get_value); var cooked = this._transformer.transform(input); var command = this._transformer.get_command(cooked); @@ -373,15 +380,15 @@ cls.ReplService = function(view, data) } else { - this._handle_hostcommand(cooked); + this._handle_hostcommand(cooked, $_identifiers); } }; this.get_selected_objects = function() { var selection = []; - if (this._cur_selected) { selection.push(this._cur_selected) } - if (this._prev_selected) { selection.push(this._prev_selected) } + if (this._cur_selected) { selection.push(this._cur_selected.obj_id) } + if (this._prev_selected) { selection.push(this._prev_selected.obj_id) } return selection; }; @@ -390,23 +397,34 @@ cls.ReplService = function(view, data) command.call(this._transformer, this._view, this._data, this); }; - this._handle_hostcommand = function(cooked) + this._handle_hostcommand = function(cooked, $_identifiers) { // ignore all whitespace commands if (cooked.trim() == "") return; - - var ex_ctx = window.runtimes.get_execution_context(); - var rt_id = ex_ctx.rt_id; - var thread_id = ex_ctx.thread_id; - var frame_index = ex_ctx.frame_index; var magicvars = []; - if (this._cur_selected) - magicvars.push(["$0", this._cur_selected]); - - if (this._prev_selected) - magicvars.push(["$1", this._prev_selected]); + if ($_identifiers.contains("$0") && this._cur_selected) + { + magicvars.push(["$0", this._cur_selected.obj_id]); + if (this._cur_selected.rt_id != rt_id) + this._runtime_select.set_id(this._cur_selected.rt_id) + } + if ($_identifiers.contains("$1") && this._prev_selected) + { + magicvars.push(["$1", this._prev_selected.obj_id]); + if (this._prev_selected.rt_id != rt_id) + this._runtime_select.set_id(this._prev_selected.rt_id) + } + var rt_id = this._runtime_select.get_id(); + var thread_id = 0; + var frame_index = 0; + var ex_ctx = window.runtimes.get_execution_context(); + if (ex_ctx.rt_id == rt_id) + { + thread_id = ex_ctx.thread_id; + frame_index = ex_ctx.frame_index; + } var msg = [rt_id, thread_id, frame_index, cooked, magicvars]; this._eval(msg, this._on_eval_done_bound, [rt_id, thread_id, frame_index]); }; @@ -418,7 +436,7 @@ cls.ReplService = function(view, data) msg[WANT_DEBUG] = msg[THREAD_ID] ? 0 : 1; this._edservice.requestEval(tag, msg); if (msg[WANT_DEBUG]) - window.messages.post('console-script-submitted', {script: msg[SCRIPT_DATA]}); + window.messages.post("console-script-submitted", {script: msg[SCRIPT_DATA]}); } this._get_host_info = function() @@ -457,6 +475,7 @@ cls.ReplService = function(view, data) this._on_eval_done_bound = this._msg_queue.queue(this._process_on_eval_done); this._tagman = window.tagManager; //TagManager.getInstance(); <- fixme: use singleton this._edservice = window.services["ecmascript-debugger"]; + this._runtime_select = window["cst-selects"]["cmd-runtime-select"]; this._edservice.addListener("consolelog", this._on_consolelog_bound); this._edservice.addListener("consoletime", this._on_consoletime_bound); this._edservice.addListener("consoletimeend", this._on_consoletimeend_bound); @@ -470,7 +489,7 @@ cls.ReplService = function(view, data) window.messages.addListener("element-selected", this._on_element_selected_bound); this._is_inline_expand = settings.command_line.get(IS_EXPAND_INLINE_KEY); - messages.addListener('setting-changed', this._onsettingchange.bind(this)); + messages.addListener("setting-changed", this._onsettingchange.bind(this)); this._get_host_info(); }; diff --git a/src/repl/runtimeselect.js b/src/repl/runtimeselect.js index ad568b1b2..92ea20896 100644 --- a/src/repl/runtimeselect.js +++ b/src/repl/runtimeselect.js @@ -1,41 +1,51 @@ cls.CommandLineRuntimeSelect = function(id, class_name) { - var selected_value = ""; - this.getSelectedOptionText = function() { - var selected_rt_id = runtimes.getSelectedRuntimeId(); - if( selected_rt_id ) - { - var rt = runtimes.getRuntime(selected_rt_id); - if( rt ) - { - return rt['title'] || helpers.shortenURI(rt.uri).uri; - } - } - return ''; - } - - this.getSelectedOptionValue = function() - { + var rt = window.runtimes.getRuntime(this._selected_runtime_id); + return rt ? rt.title || rt.short_distinguisher : ""; + }; - } + this.getSelectedOptionValue = function() {}; this.templateOptionList = function(select_obj) { return templates.runtime_dropdown(runtimes.get_dom_runtimes()); - } + }; this.checkChange = function(target_ele) { var rt_id = parseInt(target_ele.getAttribute('rt-id')); - if( rt_id && rt_id != runtimes.getSelectedRuntimeId() ) - { - runtimes.setSelectedRuntimeId(rt_id); - } + if (rt_id && rt_id != this._selected_runtime_id) + this.set_id(rt_id); return true; - } + }; + + this._onruntimeselected = function(msg) + { + this.set_id(msg.id); + }; + + this.set_id = function(id) + { + this._selected_runtime_id = id; + this.updateElement(); + }; + + this.get_id = function(id) + { + return this._selected_runtime_id; + }; + + this.init = function(id, class_name) + { + this._selected_runtime = null; + CstSelect.prototype.init.call(this, id, class_name); + window.messages.add_listener("runtime-selected", this._onruntimeselected.bind(this)); + }; this.init(id, class_name); }; + +cls.CommandLineRuntimeSelect.prototype = new CstSelect(); From d2bec3e9b41adb37deac8945d1f0008f90681e92 Mon Sep 17 00:00:00 2001 From: Chris K Date: Wed, 8 Aug 2012 13:17:33 +0200 Subject: [PATCH 09/27] Run cleanrepo. --- .../build_ecmascript_debugger_6_0.js | 556 +-- .../dominspection/inspectabledomnode.js | 1070 ++--- src/ecma-debugger/dominspection/templates.js | 1810 ++++----- src/ecma-debugger/jssourcetooltip.js | 2204 +++++------ src/ecma-debugger/newscript.js | 1208 +++--- .../objectinspection.6.0/actions.js | 382 +- .../objectinspection.6.0/inspectiontooltip.js | 378 +- .../objectinspection.6.0/prettyprinter.js | 742 ++-- src/ecma-debugger/stop_at.js | 1236 +++--- src/ecma-debugger/templates.js | 1104 +++--- src/lib/elementprototype.js | 1516 ++++---- src/repl/propertyfinder.js | 568 +-- src/searches/domsearchview.js | 372 +- src/style/newstyle.js | 240 +- src/ui-scripts/actions/actionbroker.js | 1076 +++--- src/ui-scripts/actions/globalactionhandler.js | 846 ++-- src/ui-scripts/tooltip/tooltip.js | 974 ++--- src/ui-strings/ui_strings-en.js | 3438 ++++++++--------- 18 files changed, 9854 insertions(+), 9866 deletions(-) diff --git a/src/build-application/build_ecmascript_debugger_6_0.js b/src/build-application/build_ecmascript_debugger_6_0.js index 45f305a99..5e73bb859 100644 --- a/src/build-application/build_ecmascript_debugger_6_0.js +++ b/src/build-application/build_ecmascript_debugger_6_0.js @@ -1,278 +1,278 @@ -/* load after build_application.js */ - -window.app.builders.EcmascriptDebugger || (window.app.builders.EcmascriptDebugger = {}); - -/** - * @param {Object} service. The service description of - * the according service on the host side. - */ - -window.app.builders.EcmascriptDebugger["6.0"] = function(service) -{ - // see diff to %.0 version: hg diff -c 9d4f82a72900 - var namespace = cls.EcmascriptDebugger && cls.EcmascriptDebugger["6.0"]; - var service_interface = window.services['ecmascript-debugger']; - - const NAME = 0, ID = 1, VIEWS = 2; - - if(service_interface) - { - - cls.InspectableJSObject = namespace.InspectableJSObject; - cls.JSInspectionTooltip.register(); - cls.EventListenerTooltip.register(); - // disabled for now. see CORE-32113 - // cls.InspectableJSObject.register_enabled_listener(); - // for now we are filtering on the client side - cls.InspectableJSObject.create_filters(); - - window.runtimes = new namespace.Runtimes("6.0"); - window.runtimes.bind(service_interface); - - window.dom_data = new namespace.DOMData('dom'); - window.dom_data.bind(service_interface); - window.stop_at = new namespace.StopAt(); - window.stop_at.bind(service_interface); - window.host_tabs = new namespace.HostTabs(); - window.host_tabs.bind(service_interface); - window.hostspotlighter = new namespace.Hostspotlighter(); - window.hostspotlighter.bind(service_interface); - - /* ECMA object inspection */ - var BaseView = new namespace.InspectionBaseView(); - namespace.InspectionView.prototype = BaseView; - new namespace.InspectionView('inspection', - ui_strings.M_VIEW_LABEL_FRAME_INSPECTION, - 'scroll mono'); - namespace.InspectionView.create_ui_widgets(); - - /* DOM object inspection */ - namespace.DOMAttrsView.prototype = BaseView; - new namespace.DOMAttrsView('dom_attrs', - ui_strings.M_VIEW_LABEL_DOM_ATTR, - 'scroll dom-attrs mono'); - namespace.DOMAttrsView.create_ui_widgets(); - - /* - a namespace for all the followindg classes will only be created - if needed to adjust them for an updated service version - */ - - window.runtime_onload_handler = new namespace.RuntimeOnloadHandler(); - - /* commandline */ - new cls.CommandLineRuntimeSelect('cmd-runtime-select', 'cmd-line-runtimes'); - - cls.ReplView.create_ui_widgets(); - new cls.ReplView('command_line', - ui_strings.M_VIEW_LABEL_COMMAND_LINE, - 'scroll console mono', - '', 'repl-focus'); - - /* JS source */ - window.simple_js_parser = new window.cls.SimpleJSParser(); - new cls.JsSourceView('js_source', - ui_strings.M_VIEW_LABEL_SOURCE, - 'scroll js-source mono'); - new cls.ScriptSelect('js-script-select', 'script-options'); - cls.JsSourceView.create_ui_widgets(); - - /* Watches */ - cls.WatchesView.prototype = ViewBase; - new cls.WatchesView('watches', - ui_strings.M_VIEW_LABEL_WATCHES, - 'scroll mono'); - - /* Runtime State */ - new cls.JSSidePanelView('scripts-side-panel', - ui_strings.M_VIEW_LABEL_RUNTIME_STATE, - ['watches', 'callstack', 'inspection'], - // default expanded flags for the view list - [false, true, true]); - - /* Callstack */ - cls.CallstackView.prototype = ViewBase; - new cls.CallstackView('callstack', - ui_strings.M_VIEW_LABEL_CALLSTACK, - 'scroll mono'); - - /* Threads */ - cls.ThreadsView.prototype = ViewBase; - new cls.ThreadsView('threads', - ui_strings.M_VIEW_LABEL_THREAD_LOG, - 'scroll threads'); - //cls.ThreadsView.create_ui_widgets(); - - /* DOM */ - cls.InspectableDOMNode = namespace.InspectableDOMNode; - new cls.DOMInspectorActions('dom'); // the view id - cls.DOMView.prototype = ViewBase; - new cls.DOMView('dom', ui_strings.M_VIEW_LABEL_DOM, 'scroll dom mono'); - cls.DOMView.prototype.constructor = cls.DOMView; - cls.DocumentSelect.prototype = new CstSelect(); - new cls.DocumentSelect('document-select', 'document-options'); - cls.DOMView.create_ui_widgets(); - cls.DOMSearchView.prototype = ViewBase; - new cls.DOMSearchView('dom-search', ui_strings.M_VIEW_LABEL_SEARCH); - - window.stylesheets = new cls.Stylesheets(); - window.element_style = new cls.ElementStyle(); - cls.CssStyleDeclarations = cls.EcmascriptDebugger["6.7"].CssStyleDeclarations; - - /* CSS inspector */ - cls.CSSInspectorView.prototype = ViewBase; - new cls.CSSInspectorView('css-inspector', - ui_strings.M_VIEW_LABEL_STYLES, - 'scroll css-inspector mono'); - new cls.CSSInspectorView.create_ui_widgets(); - - cls.CSSInspectorCompStyleView.prototype = ViewBase; - new cls.CSSInspectorCompStyleView('css-comp-style', - ui_strings.M_VIEW_LABEL_COMPUTED_STYLE, - 'scroll css-inspector mono'); - - cls.NewStyle.prototype = ViewBase; - new cls.NewStyle('new-style', ui_strings.M_VIEW_LABEL_NEW_STYLE, 'scroll css-new-style mono'); - - new cls.ColorPickerView('color-selector', 'Color Picker', 'color-selector'); - new cls.CSSInspectorActions('css-inspector'); - - /* DOM sidepanel */ - new cls.DOMSidePanelView('dom-side-panel', - ui_strings.M_VIEW_LABEL_STYLES, - ['css-comp-style', 'css-inspector', 'new-style'], - // default expanded flags for the view list - [false, true, false]); - cls.DOMSidePanelView.create_ui_widgets(); - - /* Layout */ - window.element_layout = new cls.ElementLayout(); - cls.CSSLayoutView.prototype = ViewBase; - new cls.CSSLayoutView('css-layout', - ui_strings.M_VIEW_LABEL_LAYOUT, - 'scroll css-layout'); - - /* Runtime State */ - new cls.JSSidePanelView('breakpoints-side-panel', - ui_strings.M_VIEW_LABEL_BREAKPOINTS, - ['breakpoints', 'event-breakpoints'], - // default expanded flags for the view list - [true, false]); - - /* Event Breakpoints */ - window.event_breakpoints = cls.EventBreakpoints.get_instance(); - cls.EventBreakpointsView.prototype = ViewBase; - new cls.EventBreakpointsView('event-breakpoints', - ui_strings.M_VIEW_LABEL_EVENT_BREAKPOINTS, - 'scroll event-breakpoints'); - cls.EventBreakpointsView.create_ui_widgets(); - - /* Breakpoints */ - cls.BreakpointsView.prototype = ViewBase; - new cls.BreakpointsView('breakpoints', - ui_strings.M_VIEW_LABEL_BREAKPOINTS, - 'scroll breakpoints mono'); - cls.BreakpointsView.create_ui_widgets(); - - /* JS Search */ - cls.JSSearchView.prototype = ViewBase; - new cls.JSSearchView('js-search', - ui_strings.M_VIEW_LABEL_SEARCH, - 'scroll js-search'); - - /* Listeners */ - if (service_interface.satisfies_version(6, 11)) - { - new cls.SelectedNodeListenersView("ev-listeners-selected-node", - ui_strings.M_VIEW_LABEL_EVENT_LISTENERS_SELECTED_NODE, - "ev-listeners-selected-node scroll"); - new cls.EventListenersView("ev-listeners-all", - ui_strings.M_VIEW_LABEL_EVENT_LISTENERS_ALL, - "ev-listeners-all scroll"); - new cls.EventListenerSidePanelView("ev-listeners-side-panel", - ui_strings.M_VIEW_LABEL_EVENT_LISTENERS, - ["ev-listeners-selected-node", "ev-listeners-all"], - // default expanded flags for the view list - [true, true]); - cls.EventListenerSidePanelView.create_ui_widgets(); - } - - /* adjust the base class */ - - var StorageDataBase = new namespace.StorageDataBase(); - cls.CookiesData.prototype = StorageDataBase; - cls.LocalStorageData.prototype = StorageDataBase; - - /* storage objects and cookies */ - new cls.Namespace("storages"); - window.storages.add(new cls.LocalStorageData( - 'local_storage', - 'local-storage', - ui_strings.M_VIEW_LABEL_LOCAL_STORAGE, - 'localStorage')); - window.storages.add(new cls.LocalStorageData( - 'session_storage', - 'session-storage', - ui_strings.M_VIEW_LABEL_SESSION_STORAGE, - 'sessionStorage')); - window.storages.add(new cls.LocalStorageData( - 'widget_preferences', - 'widget-preferences', - ui_strings.M_VIEW_LABEL_WIDGET_PREFERNCES, - 'widget.preferences')); - window.storages.add(new cls.CookiesData( - 'cookies', - 'cookies', - ui_strings.M_VIEW_LABEL_COOKIES)); - - new cls.StorageView("local_storage", - ui_strings.M_VIEW_LABEL_LOCAL_STORAGE, - "scroll storage_view local_storage", - "local_storage"); - new cls.StorageViewActions("local_storage"); - - new cls.StorageView("session_storage", - ui_strings.M_VIEW_LABEL_SESSION_STORAGE, - "scroll storage_view session_storage", - "session_storage"); - new cls.StorageViewActions("session_storage"); - - new cls.StorageView("cookies", - ui_strings.M_VIEW_LABEL_COOKIES, - "scroll storage_view cookies", - "cookies"); - new cls.StorageViewActions("cookies"); - - new cls.StorageView("widget_preferences", - ui_strings.M_VIEW_LABEL_WIDGET_PREFERNCES, - "scroll storage_view widget_preferences", - "widget_preferences"); - new cls.StorageViewActions("widget_preferences"); - - /* the following views must be created to get entry in the Settings tab */ - - /* Environment */ - cls.EnvironmentView.prototype = ViewBase; - new cls.EnvironmentView('environment', - ui_strings.M_VIEW_LABEL_ENVIRONMENT, - 'scroll'); - cls.EnvironmentView.create_ui_widgets(); - - /* About */ - cls.AboutView.prototype = ViewBase; - new cls.AboutView('about', ui_strings.S_SETTINGS_HEADER_ABOUT, 'scroll'); - cls.AboutView.create_ui_widgets(); - - /* Hostspotlighter */ - cls.HostSpotlightView.prototype = ViewBase; - new cls.HostSpotlightView('host-spotlight', - ui_strings.S_LABEL_SPOTLIGHT_TITLE); - cls.HostSpotlightView.create_ui_widgets(); - - /* main view doesn't really exist */ - cls.MainView.create_ui_widgets(); - - return true; - } - -} +/* load after build_application.js */ + +window.app.builders.EcmascriptDebugger || (window.app.builders.EcmascriptDebugger = {}); + +/** + * @param {Object} service. The service description of + * the according service on the host side. + */ + +window.app.builders.EcmascriptDebugger["6.0"] = function(service) +{ + // see diff to %.0 version: hg diff -c 9d4f82a72900 + var namespace = cls.EcmascriptDebugger && cls.EcmascriptDebugger["6.0"]; + var service_interface = window.services['ecmascript-debugger']; + + const NAME = 0, ID = 1, VIEWS = 2; + + if(service_interface) + { + + cls.InspectableJSObject = namespace.InspectableJSObject; + cls.JSInspectionTooltip.register(); + cls.EventListenerTooltip.register(); + // disabled for now. see CORE-32113 + // cls.InspectableJSObject.register_enabled_listener(); + // for now we are filtering on the client side + cls.InspectableJSObject.create_filters(); + + window.runtimes = new namespace.Runtimes("6.0"); + window.runtimes.bind(service_interface); + + window.dom_data = new namespace.DOMData('dom'); + window.dom_data.bind(service_interface); + window.stop_at = new namespace.StopAt(); + window.stop_at.bind(service_interface); + window.host_tabs = new namespace.HostTabs(); + window.host_tabs.bind(service_interface); + window.hostspotlighter = new namespace.Hostspotlighter(); + window.hostspotlighter.bind(service_interface); + + /* ECMA object inspection */ + var BaseView = new namespace.InspectionBaseView(); + namespace.InspectionView.prototype = BaseView; + new namespace.InspectionView('inspection', + ui_strings.M_VIEW_LABEL_FRAME_INSPECTION, + 'scroll mono'); + namespace.InspectionView.create_ui_widgets(); + + /* DOM object inspection */ + namespace.DOMAttrsView.prototype = BaseView; + new namespace.DOMAttrsView('dom_attrs', + ui_strings.M_VIEW_LABEL_DOM_ATTR, + 'scroll dom-attrs mono'); + namespace.DOMAttrsView.create_ui_widgets(); + + /* + a namespace for all the followindg classes will only be created + if needed to adjust them for an updated service version + */ + + window.runtime_onload_handler = new namespace.RuntimeOnloadHandler(); + + /* commandline */ + new cls.CommandLineRuntimeSelect('cmd-runtime-select', 'cmd-line-runtimes'); + + cls.ReplView.create_ui_widgets(); + new cls.ReplView('command_line', + ui_strings.M_VIEW_LABEL_COMMAND_LINE, + 'scroll console mono', + '', 'repl-focus'); + + /* JS source */ + window.simple_js_parser = new window.cls.SimpleJSParser(); + new cls.JsSourceView('js_source', + ui_strings.M_VIEW_LABEL_SOURCE, + 'scroll js-source mono'); + new cls.ScriptSelect('js-script-select', 'script-options'); + cls.JsSourceView.create_ui_widgets(); + + /* Watches */ + cls.WatchesView.prototype = ViewBase; + new cls.WatchesView('watches', + ui_strings.M_VIEW_LABEL_WATCHES, + 'scroll mono'); + + /* Runtime State */ + new cls.JSSidePanelView('scripts-side-panel', + ui_strings.M_VIEW_LABEL_RUNTIME_STATE, + ['watches', 'callstack', 'inspection'], + // default expanded flags for the view list + [false, true, true]); + + /* Callstack */ + cls.CallstackView.prototype = ViewBase; + new cls.CallstackView('callstack', + ui_strings.M_VIEW_LABEL_CALLSTACK, + 'scroll mono'); + + /* Threads */ + cls.ThreadsView.prototype = ViewBase; + new cls.ThreadsView('threads', + ui_strings.M_VIEW_LABEL_THREAD_LOG, + 'scroll threads'); + //cls.ThreadsView.create_ui_widgets(); + + /* DOM */ + cls.InspectableDOMNode = namespace.InspectableDOMNode; + new cls.DOMInspectorActions('dom'); // the view id + cls.DOMView.prototype = ViewBase; + new cls.DOMView('dom', ui_strings.M_VIEW_LABEL_DOM, 'scroll dom mono'); + cls.DOMView.prototype.constructor = cls.DOMView; + cls.DocumentSelect.prototype = new CstSelect(); + new cls.DocumentSelect('document-select', 'document-options'); + cls.DOMView.create_ui_widgets(); + cls.DOMSearchView.prototype = ViewBase; + new cls.DOMSearchView('dom-search', ui_strings.M_VIEW_LABEL_SEARCH); + + window.stylesheets = new cls.Stylesheets(); + window.element_style = new cls.ElementStyle(); + cls.CssStyleDeclarations = cls.EcmascriptDebugger["6.7"].CssStyleDeclarations; + + /* CSS inspector */ + cls.CSSInspectorView.prototype = ViewBase; + new cls.CSSInspectorView('css-inspector', + ui_strings.M_VIEW_LABEL_STYLES, + 'scroll css-inspector mono'); + new cls.CSSInspectorView.create_ui_widgets(); + + cls.CSSInspectorCompStyleView.prototype = ViewBase; + new cls.CSSInspectorCompStyleView('css-comp-style', + ui_strings.M_VIEW_LABEL_COMPUTED_STYLE, + 'scroll css-inspector mono'); + + cls.NewStyle.prototype = ViewBase; + new cls.NewStyle('new-style', ui_strings.M_VIEW_LABEL_NEW_STYLE, 'scroll css-new-style mono'); + + new cls.ColorPickerView('color-selector', 'Color Picker', 'color-selector'); + new cls.CSSInspectorActions('css-inspector'); + + /* DOM sidepanel */ + new cls.DOMSidePanelView('dom-side-panel', + ui_strings.M_VIEW_LABEL_STYLES, + ['css-comp-style', 'css-inspector', 'new-style'], + // default expanded flags for the view list + [false, true, false]); + cls.DOMSidePanelView.create_ui_widgets(); + + /* Layout */ + window.element_layout = new cls.ElementLayout(); + cls.CSSLayoutView.prototype = ViewBase; + new cls.CSSLayoutView('css-layout', + ui_strings.M_VIEW_LABEL_LAYOUT, + 'scroll css-layout'); + + /* Runtime State */ + new cls.JSSidePanelView('breakpoints-side-panel', + ui_strings.M_VIEW_LABEL_BREAKPOINTS, + ['breakpoints', 'event-breakpoints'], + // default expanded flags for the view list + [true, false]); + + /* Event Breakpoints */ + window.event_breakpoints = cls.EventBreakpoints.get_instance(); + cls.EventBreakpointsView.prototype = ViewBase; + new cls.EventBreakpointsView('event-breakpoints', + ui_strings.M_VIEW_LABEL_EVENT_BREAKPOINTS, + 'scroll event-breakpoints'); + cls.EventBreakpointsView.create_ui_widgets(); + + /* Breakpoints */ + cls.BreakpointsView.prototype = ViewBase; + new cls.BreakpointsView('breakpoints', + ui_strings.M_VIEW_LABEL_BREAKPOINTS, + 'scroll breakpoints mono'); + cls.BreakpointsView.create_ui_widgets(); + + /* JS Search */ + cls.JSSearchView.prototype = ViewBase; + new cls.JSSearchView('js-search', + ui_strings.M_VIEW_LABEL_SEARCH, + 'scroll js-search'); + + /* Listeners */ + if (service_interface.satisfies_version(6, 11)) + { + new cls.SelectedNodeListenersView("ev-listeners-selected-node", + ui_strings.M_VIEW_LABEL_EVENT_LISTENERS_SELECTED_NODE, + "ev-listeners-selected-node scroll"); + new cls.EventListenersView("ev-listeners-all", + ui_strings.M_VIEW_LABEL_EVENT_LISTENERS_ALL, + "ev-listeners-all scroll"); + new cls.EventListenerSidePanelView("ev-listeners-side-panel", + ui_strings.M_VIEW_LABEL_EVENT_LISTENERS, + ["ev-listeners-selected-node", "ev-listeners-all"], + // default expanded flags for the view list + [true, true]); + cls.EventListenerSidePanelView.create_ui_widgets(); + } + + /* adjust the base class */ + + var StorageDataBase = new namespace.StorageDataBase(); + cls.CookiesData.prototype = StorageDataBase; + cls.LocalStorageData.prototype = StorageDataBase; + + /* storage objects and cookies */ + new cls.Namespace("storages"); + window.storages.add(new cls.LocalStorageData( + 'local_storage', + 'local-storage', + ui_strings.M_VIEW_LABEL_LOCAL_STORAGE, + 'localStorage')); + window.storages.add(new cls.LocalStorageData( + 'session_storage', + 'session-storage', + ui_strings.M_VIEW_LABEL_SESSION_STORAGE, + 'sessionStorage')); + window.storages.add(new cls.LocalStorageData( + 'widget_preferences', + 'widget-preferences', + ui_strings.M_VIEW_LABEL_WIDGET_PREFERNCES, + 'widget.preferences')); + window.storages.add(new cls.CookiesData( + 'cookies', + 'cookies', + ui_strings.M_VIEW_LABEL_COOKIES)); + + new cls.StorageView("local_storage", + ui_strings.M_VIEW_LABEL_LOCAL_STORAGE, + "scroll storage_view local_storage", + "local_storage"); + new cls.StorageViewActions("local_storage"); + + new cls.StorageView("session_storage", + ui_strings.M_VIEW_LABEL_SESSION_STORAGE, + "scroll storage_view session_storage", + "session_storage"); + new cls.StorageViewActions("session_storage"); + + new cls.StorageView("cookies", + ui_strings.M_VIEW_LABEL_COOKIES, + "scroll storage_view cookies", + "cookies"); + new cls.StorageViewActions("cookies"); + + new cls.StorageView("widget_preferences", + ui_strings.M_VIEW_LABEL_WIDGET_PREFERNCES, + "scroll storage_view widget_preferences", + "widget_preferences"); + new cls.StorageViewActions("widget_preferences"); + + /* the following views must be created to get entry in the Settings tab */ + + /* Environment */ + cls.EnvironmentView.prototype = ViewBase; + new cls.EnvironmentView('environment', + ui_strings.M_VIEW_LABEL_ENVIRONMENT, + 'scroll'); + cls.EnvironmentView.create_ui_widgets(); + + /* About */ + cls.AboutView.prototype = ViewBase; + new cls.AboutView('about', ui_strings.S_SETTINGS_HEADER_ABOUT, 'scroll'); + cls.AboutView.create_ui_widgets(); + + /* Hostspotlighter */ + cls.HostSpotlightView.prototype = ViewBase; + new cls.HostSpotlightView('host-spotlight', + ui_strings.S_LABEL_SPOTLIGHT_TITLE); + cls.HostSpotlightView.create_ui_widgets(); + + /* main view doesn't really exist */ + cls.MainView.create_ui_widgets(); + + return true; + } + +} diff --git a/src/ecma-debugger/dominspection/inspectabledomnode.js b/src/ecma-debugger/dominspection/inspectabledomnode.js index 7643d11f3..43636139b 100644 --- a/src/ecma-debugger/dominspection/inspectabledomnode.js +++ b/src/ecma-debugger/dominspection/inspectabledomnode.js @@ -1,535 +1,535 @@ -window.cls || (window.cls = {}); -cls.EcmascriptDebugger || (cls.EcmascriptDebugger = {}); -cls.EcmascriptDebugger["6.0"] || (cls.EcmascriptDebugger["6.0"] = {}); - -/** - * @constructor - */ - -cls.EcmascriptDebugger["6.0"].InspectableDOMNode = function(rt_id, - obj_id, - has_error_handling) -{ - this._init(rt_id, obj_id, has_error_handling); -}; - -cls.EcmascriptDebugger["6.0"].InspectableDOMNode.OBJECT_ID = 0; -cls.EcmascriptDebugger["6.0"].InspectableDOMNode.TYPE = 1; -cls.EcmascriptDebugger["6.0"].InspectableDOMNode.NAME = 2; -cls.EcmascriptDebugger["6.0"].InspectableDOMNode.DEPTH = 3; -cls.EcmascriptDebugger["6.0"].InspectableDOMNode.NAMESPACE_PREFIX = 4; -cls.EcmascriptDebugger["6.0"].InspectableDOMNode.ATTRIBUTE_LIST = 5; -cls.EcmascriptDebugger["6.0"].InspectableDOMNode.CHILDREN_LENGTH = 6; -cls.EcmascriptDebugger["6.0"].InspectableDOMNode.VALUE = 7; -cls.EcmascriptDebugger["6.0"].InspectableDOMNode.PUBLIC_ID = 8; -cls.EcmascriptDebugger["6.0"].InspectableDOMNode.SYSTEM_ID = 9; -cls.EcmascriptDebugger["6.0"].InspectableDOMNode.RUNTIME_ID = 10; -cls.EcmascriptDebugger["6.0"].InspectableDOMNode.CONTENT_DOCUMENT = 11; -cls.EcmascriptDebugger["6.0"].InspectableDOMNode.FRAME_ELEMENT = 12; -cls.EcmascriptDebugger["6.0"].InspectableDOMNode.MATCH_REASON = 13; -cls.EcmascriptDebugger["6.0"].InspectableDOMNode.PSEUDO_ELEMENT = 14; -cls.EcmascriptDebugger["6.0"].InspectableDOMNode.EVENT_LISTENER_LIST = 15; -cls.EcmascriptDebugger["6.0"].InspectableDOMNode.PSEUDO_NODE = 0; - -cls.EcmascriptDebugger["6.0"].InspectableDOMNode.prototype = new function() -{ - - var NODE_LIST = 0; - var ID = 0; - var TYPE = 1; - var NAME = 2; - var DEPTH = 3; - - var ATTRS = 5; - var ATTR_PREFIX = 0; - var ATTR_KEY = 1; - var ATTR_VALUE = 2; - var CHILDREN_LENGTH = 6; - var PUBLIC_ID = 4; - var SYSTEM_ID = 5; - var MATCH_REASON = cls.EcmascriptDebugger["6.0"].InspectableDOMNode.MATCH_REASON; - var TRAVERSE_SEARCH = "search"; - var TRAVERSAL = 1; - var SEARCH_PARENT = 2; - var SEARCH_HIT = 3; - var PSEUDO_TYPE = 0; - var PSEUDO_ELEMENT = cls.EcmascriptDebugger["6.0"].InspectableDOMNode.PSEUDO_ELEMENT; - var PSEUDO_NODE = cls.EcmascriptDebugger["6.0"].InspectableDOMNode.PSEUDO_NODE; - var BEFORE = 1; - var AFTER = 2; - var FIRST_LETTER = 3; - var FIRST_LINE = 4; - var BEFORE_ALIKES = [BEFORE, FIRST_LETTER, FIRST_LINE]; - var AFTER_ALIKES = [AFTER]; - var ERROR_MSG = 0; - var PSEUDO_NAME = {}; - var EVENT_LISTENER_LIST = cls.EcmascriptDebugger["6.0"].InspectableDOMNode.EVENT_LISTENER_LIST; - - PSEUDO_NAME[BEFORE] = "before"; - PSEUDO_NAME[AFTER] = "after"; - PSEUDO_NAME[FIRST_LETTER] = "first-letter"; - PSEUDO_NAME[FIRST_LINE] = "first-line"; - - this._set_mime = function() - { - if (this._data) - for (var node = null, i = 0; node = this._data[i]; i++) - { - if (node[TYPE] == 1 ) - { - // TODO take in account doctype if present - return /^[A-Z][A-Z0-9]*$/.test(node[NAME]) && "text/html" || "application/xml"; - } - } - return ""; - }; - - this.get_mime = function() - { - return this._mime; - } - - this.isTextHtml = function() - { - return this._data.length && this._mime == "text/html" || false; - }; - - this.expand = function(cb, object_id, traverse_type) - { - this._get_dom(object_id, traverse_type || "children", cb); - } - - // this method is only supported in ECMAScriptDebugger 6.5 and higher - this.search = function(query, type, ignore_case, object_id, cb) - { - this._isprocessing = true; - var tag = window.tag_manager.set_callback(this, - this.__handle_dom, - [object_id, TRAVERSE_SEARCH, cb]); - this.search_type = type; - var msg = [this._data_runtime_id, - query, - type, - object_id || null, - ignore_case || 0]; - services['ecmascript-debugger'].requestSearchDom(tag, msg); - }; - - // this method makes only sense with ECMAScriptDebugger 6.5 and higher - this.get_match_count = function() - { - var i = 0, count = 0, length = this._data ? this._data.length : 0; - for (; i < length; i++) - { - if (this._data[i][MATCH_REASON] == SEARCH_HIT) - { - count++; - } - } - return count; - }; - - // this method makes only sense with ECMAScriptDebugger 6.5 and higher - this.clear_search = function() - { - for (var i = 0; this._data[i]; i++) - { - this._data[i][MATCH_REASON] = TRAVERSAL; - }; - }; - - this.node_has_attr = function(node_id, attr_name) - { - var node = this.get_node(node_id); - var attrs = node && node[ATTRS]; - return attrs && attrs.some(function(attr) - { - return attr[ATTR_KEY] == attr_name; - }); - } - - this._get_dom = function(object_id, traverse_type, cb) - { - this._isprocessing = true; - var tag = window.tag_manager.set_callback(this, this.__handle_dom, [object_id, traverse_type, cb]); - services['ecmascript-debugger'].requestInspectDom(tag, [object_id, traverse_type]); - }; - - this.__handle_dom = function(status, message, object_id, traverse_type, cb) - { - var - _data = message[NODE_LIST] || [], - error_ms = ui_strings.S_DRAGONFLY_INFO_MESSAGE + 'this.__handle_dom failed in DOMBaseData', - splice_args = null, - i = 0; - - if (!status) - { - switch (traverse_type) - { - // traverse_type 'node' so far not supported - case TRAVERSE_SEARCH: - case "parent-node-chain-with-children": - { - if (traverse_type != "search" || !object_id) - { - this._data = _data; - this._unfold_pseudos(); - break; - } - } - case "subtree": - case "children": - case "node": - { - for (; this._data[i] && this._data[i][ID] != object_id; i++); - if (this._data[i]) - { - // A search with an object_id searches only in the subtree - // of that node, but returns a tree with the ancestor up - // to the document. - // For the use case in Dragonfly we cut away the chain from - // the object up to the document. - if (traverse_type == "search") - { - this.clear_search(); - for (var j = 0; _data[j] && _data[j][ID] != object_id; j++); - if (_data[j]) - { - _data = _data.slice(j); - } - } - // if object_id matches the one of the first node - // of the return data the traversal was subtree - // a search can return no data - if (_data[0]) - { - if (object_id == _data[0][ID]) - { - this.collapse(object_id); - this._data.insert(i, _data, 1); - } - else - { - this._data.insert(i + 1, _data); - } - - } - this._unfold_pseudos(i, _data.length, traverse_type == "subtree"); - } - else if (!this._data.length) - { - this._data = _data; - this._unfold_pseudos(); - } - else - opera.postError(error_ms); - break; - } - } - this._mime = this._set_mime(); - if (cb) - cb(); - } - else if(traverse_type == "search") - { - this._data = []; - cb(); - } - else if (this._has_error_handling) - { - this.error = message[ERROR_MSG]; - if (cb) - cb(); - } - else - { - opera.postError(error_ms + ' ' + JSON.stringify(message)); - } - this._isprocessing = false; - }; - - this._unfold_pseudos = function(index, length, force_unfold) - { - typeof index == "number" || (index = 0); - typeof length == "number" || (length = this._data ? this._data.length : 0); - - if (this._data && this._data[index]) - { - var current_depth = this._data[index][DEPTH]; - var parent_stack = []; - var i = index; - var delta = 0; - var cur = null; - - for ( ; i <= index + length && (cur = this._data[i + delta]); i++) - { - if (cur[DEPTH] > current_depth) - { - parent_stack.push(this._data[i + delta - 1]); - delta += this._insert_pseudos(parent_stack.last, - i + delta, - BEFORE_ALIKES); - current_depth++; - } - else if (cur[DEPTH] < current_depth) - { - while (cur[DEPTH] < current_depth) - { - delta += this._insert_pseudos(parent_stack.last, - i + delta, - AFTER_ALIKES); - parent_stack.pop(); - current_depth--; - } - } - - if (!cur[CHILDREN_LENGTH] && - (force_unfold || current_depth == this._data[index][DEPTH])) - { - delta += this._insert_pseudos(cur, i + delta + 1, BEFORE_ALIKES); - delta += this._insert_pseudos(cur, i + delta + 1, AFTER_ALIKES); - } - } - - while (parent_stack.length) - { - delta += this._insert_pseudos(parent_stack.pop(), - i + delta, - AFTER_ALIKES); - } - } - }; - - this._insert_pseudos = function(node, index, alike) - { - var ret = []; - - if (node && node[PSEUDO_ELEMENT]) - { - for (var i = 0, cur; cur = node[PSEUDO_ELEMENT][i]; i++) - { - if (alike.contains(cur[PSEUDO_TYPE])) - { - ret.push([node[ID], - PSEUDO_NODE, - PSEUDO_NAME[cur[PSEUDO_TYPE]], - node[DEPTH] + 1]); - } - } - } - - if (ret.length) - { - this._data.insert(index, ret); - } - return ret.length; - }; - - this.__defineGetter__('isprocessing', function() - { - return this._isprocessing; - }); - - this.__defineSetter__('isprocessing', function(){}); - - this.collapse = function(object_id) - { - var i = 0, j = 0, level = 0; - for (; this._data[i] && this._data[i][ID] != object_id; i++ ); - if (this._data[i]) - { - level = this._data[i][DEPTH]; - i += 1; - j = i; - while (this._data[j] && this._data[j][DEPTH] > level) - j++; - if (j - i) - { - this._data.splice(i, j - i); - } - } - else - { - opera.postError(ui_strings.S_DRAGONFLY_INFO_MESSAGE + - 'missing refrence in collapse_node in DOMBaseData'); - } - }; - - this._get_element_name = function(data_entry, force_lower_case, with_ids_and_classes) - { - var name = data_entry[NAME], attrs = data_entry[ATTRS], id = '', class_name = ''; - if (force_lower_case) - name = name.toLowerCase(); - if (with_ids_and_classes) - { - for (var attr, i = 0; attr = attrs[i]; i++) - { - if (attr[ATTR_KEY] == 'id') - id = "#" + attr[ATTR_VALUE]; - if (attr[ATTR_KEY] == 'class' && attr[ATTR_VALUE].trim()) - class_name = "." + attr[ATTR_VALUE].trim().replace(/\s+/g, "."); - } - } - return name + id + class_name; - } - - this._parse_parent_offset = function(chain) - { - var ret = false, cur = null; - if (chain) - { - cur = chain.pop(); - if (cur) - ret = cur[1] == '1'; - else - opera.postError(ui_strings.S_DRAGONFLY_INFO_MESSAGE + - "failed in this._parse_parent_offset in InspectableDOMNode"); - } - return ret; - } - - this.get_css_path = - this._get_css_path = function(object_id, parent_offset_chain, - force_lower_case, show_id_and_classes, show_siblings) - { - var i = 0, j = 0, path = []; - if (object_id) - { - if (parent_offset_chain) - { - parent_offset_chain = parent_offset_chain.slice(0); - } - for ( ; this._data[i] && this._data[i][ID] != object_id; i++); - if (this._data[i]) - { - if (this._data[i][TYPE] == 1) - { - path.unshift({ - name: this._get_element_name(this._data[i], force_lower_case, show_id_and_classes), - id: this._data[i][ID], - combinator: "", - is_parent_offset: this._parse_parent_offset(parent_offset_chain) - }); - } - j = i; - i--; - for ( ; this._data[i]; i--) - { - if (this._data[i][TYPE] == 1 && this._data[i][DEPTH] <= this._data[j][DEPTH]) - { - if (this._data[i][DEPTH] < this._data[j][DEPTH]) - { - path.unshift({ - name: this._get_element_name(this._data[i], force_lower_case, show_id_and_classes), - id: this._data[i][ID], - combinator: ">", - is_parent_offset: this._parse_parent_offset(parent_offset_chain) - }); - } - else if (show_siblings) - { - path.unshift({ - name: this._get_element_name(this._data[i], force_lower_case, show_id_and_classes), - id: this._data[i][ID], - combinator: "+", - is_parent_offset: false - }); - } - j = i; - } - } - } - } - return path; - } - - this.has_data = function() - { - return Boolean(this._data && this._data.length); - } - - this.get_node = function(node_id) - { - if (this.has_data()) - { - for (var i = 0; this._data[i] && this._data[i][ID] != node_id; i++); - return this._data[i]; - } - return null; - }; - - this.has_node = function(node_id) - { - return Boolean(this.get_node(node_id)); - }; - - this.get_ev_listeners = function(node_id) - { - var node = this.get_node(node_id); - return node && node[EVENT_LISTENER_LIST] || []; - }; - - this.get_data = this.getData = function() - { - return this._data; - } - - this.getParentElement = function(obj_id) - { - var i = 0, depth = 0; - for ( ; this._data[i] && this._data[i][ID] != obj_id; i++) - ; - if (this._data[i]) - { - depth = this._data[i][DEPTH]; - for ( ; this._data[i] && !((this._data[i][TYPE] == 1 || this._data[i][TYPE] == 9) && this._data[i][DEPTH] < depth); i--); - return this._data[i] && this._data[i][ID] || 0; - } - } - - this.getRootElement = function() - { - for (var i = 0; this._data[i] && this._data[i][TYPE] != 1; i++) - ; - return this._data[i] && this._data[i][ID] || 0; - } - - this.get_depth_of_first_element = function() - { - for (var i = 0; this._data[i] && this._data[i][TYPE] != 1; i++) - ; - return this._data[i] && this._data[i][DEPTH] || 0; - } - - this.getDataRuntimeId = function() - { - return this._data_runtime_id; - } - - this._get_id = (function() - { - var id_counter = 0; - return function() - { - id_counter++; - return "dom-inspection-id-" + id_counter.toString(); - }; - })(); - - this._init = function(rt_id, obj_id, has_error_handling) - { - this.id = this._get_id(); - this._data_runtime_id = rt_id || 0; // data of a dom tree has always just one runtime - this._root_obj_id = obj_id || 0; - this._has_error_handling = has_error_handling; - this._data = []; - this._mime = ''; - if (!window.dominspections) - { - new cls.Namespace("dominspections"); - } - window.dominspections.add(this); - }; - -}; +window.cls || (window.cls = {}); +cls.EcmascriptDebugger || (cls.EcmascriptDebugger = {}); +cls.EcmascriptDebugger["6.0"] || (cls.EcmascriptDebugger["6.0"] = {}); + +/** + * @constructor + */ + +cls.EcmascriptDebugger["6.0"].InspectableDOMNode = function(rt_id, + obj_id, + has_error_handling) +{ + this._init(rt_id, obj_id, has_error_handling); +}; + +cls.EcmascriptDebugger["6.0"].InspectableDOMNode.OBJECT_ID = 0; +cls.EcmascriptDebugger["6.0"].InspectableDOMNode.TYPE = 1; +cls.EcmascriptDebugger["6.0"].InspectableDOMNode.NAME = 2; +cls.EcmascriptDebugger["6.0"].InspectableDOMNode.DEPTH = 3; +cls.EcmascriptDebugger["6.0"].InspectableDOMNode.NAMESPACE_PREFIX = 4; +cls.EcmascriptDebugger["6.0"].InspectableDOMNode.ATTRIBUTE_LIST = 5; +cls.EcmascriptDebugger["6.0"].InspectableDOMNode.CHILDREN_LENGTH = 6; +cls.EcmascriptDebugger["6.0"].InspectableDOMNode.VALUE = 7; +cls.EcmascriptDebugger["6.0"].InspectableDOMNode.PUBLIC_ID = 8; +cls.EcmascriptDebugger["6.0"].InspectableDOMNode.SYSTEM_ID = 9; +cls.EcmascriptDebugger["6.0"].InspectableDOMNode.RUNTIME_ID = 10; +cls.EcmascriptDebugger["6.0"].InspectableDOMNode.CONTENT_DOCUMENT = 11; +cls.EcmascriptDebugger["6.0"].InspectableDOMNode.FRAME_ELEMENT = 12; +cls.EcmascriptDebugger["6.0"].InspectableDOMNode.MATCH_REASON = 13; +cls.EcmascriptDebugger["6.0"].InspectableDOMNode.PSEUDO_ELEMENT = 14; +cls.EcmascriptDebugger["6.0"].InspectableDOMNode.EVENT_LISTENER_LIST = 15; +cls.EcmascriptDebugger["6.0"].InspectableDOMNode.PSEUDO_NODE = 0; + +cls.EcmascriptDebugger["6.0"].InspectableDOMNode.prototype = new function() +{ + + var NODE_LIST = 0; + var ID = 0; + var TYPE = 1; + var NAME = 2; + var DEPTH = 3; + + var ATTRS = 5; + var ATTR_PREFIX = 0; + var ATTR_KEY = 1; + var ATTR_VALUE = 2; + var CHILDREN_LENGTH = 6; + var PUBLIC_ID = 4; + var SYSTEM_ID = 5; + var MATCH_REASON = cls.EcmascriptDebugger["6.0"].InspectableDOMNode.MATCH_REASON; + var TRAVERSE_SEARCH = "search"; + var TRAVERSAL = 1; + var SEARCH_PARENT = 2; + var SEARCH_HIT = 3; + var PSEUDO_TYPE = 0; + var PSEUDO_ELEMENT = cls.EcmascriptDebugger["6.0"].InspectableDOMNode.PSEUDO_ELEMENT; + var PSEUDO_NODE = cls.EcmascriptDebugger["6.0"].InspectableDOMNode.PSEUDO_NODE; + var BEFORE = 1; + var AFTER = 2; + var FIRST_LETTER = 3; + var FIRST_LINE = 4; + var BEFORE_ALIKES = [BEFORE, FIRST_LETTER, FIRST_LINE]; + var AFTER_ALIKES = [AFTER]; + var ERROR_MSG = 0; + var PSEUDO_NAME = {}; + var EVENT_LISTENER_LIST = cls.EcmascriptDebugger["6.0"].InspectableDOMNode.EVENT_LISTENER_LIST; + + PSEUDO_NAME[BEFORE] = "before"; + PSEUDO_NAME[AFTER] = "after"; + PSEUDO_NAME[FIRST_LETTER] = "first-letter"; + PSEUDO_NAME[FIRST_LINE] = "first-line"; + + this._set_mime = function() + { + if (this._data) + for (var node = null, i = 0; node = this._data[i]; i++) + { + if (node[TYPE] == 1 ) + { + // TODO take in account doctype if present + return /^[A-Z][A-Z0-9]*$/.test(node[NAME]) && "text/html" || "application/xml"; + } + } + return ""; + }; + + this.get_mime = function() + { + return this._mime; + } + + this.isTextHtml = function() + { + return this._data.length && this._mime == "text/html" || false; + }; + + this.expand = function(cb, object_id, traverse_type) + { + this._get_dom(object_id, traverse_type || "children", cb); + } + + // this method is only supported in ECMAScriptDebugger 6.5 and higher + this.search = function(query, type, ignore_case, object_id, cb) + { + this._isprocessing = true; + var tag = window.tag_manager.set_callback(this, + this.__handle_dom, + [object_id, TRAVERSE_SEARCH, cb]); + this.search_type = type; + var msg = [this._data_runtime_id, + query, + type, + object_id || null, + ignore_case || 0]; + services['ecmascript-debugger'].requestSearchDom(tag, msg); + }; + + // this method makes only sense with ECMAScriptDebugger 6.5 and higher + this.get_match_count = function() + { + var i = 0, count = 0, length = this._data ? this._data.length : 0; + for (; i < length; i++) + { + if (this._data[i][MATCH_REASON] == SEARCH_HIT) + { + count++; + } + } + return count; + }; + + // this method makes only sense with ECMAScriptDebugger 6.5 and higher + this.clear_search = function() + { + for (var i = 0; this._data[i]; i++) + { + this._data[i][MATCH_REASON] = TRAVERSAL; + }; + }; + + this.node_has_attr = function(node_id, attr_name) + { + var node = this.get_node(node_id); + var attrs = node && node[ATTRS]; + return attrs && attrs.some(function(attr) + { + return attr[ATTR_KEY] == attr_name; + }); + } + + this._get_dom = function(object_id, traverse_type, cb) + { + this._isprocessing = true; + var tag = window.tag_manager.set_callback(this, this.__handle_dom, [object_id, traverse_type, cb]); + services['ecmascript-debugger'].requestInspectDom(tag, [object_id, traverse_type]); + }; + + this.__handle_dom = function(status, message, object_id, traverse_type, cb) + { + var + _data = message[NODE_LIST] || [], + error_ms = ui_strings.S_DRAGONFLY_INFO_MESSAGE + 'this.__handle_dom failed in DOMBaseData', + splice_args = null, + i = 0; + + if (!status) + { + switch (traverse_type) + { + // traverse_type 'node' so far not supported + case TRAVERSE_SEARCH: + case "parent-node-chain-with-children": + { + if (traverse_type != "search" || !object_id) + { + this._data = _data; + this._unfold_pseudos(); + break; + } + } + case "subtree": + case "children": + case "node": + { + for (; this._data[i] && this._data[i][ID] != object_id; i++); + if (this._data[i]) + { + // A search with an object_id searches only in the subtree + // of that node, but returns a tree with the ancestor up + // to the document. + // For the use case in Dragonfly we cut away the chain from + // the object up to the document. + if (traverse_type == "search") + { + this.clear_search(); + for (var j = 0; _data[j] && _data[j][ID] != object_id; j++); + if (_data[j]) + { + _data = _data.slice(j); + } + } + // if object_id matches the one of the first node + // of the return data the traversal was subtree + // a search can return no data + if (_data[0]) + { + if (object_id == _data[0][ID]) + { + this.collapse(object_id); + this._data.insert(i, _data, 1); + } + else + { + this._data.insert(i + 1, _data); + } + + } + this._unfold_pseudos(i, _data.length, traverse_type == "subtree"); + } + else if (!this._data.length) + { + this._data = _data; + this._unfold_pseudos(); + } + else + opera.postError(error_ms); + break; + } + } + this._mime = this._set_mime(); + if (cb) + cb(); + } + else if(traverse_type == "search") + { + this._data = []; + cb(); + } + else if (this._has_error_handling) + { + this.error = message[ERROR_MSG]; + if (cb) + cb(); + } + else + { + opera.postError(error_ms + ' ' + JSON.stringify(message)); + } + this._isprocessing = false; + }; + + this._unfold_pseudos = function(index, length, force_unfold) + { + typeof index == "number" || (index = 0); + typeof length == "number" || (length = this._data ? this._data.length : 0); + + if (this._data && this._data[index]) + { + var current_depth = this._data[index][DEPTH]; + var parent_stack = []; + var i = index; + var delta = 0; + var cur = null; + + for ( ; i <= index + length && (cur = this._data[i + delta]); i++) + { + if (cur[DEPTH] > current_depth) + { + parent_stack.push(this._data[i + delta - 1]); + delta += this._insert_pseudos(parent_stack.last, + i + delta, + BEFORE_ALIKES); + current_depth++; + } + else if (cur[DEPTH] < current_depth) + { + while (cur[DEPTH] < current_depth) + { + delta += this._insert_pseudos(parent_stack.last, + i + delta, + AFTER_ALIKES); + parent_stack.pop(); + current_depth--; + } + } + + if (!cur[CHILDREN_LENGTH] && + (force_unfold || current_depth == this._data[index][DEPTH])) + { + delta += this._insert_pseudos(cur, i + delta + 1, BEFORE_ALIKES); + delta += this._insert_pseudos(cur, i + delta + 1, AFTER_ALIKES); + } + } + + while (parent_stack.length) + { + delta += this._insert_pseudos(parent_stack.pop(), + i + delta, + AFTER_ALIKES); + } + } + }; + + this._insert_pseudos = function(node, index, alike) + { + var ret = []; + + if (node && node[PSEUDO_ELEMENT]) + { + for (var i = 0, cur; cur = node[PSEUDO_ELEMENT][i]; i++) + { + if (alike.contains(cur[PSEUDO_TYPE])) + { + ret.push([node[ID], + PSEUDO_NODE, + PSEUDO_NAME[cur[PSEUDO_TYPE]], + node[DEPTH] + 1]); + } + } + } + + if (ret.length) + { + this._data.insert(index, ret); + } + return ret.length; + }; + + this.__defineGetter__('isprocessing', function() + { + return this._isprocessing; + }); + + this.__defineSetter__('isprocessing', function(){}); + + this.collapse = function(object_id) + { + var i = 0, j = 0, level = 0; + for (; this._data[i] && this._data[i][ID] != object_id; i++ ); + if (this._data[i]) + { + level = this._data[i][DEPTH]; + i += 1; + j = i; + while (this._data[j] && this._data[j][DEPTH] > level) + j++; + if (j - i) + { + this._data.splice(i, j - i); + } + } + else + { + opera.postError(ui_strings.S_DRAGONFLY_INFO_MESSAGE + + 'missing refrence in collapse_node in DOMBaseData'); + } + }; + + this._get_element_name = function(data_entry, force_lower_case, with_ids_and_classes) + { + var name = data_entry[NAME], attrs = data_entry[ATTRS], id = '', class_name = ''; + if (force_lower_case) + name = name.toLowerCase(); + if (with_ids_and_classes) + { + for (var attr, i = 0; attr = attrs[i]; i++) + { + if (attr[ATTR_KEY] == 'id') + id = "#" + attr[ATTR_VALUE]; + if (attr[ATTR_KEY] == 'class' && attr[ATTR_VALUE].trim()) + class_name = "." + attr[ATTR_VALUE].trim().replace(/\s+/g, "."); + } + } + return name + id + class_name; + } + + this._parse_parent_offset = function(chain) + { + var ret = false, cur = null; + if (chain) + { + cur = chain.pop(); + if (cur) + ret = cur[1] == '1'; + else + opera.postError(ui_strings.S_DRAGONFLY_INFO_MESSAGE + + "failed in this._parse_parent_offset in InspectableDOMNode"); + } + return ret; + } + + this.get_css_path = + this._get_css_path = function(object_id, parent_offset_chain, + force_lower_case, show_id_and_classes, show_siblings) + { + var i = 0, j = 0, path = []; + if (object_id) + { + if (parent_offset_chain) + { + parent_offset_chain = parent_offset_chain.slice(0); + } + for ( ; this._data[i] && this._data[i][ID] != object_id; i++); + if (this._data[i]) + { + if (this._data[i][TYPE] == 1) + { + path.unshift({ + name: this._get_element_name(this._data[i], force_lower_case, show_id_and_classes), + id: this._data[i][ID], + combinator: "", + is_parent_offset: this._parse_parent_offset(parent_offset_chain) + }); + } + j = i; + i--; + for ( ; this._data[i]; i--) + { + if (this._data[i][TYPE] == 1 && this._data[i][DEPTH] <= this._data[j][DEPTH]) + { + if (this._data[i][DEPTH] < this._data[j][DEPTH]) + { + path.unshift({ + name: this._get_element_name(this._data[i], force_lower_case, show_id_and_classes), + id: this._data[i][ID], + combinator: ">", + is_parent_offset: this._parse_parent_offset(parent_offset_chain) + }); + } + else if (show_siblings) + { + path.unshift({ + name: this._get_element_name(this._data[i], force_lower_case, show_id_and_classes), + id: this._data[i][ID], + combinator: "+", + is_parent_offset: false + }); + } + j = i; + } + } + } + } + return path; + } + + this.has_data = function() + { + return Boolean(this._data && this._data.length); + } + + this.get_node = function(node_id) + { + if (this.has_data()) + { + for (var i = 0; this._data[i] && this._data[i][ID] != node_id; i++); + return this._data[i]; + } + return null; + }; + + this.has_node = function(node_id) + { + return Boolean(this.get_node(node_id)); + }; + + this.get_ev_listeners = function(node_id) + { + var node = this.get_node(node_id); + return node && node[EVENT_LISTENER_LIST] || []; + }; + + this.get_data = this.getData = function() + { + return this._data; + } + + this.getParentElement = function(obj_id) + { + var i = 0, depth = 0; + for ( ; this._data[i] && this._data[i][ID] != obj_id; i++) + ; + if (this._data[i]) + { + depth = this._data[i][DEPTH]; + for ( ; this._data[i] && !((this._data[i][TYPE] == 1 || this._data[i][TYPE] == 9) && this._data[i][DEPTH] < depth); i--); + return this._data[i] && this._data[i][ID] || 0; + } + } + + this.getRootElement = function() + { + for (var i = 0; this._data[i] && this._data[i][TYPE] != 1; i++) + ; + return this._data[i] && this._data[i][ID] || 0; + } + + this.get_depth_of_first_element = function() + { + for (var i = 0; this._data[i] && this._data[i][TYPE] != 1; i++) + ; + return this._data[i] && this._data[i][DEPTH] || 0; + } + + this.getDataRuntimeId = function() + { + return this._data_runtime_id; + } + + this._get_id = (function() + { + var id_counter = 0; + return function() + { + id_counter++; + return "dom-inspection-id-" + id_counter.toString(); + }; + })(); + + this._init = function(rt_id, obj_id, has_error_handling) + { + this.id = this._get_id(); + this._data_runtime_id = rt_id || 0; // data of a dom tree has always just one runtime + this._root_obj_id = obj_id || 0; + this._has_error_handling = has_error_handling; + this._data = []; + this._mime = ''; + if (!window.dominspections) + { + new cls.Namespace("dominspections"); + } + window.dominspections.add(this); + }; + +}; diff --git a/src/ecma-debugger/dominspection/templates.js b/src/ecma-debugger/dominspection/templates.js index 8df0a4fcc..c6ccf9cd2 100644 --- a/src/ecma-debugger/dominspection/templates.js +++ b/src/ecma-debugger/dominspection/templates.js @@ -1,905 +1,905 @@ -(function() -{ - const ID = 0; - const TYPE = 1; - const NAME = 2; - const DEPTH = 3; - const NAMESPACE = 4; - const VALUE = 7; - const ATTRS = 5; - const ATTR_PREFIX = 0; - const ATTR_KEY = 1; - const ATTR_VALUE = 2; - const CHILDREN_LENGTH = 6; - const MATCH_REASON = cls.EcmascriptDebugger["6.0"].InspectableDOMNode.MATCH_REASON; - const INDENT = " "; - const LINEBREAK = '\n'; - const SEARCH_PARENT = 2; - - const ELEMENT_NODE = Node.ELEMENT_NODE; - const TEXT_NODE = Node.TEXT_NODE; - const CDATA_SECTION_NODE = Node.CDATA_SECTION_NODE; - const PROCESSING_INSTRUCTION_NODE = Node.PROCESSING_INSTRUCTION_NODE; - const COMMENT_NODE = Node.COMMENT_NODE; - const DOCUMENT_NODE = Node.DOCUMENT_NODE; - const DOCUMENT_TYPE_NODE = Node.DOCUMENT_TYPE_NODE; - const PSEUDO_NODE = cls.EcmascriptDebugger["6.0"].InspectableDOMNode.PSEUDO_NODE; - - const PSEUDO_ELEMENT_LIST = 14; - const PSEUDO_ELEMENT_TYPE = 0; - const PSEUDO_ELEMENT_CONTENT = 1; - - const PSEUDO_ELEMENT_BEFORE = 1; - const PSEUDO_ELEMENT_AFTER = 2; - const PSEUDO_ELEMENT_FIRST_LETTER = 3; - const PSEUDO_ELEMENT_FIRST_LINE = 4; - const EVENT_LISTENER_LIST = 15; - - var EV_LISTENER_MARKUP = "" - - this._pseudo_element_map = {}; - this._pseudo_element_map[PSEUDO_ELEMENT_BEFORE] = "before"; - this._pseudo_element_map[PSEUDO_ELEMENT_AFTER] = "after"; - this._pseudo_element_map[PSEUDO_ELEMENT_FIRST_LETTER] = "first-letter"; - this._pseudo_element_map[PSEUDO_ELEMENT_FIRST_LINE] = "first-line"; - - this._node_name_map = {}; - this._node_name_map[TEXT_NODE] = "#text "; - this._node_name_map[CDATA_SECTION_NODE] = "#cdata-section"; - - var disregard_force_lower_case_whitelist = - cls.EcmascriptDebugger["6.0"].DOMData.DISREGARD_FORCE_LOWER_CASE_WHITELIST; - - var disregard_force_lower_case = function(node) - { - return disregard_force_lower_case_whitelist - .indexOf(node[NAME].toLowerCase()) != -1; - }; - - /** - * Generates the part of the document type declaration after the document - * element type name. - */ - this._get_doctype_external_identifier = function(node) - { - const PUBLIC_ID = 8 - const SYSTEM_ID = 9; - - // Missing public IDs and system IDs are returned as empty strings, - // so it's impossible to distinguish them from empty ones. In reality - // this should happen very seldom, so it's not really a problem. - var public_id = node[PUBLIC_ID]; - var system_id = node[SYSTEM_ID]; - return (public_id - ? " PUBLIC \"" + public_id + "\"" - : "") + - (!public_id && system_id - ? " SYSTEM" - : "") + - (system_id - ? " \"" + system_id + "\"" - : ""); - }; - - this._get_pseudo_elements = function(element) - { - var is_tree_mode = window.settings.dom.get("dom-tree-style"); - var pseudo_element_list = element[PSEUDO_ELEMENT_LIST]; - var pseudo_elements = {}; - - if (pseudo_element_list) - { - pseudo_element_list.forEach(function(pseudo_element) { - var type = this._pseudo_element_map[pseudo_element[PSEUDO_ELEMENT_TYPE]]; - pseudo_elements[pseudo_element[PSEUDO_ELEMENT_TYPE]] = - "
" + - "" + - (is_tree_mode ? "::" + type : "<::" + type + "/>") + - "" + - "
"; - }, this); - } - - return pseudo_elements; - }; - - var formatProcessingInstructionValue = function(str, force_lower_case) - { - var r_attrs = str.split(' '), r_attr = '', i=0, attrs = '', attr = null; - - for ( ; i < r_attrs.length; i++) - { - if (r_attr = r_attrs[i]) - { - attr = r_attr.split('='); - attrs += " " + - (force_lower_case ? attr[0].toLowerCase() : attr[0]) + - "=" + - attr[1] + - ""; - } - } - return attrs; - }; - - var safe_escape_attr_key = function(attr, force_lower_case) - { - return ( - ((attr[ATTR_PREFIX] ? attr[ATTR_PREFIX] + ':' : '') + - /* regarding escaping "<". - it happens that there are very starnge keys in broken html. - perhaps we will have to extend the escaping to other data - tokens as well */ - (force_lower_case ? attr[ATTR_KEY].toLowerCase() : attr[ATTR_KEY])) - .replace(/=\"" + attr_value + "\""; - } - else - { - attrs += " " + safe_escape_attr_key(attr) + "=\"" + attr_value + "\""; - } - } - return attrs; - }; - - this._dom_attrs_search = function(node, force_lower_case) - { - for (var i = 0, attr, attr_value, attrs = ''; attr = node[ATTRS][i]; i++) - { - attr_value = helpers.escapeAttributeHtml(attr[ATTR_VALUE]); - attrs += " " + - "" + safe_escape_attr_key(attr) + "" + - "=\"" + - "" + attr_value + "" + - "\""; - } - return attrs; - }; - - this.dom_search = function(model) - { - var data = model.getData(); - var is_tree_style = window.settings.dom.get('dom-tree-style'); - var tree = ""; - var length = data.length; - var attrs = null; - var force_lower_case = model.isTextHtml() && - window.settings.dom.get('force-lowercase'); - var show_comments = window.settings.dom.get('show-comments'); - var node_name = ''; - var disregard_force_lower_case_depth = 0; - var open_tag = is_tree_style ? "" : "<"; - var close_tag = is_tree_style ? "" : ">"; - var ev_listener = ""; - - for (var i = 0, node; node = data[i]; i++) - { - if (node[MATCH_REASON] == SEARCH_PARENT) - { - continue; - } - node_name = (node[NAMESPACE] ? node[NAMESPACE] + ':': '') + node[NAME]; - node_name = helpers.escapeTextHtml(node_name); - if (force_lower_case && disregard_force_lower_case(node)) - { - disregard_force_lower_case_depth = node[DEPTH]; - force_lower_case = false; - } - else if (disregard_force_lower_case_depth && - disregard_force_lower_case_depth == node[DEPTH]) - { - disregard_force_lower_case_depth = 0; - force_lower_case = model.isTextHtml() && - window.settings.dom.get('force-lowercase'); - } - if (force_lower_case) - { - node_name = node_name.toLowerCase(); - } - ev_listener = node[EVENT_LISTENER_LIST] && node[EVENT_LISTENER_LIST].length - ? EV_LISTENER_MARKUP - : ""; - switch (node[TYPE]) - { - case PSEUDO_NODE: - { - break; - } - case ELEMENT_NODE: - { - attrs = this._dom_attrs_search(node, force_lower_case); - tree += ""; - break; - } - case PROCESSING_INSTRUCTION_NODE: - { - // TODO - tree += - ""; - break; - } - case COMMENT_NODE: - { - if (show_comments && !/^\s*$/.test(node[VALUE])) - { - tree += - ""; - } - break; - } - case DOCUMENT_NODE: - { - if (ev_listener) - { - tree += ""; - } - break; - } - case DOCUMENT_TYPE_NODE: - { - // TODO - // currently we don't earch in doctype nodes on the host side - tree += - ""; - break; - } - default: - { - if (!/^\s*$/.test(node[VALUE])) - { - tree += - ""; - } - } - } - } - tree += ""; - return tree; - }; - - this._inspected_dom_node_markup_style= function(model, target, editable, no_contextmenu) - { - var data = model.getData(); - var tree = "
"; - var i = 0; - var node = null; - var length = data.length; - var attrs = null, attr = null, k = 0, key = '', attr_value = ''; - var is_open = false; - var has_only_text_content = false; - var one_child_text_content = ''; - var current_depth = 0; - var child_pointer = 0; - var child_level = 0; - var children_length = 0; - var closing_tags = []; - var force_lower_case = model.isTextHtml() && window.settings.dom.get('force-lowercase'); - var show_comments = window.settings.dom.get('show-comments'); - var class_name = ''; - var re_formatted = /script|style|#comment/i; - var style = null; - var is_script_node = true; - var is_debug = ini.debug; - var disregard_force_lower_case_depth = 0; - var depth_first_ele = model.get_depth_of_first_element(); - var show_pseudo_elements = window.settings.dom.get("show-pseudo-elements"); - var is_expandable = false; - - for ( ; node = data[i]; i += 1) - { - while (current_depth > node[DEPTH]) - { - tree += closing_tags.pop(); - current_depth--; - } - current_depth = node[DEPTH]; - children_length = node[CHILDREN_LENGTH]; - is_expandable = children_length || (show_pseudo_elements && - node[PSEUDO_ELEMENT_LIST]); - child_pointer = 0; - - if (force_lower_case && disregard_force_lower_case(node)) - { - disregard_force_lower_case_depth = node[DEPTH]; - force_lower_case = false; - } - else if (disregard_force_lower_case_depth && - disregard_force_lower_case_depth == node[DEPTH]) - { - disregard_force_lower_case_depth = 0; - force_lower_case = model.isTextHtml() && window.settings.dom.get('force-lowercase'); - } - - switch (node[TYPE]) - { - case PSEUDO_NODE: - { - if (show_pseudo_elements) - { - tree += "
" + - "" + - "<::" + node[NAME] + ">" + - "" + - "
"; - } - break; - } - case ELEMENT_NODE: - { - var node_name = (node[NAMESPACE] ? node[NAMESPACE] + ':' : '') + node[NAME]; - node_name = helpers.escapeTextHtml(node_name); - var ev_listener = node[EVENT_LISTENER_LIST] && node[EVENT_LISTENER_LIST].length - ? EV_LISTENER_MARKUP - : ""; - - if (force_lower_case) - { - node_name = node_name.toLowerCase(); - } - is_script_node = node[NAME].toLowerCase() == 'script'; - attrs = ''; - for (k = 0; attr = node[ATTRS][k]; k++) - { - attr_value = helpers.escapeAttributeHtml(attr[ATTR_VALUE]); - attrs += " " + - ((attr[ATTR_PREFIX] ? attr[ATTR_PREFIX] + ':' : '') + - /* Regarding escaping "<". It happens that there are very - strange keys in broken html. Perhaps we will have to extend - the escaping to other data tokens as well */ - (force_lower_case ? attr[ATTR_KEY].toLowerCase() - : attr[ATTR_KEY])).replace(/=\"" + - attr_value + - "\""; - } - - child_pointer = i + 1; - is_open = (data[child_pointer] && (node[DEPTH] < data[child_pointer][DEPTH])); - if (is_open) - { - one_child_text_content = ''; - has_only_text_content = false; - child_level = data[child_pointer][DEPTH]; - for ( ; data[child_pointer] && data[child_pointer][DEPTH] == child_level; - child_pointer += 1) - { - has_only_text_content = true; - if (data[child_pointer][TYPE] != TEXT_NODE) - { - has_only_text_content = false; - one_child_text_content = ''; - break; - } - // perhaps this needs to be adjusted. a non-closed (e.g. p) tag - // will create an additional CRLF text node, that means the text nodes are not normalized. - // in markup view it doesn't make sense to display such a node, still we have to ensure - // that there is at least one text node. - // perhaps there are other situation with not-normalized text nodes, - // with the following code each of them will be a single text node, - // if they contain more than just white space. - // for exact DOM representation it is anyway better to use the DOM tree style. - if (!one_child_text_content || !/^\s*$/.test(data[child_pointer][VALUE])) - { - one_child_text_content += "" + helpers.escapeTextHtml(data[child_pointer][VALUE]) + ""; - } - } - if (has_only_text_content) - { - class_name = " class='spotlight-node"; - if (re_formatted.test(node_name)) - { - class_name += " pre-wrap"; - if (is_script_node) - { - class_name += " non-editable"; - } - } - class_name += "'"; - tree += "
" + - "" + - "<" + node_name + attrs + ">" + - one_child_text_content + - "</" + node_name + ">" + - (is_debug && (" [" + node[ID] + "]" ) || "") + - ev_listener + "
"; - i = child_pointer - 1; - } - else - { - - tree += "
" + - (is_expandable ? - "" : '') + - "<" + node_name + attrs + ">" + - (is_debug && (" [" + node[ID] + "]" ) || "") + - ev_listener + "
"; - - closing_tags.push("" + - "</" + node_name + ">" + - "
"); - } - } - else - { - tree += "
" + - (is_expandable ? - "" : '') + - "<" + node_name + attrs + (is_expandable ? '' : '/') + ">" + - (is_debug && (" [" + node[ID] + "]" ) || "") + - ev_listener + "
"; - } - break; - } - - case PROCESSING_INSTRUCTION_NODE: - { - tree += "<?" + node[NAME] + ' ' + - formatProcessingInstructionValue(node[VALUE], force_lower_case) + "?>"; - break; - } - - case COMMENT_NODE: - { - if (show_comments) - { - if (!/^\s*$/.test(node[VALUE])) - { - tree += "" + - "<!--" + - helpers.escapeTextHtml(node[VALUE]) + - "-->"; - } - } - break; - } - - case DOCUMENT_NODE: - // Don't show this in markup view - break; - - case DOCUMENT_TYPE_NODE: - { - tree += "" + - "<!DOCTYPE " + node[NAME] + - this._get_doctype_external_identifier(node) + - ">"; - break; - } - - default: - { - if (!/^\s*$/.test(node[ VALUE ])) - { - // style and script elements are handled in - // the 'has_only_text_content' check, - // so we don't need to check here again for 'pre-wrap' content - - tree += "" + - "" + helpers.escapeTextHtml(node[VALUE]) + "" + - ""; - } - } - } - } - - while (closing_tags.length) - { - tree += closing_tags.pop(); - } - tree += ""; - return tree; - }; - - this._inspected_dom_node_tree_style = function(model, target, editable, no_contextmenu) - { - - var data = model.getData(); - var force_lower_case = model.isTextHtml() && window.settings.dom.get('force-lowercase'); - var show_comments = window.settings.dom.get('show-comments'); - var show_white_space_nodes = window.settings.dom.get('show-whitespace-nodes'); - var tree = "
"; - var i = 0, node = null, length = data.length; - var attrs = null, key = '', attr_value = ''; - var is_open = false; - var has_only_text_content = false; - var one_child_value = '' - var current_depth = 0; - var child_pointer = 0; - var child_level = 0; - var k = 0; - var children_length = 0; - var closing_tags = []; - var current_formatting = ''; - var re_formatted = /script|style/i; - var style = null; - var is_script_node = true; - var disregard_force_lower_case_depth = 0; - var depth_first_ele = model.get_depth_of_first_element(); - var show_pseudo_elements = window.settings.dom.get("show-pseudo-elements"); - var parent_ele_stack = []; - var parent_ele = null; - var is_expandable = false; - var ev_listener = ""; - - for ( ; node = data[i]; i += 1) - { - while (current_depth > node[DEPTH]) - { - current_depth--; - } - current_depth = node[DEPTH]; - children_length = node[CHILDREN_LENGTH]; - is_expandable = children_length || (show_pseudo_elements && - node[PSEUDO_ELEMENT_LIST]); - child_pointer = 0; - while ((parent_ele = parent_ele_stack.last) && - current_depth <= parent_ele[DEPTH]) - { - parent_ele_stack.pop(); - } - - if (force_lower_case && disregard_force_lower_case(node)) - { - disregard_force_lower_case_depth = node[DEPTH]; - force_lower_case = false; - } - else if (disregard_force_lower_case_depth && disregard_force_lower_case_depth == node[DEPTH]) - { - disregard_force_lower_case_depth = 0; - force_lower_case = model.isTextHtml() && window.settings.dom.get('force-lowercase'); - } - - ev_listener = node[EVENT_LISTENER_LIST] && node[EVENT_LISTENER_LIST].length - ? EV_LISTENER_MARKUP - : ""; - - switch (node[TYPE]) - { - case PSEUDO_NODE: - { - if (show_pseudo_elements) - { - tree += "
" + - "" + - "::" + node[NAME] + - "" + - "
"; - } - break; - } - case ELEMENT_NODE: - { - var node_name = (node[NAMESPACE] ? node[NAMESPACE] + ':' : '') + node[NAME]; - node_name = helpers.escapeTextHtml(node_name); - if (force_lower_case) - { - node_name = node_name.toLowerCase(); - } - var pseudo_elements = show_pseudo_elements && this._get_pseudo_elements(node); - is_script_node = node[NAME].toLowerCase() == 'script'; - attrs = ''; - for (k = 0; attr = node[ATTRS][k]; k++) - { - attr_value = helpers.escapeAttributeHtml(attr[ATTR_VALUE]); - attrs += " " + - (attr[ATTR_PREFIX] ? attr[ATTR_PREFIX] + ':' : '') + - /* regarding escaping "<". it happens that there are very starnge keys in broken html. - perhaps we will have to extend the escaping to other data tokens as well */ - (force_lower_case ? attr[ATTR_KEY].toLowerCase() : attr[ATTR_KEY] ).replace(/=\"" + - attr_value + - "\""; - } - - child_pointer = i + 1; - - is_open = (data[child_pointer] && (node[DEPTH] < data[child_pointer][DEPTH])); - if (is_open) - { - has_only_text_content = !node.hasOwnProperty(PSEUDO_ELEMENT_LIST); - one_child_value = ''; - child_level = data[child_pointer][DEPTH]; - for ( ; data[child_pointer] && data[child_pointer][DEPTH] == child_level; child_pointer += 1) - { - one_child_value += data[child_pointer][VALUE]; - if (data[child_pointer][TYPE] != TEXT_NODE) - { - has_only_text_content = false; - one_child_value = ''; - break; - } - } - - tree += "
" + - (is_expandable ? - "" : '') + - "" + node_name + attrs + "" + - ev_listener + "
"; - } - else - { - tree += "
" + - (is_expandable ? - "" : '') + - "" + node_name + attrs + "" + - ev_listener + "
"; - } - parent_ele_stack.push(node); - break; - } - - case COMMENT_NODE: - { - if (show_comments) - { - tree += "" + - "#comment" + - helpers.escapeTextHtml(node[VALUE]) + "
"; - } - break; - } - - case DOCUMENT_NODE: - { - tree += "" + - "#document" + - ev_listener + "
"; - break; - } - - case DOCUMENT_TYPE_NODE: - { - tree += "" + - "" + node[NAME] + " " + - this._get_doctype_external_identifier(node) + - ""; - break; - } - - default: - { - current_formatting = ""; - parent_ele = parent_ele_stack.last; - if (re_formatted.test(parent_ele)) - { - current_formatting = parent_ele[NAME].toLowerCase() == 'script' - ? " class='pre-wrap non-editable' " - : " class='pre-wrap' "; - } - if (!(show_white_space_nodes) && (node[TYPE] == TEXT_NODE)) - { - if (!/^\s*$/.test(node[VALUE])) - { - tree += "" + - (node[NAME] ? node[NAME] : this._node_name_map[node[TYPE]]) + - "" + - helpers.escapeTextHtml(node[VALUE]) + "" + - ""; - } - } - else - { - var only_whitespace = /^\s*$/.test(node[VALUE]); - tree += "" + - (node[NAME] ? node[NAME] : this._node_name_map[node[TYPE]]) + - "" + - (only_whitespace ? helpers.escape_whitespace(node[VALUE]) - : helpers.escapeTextHtml(node[VALUE])) + - "" + - ""; - } - } - } - } - tree += ""; - return tree; - } - - this.inspected_dom_node = function(model, target, editable, no_contextmenu) - { - return (window.settings.dom.get('dom-tree-style') ? - this._inspected_dom_node_tree_style(model, target, editable, no_contextmenu) : - this._inspected_dom_node_markup_style(model, target, editable, no_contextmenu)); - } - - this._margin_style = function(node, start_depth) - { - const INDENT_AMOUNT = 16; - return " style='margin-left:" + - INDENT_AMOUNT * (node[DEPTH] - (start_depth || 0)) + - "px;' "; - }; - - this._offsets = function(value, index) - { - if (!this._OFFSETS) - this._OFFSETS = cls.ElementLayout.OFFSETS - return (Boolean(index) ? - ['tr', - ['th', this._OFFSETS[index]], - ['td', - value, - "class", "number" - ], - "data-spec", "dom#" + this._OFFSETS[index] - ] : []); - } - - this.offset_values = function(offsets_values) - { - var model = window.dominspections.active, ret = []; - if (model) - { - if (model.breadcrumbhead && !model.has_node(model.breadcrumbhead)) - { - model.breadcrumbhead = null; - model.breadcrumb_offsets = null; - } - var target_is_head = !model.breadcrumbhead || - model.breadcrumbhead == model.target; - if (target_is_head) - { - model.breadcrumb_offsets = window.helpers.copy_object(offsets_values[0]); - } - ret = - [ - ['h2', ui_strings.M_VIEW_SUB_LABEL_PARENT_OFFSETS], - ['parent-node-chain', - target_is_head ? - this.breadcrumb(model, model.target, offsets_values[0], null, true) : - this.breadcrumb(model, model.breadcrumbhead, - model.breadcrumb_offsets, model.target, true), - 'onmouseover', helpers.breadcrumbSpotlight, - 'onmouseout', helpers.breadcrumbClearSpotlight, - 'class', 'mono' - ], - ['h2', ui_strings.M_VIEW_SUB_LABEL_OFFSET_VALUES], - ['table', - offsets_values.map(this._offsets), - "class", "offsets" - ] - ]; - } - return ret; - } - - this.disabled_view = function() - { - return ( - ["div", - ["p", window.app.profiles[window.app.profiles.PROFILER].is_enabled ? - ui_strings.S_INFO_PROFILER_MODE : - ui_strings.S_INFO_HTTP_PROFILER_MODE], - ["p", - ["span", ui_strings.S_LABEL_ENABLE_DEFAULT_FEATURES, - "class", "container-button ui-button", - "handler", "enable-ecmascript-debugger", - "unselectable", "on", - "tabindex", "1"]], - "class", "info-box"]); - }; - -}).apply(window.templates || (window.templates = {})); +(function() +{ + const ID = 0; + const TYPE = 1; + const NAME = 2; + const DEPTH = 3; + const NAMESPACE = 4; + const VALUE = 7; + const ATTRS = 5; + const ATTR_PREFIX = 0; + const ATTR_KEY = 1; + const ATTR_VALUE = 2; + const CHILDREN_LENGTH = 6; + const MATCH_REASON = cls.EcmascriptDebugger["6.0"].InspectableDOMNode.MATCH_REASON; + const INDENT = " "; + const LINEBREAK = '\n'; + const SEARCH_PARENT = 2; + + const ELEMENT_NODE = Node.ELEMENT_NODE; + const TEXT_NODE = Node.TEXT_NODE; + const CDATA_SECTION_NODE = Node.CDATA_SECTION_NODE; + const PROCESSING_INSTRUCTION_NODE = Node.PROCESSING_INSTRUCTION_NODE; + const COMMENT_NODE = Node.COMMENT_NODE; + const DOCUMENT_NODE = Node.DOCUMENT_NODE; + const DOCUMENT_TYPE_NODE = Node.DOCUMENT_TYPE_NODE; + const PSEUDO_NODE = cls.EcmascriptDebugger["6.0"].InspectableDOMNode.PSEUDO_NODE; + + const PSEUDO_ELEMENT_LIST = 14; + const PSEUDO_ELEMENT_TYPE = 0; + const PSEUDO_ELEMENT_CONTENT = 1; + + const PSEUDO_ELEMENT_BEFORE = 1; + const PSEUDO_ELEMENT_AFTER = 2; + const PSEUDO_ELEMENT_FIRST_LETTER = 3; + const PSEUDO_ELEMENT_FIRST_LINE = 4; + const EVENT_LISTENER_LIST = 15; + + var EV_LISTENER_MARKUP = "" + + this._pseudo_element_map = {}; + this._pseudo_element_map[PSEUDO_ELEMENT_BEFORE] = "before"; + this._pseudo_element_map[PSEUDO_ELEMENT_AFTER] = "after"; + this._pseudo_element_map[PSEUDO_ELEMENT_FIRST_LETTER] = "first-letter"; + this._pseudo_element_map[PSEUDO_ELEMENT_FIRST_LINE] = "first-line"; + + this._node_name_map = {}; + this._node_name_map[TEXT_NODE] = "#text "; + this._node_name_map[CDATA_SECTION_NODE] = "#cdata-section"; + + var disregard_force_lower_case_whitelist = + cls.EcmascriptDebugger["6.0"].DOMData.DISREGARD_FORCE_LOWER_CASE_WHITELIST; + + var disregard_force_lower_case = function(node) + { + return disregard_force_lower_case_whitelist + .indexOf(node[NAME].toLowerCase()) != -1; + }; + + /** + * Generates the part of the document type declaration after the document + * element type name. + */ + this._get_doctype_external_identifier = function(node) + { + const PUBLIC_ID = 8 + const SYSTEM_ID = 9; + + // Missing public IDs and system IDs are returned as empty strings, + // so it's impossible to distinguish them from empty ones. In reality + // this should happen very seldom, so it's not really a problem. + var public_id = node[PUBLIC_ID]; + var system_id = node[SYSTEM_ID]; + return (public_id + ? " PUBLIC \"" + public_id + "\"" + : "") + + (!public_id && system_id + ? " SYSTEM" + : "") + + (system_id + ? " \"" + system_id + "\"" + : ""); + }; + + this._get_pseudo_elements = function(element) + { + var is_tree_mode = window.settings.dom.get("dom-tree-style"); + var pseudo_element_list = element[PSEUDO_ELEMENT_LIST]; + var pseudo_elements = {}; + + if (pseudo_element_list) + { + pseudo_element_list.forEach(function(pseudo_element) { + var type = this._pseudo_element_map[pseudo_element[PSEUDO_ELEMENT_TYPE]]; + pseudo_elements[pseudo_element[PSEUDO_ELEMENT_TYPE]] = + "
" + + "" + + (is_tree_mode ? "::" + type : "<::" + type + "/>") + + "" + + "
"; + }, this); + } + + return pseudo_elements; + }; + + var formatProcessingInstructionValue = function(str, force_lower_case) + { + var r_attrs = str.split(' '), r_attr = '', i=0, attrs = '', attr = null; + + for ( ; i < r_attrs.length; i++) + { + if (r_attr = r_attrs[i]) + { + attr = r_attr.split('='); + attrs += " " + + (force_lower_case ? attr[0].toLowerCase() : attr[0]) + + "=" + + attr[1] + + ""; + } + } + return attrs; + }; + + var safe_escape_attr_key = function(attr, force_lower_case) + { + return ( + ((attr[ATTR_PREFIX] ? attr[ATTR_PREFIX] + ':' : '') + + /* regarding escaping "<". + it happens that there are very starnge keys in broken html. + perhaps we will have to extend the escaping to other data + tokens as well */ + (force_lower_case ? attr[ATTR_KEY].toLowerCase() : attr[ATTR_KEY])) + .replace(/=\"" + attr_value + "\""; + } + else + { + attrs += " " + safe_escape_attr_key(attr) + "=\"" + attr_value + "\""; + } + } + return attrs; + }; + + this._dom_attrs_search = function(node, force_lower_case) + { + for (var i = 0, attr, attr_value, attrs = ''; attr = node[ATTRS][i]; i++) + { + attr_value = helpers.escapeAttributeHtml(attr[ATTR_VALUE]); + attrs += " " + + "" + safe_escape_attr_key(attr) + "" + + "=\"" + + "" + attr_value + "" + + "\""; + } + return attrs; + }; + + this.dom_search = function(model) + { + var data = model.getData(); + var is_tree_style = window.settings.dom.get('dom-tree-style'); + var tree = ""; + var length = data.length; + var attrs = null; + var force_lower_case = model.isTextHtml() && + window.settings.dom.get('force-lowercase'); + var show_comments = window.settings.dom.get('show-comments'); + var node_name = ''; + var disregard_force_lower_case_depth = 0; + var open_tag = is_tree_style ? "" : "<"; + var close_tag = is_tree_style ? "" : ">"; + var ev_listener = ""; + + for (var i = 0, node; node = data[i]; i++) + { + if (node[MATCH_REASON] == SEARCH_PARENT) + { + continue; + } + node_name = (node[NAMESPACE] ? node[NAMESPACE] + ':': '') + node[NAME]; + node_name = helpers.escapeTextHtml(node_name); + if (force_lower_case && disregard_force_lower_case(node)) + { + disregard_force_lower_case_depth = node[DEPTH]; + force_lower_case = false; + } + else if (disregard_force_lower_case_depth && + disregard_force_lower_case_depth == node[DEPTH]) + { + disregard_force_lower_case_depth = 0; + force_lower_case = model.isTextHtml() && + window.settings.dom.get('force-lowercase'); + } + if (force_lower_case) + { + node_name = node_name.toLowerCase(); + } + ev_listener = node[EVENT_LISTENER_LIST] && node[EVENT_LISTENER_LIST].length + ? EV_LISTENER_MARKUP + : ""; + switch (node[TYPE]) + { + case PSEUDO_NODE: + { + break; + } + case ELEMENT_NODE: + { + attrs = this._dom_attrs_search(node, force_lower_case); + tree += ""; + break; + } + case PROCESSING_INSTRUCTION_NODE: + { + // TODO + tree += + ""; + break; + } + case COMMENT_NODE: + { + if (show_comments && !/^\s*$/.test(node[VALUE])) + { + tree += + ""; + } + break; + } + case DOCUMENT_NODE: + { + if (ev_listener) + { + tree += ""; + } + break; + } + case DOCUMENT_TYPE_NODE: + { + // TODO + // currently we don't earch in doctype nodes on the host side + tree += + ""; + break; + } + default: + { + if (!/^\s*$/.test(node[VALUE])) + { + tree += + ""; + } + } + } + } + tree += ""; + return tree; + }; + + this._inspected_dom_node_markup_style= function(model, target, editable, no_contextmenu) + { + var data = model.getData(); + var tree = "
"; + var i = 0; + var node = null; + var length = data.length; + var attrs = null, attr = null, k = 0, key = '', attr_value = ''; + var is_open = false; + var has_only_text_content = false; + var one_child_text_content = ''; + var current_depth = 0; + var child_pointer = 0; + var child_level = 0; + var children_length = 0; + var closing_tags = []; + var force_lower_case = model.isTextHtml() && window.settings.dom.get('force-lowercase'); + var show_comments = window.settings.dom.get('show-comments'); + var class_name = ''; + var re_formatted = /script|style|#comment/i; + var style = null; + var is_script_node = true; + var is_debug = ini.debug; + var disregard_force_lower_case_depth = 0; + var depth_first_ele = model.get_depth_of_first_element(); + var show_pseudo_elements = window.settings.dom.get("show-pseudo-elements"); + var is_expandable = false; + + for ( ; node = data[i]; i += 1) + { + while (current_depth > node[DEPTH]) + { + tree += closing_tags.pop(); + current_depth--; + } + current_depth = node[DEPTH]; + children_length = node[CHILDREN_LENGTH]; + is_expandable = children_length || (show_pseudo_elements && + node[PSEUDO_ELEMENT_LIST]); + child_pointer = 0; + + if (force_lower_case && disregard_force_lower_case(node)) + { + disregard_force_lower_case_depth = node[DEPTH]; + force_lower_case = false; + } + else if (disregard_force_lower_case_depth && + disregard_force_lower_case_depth == node[DEPTH]) + { + disregard_force_lower_case_depth = 0; + force_lower_case = model.isTextHtml() && window.settings.dom.get('force-lowercase'); + } + + switch (node[TYPE]) + { + case PSEUDO_NODE: + { + if (show_pseudo_elements) + { + tree += "
" + + "" + + "<::" + node[NAME] + ">" + + "" + + "
"; + } + break; + } + case ELEMENT_NODE: + { + var node_name = (node[NAMESPACE] ? node[NAMESPACE] + ':' : '') + node[NAME]; + node_name = helpers.escapeTextHtml(node_name); + var ev_listener = node[EVENT_LISTENER_LIST] && node[EVENT_LISTENER_LIST].length + ? EV_LISTENER_MARKUP + : ""; + + if (force_lower_case) + { + node_name = node_name.toLowerCase(); + } + is_script_node = node[NAME].toLowerCase() == 'script'; + attrs = ''; + for (k = 0; attr = node[ATTRS][k]; k++) + { + attr_value = helpers.escapeAttributeHtml(attr[ATTR_VALUE]); + attrs += " " + + ((attr[ATTR_PREFIX] ? attr[ATTR_PREFIX] + ':' : '') + + /* Regarding escaping "<". It happens that there are very + strange keys in broken html. Perhaps we will have to extend + the escaping to other data tokens as well */ + (force_lower_case ? attr[ATTR_KEY].toLowerCase() + : attr[ATTR_KEY])).replace(/=\"" + + attr_value + + "\""; + } + + child_pointer = i + 1; + is_open = (data[child_pointer] && (node[DEPTH] < data[child_pointer][DEPTH])); + if (is_open) + { + one_child_text_content = ''; + has_only_text_content = false; + child_level = data[child_pointer][DEPTH]; + for ( ; data[child_pointer] && data[child_pointer][DEPTH] == child_level; + child_pointer += 1) + { + has_only_text_content = true; + if (data[child_pointer][TYPE] != TEXT_NODE) + { + has_only_text_content = false; + one_child_text_content = ''; + break; + } + // perhaps this needs to be adjusted. a non-closed (e.g. p) tag + // will create an additional CRLF text node, that means the text nodes are not normalized. + // in markup view it doesn't make sense to display such a node, still we have to ensure + // that there is at least one text node. + // perhaps there are other situation with not-normalized text nodes, + // with the following code each of them will be a single text node, + // if they contain more than just white space. + // for exact DOM representation it is anyway better to use the DOM tree style. + if (!one_child_text_content || !/^\s*$/.test(data[child_pointer][VALUE])) + { + one_child_text_content += "" + helpers.escapeTextHtml(data[child_pointer][VALUE]) + ""; + } + } + if (has_only_text_content) + { + class_name = " class='spotlight-node"; + if (re_formatted.test(node_name)) + { + class_name += " pre-wrap"; + if (is_script_node) + { + class_name += " non-editable"; + } + } + class_name += "'"; + tree += "
" + + "" + + "<" + node_name + attrs + ">" + + one_child_text_content + + "</" + node_name + ">" + + (is_debug && (" [" + node[ID] + "]" ) || "") + + ev_listener + "
"; + i = child_pointer - 1; + } + else + { + + tree += "
" + + (is_expandable ? + "" : '') + + "<" + node_name + attrs + ">" + + (is_debug && (" [" + node[ID] + "]" ) || "") + + ev_listener + "
"; + + closing_tags.push("" + + "</" + node_name + ">" + + "
"); + } + } + else + { + tree += "
" + + (is_expandable ? + "" : '') + + "<" + node_name + attrs + (is_expandable ? '' : '/') + ">" + + (is_debug && (" [" + node[ID] + "]" ) || "") + + ev_listener + "
"; + } + break; + } + + case PROCESSING_INSTRUCTION_NODE: + { + tree += "<?" + node[NAME] + ' ' + + formatProcessingInstructionValue(node[VALUE], force_lower_case) + "?>"; + break; + } + + case COMMENT_NODE: + { + if (show_comments) + { + if (!/^\s*$/.test(node[VALUE])) + { + tree += "" + + "<!--" + + helpers.escapeTextHtml(node[VALUE]) + + "-->"; + } + } + break; + } + + case DOCUMENT_NODE: + // Don't show this in markup view + break; + + case DOCUMENT_TYPE_NODE: + { + tree += "" + + "<!DOCTYPE " + node[NAME] + + this._get_doctype_external_identifier(node) + + ">"; + break; + } + + default: + { + if (!/^\s*$/.test(node[ VALUE ])) + { + // style and script elements are handled in + // the 'has_only_text_content' check, + // so we don't need to check here again for 'pre-wrap' content + + tree += "" + + "" + helpers.escapeTextHtml(node[VALUE]) + "" + + ""; + } + } + } + } + + while (closing_tags.length) + { + tree += closing_tags.pop(); + } + tree += ""; + return tree; + }; + + this._inspected_dom_node_tree_style = function(model, target, editable, no_contextmenu) + { + + var data = model.getData(); + var force_lower_case = model.isTextHtml() && window.settings.dom.get('force-lowercase'); + var show_comments = window.settings.dom.get('show-comments'); + var show_white_space_nodes = window.settings.dom.get('show-whitespace-nodes'); + var tree = "
"; + var i = 0, node = null, length = data.length; + var attrs = null, key = '', attr_value = ''; + var is_open = false; + var has_only_text_content = false; + var one_child_value = '' + var current_depth = 0; + var child_pointer = 0; + var child_level = 0; + var k = 0; + var children_length = 0; + var closing_tags = []; + var current_formatting = ''; + var re_formatted = /script|style/i; + var style = null; + var is_script_node = true; + var disregard_force_lower_case_depth = 0; + var depth_first_ele = model.get_depth_of_first_element(); + var show_pseudo_elements = window.settings.dom.get("show-pseudo-elements"); + var parent_ele_stack = []; + var parent_ele = null; + var is_expandable = false; + var ev_listener = ""; + + for ( ; node = data[i]; i += 1) + { + while (current_depth > node[DEPTH]) + { + current_depth--; + } + current_depth = node[DEPTH]; + children_length = node[CHILDREN_LENGTH]; + is_expandable = children_length || (show_pseudo_elements && + node[PSEUDO_ELEMENT_LIST]); + child_pointer = 0; + while ((parent_ele = parent_ele_stack.last) && + current_depth <= parent_ele[DEPTH]) + { + parent_ele_stack.pop(); + } + + if (force_lower_case && disregard_force_lower_case(node)) + { + disregard_force_lower_case_depth = node[DEPTH]; + force_lower_case = false; + } + else if (disregard_force_lower_case_depth && disregard_force_lower_case_depth == node[DEPTH]) + { + disregard_force_lower_case_depth = 0; + force_lower_case = model.isTextHtml() && window.settings.dom.get('force-lowercase'); + } + + ev_listener = node[EVENT_LISTENER_LIST] && node[EVENT_LISTENER_LIST].length + ? EV_LISTENER_MARKUP + : ""; + + switch (node[TYPE]) + { + case PSEUDO_NODE: + { + if (show_pseudo_elements) + { + tree += "
" + + "" + + "::" + node[NAME] + + "" + + "
"; + } + break; + } + case ELEMENT_NODE: + { + var node_name = (node[NAMESPACE] ? node[NAMESPACE] + ':' : '') + node[NAME]; + node_name = helpers.escapeTextHtml(node_name); + if (force_lower_case) + { + node_name = node_name.toLowerCase(); + } + var pseudo_elements = show_pseudo_elements && this._get_pseudo_elements(node); + is_script_node = node[NAME].toLowerCase() == 'script'; + attrs = ''; + for (k = 0; attr = node[ATTRS][k]; k++) + { + attr_value = helpers.escapeAttributeHtml(attr[ATTR_VALUE]); + attrs += " " + + (attr[ATTR_PREFIX] ? attr[ATTR_PREFIX] + ':' : '') + + /* regarding escaping "<". it happens that there are very starnge keys in broken html. + perhaps we will have to extend the escaping to other data tokens as well */ + (force_lower_case ? attr[ATTR_KEY].toLowerCase() : attr[ATTR_KEY] ).replace(/=\"" + + attr_value + + "\""; + } + + child_pointer = i + 1; + + is_open = (data[child_pointer] && (node[DEPTH] < data[child_pointer][DEPTH])); + if (is_open) + { + has_only_text_content = !node.hasOwnProperty(PSEUDO_ELEMENT_LIST); + one_child_value = ''; + child_level = data[child_pointer][DEPTH]; + for ( ; data[child_pointer] && data[child_pointer][DEPTH] == child_level; child_pointer += 1) + { + one_child_value += data[child_pointer][VALUE]; + if (data[child_pointer][TYPE] != TEXT_NODE) + { + has_only_text_content = false; + one_child_value = ''; + break; + } + } + + tree += "
" + + (is_expandable ? + "" : '') + + "" + node_name + attrs + "" + + ev_listener + "
"; + } + else + { + tree += "
" + + (is_expandable ? + "" : '') + + "" + node_name + attrs + "" + + ev_listener + "
"; + } + parent_ele_stack.push(node); + break; + } + + case COMMENT_NODE: + { + if (show_comments) + { + tree += "" + + "#comment" + + helpers.escapeTextHtml(node[VALUE]) + "
"; + } + break; + } + + case DOCUMENT_NODE: + { + tree += "" + + "#document" + + ev_listener + "
"; + break; + } + + case DOCUMENT_TYPE_NODE: + { + tree += "" + + "" + node[NAME] + " " + + this._get_doctype_external_identifier(node) + + ""; + break; + } + + default: + { + current_formatting = ""; + parent_ele = parent_ele_stack.last; + if (re_formatted.test(parent_ele)) + { + current_formatting = parent_ele[NAME].toLowerCase() == 'script' + ? " class='pre-wrap non-editable' " + : " class='pre-wrap' "; + } + if (!(show_white_space_nodes) && (node[TYPE] == TEXT_NODE)) + { + if (!/^\s*$/.test(node[VALUE])) + { + tree += "" + + (node[NAME] ? node[NAME] : this._node_name_map[node[TYPE]]) + + "" + + helpers.escapeTextHtml(node[VALUE]) + "" + + ""; + } + } + else + { + var only_whitespace = /^\s*$/.test(node[VALUE]); + tree += "" + + (node[NAME] ? node[NAME] : this._node_name_map[node[TYPE]]) + + "" + + (only_whitespace ? helpers.escape_whitespace(node[VALUE]) + : helpers.escapeTextHtml(node[VALUE])) + + "" + + ""; + } + } + } + } + tree += ""; + return tree; + } + + this.inspected_dom_node = function(model, target, editable, no_contextmenu) + { + return (window.settings.dom.get('dom-tree-style') ? + this._inspected_dom_node_tree_style(model, target, editable, no_contextmenu) : + this._inspected_dom_node_markup_style(model, target, editable, no_contextmenu)); + } + + this._margin_style = function(node, start_depth) + { + const INDENT_AMOUNT = 16; + return " style='margin-left:" + + INDENT_AMOUNT * (node[DEPTH] - (start_depth || 0)) + + "px;' "; + }; + + this._offsets = function(value, index) + { + if (!this._OFFSETS) + this._OFFSETS = cls.ElementLayout.OFFSETS + return (Boolean(index) ? + ['tr', + ['th', this._OFFSETS[index]], + ['td', + value, + "class", "number" + ], + "data-spec", "dom#" + this._OFFSETS[index] + ] : []); + } + + this.offset_values = function(offsets_values) + { + var model = window.dominspections.active, ret = []; + if (model) + { + if (model.breadcrumbhead && !model.has_node(model.breadcrumbhead)) + { + model.breadcrumbhead = null; + model.breadcrumb_offsets = null; + } + var target_is_head = !model.breadcrumbhead || + model.breadcrumbhead == model.target; + if (target_is_head) + { + model.breadcrumb_offsets = window.helpers.copy_object(offsets_values[0]); + } + ret = + [ + ['h2', ui_strings.M_VIEW_SUB_LABEL_PARENT_OFFSETS], + ['parent-node-chain', + target_is_head ? + this.breadcrumb(model, model.target, offsets_values[0], null, true) : + this.breadcrumb(model, model.breadcrumbhead, + model.breadcrumb_offsets, model.target, true), + 'onmouseover', helpers.breadcrumbSpotlight, + 'onmouseout', helpers.breadcrumbClearSpotlight, + 'class', 'mono' + ], + ['h2', ui_strings.M_VIEW_SUB_LABEL_OFFSET_VALUES], + ['table', + offsets_values.map(this._offsets), + "class", "offsets" + ] + ]; + } + return ret; + } + + this.disabled_view = function() + { + return ( + ["div", + ["p", window.app.profiles[window.app.profiles.PROFILER].is_enabled ? + ui_strings.S_INFO_PROFILER_MODE : + ui_strings.S_INFO_HTTP_PROFILER_MODE], + ["p", + ["span", ui_strings.S_LABEL_ENABLE_DEFAULT_FEATURES, + "class", "container-button ui-button", + "handler", "enable-ecmascript-debugger", + "unselectable", "on", + "tabindex", "1"]], + "class", "info-box"]); + }; + +}).apply(window.templates || (window.templates = {})); diff --git a/src/ecma-debugger/jssourcetooltip.js b/src/ecma-debugger/jssourcetooltip.js index 5aa47b54d..31c0c3863 100644 --- a/src/ecma-debugger/jssourcetooltip.js +++ b/src/ecma-debugger/jssourcetooltip.js @@ -1,1102 +1,1102 @@ -"use strict"; - -window.cls || (window.cls = {}); - -cls.JSSourceTooltip = function(view) -{ - var POLL_INTERVAL = 150; - var MAX = Math.max; - var MIN = Math.min; - var POW = Math.pow; - var MIN_RADIUS = 2; - var WHITESPACE = cls.SimpleJSParser.WHITESPACE; - var LINETERMINATOR = cls.SimpleJSParser.LINETERMINATOR; - var IDENTIFIER = cls.SimpleJSParser.IDENTIFIER; - var NUMBER = cls.SimpleJSParser.NUMBER; - var STRING = cls.SimpleJSParser.STRING; - var PUNCTUATOR = cls.SimpleJSParser.PUNCTUATOR; - var DIV_PUNCTUATOR = cls.SimpleJSParser.DIV_PUNCTUATOR; - var REG_EXP = cls.SimpleJSParser.REG_EXP; - var COMMENT = cls.SimpleJSParser.COMMENT; - var FORWARD = 1; - var BACKWARDS = -1; - var TYPE = 0; - var VALUE = 1; - var SHIFT_KEY = 16; - var TOOLTIP_NAME = cls.JSInspectionTooltip.tooltip_name; - var MAX_MOUSE_POS_COUNT = 2; - var FILTER_HANDLER = "js-tooltip-filter"; - - var _tooltip = null; - var _view = null; - var _tokenizer = null; - var _poll_interval = 0; - var _tooltip_target_ele = null; - var _last_move_event = null; - var _is_token_selected = false; - var _mouse_positions = []; - var _container = null; - var _container_box = null; - var _char_width = 0; - var _line_height = 0; - var _tab_size = 0; - var _default_offset = 10; - var _total_x_offset = 0; - var _last_poll = {}; - var _identifier = null; - var _identifier_boxes = []; - var _identifier_out_count = 0; - var _tagman = null; - var _esde = null; - var _is_over_tooltip = false; - var _win_selection = null; - var _last_script_text = ""; - var _shift_key = false; - var _filter = null; - var _filter_input = null; - var _tooltip_container = null; - var _tooltip_model = null; - var _filter_shortcuts_cb = null; - var _filter_config = {"handler": FILTER_HANDLER, - "shortcuts": FILTER_HANDLER, - "type": "filter", - "label": ui_strings.S_INPUT_DEFAULT_TEXT_FILTER, - "focus-handler": FILTER_HANDLER, - "blur-handler": FILTER_HANDLER}; - var _is_filter_focus = false; - var _is_mouse_down = false; - - var _poll_position = function() - { - if (!_last_move_event || - _is_over_tooltip || - !_win_selection || - _is_mouse_down || - (_filter && _is_filter_focus) || - CstSelect.is_active) - return; - - if (!_win_selection.isCollapsed && !_shift_key) - { - _clear_selection(); - return; - } - - if (_identifier) - { - if (_is_over_identifier_boxes(_last_move_event)) - { - _identifier_out_count = 0; - } - else - { - if (_identifier_out_count > 1) - _clear_selection(); - else - _identifier_out_count += 1; - } - } - - while (_mouse_positions.length > MAX_MOUSE_POS_COUNT) - _mouse_positions.shift(); - - _mouse_positions.push({x: _last_move_event.clientX, - y: _last_move_event.clientY}); - var center = _get_mouse_pos_center(); - if (center && center.r <= MIN_RADIUS) - { - var script = _view.get_current_script(); - if (script) - { - var offset_y = center.y - _container_box.top; - var line_number = _view.get_line_number_with_offset(offset_y); - var line = script.get_line(line_number); - var offset_x = center.x + _container.scrollLeft - _total_x_offset; - var char_offset = _get_char_offset(line, offset_x); - if (char_offset > -1 && - !(_last_poll.script == script && - _last_poll.line_number == line_number && - _last_poll.char_offset == char_offset && - _last_poll.shift_key == _shift_key)) - { - _last_poll.script = script; - _last_poll.line_number = line_number; - _last_poll.char_offset = char_offset; - _last_poll.center = center; - _last_poll.shift_key = _shift_key; - var line_count = Math.floor(offset_y / _line_height); - var box = - { - top: _container_box.top + line_count * _line_height, - bottom: _container_box.top + (line_count + 1) * _line_height, - mouse_x: Math.floor(center.x), - mouse_y: Math.floor(center.y) - }; - _handle_poll_position(script, line_number, char_offset, - box, _shift_key); - } - } - else - { - _clear_selection(); - } - } - }; - - var _handle_poll_position = function(script, line_number, char_offset, - box, shift_key) - { - var sel = _get_identifier(script, line_number, char_offset, shift_key); - if (sel) - { - var start = script.line_arr[sel.start_line - 1] + sel.start_offset; - var end = script.line_arr[sel.end_line - 1] + sel.end_offset; - var script_text = script.script_data.slice(start, end + 1); - - if (script_text != _last_script_text) - { - var rt_id = script.runtime_id; - var thread_id = 0; - var frame_index = 0; - _last_script_text = script_text; - var ex_ctx = window.runtimes.get_execution_context(); - if (ex_ctx.rt_id == rt_id) - { - thread_id = ex_ctx.thread_id; - frame_index = ex_ctx.frame_index; - } - var args = [script, line_number, char_offset, box, sel, rt_id, script_text]; - var tag = _tagman.set_callback(null, _handle_script, args); - var msg = [rt_id, thread_id, frame_index, script_text]; - _esde.requestEval(tag, msg); - } - } - }; - - var _handle_script = function(status, - message, - script, - line_number, - char_offset, - box, - selection, - rt_id, - script_text) - { - var STATUS = 0; - var TYPE = 1; - var VALUE = 2; - var OBJECT = 3; - var OBJECT_ID = 0; - var CLASS_NAME = 4; - - if (status === 0 && message[STATUS] == "completed") - { - _identifier = selection; - _identifier_out_count = 0; - _update_identifier_boxes(script, _identifier); - - if (selection.start_line != selection.end_line) - { - var line_count = selection.start_line - _view.getTopLine(); - if (line_count < 0) - line_count = 0; - - box.top = _container_box.top + line_count * _line_height; - var end_line = selection.end_line; - if (end_line > _view.getBottomLine()) - end_line = _view.getBottomLine(); - - line_count = selection.end_line - _view.getTopLine() + 1; - box.bottom = _container_box.top + line_count * _line_height; - var max_right = _get_max_right(); - box.left = _total_x_offset; - box.right = _total_x_offset + max_right - _container.scrollLeft; - } - - if (message[TYPE] == "object") - { - var object = message[OBJECT]; - var model = new cls.InspectableJSObject(rt_id, - object[OBJECT_ID], - "", - object[CLASS_NAME]); - _tooltip_model = model; - model.expand(function() - { - var tmpl = ["div", - ["h2", templates.default_filter(_filter_config), - ["span", object[CLASS_NAME], - "data-tooltip", TOOLTIP_NAME], - "data-id", String(model.id), - "obj-id", String(model.object_id), - "class", "js-tooltip-title"], - ["div", [window.templates.inspected_js_object(model, false)], - "class", "js-tooltip-examine-container mono"], - "class", "js-tooltip js-tooltip-examine"]; - var ele = _tooltip.show(tmpl, box); - if (ele) - { - _filter_input = ele.querySelector("input"); - _tooltip_container = ele.querySelector(".js-tooltip-examine-container"); - _filter.set_form_input(_filter_input); - _filter.set_container(_tooltip_container); - } - }); - } - else - { - var value = ""; - if (message[TYPE] == "null" || message[TYPE] == "undefined") - value = message[TYPE] - else if (message[TYPE] == "string") - value = "\"" + message[VALUE] + "\""; - else - value = message[VALUE]; - - var tmpl = ["div", - ["value", value, "class", message[TYPE]], - "class", "js-tooltip"]; - _tooltip.show(tmpl, box); - } - - var start_line = _identifier.start_line; - var start_offset = _identifier.start_offset; - var length = script_text.length; - - if (start_line < _view.getTopLine()) - { - if (_identifier.end_line < _view.getTopLine()) - return; - - start_line = _view.getTopLine(); - start_offset = 0; - var start = script.line_arr[start_line - 1]; - var end = script.line_arr[selection.end_line - 1] + selection.end_offset; - length = end + 1 - start; - } - - if (!_win_selection.isCollapsed) - _win_selection.collapseToStart() - - _view.higlight_slice(start_line, start_offset, length); - } - }; - - var _get_tokens_of_line = function(script, line_number) - { - var tokens = []; - if (script) - { - var line = script.get_line(line_number); - var start_state = script.state_arr[line_number - 1]; - - if (line) - { - _tokenizer.tokenize(line, function(token_type, token) - { - tokens.push([token_type, token]); - }, false, start_state); - } - } - return tokens; - }; - - var _get_identifier = function(script, line_number, char_offset, shift_key) - { - if (_win_selection.isCollapsed) - { - var tokens = _get_tokens_of_line(script, line_number); - - for (var i = 0, sum = 0; i < tokens.length; i++) - { - sum += tokens[i][VALUE].length; - if (sum > char_offset) - break; - } - - if ((tokens[i][TYPE] == IDENTIFIER && - (!window.js_keywords.hasOwnProperty(tokens[i][VALUE]) || - tokens[i][VALUE] == "this")) || - (tokens[i][TYPE] == PUNCTUATOR && - ((tokens[i][VALUE] == "[" || tokens[i][VALUE] == "]") || - (shift_key && (tokens[i][VALUE] == "(" || tokens[i][VALUE] == ")"))))) - { - var start = _get_identifier_chain_start(script, line_number, tokens, i, shift_key); - var end = _get_identifier_chain_end(script, line_number, tokens, i, shift_key); - return {start_line: start.start_line, - start_offset: start.start_offset, - end_line: end.end_line, - end_offset: end.end_offset}; - } - } - else - { - var range = _win_selection.getRangeAt(0); - if (document.documentElement.contains(_last_move_event.target) && - range.intersectsNode(_last_move_event.target)) - { - var start = _get_line_and_offset(range.startContainer, range.startOffset); - var end = _get_line_and_offset(range.endContainer, range.endOffset); - if (start && end) - return {start_line: start.line_number, - start_offset: start.offset, - end_line: end.line_number, - end_offset: end.offset - 1}; - } - } - - return null; - }; - - var _get_identifier_chain_start = function(script, line_number, tokens, - match_index, shift_key) - { - var start_line = line_number; - var bracket_count = 0; - var previous_token = tokens[match_index]; - var bracket_stack = []; - var parens_stack = []; - var index = match_index - 1; - - if (previous_token[VALUE] == "]") - bracket_stack.push(previous_token[VALUE]); - - if (shift_key && previous_token[VALUE] == ")") - parens_stack.push(previous_token[VALUE]); - - while (true) - { - for (var i = match_index - 1, token = null; token = tokens[i]; i--) - { - // consume everything between parentheses if shiftKey is pressed - if (shift_key && parens_stack.length) - { - if (token[TYPE] == PUNCTUATOR) - { - if (token[VALUE] == ")") - { - parens_stack.push(token[VALUE]) - previous_token = token; - } - if (token[VALUE] == "(") - { - parens_stack.pop(); - previous_token = token; - } - } - index = i - 1; - continue; - } - - switch (previous_token[TYPE]) - { - case IDENTIFIER: - { - switch (token[TYPE]) - { - case WHITESPACE: - case LINETERMINATOR: - case COMMENT: - { - continue; - } - case PUNCTUATOR: - { - if (token[VALUE] == ".") - { - previous_token = token; - index = i - 1; - continue; - } - if (token[VALUE] == "[" && bracket_stack.length) - { - bracket_stack.pop(); - previous_token = token; - index = i - 1; - continue; - } - } - } - break; - } - case PUNCTUATOR: - { - //previous_token[VALUE] is one of '.', '[', ']', '(', ')' - if (shift_key && token[VALUE] == ")") - { - parens_stack.push(token[VALUE]); - previous_token = token; - index = i - 1; - continue; - } - - if (previous_token[VALUE] == "." || previous_token[VALUE] == "[") - { - switch (token[TYPE]) - { - case WHITESPACE: - case LINETERMINATOR: - case COMMENT: - { - continue; - } - case IDENTIFIER: - { - previous_token = token; - index = i - 1; - continue; - } - case PUNCTUATOR: - { - if (token[VALUE] == "]") - { - bracket_stack.push(token[VALUE]); - previous_token = token; - index = i - 1; - continue; - } - } - } - } - else // must be "]" - { - switch (token[TYPE]) - { - case WHITESPACE: - case LINETERMINATOR: - case COMMENT: - { - continue; - } - case STRING: - case NUMBER: - case IDENTIFIER: - { - previous_token = token; - index = i - 1; - continue; - } - case PUNCTUATOR: - { - if (token[VALUE] == "]") - { - bracket_stack.push(token[VALUE]); - previous_token = token; - index = i - 1; - continue; - } - } - } - } - break; - } - case STRING: - case NUMBER: - { - switch (token[TYPE]) - { - case WHITESPACE: - case LINETERMINATOR: - case COMMENT: - { - continue; - } - case PUNCTUATOR: - { - if (token[VALUE] == "[") - { - bracket_stack.pop(); - previous_token = token; - index = i - 1; - continue; - } - } - } - break; - } - } - break; - } - - if (i == -1) - { - var new_tokens = _get_tokens_of_line(script, start_line - 1); - - if (new_tokens.length) - { - start_line--; - match_index = new_tokens.length; - index += match_index; - tokens = new_tokens.extend(tokens); - } - else - break; - } - else - break; - } - - if (tokens[index + 1][TYPE] == PUNCTUATOR && tokens[index + 1][VALUE] == ".") - index++; - - while (true) - { - var nl_index = _get_index_of_newline(tokens); - if (nl_index > -1 && nl_index <= index) - { - index -= tokens.splice(0, nl_index + 1).length; - start_line++; - } - else - break - } - - return {start_line: start_line, start_offset: _get_sum(tokens, index)}; - }; - - var _get_identifier_chain_end = function(script, line_number, tokens, - match_index, shift_key) - { - var start_line = line_number; - var bracket_count = 0; - var previous_token = tokens[match_index]; - var bracket_stack = []; - var parens_stack = []; - var index = match_index; - - if (previous_token[VALUE] == "[") - bracket_stack.push(previous_token[VALUE]); - - if (shift_key && previous_token[VALUE] == "(") - parens_stack.push(previous_token[VALUE]); - - while (bracket_stack.length || (shift_key && parens_stack.length)) - { - for (var i = match_index + 1, token = null; token = tokens[i]; i++) - { - // consume everything between parentheses if shiftKey is pressed - if (shift_key && parens_stack.length) - { - if (token[TYPE] == PUNCTUATOR) - { - if (token[VALUE] == "(") - { - parens_stack.push(token[VALUE]) - previous_token = token; - } - if (token[VALUE] == ")") - { - parens_stack.pop(); - previous_token = token; - } - } - index = i; - continue; - } - - if (!bracket_stack.length) - break; - - switch (previous_token[TYPE]) - { - case IDENTIFIER: - { - switch (token[TYPE]) - { - case WHITESPACE: - case LINETERMINATOR: - case COMMENT: - { - continue; - } - case PUNCTUATOR: - { - if (token[VALUE] == ".") - { - previous_token = token; - index = i; - continue; - } - if (token[VALUE] == "]") - { - bracket_stack.pop(); - previous_token = token; - index = i; - continue; - } - if (token[VALUE] == "[") - { - bracket_stack.push(token[VALUE]); - previous_token = token; - index = i; - continue; - } - } - } - break; - } - case PUNCTUATOR: - { - if (previous_token[VALUE] == "]") - { - switch (token[TYPE]) - { - case WHITESPACE: - case LINETERMINATOR: - case COMMENT: - { - continue; - } - case PUNCTUATOR: - { - if (token[VALUE] == ".") - { - previous_token = token; - index = i - 1; - continue; - } - if (token[VALUE] == "]" && bracket_stack.length) - { - bracket_stack.pop(); - previous_token = token; - index = i; - continue; - } - } - } - } - else if (previous_token[VALUE] == "[") - { - switch (token[TYPE]) - { - case WHITESPACE: - case LINETERMINATOR: - case COMMENT: - { - continue; - } - case STRING: - case NUMBER: - case IDENTIFIER: - { - previous_token = token; - index = i; - continue; - } - } - } - else // must be "." - { - switch (token[TYPE]) - { - case WHITESPACE: - case LINETERMINATOR: - case COMMENT: - { - continue; - } - case IDENTIFIER: - { - previous_token = token; - index = i; - continue; - } - } - } - break; - } - case STRING: - case NUMBER: - { - switch (token[TYPE]) - { - case WHITESPACE: - case LINETERMINATOR: - case COMMENT: - { - continue; - } - case PUNCTUATOR: - { - if (token[VALUE] == "]") - { - bracket_stack.pop(); - previous_token = token; - index = i; - continue; - } - } - } - break; - } - } - } - - if (i == tokens.length && bracket_stack.length) - { - start_line++; - var new_tokens = _get_tokens_of_line(script, start_line); - - if (new_tokens.length) - { - match_index = i; - tokens.extend(new_tokens); - } - else - break; - } - else - break; - } - - while (true) - { - var nl_index = _get_index_of_newline(tokens); - if (nl_index > -1 && nl_index <= index) - index -= tokens.splice(0, nl_index + 1).length; - else - break - } - - return {end_line: start_line, end_offset: _get_sum(tokens, index) - 1}; - }; - - var _get_line_and_offset = function(node, offset) - { - var line_ele = node.parentNode.has_attr("parent-node-chain", "data-line-number"); - if (line_ele) - { - var ctx = {target_node: node, sum: offset, is_found: false}; - return {line_number: parseInt(line_ele.getAttribute("data-line-number")), - offset: _walk_dom(ctx, line_ele).sum}; - } - return null; - }; - - var _walk_dom = function(ctx, node) - { - // ctx.target_node, ctx.sum, ctx.is_found - while (!ctx.is_found && node) - { - if (node.nodeType == Node.ELEMENT_NODE) - _walk_dom(ctx, node.firstChild); - - if (node.nodeType == Node.TEXT_NODE) - { - if (node == ctx.target_node) - ctx.is_found = true; - else - ctx.sum += node.nodeValue.length; - } - node = node.nextSibling; - } - return ctx; - }; - - var _get_max_right = function() - { - return Math.max.apply(null, _identifier_boxes.map(function(box) - { - return box.right; - })); - }; - - var _get_index_of_newline = function(tokens) - { - for (var i = 0, token; token = tokens[i]; i++) - { - if (token[TYPE] == LINETERMINATOR) - return i; - } - return -1; - }; - - var _get_sum = function(tokens, index) - { - for (var i = 0, sum = 0; i <= index; i++) - sum += tokens[i][VALUE].length; - - return sum; - }; - - var _get_mouse_pos_center = function() - { - var center = null; - if (_mouse_positions.length > 2) - { - var min_x = MIN(_mouse_positions[0].x, - _mouse_positions[1].x, - _mouse_positions[2].x); - var max_x = MAX(_mouse_positions[0].x, - _mouse_positions[1].x, - _mouse_positions[2].x); - var min_y = MIN(_mouse_positions[0].y, - _mouse_positions[1].y, - _mouse_positions[2].y); - var max_y = MAX(_mouse_positions[0].y, - _mouse_positions[1].y, - _mouse_positions[2].y); - var dx = max_x - min_x; - var dy = max_y - min_y; - - center = {x: min_x + dx / 2, - y: min_y + dy / 2, - r: POW(POW(dx / 2, 2) + POW(dy / 2, 2), 0.5)}; - } - return center; - }; - - var _update_identifier_boxes = function(script, identifier) - { - // translates the current selected identifier to dimension boxes - // position and dimensions are absolute to the source text - var line_number = _identifier.start_line; - - var start_offset = _identifier.start_offset; - var end_offset = 0; - _identifier_boxes = []; - while (true) - { - var box = {}; - var line = script.get_line(line_number); - box.left = _get_pixel_offset(line, start_offset); - if (line_number < _identifier.end_line) - box.right = _get_pixel_offset(line, line.length + 1); - else - box.right = _get_pixel_offset(line, _identifier.end_offset + 1); - box.top = (line_number - 1) * _line_height; - box.bottom = line_number * _line_height; - _identifier_boxes.push(box); - if (line_number == _identifier.end_line || - line_number >= script.line_arr.length) - break; - else - line_number += 1; - start_offset = 0; - } - }; - - var _is_over_identifier_boxes = function(event) - { - var off_x = _total_x_offset - _container.scrollLeft; - var off_y = _container_box.top - (_view.getTopLine() - 1) * _line_height; - var e_x = event.clientX - off_x; - var e_y = event.clientY - off_y; - - for (var i = 0, box; box = _identifier_boxes[i]; i++) - { - if (e_x >= box.left && e_x <= box.right && - e_y >= box.top && e_y <= box.bottom) - return true; - } - return false; - }; - - var _clear_selection = function() - { - _identifier = null; - _last_script_text = ""; - _last_poll = {}; - _view.higlight_slice(); - _tooltip.hide(); - _filter.set_search_term(""); - _filter.cleanup(); - _is_filter_focus = false; - _tooltip_model = null; - _tooltip_container = null; - - }; - - var _get_char_offset = function(line, offset) - { - offset /= _char_width; - for (var i = 0, l = line.length, offset_count = 0; i < l; i++) - { - offset_count += line[i] == "\t" - ? _tab_size - (offset_count % _tab_size) - : 1; - if (offset_count > offset) - return i; - } - return -1; - }; - - var _get_pixel_offset = function(line, char_offset) - { - for (var i = 0, offset_count = 0, char = ""; i < char_offset; i++) - { - char = line[i]; - if (char == "\n" || char == "\r") - continue; - - offset_count += char == "\t" - ? _tab_size - offset_count % _tab_size - : 1; - } - return offset_count * _char_width; - }; - - var _get_tab_size = function() - { - var style_dec = document.styleSheets.getDeclaration(".js-source-content div"); - return style_dec ? parseInt(style_dec.getPropertyValue("-o-tab-size")) : 0; - }; - - var _get_container_box = function() - { - if (_container) - _container_box = _container.getBoundingClientRect(); - }; - - /* event handlers */ - - var _onmousemove = function(event) - { - _last_move_event = event; - }; - - var _ontooltip = function(event, target) - { - if (!_poll_interval) - { - if (!_char_width) - _onmonospacefontchange(); - - var container = _view.get_scroll_container(); - if (container && target.parentNode) - { - _container = container; - _container_box = container.getBoundingClientRect(); - _tooltip_target_ele = target.parentNode; - _tooltip_target_ele.addEventListener("mousemove", _onmousemove, false); - while (_mouse_positions.length) - _mouse_positions.pop(); - - _total_x_offset = _container_box.left + _default_offset; - _win_selection = window.getSelection(); - _poll_interval = setInterval(_poll_position, POLL_INTERVAL); - } - } - }; - - var _onhide = function() - { - if (_poll_interval) - { - clearInterval(_poll_interval); - _clear_selection(); - _tooltip_target_ele.removeEventListener('mousemove', _onmousemove, false); - _poll_interval = 0; - _tooltip_target_ele = null; - _container_box = null; - _container = null; - _win_selection = null; - } - }; - - var _ontooltipenter = function(event) - { - _is_over_tooltip = true; - }; - - var _ontooltipleave = function(event) - { - _is_over_tooltip = false; - }; - - var _onmonospacefontchange = function(msg) - { - _char_width = defaults["js-source-char-width"]; - _line_height = defaults["js-source-line-height"]; - _tab_size = _get_tab_size(); - _default_offset = defaults["js-default-text-offset"]; - }; - - var _onkeydown = function(event) - { - if (event.keyCode == SHIFT_KEY) - _shift_key = true; - }; - - var _onkeyup = function(event) - { - if (event.keyCode == SHIFT_KEY) - _shift_key = false; - }; - - var _onbeforefilter = function(msg) - { - if (_tooltip_model && _tooltip_container) - { - var tmpl = window.templates.inspected_js_object(_tooltip_model, false, - null, msg.search_term); - _tooltip_container.clearAndRender(tmpl); - } - }; - - var _onmousedown = function(event, target) - { - _is_mouse_down = true; - _clear_selection(); - }; - - var _onmouseup = function(event) - { - _is_mouse_down = false; - }; - - var _onfocus = function(event, target) - { - _is_filter_focus = true; - }; - - var _onblur = function(event, target) - { - _is_filter_focus = false - }; - - var _oninput = function(event, target) - { - _filter.search_delayed(target.value); - }; - - var _init = function(view) - { - _view = view; - _tokenizer = new cls.SimpleJSParser(); - _tooltip = Tooltips.register(cls.JSSourceTooltip.tooltip_name, true, false, - ".js-tooltip-examine-container"); - _tooltip.ontooltip = _ontooltip; - _tooltip.onhide = _onhide; - _tooltip.ontooltipenter = _ontooltipenter; - _tooltip.ontooltipleave = _ontooltipleave; - _tagman = window.tagManager; - _esde = window.services["ecmascript-debugger"]; - _filter = new TextSearch(); - _filter_shortcuts_cb = cls.Helpers.shortcut_search_cb.bind(_filter); - window.event_handlers.input[FILTER_HANDLER] = _oninput; - window.event_handlers.focus[FILTER_HANDLER] = _onfocus; - window.event_handlers.blur[FILTER_HANDLER] = _onblur; - window.event_handlers.mousedown["scroll-js-source-view"] = _onmousedown; - _filter.add_listener("onbeforesearch", _onbeforefilter); - ActionBroker.get_instance().get_global_handler(). - register_shortcut_listener(FILTER_HANDLER, _filter_shortcuts_cb); - window.messages.addListener("monospace-font-changed", _onmonospacefontchange); - window.addEventListener("resize", _get_container_box, false); - document.addEventListener("keydown", _onkeydown, false); - document.addEventListener("keyup", _onkeyup, false); - document.addEventListener("mouseup", _onmouseup, false); - }; - - this.unregister = function() - { - Tooltips.unregister(cls.JSSourceTooltip.tooltip_name, _tooltip); - window.messages.removeListener("monospace-font-changed", _onmonospacefontchange); - window.removeEventListener('resize', _get_container_box, false); - }; - - _init(view); -}; - -cls.JSSourceTooltip.tooltip_name = "js-source"; +"use strict"; + +window.cls || (window.cls = {}); + +cls.JSSourceTooltip = function(view) +{ + var POLL_INTERVAL = 150; + var MAX = Math.max; + var MIN = Math.min; + var POW = Math.pow; + var MIN_RADIUS = 2; + var WHITESPACE = cls.SimpleJSParser.WHITESPACE; + var LINETERMINATOR = cls.SimpleJSParser.LINETERMINATOR; + var IDENTIFIER = cls.SimpleJSParser.IDENTIFIER; + var NUMBER = cls.SimpleJSParser.NUMBER; + var STRING = cls.SimpleJSParser.STRING; + var PUNCTUATOR = cls.SimpleJSParser.PUNCTUATOR; + var DIV_PUNCTUATOR = cls.SimpleJSParser.DIV_PUNCTUATOR; + var REG_EXP = cls.SimpleJSParser.REG_EXP; + var COMMENT = cls.SimpleJSParser.COMMENT; + var FORWARD = 1; + var BACKWARDS = -1; + var TYPE = 0; + var VALUE = 1; + var SHIFT_KEY = 16; + var TOOLTIP_NAME = cls.JSInspectionTooltip.tooltip_name; + var MAX_MOUSE_POS_COUNT = 2; + var FILTER_HANDLER = "js-tooltip-filter"; + + var _tooltip = null; + var _view = null; + var _tokenizer = null; + var _poll_interval = 0; + var _tooltip_target_ele = null; + var _last_move_event = null; + var _is_token_selected = false; + var _mouse_positions = []; + var _container = null; + var _container_box = null; + var _char_width = 0; + var _line_height = 0; + var _tab_size = 0; + var _default_offset = 10; + var _total_x_offset = 0; + var _last_poll = {}; + var _identifier = null; + var _identifier_boxes = []; + var _identifier_out_count = 0; + var _tagman = null; + var _esde = null; + var _is_over_tooltip = false; + var _win_selection = null; + var _last_script_text = ""; + var _shift_key = false; + var _filter = null; + var _filter_input = null; + var _tooltip_container = null; + var _tooltip_model = null; + var _filter_shortcuts_cb = null; + var _filter_config = {"handler": FILTER_HANDLER, + "shortcuts": FILTER_HANDLER, + "type": "filter", + "label": ui_strings.S_INPUT_DEFAULT_TEXT_FILTER, + "focus-handler": FILTER_HANDLER, + "blur-handler": FILTER_HANDLER}; + var _is_filter_focus = false; + var _is_mouse_down = false; + + var _poll_position = function() + { + if (!_last_move_event || + _is_over_tooltip || + !_win_selection || + _is_mouse_down || + (_filter && _is_filter_focus) || + CstSelect.is_active) + return; + + if (!_win_selection.isCollapsed && !_shift_key) + { + _clear_selection(); + return; + } + + if (_identifier) + { + if (_is_over_identifier_boxes(_last_move_event)) + { + _identifier_out_count = 0; + } + else + { + if (_identifier_out_count > 1) + _clear_selection(); + else + _identifier_out_count += 1; + } + } + + while (_mouse_positions.length > MAX_MOUSE_POS_COUNT) + _mouse_positions.shift(); + + _mouse_positions.push({x: _last_move_event.clientX, + y: _last_move_event.clientY}); + var center = _get_mouse_pos_center(); + if (center && center.r <= MIN_RADIUS) + { + var script = _view.get_current_script(); + if (script) + { + var offset_y = center.y - _container_box.top; + var line_number = _view.get_line_number_with_offset(offset_y); + var line = script.get_line(line_number); + var offset_x = center.x + _container.scrollLeft - _total_x_offset; + var char_offset = _get_char_offset(line, offset_x); + if (char_offset > -1 && + !(_last_poll.script == script && + _last_poll.line_number == line_number && + _last_poll.char_offset == char_offset && + _last_poll.shift_key == _shift_key)) + { + _last_poll.script = script; + _last_poll.line_number = line_number; + _last_poll.char_offset = char_offset; + _last_poll.center = center; + _last_poll.shift_key = _shift_key; + var line_count = Math.floor(offset_y / _line_height); + var box = + { + top: _container_box.top + line_count * _line_height, + bottom: _container_box.top + (line_count + 1) * _line_height, + mouse_x: Math.floor(center.x), + mouse_y: Math.floor(center.y) + }; + _handle_poll_position(script, line_number, char_offset, + box, _shift_key); + } + } + else + { + _clear_selection(); + } + } + }; + + var _handle_poll_position = function(script, line_number, char_offset, + box, shift_key) + { + var sel = _get_identifier(script, line_number, char_offset, shift_key); + if (sel) + { + var start = script.line_arr[sel.start_line - 1] + sel.start_offset; + var end = script.line_arr[sel.end_line - 1] + sel.end_offset; + var script_text = script.script_data.slice(start, end + 1); + + if (script_text != _last_script_text) + { + var rt_id = script.runtime_id; + var thread_id = 0; + var frame_index = 0; + _last_script_text = script_text; + var ex_ctx = window.runtimes.get_execution_context(); + if (ex_ctx.rt_id == rt_id) + { + thread_id = ex_ctx.thread_id; + frame_index = ex_ctx.frame_index; + } + var args = [script, line_number, char_offset, box, sel, rt_id, script_text]; + var tag = _tagman.set_callback(null, _handle_script, args); + var msg = [rt_id, thread_id, frame_index, script_text]; + _esde.requestEval(tag, msg); + } + } + }; + + var _handle_script = function(status, + message, + script, + line_number, + char_offset, + box, + selection, + rt_id, + script_text) + { + var STATUS = 0; + var TYPE = 1; + var VALUE = 2; + var OBJECT = 3; + var OBJECT_ID = 0; + var CLASS_NAME = 4; + + if (status === 0 && message[STATUS] == "completed") + { + _identifier = selection; + _identifier_out_count = 0; + _update_identifier_boxes(script, _identifier); + + if (selection.start_line != selection.end_line) + { + var line_count = selection.start_line - _view.getTopLine(); + if (line_count < 0) + line_count = 0; + + box.top = _container_box.top + line_count * _line_height; + var end_line = selection.end_line; + if (end_line > _view.getBottomLine()) + end_line = _view.getBottomLine(); + + line_count = selection.end_line - _view.getTopLine() + 1; + box.bottom = _container_box.top + line_count * _line_height; + var max_right = _get_max_right(); + box.left = _total_x_offset; + box.right = _total_x_offset + max_right - _container.scrollLeft; + } + + if (message[TYPE] == "object") + { + var object = message[OBJECT]; + var model = new cls.InspectableJSObject(rt_id, + object[OBJECT_ID], + "", + object[CLASS_NAME]); + _tooltip_model = model; + model.expand(function() + { + var tmpl = ["div", + ["h2", templates.default_filter(_filter_config), + ["span", object[CLASS_NAME], + "data-tooltip", TOOLTIP_NAME], + "data-id", String(model.id), + "obj-id", String(model.object_id), + "class", "js-tooltip-title"], + ["div", [window.templates.inspected_js_object(model, false)], + "class", "js-tooltip-examine-container mono"], + "class", "js-tooltip js-tooltip-examine"]; + var ele = _tooltip.show(tmpl, box); + if (ele) + { + _filter_input = ele.querySelector("input"); + _tooltip_container = ele.querySelector(".js-tooltip-examine-container"); + _filter.set_form_input(_filter_input); + _filter.set_container(_tooltip_container); + } + }); + } + else + { + var value = ""; + if (message[TYPE] == "null" || message[TYPE] == "undefined") + value = message[TYPE] + else if (message[TYPE] == "string") + value = "\"" + message[VALUE] + "\""; + else + value = message[VALUE]; + + var tmpl = ["div", + ["value", value, "class", message[TYPE]], + "class", "js-tooltip"]; + _tooltip.show(tmpl, box); + } + + var start_line = _identifier.start_line; + var start_offset = _identifier.start_offset; + var length = script_text.length; + + if (start_line < _view.getTopLine()) + { + if (_identifier.end_line < _view.getTopLine()) + return; + + start_line = _view.getTopLine(); + start_offset = 0; + var start = script.line_arr[start_line - 1]; + var end = script.line_arr[selection.end_line - 1] + selection.end_offset; + length = end + 1 - start; + } + + if (!_win_selection.isCollapsed) + _win_selection.collapseToStart() + + _view.higlight_slice(start_line, start_offset, length); + } + }; + + var _get_tokens_of_line = function(script, line_number) + { + var tokens = []; + if (script) + { + var line = script.get_line(line_number); + var start_state = script.state_arr[line_number - 1]; + + if (line) + { + _tokenizer.tokenize(line, function(token_type, token) + { + tokens.push([token_type, token]); + }, false, start_state); + } + } + return tokens; + }; + + var _get_identifier = function(script, line_number, char_offset, shift_key) + { + if (_win_selection.isCollapsed) + { + var tokens = _get_tokens_of_line(script, line_number); + + for (var i = 0, sum = 0; i < tokens.length; i++) + { + sum += tokens[i][VALUE].length; + if (sum > char_offset) + break; + } + + if ((tokens[i][TYPE] == IDENTIFIER && + (!window.js_keywords.hasOwnProperty(tokens[i][VALUE]) || + tokens[i][VALUE] == "this")) || + (tokens[i][TYPE] == PUNCTUATOR && + ((tokens[i][VALUE] == "[" || tokens[i][VALUE] == "]") || + (shift_key && (tokens[i][VALUE] == "(" || tokens[i][VALUE] == ")"))))) + { + var start = _get_identifier_chain_start(script, line_number, tokens, i, shift_key); + var end = _get_identifier_chain_end(script, line_number, tokens, i, shift_key); + return {start_line: start.start_line, + start_offset: start.start_offset, + end_line: end.end_line, + end_offset: end.end_offset}; + } + } + else + { + var range = _win_selection.getRangeAt(0); + if (document.documentElement.contains(_last_move_event.target) && + range.intersectsNode(_last_move_event.target)) + { + var start = _get_line_and_offset(range.startContainer, range.startOffset); + var end = _get_line_and_offset(range.endContainer, range.endOffset); + if (start && end) + return {start_line: start.line_number, + start_offset: start.offset, + end_line: end.line_number, + end_offset: end.offset - 1}; + } + } + + return null; + }; + + var _get_identifier_chain_start = function(script, line_number, tokens, + match_index, shift_key) + { + var start_line = line_number; + var bracket_count = 0; + var previous_token = tokens[match_index]; + var bracket_stack = []; + var parens_stack = []; + var index = match_index - 1; + + if (previous_token[VALUE] == "]") + bracket_stack.push(previous_token[VALUE]); + + if (shift_key && previous_token[VALUE] == ")") + parens_stack.push(previous_token[VALUE]); + + while (true) + { + for (var i = match_index - 1, token = null; token = tokens[i]; i--) + { + // consume everything between parentheses if shiftKey is pressed + if (shift_key && parens_stack.length) + { + if (token[TYPE] == PUNCTUATOR) + { + if (token[VALUE] == ")") + { + parens_stack.push(token[VALUE]) + previous_token = token; + } + if (token[VALUE] == "(") + { + parens_stack.pop(); + previous_token = token; + } + } + index = i - 1; + continue; + } + + switch (previous_token[TYPE]) + { + case IDENTIFIER: + { + switch (token[TYPE]) + { + case WHITESPACE: + case LINETERMINATOR: + case COMMENT: + { + continue; + } + case PUNCTUATOR: + { + if (token[VALUE] == ".") + { + previous_token = token; + index = i - 1; + continue; + } + if (token[VALUE] == "[" && bracket_stack.length) + { + bracket_stack.pop(); + previous_token = token; + index = i - 1; + continue; + } + } + } + break; + } + case PUNCTUATOR: + { + //previous_token[VALUE] is one of '.', '[', ']', '(', ')' + if (shift_key && token[VALUE] == ")") + { + parens_stack.push(token[VALUE]); + previous_token = token; + index = i - 1; + continue; + } + + if (previous_token[VALUE] == "." || previous_token[VALUE] == "[") + { + switch (token[TYPE]) + { + case WHITESPACE: + case LINETERMINATOR: + case COMMENT: + { + continue; + } + case IDENTIFIER: + { + previous_token = token; + index = i - 1; + continue; + } + case PUNCTUATOR: + { + if (token[VALUE] == "]") + { + bracket_stack.push(token[VALUE]); + previous_token = token; + index = i - 1; + continue; + } + } + } + } + else // must be "]" + { + switch (token[TYPE]) + { + case WHITESPACE: + case LINETERMINATOR: + case COMMENT: + { + continue; + } + case STRING: + case NUMBER: + case IDENTIFIER: + { + previous_token = token; + index = i - 1; + continue; + } + case PUNCTUATOR: + { + if (token[VALUE] == "]") + { + bracket_stack.push(token[VALUE]); + previous_token = token; + index = i - 1; + continue; + } + } + } + } + break; + } + case STRING: + case NUMBER: + { + switch (token[TYPE]) + { + case WHITESPACE: + case LINETERMINATOR: + case COMMENT: + { + continue; + } + case PUNCTUATOR: + { + if (token[VALUE] == "[") + { + bracket_stack.pop(); + previous_token = token; + index = i - 1; + continue; + } + } + } + break; + } + } + break; + } + + if (i == -1) + { + var new_tokens = _get_tokens_of_line(script, start_line - 1); + + if (new_tokens.length) + { + start_line--; + match_index = new_tokens.length; + index += match_index; + tokens = new_tokens.extend(tokens); + } + else + break; + } + else + break; + } + + if (tokens[index + 1][TYPE] == PUNCTUATOR && tokens[index + 1][VALUE] == ".") + index++; + + while (true) + { + var nl_index = _get_index_of_newline(tokens); + if (nl_index > -1 && nl_index <= index) + { + index -= tokens.splice(0, nl_index + 1).length; + start_line++; + } + else + break + } + + return {start_line: start_line, start_offset: _get_sum(tokens, index)}; + }; + + var _get_identifier_chain_end = function(script, line_number, tokens, + match_index, shift_key) + { + var start_line = line_number; + var bracket_count = 0; + var previous_token = tokens[match_index]; + var bracket_stack = []; + var parens_stack = []; + var index = match_index; + + if (previous_token[VALUE] == "[") + bracket_stack.push(previous_token[VALUE]); + + if (shift_key && previous_token[VALUE] == "(") + parens_stack.push(previous_token[VALUE]); + + while (bracket_stack.length || (shift_key && parens_stack.length)) + { + for (var i = match_index + 1, token = null; token = tokens[i]; i++) + { + // consume everything between parentheses if shiftKey is pressed + if (shift_key && parens_stack.length) + { + if (token[TYPE] == PUNCTUATOR) + { + if (token[VALUE] == "(") + { + parens_stack.push(token[VALUE]) + previous_token = token; + } + if (token[VALUE] == ")") + { + parens_stack.pop(); + previous_token = token; + } + } + index = i; + continue; + } + + if (!bracket_stack.length) + break; + + switch (previous_token[TYPE]) + { + case IDENTIFIER: + { + switch (token[TYPE]) + { + case WHITESPACE: + case LINETERMINATOR: + case COMMENT: + { + continue; + } + case PUNCTUATOR: + { + if (token[VALUE] == ".") + { + previous_token = token; + index = i; + continue; + } + if (token[VALUE] == "]") + { + bracket_stack.pop(); + previous_token = token; + index = i; + continue; + } + if (token[VALUE] == "[") + { + bracket_stack.push(token[VALUE]); + previous_token = token; + index = i; + continue; + } + } + } + break; + } + case PUNCTUATOR: + { + if (previous_token[VALUE] == "]") + { + switch (token[TYPE]) + { + case WHITESPACE: + case LINETERMINATOR: + case COMMENT: + { + continue; + } + case PUNCTUATOR: + { + if (token[VALUE] == ".") + { + previous_token = token; + index = i - 1; + continue; + } + if (token[VALUE] == "]" && bracket_stack.length) + { + bracket_stack.pop(); + previous_token = token; + index = i; + continue; + } + } + } + } + else if (previous_token[VALUE] == "[") + { + switch (token[TYPE]) + { + case WHITESPACE: + case LINETERMINATOR: + case COMMENT: + { + continue; + } + case STRING: + case NUMBER: + case IDENTIFIER: + { + previous_token = token; + index = i; + continue; + } + } + } + else // must be "." + { + switch (token[TYPE]) + { + case WHITESPACE: + case LINETERMINATOR: + case COMMENT: + { + continue; + } + case IDENTIFIER: + { + previous_token = token; + index = i; + continue; + } + } + } + break; + } + case STRING: + case NUMBER: + { + switch (token[TYPE]) + { + case WHITESPACE: + case LINETERMINATOR: + case COMMENT: + { + continue; + } + case PUNCTUATOR: + { + if (token[VALUE] == "]") + { + bracket_stack.pop(); + previous_token = token; + index = i; + continue; + } + } + } + break; + } + } + } + + if (i == tokens.length && bracket_stack.length) + { + start_line++; + var new_tokens = _get_tokens_of_line(script, start_line); + + if (new_tokens.length) + { + match_index = i; + tokens.extend(new_tokens); + } + else + break; + } + else + break; + } + + while (true) + { + var nl_index = _get_index_of_newline(tokens); + if (nl_index > -1 && nl_index <= index) + index -= tokens.splice(0, nl_index + 1).length; + else + break + } + + return {end_line: start_line, end_offset: _get_sum(tokens, index) - 1}; + }; + + var _get_line_and_offset = function(node, offset) + { + var line_ele = node.parentNode.has_attr("parent-node-chain", "data-line-number"); + if (line_ele) + { + var ctx = {target_node: node, sum: offset, is_found: false}; + return {line_number: parseInt(line_ele.getAttribute("data-line-number")), + offset: _walk_dom(ctx, line_ele).sum}; + } + return null; + }; + + var _walk_dom = function(ctx, node) + { + // ctx.target_node, ctx.sum, ctx.is_found + while (!ctx.is_found && node) + { + if (node.nodeType == Node.ELEMENT_NODE) + _walk_dom(ctx, node.firstChild); + + if (node.nodeType == Node.TEXT_NODE) + { + if (node == ctx.target_node) + ctx.is_found = true; + else + ctx.sum += node.nodeValue.length; + } + node = node.nextSibling; + } + return ctx; + }; + + var _get_max_right = function() + { + return Math.max.apply(null, _identifier_boxes.map(function(box) + { + return box.right; + })); + }; + + var _get_index_of_newline = function(tokens) + { + for (var i = 0, token; token = tokens[i]; i++) + { + if (token[TYPE] == LINETERMINATOR) + return i; + } + return -1; + }; + + var _get_sum = function(tokens, index) + { + for (var i = 0, sum = 0; i <= index; i++) + sum += tokens[i][VALUE].length; + + return sum; + }; + + var _get_mouse_pos_center = function() + { + var center = null; + if (_mouse_positions.length > 2) + { + var min_x = MIN(_mouse_positions[0].x, + _mouse_positions[1].x, + _mouse_positions[2].x); + var max_x = MAX(_mouse_positions[0].x, + _mouse_positions[1].x, + _mouse_positions[2].x); + var min_y = MIN(_mouse_positions[0].y, + _mouse_positions[1].y, + _mouse_positions[2].y); + var max_y = MAX(_mouse_positions[0].y, + _mouse_positions[1].y, + _mouse_positions[2].y); + var dx = max_x - min_x; + var dy = max_y - min_y; + + center = {x: min_x + dx / 2, + y: min_y + dy / 2, + r: POW(POW(dx / 2, 2) + POW(dy / 2, 2), 0.5)}; + } + return center; + }; + + var _update_identifier_boxes = function(script, identifier) + { + // translates the current selected identifier to dimension boxes + // position and dimensions are absolute to the source text + var line_number = _identifier.start_line; + + var start_offset = _identifier.start_offset; + var end_offset = 0; + _identifier_boxes = []; + while (true) + { + var box = {}; + var line = script.get_line(line_number); + box.left = _get_pixel_offset(line, start_offset); + if (line_number < _identifier.end_line) + box.right = _get_pixel_offset(line, line.length + 1); + else + box.right = _get_pixel_offset(line, _identifier.end_offset + 1); + box.top = (line_number - 1) * _line_height; + box.bottom = line_number * _line_height; + _identifier_boxes.push(box); + if (line_number == _identifier.end_line || + line_number >= script.line_arr.length) + break; + else + line_number += 1; + start_offset = 0; + } + }; + + var _is_over_identifier_boxes = function(event) + { + var off_x = _total_x_offset - _container.scrollLeft; + var off_y = _container_box.top - (_view.getTopLine() - 1) * _line_height; + var e_x = event.clientX - off_x; + var e_y = event.clientY - off_y; + + for (var i = 0, box; box = _identifier_boxes[i]; i++) + { + if (e_x >= box.left && e_x <= box.right && + e_y >= box.top && e_y <= box.bottom) + return true; + } + return false; + }; + + var _clear_selection = function() + { + _identifier = null; + _last_script_text = ""; + _last_poll = {}; + _view.higlight_slice(); + _tooltip.hide(); + _filter.set_search_term(""); + _filter.cleanup(); + _is_filter_focus = false; + _tooltip_model = null; + _tooltip_container = null; + + }; + + var _get_char_offset = function(line, offset) + { + offset /= _char_width; + for (var i = 0, l = line.length, offset_count = 0; i < l; i++) + { + offset_count += line[i] == "\t" + ? _tab_size - (offset_count % _tab_size) + : 1; + if (offset_count > offset) + return i; + } + return -1; + }; + + var _get_pixel_offset = function(line, char_offset) + { + for (var i = 0, offset_count = 0, char = ""; i < char_offset; i++) + { + char = line[i]; + if (char == "\n" || char == "\r") + continue; + + offset_count += char == "\t" + ? _tab_size - offset_count % _tab_size + : 1; + } + return offset_count * _char_width; + }; + + var _get_tab_size = function() + { + var style_dec = document.styleSheets.getDeclaration(".js-source-content div"); + return style_dec ? parseInt(style_dec.getPropertyValue("-o-tab-size")) : 0; + }; + + var _get_container_box = function() + { + if (_container) + _container_box = _container.getBoundingClientRect(); + }; + + /* event handlers */ + + var _onmousemove = function(event) + { + _last_move_event = event; + }; + + var _ontooltip = function(event, target) + { + if (!_poll_interval) + { + if (!_char_width) + _onmonospacefontchange(); + + var container = _view.get_scroll_container(); + if (container && target.parentNode) + { + _container = container; + _container_box = container.getBoundingClientRect(); + _tooltip_target_ele = target.parentNode; + _tooltip_target_ele.addEventListener("mousemove", _onmousemove, false); + while (_mouse_positions.length) + _mouse_positions.pop(); + + _total_x_offset = _container_box.left + _default_offset; + _win_selection = window.getSelection(); + _poll_interval = setInterval(_poll_position, POLL_INTERVAL); + } + } + }; + + var _onhide = function() + { + if (_poll_interval) + { + clearInterval(_poll_interval); + _clear_selection(); + _tooltip_target_ele.removeEventListener('mousemove', _onmousemove, false); + _poll_interval = 0; + _tooltip_target_ele = null; + _container_box = null; + _container = null; + _win_selection = null; + } + }; + + var _ontooltipenter = function(event) + { + _is_over_tooltip = true; + }; + + var _ontooltipleave = function(event) + { + _is_over_tooltip = false; + }; + + var _onmonospacefontchange = function(msg) + { + _char_width = defaults["js-source-char-width"]; + _line_height = defaults["js-source-line-height"]; + _tab_size = _get_tab_size(); + _default_offset = defaults["js-default-text-offset"]; + }; + + var _onkeydown = function(event) + { + if (event.keyCode == SHIFT_KEY) + _shift_key = true; + }; + + var _onkeyup = function(event) + { + if (event.keyCode == SHIFT_KEY) + _shift_key = false; + }; + + var _onbeforefilter = function(msg) + { + if (_tooltip_model && _tooltip_container) + { + var tmpl = window.templates.inspected_js_object(_tooltip_model, false, + null, msg.search_term); + _tooltip_container.clearAndRender(tmpl); + } + }; + + var _onmousedown = function(event, target) + { + _is_mouse_down = true; + _clear_selection(); + }; + + var _onmouseup = function(event) + { + _is_mouse_down = false; + }; + + var _onfocus = function(event, target) + { + _is_filter_focus = true; + }; + + var _onblur = function(event, target) + { + _is_filter_focus = false + }; + + var _oninput = function(event, target) + { + _filter.search_delayed(target.value); + }; + + var _init = function(view) + { + _view = view; + _tokenizer = new cls.SimpleJSParser(); + _tooltip = Tooltips.register(cls.JSSourceTooltip.tooltip_name, true, false, + ".js-tooltip-examine-container"); + _tooltip.ontooltip = _ontooltip; + _tooltip.onhide = _onhide; + _tooltip.ontooltipenter = _ontooltipenter; + _tooltip.ontooltipleave = _ontooltipleave; + _tagman = window.tagManager; + _esde = window.services["ecmascript-debugger"]; + _filter = new TextSearch(); + _filter_shortcuts_cb = cls.Helpers.shortcut_search_cb.bind(_filter); + window.event_handlers.input[FILTER_HANDLER] = _oninput; + window.event_handlers.focus[FILTER_HANDLER] = _onfocus; + window.event_handlers.blur[FILTER_HANDLER] = _onblur; + window.event_handlers.mousedown["scroll-js-source-view"] = _onmousedown; + _filter.add_listener("onbeforesearch", _onbeforefilter); + ActionBroker.get_instance().get_global_handler(). + register_shortcut_listener(FILTER_HANDLER, _filter_shortcuts_cb); + window.messages.addListener("monospace-font-changed", _onmonospacefontchange); + window.addEventListener("resize", _get_container_box, false); + document.addEventListener("keydown", _onkeydown, false); + document.addEventListener("keyup", _onkeyup, false); + document.addEventListener("mouseup", _onmouseup, false); + }; + + this.unregister = function() + { + Tooltips.unregister(cls.JSSourceTooltip.tooltip_name, _tooltip); + window.messages.removeListener("monospace-font-changed", _onmonospacefontchange); + window.removeEventListener('resize', _get_container_box, false); + }; + + _init(view); +}; + +cls.JSSourceTooltip.tooltip_name = "js-source"; diff --git a/src/ecma-debugger/newscript.js b/src/ecma-debugger/newscript.js index 36b7daa6a..c5c23e761 100644 --- a/src/ecma-debugger/newscript.js +++ b/src/ecma-debugger/newscript.js @@ -1,604 +1,604 @@ -window.cls || (window.cls = {}); - -window.cls.NewScript = function(message) -{ - const - RUNTIME_ID = 0, - SCRIPT_ID = 1, - SCRIPT_TYPE = 2, - SCRIPT_DATA = 3, - URI = 4; - - this.runtime_id = message[RUNTIME_ID]; - this.script_id = message[SCRIPT_ID]; - this.script_type = message[SCRIPT_TYPE]; - this.script_data = message[SCRIPT_DATA] || ''; - this.uri = message[URI]; - this.breakpoints = {}; - this.breakpoint_states = []; - this.line_pointer = {line: 0, state: 0}; - this.stop_ats = []; - this.scroll_height = 0; - this.scroll_width = 0; -}; - -window.cls.NewScript.BP_NONE = 0; -window.cls.NewScript.BP_DISABLED = 3; -window.cls.NewScript.BP_DISABLED_CONDITION = 6; -window.cls.NewScript.BP_ENABLED = 9; -window.cls.NewScript.BP_ENABLED_CONDITION = 12; -window.cls.NewScript.LINE_POINTER_TOP = 1; -window.cls.NewScript.LINE_POINTER = 2; -/* line state */ -window.cls.NewScript.DEFAULT_STATE = 0; -window.cls.NewScript.SINGLE_QUOTE_STATE = 1; -window.cls.NewScript.DOUBLE_QUOTE_STATE = 2; -window.cls.NewScript.REG_EXP_STATE = 3; -window.cls.NewScript.COMMENT_STATE = 4; - -window.cls.NewScriptPrototype = function() -{ - var WHITESPACE = cls.SimpleJSParser.WHITESPACE; - var LINETERMINATOR = cls.SimpleJSParser.LINETERMINATOR; - var IDENTIFIER = cls.SimpleJSParser.IDENTIFIER; - var NUMBER = cls.SimpleJSParser.NUMBER; - var STRING = cls.SimpleJSParser.STRING; - var PUNCTUATOR = cls.SimpleJSParser.PUNCTUATOR; - var DIV_PUNCTUATOR = cls.SimpleJSParser.DIV_PUNCTUATOR; - var REG_EXP = cls.SimpleJSParser.REG_EXP; - var COMMENT = cls.SimpleJSParser.COMMENT; - var TYPE = 0; - var VALUE = 1; - var _tokenizer = new cls.SimpleJSParser(); - - /** - * Searches the actual data. - * Updates the script object with the following properties for all matches: - * - line_matches, a list of all matches in the source, - * the values are the lines numbers of a given match - * - line_offsets, a list of all matches in the source, - * the values are the character offset in the line of the match - * - match_cursor, pointing to the selected match - * _ match_length, the length of the search term - */ - this.search_source = function(search_term, is_ignore_case, is_reg_exp) - { - if (is_ignore_case && !is_reg_exp) - { - search_term = search_term.toLowerCase(); - } - if (is_reg_exp) - { - search_term = new RegExp(search_term, is_ignore_case ? 'ig' : 'g'); - } - if (this.search_term != search_term || - this.is_ignore_case != is_ignore_case || - this.is_reg_exp != is_reg_exp) - { - if (!this.line_arr) - { - this.set_line_states(); - } - this.clear_search(); - this.search_term = search_term; - this.is_ignore_case = is_ignore_case; - this.is_reg_exp = is_reg_exp; - this.match_length = search_term.length; - if (!this.script_data_lower) - { - this.script_data_lower = this.script_data.toLowerCase(); - } - if (search_term) - { - var pos = -1; - var line_cur = 0; - var index = 0; - var line_arr_length = this.line_arr.length; - var match = null; - while (true) - { - if (is_reg_exp) - { - match = search_term.exec(this.script_data); - pos = match ? match.index : -1; - } - else if (is_ignore_case) - { - pos = this.script_data_lower.indexOf(search_term, pos + 1); - } - else - { - pos = this.script_data.indexOf(search_term, pos + 1); - } - - if (pos == -1) - { - break; - } - - while (line_cur < line_arr_length && this.line_arr[line_cur] <= pos) - { - ++line_cur; - } - - this.line_matches[index] = line_cur; - this.line_offsets[index] = pos - this.line_arr[line_cur - 1]; - if (is_reg_exp) - { - this.line_offsets_length[index] = match[0].length - } - index++; - } - } - } - }; - - this.get_line_length = function(index) - { - return index > 0 - ? this.line_arr[index] - this.line_arr[index - 1] - : this.line_arr[0]; - } - - this.get_line = function(line_number) - { - if (!this.line_arr) - this.set_line_states(); - - if (line_number > 0 && this.line_arr[line_number]) - return this.script_data.slice(this.line_arr[line_number - 1], - this.line_arr[line_number]); - return ""; - }; - - this.clear_search = function() - { - this.search_term = ""; - this.line_matches = []; - this.line_offsets = []; - this.line_offsets_length = []; - this.match_cursor = -1; - this.match_length = 0; - }; - - this.__defineGetter__("is_minified", function() - { - if (this._is_minified === undefined) - { - var MAX_SLICE = 5000; - var LIMIT = 11; - var re = /\s+/g; - var ws = 0; - var m = null; - var src = this.script_data.slice(0, MAX_SLICE); - while (m = re.exec(src)) - ws += m[0].length; - - this._is_minified = (100 * ws / src.length) < LIMIT; - } - return this._is_minified; - }); - - this.__defineSetter__("is_minified", function() {}); - - this.get_function = function(line_number) - { - if (this.is_minified) - return null; - - var start_line = -1; - var end_line = -1; - var index = -1; - var tokens = null; - var op_bracket_count = 0; - while (start_line == -1 && line_number > -1) - { - tokens = this._get_tokens_of_line(line_number); - for (var i = 0, token; token = tokens[i]; i++) - { - if (token[TYPE] == IDENTIFIER && token[VALUE] == "function") - { - start_line = line_number; - index = i; - } - } - if (index == -1) - line_number--; - } - while (!op_bracket_count && line_number <= this.line_arr.length) - { - for (var i = index, token; token = tokens[i]; i++) - { - if (token[TYPE] == PUNCTUATOR && token[VALUE] == "{") - { - op_bracket_count++; - index = i + 1; - break; - } - } - if (!token) - { - index = 0; - tokens = this._get_tokens_of_line(++line_number); - } - } - while (op_bracket_count && end_line == -1 && line_number <= this.line_arr.length) - { - for (var i = index, token; token = tokens[i]; i++) - { - if (token[TYPE] == PUNCTUATOR) - { - if (token[VALUE] == "{") - op_bracket_count++; - else if (token[VALUE] == "}") - { - op_bracket_count--; - if (!op_bracket_count) - { - end_line = line_number; - break; - } - } - } - } - - if (end_line == -1) - { - index = 0; - tokens = this._get_tokens_of_line(++line_number); - } - } - return start_line > -1 && end_line > -1 - ? {start_line: start_line, end_line: end_line} - : null; - }; - - this._get_tokens_of_line = function(line_number) - { - if (!this.line_arr) - this.set_line_states(); - - var tokens = []; - var line = this.get_line(line_number); - var start_state = this.state_arr[line_number - 1]; - if (line) - { - _tokenizer.tokenize(line, function(token_type, token) - { - tokens.push([token_type, token]); - }, false, start_state); - } - return tokens; - }; - - this.set_line_states = function() - { - this.line_arr = []; - this.state_arr = []; - var input = this.script_data, line_arr = this.line_arr, state_arr = this.state_arr; - var cur_cur = -1; - var line_cur = 0; - var line_cur_prev = -1; - var s_quote_cur = -2; - var d_quote_cur = -2; - var slash_cur = -2; - var nl_cur = 0; - var cr_cur = 0; - - - var min_cur = 0; - - var s_quote_val = '\''; - var d_quote_val = '"'; - var slash_val = '/'; - var NL = '\n'; - var CR = '\r'; - - var eol = NL; - // old mac end of lines - if (/\r(?!\n)/.test(input)) - { - eol = CR; - } - - var line_count = 0; - - var temp_count = 0; - - var temp_char = ''; - - var temp_type = ''; - - - var string = input; - // states = default, s_quote, d_qute, slash - var DEFAULT = window.cls.NewScript.DEFAULT_STATE; - var SINGLE_QUOTE = window.cls.NewScript.SINGLE_QUOTE_STATE; - var DOUBLE_QUOTE = window.cls.NewScript.DOUBLE_QUOTE_STATE; - var REG_EXP = window.cls.NewScript.REG_EXP_STATE; - var COMMENT = window.cls.NewScript.COMMENT_STATE; - // lexer_states = default, s_quote, d_qute, slash - var lex_state = 'DEFAULT'; // SINGLE_QUOTE; DOUBLE_QUOTE; SLASH - var LEX_S_QUOTE = 1; - var state = ''; - - var get_min = Math.min; - var get_max = Math.max; - - var handle_strings = function(ref_pos, ref_val) - { - // ensure that a string never exceeds the current - // line if the newline is not escaped - var temp_count = 0; - var is_cr = 0; - var nl_cur = string.indexOf(eol, ref_pos + 1); - do - { - // newline was escaped - if (temp_count && (nl_cur == ref_pos)) - nl_cur = string.indexOf(eol, nl_cur + 1); - ref_pos = string.indexOf(ref_val, ref_pos + 1); - if (nl_cur > -1 && nl_cur < ref_pos) - { - ref_pos = nl_cur; - is_cr = (eol == NL && string[nl_cur - 1] == CR) ? 1 : 0; - } - temp_count = 0; - while (string.charAt(ref_pos - temp_count - 1 - is_cr) == '\\') - temp_count++; - } - while ((temp_count & 1) && ref_pos != -1); - return ref_pos; - }; - - while( min_cur != -1 ) - { - - state = ''; - if( ( s_quote_cur != -1 ) && ( s_quote_cur <= cur_cur ) ) - { - s_quote_cur = string.indexOf(s_quote_val, cur_cur + 1); - } - if( ( d_quote_cur != -1 ) && ( d_quote_cur <= cur_cur ) ) - { - d_quote_cur = string.indexOf(d_quote_val, cur_cur + 1); - } - if( ( slash_cur != -1 ) && ( slash_cur <= cur_cur ) ) - { - slash_cur = string.indexOf(slash_val, cur_cur + 1); - } - // get the minimum, but bigger then -1 - min_cur = get_max(s_quote_cur, d_quote_cur, slash_cur); - if( s_quote_cur != -1 && s_quote_cur <= min_cur) - { - min_cur = s_quote_cur; - state = 'SINGLE_QUOTE'; - } - if( d_quote_cur != -1 && d_quote_cur <= min_cur ) - { - min_cur = d_quote_cur; - state = 'DOUBLE_QUOTE'; - } - if( slash_cur != -1 && slash_cur <= min_cur ) - { - min_cur = slash_cur; - state = 'SLASH'; - } - if( state ) - { - - while( line_cur <= min_cur ) - { - line_arr[line_count++] = line_cur; - if( ( line_cur = string.indexOf(eol, line_cur) + 1 ) == 0 ) - { - if( line_arr[ line_arr.length - 1 ] < string.length ) - { - line_arr[line_count] = string.length; - } - return; - } - } - switch( state ) - { - case 'SINGLE_QUOTE': - { - s_quote_cur = handle_strings(s_quote_cur, s_quote_val); - if( s_quote_cur != -1 ) - { - cur_cur = s_quote_cur; - while( line_cur < cur_cur ) - { - line_arr[line_count] = line_cur; - state_arr[line_count++] = SINGLE_QUOTE; - if( ( line_cur = string.indexOf(eol, line_cur) + 1 ) == 0 ) - { - if( line_arr[ line_arr.length - 1 ] < string.length ) - { - line_arr[line_count] = string.length; - } - return; - } - } - } - continue; - } - case 'DOUBLE_QUOTE': - { - d_quote_cur = handle_strings(d_quote_cur, d_quote_val); - if( d_quote_cur != -1 ) - { - cur_cur = d_quote_cur; - while( line_cur < cur_cur ) - { - line_arr[line_count] = line_cur; - state_arr[line_count++] = DOUBLE_QUOTE; - if( ( line_cur = string.indexOf(eol, line_cur) + 1 ) == 0 ) - { - if( line_arr[ line_arr.length - 1 ] < string.length ) - { - line_arr[line_count] = string.length; - } - return; - } - } - } - - continue; - } - case 'SLASH': - { - switch(string.charAt(slash_cur+1)) - { - case '/': - { - cur_cur = string.indexOf(eol, slash_cur+2); - while( line_cur < cur_cur ) - { - line_arr[line_count++] = line_cur; - if( ( line_cur = string.indexOf(eol, line_cur) + 1 ) == 0 ) - { - if( line_arr[ line_arr.length - 1 ] < string.length ) - { - line_arr[line_count] = string.length; - } - return; - } - } - continue; - } - case '*': - { - // skip the first '*' - slash_cur++; - - do - { - slash_cur = string.indexOf('*', slash_cur + 1); - temp_char = string.charAt(slash_cur + 1); - } - while ( slash_cur != -1 && temp_char && temp_char != '/'); - if( slash_cur != -1 ) - { - cur_cur = slash_cur+1; - while (line_cur < cur_cur) - { - line_arr[line_count] = line_cur; - state_arr[line_count++] = COMMENT; - - if ((line_cur = string.indexOf(eol, line_cur) + 1) == 0) - { - if (line_arr[ line_arr.length - 1 ] < string.length) - { - line_arr[line_count] = string.length; - } - return; - } - } - } - continue; - } - default: - { - temp_count = 1; - do - { - temp_char = string.charAt(slash_cur-temp_count); - temp_count++; - } - while ( temp_char == ' ' && ( slash_cur - temp_count > 0 ) ); - switch(temp_char) - { - case '=': - case '(': - case '[': - case ':': - case ',': - case '!': - { - temp_type = 'REG_EXP'; - break; - } - case '&': - case '|': - { - if(string.charAt(slash_cur-temp_count) == temp_char) - { - temp_type = 'REG_EXP'; - break; - } - } - default: - { - temp_type = ''; - } - } - if(temp_type == 'REG_EXP') - { - do - { - slash_cur = string.indexOf(slash_val, slash_cur + 1); - temp_count = 0; - while( string.charAt( slash_cur - temp_count - 1 )=='\\' ) - { - temp_count++; - } - } - while ( ( temp_count&1 ) && slash_cur != -1 ); - if( slash_cur != -1 ) - { - cur_cur = slash_cur; - while( line_cur < cur_cur ) - { - line_arr[line_count] = line_cur; - state_arr[line_count++] = REG_EXP; - if( ( line_cur = string.indexOf(eol, line_cur) + 1 ) == 0 ) - { - if( line_arr[ line_arr.length - 1 ] < string.length ) - { - line_arr[line_count] = string.length; - } - return; - } - } - } - continue; - } - else // should be a division - { - cur_cur = slash_cur; - continue; - } - } - } - } - } - } - else - { - if( !line_cur && !line_arr.length ) - { - line_cur = string.indexOf(eol, line_cur) + 1 ; - if( line_cur || string.length ) - { - line_arr[line_count++] = 0; - } - } - while( line_cur ) - { - line_arr[line_count++] = line_cur; - line_cur = string.indexOf(eol, line_cur) + 1; - } - if( line_arr[ line_arr.length - 1 ] < string.length ) - { - line_arr[line_count] = string.length; - } - - return; - } - } - } -}; - -window.cls.NewScriptPrototype.prototype = new URIPrototype("uri"); -window.cls.NewScript.prototype = new window.cls.NewScriptPrototype(); +window.cls || (window.cls = {}); + +window.cls.NewScript = function(message) +{ + const + RUNTIME_ID = 0, + SCRIPT_ID = 1, + SCRIPT_TYPE = 2, + SCRIPT_DATA = 3, + URI = 4; + + this.runtime_id = message[RUNTIME_ID]; + this.script_id = message[SCRIPT_ID]; + this.script_type = message[SCRIPT_TYPE]; + this.script_data = message[SCRIPT_DATA] || ''; + this.uri = message[URI]; + this.breakpoints = {}; + this.breakpoint_states = []; + this.line_pointer = {line: 0, state: 0}; + this.stop_ats = []; + this.scroll_height = 0; + this.scroll_width = 0; +}; + +window.cls.NewScript.BP_NONE = 0; +window.cls.NewScript.BP_DISABLED = 3; +window.cls.NewScript.BP_DISABLED_CONDITION = 6; +window.cls.NewScript.BP_ENABLED = 9; +window.cls.NewScript.BP_ENABLED_CONDITION = 12; +window.cls.NewScript.LINE_POINTER_TOP = 1; +window.cls.NewScript.LINE_POINTER = 2; +/* line state */ +window.cls.NewScript.DEFAULT_STATE = 0; +window.cls.NewScript.SINGLE_QUOTE_STATE = 1; +window.cls.NewScript.DOUBLE_QUOTE_STATE = 2; +window.cls.NewScript.REG_EXP_STATE = 3; +window.cls.NewScript.COMMENT_STATE = 4; + +window.cls.NewScriptPrototype = function() +{ + var WHITESPACE = cls.SimpleJSParser.WHITESPACE; + var LINETERMINATOR = cls.SimpleJSParser.LINETERMINATOR; + var IDENTIFIER = cls.SimpleJSParser.IDENTIFIER; + var NUMBER = cls.SimpleJSParser.NUMBER; + var STRING = cls.SimpleJSParser.STRING; + var PUNCTUATOR = cls.SimpleJSParser.PUNCTUATOR; + var DIV_PUNCTUATOR = cls.SimpleJSParser.DIV_PUNCTUATOR; + var REG_EXP = cls.SimpleJSParser.REG_EXP; + var COMMENT = cls.SimpleJSParser.COMMENT; + var TYPE = 0; + var VALUE = 1; + var _tokenizer = new cls.SimpleJSParser(); + + /** + * Searches the actual data. + * Updates the script object with the following properties for all matches: + * - line_matches, a list of all matches in the source, + * the values are the lines numbers of a given match + * - line_offsets, a list of all matches in the source, + * the values are the character offset in the line of the match + * - match_cursor, pointing to the selected match + * _ match_length, the length of the search term + */ + this.search_source = function(search_term, is_ignore_case, is_reg_exp) + { + if (is_ignore_case && !is_reg_exp) + { + search_term = search_term.toLowerCase(); + } + if (is_reg_exp) + { + search_term = new RegExp(search_term, is_ignore_case ? 'ig' : 'g'); + } + if (this.search_term != search_term || + this.is_ignore_case != is_ignore_case || + this.is_reg_exp != is_reg_exp) + { + if (!this.line_arr) + { + this.set_line_states(); + } + this.clear_search(); + this.search_term = search_term; + this.is_ignore_case = is_ignore_case; + this.is_reg_exp = is_reg_exp; + this.match_length = search_term.length; + if (!this.script_data_lower) + { + this.script_data_lower = this.script_data.toLowerCase(); + } + if (search_term) + { + var pos = -1; + var line_cur = 0; + var index = 0; + var line_arr_length = this.line_arr.length; + var match = null; + while (true) + { + if (is_reg_exp) + { + match = search_term.exec(this.script_data); + pos = match ? match.index : -1; + } + else if (is_ignore_case) + { + pos = this.script_data_lower.indexOf(search_term, pos + 1); + } + else + { + pos = this.script_data.indexOf(search_term, pos + 1); + } + + if (pos == -1) + { + break; + } + + while (line_cur < line_arr_length && this.line_arr[line_cur] <= pos) + { + ++line_cur; + } + + this.line_matches[index] = line_cur; + this.line_offsets[index] = pos - this.line_arr[line_cur - 1]; + if (is_reg_exp) + { + this.line_offsets_length[index] = match[0].length + } + index++; + } + } + } + }; + + this.get_line_length = function(index) + { + return index > 0 + ? this.line_arr[index] - this.line_arr[index - 1] + : this.line_arr[0]; + } + + this.get_line = function(line_number) + { + if (!this.line_arr) + this.set_line_states(); + + if (line_number > 0 && this.line_arr[line_number]) + return this.script_data.slice(this.line_arr[line_number - 1], + this.line_arr[line_number]); + return ""; + }; + + this.clear_search = function() + { + this.search_term = ""; + this.line_matches = []; + this.line_offsets = []; + this.line_offsets_length = []; + this.match_cursor = -1; + this.match_length = 0; + }; + + this.__defineGetter__("is_minified", function() + { + if (this._is_minified === undefined) + { + var MAX_SLICE = 5000; + var LIMIT = 11; + var re = /\s+/g; + var ws = 0; + var m = null; + var src = this.script_data.slice(0, MAX_SLICE); + while (m = re.exec(src)) + ws += m[0].length; + + this._is_minified = (100 * ws / src.length) < LIMIT; + } + return this._is_minified; + }); + + this.__defineSetter__("is_minified", function() {}); + + this.get_function = function(line_number) + { + if (this.is_minified) + return null; + + var start_line = -1; + var end_line = -1; + var index = -1; + var tokens = null; + var op_bracket_count = 0; + while (start_line == -1 && line_number > -1) + { + tokens = this._get_tokens_of_line(line_number); + for (var i = 0, token; token = tokens[i]; i++) + { + if (token[TYPE] == IDENTIFIER && token[VALUE] == "function") + { + start_line = line_number; + index = i; + } + } + if (index == -1) + line_number--; + } + while (!op_bracket_count && line_number <= this.line_arr.length) + { + for (var i = index, token; token = tokens[i]; i++) + { + if (token[TYPE] == PUNCTUATOR && token[VALUE] == "{") + { + op_bracket_count++; + index = i + 1; + break; + } + } + if (!token) + { + index = 0; + tokens = this._get_tokens_of_line(++line_number); + } + } + while (op_bracket_count && end_line == -1 && line_number <= this.line_arr.length) + { + for (var i = index, token; token = tokens[i]; i++) + { + if (token[TYPE] == PUNCTUATOR) + { + if (token[VALUE] == "{") + op_bracket_count++; + else if (token[VALUE] == "}") + { + op_bracket_count--; + if (!op_bracket_count) + { + end_line = line_number; + break; + } + } + } + } + + if (end_line == -1) + { + index = 0; + tokens = this._get_tokens_of_line(++line_number); + } + } + return start_line > -1 && end_line > -1 + ? {start_line: start_line, end_line: end_line} + : null; + }; + + this._get_tokens_of_line = function(line_number) + { + if (!this.line_arr) + this.set_line_states(); + + var tokens = []; + var line = this.get_line(line_number); + var start_state = this.state_arr[line_number - 1]; + if (line) + { + _tokenizer.tokenize(line, function(token_type, token) + { + tokens.push([token_type, token]); + }, false, start_state); + } + return tokens; + }; + + this.set_line_states = function() + { + this.line_arr = []; + this.state_arr = []; + var input = this.script_data, line_arr = this.line_arr, state_arr = this.state_arr; + var cur_cur = -1; + var line_cur = 0; + var line_cur_prev = -1; + var s_quote_cur = -2; + var d_quote_cur = -2; + var slash_cur = -2; + var nl_cur = 0; + var cr_cur = 0; + + + var min_cur = 0; + + var s_quote_val = '\''; + var d_quote_val = '"'; + var slash_val = '/'; + var NL = '\n'; + var CR = '\r'; + + var eol = NL; + // old mac end of lines + if (/\r(?!\n)/.test(input)) + { + eol = CR; + } + + var line_count = 0; + + var temp_count = 0; + + var temp_char = ''; + + var temp_type = ''; + + + var string = input; + // states = default, s_quote, d_qute, slash + var DEFAULT = window.cls.NewScript.DEFAULT_STATE; + var SINGLE_QUOTE = window.cls.NewScript.SINGLE_QUOTE_STATE; + var DOUBLE_QUOTE = window.cls.NewScript.DOUBLE_QUOTE_STATE; + var REG_EXP = window.cls.NewScript.REG_EXP_STATE; + var COMMENT = window.cls.NewScript.COMMENT_STATE; + // lexer_states = default, s_quote, d_qute, slash + var lex_state = 'DEFAULT'; // SINGLE_QUOTE; DOUBLE_QUOTE; SLASH + var LEX_S_QUOTE = 1; + var state = ''; + + var get_min = Math.min; + var get_max = Math.max; + + var handle_strings = function(ref_pos, ref_val) + { + // ensure that a string never exceeds the current + // line if the newline is not escaped + var temp_count = 0; + var is_cr = 0; + var nl_cur = string.indexOf(eol, ref_pos + 1); + do + { + // newline was escaped + if (temp_count && (nl_cur == ref_pos)) + nl_cur = string.indexOf(eol, nl_cur + 1); + ref_pos = string.indexOf(ref_val, ref_pos + 1); + if (nl_cur > -1 && nl_cur < ref_pos) + { + ref_pos = nl_cur; + is_cr = (eol == NL && string[nl_cur - 1] == CR) ? 1 : 0; + } + temp_count = 0; + while (string.charAt(ref_pos - temp_count - 1 - is_cr) == '\\') + temp_count++; + } + while ((temp_count & 1) && ref_pos != -1); + return ref_pos; + }; + + while( min_cur != -1 ) + { + + state = ''; + if( ( s_quote_cur != -1 ) && ( s_quote_cur <= cur_cur ) ) + { + s_quote_cur = string.indexOf(s_quote_val, cur_cur + 1); + } + if( ( d_quote_cur != -1 ) && ( d_quote_cur <= cur_cur ) ) + { + d_quote_cur = string.indexOf(d_quote_val, cur_cur + 1); + } + if( ( slash_cur != -1 ) && ( slash_cur <= cur_cur ) ) + { + slash_cur = string.indexOf(slash_val, cur_cur + 1); + } + // get the minimum, but bigger then -1 + min_cur = get_max(s_quote_cur, d_quote_cur, slash_cur); + if( s_quote_cur != -1 && s_quote_cur <= min_cur) + { + min_cur = s_quote_cur; + state = 'SINGLE_QUOTE'; + } + if( d_quote_cur != -1 && d_quote_cur <= min_cur ) + { + min_cur = d_quote_cur; + state = 'DOUBLE_QUOTE'; + } + if( slash_cur != -1 && slash_cur <= min_cur ) + { + min_cur = slash_cur; + state = 'SLASH'; + } + if( state ) + { + + while( line_cur <= min_cur ) + { + line_arr[line_count++] = line_cur; + if( ( line_cur = string.indexOf(eol, line_cur) + 1 ) == 0 ) + { + if( line_arr[ line_arr.length - 1 ] < string.length ) + { + line_arr[line_count] = string.length; + } + return; + } + } + switch( state ) + { + case 'SINGLE_QUOTE': + { + s_quote_cur = handle_strings(s_quote_cur, s_quote_val); + if( s_quote_cur != -1 ) + { + cur_cur = s_quote_cur; + while( line_cur < cur_cur ) + { + line_arr[line_count] = line_cur; + state_arr[line_count++] = SINGLE_QUOTE; + if( ( line_cur = string.indexOf(eol, line_cur) + 1 ) == 0 ) + { + if( line_arr[ line_arr.length - 1 ] < string.length ) + { + line_arr[line_count] = string.length; + } + return; + } + } + } + continue; + } + case 'DOUBLE_QUOTE': + { + d_quote_cur = handle_strings(d_quote_cur, d_quote_val); + if( d_quote_cur != -1 ) + { + cur_cur = d_quote_cur; + while( line_cur < cur_cur ) + { + line_arr[line_count] = line_cur; + state_arr[line_count++] = DOUBLE_QUOTE; + if( ( line_cur = string.indexOf(eol, line_cur) + 1 ) == 0 ) + { + if( line_arr[ line_arr.length - 1 ] < string.length ) + { + line_arr[line_count] = string.length; + } + return; + } + } + } + + continue; + } + case 'SLASH': + { + switch(string.charAt(slash_cur+1)) + { + case '/': + { + cur_cur = string.indexOf(eol, slash_cur+2); + while( line_cur < cur_cur ) + { + line_arr[line_count++] = line_cur; + if( ( line_cur = string.indexOf(eol, line_cur) + 1 ) == 0 ) + { + if( line_arr[ line_arr.length - 1 ] < string.length ) + { + line_arr[line_count] = string.length; + } + return; + } + } + continue; + } + case '*': + { + // skip the first '*' + slash_cur++; + + do + { + slash_cur = string.indexOf('*', slash_cur + 1); + temp_char = string.charAt(slash_cur + 1); + } + while ( slash_cur != -1 && temp_char && temp_char != '/'); + if( slash_cur != -1 ) + { + cur_cur = slash_cur+1; + while (line_cur < cur_cur) + { + line_arr[line_count] = line_cur; + state_arr[line_count++] = COMMENT; + + if ((line_cur = string.indexOf(eol, line_cur) + 1) == 0) + { + if (line_arr[ line_arr.length - 1 ] < string.length) + { + line_arr[line_count] = string.length; + } + return; + } + } + } + continue; + } + default: + { + temp_count = 1; + do + { + temp_char = string.charAt(slash_cur-temp_count); + temp_count++; + } + while ( temp_char == ' ' && ( slash_cur - temp_count > 0 ) ); + switch(temp_char) + { + case '=': + case '(': + case '[': + case ':': + case ',': + case '!': + { + temp_type = 'REG_EXP'; + break; + } + case '&': + case '|': + { + if(string.charAt(slash_cur-temp_count) == temp_char) + { + temp_type = 'REG_EXP'; + break; + } + } + default: + { + temp_type = ''; + } + } + if(temp_type == 'REG_EXP') + { + do + { + slash_cur = string.indexOf(slash_val, slash_cur + 1); + temp_count = 0; + while( string.charAt( slash_cur - temp_count - 1 )=='\\' ) + { + temp_count++; + } + } + while ( ( temp_count&1 ) && slash_cur != -1 ); + if( slash_cur != -1 ) + { + cur_cur = slash_cur; + while( line_cur < cur_cur ) + { + line_arr[line_count] = line_cur; + state_arr[line_count++] = REG_EXP; + if( ( line_cur = string.indexOf(eol, line_cur) + 1 ) == 0 ) + { + if( line_arr[ line_arr.length - 1 ] < string.length ) + { + line_arr[line_count] = string.length; + } + return; + } + } + } + continue; + } + else // should be a division + { + cur_cur = slash_cur; + continue; + } + } + } + } + } + } + else + { + if( !line_cur && !line_arr.length ) + { + line_cur = string.indexOf(eol, line_cur) + 1 ; + if( line_cur || string.length ) + { + line_arr[line_count++] = 0; + } + } + while( line_cur ) + { + line_arr[line_count++] = line_cur; + line_cur = string.indexOf(eol, line_cur) + 1; + } + if( line_arr[ line_arr.length - 1 ] < string.length ) + { + line_arr[line_count] = string.length; + } + + return; + } + } + } +}; + +window.cls.NewScriptPrototype.prototype = new URIPrototype("uri"); +window.cls.NewScript.prototype = new window.cls.NewScriptPrototype(); diff --git a/src/ecma-debugger/objectinspection.6.0/actions.js b/src/ecma-debugger/objectinspection.6.0/actions.js index ed731a2f5..3140d2035 100644 --- a/src/ecma-debugger/objectinspection.6.0/actions.js +++ b/src/ecma-debugger/objectinspection.6.0/actions.js @@ -1,191 +1,191 @@ -(function() -{ - var get_path = function(ele) - { - var path = [], proto = null; - while (ele && (proto = ele.parentNode) && - proto.parentNode.nodeName.toLowerCase() == 'examine-objects') - { - path.push([ - ele.getElementsByTagName('key')[0].textContent, - parseInt(ele.getAttribute('obj-id')), - parseInt(proto.getAttribute('data-proto-index')) - ]); - ele = proto.parentNode.parentNode; - } - return path.reverse(); - }; - - var examine_object_cb = function(target, container, data_model, path) - { - container.render(window.templates.inspected_js_object(data_model, null, path)); - // update the icon - target.style.backgroundPosition = "0px -11px"; - }; - - window.eventHandlers.click['expand-prototype'] = function(event, target) - { - const PATH_PROTO_INDEX = 2; - - var - data_model = window.inspections[target.get_attr('parent-node-chain', 'data-id')], - is_unfolded = target.hasClass('unfolded'), - path = get_path(target), - name = target.getElementsByTagName('key')[0].textContent; - - if (is_unfolded) - data_model.collapse_prototype(path); - else - data_model.expand_prototype(path); - var index = path.pop()[PATH_PROTO_INDEX]; - var templ = window.templates.inspected_js_prototype(data_model, path, index, name); - target.parentNode.re_render(templ); - } - - window.eventHandlers.click['examine-object'] = function examine_objects(event, target) - { - /* - // prototype header - -
-
-
- - Function -
-
-
- - - // object item - -
- - - ApplicationCache - ApplicationCache - - */ - - const PATH_OBJ_ID = 1; - - var - parent = target.parentNode, - data_model = window.inspections[parent.get_attr('parent-node-chain', 'data-id')], - examine_object = parent.getElementsByTagName('examine-objects')[0], - path = get_path(parent); - - if (data_model) - { - if (examine_object) // is unfolded - { - if (!target.disabled) - { - data_model.collapse(path); - parent.removeChild(examine_object); - target.style.removeProperty("background-position"); - } - } - else - { - var cb = examine_object_cb.bind(this, target, parent, data_model, path); - data_model.expand(cb, path); - } - } - }; - - window.eventHandlers.click['get-getter-value'] = function examine_objects(event, target) - { - var obj_id = Number(target.get_attr('parent-node-chain', 'obj-id')); - var data_model = window.inspections[target.get_attr('parent-node-chain', 'data-id')]; - var parent = target.get_ancestor("item"); - var key = parent && parent.querySelector("key"); - var path = data_model && data_model.norm_path(get_path(parent)); - if (obj_id && data_model && key && path) - { - var getter = key.textContent; - var cb = _expand_getter.bind(null, target, obj_id, data_model, getter, path); - var tag = window.tag_manager.set_callback(null, cb, []); - var ex_ctx = window.runtimes.get_execution_context(); - var rt_id = ex_ctx.rt_id; - var thread_id = ex_ctx.thread_id; - var frame_index = ex_ctx.frame_index; - if (data_model.runtime_id != rt_id) - { - rt_id = data_model.runtime_id; - thread_id = 0; - frame_index = 0; - } - var script = "obj[\"" + window.helpers.escape_input(getter) + "\"]"; - var msg = [rt_id, thread_id, frame_index, script, [["obj", obj_id]]]; - window.services["ecmascript-debugger"].requestEval(tag, msg); - } - }; - - window.eventHandlers.click['expand-scope-chain'] = function(event, target) - { - var - parent = target.parentNode, - data_model = window.inspections[target.getAttribute('data-id')], - examine_object = parent.getElementsByTagName('examine-objects')[0]; - - if (examine_object) // is unfolded - { - data_model.collapse_scope_chain(); - parent.re_render(window.templates.inspected_js_scope_chain(data_model)); - } - else - { - data_model.expand_scope_chain(); - parent.re_render(window.templates.inspected_js_scope_chain(data_model)); - } - }; - - var _expand_getter = function(target, obj_id, data_model, getter, path, status, message) - { - var PATH_PROTO_INDEX = 2; - var STATUS_OK = 0; - if (status === STATUS_OK && - data_model.set_getter_value(obj_id, getter, message) && - target.parentNode && target.parentNode.parentNode) - { - var index = path.pop()[PATH_PROTO_INDEX]; - var templ = window.templates.inspected_js_prototype(data_model, path, index); - target.parentNode.parentNode.re_render(templ); - } - }; - - var _inspect_object = function(rt_id, obj_id, force_show_view) - { - messages.post('active-inspection-type', {inspection_type: 'object'}); - if (force_show_view) - { - UI.get_instance().show_view(views.inspection.id); - } - messages.post('object-selected', {rt_id: rt_id, obj_id: obj_id}); - }; - - window.eventHandlers.click['inspect-object-link'] = function(event, target) - { - var rt_id = Number(target.get_ancestor_attr('rt-id') || - target.get_ancestor_attr('data-rt-id')); - var obj_id = Number(target.get_ancestor_attr('obj-id') || - target.get_ancestor_attr('data-obj-id')); - if (rt_id && obj_id) - _inspect_object(rt_id, obj_id, true); - }; - - window.eventHandlers.click['inspect-object-inline-link'] = function(event, target) - { - if (event.target.nodeName.toLowerCase() == "key" && - event.target.parentNode.hasAttribute('obj-id')) - { - var obj_id = parseInt(event.target.parentNode.getAttribute('obj-id')); - var model_id = event.target.get_attr('parent-node-chain', 'data-id'); - var model = model_id && window.inspections[model_id]; - var rt_id = model && model.runtime_id; - _inspect_object(rt_id, obj_id); - } - }; - -})(); +(function() +{ + var get_path = function(ele) + { + var path = [], proto = null; + while (ele && (proto = ele.parentNode) && + proto.parentNode.nodeName.toLowerCase() == 'examine-objects') + { + path.push([ + ele.getElementsByTagName('key')[0].textContent, + parseInt(ele.getAttribute('obj-id')), + parseInt(proto.getAttribute('data-proto-index')) + ]); + ele = proto.parentNode.parentNode; + } + return path.reverse(); + }; + + var examine_object_cb = function(target, container, data_model, path) + { + container.render(window.templates.inspected_js_object(data_model, null, path)); + // update the icon + target.style.backgroundPosition = "0px -11px"; + }; + + window.eventHandlers.click['expand-prototype'] = function(event, target) + { + const PATH_PROTO_INDEX = 2; + + var + data_model = window.inspections[target.get_attr('parent-node-chain', 'data-id')], + is_unfolded = target.hasClass('unfolded'), + path = get_path(target), + name = target.getElementsByTagName('key')[0].textContent; + + if (is_unfolded) + data_model.collapse_prototype(path); + else + data_model.expand_prototype(path); + var index = path.pop()[PATH_PROTO_INDEX]; + var templ = window.templates.inspected_js_prototype(data_model, path, index, name); + target.parentNode.re_render(templ); + } + + window.eventHandlers.click['examine-object'] = function examine_objects(event, target) + { + /* + // prototype header + +
+
+
+ + Function +
+
+
+ + + // object item + +
+ + + ApplicationCache + ApplicationCache + + */ + + const PATH_OBJ_ID = 1; + + var + parent = target.parentNode, + data_model = window.inspections[parent.get_attr('parent-node-chain', 'data-id')], + examine_object = parent.getElementsByTagName('examine-objects')[0], + path = get_path(parent); + + if (data_model) + { + if (examine_object) // is unfolded + { + if (!target.disabled) + { + data_model.collapse(path); + parent.removeChild(examine_object); + target.style.removeProperty("background-position"); + } + } + else + { + var cb = examine_object_cb.bind(this, target, parent, data_model, path); + data_model.expand(cb, path); + } + } + }; + + window.eventHandlers.click['get-getter-value'] = function examine_objects(event, target) + { + var obj_id = Number(target.get_attr('parent-node-chain', 'obj-id')); + var data_model = window.inspections[target.get_attr('parent-node-chain', 'data-id')]; + var parent = target.get_ancestor("item"); + var key = parent && parent.querySelector("key"); + var path = data_model && data_model.norm_path(get_path(parent)); + if (obj_id && data_model && key && path) + { + var getter = key.textContent; + var cb = _expand_getter.bind(null, target, obj_id, data_model, getter, path); + var tag = window.tag_manager.set_callback(null, cb, []); + var ex_ctx = window.runtimes.get_execution_context(); + var rt_id = ex_ctx.rt_id; + var thread_id = ex_ctx.thread_id; + var frame_index = ex_ctx.frame_index; + if (data_model.runtime_id != rt_id) + { + rt_id = data_model.runtime_id; + thread_id = 0; + frame_index = 0; + } + var script = "obj[\"" + window.helpers.escape_input(getter) + "\"]"; + var msg = [rt_id, thread_id, frame_index, script, [["obj", obj_id]]]; + window.services["ecmascript-debugger"].requestEval(tag, msg); + } + }; + + window.eventHandlers.click['expand-scope-chain'] = function(event, target) + { + var + parent = target.parentNode, + data_model = window.inspections[target.getAttribute('data-id')], + examine_object = parent.getElementsByTagName('examine-objects')[0]; + + if (examine_object) // is unfolded + { + data_model.collapse_scope_chain(); + parent.re_render(window.templates.inspected_js_scope_chain(data_model)); + } + else + { + data_model.expand_scope_chain(); + parent.re_render(window.templates.inspected_js_scope_chain(data_model)); + } + }; + + var _expand_getter = function(target, obj_id, data_model, getter, path, status, message) + { + var PATH_PROTO_INDEX = 2; + var STATUS_OK = 0; + if (status === STATUS_OK && + data_model.set_getter_value(obj_id, getter, message) && + target.parentNode && target.parentNode.parentNode) + { + var index = path.pop()[PATH_PROTO_INDEX]; + var templ = window.templates.inspected_js_prototype(data_model, path, index); + target.parentNode.parentNode.re_render(templ); + } + }; + + var _inspect_object = function(rt_id, obj_id, force_show_view) + { + messages.post('active-inspection-type', {inspection_type: 'object'}); + if (force_show_view) + { + UI.get_instance().show_view(views.inspection.id); + } + messages.post('object-selected', {rt_id: rt_id, obj_id: obj_id}); + }; + + window.eventHandlers.click['inspect-object-link'] = function(event, target) + { + var rt_id = Number(target.get_ancestor_attr('rt-id') || + target.get_ancestor_attr('data-rt-id')); + var obj_id = Number(target.get_ancestor_attr('obj-id') || + target.get_ancestor_attr('data-obj-id')); + if (rt_id && obj_id) + _inspect_object(rt_id, obj_id, true); + }; + + window.eventHandlers.click['inspect-object-inline-link'] = function(event, target) + { + if (event.target.nodeName.toLowerCase() == "key" && + event.target.parentNode.hasAttribute('obj-id')) + { + var obj_id = parseInt(event.target.parentNode.getAttribute('obj-id')); + var model_id = event.target.get_attr('parent-node-chain', 'data-id'); + var model = model_id && window.inspections[model_id]; + var rt_id = model && model.runtime_id; + _inspect_object(rt_id, obj_id); + } + }; + +})(); diff --git a/src/ecma-debugger/objectinspection.6.0/inspectiontooltip.js b/src/ecma-debugger/objectinspection.6.0/inspectiontooltip.js index f4c504ab6..90d9daa83 100644 --- a/src/ecma-debugger/objectinspection.6.0/inspectiontooltip.js +++ b/src/ecma-debugger/objectinspection.6.0/inspectiontooltip.js @@ -1,189 +1,189 @@ -"use strict"; - -window.cls || (window.cls = {}); - -cls.JSInspectionTooltip = function() -{ - var OBJECT_VALUE = 3; - var CLASS_NAME = 4; - var NON_PRINTABLE = 0; - var CLASS_TOOLTIP_SELECTED = "tooltip-selected"; - - var _tooltip = null; - var _pretty_printer = null; - var _cur_ctx = null; - var _cur_object = null; - - var _handle_ontooltip = function(ctx) - { - if (_cur_object && ctx.object == _cur_object && - document.documentElement.contains(ctx.target) && - ctx.template) - { - _cur_ctx = ctx; - _cur_ctx.target.addClass(CLASS_TOOLTIP_SELECTED); - _tooltip.show(ctx.template); - if (ctx.type.after_render) - ctx.type.after_render(); - } - else - _hide_tooltip(); - }; - - var _hide_tooltip = function() - { - if (_cur_ctx) - _cur_ctx.target.removeClass(CLASS_TOOLTIP_SELECTED); - - _cur_ctx = null; - _cur_object = null; - _tooltip.hide(); - }; - - var _ontooltipenter = function(event) - { - if (!_cur_ctx) - return; - - switch (_cur_ctx.type.type) - { - case cls.PrettyPrinter.ELEMENT: - if (settings.dom.get("highlight-on-hover")) - hostspotlighter.spotlight(_cur_ctx.obj_id, true); - break; - } - }; - - var _ontooltipleave = function(event) - { - if (!_cur_ctx) - return; - - switch (_cur_ctx.type.type) - { - case cls.PrettyPrinter.ELEMENT: - if (settings.dom.get("highlight-on-hover")) - { - if (views.dom.isvisible() && dom_data.target) - hostspotlighter.spotlight(dom_data.target, true); - else - hostspotlighter.clearSpotlight(); - } - break; - } - }; - - var _ontooltipclick = function(event) - { - if (!_cur_ctx) - return; - - switch (_cur_ctx.type.type) - { - case cls.PrettyPrinter.ELEMENT: - UI.get_instance().show_view("dom"); - dom_data.get_dom(_cur_ctx.rt_id, _cur_ctx.obj_id); - _hide_tooltip(); - break; - } - }; - - var _ontooltip = function(event, target) - { - if (_cur_ctx && _cur_ctx.target == target) - return; - - _hide_tooltip(); - - var model_id = target.get_attr("parent-node-chain", "data-id"); - var obj_id = parseInt(target.get_attr("parent-node-chain", "obj-id")); - var model = inspections[model_id]; - var obj = model && model.get_object_with_id(obj_id); - - if (obj && obj[OBJECT_VALUE]) - { - _cur_object = obj; - _pretty_printer.print({target: target, - rt_id: model.runtime_id, - obj_id: obj_id, - class_name: obj[OBJECT_VALUE][CLASS_NAME] || "", - object: obj, - callback: _handle_ontooltip}); - } - else - { - var rt_id = Number(target.get_ancestor_attr("data-rt-id")); - var obj_id = Number(target.get_ancestor_attr("data-obj-id")); - var class_name = target.get_ancestor_attr("data-class-name"); - if (rt_id && obj_id && class_name) - { - _cur_object = {rt_id: rt_id, obj_id: obj_id, class_name: class_name}; - _pretty_printer.print({target: target, - rt_id: rt_id, - obj_id: obj_id, - class_name: class_name, - object: _cur_object, - callback: _handle_ontooltip}); - } - else - { - var script_data = target.get_ancestor_attr("data-script-data"); - if (script_data && class_name) - { - _cur_object = {script_data: script_data, class_name: class_name}; - _pretty_printer.print({target: target, - script_data: script_data, - class_name: class_name, - object: _cur_object, - callback: _handle_ontooltip}); - } - } - } - }; - - this.handle_function_source = function(event, target) - { - var rt_id = Number(target.get_ancestor_attr("data-rt-id")); - var obj_id = Number(target.get_ancestor_attr("data-obj-id")); - if (_cur_object && _cur_ctx && - _cur_object.rt_id == rt_id && _cur_object.obj_id == obj_id && - _cur_ctx.script && _cur_ctx.function_definition && - window.views.js_source) - { - window.views.js_source.show_script(_cur_ctx.script.script_id, - _cur_ctx.function_definition.start_line, - _cur_ctx.function_definition.end_line); - } - }; - - var _init = function(view) - { - _tooltip = Tooltips.register(cls.JSInspectionTooltip.tooltip_name, true, true, - ".js-tooltip-examine-container"); - _pretty_printer = new cls.PrettyPrinter(); - _pretty_printer.register_types([cls.PrettyPrinter.ELEMENT, - cls.PrettyPrinter.DATE, - cls.PrettyPrinter.FUNCTION, - cls.PrettyPrinter.ERROR, - cls.PrettyPrinter.REGEXP]); - _tooltip.ontooltip = _ontooltip; - _tooltip.onhide = _hide_tooltip; - _tooltip.ontooltipenter = _ontooltipenter; - _tooltip.ontooltipleave = _ontooltipleave; - _tooltip.ontooltipclick = _ontooltipclick; - }; - - _init(); -}; - -cls.JSInspectionTooltip.tooltip_name = "js-inspection"; - -cls.JSInspectionTooltip.register = function() -{ - this._tooltip = new cls.JSInspectionTooltip(); -}; - -cls.JSInspectionTooltip.get_tooltip = function() -{ - return this._tooltip; -}; +"use strict"; + +window.cls || (window.cls = {}); + +cls.JSInspectionTooltip = function() +{ + var OBJECT_VALUE = 3; + var CLASS_NAME = 4; + var NON_PRINTABLE = 0; + var CLASS_TOOLTIP_SELECTED = "tooltip-selected"; + + var _tooltip = null; + var _pretty_printer = null; + var _cur_ctx = null; + var _cur_object = null; + + var _handle_ontooltip = function(ctx) + { + if (_cur_object && ctx.object == _cur_object && + document.documentElement.contains(ctx.target) && + ctx.template) + { + _cur_ctx = ctx; + _cur_ctx.target.addClass(CLASS_TOOLTIP_SELECTED); + _tooltip.show(ctx.template); + if (ctx.type.after_render) + ctx.type.after_render(); + } + else + _hide_tooltip(); + }; + + var _hide_tooltip = function() + { + if (_cur_ctx) + _cur_ctx.target.removeClass(CLASS_TOOLTIP_SELECTED); + + _cur_ctx = null; + _cur_object = null; + _tooltip.hide(); + }; + + var _ontooltipenter = function(event) + { + if (!_cur_ctx) + return; + + switch (_cur_ctx.type.type) + { + case cls.PrettyPrinter.ELEMENT: + if (settings.dom.get("highlight-on-hover")) + hostspotlighter.spotlight(_cur_ctx.obj_id, true); + break; + } + }; + + var _ontooltipleave = function(event) + { + if (!_cur_ctx) + return; + + switch (_cur_ctx.type.type) + { + case cls.PrettyPrinter.ELEMENT: + if (settings.dom.get("highlight-on-hover")) + { + if (views.dom.isvisible() && dom_data.target) + hostspotlighter.spotlight(dom_data.target, true); + else + hostspotlighter.clearSpotlight(); + } + break; + } + }; + + var _ontooltipclick = function(event) + { + if (!_cur_ctx) + return; + + switch (_cur_ctx.type.type) + { + case cls.PrettyPrinter.ELEMENT: + UI.get_instance().show_view("dom"); + dom_data.get_dom(_cur_ctx.rt_id, _cur_ctx.obj_id); + _hide_tooltip(); + break; + } + }; + + var _ontooltip = function(event, target) + { + if (_cur_ctx && _cur_ctx.target == target) + return; + + _hide_tooltip(); + + var model_id = target.get_attr("parent-node-chain", "data-id"); + var obj_id = parseInt(target.get_attr("parent-node-chain", "obj-id")); + var model = inspections[model_id]; + var obj = model && model.get_object_with_id(obj_id); + + if (obj && obj[OBJECT_VALUE]) + { + _cur_object = obj; + _pretty_printer.print({target: target, + rt_id: model.runtime_id, + obj_id: obj_id, + class_name: obj[OBJECT_VALUE][CLASS_NAME] || "", + object: obj, + callback: _handle_ontooltip}); + } + else + { + var rt_id = Number(target.get_ancestor_attr("data-rt-id")); + var obj_id = Number(target.get_ancestor_attr("data-obj-id")); + var class_name = target.get_ancestor_attr("data-class-name"); + if (rt_id && obj_id && class_name) + { + _cur_object = {rt_id: rt_id, obj_id: obj_id, class_name: class_name}; + _pretty_printer.print({target: target, + rt_id: rt_id, + obj_id: obj_id, + class_name: class_name, + object: _cur_object, + callback: _handle_ontooltip}); + } + else + { + var script_data = target.get_ancestor_attr("data-script-data"); + if (script_data && class_name) + { + _cur_object = {script_data: script_data, class_name: class_name}; + _pretty_printer.print({target: target, + script_data: script_data, + class_name: class_name, + object: _cur_object, + callback: _handle_ontooltip}); + } + } + } + }; + + this.handle_function_source = function(event, target) + { + var rt_id = Number(target.get_ancestor_attr("data-rt-id")); + var obj_id = Number(target.get_ancestor_attr("data-obj-id")); + if (_cur_object && _cur_ctx && + _cur_object.rt_id == rt_id && _cur_object.obj_id == obj_id && + _cur_ctx.script && _cur_ctx.function_definition && + window.views.js_source) + { + window.views.js_source.show_script(_cur_ctx.script.script_id, + _cur_ctx.function_definition.start_line, + _cur_ctx.function_definition.end_line); + } + }; + + var _init = function(view) + { + _tooltip = Tooltips.register(cls.JSInspectionTooltip.tooltip_name, true, true, + ".js-tooltip-examine-container"); + _pretty_printer = new cls.PrettyPrinter(); + _pretty_printer.register_types([cls.PrettyPrinter.ELEMENT, + cls.PrettyPrinter.DATE, + cls.PrettyPrinter.FUNCTION, + cls.PrettyPrinter.ERROR, + cls.PrettyPrinter.REGEXP]); + _tooltip.ontooltip = _ontooltip; + _tooltip.onhide = _hide_tooltip; + _tooltip.ontooltipenter = _ontooltipenter; + _tooltip.ontooltipleave = _ontooltipleave; + _tooltip.ontooltipclick = _ontooltipclick; + }; + + _init(); +}; + +cls.JSInspectionTooltip.tooltip_name = "js-inspection"; + +cls.JSInspectionTooltip.register = function() +{ + this._tooltip = new cls.JSInspectionTooltip(); +}; + +cls.JSInspectionTooltip.get_tooltip = function() +{ + return this._tooltip; +}; diff --git a/src/ecma-debugger/objectinspection.6.0/prettyprinter.js b/src/ecma-debugger/objectinspection.6.0/prettyprinter.js index 585d8305a..e76e750a0 100644 --- a/src/ecma-debugger/objectinspection.6.0/prettyprinter.js +++ b/src/ecma-debugger/objectinspection.6.0/prettyprinter.js @@ -1,371 +1,371 @@ -"use strict"; - -window.cls || (window.cls = {}); - -cls.PrettyPrinter = function() {}; - -cls.PrettyPrinter.ELEMENT = 1; -cls.PrettyPrinter.DATE = 2; -cls.PrettyPrinter.FUNCTION = 3; -cls.PrettyPrinter.ERROR = 4; -cls.PrettyPrinter.REGEXP = 5; - -cls.PrettyPrinter.types = {}; - -/** - * Add more types here. - * A type must have an is_type function which takes a class name to check - * if a given object is of this type. - * The type must either have a script or a traversal property. The script is - * used with an Eval command to pretty print an object. The traversal is used - * with an InspectDOM command to retrieve a node. - * The type must have a template function to return a template. The template - * takes the returned message and the given ctx as arguments. - */ - -cls.PrettyPrinter.types[cls.PrettyPrinter.ELEMENT] = -{ - type: cls.PrettyPrinter.ELEMENT, - is_type: function(class_name) - { - return /Element$/.test(class_name); - }, - traversal: "node", - template: function(msg, ctx) - { - var NODE_LIST = 0; - var NODE = 0; - var NAME = 2; - var NAMESPACE = 4; - var ATTRS = 5; - var ATTR_PREFIX = 0; - var ATTR_KEY = 1; - var ATTR_VALUE = 2; - - var tmpl = []; - var node = msg[NODE_LIST] && msg[NODE_LIST][NODE]; - - if (node) - { - var force_lower_case = settings.dom.get("force-lowercase"); - var is_tree_style = settings.dom.get("dom-tree-style"); - var node_name = node[NAMESPACE] - ? node[NAMESPACE] + ":" - : ""; - node_name += node[NAME]; - if (force_lower_case) - node_name = node_name.toLowerCase(); - - if (node[ATTRS] && node[ATTRS].length) - { - tmpl.push("node", (is_tree_style ? "" : "<") + node_name + " "); - node[ATTRS].forEach(function(attr) - { - var attr_key = attr[ATTR_PREFIX] ? attr[ATTR_PREFIX] + ":" : ""; - attr_key += force_lower_case - ? attr[ATTR_KEY].toLowerCase() - : attr[ATTR_KEY]; - tmpl.push(["key", attr_key]); - tmpl.push("="); - tmpl.push(["value", "\"" + attr[ATTR_VALUE] + "\""]); - tmpl.push(" "); - }); - tmpl.pop(); - if (!is_tree_style) - tmpl.push(">"); - } - else - tmpl.push("node", is_tree_style ? node_name : "<" + node_name + ">"); - - tmpl = ["div", tmpl, "class", "dom mono"]; - } - return tmpl; - } -}; - -cls.PrettyPrinter.types[cls.PrettyPrinter.DATE] = -{ - type: cls.PrettyPrinter.DATE, - is_type: function(class_name) - { - return class_name == "Date"; - }, - script: "new Date(object.getTime() - object.getTimezoneOffset() * 1000 * 60)" + - ".toISOString().replace(\"Z\", \"\")", - template: function(message, ctx) - { - var VALUE = 2; - return ["span", message[VALUE], "class", "mono"]; - } -}; - -cls.PrettyPrinter.types[cls.PrettyPrinter.FUNCTION] = -{ - type: cls.PrettyPrinter.FUNCTION, - is_type: function(class_name) - { - return class_name == "Function"; - }, - script: "object.toString()", - template: function(message, ctx) - { - var tmpl = []; - if (ctx.script_data) - { - tmpl.push("div"); - window.templates.highlight_js_source(ctx.script_data, null, 0, tmpl); - tmpl.push("class", "tooltip-function-source"); - } - else if (ctx.function_definition) - { - var script = ctx.script; - var start_line = ctx.function_definition.start_line; - var end_line = ctx.function_definition.end_line; - var line_numbers = ["ul"]; - var lines = ["div"]; - var head = []; - var sc_link = window.templates.script_link_with_line_number(script, start_line); - if (sc_link) - { - sc_link.push("handler", "show-log-entry-source", - "data-scriptid", String(script.script_id), - "data-scriptline", String(start_line), - "data-script-endline", String(end_line)), - head = ["h2", sc_link, "class", "js-tooltip-title"]; - } - - for (var i = start_line; i <= end_line; i++) - { - var data = script.get_line(i); - var start_state = script.state_arr[i - 1]; - var line_tmpl = ["div"]; - window.templates.highlight_js_source(data, null, start_state, line_tmpl); - lines.push(line_tmpl); - var num_templ = ["li"]; - num_templ.push(["span", String(i), "class", "line-number"]); - num_templ.push(["span", "handler", "set-break-point", "class", "break-point"]); - line_numbers.push(num_templ); - } - lines.push("class", "js-source-content js-source mono"); - line_numbers.push("class", "js-source-line-numbers"); - - tmpl = ["div", - head, - ["div", - ["div", lines, line_numbers, "class", "position-relative"], - "class", "js-tooltip-examine-container mono"], - "class", "tooltip-function-source", - "data-script-id", String(script.script_id)]; - } - else - { - var VALUE = 2; - tmpl = templates.highlight_js_source(message[VALUE]); - tmpl.push("class", "pretty-printed-code mono"); - } - return tmpl; - }, - after_render: function() - { - var fn_tooltip = document.querySelector(".tooltip-function-source"); - if (fn_tooltip) - { - var line_numbers = fn_tooltip.querySelector(".js-source-line-numbers"); - var script_id = line_numbers && line_numbers.get_ancestor_attr("data-script-id"); - var script = window.runtimes.getScript(Number(script_id)); - cls.JsSourceView.update_breakpoints(script, line_numbers); - } - }, - init: function() - { - if (!this._is_initialized) - { - this._is_initialized = true; - window.messages.addListener("breakpoint-updated", this.after_render); - } - } -}; - -cls.PrettyPrinter.types[cls.PrettyPrinter.ERROR] = -{ - type: cls.PrettyPrinter.ERROR, - is_type: function(class_name) - { - return /(Error|Exception)$/.test(class_name); - }, - script: "object.message", - template: function(message, ctx) - { - var VALUE = 2; - return ["span", message[VALUE], "class", "mono"]; - } -}; - -cls.PrettyPrinter.types[cls.PrettyPrinter.REGEXP] = -{ - type: cls.PrettyPrinter.REGEXP, - is_type: function(class_name) - { - return class_name == "RegExp"; - }, - script: "object.toString()", - template: function(message, ctx) - { - var VALUE = 2; - return ["span", message[VALUE], "class", "reg_exp mono"]; - } -}; - -cls.PrettyPrinter.prototype = new function() -{ - var SUCCESS = 0; - - this.register_types = function(list) {}; - this.unregister_types = function(list) {}; - /** - * param {Object} ctx The context to pretty print an object. The context - * must have a rt_id, an obj_id, a class_name and a callback property. - * The type and the template will be set on the context if there is an - * according type registered for the given object. - */ - this.print = function(ctx) {}; - - this.register_types = function(list) - { - if (!this._types) - this._types = []; - - list.forEach(function(type) - { - var type_obj = cls.PrettyPrinter.types[type]; - if (cls.PrettyPrinter.types.hasOwnProperty(type) && - !this._types.contains(type_obj)) - { - this._types.push(type_obj); - if (type_obj.init) - type_obj.init(); - } - }, this); - }; - - this.unregister_types = function(list) - { - list.forEach(function(type) - { - var index = this._types.indexOf(cls.PrettyPrinter.types[type]); - if (index > -1) - this._types.splice(index, 1); - }, this); - }; - - this._get_type = function(class_name) - { - for (var i = 0, type; type = this._types[i]; i++) - { - if (type.is_type(class_name)) - return type; - } - return null; - }; - - this._print_element = function(ctx) - { - var tag = tag_manager.set_callback(this, this._handle_element, [ctx]); - var msg = [ctx.obj_id, ctx.type.traversal]; - services["ecmascript-debugger"].requestInspectDom(tag, msg); - }; - - this._handle_element = function(status, message, ctx) - { - ctx.template = !status && ctx.type.template(message, ctx) - ctx.callback(ctx); - }; - - this._print_object = function(ctx) - { - var ex_ctx = window.runtimes.get_execution_context(); - var rt_id = ex_ctx.rt_id; - var thread_id = ex_ctx.thread_id; - var frame_index = ex_ctx.frame_index; - if (ctx.rt_id != rt_id) - { - rt_id = ctx.rt_id; - thread_id = 0; - frame_index = 0; - } - var tag = tagManager.set_callback(this, this._handle_object, [ctx]); - var msg = [rt_id, thread_id, frame_index, ctx.type.script, [["object", ctx.obj_id]]]; - services["ecmascript-debugger"].requestEval(tag, msg); - }; - - this._handle_object = function(status, message, ctx) - { - var STATUS = 0; - ctx.template = !status && message[STATUS] == "completed" && - ctx.type.template(message, ctx); - ctx.callback(ctx); - }; - - this._print_function = function(ctx) - { - if (ctx.script_data) - { - ctx.template = ctx.type.template(null, ctx); - ctx.callback(ctx); - } - else if (services["ecmascript-debugger"].requestGetFunctionPositions) - { - var tag = tagManager.set_callback(this, this._handle_function, [ctx]); - var msg = [ctx.rt_id, [ctx.obj_id]]; - services["ecmascript-debugger"].requestGetFunctionPositions(tag, msg); - } - else - this._print_object(ctx); - }; - - this._handle_function = function(status, message, ctx) - { - var FUNCTION_POSITION_LIST = 0; - var POSITION = 1; - var SCRIPT_ID = 0; - var LINE_NUMBER = 1; - var pos = null; - if (status === SUCCESS && - (pos = message[FUNCTION_POSITION_LIST]) && - (pos = pos[0]) && - (pos = pos[POSITION])) - { - var script = window.runtimes.getScript(pos[SCRIPT_ID]); - if (script) - { - var funcion_definition = script.get_function(pos[LINE_NUMBER]); - if (funcion_definition) - { - ctx.function_definition = funcion_definition; - ctx.script = script; - ctx.template = ctx.type.template(message, ctx); - ctx.callback(ctx); - return; - } - } - } - this._print_object(ctx); - }; - - this.print = function(ctx) - { - if (ctx.type = this._get_type(ctx.class_name)) - { - if (ctx.type.traversal) - this._print_element(ctx); - else if (ctx.type.type == cls.PrettyPrinter.FUNCTION) - this._print_function(ctx); - else - this._print_object(ctx); - } - else - ctx.callback(ctx); - }; -}; - - +"use strict"; + +window.cls || (window.cls = {}); + +cls.PrettyPrinter = function() {}; + +cls.PrettyPrinter.ELEMENT = 1; +cls.PrettyPrinter.DATE = 2; +cls.PrettyPrinter.FUNCTION = 3; +cls.PrettyPrinter.ERROR = 4; +cls.PrettyPrinter.REGEXP = 5; + +cls.PrettyPrinter.types = {}; + +/** + * Add more types here. + * A type must have an is_type function which takes a class name to check + * if a given object is of this type. + * The type must either have a script or a traversal property. The script is + * used with an Eval command to pretty print an object. The traversal is used + * with an InspectDOM command to retrieve a node. + * The type must have a template function to return a template. The template + * takes the returned message and the given ctx as arguments. + */ + +cls.PrettyPrinter.types[cls.PrettyPrinter.ELEMENT] = +{ + type: cls.PrettyPrinter.ELEMENT, + is_type: function(class_name) + { + return /Element$/.test(class_name); + }, + traversal: "node", + template: function(msg, ctx) + { + var NODE_LIST = 0; + var NODE = 0; + var NAME = 2; + var NAMESPACE = 4; + var ATTRS = 5; + var ATTR_PREFIX = 0; + var ATTR_KEY = 1; + var ATTR_VALUE = 2; + + var tmpl = []; + var node = msg[NODE_LIST] && msg[NODE_LIST][NODE]; + + if (node) + { + var force_lower_case = settings.dom.get("force-lowercase"); + var is_tree_style = settings.dom.get("dom-tree-style"); + var node_name = node[NAMESPACE] + ? node[NAMESPACE] + ":" + : ""; + node_name += node[NAME]; + if (force_lower_case) + node_name = node_name.toLowerCase(); + + if (node[ATTRS] && node[ATTRS].length) + { + tmpl.push("node", (is_tree_style ? "" : "<") + node_name + " "); + node[ATTRS].forEach(function(attr) + { + var attr_key = attr[ATTR_PREFIX] ? attr[ATTR_PREFIX] + ":" : ""; + attr_key += force_lower_case + ? attr[ATTR_KEY].toLowerCase() + : attr[ATTR_KEY]; + tmpl.push(["key", attr_key]); + tmpl.push("="); + tmpl.push(["value", "\"" + attr[ATTR_VALUE] + "\""]); + tmpl.push(" "); + }); + tmpl.pop(); + if (!is_tree_style) + tmpl.push(">"); + } + else + tmpl.push("node", is_tree_style ? node_name : "<" + node_name + ">"); + + tmpl = ["div", tmpl, "class", "dom mono"]; + } + return tmpl; + } +}; + +cls.PrettyPrinter.types[cls.PrettyPrinter.DATE] = +{ + type: cls.PrettyPrinter.DATE, + is_type: function(class_name) + { + return class_name == "Date"; + }, + script: "new Date(object.getTime() - object.getTimezoneOffset() * 1000 * 60)" + + ".toISOString().replace(\"Z\", \"\")", + template: function(message, ctx) + { + var VALUE = 2; + return ["span", message[VALUE], "class", "mono"]; + } +}; + +cls.PrettyPrinter.types[cls.PrettyPrinter.FUNCTION] = +{ + type: cls.PrettyPrinter.FUNCTION, + is_type: function(class_name) + { + return class_name == "Function"; + }, + script: "object.toString()", + template: function(message, ctx) + { + var tmpl = []; + if (ctx.script_data) + { + tmpl.push("div"); + window.templates.highlight_js_source(ctx.script_data, null, 0, tmpl); + tmpl.push("class", "tooltip-function-source"); + } + else if (ctx.function_definition) + { + var script = ctx.script; + var start_line = ctx.function_definition.start_line; + var end_line = ctx.function_definition.end_line; + var line_numbers = ["ul"]; + var lines = ["div"]; + var head = []; + var sc_link = window.templates.script_link_with_line_number(script, start_line); + if (sc_link) + { + sc_link.push("handler", "show-log-entry-source", + "data-scriptid", String(script.script_id), + "data-scriptline", String(start_line), + "data-script-endline", String(end_line)), + head = ["h2", sc_link, "class", "js-tooltip-title"]; + } + + for (var i = start_line; i <= end_line; i++) + { + var data = script.get_line(i); + var start_state = script.state_arr[i - 1]; + var line_tmpl = ["div"]; + window.templates.highlight_js_source(data, null, start_state, line_tmpl); + lines.push(line_tmpl); + var num_templ = ["li"]; + num_templ.push(["span", String(i), "class", "line-number"]); + num_templ.push(["span", "handler", "set-break-point", "class", "break-point"]); + line_numbers.push(num_templ); + } + lines.push("class", "js-source-content js-source mono"); + line_numbers.push("class", "js-source-line-numbers"); + + tmpl = ["div", + head, + ["div", + ["div", lines, line_numbers, "class", "position-relative"], + "class", "js-tooltip-examine-container mono"], + "class", "tooltip-function-source", + "data-script-id", String(script.script_id)]; + } + else + { + var VALUE = 2; + tmpl = templates.highlight_js_source(message[VALUE]); + tmpl.push("class", "pretty-printed-code mono"); + } + return tmpl; + }, + after_render: function() + { + var fn_tooltip = document.querySelector(".tooltip-function-source"); + if (fn_tooltip) + { + var line_numbers = fn_tooltip.querySelector(".js-source-line-numbers"); + var script_id = line_numbers && line_numbers.get_ancestor_attr("data-script-id"); + var script = window.runtimes.getScript(Number(script_id)); + cls.JsSourceView.update_breakpoints(script, line_numbers); + } + }, + init: function() + { + if (!this._is_initialized) + { + this._is_initialized = true; + window.messages.addListener("breakpoint-updated", this.after_render); + } + } +}; + +cls.PrettyPrinter.types[cls.PrettyPrinter.ERROR] = +{ + type: cls.PrettyPrinter.ERROR, + is_type: function(class_name) + { + return /(Error|Exception)$/.test(class_name); + }, + script: "object.message", + template: function(message, ctx) + { + var VALUE = 2; + return ["span", message[VALUE], "class", "mono"]; + } +}; + +cls.PrettyPrinter.types[cls.PrettyPrinter.REGEXP] = +{ + type: cls.PrettyPrinter.REGEXP, + is_type: function(class_name) + { + return class_name == "RegExp"; + }, + script: "object.toString()", + template: function(message, ctx) + { + var VALUE = 2; + return ["span", message[VALUE], "class", "reg_exp mono"]; + } +}; + +cls.PrettyPrinter.prototype = new function() +{ + var SUCCESS = 0; + + this.register_types = function(list) {}; + this.unregister_types = function(list) {}; + /** + * param {Object} ctx The context to pretty print an object. The context + * must have a rt_id, an obj_id, a class_name and a callback property. + * The type and the template will be set on the context if there is an + * according type registered for the given object. + */ + this.print = function(ctx) {}; + + this.register_types = function(list) + { + if (!this._types) + this._types = []; + + list.forEach(function(type) + { + var type_obj = cls.PrettyPrinter.types[type]; + if (cls.PrettyPrinter.types.hasOwnProperty(type) && + !this._types.contains(type_obj)) + { + this._types.push(type_obj); + if (type_obj.init) + type_obj.init(); + } + }, this); + }; + + this.unregister_types = function(list) + { + list.forEach(function(type) + { + var index = this._types.indexOf(cls.PrettyPrinter.types[type]); + if (index > -1) + this._types.splice(index, 1); + }, this); + }; + + this._get_type = function(class_name) + { + for (var i = 0, type; type = this._types[i]; i++) + { + if (type.is_type(class_name)) + return type; + } + return null; + }; + + this._print_element = function(ctx) + { + var tag = tag_manager.set_callback(this, this._handle_element, [ctx]); + var msg = [ctx.obj_id, ctx.type.traversal]; + services["ecmascript-debugger"].requestInspectDom(tag, msg); + }; + + this._handle_element = function(status, message, ctx) + { + ctx.template = !status && ctx.type.template(message, ctx) + ctx.callback(ctx); + }; + + this._print_object = function(ctx) + { + var ex_ctx = window.runtimes.get_execution_context(); + var rt_id = ex_ctx.rt_id; + var thread_id = ex_ctx.thread_id; + var frame_index = ex_ctx.frame_index; + if (ctx.rt_id != rt_id) + { + rt_id = ctx.rt_id; + thread_id = 0; + frame_index = 0; + } + var tag = tagManager.set_callback(this, this._handle_object, [ctx]); + var msg = [rt_id, thread_id, frame_index, ctx.type.script, [["object", ctx.obj_id]]]; + services["ecmascript-debugger"].requestEval(tag, msg); + }; + + this._handle_object = function(status, message, ctx) + { + var STATUS = 0; + ctx.template = !status && message[STATUS] == "completed" && + ctx.type.template(message, ctx); + ctx.callback(ctx); + }; + + this._print_function = function(ctx) + { + if (ctx.script_data) + { + ctx.template = ctx.type.template(null, ctx); + ctx.callback(ctx); + } + else if (services["ecmascript-debugger"].requestGetFunctionPositions) + { + var tag = tagManager.set_callback(this, this._handle_function, [ctx]); + var msg = [ctx.rt_id, [ctx.obj_id]]; + services["ecmascript-debugger"].requestGetFunctionPositions(tag, msg); + } + else + this._print_object(ctx); + }; + + this._handle_function = function(status, message, ctx) + { + var FUNCTION_POSITION_LIST = 0; + var POSITION = 1; + var SCRIPT_ID = 0; + var LINE_NUMBER = 1; + var pos = null; + if (status === SUCCESS && + (pos = message[FUNCTION_POSITION_LIST]) && + (pos = pos[0]) && + (pos = pos[POSITION])) + { + var script = window.runtimes.getScript(pos[SCRIPT_ID]); + if (script) + { + var funcion_definition = script.get_function(pos[LINE_NUMBER]); + if (funcion_definition) + { + ctx.function_definition = funcion_definition; + ctx.script = script; + ctx.template = ctx.type.template(message, ctx); + ctx.callback(ctx); + return; + } + } + } + this._print_object(ctx); + }; + + this.print = function(ctx) + { + if (ctx.type = this._get_type(ctx.class_name)) + { + if (ctx.type.traversal) + this._print_element(ctx); + else if (ctx.type.type == cls.PrettyPrinter.FUNCTION) + this._print_function(ctx); + else + this._print_object(ctx); + } + else + ctx.callback(ctx); + }; +}; + + diff --git a/src/ecma-debugger/stop_at.js b/src/ecma-debugger/stop_at.js index 854deb514..8653c5619 100644 --- a/src/ecma-debugger/stop_at.js +++ b/src/ecma-debugger/stop_at.js @@ -1,618 +1,618 @@ -window.cls || (window.cls = {}); -cls.EcmascriptDebugger || (cls.EcmascriptDebugger = {}); -cls.EcmascriptDebugger["6.0"] || (cls.EcmascriptDebugger["6.0"] = {}); - -/** - * @constructor - */ - -cls.EcmascriptDebugger["6.0"].StopAt = function() -{ - - /** - * two layers are needed. - * stop_at script must be enabled allways to be able to reasign breakpoints. - */ - - var stop_at_settings = - { - script: 1, - exception: 0, - error: 0, - abort: 0, - gc: 0, - debugger_statement: 1, - reformat_javascript: 1, - use_reformat_condition: 1, - } - - var stop_at_id_map = - { - script: 0, - exception: 1, - error: 2, - abort: 3, - gc: 4, - debugger_statement: 5, - reformat_javascript: 6, - use_reformat_condition: 7, - } - - var requires_version_map = - { - "6": [6, 13], - "7": [6, 13], - }; - - var reformat_condition = - [ - "var MAX_SLICE = 5000;", - "var LIMIT = 11;", - "var re = /\\s+/g;", - "var ws = 0;", - "var m = null;", - "var src = scriptData.slice(0, MAX_SLICE);", - "while (m = re.exec(src))", - " ws += m[0].length;", - "", - "return (100 * ws / src.length) < LIMIT;", - ].join(""); - - var self = this; - - var ecma_debugger = window.services['ecmascript-debugger']; - - var stopAt = {}; // there can be only one stop at at the time - - var runtime_id = ''; - - var callstack = []; - - var __script_ids_in_callstack = []; - - var __controls_enabled = false; - - var __is_stopped = false; - - var __stopAtId = 1; - - var __selected_frame_index = -1; - - var cur_inspection_type = ''; - - var getStopAtId = function() - { - return __stopAtId++; - } - - var _is_initial_settings_set = false; - - var onSettingChange = function(msg) - { - if(msg.id == 'js_source' ) - { - var key = msg.key; - var value = settings['js_source'].get(key); - stop_at_settings[key] = value; - var message = get_config_msg(); - ecma_debugger.requestSetConfiguration(cls.TagManager.IGNORE_RESPONSE, message); - - if (msg.key == 'reformat_javascript') - { - new ConfirmDialog(ui_strings.D_REFORMAT_SCRIPTS, - function() { window.runtimes.reloadWindow(); }).show(); - } - } - }; - - var get_config_msg = function() - { - var config_arr = []; - for (var prop in stop_at_settings) - { - var index = stop_at_id_map[prop]; - var depending = requires_version_map[index]; - if (depending && !ecma_debugger.satisfies_version.apply(ecma_debugger, depending)) - continue; - - if (prop == "script") - config_arr[index] = 1; - else if (prop == "use_reformat_condition") - config_arr[index] = stop_at_settings[prop] ? reformat_condition : ""; - else - config_arr[index] = stop_at_settings[prop] ? 1 : 0; - } - return config_arr; - }; - - this.getRuntimeId = function() - { - return runtime_id; - } - - - this.getControlsEnabled = function() - { - return __controls_enabled; - } - - this.__defineGetter__("is_stopped", function() - { - return __is_stopped; - }); - - this.__defineSetter__("is_stopped", function(){}); - - this.getFrames = function() - { - return callstack; // should be copied - } - - this.get_script_ids_in_callstack = function() - { - return __script_ids_in_callstack; - }; - - this.getFrame = function(id) - { - return callstack[id]; - } - - this.getThreadId = function() - { - return stopAt && stopAt.thread_id || ''; - } - - /** - * To get the selected frame index. - * It can return -1 which means that no frame is selected. - * Be aware that -1 is not a valid value in e.g. the Eval command. - * 0 for frame index has an overloaded meaning: if the thread id is not 0 - * it means the top frame, otherwise it means no frame. - */ - this.getSelectedFrameIndex = function() - { - return __selected_frame_index; - } - - /** - * To get the selected frame. - * @returns null or an object with runtime_id, scope_id, thread_id and index. - */ - this.getSelectedFrame = function() - { - if (__selected_frame_index > -1) - { - var frame = callstack[__selected_frame_index]; - return ( - { - runtime_id: frame.rt_id, - scope_id: frame.scope_id, - thread_id: stopAt.thread_id, - index: __selected_frame_index, - argument_id: frame.argument_id, - scope_list: frame.scope_list - }); - } - return null; - } - - var parseBacktrace = function(status, message, stop_at) - { - const - FRAME_LIST = 0, - // sub message BacktraceFrame - FUNCTION_ID = 0, - ARGUMENT_OBJECT = 1, - VARIABLE_OBJECT = 2, - THIS_OBJECT = 3, - OBJECT_VALUE = 4, - SCRIPT_ID = 5, - LINE_NUMBER = 6, - // sub message ObjectValue - OBJECT_ID = 0, - NAME = 5, - SCOPE_LIST = 7, - ARGUMENT_VALUE = 8, - THIS_VALUE = 9; - - if (status) - { - opera.postError("parseBacktrace failed scope message: " + message); - } - else - { - var _frames = message[FRAME_LIST], frame = null, i = 0; - var fn_name = '', line = '', script_id = '', argument_id = '', scope_id = ''; - var _frames_length = _frames.length; - var is_all_frames = _frames_length <= ini.max_frames; - var line_number = 0; - callstack = []; - __script_ids_in_callstack = []; - for( ; frame = _frames[i]; i++ ) - { - line_number = frame[LINE_NUMBER]; - // workaround for CORE-37771 and CORE-37798 - // line number of the top frame is sometime off by one or two lines - if (!i && typeof stop_at.line_number == 'number' && - Math.abs(line_number - stop_at.line_number) < 3) - { - line_number = stop_at.line_number; - } - callstack[i] = - { - fn_name : is_all_frames && i == _frames_length - 1 - ? ui_strings.S_GLOBAL_SCOPE_NAME - : frame[OBJECT_VALUE] && frame[OBJECT_VALUE][NAME] || - ui_strings.S_ANONYMOUS_FUNCTION_NAME, - line : line_number, - script_id : frame[SCRIPT_ID], - argument_id : frame[ARGUMENT_OBJECT], - scope_id : frame[VARIABLE_OBJECT], - this_id : frame[THIS_OBJECT], - id: i, - rt_id: stop_at.runtime_id, - scope_list: frame[SCOPE_LIST], - argument_value: frame[ARGUMENT_VALUE], - this_value: frame[THIS_VALUE], - } - __script_ids_in_callstack[i] = frame[SCRIPT_ID]; - } - - if( cur_inspection_type != 'frame' ) - { - messages.post('active-inspection-type', {inspection_type: 'frame'}); - } - messages.post('frame-selected', {frame_index: 0}); - views.callstack.update(); - if (!views.js_source.isvisible()) - { - topCell.showView(views.js_source.id); - } - var top_frame = callstack[0]; - if (views.js_source.showLine(top_frame.script_id, top_frame.line)) - { - runtimes.setSelectedScript(top_frame.script_id); - views.js_source.showLinePointer(top_frame.line, true); - } - toolbars.js_source.enableButtons('continue'); - messages.post('thread-stopped-event', {stop_at: stop_at}); - messages.post('host-state', {state: 'waiting'}); - setTimeout(function(){ __controls_enabled = true;}, 50); - } - } - - this.setInitialSettings = function() - { - if (!_is_initial_settings_set) - { - for (var prop in stop_at_settings) - { - var value = window.settings['js_source'].get(prop); - if (typeof value == "boolean") - stop_at_settings[prop] = value; - } - var msg = get_config_msg(); - ecma_debugger.requestSetConfiguration(cls.TagManager.IGNORE_RESPONSE, msg); - _is_initial_settings_set = true; - } - }; - - this.__continue = function (mode, clear_disabled_state) // - { - var tag = tag_manager.set_callback(this, - this._handle_continue, - [mode, clear_disabled_state]); - var msg = [stopAt.runtime_id, stopAt.thread_id, mode]; - services['ecmascript-debugger'].requestContinueThread(tag, msg); - } - - this.continue_thread = function (mode) // - { - if (__controls_enabled) - { - this.__continue(mode, true); - } - } - - this._handle_continue = function(status, message, mode, clear_disabled_state) - { - this._clear_stop_at_error(); - callstack = []; - __script_ids_in_callstack = []; - runtimes.setObserve(stopAt.runtime_id, mode != 'run'); - messages.post('frame-selected', {frame_index: -1}); - messages.post('thread-continue-event', {stop_at: stopAt}); - if (clear_disabled_state) - { - __controls_enabled = false; - __is_stopped = false; - toolbars.js_source.disableButtons('continue'); - } - messages.post('host-state', {state: 'ready'}); - } - - this.on_thread_cancelled = function(message) - { - const THREAD_ID = 1; - if (message[THREAD_ID] == stopAt.thread_id) - { - this._clear_stop_at_error(); - callstack = []; - __script_ids_in_callstack = []; - messages.post('frame-selected', {frame_index: -1}); - __controls_enabled = false; - __is_stopped = false; - toolbars.js_source.disableButtons('continue'); - messages.post('host-state', {state: 'ready'}); - } - }; - - this.handle = function(message) - { - const - RUNTIME_ID = 0, - THREAD_ID = 1, - SCRIPT_ID = 2, - LINE_NUMBER = 3, - STOPPED_REASON = 4, - BREAKPOINT_ID = 5, - EXCEPTION_VALUE = 6, - OBJECT_VALUE = 3, - OBJECT_ID = 0; - - stopAt = - { - runtime_id: message[RUNTIME_ID], - thread_id: message[THREAD_ID], - script_id: message[SCRIPT_ID], - line_number: message[LINE_NUMBER], - stopped_reason: message[STOPPED_REASON], - breakpoint_id: message[BREAKPOINT_ID] - }; - - if (message[EXCEPTION_VALUE]) - { - var error_obj_id = message[EXCEPTION_VALUE] && - message[EXCEPTION_VALUE][OBJECT_VALUE] && - message[EXCEPTION_VALUE][OBJECT_VALUE][OBJECT_ID]; - if (error_obj_id) - { - stopAt.error = message[EXCEPTION_VALUE]; - stopAt.error_obj_id = error_obj_id; - } - } - - var line = stopAt.line_number; - if (typeof line == 'number') - { - /** - * This event is enabled by default to reassign breakpoints. - * Here it must be checked if the user likes actually to stop or not. - * At the moment this is a hack because the stop reason is not set for that case. - * The check is if the stop reason is 'unknown' (should be 'new script') - * - * In version 6.6 and higher the stop reason is 'new script'. - */ - if (stopAt.stopped_reason == 'unknown' || - stopAt.stopped_reason == 'new script') - { - runtime_id = stopAt.runtime_id; - if (settings['js_source'].get('script') - || runtimes.getObserve(runtime_id) - // this is a workaround for Bug 328220 - // if there is a breakpoint at the first statement of a script - // the event for stop at new script and the stop at breakpoint are the same - || this._bps.script_has_breakpoint_on_line(stopAt.script_id, line)) - { - this._stop_in_script(stopAt); - } - else - { - this.__continue('run'); - } - } - else - { - /* - example - - "runtime_id":2, - "thread_id":7, - "script_id":3068, - "line_number":8, - "stopped_reason":"breakpoint", - "breakpoint_id":1 - - */ - var condition = this._bps.get_condition(stopAt.breakpoint_id); - if (condition) - { - var tag = tagManager.set_callback(this, - this._handle_condition, - [stopAt]); - var msg = [stopAt.runtime_id, - stopAt.thread_id, - 0, - "Boolean(" + condition + ")", - [['dummy', 0]]]; - services['ecmascript-debugger'].requestEval(tag, msg); - } - else - { - this._stop_in_script(stopAt); - } - } - } - else - { - opera.postError('not a line number: ' + stopAt.line_number + '\n' + - JSON.stringify(stopAt)) - } - } - - this._handle_condition = function(status, message, stop_at) - { - const STATUS = 0, TYPE = 1, VALUE = 2; - if (status) - { - opera.postError('Evaling breakpoint condition failed'); - this.__continue('run'); - } - else if(message[STATUS] == "completed" && - message[TYPE] == "boolean" && - message[VALUE] == "true") - { - this._stop_in_script(stop_at); - } - else - { - this.__continue('run'); - } - }; - - this._handle_error = function(status, message, stop_at) - { - if (status) - { - opera.postError(ui_strings.S_DRAGONFLY_INFO_MESSAGE + - " error inspection failed in StopAt handle_error"); - } - else - { - const - OBJECT_CHAIN_LIST = 0, - OBJECT_LIST = 0, - OBJECT_VALUE = 0, - CLASS_NAME = 4, - PROPERTY_LIST = 1, - OBJECT_ID = 0, - PROP_OBJECT_VALUE = 3, - NAME = 0, - STRING = 2; - - var error = message && - (message = message[OBJECT_CHAIN_LIST]) && - (message = message[0]) && - (message = message[OBJECT_LIST]) && - message[0]; - if (error) - { - stop_at.error_class = error[OBJECT_VALUE] && - error[OBJECT_VALUE][CLASS_NAME] || "Error"; - var props = error[PROPERTY_LIST]; - if (props) - { - for (var i = 0, prop; prop = props[i]; i++) - { - if (prop[NAME] == "message") - stop_at.error_message = prop[STRING]; - } - } - - var script = window.runtimes.getScript(stop_at.script_id); - if (script) - { - script.stop_at_error = stop_at; - window.views.js_source.show_stop_at_error(); - } - } - } - }; - - this._clear_stop_at_error = function() - { - if (stopAt.error) - { - var script = window.runtimes.getScript(stopAt.script_id); - if (script) - script.stop_at_error = null; - window.views.js_source.clear_stop_at_error(); - } - }; - - this._stop_in_script = function(stop_at) - { - __is_stopped = true; - var tag = tagManager.set_callback(null, parseBacktrace, [stop_at]); - var msg = [stop_at.runtime_id, stop_at.thread_id, ini.max_frames]; - services['ecmascript-debugger'].requestGetBacktrace(tag, msg); - if (stop_at.error) - { - var tag = tagManager.set_callback(this, this._handle_error, [stop_at]); - var msg = [stop_at.runtime_id, [stop_at.error_obj_id], 0, 0, 0]; - window.services['ecmascript-debugger'].requestExamineObjects(tag, msg); - } - } - - var onRuntimeDestroyed = function(msg) - { - if( stopAt && stopAt.runtime_id == msg.id ) - { - views.callstack.clearView(); - views.inspection.clearView(); - self.__continue('run'); - } - - }; - - this._on_profile_disabled = function(msg) - { - if (msg.profile == window.app.profiles.DEFAULT) - { - this._clear_stop_at_error(); - callstack = []; - __script_ids_in_callstack = []; - window.views.js_source.clearLinePointer(); - window.views.callstack.clearView(); - window.views.inspection.clearView(); - window.messages.post('frame-selected', {frame_index: -1}); - window.messages.post('thread-continue-event', {stop_at: stopAt}); - __controls_enabled = false; - __is_stopped = false; - window.toolbars.js_source.disableButtons('continue'); - window.messages.post('host-state', {state: 'ready'}); - } - }; - - messages.addListener('runtime-destroyed', onRuntimeDestroyed); - messages.addListener('profile-disabled', this._on_profile_disabled.bind(this)); - - var onActiveInspectionType = function(msg) - { - cur_inspection_type = msg.inspection_type; - } - - var onFrameSelected = function(msg) - { - __selected_frame_index = msg.frame_index; - } - - this._bps = cls.Breakpoints.get_instance(); - - messages.addListener('active-inspection-type', onActiveInspectionType); - - - - messages.addListener('setting-changed', onSettingChange); - messages.addListener('frame-selected', onFrameSelected); - - this.bind = function(ecma_debugger) - { - var self = this; - - ecma_debugger.handleSetConfiguration = - ecma_debugger.handleContinueThread = - function(status, message){}; - - - ecma_debugger.addListener('enable-success', function() - { - self.setInitialSettings(); - }); - } - - this._bps = window.cls.Breakpoints.get_instance(); - - -} +window.cls || (window.cls = {}); +cls.EcmascriptDebugger || (cls.EcmascriptDebugger = {}); +cls.EcmascriptDebugger["6.0"] || (cls.EcmascriptDebugger["6.0"] = {}); + +/** + * @constructor + */ + +cls.EcmascriptDebugger["6.0"].StopAt = function() +{ + + /** + * two layers are needed. + * stop_at script must be enabled allways to be able to reasign breakpoints. + */ + + var stop_at_settings = + { + script: 1, + exception: 0, + error: 0, + abort: 0, + gc: 0, + debugger_statement: 1, + reformat_javascript: 1, + use_reformat_condition: 1, + } + + var stop_at_id_map = + { + script: 0, + exception: 1, + error: 2, + abort: 3, + gc: 4, + debugger_statement: 5, + reformat_javascript: 6, + use_reformat_condition: 7, + } + + var requires_version_map = + { + "6": [6, 13], + "7": [6, 13], + }; + + var reformat_condition = + [ + "var MAX_SLICE = 5000;", + "var LIMIT = 11;", + "var re = /\\s+/g;", + "var ws = 0;", + "var m = null;", + "var src = scriptData.slice(0, MAX_SLICE);", + "while (m = re.exec(src))", + " ws += m[0].length;", + "", + "return (100 * ws / src.length) < LIMIT;", + ].join(""); + + var self = this; + + var ecma_debugger = window.services['ecmascript-debugger']; + + var stopAt = {}; // there can be only one stop at at the time + + var runtime_id = ''; + + var callstack = []; + + var __script_ids_in_callstack = []; + + var __controls_enabled = false; + + var __is_stopped = false; + + var __stopAtId = 1; + + var __selected_frame_index = -1; + + var cur_inspection_type = ''; + + var getStopAtId = function() + { + return __stopAtId++; + } + + var _is_initial_settings_set = false; + + var onSettingChange = function(msg) + { + if(msg.id == 'js_source' ) + { + var key = msg.key; + var value = settings['js_source'].get(key); + stop_at_settings[key] = value; + var message = get_config_msg(); + ecma_debugger.requestSetConfiguration(cls.TagManager.IGNORE_RESPONSE, message); + + if (msg.key == 'reformat_javascript') + { + new ConfirmDialog(ui_strings.D_REFORMAT_SCRIPTS, + function() { window.runtimes.reloadWindow(); }).show(); + } + } + }; + + var get_config_msg = function() + { + var config_arr = []; + for (var prop in stop_at_settings) + { + var index = stop_at_id_map[prop]; + var depending = requires_version_map[index]; + if (depending && !ecma_debugger.satisfies_version.apply(ecma_debugger, depending)) + continue; + + if (prop == "script") + config_arr[index] = 1; + else if (prop == "use_reformat_condition") + config_arr[index] = stop_at_settings[prop] ? reformat_condition : ""; + else + config_arr[index] = stop_at_settings[prop] ? 1 : 0; + } + return config_arr; + }; + + this.getRuntimeId = function() + { + return runtime_id; + } + + + this.getControlsEnabled = function() + { + return __controls_enabled; + } + + this.__defineGetter__("is_stopped", function() + { + return __is_stopped; + }); + + this.__defineSetter__("is_stopped", function(){}); + + this.getFrames = function() + { + return callstack; // should be copied + } + + this.get_script_ids_in_callstack = function() + { + return __script_ids_in_callstack; + }; + + this.getFrame = function(id) + { + return callstack[id]; + } + + this.getThreadId = function() + { + return stopAt && stopAt.thread_id || ''; + } + + /** + * To get the selected frame index. + * It can return -1 which means that no frame is selected. + * Be aware that -1 is not a valid value in e.g. the Eval command. + * 0 for frame index has an overloaded meaning: if the thread id is not 0 + * it means the top frame, otherwise it means no frame. + */ + this.getSelectedFrameIndex = function() + { + return __selected_frame_index; + } + + /** + * To get the selected frame. + * @returns null or an object with runtime_id, scope_id, thread_id and index. + */ + this.getSelectedFrame = function() + { + if (__selected_frame_index > -1) + { + var frame = callstack[__selected_frame_index]; + return ( + { + runtime_id: frame.rt_id, + scope_id: frame.scope_id, + thread_id: stopAt.thread_id, + index: __selected_frame_index, + argument_id: frame.argument_id, + scope_list: frame.scope_list + }); + } + return null; + } + + var parseBacktrace = function(status, message, stop_at) + { + const + FRAME_LIST = 0, + // sub message BacktraceFrame + FUNCTION_ID = 0, + ARGUMENT_OBJECT = 1, + VARIABLE_OBJECT = 2, + THIS_OBJECT = 3, + OBJECT_VALUE = 4, + SCRIPT_ID = 5, + LINE_NUMBER = 6, + // sub message ObjectValue + OBJECT_ID = 0, + NAME = 5, + SCOPE_LIST = 7, + ARGUMENT_VALUE = 8, + THIS_VALUE = 9; + + if (status) + { + opera.postError("parseBacktrace failed scope message: " + message); + } + else + { + var _frames = message[FRAME_LIST], frame = null, i = 0; + var fn_name = '', line = '', script_id = '', argument_id = '', scope_id = ''; + var _frames_length = _frames.length; + var is_all_frames = _frames_length <= ini.max_frames; + var line_number = 0; + callstack = []; + __script_ids_in_callstack = []; + for( ; frame = _frames[i]; i++ ) + { + line_number = frame[LINE_NUMBER]; + // workaround for CORE-37771 and CORE-37798 + // line number of the top frame is sometime off by one or two lines + if (!i && typeof stop_at.line_number == 'number' && + Math.abs(line_number - stop_at.line_number) < 3) + { + line_number = stop_at.line_number; + } + callstack[i] = + { + fn_name : is_all_frames && i == _frames_length - 1 + ? ui_strings.S_GLOBAL_SCOPE_NAME + : frame[OBJECT_VALUE] && frame[OBJECT_VALUE][NAME] || + ui_strings.S_ANONYMOUS_FUNCTION_NAME, + line : line_number, + script_id : frame[SCRIPT_ID], + argument_id : frame[ARGUMENT_OBJECT], + scope_id : frame[VARIABLE_OBJECT], + this_id : frame[THIS_OBJECT], + id: i, + rt_id: stop_at.runtime_id, + scope_list: frame[SCOPE_LIST], + argument_value: frame[ARGUMENT_VALUE], + this_value: frame[THIS_VALUE], + } + __script_ids_in_callstack[i] = frame[SCRIPT_ID]; + } + + if( cur_inspection_type != 'frame' ) + { + messages.post('active-inspection-type', {inspection_type: 'frame'}); + } + messages.post('frame-selected', {frame_index: 0}); + views.callstack.update(); + if (!views.js_source.isvisible()) + { + topCell.showView(views.js_source.id); + } + var top_frame = callstack[0]; + if (views.js_source.showLine(top_frame.script_id, top_frame.line)) + { + runtimes.setSelectedScript(top_frame.script_id); + views.js_source.showLinePointer(top_frame.line, true); + } + toolbars.js_source.enableButtons('continue'); + messages.post('thread-stopped-event', {stop_at: stop_at}); + messages.post('host-state', {state: 'waiting'}); + setTimeout(function(){ __controls_enabled = true;}, 50); + } + } + + this.setInitialSettings = function() + { + if (!_is_initial_settings_set) + { + for (var prop in stop_at_settings) + { + var value = window.settings['js_source'].get(prop); + if (typeof value == "boolean") + stop_at_settings[prop] = value; + } + var msg = get_config_msg(); + ecma_debugger.requestSetConfiguration(cls.TagManager.IGNORE_RESPONSE, msg); + _is_initial_settings_set = true; + } + }; + + this.__continue = function (mode, clear_disabled_state) // + { + var tag = tag_manager.set_callback(this, + this._handle_continue, + [mode, clear_disabled_state]); + var msg = [stopAt.runtime_id, stopAt.thread_id, mode]; + services['ecmascript-debugger'].requestContinueThread(tag, msg); + } + + this.continue_thread = function (mode) // + { + if (__controls_enabled) + { + this.__continue(mode, true); + } + } + + this._handle_continue = function(status, message, mode, clear_disabled_state) + { + this._clear_stop_at_error(); + callstack = []; + __script_ids_in_callstack = []; + runtimes.setObserve(stopAt.runtime_id, mode != 'run'); + messages.post('frame-selected', {frame_index: -1}); + messages.post('thread-continue-event', {stop_at: stopAt}); + if (clear_disabled_state) + { + __controls_enabled = false; + __is_stopped = false; + toolbars.js_source.disableButtons('continue'); + } + messages.post('host-state', {state: 'ready'}); + } + + this.on_thread_cancelled = function(message) + { + const THREAD_ID = 1; + if (message[THREAD_ID] == stopAt.thread_id) + { + this._clear_stop_at_error(); + callstack = []; + __script_ids_in_callstack = []; + messages.post('frame-selected', {frame_index: -1}); + __controls_enabled = false; + __is_stopped = false; + toolbars.js_source.disableButtons('continue'); + messages.post('host-state', {state: 'ready'}); + } + }; + + this.handle = function(message) + { + const + RUNTIME_ID = 0, + THREAD_ID = 1, + SCRIPT_ID = 2, + LINE_NUMBER = 3, + STOPPED_REASON = 4, + BREAKPOINT_ID = 5, + EXCEPTION_VALUE = 6, + OBJECT_VALUE = 3, + OBJECT_ID = 0; + + stopAt = + { + runtime_id: message[RUNTIME_ID], + thread_id: message[THREAD_ID], + script_id: message[SCRIPT_ID], + line_number: message[LINE_NUMBER], + stopped_reason: message[STOPPED_REASON], + breakpoint_id: message[BREAKPOINT_ID] + }; + + if (message[EXCEPTION_VALUE]) + { + var error_obj_id = message[EXCEPTION_VALUE] && + message[EXCEPTION_VALUE][OBJECT_VALUE] && + message[EXCEPTION_VALUE][OBJECT_VALUE][OBJECT_ID]; + if (error_obj_id) + { + stopAt.error = message[EXCEPTION_VALUE]; + stopAt.error_obj_id = error_obj_id; + } + } + + var line = stopAt.line_number; + if (typeof line == 'number') + { + /** + * This event is enabled by default to reassign breakpoints. + * Here it must be checked if the user likes actually to stop or not. + * At the moment this is a hack because the stop reason is not set for that case. + * The check is if the stop reason is 'unknown' (should be 'new script') + * + * In version 6.6 and higher the stop reason is 'new script'. + */ + if (stopAt.stopped_reason == 'unknown' || + stopAt.stopped_reason == 'new script') + { + runtime_id = stopAt.runtime_id; + if (settings['js_source'].get('script') + || runtimes.getObserve(runtime_id) + // this is a workaround for Bug 328220 + // if there is a breakpoint at the first statement of a script + // the event for stop at new script and the stop at breakpoint are the same + || this._bps.script_has_breakpoint_on_line(stopAt.script_id, line)) + { + this._stop_in_script(stopAt); + } + else + { + this.__continue('run'); + } + } + else + { + /* + example + + "runtime_id":2, + "thread_id":7, + "script_id":3068, + "line_number":8, + "stopped_reason":"breakpoint", + "breakpoint_id":1 + + */ + var condition = this._bps.get_condition(stopAt.breakpoint_id); + if (condition) + { + var tag = tagManager.set_callback(this, + this._handle_condition, + [stopAt]); + var msg = [stopAt.runtime_id, + stopAt.thread_id, + 0, + "Boolean(" + condition + ")", + [['dummy', 0]]]; + services['ecmascript-debugger'].requestEval(tag, msg); + } + else + { + this._stop_in_script(stopAt); + } + } + } + else + { + opera.postError('not a line number: ' + stopAt.line_number + '\n' + + JSON.stringify(stopAt)) + } + } + + this._handle_condition = function(status, message, stop_at) + { + const STATUS = 0, TYPE = 1, VALUE = 2; + if (status) + { + opera.postError('Evaling breakpoint condition failed'); + this.__continue('run'); + } + else if(message[STATUS] == "completed" && + message[TYPE] == "boolean" && + message[VALUE] == "true") + { + this._stop_in_script(stop_at); + } + else + { + this.__continue('run'); + } + }; + + this._handle_error = function(status, message, stop_at) + { + if (status) + { + opera.postError(ui_strings.S_DRAGONFLY_INFO_MESSAGE + + " error inspection failed in StopAt handle_error"); + } + else + { + const + OBJECT_CHAIN_LIST = 0, + OBJECT_LIST = 0, + OBJECT_VALUE = 0, + CLASS_NAME = 4, + PROPERTY_LIST = 1, + OBJECT_ID = 0, + PROP_OBJECT_VALUE = 3, + NAME = 0, + STRING = 2; + + var error = message && + (message = message[OBJECT_CHAIN_LIST]) && + (message = message[0]) && + (message = message[OBJECT_LIST]) && + message[0]; + if (error) + { + stop_at.error_class = error[OBJECT_VALUE] && + error[OBJECT_VALUE][CLASS_NAME] || "Error"; + var props = error[PROPERTY_LIST]; + if (props) + { + for (var i = 0, prop; prop = props[i]; i++) + { + if (prop[NAME] == "message") + stop_at.error_message = prop[STRING]; + } + } + + var script = window.runtimes.getScript(stop_at.script_id); + if (script) + { + script.stop_at_error = stop_at; + window.views.js_source.show_stop_at_error(); + } + } + } + }; + + this._clear_stop_at_error = function() + { + if (stopAt.error) + { + var script = window.runtimes.getScript(stopAt.script_id); + if (script) + script.stop_at_error = null; + window.views.js_source.clear_stop_at_error(); + } + }; + + this._stop_in_script = function(stop_at) + { + __is_stopped = true; + var tag = tagManager.set_callback(null, parseBacktrace, [stop_at]); + var msg = [stop_at.runtime_id, stop_at.thread_id, ini.max_frames]; + services['ecmascript-debugger'].requestGetBacktrace(tag, msg); + if (stop_at.error) + { + var tag = tagManager.set_callback(this, this._handle_error, [stop_at]); + var msg = [stop_at.runtime_id, [stop_at.error_obj_id], 0, 0, 0]; + window.services['ecmascript-debugger'].requestExamineObjects(tag, msg); + } + } + + var onRuntimeDestroyed = function(msg) + { + if( stopAt && stopAt.runtime_id == msg.id ) + { + views.callstack.clearView(); + views.inspection.clearView(); + self.__continue('run'); + } + + }; + + this._on_profile_disabled = function(msg) + { + if (msg.profile == window.app.profiles.DEFAULT) + { + this._clear_stop_at_error(); + callstack = []; + __script_ids_in_callstack = []; + window.views.js_source.clearLinePointer(); + window.views.callstack.clearView(); + window.views.inspection.clearView(); + window.messages.post('frame-selected', {frame_index: -1}); + window.messages.post('thread-continue-event', {stop_at: stopAt}); + __controls_enabled = false; + __is_stopped = false; + window.toolbars.js_source.disableButtons('continue'); + window.messages.post('host-state', {state: 'ready'}); + } + }; + + messages.addListener('runtime-destroyed', onRuntimeDestroyed); + messages.addListener('profile-disabled', this._on_profile_disabled.bind(this)); + + var onActiveInspectionType = function(msg) + { + cur_inspection_type = msg.inspection_type; + } + + var onFrameSelected = function(msg) + { + __selected_frame_index = msg.frame_index; + } + + this._bps = cls.Breakpoints.get_instance(); + + messages.addListener('active-inspection-type', onActiveInspectionType); + + + + messages.addListener('setting-changed', onSettingChange); + messages.addListener('frame-selected', onFrameSelected); + + this.bind = function(ecma_debugger) + { + var self = this; + + ecma_debugger.handleSetConfiguration = + ecma_debugger.handleContinueThread = + function(status, message){}; + + + ecma_debugger.addListener('enable-success', function() + { + self.setInitialSettings(); + }); + } + + this._bps = window.cls.Breakpoints.get_instance(); + + +} diff --git a/src/ecma-debugger/templates.js b/src/ecma-debugger/templates.js index d93256732..d426c2839 100644 --- a/src/ecma-debugger/templates.js +++ b/src/ecma-debugger/templates.js @@ -1,552 +1,552 @@ -;(function() -{ - var self = this; - this.hello = function(enviroment) - { - var ret = ["ul"]; - var prop = ""; - var prop_dict = - { - "stpVersion": ui_strings.S_TEXT_ENVIRONMENT_PROTOCOL_VERSION, - "coreVersion": "Core Version", - "operatingSystem": ui_strings.S_TEXT_ENVIRONMENT_OPERATING_SYSTEM, - "platform": ui_strings.S_TEXT_ENVIRONMENT_PLATFORM, - "userAgent": ui_strings.S_TEXT_ENVIRONMENT_USER_AGENT - } - for( prop in prop_dict) - { - ret[ret.length] = ["li", prop_dict[prop] + ": " + enviroment[prop]]; - } - if( ini.revision_number.indexOf("$") != -1 && ini.mercurial_revision ) - { - ini.revision_number = ini.mercurial_revision; - } - ret[ret.length] = ["li", ui_strings.S_TEXT_ENVIRONMENT_DRAGONFLY_VERSION + ": " + ini.dragonfly_version]; - ret[ret.length] = ["li", ui_strings.S_TEXT_ENVIRONMENT_REVISION_NUMBER + ": " + ini.revision_number]; - ret.push("class", "selectable"); - return ["div", ret, "class", "padding"]; - } - - this.runtime_dropdown = function(runtimes) - { - return runtimes.map(this.runtime, this); - } - - this.runtime = function(runtime) - { - var option = ["cst-option", runtime.title, "rt-id", String(runtime.id)]; - if (runtime.title_attr) - option.push("title", runtime.title_attr); - var ret = [option]; - if (runtime.extensions && runtime.extensions.length) - ret.push(["cst-group", runtime.extensions.map(this.runtime, this)]); - return ret; - } - - this.script_dropdown = function(select_id, runtimes, stopped_script_id, selected_script_id) - { - var option_list = this.script_dropdown_options(select_id, - runtimes, - stopped_script_id, - selected_script_id); - return [["div", - ["div", - ["input", "type", "text", - "handler", select_id + "-filter", - "shortcuts", select_id + "-filter", - "class", "js-dd-filter"], - "class", "js-dd-filter-container"], - ["span", "class", "js-dd-clear-filter", - "handler", "js-dd-clear-filter"], - "class", "js-dd-filter-bar"], - option_list]; - }; - - this.script_dropdown_options = function(select_id, runtimes, stopped_script_id, - selected_script_id, search_term) - { - var script_list = ["div"]; - if (runtimes && runtimes.length) - { - for (var i = 0, rt; rt = runtimes[i]; i++) - { - script_list.push(this.runtime_script(rt, stopped_script_id, - selected_script_id, search_term)); - } - } - script_list.push("class", "js-dd-script-list", - "handler", "js-dd-move-highlight"); - return script_list; - }; - - this.runtime_script = function(runtime, stopped_script_id, - selected_script_id, search_term) - { - // search_term only applies to .js-dd-s-scope - var ret = []; - var script_uri_paths = new HashMap(); - var inline_and_evals = []; - var title = ["cst-title", runtime.title]; - var class_name = runtime.type == "extension" - ? "js-dd-ext-runtime" - : "js-dd-runtime"; - - title.push("class", class_name + (runtime.selected ? " selected-runtime" : "")); - - if (runtime.title != runtime.uri) - title.push("title", runtime.uri); - - runtime.scripts.forEach(function(script) - { - var ret_script = this.script_option(script, - stopped_script_id, - selected_script_id, - search_term); - if (ret_script) - { - if (script.script_type === "linked") - { - var root_uri = this._uri_path(runtime, script, search_term); - if (script_uri_paths[root_uri]) - script_uri_paths[root_uri].push(ret_script); - else - script_uri_paths[root_uri] = [ret_script]; - } - else - inline_and_evals.push(ret_script); - } - - }, this); - - var script_list = []; - Object.getOwnPropertyNames(script_uri_paths).sort().forEach(function(uri) - { - var group = ["div"]; - if (uri != "./") - group.push(["cst-title", uri, "class", "js-dd-dir-path"]); - - group.extend(script_uri_paths[uri]); - group.push("class", "js-dd-group js-dd-s-scope"); - ret.push(group); - }); - - if (inline_and_evals.length) - { - if (runtime.type == "extension") - { - ret.push(["div", inline_and_evals, "class", "js-dd-group js-dd-s-scope"]); - } - else - { - var group = ["div"]; - group.push(["cst-title", - ui_strings.S_SCRIPT_SELECT_SECTION_INLINE_AND_EVALS, - "class", "js-dd-dir-path"]); - - group.extend(inline_and_evals); - group.push("class", "js-dd-group"); - ret.push(group); - } - } - - if (runtime.type != "extension") - { - if (runtime.browser_js || (runtime.user_js_s && runtime.user_js_s.length)) - { - var scripts = []; - var sc_op = null; - if (runtime.browser_js) - { - sc_op = this.script_option(runtime.browser_js, stopped_script_id, - selected_script_id, search_term); - if (sc_op) - scripts.push(sc_op); - } - - if (runtime.user_js_s) - { - for (var i = 0, script; script = runtime.user_js_s[i]; i++) - { - sc_op = this.script_option(script, stopped_script_id, - selected_script_id, search_term) - if (sc_op) - scripts.push(sc_op); - } - } - - if (scripts.length) - { - ret.push(["div", - ["cst-title", - ui_strings.S_SCRIPT_SELECT_SECTION_BROWSER_AND_USER_JS, - "class", "js-dd-dir-path"], - ["div", scripts, "class", "js-dd-s-scope"], - "class", "js-dd-group"]); - } - } - - if (runtime.extensions) - { - for (var i = 0, rt; rt = runtime.extensions[i]; i++) - { - var ext_scripts = this.runtime_script(rt, stopped_script_id, - selected_script_id, search_term) - if (ext_scripts.length) - ret.push(ext_scripts); - } - } - } - - if (ret.length) - ret.unshift(title); - - return ret; - } - - this._uri_path = function(runtime, script, search_term) - { - var uri_path = script.abs_dir; - - if (script.abs_dir.indexOf(runtime.abs_dir) == 0 && - (!search_term || !runtime.abs_dir.contains(search_term))) - uri_path = "./" + script.abs_dir.slice(runtime.abs_dir.length); - else if (script.origin == runtime.origin && - (!search_term || !(script.origin.contains(search_term)))) - uri_path = script.dir_pathname; - - return uri_path; - }; - - // script types in the protocol: - // "inline", "event", "linked", "timeout", - // "java", "generated", "unknown" - // "Greasemonkey JS", "Browser JS", "User JS", "Extension JS" - this._script_type_map = - { - "inline": ui_strings.S_TEXT_ECMA_SCRIPT_TYPE_INLINE, - "linked": ui_strings.S_TEXT_ECMA_SCRIPT_TYPE_LINKED, - "unknown": ui_strings.S_TEXT_ECMA_SCRIPT_TYPE_UNKNOWN - }; - - this.script_option = function(script, stopped_script_id, - selected_script_id, search_term) - { - var script_type = this._script_type_map[script.script_type] || - script.script_type; - var ret = null; - - if (search_term && - !((script.uri && script.uri.toLowerCase().contains(search_term)) || - (!script.uri && script_type.toLowerCase().contains(search_term)))) - return ret; - - if (script.uri) - { - var is_linked = script.script_type == "linked"; - ret = ["cst-option", - ["span", - script.filename, - "data-tooltip", is_linked && "js-script-select", - "data-tooltip-text", is_linked && script.uri]]; - - if (script.search) - ret.push(["span", script.search, "class", "js-dd-scr-query"]); - - if (script.hash) - ret.push(["span", script.query, "class", "js-dd-scr-hash"]); - - ret.push("script-id", script.script_id.toString()); - } - else - { - var code_snippet = script.script_data.slice(0, 360) - .replace(/\s+/g, " ").slice(0, 120); - ret = ["cst-option", - ["span", script_type.capitalize(true), "class", "js-dd-s-scope"], - " – ", - ["code", code_snippet, "class", "code-snippet"], - "script-id", script.script_id.toString()]; - } - - var class_name = script.script_id == selected_script_id - ? "selected" - : ""; - - if (stopped_script_id == script.script_id) - class_name += (class_name ? " " : "") + "stopped"; - - if (class_name) - ret.push("class", class_name); - - return ret; - }; - - this.runtime_dom = function(runtime) - { - var display_uri = runtime["title"] || helpers.shortenURI(runtime.uri).uri; - return ( - [ - "cst-option", - runtime["title"] || runtime.uri, - "runtime-id", runtime.runtime_id.toString() - ].concat( dom_data.getDataRuntimeId() == runtime.runtime_id ? ["class", "selected"] : [] ). - concat( display_uri != runtime.uri ? ["title", runtime.uri] : [] ) ) - } - - this.frame = function(frame, is_top) - { - // Fall back to document URI if it's inline - var uri = frame.script_id && runtimes.getScript(frame.script_id) - ? (runtimes.getScript(frame.script_id).uri || runtimes.getRuntime(frame.rt_id).uri) - : null; - return ["li", - ["span", frame.fn_name, "class", "scope-name"], - ["span", - " " + (uri && frame.line ? helpers.basename(uri) + ":" + frame.line : ""), - "class", "file-line"], - "handler", "show-frame", - "ref-id", String(frame.id), - "title", uri - ].concat( is_top ? ["class", "selected"] : [] ); - } - - this.configStopAt = function(config) - { - var ret =["ul"]; - var arr = ["script", "exception", "error", "abort"], n="", i=0; - for( ; n = arr[i]; i++) - { - ret[ret.length] = this.checkbox(n, config[n]); - } - return ["div"].concat([ret]); - } - - this.breakpoint = function(line_nr, top) - { - return ["li", - "class", "breakpoint", - "line_nr", line_nr, - "style", "top:"+ top +"px" - ] - } - - this.breadcrumb = function(model, obj_id, parent_node_chain, target_id, show_combinator) - { - var setting = window.settings.dom; - var css_path = model._get_css_path(obj_id, parent_node_chain, - setting.get("force-lowercase"), - setting.get("show-id_and_classes-in-breadcrumb"), - setting.get("show-siblings-in-breadcrumb")); - var ret = []; - target_id || (target_id = obj_id) - if (css_path) - { - for (var i = 0; i < css_path.length; i++ ) - { - ret[ret.length] = - [ - "breadcrumb", css_path[i].name, - "ref-id", css_path[i].id.toString(), - "handler", "breadcrumb-link", - "data-menu", "breadcrumb", - "class", (css_path[i].is_parent_offset ? "parent-offset" : "") + - (css_path[i].id == target_id ? " active" : ""), - ]; - if (show_combinator) - { - ret[ret.length] = " " + css_path[i].combinator + " "; - } - } - } - return ret; - } - - this.uiLangOptions = function(lang_dict) - { - var dict = - [ - { - browserLanguge: "be", - key: "be", - name: "Беларуская" - }, - { - browserLanguge: "bg", - key: "bg", - name: "Български" - }, - { - browserLanguge: "cs", - key: "cs", - name: "Česky" - }, - { - browserLanguge: "de", - key: "de", - name: "Deutsch" - }, - { - browserLanguge: "en", - key: "en", - name: "U.S. English" - }, - { - browserLanguge: "en-GB", - key: "en-GB", - name: "British English" - }, - { - browserLanguge: "es-ES", - key: "es-ES", - name: "Español (España)" - }, - { - browserLanguge: "es-LA", - key: "es-LA", - name: "Español (Latinoamérica)" - }, - { - browserLanguge: "et", - key: "et", - name: "Eesti keel" - }, - { - browserLanguge: "fr", - key: "fr", - name: "Français" - }, - { - browserLanguge: "fr-CA", - key: "fr-CA", - name: "Français Canadien" - }, - { - browserLanguge: "fy", - key: "fy", - name: "Frysk" - }, - { - browserLanguge: "gd", - key: "gd", - name: "Gàidhlig" - }, - { - browserLanguge: "hu", - key: "hu", - name: "Magyar" - }, - { - browserLanguge: "id", - key: "id", - name: "Bahasa Indonesia" - }, - { - browserLanguge: "it", - key: "it", - name: "Italiano" - }, - { - browserLanguge: "ja", - key: "ja", - name: "日本語" - }, - { - browserLanguge: "ka", - key: "ka", - name: "ქართული" - }, - { - browserLanguge: "mk", - key: "mk", - name: "македонски јазик" - }, - { - browserLanguge: "nb", - key: "nb", - name: "Norsk bokmål" - }, - { - browserLanguge: "nl", - key: "nl", - name: "Nederlands" - }, - { - browserLanguge: "nn", - key: "nn", - name: "Norsk nynorsk" - }, - { - browserLanguge: "pl", - key: "pl", - name: "Polski" - }, - { - browserLanguge: "pt", - key: "pt", - name: "Português" - }, - { - browserLanguge: "pt-BR", - key: "pt-BR", - name: "Português (Brasil)" - }, - { - browserLanguge: "ro", - key: "ro", - name: "Română" - }, - { - browserLanguge: "ru", - key: "ru", - name: "Русский язык" - }, - { - browserLanguge: "sk", - key: "sk", - name: "Slovenčina" - }, - { - browserLanguge: "sr", - key: "sr", - name: "српски" - }, - { - browserLanguge: "sv", - key: "sv", - name: "Svenska" - }, - { - browserLanguge: "tr", - key: "tr", - name: "Türkçe" - }, - { - browserLanguge: "uk", - key: "uk", - name: "Українська" - }, - { - browserLanguge: "zh-cn", - key: "zh-cn", - name: "简体中文" - }, - { - browserLanguge: "zh-tw", - key: "zh-tw", - name: "繁體中文" - } - ], - lang = null, - i = 0, - selected_lang = window.ui_strings.lang_code, - ret = []; - - for( ; lang = dict[i]; i++) - { - ret[ret.length] = ["option", lang.name, "value", lang.key]. - concat(selected_lang == lang.key ? ["selected", "selected"] : []); - } - return ret; - } - -}).apply(window.templates || (window.templates = {})); +;(function() +{ + var self = this; + this.hello = function(enviroment) + { + var ret = ["ul"]; + var prop = ""; + var prop_dict = + { + "stpVersion": ui_strings.S_TEXT_ENVIRONMENT_PROTOCOL_VERSION, + "coreVersion": "Core Version", + "operatingSystem": ui_strings.S_TEXT_ENVIRONMENT_OPERATING_SYSTEM, + "platform": ui_strings.S_TEXT_ENVIRONMENT_PLATFORM, + "userAgent": ui_strings.S_TEXT_ENVIRONMENT_USER_AGENT + } + for( prop in prop_dict) + { + ret[ret.length] = ["li", prop_dict[prop] + ": " + enviroment[prop]]; + } + if( ini.revision_number.indexOf("$") != -1 && ini.mercurial_revision ) + { + ini.revision_number = ini.mercurial_revision; + } + ret[ret.length] = ["li", ui_strings.S_TEXT_ENVIRONMENT_DRAGONFLY_VERSION + ": " + ini.dragonfly_version]; + ret[ret.length] = ["li", ui_strings.S_TEXT_ENVIRONMENT_REVISION_NUMBER + ": " + ini.revision_number]; + ret.push("class", "selectable"); + return ["div", ret, "class", "padding"]; + } + + this.runtime_dropdown = function(runtimes) + { + return runtimes.map(this.runtime, this); + } + + this.runtime = function(runtime) + { + var option = ["cst-option", runtime.title, "rt-id", String(runtime.id)]; + if (runtime.title_attr) + option.push("title", runtime.title_attr); + var ret = [option]; + if (runtime.extensions && runtime.extensions.length) + ret.push(["cst-group", runtime.extensions.map(this.runtime, this)]); + return ret; + } + + this.script_dropdown = function(select_id, runtimes, stopped_script_id, selected_script_id) + { + var option_list = this.script_dropdown_options(select_id, + runtimes, + stopped_script_id, + selected_script_id); + return [["div", + ["div", + ["input", "type", "text", + "handler", select_id + "-filter", + "shortcuts", select_id + "-filter", + "class", "js-dd-filter"], + "class", "js-dd-filter-container"], + ["span", "class", "js-dd-clear-filter", + "handler", "js-dd-clear-filter"], + "class", "js-dd-filter-bar"], + option_list]; + }; + + this.script_dropdown_options = function(select_id, runtimes, stopped_script_id, + selected_script_id, search_term) + { + var script_list = ["div"]; + if (runtimes && runtimes.length) + { + for (var i = 0, rt; rt = runtimes[i]; i++) + { + script_list.push(this.runtime_script(rt, stopped_script_id, + selected_script_id, search_term)); + } + } + script_list.push("class", "js-dd-script-list", + "handler", "js-dd-move-highlight"); + return script_list; + }; + + this.runtime_script = function(runtime, stopped_script_id, + selected_script_id, search_term) + { + // search_term only applies to .js-dd-s-scope + var ret = []; + var script_uri_paths = new HashMap(); + var inline_and_evals = []; + var title = ["cst-title", runtime.title]; + var class_name = runtime.type == "extension" + ? "js-dd-ext-runtime" + : "js-dd-runtime"; + + title.push("class", class_name + (runtime.selected ? " selected-runtime" : "")); + + if (runtime.title != runtime.uri) + title.push("title", runtime.uri); + + runtime.scripts.forEach(function(script) + { + var ret_script = this.script_option(script, + stopped_script_id, + selected_script_id, + search_term); + if (ret_script) + { + if (script.script_type === "linked") + { + var root_uri = this._uri_path(runtime, script, search_term); + if (script_uri_paths[root_uri]) + script_uri_paths[root_uri].push(ret_script); + else + script_uri_paths[root_uri] = [ret_script]; + } + else + inline_and_evals.push(ret_script); + } + + }, this); + + var script_list = []; + Object.getOwnPropertyNames(script_uri_paths).sort().forEach(function(uri) + { + var group = ["div"]; + if (uri != "./") + group.push(["cst-title", uri, "class", "js-dd-dir-path"]); + + group.extend(script_uri_paths[uri]); + group.push("class", "js-dd-group js-dd-s-scope"); + ret.push(group); + }); + + if (inline_and_evals.length) + { + if (runtime.type == "extension") + { + ret.push(["div", inline_and_evals, "class", "js-dd-group js-dd-s-scope"]); + } + else + { + var group = ["div"]; + group.push(["cst-title", + ui_strings.S_SCRIPT_SELECT_SECTION_INLINE_AND_EVALS, + "class", "js-dd-dir-path"]); + + group.extend(inline_and_evals); + group.push("class", "js-dd-group"); + ret.push(group); + } + } + + if (runtime.type != "extension") + { + if (runtime.browser_js || (runtime.user_js_s && runtime.user_js_s.length)) + { + var scripts = []; + var sc_op = null; + if (runtime.browser_js) + { + sc_op = this.script_option(runtime.browser_js, stopped_script_id, + selected_script_id, search_term); + if (sc_op) + scripts.push(sc_op); + } + + if (runtime.user_js_s) + { + for (var i = 0, script; script = runtime.user_js_s[i]; i++) + { + sc_op = this.script_option(script, stopped_script_id, + selected_script_id, search_term) + if (sc_op) + scripts.push(sc_op); + } + } + + if (scripts.length) + { + ret.push(["div", + ["cst-title", + ui_strings.S_SCRIPT_SELECT_SECTION_BROWSER_AND_USER_JS, + "class", "js-dd-dir-path"], + ["div", scripts, "class", "js-dd-s-scope"], + "class", "js-dd-group"]); + } + } + + if (runtime.extensions) + { + for (var i = 0, rt; rt = runtime.extensions[i]; i++) + { + var ext_scripts = this.runtime_script(rt, stopped_script_id, + selected_script_id, search_term) + if (ext_scripts.length) + ret.push(ext_scripts); + } + } + } + + if (ret.length) + ret.unshift(title); + + return ret; + } + + this._uri_path = function(runtime, script, search_term) + { + var uri_path = script.abs_dir; + + if (script.abs_dir.indexOf(runtime.abs_dir) == 0 && + (!search_term || !runtime.abs_dir.contains(search_term))) + uri_path = "./" + script.abs_dir.slice(runtime.abs_dir.length); + else if (script.origin == runtime.origin && + (!search_term || !(script.origin.contains(search_term)))) + uri_path = script.dir_pathname; + + return uri_path; + }; + + // script types in the protocol: + // "inline", "event", "linked", "timeout", + // "java", "generated", "unknown" + // "Greasemonkey JS", "Browser JS", "User JS", "Extension JS" + this._script_type_map = + { + "inline": ui_strings.S_TEXT_ECMA_SCRIPT_TYPE_INLINE, + "linked": ui_strings.S_TEXT_ECMA_SCRIPT_TYPE_LINKED, + "unknown": ui_strings.S_TEXT_ECMA_SCRIPT_TYPE_UNKNOWN + }; + + this.script_option = function(script, stopped_script_id, + selected_script_id, search_term) + { + var script_type = this._script_type_map[script.script_type] || + script.script_type; + var ret = null; + + if (search_term && + !((script.uri && script.uri.toLowerCase().contains(search_term)) || + (!script.uri && script_type.toLowerCase().contains(search_term)))) + return ret; + + if (script.uri) + { + var is_linked = script.script_type == "linked"; + ret = ["cst-option", + ["span", + script.filename, + "data-tooltip", is_linked && "js-script-select", + "data-tooltip-text", is_linked && script.uri]]; + + if (script.search) + ret.push(["span", script.search, "class", "js-dd-scr-query"]); + + if (script.hash) + ret.push(["span", script.query, "class", "js-dd-scr-hash"]); + + ret.push("script-id", script.script_id.toString()); + } + else + { + var code_snippet = script.script_data.slice(0, 360) + .replace(/\s+/g, " ").slice(0, 120); + ret = ["cst-option", + ["span", script_type.capitalize(true), "class", "js-dd-s-scope"], + " – ", + ["code", code_snippet, "class", "code-snippet"], + "script-id", script.script_id.toString()]; + } + + var class_name = script.script_id == selected_script_id + ? "selected" + : ""; + + if (stopped_script_id == script.script_id) + class_name += (class_name ? " " : "") + "stopped"; + + if (class_name) + ret.push("class", class_name); + + return ret; + }; + + this.runtime_dom = function(runtime) + { + var display_uri = runtime["title"] || helpers.shortenURI(runtime.uri).uri; + return ( + [ + "cst-option", + runtime["title"] || runtime.uri, + "runtime-id", runtime.runtime_id.toString() + ].concat( dom_data.getDataRuntimeId() == runtime.runtime_id ? ["class", "selected"] : [] ). + concat( display_uri != runtime.uri ? ["title", runtime.uri] : [] ) ) + } + + this.frame = function(frame, is_top) + { + // Fall back to document URI if it's inline + var uri = frame.script_id && runtimes.getScript(frame.script_id) + ? (runtimes.getScript(frame.script_id).uri || runtimes.getRuntime(frame.rt_id).uri) + : null; + return ["li", + ["span", frame.fn_name, "class", "scope-name"], + ["span", + " " + (uri && frame.line ? helpers.basename(uri) + ":" + frame.line : ""), + "class", "file-line"], + "handler", "show-frame", + "ref-id", String(frame.id), + "title", uri + ].concat( is_top ? ["class", "selected"] : [] ); + } + + this.configStopAt = function(config) + { + var ret =["ul"]; + var arr = ["script", "exception", "error", "abort"], n="", i=0; + for( ; n = arr[i]; i++) + { + ret[ret.length] = this.checkbox(n, config[n]); + } + return ["div"].concat([ret]); + } + + this.breakpoint = function(line_nr, top) + { + return ["li", + "class", "breakpoint", + "line_nr", line_nr, + "style", "top:"+ top +"px" + ] + } + + this.breadcrumb = function(model, obj_id, parent_node_chain, target_id, show_combinator) + { + var setting = window.settings.dom; + var css_path = model._get_css_path(obj_id, parent_node_chain, + setting.get("force-lowercase"), + setting.get("show-id_and_classes-in-breadcrumb"), + setting.get("show-siblings-in-breadcrumb")); + var ret = []; + target_id || (target_id = obj_id) + if (css_path) + { + for (var i = 0; i < css_path.length; i++ ) + { + ret[ret.length] = + [ + "breadcrumb", css_path[i].name, + "ref-id", css_path[i].id.toString(), + "handler", "breadcrumb-link", + "data-menu", "breadcrumb", + "class", (css_path[i].is_parent_offset ? "parent-offset" : "") + + (css_path[i].id == target_id ? " active" : ""), + ]; + if (show_combinator) + { + ret[ret.length] = " " + css_path[i].combinator + " "; + } + } + } + return ret; + } + + this.uiLangOptions = function(lang_dict) + { + var dict = + [ + { + browserLanguge: "be", + key: "be", + name: "Беларуская" + }, + { + browserLanguge: "bg", + key: "bg", + name: "Български" + }, + { + browserLanguge: "cs", + key: "cs", + name: "Česky" + }, + { + browserLanguge: "de", + key: "de", + name: "Deutsch" + }, + { + browserLanguge: "en", + key: "en", + name: "U.S. English" + }, + { + browserLanguge: "en-GB", + key: "en-GB", + name: "British English" + }, + { + browserLanguge: "es-ES", + key: "es-ES", + name: "Español (España)" + }, + { + browserLanguge: "es-LA", + key: "es-LA", + name: "Español (Latinoamérica)" + }, + { + browserLanguge: "et", + key: "et", + name: "Eesti keel" + }, + { + browserLanguge: "fr", + key: "fr", + name: "Français" + }, + { + browserLanguge: "fr-CA", + key: "fr-CA", + name: "Français Canadien" + }, + { + browserLanguge: "fy", + key: "fy", + name: "Frysk" + }, + { + browserLanguge: "gd", + key: "gd", + name: "Gàidhlig" + }, + { + browserLanguge: "hu", + key: "hu", + name: "Magyar" + }, + { + browserLanguge: "id", + key: "id", + name: "Bahasa Indonesia" + }, + { + browserLanguge: "it", + key: "it", + name: "Italiano" + }, + { + browserLanguge: "ja", + key: "ja", + name: "日本語" + }, + { + browserLanguge: "ka", + key: "ka", + name: "ქართული" + }, + { + browserLanguge: "mk", + key: "mk", + name: "македонски јазик" + }, + { + browserLanguge: "nb", + key: "nb", + name: "Norsk bokmål" + }, + { + browserLanguge: "nl", + key: "nl", + name: "Nederlands" + }, + { + browserLanguge: "nn", + key: "nn", + name: "Norsk nynorsk" + }, + { + browserLanguge: "pl", + key: "pl", + name: "Polski" + }, + { + browserLanguge: "pt", + key: "pt", + name: "Português" + }, + { + browserLanguge: "pt-BR", + key: "pt-BR", + name: "Português (Brasil)" + }, + { + browserLanguge: "ro", + key: "ro", + name: "Română" + }, + { + browserLanguge: "ru", + key: "ru", + name: "Русский язык" + }, + { + browserLanguge: "sk", + key: "sk", + name: "Slovenčina" + }, + { + browserLanguge: "sr", + key: "sr", + name: "српски" + }, + { + browserLanguge: "sv", + key: "sv", + name: "Svenska" + }, + { + browserLanguge: "tr", + key: "tr", + name: "Türkçe" + }, + { + browserLanguge: "uk", + key: "uk", + name: "Українська" + }, + { + browserLanguge: "zh-cn", + key: "zh-cn", + name: "简体中文" + }, + { + browserLanguge: "zh-tw", + key: "zh-tw", + name: "繁體中文" + } + ], + lang = null, + i = 0, + selected_lang = window.ui_strings.lang_code, + ret = []; + + for( ; lang = dict[i]; i++) + { + ret[ret.length] = ["option", lang.name, "value", lang.key]. + concat(selected_lang == lang.key ? ["selected", "selected"] : []); + } + return ret; + } + +}).apply(window.templates || (window.templates = {})); diff --git a/src/lib/elementprototype.js b/src/lib/elementprototype.js index d7b4a9e31..f05733a57 100644 --- a/src/lib/elementprototype.js +++ b/src/lib/elementprototype.js @@ -1,758 +1,758 @@ -if (!Element.prototype.contains) -{ - Element.prototype.contains = function(ele) - { - while (ele && ele != this) - ele = ele.parentNode; - return Boolean(ele); - } -} - -if (!Element.prototype.insertAdjacentHTML) -{ - Element.prototype.insertAdjacentHTML = function(position, markup) - { - if (position == 'beforeend') - { - var div = this.appendChild(document.createElement('div')); - div.innerHTML = markup; - var range = document.createRange(); - range.selectNodeContents(div); - this.replaceChild(range.extractContents(), div); - return this.firstElementChild; - } - } -} - -if (typeof document.createElement('div').classList == 'undefined') -{ - Element.prototype.__defineGetter__('classList', function() - { - return this.className.split(/\s+/); - }); - Element.prototype.__defineSetter__('classList', function(){}); -} - -/** - * @fileoverview - * Helper function prototypes related to DOM objects and the DOM - * fixme: Christian should document the template syntax - * - * TEMPLATE :: = - * "[" [NODENAME | "null"] - * {"," TEXT | "," TEMPLATE} - * {"," KEY "," VALUE} - * "]" - * - * where NODENAME, TEXT and KEY are DOM strings and VALUE can be everything except an array - */ - -Element.prototype.render = Document.prototype.render = function(args, namespace) -{ - var args_is_string = typeof args == 'string'; - if (this.nodeType == 1 && args_is_string || - (args.length == 1 && typeof args[0] == 'string' && / scrollContainer.scrollTop + scrollContainer.offsetHeight - min_top) - { - scrollContainer.scrollTop = - this.offsetTop + this.offsetHeight - scrollContainer.offsetHeight + min_top; - } - } -}; - -/** - * Make sure the element is visible in the container. The container is the - * first element found in the offsetParent chain, or body if no - * container element is found. - */ -Element.prototype.scrollSoftIntoContainerView = function() -{ - var scrollContainer = this.offsetParent; - while (scrollContainer && scrollContainer != document.body && - scrollContainer.nodeName.toLowerCase() != "container") - { - scrollContainer = scrollContainer.offsetParent; - } - - var min_top = 20; - if (scrollContainer && scrollContainer.offsetHeight < scrollContainer.scrollHeight) - { - if (this.offsetTop < scrollContainer.scrollTop + min_top) - { - scrollContainer.scrollTop = this.offsetTop - min_top; - } - else if (this.offsetTop + this.offsetHeight > scrollContainer.scrollTop + scrollContainer.offsetHeight - min_top) - { - scrollContainer.scrollTop = - this.offsetTop + this.offsetHeight - scrollContainer.offsetHeight + min_top; - } - } -}; - -Element.prototype.hasTextNodeChild = function() -{ - for (var i = 0, child; child = this.childNodes[i]; i++) - { - if (child.nodeType == document.TEXT_NODE) - { - return true; - } - } - return false; -}; - -window.CustomElements = new function() -{ - this._init_queue = []; - - this._init_listener = function(event) - { - var - queue = CustomElements._init_queue, - wait_list = [], - item = null, - i = 0, - target = event.target; - - for ( ; item = queue[i]; i++) - { - if (target.contains(item.ele)) - { - CustomElements[item.type].init(item.ele); - } - else - { - wait_list.push(item); - } - } - CustomElements._init_queue = wait_list; - if (!wait_list.length) - { - document.removeEventListener('DOMNodeInserted', CustomElements._init_listener, false); - } - } - - this.add = function(CustomElementClass) - { - CustomElementClass.prototype = this.Base; - var custom_element = new CustomElementClass(), feature = '', i = 1; - if (custom_element.type) - { - for ( ; feature = arguments[i]; i++) - { - if (feature in this) - { - this[feature].apply(custom_element); - } - } - this[custom_element.type] = custom_element; - } - } -}; - -window.CustomElements.Base = new function() -{ - this.create = function() - { - var ele = document.createElement(this.html_name); - if (!CustomElements._init_queue.length) - { - document.addEventListener('DOMNodeInserted', CustomElements._init_listener, false); - } - - CustomElements._init_queue.push( - { - ele: ele, - type: this.type - }); - - return ele; - } - - this.init = function(ele) - { - if (this._inits) - { - for (var init = null, i = 0; init = this._inits[i]; i++) - { - init.call(this, ele); - } - } - } -}; - -window.CustomElements.PlaceholderFeature = function() -{ - this.set_placeholder = function() - { - var placeholder = this.getAttribute('data-placeholder'); - if (!this.value && placeholder) - { - this.value = placeholder; - this.addClass('placeholder'); - } - } - - this.clear_placeholder = function() - { - if (this.hasClass('placeholder')) - { - this.removeClass('placeholder'); - this.value = ''; - } - } - - this.get_value = function() - { - return this.hasClass('placeholder') ? '' : this._get_value(); - }; - - (this._inits || (this._inits = [])).push(function(ele) - { - if (!ele._get_value) - { - var _interface = ele.toString().slice(8).replace(']', ''); - window[_interface].prototype._get_value = ele.__lookupGetter__('value'); - window[_interface].prototype._set_value = ele.__lookupSetter__('value'); - } - ele.__defineSetter__('value', ele._set_value); - ele.__defineGetter__('value', this.get_value); - this.set_placeholder.call(ele); - ele.addEventListener('focus', this.clear_placeholder, false); - ele.addEventListener('blur', this.set_placeholder, false); - }); -}; - -window.CustomElements.AutoScrollHeightFeature = function() -{ - this._adjust_height = function(delta, event) - { - if (!this.value) - { - this.style.height = "auto"; - this.rows = 1; - } - else - { - this.rows = 0; - this.style.height = "0"; - this.style.height = this.scrollHeight + delta + "px"; - } - }; - - this._get_delta = function(ele) - { - var style = window.getComputedStyle(ele, null); - var is_border_box = style.getPropertyValue("box-sizing") == "border-box"; - var prop = is_border_box ? "border" : "padding"; - var sign = is_border_box ? 1 : -1; - - return (sign * parseInt(style.getPropertyValue(prop + "-bottom")) || 0) + - (sign * parseInt(style.getPropertyValue(prop + "-top")) || 0); - }; - - (this._inits || (this._inits = [])).push(function(ele) - { - var delta = this._get_delta(ele); - var adjust_height = this._adjust_height.bind(ele, delta); - adjust_height(); - ele.addEventListener('input', adjust_height, false); - // Custom event to force adjust of height - ele.addEventListener('heightadjust', adjust_height, false); - }); - -}; - -CustomElements.add(function() -{ - this.type = '_html5_input'; - this.html_name = 'input'; -}, -'PlaceholderFeature'); - -CustomElements.add(function() -{ - this.type = '_html5_textarea'; - this.html_name = 'textarea'; -}, -'PlaceholderFeature'); - -CustomElements.add(function() -{ - this.type = '_auto_height_textarea'; - this.html_name = 'textarea'; -}, -'AutoScrollHeightFeature'); - -/* testing in Chrome or FF * -if (document.createElementNS && - document.createElement('div').namespaceURI != 'http://www.w3.org/1999/xhtml') -{ - Document.prototype.createElement = document.createElement = function(name) - { - return this.createElementNS('http://www.w3.org/1999/xhtml', name); - }; -} -/* */ - -/* -(function() -{ - var div = document.createElement('div') - var setter = div.__lookupSetter__("scrollTop"); - var getter = div.__lookupGetter__("scrollTop"); - Element.prototype.__defineSetter__('scrollTop', function(scroll_top) - { - opera.postError('setter: '+this.nodeName + ', '+scroll_top); - setter.call(this, scroll_top); - }); - Element.prototype.__defineGetter__('scrollTop', function() - { - var scroll_top = getter.call(this); - return scroll_top; - }); -})(); -*/ - - +if (!Element.prototype.contains) +{ + Element.prototype.contains = function(ele) + { + while (ele && ele != this) + ele = ele.parentNode; + return Boolean(ele); + } +} + +if (!Element.prototype.insertAdjacentHTML) +{ + Element.prototype.insertAdjacentHTML = function(position, markup) + { + if (position == 'beforeend') + { + var div = this.appendChild(document.createElement('div')); + div.innerHTML = markup; + var range = document.createRange(); + range.selectNodeContents(div); + this.replaceChild(range.extractContents(), div); + return this.firstElementChild; + } + } +} + +if (typeof document.createElement('div').classList == 'undefined') +{ + Element.prototype.__defineGetter__('classList', function() + { + return this.className.split(/\s+/); + }); + Element.prototype.__defineSetter__('classList', function(){}); +} + +/** + * @fileoverview + * Helper function prototypes related to DOM objects and the DOM + * fixme: Christian should document the template syntax + * + * TEMPLATE :: = + * "[" [NODENAME | "null"] + * {"," TEXT | "," TEMPLATE} + * {"," KEY "," VALUE} + * "]" + * + * where NODENAME, TEXT and KEY are DOM strings and VALUE can be everything except an array + */ + +Element.prototype.render = Document.prototype.render = function(args, namespace) +{ + var args_is_string = typeof args == 'string'; + if (this.nodeType == 1 && args_is_string || + (args.length == 1 && typeof args[0] == 'string' && / scrollContainer.scrollTop + scrollContainer.offsetHeight - min_top) + { + scrollContainer.scrollTop = + this.offsetTop + this.offsetHeight - scrollContainer.offsetHeight + min_top; + } + } +}; + +/** + * Make sure the element is visible in the container. The container is the + * first element found in the offsetParent chain, or body if no + * container element is found. + */ +Element.prototype.scrollSoftIntoContainerView = function() +{ + var scrollContainer = this.offsetParent; + while (scrollContainer && scrollContainer != document.body && + scrollContainer.nodeName.toLowerCase() != "container") + { + scrollContainer = scrollContainer.offsetParent; + } + + var min_top = 20; + if (scrollContainer && scrollContainer.offsetHeight < scrollContainer.scrollHeight) + { + if (this.offsetTop < scrollContainer.scrollTop + min_top) + { + scrollContainer.scrollTop = this.offsetTop - min_top; + } + else if (this.offsetTop + this.offsetHeight > scrollContainer.scrollTop + scrollContainer.offsetHeight - min_top) + { + scrollContainer.scrollTop = + this.offsetTop + this.offsetHeight - scrollContainer.offsetHeight + min_top; + } + } +}; + +Element.prototype.hasTextNodeChild = function() +{ + for (var i = 0, child; child = this.childNodes[i]; i++) + { + if (child.nodeType == document.TEXT_NODE) + { + return true; + } + } + return false; +}; + +window.CustomElements = new function() +{ + this._init_queue = []; + + this._init_listener = function(event) + { + var + queue = CustomElements._init_queue, + wait_list = [], + item = null, + i = 0, + target = event.target; + + for ( ; item = queue[i]; i++) + { + if (target.contains(item.ele)) + { + CustomElements[item.type].init(item.ele); + } + else + { + wait_list.push(item); + } + } + CustomElements._init_queue = wait_list; + if (!wait_list.length) + { + document.removeEventListener('DOMNodeInserted', CustomElements._init_listener, false); + } + } + + this.add = function(CustomElementClass) + { + CustomElementClass.prototype = this.Base; + var custom_element = new CustomElementClass(), feature = '', i = 1; + if (custom_element.type) + { + for ( ; feature = arguments[i]; i++) + { + if (feature in this) + { + this[feature].apply(custom_element); + } + } + this[custom_element.type] = custom_element; + } + } +}; + +window.CustomElements.Base = new function() +{ + this.create = function() + { + var ele = document.createElement(this.html_name); + if (!CustomElements._init_queue.length) + { + document.addEventListener('DOMNodeInserted', CustomElements._init_listener, false); + } + + CustomElements._init_queue.push( + { + ele: ele, + type: this.type + }); + + return ele; + } + + this.init = function(ele) + { + if (this._inits) + { + for (var init = null, i = 0; init = this._inits[i]; i++) + { + init.call(this, ele); + } + } + } +}; + +window.CustomElements.PlaceholderFeature = function() +{ + this.set_placeholder = function() + { + var placeholder = this.getAttribute('data-placeholder'); + if (!this.value && placeholder) + { + this.value = placeholder; + this.addClass('placeholder'); + } + } + + this.clear_placeholder = function() + { + if (this.hasClass('placeholder')) + { + this.removeClass('placeholder'); + this.value = ''; + } + } + + this.get_value = function() + { + return this.hasClass('placeholder') ? '' : this._get_value(); + }; + + (this._inits || (this._inits = [])).push(function(ele) + { + if (!ele._get_value) + { + var _interface = ele.toString().slice(8).replace(']', ''); + window[_interface].prototype._get_value = ele.__lookupGetter__('value'); + window[_interface].prototype._set_value = ele.__lookupSetter__('value'); + } + ele.__defineSetter__('value', ele._set_value); + ele.__defineGetter__('value', this.get_value); + this.set_placeholder.call(ele); + ele.addEventListener('focus', this.clear_placeholder, false); + ele.addEventListener('blur', this.set_placeholder, false); + }); +}; + +window.CustomElements.AutoScrollHeightFeature = function() +{ + this._adjust_height = function(delta, event) + { + if (!this.value) + { + this.style.height = "auto"; + this.rows = 1; + } + else + { + this.rows = 0; + this.style.height = "0"; + this.style.height = this.scrollHeight + delta + "px"; + } + }; + + this._get_delta = function(ele) + { + var style = window.getComputedStyle(ele, null); + var is_border_box = style.getPropertyValue("box-sizing") == "border-box"; + var prop = is_border_box ? "border" : "padding"; + var sign = is_border_box ? 1 : -1; + + return (sign * parseInt(style.getPropertyValue(prop + "-bottom")) || 0) + + (sign * parseInt(style.getPropertyValue(prop + "-top")) || 0); + }; + + (this._inits || (this._inits = [])).push(function(ele) + { + var delta = this._get_delta(ele); + var adjust_height = this._adjust_height.bind(ele, delta); + adjust_height(); + ele.addEventListener('input', adjust_height, false); + // Custom event to force adjust of height + ele.addEventListener('heightadjust', adjust_height, false); + }); + +}; + +CustomElements.add(function() +{ + this.type = '_html5_input'; + this.html_name = 'input'; +}, +'PlaceholderFeature'); + +CustomElements.add(function() +{ + this.type = '_html5_textarea'; + this.html_name = 'textarea'; +}, +'PlaceholderFeature'); + +CustomElements.add(function() +{ + this.type = '_auto_height_textarea'; + this.html_name = 'textarea'; +}, +'AutoScrollHeightFeature'); + +/* testing in Chrome or FF * +if (document.createElementNS && + document.createElement('div').namespaceURI != 'http://www.w3.org/1999/xhtml') +{ + Document.prototype.createElement = document.createElement = function(name) + { + return this.createElementNS('http://www.w3.org/1999/xhtml', name); + }; +} +/* */ + +/* +(function() +{ + var div = document.createElement('div') + var setter = div.__lookupSetter__("scrollTop"); + var getter = div.__lookupGetter__("scrollTop"); + Element.prototype.__defineSetter__('scrollTop', function(scroll_top) + { + opera.postError('setter: '+this.nodeName + ', '+scroll_top); + setter.call(this, scroll_top); + }); + Element.prototype.__defineGetter__('scrollTop', function() + { + var scroll_top = getter.call(this); + return scroll_top; + }); +})(); +*/ + + diff --git a/src/repl/propertyfinder.js b/src/repl/propertyfinder.js index aac0927d0..ffac1897b 100644 --- a/src/repl/propertyfinder.js +++ b/src/repl/propertyfinder.js @@ -1,284 +1,284 @@ -/** - * Resolve the properties of an object in a runtime. - * - * Singleton. Every instantiation will return the same instance. Contains - * no state apart from the caching, which should be shared. - */ - -window.cls = window.cls || {}; -window.cls.PropertyFinder = function(rt_id) { - if (window.cls.PropertyFinder.instance) { - return window.cls.PropertyFinder.instance; - } - else { - window.cls.PropertyFinder.instance = this; - } - - // this cond is here so we can instanciate the class even without running - // with scope. Means we can run tests on functions that don't require - // scope. - if (window.services) - { - this._service = window.services['ecmascript-debugger']; - } - - this._cache = {}; - - this._parser = window.simple_js_parser || new window.cls.SimpleJSParser(); - - const PUNCTUATOR = cls.SimpleJSParser.PUNCTUATOR; - const IDENTIFIER = cls.SimpleJSParser.IDENTIFIER; - const TYPE = 0; - const VALUE = 1; - - this._get_last_token = function(tokens, token_type, token_value) - { - if (tokens) - { - for (var i = tokens.length - 1, token; token = tokens[i]; i--) - { - if (token[TYPE] == token_type && token[VALUE] == token_value) - { - for (var j = 0, index = 0; j <= i; j++) - index += tokens[j][VALUE].length; - return index; - } - } - } - return -1; - }; - - /** - * Figure out the object to which input belongs. - * foo.bar -> foo - * window.bleh.meh -> window.bleh - * phlebotinum -> this - * phlebotinum. -> phlebotinum - * foo(bar.bleh -> bar - * foo[window -> window - * foo[bar].a -> foo[bar] - */ - this._find_input_parts = function(input) - { - var tokens = []; - this._parser.tokenize(input, function(token_type, token) - { - tokens.push([token_type, token]); - }); - var last_bracket = this._get_last_token(tokens, PUNCTUATOR, '['); - var last_brace = this._get_last_token(tokens, PUNCTUATOR, '('); - last_brace = this._get_last_token(tokens, PUNCTUATOR, ')') <= last_brace - ? last_brace - : -1; - last_bracket = this._get_last_token(tokens, PUNCTUATOR, ']') <= last_bracket - ? last_bracket - : -1; - var pos = Math.max(last_brace, - last_bracket, - this._get_last_token(tokens, PUNCTUATOR, '='), - this._get_last_token(tokens, IDENTIFIER, 'in')); - if (pos > -1) - input = input.slice(pos); - input = input.replace(/^\s+/, ''); - var last_dot = input.lastIndexOf('.'); - var new_path = ''; - var new_id = ''; - var ret = ''; - if(last_dot > -1) - { - new_path = input.slice(0, last_dot); - new_id = input.slice(last_dot + 1).replace(/^\s+/, ''); - } - else - { - new_id = input; - } - return {scope: new_path, identifier: new_id, input: input}; - }; - - - /** - * Returns a list of properties that match the input string in the given - * runtime. - * - */ - this.find_props = function(callback, input, frameinfo, context) - { - var rt_id = runtimes.getSelectedRuntimeId(); - var rt = runtimes.getRuntime(rt_id); - if (rt) - { - frameinfo = frameinfo || - { - runtime_id: rt_id, - thread_id: 0, - scope_id: rt.object_id, - index: 0, - scope_list: [] - }; - - frameinfo.stopped = Boolean(frameinfo.thread_id); - var parts = this._find_input_parts(input); - var props = this._cache_get(parts.scope, frameinfo); - - - if (props) - { - props.input = input; - props.identifier = parts.identifier; - callback(props); - } - else - { - if (parts.scope) - { - this._get_subject_id(callback, parts.scope, frameinfo, parts, context); - } - else - { - var scopes = [frameinfo.scope_id].extend(frameinfo.scope_list || []); - this._get_object_props(callback, frameinfo, scopes, parts); - } - } - } - }; - - /** - * Tell the caching mechanism that it need no longer keep track of data - * about a particular runtime. Can be hooked up to messages about closed - * tabs/runtimes - */ - this.clear_cache = function(rt_id) { - this._cache = {}; - }; - - this._cache_key = function(scope, frameinfo) { - return "" + scope + "." + frameinfo.runtime_id + "." + frameinfo.thread_id + "." + frameinfo.index; - }; - - this._cache_put = function(result) - { - var key = this._cache_key(result.scope, result.frameinfo); - this._cache[key] = result; - }; - - this._cache_get = function(scope, frameinfo) { - var key = this._cache_key(scope, frameinfo); - return this._cache[key]; - }; - - this._get_subject_id = function(callback, scope, frameinfo, parts, context) - { - var js = "" + scope; - - var varlist = []; - if (context) - { - for (var key in context) - { - varlist.push([key, context[key]]); - } - } - - var tag = tagManager.set_callback(this, this._got_subject_id, - [callback, frameinfo, parts]); - this._service.requestEval( - tag, [frameinfo.runtime_id, frameinfo.thread_id, frameinfo.index, js, varlist] - ); - } - - this._got_subject_id = function(status, msg, callback, frameinfo, parts) - { - const EVALRESULT = 0; OBJVALUE = 3, OBJID = 0; - var objid = null; - if (msg && msg[EVALRESULT] == "completed" && msg[OBJVALUE]) - { - objid = msg[OBJVALUE][OBJID]; - this._get_object_props(callback, frameinfo, [objid], parts) - } - else - { - var ret = { - props: [], - scope: parts.scope, - input: parts.input, - identifier: parts.identifier, - }; - callback(ret); - } - } - - this._get_object_props = function(callback, frameinfo, objids, parts) - { - var tag = tagManager.set_callback(this, this._got_object_props, [callback, parts]); - this._service.requestExamineObjects(tag, [frameinfo.runtime_id, objids, 1, 0]); - } - - this._got_object_props = function(status, msg, callback, parts) - { - if (status) - { - opera.postError(ui_strings.S_DRAGONFLY_INFO_MESSAGE + - 'ExamineObjects failed in _got_object_props in PropertyFinder'); - } - else - { - var ret = { - props: this._parse_prop_list(msg) || [], - scope: parts.scope, - input: parts.input, - identifier: parts.identifier, - }; - - if (! ret.props.contains("this")) - { - ret.props.push("this"); - } - - // fixme: is "arguments" in the props when stopped? - //this._cache_put(ret); - callback(ret); - } - } - - this._parse_prop_list = function(msg) - { - var names = []; - const OBJECT_CHAIN_LIST = 0, OBJECT_LIST = 0, PROPERTY_LIST = 1, NAME = 0; - - (msg[OBJECT_CHAIN_LIST] || []).forEach(function(chain){ - var objectlist = chain[OBJECT_LIST] || []; - objectlist.forEach(function(obj) { - names.extend((obj[PROPERTY_LIST] || []).map(function(prop) { - return prop[NAME]; - })); - }); - }); - - return names.unique(); - } - - this.toString = function() { - return "[PropertyFinder singleton instance]"; - }; -}; - -cls.PropertyFinder.prop_sorter = function(a, b) -{ - a = a.toLowerCase(); - b = b.toLowerCase(); - - if (a.isdigit() && b.isdigit()) - { - return parseInt(a, 10) - parseInt(b, 10); - } - else if (a>b) - { - return 1; - } - else if (a foo + * window.bleh.meh -> window.bleh + * phlebotinum -> this + * phlebotinum. -> phlebotinum + * foo(bar.bleh -> bar + * foo[window -> window + * foo[bar].a -> foo[bar] + */ + this._find_input_parts = function(input) + { + var tokens = []; + this._parser.tokenize(input, function(token_type, token) + { + tokens.push([token_type, token]); + }); + var last_bracket = this._get_last_token(tokens, PUNCTUATOR, '['); + var last_brace = this._get_last_token(tokens, PUNCTUATOR, '('); + last_brace = this._get_last_token(tokens, PUNCTUATOR, ')') <= last_brace + ? last_brace + : -1; + last_bracket = this._get_last_token(tokens, PUNCTUATOR, ']') <= last_bracket + ? last_bracket + : -1; + var pos = Math.max(last_brace, + last_bracket, + this._get_last_token(tokens, PUNCTUATOR, '='), + this._get_last_token(tokens, IDENTIFIER, 'in')); + if (pos > -1) + input = input.slice(pos); + input = input.replace(/^\s+/, ''); + var last_dot = input.lastIndexOf('.'); + var new_path = ''; + var new_id = ''; + var ret = ''; + if(last_dot > -1) + { + new_path = input.slice(0, last_dot); + new_id = input.slice(last_dot + 1).replace(/^\s+/, ''); + } + else + { + new_id = input; + } + return {scope: new_path, identifier: new_id, input: input}; + }; + + + /** + * Returns a list of properties that match the input string in the given + * runtime. + * + */ + this.find_props = function(callback, input, frameinfo, context) + { + var rt_id = runtimes.getSelectedRuntimeId(); + var rt = runtimes.getRuntime(rt_id); + if (rt) + { + frameinfo = frameinfo || + { + runtime_id: rt_id, + thread_id: 0, + scope_id: rt.object_id, + index: 0, + scope_list: [] + }; + + frameinfo.stopped = Boolean(frameinfo.thread_id); + var parts = this._find_input_parts(input); + var props = this._cache_get(parts.scope, frameinfo); + + + if (props) + { + props.input = input; + props.identifier = parts.identifier; + callback(props); + } + else + { + if (parts.scope) + { + this._get_subject_id(callback, parts.scope, frameinfo, parts, context); + } + else + { + var scopes = [frameinfo.scope_id].extend(frameinfo.scope_list || []); + this._get_object_props(callback, frameinfo, scopes, parts); + } + } + } + }; + + /** + * Tell the caching mechanism that it need no longer keep track of data + * about a particular runtime. Can be hooked up to messages about closed + * tabs/runtimes + */ + this.clear_cache = function(rt_id) { + this._cache = {}; + }; + + this._cache_key = function(scope, frameinfo) { + return "" + scope + "." + frameinfo.runtime_id + "." + frameinfo.thread_id + "." + frameinfo.index; + }; + + this._cache_put = function(result) + { + var key = this._cache_key(result.scope, result.frameinfo); + this._cache[key] = result; + }; + + this._cache_get = function(scope, frameinfo) { + var key = this._cache_key(scope, frameinfo); + return this._cache[key]; + }; + + this._get_subject_id = function(callback, scope, frameinfo, parts, context) + { + var js = "" + scope; + + var varlist = []; + if (context) + { + for (var key in context) + { + varlist.push([key, context[key]]); + } + } + + var tag = tagManager.set_callback(this, this._got_subject_id, + [callback, frameinfo, parts]); + this._service.requestEval( + tag, [frameinfo.runtime_id, frameinfo.thread_id, frameinfo.index, js, varlist] + ); + } + + this._got_subject_id = function(status, msg, callback, frameinfo, parts) + { + const EVALRESULT = 0; OBJVALUE = 3, OBJID = 0; + var objid = null; + if (msg && msg[EVALRESULT] == "completed" && msg[OBJVALUE]) + { + objid = msg[OBJVALUE][OBJID]; + this._get_object_props(callback, frameinfo, [objid], parts) + } + else + { + var ret = { + props: [], + scope: parts.scope, + input: parts.input, + identifier: parts.identifier, + }; + callback(ret); + } + } + + this._get_object_props = function(callback, frameinfo, objids, parts) + { + var tag = tagManager.set_callback(this, this._got_object_props, [callback, parts]); + this._service.requestExamineObjects(tag, [frameinfo.runtime_id, objids, 1, 0]); + } + + this._got_object_props = function(status, msg, callback, parts) + { + if (status) + { + opera.postError(ui_strings.S_DRAGONFLY_INFO_MESSAGE + + 'ExamineObjects failed in _got_object_props in PropertyFinder'); + } + else + { + var ret = { + props: this._parse_prop_list(msg) || [], + scope: parts.scope, + input: parts.input, + identifier: parts.identifier, + }; + + if (! ret.props.contains("this")) + { + ret.props.push("this"); + } + + // fixme: is "arguments" in the props when stopped? + //this._cache_put(ret); + callback(ret); + } + } + + this._parse_prop_list = function(msg) + { + var names = []; + const OBJECT_CHAIN_LIST = 0, OBJECT_LIST = 0, PROPERTY_LIST = 1, NAME = 0; + + (msg[OBJECT_CHAIN_LIST] || []).forEach(function(chain){ + var objectlist = chain[OBJECT_LIST] || []; + objectlist.forEach(function(obj) { + names.extend((obj[PROPERTY_LIST] || []).map(function(prop) { + return prop[NAME]; + })); + }); + }); + + return names.unique(); + } + + this.toString = function() { + return "[PropertyFinder singleton instance]"; + }; +}; + +cls.PropertyFinder.prop_sorter = function(a, b) +{ + a = a.toLowerCase(); + b = b.toLowerCase(); + + if (a.isdigit() && b.isdigit()) + { + return parseInt(a, 10) - parseInt(b, 10); + } + else if (a>b) + { + return 1; + } + else if (a MAX_CONTEXT_QUEUE_LENGTH) - { - this._context_queue.shift(); - } - } - } - - this._oncontextmenubound = function(event) - { - if (this._set_action_context_bound(event) !== false) - this._contextmenu.oncontextmenu(event); - if (!event.shiftKey) - event.preventDefault(); - }.bind(this); - - this._onhideviewbound = function(msg) - { - var handler_id = msg.id; - var view = null; - if (handler_id == this._action_context_id) - { - while (this._context_queue.length) - { - handler_id = this._context_queue.pop(); - view = window.views[handler_id]; - if (view && view.isvisible()) - { - // Workaround to reset the focus to the a given view. - // Needs a proper design. - // Also used in js source view. - var container = view.get_container(); - if (container) - container.dispatchMouseEvent('click'); - - return; - } - } - this._set_current_handler(this._global_handler.id); - } - }.bind(this); - - this._init = function() - { - this._key_identifier = new KeyIdentifier(this.dispatch_key_input.bind(this), - window.ini.browser); - this.register_handler(this._global_handler); - this._contextmenu = ContextMenu.get_instance(); - window.app.addListener('services-created', function() - { - this._context_queue = []; - this._shortcuts = this._retrieve_shortcuts(); - this._global_shortcuts = this._shortcuts.global; - this._key_identifier.set_shortcuts(this._get_shortcut_keys()); - this._set_current_handler(this._global_handler.id); - document.addEventListener("contextmenu", this._oncontextmenubound, false); - document.addEventListener('click', this._set_action_context_bound, true); - document.addEventListener('focus', this._set_action_context_bound, true); - window.messages.addListener('hide-view', this._onhideviewbound); - window.messages.post('shortcuts-changed'); - }.bind(this)); - }; - - /* handling of the shortcuts map */ - - this._retrieve_shortcuts = function() - { - var stored_shortcuts = window.settings.general.get("shortcuts"); - var default_shortcuts = window.helpers.copy_object(window.ini.default_shortcuts); - if (stored_shortcuts) - { - var shortcuts_hash = window.settings.general.get("shortcuts-hash"); - if (this._hash_shortcuts(default_shortcuts) != shortcuts_hash) - { - try - { - stored_shortcuts = this._sync_shortcuts(default_shortcuts, stored_shortcuts); - this._store_shortcuts(stored_shortcuts); - } - catch(e) - { - stored_shortcuts = null; - window.settings.general.set("shortcuts", null); - window.settings.general.set("shortcuts-hash", ""); - (new AlertDialog(ui_strings.D_SHORTCUTS_UPDATE_FAILED)).show(); - } - } - } - return stored_shortcuts || default_shortcuts; - }; - - this._store_shortcuts = function(shortcuts) - { - var hash = shortcuts && this._hash_shortcuts(window.ini.default_shortcuts) || ""; - window.settings.general.set("shortcuts", shortcuts); - window.settings.general.set("shortcuts-hash", hash); - }; - - this._sync_shortcuts = function(source, target) - { - for (var prop in source) - { - if (typeof source[prop] == 'object') - { - if (!target.hasOwnProperty(prop)) - { - target[prop] = {}; - } - this._sync_shortcuts(source[prop], target[prop]); - } - else - { - if (!target.hasOwnProperty(prop)) - { - target[prop] = source[prop]; - } - } - } - return target; - }; - - this._hash_shortcuts = function(shortcuts) - { - return JSON.stringify(shortcuts).replace(/["{},:\- ]/g, ''); - }; - - /* implementation */ - - this.register_handler = function(action_handler) - { - if (!(action_handler && action_handler.id)) - throw 'missing id on action_handler in ActionBroker.instance.register_handler'; - this._handlers[action_handler.id] = action_handler; - if (action_handler.shared_shortcuts) - { - this._inherited_handlers[action_handler.shared_shortcuts] = action_handler; - if (action_handler.shared_shortcuts_label) - { - this._shared_shortcuts_labels[action_handler.shared_shortcuts] = - action_handler.shared_shortcuts_label; - } - } - } - - this.dispatch_action = function(action_handler_id, action_id, event, target) - { - this._handlers[action_handler_id].handle(action_id, event, target); - } - - this.dispatch_key_input = function(key_id, event) - { - if (this._action_context.check_mode) - this._action_context.check_mode(event); - - var shortcuts = this._current_shortcuts[this._action_context.mode] || {}; - var shared_shortcuts = this._current_shared_shortcuts[this._action_context.mode] || {}; - var action = shortcuts[key_id] || shared_shortcuts[key_id] || ''; - var propagate_event = true; - if (action) - { - propagate_event = this._action_context.handle(action, - event, - this._container); - } - - if (!(propagate_event === false) && - this._action_context != this._global_handler) - { - // to ensure that the global action handler uses the correct mode - // even if it's not the current action handler - this._global_handler.check_mode(event); - shortcuts = this._global_shortcuts[this._global_handler.mode]; - action = shortcuts && shortcuts[key_id] || ''; - if (action) - propagate_event = this._global_handler.handle(action, - event, - this._container); - } - - if (propagate_event === false) - { - event.stopPropagation(); - event.preventDefault(); - } - } - - this.delay_action = function(type, handler_id, action_id, event, target) - { - if (!this._delays.hasOwnProperty(type)) - { - this._delays[type] = new Timeouts(); - } - var cb = this.dispatch_action.bind(this, handler_id, action_id, event, target); - this._delays[type].set(cb, 300); - } - - this.clear_delayed_actions = function(type) - { - if (this._delays[type]) - this._delays[type].clear(); - } - - this.get_shortcuts = function() - { - return window.helpers.copy_object(this._shortcuts); - } - - this.set_shortcuts = function(shortcuts, handler_id, clear_setting) - { - shortcuts = window.helpers.copy_object(shortcuts); - if (handler_id) - this._shortcuts[handler_id] = shortcuts; - else - this._shortcuts = shortcuts; - this._global_shortcuts = this._shortcuts.global; - this._store_shortcuts(clear_setting == true ? null : this._shortcuts); - this._key_identifier.set_shortcuts(this._get_shortcut_keys()); - window.messages.post('shortcuts-changed'); - }; - - this.get_actions_with_handler_id = function(handler_id) - { - - return ( - (this._handlers[handler_id] && this._handlers[handler_id].get_action_list().sort()) || - (this._inherited_handlers[handler_id] && this._inherited_handlers[handler_id].get_action_list().sort()) - ); - }; - - this._get_shortcut_keys = function() - { - var ret = [], name = '', handler = null, mode = '', key = ''; - for (name in this._shortcuts) - { - handler = this._shortcuts[name]; - for (mode in handler) - { - for (key in handler[mode]) - { - if (ret.indexOf(key) == -1) - ret.push(key); - } - } - } - return ret; - }; - - this.get_label_with_handler_id_and_mode = function(handler_id, mode) - { - return (this._handlers[handler_id] && this._handlers[handler_id].mode_labels[mode]) || - (this._inherited_handlers[handler_id] && this._inherited_handlers[handler_id].mode_labels[mode]); - }; - - this.get_global_handler = function() - { - return this._global_handler; - }; - - this.set_setter_click_handler = function(setter, handler) - { - if (setter instanceof ContextMenu) - { - this._modal_click_handler_setter = setter; - this._modal_click_handler = handler; - } - }; - - this.clear_setter_click_handler = function(setter) - { - if (setter == this._modal_click_handler_setter) - { - this._modal_click_handler_setter = null; - this._modal_click_handler = null; - } - }; - - this.get_shortcut_with_handler_and_action = function(handler_id, action) - { - var - shortcuts = this._shortcuts && this._shortcuts[handler_id], - shortcuts_mode = null, - mode = '', - key = ''; - - if (shortcuts) - for (mode in shortcuts) - { - shortcuts_mode = shortcuts[mode]; - for (key in shortcuts_mode) - if (shortcuts_mode[key] == action) - return key; - } - return ''; - }; - - this.get_action_container = function() - { - return this._container; - } - - this.get_current_handler_id = function() - { - return this._action_context_id; - }; - - this.focus_handler = function(handler_id, event) - { - var view = window.views[handler_id]; - if (view && view.isvisible() && this._handlers[handler_id]) - { - this._last_event_target = event.target; - this._set_current_handler(handler_id, event, view.get_container()); - } - }; - - this.get_shared_shortcuts_label = function(shared_shortcuts) - { - return this._shared_shortcuts_labels[shared_shortcuts] || ""; - }; - - if (document.readyState == "complete") - this._init(); - else - document.addEventListener('DOMContentLoaded', this._init.bind(this), false); - -} - -ActionBroker.get_instance = function() -{ - return this.instance || new ActionBroker(); -} - -ActionBroker.GLOBAL_HANDLER_ID = "global"; + + +var ActionBroker = function() +{ + /* + static constants + ActionBroker.GLOBAL_HANDLER_ID = "global"; + + static methods + ActionBroker.get_instance + */ + + if (ActionBroker.instance) + return ActionBroker.instance; + + ActionBroker.instance = this; + + /* interface */ + + /** + * To register an instance of class which implements + * the ActionHandler interface. + */ + this.register_handler = function(action_handler){}; + + /** + * To get a copy of the current shortcut map. + */ + this.get_shortcuts = function(){}; + + /** + * To set a new shortcut map. + * @param {Object} shortcuts + * @param {String} handler_id + * @param {Boolean} clear_setting. To reste to defaults + */ + this.set_shortcuts = function(shortcuts, handler_id, clear_setting){}; + + /** + * To get a list of action handler ids. + */ + this.get_handlers = function(){}; + + /** + * To propagate UI inputs, e.g. click or right click menu, as actions. + */ + this.dispatch_action = function(view_id, action_id, event, target){}; + + /** + * To propagate key input as a shortcut action. + */ + this.dispatch_key_input = function(key_id, event){}; + + /** + * To delay an action propagation, + * e.g if a click could be followed by a double click. + * @param {String} type, the event type + * @param {String} handler_id + * @param {String} action_id + * @param {Event} event + * @param {Element} target + */ + this.delay_action = function(type, handler_id, action_id, event, target){}; + + /** + * To cancel delayed actions. + * e.g. if a dbl click has followed a click. + * @param {String} type, the event type + */ + this.clear_delayed_actions = function(type){}; + + /** + * To get a list of all actions of a given action handler. + * @param {String} handler_id + */ + this.get_actions_with_handler_id = function(handler_id){}; + + /** + * To the label for a given mode. + * @param {String} handler_id + * @param {String} mode + */ + this.get_label_with_handler_id_and_mode = function(handler_id, mode){}; + + /** + * To the global action handler. + * Any action, which was not cancelled by the focused action handler, + * gets passed to the global action handler. + */ + this.get_global_handler = function(){}; + + /** + * To subscribe to the click handler. + * @param {Object} setter. So far the setter must be an instance of ContextMenu + * @param {Function} handler. The callback for the click event. + */ + this.set_setter_click_handler = function(setter, handler){}; + + /** + * To unsubscribe to the click handler. + * @param {Object} setter. Only the setter of the click handler can unsubscribe. + */ + this.clear_setter_click_handler = function(setter){}; + + /** + * To get a shortcut for a given handler and action. + * @param {String} handler_id + * @param {String} action + */ + this.get_shortcut_with_handler_and_action = function(handler_id, action){}; + + this.get_action_container = function(){}; + + this.get_current_handler_id = function(){}; + + this.focus_handler = function(handler_id, event){}; + + /** + * To get the label for shared shortcuts. + * @param {String} shared_shortcuts + */ + this.get_shared_shortcuts_label = function(shared_shortcuts){}; + + /* constants */ + + const GLOBAL_HANDLER = ActionBroker.GLOBAL_HANDLER_ID; + const MAX_CONTEXT_QUEUE_LENGTH = 10; + + /* private */ + + this._handlers = {}; + this._inherited_handlers = {}; + this._action_context = null; + this._action_context_id = ''; + this._container = null; + this._shortcuts = null; + this._global_shortcuts = null; + this._current_shortcuts = null; + this._current_shared_shortcuts = null; + this._global_handler = new GlobalActionHandler(GLOBAL_HANDLER); + this._delays = {}; + this._modal_click_handler_setter = null; + this._modal_click_handler = null; + this._shared_shortcuts_labels = {}; + + this._set_action_context_bound = (function(event) + { + if (this._contextmenu.is_visible && event.type == 'click') + { + this._contextmenu.modal_click_handler(event); + return true; + } + if (event.target == this._last_event_target) + { + return; + } + if (!(this._action_context && this._action_context.onclick(event) === false)) + { + var container = event.target; + while (container && container.nodeType == 1 && + container.parentNode && + container.parentNode.nodeType == 1 && + !/^(?:top-|panel-|window-)?(?:container|toolbar|tabs)$/i.test(container.nodeName)) + container = container.parentNode; + + switch (container && container.nodeName.toLowerCase() || '') + { + case 'container': + case 'panel-container': + case 'window-container': + { + var ui_obj = UIBase.getUIById(container.getAttribute('ui-id')); + if (ui_obj) + { + this._set_current_handler(ui_obj.view_id, event, container); + } + break; + } + // TODO set according key handler, e.g. toolbar, tab + default: + { + this._set_current_handler(GLOBAL_HANDLER, event, container); + } + } + return true; + } + // pass the event alsways to the global handler + // so that the global mode is correct + this._global_handler.onclick(event); + return false; + }).bind(this); + + this._set_current_handler = function(handler_id, event, container) + { + if (handler_id != this._action_context_id) + { + if (this._action_context) + this._action_context.blur(); + this._action_context = this._handlers[handler_id] || this._global_handler; + this._action_context_id = this._action_context.id; + this._current_shortcuts = this._shortcuts[this._action_context_id] || {}; + this._current_shared_shortcuts = this._shortcuts[this._action_context.shared_shortcuts] || {}; + this._container = container || document.documentElement; + this._action_context.focus(event, container); + this._context_queue.push(handler_id); + while (this._context_queue.length && + this._context_queue.length > MAX_CONTEXT_QUEUE_LENGTH) + { + this._context_queue.shift(); + } + } + } + + this._oncontextmenubound = function(event) + { + if (this._set_action_context_bound(event) !== false) + this._contextmenu.oncontextmenu(event); + if (!event.shiftKey) + event.preventDefault(); + }.bind(this); + + this._onhideviewbound = function(msg) + { + var handler_id = msg.id; + var view = null; + if (handler_id == this._action_context_id) + { + while (this._context_queue.length) + { + handler_id = this._context_queue.pop(); + view = window.views[handler_id]; + if (view && view.isvisible()) + { + // Workaround to reset the focus to the a given view. + // Needs a proper design. + // Also used in js source view. + var container = view.get_container(); + if (container) + container.dispatchMouseEvent('click'); + + return; + } + } + this._set_current_handler(this._global_handler.id); + } + }.bind(this); + + this._init = function() + { + this._key_identifier = new KeyIdentifier(this.dispatch_key_input.bind(this), + window.ini.browser); + this.register_handler(this._global_handler); + this._contextmenu = ContextMenu.get_instance(); + window.app.addListener('services-created', function() + { + this._context_queue = []; + this._shortcuts = this._retrieve_shortcuts(); + this._global_shortcuts = this._shortcuts.global; + this._key_identifier.set_shortcuts(this._get_shortcut_keys()); + this._set_current_handler(this._global_handler.id); + document.addEventListener("contextmenu", this._oncontextmenubound, false); + document.addEventListener('click', this._set_action_context_bound, true); + document.addEventListener('focus', this._set_action_context_bound, true); + window.messages.addListener('hide-view', this._onhideviewbound); + window.messages.post('shortcuts-changed'); + }.bind(this)); + }; + + /* handling of the shortcuts map */ + + this._retrieve_shortcuts = function() + { + var stored_shortcuts = window.settings.general.get("shortcuts"); + var default_shortcuts = window.helpers.copy_object(window.ini.default_shortcuts); + if (stored_shortcuts) + { + var shortcuts_hash = window.settings.general.get("shortcuts-hash"); + if (this._hash_shortcuts(default_shortcuts) != shortcuts_hash) + { + try + { + stored_shortcuts = this._sync_shortcuts(default_shortcuts, stored_shortcuts); + this._store_shortcuts(stored_shortcuts); + } + catch(e) + { + stored_shortcuts = null; + window.settings.general.set("shortcuts", null); + window.settings.general.set("shortcuts-hash", ""); + (new AlertDialog(ui_strings.D_SHORTCUTS_UPDATE_FAILED)).show(); + } + } + } + return stored_shortcuts || default_shortcuts; + }; + + this._store_shortcuts = function(shortcuts) + { + var hash = shortcuts && this._hash_shortcuts(window.ini.default_shortcuts) || ""; + window.settings.general.set("shortcuts", shortcuts); + window.settings.general.set("shortcuts-hash", hash); + }; + + this._sync_shortcuts = function(source, target) + { + for (var prop in source) + { + if (typeof source[prop] == 'object') + { + if (!target.hasOwnProperty(prop)) + { + target[prop] = {}; + } + this._sync_shortcuts(source[prop], target[prop]); + } + else + { + if (!target.hasOwnProperty(prop)) + { + target[prop] = source[prop]; + } + } + } + return target; + }; + + this._hash_shortcuts = function(shortcuts) + { + return JSON.stringify(shortcuts).replace(/["{},:\- ]/g, ''); + }; + + /* implementation */ + + this.register_handler = function(action_handler) + { + if (!(action_handler && action_handler.id)) + throw 'missing id on action_handler in ActionBroker.instance.register_handler'; + this._handlers[action_handler.id] = action_handler; + if (action_handler.shared_shortcuts) + { + this._inherited_handlers[action_handler.shared_shortcuts] = action_handler; + if (action_handler.shared_shortcuts_label) + { + this._shared_shortcuts_labels[action_handler.shared_shortcuts] = + action_handler.shared_shortcuts_label; + } + } + } + + this.dispatch_action = function(action_handler_id, action_id, event, target) + { + this._handlers[action_handler_id].handle(action_id, event, target); + } + + this.dispatch_key_input = function(key_id, event) + { + if (this._action_context.check_mode) + this._action_context.check_mode(event); + + var shortcuts = this._current_shortcuts[this._action_context.mode] || {}; + var shared_shortcuts = this._current_shared_shortcuts[this._action_context.mode] || {}; + var action = shortcuts[key_id] || shared_shortcuts[key_id] || ''; + var propagate_event = true; + if (action) + { + propagate_event = this._action_context.handle(action, + event, + this._container); + } + + if (!(propagate_event === false) && + this._action_context != this._global_handler) + { + // to ensure that the global action handler uses the correct mode + // even if it's not the current action handler + this._global_handler.check_mode(event); + shortcuts = this._global_shortcuts[this._global_handler.mode]; + action = shortcuts && shortcuts[key_id] || ''; + if (action) + propagate_event = this._global_handler.handle(action, + event, + this._container); + } + + if (propagate_event === false) + { + event.stopPropagation(); + event.preventDefault(); + } + } + + this.delay_action = function(type, handler_id, action_id, event, target) + { + if (!this._delays.hasOwnProperty(type)) + { + this._delays[type] = new Timeouts(); + } + var cb = this.dispatch_action.bind(this, handler_id, action_id, event, target); + this._delays[type].set(cb, 300); + } + + this.clear_delayed_actions = function(type) + { + if (this._delays[type]) + this._delays[type].clear(); + } + + this.get_shortcuts = function() + { + return window.helpers.copy_object(this._shortcuts); + } + + this.set_shortcuts = function(shortcuts, handler_id, clear_setting) + { + shortcuts = window.helpers.copy_object(shortcuts); + if (handler_id) + this._shortcuts[handler_id] = shortcuts; + else + this._shortcuts = shortcuts; + this._global_shortcuts = this._shortcuts.global; + this._store_shortcuts(clear_setting == true ? null : this._shortcuts); + this._key_identifier.set_shortcuts(this._get_shortcut_keys()); + window.messages.post('shortcuts-changed'); + }; + + this.get_actions_with_handler_id = function(handler_id) + { + + return ( + (this._handlers[handler_id] && this._handlers[handler_id].get_action_list().sort()) || + (this._inherited_handlers[handler_id] && this._inherited_handlers[handler_id].get_action_list().sort()) + ); + }; + + this._get_shortcut_keys = function() + { + var ret = [], name = '', handler = null, mode = '', key = ''; + for (name in this._shortcuts) + { + handler = this._shortcuts[name]; + for (mode in handler) + { + for (key in handler[mode]) + { + if (ret.indexOf(key) == -1) + ret.push(key); + } + } + } + return ret; + }; + + this.get_label_with_handler_id_and_mode = function(handler_id, mode) + { + return (this._handlers[handler_id] && this._handlers[handler_id].mode_labels[mode]) || + (this._inherited_handlers[handler_id] && this._inherited_handlers[handler_id].mode_labels[mode]); + }; + + this.get_global_handler = function() + { + return this._global_handler; + }; + + this.set_setter_click_handler = function(setter, handler) + { + if (setter instanceof ContextMenu) + { + this._modal_click_handler_setter = setter; + this._modal_click_handler = handler; + } + }; + + this.clear_setter_click_handler = function(setter) + { + if (setter == this._modal_click_handler_setter) + { + this._modal_click_handler_setter = null; + this._modal_click_handler = null; + } + }; + + this.get_shortcut_with_handler_and_action = function(handler_id, action) + { + var + shortcuts = this._shortcuts && this._shortcuts[handler_id], + shortcuts_mode = null, + mode = '', + key = ''; + + if (shortcuts) + for (mode in shortcuts) + { + shortcuts_mode = shortcuts[mode]; + for (key in shortcuts_mode) + if (shortcuts_mode[key] == action) + return key; + } + return ''; + }; + + this.get_action_container = function() + { + return this._container; + } + + this.get_current_handler_id = function() + { + return this._action_context_id; + }; + + this.focus_handler = function(handler_id, event) + { + var view = window.views[handler_id]; + if (view && view.isvisible() && this._handlers[handler_id]) + { + this._last_event_target = event.target; + this._set_current_handler(handler_id, event, view.get_container()); + } + }; + + this.get_shared_shortcuts_label = function(shared_shortcuts) + { + return this._shared_shortcuts_labels[shared_shortcuts] || ""; + }; + + if (document.readyState == "complete") + this._init(); + else + document.addEventListener('DOMContentLoaded', this._init.bind(this), false); + +} + +ActionBroker.get_instance = function() +{ + return this.instance || new ActionBroker(); +} + +ActionBroker.GLOBAL_HANDLER_ID = "global"; diff --git a/src/ui-scripts/actions/globalactionhandler.js b/src/ui-scripts/actions/globalactionhandler.js index 7e0fa640a..ca8d385b8 100644 --- a/src/ui-scripts/actions/globalactionhandler.js +++ b/src/ui-scripts/actions/globalactionhandler.js @@ -1,423 +1,423 @@ -var GlobalActionHandler = function(id) -{ - /* interface */ - /** - * A view id to identify an action handler. - */ - this.id = id; - - /** - * To handle a single action. - * Returning false (as in === false) will cancel the event - * (preventDefault and stopPropagation), - * true will pass it to the next level if any. - * @param {String} action_id - * @param {Event} event - * @param {Element} target - */ - this.handle = function(action_id, event, target){}; - - /** - * To get a list of supported actions. - */ - this.get_action_list = function(){}; - - /** - * Gets called if an action handler changes to be the current context. - */ - this.focus = function(container){}; - - /** - * Gets called if an action handle stops to be the current context. - */ - this.blur = function(){}; - - /** - * Gets called if an action handler is the current context. - * Returning false (as in === false) will cancel the event - * (preventDefault and stopPropagation), - * true will pass it to the next level if any. - */ - this.onclick = function(event){}; - - /** - * To check and set the mode independent of the focused action handler. - * Special method for the global action handler. - */ - this.check_mode = function(event){}; - - /** - * To register a shortcut listener with a unique id token - * on a global input element. Global as not being part of a view pane, e.g. - * an input in a toolbar. - * @param {String} listener_id. A unique token. - * @param {Function} callback - * @param {Array} action_list. A list of action supported by - * that listener, optional. - */ - this.register_shortcut_listener = function(listener_id, callback, action_list){}; - - /** - * To register a serach panel. - * This is used to focus the panel with an according shortcut. - */ - this.register_search_panel = function(view_id){}; - - /* constants */ - - const - MODE_DEFAULT = "default", - MODE_EDIT = "edit", - RE_TEXT_INPUTS = GlobalActionHandler.RE_TEXT_INPUTS; - - this.mode = MODE_DEFAULT; - - this.mode_labels = - { - "default": ui_strings.S_LABEL_KEYBOARDCONFIG_MODE_DEFAULT, - "edit": ui_strings.S_LABEL_KEYBOARDCONFIG_MODE_EDIT, - } - - /* privat */ - - this._broker = ActionBroker.get_instance(); - this._handlers = {}; - this._private_handlers = []; - this._listener_handlers = []; - this._sc_listeners = {}; - this._search_panels = []; - - this.get_action_list = function() - { - var actions = [], key = ''; - for (key in this._handlers) - { - if (this._private_handlers.indexOf(key) == -1) - { - actions.push(key); - } - } - return actions.concat(this._listener_handlers); - }; - - this._continue_with_mode = function(mode, action_id, event, target) - { - window.views.js_source.clearLinePointer(); - window.views.callstack.clearView(); - window.views.inspection.clearView(); - window.stop_at.continue_thread(mode, true); - return false; - }; - - [ - 'run', - 'step-next-line', - 'step-into-call', - 'step-out-of-call', - ].forEach(function(mode) - { - this._handlers['continue-' + mode] = this._continue_with_mode.bind(this, mode); - }, this); - - this._handlers["select-all"] = function(action_id, event, target) - { - if (this._selection_controller.is_selectable(target)) - { - var selection = getSelection(); - var range = document.createRange(); - selection.removeAllRanges(); - range.selectNodeContents(target); - selection.addRange(range); - } - return false; - }.bind(this); - - this._handlers["invert-spotlight-colors"] = function(action_id, event, target) - { - window.hostspotlighter.invertColors(); - return false; - }; - - this._handlers["show-script-dropdown"] = function(action_id, event, target) - { - var ui = UI.get_instance(); - ui.show_view("js_source"); - ui.show_dropdown("js-script-select"); - }; - - this._close_open_menus = function() - { - var contextmenu = ContextMenu.get_instance(); - if (contextmenu.is_visible) - { - contextmenu.dismiss(); - return true; - } - var has_opened_select = CstSelectBase.close_opened_select(); - return has_opened_select; - }; - - this._handlers["toggle-console"] = function(action_id, event, target) - { - var has_open_menus = this._close_open_menus(); - if (has_open_menus || window.views['color-selector'].cancel_edit_color()) - { - return; - } - - if (this.mode == MODE_EDIT) - { - var sc_listener = event.target.get_attr('parent-node-chain', 'shortcuts'); - if (sc_listener && sc_listener in this._sc_listeners && - this._sc_listeners[sc_listener](action_id, event, target) === false) - { - return false; - } - - // Prevent ESC from opening/closing console when in edit mode, - // except if we're actually in the console - if (this._broker.get_current_handler_id() != "command_line") - { - return; - } - } - - var overlay = Overlay.get_instance(); - if (overlay.is_visible) - { - this._handlers["hide-overlay"](action_id, event, target); - return; - } - - return this._handlers["toggle-commandline"](action_id, event, target); - - }.bind(this); - - this._handlers["toggle-commandline"] = function(action_id, event, target) - { - var visible = (window.views.command_line && window.views.command_line.isvisible()); - var button = UI.get_instance().get_button("toggle-console"); - visible ? button.removeClass("is-active") : button.addClass("is-active"); - - if (!visible) - { - UIWindowBase.showWindow('command_line', - Math.ceil(innerHeight/2), 0, - innerWidth, Math.floor(innerHeight/2)); - ActionBroker.get_instance().focus_handler("command_line", event); - } - else - { - UIWindowBase.closeWindow('command_line'); - } - - return false; - }.bind(this); - - this._handlers["reload-context"] = function(action_id, event, target) - { - runtimes.reloadWindow(); - - return false; - }; - - this._handlers["show-overlay"] = function(action_id, event, target) - { - const OVERLAY_TOP_MARGIN = 10; - const OVERLAY_RIGHT_MARGIN = 20; - const ADJUST = 2; // TODO: where does this actually come from - - var overlay = Overlay.get_instance(); - var ui = UI.get_instance(); - var overlay_id = target.getAttribute("data-overlay-id"); - - ui.get_button("toggle-" + overlay_id).addClass("is-active"); - - overlay.show(overlay_id); - - if (target) - { - var button_dims = target.getBoundingClientRect(); - var element = overlay.element.querySelector("overlay-window"); - var arrow = overlay.element.querySelector("overlay-arrow"); - var arrow_width = arrow.getBoundingClientRect().width; - element.style.top = button_dims.bottom + OVERLAY_TOP_MARGIN + "px"; - element.addClass("attached"); - arrow.style.right = Math.floor(document.documentElement.clientWidth - OVERLAY_RIGHT_MARGIN - - button_dims.right - (arrow_width / 2) + (button_dims.width / 2) - ADJUST) + "px"; - } - - var first_button = overlay.element.querySelector("button, input[type='button'], .ui-button"); - if (first_button) - { - first_button.focus(); - } - }; - this._private_handlers.push("show-overlay"); - - this._handlers["hide-overlay"] = function(action_id, event, target) - { - var overlay = Overlay.get_instance(); - var ui = UI.get_instance(); - var client = window.client.current_client; - var overlay_id = overlay.active_overlay; - - ui.get_button("toggle-" + overlay_id).removeClass("is-active"); - - if (overlay_id == "remote-debug-overlay" && (!client || !client.connected)) - { - var button = UI.get_instance().get_button("toggle-remote-debug-overlay"); - if (button) - button.removeClass("alert"); - eventHandlers.click['cancel-remote-debug'](); // TODO: make a proper action - } - - overlay.hide(); - }; - this._private_handlers.push("hide-overlay"); - - this._handlers["navigate-next-top-tab"] = function(action_id, event, target) - { - window.topCell.tab.navigate_to_next_or_previous_tab(false); - return false; - }; - - this._handlers["navigate-previous-top-tab"] = function(action_id, event, target) - { - window.topCell.tab.navigate_to_next_or_previous_tab(true); - return false; - }; - - this._handlers["show-search"] = function(action_id, event, target) - { - var ui = UI.get_instance(); - var search = ui.get_visible_tabs().filter(function(view_id) - { - return this._search_panels.contains(view_id); - }, this)[0]; - if (search) - { - ui.show_view(search).focus_search_field(); - return false; - } - }.bind(this); - - var TestTempView = function(name) - { - this.createView = function(container) - { - container.innerHTML = - "

Test view, id: " + this.id + "

"; - }; - this.init(name); - }; - - TestTempView.prototype = new TempView(); - - this._handlers["add-temp-test-view"] = function(action_id, event, target) - { - var test_view = new TestTempView('Hello'); - var ui = UI.get_instance(); - ui.get_tabbar("request").add_tab(test_view.id); - ui.show_view(test_view.id); - return false; - }; - - /* implementation */ - - this.handle = function(action_id, event, target) - { - if (action_id in this._handlers && - this._handlers[action_id](action_id, event, target) == false) - { - return false; - } - var sc_listener = event.target.get_attr('parent-node-chain', 'shortcuts'); - if (sc_listener && sc_listener in this._sc_listeners) - { - return this._sc_listeners[sc_listener](action_id, event, target); - } - } - - this.focus = function(event, container) - { - var node_name = event && event.target.nodeName.toLowerCase(); - if (event && (node_name == "input" && RE_TEXT_INPUTS.test(event.target.type)) - || node_name == "textarea" - ) - { - this.mode = MODE_EDIT; - } - else - { - this.mode = MODE_DEFAULT; - } - }; - - this.check_mode = this.onclick = this.focus; - - this.register_shortcut_listener = function(listener_id, callback, action_list) - { - this._sc_listeners[listener_id] = callback; - if (action_list) - action_list.forEach(function(action) - { - if (this._listener_handlers.indexOf(action) == -1) - this._listener_handlers.push(action); - }, this); - }; - - this.register_search_panel = function(view_id) - { - if (!this._search_panels.contains(view_id)) - { - this._search_panels.push(view_id); - } - }; - - /* instatiation */ - - var is_not_selectable = '.info-box'; - var is_selectable = 'container:not(.side-panel)' + - ':not(.network-options-container)' + - ':not(.screenshot-controls),' + - 'panel-container,' + - 'window-container,' + - '.tooltip-container,' + - '.selectable'; - - this._selection_controller = new SelectionController(is_selectable, is_not_selectable); - - /* message handling */ - messages.addListener("before-show-view", function(msg) { - if (msg.id == "console_panel") - { - var is_visible = (window.views.command_line && window.views.command_line.isvisible()); - if (is_visible) - { - var button = UI.get_instance().get_button("toggle-console"); - is_visible ? button.removeClass("is-active") : button.addClass("is-active"); - UIWindowBase.closeWindow('command_line'); - } - } - }); - -}; - -GlobalActionHandler.RE_TEXT_INPUTS = new RegExp(["text", - "search", - "tel", - "url", - "email", - "password", - "datetime", - "date", - "month", - "week", - "time", - "datetime-local", - "number", - "file", - "color"].join("|"), "i"); - - +var GlobalActionHandler = function(id) +{ + /* interface */ + /** + * A view id to identify an action handler. + */ + this.id = id; + + /** + * To handle a single action. + * Returning false (as in === false) will cancel the event + * (preventDefault and stopPropagation), + * true will pass it to the next level if any. + * @param {String} action_id + * @param {Event} event + * @param {Element} target + */ + this.handle = function(action_id, event, target){}; + + /** + * To get a list of supported actions. + */ + this.get_action_list = function(){}; + + /** + * Gets called if an action handler changes to be the current context. + */ + this.focus = function(container){}; + + /** + * Gets called if an action handle stops to be the current context. + */ + this.blur = function(){}; + + /** + * Gets called if an action handler is the current context. + * Returning false (as in === false) will cancel the event + * (preventDefault and stopPropagation), + * true will pass it to the next level if any. + */ + this.onclick = function(event){}; + + /** + * To check and set the mode independent of the focused action handler. + * Special method for the global action handler. + */ + this.check_mode = function(event){}; + + /** + * To register a shortcut listener with a unique id token + * on a global input element. Global as not being part of a view pane, e.g. + * an input in a toolbar. + * @param {String} listener_id. A unique token. + * @param {Function} callback + * @param {Array} action_list. A list of action supported by + * that listener, optional. + */ + this.register_shortcut_listener = function(listener_id, callback, action_list){}; + + /** + * To register a serach panel. + * This is used to focus the panel with an according shortcut. + */ + this.register_search_panel = function(view_id){}; + + /* constants */ + + const + MODE_DEFAULT = "default", + MODE_EDIT = "edit", + RE_TEXT_INPUTS = GlobalActionHandler.RE_TEXT_INPUTS; + + this.mode = MODE_DEFAULT; + + this.mode_labels = + { + "default": ui_strings.S_LABEL_KEYBOARDCONFIG_MODE_DEFAULT, + "edit": ui_strings.S_LABEL_KEYBOARDCONFIG_MODE_EDIT, + } + + /* privat */ + + this._broker = ActionBroker.get_instance(); + this._handlers = {}; + this._private_handlers = []; + this._listener_handlers = []; + this._sc_listeners = {}; + this._search_panels = []; + + this.get_action_list = function() + { + var actions = [], key = ''; + for (key in this._handlers) + { + if (this._private_handlers.indexOf(key) == -1) + { + actions.push(key); + } + } + return actions.concat(this._listener_handlers); + }; + + this._continue_with_mode = function(mode, action_id, event, target) + { + window.views.js_source.clearLinePointer(); + window.views.callstack.clearView(); + window.views.inspection.clearView(); + window.stop_at.continue_thread(mode, true); + return false; + }; + + [ + 'run', + 'step-next-line', + 'step-into-call', + 'step-out-of-call', + ].forEach(function(mode) + { + this._handlers['continue-' + mode] = this._continue_with_mode.bind(this, mode); + }, this); + + this._handlers["select-all"] = function(action_id, event, target) + { + if (this._selection_controller.is_selectable(target)) + { + var selection = getSelection(); + var range = document.createRange(); + selection.removeAllRanges(); + range.selectNodeContents(target); + selection.addRange(range); + } + return false; + }.bind(this); + + this._handlers["invert-spotlight-colors"] = function(action_id, event, target) + { + window.hostspotlighter.invertColors(); + return false; + }; + + this._handlers["show-script-dropdown"] = function(action_id, event, target) + { + var ui = UI.get_instance(); + ui.show_view("js_source"); + ui.show_dropdown("js-script-select"); + }; + + this._close_open_menus = function() + { + var contextmenu = ContextMenu.get_instance(); + if (contextmenu.is_visible) + { + contextmenu.dismiss(); + return true; + } + var has_opened_select = CstSelectBase.close_opened_select(); + return has_opened_select; + }; + + this._handlers["toggle-console"] = function(action_id, event, target) + { + var has_open_menus = this._close_open_menus(); + if (has_open_menus || window.views['color-selector'].cancel_edit_color()) + { + return; + } + + if (this.mode == MODE_EDIT) + { + var sc_listener = event.target.get_attr('parent-node-chain', 'shortcuts'); + if (sc_listener && sc_listener in this._sc_listeners && + this._sc_listeners[sc_listener](action_id, event, target) === false) + { + return false; + } + + // Prevent ESC from opening/closing console when in edit mode, + // except if we're actually in the console + if (this._broker.get_current_handler_id() != "command_line") + { + return; + } + } + + var overlay = Overlay.get_instance(); + if (overlay.is_visible) + { + this._handlers["hide-overlay"](action_id, event, target); + return; + } + + return this._handlers["toggle-commandline"](action_id, event, target); + + }.bind(this); + + this._handlers["toggle-commandline"] = function(action_id, event, target) + { + var visible = (window.views.command_line && window.views.command_line.isvisible()); + var button = UI.get_instance().get_button("toggle-console"); + visible ? button.removeClass("is-active") : button.addClass("is-active"); + + if (!visible) + { + UIWindowBase.showWindow('command_line', + Math.ceil(innerHeight/2), 0, + innerWidth, Math.floor(innerHeight/2)); + ActionBroker.get_instance().focus_handler("command_line", event); + } + else + { + UIWindowBase.closeWindow('command_line'); + } + + return false; + }.bind(this); + + this._handlers["reload-context"] = function(action_id, event, target) + { + runtimes.reloadWindow(); + + return false; + }; + + this._handlers["show-overlay"] = function(action_id, event, target) + { + const OVERLAY_TOP_MARGIN = 10; + const OVERLAY_RIGHT_MARGIN = 20; + const ADJUST = 2; // TODO: where does this actually come from + + var overlay = Overlay.get_instance(); + var ui = UI.get_instance(); + var overlay_id = target.getAttribute("data-overlay-id"); + + ui.get_button("toggle-" + overlay_id).addClass("is-active"); + + overlay.show(overlay_id); + + if (target) + { + var button_dims = target.getBoundingClientRect(); + var element = overlay.element.querySelector("overlay-window"); + var arrow = overlay.element.querySelector("overlay-arrow"); + var arrow_width = arrow.getBoundingClientRect().width; + element.style.top = button_dims.bottom + OVERLAY_TOP_MARGIN + "px"; + element.addClass("attached"); + arrow.style.right = Math.floor(document.documentElement.clientWidth - OVERLAY_RIGHT_MARGIN - + button_dims.right - (arrow_width / 2) + (button_dims.width / 2) - ADJUST) + "px"; + } + + var first_button = overlay.element.querySelector("button, input[type='button'], .ui-button"); + if (first_button) + { + first_button.focus(); + } + }; + this._private_handlers.push("show-overlay"); + + this._handlers["hide-overlay"] = function(action_id, event, target) + { + var overlay = Overlay.get_instance(); + var ui = UI.get_instance(); + var client = window.client.current_client; + var overlay_id = overlay.active_overlay; + + ui.get_button("toggle-" + overlay_id).removeClass("is-active"); + + if (overlay_id == "remote-debug-overlay" && (!client || !client.connected)) + { + var button = UI.get_instance().get_button("toggle-remote-debug-overlay"); + if (button) + button.removeClass("alert"); + eventHandlers.click['cancel-remote-debug'](); // TODO: make a proper action + } + + overlay.hide(); + }; + this._private_handlers.push("hide-overlay"); + + this._handlers["navigate-next-top-tab"] = function(action_id, event, target) + { + window.topCell.tab.navigate_to_next_or_previous_tab(false); + return false; + }; + + this._handlers["navigate-previous-top-tab"] = function(action_id, event, target) + { + window.topCell.tab.navigate_to_next_or_previous_tab(true); + return false; + }; + + this._handlers["show-search"] = function(action_id, event, target) + { + var ui = UI.get_instance(); + var search = ui.get_visible_tabs().filter(function(view_id) + { + return this._search_panels.contains(view_id); + }, this)[0]; + if (search) + { + ui.show_view(search).focus_search_field(); + return false; + } + }.bind(this); + + var TestTempView = function(name) + { + this.createView = function(container) + { + container.innerHTML = + "

Test view, id: " + this.id + "

"; + }; + this.init(name); + }; + + TestTempView.prototype = new TempView(); + + this._handlers["add-temp-test-view"] = function(action_id, event, target) + { + var test_view = new TestTempView('Hello'); + var ui = UI.get_instance(); + ui.get_tabbar("request").add_tab(test_view.id); + ui.show_view(test_view.id); + return false; + }; + + /* implementation */ + + this.handle = function(action_id, event, target) + { + if (action_id in this._handlers && + this._handlers[action_id](action_id, event, target) == false) + { + return false; + } + var sc_listener = event.target.get_attr('parent-node-chain', 'shortcuts'); + if (sc_listener && sc_listener in this._sc_listeners) + { + return this._sc_listeners[sc_listener](action_id, event, target); + } + } + + this.focus = function(event, container) + { + var node_name = event && event.target.nodeName.toLowerCase(); + if (event && (node_name == "input" && RE_TEXT_INPUTS.test(event.target.type)) + || node_name == "textarea" + ) + { + this.mode = MODE_EDIT; + } + else + { + this.mode = MODE_DEFAULT; + } + }; + + this.check_mode = this.onclick = this.focus; + + this.register_shortcut_listener = function(listener_id, callback, action_list) + { + this._sc_listeners[listener_id] = callback; + if (action_list) + action_list.forEach(function(action) + { + if (this._listener_handlers.indexOf(action) == -1) + this._listener_handlers.push(action); + }, this); + }; + + this.register_search_panel = function(view_id) + { + if (!this._search_panels.contains(view_id)) + { + this._search_panels.push(view_id); + } + }; + + /* instatiation */ + + var is_not_selectable = '.info-box'; + var is_selectable = 'container:not(.side-panel)' + + ':not(.network-options-container)' + + ':not(.screenshot-controls),' + + 'panel-container,' + + 'window-container,' + + '.tooltip-container,' + + '.selectable'; + + this._selection_controller = new SelectionController(is_selectable, is_not_selectable); + + /* message handling */ + messages.addListener("before-show-view", function(msg) { + if (msg.id == "console_panel") + { + var is_visible = (window.views.command_line && window.views.command_line.isvisible()); + if (is_visible) + { + var button = UI.get_instance().get_button("toggle-console"); + is_visible ? button.removeClass("is-active") : button.addClass("is-active"); + UIWindowBase.closeWindow('command_line'); + } + } + }); + +}; + +GlobalActionHandler.RE_TEXT_INPUTS = new RegExp(["text", + "search", + "tel", + "url", + "email", + "password", + "datetime", + "date", + "month", + "week", + "time", + "datetime-local", + "number", + "file", + "color"].join("|"), "i"); + + diff --git a/src/ui-scripts/tooltip/tooltip.js b/src/ui-scripts/tooltip/tooltip.js index 642e267c4..f2b46e114 100644 --- a/src/ui-scripts/tooltip/tooltip.js +++ b/src/ui-scripts/tooltip/tooltip.js @@ -1,487 +1,487 @@ -var Tooltips = function() {}; - -Tooltips.CSS_TOOLTIP_SELECTED = "tooltip-selected"; - -(function() -{ - /* static methods of TooltipManager */ - - this.register = function(name, keep_on_hover, set_selected, max_height_target) {}; - this.unregister = function(name, tooltip) {}; - this.is_inside_tooltip = function(event, close_if_not_inside) {}; - - var Tooltip = function(keep_on_hover, set_selected, max_height_target) - { - this._init(keep_on_hover, set_selected, max_height_target); - }; - - Tooltip.prototype = new function() - { - /* interface */ - - /** - * Called if a node in the current mouseover parent node chaine of the - * event target has a 'data-tooltip' value with the same name as this instance. - * To show the tooltip the 'show' method must be called, mainly to - * prevent that the tooltip is shown before it has content. - */ - this.ontooltip = function(event, target){}; - - /** - * Called if the tooltip gets hidden. - */ - this.onhide = function(){}; - - this.ontooltipenter = function(){}; - - this.ontooltipleave = function(){}; - - this.ontooltipclick = function(){}; - - /** - * To show the tooltip. - * By default the tooltip is positioned in relation to the element - * with the data-tooltip attribute, the tooltip-target. If the method - * is called with the optional 'box' argument that box is used - * instead to position the tooltip. - * @param content {String or Template} The content for the tooltip. Optional. - * If not set the 'data-tooltip-text' value on the target element will be - * used instead. - * @param box The box to position the tooltip. Optional. The top, bottom, - * right and left property describe the position and dimension of the - * tooltip-target. Additionally the box needs a mouse_x and a mouse_y - * position. If the height of the tooltip-target is less than 1/3 of - * the window height, it is displayed above or beyond the tooltip-target, - * either on the left or the right side of the mouse-x position and vice - * versa if the hight is bigger. By default the box is created - * automatically with the mouse position and the target. - */ - this.show = function(content, box){}; - - /** - * To hide the tooltip. - */ - this.hide = function(){}; - - this._init = function(keep_on_hover, set_selected, max_height_target) - { - this.keep_on_hover = keep_on_hover; - this.set_selected = set_selected; - this.max_height_target = max_height_target; - } - - /* implementation */ - - this.show = function(content, box) - { - return _show_tooltip(this, content, box); - }; - - this.hide = function() - { - _hide_tooltip(this); - }; - - /** - * Default implementation. - */ - this.ontooltip = function(event, target) - { - this.show(); - }; - }; - - /* constants */ - - const DATA_TOOLTIP = "data-tooltip"; - const DATA_TOOLTIP_TEXT = "data-tooltip-text"; - const HOVER_DELAY = 70; - const DISTANCE_X = 5; - const DISTANCE_Y = 5; - const MARGIN_Y = 30; - const MARGIN_X = 30; - - /* private */ - - var _contextmenu = null; - var _tooltips = {}; - var _tooltip_ctxs = []; - var _ctx_stack = []; - var _cur_ctx = null; - var _is_setup = false; - - var _window_width = 0; - var _window_height = 0; - var _padding_width = -1; - var _padding_height = -1; - var _hover_delay = 0; - var _hover_events = []; - - var store_window_dimensions = function() - { - _window_width = window.innerWidth; - _window_height = window.innerHeight; - }; - - var _push_ctx = function() - { - if (!_tooltip_ctxs[_ctx_stack.length]) - _tooltip_ctxs.push(new TooltipContext()); - - _ctx_stack.push(_tooltip_ctxs[_ctx_stack.length]); - _cur_ctx = _ctx_stack.last; - }; - - var _mouseover = function(event) - { - _hover_events.push(event); - if (!_hover_delay) - _hover_delay = setTimeout(_handle_mouseover, HOVER_DELAY); - }; - - var _handle_mouseover = function() - { - _hover_delay = 0; - var event = _hover_events.last; - while (_hover_events.length) - _hover_events.pop(); - - if (!event || (_contextmenu && _contextmenu.is_visible)) - return; - - var ele = event.target; - var index = _ctx_stack.length - 1; - var ctx = null; - - for (; ctx = _ctx_stack[index]; index--) - { - if (ctx.tooltip_ele.contains(ele)) - break; - } - - if (index > -1 && ctx == _ctx_stack.last) - { - if (ctx.current_tooltip && ctx.current_tooltip.keep_on_hover) - { - ctx.handle_mouse_enter(event); - ctx.last_handler_ele = null; - ctx.last_box = null; - ctx.clear_show_timeout(); - ctx.clear_hide_timeout(); - ctx.accept_call = true; - _push_ctx(); - } - else - { - ctx.set_hide_timeout(); - return; - } - } - else - { - while (_ctx_stack.length > index + 1) - { - _ctx_stack.last.handle_mouse_leave(event); - if (_ctx_stack.length == index + 2) - break; - - else - _ctx_stack.pop().hide_tooltip(); - } - } - - _cur_ctx = _ctx_stack.last; - - while (ele && ele.nodeType == Node.ELEMENT_NODE) - { - var name = ele.getAttribute(DATA_TOOLTIP); - if (name && _tooltips[name]) - { - if (ele == _cur_ctx.last_handler_ele) - return; - - if (_cur_ctx.current_tooltip != _tooltips[name]) - { - _cur_ctx.hide_tooltip(); - _cur_ctx.current_tooltip = _tooltips[name]; - } -/* - // Set the z-index dynamically to make sure the tooltip is - // always displayed at the top. - var z_index = "auto"; - var ancestor = ele && ele.offsetParent; - while (ancestor) - { - var value = Number(getComputedStyle(ancestor).zIndex); - if (!isNaN(value)) - { - z_index = value + 1; - break; - } - ancestor = ancestor.offsetParent; - } - _cur_ctx.tooltip_ele.style.zIndex = z_index; -*/ - _cur_ctx.accept_call = true; - _cur_ctx.last_handler_ele = ele; - _cur_ctx.last_box = ele.getBoundingClientRect(); - _cur_ctx.last_event = event; - _cur_ctx.set_show_timeout(); - return; - } - - ele = ele.parentNode; - } - - if (_cur_ctx.current_tooltip) - _cur_ctx.accept_call = false; - - _cur_ctx.set_hide_timeout(); - }; - - var _show_tooltip = function(tooltip, content, box) - { - var ret = null; - if (_cur_ctx && tooltip == _cur_ctx.current_tooltip && - _cur_ctx.accept_call) - { - // read and store the style properties of the tooltip container - if (_padding_width == -1) - { - var style = getComputedStyle(_cur_ctx.tooltip_ele, null); - _padding_width = 0; - _padding_height = 0; - ["padding-left", - "border-left-width", - "padding-right", - "border-right-width", - "padding-top", - "border-top-width", - "padding-bottom", - "border-bottom-width"].forEach(function(prop) - { - var value = parseInt(style.getPropertyValue(prop)); - if (value) - { - if (prop.contains("left") || prop.contains("right")) - _padding_width += value; - else - _padding_height += value; - } - }); - } - - if (!content && _cur_ctx.last_handler_ele) - content = ["span", - _cur_ctx.last_handler_ele.getAttribute(DATA_TOOLTIP_TEXT), - "class", "basic-tooltip"]; - - if (content) - { - _cur_ctx.tooltip_ele.scrollTop = 0; - _cur_ctx.tooltip_ele.scrollLeft = 0; - ret = typeof content == "string" - ? (_cur_ctx.tooltip_ele.textContent = content) - : _cur_ctx.tooltip_ele.clearAndRender(content); - } - - if (!box && _cur_ctx.last_box) - { - box = {top: _cur_ctx.last_box.top, - bottom: _cur_ctx.last_box.bottom, - left: _cur_ctx.last_box.left, - right: _cur_ctx.last_box.right}; - - if (_cur_ctx.last_event) - { - box.mouse_x = _cur_ctx.last_event.clientX; - box.mouse_y = _cur_ctx.last_event.clientY; - } - else - { - box.mouse_x = Math.floor(box.left + (box.right - box.left) / 2); - box.mouse_y = Math.floor(box.top + (box.bottom - box.top) / 2); - } - } - - if (box) - { - var max_h = 0; - var max_w = 0; - var max_height_target = tooltip.max_height_target - && _cur_ctx.tooltip_ele.querySelector(tooltip.max_height_target) - || _cur_ctx.tooltip_ele; - - _cur_ctx.select_last_handler_ele(); - - if (box.bottom - box.top < _window_height / 3 || - Math.max(box.left, _window_width - box.right) < _window_height / 3) - { - // positioning horizontally - if (_window_height - box.bottom > box.top) - { - var top = box.bottom + DISTANCE_Y; - _cur_ctx.tooltip_ele.style.top = top + "px"; - _cur_ctx.tooltip_ele.style.bottom = "auto"; - max_h = _window_height - top - MARGIN_Y - _padding_height; - max_height_target.style.maxHeight = max_h + "px"; - } - else - { - var bottom = _window_height - box.top + DISTANCE_Y; - _cur_ctx.tooltip_ele.style.bottom = bottom + "px"; - _cur_ctx.tooltip_ele.style.top = "auto"; - max_h = _window_height - bottom - MARGIN_Y - _padding_height; - max_height_target.style.maxHeight = max_h + "px"; - } - - if (box.mouse_x < _window_width / 2) - { - var left = box.mouse_x + DISTANCE_X; - _cur_ctx.tooltip_ele.style.left = left + "px"; - _cur_ctx.tooltip_ele.style.right = "auto"; - max_w = _window_width - left - MARGIN_X - _padding_width; - max_height_target.style.maxWidth = max_w + "px"; - } - else - { - var right = _window_width - box.mouse_x + DISTANCE_X; - _cur_ctx.tooltip_ele.style.right = right + "px"; - _cur_ctx.tooltip_ele.style.left = "auto"; - max_w = _window_width - right - MARGIN_X - _padding_width; - max_height_target.style.maxWidth = max_w + "px"; - } - - } - else - { - // positioning vertically - if (_window_width - box.right > box.left) - { - var left = box.right + DISTANCE_X; - _cur_ctx.tooltip_ele.style.left = left + "px"; - _cur_ctx.tooltip_ele.style.right = "auto"; - max_w = _window_width - left - MARGIN_X - _padding_width; - max_height_target.style.maxWidth = max_w + "px"; - } - else - { - var right = box.left - DISTANCE_X; - _cur_ctx.tooltip_ele.style.right = right + "px"; - _cur_ctx.tooltip_ele.style.left = "auto"; - max_w = right - MARGIN_X - _padding_width; - max_height_target.style.maxWidth = max_w + "px"; - } - - if (box.mouse_y < _window_height / 2) - { - var top = box.mouse_y + DISTANCE_Y; - _cur_ctx.tooltip_ele.style.top = top + "px"; - _cur_ctx.tooltip_ele.style.bottom = "auto"; - max_h = _window_height - top - MARGIN_Y - _padding_height; - max_height_target.style.maxHeight = max_h + "px"; - } - else - { - var bottom = _window_height - box.mouse_y - DISTANCE_Y; - _cur_ctx.tooltip_ele.style.bottom = bottom + "px"; - _cur_ctx.tooltip_ele.style.top = "auto"; - max_h = box.mouse_y - MARGIN_Y - _padding_height; - max_height_target.style.maxHeight = max_h + "px"; - } - } - } - } - - return ret; - }; - - var _hide_tooltip = function(tooltip) - { - if (!_cur_ctx) - return; - - var index = _ctx_stack.length - 1; - var ctx = _ctx_stack[index]; - while (ctx && index > -1) - { - if (ctx.current_tooltip && tooltip == ctx.current_tooltip && ctx.accept_call) - { - while (_ctx_stack.length > index + 1) - _ctx_stack.pop().hide_tooltip(true); - - ctx.hide_tooltip(true); - _cur_ctx = ctx; - break; - } - ctx = _ctx_stack[--index] - } - }; - - var _setup = function() - { - if ("ContextMenu" in window) - _contextmenu = ContextMenu.get_instance(); - - _push_ctx(); - document.addEventListener("mouseover", _mouseover, false); - document.documentElement.addEventListener("mouseleave", _mouseover, false); - window.addEventListener("resize", store_window_dimensions, false); - store_window_dimensions(); - }; - - /* implementation */ - - this.register = function(name, keep_on_hover, set_selected, max_height_target) - { - if (!_is_setup) - { - if (document.readyState == "complete") - _setup(); - else - document.addEventListener("DOMContentLoaded", _setup, false); - _is_setup = true; - } - - if (typeof set_selected != "boolean") - set_selected = true; - - _tooltips[name] = new Tooltip(keep_on_hover, set_selected, max_height_target); - return _tooltips[name]; - }; - - this.unregister = function(name, tooltip) - { - if (_tooltips[name] && _tooltips[name] == tooltip) - _tooltips[name] = null; - }; - - this.is_in_target_chain = function(event) - { - for (var i = 0, ctx; ctx = _ctx_stack[i]; i++) - { - if (ctx.tooltip_ele.contains(event.target)) - return true; - } - return false; - }; - - this.handle_contextmenu_event = function(event) - { - if (_cur_ctx && !_cur_ctx.tooltip_ele.contains(event.target)) - _cur_ctx.hide_tooltip(); - }; - - this.hide_tooltip = function() - { - if (_cur_ctx) - { - while (_ctx_stack.length > 1) - _ctx_stack.pop().hide_tooltip(); - - _cur_ctx = _ctx_stack.last; - _cur_ctx.hide_tooltip(); - } - }; - -}).apply(Tooltips); +var Tooltips = function() {}; + +Tooltips.CSS_TOOLTIP_SELECTED = "tooltip-selected"; + +(function() +{ + /* static methods of TooltipManager */ + + this.register = function(name, keep_on_hover, set_selected, max_height_target) {}; + this.unregister = function(name, tooltip) {}; + this.is_inside_tooltip = function(event, close_if_not_inside) {}; + + var Tooltip = function(keep_on_hover, set_selected, max_height_target) + { + this._init(keep_on_hover, set_selected, max_height_target); + }; + + Tooltip.prototype = new function() + { + /* interface */ + + /** + * Called if a node in the current mouseover parent node chaine of the + * event target has a 'data-tooltip' value with the same name as this instance. + * To show the tooltip the 'show' method must be called, mainly to + * prevent that the tooltip is shown before it has content. + */ + this.ontooltip = function(event, target){}; + + /** + * Called if the tooltip gets hidden. + */ + this.onhide = function(){}; + + this.ontooltipenter = function(){}; + + this.ontooltipleave = function(){}; + + this.ontooltipclick = function(){}; + + /** + * To show the tooltip. + * By default the tooltip is positioned in relation to the element + * with the data-tooltip attribute, the tooltip-target. If the method + * is called with the optional 'box' argument that box is used + * instead to position the tooltip. + * @param content {String or Template} The content for the tooltip. Optional. + * If not set the 'data-tooltip-text' value on the target element will be + * used instead. + * @param box The box to position the tooltip. Optional. The top, bottom, + * right and left property describe the position and dimension of the + * tooltip-target. Additionally the box needs a mouse_x and a mouse_y + * position. If the height of the tooltip-target is less than 1/3 of + * the window height, it is displayed above or beyond the tooltip-target, + * either on the left or the right side of the mouse-x position and vice + * versa if the hight is bigger. By default the box is created + * automatically with the mouse position and the target. + */ + this.show = function(content, box){}; + + /** + * To hide the tooltip. + */ + this.hide = function(){}; + + this._init = function(keep_on_hover, set_selected, max_height_target) + { + this.keep_on_hover = keep_on_hover; + this.set_selected = set_selected; + this.max_height_target = max_height_target; + } + + /* implementation */ + + this.show = function(content, box) + { + return _show_tooltip(this, content, box); + }; + + this.hide = function() + { + _hide_tooltip(this); + }; + + /** + * Default implementation. + */ + this.ontooltip = function(event, target) + { + this.show(); + }; + }; + + /* constants */ + + const DATA_TOOLTIP = "data-tooltip"; + const DATA_TOOLTIP_TEXT = "data-tooltip-text"; + const HOVER_DELAY = 70; + const DISTANCE_X = 5; + const DISTANCE_Y = 5; + const MARGIN_Y = 30; + const MARGIN_X = 30; + + /* private */ + + var _contextmenu = null; + var _tooltips = {}; + var _tooltip_ctxs = []; + var _ctx_stack = []; + var _cur_ctx = null; + var _is_setup = false; + + var _window_width = 0; + var _window_height = 0; + var _padding_width = -1; + var _padding_height = -1; + var _hover_delay = 0; + var _hover_events = []; + + var store_window_dimensions = function() + { + _window_width = window.innerWidth; + _window_height = window.innerHeight; + }; + + var _push_ctx = function() + { + if (!_tooltip_ctxs[_ctx_stack.length]) + _tooltip_ctxs.push(new TooltipContext()); + + _ctx_stack.push(_tooltip_ctxs[_ctx_stack.length]); + _cur_ctx = _ctx_stack.last; + }; + + var _mouseover = function(event) + { + _hover_events.push(event); + if (!_hover_delay) + _hover_delay = setTimeout(_handle_mouseover, HOVER_DELAY); + }; + + var _handle_mouseover = function() + { + _hover_delay = 0; + var event = _hover_events.last; + while (_hover_events.length) + _hover_events.pop(); + + if (!event || (_contextmenu && _contextmenu.is_visible)) + return; + + var ele = event.target; + var index = _ctx_stack.length - 1; + var ctx = null; + + for (; ctx = _ctx_stack[index]; index--) + { + if (ctx.tooltip_ele.contains(ele)) + break; + } + + if (index > -1 && ctx == _ctx_stack.last) + { + if (ctx.current_tooltip && ctx.current_tooltip.keep_on_hover) + { + ctx.handle_mouse_enter(event); + ctx.last_handler_ele = null; + ctx.last_box = null; + ctx.clear_show_timeout(); + ctx.clear_hide_timeout(); + ctx.accept_call = true; + _push_ctx(); + } + else + { + ctx.set_hide_timeout(); + return; + } + } + else + { + while (_ctx_stack.length > index + 1) + { + _ctx_stack.last.handle_mouse_leave(event); + if (_ctx_stack.length == index + 2) + break; + + else + _ctx_stack.pop().hide_tooltip(); + } + } + + _cur_ctx = _ctx_stack.last; + + while (ele && ele.nodeType == Node.ELEMENT_NODE) + { + var name = ele.getAttribute(DATA_TOOLTIP); + if (name && _tooltips[name]) + { + if (ele == _cur_ctx.last_handler_ele) + return; + + if (_cur_ctx.current_tooltip != _tooltips[name]) + { + _cur_ctx.hide_tooltip(); + _cur_ctx.current_tooltip = _tooltips[name]; + } +/* + // Set the z-index dynamically to make sure the tooltip is + // always displayed at the top. + var z_index = "auto"; + var ancestor = ele && ele.offsetParent; + while (ancestor) + { + var value = Number(getComputedStyle(ancestor).zIndex); + if (!isNaN(value)) + { + z_index = value + 1; + break; + } + ancestor = ancestor.offsetParent; + } + _cur_ctx.tooltip_ele.style.zIndex = z_index; +*/ + _cur_ctx.accept_call = true; + _cur_ctx.last_handler_ele = ele; + _cur_ctx.last_box = ele.getBoundingClientRect(); + _cur_ctx.last_event = event; + _cur_ctx.set_show_timeout(); + return; + } + + ele = ele.parentNode; + } + + if (_cur_ctx.current_tooltip) + _cur_ctx.accept_call = false; + + _cur_ctx.set_hide_timeout(); + }; + + var _show_tooltip = function(tooltip, content, box) + { + var ret = null; + if (_cur_ctx && tooltip == _cur_ctx.current_tooltip && + _cur_ctx.accept_call) + { + // read and store the style properties of the tooltip container + if (_padding_width == -1) + { + var style = getComputedStyle(_cur_ctx.tooltip_ele, null); + _padding_width = 0; + _padding_height = 0; + ["padding-left", + "border-left-width", + "padding-right", + "border-right-width", + "padding-top", + "border-top-width", + "padding-bottom", + "border-bottom-width"].forEach(function(prop) + { + var value = parseInt(style.getPropertyValue(prop)); + if (value) + { + if (prop.contains("left") || prop.contains("right")) + _padding_width += value; + else + _padding_height += value; + } + }); + } + + if (!content && _cur_ctx.last_handler_ele) + content = ["span", + _cur_ctx.last_handler_ele.getAttribute(DATA_TOOLTIP_TEXT), + "class", "basic-tooltip"]; + + if (content) + { + _cur_ctx.tooltip_ele.scrollTop = 0; + _cur_ctx.tooltip_ele.scrollLeft = 0; + ret = typeof content == "string" + ? (_cur_ctx.tooltip_ele.textContent = content) + : _cur_ctx.tooltip_ele.clearAndRender(content); + } + + if (!box && _cur_ctx.last_box) + { + box = {top: _cur_ctx.last_box.top, + bottom: _cur_ctx.last_box.bottom, + left: _cur_ctx.last_box.left, + right: _cur_ctx.last_box.right}; + + if (_cur_ctx.last_event) + { + box.mouse_x = _cur_ctx.last_event.clientX; + box.mouse_y = _cur_ctx.last_event.clientY; + } + else + { + box.mouse_x = Math.floor(box.left + (box.right - box.left) / 2); + box.mouse_y = Math.floor(box.top + (box.bottom - box.top) / 2); + } + } + + if (box) + { + var max_h = 0; + var max_w = 0; + var max_height_target = tooltip.max_height_target + && _cur_ctx.tooltip_ele.querySelector(tooltip.max_height_target) + || _cur_ctx.tooltip_ele; + + _cur_ctx.select_last_handler_ele(); + + if (box.bottom - box.top < _window_height / 3 || + Math.max(box.left, _window_width - box.right) < _window_height / 3) + { + // positioning horizontally + if (_window_height - box.bottom > box.top) + { + var top = box.bottom + DISTANCE_Y; + _cur_ctx.tooltip_ele.style.top = top + "px"; + _cur_ctx.tooltip_ele.style.bottom = "auto"; + max_h = _window_height - top - MARGIN_Y - _padding_height; + max_height_target.style.maxHeight = max_h + "px"; + } + else + { + var bottom = _window_height - box.top + DISTANCE_Y; + _cur_ctx.tooltip_ele.style.bottom = bottom + "px"; + _cur_ctx.tooltip_ele.style.top = "auto"; + max_h = _window_height - bottom - MARGIN_Y - _padding_height; + max_height_target.style.maxHeight = max_h + "px"; + } + + if (box.mouse_x < _window_width / 2) + { + var left = box.mouse_x + DISTANCE_X; + _cur_ctx.tooltip_ele.style.left = left + "px"; + _cur_ctx.tooltip_ele.style.right = "auto"; + max_w = _window_width - left - MARGIN_X - _padding_width; + max_height_target.style.maxWidth = max_w + "px"; + } + else + { + var right = _window_width - box.mouse_x + DISTANCE_X; + _cur_ctx.tooltip_ele.style.right = right + "px"; + _cur_ctx.tooltip_ele.style.left = "auto"; + max_w = _window_width - right - MARGIN_X - _padding_width; + max_height_target.style.maxWidth = max_w + "px"; + } + + } + else + { + // positioning vertically + if (_window_width - box.right > box.left) + { + var left = box.right + DISTANCE_X; + _cur_ctx.tooltip_ele.style.left = left + "px"; + _cur_ctx.tooltip_ele.style.right = "auto"; + max_w = _window_width - left - MARGIN_X - _padding_width; + max_height_target.style.maxWidth = max_w + "px"; + } + else + { + var right = box.left - DISTANCE_X; + _cur_ctx.tooltip_ele.style.right = right + "px"; + _cur_ctx.tooltip_ele.style.left = "auto"; + max_w = right - MARGIN_X - _padding_width; + max_height_target.style.maxWidth = max_w + "px"; + } + + if (box.mouse_y < _window_height / 2) + { + var top = box.mouse_y + DISTANCE_Y; + _cur_ctx.tooltip_ele.style.top = top + "px"; + _cur_ctx.tooltip_ele.style.bottom = "auto"; + max_h = _window_height - top - MARGIN_Y - _padding_height; + max_height_target.style.maxHeight = max_h + "px"; + } + else + { + var bottom = _window_height - box.mouse_y - DISTANCE_Y; + _cur_ctx.tooltip_ele.style.bottom = bottom + "px"; + _cur_ctx.tooltip_ele.style.top = "auto"; + max_h = box.mouse_y - MARGIN_Y - _padding_height; + max_height_target.style.maxHeight = max_h + "px"; + } + } + } + } + + return ret; + }; + + var _hide_tooltip = function(tooltip) + { + if (!_cur_ctx) + return; + + var index = _ctx_stack.length - 1; + var ctx = _ctx_stack[index]; + while (ctx && index > -1) + { + if (ctx.current_tooltip && tooltip == ctx.current_tooltip && ctx.accept_call) + { + while (_ctx_stack.length > index + 1) + _ctx_stack.pop().hide_tooltip(true); + + ctx.hide_tooltip(true); + _cur_ctx = ctx; + break; + } + ctx = _ctx_stack[--index] + } + }; + + var _setup = function() + { + if ("ContextMenu" in window) + _contextmenu = ContextMenu.get_instance(); + + _push_ctx(); + document.addEventListener("mouseover", _mouseover, false); + document.documentElement.addEventListener("mouseleave", _mouseover, false); + window.addEventListener("resize", store_window_dimensions, false); + store_window_dimensions(); + }; + + /* implementation */ + + this.register = function(name, keep_on_hover, set_selected, max_height_target) + { + if (!_is_setup) + { + if (document.readyState == "complete") + _setup(); + else + document.addEventListener("DOMContentLoaded", _setup, false); + _is_setup = true; + } + + if (typeof set_selected != "boolean") + set_selected = true; + + _tooltips[name] = new Tooltip(keep_on_hover, set_selected, max_height_target); + return _tooltips[name]; + }; + + this.unregister = function(name, tooltip) + { + if (_tooltips[name] && _tooltips[name] == tooltip) + _tooltips[name] = null; + }; + + this.is_in_target_chain = function(event) + { + for (var i = 0, ctx; ctx = _ctx_stack[i]; i++) + { + if (ctx.tooltip_ele.contains(event.target)) + return true; + } + return false; + }; + + this.handle_contextmenu_event = function(event) + { + if (_cur_ctx && !_cur_ctx.tooltip_ele.contains(event.target)) + _cur_ctx.hide_tooltip(); + }; + + this.hide_tooltip = function() + { + if (_cur_ctx) + { + while (_ctx_stack.length > 1) + _ctx_stack.pop().hide_tooltip(); + + _cur_ctx = _ctx_stack.last; + _cur_ctx.hide_tooltip(); + } + }; + +}).apply(Tooltips); diff --git a/src/ui-strings/ui_strings-en.js b/src/ui-strings/ui_strings-en.js index 4d2f403b3..775630325 100644 --- a/src/ui-strings/ui_strings-en.js +++ b/src/ui-strings/ui_strings-en.js @@ -12,1728 +12,1716 @@ window.ui_strings.lang_code = "en"; * M Menus */ -/* DESC: Confirm dialog text for asking if the user wants to redo the search because the context has changed. */ -ui_strings.D_REDO_SEARCH = "The searched document no longer exists.\nRepeat search in the current document?"; - -/* DESC: Confirm dialog text for asking if the user wants to reload and reformat the scripts now. */ -ui_strings.D_REFORMAT_SCRIPTS = "Reload the page to reformat the scripts now?"; - -/* DESC: Confirm dialog text for asking if the user wants to reload all scripts. */ -ui_strings.D_RELOAD_SCRIPTS = "Not all scripts are loaded. Do you want to reload the page?"; - -/* DESC: Alert dialog that updating of the custom shortcuts with new ones has failed. */ -ui_strings.D_SHORTCUTS_UPDATE_FAILED = "Failed to sync custom shortcuts. The shortcuts are reset to the default ones."; - -/* DESC: Context menu item for adding an attribute in the DOM view. */ -ui_strings.M_CONTEXTMENU_ADD_ATTRIBUTE = "Add attribute"; - -/* DESC: Context menu item for adding a breakpoint. */ -ui_strings.M_CONTEXTMENU_ADD_BREAKPOINT = "Add breakpoint"; - -/* DESC: Context menu item to add a color in the color palette. */ -ui_strings.M_CONTEXTMENU_ADD_COLOR = "Add color"; - -/* DESC: Context menu item for breakpoints to add a condition. */ -ui_strings.M_CONTEXTMENU_ADD_CONDITION = "Add condition"; - -/* DESC: Context menu item for adding a declaration in a rule. */ -ui_strings.M_CONTEXTMENU_ADD_DECLARATION = "Add declaration"; - -/* DESC: Context menu item for adding a something to watches. */ -ui_strings.M_CONTEXTMENU_ADD_WATCH = "Watch \"%s\""; - -/* DESC: Context menu item for collapsing a node subtree. */ -ui_strings.M_CONTEXTMENU_COLLAPSE_SUBTREE = "Collapse subtree"; - -/* DESC: Context menu item, general "Delete" in a context, e.g. a breakpoint */ -ui_strings.M_CONTEXTMENU_DELETE = "Delete"; - -/* DESC: Context menu item, general "Delete all" in a context, e.g. breakpoints */ -ui_strings.M_CONTEXTMENU_DELETE_ALL = "Delete all"; - -/* DESC: Context menu item for deleting all breakpoints */ -ui_strings.M_CONTEXTMENU_DELETE_ALL_BREAKPOINTS = "Delete all breakpoints"; - -/* DESC: Context menu item for deleting a breakpoint. */ -ui_strings.M_CONTEXTMENU_DELETE_BREAKPOINT = "Delete breakpoint"; - -/* DESC: Context menu item to delete a color in the color palette. */ -ui_strings.M_CONTEXTMENU_DELETE_COLOR = "Delete color"; - -/* DESC: Context menu item for breakpoints to delete a condition. */ -ui_strings.M_CONTEXTMENU_DELETE_CONDITION = "Delete condition"; - -/* DESC: Context menu item, general "Disable all" in a context, e.g. breakpoints */ -ui_strings.M_CONTEXTMENU_DISABLE_ALL = "Disable all"; - -/* DESC: Context menu item for disabling all breakpoints */ -ui_strings.M_CONTEXTMENU_DISABLE_ALL_BREAKPOINTS = "Disable all breakpoints"; - -/* DESC: Context menu item for disabling a breakpoint. */ -ui_strings.M_CONTEXTMENU_DISABLE_BREAKPOINT = "Disable breakpoint"; - -/* DESC: Context menu item for disabling a breakpoint. */ -ui_strings.M_CONTEXTMENU_DISABLE_BREAKPOINT = "Disable breakpoint"; - -/* DESC: Context menu item for disabling all declarations in a rule. */ -ui_strings.M_CONTEXTMENU_DISABLE_DECLARATIONS = "Disable all declarations"; - -/* DESC: Context menu item for editing an attribute name in the DOM view. */ -ui_strings.M_CONTEXTMENU_EDIT_ATTRIBUTE = "Edit attribute"; - -/* DESC: Context menu item for editing an attribute value in the DOM view. */ -ui_strings.M_CONTEXTMENU_EDIT_ATTRIBUTE_VALUE = "Edit attribute value"; - -/* DESC: Context menu item to edit a color in the color palette. */ -ui_strings.M_CONTEXTMENU_EDIT_COLOR = "Edit color"; - -/* DESC: Context menu item for breakpoints to edit a condition. */ -ui_strings.M_CONTEXTMENU_EDIT_CONDITION = "Edit condition"; - -/* DESC: Context menu item for editiing a declaration in a rule. */ -ui_strings.M_CONTEXTMENU_EDIT_DECLARATION = "Edit declaration"; - -/* DESC: Context menu item for editing some piece of markup in the DOM view. */ -ui_strings.M_CONTEXTMENU_EDIT_MARKUP = "Edit markup"; - -/* DESC: Context menu item for editing text in the DOM view. */ -ui_strings.M_CONTEXTMENU_EDIT_TEXT = "Edit text"; - -/* DESC: Context menu item for enabling a breakpoint. */ -ui_strings.M_CONTEXTMENU_ENABLE_BREAKPOINT = "Enable breakpoint"; - -/* DESC: Context menu item for expanding a node subtree. */ -ui_strings.M_CONTEXTMENU_EXPAND_SUBTREE = "Expand subtree"; - -/* DESC: Context menu item for showing the color picker. */ -ui_strings.M_CONTEXTMENU_OPEN_COLOR_PICKER = "Open color picker"; - -/* DESC: Context menu item for removing a property in a rule. */ -ui_strings.M_CONTEXTMENU_REMOVE_DECLARATION = "Delete declaration"; - -/* DESC: Context menu item for removing a node in the DOM view. */ -ui_strings.M_CONTEXTMENU_REMOVE_NODE = "Delete node"; - -/* DESC: Show resource context menu entry. */ -ui_strings.M_CONTEXTMENU_SHOW_RESOURCE = "Show resource"; - -/* DESC: Context menu item for specification links. */ -ui_strings.M_CONTEXTMENU_SPEC_LINK = "Specification for \"%s\""; - -/* DESC: Context menu item for adding an item in the storage view. */ -ui_strings.M_CONTEXTMENU_STORAGE_ADD = "Add item"; - -/* DESC: Context menu item for deleting an item in the storage view. */ -ui_strings.M_CONTEXTMENU_STORAGE_DELETE = "Delete item"; - -/* DESC: Context menu item for editing an item in the storage view, where %s is the domain name. */ -ui_strings.M_CONTEXTMENU_STORAGE_DELETE_ALL_FROM = "Delete all from %s"; - -/* DESC: Context menu item for deleting multiple items in the storage view. */ -ui_strings.M_CONTEXTMENU_STORAGE_DELETE_PLURAL = "Delete items"; - -/* DESC: Context menu item for editing an item in the storage view. */ -ui_strings.M_CONTEXTMENU_STORAGE_EDIT = "Edit item"; - -/* DESC: Label for option that clears all errors */ -ui_strings.M_LABEL_CLEAR_ALL_ERRORS = "Clear all errors"; - -/* DESC: Label for user interface language dropdown in settings */ -ui_strings.M_LABEL_UI_LANGUAGE = "User interface language"; - -/* DESC: Label for request body input in network crafter */ -ui_strings.M_NETWORK_CRAFTER_REQUEST_BODY = "Request body"; - -/* DESC: Label for response body input in network crafter */ -ui_strings.M_NETWORK_CRAFTER_RESPONSE_BODY = "Response"; - -/* DESC: Label for send request button in network crafter */ -ui_strings.M_NETWORK_CRAFTER_SEND = "Send request"; - -/* DESC: Label for request duration */ -ui_strings.M_NETWORK_REQUEST_DETAIL_DURATION = "Duration"; - -/* DESC: Label for get response body int network request view */ -ui_strings.M_NETWORK_REQUEST_DETAIL_GET_RESPONSE_BODY_LABEL = "Get response body"; - -/* DESC: Label request status */ -ui_strings.M_NETWORK_REQUEST_DETAIL_STATUS = "Status"; - -/* DESC: General settings label. */ -ui_strings.M_SETTING_LABEL_GENERAL = "General"; - -/* DESC: Context menu entry to selecting to group by %s */ -ui_strings.M_SORTABLE_TABLE_CONTEXT_GROUP_BY = "Group by \"%s\""; - -/* DESC: Context menu entry to select that there should be no grouping in the table */ -ui_strings.M_SORTABLE_TABLE_CONTEXT_NO_GROUPING = "No grouping"; - -/* DESC: Context menu entry to reset the columns that are shown */ -ui_strings.M_SORTABLE_TABLE_CONTEXT_RESET_COLUMNS = "Reset columns"; - -/* DESC: Context menu entry to reset the sort order */ -ui_strings.M_SORTABLE_TABLE_CONTEXT_RESET_SORT = "Reset sorting"; - -/* DESC: view that shows all resources */ -ui_strings.M_VIEW_LABEL_ALL_RESOURCES = "All resources"; - -/* DESC: view to set and remove breakpoints */ -ui_strings.M_VIEW_LABEL_BREAKPOINTS = "Breakpoints"; - -/* DESC: Tab heading for area for call stack overview, a list of function calls. */ -ui_strings.M_VIEW_LABEL_CALLSTACK = "Call Stack"; - -/* DESC: Label of the pixel magnifier and color picker view */ -ui_strings.M_VIEW_LABEL_COLOR_MAGNIFIER_AND_PICKER = "Pixel Magnifier and Color Picker"; - -/* DESC: View of the palette of the stored colors. */ -ui_strings.M_VIEW_LABEL_COLOR_PALETTE = "Color Palette"; - -/* DESC: View of the palette of the stored colors. */ -ui_strings.M_VIEW_LABEL_COLOR_PALETTE_SHORT = "Palette"; - -/* DESC: View with a screenshot to select a color. */ -ui_strings.M_VIEW_LABEL_COLOR_PICKER = "Color Picker"; - -/* DESC: Label of the section for selecting a color in color picker */ -ui_strings.M_VIEW_LABEL_COLOR_SELECT = "Color Select"; - -/* DESC: Command line. */ -ui_strings.M_VIEW_LABEL_COMMAND_LINE = "Console"; - -/* DESC: View for DOM debugging. */ -ui_strings.M_VIEW_LABEL_COMPOSITE_DOM = "Documents"; - -/* DESC: View for error log. */ -ui_strings.M_VIEW_LABEL_COMPOSITE_ERROR_CONSOLE = "Errors"; - -/* DESC: Tab heading for the view for exported code. */ -ui_strings.M_VIEW_LABEL_COMPOSITE_EXPORTS = "Export"; - -/* DESC: Tab heading for the view for script debuggingand Settings label. */ -ui_strings.M_VIEW_LABEL_COMPOSITE_SCRIPTS = "Scripts"; - -/* DESC: Menu heading, expandable, for displaying the styles that the rendering computed from all stylesheets. */ -ui_strings.M_VIEW_LABEL_COMPUTED_STYLE = "Computed Style"; - -/* DESC: The view on the console. */ -ui_strings.M_VIEW_LABEL_CONSOLE = "Error Panels"; - -/* DESC: view for cookies */ -ui_strings.M_VIEW_LABEL_COOKIES = "Cookies"; - -/* DESC: View to see the DOM tree. */ -ui_strings.M_VIEW_LABEL_DOM = "DOM Panel"; - -/* DESC: Tab heading for the list of properties of a selected DOM node and a Settings label. */ -ui_strings.M_VIEW_LABEL_DOM_ATTR = "Properties"; - -/* DESC: Tab heading for area giving information of the runtime environment. */ -ui_strings.M_VIEW_LABEL_ENVIRONMENT = "Environment"; - -/* DESC: Tab heading, subhead under the Error Console tab for the error view filter for showing all errors. */ -ui_strings.M_VIEW_LABEL_ERROR_ALL = "All"; - -/* DESC: See Opera Error console: Error view filter for showing all Bittorrent errors. */ -ui_strings.M_VIEW_LABEL_ERROR_BITTORRENT = "BitTorrent"; - -/* DESC: Tab heading, subhead under the Error Console tab for the error view filter for showing all CSS errors. */ -ui_strings.M_VIEW_LABEL_ERROR_CSS = "CSS"; - -/* DESC: Tab heading, subhead under the Error Console tab for the error view filter for showing all HTML errors. */ -ui_strings.M_VIEW_LABEL_ERROR_HTML = "HTML"; - -/* DESC: Tab heading, subhead under the Error Console tab for the error view filter for showing all Java errors. */ -ui_strings.M_VIEW_LABEL_ERROR_JAVA = "Java"; - -/* DESC: Tooltip that explains File:Line notation (e.g. in Error Log) */ -ui_strings.M_VIEW_LABEL_ERROR_LOCATION_TITLE = "Line %(LINE)s in %(URI)s"; - -/* DESC: Tab heading, subhead under the Error Console tab for the error view filter for showing all Mail errors. */ -ui_strings.M_VIEW_LABEL_ERROR_M2 = "Mail"; - -/* DESC: Tab heading, subhead under the Error Console tab for the error view filter for showing all Network errors. */ -ui_strings.M_VIEW_LABEL_ERROR_NETWORK = "Network"; - -/* DESC: Tab heading, subhead under the Error Console tab for the error view filter for showing errors that we don't have a dedicated tab for. */ -ui_strings.M_VIEW_LABEL_ERROR_OTHER = "Other"; - -/* DESC: Tab heading, subhead under the Error Console tab for the error view filter for showing all JS errors. */ -ui_strings.M_VIEW_LABEL_ERROR_SCRIPT = "JavaScript"; - -/* DESC: Tab heading, subhead under the Error Console tab for the error view filter for showing all Storage errors. */ -ui_strings.M_VIEW_LABEL_ERROR_STORAGE = "Storage"; - -/* DESC: Tab heading, subhead under the Error Console tab for the error view filter for showing all SVG errors. */ -ui_strings.M_VIEW_LABEL_ERROR_SVG = "SVG"; - -/* DESC: See Opera Error console: Error view filter for showing all Widget errors. */ -ui_strings.M_VIEW_LABEL_ERROR_WIDGET = "Widgets"; - -/* DESC: Tab heading, subhead under the Error Console tab for the error view filter for showing all XML errors. */ -ui_strings.M_VIEW_LABEL_ERROR_XML = "XML"; - -/* DESC: Tab heading, subhead under the Error Console tab for the error view filter for showing all XSLT errors. */ -ui_strings.M_VIEW_LABEL_ERROR_XSLT = "XSLT"; - -/* DESC: view to set and remove event breakpoints */ -ui_strings.M_VIEW_LABEL_EVENT_BREAKPOINTS = "Event Breakpoints"; - -/* DESC: Side panel view with event listeners. */ -ui_strings.M_VIEW_LABEL_EVENT_LISTENERS = "Listeners"; - -/* DESC: View with all event listeners. */ -ui_strings.M_VIEW_LABEL_EVENT_LISTENERS_ALL = "All"; - -/* DESC: View with the event listeners of the selected node. */ -ui_strings.M_VIEW_LABEL_EVENT_LISTENERS_SELECTED_NODE = "Selected node"; - -/* DESC: Heading for Export button, accessed by clicking the subhead DOM view button. */ -ui_strings.M_VIEW_LABEL_EXPORT = "Export"; - -/* DESC: Tab heading for the area displaying JS properties of a frame or object and a Settings label. */ -ui_strings.M_VIEW_LABEL_FRAME_INSPECTION = "Inspection"; - -/* DESC: Label for a utility window that enables the user to enter a line number, and go to that line. */ -ui_strings.M_VIEW_LABEL_GO_TO_LINE = "Go to line"; - -/* DESC: Tab heading for the box model layout display and a Settings label. */ -ui_strings.M_VIEW_LABEL_LAYOUT = "Layout"; - -/* DESC: view for the local storage */ -ui_strings.M_VIEW_LABEL_LOCAL_STORAGE = "Local Storage"; - -/* DESC: Label for the setting of the monospace font. */ -ui_strings.M_VIEW_LABEL_MONOSPACE_FONT = "Monospace Font"; - -/* DESC: Tab heading for the view for network debugging (and http logger) */ -ui_strings.M_VIEW_LABEL_NETWORK = "Network"; - -/* DESC: view that shows network log */ -ui_strings.M_VIEW_LABEL_NETWORK_LOG = "Network log"; - -/* DESC: view that shows network options */ -ui_strings.M_VIEW_LABEL_NETWORK_OPTIONS = "Network options"; - -/* DESC: Section title for new styles. */ -ui_strings.M_VIEW_LABEL_NEW_STYLE = "New Style"; - -/* DESC: Text to show in call stack when the execution is not stopped. */ -ui_strings.M_VIEW_LABEL_NOT_STOPPED = "Not stopped"; - -/* DESC: Text to show in breakpoins if there is no breakpoint. */ -ui_strings.M_VIEW_LABEL_NO_BREAKPOINT = "No breakpoint"; - -/* DESC: Text to show in inspection if there is no object to inspect. */ -ui_strings.M_VIEW_LABEL_NO_INSPECTION = "No inspection"; - -/* DESC: Text to show in watches if there are no watches */ -ui_strings.M_VIEW_LABEL_NO_WATCHES = "No watches"; - -/* DESC: View for DOM debugging. */ -ui_strings.M_VIEW_LABEL_PROFILER = "Profiler"; - -/* DESC: Name of raw request tab */ -ui_strings.M_VIEW_LABEL_RAW_REQUEST_INFO = "Raw request"; - -/* DESC: Name of raw response tab */ -ui_strings.M_VIEW_LABEL_RAW_RESPONSE_INFO = "Raw Response"; - -/* DESC: view that shows request crafter */ -ui_strings.M_VIEW_LABEL_REQUEST_CRAFTER = "Make request"; - -/* DESC: Name of request headers tab */ -ui_strings.M_VIEW_LABEL_REQUEST_HEADERS = "Request Headers"; - -/* DESC: Name of request log tab */ -ui_strings.M_VIEW_LABEL_REQUEST_LOG = "Request log"; - -/* DESC: Name of request summary view */ -ui_strings.M_VIEW_LABEL_REQUEST_SUMMARY = "Request Summary"; - -/* DESC: View for overview of resources contained in a document */ -ui_strings.M_VIEW_LABEL_RESOURCES = "Resources"; - -/* DESC: Name of response body tab */ -ui_strings.M_VIEW_LABEL_RESPONSE_BODY = "Response body"; - -/* DESC: Name of response headers tab */ -ui_strings.M_VIEW_LABEL_RESPONSE_HEADERS = "Response Headers"; - -/* DESC: side panel in the script view with the callstack and the inspection view. */ -ui_strings.M_VIEW_LABEL_RUNTIME_STATE = "State"; - -/* DESC: Subhead located under the Scripts area, for scripts contained in runtime. */ -ui_strings.M_VIEW_LABEL_SCRIPTS = "Scripts"; - -/* DESC: Tab heading for the search panel. */ -ui_strings.M_VIEW_LABEL_SEARCH = "Search"; - -/* DESC: view for the session storage */ -ui_strings.M_VIEW_LABEL_SESSION_STORAGE = "Session Storage"; - -/* DESC: Tab heading for area giving source code view and Settings label . */ -ui_strings.M_VIEW_LABEL_SOURCE = "Source"; - -/* DESC: View for all types of storage, cookies, localStorage, sessionStorage e.t.c */ -ui_strings.M_VIEW_LABEL_STORAGE = "Storage"; - -/* DESC: Label of the stored colors view */ -ui_strings.M_VIEW_LABEL_STORED_COLORS = "Color Palette"; - -/* DESC: Tab heading for the list of all applied styles and a Settings label; also menu heading, expandable, for displaying the styles that got defined in the style sheets. */ -ui_strings.M_VIEW_LABEL_STYLES = "Styles"; - -/* DESC: Tab heading for the view to see style sheet rules and a Settings label. */ -ui_strings.M_VIEW_LABEL_STYLESHEET = "Style Sheet"; - -/* DESC: Tab heading, a subhead under DOM, for area displaying style sheets in the runtime. */ -ui_strings.M_VIEW_LABEL_STYLESHEETS = "Style Sheets"; - -/* DESC: Tab heading for thread log overview, a list of threads and Settings label. */ -ui_strings.M_VIEW_LABEL_THREAD_LOG = "Thread Log"; - -/* DESC: View for utilities, e.g. a pixel maginfier and color picker */ -ui_strings.M_VIEW_LABEL_UTILITIES = "Utilities"; - -/* DESC: Label of the Views menu. */ -ui_strings.M_VIEW_LABEL_VIEWS = "Views"; - -/* DESC: section in the script side panel for watches. */ -ui_strings.M_VIEW_LABEL_WATCHES = "Watches"; - -/* DESC: view for widget prefernces */ -ui_strings.M_VIEW_LABEL_WIDGET_PREFERNCES = "Widget Preferences"; - -/* DESC: Label for the layout subview showing the box-model metrics of an element. */ -ui_strings.M_VIEW_SUB_LABEL_METRICS = "Metrics"; - -/* DESC: Label for the layout subvie showing offsets of the selected element. */ -ui_strings.M_VIEW_SUB_LABEL_OFFSET_VALUES = "Offset Values"; - -/* DESC: Label for the layout subview showing the parent node chain used to calculate the offset. */ -ui_strings.M_VIEW_SUB_LABEL_PARENT_OFFSETS = "Parent Offsets"; - -/* DESC: Anonymous function label. */ -ui_strings.S_ANONYMOUS_FUNCTION_NAME = ""; - -/* DESC: Info in a tooltip that the according listener was set as attribute. */ -ui_strings.S_ATTRIBUTE_LISTENER = "attribute listener"; - -/* DESC: Generic label for a cancel button */ -ui_strings.S_BUTTON_CANCEL = "Cancel"; - -/* DESC: Cancel button while the client is waiting for a host connection. */ -ui_strings.S_BUTTON_CANCEL_REMOTE_DEBUG = "Cancel Remote Debug"; - -/* DESC: Reset all the values to their default state */ -ui_strings.S_BUTTON_COLOR_RESTORE_DEFAULTS = "Restore defaults"; - -/* DESC: Edit custom events */ -ui_strings.S_BUTTON_EDIT_CUSTOM_EVENT = "Edit"; - -/* DESC: Enter anvanced search mode */ -ui_strings.S_BUTTON_ENTER_ADVANCED_SEARCH = "More"; - -/* DESC: Enter anvanced search mode tooltip */ -ui_strings.S_BUTTON_ENTER_ADVANCED_SEARCH_TOOLTIP = "Show advanced search"; - -/* DESC: Expand all sections in the event breakpoints view */ -ui_strings.S_BUTTON_EXPAND_ALL_SECTIONS = "Expand all sections"; - -/* DESC: Execution stops at encountering an abort. */ -ui_strings.S_BUTTON_LABEL_AT_ABORT = "Stop when encountering an abort message"; - -/* DESC: Execution stops when encountering an error. */ -ui_strings.S_BUTTON_LABEL_AT_ERROR = "Show parse errors and break on exceptions"; - -/* DESC: Execution stops when encountering an exception. */ -ui_strings.S_BUTTON_LABEL_AT_EXCEPTION = "Break when an exception is thrown"; - -/* DESC: Empties the log entries. */ -ui_strings.S_BUTTON_LABEL_CLEAR_LOG = "Clear visible errors"; - -/* DESC: Tooltip text for a button on the Thread Log view to clear thread log. */ -ui_strings.S_BUTTON_LABEL_CLEAR_THREAD_LOG = "Clear thread log"; - -/* DESC: Closes the window. */ -ui_strings.S_BUTTON_LABEL_CLOSE_WINDOW = "Close window"; - -/* DESC: Debugger continues debugging. */ -ui_strings.S_BUTTON_LABEL_CONTINUE = "Continue (%s)"; - -/* DESC: Exports the DOM currently shown. */ -ui_strings.S_BUTTON_LABEL_EXPORT_DOM = "Export the current DOM panel"; - -/* DESC: Also Tooltip text for a button on the Thread Log view to export current thread log. */ -ui_strings.S_BUTTON_LABEL_EXPORT_LOG = "Export thread log"; - -/* DESC: Tooltip text for a button under the secondary DOM tab that expands the DOM tree completely. */ -ui_strings.S_BUTTON_LABEL_GET_THE_WOHLE_TREE = "Expand the DOM tree"; - -/* DESC: Opens help. */ -ui_strings.S_BUTTON_LABEL_HELP = "Help"; - -/* DESC: Hides all default properties in the global scope. */ -ui_strings.S_BUTTON_LABEL_HIDE_DEFAULT_PROPS_IN_GLOBAL_SCOPE = "Show default properties in global scope"; - -/* DESC: List item under the Source settings menu to logs all threads when activated. Also Tooltip text for a button on the Source tab. */ -ui_strings.S_BUTTON_LABEL_LOG_THREADS = "Log threads"; - -/* DESC: Refetch the event listeners. */ -ui_strings.S_BUTTON_LABEL_REFETCH_EVENT_LISTENERS = "Refetch event listeners"; - -/* DESC: Enable reformatting of JavaScript. */ -ui_strings.S_BUTTON_LABEL_REFORMAT_JAVASCRIPT = "Pretty print JavaScript"; - -/* DESC: Tooltip text for a button under the Scripts tab that reloads the browser to receive fresh DOM, etc. */ -ui_strings.S_BUTTON_LABEL_RELOAD_HOST = "Reload the selected window in the browser"; - -/* DESC: For selecting which window to debug. */ -ui_strings.S_BUTTON_LABEL_SELECT_WINDOW = "Select the debugging context you want to debug"; - -/* DESC: Tooltip text for the Settings button that launches the Settings view. */ -ui_strings.S_BUTTON_LABEL_SETTINGS = "Settings"; - -/* DESC: Debugger step into current statement. */ -ui_strings.S_BUTTON_LABEL_STEP_INTO = "Step into (%s)"; - -/* DESC: Debugger step out from current statement. */ -ui_strings.S_BUTTON_LABEL_STEP_OUT = "Step out (%s)"; - -/* DESC: Debugger step over current statement. */ -ui_strings.S_BUTTON_LABEL_STEP_OVER = "Step over (%s)"; - -/* DESC: Execution stops when a new script is encountered. */ -ui_strings.S_BUTTON_LABEL_STOP_AT_THREAD = "Break on first statement of a new script"; - -/* DESC: Leave anvanced search mode */ -ui_strings.S_BUTTON_LEAVE_ADVANCED_SEARCH = "Less"; - -/* DESC: Leave anvanced search mode tooltip */ -ui_strings.S_BUTTON_LEAVE_ADVANCED_SEARCH_TOOLTIP = "Show search bar"; - -/* DESC: Button label to show window for loading a PO file */ -ui_strings.S_BUTTON_LOAD_PO_FILE = "Load PO file"; - -/* DESC: Generic label for an OK button */ -ui_strings.S_BUTTON_OK = "OK"; - -/* DESC: Remove all event breakpoints */ -ui_strings.S_BUTTON_REMOVE_ALL_BREAKPOINTS = "Delete all event breakpoints"; - -/* DESC: Reset all keyboard shortcuts to the default values. */ -ui_strings.S_BUTTON_RESET_ALL_TO_DEFAULTS = "Reset all to defaults"; - -/* DESC: Button label to reset the fon selection to the default values */ -ui_strings.S_BUTTON_RESET_TO_DEFAULTS = "Reset default values"; - -/* DESC: Generic label for a save button */ -ui_strings.S_BUTTON_SAVE = "Save"; - -/* DESC: Search for an event in the event breakpoints view */ -ui_strings.S_BUTTON_SEARCH_EVENT = "Search for an event"; - -/* DESC: Search for a keyboard shortcut in the keyboard configuration view */ -ui_strings.S_BUTTON_SEARCH_SHORTCUT = "Search keyboard shortcuts"; - -/* DESC: Set the default value. */ -ui_strings.S_BUTTON_SET_DEFAULT_VALUE = "Reset default value"; - -/* DESC: Show request headers. */ -ui_strings.S_BUTTON_SHOW_REQUEST_HEADERS = "Headers"; - -/* DESC: Show raw request. */ -ui_strings.S_BUTTON_SHOW_REQUEST_RAW = "Raw"; - -/* DESC: Show request summary. */ -ui_strings.S_BUTTON_SHOW_REQUEST_SUMMARY = "Summary"; - -/* DESC: Button label in settings to reset the element highlight to the default values */ -ui_strings.S_BUTTON_SPOTLIGHT_RESET_DEFAULT_COLORS = "Reset default colors"; - -/* DESC: Button title for starting the profiler */ -ui_strings.S_BUTTON_START_PROFILER = "Start profiling"; - -/* DESC: Button title for stopping the profiler */ -ui_strings.S_BUTTON_STOP_PROFILER = "Stop profiling"; - -/* DESC: Button label to delete all items in a storage, e.g. the local storage */ -ui_strings.S_BUTTON_STORAGE_DELETE_ALL = "Delete All"; - -/* DESC: Button label to store the color */ -ui_strings.S_BUTTON_STORE_COLOR = "Store color"; - -/* DESC: Button to switch to network-profiler mode. */ -ui_strings.S_BUTTON_SWITCH_TO_NETWORK_PROFILER = "Improve accuracy of timing information"; - -/* DESC: Button label to take a screenshot */ -ui_strings.S_BUTTON_TAKE_SCREENSHOT = "Take screenshot"; - -/* DESC: Label for button in Remote Debugging that applies the changes. */ -ui_strings.S_BUTTON_TEXT_APPLY = "Apply"; - -/* DESC: Global console toggle */ -ui_strings.S_BUTTON_TOGGLE_CONSOLE = "Toggle console"; - -/* DESC: Global remote debug toggle */ -ui_strings.S_BUTTON_TOGGLE_REMOTE_DEBUG = "Remote debug configuration"; - -/* DESC: Global settings toggle */ -ui_strings.S_BUTTON_TOGGLE_SETTINGS = "Settings"; - -/* DESC: Button label to update the screenshot */ -ui_strings.S_BUTTON_UPDATE_SCREESHOT = "Update screenshot"; - -/* DESC: Unit string for bytes */ -ui_strings.S_BYTES_UNIT = "bytes"; - -/* DESC: Clears the command line log */ -ui_strings.S_CLEAR_COMMAND_LINE_LOG = "Clear console"; - -/* DESC: Label on button to clear network graph */ -ui_strings.S_CLEAR_NETWORK_LOG = "Clear network log"; - -/* DESC: Close command line window */ -ui_strings.S_CLOSE_COMMAND_LINE = "Close console"; - -/* DESC: Setting for changing the color notation (Hex, RGB, HSL) */ -ui_strings.S_COLOR_NOTATION = "Color format"; - -/* DESC: Average color setting, " x pixels" will be added */ -ui_strings.S_COLOR_PICKER_AVERAGE_COLOR_OF = "Average color of"; - -/* DESC: Table heading for column showing error descriptions */ -ui_strings.S_COLUMN_LABEL_ERROR = "Error"; - -/* DESC: Table heading for "file" column */ -ui_strings.S_COLUMN_LABEL_FILE = "File"; - -/* DESC: Table heading for column showing line number */ -ui_strings.S_COLUMN_LABEL_LINE = "Line"; - -/* DESC: Message about having to load a different version of dragonfly in order to work with the browser bing debugged */ -ui_strings.S_CONFIRM_LOAD_COMPATIBLE_VERSION = "The protocol version of Opera does not match the one which Opera Dragonfly is using.\n\nTry to load a compatible version?"; - -/* DESC: Dialog to confirm switching to network-profiler mode. */ -ui_strings.S_CONFIRM_SWITCH_TO_NETWORK_PROFILER = "To improve the accuracy of timing information, other features are turned off. You may lose changes you made."; - -/* DESC: Label for the list of function when doing console.trace(). */ -ui_strings.S_CONSOLE_TRACE_LABEL = "Stack trace:"; - -/* DESC: In 1 hour */ -ui_strings.S_COOKIE_MANAGER_IN_1_HOUR = "In 1 hour"; - -/* DESC: In 1 minute */ -ui_strings.S_COOKIE_MANAGER_IN_1_MINUTE = "In 1 minute"; - -/* DESC: In 1 month */ -ui_strings.S_COOKIE_MANAGER_IN_1_MONTH = "In 1 month"; - -/* DESC: In 1 week */ -ui_strings.S_COOKIE_MANAGER_IN_1_WEEK = "In 1 week"; - -/* DESC: In 1 year */ -ui_strings.S_COOKIE_MANAGER_IN_1_YEAR = "In 1 year"; - -/* DESC: In x days */ -ui_strings.S_COOKIE_MANAGER_IN_X_DAYS = "In %s days"; - -/* DESC: In x hours */ -ui_strings.S_COOKIE_MANAGER_IN_X_HOURS = "In %s hours"; - -/* DESC: In x minutes */ -ui_strings.S_COOKIE_MANAGER_IN_X_MINUTES = "In %s minutes"; - -/* DESC: In x months */ -ui_strings.S_COOKIE_MANAGER_IN_X_MONTHS = "In %s months"; - -/* DESC: In x weeks */ -ui_strings.S_COOKIE_MANAGER_IN_X_WEEKS = "In %s weeks"; - -/* DESC: In x years */ -ui_strings.S_COOKIE_MANAGER_IN_X_YEARS = "In %s years"; - -/* DESC: In less then 1 minute */ -ui_strings.S_COOKIE_MANAGER_SOONER_THEN_1_MINUTE = "< 1 minute"; - -/* DESC: Tomorrow */ -ui_strings.S_COOKIE_MANAGER_TOMORROW = "Tomorrow"; - -/* DESC: Tooltip for disabling a declaration */ -ui_strings.S_DISABLE_DECLARATION = "Disable"; - -/* DESC: Prefix before debug output */ -ui_strings.S_DRAGONFLY_INFO_MESSAGE = "Opera Dragonfly info message:\n"; - -/* DESC: Tooltip for enabling a declaration */ -ui_strings.S_ENABLE_DECLARATION = "Enable"; - -/* DESC: Info text that explains that only a certain number %(MAX)s of Errors is shown, out of a total of %(COUNT)s */ -ui_strings.S_ERRORS_MAXIMUM_REACHED = "Displaying %(MAX)s of %(COUNT)s errors"; - -/* DESC: List of filters that will be hidden in the Error log */ -ui_strings.S_ERROR_LOG_CSS_FILTER = "Use CSS filter"; - -/* DESC: Link in an event listener tooltip to the source position where the listener is added. */ -ui_strings.S_EVENT_LISTENER_ADDED_IN = "added in %s"; - -/* DESC: Info in an event listener tooltip that the according listener was added in the markup as element attribute. */ -ui_strings.S_EVENT_LISTENER_SET_AS_MARKUP_ATTR = "set as markup attribute"; - -/* DESC: Info in a tooltip that the according listener was set by the event target interface. */ -ui_strings.S_EVENT_TARGET_LISTENER = "event target listener"; - -/* DESC: Event type for events in the profiler */ -ui_strings.S_EVENT_TYPE_CSS_PARSING = "CSS parsing"; - -/* DESC: Event type for events in the profiler */ -ui_strings.S_EVENT_TYPE_CSS_SELECTOR_MATCHING = "CSS selector matching"; - -/* DESC: Event type for events in the profiler */ -ui_strings.S_EVENT_TYPE_DOCUMENT_PARSING = "Document parsing"; - -/* DESC: Event type for events in the profiler */ -ui_strings.S_EVENT_TYPE_GENERIC = "Generic"; - -/* DESC: Event type for events in the profiler */ -ui_strings.S_EVENT_TYPE_LAYOUT = "Layout"; - -/* DESC: Event type for events in the profiler */ -ui_strings.S_EVENT_TYPE_PAINT = "Paint"; - -/* DESC: Event type for events in the profiler */ -ui_strings.S_EVENT_TYPE_PROCESS = "Process"; - -/* DESC: Event type for events in the profiler */ -ui_strings.S_EVENT_TYPE_REFLOW = "Reflow"; - -/* DESC: Event type for events in the profiler */ -ui_strings.S_EVENT_TYPE_SCRIPT_COMPILATION = "Script compilation"; - -/* DESC: Event type for events in the profiler */ -ui_strings.S_EVENT_TYPE_STYLE_RECALCULATION = "Style recalculation"; - -/* DESC: Event type for events in the profiler */ -ui_strings.S_EVENT_TYPE_THREAD_EVALUATION = "Thread evaluation"; - -/* DESC: Context menu item for expanding CSS shorthands */ -ui_strings.S_EXPAND_SHORTHANDS = "Expand shorthands"; - -/* DESC: Label for the global keyboard shortcuts section */ -ui_strings.S_GLOBAL_KEYBOARD_SHORTCUTS_SECTION_TITLE = "Global"; - -/* DESC: Global scope label. */ -ui_strings.S_GLOBAL_SCOPE_NAME = ""; - -/* DESC: Show help in command line */ -ui_strings.S_HELP_COMMAND_LINE = "Help"; - -/* DESC: Label for http event sequence when urlfinished follows after some other event, meaning it was aborted */ -ui_strings.S_HTTP_EVENT_SEQUENCE_INFO_ABORTING_REQUEST = "Request aborted"; - -/* DESC: Label for http event sequence when redirecting */ -ui_strings.S_HTTP_EVENT_SEQUENCE_INFO_ABORT_RETRYING = "Sequence terminated, retry"; - -/* DESC: Label for http event sequence when closing response phase */ -ui_strings.S_HTTP_EVENT_SEQUENCE_INFO_CLOSING_RESPONSE_PHASE = "Closing response phase"; - -/* DESC: Label for http event sequence when processing */ -ui_strings.S_HTTP_EVENT_SEQUENCE_INFO_PROCESSING = "Processing"; - -/* DESC: Label for http event sequence when processing response */ -ui_strings.S_HTTP_EVENT_SEQUENCE_INFO_PROCESSING_RESPONSE = "Processing response"; - -/* DESC: Label for http event sequence when reading local data (data-uri, caches, file:// etc) */ -ui_strings.S_HTTP_EVENT_SEQUENCE_INFO_READING_LOCAL_DATA = "Reading local data"; - -/* DESC: Label for http event sequence when redirecting */ -ui_strings.S_HTTP_EVENT_SEQUENCE_INFO_REDIRECTING = "Redirecting"; - -/* DESC: Label for http event sequence when the event was scheduled */ -ui_strings.S_HTTP_EVENT_SEQUENCE_INFO_SCHEDULING = "Scheduling request"; - -/* DESC: Label for http event sequence when reading response body */ -ui_strings.S_HTTP_EVENT_SEQUENCE_READING_RESPONSE_BODY = "Reading response body"; - -/* DESC: Label for http event sequence when reading response header */ -ui_strings.S_HTTP_EVENT_SEQUENCE_READING_RESPONSE_HEADER = "Reading response header"; - -/* DESC: Label for http event sequence when waiting for response from network */ -ui_strings.S_HTTP_EVENT_SEQUENCE_WAITING_FOR_RESPONSE = "Waiting for response"; - -/* DESC: Label for http event sequence when writing request body */ -ui_strings.S_HTTP_EVENT_SEQUENCE_WRITING_REQUEST_BODY = "Writing request body"; - -/* DESC: Label for http event sequence when writing request header */ -ui_strings.S_HTTP_EVENT_SEQUENCE_WRITING_REQUEST_HEADER = "Writing request header"; - -/* DESC: First line of dialog that explains that the loading flow of the context is not shown completely */ -ui_strings.S_HTTP_INCOMPLETE_LOADING_GRAPH = "Reload to show all page requests"; - -/* DESC: tooltip for the network data view button */ -ui_strings.S_HTTP_LABEL_DATA_VIEW = "Data view"; - -/* DESC: label for table header that shows duration (short) */ -ui_strings.S_HTTP_LABEL_DURATION = "Duration"; - -/* DESC: label for the network filter that shows all items */ -ui_strings.S_HTTP_LABEL_FILTER_ALL = "All"; - -/* DESC: label for the network filter that shows image items */ -ui_strings.S_HTTP_LABEL_FILTER_IMAGES = "Images"; - -/* DESC: label for the network filter that shows markup items */ -ui_strings.S_HTTP_LABEL_FILTER_MARKUP = "Markup"; - -/* DESC: label for the network filter that shows items that are not markup, stylesheet, script or image */ -ui_strings.S_HTTP_LABEL_FILTER_OTHER = "Other"; - -/* DESC: label for the network filter that shows script items */ -ui_strings.S_HTTP_LABEL_FILTER_SCRIPTS = "Scripts"; - -/* DESC: label for the network filter that shows stylesheet items */ -ui_strings.S_HTTP_LABEL_FILTER_STYLESHEETS = "Stylesheets"; - -/* DESC: label for the network filter that shows items requested over XMLHttpRequest */ -ui_strings.S_HTTP_LABEL_FILTER_XHR = "XHR"; - -/* DESC: label for table header that shows loading sequence as a graph (short) */ -ui_strings.S_HTTP_LABEL_GRAPH = "Graph"; - -/* DESC: tooltip for the network graph view button */ -ui_strings.S_HTTP_LABEL_GRAPH_VIEW = "Graph view"; - -/* DESC: label for host in http request details */ -ui_strings.S_HTTP_LABEL_HOST = "Host"; - -/* DESC: label for method in http request details */ -ui_strings.S_HTTP_LABEL_METHOD = "Method"; - -/* DESC: label for path in http request details */ -ui_strings.S_HTTP_LABEL_PATH = "Path"; - -/* DESC: label for query arguments in http request details */ -ui_strings.S_HTTP_LABEL_QUERY_ARGS = "Query arguments"; - -/* DESC: label for response in http request details */ -ui_strings.S_HTTP_LABEL_RESPONSE = "Response"; - -/* DESC: label for table header that shows http response code (short) */ -ui_strings.S_HTTP_LABEL_RESPONSECODE = "Status"; - -/* DESC: label for table header that shows starting time (short) */ -ui_strings.S_HTTP_LABEL_STARTED = "Started"; - -/* DESC: label for url in http request details */ -ui_strings.S_HTTP_LABEL_URL = "URL"; - -/* DESC: label for table header that shows waiting time (short) */ -ui_strings.S_HTTP_LABEL_WAITING = "Waiting"; - -/* DESC: tooltip for resources that have not been requested over network (mostly that means cached) */ -ui_strings.S_HTTP_NOT_REQUESTED = "Cached"; - -/* DESC: Headline for network-sequence tooltip that shows the absolute time when the resource was requested internally */ -ui_strings.S_HTTP_REQUESTED_HEADLINE = "Requested at %s"; - -/* DESC: tooltip for resources served over file:// to make it explicit that this didn't touch the network */ -ui_strings.S_HTTP_SERVED_OVER_FILE = "Local"; - -/* DESC: tooltip for table header that shows duration */ -ui_strings.S_HTTP_TOOLTIP_DURATION = "Time spent between starting and finishing this request"; - -/* DESC: tooltip for the network filter that shows all items */ -ui_strings.S_HTTP_TOOLTIP_FILTER_ALL = "Show all requests"; - -/* DESC: tooltip for the network filter that shows image items */ -ui_strings.S_HTTP_TOOLTIP_FILTER_IMAGES = "Show only images"; - -/* DESC: tooltip for the network filter that shows markup items */ -ui_strings.S_HTTP_TOOLTIP_FILTER_MARKUP = "Show only markup"; - -/* DESC: tooltip for the network filter that shows items that are not markup, stylesheet, script or image */ -ui_strings.S_HTTP_TOOLTIP_FILTER_OTHER = "Show requests of other types"; - -/* DESC: tooltip for the network filter that shows script items */ -ui_strings.S_HTTP_TOOLTIP_FILTER_SCRIPTS = "Show only scripts"; - -/* DESC: tooltip for the network filter that shows stylesheet items */ -ui_strings.S_HTTP_TOOLTIP_FILTER_STYLESHEETS = "Show only stylesheets"; - -/* DESC: tooltip for the network filter that shows items requested over XMLHttpRequest */ -ui_strings.S_HTTP_TOOLTIP_FILTER_XHR = "Show only XMLHttpRequests"; - -/* DESC: tooltip for table header that shows loading sequence as a graph */ -ui_strings.S_HTTP_TOOLTIP_GRAPH = "Graph of the loading sequence"; - -/* DESC: tooltip on mime type table header */ -ui_strings.S_HTTP_TOOLTIP_MIME = "MIME type"; - -/* DESC: tooltip on protocol table header */ -ui_strings.S_HTTP_TOOLTIP_PROTOCOL = "Protocol"; - -/* DESC: tooltip on table header that shows http response code */ -ui_strings.S_HTTP_TOOLTIP_RESPONSECODE = "HTTP status code"; - -/* DESC: tooltip on size table header */ -ui_strings.S_HTTP_TOOLTIP_SIZE = "Content-length of the response in bytes"; - -/* DESC: tooltip on prettyprinted size table header */ -ui_strings.S_HTTP_TOOLTIP_SIZE_PRETTYPRINTED = "Content-length of the response"; - -/* DESC: tooltip for table header that shows relative starting time */ -ui_strings.S_HTTP_TOOLTIP_STARTED = "Starting time, relative to the main document"; - -/* DESC: tooltip for table header that shows waiting time */ -ui_strings.S_HTTP_TOOLTIP_WAITING = "Time spent requesting this resource"; - -/* DESC: tooltip-prefix for resources that have been marked unloaded, which means they are no longer reference in the document */ -ui_strings.S_HTTP_UNREFERENCED = "Unreferenced"; - -/* DESC: Information shown if the document does not hold any style sheet. */ -ui_strings.S_INFO_DOCUMENT_HAS_NO_STYLESHEETS = "This document has no style sheets"; - -/* DESC: Feedback showing that Opera Dragonfly is loading and the user shall have patience. */ -ui_strings.S_INFO_DOCUMNENT_LOADING = "Updating Opera Dragonfly‚Ķ"; - -/* DESC: There was an error trying to listen to the specified port */ -ui_strings.S_INFO_ERROR_LISTENING = "There was an error. Please check that port %s is not in use."; - -/* DESC: A info message that the debugger is currently in HTTP profiler mode. */ -ui_strings.S_INFO_HTTP_PROFILER_MODE = "The debugger is in HTTP profiler mode. All other features are disabled." - -/* DESC: A info message that the debugger is currently in HTTP profiler mode. */ -ui_strings.S_INFO_HTTP_PROFILER_MODE = "The debugger is in HTTP profiler mode. All other features are disabled."; - -/* DESC: Information shown if the user tries to perform a reg exp search with an invalid regular expression. */ -ui_strings.S_INFO_INVALID_REGEXP = "Invalid regular expression."; - -/* DESC: Info text in the settings to invert the highlight color for elements. */ -ui_strings.S_INFO_INVERT_ELEMENT_HIGHLIGHT = "The element highlight color can be inverted with the \"%s\" shortcut."; - -/* DESC: The info text to notify the user that the application is performing the search. */ -ui_strings.S_INFO_IS_SEARCHING = "Searching‚Ķ"; - -/* DESC: Info in an event listener tooltip that the according source file is missing. */ -ui_strings.S_INFO_MISSING_JS_SOURCE_FILE = ""; - -/* DESC: Info text in the network view when a page starts to load while screen updats are paused */ -ui_strings.S_INFO_NETWORK_UPDATES_PAUSED = "Updating of network log is paused."; - -/* DESC: Message about there being no version of dragonfly compatible with the browser being debugged */ -ui_strings.S_INFO_NO_COMPATIBLE_VERSION = "There is no compatible Opera Dragonfly version."; - -/* DESC: Shown when entering something on the command line while there is no javascript running in the window being debugged */ -ui_strings.S_INFO_NO_JAVASCRIPT_IN_CONTEXT = "There is no JavaScript environment in the active window"; - -/* DESC: The info text in an alert box if the user has specified an invalid port number for remote debugging. */ -ui_strings.S_INFO_NO_VALID_PORT_NUMBER = "Please select a port number between %s and %s."; - -/* DESC: A info message that the debugger is currently in profiler mode. */ -ui_strings.S_INFO_PROFILER_MODE = "The debugger is in profiler mode. All other features are disabled." - -/* DESC: A info message that the debugger is currently in profiler mode. */ -ui_strings.S_INFO_PROFILER_MODE = "The debugger is in profiler mode. All other features are disabled."; - -/* DESC: Information shown if the user tries to perform a reg exp search which matches the empty string. */ -ui_strings.S_INFO_REGEXP_MATCHES_EMPTY_STRING = "RegExp matches empty string. No search was performed."; - -/* DESC: Currently no scripts are loaded and a reload of the page will resolve all linked scripts. */ -ui_strings.S_INFO_RELOAD_FOR_SCRIPT = "Click the reload button above to fetch the scripts for the selected debugging context"; - -/* DESC: Info text in when a request in the request crafter failed. */ -ui_strings.S_INFO_REQUEST_FAILED = "The request failed."; - -/* DESC: Information shown if the document does not hold any scripts. Appears in Scripts view. */ -ui_strings.S_INFO_RUNTIME_HAS_NO_SCRIPTS = "This document has no scripts"; - -/* DESC: the given storage type doesn't exist, e.g. a widget without the w3c widget namespace */ -ui_strings.S_INFO_STORAGE_TYPE_DOES_NOT_EXIST = "%s does not exist."; - -/* DESC: Information shown if the stylesheet does not hold any style rules. */ -ui_strings.S_INFO_STYLESHEET_HAS_NO_RULES = "This style sheet has no rules"; - -/* DESC: The info text to notify the user that only a part of the search results are displayed. */ -ui_strings.S_INFO_TOO_MANY_SEARCH_RESULTS = "Displaying %(MAX)s of %(COUNT)s"; - -/* DESC: Dragonfly is waiting for host connection */ -ui_strings.S_INFO_WAITING_FORHOST_CONNECTION = "Waiting for a host connection on port %s."; - -/* DESC: Information shown if the window has no runtime, e.g. speed dial. */ -ui_strings.S_INFO_WINDOW_HAS_NO_RUNTIME = "This window has no runtime"; - -/* DESC: Inhertied from, " " will be added */ -ui_strings.S_INHERITED_FROM = "Inherited from"; - -/* DESC: For filter fields. */ -ui_strings.S_INPUT_DEFAULT_TEXT_FILTER = "Filter"; - -/* DESC: Label for search fields. */ -ui_strings.S_INPUT_DEFAULT_TEXT_SEARCH = "Search"; - -/* DESC: Heading for the area where the user can configure keyboard shortcuts in settings. */ -ui_strings.S_KEYBOARD_SHORTCUTS_CONFIGURATION = "Configuration"; - -/* DESC: Context menu entry that brings up "Add watch" UI, Label for "Add watch" button */ -ui_strings.S_LABEL_ADD_WATCH = "Add watch"; - -/* DESC: Instruction in settings how to change the user language. The place holder will be replace with an according link to the user setting in opera:config. */ -ui_strings.S_LABEL_CHANGE_UI_LANGUAGE_INFO = "Change %s to one of"; - -/* DESC: A setting to define which prototypes of inspected js objects should be collapsed by default. */ -ui_strings.S_LABEL_COLLAPSED_INSPECTED_PROTOTYPES = "Default collapsed prototype objects (a list of prototypes, e.g. Object, Array, etc. * will collapse all): "; - -/* DESC: Label for the hue of a color value. */ -ui_strings.S_LABEL_COLOR_HUE = "Hue"; - -/* DESC: Label for the luminosity of a color value. */ -ui_strings.S_LABEL_COLOR_LUMINOSITY = "Luminosity"; - -/* DESC: Label for the opacity of a color value. */ -ui_strings.S_LABEL_COLOR_OPACITY = "Opacity"; - -/* DESC: Setting label to select the sample size of the color picker */ -ui_strings.S_LABEL_COLOR_PICKER_SAMPLE_SIZE = "Sample Size"; - -/* DESC: Setting label to select the zoom level of the color picker */ -ui_strings.S_LABEL_COLOR_PICKER_ZOOM = "Zoom"; - -/* DESC: Label for the saturation of a color value. */ -ui_strings.S_LABEL_COLOR_SATURATION = "Saturation"; - -/* DESC: Context menu entry that brings up "Add cookie" UI, Label for "Add Cookie" button */ -ui_strings.S_LABEL_COOKIE_MANAGER_ADD_COOKIE = "Add cookie"; - -/* DESC: Label for the domain that is set for a cookie */ -ui_strings.S_LABEL_COOKIE_MANAGER_COOKIE_DOMAIN = "Domain"; - -/* DESC: Label for the expiry when cookie has already expired */ -ui_strings.S_LABEL_COOKIE_MANAGER_COOKIE_EXPIRED = "(expired)"; - -/* DESC: Label for the expiry value of a cookie */ -ui_strings.S_LABEL_COOKIE_MANAGER_COOKIE_EXPIRES = "Expires"; - -/* DESC: Label for the expiry when cookie expires after the session is closed */ -ui_strings.S_LABEL_COOKIE_MANAGER_COOKIE_EXPIRES_ON_SESSION_CLOSE = "When session ends, e.g. the tab is closed"; - -/* DESC: Label for the expiry when cookie expires after the session is closed */ -ui_strings.S_LABEL_COOKIE_MANAGER_COOKIE_EXPIRES_ON_SESSION_CLOSE_SHORT = "Session"; - -/* DESC: Label for the name (key) of a cookie */ -ui_strings.S_LABEL_COOKIE_MANAGER_COOKIE_NAME = "Name"; - -/* DESC: Label for the value of a cookie */ -ui_strings.S_LABEL_COOKIE_MANAGER_COOKIE_PATH = "Path"; - -/* DESC: Label for the value of a cookie or storage item */ -ui_strings.S_LABEL_COOKIE_MANAGER_COOKIE_VALUE = "Value"; - -/* DESC: Context menu entry that brings up "Edit cookie" UI */ -ui_strings.S_LABEL_COOKIE_MANAGER_EDIT_COOKIE = "Edit cookie"; - -/* DESC: Label for grouping by runtime (lowercase) */ -ui_strings.S_LABEL_COOKIE_MANAGER_GROUPER_RUNTIME = "runtime"; - -/* DESC: Label for isHTTPOnly flag on a cookie */ -ui_strings.S_LABEL_COOKIE_MANAGER_HTTP_ONLY = "HTTPOnly"; - -/* DESC: Context menu entry that removes cookie */ -ui_strings.S_LABEL_COOKIE_MANAGER_REMOVE_COOKIE = "Delete cookie"; - -/* DESC: Context menu entry that removes cookies (plural) */ -ui_strings.S_LABEL_COOKIE_MANAGER_REMOVE_COOKIES = "Delete cookies"; - -/* DESC: Context menu entry that removes cookies of specific group */ -ui_strings.S_LABEL_COOKIE_MANAGER_REMOVE_COOKIES_OF = "Delete cookies from %s"; - -/* DESC: Label for isSecure flag on a cookie, set if cookie is only transmitted on secure connections */ -ui_strings.S_LABEL_COOKIE_MANAGER_SECURE_CONNECTIONS_ONLY = "Secure"; - -/* DESC: Setting label to switch back to the default setting */ -ui_strings.S_LABEL_DEFAULT_SELECTION = "Default"; - -/* DESC: Context menu entry that removes all watches */ -ui_strings.S_LABEL_DELETE_ALL_WATCHES = "Delete all watches"; - -/* DESC: Context menu entry that removes watch */ -ui_strings.S_LABEL_DELETE_WATCH = "Delete watch"; - -/* DESC: Label for a button in a dialog to dismiss in so it won't be shown again */ -ui_strings.S_LABEL_DIALOG_DONT_SHOW_AGAIN = "Do not show again"; - -/* DESC: Context menu entry that brings up "Edit" UI */ -ui_strings.S_LABEL_EDIT_WATCH = "Edit watch"; - -/* DESC: Button label to enable the default debugger features. */ -ui_strings.S_LABEL_ENABLE_DEFAULT_FEATURES = "Enable the default debugger features"; - -/* DESC: Button label to enable the default debugger features. */ -ui_strings.S_LABEL_ENABLE_DEFAULT_FEATURES = "Enable the default debugger features"; - -/* DESC: Setting label to select the font face */ -ui_strings.S_LABEL_FONT_SELECTION_FACE = "Font face"; - -/* DESC: Setting label to select the line height */ -ui_strings.S_LABEL_FONT_SELECTION_LINE_HEIGHT = "Line height"; - -/* DESC: Setting label to select the font face */ -ui_strings.S_LABEL_FONT_SELECTION_SIZE = "Font size"; - -/* DESC: Label of a section in the keyboard configuration for a specific view */ -ui_strings.S_LABEL_KEYBOARDCONFIG_FOR_VIEW = "Keyboard shortcuts %s"; - -/* DESC: Label of an invalid keyboard shortcut */ -ui_strings.S_LABEL_KEYBOARDCONFIG_INVALID_SHORTCUT = "Invalid keyboard shortcut"; - -/* DESC: Label of a subsection in the keyboard configuration */ -ui_strings.S_LABEL_KEYBOARDCONFIG_MODE_DEFAULT = "Default"; - -/* DESC: Label of a subsection in the keyboard configuration */ -ui_strings.S_LABEL_KEYBOARDCONFIG_MODE_EDIT = "Edit"; - -/* DESC: Label of a subsection in the keyboard configuration */ -ui_strings.S_LABEL_KEYBOARDCONFIG_MODE_EDIT_ATTR_AND_TEXT = "Edit Attributes and Text"; - -/* DESC: Label of a subsection in the keyboard configuration */ -ui_strings.S_LABEL_KEYBOARDCONFIG_MODE_EDIT_MARKUP = "Edit markup"; - -/* DESC: Settings label for the maximum number of search hits in the search panel. */ -ui_strings.S_LABEL_MAX_SEARCH_HITS = "Maximum number of search results"; - -/* DESC: Button tooltip */ -ui_strings.S_LABEL_MOVE_HIGHLIGHT_DOWN = "Find next"; - -/* DESC: Button tooltip */ -ui_strings.S_LABEL_MOVE_HIGHLIGHT_UP = "Find previous"; - -/* DESC: Label for the name column header of a form field in a POST */ -ui_strings.S_LABEL_NETWORK_POST_DATA_NAME = "Name"; - -/* DESC: Label for the value column header of a form value in a POST */ -ui_strings.S_LABEL_NETWORK_POST_DATA_VALUE = "Value"; - -/* DESC: Label for the network port to connect to. */ -ui_strings.S_LABEL_PORT = "Port"; - -/* DESC: In the command line, choose the size of the typed history */ -ui_strings.S_LABEL_REPL_BACKLOG_LENGTH = "Number of lines of stored history"; - -/* DESC: Label of a subsection in the keyboard configuration */ -ui_strings.S_LABEL_REPL_MODE_AUTOCOMPLETE = "Autocomplete"; - -/* DESC: Label of a subsection in the keyboard configuration */ -ui_strings.S_LABEL_REPL_MODE_DEFAULT = "Default"; - -/* DESC: Label of a subsection in the keyboard configuration */ -ui_strings.S_LABEL_REPL_MODE_MULTILINE = "Multi-line edit"; - -/* DESC: Label of a subsection in the keyboard configuration */ -ui_strings.S_LABEL_REPL_MODE_SINGLELINE = "Single-line edit"; - -/* DESC: Label of the section with the scope chain in the Inspection view */ -ui_strings.S_LABEL_SCOPE_CHAIN = "Scope Chain"; - -/* DESC: Checkbox label to search in all files in the JS search pane. */ -ui_strings.S_LABEL_SEARCH_ALL_FILES = "All files"; - -/* DESC: Checkbox label to set the 'ignore case' flag search panel. */ -ui_strings.S_LABEL_SEARCH_FLAG_IGNORE_CASE = "Ignore case"; - -/* DESC: Checkbox label to search in injected scripts in the JS search pane. */ -ui_strings.S_LABEL_SEARCH_INJECTED_SCRIPTS = "Injected"; - -/* DESC: Tooltip for the injected scripts search settings label. */ -ui_strings.S_LABEL_SEARCH_INJECTED_SCRIPTS_TOOLTIP = "Search in all injected scripts, including Browser JS, Extension JS and User JS"; - -/* DESC: Radio label for the search type 'Selector' (as in CSS Selector) in the DOM search panel. */ -ui_strings.S_LABEL_SEARCH_TYPE_CSS = "Selector"; - -/* DESC: RRadio label for the search type 'RegExp' in the DOM search panel. */ -ui_strings.S_LABEL_SEARCH_TYPE_REGEXP = "RegExp"; - -/* DESC: Radio label for the search type 'Text' in the DOM search panel. */ -ui_strings.S_LABEL_SEARCH_TYPE_TEXT = "Text"; - -/* DESC: Radio label for the search type 'XPath' in the DOM search panel. */ -ui_strings.S_LABEL_SEARCH_TYPE_XPATH = "XPath"; - -/* DESC: Settings label to show a tooltip for the hovered identifier in the source view. */ -ui_strings.S_LABEL_SHOW_JS_TOOLTIP = "Show inspection tooltip"; - -/* DESC: Enable smart reformatting of JavaScript. */ -ui_strings.S_LABEL_SMART_REFORMAT_JAVASCRIPT = "Smart JavaScript pretty printing"; - -/* DESC: Settings label to configure the element highlight color */ -ui_strings.S_LABEL_SPOTLIGHT_TITLE = "Element Highlight"; - -/* DESC: Button label to add an item in a storage, e.g. in the local storage */ -ui_strings.S_LABEL_STORAGE_ADD = "Add"; - -/* DESC: Label for "Add storage_type" button */ -ui_strings.S_LABEL_STORAGE_ADD_STORAGE_TYPE = "Add %s"; - -/* DESC: Button label to delete an item in a storage, e.g. in the local storage */ -ui_strings.S_LABEL_STORAGE_DELETE = "Delete"; - -/* DESC: Tool tip in a storage view to inform the user how to edit an item */ -ui_strings.S_LABEL_STORAGE_DOUBLE_CLICK_TO_EDIT = "Double-click to edit"; - -/* DESC: Label for the key (identifier) of a storage item */ -ui_strings.S_LABEL_STORAGE_KEY = "Key"; - -/* DESC: Button label to update a view with all items of a storage, e.g. of the local storage */ -ui_strings.S_LABEL_STORAGE_UPDATE = "Update"; - -/* DESC: Tab size in source view. */ -ui_strings.S_LABEL_TAB_SIZE = "Tab Size"; - -/* DESC: Area as in size. choices are 10 x 10, and so on. */ -ui_strings.S_LABEL_UTIL_AREA = "Area"; - -/* DESC: Scale */ -ui_strings.S_LABEL_UTIL_SCALE = "Scale"; - -/* DESC: Info in an event listener tooltip that the according listener listens in the bubbling phase. */ -ui_strings.S_LISTENER_BUBBLING_PHASE = "bubbling"; - -/* DESC: Info in an event listener tooltip that the according listener listens in the capturing phase. */ -ui_strings.S_LISTENER_CAPTURING_PHASE = "capturing"; - -/* DESC: Debug context menu */ -ui_strings.S_MENU_DEBUG_CONTEXT = "Select the debugging context"; - -/* DESC: Reload the debug context. */ -ui_strings.S_MENU_RELOAD_DEBUG_CONTEXT = "Reload Debugging Context"; - -/* DESC: Reload the debug context (shorter than S_MENU_RELOAD_DEBUG_CONTEXT). */ -ui_strings.S_MENU_RELOAD_DEBUG_CONTEXT_SHORT = "Reload"; - -/* DESC: Select the active window as debugger context. */ -ui_strings.S_MENU_SELECT_ACTIVE_WINDOW = "Select Active Window"; - -/* DESC: String used when the user has clicked to get a resource body, but dragonfly wasn't able to do so. */ -ui_strings.S_NETWORK_BODY_NOT_AVAILABLE = "Request body not available. Enable resource tracking and reload the page to view the resource."; - -/* DESC: Name of network caching setting for default browser caching policy */ -ui_strings.S_NETWORK_CACHING_SETTING_DEFAULT_LABEL = "Standard browser caching behavior"; - -/* DESC: Help text for explaining caching setting in global network options */ -ui_strings.S_NETWORK_CACHING_SETTING_DESC = "This setting controls how caching works when Opera Dragonfly is running. When caching is disabled, Opera always reloads the page."; - -/* DESC: Name of network caching setting for disabling browser caching policy */ -ui_strings.S_NETWORK_CACHING_SETTING_DISABLED_LABEL = "Disable all caching"; - -/* DESC: Title for caching settings section in global network options */ -ui_strings.S_NETWORK_CACHING_SETTING_TITLE = "Caching behavior"; - -/* DESC: Can't show request data, as we don't know the type of it. */ -ui_strings.S_NETWORK_CANT_DISPLAY_TYPE = "Cannot display content of type %s"; - -/* DESC: Name of content tracking setting for tracking content */ -ui_strings.S_NETWORK_CONTENT_TRACKING_SETTING_TRACK_LABEL = "Track content (affects speed/memory)"; - -/* DESC: Explanation of how to enable content tracking. */ -ui_strings.S_NETWORK_ENABLE_CONTENT_TRACKING_FOR_REQUEST = "Enable content tracking in the \"network options\" panel to see request bodies"; - -/* DESC: Example value to show what header formats look like. Header-name */ -ui_strings.S_NETWORK_HEADER_EXAMPLE_VAL_NAME = "Header-name"; - -/* DESC: Example value to show what header formats look like. Header-value */ -ui_strings.S_NETWORK_HEADER_EXAMPLE_VAL_VALUE = "Header-value"; - -/* DESC: Description of network header overrides feature. */ -ui_strings.S_NETWORK_HEADER_OVERRIDES_DESC = "Headers in the override box will be used for all requests in the debugged browser. They will override normal headers."; - -/* DESC: Label for checkbox to enable global header overrides */ -ui_strings.S_NETWORK_HEADER_OVERRIDES_LABEL = "Enable global header overrides"; - -/* DESC: Label for presets */ -ui_strings.S_NETWORK_HEADER_OVERRIDES_PRESETS_LABEL = "Presets"; - -/* DESC: Label for save nbutton */ -ui_strings.S_NETWORK_HEADER_OVERRIDES_PRESETS_SAVE = "Save"; - -/* DESC: Label for selecting an empty preset */ -ui_strings.S_NETWORK_HEADER_OVERRIDES_PRESET_NONE = "None"; - -/* DESC: Title of global header overrides section in global network settings */ -ui_strings.S_NETWORK_HEADER_OVERRIDES_TITLE = "Global header overrides"; - -/* DESC: Title of request body section when the body is multipart-encoded */ -ui_strings.S_NETWORK_MULTIPART_REQUEST_TITLE = "Request - multipart"; - -/* DESC: String used when there is a request body we can't show the contents of directly. */ -ui_strings.S_NETWORK_N_BYTE_BODY = "Request body of %s bytes"; - -/* DESC: Name of entry in Network Log, used in summary at the end */ -ui_strings.S_NETWORK_REQUEST = "Request"; - -/* DESC: Name of entry in Network Log, plural, used in summary at the end */ -ui_strings.S_NETWORK_REQUESTS = "Requests"; - -/* DESC: Help text about how to always track resources in request view */ -ui_strings.S_NETWORK_REQUEST_DETAIL_BODY_DESC = "Response body not tracked. To always fetch response bodies, toggle the \"Track content\" option in Settings. To retrieve only this body, click the button."; - -/* DESC: Message about not yet available response body */ -ui_strings.S_NETWORK_REQUEST_DETAIL_BODY_UNFINISHED = "Response body not available until the request is finished."; - -/* DESC: Help text about how a request body could not be show because it's no longer available. */ -ui_strings.S_NETWORK_REQUEST_DETAIL_NO_RESPONSE_BODY = "Response body not available. Enable the \"Track content\" option in Settings and reload the page to view the resource."; - -/* DESC: Title for request details section */ -ui_strings.S_NETWORK_REQUEST_DETAIL_REQUEST_TITLE = "Request"; - -/* DESC: Title for response details section */ -ui_strings.S_NETWORK_REQUEST_DETAIL_RESPONSE_TITLE = "Response"; - -/* DESC: Message about file types we have no good way of showing. */ -ui_strings.S_NETWORK_REQUEST_DETAIL_UNDISPLAYABLE_BODY_LABEL = "Unable to show data of type %s"; - -/* DESC: Message about there being no headers attached to a specific request or response */ -ui_strings.S_NETWORK_REQUEST_NO_HEADERS_LABEL = "No headers"; - -/* DESC: Explanation about why a network requests lacks headers. */ -ui_strings.S_NETWORK_SERVED_FROM_CACHE = "No request made. All data was retrieved from cache without accessing the network."; - -/* DESC: Unknown mime type for content */ -ui_strings.S_NETWORK_UNKNOWN_MIME_TYPE = "MIME type not known for request data"; - -/* DESC: The string "None" used wherever there's an absence of something */ -ui_strings.S_NONE = "None"; - -/* DESC: Info in the DOM side panel that the selected node has no event listeners attached. */ -ui_strings.S_NO_EVENT_LISTENER = "No event listeners"; - -/* DESC: Label in a tooltip */ -ui_strings.S_PROFILER_AREA_DIMENSION = "Area"; - -/* DESC: Label in a tooltip */ -ui_strings.S_PROFILER_AREA_LOCATION = "Location"; - -/* DESC: Message in the profiler when the profiler is calculating */ -ui_strings.S_PROFILER_CALCULATING = "Calculating…"; - -/* DESC: Label in a tooltip */ -ui_strings.S_PROFILER_DURATION = "Duration"; - -/* DESC: Message in the profiler when no data was "captured" by the profiler */ -ui_strings.S_PROFILER_NO_DATA = "No data"; - -/* DESC: Message when an event in the profiler has no details */ -ui_strings.S_PROFILER_NO_DETAILS = "No details"; - -/* DESC: Message in the profiler when the profiler is active */ -ui_strings.S_PROFILER_PROFILING = "Profiling…"; - -/* DESC: Message in the profiler when the profiler failed */ -ui_strings.S_PROFILER_PROFILING_FAILED = "Profiling failed"; - -/* DESC: Message before activating the profiler profile */ -ui_strings.S_PROFILER_RELOAD = "To get accurate data from the profiler, all other features have to be disabled and the document has to be reloaded."; - -/* DESC: Label in a tooltip */ -ui_strings.S_PROFILER_SELF_TIME = "Self time"; - -/* DESC: Message before starting the profiler */ -ui_strings.S_PROFILER_START_MESSAGE = "Press the Record button to start profiling"; - -/* DESC: Label in a tooltip */ -ui_strings.S_PROFILER_START_TIME = "Start"; - -/* DESC: Label in a tooltip */ -ui_strings.S_PROFILER_TOTAL_SELF_TIME = "Total self time"; - -/* DESC: Label in a tooltip */ -ui_strings.S_PROFILER_TYPE_EVENT = "Event name"; - -/* DESC: Label in a tooltip */ -ui_strings.S_PROFILER_TYPE_SCRIPT = "Script type"; - -/* DESC: Label in a tooltip */ -ui_strings.S_PROFILER_TYPE_SELECTOR = "Selector"; - -/* DESC: Label in a tooltip */ -ui_strings.S_PROFILER_TYPE_THREAD = "Thread type"; - -/* DESC: Remote debug guide, connection setup */ -ui_strings.S_REMOTE_DEBUG_GUIDE_PRECONNECT_HEADER = "Steps to enable remote debugging:"; - -/* DESC: Remote debug guide, connection setup */ -ui_strings.S_REMOTE_DEBUG_GUIDE_PRECONNECT_STEP_1 = "Specify the port number you wish to connect to, or leave as the default"; - -/* DESC: Remote debug guide, connection setup */ -ui_strings.S_REMOTE_DEBUG_GUIDE_PRECONNECT_STEP_2 = "Click \"Apply\""; - -/* DESC: Remote debug guide, waiting for connection */ -ui_strings.S_REMOTE_DEBUG_GUIDE_WAITING_HEADER = "On the remote device:"; - -/* DESC: Remote debug guide, waiting for connection */ -ui_strings.S_REMOTE_DEBUG_GUIDE_WAITING_STEP_1 = "Enter opera:debug in the URL field"; - -/* DESC: Remote debug guide, waiting for connection */ -ui_strings.S_REMOTE_DEBUG_GUIDE_WAITING_STEP_2 = "Enter the IP address of the machine running Opera Dragonfly"; - -/* DESC: Remote debug guide, waiting for connection */ -ui_strings.S_REMOTE_DEBUG_GUIDE_WAITING_STEP_3 = "Enter the port number %s"; - -/* DESC: Remote debug guide, waiting for connection */ -ui_strings.S_REMOTE_DEBUG_GUIDE_WAITING_STEP_4 = "Click \"Connect\""; - -/* DESC: Remote debug guide, waiting for connection */ -ui_strings.S_REMOTE_DEBUG_GUIDE_WAITING_STEP_5 = "Once connected navigate to the page you wish to debug"; - -/* DESC: Description of the "help" command in the repl */ -ui_strings.S_REPL_HELP_COMMAND_DESC = "Show a list of all available commands"; - -/* DESC: Description of the "jquery" command in the repl */ -ui_strings.S_REPL_JQUERY_COMMAND_DESC = "Load jQuery in the active tab"; - -/* DESC: Printed in the command line view when it is shown for the first time. */ -ui_strings.S_REPL_WELCOME_TEXT = "Type %(CLEAR_COMMAND)s to clear the console.\nType %(HELP_COMMAND)s for more information."; - -/* DESC: "Not applicable" abbreviation */ -ui_strings.S_RESOURCE_ALL_NOT_APPLICABLE = "n/a"; - -/* DESC: Name of host column */ -ui_strings.S_RESOURCE_ALL_TABLE_COLUMN_HOST = "Host"; - -/* DESC: Name of mime column */ -ui_strings.S_RESOURCE_ALL_TABLE_COLUMN_MIME = "MIME"; - -/* DESC: Name of path column */ -ui_strings.S_RESOURCE_ALL_TABLE_COLUMN_PATH = "Path"; - -/* DESC: Name of pretty printed size column */ -ui_strings.S_RESOURCE_ALL_TABLE_COLUMN_PPSIZE = "Size (pretty printed)"; - -/* DESC: Name of protocol column */ -ui_strings.S_RESOURCE_ALL_TABLE_COLUMN_PROTOCOL = "Protocol"; - -/* DESC: Name of size column */ -ui_strings.S_RESOURCE_ALL_TABLE_COLUMN_SIZE = "Size"; - -/* DESC: Name of type column */ -ui_strings.S_RESOURCE_ALL_TABLE_COLUMN_TYPE = "Type"; - -/* DESC: Name of types size group */ -ui_strings.S_RESOURCE_ALL_TABLE_GROUP_GROUPS = "Groups"; - -/* DESC: Name of hosts size group */ -ui_strings.S_RESOURCE_ALL_TABLE_GROUP_HOSTS = "Hosts"; - -/* DESC: Fallback text for no filename, used as tab label */ -ui_strings.S_RESOURCE_ALL_TABLE_NO_FILENAME = ""; - -/* DESC: Fallback text for no host */ -ui_strings.S_RESOURCE_ALL_TABLE_NO_HOST = "No host"; - -/* DESC: Fallback text for unknown groups */ -ui_strings.S_RESOURCE_ALL_TABLE_UNKNOWN_GROUP = "Unknown"; - -/* DESC: Click reload button to fetch resources */ -ui_strings.S_RESOURCE_CLICK_BUTTON_TO_FETCH_RESOURCES = "Click the reload button above to reload the debugged window and fetch its resources"; - -/* DESC: Label for the global scope in the Scope Chain. */ -ui_strings.S_SCOPE_GLOBAL = "Global"; - -/* DESC: Label for the scopes other than local and global in the Scope Chain. */ -ui_strings.S_SCOPE_INNER = "Scope %s"; - -/* DESC: Section header in the script drop-down select for Browser and User JS. */ -ui_strings.S_SCRIPT_SELECT_SECTION_BROWSER_AND_USER_JS = "Browser JS and User JS"; - -/* DESC: Section header in the script drop-down select for inline, eval, timeout and event handler scripts. */ -ui_strings.S_SCRIPT_SELECT_SECTION_INLINE_AND_EVALS = "Inline, eval, timeout and event-handler scripts"; - -/* DESC: Script type for events in the profiler */ -ui_strings.S_SCRIPT_TYPE_BROWSERJS = "BrowserJS"; - -/* DESC: Script type for events in the profiler */ -ui_strings.S_SCRIPT_TYPE_DEBUGGER = "Debugger"; - -/* DESC: Script type for events in the profiler */ -ui_strings.S_SCRIPT_TYPE_EVAL = "Eval"; - -/* DESC: Script type for events in the profiler */ -ui_strings.S_SCRIPT_TYPE_EVENT_HANDLER = "Event"; - -/* DESC: Script type for events in the profiler */ -ui_strings.S_SCRIPT_TYPE_EXTENSIONJS = "Extension"; - -/* DESC: Script type for events in the profiler */ -ui_strings.S_SCRIPT_TYPE_GENERATED = "document.write()"; - -/* DESC: Script type for events in the profiler */ -ui_strings.S_SCRIPT_TYPE_INLINE = "Inline"; - -/* DESC: Script type for events in the profiler */ -ui_strings.S_SCRIPT_TYPE_LINKED = "External"; - -/* DESC: Script type for events in the profiler */ -ui_strings.S_SCRIPT_TYPE_TIMEOUT = "Timeout or interval"; - -/* DESC: Script type for events in the profiler */ -ui_strings.S_SCRIPT_TYPE_UNKNOWN = "Unknown"; - -/* DESC: Script type for events in the profiler */ -ui_strings.S_SCRIPT_TYPE_URI = "javascript: URL"; - -/* DESC: Script type for events in the profiler */ -ui_strings.S_SCRIPT_TYPE_USERJS = "UserJS"; - -/* DESC: Tooltip for filtering text-input boxes */ -ui_strings.S_SEARCH_INPUT_TOOLTIP = "text search"; - -/* DESC: Header for settings group "About" */ -ui_strings.S_SETTINGS_HEADER_ABOUT = "About"; - -/* DESC: Header for settings group "Console" */ -ui_strings.S_SETTINGS_HEADER_CONSOLE = "Error Log"; - -/* DESC: Header for settings group "Document" */ -ui_strings.S_SETTINGS_HEADER_DOCUMENT = "Documents"; - -/* DESC: Header for settings group "General" */ -ui_strings.S_SETTINGS_HEADER_GENERAL = "General"; - -/* DESC: Header for settings group "Keyboard shortcuts" */ -ui_strings.S_SETTINGS_HEADER_KEYBOARD_SHORTCUTS = "Keyboard shortcuts"; - -/* DESC: Header for settings group "Network" */ -ui_strings.S_SETTINGS_HEADER_NETWORK = "Network"; - -/* DESC: Header for settings group "Script" */ -ui_strings.S_SETTINGS_HEADER_SCRIPT = "Scripts"; - -/* DESC: Description for CSS rules with the origin being the user */ -ui_strings.S_STYLE_ORIGIN_LOCAL = "user stylesheet"; - -/* DESC: Description for CSS rules with the origin being the SVG presentation attributes */ -ui_strings.S_STYLE_ORIGIN_SVG = "presentation attributes"; - -/* DESC: Description for CSS rules with the origin being the UA */ -ui_strings.S_STYLE_ORIGIN_USER_AGENT = "user agent stylesheet"; - -/* DESC: Tooltip text for a button that attaches Opera Dragonfly to the main browser window. */ -ui_strings.S_SWITCH_ATTACH_WINDOW = "Dock to main window"; - -/* DESC: When enabled, the request log always scroll to the bottom on new requests */ -ui_strings.S_SWITCH_AUTO_SCROLL_REQUEST_LIST = "Auto-scroll request log"; - -/* DESC: Button title for stopping the profiler */ -ui_strings.S_SWITCH_CHANGE_START_TO_FIRST_EVENT = "Change start time to first event"; - -/* DESC: Checkbox: undocks Opera Dragonfly into a separate window. */ -ui_strings.S_SWITCH_DETACH_WINDOW = "Undock into separate window"; - -/* DESC: Expand all (entries in a list) */ -ui_strings.S_SWITCH_EXPAND_ALL = "Expand all"; - -/* DESC: If enabled objects can be expanded inline in the console. */ -ui_strings.S_SWITCH_EXPAND_OBJECTS_INLINE = "Expand objects inline in the console"; - -/* DESC: Will select the element when clicked. */ -ui_strings.S_SWITCH_FIND_ELEMENT_BY_CLICKING = "Select an element in the page to inspect it"; - -/* DESC: When enabled, objects of type element will be friendly printed */ -ui_strings.S_SWITCH_FRIENDLY_PRINT = "Enable smart-printing for Element objects in the console"; - -/* DESC: Shows or hides empty strings and null values. */ -ui_strings.S_SWITCH_HIDE_EMPTY_STRINGS = "Show empty strings and null values"; - -/* DESC: Highlights page elements when thet mouse hovers. */ -ui_strings.S_SWITCH_HIGHLIGHT_SELECTED_OR_HOVERED_ELEMENT = "Highlight selected element"; - -/* DESC: When enabled, objects of type element in the command line will be displayed in the DOM view */ -ui_strings.S_SWITCH_IS_ELEMENT_SENSITIVE = "Display Element objects in the DOM panel when selected in the console"; - -/* DESC: Draw a border on to selected DOM elements */ -ui_strings.S_SWITCH_LOCK_SELECTED_ELEMENTS = "Keep elements highlighted"; - -/* DESC: Switch toggeling if the debugger should automatically reload the page when the user changes the window to debug. */ -ui_strings.S_SWITCH_RELOAD_SCRIPTS_AUTOMATICALLY = "Reload new debugging contexts automatically"; - -/* DESC: Route debugging traffic trough proxy to enable debugging devices */ -ui_strings.S_SWITCH_REMOTE_DEBUG = "Remote debug"; - -/* DESC: Scroll an element in the host into view when selecting it in the DOM. */ -ui_strings.S_SWITCH_SCROLL_INTO_VIEW_ON_FIRST_SPOTLIGHT = "Scroll into view on first highlight"; - -/* DESC: List item in the DOM settings menu to shows or hide comments in DOM. Also Tooltip text for button in the secondary DOM menu. */ -ui_strings.S_SWITCH_SHOW_COMMENT_NODES = "Show comment nodes"; - -/* DESC: Shows DOM in tree or mark-up mode. */ -ui_strings.S_SWITCH_SHOW_DOM_INTREE_VIEW = "Represent the DOM as a node tree"; - -/* DESC: Show ECMAScript errors in the command line. */ -ui_strings.S_SWITCH_SHOW_ECMA_ERRORS_IN_COMMAND_LINE = "Show JavaScript errors in the console"; - -/* DESC: Show default null and empty string values when inspecting a js object. */ -ui_strings.S_SWITCH_SHOW_FEFAULT_NULLS_AND_EMPTY_STRINGS = "Show default values if they are null or empty strings"; - -/* DESC: Showing the id's and class names in the breadcrumb in the statusbar. */ -ui_strings.S_SWITCH_SHOW_ID_AND_CLASSES_IN_BREAD_CRUMB = "Show id's and classes in breadcrumb trail"; - -/* DESC: Toggles the display of pre-set values in the computed styles view. */ -ui_strings.S_SWITCH_SHOW_INITIAL_VALUES = "Show initial values"; - -/* DESC: Show non enumerale properties when inspecting a js object. */ -ui_strings.S_SWITCH_SHOW_NON_ENUMERABLES = "Show non-enumerable properties"; - -/* DESC: There are a lot of window types in Opera. This switch toggles if we show only the useful ones, or all of them. */ -ui_strings.S_SWITCH_SHOW_ONLY_NORMAL_AND_GADGETS_TYPE_WINDOWS = "Hide browser-specific contexts, such as mail and feed windows"; - -/* DESC: Show prototpe objects when inspecting a js object. */ -ui_strings.S_SWITCH_SHOW_PROTOTYPES = "Show prototypes"; - -/* DESC: Show pseudo elements in the DOM view */ -ui_strings.S_SWITCH_SHOW_PSEUDO_ELEMENTS = "Show pseudo-elements"; - -/* DESC: Showing the siblings in the breadcrumb in the statusbar. */ -ui_strings.S_SWITCH_SHOW_SIBLINGS_IN_BREAD_CRUMB = "Show siblings in breadcrumb trail"; - -/* DESC: Switch display of 'All' tab on or off. */ -ui_strings.S_SWITCH_SHOW_TAB_ALL = "All"; - -/* DESC: Switch display of 'Bittorrent' tab on or off. */ -ui_strings.S_SWITCH_SHOW_TAB_BITTORRENT = "BitTorrent"; - -/* DESC: Switch display of 'CSS' tab on or off. */ -ui_strings.S_SWITCH_SHOW_TAB_CSS = "CSS"; - -/* DESC: Switch display of 'HTML' tab on or off. */ -ui_strings.S_SWITCH_SHOW_TAB_HTML = "HTML"; - -/* DESC: Switch display of 'Java' tab on or off. */ -ui_strings.S_SWITCH_SHOW_TAB_JAVA = "Java"; - -/* DESC: Switch display of 'Mail' tab on or off. */ -ui_strings.S_SWITCH_SHOW_TAB_M2 = "Mail"; - -/* DESC: Switch display of 'Network' tab on or off. */ -ui_strings.S_SWITCH_SHOW_TAB_NETWORK = "Network"; - -/* DESC: Switch display of 'Script' tab on or off. */ -ui_strings.S_SWITCH_SHOW_TAB_SCRIPT = "JavaScript"; - -/* DESC: Switch display of 'SVG' tab on or off. */ -ui_strings.S_SWITCH_SHOW_TAB_SVG = "SVG"; - -/* DESC: Switch display of 'Voice' tab on or off. */ -ui_strings.S_SWITCH_SHOW_TAB_VOICE = "Voice"; - -/* DESC: Switch display of 'Widget' tab on or off. */ -ui_strings.S_SWITCH_SHOW_TAB_WIDGET = "Widgets"; - -/* DESC: Switch display of 'XML' tab on or off. */ -ui_strings.S_SWITCH_SHOW_TAB_XML = "XML"; - -/* DESC: Switch display of 'XSLT' tab on or off. */ -ui_strings.S_SWITCH_SHOW_TAB_XSLT = "XSLT"; - -/* DESC: List item in General settings menu to show or hide Views menu. */ -ui_strings.S_SWITCH_SHOW_VIEWS_MENU = "Show Views menu"; - -/* DESC: Shows or hides white space nodes in DOM. */ -ui_strings.S_SWITCH_SHOW_WHITE_SPACE_NODES = "Show whitespace nodes"; - -/* DESC: When enabled, a screenshot is taken automatically on showing utilities */ -ui_strings.S_SWITCH_TAKE_SCREENSHOT_AUTOMATICALLY = "Take a screenshot automatically when opening Utilities"; - -/* DESC: Settings checkbox label for toggling usage tracking. Add one to a running total each time the user starts Dragonfly. */ -ui_strings.S_SWITCH_TRACK_USAGE = "Track usage. Sends a randomly-generated user ID to the Opera Dragonfly servers each time Opera Dragonfly is started."; - -/* DESC: When enabled, list alike objects will be unpacked in the command line */ -ui_strings.S_SWITCH_UNPACK_LIST_ALIKES = "Unpack objects which have list-like behavior in the console"; - -/* DESC: List item in the DOM settings menu to update the DOM model automatically when a node is being removed. Also Tooltip text for button in the secondary DOM menu. */ -ui_strings.S_SWITCH_UPDATE_DOM_ON_NODE_REMOVE = "Update DOM when a node is removed"; - -/* DESC: List item in the DOM settings menu. */ -ui_strings.S_SWITCH_UPDATE_GLOBAL_SCOPE = "Automatically update global scope"; - -/* DESC: Spell HTML tag names upper or lower case. */ -ui_strings.S_SWITCH_USE_LOWER_CASE_TAG_NAMES = "Use lower case tag names for text/html"; - -/* DESC: Table header in the profiler */ -ui_strings.S_TABLE_HEADER_HITS = "Hits"; - -/* DESC: Table header in the profiler */ -ui_strings.S_TABLE_HEADER_TIME = "Time"; - -/* DESC: Entry format in the call stack view showing the function name, line number and script ID. Please do not modify the %(VARIABLE)s . */ -ui_strings.S_TEXT_CALL_STACK_FRAME_LINE = "%(FUNCTION_NAME)s: %(SCRIPT_ID)s:%(LINE_NUMBER)s"; - -/* DESC: Badge for the script ID in Scripts view. */ -ui_strings.S_TEXT_ECMA_SCRIPT_SCRIPT_ID = "Script id"; - -/* DESC: Badge for inline scripts. */ -ui_strings.S_TEXT_ECMA_SCRIPT_TYPE_INLINE = "Inline"; - -/* DESC: Badge for linked scripts. */ -ui_strings.S_TEXT_ECMA_SCRIPT_TYPE_LINKED = "Linked"; - -/* DESC: Badge for unknown script types. */ -ui_strings.S_TEXT_ECMA_SCRIPT_TYPE_UNKNOWN = "Unknown"; - -/* DESC: Information on the Opera Dragonfly version number that appears in the Environment view. */ -ui_strings.S_TEXT_ENVIRONMENT_DRAGONFLY_VERSION = "Opera Dragonfly Version"; - -/* DESC: Information on the operating system used that appears in the Environment view. */ -ui_strings.S_TEXT_ENVIRONMENT_OPERATING_SYSTEM = "Operating System"; - -/* DESC: Information on the platform in use that appears in the Environment view. */ -ui_strings.S_TEXT_ENVIRONMENT_PLATFORM = "Platform"; - -/* DESC: Information on the Scope protocol version used that appears in the Environment view. */ -ui_strings.S_TEXT_ENVIRONMENT_PROTOCOL_VERSION = "Protocol Version"; - -/* DESC: Information on the Opera Dragonfly revision number that appears in the Environment view. */ -ui_strings.S_TEXT_ENVIRONMENT_REVISION_NUMBER = "Revision Number"; - -/* DESC: Information on the user-agent submitted that appears in the Environment view. */ -ui_strings.S_TEXT_ENVIRONMENT_USER_AGENT = "User Agent"; - -/* DESC: Result text for a search when there were search results. The %(VARIABLE)s should not be translated, but its position in the text can be rearranged. Python syntax: %(VARIABLE)type_identifier, so %(FOO)s in its entirety is replaced. */ -ui_strings.S_TEXT_STATUS_SEARCH = "Matches for \"%(SEARCH_TERM)s\": Match %(SEARCH_COUNT_INDEX)s out of %(SEARCH_COUNT_TOTAL)s"; - -/* DESC: Result text for the search. Please do not modify the %(VARIABLE)s . */ -ui_strings.S_TEXT_STATUS_SEARCH_NO_MATCH = "No match for \"%(SEARCH_TERM)s\""; - -/* DESC: Thread type for events in the profiler */ -ui_strings.S_THREAD_TYPE_COMMON = "Common"; - -/* DESC: Thread type for events in the profiler */ -ui_strings.S_THREAD_TYPE_DEBUGGER_EVAL = "Debugger"; - -/* DESC: Thread type for events in the profiler */ -ui_strings.S_THREAD_TYPE_EVENT = "Event"; - -/* DESC: Thread type for events in the profiler */ -ui_strings.S_THREAD_TYPE_HISTORY_NAVIGATION = "History navigation"; - -/* DESC: Thread type for events in the profiler */ -ui_strings.S_THREAD_TYPE_INLINE_SCRIPT = "Inline script"; - -/* DESC: Thread type for events in the profiler */ -ui_strings.S_THREAD_TYPE_JAVASCRIPT_URL = "javascript: URL"; - -/* DESC: Thread type for events in the profiler. This should not be translated. */ -ui_strings.S_THREAD_TYPE_JAVA_EVAL = "Java (LiveConnect)"; - -/* DESC: Thread type for events in the profiler */ -ui_strings.S_THREAD_TYPE_TIMEOUT = "Timeout or interval"; - -/* DESC: Thread type for events in the profiler */ -ui_strings.S_THREAD_TYPE_UNKNOWN = "Unknown"; - -/* DESC: Enabling/disabling DOM modebar */ -ui_strings.S_TOGGLE_DOM_MODEBAR = "Show breadcrumb trail"; - -/* DESC: Heading for the setting that toggles the breadcrumb trail */ -ui_strings.S_TOGGLE_DOM_MODEBAR_HEADER = "Breadcrumb Trail"; - -/* DESC: Label on button to pause/unpause updates of the network graph view */ -ui_strings.S_TOGGLE_PAUSED_UPDATING_NETWORK_VIEW = "Pause updating network activity"; - +/* DESC: Confirm dialog text for asking if the user wants to redo the search because the context has changed. */ +ui_strings.D_REDO_SEARCH = "The searched document no longer exists.\nRepeat search in the current document?"; + +/* DESC: Confirm dialog text for asking if the user wants to reload and reformat the scripts now. */ +ui_strings.D_REFORMAT_SCRIPTS = "Reload the page to reformat the scripts now?"; + +/* DESC: Confirm dialog text for asking if the user wants to reload all scripts. */ +ui_strings.D_RELOAD_SCRIPTS = "Not all scripts are loaded. Do you want to reload the page?"; + +/* DESC: Alert dialog that updating of the custom shortcuts with new ones has failed. */ +ui_strings.D_SHORTCUTS_UPDATE_FAILED = "Failed to sync custom shortcuts. The shortcuts are reset to the default ones."; + +/* DESC: Context menu item for adding an attribute in the DOM view. */ +ui_strings.M_CONTEXTMENU_ADD_ATTRIBUTE = "Add attribute"; + +/* DESC: Context menu item for adding a breakpoint. */ +ui_strings.M_CONTEXTMENU_ADD_BREAKPOINT = "Add breakpoint"; + +/* DESC: Context menu item to add a color in the color palette. */ +ui_strings.M_CONTEXTMENU_ADD_COLOR = "Add color"; + +/* DESC: Context menu item for breakpoints to add a condition. */ +ui_strings.M_CONTEXTMENU_ADD_CONDITION = "Add condition"; + +/* DESC: Context menu item for adding a declaration in a rule. */ +ui_strings.M_CONTEXTMENU_ADD_DECLARATION = "Add declaration"; + +/* DESC: Context menu item for adding a something to watches. */ +ui_strings.M_CONTEXTMENU_ADD_WATCH = "Watch \"%s\""; + +/* DESC: Context menu item for collapsing a node subtree. */ +ui_strings.M_CONTEXTMENU_COLLAPSE_SUBTREE = "Collapse subtree"; + +/* DESC: Context menu item, general "Delete" in a context, e.g. a breakpoint */ +ui_strings.M_CONTEXTMENU_DELETE = "Delete"; + +/* DESC: Context menu item, general "Delete all" in a context, e.g. breakpoints */ +ui_strings.M_CONTEXTMENU_DELETE_ALL = "Delete all"; + +/* DESC: Context menu item for deleting all breakpoints */ +ui_strings.M_CONTEXTMENU_DELETE_ALL_BREAKPOINTS = "Delete all breakpoints"; + +/* DESC: Context menu item for deleting a breakpoint. */ +ui_strings.M_CONTEXTMENU_DELETE_BREAKPOINT = "Delete breakpoint"; + +/* DESC: Context menu item to delete a color in the color palette. */ +ui_strings.M_CONTEXTMENU_DELETE_COLOR = "Delete color"; + +/* DESC: Context menu item for breakpoints to delete a condition. */ +ui_strings.M_CONTEXTMENU_DELETE_CONDITION = "Delete condition"; + +/* DESC: Context menu item, general "Disable all" in a context, e.g. breakpoints */ +ui_strings.M_CONTEXTMENU_DISABLE_ALL = "Disable all"; + +/* DESC: Context menu item for disabling all breakpoints */ +ui_strings.M_CONTEXTMENU_DISABLE_ALL_BREAKPOINTS = "Disable all breakpoints"; + +/* DESC: Context menu item for disabling a breakpoint. */ +ui_strings.M_CONTEXTMENU_DISABLE_BREAKPOINT = "Disable breakpoint"; + +/* DESC: Context menu item for disabling all declarations in a rule. */ +ui_strings.M_CONTEXTMENU_DISABLE_DECLARATIONS = "Disable all declarations"; + +/* DESC: Context menu item for editing an attribute name in the DOM view. */ +ui_strings.M_CONTEXTMENU_EDIT_ATTRIBUTE = "Edit attribute"; + +/* DESC: Context menu item for editing an attribute value in the DOM view. */ +ui_strings.M_CONTEXTMENU_EDIT_ATTRIBUTE_VALUE = "Edit attribute value"; + +/* DESC: Context menu item to edit a color in the color palette. */ +ui_strings.M_CONTEXTMENU_EDIT_COLOR = "Edit color"; + +/* DESC: Context menu item for breakpoints to edit a condition. */ +ui_strings.M_CONTEXTMENU_EDIT_CONDITION = "Edit condition"; + +/* DESC: Context menu item for editiing a declaration in a rule. */ +ui_strings.M_CONTEXTMENU_EDIT_DECLARATION = "Edit declaration"; + +/* DESC: Context menu item for editing some piece of markup in the DOM view. */ +ui_strings.M_CONTEXTMENU_EDIT_MARKUP = "Edit markup"; + +/* DESC: Context menu item for editing text in the DOM view. */ +ui_strings.M_CONTEXTMENU_EDIT_TEXT = "Edit text"; + +/* DESC: Context menu item for enabling a breakpoint. */ +ui_strings.M_CONTEXTMENU_ENABLE_BREAKPOINT = "Enable breakpoint"; + +/* DESC: Context menu item for expanding a node subtree. */ +ui_strings.M_CONTEXTMENU_EXPAND_SUBTREE = "Expand subtree"; + +/* DESC: Context menu item for showing the color picker. */ +ui_strings.M_CONTEXTMENU_OPEN_COLOR_PICKER = "Open color picker"; + +/* DESC: Context menu item for removing a property in a rule. */ +ui_strings.M_CONTEXTMENU_REMOVE_DECLARATION = "Delete declaration"; + +/* DESC: Context menu item for removing a node in the DOM view. */ +ui_strings.M_CONTEXTMENU_REMOVE_NODE = "Delete node"; + +/* DESC: Show resource context menu entry. */ +ui_strings.M_CONTEXTMENU_SHOW_RESOURCE = "Show resource"; + +/* DESC: Context menu item for specification links. */ +ui_strings.M_CONTEXTMENU_SPEC_LINK = "Specification for \"%s\""; + +/* DESC: Context menu item for adding an item in the storage view. */ +ui_strings.M_CONTEXTMENU_STORAGE_ADD = "Add item"; + +/* DESC: Context menu item for deleting an item in the storage view. */ +ui_strings.M_CONTEXTMENU_STORAGE_DELETE = "Delete item"; + +/* DESC: Context menu item for editing an item in the storage view, where %s is the domain name. */ +ui_strings.M_CONTEXTMENU_STORAGE_DELETE_ALL_FROM = "Delete all from %s"; + +/* DESC: Context menu item for deleting multiple items in the storage view. */ +ui_strings.M_CONTEXTMENU_STORAGE_DELETE_PLURAL = "Delete items"; + +/* DESC: Context menu item for editing an item in the storage view. */ +ui_strings.M_CONTEXTMENU_STORAGE_EDIT = "Edit item"; + +/* DESC: Label for option that clears all errors */ +ui_strings.M_LABEL_CLEAR_ALL_ERRORS = "Clear all errors"; + +/* DESC: Label for user interface language dropdown in settings */ +ui_strings.M_LABEL_UI_LANGUAGE = "User interface language"; + +/* DESC: Label for request body input in network crafter */ +ui_strings.M_NETWORK_CRAFTER_REQUEST_BODY = "Request body"; + +/* DESC: Label for response body input in network crafter */ +ui_strings.M_NETWORK_CRAFTER_RESPONSE_BODY = "Response"; + +/* DESC: Label for send request button in network crafter */ +ui_strings.M_NETWORK_CRAFTER_SEND = "Send request"; + +/* DESC: Label for request duration */ +ui_strings.M_NETWORK_REQUEST_DETAIL_DURATION = "Duration"; + +/* DESC: Label for get response body int network request view */ +ui_strings.M_NETWORK_REQUEST_DETAIL_GET_RESPONSE_BODY_LABEL = "Get response body"; + +/* DESC: Label request status */ +ui_strings.M_NETWORK_REQUEST_DETAIL_STATUS = "Status"; + +/* DESC: General settings label. */ +ui_strings.M_SETTING_LABEL_GENERAL = "General"; + +/* DESC: Context menu entry to selecting to group by %s */ +ui_strings.M_SORTABLE_TABLE_CONTEXT_GROUP_BY = "Group by \"%s\""; + +/* DESC: Context menu entry to select that there should be no grouping in the table */ +ui_strings.M_SORTABLE_TABLE_CONTEXT_NO_GROUPING = "No grouping"; + +/* DESC: Context menu entry to reset the columns that are shown */ +ui_strings.M_SORTABLE_TABLE_CONTEXT_RESET_COLUMNS = "Reset columns"; + +/* DESC: Context menu entry to reset the sort order */ +ui_strings.M_SORTABLE_TABLE_CONTEXT_RESET_SORT = "Reset sorting"; + +/* DESC: view that shows all resources */ +ui_strings.M_VIEW_LABEL_ALL_RESOURCES = "All resources"; + +/* DESC: view to set and remove breakpoints */ +ui_strings.M_VIEW_LABEL_BREAKPOINTS = "Breakpoints"; + +/* DESC: Tab heading for area for call stack overview, a list of function calls. */ +ui_strings.M_VIEW_LABEL_CALLSTACK = "Call Stack"; + +/* DESC: Label of the pixel magnifier and color picker view */ +ui_strings.M_VIEW_LABEL_COLOR_MAGNIFIER_AND_PICKER = "Pixel Magnifier and Color Picker"; + +/* DESC: View of the palette of the stored colors. */ +ui_strings.M_VIEW_LABEL_COLOR_PALETTE = "Color Palette"; + +/* DESC: View of the palette of the stored colors. */ +ui_strings.M_VIEW_LABEL_COLOR_PALETTE_SHORT = "Palette"; + +/* DESC: View with a screenshot to select a color. */ +ui_strings.M_VIEW_LABEL_COLOR_PICKER = "Color Picker"; + +/* DESC: Label of the section for selecting a color in color picker */ +ui_strings.M_VIEW_LABEL_COLOR_SELECT = "Color Select"; + +/* DESC: Command line. */ +ui_strings.M_VIEW_LABEL_COMMAND_LINE = "Console"; + +/* DESC: View for DOM debugging. */ +ui_strings.M_VIEW_LABEL_COMPOSITE_DOM = "Documents"; + +/* DESC: View for error log. */ +ui_strings.M_VIEW_LABEL_COMPOSITE_ERROR_CONSOLE = "Errors"; + +/* DESC: Tab heading for the view for exported code. */ +ui_strings.M_VIEW_LABEL_COMPOSITE_EXPORTS = "Export"; + +/* DESC: Tab heading for the view for script debuggingand Settings label. */ +ui_strings.M_VIEW_LABEL_COMPOSITE_SCRIPTS = "Scripts"; + +/* DESC: Menu heading, expandable, for displaying the styles that the rendering computed from all stylesheets. */ +ui_strings.M_VIEW_LABEL_COMPUTED_STYLE = "Computed Style"; + +/* DESC: The view on the console. */ +ui_strings.M_VIEW_LABEL_CONSOLE = "Error Panels"; + +/* DESC: view for cookies */ +ui_strings.M_VIEW_LABEL_COOKIES = "Cookies"; + +/* DESC: View to see the DOM tree. */ +ui_strings.M_VIEW_LABEL_DOM = "DOM Panel"; + +/* DESC: Tab heading for the list of properties of a selected DOM node and a Settings label. */ +ui_strings.M_VIEW_LABEL_DOM_ATTR = "Properties"; + +/* DESC: Tab heading for area giving information of the runtime environment. */ +ui_strings.M_VIEW_LABEL_ENVIRONMENT = "Environment"; + +/* DESC: Tab heading, subhead under the Error Console tab for the error view filter for showing all errors. */ +ui_strings.M_VIEW_LABEL_ERROR_ALL = "All"; + +/* DESC: See Opera Error console: Error view filter for showing all Bittorrent errors. */ +ui_strings.M_VIEW_LABEL_ERROR_BITTORRENT = "BitTorrent"; + +/* DESC: Tab heading, subhead under the Error Console tab for the error view filter for showing all CSS errors. */ +ui_strings.M_VIEW_LABEL_ERROR_CSS = "CSS"; + +/* DESC: Tab heading, subhead under the Error Console tab for the error view filter for showing all HTML errors. */ +ui_strings.M_VIEW_LABEL_ERROR_HTML = "HTML"; + +/* DESC: Tab heading, subhead under the Error Console tab for the error view filter for showing all Java errors. */ +ui_strings.M_VIEW_LABEL_ERROR_JAVA = "Java"; + +/* DESC: Tooltip that explains File:Line notation (e.g. in Error Log) */ +ui_strings.M_VIEW_LABEL_ERROR_LOCATION_TITLE = "Line %(LINE)s in %(URI)s"; + +/* DESC: Tab heading, subhead under the Error Console tab for the error view filter for showing all Mail errors. */ +ui_strings.M_VIEW_LABEL_ERROR_M2 = "Mail"; + +/* DESC: Tab heading, subhead under the Error Console tab for the error view filter for showing all Network errors. */ +ui_strings.M_VIEW_LABEL_ERROR_NETWORK = "Network"; + +/* DESC: Tab heading, subhead under the Error Console tab for the error view filter for showing errors that we don't have a dedicated tab for. */ +ui_strings.M_VIEW_LABEL_ERROR_OTHER = "Other"; + +/* DESC: Tab heading, subhead under the Error Console tab for the error view filter for showing all JS errors. */ +ui_strings.M_VIEW_LABEL_ERROR_SCRIPT = "JavaScript"; + +/* DESC: Tab heading, subhead under the Error Console tab for the error view filter for showing all Storage errors. */ +ui_strings.M_VIEW_LABEL_ERROR_STORAGE = "Storage"; + +/* DESC: Tab heading, subhead under the Error Console tab for the error view filter for showing all SVG errors. */ +ui_strings.M_VIEW_LABEL_ERROR_SVG = "SVG"; + +/* DESC: See Opera Error console: Error view filter for showing all Widget errors. */ +ui_strings.M_VIEW_LABEL_ERROR_WIDGET = "Widgets"; + +/* DESC: Tab heading, subhead under the Error Console tab for the error view filter for showing all XML errors. */ +ui_strings.M_VIEW_LABEL_ERROR_XML = "XML"; + +/* DESC: Tab heading, subhead under the Error Console tab for the error view filter for showing all XSLT errors. */ +ui_strings.M_VIEW_LABEL_ERROR_XSLT = "XSLT"; + +/* DESC: view to set and remove event breakpoints */ +ui_strings.M_VIEW_LABEL_EVENT_BREAKPOINTS = "Event Breakpoints"; + +/* DESC: Side panel view with event listeners. */ +ui_strings.M_VIEW_LABEL_EVENT_LISTENERS = "Listeners"; + +/* DESC: View with all event listeners. */ +ui_strings.M_VIEW_LABEL_EVENT_LISTENERS_ALL = "All"; + +/* DESC: View with the event listeners of the selected node. */ +ui_strings.M_VIEW_LABEL_EVENT_LISTENERS_SELECTED_NODE = "Selected node"; + +/* DESC: Heading for Export button, accessed by clicking the subhead DOM view button. */ +ui_strings.M_VIEW_LABEL_EXPORT = "Export"; + +/* DESC: Tab heading for the area displaying JS properties of a frame or object and a Settings label. */ +ui_strings.M_VIEW_LABEL_FRAME_INSPECTION = "Inspection"; + +/* DESC: Label for a utility window that enables the user to enter a line number, and go to that line. */ +ui_strings.M_VIEW_LABEL_GO_TO_LINE = "Go to line"; + +/* DESC: Tab heading for the box model layout display and a Settings label. */ +ui_strings.M_VIEW_LABEL_LAYOUT = "Layout"; + +/* DESC: view for the local storage */ +ui_strings.M_VIEW_LABEL_LOCAL_STORAGE = "Local Storage"; + +/* DESC: Label for the setting of the monospace font. */ +ui_strings.M_VIEW_LABEL_MONOSPACE_FONT = "Monospace Font"; + +/* DESC: Tab heading for the view for network debugging (and http logger) */ +ui_strings.M_VIEW_LABEL_NETWORK = "Network"; + +/* DESC: view that shows network log */ +ui_strings.M_VIEW_LABEL_NETWORK_LOG = "Network log"; + +/* DESC: view that shows network options */ +ui_strings.M_VIEW_LABEL_NETWORK_OPTIONS = "Network options"; + +/* DESC: Section title for new styles. */ +ui_strings.M_VIEW_LABEL_NEW_STYLE = "New Style"; + +/* DESC: Text to show in call stack when the execution is not stopped. */ +ui_strings.M_VIEW_LABEL_NOT_STOPPED = "Not stopped"; + +/* DESC: Text to show in breakpoins if there is no breakpoint. */ +ui_strings.M_VIEW_LABEL_NO_BREAKPOINT = "No breakpoint"; + +/* DESC: Text to show in inspection if there is no object to inspect. */ +ui_strings.M_VIEW_LABEL_NO_INSPECTION = "No inspection"; + +/* DESC: Text to show in watches if there are no watches */ +ui_strings.M_VIEW_LABEL_NO_WATCHES = "No watches"; + +/* DESC: View for DOM debugging. */ +ui_strings.M_VIEW_LABEL_PROFILER = "Profiler"; + +/* DESC: Name of raw request tab */ +ui_strings.M_VIEW_LABEL_RAW_REQUEST_INFO = "Raw request"; + +/* DESC: Name of raw response tab */ +ui_strings.M_VIEW_LABEL_RAW_RESPONSE_INFO = "Raw Response"; + +/* DESC: view that shows request crafter */ +ui_strings.M_VIEW_LABEL_REQUEST_CRAFTER = "Make request"; + +/* DESC: Name of request headers tab */ +ui_strings.M_VIEW_LABEL_REQUEST_HEADERS = "Request Headers"; + +/* DESC: Name of request log tab */ +ui_strings.M_VIEW_LABEL_REQUEST_LOG = "Request log"; + +/* DESC: Name of request summary view */ +ui_strings.M_VIEW_LABEL_REQUEST_SUMMARY = "Request Summary"; + +/* DESC: View for overview of resources contained in a document */ +ui_strings.M_VIEW_LABEL_RESOURCES = "Resources"; + +/* DESC: Name of response body tab */ +ui_strings.M_VIEW_LABEL_RESPONSE_BODY = "Response body"; + +/* DESC: Name of response headers tab */ +ui_strings.M_VIEW_LABEL_RESPONSE_HEADERS = "Response Headers"; + +/* DESC: side panel in the script view with the callstack and the inspection view. */ +ui_strings.M_VIEW_LABEL_RUNTIME_STATE = "State"; + +/* DESC: Subhead located under the Scripts area, for scripts contained in runtime. */ +ui_strings.M_VIEW_LABEL_SCRIPTS = "Scripts"; + +/* DESC: Tab heading for the search panel. */ +ui_strings.M_VIEW_LABEL_SEARCH = "Search"; + +/* DESC: view for the session storage */ +ui_strings.M_VIEW_LABEL_SESSION_STORAGE = "Session Storage"; + +/* DESC: Tab heading for area giving source code view and Settings label . */ +ui_strings.M_VIEW_LABEL_SOURCE = "Source"; + +/* DESC: View for all types of storage, cookies, localStorage, sessionStorage e.t.c */ +ui_strings.M_VIEW_LABEL_STORAGE = "Storage"; + +/* DESC: Label of the stored colors view */ +ui_strings.M_VIEW_LABEL_STORED_COLORS = "Color Palette"; + +/* DESC: Tab heading for the list of all applied styles and a Settings label; also menu heading, expandable, for displaying the styles that got defined in the style sheets. */ +ui_strings.M_VIEW_LABEL_STYLES = "Styles"; + +/* DESC: Tab heading for the view to see style sheet rules and a Settings label. */ +ui_strings.M_VIEW_LABEL_STYLESHEET = "Style Sheet"; + +/* DESC: Tab heading, a subhead under DOM, for area displaying style sheets in the runtime. */ +ui_strings.M_VIEW_LABEL_STYLESHEETS = "Style Sheets"; + +/* DESC: Tab heading for thread log overview, a list of threads and Settings label. */ +ui_strings.M_VIEW_LABEL_THREAD_LOG = "Thread Log"; + +/* DESC: View for utilities, e.g. a pixel maginfier and color picker */ +ui_strings.M_VIEW_LABEL_UTILITIES = "Utilities"; + +/* DESC: Label of the Views menu. */ +ui_strings.M_VIEW_LABEL_VIEWS = "Views"; + +/* DESC: section in the script side panel for watches. */ +ui_strings.M_VIEW_LABEL_WATCHES = "Watches"; + +/* DESC: view for widget prefernces */ +ui_strings.M_VIEW_LABEL_WIDGET_PREFERNCES = "Widget Preferences"; + +/* DESC: Label for the layout subview showing the box-model metrics of an element. */ +ui_strings.M_VIEW_SUB_LABEL_METRICS = "Metrics"; + +/* DESC: Label for the layout subvie showing offsets of the selected element. */ +ui_strings.M_VIEW_SUB_LABEL_OFFSET_VALUES = "Offset Values"; + +/* DESC: Label for the layout subview showing the parent node chain used to calculate the offset. */ +ui_strings.M_VIEW_SUB_LABEL_PARENT_OFFSETS = "Parent Offsets"; + +/* DESC: Anonymous function label. */ +ui_strings.S_ANONYMOUS_FUNCTION_NAME = ""; + +/* DESC: Info in a tooltip that the according listener was set as attribute. */ +ui_strings.S_ATTRIBUTE_LISTENER = "attribute listener"; + +/* DESC: Generic label for a cancel button */ +ui_strings.S_BUTTON_CANCEL = "Cancel"; + +/* DESC: Cancel button while the client is waiting for a host connection. */ +ui_strings.S_BUTTON_CANCEL_REMOTE_DEBUG = "Cancel Remote Debug"; + +/* DESC: Reset all the values to their default state */ +ui_strings.S_BUTTON_COLOR_RESTORE_DEFAULTS = "Restore defaults"; + +/* DESC: Edit custom events */ +ui_strings.S_BUTTON_EDIT_CUSTOM_EVENT = "Edit"; + +/* DESC: Enter anvanced search mode */ +ui_strings.S_BUTTON_ENTER_ADVANCED_SEARCH = "More"; + +/* DESC: Enter anvanced search mode tooltip */ +ui_strings.S_BUTTON_ENTER_ADVANCED_SEARCH_TOOLTIP = "Show advanced search"; + +/* DESC: Expand all sections in the event breakpoints view */ +ui_strings.S_BUTTON_EXPAND_ALL_SECTIONS = "Expand all sections"; + +/* DESC: Execution stops at encountering an abort. */ +ui_strings.S_BUTTON_LABEL_AT_ABORT = "Stop when encountering an abort message"; + +/* DESC: Execution stops when encountering an error. */ +ui_strings.S_BUTTON_LABEL_AT_ERROR = "Show parse errors and break on exceptions"; + +/* DESC: Execution stops when encountering an exception. */ +ui_strings.S_BUTTON_LABEL_AT_EXCEPTION = "Break when an exception is thrown"; + +/* DESC: Empties the log entries. */ +ui_strings.S_BUTTON_LABEL_CLEAR_LOG = "Clear visible errors"; + +/* DESC: Tooltip text for a button on the Thread Log view to clear thread log. */ +ui_strings.S_BUTTON_LABEL_CLEAR_THREAD_LOG = "Clear thread log"; + +/* DESC: Closes the window. */ +ui_strings.S_BUTTON_LABEL_CLOSE_WINDOW = "Close window"; + +/* DESC: Debugger continues debugging. */ +ui_strings.S_BUTTON_LABEL_CONTINUE = "Continue (%s)"; + +/* DESC: Exports the DOM currently shown. */ +ui_strings.S_BUTTON_LABEL_EXPORT_DOM = "Export the current DOM panel"; + +/* DESC: Also Tooltip text for a button on the Thread Log view to export current thread log. */ +ui_strings.S_BUTTON_LABEL_EXPORT_LOG = "Export thread log"; + +/* DESC: Tooltip text for a button under the secondary DOM tab that expands the DOM tree completely. */ +ui_strings.S_BUTTON_LABEL_GET_THE_WOHLE_TREE = "Expand the DOM tree"; + +/* DESC: Opens help. */ +ui_strings.S_BUTTON_LABEL_HELP = "Help"; + +/* DESC: Hides all default properties in the global scope. */ +ui_strings.S_BUTTON_LABEL_HIDE_DEFAULT_PROPS_IN_GLOBAL_SCOPE = "Show default properties in global scope"; + +/* DESC: List item under the Source settings menu to logs all threads when activated. Also Tooltip text for a button on the Source tab. */ +ui_strings.S_BUTTON_LABEL_LOG_THREADS = "Log threads"; + +/* DESC: Refetch the event listeners. */ +ui_strings.S_BUTTON_LABEL_REFETCH_EVENT_LISTENERS = "Refetch event listeners"; + +/* DESC: Enable reformatting of JavaScript. */ +ui_strings.S_BUTTON_LABEL_REFORMAT_JAVASCRIPT = "Pretty print JavaScript"; + +/* DESC: Tooltip text for a button under the Scripts tab that reloads the browser to receive fresh DOM, etc. */ +ui_strings.S_BUTTON_LABEL_RELOAD_HOST = "Reload the selected window in the browser"; + +/* DESC: For selecting which window to debug. */ +ui_strings.S_BUTTON_LABEL_SELECT_WINDOW = "Select the debugging context you want to debug"; + +/* DESC: Tooltip text for the Settings button that launches the Settings view. */ +ui_strings.S_BUTTON_LABEL_SETTINGS = "Settings"; + +/* DESC: Debugger step into current statement. */ +ui_strings.S_BUTTON_LABEL_STEP_INTO = "Step into (%s)"; + +/* DESC: Debugger step out from current statement. */ +ui_strings.S_BUTTON_LABEL_STEP_OUT = "Step out (%s)"; + +/* DESC: Debugger step over current statement. */ +ui_strings.S_BUTTON_LABEL_STEP_OVER = "Step over (%s)"; + +/* DESC: Execution stops when a new script is encountered. */ +ui_strings.S_BUTTON_LABEL_STOP_AT_THREAD = "Break on first statement of a new script"; + +/* DESC: Leave anvanced search mode */ +ui_strings.S_BUTTON_LEAVE_ADVANCED_SEARCH = "Less"; + +/* DESC: Leave anvanced search mode tooltip */ +ui_strings.S_BUTTON_LEAVE_ADVANCED_SEARCH_TOOLTIP = "Show search bar"; + +/* DESC: Button label to show window for loading a PO file */ +ui_strings.S_BUTTON_LOAD_PO_FILE = "Load PO file"; + +/* DESC: Generic label for an OK button */ +ui_strings.S_BUTTON_OK = "OK"; + +/* DESC: Remove all event breakpoints */ +ui_strings.S_BUTTON_REMOVE_ALL_BREAKPOINTS = "Delete all event breakpoints"; + +/* DESC: Reset all keyboard shortcuts to the default values. */ +ui_strings.S_BUTTON_RESET_ALL_TO_DEFAULTS = "Reset all to defaults"; + +/* DESC: Button label to reset the fon selection to the default values */ +ui_strings.S_BUTTON_RESET_TO_DEFAULTS = "Reset default values"; + +/* DESC: Generic label for a save button */ +ui_strings.S_BUTTON_SAVE = "Save"; + +/* DESC: Search for an event in the event breakpoints view */ +ui_strings.S_BUTTON_SEARCH_EVENT = "Search for an event"; + +/* DESC: Search for a keyboard shortcut in the keyboard configuration view */ +ui_strings.S_BUTTON_SEARCH_SHORTCUT = "Search keyboard shortcuts"; + +/* DESC: Set the default value. */ +ui_strings.S_BUTTON_SET_DEFAULT_VALUE = "Reset default value"; + +/* DESC: Show request headers. */ +ui_strings.S_BUTTON_SHOW_REQUEST_HEADERS = "Headers"; + +/* DESC: Show raw request. */ +ui_strings.S_BUTTON_SHOW_REQUEST_RAW = "Raw"; + +/* DESC: Show request summary. */ +ui_strings.S_BUTTON_SHOW_REQUEST_SUMMARY = "Summary"; + +/* DESC: Button label in settings to reset the element highlight to the default values */ +ui_strings.S_BUTTON_SPOTLIGHT_RESET_DEFAULT_COLORS = "Reset default colors"; + +/* DESC: Button title for starting the profiler */ +ui_strings.S_BUTTON_START_PROFILER = "Start profiling"; + +/* DESC: Button title for stopping the profiler */ +ui_strings.S_BUTTON_STOP_PROFILER = "Stop profiling"; + +/* DESC: Button label to delete all items in a storage, e.g. the local storage */ +ui_strings.S_BUTTON_STORAGE_DELETE_ALL = "Delete All"; + +/* DESC: Button label to store the color */ +ui_strings.S_BUTTON_STORE_COLOR = "Store color"; + +/* DESC: Button to switch to network-profiler mode. */ +ui_strings.S_BUTTON_SWITCH_TO_NETWORK_PROFILER = "Improve accuracy of timing information"; + +/* DESC: Button label to take a screenshot */ +ui_strings.S_BUTTON_TAKE_SCREENSHOT = "Take screenshot"; + +/* DESC: Label for button in Remote Debugging that applies the changes. */ +ui_strings.S_BUTTON_TEXT_APPLY = "Apply"; + +/* DESC: Global console toggle */ +ui_strings.S_BUTTON_TOGGLE_CONSOLE = "Toggle console"; + +/* DESC: Global remote debug toggle */ +ui_strings.S_BUTTON_TOGGLE_REMOTE_DEBUG = "Remote debug configuration"; + +/* DESC: Global settings toggle */ +ui_strings.S_BUTTON_TOGGLE_SETTINGS = "Settings"; + +/* DESC: Button label to update the screenshot */ +ui_strings.S_BUTTON_UPDATE_SCREESHOT = "Update screenshot"; + +/* DESC: Unit string for bytes */ +ui_strings.S_BYTES_UNIT = "bytes"; + +/* DESC: Clears the command line log */ +ui_strings.S_CLEAR_COMMAND_LINE_LOG = "Clear console"; + +/* DESC: Label on button to clear network graph */ +ui_strings.S_CLEAR_NETWORK_LOG = "Clear network log"; + +/* DESC: Close command line window */ +ui_strings.S_CLOSE_COMMAND_LINE = "Close console"; + +/* DESC: Setting for changing the color notation (Hex, RGB, HSL) */ +ui_strings.S_COLOR_NOTATION = "Color format"; + +/* DESC: Average color setting, " x pixels" will be added */ +ui_strings.S_COLOR_PICKER_AVERAGE_COLOR_OF = "Average color of"; + +/* DESC: Table heading for column showing error descriptions */ +ui_strings.S_COLUMN_LABEL_ERROR = "Error"; + +/* DESC: Table heading for "file" column */ +ui_strings.S_COLUMN_LABEL_FILE = "File"; + +/* DESC: Table heading for column showing line number */ +ui_strings.S_COLUMN_LABEL_LINE = "Line"; + +/* DESC: Message about having to load a different version of dragonfly in order to work with the browser bing debugged */ +ui_strings.S_CONFIRM_LOAD_COMPATIBLE_VERSION = "The protocol version of Opera does not match the one which Opera Dragonfly is using.\n\nTry to load a compatible version?"; + +/* DESC: Dialog to confirm switching to network-profiler mode. */ +ui_strings.S_CONFIRM_SWITCH_TO_NETWORK_PROFILER = "To improve the accuracy of timing information, other features are turned off. You may lose changes you made."; + +/* DESC: Label for the list of function when doing console.trace(). */ +ui_strings.S_CONSOLE_TRACE_LABEL = "Stack trace:"; + +/* DESC: In 1 hour */ +ui_strings.S_COOKIE_MANAGER_IN_1_HOUR = "In 1 hour"; + +/* DESC: In 1 minute */ +ui_strings.S_COOKIE_MANAGER_IN_1_MINUTE = "In 1 minute"; + +/* DESC: In 1 month */ +ui_strings.S_COOKIE_MANAGER_IN_1_MONTH = "In 1 month"; + +/* DESC: In 1 week */ +ui_strings.S_COOKIE_MANAGER_IN_1_WEEK = "In 1 week"; + +/* DESC: In 1 year */ +ui_strings.S_COOKIE_MANAGER_IN_1_YEAR = "In 1 year"; + +/* DESC: In x days */ +ui_strings.S_COOKIE_MANAGER_IN_X_DAYS = "In %s days"; + +/* DESC: In x hours */ +ui_strings.S_COOKIE_MANAGER_IN_X_HOURS = "In %s hours"; + +/* DESC: In x minutes */ +ui_strings.S_COOKIE_MANAGER_IN_X_MINUTES = "In %s minutes"; + +/* DESC: In x months */ +ui_strings.S_COOKIE_MANAGER_IN_X_MONTHS = "In %s months"; + +/* DESC: In x weeks */ +ui_strings.S_COOKIE_MANAGER_IN_X_WEEKS = "In %s weeks"; + +/* DESC: In x years */ +ui_strings.S_COOKIE_MANAGER_IN_X_YEARS = "In %s years"; + +/* DESC: In less then 1 minute */ +ui_strings.S_COOKIE_MANAGER_SOONER_THEN_1_MINUTE = "< 1 minute"; + +/* DESC: Tomorrow */ +ui_strings.S_COOKIE_MANAGER_TOMORROW = "Tomorrow"; + +/* DESC: Tooltip for disabling a declaration */ +ui_strings.S_DISABLE_DECLARATION = "Disable"; + +/* DESC: Prefix before debug output */ +ui_strings.S_DRAGONFLY_INFO_MESSAGE = "Opera Dragonfly info message:\n"; + +/* DESC: Tooltip for enabling a declaration */ +ui_strings.S_ENABLE_DECLARATION = "Enable"; + +/* DESC: Info text that explains that only a certain number %(MAX)s of Errors is shown, out of a total of %(COUNT)s */ +ui_strings.S_ERRORS_MAXIMUM_REACHED = "Displaying %(MAX)s of %(COUNT)s errors"; + +/* DESC: List of filters that will be hidden in the Error log */ +ui_strings.S_ERROR_LOG_CSS_FILTER = "Use CSS filter"; + +/* DESC: Link in an event listener tooltip to the source position where the listener is added. */ +ui_strings.S_EVENT_LISTENER_ADDED_IN = "added in %s"; + +/* DESC: Info in an event listener tooltip that the according listener was added in the markup as element attribute. */ +ui_strings.S_EVENT_LISTENER_SET_AS_MARKUP_ATTR = "set as markup attribute"; + +/* DESC: Info in a tooltip that the according listener was set by the event target interface. */ +ui_strings.S_EVENT_TARGET_LISTENER = "event target listener"; + +/* DESC: Event type for events in the profiler */ +ui_strings.S_EVENT_TYPE_CSS_PARSING = "CSS parsing"; + +/* DESC: Event type for events in the profiler */ +ui_strings.S_EVENT_TYPE_CSS_SELECTOR_MATCHING = "CSS selector matching"; + +/* DESC: Event type for events in the profiler */ +ui_strings.S_EVENT_TYPE_DOCUMENT_PARSING = "Document parsing"; + +/* DESC: Event type for events in the profiler */ +ui_strings.S_EVENT_TYPE_GENERIC = "Generic"; + +/* DESC: Event type for events in the profiler */ +ui_strings.S_EVENT_TYPE_LAYOUT = "Layout"; + +/* DESC: Event type for events in the profiler */ +ui_strings.S_EVENT_TYPE_PAINT = "Paint"; + +/* DESC: Event type for events in the profiler */ +ui_strings.S_EVENT_TYPE_PROCESS = "Process"; + +/* DESC: Event type for events in the profiler */ +ui_strings.S_EVENT_TYPE_REFLOW = "Reflow"; + +/* DESC: Event type for events in the profiler */ +ui_strings.S_EVENT_TYPE_SCRIPT_COMPILATION = "Script compilation"; + +/* DESC: Event type for events in the profiler */ +ui_strings.S_EVENT_TYPE_STYLE_RECALCULATION = "Style recalculation"; + +/* DESC: Event type for events in the profiler */ +ui_strings.S_EVENT_TYPE_THREAD_EVALUATION = "Thread evaluation"; + +/* DESC: Context menu item for expanding CSS shorthands */ +ui_strings.S_EXPAND_SHORTHANDS = "Expand shorthands"; + +/* DESC: Label for the global keyboard shortcuts section */ +ui_strings.S_GLOBAL_KEYBOARD_SHORTCUTS_SECTION_TITLE = "Global"; + +/* DESC: Global scope label. */ +ui_strings.S_GLOBAL_SCOPE_NAME = ""; + +/* DESC: Show help in command line */ +ui_strings.S_HELP_COMMAND_LINE = "Help"; + +/* DESC: Label for http event sequence when urlfinished follows after some other event, meaning it was aborted */ +ui_strings.S_HTTP_EVENT_SEQUENCE_INFO_ABORTING_REQUEST = "Request aborted"; + +/* DESC: Label for http event sequence when redirecting */ +ui_strings.S_HTTP_EVENT_SEQUENCE_INFO_ABORT_RETRYING = "Sequence terminated, retry"; + +/* DESC: Label for http event sequence when closing response phase */ +ui_strings.S_HTTP_EVENT_SEQUENCE_INFO_CLOSING_RESPONSE_PHASE = "Closing response phase"; + +/* DESC: Label for http event sequence when processing */ +ui_strings.S_HTTP_EVENT_SEQUENCE_INFO_PROCESSING = "Processing"; + +/* DESC: Label for http event sequence when processing response */ +ui_strings.S_HTTP_EVENT_SEQUENCE_INFO_PROCESSING_RESPONSE = "Processing response"; + +/* DESC: Label for http event sequence when reading local data (data-uri, caches, file:// etc) */ +ui_strings.S_HTTP_EVENT_SEQUENCE_INFO_READING_LOCAL_DATA = "Reading local data"; + +/* DESC: Label for http event sequence when redirecting */ +ui_strings.S_HTTP_EVENT_SEQUENCE_INFO_REDIRECTING = "Redirecting"; + +/* DESC: Label for http event sequence when the event was scheduled */ +ui_strings.S_HTTP_EVENT_SEQUENCE_INFO_SCHEDULING = "Scheduling request"; + +/* DESC: Label for http event sequence when reading response body */ +ui_strings.S_HTTP_EVENT_SEQUENCE_READING_RESPONSE_BODY = "Reading response body"; + +/* DESC: Label for http event sequence when reading response header */ +ui_strings.S_HTTP_EVENT_SEQUENCE_READING_RESPONSE_HEADER = "Reading response header"; + +/* DESC: Label for http event sequence when waiting for response from network */ +ui_strings.S_HTTP_EVENT_SEQUENCE_WAITING_FOR_RESPONSE = "Waiting for response"; + +/* DESC: Label for http event sequence when writing request body */ +ui_strings.S_HTTP_EVENT_SEQUENCE_WRITING_REQUEST_BODY = "Writing request body"; + +/* DESC: Label for http event sequence when writing request header */ +ui_strings.S_HTTP_EVENT_SEQUENCE_WRITING_REQUEST_HEADER = "Writing request header"; + +/* DESC: First line of dialog that explains that the loading flow of the context is not shown completely */ +ui_strings.S_HTTP_INCOMPLETE_LOADING_GRAPH = "Reload to show all page requests"; + +/* DESC: tooltip for the network data view button */ +ui_strings.S_HTTP_LABEL_DATA_VIEW = "Data view"; + +/* DESC: label for table header that shows duration (short) */ +ui_strings.S_HTTP_LABEL_DURATION = "Duration"; + +/* DESC: label for the network filter that shows all items */ +ui_strings.S_HTTP_LABEL_FILTER_ALL = "All"; + +/* DESC: label for the network filter that shows image items */ +ui_strings.S_HTTP_LABEL_FILTER_IMAGES = "Images"; + +/* DESC: label for the network filter that shows markup items */ +ui_strings.S_HTTP_LABEL_FILTER_MARKUP = "Markup"; + +/* DESC: label for the network filter that shows items that are not markup, stylesheet, script or image */ +ui_strings.S_HTTP_LABEL_FILTER_OTHER = "Other"; + +/* DESC: label for the network filter that shows script items */ +ui_strings.S_HTTP_LABEL_FILTER_SCRIPTS = "Scripts"; + +/* DESC: label for the network filter that shows stylesheet items */ +ui_strings.S_HTTP_LABEL_FILTER_STYLESHEETS = "Stylesheets"; + +/* DESC: label for the network filter that shows items requested over XMLHttpRequest */ +ui_strings.S_HTTP_LABEL_FILTER_XHR = "XHR"; + +/* DESC: label for table header that shows loading sequence as a graph (short) */ +ui_strings.S_HTTP_LABEL_GRAPH = "Graph"; + +/* DESC: tooltip for the network graph view button */ +ui_strings.S_HTTP_LABEL_GRAPH_VIEW = "Graph view"; + +/* DESC: label for host in http request details */ +ui_strings.S_HTTP_LABEL_HOST = "Host"; + +/* DESC: label for method in http request details */ +ui_strings.S_HTTP_LABEL_METHOD = "Method"; + +/* DESC: label for path in http request details */ +ui_strings.S_HTTP_LABEL_PATH = "Path"; + +/* DESC: label for query arguments in http request details */ +ui_strings.S_HTTP_LABEL_QUERY_ARGS = "Query arguments"; + +/* DESC: label for response in http request details */ +ui_strings.S_HTTP_LABEL_RESPONSE = "Response"; + +/* DESC: label for table header that shows http response code (short) */ +ui_strings.S_HTTP_LABEL_RESPONSECODE = "Status"; + +/* DESC: label for table header that shows starting time (short) */ +ui_strings.S_HTTP_LABEL_STARTED = "Started"; + +/* DESC: label for url in http request details */ +ui_strings.S_HTTP_LABEL_URL = "URL"; + +/* DESC: label for table header that shows waiting time (short) */ +ui_strings.S_HTTP_LABEL_WAITING = "Waiting"; + +/* DESC: tooltip for resources that have not been requested over network (mostly that means cached) */ +ui_strings.S_HTTP_NOT_REQUESTED = "Cached"; + +/* DESC: Headline for network-sequence tooltip that shows the absolute time when the resource was requested internally */ +ui_strings.S_HTTP_REQUESTED_HEADLINE = "Requested at %s"; + +/* DESC: tooltip for resources served over file:// to make it explicit that this didn't touch the network */ +ui_strings.S_HTTP_SERVED_OVER_FILE = "Local"; + +/* DESC: tooltip for table header that shows duration */ +ui_strings.S_HTTP_TOOLTIP_DURATION = "Time spent between starting and finishing this request"; + +/* DESC: tooltip for the network filter that shows all items */ +ui_strings.S_HTTP_TOOLTIP_FILTER_ALL = "Show all requests"; + +/* DESC: tooltip for the network filter that shows image items */ +ui_strings.S_HTTP_TOOLTIP_FILTER_IMAGES = "Show only images"; + +/* DESC: tooltip for the network filter that shows markup items */ +ui_strings.S_HTTP_TOOLTIP_FILTER_MARKUP = "Show only markup"; + +/* DESC: tooltip for the network filter that shows items that are not markup, stylesheet, script or image */ +ui_strings.S_HTTP_TOOLTIP_FILTER_OTHER = "Show requests of other types"; + +/* DESC: tooltip for the network filter that shows script items */ +ui_strings.S_HTTP_TOOLTIP_FILTER_SCRIPTS = "Show only scripts"; + +/* DESC: tooltip for the network filter that shows stylesheet items */ +ui_strings.S_HTTP_TOOLTIP_FILTER_STYLESHEETS = "Show only stylesheets"; + +/* DESC: tooltip for the network filter that shows items requested over XMLHttpRequest */ +ui_strings.S_HTTP_TOOLTIP_FILTER_XHR = "Show only XMLHttpRequests"; + +/* DESC: tooltip for table header that shows loading sequence as a graph */ +ui_strings.S_HTTP_TOOLTIP_GRAPH = "Graph of the loading sequence"; + +/* DESC: tooltip on mime type table header */ +ui_strings.S_HTTP_TOOLTIP_MIME = "MIME type"; + +/* DESC: tooltip on protocol table header */ +ui_strings.S_HTTP_TOOLTIP_PROTOCOL = "Protocol"; + +/* DESC: tooltip on table header that shows http response code */ +ui_strings.S_HTTP_TOOLTIP_RESPONSECODE = "HTTP status code"; + +/* DESC: tooltip on size table header */ +ui_strings.S_HTTP_TOOLTIP_SIZE = "Content-length of the response in bytes"; + +/* DESC: tooltip on prettyprinted size table header */ +ui_strings.S_HTTP_TOOLTIP_SIZE_PRETTYPRINTED = "Content-length of the response"; + +/* DESC: tooltip for table header that shows relative starting time */ +ui_strings.S_HTTP_TOOLTIP_STARTED = "Starting time, relative to the main document"; + +/* DESC: tooltip for table header that shows waiting time */ +ui_strings.S_HTTP_TOOLTIP_WAITING = "Time spent requesting this resource"; + +/* DESC: tooltip-prefix for resources that have been marked unloaded, which means they are no longer reference in the document */ +ui_strings.S_HTTP_UNREFERENCED = "Unreferenced"; + +/* DESC: Information shown if the document does not hold any style sheet. */ +ui_strings.S_INFO_DOCUMENT_HAS_NO_STYLESHEETS = "This document has no style sheets"; + +/* DESC: Feedback showing that Opera Dragonfly is loading and the user shall have patience. */ +ui_strings.S_INFO_DOCUMNENT_LOADING = "Updating Opera Dragonfly‚Ķ"; + +/* DESC: There was an error trying to listen to the specified port */ +ui_strings.S_INFO_ERROR_LISTENING = "There was an error. Please check that port %s is not in use."; + +/* DESC: A info message that the debugger is currently in HTTP profiler mode. */ +ui_strings.S_INFO_HTTP_PROFILER_MODE = "The debugger is in HTTP profiler mode. All other features are disabled." + +/* DESC: Information shown if the user tries to perform a reg exp search with an invalid regular expression. */ +ui_strings.S_INFO_INVALID_REGEXP = "Invalid regular expression."; + +/* DESC: Info text in the settings to invert the highlight color for elements. */ +ui_strings.S_INFO_INVERT_ELEMENT_HIGHLIGHT = "The element highlight color can be inverted with the \"%s\" shortcut."; + +/* DESC: The info text to notify the user that the application is performing the search. */ +ui_strings.S_INFO_IS_SEARCHING = "Searching‚Ķ"; + +/* DESC: Info in an event listener tooltip that the according source file is missing. */ +ui_strings.S_INFO_MISSING_JS_SOURCE_FILE = ""; + +/* DESC: Info text in the network view when a page starts to load while screen updats are paused */ +ui_strings.S_INFO_NETWORK_UPDATES_PAUSED = "Updating of network log is paused."; + +/* DESC: Message about there being no version of dragonfly compatible with the browser being debugged */ +ui_strings.S_INFO_NO_COMPATIBLE_VERSION = "There is no compatible Opera Dragonfly version."; + +/* DESC: Shown when entering something on the command line while there is no javascript running in the window being debugged */ +ui_strings.S_INFO_NO_JAVASCRIPT_IN_CONTEXT = "There is no JavaScript environment in the active window"; + +/* DESC: The info text in an alert box if the user has specified an invalid port number for remote debugging. */ +ui_strings.S_INFO_NO_VALID_PORT_NUMBER = "Please select a port number between %s and %s."; + +/* DESC: A info message that the debugger is currently in profiler mode. */ +ui_strings.S_INFO_PROFILER_MODE = "The debugger is in profiler mode. All other features are disabled."; + +/* DESC: Information shown if the user tries to perform a reg exp search which matches the empty string. */ +ui_strings.S_INFO_REGEXP_MATCHES_EMPTY_STRING = "RegExp matches empty string. No search was performed."; + +/* DESC: Currently no scripts are loaded and a reload of the page will resolve all linked scripts. */ +ui_strings.S_INFO_RELOAD_FOR_SCRIPT = "Click the reload button above to fetch the scripts for the selected debugging context"; + +/* DESC: Info text in when a request in the request crafter failed. */ +ui_strings.S_INFO_REQUEST_FAILED = "The request failed."; + +/* DESC: Information shown if the document does not hold any scripts. Appears in Scripts view. */ +ui_strings.S_INFO_RUNTIME_HAS_NO_SCRIPTS = "This document has no scripts"; + +/* DESC: the given storage type doesn't exist, e.g. a widget without the w3c widget namespace */ +ui_strings.S_INFO_STORAGE_TYPE_DOES_NOT_EXIST = "%s does not exist."; + +/* DESC: Information shown if the stylesheet does not hold any style rules. */ +ui_strings.S_INFO_STYLESHEET_HAS_NO_RULES = "This style sheet has no rules"; + +/* DESC: The info text to notify the user that only a part of the search results are displayed. */ +ui_strings.S_INFO_TOO_MANY_SEARCH_RESULTS = "Displaying %(MAX)s of %(COUNT)s"; + +/* DESC: Dragonfly is waiting for host connection */ +ui_strings.S_INFO_WAITING_FORHOST_CONNECTION = "Waiting for a host connection on port %s."; + +/* DESC: Information shown if the window has no runtime, e.g. speed dial. */ +ui_strings.S_INFO_WINDOW_HAS_NO_RUNTIME = "This window has no runtime"; + +/* DESC: Inhertied from, " " will be added */ +ui_strings.S_INHERITED_FROM = "Inherited from"; + +/* DESC: For filter fields. */ +ui_strings.S_INPUT_DEFAULT_TEXT_FILTER = "Filter"; + +/* DESC: Label for search fields. */ +ui_strings.S_INPUT_DEFAULT_TEXT_SEARCH = "Search"; + +/* DESC: Heading for the area where the user can configure keyboard shortcuts in settings. */ +ui_strings.S_KEYBOARD_SHORTCUTS_CONFIGURATION = "Configuration"; + +/* DESC: Context menu entry that brings up "Add watch" UI, Label for "Add watch" button */ +ui_strings.S_LABEL_ADD_WATCH = "Add watch"; + +/* DESC: Instruction in settings how to change the user language. The place holder will be replace with an according link to the user setting in opera:config. */ +ui_strings.S_LABEL_CHANGE_UI_LANGUAGE_INFO = "Change %s to one of"; + +/* DESC: A setting to define which prototypes of inspected js objects should be collapsed by default. */ +ui_strings.S_LABEL_COLLAPSED_INSPECTED_PROTOTYPES = "Default collapsed prototype objects (a list of prototypes, e.g. Object, Array, etc. * will collapse all): "; + +/* DESC: Label for the hue of a color value. */ +ui_strings.S_LABEL_COLOR_HUE = "Hue"; + +/* DESC: Label for the luminosity of a color value. */ +ui_strings.S_LABEL_COLOR_LUMINOSITY = "Luminosity"; + +/* DESC: Label for the opacity of a color value. */ +ui_strings.S_LABEL_COLOR_OPACITY = "Opacity"; + +/* DESC: Setting label to select the sample size of the color picker */ +ui_strings.S_LABEL_COLOR_PICKER_SAMPLE_SIZE = "Sample Size"; + +/* DESC: Setting label to select the zoom level of the color picker */ +ui_strings.S_LABEL_COLOR_PICKER_ZOOM = "Zoom"; + +/* DESC: Label for the saturation of a color value. */ +ui_strings.S_LABEL_COLOR_SATURATION = "Saturation"; + +/* DESC: Context menu entry that brings up "Add cookie" UI, Label for "Add Cookie" button */ +ui_strings.S_LABEL_COOKIE_MANAGER_ADD_COOKIE = "Add cookie"; + +/* DESC: Label for the domain that is set for a cookie */ +ui_strings.S_LABEL_COOKIE_MANAGER_COOKIE_DOMAIN = "Domain"; + +/* DESC: Label for the expiry when cookie has already expired */ +ui_strings.S_LABEL_COOKIE_MANAGER_COOKIE_EXPIRED = "(expired)"; + +/* DESC: Label for the expiry value of a cookie */ +ui_strings.S_LABEL_COOKIE_MANAGER_COOKIE_EXPIRES = "Expires"; + +/* DESC: Label for the expiry when cookie expires after the session is closed */ +ui_strings.S_LABEL_COOKIE_MANAGER_COOKIE_EXPIRES_ON_SESSION_CLOSE = "When session ends, e.g. the tab is closed"; + +/* DESC: Label for the expiry when cookie expires after the session is closed */ +ui_strings.S_LABEL_COOKIE_MANAGER_COOKIE_EXPIRES_ON_SESSION_CLOSE_SHORT = "Session"; + +/* DESC: Label for the name (key) of a cookie */ +ui_strings.S_LABEL_COOKIE_MANAGER_COOKIE_NAME = "Name"; + +/* DESC: Label for the value of a cookie */ +ui_strings.S_LABEL_COOKIE_MANAGER_COOKIE_PATH = "Path"; + +/* DESC: Label for the value of a cookie or storage item */ +ui_strings.S_LABEL_COOKIE_MANAGER_COOKIE_VALUE = "Value"; + +/* DESC: Context menu entry that brings up "Edit cookie" UI */ +ui_strings.S_LABEL_COOKIE_MANAGER_EDIT_COOKIE = "Edit cookie"; + +/* DESC: Label for grouping by runtime (lowercase) */ +ui_strings.S_LABEL_COOKIE_MANAGER_GROUPER_RUNTIME = "runtime"; + +/* DESC: Label for isHTTPOnly flag on a cookie */ +ui_strings.S_LABEL_COOKIE_MANAGER_HTTP_ONLY = "HTTPOnly"; + +/* DESC: Context menu entry that removes cookie */ +ui_strings.S_LABEL_COOKIE_MANAGER_REMOVE_COOKIE = "Delete cookie"; + +/* DESC: Context menu entry that removes cookies (plural) */ +ui_strings.S_LABEL_COOKIE_MANAGER_REMOVE_COOKIES = "Delete cookies"; + +/* DESC: Context menu entry that removes cookies of specific group */ +ui_strings.S_LABEL_COOKIE_MANAGER_REMOVE_COOKIES_OF = "Delete cookies from %s"; + +/* DESC: Label for isSecure flag on a cookie, set if cookie is only transmitted on secure connections */ +ui_strings.S_LABEL_COOKIE_MANAGER_SECURE_CONNECTIONS_ONLY = "Secure"; + +/* DESC: Setting label to switch back to the default setting */ +ui_strings.S_LABEL_DEFAULT_SELECTION = "Default"; + +/* DESC: Context menu entry that removes all watches */ +ui_strings.S_LABEL_DELETE_ALL_WATCHES = "Delete all watches"; + +/* DESC: Context menu entry that removes watch */ +ui_strings.S_LABEL_DELETE_WATCH = "Delete watch"; + +/* DESC: Label for a button in a dialog to dismiss in so it won't be shown again */ +ui_strings.S_LABEL_DIALOG_DONT_SHOW_AGAIN = "Do not show again"; + +/* DESC: Context menu entry that brings up "Edit" UI */ +ui_strings.S_LABEL_EDIT_WATCH = "Edit watch"; + +/* DESC: Button label to enable the default debugger features. */ +ui_strings.S_LABEL_ENABLE_DEFAULT_FEATURES = "Enable the default debugger features"; + +/* DESC: Setting label to select the font face */ +ui_strings.S_LABEL_FONT_SELECTION_FACE = "Font face"; + +/* DESC: Setting label to select the line height */ +ui_strings.S_LABEL_FONT_SELECTION_LINE_HEIGHT = "Line height"; + +/* DESC: Setting label to select the font face */ +ui_strings.S_LABEL_FONT_SELECTION_SIZE = "Font size"; + +/* DESC: Label of a section in the keyboard configuration for a specific view */ +ui_strings.S_LABEL_KEYBOARDCONFIG_FOR_VIEW = "Keyboard shortcuts %s"; + +/* DESC: Label of an invalid keyboard shortcut */ +ui_strings.S_LABEL_KEYBOARDCONFIG_INVALID_SHORTCUT = "Invalid keyboard shortcut"; + +/* DESC: Label of a subsection in the keyboard configuration */ +ui_strings.S_LABEL_KEYBOARDCONFIG_MODE_DEFAULT = "Default"; + +/* DESC: Label of a subsection in the keyboard configuration */ +ui_strings.S_LABEL_KEYBOARDCONFIG_MODE_EDIT = "Edit"; + +/* DESC: Label of a subsection in the keyboard configuration */ +ui_strings.S_LABEL_KEYBOARDCONFIG_MODE_EDIT_ATTR_AND_TEXT = "Edit Attributes and Text"; + +/* DESC: Label of a subsection in the keyboard configuration */ +ui_strings.S_LABEL_KEYBOARDCONFIG_MODE_EDIT_MARKUP = "Edit markup"; + +/* DESC: Settings label for the maximum number of search hits in the search panel. */ +ui_strings.S_LABEL_MAX_SEARCH_HITS = "Maximum number of search results"; + +/* DESC: Button tooltip */ +ui_strings.S_LABEL_MOVE_HIGHLIGHT_DOWN = "Find next"; + +/* DESC: Button tooltip */ +ui_strings.S_LABEL_MOVE_HIGHLIGHT_UP = "Find previous"; + +/* DESC: Label for the name column header of a form field in a POST */ +ui_strings.S_LABEL_NETWORK_POST_DATA_NAME = "Name"; + +/* DESC: Label for the value column header of a form value in a POST */ +ui_strings.S_LABEL_NETWORK_POST_DATA_VALUE = "Value"; + +/* DESC: Label for the network port to connect to. */ +ui_strings.S_LABEL_PORT = "Port"; + +/* DESC: In the command line, choose the size of the typed history */ +ui_strings.S_LABEL_REPL_BACKLOG_LENGTH = "Number of lines of stored history"; + +/* DESC: Label of a subsection in the keyboard configuration */ +ui_strings.S_LABEL_REPL_MODE_AUTOCOMPLETE = "Autocomplete"; + +/* DESC: Label of a subsection in the keyboard configuration */ +ui_strings.S_LABEL_REPL_MODE_DEFAULT = "Default"; + +/* DESC: Label of a subsection in the keyboard configuration */ +ui_strings.S_LABEL_REPL_MODE_MULTILINE = "Multi-line edit"; + +/* DESC: Label of a subsection in the keyboard configuration */ +ui_strings.S_LABEL_REPL_MODE_SINGLELINE = "Single-line edit"; + +/* DESC: Label of the section with the scope chain in the Inspection view */ +ui_strings.S_LABEL_SCOPE_CHAIN = "Scope Chain"; + +/* DESC: Checkbox label to search in all files in the JS search pane. */ +ui_strings.S_LABEL_SEARCH_ALL_FILES = "All files"; + +/* DESC: Checkbox label to set the 'ignore case' flag search panel. */ +ui_strings.S_LABEL_SEARCH_FLAG_IGNORE_CASE = "Ignore case"; + +/* DESC: Checkbox label to search in injected scripts in the JS search pane. */ +ui_strings.S_LABEL_SEARCH_INJECTED_SCRIPTS = "Injected"; + +/* DESC: Tooltip for the injected scripts search settings label. */ +ui_strings.S_LABEL_SEARCH_INJECTED_SCRIPTS_TOOLTIP = "Search in all injected scripts, including Browser JS, Extension JS and User JS"; + +/* DESC: Radio label for the search type 'Selector' (as in CSS Selector) in the DOM search panel. */ +ui_strings.S_LABEL_SEARCH_TYPE_CSS = "Selector"; + +/* DESC: RRadio label for the search type 'RegExp' in the DOM search panel. */ +ui_strings.S_LABEL_SEARCH_TYPE_REGEXP = "RegExp"; + +/* DESC: Radio label for the search type 'Text' in the DOM search panel. */ +ui_strings.S_LABEL_SEARCH_TYPE_TEXT = "Text"; + +/* DESC: Radio label for the search type 'XPath' in the DOM search panel. */ +ui_strings.S_LABEL_SEARCH_TYPE_XPATH = "XPath"; + +/* DESC: Settings label to show a tooltip for the hovered identifier in the source view. */ +ui_strings.S_LABEL_SHOW_JS_TOOLTIP = "Show inspection tooltip"; + +/* DESC: Enable smart reformatting of JavaScript. */ +ui_strings.S_LABEL_SMART_REFORMAT_JAVASCRIPT = "Smart JavaScript pretty printing"; + +/* DESC: Settings label to configure the element highlight color */ +ui_strings.S_LABEL_SPOTLIGHT_TITLE = "Element Highlight"; + +/* DESC: Button label to add an item in a storage, e.g. in the local storage */ +ui_strings.S_LABEL_STORAGE_ADD = "Add"; + +/* DESC: Label for "Add storage_type" button */ +ui_strings.S_LABEL_STORAGE_ADD_STORAGE_TYPE = "Add %s"; + +/* DESC: Button label to delete an item in a storage, e.g. in the local storage */ +ui_strings.S_LABEL_STORAGE_DELETE = "Delete"; + +/* DESC: Tool tip in a storage view to inform the user how to edit an item */ +ui_strings.S_LABEL_STORAGE_DOUBLE_CLICK_TO_EDIT = "Double-click to edit"; + +/* DESC: Label for the key (identifier) of a storage item */ +ui_strings.S_LABEL_STORAGE_KEY = "Key"; + +/* DESC: Button label to update a view with all items of a storage, e.g. of the local storage */ +ui_strings.S_LABEL_STORAGE_UPDATE = "Update"; + +/* DESC: Tab size in source view. */ +ui_strings.S_LABEL_TAB_SIZE = "Tab Size"; + +/* DESC: Area as in size. choices are 10 x 10, and so on. */ +ui_strings.S_LABEL_UTIL_AREA = "Area"; + +/* DESC: Scale */ +ui_strings.S_LABEL_UTIL_SCALE = "Scale"; + +/* DESC: Info in an event listener tooltip that the according listener listens in the bubbling phase. */ +ui_strings.S_LISTENER_BUBBLING_PHASE = "bubbling"; + +/* DESC: Info in an event listener tooltip that the according listener listens in the capturing phase. */ +ui_strings.S_LISTENER_CAPTURING_PHASE = "capturing"; + +/* DESC: Debug context menu */ +ui_strings.S_MENU_DEBUG_CONTEXT = "Select the debugging context"; + +/* DESC: Reload the debug context. */ +ui_strings.S_MENU_RELOAD_DEBUG_CONTEXT = "Reload Debugging Context"; + +/* DESC: Reload the debug context (shorter than S_MENU_RELOAD_DEBUG_CONTEXT). */ +ui_strings.S_MENU_RELOAD_DEBUG_CONTEXT_SHORT = "Reload"; + +/* DESC: Select the active window as debugger context. */ +ui_strings.S_MENU_SELECT_ACTIVE_WINDOW = "Select Active Window"; + +/* DESC: String used when the user has clicked to get a resource body, but dragonfly wasn't able to do so. */ +ui_strings.S_NETWORK_BODY_NOT_AVAILABLE = "Request body not available. Enable resource tracking and reload the page to view the resource."; + +/* DESC: Name of network caching setting for default browser caching policy */ +ui_strings.S_NETWORK_CACHING_SETTING_DEFAULT_LABEL = "Standard browser caching behavior"; + +/* DESC: Help text for explaining caching setting in global network options */ +ui_strings.S_NETWORK_CACHING_SETTING_DESC = "This setting controls how caching works when Opera Dragonfly is running. When caching is disabled, Opera always reloads the page."; + +/* DESC: Name of network caching setting for disabling browser caching policy */ +ui_strings.S_NETWORK_CACHING_SETTING_DISABLED_LABEL = "Disable all caching"; + +/* DESC: Title for caching settings section in global network options */ +ui_strings.S_NETWORK_CACHING_SETTING_TITLE = "Caching behavior"; + +/* DESC: Can't show request data, as we don't know the type of it. */ +ui_strings.S_NETWORK_CANT_DISPLAY_TYPE = "Cannot display content of type %s"; + +/* DESC: Name of content tracking setting for tracking content */ +ui_strings.S_NETWORK_CONTENT_TRACKING_SETTING_TRACK_LABEL = "Track content (affects speed/memory)"; + +/* DESC: Explanation of how to enable content tracking. */ +ui_strings.S_NETWORK_ENABLE_CONTENT_TRACKING_FOR_REQUEST = "Enable content tracking in the \"network options\" panel to see request bodies"; + +/* DESC: Example value to show what header formats look like. Header-name */ +ui_strings.S_NETWORK_HEADER_EXAMPLE_VAL_NAME = "Header-name"; + +/* DESC: Example value to show what header formats look like. Header-value */ +ui_strings.S_NETWORK_HEADER_EXAMPLE_VAL_VALUE = "Header-value"; + +/* DESC: Description of network header overrides feature. */ +ui_strings.S_NETWORK_HEADER_OVERRIDES_DESC = "Headers in the override box will be used for all requests in the debugged browser. They will override normal headers."; + +/* DESC: Label for checkbox to enable global header overrides */ +ui_strings.S_NETWORK_HEADER_OVERRIDES_LABEL = "Enable global header overrides"; + +/* DESC: Label for presets */ +ui_strings.S_NETWORK_HEADER_OVERRIDES_PRESETS_LABEL = "Presets"; + +/* DESC: Label for save nbutton */ +ui_strings.S_NETWORK_HEADER_OVERRIDES_PRESETS_SAVE = "Save"; + +/* DESC: Label for selecting an empty preset */ +ui_strings.S_NETWORK_HEADER_OVERRIDES_PRESET_NONE = "None"; + +/* DESC: Title of global header overrides section in global network settings */ +ui_strings.S_NETWORK_HEADER_OVERRIDES_TITLE = "Global header overrides"; + +/* DESC: Title of request body section when the body is multipart-encoded */ +ui_strings.S_NETWORK_MULTIPART_REQUEST_TITLE = "Request - multipart"; + +/* DESC: String used when there is a request body we can't show the contents of directly. */ +ui_strings.S_NETWORK_N_BYTE_BODY = "Request body of %s bytes"; + +/* DESC: Name of entry in Network Log, used in summary at the end */ +ui_strings.S_NETWORK_REQUEST = "Request"; + +/* DESC: Name of entry in Network Log, plural, used in summary at the end */ +ui_strings.S_NETWORK_REQUESTS = "Requests"; + +/* DESC: Help text about how to always track resources in request view */ +ui_strings.S_NETWORK_REQUEST_DETAIL_BODY_DESC = "Response body not tracked. To always fetch response bodies, toggle the \"Track content\" option in Settings. To retrieve only this body, click the button."; + +/* DESC: Message about not yet available response body */ +ui_strings.S_NETWORK_REQUEST_DETAIL_BODY_UNFINISHED = "Response body not available until the request is finished."; + +/* DESC: Help text about how a request body could not be show because it's no longer available. */ +ui_strings.S_NETWORK_REQUEST_DETAIL_NO_RESPONSE_BODY = "Response body not available. Enable the \"Track content\" option in Settings and reload the page to view the resource."; + +/* DESC: Title for request details section */ +ui_strings.S_NETWORK_REQUEST_DETAIL_REQUEST_TITLE = "Request"; + +/* DESC: Title for response details section */ +ui_strings.S_NETWORK_REQUEST_DETAIL_RESPONSE_TITLE = "Response"; + +/* DESC: Message about file types we have no good way of showing. */ +ui_strings.S_NETWORK_REQUEST_DETAIL_UNDISPLAYABLE_BODY_LABEL = "Unable to show data of type %s"; + +/* DESC: Message about there being no headers attached to a specific request or response */ +ui_strings.S_NETWORK_REQUEST_NO_HEADERS_LABEL = "No headers"; + +/* DESC: Explanation about why a network requests lacks headers. */ +ui_strings.S_NETWORK_SERVED_FROM_CACHE = "No request made. All data was retrieved from cache without accessing the network."; + +/* DESC: Unknown mime type for content */ +ui_strings.S_NETWORK_UNKNOWN_MIME_TYPE = "MIME type not known for request data"; + +/* DESC: The string "None" used wherever there's an absence of something */ +ui_strings.S_NONE = "None"; + +/* DESC: Info in the DOM side panel that the selected node has no event listeners attached. */ +ui_strings.S_NO_EVENT_LISTENER = "No event listeners"; + +/* DESC: Label in a tooltip */ +ui_strings.S_PROFILER_AREA_DIMENSION = "Area"; + +/* DESC: Label in a tooltip */ +ui_strings.S_PROFILER_AREA_LOCATION = "Location"; + +/* DESC: Message in the profiler when the profiler is calculating */ +ui_strings.S_PROFILER_CALCULATING = "Calculating…"; + +/* DESC: Label in a tooltip */ +ui_strings.S_PROFILER_DURATION = "Duration"; + +/* DESC: Message in the profiler when no data was "captured" by the profiler */ +ui_strings.S_PROFILER_NO_DATA = "No data"; + +/* DESC: Message when an event in the profiler has no details */ +ui_strings.S_PROFILER_NO_DETAILS = "No details"; + +/* DESC: Message in the profiler when the profiler is active */ +ui_strings.S_PROFILER_PROFILING = "Profiling…"; + +/* DESC: Message in the profiler when the profiler failed */ +ui_strings.S_PROFILER_PROFILING_FAILED = "Profiling failed"; + +/* DESC: Message before activating the profiler profile */ +ui_strings.S_PROFILER_RELOAD = "To get accurate data from the profiler, all other features have to be disabled and the document has to be reloaded."; + +/* DESC: Label in a tooltip */ +ui_strings.S_PROFILER_SELF_TIME = "Self time"; + +/* DESC: Message before starting the profiler */ +ui_strings.S_PROFILER_START_MESSAGE = "Press the Record button to start profiling"; + +/* DESC: Label in a tooltip */ +ui_strings.S_PROFILER_START_TIME = "Start"; + +/* DESC: Label in a tooltip */ +ui_strings.S_PROFILER_TOTAL_SELF_TIME = "Total self time"; + +/* DESC: Label in a tooltip */ +ui_strings.S_PROFILER_TYPE_EVENT = "Event name"; + +/* DESC: Label in a tooltip */ +ui_strings.S_PROFILER_TYPE_SCRIPT = "Script type"; + +/* DESC: Label in a tooltip */ +ui_strings.S_PROFILER_TYPE_SELECTOR = "Selector"; + +/* DESC: Label in a tooltip */ +ui_strings.S_PROFILER_TYPE_THREAD = "Thread type"; + +/* DESC: Remote debug guide, connection setup */ +ui_strings.S_REMOTE_DEBUG_GUIDE_PRECONNECT_HEADER = "Steps to enable remote debugging:"; + +/* DESC: Remote debug guide, connection setup */ +ui_strings.S_REMOTE_DEBUG_GUIDE_PRECONNECT_STEP_1 = "Specify the port number you wish to connect to, or leave as the default"; + +/* DESC: Remote debug guide, connection setup */ +ui_strings.S_REMOTE_DEBUG_GUIDE_PRECONNECT_STEP_2 = "Click \"Apply\""; + +/* DESC: Remote debug guide, waiting for connection */ +ui_strings.S_REMOTE_DEBUG_GUIDE_WAITING_HEADER = "On the remote device:"; + +/* DESC: Remote debug guide, waiting for connection */ +ui_strings.S_REMOTE_DEBUG_GUIDE_WAITING_STEP_1 = "Enter opera:debug in the URL field"; + +/* DESC: Remote debug guide, waiting for connection */ +ui_strings.S_REMOTE_DEBUG_GUIDE_WAITING_STEP_2 = "Enter the IP address of the machine running Opera Dragonfly"; + +/* DESC: Remote debug guide, waiting for connection */ +ui_strings.S_REMOTE_DEBUG_GUIDE_WAITING_STEP_3 = "Enter the port number %s"; + +/* DESC: Remote debug guide, waiting for connection */ +ui_strings.S_REMOTE_DEBUG_GUIDE_WAITING_STEP_4 = "Click \"Connect\""; + +/* DESC: Remote debug guide, waiting for connection */ +ui_strings.S_REMOTE_DEBUG_GUIDE_WAITING_STEP_5 = "Once connected navigate to the page you wish to debug"; + +/* DESC: Description of the "help" command in the repl */ +ui_strings.S_REPL_HELP_COMMAND_DESC = "Show a list of all available commands"; + +/* DESC: Description of the "jquery" command in the repl */ +ui_strings.S_REPL_JQUERY_COMMAND_DESC = "Load jQuery in the active tab"; + +/* DESC: Printed in the command line view when it is shown for the first time. */ +ui_strings.S_REPL_WELCOME_TEXT = "Type %(CLEAR_COMMAND)s to clear the console.\nType %(HELP_COMMAND)s for more information."; + +/* DESC: "Not applicable" abbreviation */ +ui_strings.S_RESOURCE_ALL_NOT_APPLICABLE = "n/a"; + +/* DESC: Name of host column */ +ui_strings.S_RESOURCE_ALL_TABLE_COLUMN_HOST = "Host"; + +/* DESC: Name of mime column */ +ui_strings.S_RESOURCE_ALL_TABLE_COLUMN_MIME = "MIME"; + +/* DESC: Name of path column */ +ui_strings.S_RESOURCE_ALL_TABLE_COLUMN_PATH = "Path"; + +/* DESC: Name of pretty printed size column */ +ui_strings.S_RESOURCE_ALL_TABLE_COLUMN_PPSIZE = "Size (pretty printed)"; + +/* DESC: Name of protocol column */ +ui_strings.S_RESOURCE_ALL_TABLE_COLUMN_PROTOCOL = "Protocol"; + +/* DESC: Name of size column */ +ui_strings.S_RESOURCE_ALL_TABLE_COLUMN_SIZE = "Size"; + +/* DESC: Name of type column */ +ui_strings.S_RESOURCE_ALL_TABLE_COLUMN_TYPE = "Type"; + +/* DESC: Name of types size group */ +ui_strings.S_RESOURCE_ALL_TABLE_GROUP_GROUPS = "Groups"; + +/* DESC: Name of hosts size group */ +ui_strings.S_RESOURCE_ALL_TABLE_GROUP_HOSTS = "Hosts"; + +/* DESC: Fallback text for no filename, used as tab label */ +ui_strings.S_RESOURCE_ALL_TABLE_NO_FILENAME = ""; + +/* DESC: Fallback text for no host */ +ui_strings.S_RESOURCE_ALL_TABLE_NO_HOST = "No host"; + +/* DESC: Fallback text for unknown groups */ +ui_strings.S_RESOURCE_ALL_TABLE_UNKNOWN_GROUP = "Unknown"; + +/* DESC: Click reload button to fetch resources */ +ui_strings.S_RESOURCE_CLICK_BUTTON_TO_FETCH_RESOURCES = "Click the reload button above to reload the debugged window and fetch its resources"; + +/* DESC: Label for the global scope in the Scope Chain. */ +ui_strings.S_SCOPE_GLOBAL = "Global"; + +/* DESC: Label for the scopes other than local and global in the Scope Chain. */ +ui_strings.S_SCOPE_INNER = "Scope %s"; + +/* DESC: Section header in the script drop-down select for Browser and User JS. */ +ui_strings.S_SCRIPT_SELECT_SECTION_BROWSER_AND_USER_JS = "Browser JS and User JS"; + +/* DESC: Section header in the script drop-down select for inline, eval, timeout and event handler scripts. */ +ui_strings.S_SCRIPT_SELECT_SECTION_INLINE_AND_EVALS = "Inline, eval, timeout and event-handler scripts"; + +/* DESC: Script type for events in the profiler */ +ui_strings.S_SCRIPT_TYPE_BROWSERJS = "BrowserJS"; + +/* DESC: Script type for events in the profiler */ +ui_strings.S_SCRIPT_TYPE_DEBUGGER = "Debugger"; + +/* DESC: Script type for events in the profiler */ +ui_strings.S_SCRIPT_TYPE_EVAL = "Eval"; + +/* DESC: Script type for events in the profiler */ +ui_strings.S_SCRIPT_TYPE_EVENT_HANDLER = "Event"; + +/* DESC: Script type for events in the profiler */ +ui_strings.S_SCRIPT_TYPE_EXTENSIONJS = "Extension"; + +/* DESC: Script type for events in the profiler */ +ui_strings.S_SCRIPT_TYPE_GENERATED = "document.write()"; + +/* DESC: Script type for events in the profiler */ +ui_strings.S_SCRIPT_TYPE_INLINE = "Inline"; + +/* DESC: Script type for events in the profiler */ +ui_strings.S_SCRIPT_TYPE_LINKED = "External"; + +/* DESC: Script type for events in the profiler */ +ui_strings.S_SCRIPT_TYPE_TIMEOUT = "Timeout or interval"; + +/* DESC: Script type for events in the profiler */ +ui_strings.S_SCRIPT_TYPE_UNKNOWN = "Unknown"; + +/* DESC: Script type for events in the profiler */ +ui_strings.S_SCRIPT_TYPE_URI = "javascript: URL"; + +/* DESC: Script type for events in the profiler */ +ui_strings.S_SCRIPT_TYPE_USERJS = "UserJS"; + +/* DESC: Tooltip for filtering text-input boxes */ +ui_strings.S_SEARCH_INPUT_TOOLTIP = "text search"; + +/* DESC: Header for settings group "About" */ +ui_strings.S_SETTINGS_HEADER_ABOUT = "About"; + +/* DESC: Header for settings group "Console" */ +ui_strings.S_SETTINGS_HEADER_CONSOLE = "Error Log"; + +/* DESC: Header for settings group "Document" */ +ui_strings.S_SETTINGS_HEADER_DOCUMENT = "Documents"; + +/* DESC: Header for settings group "General" */ +ui_strings.S_SETTINGS_HEADER_GENERAL = "General"; + +/* DESC: Header for settings group "Keyboard shortcuts" */ +ui_strings.S_SETTINGS_HEADER_KEYBOARD_SHORTCUTS = "Keyboard shortcuts"; + +/* DESC: Header for settings group "Network" */ +ui_strings.S_SETTINGS_HEADER_NETWORK = "Network"; + +/* DESC: Header for settings group "Script" */ +ui_strings.S_SETTINGS_HEADER_SCRIPT = "Scripts"; + +/* DESC: Description for CSS rules with the origin being the user */ +ui_strings.S_STYLE_ORIGIN_LOCAL = "user stylesheet"; + +/* DESC: Description for CSS rules with the origin being the SVG presentation attributes */ +ui_strings.S_STYLE_ORIGIN_SVG = "presentation attributes"; + +/* DESC: Description for CSS rules with the origin being the UA */ +ui_strings.S_STYLE_ORIGIN_USER_AGENT = "user agent stylesheet"; + +/* DESC: Tooltip text for a button that attaches Opera Dragonfly to the main browser window. */ +ui_strings.S_SWITCH_ATTACH_WINDOW = "Dock to main window"; + +/* DESC: When enabled, the request log always scroll to the bottom on new requests */ +ui_strings.S_SWITCH_AUTO_SCROLL_REQUEST_LIST = "Auto-scroll request log"; + +/* DESC: Button title for stopping the profiler */ +ui_strings.S_SWITCH_CHANGE_START_TO_FIRST_EVENT = "Change start time to first event"; + +/* DESC: Checkbox: undocks Opera Dragonfly into a separate window. */ +ui_strings.S_SWITCH_DETACH_WINDOW = "Undock into separate window"; + +/* DESC: Expand all (entries in a list) */ +ui_strings.S_SWITCH_EXPAND_ALL = "Expand all"; + +/* DESC: If enabled objects can be expanded inline in the console. */ +ui_strings.S_SWITCH_EXPAND_OBJECTS_INLINE = "Expand objects inline in the console"; + +/* DESC: Will select the element when clicked. */ +ui_strings.S_SWITCH_FIND_ELEMENT_BY_CLICKING = "Select an element in the page to inspect it"; + +/* DESC: When enabled, objects of type element will be friendly printed */ +ui_strings.S_SWITCH_FRIENDLY_PRINT = "Enable smart-printing for Element objects in the console"; + +/* DESC: Shows or hides empty strings and null values. */ +ui_strings.S_SWITCH_HIDE_EMPTY_STRINGS = "Show empty strings and null values"; + +/* DESC: Highlights page elements when thet mouse hovers. */ +ui_strings.S_SWITCH_HIGHLIGHT_SELECTED_OR_HOVERED_ELEMENT = "Highlight selected element"; + +/* DESC: When enabled, objects of type element in the command line will be displayed in the DOM view */ +ui_strings.S_SWITCH_IS_ELEMENT_SENSITIVE = "Display Element objects in the DOM panel when selected in the console"; + +/* DESC: Draw a border on to selected DOM elements */ +ui_strings.S_SWITCH_LOCK_SELECTED_ELEMENTS = "Keep elements highlighted"; + +/* DESC: Switch toggeling if the debugger should automatically reload the page when the user changes the window to debug. */ +ui_strings.S_SWITCH_RELOAD_SCRIPTS_AUTOMATICALLY = "Reload new debugging contexts automatically"; + +/* DESC: Route debugging traffic trough proxy to enable debugging devices */ +ui_strings.S_SWITCH_REMOTE_DEBUG = "Remote debug"; + +/* DESC: Scroll an element in the host into view when selecting it in the DOM. */ +ui_strings.S_SWITCH_SCROLL_INTO_VIEW_ON_FIRST_SPOTLIGHT = "Scroll into view on first highlight"; + +/* DESC: List item in the DOM settings menu to shows or hide comments in DOM. Also Tooltip text for button in the secondary DOM menu. */ +ui_strings.S_SWITCH_SHOW_COMMENT_NODES = "Show comment nodes"; + +/* DESC: Shows DOM in tree or mark-up mode. */ +ui_strings.S_SWITCH_SHOW_DOM_INTREE_VIEW = "Represent the DOM as a node tree"; + +/* DESC: Show ECMAScript errors in the command line. */ +ui_strings.S_SWITCH_SHOW_ECMA_ERRORS_IN_COMMAND_LINE = "Show JavaScript errors in the console"; + +/* DESC: Show default null and empty string values when inspecting a js object. */ +ui_strings.S_SWITCH_SHOW_FEFAULT_NULLS_AND_EMPTY_STRINGS = "Show default values if they are null or empty strings"; + +/* DESC: Showing the id's and class names in the breadcrumb in the statusbar. */ +ui_strings.S_SWITCH_SHOW_ID_AND_CLASSES_IN_BREAD_CRUMB = "Show id's and classes in breadcrumb trail"; + +/* DESC: Toggles the display of pre-set values in the computed styles view. */ +ui_strings.S_SWITCH_SHOW_INITIAL_VALUES = "Show initial values"; + +/* DESC: Show non enumerale properties when inspecting a js object. */ +ui_strings.S_SWITCH_SHOW_NON_ENUMERABLES = "Show non-enumerable properties"; + +/* DESC: There are a lot of window types in Opera. This switch toggles if we show only the useful ones, or all of them. */ +ui_strings.S_SWITCH_SHOW_ONLY_NORMAL_AND_GADGETS_TYPE_WINDOWS = "Hide browser-specific contexts, such as mail and feed windows"; + +/* DESC: Show prototpe objects when inspecting a js object. */ +ui_strings.S_SWITCH_SHOW_PROTOTYPES = "Show prototypes"; + +/* DESC: Show pseudo elements in the DOM view */ +ui_strings.S_SWITCH_SHOW_PSEUDO_ELEMENTS = "Show pseudo-elements"; + +/* DESC: Showing the siblings in the breadcrumb in the statusbar. */ +ui_strings.S_SWITCH_SHOW_SIBLINGS_IN_BREAD_CRUMB = "Show siblings in breadcrumb trail"; + +/* DESC: Switch display of 'All' tab on or off. */ +ui_strings.S_SWITCH_SHOW_TAB_ALL = "All"; + +/* DESC: Switch display of 'Bittorrent' tab on or off. */ +ui_strings.S_SWITCH_SHOW_TAB_BITTORRENT = "BitTorrent"; + +/* DESC: Switch display of 'CSS' tab on or off. */ +ui_strings.S_SWITCH_SHOW_TAB_CSS = "CSS"; + +/* DESC: Switch display of 'HTML' tab on or off. */ +ui_strings.S_SWITCH_SHOW_TAB_HTML = "HTML"; + +/* DESC: Switch display of 'Java' tab on or off. */ +ui_strings.S_SWITCH_SHOW_TAB_JAVA = "Java"; + +/* DESC: Switch display of 'Mail' tab on or off. */ +ui_strings.S_SWITCH_SHOW_TAB_M2 = "Mail"; + +/* DESC: Switch display of 'Network' tab on or off. */ +ui_strings.S_SWITCH_SHOW_TAB_NETWORK = "Network"; + +/* DESC: Switch display of 'Script' tab on or off. */ +ui_strings.S_SWITCH_SHOW_TAB_SCRIPT = "JavaScript"; + +/* DESC: Switch display of 'SVG' tab on or off. */ +ui_strings.S_SWITCH_SHOW_TAB_SVG = "SVG"; + +/* DESC: Switch display of 'Voice' tab on or off. */ +ui_strings.S_SWITCH_SHOW_TAB_VOICE = "Voice"; + +/* DESC: Switch display of 'Widget' tab on or off. */ +ui_strings.S_SWITCH_SHOW_TAB_WIDGET = "Widgets"; + +/* DESC: Switch display of 'XML' tab on or off. */ +ui_strings.S_SWITCH_SHOW_TAB_XML = "XML"; + +/* DESC: Switch display of 'XSLT' tab on or off. */ +ui_strings.S_SWITCH_SHOW_TAB_XSLT = "XSLT"; + +/* DESC: List item in General settings menu to show or hide Views menu. */ +ui_strings.S_SWITCH_SHOW_VIEWS_MENU = "Show Views menu"; + +/* DESC: Shows or hides white space nodes in DOM. */ +ui_strings.S_SWITCH_SHOW_WHITE_SPACE_NODES = "Show whitespace nodes"; + +/* DESC: When enabled, a screenshot is taken automatically on showing utilities */ +ui_strings.S_SWITCH_TAKE_SCREENSHOT_AUTOMATICALLY = "Take a screenshot automatically when opening Utilities"; + +/* DESC: Settings checkbox label for toggling usage tracking. Add one to a running total each time the user starts Dragonfly. */ +ui_strings.S_SWITCH_TRACK_USAGE = "Track usage. Sends a randomly-generated user ID to the Opera Dragonfly servers each time Opera Dragonfly is started."; + +/* DESC: When enabled, list alike objects will be unpacked in the command line */ +ui_strings.S_SWITCH_UNPACK_LIST_ALIKES = "Unpack objects which have list-like behavior in the console"; + +/* DESC: List item in the DOM settings menu to update the DOM model automatically when a node is being removed. Also Tooltip text for button in the secondary DOM menu. */ +ui_strings.S_SWITCH_UPDATE_DOM_ON_NODE_REMOVE = "Update DOM when a node is removed"; + +/* DESC: List item in the DOM settings menu. */ +ui_strings.S_SWITCH_UPDATE_GLOBAL_SCOPE = "Automatically update global scope"; + +/* DESC: Spell HTML tag names upper or lower case. */ +ui_strings.S_SWITCH_USE_LOWER_CASE_TAG_NAMES = "Use lower case tag names for text/html"; + +/* DESC: Table header in the profiler */ +ui_strings.S_TABLE_HEADER_HITS = "Hits"; + +/* DESC: Table header in the profiler */ +ui_strings.S_TABLE_HEADER_TIME = "Time"; + +/* DESC: Entry format in the call stack view showing the function name, line number and script ID. Please do not modify the %(VARIABLE)s . */ +ui_strings.S_TEXT_CALL_STACK_FRAME_LINE = "%(FUNCTION_NAME)s: %(SCRIPT_ID)s:%(LINE_NUMBER)s"; + +/* DESC: Badge for the script ID in Scripts view. */ +ui_strings.S_TEXT_ECMA_SCRIPT_SCRIPT_ID = "Script id"; + +/* DESC: Badge for inline scripts. */ +ui_strings.S_TEXT_ECMA_SCRIPT_TYPE_INLINE = "Inline"; + +/* DESC: Badge for linked scripts. */ +ui_strings.S_TEXT_ECMA_SCRIPT_TYPE_LINKED = "Linked"; + +/* DESC: Badge for unknown script types. */ +ui_strings.S_TEXT_ECMA_SCRIPT_TYPE_UNKNOWN = "Unknown"; + +/* DESC: Information on the Opera Dragonfly version number that appears in the Environment view. */ +ui_strings.S_TEXT_ENVIRONMENT_DRAGONFLY_VERSION = "Opera Dragonfly Version"; + +/* DESC: Information on the operating system used that appears in the Environment view. */ +ui_strings.S_TEXT_ENVIRONMENT_OPERATING_SYSTEM = "Operating System"; + +/* DESC: Information on the platform in use that appears in the Environment view. */ +ui_strings.S_TEXT_ENVIRONMENT_PLATFORM = "Platform"; + +/* DESC: Information on the Scope protocol version used that appears in the Environment view. */ +ui_strings.S_TEXT_ENVIRONMENT_PROTOCOL_VERSION = "Protocol Version"; + +/* DESC: Information on the Opera Dragonfly revision number that appears in the Environment view. */ +ui_strings.S_TEXT_ENVIRONMENT_REVISION_NUMBER = "Revision Number"; + +/* DESC: Information on the user-agent submitted that appears in the Environment view. */ +ui_strings.S_TEXT_ENVIRONMENT_USER_AGENT = "User Agent"; + +/* DESC: Result text for a search when there were search results. The %(VARIABLE)s should not be translated, but its position in the text can be rearranged. Python syntax: %(VARIABLE)type_identifier, so %(FOO)s in its entirety is replaced. */ +ui_strings.S_TEXT_STATUS_SEARCH = "Matches for \"%(SEARCH_TERM)s\": Match %(SEARCH_COUNT_INDEX)s out of %(SEARCH_COUNT_TOTAL)s"; + +/* DESC: Result text for the search. Please do not modify the %(VARIABLE)s . */ +ui_strings.S_TEXT_STATUS_SEARCH_NO_MATCH = "No match for \"%(SEARCH_TERM)s\""; + +/* DESC: Thread type for events in the profiler */ +ui_strings.S_THREAD_TYPE_COMMON = "Common"; + +/* DESC: Thread type for events in the profiler */ +ui_strings.S_THREAD_TYPE_DEBUGGER_EVAL = "Debugger"; + +/* DESC: Thread type for events in the profiler */ +ui_strings.S_THREAD_TYPE_EVENT = "Event"; + +/* DESC: Thread type for events in the profiler */ +ui_strings.S_THREAD_TYPE_HISTORY_NAVIGATION = "History navigation"; + +/* DESC: Thread type for events in the profiler */ +ui_strings.S_THREAD_TYPE_INLINE_SCRIPT = "Inline script"; + +/* DESC: Thread type for events in the profiler */ +ui_strings.S_THREAD_TYPE_JAVASCRIPT_URL = "javascript: URL"; + +/* DESC: Thread type for events in the profiler. This should not be translated. */ +ui_strings.S_THREAD_TYPE_JAVA_EVAL = "Java (LiveConnect)"; + +/* DESC: Thread type for events in the profiler */ +ui_strings.S_THREAD_TYPE_TIMEOUT = "Timeout or interval"; + +/* DESC: Thread type for events in the profiler */ +ui_strings.S_THREAD_TYPE_UNKNOWN = "Unknown"; + +/* DESC: Enabling/disabling DOM modebar */ +ui_strings.S_TOGGLE_DOM_MODEBAR = "Show breadcrumb trail"; + +/* DESC: Heading for the setting that toggles the breadcrumb trail */ +ui_strings.S_TOGGLE_DOM_MODEBAR_HEADER = "Breadcrumb Trail"; + +/* DESC: Label on button to pause/unpause updates of the network graph view */ +ui_strings.S_TOGGLE_PAUSED_UPDATING_NETWORK_VIEW = "Pause updating network activity"; + From 0769f67aae8b28def54eff7f10c99ebb9bf2777e Mon Sep 17 00:00:00 2001 From: Chris K Date: Mon, 13 Aug 2012 18:46:37 +0200 Subject: [PATCH 10/27] Run cleanrepo. --- .../build_ecmascript_debugger_6_0.js | 576 +-- src/ecma-debugger/jssourcetooltip.js | 2204 +++++------ src/ecma-debugger/stop_at.js | 1276 +++--- src/ecma-debugger/templates.js | 1504 +++---- src/ui-strings/ui_strings-en.js | 3479 ++++++++--------- 5 files changed, 4519 insertions(+), 4520 deletions(-) diff --git a/src/build-application/build_ecmascript_debugger_6_0.js b/src/build-application/build_ecmascript_debugger_6_0.js index ed4e6d0f1..0490f1097 100644 --- a/src/build-application/build_ecmascript_debugger_6_0.js +++ b/src/build-application/build_ecmascript_debugger_6_0.js @@ -1,288 +1,288 @@ -/* load after build_application.js */ - -window.app.builders.EcmascriptDebugger || (window.app.builders.EcmascriptDebugger = {}); - -/** - * @param {Object} service. The service description of - * the according service on the host side. - */ - -window.app.builders.EcmascriptDebugger["6.0"] = function(service) -{ - // see diff to %.0 version: hg diff -c 9d4f82a72900 - var namespace = cls.EcmascriptDebugger && cls.EcmascriptDebugger["6.0"]; - var service_interface = window.services['ecmascript-debugger']; - - const NAME = 0, ID = 1, VIEWS = 2; - - if(service_interface) - { - - cls.InspectableJSObject = namespace.InspectableJSObject; - cls.JSInspectionTooltip.register(); - cls.EventListenerTooltip.register(); - // disabled for now. see CORE-32113 - // cls.InspectableJSObject.register_enabled_listener(); - // for now we are filtering on the client side - cls.InspectableJSObject.create_filters(); - - window.runtimes = new namespace.Runtimes("6.0"); - window.runtimes.bind(service_interface); - - window.dom_data = new namespace.DOMData('dom'); - window.dom_data.bind(service_interface); - window.stop_at = new namespace.StopAt(); - window.stop_at.bind(service_interface); - window.host_tabs = new namespace.HostTabs(); - window.host_tabs.bind(service_interface); - window.hostspotlighter = new namespace.Hostspotlighter(); - window.hostspotlighter.bind(service_interface); - - /* ECMA object inspection */ - var BaseView = new namespace.InspectionBaseView(); - namespace.InspectionView.prototype = BaseView; - new namespace.InspectionView('inspection', - ui_strings.M_VIEW_LABEL_FRAME_INSPECTION, - 'scroll mono'); - namespace.InspectionView.create_ui_widgets(); - - /* DOM object inspection */ - namespace.DOMAttrsView.prototype = BaseView; - new namespace.DOMAttrsView('dom_attrs', - ui_strings.M_VIEW_LABEL_DOM_ATTR, - 'scroll dom-attrs mono'); - namespace.DOMAttrsView.create_ui_widgets(); - - /* - a namespace for all the followindg classes will only be created - if needed to adjust them for an updated service version - */ - - window.runtime_onload_handler = new namespace.RuntimeOnloadHandler(); - - /* commandline */ - new cls.CommandLineRuntimeSelect('cmd-runtime-select', 'cmd-line-runtimes'); - - cls.ReplView.create_ui_widgets(); - new cls.ReplView('command_line', - ui_strings.M_VIEW_LABEL_COMMAND_LINE, - 'scroll console mono', - '', 'repl-focus'); - - /* JS source */ - window.simple_js_parser = new window.cls.SimpleJSParser(); - new cls.JsSourceView('js_source', - ui_strings.M_VIEW_LABEL_SOURCE, - 'scroll js-source mono'); - new cls.ScriptSelect('js-script-select', 'script-options'); - cls.JsSourceView.create_ui_widgets(); - - /* Watches */ - cls.WatchesView.prototype = ViewBase; - new cls.WatchesView('watches', - ui_strings.M_VIEW_LABEL_WATCHES, - 'scroll mono'); - - /* Runtime State */ - var js_side_panel_sections = service_interface.satisfies_version(6, 10) - ? ['watches', 'return-values', 'callstack', 'inspection'] - : ['watches', 'callstack', 'inspection']; - new cls.JSSidePanelView('scripts-side-panel', - ui_strings.M_VIEW_LABEL_RUNTIME_STATE, - js_side_panel_sections, - // default expanded flags for the view list - [false, true, true, true]); - - /* Return Values */ - cls.ReturnValuesView.prototype = ViewBase; - new cls.ReturnValuesView('return-values', - ui_strings.M_VIEW_LABEL_RETURN_VALUES, - 'scroll mono'); - cls.ReturnValuesView.create_ui_widgets(); - - /* Callstack */ - cls.CallstackView.prototype = ViewBase; - new cls.CallstackView('callstack', - ui_strings.M_VIEW_LABEL_CALLSTACK, - 'scroll mono'); - - /* Threads */ - cls.ThreadsView.prototype = ViewBase; - new cls.ThreadsView('threads', - ui_strings.M_VIEW_LABEL_THREAD_LOG, - 'scroll threads'); - //cls.ThreadsView.create_ui_widgets(); - - /* DOM */ - cls.InspectableDOMNode = namespace.InspectableDOMNode; - new cls.DOMInspectorActions('dom'); // the view id - cls.DOMView.prototype = ViewBase; - new cls.DOMView('dom', ui_strings.M_VIEW_LABEL_DOM, 'scroll dom mono'); - cls.DOMView.prototype.constructor = cls.DOMView; - cls.DocumentSelect.prototype = new CstSelect(); - new cls.DocumentSelect('document-select', 'document-options'); - cls.DOMView.create_ui_widgets(); - cls.DOMSearchView.prototype = ViewBase; - new cls.DOMSearchView('dom-search', ui_strings.M_VIEW_LABEL_SEARCH); - - window.stylesheets = new cls.Stylesheets(); - window.element_style = new cls.ElementStyle(); - cls.CssStyleDeclarations = cls.EcmascriptDebugger["6.7"].CssStyleDeclarations; - - /* CSS inspector */ - cls.CSSInspectorView.prototype = ViewBase; - new cls.CSSInspectorView('css-inspector', - ui_strings.M_VIEW_LABEL_STYLES, - 'scroll css-inspector mono'); - new cls.CSSInspectorView.create_ui_widgets(); - - cls.CSSInspectorCompStyleView.prototype = ViewBase; - new cls.CSSInspectorCompStyleView('css-comp-style', - ui_strings.M_VIEW_LABEL_COMPUTED_STYLE, - 'scroll css-inspector mono'); - - cls.NewStyle.prototype = ViewBase; - new cls.NewStyle('new-style', ui_strings.M_VIEW_LABEL_NEW_STYLE, 'scroll css-new-style mono'); - - new cls.ColorPickerView('color-selector', 'Color Picker', 'color-selector'); - new cls.CSSInspectorActions('css-inspector'); - - /* DOM sidepanel */ - new cls.DOMSidePanelView('dom-side-panel', - ui_strings.M_VIEW_LABEL_STYLES, - ['css-comp-style', 'css-inspector', 'new-style'], - // default expanded flags for the view list - [false, true, false]); - cls.DOMSidePanelView.create_ui_widgets(); - - /* Layout */ - window.element_layout = new cls.ElementLayout(); - cls.CSSLayoutView.prototype = ViewBase; - new cls.CSSLayoutView('css-layout', - ui_strings.M_VIEW_LABEL_LAYOUT, - 'scroll css-layout'); - - /* Runtime State */ - new cls.JSSidePanelView('breakpoints-side-panel', - ui_strings.M_VIEW_LABEL_BREAKPOINTS, - ['breakpoints', 'event-breakpoints'], - // default expanded flags for the view list - [true, false]); - - /* Event Breakpoints */ - window.event_breakpoints = cls.EventBreakpoints.get_instance(); - cls.EventBreakpointsView.prototype = ViewBase; - new cls.EventBreakpointsView('event-breakpoints', - ui_strings.M_VIEW_LABEL_EVENT_BREAKPOINTS, - 'scroll event-breakpoints'); - cls.EventBreakpointsView.create_ui_widgets(); - - /* Breakpoints */ - cls.BreakpointsView.prototype = ViewBase; - new cls.BreakpointsView('breakpoints', - ui_strings.M_VIEW_LABEL_BREAKPOINTS, - 'scroll breakpoints mono'); - cls.BreakpointsView.create_ui_widgets(); - - /* JS Search */ - cls.JSSearchView.prototype = ViewBase; - new cls.JSSearchView('js-search', - ui_strings.M_VIEW_LABEL_SEARCH, - 'scroll js-search'); - - /* Listeners */ - if (service_interface.satisfies_version(6, 11)) - { - new cls.SelectedNodeListenersView("ev-listeners-selected-node", - ui_strings.M_VIEW_LABEL_EVENT_LISTENERS_SELECTED_NODE, - "ev-listeners-selected-node scroll"); - new cls.EventListenersView("ev-listeners-all", - ui_strings.M_VIEW_LABEL_EVENT_LISTENERS_ALL, - "ev-listeners-all scroll"); - new cls.EventListenerSidePanelView("ev-listeners-side-panel", - ui_strings.M_VIEW_LABEL_EVENT_LISTENERS, - ["ev-listeners-selected-node", "ev-listeners-all"], - // default expanded flags for the view list - [true, true]); - cls.EventListenerSidePanelView.create_ui_widgets(); - } - - /* adjust the base class */ - - var StorageDataBase = new namespace.StorageDataBase(); - cls.CookiesData.prototype = StorageDataBase; - cls.LocalStorageData.prototype = StorageDataBase; - - /* storage objects and cookies */ - new cls.Namespace("storages"); - window.storages.add(new cls.LocalStorageData( - 'local_storage', - 'local-storage', - ui_strings.M_VIEW_LABEL_LOCAL_STORAGE, - 'localStorage')); - window.storages.add(new cls.LocalStorageData( - 'session_storage', - 'session-storage', - ui_strings.M_VIEW_LABEL_SESSION_STORAGE, - 'sessionStorage')); - window.storages.add(new cls.LocalStorageData( - 'widget_preferences', - 'widget-preferences', - ui_strings.M_VIEW_LABEL_WIDGET_PREFERNCES, - 'widget.preferences')); - window.storages.add(new cls.CookiesData( - 'cookies', - 'cookies', - ui_strings.M_VIEW_LABEL_COOKIES)); - - new cls.StorageView("local_storage", - ui_strings.M_VIEW_LABEL_LOCAL_STORAGE, - "scroll storage_view local_storage", - "local_storage"); - new cls.StorageViewActions("local_storage"); - - new cls.StorageView("session_storage", - ui_strings.M_VIEW_LABEL_SESSION_STORAGE, - "scroll storage_view session_storage", - "session_storage"); - new cls.StorageViewActions("session_storage"); - - new cls.StorageView("cookies", - ui_strings.M_VIEW_LABEL_COOKIES, - "scroll storage_view cookies", - "cookies"); - new cls.StorageViewActions("cookies"); - - new cls.StorageView("widget_preferences", - ui_strings.M_VIEW_LABEL_WIDGET_PREFERNCES, - "scroll storage_view widget_preferences", - "widget_preferences"); - new cls.StorageViewActions("widget_preferences"); - - /* the following views must be created to get entry in the Settings tab */ - - /* Environment */ - cls.EnvironmentView.prototype = ViewBase; - new cls.EnvironmentView('environment', - ui_strings.M_VIEW_LABEL_ENVIRONMENT, - 'scroll'); - cls.EnvironmentView.create_ui_widgets(); - - /* About */ - cls.AboutView.prototype = ViewBase; - new cls.AboutView('about', ui_strings.S_SETTINGS_HEADER_ABOUT, 'scroll'); - cls.AboutView.create_ui_widgets(); - - /* Hostspotlighter */ - cls.HostSpotlightView.prototype = ViewBase; - new cls.HostSpotlightView('host-spotlight', - ui_strings.S_LABEL_SPOTLIGHT_TITLE); - cls.HostSpotlightView.create_ui_widgets(); - - /* main view doesn't really exist */ - cls.MainView.create_ui_widgets(); - - return true; - } - -} +/* load after build_application.js */ + +window.app.builders.EcmascriptDebugger || (window.app.builders.EcmascriptDebugger = {}); + +/** + * @param {Object} service. The service description of + * the according service on the host side. + */ + +window.app.builders.EcmascriptDebugger["6.0"] = function(service) +{ + // see diff to %.0 version: hg diff -c 9d4f82a72900 + var namespace = cls.EcmascriptDebugger && cls.EcmascriptDebugger["6.0"]; + var service_interface = window.services['ecmascript-debugger']; + + const NAME = 0, ID = 1, VIEWS = 2; + + if(service_interface) + { + + cls.InspectableJSObject = namespace.InspectableJSObject; + cls.JSInspectionTooltip.register(); + cls.EventListenerTooltip.register(); + // disabled for now. see CORE-32113 + // cls.InspectableJSObject.register_enabled_listener(); + // for now we are filtering on the client side + cls.InspectableJSObject.create_filters(); + + window.runtimes = new namespace.Runtimes("6.0"); + window.runtimes.bind(service_interface); + + window.dom_data = new namespace.DOMData('dom'); + window.dom_data.bind(service_interface); + window.stop_at = new namespace.StopAt(); + window.stop_at.bind(service_interface); + window.host_tabs = new namespace.HostTabs(); + window.host_tabs.bind(service_interface); + window.hostspotlighter = new namespace.Hostspotlighter(); + window.hostspotlighter.bind(service_interface); + + /* ECMA object inspection */ + var BaseView = new namespace.InspectionBaseView(); + namespace.InspectionView.prototype = BaseView; + new namespace.InspectionView('inspection', + ui_strings.M_VIEW_LABEL_FRAME_INSPECTION, + 'scroll mono'); + namespace.InspectionView.create_ui_widgets(); + + /* DOM object inspection */ + namespace.DOMAttrsView.prototype = BaseView; + new namespace.DOMAttrsView('dom_attrs', + ui_strings.M_VIEW_LABEL_DOM_ATTR, + 'scroll dom-attrs mono'); + namespace.DOMAttrsView.create_ui_widgets(); + + /* + a namespace for all the followindg classes will only be created + if needed to adjust them for an updated service version + */ + + window.runtime_onload_handler = new namespace.RuntimeOnloadHandler(); + + /* commandline */ + new cls.CommandLineRuntimeSelect('cmd-runtime-select', 'cmd-line-runtimes'); + + cls.ReplView.create_ui_widgets(); + new cls.ReplView('command_line', + ui_strings.M_VIEW_LABEL_COMMAND_LINE, + 'scroll console mono', + '', 'repl-focus'); + + /* JS source */ + window.simple_js_parser = new window.cls.SimpleJSParser(); + new cls.JsSourceView('js_source', + ui_strings.M_VIEW_LABEL_SOURCE, + 'scroll js-source mono'); + new cls.ScriptSelect('js-script-select', 'script-options'); + cls.JsSourceView.create_ui_widgets(); + + /* Watches */ + cls.WatchesView.prototype = ViewBase; + new cls.WatchesView('watches', + ui_strings.M_VIEW_LABEL_WATCHES, + 'scroll mono'); + + /* Runtime State */ + var js_side_panel_sections = service_interface.satisfies_version(6, 10) + ? ['watches', 'return-values', 'callstack', 'inspection'] + : ['watches', 'callstack', 'inspection']; + new cls.JSSidePanelView('scripts-side-panel', + ui_strings.M_VIEW_LABEL_RUNTIME_STATE, + js_side_panel_sections, + // default expanded flags for the view list + [false, true, true, true]); + + /* Return Values */ + cls.ReturnValuesView.prototype = ViewBase; + new cls.ReturnValuesView('return-values', + ui_strings.M_VIEW_LABEL_RETURN_VALUES, + 'scroll mono'); + cls.ReturnValuesView.create_ui_widgets(); + + /* Callstack */ + cls.CallstackView.prototype = ViewBase; + new cls.CallstackView('callstack', + ui_strings.M_VIEW_LABEL_CALLSTACK, + 'scroll mono'); + + /* Threads */ + cls.ThreadsView.prototype = ViewBase; + new cls.ThreadsView('threads', + ui_strings.M_VIEW_LABEL_THREAD_LOG, + 'scroll threads'); + //cls.ThreadsView.create_ui_widgets(); + + /* DOM */ + cls.InspectableDOMNode = namespace.InspectableDOMNode; + new cls.DOMInspectorActions('dom'); // the view id + cls.DOMView.prototype = ViewBase; + new cls.DOMView('dom', ui_strings.M_VIEW_LABEL_DOM, 'scroll dom mono'); + cls.DOMView.prototype.constructor = cls.DOMView; + cls.DocumentSelect.prototype = new CstSelect(); + new cls.DocumentSelect('document-select', 'document-options'); + cls.DOMView.create_ui_widgets(); + cls.DOMSearchView.prototype = ViewBase; + new cls.DOMSearchView('dom-search', ui_strings.M_VIEW_LABEL_SEARCH); + + window.stylesheets = new cls.Stylesheets(); + window.element_style = new cls.ElementStyle(); + cls.CssStyleDeclarations = cls.EcmascriptDebugger["6.7"].CssStyleDeclarations; + + /* CSS inspector */ + cls.CSSInspectorView.prototype = ViewBase; + new cls.CSSInspectorView('css-inspector', + ui_strings.M_VIEW_LABEL_STYLES, + 'scroll css-inspector mono'); + new cls.CSSInspectorView.create_ui_widgets(); + + cls.CSSInspectorCompStyleView.prototype = ViewBase; + new cls.CSSInspectorCompStyleView('css-comp-style', + ui_strings.M_VIEW_LABEL_COMPUTED_STYLE, + 'scroll css-inspector mono'); + + cls.NewStyle.prototype = ViewBase; + new cls.NewStyle('new-style', ui_strings.M_VIEW_LABEL_NEW_STYLE, 'scroll css-new-style mono'); + + new cls.ColorPickerView('color-selector', 'Color Picker', 'color-selector'); + new cls.CSSInspectorActions('css-inspector'); + + /* DOM sidepanel */ + new cls.DOMSidePanelView('dom-side-panel', + ui_strings.M_VIEW_LABEL_STYLES, + ['css-comp-style', 'css-inspector', 'new-style'], + // default expanded flags for the view list + [false, true, false]); + cls.DOMSidePanelView.create_ui_widgets(); + + /* Layout */ + window.element_layout = new cls.ElementLayout(); + cls.CSSLayoutView.prototype = ViewBase; + new cls.CSSLayoutView('css-layout', + ui_strings.M_VIEW_LABEL_LAYOUT, + 'scroll css-layout'); + + /* Runtime State */ + new cls.JSSidePanelView('breakpoints-side-panel', + ui_strings.M_VIEW_LABEL_BREAKPOINTS, + ['breakpoints', 'event-breakpoints'], + // default expanded flags for the view list + [true, false]); + + /* Event Breakpoints */ + window.event_breakpoints = cls.EventBreakpoints.get_instance(); + cls.EventBreakpointsView.prototype = ViewBase; + new cls.EventBreakpointsView('event-breakpoints', + ui_strings.M_VIEW_LABEL_EVENT_BREAKPOINTS, + 'scroll event-breakpoints'); + cls.EventBreakpointsView.create_ui_widgets(); + + /* Breakpoints */ + cls.BreakpointsView.prototype = ViewBase; + new cls.BreakpointsView('breakpoints', + ui_strings.M_VIEW_LABEL_BREAKPOINTS, + 'scroll breakpoints mono'); + cls.BreakpointsView.create_ui_widgets(); + + /* JS Search */ + cls.JSSearchView.prototype = ViewBase; + new cls.JSSearchView('js-search', + ui_strings.M_VIEW_LABEL_SEARCH, + 'scroll js-search'); + + /* Listeners */ + if (service_interface.satisfies_version(6, 11)) + { + new cls.SelectedNodeListenersView("ev-listeners-selected-node", + ui_strings.M_VIEW_LABEL_EVENT_LISTENERS_SELECTED_NODE, + "ev-listeners-selected-node scroll"); + new cls.EventListenersView("ev-listeners-all", + ui_strings.M_VIEW_LABEL_EVENT_LISTENERS_ALL, + "ev-listeners-all scroll"); + new cls.EventListenerSidePanelView("ev-listeners-side-panel", + ui_strings.M_VIEW_LABEL_EVENT_LISTENERS, + ["ev-listeners-selected-node", "ev-listeners-all"], + // default expanded flags for the view list + [true, true]); + cls.EventListenerSidePanelView.create_ui_widgets(); + } + + /* adjust the base class */ + + var StorageDataBase = new namespace.StorageDataBase(); + cls.CookiesData.prototype = StorageDataBase; + cls.LocalStorageData.prototype = StorageDataBase; + + /* storage objects and cookies */ + new cls.Namespace("storages"); + window.storages.add(new cls.LocalStorageData( + 'local_storage', + 'local-storage', + ui_strings.M_VIEW_LABEL_LOCAL_STORAGE, + 'localStorage')); + window.storages.add(new cls.LocalStorageData( + 'session_storage', + 'session-storage', + ui_strings.M_VIEW_LABEL_SESSION_STORAGE, + 'sessionStorage')); + window.storages.add(new cls.LocalStorageData( + 'widget_preferences', + 'widget-preferences', + ui_strings.M_VIEW_LABEL_WIDGET_PREFERNCES, + 'widget.preferences')); + window.storages.add(new cls.CookiesData( + 'cookies', + 'cookies', + ui_strings.M_VIEW_LABEL_COOKIES)); + + new cls.StorageView("local_storage", + ui_strings.M_VIEW_LABEL_LOCAL_STORAGE, + "scroll storage_view local_storage", + "local_storage"); + new cls.StorageViewActions("local_storage"); + + new cls.StorageView("session_storage", + ui_strings.M_VIEW_LABEL_SESSION_STORAGE, + "scroll storage_view session_storage", + "session_storage"); + new cls.StorageViewActions("session_storage"); + + new cls.StorageView("cookies", + ui_strings.M_VIEW_LABEL_COOKIES, + "scroll storage_view cookies", + "cookies"); + new cls.StorageViewActions("cookies"); + + new cls.StorageView("widget_preferences", + ui_strings.M_VIEW_LABEL_WIDGET_PREFERNCES, + "scroll storage_view widget_preferences", + "widget_preferences"); + new cls.StorageViewActions("widget_preferences"); + + /* the following views must be created to get entry in the Settings tab */ + + /* Environment */ + cls.EnvironmentView.prototype = ViewBase; + new cls.EnvironmentView('environment', + ui_strings.M_VIEW_LABEL_ENVIRONMENT, + 'scroll'); + cls.EnvironmentView.create_ui_widgets(); + + /* About */ + cls.AboutView.prototype = ViewBase; + new cls.AboutView('about', ui_strings.S_SETTINGS_HEADER_ABOUT, 'scroll'); + cls.AboutView.create_ui_widgets(); + + /* Hostspotlighter */ + cls.HostSpotlightView.prototype = ViewBase; + new cls.HostSpotlightView('host-spotlight', + ui_strings.S_LABEL_SPOTLIGHT_TITLE); + cls.HostSpotlightView.create_ui_widgets(); + + /* main view doesn't really exist */ + cls.MainView.create_ui_widgets(); + + return true; + } + +} diff --git a/src/ecma-debugger/jssourcetooltip.js b/src/ecma-debugger/jssourcetooltip.js index 5aa47b54d..31c0c3863 100644 --- a/src/ecma-debugger/jssourcetooltip.js +++ b/src/ecma-debugger/jssourcetooltip.js @@ -1,1102 +1,1102 @@ -"use strict"; - -window.cls || (window.cls = {}); - -cls.JSSourceTooltip = function(view) -{ - var POLL_INTERVAL = 150; - var MAX = Math.max; - var MIN = Math.min; - var POW = Math.pow; - var MIN_RADIUS = 2; - var WHITESPACE = cls.SimpleJSParser.WHITESPACE; - var LINETERMINATOR = cls.SimpleJSParser.LINETERMINATOR; - var IDENTIFIER = cls.SimpleJSParser.IDENTIFIER; - var NUMBER = cls.SimpleJSParser.NUMBER; - var STRING = cls.SimpleJSParser.STRING; - var PUNCTUATOR = cls.SimpleJSParser.PUNCTUATOR; - var DIV_PUNCTUATOR = cls.SimpleJSParser.DIV_PUNCTUATOR; - var REG_EXP = cls.SimpleJSParser.REG_EXP; - var COMMENT = cls.SimpleJSParser.COMMENT; - var FORWARD = 1; - var BACKWARDS = -1; - var TYPE = 0; - var VALUE = 1; - var SHIFT_KEY = 16; - var TOOLTIP_NAME = cls.JSInspectionTooltip.tooltip_name; - var MAX_MOUSE_POS_COUNT = 2; - var FILTER_HANDLER = "js-tooltip-filter"; - - var _tooltip = null; - var _view = null; - var _tokenizer = null; - var _poll_interval = 0; - var _tooltip_target_ele = null; - var _last_move_event = null; - var _is_token_selected = false; - var _mouse_positions = []; - var _container = null; - var _container_box = null; - var _char_width = 0; - var _line_height = 0; - var _tab_size = 0; - var _default_offset = 10; - var _total_x_offset = 0; - var _last_poll = {}; - var _identifier = null; - var _identifier_boxes = []; - var _identifier_out_count = 0; - var _tagman = null; - var _esde = null; - var _is_over_tooltip = false; - var _win_selection = null; - var _last_script_text = ""; - var _shift_key = false; - var _filter = null; - var _filter_input = null; - var _tooltip_container = null; - var _tooltip_model = null; - var _filter_shortcuts_cb = null; - var _filter_config = {"handler": FILTER_HANDLER, - "shortcuts": FILTER_HANDLER, - "type": "filter", - "label": ui_strings.S_INPUT_DEFAULT_TEXT_FILTER, - "focus-handler": FILTER_HANDLER, - "blur-handler": FILTER_HANDLER}; - var _is_filter_focus = false; - var _is_mouse_down = false; - - var _poll_position = function() - { - if (!_last_move_event || - _is_over_tooltip || - !_win_selection || - _is_mouse_down || - (_filter && _is_filter_focus) || - CstSelect.is_active) - return; - - if (!_win_selection.isCollapsed && !_shift_key) - { - _clear_selection(); - return; - } - - if (_identifier) - { - if (_is_over_identifier_boxes(_last_move_event)) - { - _identifier_out_count = 0; - } - else - { - if (_identifier_out_count > 1) - _clear_selection(); - else - _identifier_out_count += 1; - } - } - - while (_mouse_positions.length > MAX_MOUSE_POS_COUNT) - _mouse_positions.shift(); - - _mouse_positions.push({x: _last_move_event.clientX, - y: _last_move_event.clientY}); - var center = _get_mouse_pos_center(); - if (center && center.r <= MIN_RADIUS) - { - var script = _view.get_current_script(); - if (script) - { - var offset_y = center.y - _container_box.top; - var line_number = _view.get_line_number_with_offset(offset_y); - var line = script.get_line(line_number); - var offset_x = center.x + _container.scrollLeft - _total_x_offset; - var char_offset = _get_char_offset(line, offset_x); - if (char_offset > -1 && - !(_last_poll.script == script && - _last_poll.line_number == line_number && - _last_poll.char_offset == char_offset && - _last_poll.shift_key == _shift_key)) - { - _last_poll.script = script; - _last_poll.line_number = line_number; - _last_poll.char_offset = char_offset; - _last_poll.center = center; - _last_poll.shift_key = _shift_key; - var line_count = Math.floor(offset_y / _line_height); - var box = - { - top: _container_box.top + line_count * _line_height, - bottom: _container_box.top + (line_count + 1) * _line_height, - mouse_x: Math.floor(center.x), - mouse_y: Math.floor(center.y) - }; - _handle_poll_position(script, line_number, char_offset, - box, _shift_key); - } - } - else - { - _clear_selection(); - } - } - }; - - var _handle_poll_position = function(script, line_number, char_offset, - box, shift_key) - { - var sel = _get_identifier(script, line_number, char_offset, shift_key); - if (sel) - { - var start = script.line_arr[sel.start_line - 1] + sel.start_offset; - var end = script.line_arr[sel.end_line - 1] + sel.end_offset; - var script_text = script.script_data.slice(start, end + 1); - - if (script_text != _last_script_text) - { - var rt_id = script.runtime_id; - var thread_id = 0; - var frame_index = 0; - _last_script_text = script_text; - var ex_ctx = window.runtimes.get_execution_context(); - if (ex_ctx.rt_id == rt_id) - { - thread_id = ex_ctx.thread_id; - frame_index = ex_ctx.frame_index; - } - var args = [script, line_number, char_offset, box, sel, rt_id, script_text]; - var tag = _tagman.set_callback(null, _handle_script, args); - var msg = [rt_id, thread_id, frame_index, script_text]; - _esde.requestEval(tag, msg); - } - } - }; - - var _handle_script = function(status, - message, - script, - line_number, - char_offset, - box, - selection, - rt_id, - script_text) - { - var STATUS = 0; - var TYPE = 1; - var VALUE = 2; - var OBJECT = 3; - var OBJECT_ID = 0; - var CLASS_NAME = 4; - - if (status === 0 && message[STATUS] == "completed") - { - _identifier = selection; - _identifier_out_count = 0; - _update_identifier_boxes(script, _identifier); - - if (selection.start_line != selection.end_line) - { - var line_count = selection.start_line - _view.getTopLine(); - if (line_count < 0) - line_count = 0; - - box.top = _container_box.top + line_count * _line_height; - var end_line = selection.end_line; - if (end_line > _view.getBottomLine()) - end_line = _view.getBottomLine(); - - line_count = selection.end_line - _view.getTopLine() + 1; - box.bottom = _container_box.top + line_count * _line_height; - var max_right = _get_max_right(); - box.left = _total_x_offset; - box.right = _total_x_offset + max_right - _container.scrollLeft; - } - - if (message[TYPE] == "object") - { - var object = message[OBJECT]; - var model = new cls.InspectableJSObject(rt_id, - object[OBJECT_ID], - "", - object[CLASS_NAME]); - _tooltip_model = model; - model.expand(function() - { - var tmpl = ["div", - ["h2", templates.default_filter(_filter_config), - ["span", object[CLASS_NAME], - "data-tooltip", TOOLTIP_NAME], - "data-id", String(model.id), - "obj-id", String(model.object_id), - "class", "js-tooltip-title"], - ["div", [window.templates.inspected_js_object(model, false)], - "class", "js-tooltip-examine-container mono"], - "class", "js-tooltip js-tooltip-examine"]; - var ele = _tooltip.show(tmpl, box); - if (ele) - { - _filter_input = ele.querySelector("input"); - _tooltip_container = ele.querySelector(".js-tooltip-examine-container"); - _filter.set_form_input(_filter_input); - _filter.set_container(_tooltip_container); - } - }); - } - else - { - var value = ""; - if (message[TYPE] == "null" || message[TYPE] == "undefined") - value = message[TYPE] - else if (message[TYPE] == "string") - value = "\"" + message[VALUE] + "\""; - else - value = message[VALUE]; - - var tmpl = ["div", - ["value", value, "class", message[TYPE]], - "class", "js-tooltip"]; - _tooltip.show(tmpl, box); - } - - var start_line = _identifier.start_line; - var start_offset = _identifier.start_offset; - var length = script_text.length; - - if (start_line < _view.getTopLine()) - { - if (_identifier.end_line < _view.getTopLine()) - return; - - start_line = _view.getTopLine(); - start_offset = 0; - var start = script.line_arr[start_line - 1]; - var end = script.line_arr[selection.end_line - 1] + selection.end_offset; - length = end + 1 - start; - } - - if (!_win_selection.isCollapsed) - _win_selection.collapseToStart() - - _view.higlight_slice(start_line, start_offset, length); - } - }; - - var _get_tokens_of_line = function(script, line_number) - { - var tokens = []; - if (script) - { - var line = script.get_line(line_number); - var start_state = script.state_arr[line_number - 1]; - - if (line) - { - _tokenizer.tokenize(line, function(token_type, token) - { - tokens.push([token_type, token]); - }, false, start_state); - } - } - return tokens; - }; - - var _get_identifier = function(script, line_number, char_offset, shift_key) - { - if (_win_selection.isCollapsed) - { - var tokens = _get_tokens_of_line(script, line_number); - - for (var i = 0, sum = 0; i < tokens.length; i++) - { - sum += tokens[i][VALUE].length; - if (sum > char_offset) - break; - } - - if ((tokens[i][TYPE] == IDENTIFIER && - (!window.js_keywords.hasOwnProperty(tokens[i][VALUE]) || - tokens[i][VALUE] == "this")) || - (tokens[i][TYPE] == PUNCTUATOR && - ((tokens[i][VALUE] == "[" || tokens[i][VALUE] == "]") || - (shift_key && (tokens[i][VALUE] == "(" || tokens[i][VALUE] == ")"))))) - { - var start = _get_identifier_chain_start(script, line_number, tokens, i, shift_key); - var end = _get_identifier_chain_end(script, line_number, tokens, i, shift_key); - return {start_line: start.start_line, - start_offset: start.start_offset, - end_line: end.end_line, - end_offset: end.end_offset}; - } - } - else - { - var range = _win_selection.getRangeAt(0); - if (document.documentElement.contains(_last_move_event.target) && - range.intersectsNode(_last_move_event.target)) - { - var start = _get_line_and_offset(range.startContainer, range.startOffset); - var end = _get_line_and_offset(range.endContainer, range.endOffset); - if (start && end) - return {start_line: start.line_number, - start_offset: start.offset, - end_line: end.line_number, - end_offset: end.offset - 1}; - } - } - - return null; - }; - - var _get_identifier_chain_start = function(script, line_number, tokens, - match_index, shift_key) - { - var start_line = line_number; - var bracket_count = 0; - var previous_token = tokens[match_index]; - var bracket_stack = []; - var parens_stack = []; - var index = match_index - 1; - - if (previous_token[VALUE] == "]") - bracket_stack.push(previous_token[VALUE]); - - if (shift_key && previous_token[VALUE] == ")") - parens_stack.push(previous_token[VALUE]); - - while (true) - { - for (var i = match_index - 1, token = null; token = tokens[i]; i--) - { - // consume everything between parentheses if shiftKey is pressed - if (shift_key && parens_stack.length) - { - if (token[TYPE] == PUNCTUATOR) - { - if (token[VALUE] == ")") - { - parens_stack.push(token[VALUE]) - previous_token = token; - } - if (token[VALUE] == "(") - { - parens_stack.pop(); - previous_token = token; - } - } - index = i - 1; - continue; - } - - switch (previous_token[TYPE]) - { - case IDENTIFIER: - { - switch (token[TYPE]) - { - case WHITESPACE: - case LINETERMINATOR: - case COMMENT: - { - continue; - } - case PUNCTUATOR: - { - if (token[VALUE] == ".") - { - previous_token = token; - index = i - 1; - continue; - } - if (token[VALUE] == "[" && bracket_stack.length) - { - bracket_stack.pop(); - previous_token = token; - index = i - 1; - continue; - } - } - } - break; - } - case PUNCTUATOR: - { - //previous_token[VALUE] is one of '.', '[', ']', '(', ')' - if (shift_key && token[VALUE] == ")") - { - parens_stack.push(token[VALUE]); - previous_token = token; - index = i - 1; - continue; - } - - if (previous_token[VALUE] == "." || previous_token[VALUE] == "[") - { - switch (token[TYPE]) - { - case WHITESPACE: - case LINETERMINATOR: - case COMMENT: - { - continue; - } - case IDENTIFIER: - { - previous_token = token; - index = i - 1; - continue; - } - case PUNCTUATOR: - { - if (token[VALUE] == "]") - { - bracket_stack.push(token[VALUE]); - previous_token = token; - index = i - 1; - continue; - } - } - } - } - else // must be "]" - { - switch (token[TYPE]) - { - case WHITESPACE: - case LINETERMINATOR: - case COMMENT: - { - continue; - } - case STRING: - case NUMBER: - case IDENTIFIER: - { - previous_token = token; - index = i - 1; - continue; - } - case PUNCTUATOR: - { - if (token[VALUE] == "]") - { - bracket_stack.push(token[VALUE]); - previous_token = token; - index = i - 1; - continue; - } - } - } - } - break; - } - case STRING: - case NUMBER: - { - switch (token[TYPE]) - { - case WHITESPACE: - case LINETERMINATOR: - case COMMENT: - { - continue; - } - case PUNCTUATOR: - { - if (token[VALUE] == "[") - { - bracket_stack.pop(); - previous_token = token; - index = i - 1; - continue; - } - } - } - break; - } - } - break; - } - - if (i == -1) - { - var new_tokens = _get_tokens_of_line(script, start_line - 1); - - if (new_tokens.length) - { - start_line--; - match_index = new_tokens.length; - index += match_index; - tokens = new_tokens.extend(tokens); - } - else - break; - } - else - break; - } - - if (tokens[index + 1][TYPE] == PUNCTUATOR && tokens[index + 1][VALUE] == ".") - index++; - - while (true) - { - var nl_index = _get_index_of_newline(tokens); - if (nl_index > -1 && nl_index <= index) - { - index -= tokens.splice(0, nl_index + 1).length; - start_line++; - } - else - break - } - - return {start_line: start_line, start_offset: _get_sum(tokens, index)}; - }; - - var _get_identifier_chain_end = function(script, line_number, tokens, - match_index, shift_key) - { - var start_line = line_number; - var bracket_count = 0; - var previous_token = tokens[match_index]; - var bracket_stack = []; - var parens_stack = []; - var index = match_index; - - if (previous_token[VALUE] == "[") - bracket_stack.push(previous_token[VALUE]); - - if (shift_key && previous_token[VALUE] == "(") - parens_stack.push(previous_token[VALUE]); - - while (bracket_stack.length || (shift_key && parens_stack.length)) - { - for (var i = match_index + 1, token = null; token = tokens[i]; i++) - { - // consume everything between parentheses if shiftKey is pressed - if (shift_key && parens_stack.length) - { - if (token[TYPE] == PUNCTUATOR) - { - if (token[VALUE] == "(") - { - parens_stack.push(token[VALUE]) - previous_token = token; - } - if (token[VALUE] == ")") - { - parens_stack.pop(); - previous_token = token; - } - } - index = i; - continue; - } - - if (!bracket_stack.length) - break; - - switch (previous_token[TYPE]) - { - case IDENTIFIER: - { - switch (token[TYPE]) - { - case WHITESPACE: - case LINETERMINATOR: - case COMMENT: - { - continue; - } - case PUNCTUATOR: - { - if (token[VALUE] == ".") - { - previous_token = token; - index = i; - continue; - } - if (token[VALUE] == "]") - { - bracket_stack.pop(); - previous_token = token; - index = i; - continue; - } - if (token[VALUE] == "[") - { - bracket_stack.push(token[VALUE]); - previous_token = token; - index = i; - continue; - } - } - } - break; - } - case PUNCTUATOR: - { - if (previous_token[VALUE] == "]") - { - switch (token[TYPE]) - { - case WHITESPACE: - case LINETERMINATOR: - case COMMENT: - { - continue; - } - case PUNCTUATOR: - { - if (token[VALUE] == ".") - { - previous_token = token; - index = i - 1; - continue; - } - if (token[VALUE] == "]" && bracket_stack.length) - { - bracket_stack.pop(); - previous_token = token; - index = i; - continue; - } - } - } - } - else if (previous_token[VALUE] == "[") - { - switch (token[TYPE]) - { - case WHITESPACE: - case LINETERMINATOR: - case COMMENT: - { - continue; - } - case STRING: - case NUMBER: - case IDENTIFIER: - { - previous_token = token; - index = i; - continue; - } - } - } - else // must be "." - { - switch (token[TYPE]) - { - case WHITESPACE: - case LINETERMINATOR: - case COMMENT: - { - continue; - } - case IDENTIFIER: - { - previous_token = token; - index = i; - continue; - } - } - } - break; - } - case STRING: - case NUMBER: - { - switch (token[TYPE]) - { - case WHITESPACE: - case LINETERMINATOR: - case COMMENT: - { - continue; - } - case PUNCTUATOR: - { - if (token[VALUE] == "]") - { - bracket_stack.pop(); - previous_token = token; - index = i; - continue; - } - } - } - break; - } - } - } - - if (i == tokens.length && bracket_stack.length) - { - start_line++; - var new_tokens = _get_tokens_of_line(script, start_line); - - if (new_tokens.length) - { - match_index = i; - tokens.extend(new_tokens); - } - else - break; - } - else - break; - } - - while (true) - { - var nl_index = _get_index_of_newline(tokens); - if (nl_index > -1 && nl_index <= index) - index -= tokens.splice(0, nl_index + 1).length; - else - break - } - - return {end_line: start_line, end_offset: _get_sum(tokens, index) - 1}; - }; - - var _get_line_and_offset = function(node, offset) - { - var line_ele = node.parentNode.has_attr("parent-node-chain", "data-line-number"); - if (line_ele) - { - var ctx = {target_node: node, sum: offset, is_found: false}; - return {line_number: parseInt(line_ele.getAttribute("data-line-number")), - offset: _walk_dom(ctx, line_ele).sum}; - } - return null; - }; - - var _walk_dom = function(ctx, node) - { - // ctx.target_node, ctx.sum, ctx.is_found - while (!ctx.is_found && node) - { - if (node.nodeType == Node.ELEMENT_NODE) - _walk_dom(ctx, node.firstChild); - - if (node.nodeType == Node.TEXT_NODE) - { - if (node == ctx.target_node) - ctx.is_found = true; - else - ctx.sum += node.nodeValue.length; - } - node = node.nextSibling; - } - return ctx; - }; - - var _get_max_right = function() - { - return Math.max.apply(null, _identifier_boxes.map(function(box) - { - return box.right; - })); - }; - - var _get_index_of_newline = function(tokens) - { - for (var i = 0, token; token = tokens[i]; i++) - { - if (token[TYPE] == LINETERMINATOR) - return i; - } - return -1; - }; - - var _get_sum = function(tokens, index) - { - for (var i = 0, sum = 0; i <= index; i++) - sum += tokens[i][VALUE].length; - - return sum; - }; - - var _get_mouse_pos_center = function() - { - var center = null; - if (_mouse_positions.length > 2) - { - var min_x = MIN(_mouse_positions[0].x, - _mouse_positions[1].x, - _mouse_positions[2].x); - var max_x = MAX(_mouse_positions[0].x, - _mouse_positions[1].x, - _mouse_positions[2].x); - var min_y = MIN(_mouse_positions[0].y, - _mouse_positions[1].y, - _mouse_positions[2].y); - var max_y = MAX(_mouse_positions[0].y, - _mouse_positions[1].y, - _mouse_positions[2].y); - var dx = max_x - min_x; - var dy = max_y - min_y; - - center = {x: min_x + dx / 2, - y: min_y + dy / 2, - r: POW(POW(dx / 2, 2) + POW(dy / 2, 2), 0.5)}; - } - return center; - }; - - var _update_identifier_boxes = function(script, identifier) - { - // translates the current selected identifier to dimension boxes - // position and dimensions are absolute to the source text - var line_number = _identifier.start_line; - - var start_offset = _identifier.start_offset; - var end_offset = 0; - _identifier_boxes = []; - while (true) - { - var box = {}; - var line = script.get_line(line_number); - box.left = _get_pixel_offset(line, start_offset); - if (line_number < _identifier.end_line) - box.right = _get_pixel_offset(line, line.length + 1); - else - box.right = _get_pixel_offset(line, _identifier.end_offset + 1); - box.top = (line_number - 1) * _line_height; - box.bottom = line_number * _line_height; - _identifier_boxes.push(box); - if (line_number == _identifier.end_line || - line_number >= script.line_arr.length) - break; - else - line_number += 1; - start_offset = 0; - } - }; - - var _is_over_identifier_boxes = function(event) - { - var off_x = _total_x_offset - _container.scrollLeft; - var off_y = _container_box.top - (_view.getTopLine() - 1) * _line_height; - var e_x = event.clientX - off_x; - var e_y = event.clientY - off_y; - - for (var i = 0, box; box = _identifier_boxes[i]; i++) - { - if (e_x >= box.left && e_x <= box.right && - e_y >= box.top && e_y <= box.bottom) - return true; - } - return false; - }; - - var _clear_selection = function() - { - _identifier = null; - _last_script_text = ""; - _last_poll = {}; - _view.higlight_slice(); - _tooltip.hide(); - _filter.set_search_term(""); - _filter.cleanup(); - _is_filter_focus = false; - _tooltip_model = null; - _tooltip_container = null; - - }; - - var _get_char_offset = function(line, offset) - { - offset /= _char_width; - for (var i = 0, l = line.length, offset_count = 0; i < l; i++) - { - offset_count += line[i] == "\t" - ? _tab_size - (offset_count % _tab_size) - : 1; - if (offset_count > offset) - return i; - } - return -1; - }; - - var _get_pixel_offset = function(line, char_offset) - { - for (var i = 0, offset_count = 0, char = ""; i < char_offset; i++) - { - char = line[i]; - if (char == "\n" || char == "\r") - continue; - - offset_count += char == "\t" - ? _tab_size - offset_count % _tab_size - : 1; - } - return offset_count * _char_width; - }; - - var _get_tab_size = function() - { - var style_dec = document.styleSheets.getDeclaration(".js-source-content div"); - return style_dec ? parseInt(style_dec.getPropertyValue("-o-tab-size")) : 0; - }; - - var _get_container_box = function() - { - if (_container) - _container_box = _container.getBoundingClientRect(); - }; - - /* event handlers */ - - var _onmousemove = function(event) - { - _last_move_event = event; - }; - - var _ontooltip = function(event, target) - { - if (!_poll_interval) - { - if (!_char_width) - _onmonospacefontchange(); - - var container = _view.get_scroll_container(); - if (container && target.parentNode) - { - _container = container; - _container_box = container.getBoundingClientRect(); - _tooltip_target_ele = target.parentNode; - _tooltip_target_ele.addEventListener("mousemove", _onmousemove, false); - while (_mouse_positions.length) - _mouse_positions.pop(); - - _total_x_offset = _container_box.left + _default_offset; - _win_selection = window.getSelection(); - _poll_interval = setInterval(_poll_position, POLL_INTERVAL); - } - } - }; - - var _onhide = function() - { - if (_poll_interval) - { - clearInterval(_poll_interval); - _clear_selection(); - _tooltip_target_ele.removeEventListener('mousemove', _onmousemove, false); - _poll_interval = 0; - _tooltip_target_ele = null; - _container_box = null; - _container = null; - _win_selection = null; - } - }; - - var _ontooltipenter = function(event) - { - _is_over_tooltip = true; - }; - - var _ontooltipleave = function(event) - { - _is_over_tooltip = false; - }; - - var _onmonospacefontchange = function(msg) - { - _char_width = defaults["js-source-char-width"]; - _line_height = defaults["js-source-line-height"]; - _tab_size = _get_tab_size(); - _default_offset = defaults["js-default-text-offset"]; - }; - - var _onkeydown = function(event) - { - if (event.keyCode == SHIFT_KEY) - _shift_key = true; - }; - - var _onkeyup = function(event) - { - if (event.keyCode == SHIFT_KEY) - _shift_key = false; - }; - - var _onbeforefilter = function(msg) - { - if (_tooltip_model && _tooltip_container) - { - var tmpl = window.templates.inspected_js_object(_tooltip_model, false, - null, msg.search_term); - _tooltip_container.clearAndRender(tmpl); - } - }; - - var _onmousedown = function(event, target) - { - _is_mouse_down = true; - _clear_selection(); - }; - - var _onmouseup = function(event) - { - _is_mouse_down = false; - }; - - var _onfocus = function(event, target) - { - _is_filter_focus = true; - }; - - var _onblur = function(event, target) - { - _is_filter_focus = false - }; - - var _oninput = function(event, target) - { - _filter.search_delayed(target.value); - }; - - var _init = function(view) - { - _view = view; - _tokenizer = new cls.SimpleJSParser(); - _tooltip = Tooltips.register(cls.JSSourceTooltip.tooltip_name, true, false, - ".js-tooltip-examine-container"); - _tooltip.ontooltip = _ontooltip; - _tooltip.onhide = _onhide; - _tooltip.ontooltipenter = _ontooltipenter; - _tooltip.ontooltipleave = _ontooltipleave; - _tagman = window.tagManager; - _esde = window.services["ecmascript-debugger"]; - _filter = new TextSearch(); - _filter_shortcuts_cb = cls.Helpers.shortcut_search_cb.bind(_filter); - window.event_handlers.input[FILTER_HANDLER] = _oninput; - window.event_handlers.focus[FILTER_HANDLER] = _onfocus; - window.event_handlers.blur[FILTER_HANDLER] = _onblur; - window.event_handlers.mousedown["scroll-js-source-view"] = _onmousedown; - _filter.add_listener("onbeforesearch", _onbeforefilter); - ActionBroker.get_instance().get_global_handler(). - register_shortcut_listener(FILTER_HANDLER, _filter_shortcuts_cb); - window.messages.addListener("monospace-font-changed", _onmonospacefontchange); - window.addEventListener("resize", _get_container_box, false); - document.addEventListener("keydown", _onkeydown, false); - document.addEventListener("keyup", _onkeyup, false); - document.addEventListener("mouseup", _onmouseup, false); - }; - - this.unregister = function() - { - Tooltips.unregister(cls.JSSourceTooltip.tooltip_name, _tooltip); - window.messages.removeListener("monospace-font-changed", _onmonospacefontchange); - window.removeEventListener('resize', _get_container_box, false); - }; - - _init(view); -}; - -cls.JSSourceTooltip.tooltip_name = "js-source"; +"use strict"; + +window.cls || (window.cls = {}); + +cls.JSSourceTooltip = function(view) +{ + var POLL_INTERVAL = 150; + var MAX = Math.max; + var MIN = Math.min; + var POW = Math.pow; + var MIN_RADIUS = 2; + var WHITESPACE = cls.SimpleJSParser.WHITESPACE; + var LINETERMINATOR = cls.SimpleJSParser.LINETERMINATOR; + var IDENTIFIER = cls.SimpleJSParser.IDENTIFIER; + var NUMBER = cls.SimpleJSParser.NUMBER; + var STRING = cls.SimpleJSParser.STRING; + var PUNCTUATOR = cls.SimpleJSParser.PUNCTUATOR; + var DIV_PUNCTUATOR = cls.SimpleJSParser.DIV_PUNCTUATOR; + var REG_EXP = cls.SimpleJSParser.REG_EXP; + var COMMENT = cls.SimpleJSParser.COMMENT; + var FORWARD = 1; + var BACKWARDS = -1; + var TYPE = 0; + var VALUE = 1; + var SHIFT_KEY = 16; + var TOOLTIP_NAME = cls.JSInspectionTooltip.tooltip_name; + var MAX_MOUSE_POS_COUNT = 2; + var FILTER_HANDLER = "js-tooltip-filter"; + + var _tooltip = null; + var _view = null; + var _tokenizer = null; + var _poll_interval = 0; + var _tooltip_target_ele = null; + var _last_move_event = null; + var _is_token_selected = false; + var _mouse_positions = []; + var _container = null; + var _container_box = null; + var _char_width = 0; + var _line_height = 0; + var _tab_size = 0; + var _default_offset = 10; + var _total_x_offset = 0; + var _last_poll = {}; + var _identifier = null; + var _identifier_boxes = []; + var _identifier_out_count = 0; + var _tagman = null; + var _esde = null; + var _is_over_tooltip = false; + var _win_selection = null; + var _last_script_text = ""; + var _shift_key = false; + var _filter = null; + var _filter_input = null; + var _tooltip_container = null; + var _tooltip_model = null; + var _filter_shortcuts_cb = null; + var _filter_config = {"handler": FILTER_HANDLER, + "shortcuts": FILTER_HANDLER, + "type": "filter", + "label": ui_strings.S_INPUT_DEFAULT_TEXT_FILTER, + "focus-handler": FILTER_HANDLER, + "blur-handler": FILTER_HANDLER}; + var _is_filter_focus = false; + var _is_mouse_down = false; + + var _poll_position = function() + { + if (!_last_move_event || + _is_over_tooltip || + !_win_selection || + _is_mouse_down || + (_filter && _is_filter_focus) || + CstSelect.is_active) + return; + + if (!_win_selection.isCollapsed && !_shift_key) + { + _clear_selection(); + return; + } + + if (_identifier) + { + if (_is_over_identifier_boxes(_last_move_event)) + { + _identifier_out_count = 0; + } + else + { + if (_identifier_out_count > 1) + _clear_selection(); + else + _identifier_out_count += 1; + } + } + + while (_mouse_positions.length > MAX_MOUSE_POS_COUNT) + _mouse_positions.shift(); + + _mouse_positions.push({x: _last_move_event.clientX, + y: _last_move_event.clientY}); + var center = _get_mouse_pos_center(); + if (center && center.r <= MIN_RADIUS) + { + var script = _view.get_current_script(); + if (script) + { + var offset_y = center.y - _container_box.top; + var line_number = _view.get_line_number_with_offset(offset_y); + var line = script.get_line(line_number); + var offset_x = center.x + _container.scrollLeft - _total_x_offset; + var char_offset = _get_char_offset(line, offset_x); + if (char_offset > -1 && + !(_last_poll.script == script && + _last_poll.line_number == line_number && + _last_poll.char_offset == char_offset && + _last_poll.shift_key == _shift_key)) + { + _last_poll.script = script; + _last_poll.line_number = line_number; + _last_poll.char_offset = char_offset; + _last_poll.center = center; + _last_poll.shift_key = _shift_key; + var line_count = Math.floor(offset_y / _line_height); + var box = + { + top: _container_box.top + line_count * _line_height, + bottom: _container_box.top + (line_count + 1) * _line_height, + mouse_x: Math.floor(center.x), + mouse_y: Math.floor(center.y) + }; + _handle_poll_position(script, line_number, char_offset, + box, _shift_key); + } + } + else + { + _clear_selection(); + } + } + }; + + var _handle_poll_position = function(script, line_number, char_offset, + box, shift_key) + { + var sel = _get_identifier(script, line_number, char_offset, shift_key); + if (sel) + { + var start = script.line_arr[sel.start_line - 1] + sel.start_offset; + var end = script.line_arr[sel.end_line - 1] + sel.end_offset; + var script_text = script.script_data.slice(start, end + 1); + + if (script_text != _last_script_text) + { + var rt_id = script.runtime_id; + var thread_id = 0; + var frame_index = 0; + _last_script_text = script_text; + var ex_ctx = window.runtimes.get_execution_context(); + if (ex_ctx.rt_id == rt_id) + { + thread_id = ex_ctx.thread_id; + frame_index = ex_ctx.frame_index; + } + var args = [script, line_number, char_offset, box, sel, rt_id, script_text]; + var tag = _tagman.set_callback(null, _handle_script, args); + var msg = [rt_id, thread_id, frame_index, script_text]; + _esde.requestEval(tag, msg); + } + } + }; + + var _handle_script = function(status, + message, + script, + line_number, + char_offset, + box, + selection, + rt_id, + script_text) + { + var STATUS = 0; + var TYPE = 1; + var VALUE = 2; + var OBJECT = 3; + var OBJECT_ID = 0; + var CLASS_NAME = 4; + + if (status === 0 && message[STATUS] == "completed") + { + _identifier = selection; + _identifier_out_count = 0; + _update_identifier_boxes(script, _identifier); + + if (selection.start_line != selection.end_line) + { + var line_count = selection.start_line - _view.getTopLine(); + if (line_count < 0) + line_count = 0; + + box.top = _container_box.top + line_count * _line_height; + var end_line = selection.end_line; + if (end_line > _view.getBottomLine()) + end_line = _view.getBottomLine(); + + line_count = selection.end_line - _view.getTopLine() + 1; + box.bottom = _container_box.top + line_count * _line_height; + var max_right = _get_max_right(); + box.left = _total_x_offset; + box.right = _total_x_offset + max_right - _container.scrollLeft; + } + + if (message[TYPE] == "object") + { + var object = message[OBJECT]; + var model = new cls.InspectableJSObject(rt_id, + object[OBJECT_ID], + "", + object[CLASS_NAME]); + _tooltip_model = model; + model.expand(function() + { + var tmpl = ["div", + ["h2", templates.default_filter(_filter_config), + ["span", object[CLASS_NAME], + "data-tooltip", TOOLTIP_NAME], + "data-id", String(model.id), + "obj-id", String(model.object_id), + "class", "js-tooltip-title"], + ["div", [window.templates.inspected_js_object(model, false)], + "class", "js-tooltip-examine-container mono"], + "class", "js-tooltip js-tooltip-examine"]; + var ele = _tooltip.show(tmpl, box); + if (ele) + { + _filter_input = ele.querySelector("input"); + _tooltip_container = ele.querySelector(".js-tooltip-examine-container"); + _filter.set_form_input(_filter_input); + _filter.set_container(_tooltip_container); + } + }); + } + else + { + var value = ""; + if (message[TYPE] == "null" || message[TYPE] == "undefined") + value = message[TYPE] + else if (message[TYPE] == "string") + value = "\"" + message[VALUE] + "\""; + else + value = message[VALUE]; + + var tmpl = ["div", + ["value", value, "class", message[TYPE]], + "class", "js-tooltip"]; + _tooltip.show(tmpl, box); + } + + var start_line = _identifier.start_line; + var start_offset = _identifier.start_offset; + var length = script_text.length; + + if (start_line < _view.getTopLine()) + { + if (_identifier.end_line < _view.getTopLine()) + return; + + start_line = _view.getTopLine(); + start_offset = 0; + var start = script.line_arr[start_line - 1]; + var end = script.line_arr[selection.end_line - 1] + selection.end_offset; + length = end + 1 - start; + } + + if (!_win_selection.isCollapsed) + _win_selection.collapseToStart() + + _view.higlight_slice(start_line, start_offset, length); + } + }; + + var _get_tokens_of_line = function(script, line_number) + { + var tokens = []; + if (script) + { + var line = script.get_line(line_number); + var start_state = script.state_arr[line_number - 1]; + + if (line) + { + _tokenizer.tokenize(line, function(token_type, token) + { + tokens.push([token_type, token]); + }, false, start_state); + } + } + return tokens; + }; + + var _get_identifier = function(script, line_number, char_offset, shift_key) + { + if (_win_selection.isCollapsed) + { + var tokens = _get_tokens_of_line(script, line_number); + + for (var i = 0, sum = 0; i < tokens.length; i++) + { + sum += tokens[i][VALUE].length; + if (sum > char_offset) + break; + } + + if ((tokens[i][TYPE] == IDENTIFIER && + (!window.js_keywords.hasOwnProperty(tokens[i][VALUE]) || + tokens[i][VALUE] == "this")) || + (tokens[i][TYPE] == PUNCTUATOR && + ((tokens[i][VALUE] == "[" || tokens[i][VALUE] == "]") || + (shift_key && (tokens[i][VALUE] == "(" || tokens[i][VALUE] == ")"))))) + { + var start = _get_identifier_chain_start(script, line_number, tokens, i, shift_key); + var end = _get_identifier_chain_end(script, line_number, tokens, i, shift_key); + return {start_line: start.start_line, + start_offset: start.start_offset, + end_line: end.end_line, + end_offset: end.end_offset}; + } + } + else + { + var range = _win_selection.getRangeAt(0); + if (document.documentElement.contains(_last_move_event.target) && + range.intersectsNode(_last_move_event.target)) + { + var start = _get_line_and_offset(range.startContainer, range.startOffset); + var end = _get_line_and_offset(range.endContainer, range.endOffset); + if (start && end) + return {start_line: start.line_number, + start_offset: start.offset, + end_line: end.line_number, + end_offset: end.offset - 1}; + } + } + + return null; + }; + + var _get_identifier_chain_start = function(script, line_number, tokens, + match_index, shift_key) + { + var start_line = line_number; + var bracket_count = 0; + var previous_token = tokens[match_index]; + var bracket_stack = []; + var parens_stack = []; + var index = match_index - 1; + + if (previous_token[VALUE] == "]") + bracket_stack.push(previous_token[VALUE]); + + if (shift_key && previous_token[VALUE] == ")") + parens_stack.push(previous_token[VALUE]); + + while (true) + { + for (var i = match_index - 1, token = null; token = tokens[i]; i--) + { + // consume everything between parentheses if shiftKey is pressed + if (shift_key && parens_stack.length) + { + if (token[TYPE] == PUNCTUATOR) + { + if (token[VALUE] == ")") + { + parens_stack.push(token[VALUE]) + previous_token = token; + } + if (token[VALUE] == "(") + { + parens_stack.pop(); + previous_token = token; + } + } + index = i - 1; + continue; + } + + switch (previous_token[TYPE]) + { + case IDENTIFIER: + { + switch (token[TYPE]) + { + case WHITESPACE: + case LINETERMINATOR: + case COMMENT: + { + continue; + } + case PUNCTUATOR: + { + if (token[VALUE] == ".") + { + previous_token = token; + index = i - 1; + continue; + } + if (token[VALUE] == "[" && bracket_stack.length) + { + bracket_stack.pop(); + previous_token = token; + index = i - 1; + continue; + } + } + } + break; + } + case PUNCTUATOR: + { + //previous_token[VALUE] is one of '.', '[', ']', '(', ')' + if (shift_key && token[VALUE] == ")") + { + parens_stack.push(token[VALUE]); + previous_token = token; + index = i - 1; + continue; + } + + if (previous_token[VALUE] == "." || previous_token[VALUE] == "[") + { + switch (token[TYPE]) + { + case WHITESPACE: + case LINETERMINATOR: + case COMMENT: + { + continue; + } + case IDENTIFIER: + { + previous_token = token; + index = i - 1; + continue; + } + case PUNCTUATOR: + { + if (token[VALUE] == "]") + { + bracket_stack.push(token[VALUE]); + previous_token = token; + index = i - 1; + continue; + } + } + } + } + else // must be "]" + { + switch (token[TYPE]) + { + case WHITESPACE: + case LINETERMINATOR: + case COMMENT: + { + continue; + } + case STRING: + case NUMBER: + case IDENTIFIER: + { + previous_token = token; + index = i - 1; + continue; + } + case PUNCTUATOR: + { + if (token[VALUE] == "]") + { + bracket_stack.push(token[VALUE]); + previous_token = token; + index = i - 1; + continue; + } + } + } + } + break; + } + case STRING: + case NUMBER: + { + switch (token[TYPE]) + { + case WHITESPACE: + case LINETERMINATOR: + case COMMENT: + { + continue; + } + case PUNCTUATOR: + { + if (token[VALUE] == "[") + { + bracket_stack.pop(); + previous_token = token; + index = i - 1; + continue; + } + } + } + break; + } + } + break; + } + + if (i == -1) + { + var new_tokens = _get_tokens_of_line(script, start_line - 1); + + if (new_tokens.length) + { + start_line--; + match_index = new_tokens.length; + index += match_index; + tokens = new_tokens.extend(tokens); + } + else + break; + } + else + break; + } + + if (tokens[index + 1][TYPE] == PUNCTUATOR && tokens[index + 1][VALUE] == ".") + index++; + + while (true) + { + var nl_index = _get_index_of_newline(tokens); + if (nl_index > -1 && nl_index <= index) + { + index -= tokens.splice(0, nl_index + 1).length; + start_line++; + } + else + break + } + + return {start_line: start_line, start_offset: _get_sum(tokens, index)}; + }; + + var _get_identifier_chain_end = function(script, line_number, tokens, + match_index, shift_key) + { + var start_line = line_number; + var bracket_count = 0; + var previous_token = tokens[match_index]; + var bracket_stack = []; + var parens_stack = []; + var index = match_index; + + if (previous_token[VALUE] == "[") + bracket_stack.push(previous_token[VALUE]); + + if (shift_key && previous_token[VALUE] == "(") + parens_stack.push(previous_token[VALUE]); + + while (bracket_stack.length || (shift_key && parens_stack.length)) + { + for (var i = match_index + 1, token = null; token = tokens[i]; i++) + { + // consume everything between parentheses if shiftKey is pressed + if (shift_key && parens_stack.length) + { + if (token[TYPE] == PUNCTUATOR) + { + if (token[VALUE] == "(") + { + parens_stack.push(token[VALUE]) + previous_token = token; + } + if (token[VALUE] == ")") + { + parens_stack.pop(); + previous_token = token; + } + } + index = i; + continue; + } + + if (!bracket_stack.length) + break; + + switch (previous_token[TYPE]) + { + case IDENTIFIER: + { + switch (token[TYPE]) + { + case WHITESPACE: + case LINETERMINATOR: + case COMMENT: + { + continue; + } + case PUNCTUATOR: + { + if (token[VALUE] == ".") + { + previous_token = token; + index = i; + continue; + } + if (token[VALUE] == "]") + { + bracket_stack.pop(); + previous_token = token; + index = i; + continue; + } + if (token[VALUE] == "[") + { + bracket_stack.push(token[VALUE]); + previous_token = token; + index = i; + continue; + } + } + } + break; + } + case PUNCTUATOR: + { + if (previous_token[VALUE] == "]") + { + switch (token[TYPE]) + { + case WHITESPACE: + case LINETERMINATOR: + case COMMENT: + { + continue; + } + case PUNCTUATOR: + { + if (token[VALUE] == ".") + { + previous_token = token; + index = i - 1; + continue; + } + if (token[VALUE] == "]" && bracket_stack.length) + { + bracket_stack.pop(); + previous_token = token; + index = i; + continue; + } + } + } + } + else if (previous_token[VALUE] == "[") + { + switch (token[TYPE]) + { + case WHITESPACE: + case LINETERMINATOR: + case COMMENT: + { + continue; + } + case STRING: + case NUMBER: + case IDENTIFIER: + { + previous_token = token; + index = i; + continue; + } + } + } + else // must be "." + { + switch (token[TYPE]) + { + case WHITESPACE: + case LINETERMINATOR: + case COMMENT: + { + continue; + } + case IDENTIFIER: + { + previous_token = token; + index = i; + continue; + } + } + } + break; + } + case STRING: + case NUMBER: + { + switch (token[TYPE]) + { + case WHITESPACE: + case LINETERMINATOR: + case COMMENT: + { + continue; + } + case PUNCTUATOR: + { + if (token[VALUE] == "]") + { + bracket_stack.pop(); + previous_token = token; + index = i; + continue; + } + } + } + break; + } + } + } + + if (i == tokens.length && bracket_stack.length) + { + start_line++; + var new_tokens = _get_tokens_of_line(script, start_line); + + if (new_tokens.length) + { + match_index = i; + tokens.extend(new_tokens); + } + else + break; + } + else + break; + } + + while (true) + { + var nl_index = _get_index_of_newline(tokens); + if (nl_index > -1 && nl_index <= index) + index -= tokens.splice(0, nl_index + 1).length; + else + break + } + + return {end_line: start_line, end_offset: _get_sum(tokens, index) - 1}; + }; + + var _get_line_and_offset = function(node, offset) + { + var line_ele = node.parentNode.has_attr("parent-node-chain", "data-line-number"); + if (line_ele) + { + var ctx = {target_node: node, sum: offset, is_found: false}; + return {line_number: parseInt(line_ele.getAttribute("data-line-number")), + offset: _walk_dom(ctx, line_ele).sum}; + } + return null; + }; + + var _walk_dom = function(ctx, node) + { + // ctx.target_node, ctx.sum, ctx.is_found + while (!ctx.is_found && node) + { + if (node.nodeType == Node.ELEMENT_NODE) + _walk_dom(ctx, node.firstChild); + + if (node.nodeType == Node.TEXT_NODE) + { + if (node == ctx.target_node) + ctx.is_found = true; + else + ctx.sum += node.nodeValue.length; + } + node = node.nextSibling; + } + return ctx; + }; + + var _get_max_right = function() + { + return Math.max.apply(null, _identifier_boxes.map(function(box) + { + return box.right; + })); + }; + + var _get_index_of_newline = function(tokens) + { + for (var i = 0, token; token = tokens[i]; i++) + { + if (token[TYPE] == LINETERMINATOR) + return i; + } + return -1; + }; + + var _get_sum = function(tokens, index) + { + for (var i = 0, sum = 0; i <= index; i++) + sum += tokens[i][VALUE].length; + + return sum; + }; + + var _get_mouse_pos_center = function() + { + var center = null; + if (_mouse_positions.length > 2) + { + var min_x = MIN(_mouse_positions[0].x, + _mouse_positions[1].x, + _mouse_positions[2].x); + var max_x = MAX(_mouse_positions[0].x, + _mouse_positions[1].x, + _mouse_positions[2].x); + var min_y = MIN(_mouse_positions[0].y, + _mouse_positions[1].y, + _mouse_positions[2].y); + var max_y = MAX(_mouse_positions[0].y, + _mouse_positions[1].y, + _mouse_positions[2].y); + var dx = max_x - min_x; + var dy = max_y - min_y; + + center = {x: min_x + dx / 2, + y: min_y + dy / 2, + r: POW(POW(dx / 2, 2) + POW(dy / 2, 2), 0.5)}; + } + return center; + }; + + var _update_identifier_boxes = function(script, identifier) + { + // translates the current selected identifier to dimension boxes + // position and dimensions are absolute to the source text + var line_number = _identifier.start_line; + + var start_offset = _identifier.start_offset; + var end_offset = 0; + _identifier_boxes = []; + while (true) + { + var box = {}; + var line = script.get_line(line_number); + box.left = _get_pixel_offset(line, start_offset); + if (line_number < _identifier.end_line) + box.right = _get_pixel_offset(line, line.length + 1); + else + box.right = _get_pixel_offset(line, _identifier.end_offset + 1); + box.top = (line_number - 1) * _line_height; + box.bottom = line_number * _line_height; + _identifier_boxes.push(box); + if (line_number == _identifier.end_line || + line_number >= script.line_arr.length) + break; + else + line_number += 1; + start_offset = 0; + } + }; + + var _is_over_identifier_boxes = function(event) + { + var off_x = _total_x_offset - _container.scrollLeft; + var off_y = _container_box.top - (_view.getTopLine() - 1) * _line_height; + var e_x = event.clientX - off_x; + var e_y = event.clientY - off_y; + + for (var i = 0, box; box = _identifier_boxes[i]; i++) + { + if (e_x >= box.left && e_x <= box.right && + e_y >= box.top && e_y <= box.bottom) + return true; + } + return false; + }; + + var _clear_selection = function() + { + _identifier = null; + _last_script_text = ""; + _last_poll = {}; + _view.higlight_slice(); + _tooltip.hide(); + _filter.set_search_term(""); + _filter.cleanup(); + _is_filter_focus = false; + _tooltip_model = null; + _tooltip_container = null; + + }; + + var _get_char_offset = function(line, offset) + { + offset /= _char_width; + for (var i = 0, l = line.length, offset_count = 0; i < l; i++) + { + offset_count += line[i] == "\t" + ? _tab_size - (offset_count % _tab_size) + : 1; + if (offset_count > offset) + return i; + } + return -1; + }; + + var _get_pixel_offset = function(line, char_offset) + { + for (var i = 0, offset_count = 0, char = ""; i < char_offset; i++) + { + char = line[i]; + if (char == "\n" || char == "\r") + continue; + + offset_count += char == "\t" + ? _tab_size - offset_count % _tab_size + : 1; + } + return offset_count * _char_width; + }; + + var _get_tab_size = function() + { + var style_dec = document.styleSheets.getDeclaration(".js-source-content div"); + return style_dec ? parseInt(style_dec.getPropertyValue("-o-tab-size")) : 0; + }; + + var _get_container_box = function() + { + if (_container) + _container_box = _container.getBoundingClientRect(); + }; + + /* event handlers */ + + var _onmousemove = function(event) + { + _last_move_event = event; + }; + + var _ontooltip = function(event, target) + { + if (!_poll_interval) + { + if (!_char_width) + _onmonospacefontchange(); + + var container = _view.get_scroll_container(); + if (container && target.parentNode) + { + _container = container; + _container_box = container.getBoundingClientRect(); + _tooltip_target_ele = target.parentNode; + _tooltip_target_ele.addEventListener("mousemove", _onmousemove, false); + while (_mouse_positions.length) + _mouse_positions.pop(); + + _total_x_offset = _container_box.left + _default_offset; + _win_selection = window.getSelection(); + _poll_interval = setInterval(_poll_position, POLL_INTERVAL); + } + } + }; + + var _onhide = function() + { + if (_poll_interval) + { + clearInterval(_poll_interval); + _clear_selection(); + _tooltip_target_ele.removeEventListener('mousemove', _onmousemove, false); + _poll_interval = 0; + _tooltip_target_ele = null; + _container_box = null; + _container = null; + _win_selection = null; + } + }; + + var _ontooltipenter = function(event) + { + _is_over_tooltip = true; + }; + + var _ontooltipleave = function(event) + { + _is_over_tooltip = false; + }; + + var _onmonospacefontchange = function(msg) + { + _char_width = defaults["js-source-char-width"]; + _line_height = defaults["js-source-line-height"]; + _tab_size = _get_tab_size(); + _default_offset = defaults["js-default-text-offset"]; + }; + + var _onkeydown = function(event) + { + if (event.keyCode == SHIFT_KEY) + _shift_key = true; + }; + + var _onkeyup = function(event) + { + if (event.keyCode == SHIFT_KEY) + _shift_key = false; + }; + + var _onbeforefilter = function(msg) + { + if (_tooltip_model && _tooltip_container) + { + var tmpl = window.templates.inspected_js_object(_tooltip_model, false, + null, msg.search_term); + _tooltip_container.clearAndRender(tmpl); + } + }; + + var _onmousedown = function(event, target) + { + _is_mouse_down = true; + _clear_selection(); + }; + + var _onmouseup = function(event) + { + _is_mouse_down = false; + }; + + var _onfocus = function(event, target) + { + _is_filter_focus = true; + }; + + var _onblur = function(event, target) + { + _is_filter_focus = false + }; + + var _oninput = function(event, target) + { + _filter.search_delayed(target.value); + }; + + var _init = function(view) + { + _view = view; + _tokenizer = new cls.SimpleJSParser(); + _tooltip = Tooltips.register(cls.JSSourceTooltip.tooltip_name, true, false, + ".js-tooltip-examine-container"); + _tooltip.ontooltip = _ontooltip; + _tooltip.onhide = _onhide; + _tooltip.ontooltipenter = _ontooltipenter; + _tooltip.ontooltipleave = _ontooltipleave; + _tagman = window.tagManager; + _esde = window.services["ecmascript-debugger"]; + _filter = new TextSearch(); + _filter_shortcuts_cb = cls.Helpers.shortcut_search_cb.bind(_filter); + window.event_handlers.input[FILTER_HANDLER] = _oninput; + window.event_handlers.focus[FILTER_HANDLER] = _onfocus; + window.event_handlers.blur[FILTER_HANDLER] = _onblur; + window.event_handlers.mousedown["scroll-js-source-view"] = _onmousedown; + _filter.add_listener("onbeforesearch", _onbeforefilter); + ActionBroker.get_instance().get_global_handler(). + register_shortcut_listener(FILTER_HANDLER, _filter_shortcuts_cb); + window.messages.addListener("monospace-font-changed", _onmonospacefontchange); + window.addEventListener("resize", _get_container_box, false); + document.addEventListener("keydown", _onkeydown, false); + document.addEventListener("keyup", _onkeyup, false); + document.addEventListener("mouseup", _onmouseup, false); + }; + + this.unregister = function() + { + Tooltips.unregister(cls.JSSourceTooltip.tooltip_name, _tooltip); + window.messages.removeListener("monospace-font-changed", _onmonospacefontchange); + window.removeEventListener('resize', _get_container_box, false); + }; + + _init(view); +}; + +cls.JSSourceTooltip.tooltip_name = "js-source"; diff --git a/src/ecma-debugger/stop_at.js b/src/ecma-debugger/stop_at.js index c9deb65e3..f103d0d5d 100644 --- a/src/ecma-debugger/stop_at.js +++ b/src/ecma-debugger/stop_at.js @@ -1,638 +1,638 @@ -window.cls || (window.cls = {}); -cls.EcmascriptDebugger || (cls.EcmascriptDebugger = {}); -cls.EcmascriptDebugger["6.0"] || (cls.EcmascriptDebugger["6.0"] = {}); - -/** - * @constructor - */ - -cls.EcmascriptDebugger["6.0"].StopAt = function() -{ - - /** - * two layers are needed. - * stop_at script must be enabled allways to be able to reasign breakpoints. - */ - - var stop_at_settings = - { - script: 1, - exception: 0, - error: 0, - abort: 0, - gc: 0, - debugger_statement: 1, - reformat_javascript: 1, - use_reformat_condition: 1, - } - - var stop_at_id_map = - { - script: 0, - exception: 1, - error: 2, - abort: 3, - gc: 4, - debugger_statement: 5, - reformat_javascript: 6, - use_reformat_condition: 7, - } - - var requires_version_map = - { - "6": [6, 13], - "7": [6, 13], - }; - - var reformat_condition = - [ - "var MAX_SLICE = 5000;", - "var LIMIT = 11;", - "var re = /\\s+/g;", - "var ws = 0;", - "var m = null;", - "var src = scriptData.slice(0, MAX_SLICE);", - "while (m = re.exec(src))", - " ws += m[0].length;", - "", - "return (100 * ws / src.length) < LIMIT;", - ].join(""); - - var self = this; - - var ecma_debugger = window.services['ecmascript-debugger']; - - var stopAt = {}; // there can be only one stop at at the time - - var runtime_id = ''; - - var callstack = []; - var return_values = {}; - - var __script_ids_in_callstack = []; - - var __controls_enabled = false; - - var __is_stopped = false; - - var __stopAtId = 1; - - var __selected_frame_index = -1; - - var cur_inspection_type = ''; - - var getStopAtId = function() - { - return __stopAtId++; - } - - var _is_initial_settings_set = false; - - var onSettingChange = function(msg) - { - if(msg.id == 'js_source' ) - { - var key = msg.key; - var value = settings['js_source'].get(key); - stop_at_settings[key] = value; - var message = get_config_msg(); - ecma_debugger.requestSetConfiguration(cls.TagManager.IGNORE_RESPONSE, message); - - if (msg.key == 'reformat_javascript') - { - new ConfirmDialog(ui_strings.D_REFORMAT_SCRIPTS, - function() { window.runtimes.reloadWindow(); }).show(); - } - } - }; - - var get_config_msg = function() - { - var config_arr = []; - for (var prop in stop_at_settings) - { - var index = stop_at_id_map[prop]; - var depending = requires_version_map[index]; - if (depending && !ecma_debugger.satisfies_version.apply(ecma_debugger, depending)) - continue; - - if (prop == "script") - config_arr[index] = 1; - else if (prop == "use_reformat_condition") - config_arr[index] = stop_at_settings[prop] ? reformat_condition : ""; - else - config_arr[index] = stop_at_settings[prop] ? 1 : 0; - } - return config_arr; - }; - - this.getRuntimeId = function() - { - return runtime_id; - } - - - this.getControlsEnabled = function() - { - return __controls_enabled; - } - - this.__defineGetter__("is_stopped", function() - { - return __is_stopped; - }); - - this.__defineSetter__("is_stopped", function(){}); - - this.getFrames = function() - { - return callstack; // should be copied - } - - this.get_return_values = function() - { - return return_values; - }; - - this.get_script_ids_in_callstack = function() - { - return __script_ids_in_callstack; - }; - - this.getFrame = function(id) - { - return callstack[id]; - } - - this.getThreadId = function() - { - return stopAt && stopAt.thread_id || ''; - } - - /** - * To get the selected frame index. - * It can return -1 which means that no frame is selected. - * Be aware that -1 is not a valid value in e.g. the Eval command. - * 0 for frame index has an overloaded meaning: if the thread id is not 0 - * it means the top frame, otherwise it means no frame. - */ - this.getSelectedFrameIndex = function() - { - return __selected_frame_index; - } - - /** - * To get the selected frame. - * @returns null or an object with runtime_id, scope_id, thread_id and index. - */ - this.getSelectedFrame = function() - { - if (__selected_frame_index > -1) - { - var frame = callstack[__selected_frame_index]; - return ( - { - runtime_id: frame.rt_id, - scope_id: frame.scope_id, - thread_id: stopAt.thread_id, - index: __selected_frame_index, - argument_id: frame.argument_id, - scope_list: frame.scope_list - }); - } - return null; - } - - var parseBacktrace = function(status, message, stop_at) - { - const - FRAME_LIST = 0, - // sub message BacktraceFrame - FUNCTION_ID = 0, - ARGUMENT_OBJECT = 1, - VARIABLE_OBJECT = 2, - THIS_OBJECT = 3, - OBJECT_VALUE = 4, - SCRIPT_ID = 5, - LINE_NUMBER = 6, - // sub message ObjectValue - OBJECT_ID = 0, - NAME = 5, - SCOPE_LIST = 7, - ARGUMENT_VALUE = 8, - THIS_VALUE = 9; - - if (status) - { - opera.postError("parseBacktrace failed scope message: " + message); - } - else - { - var _frames = message[FRAME_LIST], frame = null, i = 0; - var fn_name = '', line = '', script_id = '', argument_id = '', scope_id = ''; - var _frames_length = _frames.length; - var is_all_frames = _frames_length <= ini.max_frames; - var line_number = 0; - callstack = []; - __script_ids_in_callstack = []; - for( ; frame = _frames[i]; i++ ) - { - line_number = frame[LINE_NUMBER]; - // workaround for CORE-37771 and CORE-37798 - // line number of the top frame is sometime off by one or two lines - if (!i && typeof stop_at.line_number == 'number' && - Math.abs(line_number - stop_at.line_number) < 3) - { - line_number = stop_at.line_number; - } - callstack[i] = - { - fn_name : is_all_frames && i == _frames_length - 1 - ? ui_strings.S_GLOBAL_SCOPE_NAME - : frame[OBJECT_VALUE] && frame[OBJECT_VALUE][NAME] || - ui_strings.S_ANONYMOUS_FUNCTION_NAME, - line : line_number, - script_id : frame[SCRIPT_ID], - argument_id : frame[ARGUMENT_OBJECT], - scope_id : frame[VARIABLE_OBJECT], - this_id : frame[THIS_OBJECT], - id: i, - rt_id: stop_at.runtime_id, - scope_list: frame[SCOPE_LIST], - argument_value: frame[ARGUMENT_VALUE], - this_value: frame[THIS_VALUE], - } - __script_ids_in_callstack[i] = frame[SCRIPT_ID]; - } - - var backtrace_frame_list = new cls.EcmascriptDebugger["6.14"].BacktraceFrameList(message); - var return_value_list = backtrace_frame_list && backtrace_frame_list.returnValueList; - if (return_value_list) - { - return_values = { - rt_id: stop_at.runtime_id, - return_value_list: return_value_list - }; - } - - if( cur_inspection_type != 'frame' ) - { - messages.post('active-inspection-type', {inspection_type: 'frame'}); - } - messages.post('frame-selected', {frame_index: 0}); - views["callstack"].update(); - views["return-values"].update(); - if (!views.js_source.isvisible()) - { - topCell.showView(views.js_source.id); - } - var top_frame = callstack[0]; - if (views.js_source.showLine(top_frame.script_id, top_frame.line)) - { - runtimes.setSelectedScript(top_frame.script_id); - views.js_source.showLinePointer(top_frame.line, true); - } - toolbars.js_source.enableButtons('continue'); - messages.post('thread-stopped-event', {stop_at: stop_at}); - messages.post('host-state', {state: 'waiting'}); - setTimeout(function(){ __controls_enabled = true;}, 50); - } - } - - this.setInitialSettings = function() - { - if (!_is_initial_settings_set) - { - for (var prop in stop_at_settings) - { - var value = window.settings['js_source'].get(prop); - if (typeof value == "boolean") - stop_at_settings[prop] = value; - } - var msg = get_config_msg(); - ecma_debugger.requestSetConfiguration(cls.TagManager.IGNORE_RESPONSE, msg); - _is_initial_settings_set = true; - } - }; - - this.__continue = function (mode, clear_disabled_state) // - { - var tag = tag_manager.set_callback(this, - this._handle_continue, - [mode, clear_disabled_state]); - var msg = [stopAt.runtime_id, stopAt.thread_id, mode]; - services['ecmascript-debugger'].requestContinueThread(tag, msg); - } - - this.continue_thread = function (mode) // - { - if (__controls_enabled) - { - this.__continue(mode, true); - } - } - - this._handle_continue = function(status, message, mode, clear_disabled_state) - { - this._clear_stop_at_error(); - callstack = []; - return_values = {}; - __script_ids_in_callstack = []; - runtimes.setObserve(stopAt.runtime_id, mode != 'run'); - messages.post('frame-selected', {frame_index: -1}); - messages.post('thread-continue-event', {stop_at: stopAt}); - if (clear_disabled_state) - { - __controls_enabled = false; - __is_stopped = false; - toolbars.js_source.disableButtons('continue'); - } - messages.post('host-state', {state: 'ready'}); - window.views["return-values"].update(); - } - - this.on_thread_cancelled = function(message) - { - const THREAD_ID = 1; - if (message[THREAD_ID] == stopAt.thread_id) - { - this._clear_stop_at_error(); - callstack = []; - return_values = {}; - __script_ids_in_callstack = []; - messages.post('frame-selected', {frame_index: -1}); - __controls_enabled = false; - __is_stopped = false; - toolbars.js_source.disableButtons('continue'); - messages.post('host-state', {state: 'ready'}); - } - }; - - this.handle = function(message) - { - const - RUNTIME_ID = 0, - THREAD_ID = 1, - SCRIPT_ID = 2, - LINE_NUMBER = 3, - STOPPED_REASON = 4, - BREAKPOINT_ID = 5, - EXCEPTION_VALUE = 6, - OBJECT_VALUE = 3, - OBJECT_ID = 0; - - stopAt = - { - runtime_id: message[RUNTIME_ID], - thread_id: message[THREAD_ID], - script_id: message[SCRIPT_ID], - line_number: message[LINE_NUMBER], - stopped_reason: message[STOPPED_REASON], - breakpoint_id: message[BREAKPOINT_ID] - }; - - if (message[EXCEPTION_VALUE]) - { - var error_obj_id = message[EXCEPTION_VALUE] && - message[EXCEPTION_VALUE][OBJECT_VALUE] && - message[EXCEPTION_VALUE][OBJECT_VALUE][OBJECT_ID]; - if (error_obj_id) - { - stopAt.error = message[EXCEPTION_VALUE]; - stopAt.error_obj_id = error_obj_id; - } - } - - var line = stopAt.line_number; - if (typeof line == 'number') - { - /** - * This event is enabled by default to reassign breakpoints. - * Here it must be checked if the user likes actually to stop or not. - * At the moment this is a hack because the stop reason is not set for that case. - * The check is if the stop reason is 'unknown' (should be 'new script') - * - * In version 6.6 and higher the stop reason is 'new script'. - */ - if (stopAt.stopped_reason == 'unknown' || - stopAt.stopped_reason == 'new script') - { - runtime_id = stopAt.runtime_id; - if (settings['js_source'].get('script') - || runtimes.getObserve(runtime_id) - // this is a workaround for Bug 328220 - // if there is a breakpoint at the first statement of a script - // the event for stop at new script and the stop at breakpoint are the same - || this._bps.script_has_breakpoint_on_line(stopAt.script_id, line)) - { - this._stop_in_script(stopAt); - } - else - { - this.__continue('run'); - } - } - else - { - /* - example - - "runtime_id":2, - "thread_id":7, - "script_id":3068, - "line_number":8, - "stopped_reason":"breakpoint", - "breakpoint_id":1 - - */ - var condition = this._bps.get_condition(stopAt.breakpoint_id); - if (condition) - { - var tag = tagManager.set_callback(this, - this._handle_condition, - [stopAt]); - var msg = [stopAt.runtime_id, - stopAt.thread_id, - 0, - "Boolean(" + condition + ")", - [['dummy', 0]]]; - services['ecmascript-debugger'].requestEval(tag, msg); - } - else - { - this._stop_in_script(stopAt); - } - } - } - else - { - opera.postError('not a line number: ' + stopAt.line_number + '\n' + - JSON.stringify(stopAt)) - } - } - - this._handle_condition = function(status, message, stop_at) - { - const STATUS = 0, TYPE = 1, VALUE = 2; - if (status) - { - opera.postError('Evaling breakpoint condition failed'); - this.__continue('run'); - } - else if(message[STATUS] == "completed" && - message[TYPE] == "boolean" && - message[VALUE] == "true") - { - this._stop_in_script(stop_at); - } - else - { - this.__continue('run'); - } - }; - - this._handle_error = function(status, message, stop_at) - { - if (status) - { - opera.postError(ui_strings.S_DRAGONFLY_INFO_MESSAGE + - " error inspection failed in StopAt handle_error"); - } - else - { - const - OBJECT_CHAIN_LIST = 0, - OBJECT_LIST = 0, - OBJECT_VALUE = 0, - CLASS_NAME = 4, - PROPERTY_LIST = 1, - OBJECT_ID = 0, - PROP_OBJECT_VALUE = 3, - NAME = 0, - STRING = 2; - - var error = message && - (message = message[OBJECT_CHAIN_LIST]) && - (message = message[0]) && - (message = message[OBJECT_LIST]) && - message[0]; - if (error) - { - stop_at.error_class = error[OBJECT_VALUE] && - error[OBJECT_VALUE][CLASS_NAME] || "Error"; - var props = error[PROPERTY_LIST]; - if (props) - { - for (var i = 0, prop; prop = props[i]; i++) - { - if (prop[NAME] == "message") - stop_at.error_message = prop[STRING]; - } - } - - var script = window.runtimes.getScript(stop_at.script_id); - if (script) - { - script.stop_at_error = stop_at; - window.views.js_source.show_stop_at_error(); - } - } - } - }; - - this._clear_stop_at_error = function() - { - if (stopAt.error) - { - var script = window.runtimes.getScript(stopAt.script_id); - if (script) - script.stop_at_error = null; - window.views.js_source.clear_stop_at_error(); - } - }; - - this._stop_in_script = function(stop_at) - { - __is_stopped = true; - var tag = tagManager.set_callback(null, parseBacktrace, [stop_at]); - var msg = [stop_at.runtime_id, stop_at.thread_id, ini.max_frames]; - services['ecmascript-debugger'].requestGetBacktrace(tag, msg); - if (stop_at.error) - { - var tag = tagManager.set_callback(this, this._handle_error, [stop_at]); - var msg = [stop_at.runtime_id, [stop_at.error_obj_id], 0, 0, 0]; - window.services['ecmascript-debugger'].requestExamineObjects(tag, msg); - } - } - - var onRuntimeDestroyed = function(msg) - { - if( stopAt && stopAt.runtime_id == msg.id ) - { - views.callstack.clearView(); - views.inspection.clearView(); - self.__continue('run'); - } - - }; - - this._on_profile_disabled = function(msg) - { - if (msg.profile == window.app.profiles.DEFAULT) - { - this._clear_stop_at_error(); - callstack = []; - __script_ids_in_callstack = []; - window.views.js_source.clearLinePointer(); - window.views.callstack.clearView(); - window.views.inspection.clearView(); - window.messages.post('frame-selected', {frame_index: -1}); - window.messages.post('thread-continue-event', {stop_at: stopAt}); - __controls_enabled = false; - __is_stopped = false; - window.toolbars.js_source.disableButtons('continue'); - window.messages.post('host-state', {state: 'ready'}); - } - }; - - messages.addListener('runtime-destroyed', onRuntimeDestroyed); - messages.addListener('profile-disabled', this._on_profile_disabled.bind(this)); - - var onActiveInspectionType = function(msg) - { - cur_inspection_type = msg.inspection_type; - } - - var onFrameSelected = function(msg) - { - __selected_frame_index = msg.frame_index; - } - - this._bps = cls.Breakpoints.get_instance(); - - messages.addListener('active-inspection-type', onActiveInspectionType); - - - - messages.addListener('setting-changed', onSettingChange); - messages.addListener('frame-selected', onFrameSelected); - - this.bind = function(ecma_debugger) - { - var self = this; - - ecma_debugger.handleSetConfiguration = - ecma_debugger.handleContinueThread = - function(status, message){}; - - - ecma_debugger.addListener('enable-success', function() - { - self.setInitialSettings(); - }); - } - - this._bps = window.cls.Breakpoints.get_instance(); - - -} +window.cls || (window.cls = {}); +cls.EcmascriptDebugger || (cls.EcmascriptDebugger = {}); +cls.EcmascriptDebugger["6.0"] || (cls.EcmascriptDebugger["6.0"] = {}); + +/** + * @constructor + */ + +cls.EcmascriptDebugger["6.0"].StopAt = function() +{ + + /** + * two layers are needed. + * stop_at script must be enabled allways to be able to reasign breakpoints. + */ + + var stop_at_settings = + { + script: 1, + exception: 0, + error: 0, + abort: 0, + gc: 0, + debugger_statement: 1, + reformat_javascript: 1, + use_reformat_condition: 1, + } + + var stop_at_id_map = + { + script: 0, + exception: 1, + error: 2, + abort: 3, + gc: 4, + debugger_statement: 5, + reformat_javascript: 6, + use_reformat_condition: 7, + } + + var requires_version_map = + { + "6": [6, 13], + "7": [6, 13], + }; + + var reformat_condition = + [ + "var MAX_SLICE = 5000;", + "var LIMIT = 11;", + "var re = /\\s+/g;", + "var ws = 0;", + "var m = null;", + "var src = scriptData.slice(0, MAX_SLICE);", + "while (m = re.exec(src))", + " ws += m[0].length;", + "", + "return (100 * ws / src.length) < LIMIT;", + ].join(""); + + var self = this; + + var ecma_debugger = window.services['ecmascript-debugger']; + + var stopAt = {}; // there can be only one stop at at the time + + var runtime_id = ''; + + var callstack = []; + var return_values = {}; + + var __script_ids_in_callstack = []; + + var __controls_enabled = false; + + var __is_stopped = false; + + var __stopAtId = 1; + + var __selected_frame_index = -1; + + var cur_inspection_type = ''; + + var getStopAtId = function() + { + return __stopAtId++; + } + + var _is_initial_settings_set = false; + + var onSettingChange = function(msg) + { + if(msg.id == 'js_source' ) + { + var key = msg.key; + var value = settings['js_source'].get(key); + stop_at_settings[key] = value; + var message = get_config_msg(); + ecma_debugger.requestSetConfiguration(cls.TagManager.IGNORE_RESPONSE, message); + + if (msg.key == 'reformat_javascript') + { + new ConfirmDialog(ui_strings.D_REFORMAT_SCRIPTS, + function() { window.runtimes.reloadWindow(); }).show(); + } + } + }; + + var get_config_msg = function() + { + var config_arr = []; + for (var prop in stop_at_settings) + { + var index = stop_at_id_map[prop]; + var depending = requires_version_map[index]; + if (depending && !ecma_debugger.satisfies_version.apply(ecma_debugger, depending)) + continue; + + if (prop == "script") + config_arr[index] = 1; + else if (prop == "use_reformat_condition") + config_arr[index] = stop_at_settings[prop] ? reformat_condition : ""; + else + config_arr[index] = stop_at_settings[prop] ? 1 : 0; + } + return config_arr; + }; + + this.getRuntimeId = function() + { + return runtime_id; + } + + + this.getControlsEnabled = function() + { + return __controls_enabled; + } + + this.__defineGetter__("is_stopped", function() + { + return __is_stopped; + }); + + this.__defineSetter__("is_stopped", function(){}); + + this.getFrames = function() + { + return callstack; // should be copied + } + + this.get_return_values = function() + { + return return_values; + }; + + this.get_script_ids_in_callstack = function() + { + return __script_ids_in_callstack; + }; + + this.getFrame = function(id) + { + return callstack[id]; + } + + this.getThreadId = function() + { + return stopAt && stopAt.thread_id || ''; + } + + /** + * To get the selected frame index. + * It can return -1 which means that no frame is selected. + * Be aware that -1 is not a valid value in e.g. the Eval command. + * 0 for frame index has an overloaded meaning: if the thread id is not 0 + * it means the top frame, otherwise it means no frame. + */ + this.getSelectedFrameIndex = function() + { + return __selected_frame_index; + } + + /** + * To get the selected frame. + * @returns null or an object with runtime_id, scope_id, thread_id and index. + */ + this.getSelectedFrame = function() + { + if (__selected_frame_index > -1) + { + var frame = callstack[__selected_frame_index]; + return ( + { + runtime_id: frame.rt_id, + scope_id: frame.scope_id, + thread_id: stopAt.thread_id, + index: __selected_frame_index, + argument_id: frame.argument_id, + scope_list: frame.scope_list + }); + } + return null; + } + + var parseBacktrace = function(status, message, stop_at) + { + const + FRAME_LIST = 0, + // sub message BacktraceFrame + FUNCTION_ID = 0, + ARGUMENT_OBJECT = 1, + VARIABLE_OBJECT = 2, + THIS_OBJECT = 3, + OBJECT_VALUE = 4, + SCRIPT_ID = 5, + LINE_NUMBER = 6, + // sub message ObjectValue + OBJECT_ID = 0, + NAME = 5, + SCOPE_LIST = 7, + ARGUMENT_VALUE = 8, + THIS_VALUE = 9; + + if (status) + { + opera.postError("parseBacktrace failed scope message: " + message); + } + else + { + var _frames = message[FRAME_LIST], frame = null, i = 0; + var fn_name = '', line = '', script_id = '', argument_id = '', scope_id = ''; + var _frames_length = _frames.length; + var is_all_frames = _frames_length <= ini.max_frames; + var line_number = 0; + callstack = []; + __script_ids_in_callstack = []; + for( ; frame = _frames[i]; i++ ) + { + line_number = frame[LINE_NUMBER]; + // workaround for CORE-37771 and CORE-37798 + // line number of the top frame is sometime off by one or two lines + if (!i && typeof stop_at.line_number == 'number' && + Math.abs(line_number - stop_at.line_number) < 3) + { + line_number = stop_at.line_number; + } + callstack[i] = + { + fn_name : is_all_frames && i == _frames_length - 1 + ? ui_strings.S_GLOBAL_SCOPE_NAME + : frame[OBJECT_VALUE] && frame[OBJECT_VALUE][NAME] || + ui_strings.S_ANONYMOUS_FUNCTION_NAME, + line : line_number, + script_id : frame[SCRIPT_ID], + argument_id : frame[ARGUMENT_OBJECT], + scope_id : frame[VARIABLE_OBJECT], + this_id : frame[THIS_OBJECT], + id: i, + rt_id: stop_at.runtime_id, + scope_list: frame[SCOPE_LIST], + argument_value: frame[ARGUMENT_VALUE], + this_value: frame[THIS_VALUE], + } + __script_ids_in_callstack[i] = frame[SCRIPT_ID]; + } + + var backtrace_frame_list = new cls.EcmascriptDebugger["6.14"].BacktraceFrameList(message); + var return_value_list = backtrace_frame_list && backtrace_frame_list.returnValueList; + if (return_value_list) + { + return_values = { + rt_id: stop_at.runtime_id, + return_value_list: return_value_list + }; + } + + if( cur_inspection_type != 'frame' ) + { + messages.post('active-inspection-type', {inspection_type: 'frame'}); + } + messages.post('frame-selected', {frame_index: 0}); + views["callstack"].update(); + views["return-values"].update(); + if (!views.js_source.isvisible()) + { + topCell.showView(views.js_source.id); + } + var top_frame = callstack[0]; + if (views.js_source.showLine(top_frame.script_id, top_frame.line)) + { + runtimes.setSelectedScript(top_frame.script_id); + views.js_source.showLinePointer(top_frame.line, true); + } + toolbars.js_source.enableButtons('continue'); + messages.post('thread-stopped-event', {stop_at: stop_at}); + messages.post('host-state', {state: 'waiting'}); + setTimeout(function(){ __controls_enabled = true;}, 50); + } + } + + this.setInitialSettings = function() + { + if (!_is_initial_settings_set) + { + for (var prop in stop_at_settings) + { + var value = window.settings['js_source'].get(prop); + if (typeof value == "boolean") + stop_at_settings[prop] = value; + } + var msg = get_config_msg(); + ecma_debugger.requestSetConfiguration(cls.TagManager.IGNORE_RESPONSE, msg); + _is_initial_settings_set = true; + } + }; + + this.__continue = function (mode, clear_disabled_state) // + { + var tag = tag_manager.set_callback(this, + this._handle_continue, + [mode, clear_disabled_state]); + var msg = [stopAt.runtime_id, stopAt.thread_id, mode]; + services['ecmascript-debugger'].requestContinueThread(tag, msg); + } + + this.continue_thread = function (mode) // + { + if (__controls_enabled) + { + this.__continue(mode, true); + } + } + + this._handle_continue = function(status, message, mode, clear_disabled_state) + { + this._clear_stop_at_error(); + callstack = []; + return_values = {}; + __script_ids_in_callstack = []; + runtimes.setObserve(stopAt.runtime_id, mode != 'run'); + messages.post('frame-selected', {frame_index: -1}); + messages.post('thread-continue-event', {stop_at: stopAt}); + if (clear_disabled_state) + { + __controls_enabled = false; + __is_stopped = false; + toolbars.js_source.disableButtons('continue'); + } + messages.post('host-state', {state: 'ready'}); + window.views["return-values"].update(); + } + + this.on_thread_cancelled = function(message) + { + const THREAD_ID = 1; + if (message[THREAD_ID] == stopAt.thread_id) + { + this._clear_stop_at_error(); + callstack = []; + return_values = {}; + __script_ids_in_callstack = []; + messages.post('frame-selected', {frame_index: -1}); + __controls_enabled = false; + __is_stopped = false; + toolbars.js_source.disableButtons('continue'); + messages.post('host-state', {state: 'ready'}); + } + }; + + this.handle = function(message) + { + const + RUNTIME_ID = 0, + THREAD_ID = 1, + SCRIPT_ID = 2, + LINE_NUMBER = 3, + STOPPED_REASON = 4, + BREAKPOINT_ID = 5, + EXCEPTION_VALUE = 6, + OBJECT_VALUE = 3, + OBJECT_ID = 0; + + stopAt = + { + runtime_id: message[RUNTIME_ID], + thread_id: message[THREAD_ID], + script_id: message[SCRIPT_ID], + line_number: message[LINE_NUMBER], + stopped_reason: message[STOPPED_REASON], + breakpoint_id: message[BREAKPOINT_ID] + }; + + if (message[EXCEPTION_VALUE]) + { + var error_obj_id = message[EXCEPTION_VALUE] && + message[EXCEPTION_VALUE][OBJECT_VALUE] && + message[EXCEPTION_VALUE][OBJECT_VALUE][OBJECT_ID]; + if (error_obj_id) + { + stopAt.error = message[EXCEPTION_VALUE]; + stopAt.error_obj_id = error_obj_id; + } + } + + var line = stopAt.line_number; + if (typeof line == 'number') + { + /** + * This event is enabled by default to reassign breakpoints. + * Here it must be checked if the user likes actually to stop or not. + * At the moment this is a hack because the stop reason is not set for that case. + * The check is if the stop reason is 'unknown' (should be 'new script') + * + * In version 6.6 and higher the stop reason is 'new script'. + */ + if (stopAt.stopped_reason == 'unknown' || + stopAt.stopped_reason == 'new script') + { + runtime_id = stopAt.runtime_id; + if (settings['js_source'].get('script') + || runtimes.getObserve(runtime_id) + // this is a workaround for Bug 328220 + // if there is a breakpoint at the first statement of a script + // the event for stop at new script and the stop at breakpoint are the same + || this._bps.script_has_breakpoint_on_line(stopAt.script_id, line)) + { + this._stop_in_script(stopAt); + } + else + { + this.__continue('run'); + } + } + else + { + /* + example + + "runtime_id":2, + "thread_id":7, + "script_id":3068, + "line_number":8, + "stopped_reason":"breakpoint", + "breakpoint_id":1 + + */ + var condition = this._bps.get_condition(stopAt.breakpoint_id); + if (condition) + { + var tag = tagManager.set_callback(this, + this._handle_condition, + [stopAt]); + var msg = [stopAt.runtime_id, + stopAt.thread_id, + 0, + "Boolean(" + condition + ")", + [['dummy', 0]]]; + services['ecmascript-debugger'].requestEval(tag, msg); + } + else + { + this._stop_in_script(stopAt); + } + } + } + else + { + opera.postError('not a line number: ' + stopAt.line_number + '\n' + + JSON.stringify(stopAt)) + } + } + + this._handle_condition = function(status, message, stop_at) + { + const STATUS = 0, TYPE = 1, VALUE = 2; + if (status) + { + opera.postError('Evaling breakpoint condition failed'); + this.__continue('run'); + } + else if(message[STATUS] == "completed" && + message[TYPE] == "boolean" && + message[VALUE] == "true") + { + this._stop_in_script(stop_at); + } + else + { + this.__continue('run'); + } + }; + + this._handle_error = function(status, message, stop_at) + { + if (status) + { + opera.postError(ui_strings.S_DRAGONFLY_INFO_MESSAGE + + " error inspection failed in StopAt handle_error"); + } + else + { + const + OBJECT_CHAIN_LIST = 0, + OBJECT_LIST = 0, + OBJECT_VALUE = 0, + CLASS_NAME = 4, + PROPERTY_LIST = 1, + OBJECT_ID = 0, + PROP_OBJECT_VALUE = 3, + NAME = 0, + STRING = 2; + + var error = message && + (message = message[OBJECT_CHAIN_LIST]) && + (message = message[0]) && + (message = message[OBJECT_LIST]) && + message[0]; + if (error) + { + stop_at.error_class = error[OBJECT_VALUE] && + error[OBJECT_VALUE][CLASS_NAME] || "Error"; + var props = error[PROPERTY_LIST]; + if (props) + { + for (var i = 0, prop; prop = props[i]; i++) + { + if (prop[NAME] == "message") + stop_at.error_message = prop[STRING]; + } + } + + var script = window.runtimes.getScript(stop_at.script_id); + if (script) + { + script.stop_at_error = stop_at; + window.views.js_source.show_stop_at_error(); + } + } + } + }; + + this._clear_stop_at_error = function() + { + if (stopAt.error) + { + var script = window.runtimes.getScript(stopAt.script_id); + if (script) + script.stop_at_error = null; + window.views.js_source.clear_stop_at_error(); + } + }; + + this._stop_in_script = function(stop_at) + { + __is_stopped = true; + var tag = tagManager.set_callback(null, parseBacktrace, [stop_at]); + var msg = [stop_at.runtime_id, stop_at.thread_id, ini.max_frames]; + services['ecmascript-debugger'].requestGetBacktrace(tag, msg); + if (stop_at.error) + { + var tag = tagManager.set_callback(this, this._handle_error, [stop_at]); + var msg = [stop_at.runtime_id, [stop_at.error_obj_id], 0, 0, 0]; + window.services['ecmascript-debugger'].requestExamineObjects(tag, msg); + } + } + + var onRuntimeDestroyed = function(msg) + { + if( stopAt && stopAt.runtime_id == msg.id ) + { + views.callstack.clearView(); + views.inspection.clearView(); + self.__continue('run'); + } + + }; + + this._on_profile_disabled = function(msg) + { + if (msg.profile == window.app.profiles.DEFAULT) + { + this._clear_stop_at_error(); + callstack = []; + __script_ids_in_callstack = []; + window.views.js_source.clearLinePointer(); + window.views.callstack.clearView(); + window.views.inspection.clearView(); + window.messages.post('frame-selected', {frame_index: -1}); + window.messages.post('thread-continue-event', {stop_at: stopAt}); + __controls_enabled = false; + __is_stopped = false; + window.toolbars.js_source.disableButtons('continue'); + window.messages.post('host-state', {state: 'ready'}); + } + }; + + messages.addListener('runtime-destroyed', onRuntimeDestroyed); + messages.addListener('profile-disabled', this._on_profile_disabled.bind(this)); + + var onActiveInspectionType = function(msg) + { + cur_inspection_type = msg.inspection_type; + } + + var onFrameSelected = function(msg) + { + __selected_frame_index = msg.frame_index; + } + + this._bps = cls.Breakpoints.get_instance(); + + messages.addListener('active-inspection-type', onActiveInspectionType); + + + + messages.addListener('setting-changed', onSettingChange); + messages.addListener('frame-selected', onFrameSelected); + + this.bind = function(ecma_debugger) + { + var self = this; + + ecma_debugger.handleSetConfiguration = + ecma_debugger.handleContinueThread = + function(status, message){}; + + + ecma_debugger.addListener('enable-success', function() + { + self.setInitialSettings(); + }); + } + + this._bps = window.cls.Breakpoints.get_instance(); + + +} diff --git a/src/ecma-debugger/templates.js b/src/ecma-debugger/templates.js index 2fa0e0088..4a511fefd 100644 --- a/src/ecma-debugger/templates.js +++ b/src/ecma-debugger/templates.js @@ -1,752 +1,752 @@ -;(function() -{ - var self = this; - - var STRING_MAX_VALUE_LENGTH = 30; - - var TYPE_UNDEFINED = 0; - var TYPE_NULL = 1; - var TYPE_TRUE = 2; - var TYPE_FALSE = 3; - var TYPE_NAN = 4; - var TYPE_PLUS_INFINITY = 5; - var TYPE_MINUS_INFINITY = 6; - var TYPE_NUMBER = 7; - var TYPE_STRING = 8; - var TYPE_OBJECT = 9; - - var types = {}; - types[TYPE_UNDEFINED] = "undefined"; - types[TYPE_NULL] = "null"; - types[TYPE_TRUE] = "boolean"; - types[TYPE_FALSE] = "boolean"; - types[TYPE_NAN] = "number"; - types[TYPE_PLUS_INFINITY] = "number"; - types[TYPE_MINUS_INFINITY] = "number"; - types[TYPE_NUMBER] = "number"; - types[TYPE_STRING] = "string"; - - var names = {}; - names[TYPE_TRUE] = "true"; - names[TYPE_FALSE] = "false"; - names[TYPE_NAN] = "NaN"; - names[TYPE_PLUS_INFINITY] = "Infinity"; - names[TYPE_MINUS_INFINITY] = "-Infinity"; - - this.hello = function(enviroment) - { - var ret = ["ul"]; - var prop = ""; - var prop_dict = - { - "stpVersion": ui_strings.S_TEXT_ENVIRONMENT_PROTOCOL_VERSION, - "coreVersion": "Core Version", - "operatingSystem": ui_strings.S_TEXT_ENVIRONMENT_OPERATING_SYSTEM, - "platform": ui_strings.S_TEXT_ENVIRONMENT_PLATFORM, - "userAgent": ui_strings.S_TEXT_ENVIRONMENT_USER_AGENT - } - for( prop in prop_dict) - { - ret[ret.length] = ["li", prop_dict[prop] + ": " + enviroment[prop]]; - } - if( ini.revision_number.indexOf("$") != -1 && ini.mercurial_revision ) - { - ini.revision_number = ini.mercurial_revision; - } - ret[ret.length] = ["li", ui_strings.S_TEXT_ENVIRONMENT_DRAGONFLY_VERSION + ": " + ini.dragonfly_version]; - ret[ret.length] = ["li", ui_strings.S_TEXT_ENVIRONMENT_REVISION_NUMBER + ": " + ini.revision_number]; - ret.push("class", "selectable"); - return ["div", ret, "class", "padding"]; - } - - this.runtime_dropdown = function(runtimes) - { - return runtimes.map(this.runtime, this); - } - - this.runtime = function(runtime) - { - var option = ["cst-option", runtime.title, "rt-id", String(runtime.id)]; - if (runtime.title_attr) - option.push("title", runtime.title_attr); - var ret = [option]; - if (runtime.extensions && runtime.extensions.length) - ret.push(["cst-group", runtime.extensions.map(this.runtime, this)]); - return ret; - } - - this.script_dropdown = function(select_id, runtimes, stopped_script_id, selected_script_id) - { - var option_list = this.script_dropdown_options(select_id, - runtimes, - stopped_script_id, - selected_script_id); - return [["div", - ["div", - ["input", "type", "text", - "handler", select_id + "-filter", - "shortcuts", select_id + "-filter", - "class", "js-dd-filter"], - "class", "js-dd-filter-container"], - ["span", "class", "js-dd-clear-filter", - "handler", "js-dd-clear-filter"], - "class", "js-dd-filter-bar"], - option_list]; - }; - - this.script_dropdown_options = function(select_id, runtimes, stopped_script_id, - selected_script_id, search_term) - { - var script_list = ["div"]; - if (runtimes && runtimes.length) - { - for (var i = 0, rt; rt = runtimes[i]; i++) - { - script_list.push(this.runtime_script(rt, stopped_script_id, - selected_script_id, search_term)); - } - } - script_list.push("class", "js-dd-script-list", - "handler", "js-dd-move-highlight"); - return script_list; - }; - - this.runtime_script = function(runtime, stopped_script_id, - selected_script_id, search_term) - { - // search_term only applies to .js-dd-s-scope - var ret = []; - var script_uri_paths = new HashMap(); - var inline_and_evals = []; - var title = ["cst-title", runtime.title]; - var class_name = runtime.type == "extension" - ? "js-dd-ext-runtime" - : "js-dd-runtime"; - - title.push("class", class_name + (runtime.selected ? " selected-runtime" : "")); - - if (runtime.title != runtime.uri) - title.push("title", runtime.uri); - - runtime.scripts.forEach(function(script) - { - var ret_script = this.script_option(script, - stopped_script_id, - selected_script_id, - search_term); - if (ret_script) - { - if (script.script_type === "linked") - { - var root_uri = this._uri_path(runtime, script, search_term); - if (script_uri_paths[root_uri]) - script_uri_paths[root_uri].push(ret_script); - else - script_uri_paths[root_uri] = [ret_script]; - } - else - inline_and_evals.push(ret_script); - } - - }, this); - - var script_list = []; - Object.getOwnPropertyNames(script_uri_paths).sort().forEach(function(uri) - { - var group = ["div"]; - if (uri != "./") - group.push(["cst-title", uri, "class", "js-dd-dir-path"]); - - group.extend(script_uri_paths[uri]); - group.push("class", "js-dd-group js-dd-s-scope"); - ret.push(group); - }); - - if (inline_and_evals.length) - { - if (runtime.type == "extension") - { - ret.push(["div", inline_and_evals, "class", "js-dd-group js-dd-s-scope"]); - } - else - { - var group = ["div"]; - group.push(["cst-title", - ui_strings.S_SCRIPT_SELECT_SECTION_INLINE_AND_EVALS, - "class", "js-dd-dir-path"]); - - group.extend(inline_and_evals); - group.push("class", "js-dd-group"); - ret.push(group); - } - } - - if (runtime.type != "extension") - { - if (runtime.browser_js || (runtime.user_js_s && runtime.user_js_s.length)) - { - var scripts = []; - var sc_op = null; - if (runtime.browser_js) - { - sc_op = this.script_option(runtime.browser_js, stopped_script_id, - selected_script_id, search_term); - if (sc_op) - scripts.push(sc_op); - } - - if (runtime.user_js_s) - { - for (var i = 0, script; script = runtime.user_js_s[i]; i++) - { - sc_op = this.script_option(script, stopped_script_id, - selected_script_id, search_term) - if (sc_op) - scripts.push(sc_op); - } - } - - if (scripts.length) - { - ret.push(["div", - ["cst-title", - ui_strings.S_SCRIPT_SELECT_SECTION_BROWSER_AND_USER_JS, - "class", "js-dd-dir-path"], - ["div", scripts, "class", "js-dd-s-scope"], - "class", "js-dd-group"]); - } - } - - if (runtime.extensions) - { - for (var i = 0, rt; rt = runtime.extensions[i]; i++) - { - var ext_scripts = this.runtime_script(rt, stopped_script_id, - selected_script_id, search_term) - if (ext_scripts.length) - ret.push(ext_scripts); - } - } - } - - if (ret.length) - ret.unshift(title); - - return ret; - } - - this._uri_path = function(runtime, script, search_term) - { - var uri_path = script.abs_dir; - - if (script.abs_dir.indexOf(runtime.abs_dir) == 0 && - (!search_term || !runtime.abs_dir.contains(search_term))) - uri_path = "./" + script.abs_dir.slice(runtime.abs_dir.length); - else if (script.origin == runtime.origin && - (!search_term || !(script.origin.contains(search_term)))) - uri_path = script.dir_pathname; - - return uri_path; - }; - - // script types in the protocol: - // "inline", "event", "linked", "timeout", - // "java", "generated", "unknown" - // "Greasemonkey JS", "Browser JS", "User JS", "Extension JS" - this._script_type_map = - { - "inline": ui_strings.S_TEXT_ECMA_SCRIPT_TYPE_INLINE, - "linked": ui_strings.S_TEXT_ECMA_SCRIPT_TYPE_LINKED, - "unknown": ui_strings.S_TEXT_ECMA_SCRIPT_TYPE_UNKNOWN - }; - - this.script_option = function(script, stopped_script_id, - selected_script_id, search_term) - { - var script_type = this._script_type_map[script.script_type] || - script.script_type; - var ret = null; - - if (search_term && - !((script.uri && script.uri.toLowerCase().contains(search_term)) || - (!script.uri && script_type.toLowerCase().contains(search_term)))) - return ret; - - if (script.uri) - { - var is_linked = script.script_type == "linked"; - ret = ["cst-option", - ["span", - script.filename, - "data-tooltip", is_linked && "js-script-select", - "data-tooltip-text", is_linked && script.uri]]; - - if (script.search) - ret.push(["span", script.search, "class", "js-dd-scr-query"]); - - if (script.hash) - ret.push(["span", script.query, "class", "js-dd-scr-hash"]); - - ret.push("script-id", script.script_id.toString()); - } - else - { - var code_snippet = script.script_data.slice(0, 360) - .replace(/\s+/g, " ").slice(0, 120); - ret = ["cst-option", - ["span", script_type.capitalize(true), "class", "js-dd-s-scope"], - " – ", - ["code", code_snippet, "class", "code-snippet"], - "script-id", script.script_id.toString()]; - } - - var class_name = script.script_id == selected_script_id - ? "selected" - : ""; - - if (stopped_script_id == script.script_id) - class_name += (class_name ? " " : "") + "stopped"; - - if (class_name) - ret.push("class", class_name); - - return ret; - }; - - this.runtime_dom = function(runtime) - { - var display_uri = runtime["title"] || helpers.shortenURI(runtime.uri).uri; - return ( - [ - "cst-option", - runtime["title"] || runtime.uri, - "runtime-id", runtime.runtime_id.toString() - ].concat( dom_data.getDataRuntimeId() == runtime.runtime_id ? ["class", "selected"] : [] ). - concat( display_uri != runtime.uri ? ["title", runtime.uri] : [] ) ) - } - - this.frame = function(frame, is_top) - { - // Fall back to document URI if it's inline - var uri = frame.script_id && runtimes.getScript(frame.script_id) - ? (runtimes.getScript(frame.script_id).uri || runtimes.getRuntime(frame.rt_id).uri) - : null; - return ["li", - ["span", frame.fn_name, "class", "scope-name"], - ["span", - " " + (uri && frame.line ? helpers.basename(uri) + ":" + frame.line : ""), - "class", "file-line"], - "handler", "show-frame", - "ref-id", String(frame.id), - "title", uri - ].concat( is_top ? ["class", "selected"] : [] ); - } - - this.return_values = function(return_values, search_term) - { - return ( - ["ol", - return_values.return_value_list.map(function(retval) { - return this.return_value(retval, - return_values.rt_id, - search_term); - }, this), - "class", "return-values" - ] - ); - }; - - this.return_value = function(retval, rt_id, search_term) - { - var value_template = []; - var value = ""; - var type = types[retval.value.type]; - switch (retval.value.type) - { - case TYPE_UNDEFINED: - case TYPE_NULL: - if (type.toLowerCase().contains(search_term)) - { - value_template.push( - ["item", - ["value", - type, - "class", type - ] - ] - ); - } - break; - - case TYPE_TRUE: - case TYPE_FALSE: - case TYPE_NAN: - case TYPE_PLUS_INFINITY: - case TYPE_MINUS_INFINITY: - case TYPE_NUMBER: - value = (retval.value.type == TYPE_NUMBER) - ? String(retval.value.number) - : names[retval.value.type]; - if (value.toLowerCase().contains(search_term)) - { - value_template.push( - ["item", - ["value", - value - ], - "class", type - ] - ); - } - break; - - case TYPE_STRING: - value = retval.value.str; - if (value.toLowerCase().contains(search_term)) - { - var short_value = value.length > STRING_MAX_VALUE_LENGTH - ? value.slice(0, STRING_MAX_VALUE_LENGTH) + "…" - : null; - if (short_value) - { - value_template.push( - ["item", - ["input", - "type", "button", - "handler", "expand-value", - "class", "folder-key" - ], - ["value", - "\"" + short_value + "\"", - "class", type, - "data-value", "\"" + value + "\"", - ] - ] - ); - } - else - { - value_template.push( - ["item", - ["value", - "\"" + value + "\"", - "class", type - ] - ] - ); - } - } - break; - - case TYPE_OBJECT: - var object = retval.value.object; - var name = object.className === "Function" && !object.functionName - ? ui_strings.S_ANONYMOUS_FUNCTION_NAME - : object.functionName; - value = window.templates.inspected_js_object(retval.value.model, true, null, search_term); - if (value !== "") - value_template.push(value); - break; - } - - var object = retval.functionFrom; - var function_name = object.functionName || ui_strings.S_ANONYMOUS_FUNCTION_NAME; - var func_model = window.inspections.get_object(object.objectID) || - new cls.InspectableJSObject(rt_id, - object.objectID, - function_name, - object.className, - null, - null, - true); - var func_search_term = value_template.length ? null : search_term; - var func = window.templates.inspected_js_object(func_model, true, null, func_search_term); - - // If there is no function or value, don't show anything - if (func === "" && !value_template.length) - return []; - - var from_uri = window.helpers.get_script_name(retval.positionFrom.scriptID); - from_uri = from_uri ? new URI(from_uri).basename : ui_strings.S_UNKNOWN_SCRIPT; - var to_uri = window.helpers.get_script_name(retval.positionTo.scriptID); - to_uri = to_uri ? new URI(to_uri).basename : ui_strings.S_UNKNOWN_SCRIPT; - - return [ - ["li", - ["div", - ["div", - "class", "return-value-arrow return-value-arrow-from", - "handler", "goto-script-line", - "data-tooltip", "return-value-tooltip", - "data-tooltip-text", ui_strings.S_RETURN_VALUES_FUNCTION_FROM - .replace("%s", from_uri) - .replace("%s", retval.positionFrom.lineNumber), - "data-script-id", String(retval.positionFrom.scriptID), - "data-script-line", String(retval.positionFrom.lineNumber) - ], - [func], - "class", "return-function-from" - ], - (value_template.length - ? ["div", - ["div", - ["div", - "class", "return-value-arrow-to", - "data-tooltip", "return-value-tooltip", - "data-tooltip-text", ui_strings.S_RETURN_VALUES_FUNCTION_TO - .replace("%s", to_uri) - .replace("%s", retval.positionTo.lineNumber) - ], - "class", "return-value-arrow", - "handler", "goto-script-line", - "data-script-id", String(retval.positionTo.scriptID), - "data-script-line", String(retval.positionTo.lineNumber) - ], - value_template, - "class", "return-value" - ] - : []) - ] - ]; - }; - - this.configStopAt = function(config) - { - var ret =["ul"]; - var arr = ["script", "exception", "error", "abort"], n="", i=0; - for( ; n = arr[i]; i++) - { - ret[ret.length] = this.checkbox(n, config[n]); - } - return ["div"].concat([ret]); - } - - this.breakpoint = function(line_nr, top) - { - return ["li", - "class", "breakpoint", - "line_nr", line_nr, - "style", "top:"+ top +"px" - ] - } - - this.breadcrumb = function(model, obj_id, parent_node_chain, target_id, show_combinator) - { - var setting = window.settings.dom; - var css_path = model._get_css_path(obj_id, parent_node_chain, - setting.get("force-lowercase"), - setting.get("show-id_and_classes-in-breadcrumb"), - setting.get("show-siblings-in-breadcrumb")); - var ret = []; - target_id || (target_id = obj_id) - if (css_path) - { - for (var i = 0; i < css_path.length; i++ ) - { - ret[ret.length] = - [ - "breadcrumb", css_path[i].name, - "ref-id", css_path[i].id.toString(), - "handler", "breadcrumb-link", - "data-menu", "breadcrumb", - "class", (css_path[i].is_parent_offset ? "parent-offset" : "") + - (css_path[i].id == target_id ? " active" : ""), - ]; - if (show_combinator) - { - ret[ret.length] = " " + css_path[i].combinator + " "; - } - } - } - return ret; - } - - this.uiLangOptions = function(lang_dict) - { - var dict = - [ - { - browserLanguge: "be", - key: "be", - name: "Беларуская" - }, - { - browserLanguge: "bg", - key: "bg", - name: "Български" - }, - { - browserLanguge: "cs", - key: "cs", - name: "Česky" - }, - { - browserLanguge: "de", - key: "de", - name: "Deutsch" - }, - { - browserLanguge: "en", - key: "en", - name: "U.S. English" - }, - { - browserLanguge: "en-GB", - key: "en-GB", - name: "British English" - }, - { - browserLanguge: "es-ES", - key: "es-ES", - name: "Español (España)" - }, - { - browserLanguge: "es-LA", - key: "es-LA", - name: "Español (Latinoamérica)" - }, - { - browserLanguge: "et", - key: "et", - name: "Eesti keel" - }, - { - browserLanguge: "fr", - key: "fr", - name: "Français" - }, - { - browserLanguge: "fr-CA", - key: "fr-CA", - name: "Français Canadien" - }, - { - browserLanguge: "fy", - key: "fy", - name: "Frysk" - }, - { - browserLanguge: "gd", - key: "gd", - name: "Gàidhlig" - }, - { - browserLanguge: "hu", - key: "hu", - name: "Magyar" - }, - { - browserLanguge: "id", - key: "id", - name: "Bahasa Indonesia" - }, - { - browserLanguge: "it", - key: "it", - name: "Italiano" - }, - { - browserLanguge: "ja", - key: "ja", - name: "日本語" - }, - { - browserLanguge: "ka", - key: "ka", - name: "ქართული" - }, - { - browserLanguge: "mk", - key: "mk", - name: "македонски јазик" - }, - { - browserLanguge: "nb", - key: "nb", - name: "Norsk bokmål" - }, - { - browserLanguge: "nl", - key: "nl", - name: "Nederlands" - }, - { - browserLanguge: "nn", - key: "nn", - name: "Norsk nynorsk" - }, - { - browserLanguge: "pl", - key: "pl", - name: "Polski" - }, - { - browserLanguge: "pt", - key: "pt", - name: "Português" - }, - { - browserLanguge: "pt-BR", - key: "pt-BR", - name: "Português (Brasil)" - }, - { - browserLanguge: "ro", - key: "ro", - name: "Română" - }, - { - browserLanguge: "ru", - key: "ru", - name: "Русский язык" - }, - { - browserLanguge: "sk", - key: "sk", - name: "Slovenčina" - }, - { - browserLanguge: "sr", - key: "sr", - name: "српски" - }, - { - browserLanguge: "sv", - key: "sv", - name: "Svenska" - }, - { - browserLanguge: "tr", - key: "tr", - name: "Türkçe" - }, - { - browserLanguge: "uk", - key: "uk", - name: "Українська" - }, - { - browserLanguge: "zh-cn", - key: "zh-cn", - name: "简体中文" - }, - { - browserLanguge: "zh-tw", - key: "zh-tw", - name: "繁體中文" - } - ], - lang = null, - i = 0, - selected_lang = window.ui_strings.lang_code, - ret = []; - - for( ; lang = dict[i]; i++) - { - ret[ret.length] = ["option", lang.name, "value", lang.key]. - concat(selected_lang == lang.key ? ["selected", "selected"] : []); - } - return ret; - } - -}).apply(window.templates || (window.templates = {})); +;(function() +{ + var self = this; + + var STRING_MAX_VALUE_LENGTH = 30; + + var TYPE_UNDEFINED = 0; + var TYPE_NULL = 1; + var TYPE_TRUE = 2; + var TYPE_FALSE = 3; + var TYPE_NAN = 4; + var TYPE_PLUS_INFINITY = 5; + var TYPE_MINUS_INFINITY = 6; + var TYPE_NUMBER = 7; + var TYPE_STRING = 8; + var TYPE_OBJECT = 9; + + var types = {}; + types[TYPE_UNDEFINED] = "undefined"; + types[TYPE_NULL] = "null"; + types[TYPE_TRUE] = "boolean"; + types[TYPE_FALSE] = "boolean"; + types[TYPE_NAN] = "number"; + types[TYPE_PLUS_INFINITY] = "number"; + types[TYPE_MINUS_INFINITY] = "number"; + types[TYPE_NUMBER] = "number"; + types[TYPE_STRING] = "string"; + + var names = {}; + names[TYPE_TRUE] = "true"; + names[TYPE_FALSE] = "false"; + names[TYPE_NAN] = "NaN"; + names[TYPE_PLUS_INFINITY] = "Infinity"; + names[TYPE_MINUS_INFINITY] = "-Infinity"; + + this.hello = function(enviroment) + { + var ret = ["ul"]; + var prop = ""; + var prop_dict = + { + "stpVersion": ui_strings.S_TEXT_ENVIRONMENT_PROTOCOL_VERSION, + "coreVersion": "Core Version", + "operatingSystem": ui_strings.S_TEXT_ENVIRONMENT_OPERATING_SYSTEM, + "platform": ui_strings.S_TEXT_ENVIRONMENT_PLATFORM, + "userAgent": ui_strings.S_TEXT_ENVIRONMENT_USER_AGENT + } + for( prop in prop_dict) + { + ret[ret.length] = ["li", prop_dict[prop] + ": " + enviroment[prop]]; + } + if( ini.revision_number.indexOf("$") != -1 && ini.mercurial_revision ) + { + ini.revision_number = ini.mercurial_revision; + } + ret[ret.length] = ["li", ui_strings.S_TEXT_ENVIRONMENT_DRAGONFLY_VERSION + ": " + ini.dragonfly_version]; + ret[ret.length] = ["li", ui_strings.S_TEXT_ENVIRONMENT_REVISION_NUMBER + ": " + ini.revision_number]; + ret.push("class", "selectable"); + return ["div", ret, "class", "padding"]; + } + + this.runtime_dropdown = function(runtimes) + { + return runtimes.map(this.runtime, this); + } + + this.runtime = function(runtime) + { + var option = ["cst-option", runtime.title, "rt-id", String(runtime.id)]; + if (runtime.title_attr) + option.push("title", runtime.title_attr); + var ret = [option]; + if (runtime.extensions && runtime.extensions.length) + ret.push(["cst-group", runtime.extensions.map(this.runtime, this)]); + return ret; + } + + this.script_dropdown = function(select_id, runtimes, stopped_script_id, selected_script_id) + { + var option_list = this.script_dropdown_options(select_id, + runtimes, + stopped_script_id, + selected_script_id); + return [["div", + ["div", + ["input", "type", "text", + "handler", select_id + "-filter", + "shortcuts", select_id + "-filter", + "class", "js-dd-filter"], + "class", "js-dd-filter-container"], + ["span", "class", "js-dd-clear-filter", + "handler", "js-dd-clear-filter"], + "class", "js-dd-filter-bar"], + option_list]; + }; + + this.script_dropdown_options = function(select_id, runtimes, stopped_script_id, + selected_script_id, search_term) + { + var script_list = ["div"]; + if (runtimes && runtimes.length) + { + for (var i = 0, rt; rt = runtimes[i]; i++) + { + script_list.push(this.runtime_script(rt, stopped_script_id, + selected_script_id, search_term)); + } + } + script_list.push("class", "js-dd-script-list", + "handler", "js-dd-move-highlight"); + return script_list; + }; + + this.runtime_script = function(runtime, stopped_script_id, + selected_script_id, search_term) + { + // search_term only applies to .js-dd-s-scope + var ret = []; + var script_uri_paths = new HashMap(); + var inline_and_evals = []; + var title = ["cst-title", runtime.title]; + var class_name = runtime.type == "extension" + ? "js-dd-ext-runtime" + : "js-dd-runtime"; + + title.push("class", class_name + (runtime.selected ? " selected-runtime" : "")); + + if (runtime.title != runtime.uri) + title.push("title", runtime.uri); + + runtime.scripts.forEach(function(script) + { + var ret_script = this.script_option(script, + stopped_script_id, + selected_script_id, + search_term); + if (ret_script) + { + if (script.script_type === "linked") + { + var root_uri = this._uri_path(runtime, script, search_term); + if (script_uri_paths[root_uri]) + script_uri_paths[root_uri].push(ret_script); + else + script_uri_paths[root_uri] = [ret_script]; + } + else + inline_and_evals.push(ret_script); + } + + }, this); + + var script_list = []; + Object.getOwnPropertyNames(script_uri_paths).sort().forEach(function(uri) + { + var group = ["div"]; + if (uri != "./") + group.push(["cst-title", uri, "class", "js-dd-dir-path"]); + + group.extend(script_uri_paths[uri]); + group.push("class", "js-dd-group js-dd-s-scope"); + ret.push(group); + }); + + if (inline_and_evals.length) + { + if (runtime.type == "extension") + { + ret.push(["div", inline_and_evals, "class", "js-dd-group js-dd-s-scope"]); + } + else + { + var group = ["div"]; + group.push(["cst-title", + ui_strings.S_SCRIPT_SELECT_SECTION_INLINE_AND_EVALS, + "class", "js-dd-dir-path"]); + + group.extend(inline_and_evals); + group.push("class", "js-dd-group"); + ret.push(group); + } + } + + if (runtime.type != "extension") + { + if (runtime.browser_js || (runtime.user_js_s && runtime.user_js_s.length)) + { + var scripts = []; + var sc_op = null; + if (runtime.browser_js) + { + sc_op = this.script_option(runtime.browser_js, stopped_script_id, + selected_script_id, search_term); + if (sc_op) + scripts.push(sc_op); + } + + if (runtime.user_js_s) + { + for (var i = 0, script; script = runtime.user_js_s[i]; i++) + { + sc_op = this.script_option(script, stopped_script_id, + selected_script_id, search_term) + if (sc_op) + scripts.push(sc_op); + } + } + + if (scripts.length) + { + ret.push(["div", + ["cst-title", + ui_strings.S_SCRIPT_SELECT_SECTION_BROWSER_AND_USER_JS, + "class", "js-dd-dir-path"], + ["div", scripts, "class", "js-dd-s-scope"], + "class", "js-dd-group"]); + } + } + + if (runtime.extensions) + { + for (var i = 0, rt; rt = runtime.extensions[i]; i++) + { + var ext_scripts = this.runtime_script(rt, stopped_script_id, + selected_script_id, search_term) + if (ext_scripts.length) + ret.push(ext_scripts); + } + } + } + + if (ret.length) + ret.unshift(title); + + return ret; + } + + this._uri_path = function(runtime, script, search_term) + { + var uri_path = script.abs_dir; + + if (script.abs_dir.indexOf(runtime.abs_dir) == 0 && + (!search_term || !runtime.abs_dir.contains(search_term))) + uri_path = "./" + script.abs_dir.slice(runtime.abs_dir.length); + else if (script.origin == runtime.origin && + (!search_term || !(script.origin.contains(search_term)))) + uri_path = script.dir_pathname; + + return uri_path; + }; + + // script types in the protocol: + // "inline", "event", "linked", "timeout", + // "java", "generated", "unknown" + // "Greasemonkey JS", "Browser JS", "User JS", "Extension JS" + this._script_type_map = + { + "inline": ui_strings.S_TEXT_ECMA_SCRIPT_TYPE_INLINE, + "linked": ui_strings.S_TEXT_ECMA_SCRIPT_TYPE_LINKED, + "unknown": ui_strings.S_TEXT_ECMA_SCRIPT_TYPE_UNKNOWN + }; + + this.script_option = function(script, stopped_script_id, + selected_script_id, search_term) + { + var script_type = this._script_type_map[script.script_type] || + script.script_type; + var ret = null; + + if (search_term && + !((script.uri && script.uri.toLowerCase().contains(search_term)) || + (!script.uri && script_type.toLowerCase().contains(search_term)))) + return ret; + + if (script.uri) + { + var is_linked = script.script_type == "linked"; + ret = ["cst-option", + ["span", + script.filename, + "data-tooltip", is_linked && "js-script-select", + "data-tooltip-text", is_linked && script.uri]]; + + if (script.search) + ret.push(["span", script.search, "class", "js-dd-scr-query"]); + + if (script.hash) + ret.push(["span", script.query, "class", "js-dd-scr-hash"]); + + ret.push("script-id", script.script_id.toString()); + } + else + { + var code_snippet = script.script_data.slice(0, 360) + .replace(/\s+/g, " ").slice(0, 120); + ret = ["cst-option", + ["span", script_type.capitalize(true), "class", "js-dd-s-scope"], + " – ", + ["code", code_snippet, "class", "code-snippet"], + "script-id", script.script_id.toString()]; + } + + var class_name = script.script_id == selected_script_id + ? "selected" + : ""; + + if (stopped_script_id == script.script_id) + class_name += (class_name ? " " : "") + "stopped"; + + if (class_name) + ret.push("class", class_name); + + return ret; + }; + + this.runtime_dom = function(runtime) + { + var display_uri = runtime["title"] || helpers.shortenURI(runtime.uri).uri; + return ( + [ + "cst-option", + runtime["title"] || runtime.uri, + "runtime-id", runtime.runtime_id.toString() + ].concat( dom_data.getDataRuntimeId() == runtime.runtime_id ? ["class", "selected"] : [] ). + concat( display_uri != runtime.uri ? ["title", runtime.uri] : [] ) ) + } + + this.frame = function(frame, is_top) + { + // Fall back to document URI if it's inline + var uri = frame.script_id && runtimes.getScript(frame.script_id) + ? (runtimes.getScript(frame.script_id).uri || runtimes.getRuntime(frame.rt_id).uri) + : null; + return ["li", + ["span", frame.fn_name, "class", "scope-name"], + ["span", + " " + (uri && frame.line ? helpers.basename(uri) + ":" + frame.line : ""), + "class", "file-line"], + "handler", "show-frame", + "ref-id", String(frame.id), + "title", uri + ].concat( is_top ? ["class", "selected"] : [] ); + } + + this.return_values = function(return_values, search_term) + { + return ( + ["ol", + return_values.return_value_list.map(function(retval) { + return this.return_value(retval, + return_values.rt_id, + search_term); + }, this), + "class", "return-values" + ] + ); + }; + + this.return_value = function(retval, rt_id, search_term) + { + var value_template = []; + var value = ""; + var type = types[retval.value.type]; + switch (retval.value.type) + { + case TYPE_UNDEFINED: + case TYPE_NULL: + if (type.toLowerCase().contains(search_term)) + { + value_template.push( + ["item", + ["value", + type, + "class", type + ] + ] + ); + } + break; + + case TYPE_TRUE: + case TYPE_FALSE: + case TYPE_NAN: + case TYPE_PLUS_INFINITY: + case TYPE_MINUS_INFINITY: + case TYPE_NUMBER: + value = (retval.value.type == TYPE_NUMBER) + ? String(retval.value.number) + : names[retval.value.type]; + if (value.toLowerCase().contains(search_term)) + { + value_template.push( + ["item", + ["value", + value + ], + "class", type + ] + ); + } + break; + + case TYPE_STRING: + value = retval.value.str; + if (value.toLowerCase().contains(search_term)) + { + var short_value = value.length > STRING_MAX_VALUE_LENGTH + ? value.slice(0, STRING_MAX_VALUE_LENGTH) + "…" + : null; + if (short_value) + { + value_template.push( + ["item", + ["input", + "type", "button", + "handler", "expand-value", + "class", "folder-key" + ], + ["value", + "\"" + short_value + "\"", + "class", type, + "data-value", "\"" + value + "\"", + ] + ] + ); + } + else + { + value_template.push( + ["item", + ["value", + "\"" + value + "\"", + "class", type + ] + ] + ); + } + } + break; + + case TYPE_OBJECT: + var object = retval.value.object; + var name = object.className === "Function" && !object.functionName + ? ui_strings.S_ANONYMOUS_FUNCTION_NAME + : object.functionName; + value = window.templates.inspected_js_object(retval.value.model, true, null, search_term); + if (value !== "") + value_template.push(value); + break; + } + + var object = retval.functionFrom; + var function_name = object.functionName || ui_strings.S_ANONYMOUS_FUNCTION_NAME; + var func_model = window.inspections.get_object(object.objectID) || + new cls.InspectableJSObject(rt_id, + object.objectID, + function_name, + object.className, + null, + null, + true); + var func_search_term = value_template.length ? null : search_term; + var func = window.templates.inspected_js_object(func_model, true, null, func_search_term); + + // If there is no function or value, don't show anything + if (func === "" && !value_template.length) + return []; + + var from_uri = window.helpers.get_script_name(retval.positionFrom.scriptID); + from_uri = from_uri ? new URI(from_uri).basename : ui_strings.S_UNKNOWN_SCRIPT; + var to_uri = window.helpers.get_script_name(retval.positionTo.scriptID); + to_uri = to_uri ? new URI(to_uri).basename : ui_strings.S_UNKNOWN_SCRIPT; + + return [ + ["li", + ["div", + ["div", + "class", "return-value-arrow return-value-arrow-from", + "handler", "goto-script-line", + "data-tooltip", "return-value-tooltip", + "data-tooltip-text", ui_strings.S_RETURN_VALUES_FUNCTION_FROM + .replace("%s", from_uri) + .replace("%s", retval.positionFrom.lineNumber), + "data-script-id", String(retval.positionFrom.scriptID), + "data-script-line", String(retval.positionFrom.lineNumber) + ], + [func], + "class", "return-function-from" + ], + (value_template.length + ? ["div", + ["div", + ["div", + "class", "return-value-arrow-to", + "data-tooltip", "return-value-tooltip", + "data-tooltip-text", ui_strings.S_RETURN_VALUES_FUNCTION_TO + .replace("%s", to_uri) + .replace("%s", retval.positionTo.lineNumber) + ], + "class", "return-value-arrow", + "handler", "goto-script-line", + "data-script-id", String(retval.positionTo.scriptID), + "data-script-line", String(retval.positionTo.lineNumber) + ], + value_template, + "class", "return-value" + ] + : []) + ] + ]; + }; + + this.configStopAt = function(config) + { + var ret =["ul"]; + var arr = ["script", "exception", "error", "abort"], n="", i=0; + for( ; n = arr[i]; i++) + { + ret[ret.length] = this.checkbox(n, config[n]); + } + return ["div"].concat([ret]); + } + + this.breakpoint = function(line_nr, top) + { + return ["li", + "class", "breakpoint", + "line_nr", line_nr, + "style", "top:"+ top +"px" + ] + } + + this.breadcrumb = function(model, obj_id, parent_node_chain, target_id, show_combinator) + { + var setting = window.settings.dom; + var css_path = model._get_css_path(obj_id, parent_node_chain, + setting.get("force-lowercase"), + setting.get("show-id_and_classes-in-breadcrumb"), + setting.get("show-siblings-in-breadcrumb")); + var ret = []; + target_id || (target_id = obj_id) + if (css_path) + { + for (var i = 0; i < css_path.length; i++ ) + { + ret[ret.length] = + [ + "breadcrumb", css_path[i].name, + "ref-id", css_path[i].id.toString(), + "handler", "breadcrumb-link", + "data-menu", "breadcrumb", + "class", (css_path[i].is_parent_offset ? "parent-offset" : "") + + (css_path[i].id == target_id ? " active" : ""), + ]; + if (show_combinator) + { + ret[ret.length] = " " + css_path[i].combinator + " "; + } + } + } + return ret; + } + + this.uiLangOptions = function(lang_dict) + { + var dict = + [ + { + browserLanguge: "be", + key: "be", + name: "Беларуская" + }, + { + browserLanguge: "bg", + key: "bg", + name: "Български" + }, + { + browserLanguge: "cs", + key: "cs", + name: "Česky" + }, + { + browserLanguge: "de", + key: "de", + name: "Deutsch" + }, + { + browserLanguge: "en", + key: "en", + name: "U.S. English" + }, + { + browserLanguge: "en-GB", + key: "en-GB", + name: "British English" + }, + { + browserLanguge: "es-ES", + key: "es-ES", + name: "Español (España)" + }, + { + browserLanguge: "es-LA", + key: "es-LA", + name: "Español (Latinoamérica)" + }, + { + browserLanguge: "et", + key: "et", + name: "Eesti keel" + }, + { + browserLanguge: "fr", + key: "fr", + name: "Français" + }, + { + browserLanguge: "fr-CA", + key: "fr-CA", + name: "Français Canadien" + }, + { + browserLanguge: "fy", + key: "fy", + name: "Frysk" + }, + { + browserLanguge: "gd", + key: "gd", + name: "Gàidhlig" + }, + { + browserLanguge: "hu", + key: "hu", + name: "Magyar" + }, + { + browserLanguge: "id", + key: "id", + name: "Bahasa Indonesia" + }, + { + browserLanguge: "it", + key: "it", + name: "Italiano" + }, + { + browserLanguge: "ja", + key: "ja", + name: "日本語" + }, + { + browserLanguge: "ka", + key: "ka", + name: "ქართული" + }, + { + browserLanguge: "mk", + key: "mk", + name: "македонски јазик" + }, + { + browserLanguge: "nb", + key: "nb", + name: "Norsk bokmål" + }, + { + browserLanguge: "nl", + key: "nl", + name: "Nederlands" + }, + { + browserLanguge: "nn", + key: "nn", + name: "Norsk nynorsk" + }, + { + browserLanguge: "pl", + key: "pl", + name: "Polski" + }, + { + browserLanguge: "pt", + key: "pt", + name: "Português" + }, + { + browserLanguge: "pt-BR", + key: "pt-BR", + name: "Português (Brasil)" + }, + { + browserLanguge: "ro", + key: "ro", + name: "Română" + }, + { + browserLanguge: "ru", + key: "ru", + name: "Русский язык" + }, + { + browserLanguge: "sk", + key: "sk", + name: "Slovenčina" + }, + { + browserLanguge: "sr", + key: "sr", + name: "српски" + }, + { + browserLanguge: "sv", + key: "sv", + name: "Svenska" + }, + { + browserLanguge: "tr", + key: "tr", + name: "Türkçe" + }, + { + browserLanguge: "uk", + key: "uk", + name: "Українська" + }, + { + browserLanguge: "zh-cn", + key: "zh-cn", + name: "简体中文" + }, + { + browserLanguge: "zh-tw", + key: "zh-tw", + name: "繁體中文" + } + ], + lang = null, + i = 0, + selected_lang = window.ui_strings.lang_code, + ret = []; + + for( ; lang = dict[i]; i++) + { + ret[ret.length] = ["option", lang.name, "value", lang.key]. + concat(selected_lang == lang.key ? ["selected", "selected"] : []); + } + return ret; + } + +}).apply(window.templates || (window.templates = {})); diff --git a/src/ui-strings/ui_strings-en.js b/src/ui-strings/ui_strings-en.js index eecee56ed..18fd54425 100644 --- a/src/ui-strings/ui_strings-en.js +++ b/src/ui-strings/ui_strings-en.js @@ -1,1740 +1,1739 @@ -window.ui_strings || ( window.ui_strings = {} ); -window.ui_strings.lang_code = "en"; - -/** - * Capitalization guidelines: - * http://library.gnome.org/devel/hig-book/stable/design-text-labels.html.en#layout-capitalization - * - * Prefix -> use mapping for strings: - * Prefix Use - * D Dialog titles and components - * S General strings - * M Menus - */ - -/* DESC: Confirm dialog text for asking if the user wants to redo the search because the context has changed. */ -ui_strings.D_REDO_SEARCH = "The searched document no longer exists.\nRepeat search in the current document?"; - -/* DESC: Confirm dialog text for asking if the user wants to reload and reformat the scripts now. */ -ui_strings.D_REFORMAT_SCRIPTS = "Reload the page to reformat the scripts now?"; - -/* DESC: Confirm dialog text for asking if the user wants to reload all scripts. */ -ui_strings.D_RELOAD_SCRIPTS = "Not all scripts are loaded. Do you want to reload the page?"; - -/* DESC: Alert dialog that updating of the custom shortcuts with new ones has failed. */ -ui_strings.D_SHORTCUTS_UPDATE_FAILED = "Failed to sync custom shortcuts. The shortcuts are reset to the default ones."; - -/* DESC: Context menu item for adding an attribute in the DOM view. */ -ui_strings.M_CONTEXTMENU_ADD_ATTRIBUTE = "Add attribute"; - -/* DESC: Context menu item for adding a breakpoint. */ -ui_strings.M_CONTEXTMENU_ADD_BREAKPOINT = "Add breakpoint"; - -/* DESC: Context menu item to add a color in the color palette. */ -ui_strings.M_CONTEXTMENU_ADD_COLOR = "Add color"; - -/* DESC: Context menu item for breakpoints to add a condition. */ -ui_strings.M_CONTEXTMENU_ADD_CONDITION = "Add condition"; - -/* DESC: Context menu item for adding a declaration in a rule. */ -ui_strings.M_CONTEXTMENU_ADD_DECLARATION = "Add declaration"; - -/* DESC: Context menu item for adding a something to watches. */ -ui_strings.M_CONTEXTMENU_ADD_WATCH = "Watch \"%s\""; - -/* DESC: Context menu item for collapsing a node subtree. */ -ui_strings.M_CONTEXTMENU_COLLAPSE_SUBTREE = "Collapse subtree"; - -/* DESC: Context menu item, general "Delete" in a context, e.g. a breakpoint */ -ui_strings.M_CONTEXTMENU_DELETE = "Delete"; - -/* DESC: Context menu item, general "Delete all" in a context, e.g. breakpoints */ -ui_strings.M_CONTEXTMENU_DELETE_ALL = "Delete all"; - -/* DESC: Context menu item for deleting all breakpoints */ -ui_strings.M_CONTEXTMENU_DELETE_ALL_BREAKPOINTS = "Delete all breakpoints"; - -/* DESC: Context menu item for deleting a breakpoint. */ -ui_strings.M_CONTEXTMENU_DELETE_BREAKPOINT = "Delete breakpoint"; - -/* DESC: Context menu item to delete a color in the color palette. */ -ui_strings.M_CONTEXTMENU_DELETE_COLOR = "Delete color"; - -/* DESC: Context menu item for breakpoints to delete a condition. */ -ui_strings.M_CONTEXTMENU_DELETE_CONDITION = "Delete condition"; - -/* DESC: Context menu item, general "Disable all" in a context, e.g. breakpoints */ -ui_strings.M_CONTEXTMENU_DISABLE_ALL = "Disable all"; - -/* DESC: Context menu item for disabling all breakpoints */ -ui_strings.M_CONTEXTMENU_DISABLE_ALL_BREAKPOINTS = "Disable all breakpoints"; - -/* DESC: Context menu item for disabling a breakpoint. */ -ui_strings.M_CONTEXTMENU_DISABLE_BREAKPOINT = "Disable breakpoint"; - -/* DESC: Context menu item for disabling all declarations in a rule. */ -ui_strings.M_CONTEXTMENU_DISABLE_DECLARATIONS = "Disable all declarations"; - -/* DESC: Context menu item for editing an attribute name in the DOM view. */ -ui_strings.M_CONTEXTMENU_EDIT_ATTRIBUTE = "Edit attribute"; - -/* DESC: Context menu item for editing an attribute value in the DOM view. */ -ui_strings.M_CONTEXTMENU_EDIT_ATTRIBUTE_VALUE = "Edit attribute value"; - -/* DESC: Context menu item to edit a color in the color palette. */ -ui_strings.M_CONTEXTMENU_EDIT_COLOR = "Edit color"; - -/* DESC: Context menu item for breakpoints to edit a condition. */ -ui_strings.M_CONTEXTMENU_EDIT_CONDITION = "Edit condition"; - -/* DESC: Context menu item for editiing a declaration in a rule. */ -ui_strings.M_CONTEXTMENU_EDIT_DECLARATION = "Edit declaration"; - -/* DESC: Context menu item for editing some piece of markup in the DOM view. */ -ui_strings.M_CONTEXTMENU_EDIT_MARKUP = "Edit markup"; - -/* DESC: Context menu item for editing text in the DOM view. */ -ui_strings.M_CONTEXTMENU_EDIT_TEXT = "Edit text"; - -/* DESC: Context menu item for enabling a breakpoint. */ -ui_strings.M_CONTEXTMENU_ENABLE_BREAKPOINT = "Enable breakpoint"; - -/* DESC: Context menu item for expanding a node subtree. */ -ui_strings.M_CONTEXTMENU_EXPAND_SUBTREE = "Expand subtree"; - -/* DESC: Context menu item for showing the color picker. */ -ui_strings.M_CONTEXTMENU_OPEN_COLOR_PICKER = "Open color picker"; - -/* DESC: Context menu item for removing a property in a rule. */ -ui_strings.M_CONTEXTMENU_REMOVE_DECLARATION = "Delete declaration"; - -/* DESC: Context menu item for removing a node in the DOM view. */ -ui_strings.M_CONTEXTMENU_REMOVE_NODE = "Delete node"; - -/* DESC: Show resource context menu entry. */ -ui_strings.M_CONTEXTMENU_SHOW_RESOURCE = "Show resource"; - -/* DESC: Context menu item for specification links. */ -ui_strings.M_CONTEXTMENU_SPEC_LINK = "Specification for \"%s\""; - -/* DESC: Context menu item for adding an item in the storage view. */ -ui_strings.M_CONTEXTMENU_STORAGE_ADD = "Add item"; - -/* DESC: Context menu item for deleting an item in the storage view. */ -ui_strings.M_CONTEXTMENU_STORAGE_DELETE = "Delete item"; - -/* DESC: Context menu item for editing an item in the storage view, where %s is the domain name. */ -ui_strings.M_CONTEXTMENU_STORAGE_DELETE_ALL_FROM = "Delete all from %s"; - -/* DESC: Context menu item for deleting multiple items in the storage view. */ -ui_strings.M_CONTEXTMENU_STORAGE_DELETE_PLURAL = "Delete items"; - -/* DESC: Context menu item for editing an item in the storage view. */ -ui_strings.M_CONTEXTMENU_STORAGE_EDIT = "Edit item"; - -/* DESC: Label for option that clears all errors */ -ui_strings.M_LABEL_CLEAR_ALL_ERRORS = "Clear all errors"; - -/* DESC: Label for user interface language dropdown in settings */ -ui_strings.M_LABEL_UI_LANGUAGE = "User interface language"; - -/* DESC: Label for request body input in network crafter */ -ui_strings.M_NETWORK_CRAFTER_REQUEST_BODY = "Request body"; - -/* DESC: Label for response body input in network crafter */ -ui_strings.M_NETWORK_CRAFTER_RESPONSE_BODY = "Response"; - -/* DESC: Label for send request button in network crafter */ -ui_strings.M_NETWORK_CRAFTER_SEND = "Send request"; - -/* DESC: Label for request duration */ -ui_strings.M_NETWORK_REQUEST_DETAIL_DURATION = "Duration"; - -/* DESC: Label for get response body int network request view */ -ui_strings.M_NETWORK_REQUEST_DETAIL_GET_RESPONSE_BODY_LABEL = "Get response body"; - -/* DESC: Label request status */ -ui_strings.M_NETWORK_REQUEST_DETAIL_STATUS = "Status"; - -/* DESC: General settings label. */ -ui_strings.M_SETTING_LABEL_GENERAL = "General"; - -/* DESC: Context menu entry to selecting to group by %s */ -ui_strings.M_SORTABLE_TABLE_CONTEXT_GROUP_BY = "Group by \"%s\""; - -/* DESC: Context menu entry to select that there should be no grouping in the table */ -ui_strings.M_SORTABLE_TABLE_CONTEXT_NO_GROUPING = "No grouping"; - -/* DESC: Context menu entry to reset the columns that are shown */ -ui_strings.M_SORTABLE_TABLE_CONTEXT_RESET_COLUMNS = "Reset columns"; - -/* DESC: Context menu entry to reset the sort order */ -ui_strings.M_SORTABLE_TABLE_CONTEXT_RESET_SORT = "Reset sorting"; - -/* DESC: view that shows all resources */ -ui_strings.M_VIEW_LABEL_ALL_RESOURCES = "All resources"; - -/* DESC: view to set and remove breakpoints */ -ui_strings.M_VIEW_LABEL_BREAKPOINTS = "Breakpoints"; - -/* DESC: Tab heading for area for call stack overview, a list of function calls. */ -ui_strings.M_VIEW_LABEL_CALLSTACK = "Call Stack"; - -/* DESC: Label of the pixel magnifier and color picker view */ -ui_strings.M_VIEW_LABEL_COLOR_MAGNIFIER_AND_PICKER = "Pixel Magnifier and Color Picker"; - -/* DESC: View of the palette of the stored colors. */ -ui_strings.M_VIEW_LABEL_COLOR_PALETTE = "Color Palette"; - -/* DESC: View of the palette of the stored colors. */ -ui_strings.M_VIEW_LABEL_COLOR_PALETTE_SHORT = "Palette"; - -/* DESC: View with a screenshot to select a color. */ -ui_strings.M_VIEW_LABEL_COLOR_PICKER = "Color Picker"; - -/* DESC: Label of the section for selecting a color in color picker */ -ui_strings.M_VIEW_LABEL_COLOR_SELECT = "Color Select"; - -/* DESC: Command line. */ -ui_strings.M_VIEW_LABEL_COMMAND_LINE = "Console"; - -/* DESC: View for DOM debugging. */ -ui_strings.M_VIEW_LABEL_COMPOSITE_DOM = "Documents"; - -/* DESC: View for error log. */ -ui_strings.M_VIEW_LABEL_COMPOSITE_ERROR_CONSOLE = "Errors"; - -/* DESC: Tab heading for the view for exported code. */ -ui_strings.M_VIEW_LABEL_COMPOSITE_EXPORTS = "Export"; - -/* DESC: Tab heading for the view for script debuggingand Settings label. */ -ui_strings.M_VIEW_LABEL_COMPOSITE_SCRIPTS = "Scripts"; - -/* DESC: Menu heading, expandable, for displaying the styles that the rendering computed from all stylesheets. */ -ui_strings.M_VIEW_LABEL_COMPUTED_STYLE = "Computed Style"; - -/* DESC: The view on the console. */ -ui_strings.M_VIEW_LABEL_CONSOLE = "Error Panels"; - -/* DESC: view for cookies */ -ui_strings.M_VIEW_LABEL_COOKIES = "Cookies"; - -/* DESC: View to see the DOM tree. */ -ui_strings.M_VIEW_LABEL_DOM = "DOM Panel"; - -/* DESC: Tab heading for the list of properties of a selected DOM node and a Settings label. */ -ui_strings.M_VIEW_LABEL_DOM_ATTR = "Properties"; - -/* DESC: Tab heading for area giving information of the runtime environment. */ -ui_strings.M_VIEW_LABEL_ENVIRONMENT = "Environment"; - -/* DESC: Tab heading, subhead under the Error Console tab for the error view filter for showing all errors. */ -ui_strings.M_VIEW_LABEL_ERROR_ALL = "All"; - -/* DESC: See Opera Error console: Error view filter for showing all Bittorrent errors. */ -ui_strings.M_VIEW_LABEL_ERROR_BITTORRENT = "BitTorrent"; - -/* DESC: Tab heading, subhead under the Error Console tab for the error view filter for showing all CSS errors. */ -ui_strings.M_VIEW_LABEL_ERROR_CSS = "CSS"; - -/* DESC: Tab heading, subhead under the Error Console tab for the error view filter for showing all HTML errors. */ -ui_strings.M_VIEW_LABEL_ERROR_HTML = "HTML"; - -/* DESC: Tab heading, subhead under the Error Console tab for the error view filter for showing all Java errors. */ -ui_strings.M_VIEW_LABEL_ERROR_JAVA = "Java"; - -/* DESC: Tooltip that explains File:Line notation (e.g. in Error Log) */ -ui_strings.M_VIEW_LABEL_ERROR_LOCATION_TITLE = "Line %(LINE)s in %(URI)s"; - -/* DESC: Tab heading, subhead under the Error Console tab for the error view filter for showing all Mail errors. */ -ui_strings.M_VIEW_LABEL_ERROR_M2 = "Mail"; - -/* DESC: Tab heading, subhead under the Error Console tab for the error view filter for showing all Network errors. */ -ui_strings.M_VIEW_LABEL_ERROR_NETWORK = "Network"; - -/* DESC: Tab heading, subhead under the Error Console tab for the error view filter for showing errors that we don't have a dedicated tab for. */ -ui_strings.M_VIEW_LABEL_ERROR_OTHER = "Other"; - -/* DESC: Tab heading, subhead under the Error Console tab for the error view filter for showing all JS errors. */ -ui_strings.M_VIEW_LABEL_ERROR_SCRIPT = "JavaScript"; - -/* DESC: Tab heading, subhead under the Error Console tab for the error view filter for showing all Storage errors. */ -ui_strings.M_VIEW_LABEL_ERROR_STORAGE = "Storage"; - -/* DESC: Tab heading, subhead under the Error Console tab for the error view filter for showing all SVG errors. */ -ui_strings.M_VIEW_LABEL_ERROR_SVG = "SVG"; - -/* DESC: See Opera Error console: Error view filter for showing all Widget errors. */ -ui_strings.M_VIEW_LABEL_ERROR_WIDGET = "Widgets"; - -/* DESC: Tab heading, subhead under the Error Console tab for the error view filter for showing all XML errors. */ -ui_strings.M_VIEW_LABEL_ERROR_XML = "XML"; - -/* DESC: Tab heading, subhead under the Error Console tab for the error view filter for showing all XSLT errors. */ -ui_strings.M_VIEW_LABEL_ERROR_XSLT = "XSLT"; - -/* DESC: view to set and remove event breakpoints */ -ui_strings.M_VIEW_LABEL_EVENT_BREAKPOINTS = "Event Breakpoints"; - -/* DESC: Side panel view with event listeners. */ -ui_strings.M_VIEW_LABEL_EVENT_LISTENERS = "Listeners"; - -/* DESC: View with all event listeners. */ -ui_strings.M_VIEW_LABEL_EVENT_LISTENERS_ALL = "All"; - -/* DESC: View with the event listeners of the selected node. */ -ui_strings.M_VIEW_LABEL_EVENT_LISTENERS_SELECTED_NODE = "Selected Node"; - -/* DESC: Heading for Export button, accessed by clicking the subhead DOM view button. */ -ui_strings.M_VIEW_LABEL_EXPORT = "Export"; - -/* DESC: Tab heading for the area displaying JS properties of a frame or object and a Settings label. */ -ui_strings.M_VIEW_LABEL_FRAME_INSPECTION = "Inspection"; - -/* DESC: Label for a utility window that enables the user to enter a line number, and go to that line. */ -ui_strings.M_VIEW_LABEL_GO_TO_LINE = "Go to line"; - -/* DESC: Tab heading for the box model layout display and a Settings label. */ -ui_strings.M_VIEW_LABEL_LAYOUT = "Layout"; - -/* DESC: view for the local storage */ -ui_strings.M_VIEW_LABEL_LOCAL_STORAGE = "Local Storage"; - -/* DESC: Label for the setting of the monospace font. */ -ui_strings.M_VIEW_LABEL_MONOSPACE_FONT = "Monospace Font"; - -/* DESC: Tab heading for the view for network debugging (and http logger) */ -ui_strings.M_VIEW_LABEL_NETWORK = "Network"; - -/* DESC: view that shows network log */ -ui_strings.M_VIEW_LABEL_NETWORK_LOG = "Network log"; - -/* DESC: view that shows network options */ -ui_strings.M_VIEW_LABEL_NETWORK_OPTIONS = "Network options"; - -/* DESC: Section title for new styles. */ -ui_strings.M_VIEW_LABEL_NEW_STYLE = "New Style"; - -/* DESC: Text to show in call stack when the execution is not stopped. */ -ui_strings.M_VIEW_LABEL_NOT_STOPPED = "Not stopped"; - -/* DESC: Text to show in breakpoins if there is no breakpoint. */ -ui_strings.M_VIEW_LABEL_NO_BREAKPOINT = "No breakpoint"; - -/* DESC: Text to show in inspection if there is no object to inspect. */ -ui_strings.M_VIEW_LABEL_NO_INSPECTION = "No inspection"; - -/* DESC: The content of the return value section when there are not return values. */ -ui_strings.M_VIEW_LABEL_NO_RETURN_VALUES = "No return values"; - -/* DESC: Text to show in watches if there are no watches */ -ui_strings.M_VIEW_LABEL_NO_WATCHES = "No watches"; - -/* DESC: View for DOM debugging. */ -ui_strings.M_VIEW_LABEL_PROFILER = "Profiler"; - -/* DESC: Name of raw request tab */ -ui_strings.M_VIEW_LABEL_RAW_REQUEST_INFO = "Raw request"; - -/* DESC: Name of raw response tab */ -ui_strings.M_VIEW_LABEL_RAW_RESPONSE_INFO = "Raw Response"; - -/* DESC: view that shows request crafter */ -ui_strings.M_VIEW_LABEL_REQUEST_CRAFTER = "Make request"; - -/* DESC: Name of request headers tab */ -ui_strings.M_VIEW_LABEL_REQUEST_HEADERS = "Request Headers"; - -/* DESC: Name of request log tab */ -ui_strings.M_VIEW_LABEL_REQUEST_LOG = "Request log"; - -/* DESC: Name of request summary view */ -ui_strings.M_VIEW_LABEL_REQUEST_SUMMARY = "Request Summary"; - -/* DESC: View for overview of resources contained in a document */ -ui_strings.M_VIEW_LABEL_RESOURCES = "Resources"; - -/* DESC: Name of response body tab */ -ui_strings.M_VIEW_LABEL_RESPONSE_BODY = "Response body"; - -/* DESC: Name of response headers tab */ -ui_strings.M_VIEW_LABEL_RESPONSE_HEADERS = "Response Headers"; - -/* DESC: Section in the script side panel for return values. */ -ui_strings.M_VIEW_LABEL_RETURN_VALUES = "Return Values"; - -/* DESC: side panel in the script view with the callstack and the inspection view. */ -ui_strings.M_VIEW_LABEL_RUNTIME_STATE = "State"; - -/* DESC: Subhead located under the Scripts area, for scripts contained in runtime. */ -ui_strings.M_VIEW_LABEL_SCRIPTS = "Scripts"; - -/* DESC: Tab heading for the search panel. */ -ui_strings.M_VIEW_LABEL_SEARCH = "Search"; - -/* DESC: view for the session storage */ -ui_strings.M_VIEW_LABEL_SESSION_STORAGE = "Session Storage"; - -/* DESC: Tab heading for area giving source code view and Settings label . */ -ui_strings.M_VIEW_LABEL_SOURCE = "Source"; - -/* DESC: View for all types of storage, cookies, localStorage, sessionStorage e.t.c */ -ui_strings.M_VIEW_LABEL_STORAGE = "Storage"; - -/* DESC: Label of the stored colors view */ -ui_strings.M_VIEW_LABEL_STORED_COLORS = "Color Palette"; - -/* DESC: Tab heading for the list of all applied styles and a Settings label; also menu heading, expandable, for displaying the styles that got defined in the style sheets. */ -ui_strings.M_VIEW_LABEL_STYLES = "Styles"; - -/* DESC: Tab heading for the view to see style sheet rules and a Settings label. */ -ui_strings.M_VIEW_LABEL_STYLESHEET = "Style Sheet"; - -/* DESC: Tab heading, a subhead under DOM, for area displaying style sheets in the runtime. */ -ui_strings.M_VIEW_LABEL_STYLESHEETS = "Style Sheets"; - -/* DESC: Tab heading for thread log overview, a list of threads and Settings label. */ -ui_strings.M_VIEW_LABEL_THREAD_LOG = "Thread Log"; - -/* DESC: View for utilities, e.g. a pixel maginfier and color picker */ -ui_strings.M_VIEW_LABEL_UTILITIES = "Utilities"; - -/* DESC: Label of the Views menu. */ -ui_strings.M_VIEW_LABEL_VIEWS = "Views"; - -/* DESC: section in the script side panel for watches. */ -ui_strings.M_VIEW_LABEL_WATCHES = "Watches"; - -/* DESC: view for widget prefernces */ -ui_strings.M_VIEW_LABEL_WIDGET_PREFERNCES = "Widget Preferences"; - -/* DESC: Label for the layout subview showing the box-model metrics of an element. */ -ui_strings.M_VIEW_SUB_LABEL_METRICS = "Metrics"; - -/* DESC: Label for the layout subvie showing offsets of the selected element. */ -ui_strings.M_VIEW_SUB_LABEL_OFFSET_VALUES = "Offset Values"; - -/* DESC: Label for the layout subview showing the parent node chain used to calculate the offset. */ -ui_strings.M_VIEW_SUB_LABEL_PARENT_OFFSETS = "Parent Offsets"; - -/* DESC: Anonymous function label. */ -ui_strings.S_ANONYMOUS_FUNCTION_NAME = "(anonymous)"; - -/* DESC: Info in a tooltip that the according listener was set as attribute. */ -ui_strings.S_ATTRIBUTE_LISTENER = "Event handler"; - -/* DESC: Generic label for a cancel button */ -ui_strings.S_BUTTON_CANCEL = "Cancel"; - -/* DESC: Cancel button while the client is waiting for a host connection. */ -ui_strings.S_BUTTON_CANCEL_REMOTE_DEBUG = "Cancel Remote Debug"; - -/* DESC: Reset all the values to their default state */ -ui_strings.S_BUTTON_COLOR_RESTORE_DEFAULTS = "Restore defaults"; - -/* DESC: Edit custom events */ -ui_strings.S_BUTTON_EDIT_CUSTOM_EVENT = "Edit"; - -/* DESC: Enter anvanced search mode */ -ui_strings.S_BUTTON_ENTER_ADVANCED_SEARCH = "More"; - -/* DESC: Enter anvanced search mode tooltip */ -ui_strings.S_BUTTON_ENTER_ADVANCED_SEARCH_TOOLTIP = "Show advanced search"; - -/* DESC: Expand all sections in the event breakpoints view */ -ui_strings.S_BUTTON_EXPAND_ALL_SECTIONS = "Expand all sections"; - -/* DESC: Execution stops at encountering an abort. */ -ui_strings.S_BUTTON_LABEL_AT_ABORT = "Stop when encountering an abort message"; - -/* DESC: Execution stops when encountering an error. */ -ui_strings.S_BUTTON_LABEL_AT_ERROR = "Show parse errors and break on exceptions"; - -/* DESC: Execution stops when encountering an exception. */ -ui_strings.S_BUTTON_LABEL_AT_EXCEPTION = "Break when an exception is thrown"; - -/* DESC: Empties the log entries. */ -ui_strings.S_BUTTON_LABEL_CLEAR_LOG = "Clear visible errors"; - -/* DESC: Tooltip text for a button on the Thread Log view to clear thread log. */ -ui_strings.S_BUTTON_LABEL_CLEAR_THREAD_LOG = "Clear thread log"; - -/* DESC: Closes the window. */ -ui_strings.S_BUTTON_LABEL_CLOSE_WINDOW = "Close window"; - -/* DESC: Debugger continues debugging. */ -ui_strings.S_BUTTON_LABEL_CONTINUE = "Continue (%s)"; - -/* DESC: Exports the DOM currently shown. */ -ui_strings.S_BUTTON_LABEL_EXPORT_DOM = "Export the current DOM panel"; - -/* DESC: Also Tooltip text for a button on the Thread Log view to export current thread log. */ -ui_strings.S_BUTTON_LABEL_EXPORT_LOG = "Export thread log"; - -/* DESC: Tooltip text for a button under the secondary DOM tab that expands the DOM tree completely. */ -ui_strings.S_BUTTON_LABEL_GET_THE_WOHLE_TREE = "Expand the DOM tree"; - -/* DESC: Opens help. */ -ui_strings.S_BUTTON_LABEL_HELP = "Help"; - -/* DESC: Hides all default properties in the global scope. */ -ui_strings.S_BUTTON_LABEL_HIDE_DEFAULT_PROPS_IN_GLOBAL_SCOPE = "Show default properties in global scope"; - -/* DESC: List item under the Source settings menu to logs all threads when activated. Also Tooltip text for a button on the Source tab. */ -ui_strings.S_BUTTON_LABEL_LOG_THREADS = "Log threads"; - -/* DESC: Refetch the event listeners. */ -ui_strings.S_BUTTON_LABEL_REFETCH_EVENT_LISTENERS = "Refetch event listeners"; - -/* DESC: Enable reformatting of JavaScript. */ -ui_strings.S_BUTTON_LABEL_REFORMAT_JAVASCRIPT = "Pretty print JavaScript"; - -/* DESC: Tooltip text for a button under the Scripts tab that reloads the browser to receive fresh DOM, etc. */ -ui_strings.S_BUTTON_LABEL_RELOAD_HOST = "Reload the selected window in the browser"; - -/* DESC: For selecting which window to debug. */ -ui_strings.S_BUTTON_LABEL_SELECT_WINDOW = "Select the debugging context you want to debug"; - -/* DESC: Tooltip text for the Settings button that launches the Settings view. */ -ui_strings.S_BUTTON_LABEL_SETTINGS = "Settings"; - -/* DESC: Debugger step into current statement. */ -ui_strings.S_BUTTON_LABEL_STEP_INTO = "Step into (%s)"; - -/* DESC: Debugger step out from current statement. */ -ui_strings.S_BUTTON_LABEL_STEP_OUT = "Step out (%s)"; - -/* DESC: Debugger step over current statement. */ -ui_strings.S_BUTTON_LABEL_STEP_OVER = "Step over (%s)"; - -/* DESC: Execution stops when a new script is encountered. */ -ui_strings.S_BUTTON_LABEL_STOP_AT_THREAD = "Break on first statement of a new script"; - -/* DESC: Leave anvanced search mode */ -ui_strings.S_BUTTON_LEAVE_ADVANCED_SEARCH = "Less"; - -/* DESC: Leave anvanced search mode tooltip */ -ui_strings.S_BUTTON_LEAVE_ADVANCED_SEARCH_TOOLTIP = "Show search bar"; - -/* DESC: Button label to show window for loading a PO file */ -ui_strings.S_BUTTON_LOAD_PO_FILE = "Load PO file"; - -/* DESC: Generic label for an OK button */ -ui_strings.S_BUTTON_OK = "OK"; - -/* DESC: Remove all event breakpoints */ -ui_strings.S_BUTTON_REMOVE_ALL_BREAKPOINTS = "Delete all event breakpoints"; - -/* DESC: Reset all keyboard shortcuts to the default values. */ -ui_strings.S_BUTTON_RESET_ALL_TO_DEFAULTS = "Reset all to defaults"; - -/* DESC: Button label to reset the fon selection to the default values */ -ui_strings.S_BUTTON_RESET_TO_DEFAULTS = "Reset default values"; - -/* DESC: Generic label for a save button */ -ui_strings.S_BUTTON_SAVE = "Save"; - -/* DESC: Search for an event in the event breakpoints view */ -ui_strings.S_BUTTON_SEARCH_EVENT = "Search for an event"; - -/* DESC: Search for a keyboard shortcut in the keyboard configuration view */ -ui_strings.S_BUTTON_SEARCH_SHORTCUT = "Search keyboard shortcuts"; - -/* DESC: Set the default value. */ -ui_strings.S_BUTTON_SET_DEFAULT_VALUE = "Reset default value"; - -/* DESC: Show request headers. */ -ui_strings.S_BUTTON_SHOW_REQUEST_HEADERS = "Headers"; - -/* DESC: Show raw request. */ -ui_strings.S_BUTTON_SHOW_REQUEST_RAW = "Raw"; - -/* DESC: Show request summary. */ -ui_strings.S_BUTTON_SHOW_REQUEST_SUMMARY = "Summary"; - -/* DESC: Button label in settings to reset the element highlight to the default values */ -ui_strings.S_BUTTON_SPOTLIGHT_RESET_DEFAULT_COLORS = "Reset default colors"; - -/* DESC: Button title for starting the profiler */ -ui_strings.S_BUTTON_START_PROFILER = "Start profiling"; - -/* DESC: Button title for stopping the profiler */ -ui_strings.S_BUTTON_STOP_PROFILER = "Stop profiling"; - -/* DESC: Button label to delete all items in a storage, e.g. the local storage */ -ui_strings.S_BUTTON_STORAGE_DELETE_ALL = "Delete All"; - -/* DESC: Button label to store the color */ -ui_strings.S_BUTTON_STORE_COLOR = "Store color"; - -/* DESC: Button to switch to network-profiler mode. */ -ui_strings.S_BUTTON_SWITCH_TO_NETWORK_PROFILER = "Improve accuracy of timing information"; - -/* DESC: Button label to take a screenshot */ -ui_strings.S_BUTTON_TAKE_SCREENSHOT = "Take screenshot"; - -/* DESC: Label for button in Remote Debugging that applies the changes. */ -ui_strings.S_BUTTON_TEXT_APPLY = "Apply"; - -/* DESC: Global console toggle */ -ui_strings.S_BUTTON_TOGGLE_CONSOLE = "Toggle console"; - -/* DESC: Global remote debug toggle */ -ui_strings.S_BUTTON_TOGGLE_REMOTE_DEBUG = "Remote debug configuration"; - -/* DESC: Global settings toggle */ -ui_strings.S_BUTTON_TOGGLE_SETTINGS = "Settings"; - -/* DESC: Button label to update the screenshot */ -ui_strings.S_BUTTON_UPDATE_SCREESHOT = "Update screenshot"; - -/* DESC: Unit string for bytes */ -ui_strings.S_BYTES_UNIT = "bytes"; - -/* DESC: Clears the command line log */ -ui_strings.S_CLEAR_COMMAND_LINE_LOG = "Clear console"; - -/* DESC: Label on button to clear network graph */ -ui_strings.S_CLEAR_NETWORK_LOG = "Clear network log"; - -/* DESC: Close command line window */ -ui_strings.S_CLOSE_COMMAND_LINE = "Close console"; - -/* DESC: Setting for changing the color notation (Hex, RGB, HSL) */ -ui_strings.S_COLOR_NOTATION = "Color format"; - -/* DESC: Average color setting, " x pixels" will be added */ -ui_strings.S_COLOR_PICKER_AVERAGE_COLOR_OF = "Average color of"; - -/* DESC: Table heading for column showing error descriptions */ -ui_strings.S_COLUMN_LABEL_ERROR = "Error"; - -/* DESC: Table heading for "file" column */ -ui_strings.S_COLUMN_LABEL_FILE = "File"; - -/* DESC: Table heading for column showing line number */ -ui_strings.S_COLUMN_LABEL_LINE = "Line"; - -/* DESC: Message about having to load a different version of dragonfly in order to work with the browser bing debugged */ -ui_strings.S_CONFIRM_LOAD_COMPATIBLE_VERSION = "The protocol version of Opera does not match the one which Opera Dragonfly is using.\n\nTry to load a compatible version?"; - -/* DESC: Dialog to confirm switching to network-profiler mode. */ -ui_strings.S_CONFIRM_SWITCH_TO_NETWORK_PROFILER = "To improve the accuracy of timing information, other features are turned off. You may lose changes you made."; - -/* DESC: Label for the list of function when doing console.trace(). */ -ui_strings.S_CONSOLE_TRACE_LABEL = "Stack trace:"; - -/* DESC: In 1 hour */ -ui_strings.S_COOKIE_MANAGER_IN_1_HOUR = "In 1 hour"; - -/* DESC: In 1 minute */ -ui_strings.S_COOKIE_MANAGER_IN_1_MINUTE = "In 1 minute"; - -/* DESC: In 1 month */ -ui_strings.S_COOKIE_MANAGER_IN_1_MONTH = "In 1 month"; - -/* DESC: In 1 week */ -ui_strings.S_COOKIE_MANAGER_IN_1_WEEK = "In 1 week"; - -/* DESC: In 1 year */ -ui_strings.S_COOKIE_MANAGER_IN_1_YEAR = "In 1 year"; - -/* DESC: In x days */ -ui_strings.S_COOKIE_MANAGER_IN_X_DAYS = "In %s days"; - -/* DESC: In x hours */ -ui_strings.S_COOKIE_MANAGER_IN_X_HOURS = "In %s hours"; - -/* DESC: In x minutes */ -ui_strings.S_COOKIE_MANAGER_IN_X_MINUTES = "In %s minutes"; - -/* DESC: In x months */ -ui_strings.S_COOKIE_MANAGER_IN_X_MONTHS = "In %s months"; - -/* DESC: In x weeks */ -ui_strings.S_COOKIE_MANAGER_IN_X_WEEKS = "In %s weeks"; - -/* DESC: In x years */ -ui_strings.S_COOKIE_MANAGER_IN_X_YEARS = "In %s years"; - -/* DESC: In less then 1 minute */ -ui_strings.S_COOKIE_MANAGER_SOONER_THEN_1_MINUTE = "< 1 minute"; - -/* DESC: Tomorrow */ -ui_strings.S_COOKIE_MANAGER_TOMORROW = "Tomorrow"; - -/* DESC: Tooltip for disabling a declaration */ -ui_strings.S_DISABLE_DECLARATION = "Disable"; - -/* DESC: Prefix before debug output */ -ui_strings.S_DRAGONFLY_INFO_MESSAGE = "Opera Dragonfly info message:\n"; - -/* DESC: Tooltip for enabling a declaration */ -ui_strings.S_ENABLE_DECLARATION = "Enable"; - -/* DESC: Info text that explains that only a certain number %(MAX)s of Errors is shown, out of a total of %(COUNT)s */ -ui_strings.S_ERRORS_MAXIMUM_REACHED = "Displaying %(MAX)s of %(COUNT)s errors"; - -/* DESC: List of filters that will be hidden in the Error log */ -ui_strings.S_ERROR_LOG_CSS_FILTER = "Use CSS filter"; - -/* DESC: Link in an event listener tooltip to the source position where the listener is added. */ -ui_strings.S_EVENT_LISTENER_ADDED_IN = "Added in %s"; - -/* DESC: Info in an event listener tooltip that the according listener was added in the markup as element attribute. */ -ui_strings.S_EVENT_LISTENER_SET_AS_MARKUP_ATTR = "Set as markup attribute"; - -/* DESC: Info in a tooltip that the according listener was set by the event target interface. */ -ui_strings.S_EVENT_TARGET_LISTENER = "Event listener"; - -/* DESC: Event type for events in the profiler */ -ui_strings.S_EVENT_TYPE_CSS_PARSING = "CSS parsing"; - -/* DESC: Event type for events in the profiler */ -ui_strings.S_EVENT_TYPE_CSS_SELECTOR_MATCHING = "CSS selector matching"; - -/* DESC: Event type for events in the profiler */ -ui_strings.S_EVENT_TYPE_DOCUMENT_PARSING = "Document parsing"; - -/* DESC: Event type for events in the profiler */ -ui_strings.S_EVENT_TYPE_GENERIC = "Generic"; - -/* DESC: Event type for events in the profiler */ -ui_strings.S_EVENT_TYPE_LAYOUT = "Layout"; - -/* DESC: Event type for events in the profiler */ -ui_strings.S_EVENT_TYPE_PAINT = "Paint"; - -/* DESC: Event type for events in the profiler */ -ui_strings.S_EVENT_TYPE_PROCESS = "Process"; - -/* DESC: Event type for events in the profiler */ -ui_strings.S_EVENT_TYPE_REFLOW = "Reflow"; - -/* DESC: Event type for events in the profiler */ -ui_strings.S_EVENT_TYPE_SCRIPT_COMPILATION = "Script compilation"; - -/* DESC: Event type for events in the profiler */ -ui_strings.S_EVENT_TYPE_STYLE_RECALCULATION = "Style recalculation"; - -/* DESC: Event type for events in the profiler */ -ui_strings.S_EVENT_TYPE_THREAD_EVALUATION = "Thread evaluation"; - -/* DESC: Context menu item for expanding CSS shorthands */ -ui_strings.S_EXPAND_SHORTHANDS = "Expand shorthands"; - -/* DESC: Label for the global keyboard shortcuts section */ -ui_strings.S_GLOBAL_KEYBOARD_SHORTCUTS_SECTION_TITLE = "Global"; - -/* DESC: Global scope label. */ -ui_strings.S_GLOBAL_SCOPE_NAME = "(global)"; - -/* DESC: Show help in command line */ -ui_strings.S_HELP_COMMAND_LINE = "Help"; - -/* DESC: Label for http event sequence when urlfinished follows after some other event, meaning it was aborted */ -ui_strings.S_HTTP_EVENT_SEQUENCE_INFO_ABORTING_REQUEST = "Request aborted"; - -/* DESC: Label for http event sequence when redirecting */ -ui_strings.S_HTTP_EVENT_SEQUENCE_INFO_ABORT_RETRYING = "Sequence terminated, retry"; - -/* DESC: Label for http event sequence when closing response phase */ -ui_strings.S_HTTP_EVENT_SEQUENCE_INFO_CLOSING_RESPONSE_PHASE = "Closing response phase"; - -/* DESC: Label for http event sequence when processing */ -ui_strings.S_HTTP_EVENT_SEQUENCE_INFO_PROCESSING = "Processing"; - -/* DESC: Label for http event sequence when processing response */ -ui_strings.S_HTTP_EVENT_SEQUENCE_INFO_PROCESSING_RESPONSE = "Processing response"; - -/* DESC: Label for http event sequence when reading local data (data-uri, caches, file:// etc) */ -ui_strings.S_HTTP_EVENT_SEQUENCE_INFO_READING_LOCAL_DATA = "Reading local data"; - -/* DESC: Label for http event sequence when redirecting */ -ui_strings.S_HTTP_EVENT_SEQUENCE_INFO_REDIRECTING = "Redirecting"; - -/* DESC: Label for http event sequence when the event was scheduled */ -ui_strings.S_HTTP_EVENT_SEQUENCE_INFO_SCHEDULING = "Scheduling request"; - -/* DESC: Label for http event sequence when reading response body */ -ui_strings.S_HTTP_EVENT_SEQUENCE_READING_RESPONSE_BODY = "Reading response body"; - -/* DESC: Label for http event sequence when reading response header */ -ui_strings.S_HTTP_EVENT_SEQUENCE_READING_RESPONSE_HEADER = "Reading response header"; - -/* DESC: Label for http event sequence when waiting for response from network */ -ui_strings.S_HTTP_EVENT_SEQUENCE_WAITING_FOR_RESPONSE = "Waiting for response"; - -/* DESC: Label for http event sequence when writing request body */ -ui_strings.S_HTTP_EVENT_SEQUENCE_WRITING_REQUEST_BODY = "Writing request body"; - -/* DESC: Label for http event sequence when writing request header */ -ui_strings.S_HTTP_EVENT_SEQUENCE_WRITING_REQUEST_HEADER = "Writing request header"; - -/* DESC: First line of dialog that explains that the loading flow of the context is not shown completely */ -ui_strings.S_HTTP_INCOMPLETE_LOADING_GRAPH = "Reload to show all page requests"; - -/* DESC: tooltip for the network data view button */ -ui_strings.S_HTTP_LABEL_DATA_VIEW = "Data view"; - -/* DESC: label for table header that shows duration (short) */ -ui_strings.S_HTTP_LABEL_DURATION = "Duration"; - -/* DESC: label for the network filter that shows all items */ -ui_strings.S_HTTP_LABEL_FILTER_ALL = "All"; - -/* DESC: label for the network filter that shows image items */ -ui_strings.S_HTTP_LABEL_FILTER_IMAGES = "Images"; - -/* DESC: label for the network filter that shows markup items */ -ui_strings.S_HTTP_LABEL_FILTER_MARKUP = "Markup"; - -/* DESC: label for the network filter that shows items that are not markup, stylesheet, script or image */ -ui_strings.S_HTTP_LABEL_FILTER_OTHER = "Other"; - -/* DESC: label for the network filter that shows script items */ -ui_strings.S_HTTP_LABEL_FILTER_SCRIPTS = "Scripts"; - -/* DESC: label for the network filter that shows stylesheet items */ -ui_strings.S_HTTP_LABEL_FILTER_STYLESHEETS = "Stylesheets"; - -/* DESC: label for the network filter that shows items requested over XMLHttpRequest */ -ui_strings.S_HTTP_LABEL_FILTER_XHR = "XHR"; - -/* DESC: label for table header that shows loading sequence as a graph (short) */ -ui_strings.S_HTTP_LABEL_GRAPH = "Graph"; - -/* DESC: tooltip for the network graph view button */ -ui_strings.S_HTTP_LABEL_GRAPH_VIEW = "Graph view"; - -/* DESC: label for host in http request details */ -ui_strings.S_HTTP_LABEL_HOST = "Host"; - -/* DESC: label for method in http request details */ -ui_strings.S_HTTP_LABEL_METHOD = "Method"; - -/* DESC: label for path in http request details */ -ui_strings.S_HTTP_LABEL_PATH = "Path"; - -/* DESC: label for query arguments in http request details */ -ui_strings.S_HTTP_LABEL_QUERY_ARGS = "Query arguments"; - -/* DESC: label for response in http request details */ -ui_strings.S_HTTP_LABEL_RESPONSE = "Response"; - -/* DESC: label for table header that shows http response code (short) */ -ui_strings.S_HTTP_LABEL_RESPONSECODE = "Status"; - -/* DESC: label for table header that shows starting time (short) */ -ui_strings.S_HTTP_LABEL_STARTED = "Started"; - -/* DESC: label for url in http request details */ -ui_strings.S_HTTP_LABEL_URL = "URL"; - -/* DESC: label for table header that shows waiting time (short) */ -ui_strings.S_HTTP_LABEL_WAITING = "Waiting"; - -/* DESC: tooltip for resources that have not been requested over network (mostly that means cached) */ -ui_strings.S_HTTP_NOT_REQUESTED = "Cached"; - -/* DESC: Headline for network-sequence tooltip that shows the absolute time when the resource was requested internally */ -ui_strings.S_HTTP_REQUESTED_HEADLINE = "Requested at %s"; - -/* DESC: tooltip for resources served over file:// to make it explicit that this didn't touch the network */ -ui_strings.S_HTTP_SERVED_OVER_FILE = "Local"; - -/* DESC: tooltip for table header that shows duration */ -ui_strings.S_HTTP_TOOLTIP_DURATION = "Time spent between starting and finishing this request"; - -/* DESC: tooltip for the network filter that shows all items */ -ui_strings.S_HTTP_TOOLTIP_FILTER_ALL = "Show all requests"; - -/* DESC: tooltip for the network filter that shows image items */ -ui_strings.S_HTTP_TOOLTIP_FILTER_IMAGES = "Show only images"; - -/* DESC: tooltip for the network filter that shows markup items */ -ui_strings.S_HTTP_TOOLTIP_FILTER_MARKUP = "Show only markup"; - -/* DESC: tooltip for the network filter that shows items that are not markup, stylesheet, script or image */ -ui_strings.S_HTTP_TOOLTIP_FILTER_OTHER = "Show requests of other types"; - -/* DESC: tooltip for the network filter that shows script items */ -ui_strings.S_HTTP_TOOLTIP_FILTER_SCRIPTS = "Show only scripts"; - -/* DESC: tooltip for the network filter that shows stylesheet items */ -ui_strings.S_HTTP_TOOLTIP_FILTER_STYLESHEETS = "Show only stylesheets"; - -/* DESC: tooltip for the network filter that shows items requested over XMLHttpRequest */ -ui_strings.S_HTTP_TOOLTIP_FILTER_XHR = "Show only XMLHttpRequests"; - -/* DESC: tooltip for table header that shows loading sequence as a graph */ -ui_strings.S_HTTP_TOOLTIP_GRAPH = "Graph of the loading sequence"; - -/* DESC: tooltip on mime type table header */ -ui_strings.S_HTTP_TOOLTIP_MIME = "MIME type"; - -/* DESC: tooltip on protocol table header */ -ui_strings.S_HTTP_TOOLTIP_PROTOCOL = "Protocol"; - -/* DESC: tooltip on table header that shows http response code */ -ui_strings.S_HTTP_TOOLTIP_RESPONSECODE = "HTTP status code"; - -/* DESC: tooltip on size table header */ -ui_strings.S_HTTP_TOOLTIP_SIZE = "Content-length of the response in bytes"; - -/* DESC: tooltip on prettyprinted size table header */ -ui_strings.S_HTTP_TOOLTIP_SIZE_PRETTYPRINTED = "Content-length of the response"; - -/* DESC: tooltip for table header that shows relative starting time */ -ui_strings.S_HTTP_TOOLTIP_STARTED = "Starting time, relative to the main document"; - -/* DESC: tooltip for table header that shows waiting time */ -ui_strings.S_HTTP_TOOLTIP_WAITING = "Time spent requesting this resource"; - -/* DESC: tooltip-prefix for resources that have been marked unloaded, which means they are no longer reference in the document */ -ui_strings.S_HTTP_UNREFERENCED = "Unreferenced"; - -/* DESC: Information shown if the document does not hold any style sheet. */ -ui_strings.S_INFO_DOCUMENT_HAS_NO_STYLESHEETS = "This document has no style sheets"; - -/* DESC: Feedback showing that Opera Dragonfly is loading and the user shall have patience. */ -ui_strings.S_INFO_DOCUMNENT_LOADING = "Updating Opera Dragonfly‚Ķ"; - -/* DESC: There was an error trying to listen to the specified port */ -ui_strings.S_INFO_ERROR_LISTENING = "There was an error. Please check that port %s is not in use."; - -/* DESC: A info message that the debugger is currently in HTTP profiler mode. */ -/* DESC: Information shown if the user tries to perform a reg exp search with an invalid regular expression. */ -ui_strings.S_INFO_INVALID_REGEXP = "Invalid regular expression."; - -/* DESC: Info text in the settings to invert the highlight color for elements. */ -ui_strings.S_INFO_INVERT_ELEMENT_HIGHLIGHT = "The element highlight color can be inverted with the \"%s\" shortcut."; - -/* DESC: The info text to notify the user that the application is performing the search. */ -ui_strings.S_INFO_IS_SEARCHING = "Searching‚Ķ"; - -/* DESC: Info in an event listener tooltip that the according source file is missing. */ -ui_strings.S_INFO_MISSING_JS_SOURCE_FILE = "(Missing source file)"; - -/* DESC: Info text in the network view when a page starts to load while screen updats are paused */ -ui_strings.S_INFO_NETWORK_UPDATES_PAUSED = "Updating of network log is paused."; - -/* DESC: Message about there being no version of dragonfly compatible with the browser being debugged */ -ui_strings.S_INFO_NO_COMPATIBLE_VERSION = "There is no compatible Opera Dragonfly version."; - -/* DESC: Shown when entering something on the command line while there is no javascript running in the window being debugged */ -ui_strings.S_INFO_NO_JAVASCRIPT_IN_CONTEXT = "There is no JavaScript environment in the active window"; - -/* DESC: The info text in an alert box if the user has specified an invalid port number for remote debugging. */ -ui_strings.S_INFO_NO_VALID_PORT_NUMBER = "Please select a port number between %s and %s."; - -/* DESC: A info message that the debugger is currently in profiler mode. */ -ui_strings.S_INFO_PROFILER_MODE = "The debugger is in profiler mode. All other features are disabled."; - -/* DESC: Information shown if the user tries to perform a reg exp search which matches the empty string. */ -ui_strings.S_INFO_REGEXP_MATCHES_EMPTY_STRING = "RegExp matches empty string. No search was performed."; - -/* DESC: Currently no scripts are loaded and a reload of the page will resolve all linked scripts. */ -ui_strings.S_INFO_RELOAD_FOR_SCRIPT = "Click the reload button above to fetch the scripts for the selected debugging context"; - -/* DESC: Info text in when a request in the request crafter failed. */ -ui_strings.S_INFO_REQUEST_FAILED = "The request failed."; - -/* DESC: Information shown if the document does not hold any scripts. Appears in Scripts view. */ -ui_strings.S_INFO_RUNTIME_HAS_NO_SCRIPTS = "This document has no scripts"; - -/* DESC: the given storage type doesn't exist, e.g. a widget without the w3c widget namespace */ -ui_strings.S_INFO_STORAGE_TYPE_DOES_NOT_EXIST = "%s does not exist."; - -/* DESC: Information shown if the stylesheet does not hold any style rules. */ -ui_strings.S_INFO_STYLESHEET_HAS_NO_RULES = "This style sheet has no rules"; - -/* DESC: The info text to notify the user that only a part of the search results are displayed. */ -ui_strings.S_INFO_TOO_MANY_SEARCH_RESULTS = "Displaying %(MAX)s of %(COUNT)s"; - -/* DESC: Dragonfly is waiting for host connection */ -ui_strings.S_INFO_WAITING_FORHOST_CONNECTION = "Waiting for a host connection on port %s."; - -/* DESC: Information shown if the window has no runtime, e.g. speed dial. */ -ui_strings.S_INFO_WINDOW_HAS_NO_RUNTIME = "This window has no runtime"; - -/* DESC: Inhertied from, " " will be added */ -ui_strings.S_INHERITED_FROM = "Inherited from"; - -/* DESC: For filter fields. */ -ui_strings.S_INPUT_DEFAULT_TEXT_FILTER = "Filter"; - -/* DESC: Label for search fields. */ -ui_strings.S_INPUT_DEFAULT_TEXT_SEARCH = "Search"; - -/* DESC: Heading for the area where the user can configure keyboard shortcuts in settings. */ -ui_strings.S_KEYBOARD_SHORTCUTS_CONFIGURATION = "Configuration"; - -/* DESC: Context menu entry that brings up "Add watch" UI, Label for "Add watch" button */ -ui_strings.S_LABEL_ADD_WATCH = "Add watch"; - -/* DESC: Instruction in settings how to change the user language. The place holder will be replace with an according link to the user setting in opera:config. */ -ui_strings.S_LABEL_CHANGE_UI_LANGUAGE_INFO = "Change %s to one of"; - -/* DESC: A setting to define which prototypes of inspected js objects should be collapsed by default. */ -ui_strings.S_LABEL_COLLAPSED_INSPECTED_PROTOTYPES = "Default collapsed prototype objects (a list of prototypes, e.g. Object, Array, etc. * will collapse all): "; - -/* DESC: Label for the hue of a color value. */ -ui_strings.S_LABEL_COLOR_HUE = "Hue"; - -/* DESC: Label for the luminosity of a color value. */ -ui_strings.S_LABEL_COLOR_LUMINOSITY = "Luminosity"; - -/* DESC: Label for the opacity of a color value. */ -ui_strings.S_LABEL_COLOR_OPACITY = "Opacity"; - -/* DESC: Setting label to select the sample size of the color picker */ -ui_strings.S_LABEL_COLOR_PICKER_SAMPLE_SIZE = "Sample Size"; - -/* DESC: Setting label to select the zoom level of the color picker */ -ui_strings.S_LABEL_COLOR_PICKER_ZOOM = "Zoom"; - -/* DESC: Label for the saturation of a color value. */ -ui_strings.S_LABEL_COLOR_SATURATION = "Saturation"; - -/* DESC: Context menu entry that brings up "Add cookie" UI, Label for "Add Cookie" button */ -ui_strings.S_LABEL_COOKIE_MANAGER_ADD_COOKIE = "Add cookie"; - -/* DESC: Label for the domain that is set for a cookie */ -ui_strings.S_LABEL_COOKIE_MANAGER_COOKIE_DOMAIN = "Domain"; - -/* DESC: Label for the expiry when cookie has already expired */ -ui_strings.S_LABEL_COOKIE_MANAGER_COOKIE_EXPIRED = "(expired)"; - -/* DESC: Label for the expiry value of a cookie */ -ui_strings.S_LABEL_COOKIE_MANAGER_COOKIE_EXPIRES = "Expires"; - -/* DESC: Label for the expiry when cookie expires after the session is closed */ -ui_strings.S_LABEL_COOKIE_MANAGER_COOKIE_EXPIRES_ON_SESSION_CLOSE = "When session ends, e.g. the tab is closed"; - -/* DESC: Label for the expiry when cookie expires after the session is closed */ -ui_strings.S_LABEL_COOKIE_MANAGER_COOKIE_EXPIRES_ON_SESSION_CLOSE_SHORT = "Session"; - -/* DESC: Label for the name (key) of a cookie */ -ui_strings.S_LABEL_COOKIE_MANAGER_COOKIE_NAME = "Name"; - -/* DESC: Label for the value of a cookie */ -ui_strings.S_LABEL_COOKIE_MANAGER_COOKIE_PATH = "Path"; - -/* DESC: Label for the value of a cookie or storage item */ -ui_strings.S_LABEL_COOKIE_MANAGER_COOKIE_VALUE = "Value"; - -/* DESC: Context menu entry that brings up "Edit cookie" UI */ -ui_strings.S_LABEL_COOKIE_MANAGER_EDIT_COOKIE = "Edit cookie"; - -/* DESC: Label for grouping by runtime (lowercase) */ -ui_strings.S_LABEL_COOKIE_MANAGER_GROUPER_RUNTIME = "runtime"; - -/* DESC: Label for isHTTPOnly flag on a cookie */ -ui_strings.S_LABEL_COOKIE_MANAGER_HTTP_ONLY = "HTTPOnly"; - -/* DESC: Context menu entry that removes cookie */ -ui_strings.S_LABEL_COOKIE_MANAGER_REMOVE_COOKIE = "Delete cookie"; - -/* DESC: Context menu entry that removes cookies (plural) */ -ui_strings.S_LABEL_COOKIE_MANAGER_REMOVE_COOKIES = "Delete cookies"; - -/* DESC: Context menu entry that removes cookies of specific group */ -ui_strings.S_LABEL_COOKIE_MANAGER_REMOVE_COOKIES_OF = "Delete cookies from %s"; - -/* DESC: Label for isSecure flag on a cookie, set if cookie is only transmitted on secure connections */ -ui_strings.S_LABEL_COOKIE_MANAGER_SECURE_CONNECTIONS_ONLY = "Secure"; - -/* DESC: Setting label to switch back to the default setting */ -ui_strings.S_LABEL_DEFAULT_SELECTION = "Default"; - -/* DESC: Context menu entry that removes all watches */ -ui_strings.S_LABEL_DELETE_ALL_WATCHES = "Delete all watches"; - -/* DESC: Context menu entry that removes watch */ -ui_strings.S_LABEL_DELETE_WATCH = "Delete watch"; - -/* DESC: Label for a button in a dialog to dismiss in so it won't be shown again */ -ui_strings.S_LABEL_DIALOG_DONT_SHOW_AGAIN = "Do not show again"; - -/* DESC: Context menu entry that brings up "Edit" UI */ -ui_strings.S_LABEL_EDIT_WATCH = "Edit watch"; - -/* DESC: Button label to enable the default debugger features. */ -ui_strings.S_LABEL_ENABLE_DEFAULT_FEATURES = "Enable the default debugger features"; - -/* DESC: Setting label to select the font face */ -ui_strings.S_LABEL_FONT_SELECTION_FACE = "Font face"; - -/* DESC: Setting label to select the line height */ -ui_strings.S_LABEL_FONT_SELECTION_LINE_HEIGHT = "Line height"; - -/* DESC: Setting label to select the font face */ -ui_strings.S_LABEL_FONT_SELECTION_SIZE = "Font size"; - -/* DESC: Label of a section in the keyboard configuration for a specific view */ -ui_strings.S_LABEL_KEYBOARDCONFIG_FOR_VIEW = "Keyboard shortcuts %s"; - -/* DESC: Label of an invalid keyboard shortcut */ -ui_strings.S_LABEL_KEYBOARDCONFIG_INVALID_SHORTCUT = "Invalid keyboard shortcut"; - -/* DESC: Label of a subsection in the keyboard configuration */ -ui_strings.S_LABEL_KEYBOARDCONFIG_MODE_DEFAULT = "Default"; - -/* DESC: Label of a subsection in the keyboard configuration */ -ui_strings.S_LABEL_KEYBOARDCONFIG_MODE_EDIT = "Edit"; - -/* DESC: Label of a subsection in the keyboard configuration */ -ui_strings.S_LABEL_KEYBOARDCONFIG_MODE_EDIT_ATTR_AND_TEXT = "Edit Attributes and Text"; - -/* DESC: Label of a subsection in the keyboard configuration */ -ui_strings.S_LABEL_KEYBOARDCONFIG_MODE_EDIT_MARKUP = "Edit markup"; - -/* DESC: Settings label for the maximum number of search hits in the search panel. */ -ui_strings.S_LABEL_MAX_SEARCH_HITS = "Maximum number of search results"; - -/* DESC: Button tooltip */ -ui_strings.S_LABEL_MOVE_HIGHLIGHT_DOWN = "Find next"; - -/* DESC: Button tooltip */ -ui_strings.S_LABEL_MOVE_HIGHLIGHT_UP = "Find previous"; - -/* DESC: Label for the name column header of a form field in a POST */ -ui_strings.S_LABEL_NETWORK_POST_DATA_NAME = "Name"; - -/* DESC: Label for the value column header of a form value in a POST */ -ui_strings.S_LABEL_NETWORK_POST_DATA_VALUE = "Value"; - -/* DESC: Label for the network port to connect to. */ -ui_strings.S_LABEL_PORT = "Port"; - -/* DESC: In the command line, choose the size of the typed history */ -ui_strings.S_LABEL_REPL_BACKLOG_LENGTH = "Number of lines of stored history"; - -/* DESC: Label of a subsection in the keyboard configuration */ -ui_strings.S_LABEL_REPL_MODE_AUTOCOMPLETE = "Autocomplete"; - -/* DESC: Label of a subsection in the keyboard configuration */ -ui_strings.S_LABEL_REPL_MODE_DEFAULT = "Default"; - -/* DESC: Label of a subsection in the keyboard configuration */ -ui_strings.S_LABEL_REPL_MODE_MULTILINE = "Multi-line edit"; - -/* DESC: Label of a subsection in the keyboard configuration */ -ui_strings.S_LABEL_REPL_MODE_SINGLELINE = "Single-line edit"; - -/* DESC: Label of the section with the scope chain in the Inspection view */ -ui_strings.S_LABEL_SCOPE_CHAIN = "Scope Chain"; - -/* DESC: Checkbox label to search in all files in the JS search pane. */ -ui_strings.S_LABEL_SEARCH_ALL_FILES = "All files"; - -/* DESC: Checkbox label to set the 'ignore case' flag search panel. */ -ui_strings.S_LABEL_SEARCH_FLAG_IGNORE_CASE = "Ignore case"; - -/* DESC: Checkbox label to search in injected scripts in the JS search pane. */ -ui_strings.S_LABEL_SEARCH_INJECTED_SCRIPTS = "Injected"; - -/* DESC: Tooltip for the injected scripts search settings label. */ -ui_strings.S_LABEL_SEARCH_INJECTED_SCRIPTS_TOOLTIP = "Search in all injected scripts, including Browser JS, Extension JS and User JS"; - -/* DESC: Radio label for the search type 'Selector' (as in CSS Selector) in the DOM search panel. */ -ui_strings.S_LABEL_SEARCH_TYPE_CSS = "Selector"; - -/* DESC: RRadio label for the search type 'RegExp' in the DOM search panel. */ -ui_strings.S_LABEL_SEARCH_TYPE_REGEXP = "RegExp"; - -/* DESC: Radio label for the search type 'Text' in the DOM search panel. */ -ui_strings.S_LABEL_SEARCH_TYPE_TEXT = "Text"; - -/* DESC: Radio label for the search type 'XPath' in the DOM search panel. */ -ui_strings.S_LABEL_SEARCH_TYPE_XPATH = "XPath"; - -/* DESC: Settings label to show a tooltip for the hovered identifier in the source view. */ -ui_strings.S_LABEL_SHOW_JS_TOOLTIP = "Show inspection tooltip"; - -/* DESC: Enable smart reformatting of JavaScript. */ -ui_strings.S_LABEL_SMART_REFORMAT_JAVASCRIPT = "Smart JavaScript pretty printing"; - -/* DESC: Settings label to configure the element highlight color */ -ui_strings.S_LABEL_SPOTLIGHT_TITLE = "Element Highlight"; - -/* DESC: Button label to add an item in a storage, e.g. in the local storage */ -ui_strings.S_LABEL_STORAGE_ADD = "Add"; - -/* DESC: Label for "Add storage_type" button */ -ui_strings.S_LABEL_STORAGE_ADD_STORAGE_TYPE = "Add %s"; - -/* DESC: Button label to delete an item in a storage, e.g. in the local storage */ -ui_strings.S_LABEL_STORAGE_DELETE = "Delete"; - -/* DESC: Tool tip in a storage view to inform the user how to edit an item */ -ui_strings.S_LABEL_STORAGE_DOUBLE_CLICK_TO_EDIT = "Double-click to edit"; - -/* DESC: Label for the key (identifier) of a storage item */ -ui_strings.S_LABEL_STORAGE_KEY = "Key"; - -/* DESC: Button label to update a view with all items of a storage, e.g. of the local storage */ -ui_strings.S_LABEL_STORAGE_UPDATE = "Update"; - -/* DESC: Tab size in source view. */ -ui_strings.S_LABEL_TAB_SIZE = "Tab Size"; - -/* DESC: Area as in size. choices are 10 x 10, and so on. */ -ui_strings.S_LABEL_UTIL_AREA = "Area"; - -/* DESC: Scale */ -ui_strings.S_LABEL_UTIL_SCALE = "Scale"; - -/* DESC: Info in an event listener tooltip that the according listener listens in the bubbling phase. */ -ui_strings.S_LISTENER_BUBBLING_PHASE = "bubbling"; - -/* DESC: Info in an event listener tooltip that the according listener listens in the capturing phase. */ -ui_strings.S_LISTENER_CAPTURING_PHASE = "capturing"; - -/* DESC: Debug context menu */ -ui_strings.S_MENU_DEBUG_CONTEXT = "Select the debugging context"; - -/* DESC: Reload the debug context. */ -ui_strings.S_MENU_RELOAD_DEBUG_CONTEXT = "Reload Debugging Context"; - -/* DESC: Reload the debug context (shorter than S_MENU_RELOAD_DEBUG_CONTEXT). */ -ui_strings.S_MENU_RELOAD_DEBUG_CONTEXT_SHORT = "Reload"; - -/* DESC: Select the active window as debugger context. */ -ui_strings.S_MENU_SELECT_ACTIVE_WINDOW = "Select Active Window"; - -/* DESC: String used when the user has clicked to get a resource body, but dragonfly wasn't able to do so. */ -ui_strings.S_NETWORK_BODY_NOT_AVAILABLE = "Request body not available. Enable resource tracking and reload the page to view the resource."; - -/* DESC: Name of network caching setting for default browser caching policy */ -ui_strings.S_NETWORK_CACHING_SETTING_DEFAULT_LABEL = "Standard browser caching behavior"; - -/* DESC: Help text for explaining caching setting in global network options */ -ui_strings.S_NETWORK_CACHING_SETTING_DESC = "This setting controls how caching works when Opera Dragonfly is running. When caching is disabled, Opera always reloads the page."; - -/* DESC: Name of network caching setting for disabling browser caching policy */ -ui_strings.S_NETWORK_CACHING_SETTING_DISABLED_LABEL = "Disable all caching"; - -/* DESC: Title for caching settings section in global network options */ -ui_strings.S_NETWORK_CACHING_SETTING_TITLE = "Caching behavior"; - -/* DESC: Can't show request data, as we don't know the type of it. */ -ui_strings.S_NETWORK_CANT_DISPLAY_TYPE = "Cannot display content of type %s"; - -/* DESC: Name of content tracking setting for tracking content */ -ui_strings.S_NETWORK_CONTENT_TRACKING_SETTING_TRACK_LABEL = "Track content (affects speed/memory)"; - -/* DESC: Explanation of how to enable content tracking. */ -ui_strings.S_NETWORK_ENABLE_CONTENT_TRACKING_FOR_REQUEST = "Enable content tracking in the \"network options\" panel to see request bodies"; - -/* DESC: Example value to show what header formats look like. Header-name */ -ui_strings.S_NETWORK_HEADER_EXAMPLE_VAL_NAME = "Header-name"; - -/* DESC: Example value to show what header formats look like. Header-value */ -ui_strings.S_NETWORK_HEADER_EXAMPLE_VAL_VALUE = "Header-value"; - -/* DESC: Description of network header overrides feature. */ -ui_strings.S_NETWORK_HEADER_OVERRIDES_DESC = "Headers in the override box will be used for all requests in the debugged browser. They will override normal headers."; - -/* DESC: Label for checkbox to enable global header overrides */ -ui_strings.S_NETWORK_HEADER_OVERRIDES_LABEL = "Enable global header overrides"; - -/* DESC: Label for presets */ -ui_strings.S_NETWORK_HEADER_OVERRIDES_PRESETS_LABEL = "Presets"; - -/* DESC: Label for save nbutton */ -ui_strings.S_NETWORK_HEADER_OVERRIDES_PRESETS_SAVE = "Save"; - -/* DESC: Label for selecting an empty preset */ -ui_strings.S_NETWORK_HEADER_OVERRIDES_PRESET_NONE = "None"; - -/* DESC: Title of global header overrides section in global network settings */ -ui_strings.S_NETWORK_HEADER_OVERRIDES_TITLE = "Global header overrides"; - -/* DESC: Title of request body section when the body is multipart-encoded */ -ui_strings.S_NETWORK_MULTIPART_REQUEST_TITLE = "Request - multipart"; - -/* DESC: String used when there is a request body we can't show the contents of directly. */ -ui_strings.S_NETWORK_N_BYTE_BODY = "Request body of %s bytes"; - -/* DESC: Name of entry in Network Log, used in summary at the end */ -ui_strings.S_NETWORK_REQUEST = "Request"; - -/* DESC: Name of entry in Network Log, plural, used in summary at the end */ -ui_strings.S_NETWORK_REQUESTS = "Requests"; - -/* DESC: Help text about how to always track resources in request view */ -ui_strings.S_NETWORK_REQUEST_DETAIL_BODY_DESC = "Response body not tracked. To always fetch response bodies, toggle the \"Track content\" option in Settings. To retrieve only this body, click the button."; - -/* DESC: Message about not yet available response body */ -ui_strings.S_NETWORK_REQUEST_DETAIL_BODY_UNFINISHED = "Response body not available until the request is finished."; - -/* DESC: Help text about how a request body could not be show because it's no longer available. */ -ui_strings.S_NETWORK_REQUEST_DETAIL_NO_RESPONSE_BODY = "Response body not available. Enable the \"Track content\" option in Settings and reload the page to view the resource."; - -/* DESC: Title for request details section */ -ui_strings.S_NETWORK_REQUEST_DETAIL_REQUEST_TITLE = "Request"; - -/* DESC: Title for response details section */ -ui_strings.S_NETWORK_REQUEST_DETAIL_RESPONSE_TITLE = "Response"; - -/* DESC: Message about file types we have no good way of showing. */ -ui_strings.S_NETWORK_REQUEST_DETAIL_UNDISPLAYABLE_BODY_LABEL = "Unable to show data of type %s"; - -/* DESC: Message about there being no headers attached to a specific request or response */ -ui_strings.S_NETWORK_REQUEST_NO_HEADERS_LABEL = "No headers"; - -/* DESC: Explanation about why a network requests lacks headers. */ -ui_strings.S_NETWORK_SERVED_FROM_CACHE = "No request made. All data was retrieved from cache without accessing the network."; - -/* DESC: Unknown mime type for content */ -ui_strings.S_NETWORK_UNKNOWN_MIME_TYPE = "MIME type not known for request data"; - -/* DESC: The string "None" used wherever there's an absence of something */ -ui_strings.S_NONE = "None"; - -/* DESC: Info in the DOM side panel that the selected node has no event listeners attached. */ -ui_strings.S_NO_EVENT_LISTENER = "No event listeners"; - -/* DESC: Label in a tooltip */ -ui_strings.S_PROFILER_AREA_DIMENSION = "Area"; - -/* DESC: Label in a tooltip */ -ui_strings.S_PROFILER_AREA_LOCATION = "Location"; - -/* DESC: Message in the profiler when the profiler is calculating */ -ui_strings.S_PROFILER_CALCULATING = "Calculating…"; - -/* DESC: Label in a tooltip */ -ui_strings.S_PROFILER_DURATION = "Duration"; - -/* DESC: Message in the profiler when no data was "captured" by the profiler */ -ui_strings.S_PROFILER_NO_DATA = "No data"; - -/* DESC: Message when an event in the profiler has no details */ -ui_strings.S_PROFILER_NO_DETAILS = "No details"; - -/* DESC: Message in the profiler when the profiler is active */ -ui_strings.S_PROFILER_PROFILING = "Profiling…"; - -/* DESC: Message in the profiler when the profiler failed */ -ui_strings.S_PROFILER_PROFILING_FAILED = "Profiling failed"; - -/* DESC: Message before activating the profiler profile */ -ui_strings.S_PROFILER_RELOAD = "To get accurate data from the profiler, all other features have to be disabled and the document has to be reloaded."; - -/* DESC: Label in a tooltip */ -ui_strings.S_PROFILER_SELF_TIME = "Self time"; - -/* DESC: Message before starting the profiler */ -ui_strings.S_PROFILER_START_MESSAGE = "Press the Record button to start profiling"; - -/* DESC: Label in a tooltip */ -ui_strings.S_PROFILER_START_TIME = "Start"; - -/* DESC: Label in a tooltip */ -ui_strings.S_PROFILER_TOTAL_SELF_TIME = "Total self time"; - -/* DESC: Label in a tooltip */ -ui_strings.S_PROFILER_TYPE_EVENT = "Event name"; - -/* DESC: Label in a tooltip */ -ui_strings.S_PROFILER_TYPE_SCRIPT = "Script type"; - -/* DESC: Label in a tooltip */ -ui_strings.S_PROFILER_TYPE_SELECTOR = "Selector"; - -/* DESC: Label in a tooltip */ -ui_strings.S_PROFILER_TYPE_THREAD = "Thread type"; - -/* DESC: Remote debug guide, connection setup */ -ui_strings.S_REMOTE_DEBUG_GUIDE_PRECONNECT_HEADER = "Steps to enable remote debugging:"; - -/* DESC: Remote debug guide, connection setup */ -ui_strings.S_REMOTE_DEBUG_GUIDE_PRECONNECT_STEP_1 = "Specify the port number you wish to connect to, or leave as the default"; - -/* DESC: Remote debug guide, connection setup */ -ui_strings.S_REMOTE_DEBUG_GUIDE_PRECONNECT_STEP_2 = "Click \"Apply\""; - -/* DESC: Remote debug guide, waiting for connection */ -ui_strings.S_REMOTE_DEBUG_GUIDE_WAITING_HEADER = "On the remote device:"; - -/* DESC: Remote debug guide, waiting for connection */ -ui_strings.S_REMOTE_DEBUG_GUIDE_WAITING_STEP_1 = "Enter opera:debug in the URL field"; - -/* DESC: Remote debug guide, waiting for connection */ -ui_strings.S_REMOTE_DEBUG_GUIDE_WAITING_STEP_2 = "Enter the IP address of the machine running Opera Dragonfly"; - -/* DESC: Remote debug guide, waiting for connection */ -ui_strings.S_REMOTE_DEBUG_GUIDE_WAITING_STEP_3 = "Enter the port number %s"; - -/* DESC: Remote debug guide, waiting for connection */ -ui_strings.S_REMOTE_DEBUG_GUIDE_WAITING_STEP_4 = "Click \"Connect\""; - -/* DESC: Remote debug guide, waiting for connection */ -ui_strings.S_REMOTE_DEBUG_GUIDE_WAITING_STEP_5 = "Once connected navigate to the page you wish to debug"; - -/* DESC: Description of the "help" command in the repl */ -ui_strings.S_REPL_HELP_COMMAND_DESC = "Show a list of all available commands"; - -/* DESC: Description of the "jquery" command in the repl */ -ui_strings.S_REPL_JQUERY_COMMAND_DESC = "Load jQuery in the active tab"; - -/* DESC: Printed in the command line view when it is shown for the first time. */ -ui_strings.S_REPL_WELCOME_TEXT = "Type %(CLEAR_COMMAND)s to clear the console.\nType %(HELP_COMMAND)s for more information."; - -/* DESC: "Not applicable" abbreviation */ -ui_strings.S_RESOURCE_ALL_NOT_APPLICABLE = "n/a"; - -/* DESC: Name of host column */ -ui_strings.S_RESOURCE_ALL_TABLE_COLUMN_HOST = "Host"; - -/* DESC: Name of mime column */ -ui_strings.S_RESOURCE_ALL_TABLE_COLUMN_MIME = "MIME"; - -/* DESC: Name of path column */ -ui_strings.S_RESOURCE_ALL_TABLE_COLUMN_PATH = "Path"; - -/* DESC: Name of pretty printed size column */ -ui_strings.S_RESOURCE_ALL_TABLE_COLUMN_PPSIZE = "Size (pretty printed)"; - -/* DESC: Name of protocol column */ -ui_strings.S_RESOURCE_ALL_TABLE_COLUMN_PROTOCOL = "Protocol"; - -/* DESC: Name of size column */ -ui_strings.S_RESOURCE_ALL_TABLE_COLUMN_SIZE = "Size"; - -/* DESC: Name of type column */ -ui_strings.S_RESOURCE_ALL_TABLE_COLUMN_TYPE = "Type"; - -/* DESC: Name of types size group */ -ui_strings.S_RESOURCE_ALL_TABLE_GROUP_GROUPS = "Groups"; - -/* DESC: Name of hosts size group */ -ui_strings.S_RESOURCE_ALL_TABLE_GROUP_HOSTS = "Hosts"; - -/* DESC: Fallback text for no filename, used as tab label */ -ui_strings.S_RESOURCE_ALL_TABLE_NO_FILENAME = "(no name)"; - -/* DESC: Fallback text for no host */ -ui_strings.S_RESOURCE_ALL_TABLE_NO_HOST = "No host"; - -/* DESC: Fallback text for unknown groups */ -ui_strings.S_RESOURCE_ALL_TABLE_UNKNOWN_GROUP = "Unknown"; - -/* DESC: Click reload button to fetch resources */ -ui_strings.S_RESOURCE_CLICK_BUTTON_TO_FETCH_RESOURCES = "Click the reload button above to reload the debugged window and fetch its resources"; - -/* DESC: Tooltip displayed when hovering the arrow going back in Return Values. The first variable is a file name, the second a line number */ -ui_strings.S_RETURN_VALUES_FUNCTION_FROM = "Returned from %s:%s"; - -/* DESC: Tooltip displayed when hovering the arrow going forward in Return Values. The first variable is a file name, the second a line number */ -ui_strings.S_RETURN_VALUES_FUNCTION_TO = "Returned to %s:%s"; - -/* DESC: Label for the global scope in the Scope Chain. */ -ui_strings.S_SCOPE_GLOBAL = "Global"; - -/* DESC: Label for the scopes other than local and global in the Scope Chain. */ -ui_strings.S_SCOPE_INNER = "Scope %s"; - -/* DESC: Section header in the script drop-down select for Browser and User JS. */ -ui_strings.S_SCRIPT_SELECT_SECTION_BROWSER_AND_USER_JS = "Browser JS and User JS"; - -/* DESC: Section header in the script drop-down select for inline, eval, timeout and event handler scripts. */ -ui_strings.S_SCRIPT_SELECT_SECTION_INLINE_AND_EVALS = "Inline, eval, timeout and event-handler scripts"; - -/* DESC: Script type for events in the profiler */ -ui_strings.S_SCRIPT_TYPE_BROWSERJS = "BrowserJS"; - -/* DESC: Script type for events in the profiler */ -ui_strings.S_SCRIPT_TYPE_DEBUGGER = "Debugger"; - -/* DESC: Script type for events in the profiler */ -ui_strings.S_SCRIPT_TYPE_EVAL = "Eval"; - -/* DESC: Script type for events in the profiler */ -ui_strings.S_SCRIPT_TYPE_EVENT_HANDLER = "Event"; - -/* DESC: Script type for events in the profiler */ -ui_strings.S_SCRIPT_TYPE_EXTENSIONJS = "Extension"; - -/* DESC: Script type for events in the profiler */ -ui_strings.S_SCRIPT_TYPE_GENERATED = "document.write()"; - -/* DESC: Script type for events in the profiler */ -ui_strings.S_SCRIPT_TYPE_INLINE = "Inline"; - -/* DESC: Script type for events in the profiler */ -ui_strings.S_SCRIPT_TYPE_LINKED = "External"; - -/* DESC: Script type for events in the profiler */ -ui_strings.S_SCRIPT_TYPE_TIMEOUT = "Timeout or interval"; - -/* DESC: Script type for events in the profiler */ -ui_strings.S_SCRIPT_TYPE_UNKNOWN = "Unknown"; - -/* DESC: Script type for events in the profiler */ -ui_strings.S_SCRIPT_TYPE_URI = "javascript: URL"; - -/* DESC: Script type for events in the profiler */ -ui_strings.S_SCRIPT_TYPE_USERJS = "UserJS"; - -/* DESC: Tooltip for filtering text-input boxes */ -ui_strings.S_SEARCH_INPUT_TOOLTIP = "text search"; - -/* DESC: Header for settings group "About" */ -ui_strings.S_SETTINGS_HEADER_ABOUT = "About"; - -/* DESC: Header for settings group "Console" */ -ui_strings.S_SETTINGS_HEADER_CONSOLE = "Error Log"; - -/* DESC: Header for settings group "Document" */ -ui_strings.S_SETTINGS_HEADER_DOCUMENT = "Documents"; - -/* DESC: Header for settings group "General" */ -ui_strings.S_SETTINGS_HEADER_GENERAL = "General"; - -/* DESC: Header for settings group "Keyboard shortcuts" */ -ui_strings.S_SETTINGS_HEADER_KEYBOARD_SHORTCUTS = "Keyboard shortcuts"; - -/* DESC: Header for settings group "Network" */ -ui_strings.S_SETTINGS_HEADER_NETWORK = "Network"; - -/* DESC: Header for settings group "Script" */ -ui_strings.S_SETTINGS_HEADER_SCRIPT = "Scripts"; - -/* DESC: Description for CSS rules with the origin being the user */ -ui_strings.S_STYLE_ORIGIN_LOCAL = "user stylesheet"; - -/* DESC: Description for CSS rules with the origin being the SVG presentation attributes */ -ui_strings.S_STYLE_ORIGIN_SVG = "presentation attributes"; - -/* DESC: Description for CSS rules with the origin being the UA */ -ui_strings.S_STYLE_ORIGIN_USER_AGENT = "user agent stylesheet"; - -/* DESC: Tooltip text for a button that attaches Opera Dragonfly to the main browser window. */ -ui_strings.S_SWITCH_ATTACH_WINDOW = "Dock to main window"; - -/* DESC: When enabled, the request log always scroll to the bottom on new requests */ -ui_strings.S_SWITCH_AUTO_SCROLL_REQUEST_LIST = "Auto-scroll request log"; - -/* DESC: Button title for stopping the profiler */ -ui_strings.S_SWITCH_CHANGE_START_TO_FIRST_EVENT = "Change start time to first event"; - -/* DESC: Checkbox: undocks Opera Dragonfly into a separate window. */ -ui_strings.S_SWITCH_DETACH_WINDOW = "Undock into separate window"; - -/* DESC: Expand all (entries in a list) */ -ui_strings.S_SWITCH_EXPAND_ALL = "Expand all"; - -/* DESC: If enabled objects can be expanded inline in the console. */ -ui_strings.S_SWITCH_EXPAND_OBJECTS_INLINE = "Expand objects inline in the console"; - -/* DESC: Will select the element when clicked. */ -ui_strings.S_SWITCH_FIND_ELEMENT_BY_CLICKING = "Select an element in the page to inspect it"; - -/* DESC: When enabled, objects of type element will be friendly printed */ -ui_strings.S_SWITCH_FRIENDLY_PRINT = "Enable smart-printing for Element objects in the console"; - -/* DESC: Shows or hides empty strings and null values. */ -ui_strings.S_SWITCH_HIDE_EMPTY_STRINGS = "Show empty strings and null values"; - -/* DESC: Highlights page elements when thet mouse hovers. */ -ui_strings.S_SWITCH_HIGHLIGHT_SELECTED_OR_HOVERED_ELEMENT = "Highlight selected element"; - -/* DESC: When enabled, objects of type element in the command line will be displayed in the DOM view */ -ui_strings.S_SWITCH_IS_ELEMENT_SENSITIVE = "Display Element objects in the DOM panel when selected in the console"; - -/* DESC: Draw a border on to selected DOM elements */ -ui_strings.S_SWITCH_LOCK_SELECTED_ELEMENTS = "Keep elements highlighted"; - -/* DESC: Switch toggeling if the debugger should automatically reload the page when the user changes the window to debug. */ -ui_strings.S_SWITCH_RELOAD_SCRIPTS_AUTOMATICALLY = "Reload new debugging contexts automatically"; - -/* DESC: Route debugging traffic trough proxy to enable debugging devices */ -ui_strings.S_SWITCH_REMOTE_DEBUG = "Remote debug"; - -/* DESC: Scroll an element in the host into view when selecting it in the DOM. */ -ui_strings.S_SWITCH_SCROLL_INTO_VIEW_ON_FIRST_SPOTLIGHT = "Scroll into view on first highlight"; - -/* DESC: List item in the DOM settings menu to shows or hide comments in DOM. Also Tooltip text for button in the secondary DOM menu. */ -ui_strings.S_SWITCH_SHOW_COMMENT_NODES = "Show comment nodes"; - -/* DESC: Shows DOM in tree or mark-up mode. */ -ui_strings.S_SWITCH_SHOW_DOM_INTREE_VIEW = "Represent the DOM as a node tree"; - -/* DESC: Show ECMAScript errors in the command line. */ -ui_strings.S_SWITCH_SHOW_ECMA_ERRORS_IN_COMMAND_LINE = "Show JavaScript errors in the console"; - -/* DESC: Show default null and empty string values when inspecting a js object. */ -ui_strings.S_SWITCH_SHOW_FEFAULT_NULLS_AND_EMPTY_STRINGS = "Show default values if they are null or empty strings"; - -/* DESC: Showing the id's and class names in the breadcrumb in the statusbar. */ -ui_strings.S_SWITCH_SHOW_ID_AND_CLASSES_IN_BREAD_CRUMB = "Show id's and classes in breadcrumb trail"; - -/* DESC: Toggles the display of pre-set values in the computed styles view. */ -ui_strings.S_SWITCH_SHOW_INITIAL_VALUES = "Show initial values"; - -/* DESC: Show non enumerale properties when inspecting a js object. */ -ui_strings.S_SWITCH_SHOW_NON_ENUMERABLES = "Show non-enumerable properties"; - -/* DESC: There are a lot of window types in Opera. This switch toggles if we show only the useful ones, or all of them. */ -ui_strings.S_SWITCH_SHOW_ONLY_NORMAL_AND_GADGETS_TYPE_WINDOWS = "Hide browser-specific contexts, such as mail and feed windows"; - -/* DESC: Show prototpe objects when inspecting a js object. */ -ui_strings.S_SWITCH_SHOW_PROTOTYPES = "Show prototypes"; - -/* DESC: Show pseudo elements in the DOM view */ -ui_strings.S_SWITCH_SHOW_PSEUDO_ELEMENTS = "Show pseudo-elements"; - -/* DESC: Showing the siblings in the breadcrumb in the statusbar. */ -ui_strings.S_SWITCH_SHOW_SIBLINGS_IN_BREAD_CRUMB = "Show siblings in breadcrumb trail"; - -/* DESC: Switch display of 'All' tab on or off. */ -ui_strings.S_SWITCH_SHOW_TAB_ALL = "All"; - -/* DESC: Switch display of 'Bittorrent' tab on or off. */ -ui_strings.S_SWITCH_SHOW_TAB_BITTORRENT = "BitTorrent"; - -/* DESC: Switch display of 'CSS' tab on or off. */ -ui_strings.S_SWITCH_SHOW_TAB_CSS = "CSS"; - -/* DESC: Switch display of 'HTML' tab on or off. */ -ui_strings.S_SWITCH_SHOW_TAB_HTML = "HTML"; - -/* DESC: Switch display of 'Java' tab on or off. */ -ui_strings.S_SWITCH_SHOW_TAB_JAVA = "Java"; - -/* DESC: Switch display of 'Mail' tab on or off. */ -ui_strings.S_SWITCH_SHOW_TAB_M2 = "Mail"; - -/* DESC: Switch display of 'Network' tab on or off. */ -ui_strings.S_SWITCH_SHOW_TAB_NETWORK = "Network"; - -/* DESC: Switch display of 'Script' tab on or off. */ -ui_strings.S_SWITCH_SHOW_TAB_SCRIPT = "JavaScript"; - -/* DESC: Switch display of 'SVG' tab on or off. */ -ui_strings.S_SWITCH_SHOW_TAB_SVG = "SVG"; - -/* DESC: Switch display of 'Voice' tab on or off. */ -ui_strings.S_SWITCH_SHOW_TAB_VOICE = "Voice"; - -/* DESC: Switch display of 'Widget' tab on or off. */ -ui_strings.S_SWITCH_SHOW_TAB_WIDGET = "Widgets"; - -/* DESC: Switch display of 'XML' tab on or off. */ -ui_strings.S_SWITCH_SHOW_TAB_XML = "XML"; - -/* DESC: Switch display of 'XSLT' tab on or off. */ -ui_strings.S_SWITCH_SHOW_TAB_XSLT = "XSLT"; - -/* DESC: List item in General settings menu to show or hide Views menu. */ -ui_strings.S_SWITCH_SHOW_VIEWS_MENU = "Show Views menu"; - -/* DESC: Shows or hides white space nodes in DOM. */ -ui_strings.S_SWITCH_SHOW_WHITE_SPACE_NODES = "Show whitespace nodes"; - -/* DESC: When enabled, a screenshot is taken automatically on showing utilities */ -ui_strings.S_SWITCH_TAKE_SCREENSHOT_AUTOMATICALLY = "Take a screenshot automatically when opening Utilities"; - -/* DESC: Settings checkbox label for toggling usage tracking. Add one to a running total each time the user starts Dragonfly. */ -ui_strings.S_SWITCH_TRACK_USAGE = "Track usage. Sends a randomly-generated user ID to the Opera Dragonfly servers each time Opera Dragonfly is started."; - -/* DESC: When enabled, list alike objects will be unpacked in the command line */ -ui_strings.S_SWITCH_UNPACK_LIST_ALIKES = "Unpack objects which have list-like behavior in the console"; - -/* DESC: List item in the DOM settings menu to update the DOM model automatically when a node is being removed. Also Tooltip text for button in the secondary DOM menu. */ -ui_strings.S_SWITCH_UPDATE_DOM_ON_NODE_REMOVE = "Update DOM when a node is removed"; - -/* DESC: List item in the DOM settings menu. */ -ui_strings.S_SWITCH_UPDATE_GLOBAL_SCOPE = "Automatically update global scope"; - -/* DESC: Spell HTML tag names upper or lower case. */ -ui_strings.S_SWITCH_USE_LOWER_CASE_TAG_NAMES = "Use lower case tag names for text/html"; - -/* DESC: Table header in the profiler */ -ui_strings.S_TABLE_HEADER_HITS = "Hits"; - -/* DESC: Table header in the profiler */ -ui_strings.S_TABLE_HEADER_TIME = "Time"; - -/* DESC: Entry format in the call stack view showing the function name, line number and script ID. Please do not modify the %(VARIABLE)s . */ -ui_strings.S_TEXT_CALL_STACK_FRAME_LINE = "%(FUNCTION_NAME)s: %(SCRIPT_ID)s:%(LINE_NUMBER)s"; - -/* DESC: Badge for the script ID in Scripts view. */ -ui_strings.S_TEXT_ECMA_SCRIPT_SCRIPT_ID = "Script id"; - -/* DESC: Badge for inline scripts. */ -ui_strings.S_TEXT_ECMA_SCRIPT_TYPE_INLINE = "Inline"; - -/* DESC: Badge for linked scripts. */ -ui_strings.S_TEXT_ECMA_SCRIPT_TYPE_LINKED = "Linked"; - -/* DESC: Badge for unknown script types. */ -ui_strings.S_TEXT_ECMA_SCRIPT_TYPE_UNKNOWN = "Unknown"; - -/* DESC: Information on the Opera Dragonfly version number that appears in the Environment view. */ -ui_strings.S_TEXT_ENVIRONMENT_DRAGONFLY_VERSION = "Opera Dragonfly Version"; - -/* DESC: Information on the operating system used that appears in the Environment view. */ -ui_strings.S_TEXT_ENVIRONMENT_OPERATING_SYSTEM = "Operating System"; - -/* DESC: Information on the platform in use that appears in the Environment view. */ -ui_strings.S_TEXT_ENVIRONMENT_PLATFORM = "Platform"; - -/* DESC: Information on the Scope protocol version used that appears in the Environment view. */ -ui_strings.S_TEXT_ENVIRONMENT_PROTOCOL_VERSION = "Protocol Version"; - -/* DESC: Information on the Opera Dragonfly revision number that appears in the Environment view. */ -ui_strings.S_TEXT_ENVIRONMENT_REVISION_NUMBER = "Revision Number"; - -/* DESC: Information on the user-agent submitted that appears in the Environment view. */ -ui_strings.S_TEXT_ENVIRONMENT_USER_AGENT = "User Agent"; - -/* DESC: Result text for a search when there were search results. The %(VARIABLE)s should not be translated, but its position in the text can be rearranged. Python syntax: %(VARIABLE)type_identifier, so %(FOO)s in its entirety is replaced. */ -ui_strings.S_TEXT_STATUS_SEARCH = "Matches for \"%(SEARCH_TERM)s\": Match %(SEARCH_COUNT_INDEX)s out of %(SEARCH_COUNT_TOTAL)s"; - -/* DESC: Result text for the search. Please do not modify the %(VARIABLE)s . */ -ui_strings.S_TEXT_STATUS_SEARCH_NO_MATCH = "No match for \"%(SEARCH_TERM)s\""; - -/* DESC: Thread type for events in the profiler */ -ui_strings.S_THREAD_TYPE_COMMON = "Common"; - -/* DESC: Thread type for events in the profiler */ -ui_strings.S_THREAD_TYPE_DEBUGGER_EVAL = "Debugger"; - -/* DESC: Thread type for events in the profiler */ -ui_strings.S_THREAD_TYPE_EVENT = "Event"; - -/* DESC: Thread type for events in the profiler */ -ui_strings.S_THREAD_TYPE_HISTORY_NAVIGATION = "History navigation"; - -/* DESC: Thread type for events in the profiler */ -ui_strings.S_THREAD_TYPE_INLINE_SCRIPT = "Inline script"; - -/* DESC: Thread type for events in the profiler */ -ui_strings.S_THREAD_TYPE_JAVASCRIPT_URL = "javascript: URL"; - -/* DESC: Thread type for events in the profiler. This should not be translated. */ -ui_strings.S_THREAD_TYPE_JAVA_EVAL = "Java (LiveConnect)"; - -/* DESC: Thread type for events in the profiler */ -ui_strings.S_THREAD_TYPE_TIMEOUT = "Timeout or interval"; - -/* DESC: Thread type for events in the profiler */ -ui_strings.S_THREAD_TYPE_UNKNOWN = "Unknown"; - -/* DESC: Enabling/disabling DOM modebar */ -ui_strings.S_TOGGLE_DOM_MODEBAR = "Show breadcrumb trail"; - -/* DESC: Heading for the setting that toggles the breadcrumb trail */ -ui_strings.S_TOGGLE_DOM_MODEBAR_HEADER = "Breadcrumb Trail"; - -/* DESC: Label on button to pause/unpause updates of the network graph view */ -ui_strings.S_TOGGLE_PAUSED_UPDATING_NETWORK_VIEW = "Pause updating network activity"; - -/* DESC: String shown instead of filename when file name is missing */ -ui_strings.S_UNKNOWN_SCRIPT = "(Unknown script)"; - +window.ui_strings || ( window.ui_strings = {} ); +window.ui_strings.lang_code = "en"; + +/** + * Capitalization guidelines: + * http://library.gnome.org/devel/hig-book/stable/design-text-labels.html.en#layout-capitalization + * + * Prefix -> use mapping for strings: + * Prefix Use + * D Dialog titles and components + * S General strings + * M Menus + */ + +/* DESC: Confirm dialog text for asking if the user wants to redo the search because the context has changed. */ +ui_strings.D_REDO_SEARCH = "The searched document no longer exists.\nRepeat search in the current document?"; + +/* DESC: Confirm dialog text for asking if the user wants to reload and reformat the scripts now. */ +ui_strings.D_REFORMAT_SCRIPTS = "Reload the page to reformat the scripts now?"; + +/* DESC: Confirm dialog text for asking if the user wants to reload all scripts. */ +ui_strings.D_RELOAD_SCRIPTS = "Not all scripts are loaded. Do you want to reload the page?"; + +/* DESC: Alert dialog that updating of the custom shortcuts with new ones has failed. */ +ui_strings.D_SHORTCUTS_UPDATE_FAILED = "Failed to sync custom shortcuts. The shortcuts are reset to the default ones."; + +/* DESC: Context menu item for adding an attribute in the DOM view. */ +ui_strings.M_CONTEXTMENU_ADD_ATTRIBUTE = "Add attribute"; + +/* DESC: Context menu item for adding a breakpoint. */ +ui_strings.M_CONTEXTMENU_ADD_BREAKPOINT = "Add breakpoint"; + +/* DESC: Context menu item to add a color in the color palette. */ +ui_strings.M_CONTEXTMENU_ADD_COLOR = "Add color"; + +/* DESC: Context menu item for breakpoints to add a condition. */ +ui_strings.M_CONTEXTMENU_ADD_CONDITION = "Add condition"; + +/* DESC: Context menu item for adding a declaration in a rule. */ +ui_strings.M_CONTEXTMENU_ADD_DECLARATION = "Add declaration"; + +/* DESC: Context menu item for adding a something to watches. */ +ui_strings.M_CONTEXTMENU_ADD_WATCH = "Watch \"%s\""; + +/* DESC: Context menu item for collapsing a node subtree. */ +ui_strings.M_CONTEXTMENU_COLLAPSE_SUBTREE = "Collapse subtree"; + +/* DESC: Context menu item, general "Delete" in a context, e.g. a breakpoint */ +ui_strings.M_CONTEXTMENU_DELETE = "Delete"; + +/* DESC: Context menu item, general "Delete all" in a context, e.g. breakpoints */ +ui_strings.M_CONTEXTMENU_DELETE_ALL = "Delete all"; + +/* DESC: Context menu item for deleting all breakpoints */ +ui_strings.M_CONTEXTMENU_DELETE_ALL_BREAKPOINTS = "Delete all breakpoints"; + +/* DESC: Context menu item for deleting a breakpoint. */ +ui_strings.M_CONTEXTMENU_DELETE_BREAKPOINT = "Delete breakpoint"; + +/* DESC: Context menu item to delete a color in the color palette. */ +ui_strings.M_CONTEXTMENU_DELETE_COLOR = "Delete color"; + +/* DESC: Context menu item for breakpoints to delete a condition. */ +ui_strings.M_CONTEXTMENU_DELETE_CONDITION = "Delete condition"; + +/* DESC: Context menu item, general "Disable all" in a context, e.g. breakpoints */ +ui_strings.M_CONTEXTMENU_DISABLE_ALL = "Disable all"; + +/* DESC: Context menu item for disabling all breakpoints */ +ui_strings.M_CONTEXTMENU_DISABLE_ALL_BREAKPOINTS = "Disable all breakpoints"; + +/* DESC: Context menu item for disabling a breakpoint. */ +ui_strings.M_CONTEXTMENU_DISABLE_BREAKPOINT = "Disable breakpoint"; + +/* DESC: Context menu item for disabling all declarations in a rule. */ +ui_strings.M_CONTEXTMENU_DISABLE_DECLARATIONS = "Disable all declarations"; + +/* DESC: Context menu item for editing an attribute name in the DOM view. */ +ui_strings.M_CONTEXTMENU_EDIT_ATTRIBUTE = "Edit attribute"; + +/* DESC: Context menu item for editing an attribute value in the DOM view. */ +ui_strings.M_CONTEXTMENU_EDIT_ATTRIBUTE_VALUE = "Edit attribute value"; + +/* DESC: Context menu item to edit a color in the color palette. */ +ui_strings.M_CONTEXTMENU_EDIT_COLOR = "Edit color"; + +/* DESC: Context menu item for breakpoints to edit a condition. */ +ui_strings.M_CONTEXTMENU_EDIT_CONDITION = "Edit condition"; + +/* DESC: Context menu item for editiing a declaration in a rule. */ +ui_strings.M_CONTEXTMENU_EDIT_DECLARATION = "Edit declaration"; + +/* DESC: Context menu item for editing some piece of markup in the DOM view. */ +ui_strings.M_CONTEXTMENU_EDIT_MARKUP = "Edit markup"; + +/* DESC: Context menu item for editing text in the DOM view. */ +ui_strings.M_CONTEXTMENU_EDIT_TEXT = "Edit text"; + +/* DESC: Context menu item for enabling a breakpoint. */ +ui_strings.M_CONTEXTMENU_ENABLE_BREAKPOINT = "Enable breakpoint"; + +/* DESC: Context menu item for expanding a node subtree. */ +ui_strings.M_CONTEXTMENU_EXPAND_SUBTREE = "Expand subtree"; + +/* DESC: Context menu item for showing the color picker. */ +ui_strings.M_CONTEXTMENU_OPEN_COLOR_PICKER = "Open color picker"; + +/* DESC: Context menu item for removing a property in a rule. */ +ui_strings.M_CONTEXTMENU_REMOVE_DECLARATION = "Delete declaration"; + +/* DESC: Context menu item for removing a node in the DOM view. */ +ui_strings.M_CONTEXTMENU_REMOVE_NODE = "Delete node"; + +/* DESC: Show resource context menu entry. */ +ui_strings.M_CONTEXTMENU_SHOW_RESOURCE = "Show resource"; + +/* DESC: Context menu item for specification links. */ +ui_strings.M_CONTEXTMENU_SPEC_LINK = "Specification for \"%s\""; + +/* DESC: Context menu item for adding an item in the storage view. */ +ui_strings.M_CONTEXTMENU_STORAGE_ADD = "Add item"; + +/* DESC: Context menu item for deleting an item in the storage view. */ +ui_strings.M_CONTEXTMENU_STORAGE_DELETE = "Delete item"; + +/* DESC: Context menu item for editing an item in the storage view, where %s is the domain name. */ +ui_strings.M_CONTEXTMENU_STORAGE_DELETE_ALL_FROM = "Delete all from %s"; + +/* DESC: Context menu item for deleting multiple items in the storage view. */ +ui_strings.M_CONTEXTMENU_STORAGE_DELETE_PLURAL = "Delete items"; + +/* DESC: Context menu item for editing an item in the storage view. */ +ui_strings.M_CONTEXTMENU_STORAGE_EDIT = "Edit item"; + +/* DESC: Label for option that clears all errors */ +ui_strings.M_LABEL_CLEAR_ALL_ERRORS = "Clear all errors"; + +/* DESC: Label for user interface language dropdown in settings */ +ui_strings.M_LABEL_UI_LANGUAGE = "User interface language"; + +/* DESC: Label for request body input in network crafter */ +ui_strings.M_NETWORK_CRAFTER_REQUEST_BODY = "Request body"; + +/* DESC: Label for response body input in network crafter */ +ui_strings.M_NETWORK_CRAFTER_RESPONSE_BODY = "Response"; + +/* DESC: Label for send request button in network crafter */ +ui_strings.M_NETWORK_CRAFTER_SEND = "Send request"; + +/* DESC: Label for request duration */ +ui_strings.M_NETWORK_REQUEST_DETAIL_DURATION = "Duration"; + +/* DESC: Label for get response body int network request view */ +ui_strings.M_NETWORK_REQUEST_DETAIL_GET_RESPONSE_BODY_LABEL = "Get response body"; + +/* DESC: Label request status */ +ui_strings.M_NETWORK_REQUEST_DETAIL_STATUS = "Status"; + +/* DESC: General settings label. */ +ui_strings.M_SETTING_LABEL_GENERAL = "General"; + +/* DESC: Context menu entry to selecting to group by %s */ +ui_strings.M_SORTABLE_TABLE_CONTEXT_GROUP_BY = "Group by \"%s\""; + +/* DESC: Context menu entry to select that there should be no grouping in the table */ +ui_strings.M_SORTABLE_TABLE_CONTEXT_NO_GROUPING = "No grouping"; + +/* DESC: Context menu entry to reset the columns that are shown */ +ui_strings.M_SORTABLE_TABLE_CONTEXT_RESET_COLUMNS = "Reset columns"; + +/* DESC: Context menu entry to reset the sort order */ +ui_strings.M_SORTABLE_TABLE_CONTEXT_RESET_SORT = "Reset sorting"; + +/* DESC: view that shows all resources */ +ui_strings.M_VIEW_LABEL_ALL_RESOURCES = "All resources"; + +/* DESC: view to set and remove breakpoints */ +ui_strings.M_VIEW_LABEL_BREAKPOINTS = "Breakpoints"; + +/* DESC: Tab heading for area for call stack overview, a list of function calls. */ +ui_strings.M_VIEW_LABEL_CALLSTACK = "Call Stack"; + +/* DESC: Label of the pixel magnifier and color picker view */ +ui_strings.M_VIEW_LABEL_COLOR_MAGNIFIER_AND_PICKER = "Pixel Magnifier and Color Picker"; + +/* DESC: View of the palette of the stored colors. */ +ui_strings.M_VIEW_LABEL_COLOR_PALETTE = "Color Palette"; + +/* DESC: View of the palette of the stored colors. */ +ui_strings.M_VIEW_LABEL_COLOR_PALETTE_SHORT = "Palette"; + +/* DESC: View with a screenshot to select a color. */ +ui_strings.M_VIEW_LABEL_COLOR_PICKER = "Color Picker"; + +/* DESC: Label of the section for selecting a color in color picker */ +ui_strings.M_VIEW_LABEL_COLOR_SELECT = "Color Select"; + +/* DESC: Command line. */ +ui_strings.M_VIEW_LABEL_COMMAND_LINE = "Console"; + +/* DESC: View for DOM debugging. */ +ui_strings.M_VIEW_LABEL_COMPOSITE_DOM = "Documents"; + +/* DESC: View for error log. */ +ui_strings.M_VIEW_LABEL_COMPOSITE_ERROR_CONSOLE = "Errors"; + +/* DESC: Tab heading for the view for exported code. */ +ui_strings.M_VIEW_LABEL_COMPOSITE_EXPORTS = "Export"; + +/* DESC: Tab heading for the view for script debuggingand Settings label. */ +ui_strings.M_VIEW_LABEL_COMPOSITE_SCRIPTS = "Scripts"; + +/* DESC: Menu heading, expandable, for displaying the styles that the rendering computed from all stylesheets. */ +ui_strings.M_VIEW_LABEL_COMPUTED_STYLE = "Computed Style"; + +/* DESC: The view on the console. */ +ui_strings.M_VIEW_LABEL_CONSOLE = "Error Panels"; + +/* DESC: view for cookies */ +ui_strings.M_VIEW_LABEL_COOKIES = "Cookies"; + +/* DESC: View to see the DOM tree. */ +ui_strings.M_VIEW_LABEL_DOM = "DOM Panel"; + +/* DESC: Tab heading for the list of properties of a selected DOM node and a Settings label. */ +ui_strings.M_VIEW_LABEL_DOM_ATTR = "Properties"; + +/* DESC: Tab heading for area giving information of the runtime environment. */ +ui_strings.M_VIEW_LABEL_ENVIRONMENT = "Environment"; + +/* DESC: Tab heading, subhead under the Error Console tab for the error view filter for showing all errors. */ +ui_strings.M_VIEW_LABEL_ERROR_ALL = "All"; + +/* DESC: See Opera Error console: Error view filter for showing all Bittorrent errors. */ +ui_strings.M_VIEW_LABEL_ERROR_BITTORRENT = "BitTorrent"; + +/* DESC: Tab heading, subhead under the Error Console tab for the error view filter for showing all CSS errors. */ +ui_strings.M_VIEW_LABEL_ERROR_CSS = "CSS"; + +/* DESC: Tab heading, subhead under the Error Console tab for the error view filter for showing all HTML errors. */ +ui_strings.M_VIEW_LABEL_ERROR_HTML = "HTML"; + +/* DESC: Tab heading, subhead under the Error Console tab for the error view filter for showing all Java errors. */ +ui_strings.M_VIEW_LABEL_ERROR_JAVA = "Java"; + +/* DESC: Tooltip that explains File:Line notation (e.g. in Error Log) */ +ui_strings.M_VIEW_LABEL_ERROR_LOCATION_TITLE = "Line %(LINE)s in %(URI)s"; + +/* DESC: Tab heading, subhead under the Error Console tab for the error view filter for showing all Mail errors. */ +ui_strings.M_VIEW_LABEL_ERROR_M2 = "Mail"; + +/* DESC: Tab heading, subhead under the Error Console tab for the error view filter for showing all Network errors. */ +ui_strings.M_VIEW_LABEL_ERROR_NETWORK = "Network"; + +/* DESC: Tab heading, subhead under the Error Console tab for the error view filter for showing errors that we don't have a dedicated tab for. */ +ui_strings.M_VIEW_LABEL_ERROR_OTHER = "Other"; + +/* DESC: Tab heading, subhead under the Error Console tab for the error view filter for showing all JS errors. */ +ui_strings.M_VIEW_LABEL_ERROR_SCRIPT = "JavaScript"; + +/* DESC: Tab heading, subhead under the Error Console tab for the error view filter for showing all Storage errors. */ +ui_strings.M_VIEW_LABEL_ERROR_STORAGE = "Storage"; + +/* DESC: Tab heading, subhead under the Error Console tab for the error view filter for showing all SVG errors. */ +ui_strings.M_VIEW_LABEL_ERROR_SVG = "SVG"; + +/* DESC: See Opera Error console: Error view filter for showing all Widget errors. */ +ui_strings.M_VIEW_LABEL_ERROR_WIDGET = "Widgets"; + +/* DESC: Tab heading, subhead under the Error Console tab for the error view filter for showing all XML errors. */ +ui_strings.M_VIEW_LABEL_ERROR_XML = "XML"; + +/* DESC: Tab heading, subhead under the Error Console tab for the error view filter for showing all XSLT errors. */ +ui_strings.M_VIEW_LABEL_ERROR_XSLT = "XSLT"; + +/* DESC: view to set and remove event breakpoints */ +ui_strings.M_VIEW_LABEL_EVENT_BREAKPOINTS = "Event Breakpoints"; + +/* DESC: Side panel view with event listeners. */ +ui_strings.M_VIEW_LABEL_EVENT_LISTENERS = "Listeners"; + +/* DESC: View with all event listeners. */ +ui_strings.M_VIEW_LABEL_EVENT_LISTENERS_ALL = "All"; + +/* DESC: View with the event listeners of the selected node. */ +ui_strings.M_VIEW_LABEL_EVENT_LISTENERS_SELECTED_NODE = "Selected Node"; + +/* DESC: Heading for Export button, accessed by clicking the subhead DOM view button. */ +ui_strings.M_VIEW_LABEL_EXPORT = "Export"; + +/* DESC: Tab heading for the area displaying JS properties of a frame or object and a Settings label. */ +ui_strings.M_VIEW_LABEL_FRAME_INSPECTION = "Inspection"; + +/* DESC: Label for a utility window that enables the user to enter a line number, and go to that line. */ +ui_strings.M_VIEW_LABEL_GO_TO_LINE = "Go to line"; + +/* DESC: Tab heading for the box model layout display and a Settings label. */ +ui_strings.M_VIEW_LABEL_LAYOUT = "Layout"; + +/* DESC: view for the local storage */ +ui_strings.M_VIEW_LABEL_LOCAL_STORAGE = "Local Storage"; + +/* DESC: Label for the setting of the monospace font. */ +ui_strings.M_VIEW_LABEL_MONOSPACE_FONT = "Monospace Font"; + +/* DESC: Tab heading for the view for network debugging (and http logger) */ +ui_strings.M_VIEW_LABEL_NETWORK = "Network"; + +/* DESC: view that shows network log */ +ui_strings.M_VIEW_LABEL_NETWORK_LOG = "Network log"; + +/* DESC: view that shows network options */ +ui_strings.M_VIEW_LABEL_NETWORK_OPTIONS = "Network options"; + +/* DESC: Section title for new styles. */ +ui_strings.M_VIEW_LABEL_NEW_STYLE = "New Style"; + +/* DESC: Text to show in call stack when the execution is not stopped. */ +ui_strings.M_VIEW_LABEL_NOT_STOPPED = "Not stopped"; + +/* DESC: Text to show in breakpoins if there is no breakpoint. */ +ui_strings.M_VIEW_LABEL_NO_BREAKPOINT = "No breakpoint"; + +/* DESC: Text to show in inspection if there is no object to inspect. */ +ui_strings.M_VIEW_LABEL_NO_INSPECTION = "No inspection"; + +/* DESC: The content of the return value section when there are not return values. */ +ui_strings.M_VIEW_LABEL_NO_RETURN_VALUES = "No return values"; + +/* DESC: Text to show in watches if there are no watches */ +ui_strings.M_VIEW_LABEL_NO_WATCHES = "No watches"; + +/* DESC: View for DOM debugging. */ +ui_strings.M_VIEW_LABEL_PROFILER = "Profiler"; + +/* DESC: Name of raw request tab */ +ui_strings.M_VIEW_LABEL_RAW_REQUEST_INFO = "Raw request"; + +/* DESC: Name of raw response tab */ +ui_strings.M_VIEW_LABEL_RAW_RESPONSE_INFO = "Raw Response"; + +/* DESC: view that shows request crafter */ +ui_strings.M_VIEW_LABEL_REQUEST_CRAFTER = "Make request"; + +/* DESC: Name of request headers tab */ +ui_strings.M_VIEW_LABEL_REQUEST_HEADERS = "Request Headers"; + +/* DESC: Name of request log tab */ +ui_strings.M_VIEW_LABEL_REQUEST_LOG = "Request log"; + +/* DESC: Name of request summary view */ +ui_strings.M_VIEW_LABEL_REQUEST_SUMMARY = "Request Summary"; + +/* DESC: View for overview of resources contained in a document */ +ui_strings.M_VIEW_LABEL_RESOURCES = "Resources"; + +/* DESC: Name of response body tab */ +ui_strings.M_VIEW_LABEL_RESPONSE_BODY = "Response body"; + +/* DESC: Name of response headers tab */ +ui_strings.M_VIEW_LABEL_RESPONSE_HEADERS = "Response Headers"; + +/* DESC: Section in the script side panel for return values. */ +ui_strings.M_VIEW_LABEL_RETURN_VALUES = "Return Values"; + +/* DESC: side panel in the script view with the callstack and the inspection view. */ +ui_strings.M_VIEW_LABEL_RUNTIME_STATE = "State"; + +/* DESC: Subhead located under the Scripts area, for scripts contained in runtime. */ +ui_strings.M_VIEW_LABEL_SCRIPTS = "Scripts"; + +/* DESC: Tab heading for the search panel. */ +ui_strings.M_VIEW_LABEL_SEARCH = "Search"; + +/* DESC: view for the session storage */ +ui_strings.M_VIEW_LABEL_SESSION_STORAGE = "Session Storage"; + +/* DESC: Tab heading for area giving source code view and Settings label . */ +ui_strings.M_VIEW_LABEL_SOURCE = "Source"; + +/* DESC: View for all types of storage, cookies, localStorage, sessionStorage e.t.c */ +ui_strings.M_VIEW_LABEL_STORAGE = "Storage"; + +/* DESC: Label of the stored colors view */ +ui_strings.M_VIEW_LABEL_STORED_COLORS = "Color Palette"; + +/* DESC: Tab heading for the list of all applied styles and a Settings label; also menu heading, expandable, for displaying the styles that got defined in the style sheets. */ +ui_strings.M_VIEW_LABEL_STYLES = "Styles"; + +/* DESC: Tab heading for the view to see style sheet rules and a Settings label. */ +ui_strings.M_VIEW_LABEL_STYLESHEET = "Style Sheet"; + +/* DESC: Tab heading, a subhead under DOM, for area displaying style sheets in the runtime. */ +ui_strings.M_VIEW_LABEL_STYLESHEETS = "Style Sheets"; + +/* DESC: Tab heading for thread log overview, a list of threads and Settings label. */ +ui_strings.M_VIEW_LABEL_THREAD_LOG = "Thread Log"; + +/* DESC: View for utilities, e.g. a pixel maginfier and color picker */ +ui_strings.M_VIEW_LABEL_UTILITIES = "Utilities"; + +/* DESC: Label of the Views menu. */ +ui_strings.M_VIEW_LABEL_VIEWS = "Views"; + +/* DESC: section in the script side panel for watches. */ +ui_strings.M_VIEW_LABEL_WATCHES = "Watches"; + +/* DESC: view for widget prefernces */ +ui_strings.M_VIEW_LABEL_WIDGET_PREFERNCES = "Widget Preferences"; + +/* DESC: Label for the layout subview showing the box-model metrics of an element. */ +ui_strings.M_VIEW_SUB_LABEL_METRICS = "Metrics"; + +/* DESC: Label for the layout subvie showing offsets of the selected element. */ +ui_strings.M_VIEW_SUB_LABEL_OFFSET_VALUES = "Offset Values"; + +/* DESC: Label for the layout subview showing the parent node chain used to calculate the offset. */ +ui_strings.M_VIEW_SUB_LABEL_PARENT_OFFSETS = "Parent Offsets"; + +/* DESC: Anonymous function label. */ +ui_strings.S_ANONYMOUS_FUNCTION_NAME = "(anonymous)"; + +/* DESC: Info in a tooltip that the according listener was set as attribute. */ +ui_strings.S_ATTRIBUTE_LISTENER = "Event handler"; + +/* DESC: Generic label for a cancel button */ +ui_strings.S_BUTTON_CANCEL = "Cancel"; + +/* DESC: Cancel button while the client is waiting for a host connection. */ +ui_strings.S_BUTTON_CANCEL_REMOTE_DEBUG = "Cancel Remote Debug"; + +/* DESC: Reset all the values to their default state */ +ui_strings.S_BUTTON_COLOR_RESTORE_DEFAULTS = "Restore defaults"; + +/* DESC: Edit custom events */ +ui_strings.S_BUTTON_EDIT_CUSTOM_EVENT = "Edit"; + +/* DESC: Enter anvanced search mode */ +ui_strings.S_BUTTON_ENTER_ADVANCED_SEARCH = "More"; + +/* DESC: Enter anvanced search mode tooltip */ +ui_strings.S_BUTTON_ENTER_ADVANCED_SEARCH_TOOLTIP = "Show advanced search"; + +/* DESC: Expand all sections in the event breakpoints view */ +ui_strings.S_BUTTON_EXPAND_ALL_SECTIONS = "Expand all sections"; + +/* DESC: Execution stops at encountering an abort. */ +ui_strings.S_BUTTON_LABEL_AT_ABORT = "Stop when encountering an abort message"; + +/* DESC: Execution stops when encountering an error. */ +ui_strings.S_BUTTON_LABEL_AT_ERROR = "Show parse errors and break on exceptions"; + +/* DESC: Execution stops when encountering an exception. */ +ui_strings.S_BUTTON_LABEL_AT_EXCEPTION = "Break when an exception is thrown"; + +/* DESC: Empties the log entries. */ +ui_strings.S_BUTTON_LABEL_CLEAR_LOG = "Clear visible errors"; + +/* DESC: Tooltip text for a button on the Thread Log view to clear thread log. */ +ui_strings.S_BUTTON_LABEL_CLEAR_THREAD_LOG = "Clear thread log"; + +/* DESC: Closes the window. */ +ui_strings.S_BUTTON_LABEL_CLOSE_WINDOW = "Close window"; + +/* DESC: Debugger continues debugging. */ +ui_strings.S_BUTTON_LABEL_CONTINUE = "Continue (%s)"; + +/* DESC: Exports the DOM currently shown. */ +ui_strings.S_BUTTON_LABEL_EXPORT_DOM = "Export the current DOM panel"; + +/* DESC: Also Tooltip text for a button on the Thread Log view to export current thread log. */ +ui_strings.S_BUTTON_LABEL_EXPORT_LOG = "Export thread log"; + +/* DESC: Tooltip text for a button under the secondary DOM tab that expands the DOM tree completely. */ +ui_strings.S_BUTTON_LABEL_GET_THE_WOHLE_TREE = "Expand the DOM tree"; + +/* DESC: Opens help. */ +ui_strings.S_BUTTON_LABEL_HELP = "Help"; + +/* DESC: Hides all default properties in the global scope. */ +ui_strings.S_BUTTON_LABEL_HIDE_DEFAULT_PROPS_IN_GLOBAL_SCOPE = "Show default properties in global scope"; + +/* DESC: List item under the Source settings menu to logs all threads when activated. Also Tooltip text for a button on the Source tab. */ +ui_strings.S_BUTTON_LABEL_LOG_THREADS = "Log threads"; + +/* DESC: Refetch the event listeners. */ +ui_strings.S_BUTTON_LABEL_REFETCH_EVENT_LISTENERS = "Refetch event listeners"; + +/* DESC: Enable reformatting of JavaScript. */ +ui_strings.S_BUTTON_LABEL_REFORMAT_JAVASCRIPT = "Pretty print JavaScript"; + +/* DESC: Tooltip text for a button under the Scripts tab that reloads the browser to receive fresh DOM, etc. */ +ui_strings.S_BUTTON_LABEL_RELOAD_HOST = "Reload the selected window in the browser"; + +/* DESC: For selecting which window to debug. */ +ui_strings.S_BUTTON_LABEL_SELECT_WINDOW = "Select the debugging context you want to debug"; + +/* DESC: Tooltip text for the Settings button that launches the Settings view. */ +ui_strings.S_BUTTON_LABEL_SETTINGS = "Settings"; + +/* DESC: Debugger step into current statement. */ +ui_strings.S_BUTTON_LABEL_STEP_INTO = "Step into (%s)"; + +/* DESC: Debugger step out from current statement. */ +ui_strings.S_BUTTON_LABEL_STEP_OUT = "Step out (%s)"; + +/* DESC: Debugger step over current statement. */ +ui_strings.S_BUTTON_LABEL_STEP_OVER = "Step over (%s)"; + +/* DESC: Execution stops when a new script is encountered. */ +ui_strings.S_BUTTON_LABEL_STOP_AT_THREAD = "Break on first statement of a new script"; + +/* DESC: Leave anvanced search mode */ +ui_strings.S_BUTTON_LEAVE_ADVANCED_SEARCH = "Less"; + +/* DESC: Leave anvanced search mode tooltip */ +ui_strings.S_BUTTON_LEAVE_ADVANCED_SEARCH_TOOLTIP = "Show search bar"; + +/* DESC: Button label to show window for loading a PO file */ +ui_strings.S_BUTTON_LOAD_PO_FILE = "Load PO file"; + +/* DESC: Generic label for an OK button */ +ui_strings.S_BUTTON_OK = "OK"; + +/* DESC: Remove all event breakpoints */ +ui_strings.S_BUTTON_REMOVE_ALL_BREAKPOINTS = "Delete all event breakpoints"; + +/* DESC: Reset all keyboard shortcuts to the default values. */ +ui_strings.S_BUTTON_RESET_ALL_TO_DEFAULTS = "Reset all to defaults"; + +/* DESC: Button label to reset the fon selection to the default values */ +ui_strings.S_BUTTON_RESET_TO_DEFAULTS = "Reset default values"; + +/* DESC: Generic label for a save button */ +ui_strings.S_BUTTON_SAVE = "Save"; + +/* DESC: Search for an event in the event breakpoints view */ +ui_strings.S_BUTTON_SEARCH_EVENT = "Search for an event"; + +/* DESC: Search for a keyboard shortcut in the keyboard configuration view */ +ui_strings.S_BUTTON_SEARCH_SHORTCUT = "Search keyboard shortcuts"; + +/* DESC: Set the default value. */ +ui_strings.S_BUTTON_SET_DEFAULT_VALUE = "Reset default value"; + +/* DESC: Show request headers. */ +ui_strings.S_BUTTON_SHOW_REQUEST_HEADERS = "Headers"; + +/* DESC: Show raw request. */ +ui_strings.S_BUTTON_SHOW_REQUEST_RAW = "Raw"; + +/* DESC: Show request summary. */ +ui_strings.S_BUTTON_SHOW_REQUEST_SUMMARY = "Summary"; + +/* DESC: Button label in settings to reset the element highlight to the default values */ +ui_strings.S_BUTTON_SPOTLIGHT_RESET_DEFAULT_COLORS = "Reset default colors"; + +/* DESC: Button title for starting the profiler */ +ui_strings.S_BUTTON_START_PROFILER = "Start profiling"; + +/* DESC: Button title for stopping the profiler */ +ui_strings.S_BUTTON_STOP_PROFILER = "Stop profiling"; + +/* DESC: Button label to delete all items in a storage, e.g. the local storage */ +ui_strings.S_BUTTON_STORAGE_DELETE_ALL = "Delete All"; + +/* DESC: Button label to store the color */ +ui_strings.S_BUTTON_STORE_COLOR = "Store color"; + +/* DESC: Button to switch to network-profiler mode. */ +ui_strings.S_BUTTON_SWITCH_TO_NETWORK_PROFILER = "Improve accuracy of timing information"; + +/* DESC: Button label to take a screenshot */ +ui_strings.S_BUTTON_TAKE_SCREENSHOT = "Take screenshot"; + +/* DESC: Label for button in Remote Debugging that applies the changes. */ +ui_strings.S_BUTTON_TEXT_APPLY = "Apply"; + +/* DESC: Global console toggle */ +ui_strings.S_BUTTON_TOGGLE_CONSOLE = "Toggle console"; + +/* DESC: Global remote debug toggle */ +ui_strings.S_BUTTON_TOGGLE_REMOTE_DEBUG = "Remote debug configuration"; + +/* DESC: Global settings toggle */ +ui_strings.S_BUTTON_TOGGLE_SETTINGS = "Settings"; + +/* DESC: Button label to update the screenshot */ +ui_strings.S_BUTTON_UPDATE_SCREESHOT = "Update screenshot"; + +/* DESC: Unit string for bytes */ +ui_strings.S_BYTES_UNIT = "bytes"; + +/* DESC: Clears the command line log */ +ui_strings.S_CLEAR_COMMAND_LINE_LOG = "Clear console"; + +/* DESC: Label on button to clear network graph */ +ui_strings.S_CLEAR_NETWORK_LOG = "Clear network log"; + +/* DESC: Close command line window */ +ui_strings.S_CLOSE_COMMAND_LINE = "Close console"; + +/* DESC: Setting for changing the color notation (Hex, RGB, HSL) */ +ui_strings.S_COLOR_NOTATION = "Color format"; + +/* DESC: Average color setting, " x pixels" will be added */ +ui_strings.S_COLOR_PICKER_AVERAGE_COLOR_OF = "Average color of"; + +/* DESC: Table heading for column showing error descriptions */ +ui_strings.S_COLUMN_LABEL_ERROR = "Error"; + +/* DESC: Table heading for "file" column */ +ui_strings.S_COLUMN_LABEL_FILE = "File"; + +/* DESC: Table heading for column showing line number */ +ui_strings.S_COLUMN_LABEL_LINE = "Line"; + +/* DESC: Message about having to load a different version of dragonfly in order to work with the browser bing debugged */ +ui_strings.S_CONFIRM_LOAD_COMPATIBLE_VERSION = "The protocol version of Opera does not match the one which Opera Dragonfly is using.\n\nTry to load a compatible version?"; + +/* DESC: Dialog to confirm switching to network-profiler mode. */ +ui_strings.S_CONFIRM_SWITCH_TO_NETWORK_PROFILER = "To improve the accuracy of timing information, other features are turned off. You may lose changes you made."; + +/* DESC: Label for the list of function when doing console.trace(). */ +ui_strings.S_CONSOLE_TRACE_LABEL = "Stack trace:"; + +/* DESC: In 1 hour */ +ui_strings.S_COOKIE_MANAGER_IN_1_HOUR = "In 1 hour"; + +/* DESC: In 1 minute */ +ui_strings.S_COOKIE_MANAGER_IN_1_MINUTE = "In 1 minute"; + +/* DESC: In 1 month */ +ui_strings.S_COOKIE_MANAGER_IN_1_MONTH = "In 1 month"; + +/* DESC: In 1 week */ +ui_strings.S_COOKIE_MANAGER_IN_1_WEEK = "In 1 week"; + +/* DESC: In 1 year */ +ui_strings.S_COOKIE_MANAGER_IN_1_YEAR = "In 1 year"; + +/* DESC: In x days */ +ui_strings.S_COOKIE_MANAGER_IN_X_DAYS = "In %s days"; + +/* DESC: In x hours */ +ui_strings.S_COOKIE_MANAGER_IN_X_HOURS = "In %s hours"; + +/* DESC: In x minutes */ +ui_strings.S_COOKIE_MANAGER_IN_X_MINUTES = "In %s minutes"; + +/* DESC: In x months */ +ui_strings.S_COOKIE_MANAGER_IN_X_MONTHS = "In %s months"; + +/* DESC: In x weeks */ +ui_strings.S_COOKIE_MANAGER_IN_X_WEEKS = "In %s weeks"; + +/* DESC: In x years */ +ui_strings.S_COOKIE_MANAGER_IN_X_YEARS = "In %s years"; + +/* DESC: In less then 1 minute */ +ui_strings.S_COOKIE_MANAGER_SOONER_THEN_1_MINUTE = "< 1 minute"; + +/* DESC: Tomorrow */ +ui_strings.S_COOKIE_MANAGER_TOMORROW = "Tomorrow"; + +/* DESC: Tooltip for disabling a declaration */ +ui_strings.S_DISABLE_DECLARATION = "Disable"; + +/* DESC: Prefix before debug output */ +ui_strings.S_DRAGONFLY_INFO_MESSAGE = "Opera Dragonfly info message:\n"; + +/* DESC: Tooltip for enabling a declaration */ +ui_strings.S_ENABLE_DECLARATION = "Enable"; + +/* DESC: Info text that explains that only a certain number %(MAX)s of Errors is shown, out of a total of %(COUNT)s */ +ui_strings.S_ERRORS_MAXIMUM_REACHED = "Displaying %(MAX)s of %(COUNT)s errors"; + +/* DESC: List of filters that will be hidden in the Error log */ +ui_strings.S_ERROR_LOG_CSS_FILTER = "Use CSS filter"; + +/* DESC: Link in an event listener tooltip to the source position where the listener is added. */ +ui_strings.S_EVENT_LISTENER_ADDED_IN = "Added in %s"; + +/* DESC: Info in an event listener tooltip that the according listener was added in the markup as element attribute. */ +ui_strings.S_EVENT_LISTENER_SET_AS_MARKUP_ATTR = "Set as markup attribute"; + +/* DESC: Info in a tooltip that the according listener was set by the event target interface. */ +ui_strings.S_EVENT_TARGET_LISTENER = "Event listener"; + +/* DESC: Event type for events in the profiler */ +ui_strings.S_EVENT_TYPE_CSS_PARSING = "CSS parsing"; + +/* DESC: Event type for events in the profiler */ +ui_strings.S_EVENT_TYPE_CSS_SELECTOR_MATCHING = "CSS selector matching"; + +/* DESC: Event type for events in the profiler */ +ui_strings.S_EVENT_TYPE_DOCUMENT_PARSING = "Document parsing"; + +/* DESC: Event type for events in the profiler */ +ui_strings.S_EVENT_TYPE_GENERIC = "Generic"; + +/* DESC: Event type for events in the profiler */ +ui_strings.S_EVENT_TYPE_LAYOUT = "Layout"; + +/* DESC: Event type for events in the profiler */ +ui_strings.S_EVENT_TYPE_PAINT = "Paint"; + +/* DESC: Event type for events in the profiler */ +ui_strings.S_EVENT_TYPE_PROCESS = "Process"; + +/* DESC: Event type for events in the profiler */ +ui_strings.S_EVENT_TYPE_REFLOW = "Reflow"; + +/* DESC: Event type for events in the profiler */ +ui_strings.S_EVENT_TYPE_SCRIPT_COMPILATION = "Script compilation"; + +/* DESC: Event type for events in the profiler */ +ui_strings.S_EVENT_TYPE_STYLE_RECALCULATION = "Style recalculation"; + +/* DESC: Event type for events in the profiler */ +ui_strings.S_EVENT_TYPE_THREAD_EVALUATION = "Thread evaluation"; + +/* DESC: Context menu item for expanding CSS shorthands */ +ui_strings.S_EXPAND_SHORTHANDS = "Expand shorthands"; + +/* DESC: Label for the global keyboard shortcuts section */ +ui_strings.S_GLOBAL_KEYBOARD_SHORTCUTS_SECTION_TITLE = "Global"; + +/* DESC: Global scope label. */ +ui_strings.S_GLOBAL_SCOPE_NAME = "(global)"; + +/* DESC: Show help in command line */ +ui_strings.S_HELP_COMMAND_LINE = "Help"; + +/* DESC: Label for http event sequence when urlfinished follows after some other event, meaning it was aborted */ +ui_strings.S_HTTP_EVENT_SEQUENCE_INFO_ABORTING_REQUEST = "Request aborted"; + +/* DESC: Label for http event sequence when redirecting */ +ui_strings.S_HTTP_EVENT_SEQUENCE_INFO_ABORT_RETRYING = "Sequence terminated, retry"; + +/* DESC: Label for http event sequence when closing response phase */ +ui_strings.S_HTTP_EVENT_SEQUENCE_INFO_CLOSING_RESPONSE_PHASE = "Closing response phase"; + +/* DESC: Label for http event sequence when processing */ +ui_strings.S_HTTP_EVENT_SEQUENCE_INFO_PROCESSING = "Processing"; + +/* DESC: Label for http event sequence when processing response */ +ui_strings.S_HTTP_EVENT_SEQUENCE_INFO_PROCESSING_RESPONSE = "Processing response"; + +/* DESC: Label for http event sequence when reading local data (data-uri, caches, file:// etc) */ +ui_strings.S_HTTP_EVENT_SEQUENCE_INFO_READING_LOCAL_DATA = "Reading local data"; + +/* DESC: Label for http event sequence when redirecting */ +ui_strings.S_HTTP_EVENT_SEQUENCE_INFO_REDIRECTING = "Redirecting"; + +/* DESC: Label for http event sequence when the event was scheduled */ +ui_strings.S_HTTP_EVENT_SEQUENCE_INFO_SCHEDULING = "Scheduling request"; + +/* DESC: Label for http event sequence when reading response body */ +ui_strings.S_HTTP_EVENT_SEQUENCE_READING_RESPONSE_BODY = "Reading response body"; + +/* DESC: Label for http event sequence when reading response header */ +ui_strings.S_HTTP_EVENT_SEQUENCE_READING_RESPONSE_HEADER = "Reading response header"; + +/* DESC: Label for http event sequence when waiting for response from network */ +ui_strings.S_HTTP_EVENT_SEQUENCE_WAITING_FOR_RESPONSE = "Waiting for response"; + +/* DESC: Label for http event sequence when writing request body */ +ui_strings.S_HTTP_EVENT_SEQUENCE_WRITING_REQUEST_BODY = "Writing request body"; + +/* DESC: Label for http event sequence when writing request header */ +ui_strings.S_HTTP_EVENT_SEQUENCE_WRITING_REQUEST_HEADER = "Writing request header"; + +/* DESC: First line of dialog that explains that the loading flow of the context is not shown completely */ +ui_strings.S_HTTP_INCOMPLETE_LOADING_GRAPH = "Reload to show all page requests"; + +/* DESC: tooltip for the network data view button */ +ui_strings.S_HTTP_LABEL_DATA_VIEW = "Data view"; + +/* DESC: label for table header that shows duration (short) */ +ui_strings.S_HTTP_LABEL_DURATION = "Duration"; + +/* DESC: label for the network filter that shows all items */ +ui_strings.S_HTTP_LABEL_FILTER_ALL = "All"; + +/* DESC: label for the network filter that shows image items */ +ui_strings.S_HTTP_LABEL_FILTER_IMAGES = "Images"; + +/* DESC: label for the network filter that shows markup items */ +ui_strings.S_HTTP_LABEL_FILTER_MARKUP = "Markup"; + +/* DESC: label for the network filter that shows items that are not markup, stylesheet, script or image */ +ui_strings.S_HTTP_LABEL_FILTER_OTHER = "Other"; + +/* DESC: label for the network filter that shows script items */ +ui_strings.S_HTTP_LABEL_FILTER_SCRIPTS = "Scripts"; + +/* DESC: label for the network filter that shows stylesheet items */ +ui_strings.S_HTTP_LABEL_FILTER_STYLESHEETS = "Stylesheets"; + +/* DESC: label for the network filter that shows items requested over XMLHttpRequest */ +ui_strings.S_HTTP_LABEL_FILTER_XHR = "XHR"; + +/* DESC: label for table header that shows loading sequence as a graph (short) */ +ui_strings.S_HTTP_LABEL_GRAPH = "Graph"; + +/* DESC: tooltip for the network graph view button */ +ui_strings.S_HTTP_LABEL_GRAPH_VIEW = "Graph view"; + +/* DESC: label for host in http request details */ +ui_strings.S_HTTP_LABEL_HOST = "Host"; + +/* DESC: label for method in http request details */ +ui_strings.S_HTTP_LABEL_METHOD = "Method"; + +/* DESC: label for path in http request details */ +ui_strings.S_HTTP_LABEL_PATH = "Path"; + +/* DESC: label for query arguments in http request details */ +ui_strings.S_HTTP_LABEL_QUERY_ARGS = "Query arguments"; + +/* DESC: label for response in http request details */ +ui_strings.S_HTTP_LABEL_RESPONSE = "Response"; + +/* DESC: label for table header that shows http response code (short) */ +ui_strings.S_HTTP_LABEL_RESPONSECODE = "Status"; + +/* DESC: label for table header that shows starting time (short) */ +ui_strings.S_HTTP_LABEL_STARTED = "Started"; + +/* DESC: label for url in http request details */ +ui_strings.S_HTTP_LABEL_URL = "URL"; + +/* DESC: label for table header that shows waiting time (short) */ +ui_strings.S_HTTP_LABEL_WAITING = "Waiting"; + +/* DESC: tooltip for resources that have not been requested over network (mostly that means cached) */ +ui_strings.S_HTTP_NOT_REQUESTED = "Cached"; + +/* DESC: Headline for network-sequence tooltip that shows the absolute time when the resource was requested internally */ +ui_strings.S_HTTP_REQUESTED_HEADLINE = "Requested at %s"; + +/* DESC: tooltip for resources served over file:// to make it explicit that this didn't touch the network */ +ui_strings.S_HTTP_SERVED_OVER_FILE = "Local"; + +/* DESC: tooltip for table header that shows duration */ +ui_strings.S_HTTP_TOOLTIP_DURATION = "Time spent between starting and finishing this request"; + +/* DESC: tooltip for the network filter that shows all items */ +ui_strings.S_HTTP_TOOLTIP_FILTER_ALL = "Show all requests"; + +/* DESC: tooltip for the network filter that shows image items */ +ui_strings.S_HTTP_TOOLTIP_FILTER_IMAGES = "Show only images"; + +/* DESC: tooltip for the network filter that shows markup items */ +ui_strings.S_HTTP_TOOLTIP_FILTER_MARKUP = "Show only markup"; + +/* DESC: tooltip for the network filter that shows items that are not markup, stylesheet, script or image */ +ui_strings.S_HTTP_TOOLTIP_FILTER_OTHER = "Show requests of other types"; + +/* DESC: tooltip for the network filter that shows script items */ +ui_strings.S_HTTP_TOOLTIP_FILTER_SCRIPTS = "Show only scripts"; + +/* DESC: tooltip for the network filter that shows stylesheet items */ +ui_strings.S_HTTP_TOOLTIP_FILTER_STYLESHEETS = "Show only stylesheets"; + +/* DESC: tooltip for the network filter that shows items requested over XMLHttpRequest */ +ui_strings.S_HTTP_TOOLTIP_FILTER_XHR = "Show only XMLHttpRequests"; + +/* DESC: tooltip for table header that shows loading sequence as a graph */ +ui_strings.S_HTTP_TOOLTIP_GRAPH = "Graph of the loading sequence"; + +/* DESC: tooltip on mime type table header */ +ui_strings.S_HTTP_TOOLTIP_MIME = "MIME type"; + +/* DESC: tooltip on protocol table header */ +ui_strings.S_HTTP_TOOLTIP_PROTOCOL = "Protocol"; + +/* DESC: tooltip on table header that shows http response code */ +ui_strings.S_HTTP_TOOLTIP_RESPONSECODE = "HTTP status code"; + +/* DESC: tooltip on size table header */ +ui_strings.S_HTTP_TOOLTIP_SIZE = "Content-length of the response in bytes"; + +/* DESC: tooltip on prettyprinted size table header */ +ui_strings.S_HTTP_TOOLTIP_SIZE_PRETTYPRINTED = "Content-length of the response"; + +/* DESC: tooltip for table header that shows relative starting time */ +ui_strings.S_HTTP_TOOLTIP_STARTED = "Starting time, relative to the main document"; + +/* DESC: tooltip for table header that shows waiting time */ +ui_strings.S_HTTP_TOOLTIP_WAITING = "Time spent requesting this resource"; + +/* DESC: tooltip-prefix for resources that have been marked unloaded, which means they are no longer reference in the document */ +ui_strings.S_HTTP_UNREFERENCED = "Unreferenced"; + +/* DESC: Information shown if the document does not hold any style sheet. */ +ui_strings.S_INFO_DOCUMENT_HAS_NO_STYLESHEETS = "This document has no style sheets"; + +/* DESC: Feedback showing that Opera Dragonfly is loading and the user shall have patience. */ +ui_strings.S_INFO_DOCUMNENT_LOADING = "Updating Opera Dragonfly‚Ķ"; + +/* DESC: There was an error trying to listen to the specified port */ +ui_strings.S_INFO_ERROR_LISTENING = "There was an error. Please check that port %s is not in use."; + +/* DESC: Information shown if the user tries to perform a reg exp search with an invalid regular expression. */ +ui_strings.S_INFO_INVALID_REGEXP = "Invalid regular expression."; + +/* DESC: Info text in the settings to invert the highlight color for elements. */ +ui_strings.S_INFO_INVERT_ELEMENT_HIGHLIGHT = "The element highlight color can be inverted with the \"%s\" shortcut."; + +/* DESC: The info text to notify the user that the application is performing the search. */ +ui_strings.S_INFO_IS_SEARCHING = "Searching‚Ķ"; + +/* DESC: Info in an event listener tooltip that the according source file is missing. */ +ui_strings.S_INFO_MISSING_JS_SOURCE_FILE = "(Missing source file)"; + +/* DESC: Info text in the network view when a page starts to load while screen updats are paused */ +ui_strings.S_INFO_NETWORK_UPDATES_PAUSED = "Updating of network log is paused."; + +/* DESC: Message about there being no version of dragonfly compatible with the browser being debugged */ +ui_strings.S_INFO_NO_COMPATIBLE_VERSION = "There is no compatible Opera Dragonfly version."; + +/* DESC: Shown when entering something on the command line while there is no javascript running in the window being debugged */ +ui_strings.S_INFO_NO_JAVASCRIPT_IN_CONTEXT = "There is no JavaScript environment in the active window"; + +/* DESC: The info text in an alert box if the user has specified an invalid port number for remote debugging. */ +ui_strings.S_INFO_NO_VALID_PORT_NUMBER = "Please select a port number between %s and %s."; + +/* DESC: A info message that the debugger is currently in profiler mode. */ +ui_strings.S_INFO_PROFILER_MODE = "The debugger is in profiler mode. All other features are disabled."; + +/* DESC: Information shown if the user tries to perform a reg exp search which matches the empty string. */ +ui_strings.S_INFO_REGEXP_MATCHES_EMPTY_STRING = "RegExp matches empty string. No search was performed."; + +/* DESC: Currently no scripts are loaded and a reload of the page will resolve all linked scripts. */ +ui_strings.S_INFO_RELOAD_FOR_SCRIPT = "Click the reload button above to fetch the scripts for the selected debugging context"; + +/* DESC: Info text in when a request in the request crafter failed. */ +ui_strings.S_INFO_REQUEST_FAILED = "The request failed."; + +/* DESC: Information shown if the document does not hold any scripts. Appears in Scripts view. */ +ui_strings.S_INFO_RUNTIME_HAS_NO_SCRIPTS = "This document has no scripts"; + +/* DESC: the given storage type doesn't exist, e.g. a widget without the w3c widget namespace */ +ui_strings.S_INFO_STORAGE_TYPE_DOES_NOT_EXIST = "%s does not exist."; + +/* DESC: Information shown if the stylesheet does not hold any style rules. */ +ui_strings.S_INFO_STYLESHEET_HAS_NO_RULES = "This style sheet has no rules"; + +/* DESC: The info text to notify the user that only a part of the search results are displayed. */ +ui_strings.S_INFO_TOO_MANY_SEARCH_RESULTS = "Displaying %(MAX)s of %(COUNT)s"; + +/* DESC: Dragonfly is waiting for host connection */ +ui_strings.S_INFO_WAITING_FORHOST_CONNECTION = "Waiting for a host connection on port %s."; + +/* DESC: Information shown if the window has no runtime, e.g. speed dial. */ +ui_strings.S_INFO_WINDOW_HAS_NO_RUNTIME = "This window has no runtime"; + +/* DESC: Inhertied from, " " will be added */ +ui_strings.S_INHERITED_FROM = "Inherited from"; + +/* DESC: For filter fields. */ +ui_strings.S_INPUT_DEFAULT_TEXT_FILTER = "Filter"; + +/* DESC: Label for search fields. */ +ui_strings.S_INPUT_DEFAULT_TEXT_SEARCH = "Search"; + +/* DESC: Heading for the area where the user can configure keyboard shortcuts in settings. */ +ui_strings.S_KEYBOARD_SHORTCUTS_CONFIGURATION = "Configuration"; + +/* DESC: Context menu entry that brings up "Add watch" UI, Label for "Add watch" button */ +ui_strings.S_LABEL_ADD_WATCH = "Add watch"; + +/* DESC: Instruction in settings how to change the user language. The place holder will be replace with an according link to the user setting in opera:config. */ +ui_strings.S_LABEL_CHANGE_UI_LANGUAGE_INFO = "Change %s to one of"; + +/* DESC: A setting to define which prototypes of inspected js objects should be collapsed by default. */ +ui_strings.S_LABEL_COLLAPSED_INSPECTED_PROTOTYPES = "Default collapsed prototype objects (a list of prototypes, e.g. Object, Array, etc. * will collapse all): "; + +/* DESC: Label for the hue of a color value. */ +ui_strings.S_LABEL_COLOR_HUE = "Hue"; + +/* DESC: Label for the luminosity of a color value. */ +ui_strings.S_LABEL_COLOR_LUMINOSITY = "Luminosity"; + +/* DESC: Label for the opacity of a color value. */ +ui_strings.S_LABEL_COLOR_OPACITY = "Opacity"; + +/* DESC: Setting label to select the sample size of the color picker */ +ui_strings.S_LABEL_COLOR_PICKER_SAMPLE_SIZE = "Sample Size"; + +/* DESC: Setting label to select the zoom level of the color picker */ +ui_strings.S_LABEL_COLOR_PICKER_ZOOM = "Zoom"; + +/* DESC: Label for the saturation of a color value. */ +ui_strings.S_LABEL_COLOR_SATURATION = "Saturation"; + +/* DESC: Context menu entry that brings up "Add cookie" UI, Label for "Add Cookie" button */ +ui_strings.S_LABEL_COOKIE_MANAGER_ADD_COOKIE = "Add cookie"; + +/* DESC: Label for the domain that is set for a cookie */ +ui_strings.S_LABEL_COOKIE_MANAGER_COOKIE_DOMAIN = "Domain"; + +/* DESC: Label for the expiry when cookie has already expired */ +ui_strings.S_LABEL_COOKIE_MANAGER_COOKIE_EXPIRED = "(expired)"; + +/* DESC: Label for the expiry value of a cookie */ +ui_strings.S_LABEL_COOKIE_MANAGER_COOKIE_EXPIRES = "Expires"; + +/* DESC: Label for the expiry when cookie expires after the session is closed */ +ui_strings.S_LABEL_COOKIE_MANAGER_COOKIE_EXPIRES_ON_SESSION_CLOSE = "When session ends, e.g. the tab is closed"; + +/* DESC: Label for the expiry when cookie expires after the session is closed */ +ui_strings.S_LABEL_COOKIE_MANAGER_COOKIE_EXPIRES_ON_SESSION_CLOSE_SHORT = "Session"; + +/* DESC: Label for the name (key) of a cookie */ +ui_strings.S_LABEL_COOKIE_MANAGER_COOKIE_NAME = "Name"; + +/* DESC: Label for the value of a cookie */ +ui_strings.S_LABEL_COOKIE_MANAGER_COOKIE_PATH = "Path"; + +/* DESC: Label for the value of a cookie or storage item */ +ui_strings.S_LABEL_COOKIE_MANAGER_COOKIE_VALUE = "Value"; + +/* DESC: Context menu entry that brings up "Edit cookie" UI */ +ui_strings.S_LABEL_COOKIE_MANAGER_EDIT_COOKIE = "Edit cookie"; + +/* DESC: Label for grouping by runtime (lowercase) */ +ui_strings.S_LABEL_COOKIE_MANAGER_GROUPER_RUNTIME = "runtime"; + +/* DESC: Label for isHTTPOnly flag on a cookie */ +ui_strings.S_LABEL_COOKIE_MANAGER_HTTP_ONLY = "HTTPOnly"; + +/* DESC: Context menu entry that removes cookie */ +ui_strings.S_LABEL_COOKIE_MANAGER_REMOVE_COOKIE = "Delete cookie"; + +/* DESC: Context menu entry that removes cookies (plural) */ +ui_strings.S_LABEL_COOKIE_MANAGER_REMOVE_COOKIES = "Delete cookies"; + +/* DESC: Context menu entry that removes cookies of specific group */ +ui_strings.S_LABEL_COOKIE_MANAGER_REMOVE_COOKIES_OF = "Delete cookies from %s"; + +/* DESC: Label for isSecure flag on a cookie, set if cookie is only transmitted on secure connections */ +ui_strings.S_LABEL_COOKIE_MANAGER_SECURE_CONNECTIONS_ONLY = "Secure"; + +/* DESC: Setting label to switch back to the default setting */ +ui_strings.S_LABEL_DEFAULT_SELECTION = "Default"; + +/* DESC: Context menu entry that removes all watches */ +ui_strings.S_LABEL_DELETE_ALL_WATCHES = "Delete all watches"; + +/* DESC: Context menu entry that removes watch */ +ui_strings.S_LABEL_DELETE_WATCH = "Delete watch"; + +/* DESC: Label for a button in a dialog to dismiss in so it won't be shown again */ +ui_strings.S_LABEL_DIALOG_DONT_SHOW_AGAIN = "Do not show again"; + +/* DESC: Context menu entry that brings up "Edit" UI */ +ui_strings.S_LABEL_EDIT_WATCH = "Edit watch"; + +/* DESC: Button label to enable the default debugger features. */ +ui_strings.S_LABEL_ENABLE_DEFAULT_FEATURES = "Enable the default debugger features"; + +/* DESC: Setting label to select the font face */ +ui_strings.S_LABEL_FONT_SELECTION_FACE = "Font face"; + +/* DESC: Setting label to select the line height */ +ui_strings.S_LABEL_FONT_SELECTION_LINE_HEIGHT = "Line height"; + +/* DESC: Setting label to select the font face */ +ui_strings.S_LABEL_FONT_SELECTION_SIZE = "Font size"; + +/* DESC: Label of a section in the keyboard configuration for a specific view */ +ui_strings.S_LABEL_KEYBOARDCONFIG_FOR_VIEW = "Keyboard shortcuts %s"; + +/* DESC: Label of an invalid keyboard shortcut */ +ui_strings.S_LABEL_KEYBOARDCONFIG_INVALID_SHORTCUT = "Invalid keyboard shortcut"; + +/* DESC: Label of a subsection in the keyboard configuration */ +ui_strings.S_LABEL_KEYBOARDCONFIG_MODE_DEFAULT = "Default"; + +/* DESC: Label of a subsection in the keyboard configuration */ +ui_strings.S_LABEL_KEYBOARDCONFIG_MODE_EDIT = "Edit"; + +/* DESC: Label of a subsection in the keyboard configuration */ +ui_strings.S_LABEL_KEYBOARDCONFIG_MODE_EDIT_ATTR_AND_TEXT = "Edit Attributes and Text"; + +/* DESC: Label of a subsection in the keyboard configuration */ +ui_strings.S_LABEL_KEYBOARDCONFIG_MODE_EDIT_MARKUP = "Edit markup"; + +/* DESC: Settings label for the maximum number of search hits in the search panel. */ +ui_strings.S_LABEL_MAX_SEARCH_HITS = "Maximum number of search results"; + +/* DESC: Button tooltip */ +ui_strings.S_LABEL_MOVE_HIGHLIGHT_DOWN = "Find next"; + +/* DESC: Button tooltip */ +ui_strings.S_LABEL_MOVE_HIGHLIGHT_UP = "Find previous"; + +/* DESC: Label for the name column header of a form field in a POST */ +ui_strings.S_LABEL_NETWORK_POST_DATA_NAME = "Name"; + +/* DESC: Label for the value column header of a form value in a POST */ +ui_strings.S_LABEL_NETWORK_POST_DATA_VALUE = "Value"; + +/* DESC: Label for the network port to connect to. */ +ui_strings.S_LABEL_PORT = "Port"; + +/* DESC: In the command line, choose the size of the typed history */ +ui_strings.S_LABEL_REPL_BACKLOG_LENGTH = "Number of lines of stored history"; + +/* DESC: Label of a subsection in the keyboard configuration */ +ui_strings.S_LABEL_REPL_MODE_AUTOCOMPLETE = "Autocomplete"; + +/* DESC: Label of a subsection in the keyboard configuration */ +ui_strings.S_LABEL_REPL_MODE_DEFAULT = "Default"; + +/* DESC: Label of a subsection in the keyboard configuration */ +ui_strings.S_LABEL_REPL_MODE_MULTILINE = "Multi-line edit"; + +/* DESC: Label of a subsection in the keyboard configuration */ +ui_strings.S_LABEL_REPL_MODE_SINGLELINE = "Single-line edit"; + +/* DESC: Label of the section with the scope chain in the Inspection view */ +ui_strings.S_LABEL_SCOPE_CHAIN = "Scope Chain"; + +/* DESC: Checkbox label to search in all files in the JS search pane. */ +ui_strings.S_LABEL_SEARCH_ALL_FILES = "All files"; + +/* DESC: Checkbox label to set the 'ignore case' flag search panel. */ +ui_strings.S_LABEL_SEARCH_FLAG_IGNORE_CASE = "Ignore case"; + +/* DESC: Checkbox label to search in injected scripts in the JS search pane. */ +ui_strings.S_LABEL_SEARCH_INJECTED_SCRIPTS = "Injected"; + +/* DESC: Tooltip for the injected scripts search settings label. */ +ui_strings.S_LABEL_SEARCH_INJECTED_SCRIPTS_TOOLTIP = "Search in all injected scripts, including Browser JS, Extension JS and User JS"; + +/* DESC: Radio label for the search type 'Selector' (as in CSS Selector) in the DOM search panel. */ +ui_strings.S_LABEL_SEARCH_TYPE_CSS = "Selector"; + +/* DESC: RRadio label for the search type 'RegExp' in the DOM search panel. */ +ui_strings.S_LABEL_SEARCH_TYPE_REGEXP = "RegExp"; + +/* DESC: Radio label for the search type 'Text' in the DOM search panel. */ +ui_strings.S_LABEL_SEARCH_TYPE_TEXT = "Text"; + +/* DESC: Radio label for the search type 'XPath' in the DOM search panel. */ +ui_strings.S_LABEL_SEARCH_TYPE_XPATH = "XPath"; + +/* DESC: Settings label to show a tooltip for the hovered identifier in the source view. */ +ui_strings.S_LABEL_SHOW_JS_TOOLTIP = "Show inspection tooltip"; + +/* DESC: Enable smart reformatting of JavaScript. */ +ui_strings.S_LABEL_SMART_REFORMAT_JAVASCRIPT = "Smart JavaScript pretty printing"; + +/* DESC: Settings label to configure the element highlight color */ +ui_strings.S_LABEL_SPOTLIGHT_TITLE = "Element Highlight"; + +/* DESC: Button label to add an item in a storage, e.g. in the local storage */ +ui_strings.S_LABEL_STORAGE_ADD = "Add"; + +/* DESC: Label for "Add storage_type" button */ +ui_strings.S_LABEL_STORAGE_ADD_STORAGE_TYPE = "Add %s"; + +/* DESC: Button label to delete an item in a storage, e.g. in the local storage */ +ui_strings.S_LABEL_STORAGE_DELETE = "Delete"; + +/* DESC: Tool tip in a storage view to inform the user how to edit an item */ +ui_strings.S_LABEL_STORAGE_DOUBLE_CLICK_TO_EDIT = "Double-click to edit"; + +/* DESC: Label for the key (identifier) of a storage item */ +ui_strings.S_LABEL_STORAGE_KEY = "Key"; + +/* DESC: Button label to update a view with all items of a storage, e.g. of the local storage */ +ui_strings.S_LABEL_STORAGE_UPDATE = "Update"; + +/* DESC: Tab size in source view. */ +ui_strings.S_LABEL_TAB_SIZE = "Tab Size"; + +/* DESC: Area as in size. choices are 10 x 10, and so on. */ +ui_strings.S_LABEL_UTIL_AREA = "Area"; + +/* DESC: Scale */ +ui_strings.S_LABEL_UTIL_SCALE = "Scale"; + +/* DESC: Info in an event listener tooltip that the according listener listens in the bubbling phase. */ +ui_strings.S_LISTENER_BUBBLING_PHASE = "bubbling"; + +/* DESC: Info in an event listener tooltip that the according listener listens in the capturing phase. */ +ui_strings.S_LISTENER_CAPTURING_PHASE = "capturing"; + +/* DESC: Debug context menu */ +ui_strings.S_MENU_DEBUG_CONTEXT = "Select the debugging context"; + +/* DESC: Reload the debug context. */ +ui_strings.S_MENU_RELOAD_DEBUG_CONTEXT = "Reload Debugging Context"; + +/* DESC: Reload the debug context (shorter than S_MENU_RELOAD_DEBUG_CONTEXT). */ +ui_strings.S_MENU_RELOAD_DEBUG_CONTEXT_SHORT = "Reload"; + +/* DESC: Select the active window as debugger context. */ +ui_strings.S_MENU_SELECT_ACTIVE_WINDOW = "Select Active Window"; + +/* DESC: String used when the user has clicked to get a resource body, but dragonfly wasn't able to do so. */ +ui_strings.S_NETWORK_BODY_NOT_AVAILABLE = "Request body not available. Enable resource tracking and reload the page to view the resource."; + +/* DESC: Name of network caching setting for default browser caching policy */ +ui_strings.S_NETWORK_CACHING_SETTING_DEFAULT_LABEL = "Standard browser caching behavior"; + +/* DESC: Help text for explaining caching setting in global network options */ +ui_strings.S_NETWORK_CACHING_SETTING_DESC = "This setting controls how caching works when Opera Dragonfly is running. When caching is disabled, Opera always reloads the page."; + +/* DESC: Name of network caching setting for disabling browser caching policy */ +ui_strings.S_NETWORK_CACHING_SETTING_DISABLED_LABEL = "Disable all caching"; + +/* DESC: Title for caching settings section in global network options */ +ui_strings.S_NETWORK_CACHING_SETTING_TITLE = "Caching behavior"; + +/* DESC: Can't show request data, as we don't know the type of it. */ +ui_strings.S_NETWORK_CANT_DISPLAY_TYPE = "Cannot display content of type %s"; + +/* DESC: Name of content tracking setting for tracking content */ +ui_strings.S_NETWORK_CONTENT_TRACKING_SETTING_TRACK_LABEL = "Track content (affects speed/memory)"; + +/* DESC: Explanation of how to enable content tracking. */ +ui_strings.S_NETWORK_ENABLE_CONTENT_TRACKING_FOR_REQUEST = "Enable content tracking in the \"network options\" panel to see request bodies"; + +/* DESC: Example value to show what header formats look like. Header-name */ +ui_strings.S_NETWORK_HEADER_EXAMPLE_VAL_NAME = "Header-name"; + +/* DESC: Example value to show what header formats look like. Header-value */ +ui_strings.S_NETWORK_HEADER_EXAMPLE_VAL_VALUE = "Header-value"; + +/* DESC: Description of network header overrides feature. */ +ui_strings.S_NETWORK_HEADER_OVERRIDES_DESC = "Headers in the override box will be used for all requests in the debugged browser. They will override normal headers."; + +/* DESC: Label for checkbox to enable global header overrides */ +ui_strings.S_NETWORK_HEADER_OVERRIDES_LABEL = "Enable global header overrides"; + +/* DESC: Label for presets */ +ui_strings.S_NETWORK_HEADER_OVERRIDES_PRESETS_LABEL = "Presets"; + +/* DESC: Label for save nbutton */ +ui_strings.S_NETWORK_HEADER_OVERRIDES_PRESETS_SAVE = "Save"; + +/* DESC: Label for selecting an empty preset */ +ui_strings.S_NETWORK_HEADER_OVERRIDES_PRESET_NONE = "None"; + +/* DESC: Title of global header overrides section in global network settings */ +ui_strings.S_NETWORK_HEADER_OVERRIDES_TITLE = "Global header overrides"; + +/* DESC: Title of request body section when the body is multipart-encoded */ +ui_strings.S_NETWORK_MULTIPART_REQUEST_TITLE = "Request - multipart"; + +/* DESC: String used when there is a request body we can't show the contents of directly. */ +ui_strings.S_NETWORK_N_BYTE_BODY = "Request body of %s bytes"; + +/* DESC: Name of entry in Network Log, used in summary at the end */ +ui_strings.S_NETWORK_REQUEST = "Request"; + +/* DESC: Name of entry in Network Log, plural, used in summary at the end */ +ui_strings.S_NETWORK_REQUESTS = "Requests"; + +/* DESC: Help text about how to always track resources in request view */ +ui_strings.S_NETWORK_REQUEST_DETAIL_BODY_DESC = "Response body not tracked. To always fetch response bodies, toggle the \"Track content\" option in Settings. To retrieve only this body, click the button."; + +/* DESC: Message about not yet available response body */ +ui_strings.S_NETWORK_REQUEST_DETAIL_BODY_UNFINISHED = "Response body not available until the request is finished."; + +/* DESC: Help text about how a request body could not be show because it's no longer available. */ +ui_strings.S_NETWORK_REQUEST_DETAIL_NO_RESPONSE_BODY = "Response body not available. Enable the \"Track content\" option in Settings and reload the page to view the resource."; + +/* DESC: Title for request details section */ +ui_strings.S_NETWORK_REQUEST_DETAIL_REQUEST_TITLE = "Request"; + +/* DESC: Title for response details section */ +ui_strings.S_NETWORK_REQUEST_DETAIL_RESPONSE_TITLE = "Response"; + +/* DESC: Message about file types we have no good way of showing. */ +ui_strings.S_NETWORK_REQUEST_DETAIL_UNDISPLAYABLE_BODY_LABEL = "Unable to show data of type %s"; + +/* DESC: Message about there being no headers attached to a specific request or response */ +ui_strings.S_NETWORK_REQUEST_NO_HEADERS_LABEL = "No headers"; + +/* DESC: Explanation about why a network requests lacks headers. */ +ui_strings.S_NETWORK_SERVED_FROM_CACHE = "No request made. All data was retrieved from cache without accessing the network."; + +/* DESC: Unknown mime type for content */ +ui_strings.S_NETWORK_UNKNOWN_MIME_TYPE = "MIME type not known for request data"; + +/* DESC: The string "None" used wherever there's an absence of something */ +ui_strings.S_NONE = "None"; + +/* DESC: Info in the DOM side panel that the selected node has no event listeners attached. */ +ui_strings.S_NO_EVENT_LISTENER = "No event listeners"; + +/* DESC: Label in a tooltip */ +ui_strings.S_PROFILER_AREA_DIMENSION = "Area"; + +/* DESC: Label in a tooltip */ +ui_strings.S_PROFILER_AREA_LOCATION = "Location"; + +/* DESC: Message in the profiler when the profiler is calculating */ +ui_strings.S_PROFILER_CALCULATING = "Calculating…"; + +/* DESC: Label in a tooltip */ +ui_strings.S_PROFILER_DURATION = "Duration"; + +/* DESC: Message in the profiler when no data was "captured" by the profiler */ +ui_strings.S_PROFILER_NO_DATA = "No data"; + +/* DESC: Message when an event in the profiler has no details */ +ui_strings.S_PROFILER_NO_DETAILS = "No details"; + +/* DESC: Message in the profiler when the profiler is active */ +ui_strings.S_PROFILER_PROFILING = "Profiling…"; + +/* DESC: Message in the profiler when the profiler failed */ +ui_strings.S_PROFILER_PROFILING_FAILED = "Profiling failed"; + +/* DESC: Message before activating the profiler profile */ +ui_strings.S_PROFILER_RELOAD = "To get accurate data from the profiler, all other features have to be disabled and the document has to be reloaded."; + +/* DESC: Label in a tooltip */ +ui_strings.S_PROFILER_SELF_TIME = "Self time"; + +/* DESC: Message before starting the profiler */ +ui_strings.S_PROFILER_START_MESSAGE = "Press the Record button to start profiling"; + +/* DESC: Label in a tooltip */ +ui_strings.S_PROFILER_START_TIME = "Start"; + +/* DESC: Label in a tooltip */ +ui_strings.S_PROFILER_TOTAL_SELF_TIME = "Total self time"; + +/* DESC: Label in a tooltip */ +ui_strings.S_PROFILER_TYPE_EVENT = "Event name"; + +/* DESC: Label in a tooltip */ +ui_strings.S_PROFILER_TYPE_SCRIPT = "Script type"; + +/* DESC: Label in a tooltip */ +ui_strings.S_PROFILER_TYPE_SELECTOR = "Selector"; + +/* DESC: Label in a tooltip */ +ui_strings.S_PROFILER_TYPE_THREAD = "Thread type"; + +/* DESC: Remote debug guide, connection setup */ +ui_strings.S_REMOTE_DEBUG_GUIDE_PRECONNECT_HEADER = "Steps to enable remote debugging:"; + +/* DESC: Remote debug guide, connection setup */ +ui_strings.S_REMOTE_DEBUG_GUIDE_PRECONNECT_STEP_1 = "Specify the port number you wish to connect to, or leave as the default"; + +/* DESC: Remote debug guide, connection setup */ +ui_strings.S_REMOTE_DEBUG_GUIDE_PRECONNECT_STEP_2 = "Click \"Apply\""; + +/* DESC: Remote debug guide, waiting for connection */ +ui_strings.S_REMOTE_DEBUG_GUIDE_WAITING_HEADER = "On the remote device:"; + +/* DESC: Remote debug guide, waiting for connection */ +ui_strings.S_REMOTE_DEBUG_GUIDE_WAITING_STEP_1 = "Enter opera:debug in the URL field"; + +/* DESC: Remote debug guide, waiting for connection */ +ui_strings.S_REMOTE_DEBUG_GUIDE_WAITING_STEP_2 = "Enter the IP address of the machine running Opera Dragonfly"; + +/* DESC: Remote debug guide, waiting for connection */ +ui_strings.S_REMOTE_DEBUG_GUIDE_WAITING_STEP_3 = "Enter the port number %s"; + +/* DESC: Remote debug guide, waiting for connection */ +ui_strings.S_REMOTE_DEBUG_GUIDE_WAITING_STEP_4 = "Click \"Connect\""; + +/* DESC: Remote debug guide, waiting for connection */ +ui_strings.S_REMOTE_DEBUG_GUIDE_WAITING_STEP_5 = "Once connected navigate to the page you wish to debug"; + +/* DESC: Description of the "help" command in the repl */ +ui_strings.S_REPL_HELP_COMMAND_DESC = "Show a list of all available commands"; + +/* DESC: Description of the "jquery" command in the repl */ +ui_strings.S_REPL_JQUERY_COMMAND_DESC = "Load jQuery in the active tab"; + +/* DESC: Printed in the command line view when it is shown for the first time. */ +ui_strings.S_REPL_WELCOME_TEXT = "Type %(CLEAR_COMMAND)s to clear the console.\nType %(HELP_COMMAND)s for more information."; + +/* DESC: "Not applicable" abbreviation */ +ui_strings.S_RESOURCE_ALL_NOT_APPLICABLE = "n/a"; + +/* DESC: Name of host column */ +ui_strings.S_RESOURCE_ALL_TABLE_COLUMN_HOST = "Host"; + +/* DESC: Name of mime column */ +ui_strings.S_RESOURCE_ALL_TABLE_COLUMN_MIME = "MIME"; + +/* DESC: Name of path column */ +ui_strings.S_RESOURCE_ALL_TABLE_COLUMN_PATH = "Path"; + +/* DESC: Name of pretty printed size column */ +ui_strings.S_RESOURCE_ALL_TABLE_COLUMN_PPSIZE = "Size (pretty printed)"; + +/* DESC: Name of protocol column */ +ui_strings.S_RESOURCE_ALL_TABLE_COLUMN_PROTOCOL = "Protocol"; + +/* DESC: Name of size column */ +ui_strings.S_RESOURCE_ALL_TABLE_COLUMN_SIZE = "Size"; + +/* DESC: Name of type column */ +ui_strings.S_RESOURCE_ALL_TABLE_COLUMN_TYPE = "Type"; + +/* DESC: Name of types size group */ +ui_strings.S_RESOURCE_ALL_TABLE_GROUP_GROUPS = "Groups"; + +/* DESC: Name of hosts size group */ +ui_strings.S_RESOURCE_ALL_TABLE_GROUP_HOSTS = "Hosts"; + +/* DESC: Fallback text for no filename, used as tab label */ +ui_strings.S_RESOURCE_ALL_TABLE_NO_FILENAME = "(no name)"; + +/* DESC: Fallback text for no host */ +ui_strings.S_RESOURCE_ALL_TABLE_NO_HOST = "No host"; + +/* DESC: Fallback text for unknown groups */ +ui_strings.S_RESOURCE_ALL_TABLE_UNKNOWN_GROUP = "Unknown"; + +/* DESC: Click reload button to fetch resources */ +ui_strings.S_RESOURCE_CLICK_BUTTON_TO_FETCH_RESOURCES = "Click the reload button above to reload the debugged window and fetch its resources"; + +/* DESC: Tooltip displayed when hovering the arrow going back in Return Values. The first variable is a file name, the second a line number */ +ui_strings.S_RETURN_VALUES_FUNCTION_FROM = "Returned from %s:%s"; + +/* DESC: Tooltip displayed when hovering the arrow going forward in Return Values. The first variable is a file name, the second a line number */ +ui_strings.S_RETURN_VALUES_FUNCTION_TO = "Returned to %s:%s"; + +/* DESC: Label for the global scope in the Scope Chain. */ +ui_strings.S_SCOPE_GLOBAL = "Global"; + +/* DESC: Label for the scopes other than local and global in the Scope Chain. */ +ui_strings.S_SCOPE_INNER = "Scope %s"; + +/* DESC: Section header in the script drop-down select for Browser and User JS. */ +ui_strings.S_SCRIPT_SELECT_SECTION_BROWSER_AND_USER_JS = "Browser JS and User JS"; + +/* DESC: Section header in the script drop-down select for inline, eval, timeout and event handler scripts. */ +ui_strings.S_SCRIPT_SELECT_SECTION_INLINE_AND_EVALS = "Inline, eval, timeout and event-handler scripts"; + +/* DESC: Script type for events in the profiler */ +ui_strings.S_SCRIPT_TYPE_BROWSERJS = "BrowserJS"; + +/* DESC: Script type for events in the profiler */ +ui_strings.S_SCRIPT_TYPE_DEBUGGER = "Debugger"; + +/* DESC: Script type for events in the profiler */ +ui_strings.S_SCRIPT_TYPE_EVAL = "Eval"; + +/* DESC: Script type for events in the profiler */ +ui_strings.S_SCRIPT_TYPE_EVENT_HANDLER = "Event"; + +/* DESC: Script type for events in the profiler */ +ui_strings.S_SCRIPT_TYPE_EXTENSIONJS = "Extension"; + +/* DESC: Script type for events in the profiler */ +ui_strings.S_SCRIPT_TYPE_GENERATED = "document.write()"; + +/* DESC: Script type for events in the profiler */ +ui_strings.S_SCRIPT_TYPE_INLINE = "Inline"; + +/* DESC: Script type for events in the profiler */ +ui_strings.S_SCRIPT_TYPE_LINKED = "External"; + +/* DESC: Script type for events in the profiler */ +ui_strings.S_SCRIPT_TYPE_TIMEOUT = "Timeout or interval"; + +/* DESC: Script type for events in the profiler */ +ui_strings.S_SCRIPT_TYPE_UNKNOWN = "Unknown"; + +/* DESC: Script type for events in the profiler */ +ui_strings.S_SCRIPT_TYPE_URI = "javascript: URL"; + +/* DESC: Script type for events in the profiler */ +ui_strings.S_SCRIPT_TYPE_USERJS = "UserJS"; + +/* DESC: Tooltip for filtering text-input boxes */ +ui_strings.S_SEARCH_INPUT_TOOLTIP = "text search"; + +/* DESC: Header for settings group "About" */ +ui_strings.S_SETTINGS_HEADER_ABOUT = "About"; + +/* DESC: Header for settings group "Console" */ +ui_strings.S_SETTINGS_HEADER_CONSOLE = "Error Log"; + +/* DESC: Header for settings group "Document" */ +ui_strings.S_SETTINGS_HEADER_DOCUMENT = "Documents"; + +/* DESC: Header for settings group "General" */ +ui_strings.S_SETTINGS_HEADER_GENERAL = "General"; + +/* DESC: Header for settings group "Keyboard shortcuts" */ +ui_strings.S_SETTINGS_HEADER_KEYBOARD_SHORTCUTS = "Keyboard shortcuts"; + +/* DESC: Header for settings group "Network" */ +ui_strings.S_SETTINGS_HEADER_NETWORK = "Network"; + +/* DESC: Header for settings group "Script" */ +ui_strings.S_SETTINGS_HEADER_SCRIPT = "Scripts"; + +/* DESC: Description for CSS rules with the origin being the user */ +ui_strings.S_STYLE_ORIGIN_LOCAL = "user stylesheet"; + +/* DESC: Description for CSS rules with the origin being the SVG presentation attributes */ +ui_strings.S_STYLE_ORIGIN_SVG = "presentation attributes"; + +/* DESC: Description for CSS rules with the origin being the UA */ +ui_strings.S_STYLE_ORIGIN_USER_AGENT = "user agent stylesheet"; + +/* DESC: Tooltip text for a button that attaches Opera Dragonfly to the main browser window. */ +ui_strings.S_SWITCH_ATTACH_WINDOW = "Dock to main window"; + +/* DESC: When enabled, the request log always scroll to the bottom on new requests */ +ui_strings.S_SWITCH_AUTO_SCROLL_REQUEST_LIST = "Auto-scroll request log"; + +/* DESC: Button title for stopping the profiler */ +ui_strings.S_SWITCH_CHANGE_START_TO_FIRST_EVENT = "Change start time to first event"; + +/* DESC: Checkbox: undocks Opera Dragonfly into a separate window. */ +ui_strings.S_SWITCH_DETACH_WINDOW = "Undock into separate window"; + +/* DESC: Expand all (entries in a list) */ +ui_strings.S_SWITCH_EXPAND_ALL = "Expand all"; + +/* DESC: If enabled objects can be expanded inline in the console. */ +ui_strings.S_SWITCH_EXPAND_OBJECTS_INLINE = "Expand objects inline in the console"; + +/* DESC: Will select the element when clicked. */ +ui_strings.S_SWITCH_FIND_ELEMENT_BY_CLICKING = "Select an element in the page to inspect it"; + +/* DESC: When enabled, objects of type element will be friendly printed */ +ui_strings.S_SWITCH_FRIENDLY_PRINT = "Enable smart-printing for Element objects in the console"; + +/* DESC: Shows or hides empty strings and null values. */ +ui_strings.S_SWITCH_HIDE_EMPTY_STRINGS = "Show empty strings and null values"; + +/* DESC: Highlights page elements when thet mouse hovers. */ +ui_strings.S_SWITCH_HIGHLIGHT_SELECTED_OR_HOVERED_ELEMENT = "Highlight selected element"; + +/* DESC: When enabled, objects of type element in the command line will be displayed in the DOM view */ +ui_strings.S_SWITCH_IS_ELEMENT_SENSITIVE = "Display Element objects in the DOM panel when selected in the console"; + +/* DESC: Draw a border on to selected DOM elements */ +ui_strings.S_SWITCH_LOCK_SELECTED_ELEMENTS = "Keep elements highlighted"; + +/* DESC: Switch toggeling if the debugger should automatically reload the page when the user changes the window to debug. */ +ui_strings.S_SWITCH_RELOAD_SCRIPTS_AUTOMATICALLY = "Reload new debugging contexts automatically"; + +/* DESC: Route debugging traffic trough proxy to enable debugging devices */ +ui_strings.S_SWITCH_REMOTE_DEBUG = "Remote debug"; + +/* DESC: Scroll an element in the host into view when selecting it in the DOM. */ +ui_strings.S_SWITCH_SCROLL_INTO_VIEW_ON_FIRST_SPOTLIGHT = "Scroll into view on first highlight"; + +/* DESC: List item in the DOM settings menu to shows or hide comments in DOM. Also Tooltip text for button in the secondary DOM menu. */ +ui_strings.S_SWITCH_SHOW_COMMENT_NODES = "Show comment nodes"; + +/* DESC: Shows DOM in tree or mark-up mode. */ +ui_strings.S_SWITCH_SHOW_DOM_INTREE_VIEW = "Represent the DOM as a node tree"; + +/* DESC: Show ECMAScript errors in the command line. */ +ui_strings.S_SWITCH_SHOW_ECMA_ERRORS_IN_COMMAND_LINE = "Show JavaScript errors in the console"; + +/* DESC: Show default null and empty string values when inspecting a js object. */ +ui_strings.S_SWITCH_SHOW_FEFAULT_NULLS_AND_EMPTY_STRINGS = "Show default values if they are null or empty strings"; + +/* DESC: Showing the id's and class names in the breadcrumb in the statusbar. */ +ui_strings.S_SWITCH_SHOW_ID_AND_CLASSES_IN_BREAD_CRUMB = "Show id's and classes in breadcrumb trail"; + +/* DESC: Toggles the display of pre-set values in the computed styles view. */ +ui_strings.S_SWITCH_SHOW_INITIAL_VALUES = "Show initial values"; + +/* DESC: Show non enumerale properties when inspecting a js object. */ +ui_strings.S_SWITCH_SHOW_NON_ENUMERABLES = "Show non-enumerable properties"; + +/* DESC: There are a lot of window types in Opera. This switch toggles if we show only the useful ones, or all of them. */ +ui_strings.S_SWITCH_SHOW_ONLY_NORMAL_AND_GADGETS_TYPE_WINDOWS = "Hide browser-specific contexts, such as mail and feed windows"; + +/* DESC: Show prototpe objects when inspecting a js object. */ +ui_strings.S_SWITCH_SHOW_PROTOTYPES = "Show prototypes"; + +/* DESC: Show pseudo elements in the DOM view */ +ui_strings.S_SWITCH_SHOW_PSEUDO_ELEMENTS = "Show pseudo-elements"; + +/* DESC: Showing the siblings in the breadcrumb in the statusbar. */ +ui_strings.S_SWITCH_SHOW_SIBLINGS_IN_BREAD_CRUMB = "Show siblings in breadcrumb trail"; + +/* DESC: Switch display of 'All' tab on or off. */ +ui_strings.S_SWITCH_SHOW_TAB_ALL = "All"; + +/* DESC: Switch display of 'Bittorrent' tab on or off. */ +ui_strings.S_SWITCH_SHOW_TAB_BITTORRENT = "BitTorrent"; + +/* DESC: Switch display of 'CSS' tab on or off. */ +ui_strings.S_SWITCH_SHOW_TAB_CSS = "CSS"; + +/* DESC: Switch display of 'HTML' tab on or off. */ +ui_strings.S_SWITCH_SHOW_TAB_HTML = "HTML"; + +/* DESC: Switch display of 'Java' tab on or off. */ +ui_strings.S_SWITCH_SHOW_TAB_JAVA = "Java"; + +/* DESC: Switch display of 'Mail' tab on or off. */ +ui_strings.S_SWITCH_SHOW_TAB_M2 = "Mail"; + +/* DESC: Switch display of 'Network' tab on or off. */ +ui_strings.S_SWITCH_SHOW_TAB_NETWORK = "Network"; + +/* DESC: Switch display of 'Script' tab on or off. */ +ui_strings.S_SWITCH_SHOW_TAB_SCRIPT = "JavaScript"; + +/* DESC: Switch display of 'SVG' tab on or off. */ +ui_strings.S_SWITCH_SHOW_TAB_SVG = "SVG"; + +/* DESC: Switch display of 'Voice' tab on or off. */ +ui_strings.S_SWITCH_SHOW_TAB_VOICE = "Voice"; + +/* DESC: Switch display of 'Widget' tab on or off. */ +ui_strings.S_SWITCH_SHOW_TAB_WIDGET = "Widgets"; + +/* DESC: Switch display of 'XML' tab on or off. */ +ui_strings.S_SWITCH_SHOW_TAB_XML = "XML"; + +/* DESC: Switch display of 'XSLT' tab on or off. */ +ui_strings.S_SWITCH_SHOW_TAB_XSLT = "XSLT"; + +/* DESC: List item in General settings menu to show or hide Views menu. */ +ui_strings.S_SWITCH_SHOW_VIEWS_MENU = "Show Views menu"; + +/* DESC: Shows or hides white space nodes in DOM. */ +ui_strings.S_SWITCH_SHOW_WHITE_SPACE_NODES = "Show whitespace nodes"; + +/* DESC: When enabled, a screenshot is taken automatically on showing utilities */ +ui_strings.S_SWITCH_TAKE_SCREENSHOT_AUTOMATICALLY = "Take a screenshot automatically when opening Utilities"; + +/* DESC: Settings checkbox label for toggling usage tracking. Add one to a running total each time the user starts Dragonfly. */ +ui_strings.S_SWITCH_TRACK_USAGE = "Track usage. Sends a randomly-generated user ID to the Opera Dragonfly servers each time Opera Dragonfly is started."; + +/* DESC: When enabled, list alike objects will be unpacked in the command line */ +ui_strings.S_SWITCH_UNPACK_LIST_ALIKES = "Unpack objects which have list-like behavior in the console"; + +/* DESC: List item in the DOM settings menu to update the DOM model automatically when a node is being removed. Also Tooltip text for button in the secondary DOM menu. */ +ui_strings.S_SWITCH_UPDATE_DOM_ON_NODE_REMOVE = "Update DOM when a node is removed"; + +/* DESC: List item in the DOM settings menu. */ +ui_strings.S_SWITCH_UPDATE_GLOBAL_SCOPE = "Automatically update global scope"; + +/* DESC: Spell HTML tag names upper or lower case. */ +ui_strings.S_SWITCH_USE_LOWER_CASE_TAG_NAMES = "Use lower case tag names for text/html"; + +/* DESC: Table header in the profiler */ +ui_strings.S_TABLE_HEADER_HITS = "Hits"; + +/* DESC: Table header in the profiler */ +ui_strings.S_TABLE_HEADER_TIME = "Time"; + +/* DESC: Entry format in the call stack view showing the function name, line number and script ID. Please do not modify the %(VARIABLE)s . */ +ui_strings.S_TEXT_CALL_STACK_FRAME_LINE = "%(FUNCTION_NAME)s: %(SCRIPT_ID)s:%(LINE_NUMBER)s"; + +/* DESC: Badge for the script ID in Scripts view. */ +ui_strings.S_TEXT_ECMA_SCRIPT_SCRIPT_ID = "Script id"; + +/* DESC: Badge for inline scripts. */ +ui_strings.S_TEXT_ECMA_SCRIPT_TYPE_INLINE = "Inline"; + +/* DESC: Badge for linked scripts. */ +ui_strings.S_TEXT_ECMA_SCRIPT_TYPE_LINKED = "Linked"; + +/* DESC: Badge for unknown script types. */ +ui_strings.S_TEXT_ECMA_SCRIPT_TYPE_UNKNOWN = "Unknown"; + +/* DESC: Information on the Opera Dragonfly version number that appears in the Environment view. */ +ui_strings.S_TEXT_ENVIRONMENT_DRAGONFLY_VERSION = "Opera Dragonfly Version"; + +/* DESC: Information on the operating system used that appears in the Environment view. */ +ui_strings.S_TEXT_ENVIRONMENT_OPERATING_SYSTEM = "Operating System"; + +/* DESC: Information on the platform in use that appears in the Environment view. */ +ui_strings.S_TEXT_ENVIRONMENT_PLATFORM = "Platform"; + +/* DESC: Information on the Scope protocol version used that appears in the Environment view. */ +ui_strings.S_TEXT_ENVIRONMENT_PROTOCOL_VERSION = "Protocol Version"; + +/* DESC: Information on the Opera Dragonfly revision number that appears in the Environment view. */ +ui_strings.S_TEXT_ENVIRONMENT_REVISION_NUMBER = "Revision Number"; + +/* DESC: Information on the user-agent submitted that appears in the Environment view. */ +ui_strings.S_TEXT_ENVIRONMENT_USER_AGENT = "User Agent"; + +/* DESC: Result text for a search when there were search results. The %(VARIABLE)s should not be translated, but its position in the text can be rearranged. Python syntax: %(VARIABLE)type_identifier, so %(FOO)s in its entirety is replaced. */ +ui_strings.S_TEXT_STATUS_SEARCH = "Matches for \"%(SEARCH_TERM)s\": Match %(SEARCH_COUNT_INDEX)s out of %(SEARCH_COUNT_TOTAL)s"; + +/* DESC: Result text for the search. Please do not modify the %(VARIABLE)s . */ +ui_strings.S_TEXT_STATUS_SEARCH_NO_MATCH = "No match for \"%(SEARCH_TERM)s\""; + +/* DESC: Thread type for events in the profiler */ +ui_strings.S_THREAD_TYPE_COMMON = "Common"; + +/* DESC: Thread type for events in the profiler */ +ui_strings.S_THREAD_TYPE_DEBUGGER_EVAL = "Debugger"; + +/* DESC: Thread type for events in the profiler */ +ui_strings.S_THREAD_TYPE_EVENT = "Event"; + +/* DESC: Thread type for events in the profiler */ +ui_strings.S_THREAD_TYPE_HISTORY_NAVIGATION = "History navigation"; + +/* DESC: Thread type for events in the profiler */ +ui_strings.S_THREAD_TYPE_INLINE_SCRIPT = "Inline script"; + +/* DESC: Thread type for events in the profiler */ +ui_strings.S_THREAD_TYPE_JAVASCRIPT_URL = "javascript: URL"; + +/* DESC: Thread type for events in the profiler. This should not be translated. */ +ui_strings.S_THREAD_TYPE_JAVA_EVAL = "Java (LiveConnect)"; + +/* DESC: Thread type for events in the profiler */ +ui_strings.S_THREAD_TYPE_TIMEOUT = "Timeout or interval"; + +/* DESC: Thread type for events in the profiler */ +ui_strings.S_THREAD_TYPE_UNKNOWN = "Unknown"; + +/* DESC: Enabling/disabling DOM modebar */ +ui_strings.S_TOGGLE_DOM_MODEBAR = "Show breadcrumb trail"; + +/* DESC: Heading for the setting that toggles the breadcrumb trail */ +ui_strings.S_TOGGLE_DOM_MODEBAR_HEADER = "Breadcrumb Trail"; + +/* DESC: Label on button to pause/unpause updates of the network graph view */ +ui_strings.S_TOGGLE_PAUSED_UPDATING_NETWORK_VIEW = "Pause updating network activity"; + +/* DESC: String shown instead of filename when file name is missing */ +ui_strings.S_UNKNOWN_SCRIPT = "(Unknown script)"; + From c0ece044e841373095d487fa4a500293f3766419 Mon Sep 17 00:00:00 2001 From: Chris K Date: Fri, 17 Aug 2012 16:12:06 +0200 Subject: [PATCH 11/27] Working on DFL-3159. --- src/ui-scripts/tooltip/tooltip.js | 178 ++++++++++++++++++++---------- src/ui-style/ui.css | 5 + 2 files changed, 123 insertions(+), 60 deletions(-) diff --git a/src/ui-scripts/tooltip/tooltip.js b/src/ui-scripts/tooltip/tooltip.js index f2b46e114..e8c10d4c4 100644 --- a/src/ui-scripts/tooltip/tooltip.js +++ b/src/ui-scripts/tooltip/tooltip.js @@ -10,9 +10,17 @@ Tooltips.CSS_TOOLTIP_SELECTED = "tooltip-selected"; this.unregister = function(name, tooltip) {}; this.is_inside_tooltip = function(event, close_if_not_inside) {}; - var Tooltip = function(keep_on_hover, set_selected, max_height_target) + var Tooltip = function(keep_on_hover_or_config, set_selected, max_height_target) { - this._init(keep_on_hover, set_selected, max_height_target); + /* + config + keep_on_hover: Boolean, default false + set_selected: Boolean, default false + max_height_target: Number + dynamic_size: Boolean, default false + class: default "", supported "context-window" + */ + this._init(keep_on_hover_or_config, set_selected, max_height_target); }; Tooltip.prototype = new function() @@ -63,11 +71,25 @@ Tooltips.CSS_TOOLTIP_SELECTED = "tooltip-selected"; */ this.hide = function(){}; - this._init = function(keep_on_hover, set_selected, max_height_target) + this._init = function(keep_on_hover_or_config, set_selected, max_height_target) { - this.keep_on_hover = keep_on_hover; - this.set_selected = set_selected; - this.max_height_target = max_height_target; + if (typeof keep_on_hover_or_config== "object") + { + var config = keep_on_hover_or_config; + this.keep_on_hover = config.keep_on_hover || false; + this.set_selected = config.set_selected || false; + this.max_height_target = config.max_height_target || ""; + this.dynamic_size = config.dynamic_size || false; + this.class = config.class || ""; + } + else + { + this.keep_on_hover = keep_on_hover_or_config || false; + this.set_selected = set_selected || false; + this.max_height_target = max_height_target || ""; + this.dynamic_size = false; + this.class = ""; + } } /* implementation */ @@ -98,6 +120,8 @@ Tooltips.CSS_TOOLTIP_SELECTED = "tooltip-selected"; const HOVER_DELAY = 70; const DISTANCE_X = 5; const DISTANCE_Y = 5; + const DISTANCE_X_STATIC = 12; + const DISTANCE_Y_STATIC = 12; const MARGIN_Y = 30; const MARGIN_X = 30; @@ -314,80 +338,114 @@ Tooltips.CSS_TOOLTIP_SELECTED = "tooltip-selected"; _cur_ctx.select_last_handler_ele(); - if (box.bottom - box.top < _window_height / 3 || - Math.max(box.left, _window_width - box.right) < _window_height / 3) + if (tooltip.dynamic_size) { - // positioning horizontally - if (_window_height - box.bottom > box.top) + if (box.bottom - box.top < _window_height / 3 || + Math.max(box.left, _window_width - box.right) < _window_height / 3) { - var top = box.bottom + DISTANCE_Y; - _cur_ctx.tooltip_ele.style.top = top + "px"; - _cur_ctx.tooltip_ele.style.bottom = "auto"; - max_h = _window_height - top - MARGIN_Y - _padding_height; - max_height_target.style.maxHeight = max_h + "px"; + // positioning horizontally + if (_window_height - box.bottom > box.top) + { + var top = box.bottom + DISTANCE_Y; + _cur_ctx.tooltip_ele.style.top = top + "px"; + _cur_ctx.tooltip_ele.style.bottom = "auto"; + max_h = _window_height - top - MARGIN_Y - _padding_height; + max_height_target.style.maxHeight = max_h + "px"; + } + else + { + var bottom = _window_height - box.top + DISTANCE_Y; + _cur_ctx.tooltip_ele.style.bottom = bottom + "px"; + _cur_ctx.tooltip_ele.style.top = "auto"; + max_h = _window_height - bottom - MARGIN_Y - _padding_height; + max_height_target.style.maxHeight = max_h + "px"; + } + + if (box.mouse_x < _window_width / 2) + { + var left = box.mouse_x + DISTANCE_X; + _cur_ctx.tooltip_ele.style.left = left + "px"; + _cur_ctx.tooltip_ele.style.right = "auto"; + max_w = _window_width - left - MARGIN_X - _padding_width; + max_height_target.style.maxWidth = max_w + "px"; + } + else + { + var right = _window_width - box.mouse_x + DISTANCE_X; + _cur_ctx.tooltip_ele.style.right = right + "px"; + _cur_ctx.tooltip_ele.style.left = "auto"; + max_w = _window_width - right - MARGIN_X - _padding_width; + max_height_target.style.maxWidth = max_w + "px"; + } + } else { - var bottom = _window_height - box.top + DISTANCE_Y; - _cur_ctx.tooltip_ele.style.bottom = bottom + "px"; - _cur_ctx.tooltip_ele.style.top = "auto"; - max_h = _window_height - bottom - MARGIN_Y - _padding_height; - max_height_target.style.maxHeight = max_h + "px"; + // positioning vertically + if (_window_width - box.right > box.left) + { + var left = box.right + DISTANCE_X; + _cur_ctx.tooltip_ele.style.left = left + "px"; + _cur_ctx.tooltip_ele.style.right = "auto"; + max_w = _window_width - left - MARGIN_X - _padding_width; + max_height_target.style.maxWidth = max_w + "px"; + } + else + { + var right = box.left - DISTANCE_X; + _cur_ctx.tooltip_ele.style.right = right + "px"; + _cur_ctx.tooltip_ele.style.left = "auto"; + max_w = right - MARGIN_X - _padding_width; + max_height_target.style.maxWidth = max_w + "px"; + } + + if (box.mouse_y < _window_height / 2) + { + var top = box.mouse_y + DISTANCE_Y; + _cur_ctx.tooltip_ele.style.top = top + "px"; + _cur_ctx.tooltip_ele.style.bottom = "auto"; + max_h = _window_height - top - MARGIN_Y - _padding_height; + max_height_target.style.maxHeight = max_h + "px"; + } + else + { + var bottom = _window_height - box.mouse_y - DISTANCE_Y; + _cur_ctx.tooltip_ele.style.bottom = bottom + "px"; + _cur_ctx.tooltip_ele.style.top = "auto"; + max_h = box.mouse_y - MARGIN_Y - _padding_height; + max_height_target.style.maxHeight = max_h + "px"; + } } - - if (box.mouse_x < _window_width / 2) + } + else + { + var tooltip_height = _cur_ctx.tooltip_ele.offsetHeight; + var tooltip_width = _cur_ctx.tooltip_ele.offsetWidth; + // positioning horizontally + if (_window_height - box.bottom > tooltip_height + DISTANCE_Y_STATIC) { - var left = box.mouse_x + DISTANCE_X; - _cur_ctx.tooltip_ele.style.left = left + "px"; - _cur_ctx.tooltip_ele.style.right = "auto"; - max_w = _window_width - left - MARGIN_X - _padding_width; - max_height_target.style.maxWidth = max_w + "px"; + var top = box.bottom + DISTANCE_Y_STATIC; + _cur_ctx.tooltip_ele.style.top = top + "px"; + _cur_ctx.tooltip_ele.style.bottom = "auto"; } else { - var right = _window_width - box.mouse_x + DISTANCE_X; - _cur_ctx.tooltip_ele.style.right = right + "px"; - _cur_ctx.tooltip_ele.style.left = "auto"; - max_w = _window_width - right - MARGIN_X - _padding_width; - max_height_target.style.maxWidth = max_w + "px"; + var bottom = _window_height - box.top + DISTANCE_Y_STATIC; + _cur_ctx.tooltip_ele.style.bottom = bottom + "px"; + _cur_ctx.tooltip_ele.style.top = "auto"; } - - } - else - { // positioning vertically - if (_window_width - box.right > box.left) + if (_window_width - box.mouse_x > tooltip_width + DISTANCE_X_STATIC) { - var left = box.right + DISTANCE_X; + var left = box.mouse_x + DISTANCE_X_STATIC; _cur_ctx.tooltip_ele.style.left = left + "px"; _cur_ctx.tooltip_ele.style.right = "auto"; - max_w = _window_width - left - MARGIN_X - _padding_width; - max_height_target.style.maxWidth = max_w + "px"; } else { - var right = box.left - DISTANCE_X; + var right = box.mouse_x - DISTANCE_X_STATIC; _cur_ctx.tooltip_ele.style.right = right + "px"; _cur_ctx.tooltip_ele.style.left = "auto"; - max_w = right - MARGIN_X - _padding_width; - max_height_target.style.maxWidth = max_w + "px"; - } - - if (box.mouse_y < _window_height / 2) - { - var top = box.mouse_y + DISTANCE_Y; - _cur_ctx.tooltip_ele.style.top = top + "px"; - _cur_ctx.tooltip_ele.style.bottom = "auto"; - max_h = _window_height - top - MARGIN_Y - _padding_height; - max_height_target.style.maxHeight = max_h + "px"; - } - else - { - var bottom = _window_height - box.mouse_y - DISTANCE_Y; - _cur_ctx.tooltip_ele.style.bottom = bottom + "px"; - _cur_ctx.tooltip_ele.style.top = "auto"; - max_h = box.mouse_y - MARGIN_Y - _padding_height; - max_height_target.style.maxHeight = max_h + "px"; } } } diff --git a/src/ui-style/ui.css b/src/ui-style/ui.css index 0a7b3f8bb..393ac9df2 100644 --- a/src/ui-style/ui.css +++ b/src/ui-style/ui.css @@ -182,6 +182,11 @@ cst-select-option-list, color: #333; } +.tooltip-container +{ + padding: 3px 7px; +} + .reload-window::before { background-image: url("../ui-images/icons/icon_reload.png"); From 96fe64d34bd96594b2bb63df31895aeaa0b320d6 Mon Sep 17 00:00:00 2001 From: Chris K Date: Wed, 22 Aug 2012 18:38:38 +0200 Subject: [PATCH 12/27] Adjusting tooltips according to DFL-3159. --- .../eventlisteners/evlistenertooltip.js | 6 +- src/ecma-debugger/jssourcetooltip.js | 6 +- .../objectinspection.6.0/inspectiontooltip.js | 7 +- src/ecma-debugger/return_values_view.js | 2 +- src/ecma-debugger/scriptselect.js | 2 +- src/network/network_view.js | 4 +- src/profiler/profiler_view.js | 4 +- src/style/view_color_picker.js | 6 +- .../sortable_table/sortable_table.js | 2 +- src/ui-scripts/tooltip/tooltip.css | 7 +- src/ui-scripts/tooltip/tooltip.js | 68 ++++++++++++++----- src/ui-style/js-source.css | 8 +-- src/ui-style/ui.css | 5 -- 13 files changed, 84 insertions(+), 43 deletions(-) diff --git a/src/ecma-debugger/eventlisteners/evlistenertooltip.js b/src/ecma-debugger/eventlisteners/evlistenertooltip.js index 85ff5c0b6..f710b5b18 100644 --- a/src/ecma-debugger/eventlisteners/evlistenertooltip.js +++ b/src/ecma-debugger/eventlisteners/evlistenertooltip.js @@ -54,8 +54,10 @@ cls.EventListenerTooltip = function() var _init = function(view) { - _tooltip = Tooltips.register(cls.EventListenerTooltip.tooltip_name, true); - _url_tooltip = Tooltips.register("url-tooltip", true); + _tooltip = Tooltips.register(cls.EventListenerTooltip.tooltip_name, + {type: Tooltips.TYPE_SUPPORT_CONTEXT, + set_selected: true}); + _url_tooltip = Tooltips.register("url-tooltip", {type: Tooltips.TYPE_SUPPORT_CONTEXT}); _tooltip.ontooltip = _ontooltip; _tooltip.onhide = _hide_tooltip; _tooltip.ontooltipclick = _ontooltipclick; diff --git a/src/ecma-debugger/jssourcetooltip.js b/src/ecma-debugger/jssourcetooltip.js index 7c7e992fa..096ace5dc 100644 --- a/src/ecma-debugger/jssourcetooltip.js +++ b/src/ecma-debugger/jssourcetooltip.js @@ -1129,8 +1129,10 @@ cls.JSSourceTooltip = function(view) { _view = view; _tokenizer = new cls.SimpleJSParser(); - _tooltip = Tooltips.register(cls.JSSourceTooltip.tooltip_name, true, false, - ".js-tooltip-examine-container"); + _tooltip = Tooltips.register(cls.JSSourceTooltip.tooltip_name, + {type: Tooltips.TYPE_SUPPORT_CONTEXT, + dynamic_size: true, + max_height_target: ".js-tooltip-examine-container"}); _tooltip.ontooltip = _ontooltip; _tooltip.onhide = _onhide; _tooltip.ontooltipenter = _ontooltipenter; diff --git a/src/ecma-debugger/objectinspection.6.0/inspectiontooltip.js b/src/ecma-debugger/objectinspection.6.0/inspectiontooltip.js index 7f8c14576..b3ef67c1f 100644 --- a/src/ecma-debugger/objectinspection.6.0/inspectiontooltip.js +++ b/src/ecma-debugger/objectinspection.6.0/inspectiontooltip.js @@ -158,8 +158,11 @@ cls.JSInspectionTooltip = function() var _init = function(view) { - _tooltip = Tooltips.register(cls.JSInspectionTooltip.tooltip_name, true, true, - ".js-tooltip-examine-container"); + _tooltip = Tooltips.register(cls.JSInspectionTooltip.tooltip_name, + {type: Tooltips.TYPE_SUPPORT_CONTEXT, + dynamic_size: true, + set_selected: true, + max_height_target: ".js-tooltip-examine-container"}); _pretty_printer = new cls.PrettyPrinter(); _pretty_printer.register_types([cls.PrettyPrinter.ELEMENT, cls.PrettyPrinter.DATE, diff --git a/src/ecma-debugger/return_values_view.js b/src/ecma-debugger/return_values_view.js index 2149c2ef4..7519b08dc 100644 --- a/src/ecma-debugger/return_values_view.js +++ b/src/ecma-debugger/return_values_view.js @@ -87,7 +87,7 @@ cls.ReturnValuesView = function(id, name, container_class) this.required_services = ["ecmascript-debugger"]; this._container = null; this._search_term = ""; - this._tooltip = Tooltips.register("return-value-tooltip", false, false); + this._tooltip = Tooltips.register("return-value-tooltip"); this._text_search = new TextSearch(1); this._text_search.add_listener("onbeforesearch", this._onbeforesearch.bind(this)); diff --git a/src/ecma-debugger/scriptselect.js b/src/ecma-debugger/scriptselect.js index c8c91eb55..26b4c1ed8 100644 --- a/src/ecma-debugger/scriptselect.js +++ b/src/ecma-debugger/scriptselect.js @@ -356,7 +356,7 @@ cls.ScriptSelect = function(id, class_name) messages.addListener("thread-stopped-event", onThreadStopped); messages.addListener("thread-continue-event", onThreadContinue); messages.addListener("application-setup", onApplicationSetup); - this._tooltip = Tooltips.register("js-script-select", true, false); + this._tooltip = Tooltips.register("js-script-select", {type: Tooltips.TYPE_SUPPORT_CONTEXT}); this._setting = null; this._match_history = []; this._match_cursor = 0; diff --git a/src/network/network_view.js b/src/network/network_view.js index 4eee217c0..3e664d466 100644 --- a/src/network/network_view.js +++ b/src/network/network_view.js @@ -509,10 +509,10 @@ cls.NetworkLogView = function(id, name, container_class, html, default_handler) this.mono_lineheight = window.defaults["js-source-line-height"]; }.bind(this); - this.url_tooltip = Tooltips.register("network-url-list-tooltip", true, false); + this.url_tooltip = Tooltips.register("network-url-list-tooltip", {type: Tooltips.TYPE_SUPPORT_CONTEXT}); this.url_tooltip.ontooltip = this._on_url_tooltip_bound; - this.graph_tooltip = Tooltips.register("network-graph-tooltip", true, false); + this.graph_tooltip = Tooltips.register("network-graph-tooltip", {type: Tooltips.TYPE_SUPPORT_CONTEXT}); this.graph_tooltip.ontooltip = this._on_graph_tooltip_bound; this.graph_tooltip.ontooltipenter = this._on_graph_tooltip_enter_bound; this.graph_tooltip.ontooltipleave = this._on_graph_tooltip_leave_bound; diff --git a/src/profiler/profiler_view.js b/src/profiler/profiler_view.js index 3b31b71b6..27375efae 100644 --- a/src/profiler/profiler_view.js +++ b/src/profiler/profiler_view.js @@ -413,8 +413,8 @@ var ProfilerView = function(id, name, container_class, html, default_handler) this._old_session_id = null; this._reset(); - Tooltips.register("profiler-tooltip-url", true, false); - this._tooltip = Tooltips.register("profiler-event", true, false); + Tooltips.register("profiler-tooltip-url", {type: Tooltips.TYPE_SUPPORT_CONTEXT}); + this._tooltip = Tooltips.register("profiler-event", {type: Tooltips.TYPE_SUPPORT_CONTEXT}); this._tooltip.ontooltip = this._ontooltip.bind(this); this._handle_start_profiler_bound = this._handle_start_profiler.bind(this); diff --git a/src/style/view_color_picker.js b/src/style/view_color_picker.js index 55789cf8a..de5c414f2 100644 --- a/src/style/view_color_picker.js +++ b/src/style/view_color_picker.js @@ -298,11 +298,13 @@ window.cls.ColorPickerView = function(id, name, container_class) this._color_notation = null; this._ele = null; this._panel_ele = null; - this._tooltip = Tooltips.register("color-palette", true); + this._tooltip = Tooltips.register("color-palette", {type: Tooltips.TYPE_SUPPORT_CONTEXT, + set_selected: true, + preferred_position: "top"}); this._tooltip.ontooltip = function(event, target) { var box = target.getBoundingClientRect(); - box.mouse_x = box.left; + box.mouse_x = box.left - 5; this.show(window.templates.color_picker_palette(), box); }; diff --git a/src/ui-scripts/sortable_table/sortable_table.js b/src/ui-scripts/sortable_table/sortable_table.js index 033f23cd1..696ad8030 100644 --- a/src/ui-scripts/sortable_table/sortable_table.js +++ b/src/ui-scripts/sortable_table/sortable_table.js @@ -173,7 +173,7 @@ var SortableTablePrototype = function() } // and not in tooltips either if (window.Tooltips) - Tooltips.register("sortable-table-tooltip", true, false); + Tooltips.register("sortable-table-tooltip", {set_selected: false}); } this._make_context_menu = function(evt) diff --git a/src/ui-scripts/tooltip/tooltip.css b/src/ui-scripts/tooltip/tooltip.css index ed9efbb39..0394cea51 100644 --- a/src/ui-scripts/tooltip/tooltip.css +++ b/src/ui-scripts/tooltip/tooltip.css @@ -6,7 +6,12 @@ overflow: auto; background-color: #f2f2f2; color: #000; - + padding: 3px 7px; +} + +.support-context +{ + padding: 8px; } .tooltip-selected diff --git a/src/ui-scripts/tooltip/tooltip.js b/src/ui-scripts/tooltip/tooltip.js index e8c10d4c4..170810f22 100644 --- a/src/ui-scripts/tooltip/tooltip.js +++ b/src/ui-scripts/tooltip/tooltip.js @@ -1,5 +1,8 @@ var Tooltips = function() {}; +Tooltips.TYPE_SIMPLE = 0; +Tooltips.TYPE_SUPPORT_CONTEXT = 1; + Tooltips.CSS_TOOLTIP_SELECTED = "tooltip-selected"; (function() @@ -16,9 +19,20 @@ Tooltips.CSS_TOOLTIP_SELECTED = "tooltip-selected"; config keep_on_hover: Boolean, default false set_selected: Boolean, default false - max_height_target: Number + If true it sets the class 'selected' on the target. + max_height_target: String css_query + If set it sets max-width and max-height on that element instead + on the tooltip-container. dynamic_size: Boolean, default false - class: default "", supported "context-window" + If true it positions the tooltip always in the biggest possible free area. + If false the preferred position is bottom-right of the target. Only if it + doesn't fit there it positions it in an other area. + class: String default "" + preferred_position: String , "top" or "bottom", default "bottom" + This setting has only an effect if dynamic_size is not set. + type: Type default Tooltips.TYPE_SIMPLE + If set to Tooltips.TYPE_SUPPORT_CONTEXT it will set keep_on_hover to true + and class to "support-context". */ this._init(keep_on_hover_or_config, set_selected, max_height_target); }; @@ -73,7 +87,7 @@ Tooltips.CSS_TOOLTIP_SELECTED = "tooltip-selected"; this._init = function(keep_on_hover_or_config, set_selected, max_height_target) { - if (typeof keep_on_hover_or_config== "object") + if (typeof keep_on_hover_or_config == "object") { var config = keep_on_hover_or_config; this.keep_on_hover = config.keep_on_hover || false; @@ -81,6 +95,13 @@ Tooltips.CSS_TOOLTIP_SELECTED = "tooltip-selected"; this.max_height_target = config.max_height_target || ""; this.dynamic_size = config.dynamic_size || false; this.class = config.class || ""; + this.preferred_position = config.preferred_position || "bottom"; + this.type = config.type || Tooltips.TYPE_SIMPLE; + if (this.type == Tooltips.TYPE_SUPPORT_CONTEXT) + { + this.keep_on_hover = true; + this.class = "support-context"; + } } else { @@ -89,6 +110,8 @@ Tooltips.CSS_TOOLTIP_SELECTED = "tooltip-selected"; this.max_height_target = max_height_target || ""; this.dynamic_size = false; this.class = ""; + this.preferred_position = "bottom"; + this.type = Tooltips.TYPE_SIMPLE } } @@ -309,6 +332,12 @@ Tooltips.CSS_TOOLTIP_SELECTED = "tooltip-selected"; : _cur_ctx.tooltip_ele.clearAndRender(content); } + if (_cur_ctx.current_tooltip.class) + _cur_ctx.tooltip_ele.addClass(_cur_ctx.current_tooltip.class); + else + _cur_ctx.tooltip_ele.className = "tooltip-container"; + + if (!box && _cur_ctx.last_box) { box = {top: _cur_ctx.last_box.top, @@ -421,31 +450,39 @@ Tooltips.CSS_TOOLTIP_SELECTED = "tooltip-selected"; { var tooltip_height = _cur_ctx.tooltip_ele.offsetHeight; var tooltip_width = _cur_ctx.tooltip_ele.offsetWidth; + var distance_x = DISTANCE_X_STATIC; + var distance_y = DISTANCE_Y_STATIC; + if (tooltip.type == Tooltips.TYPE_SUPPORT_CONTEXT) + { + distance_x = DISTANCE_X; + distance_y = DISTANCE_Y; + } // positioning horizontally - if (_window_height - box.bottom > tooltip_height + DISTANCE_Y_STATIC) + if (tooltip.preferred_position == "bottom" && + _window_height - box.bottom > tooltip_height + distance_y) { - var top = box.bottom + DISTANCE_Y_STATIC; + var top = box.bottom + distance_y; _cur_ctx.tooltip_ele.style.top = top + "px"; _cur_ctx.tooltip_ele.style.bottom = "auto"; } else { - var bottom = _window_height - box.top + DISTANCE_Y_STATIC; - _cur_ctx.tooltip_ele.style.bottom = bottom + "px"; + var bottom = _window_height - box.top + distance_y; _cur_ctx.tooltip_ele.style.top = "auto"; + _cur_ctx.tooltip_ele.style.bottom = bottom + "px"; } // positioning vertically - if (_window_width - box.mouse_x > tooltip_width + DISTANCE_X_STATIC) + if (_window_width - box.mouse_x > tooltip_width + distance_x) { - var left = box.mouse_x + DISTANCE_X_STATIC; + var left = box.mouse_x + distance_x; _cur_ctx.tooltip_ele.style.left = left + "px"; _cur_ctx.tooltip_ele.style.right = "auto"; } else { - var right = box.mouse_x - DISTANCE_X_STATIC; - _cur_ctx.tooltip_ele.style.right = right + "px"; + var right = _window_width - box.mouse_x + distance_x; _cur_ctx.tooltip_ele.style.left = "auto"; + _cur_ctx.tooltip_ele.style.right = right + "px"; } } } @@ -467,7 +504,6 @@ Tooltips.CSS_TOOLTIP_SELECTED = "tooltip-selected"; { while (_ctx_stack.length > index + 1) _ctx_stack.pop().hide_tooltip(true); - ctx.hide_tooltip(true); _cur_ctx = ctx; break; @@ -490,7 +526,7 @@ Tooltips.CSS_TOOLTIP_SELECTED = "tooltip-selected"; /* implementation */ - this.register = function(name, keep_on_hover, set_selected, max_height_target) + this.register = function(name, keep_on_hover_or_config, set_selected, max_height_target) { if (!_is_setup) { @@ -500,11 +536,7 @@ Tooltips.CSS_TOOLTIP_SELECTED = "tooltip-selected"; document.addEventListener("DOMContentLoaded", _setup, false); _is_setup = true; } - - if (typeof set_selected != "boolean") - set_selected = true; - - _tooltips[name] = new Tooltip(keep_on_hover, set_selected, max_height_target); + _tooltips[name] = new Tooltip(keep_on_hover_or_config, set_selected, max_height_target); return _tooltips[name]; }; diff --git a/src/ui-style/js-source.css b/src/ui-style/js-source.css index 2bdbced25..4efb4ac50 100644 --- a/src/ui-style/js-source.css +++ b/src/ui-style/js-source.css @@ -14,7 +14,7 @@ } #js-source-scroll-container { - /* the correct width is set dynamically + /* the correct width is set dynamically to scroll bar width in JsSourceView */ width: 50px; } @@ -62,7 +62,7 @@ color: #5c0909 !important; } -/* line number */ +/* line number */ .js-source-line-numbers { position: absolute; @@ -99,7 +99,7 @@ padding: 0; padding-right: 3px; background-color: transparent; - height: 100%; /* should be the same as the line height .js-source-content li */ + height: 100%; /* should be the same as the line height .js-source-content li */ font-size: inherit; font-family: inherit; vertical-align: middle; @@ -136,7 +136,7 @@ .js-identifier-selected, .js-identifier-selected-first, .js-identifier-selected-between, -.js-identifier-selected-last +.js-identifier-selected-last { color: #000000; background-color: #c5daf1; diff --git a/src/ui-style/ui.css b/src/ui-style/ui.css index 393ac9df2..0a7b3f8bb 100644 --- a/src/ui-style/ui.css +++ b/src/ui-style/ui.css @@ -182,11 +182,6 @@ cst-select-option-list, color: #333; } -.tooltip-container -{ - padding: 3px 7px; -} - .reload-window::before { background-image: url("../ui-images/icons/icon_reload.png"); From b41252d37bce8f84dd8db52977c9a914f3942d9c Mon Sep 17 00:00:00 2001 From: Chris K Date: Wed, 22 Aug 2012 19:10:39 +0200 Subject: [PATCH 13/27] Set the correct flag. --- src/ecma-debugger/eventlisteners/evlistenertooltip.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ecma-debugger/eventlisteners/evlistenertooltip.js b/src/ecma-debugger/eventlisteners/evlistenertooltip.js index f710b5b18..3a126f15a 100644 --- a/src/ecma-debugger/eventlisteners/evlistenertooltip.js +++ b/src/ecma-debugger/eventlisteners/evlistenertooltip.js @@ -57,7 +57,8 @@ cls.EventListenerTooltip = function() _tooltip = Tooltips.register(cls.EventListenerTooltip.tooltip_name, {type: Tooltips.TYPE_SUPPORT_CONTEXT, set_selected: true}); - _url_tooltip = Tooltips.register("url-tooltip", {type: Tooltips.TYPE_SUPPORT_CONTEXT}); + _url_tooltip = Tooltips.register("url-tooltip", {type: Tooltips.TYPE_SUPPORT_CONTEXT, + set_selected: true}); _tooltip.ontooltip = _ontooltip; _tooltip.onhide = _hide_tooltip; _tooltip.ontooltipclick = _ontooltipclick; From 07235182c4cd55b85f683fc0e91e7370b68dafdd Mon Sep 17 00:00:00 2001 From: Chris K Date: Thu, 23 Aug 2012 16:18:24 +0200 Subject: [PATCH 14/27] Working on copy action. --- src/client-en.xml | 2 ++ src/lib/clipboard.js | 44 ++++++++++++++++++++++++++++++++ src/network/network_templates.js | 2 ++ src/network/network_view.js | 2 +- src/ui-scripts/contextmenu.js | 2 ++ src/ui-strings/ui_strings-en.js | 6 +++++ src/ui-style/ui.css | 6 +++++ 7 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 src/lib/clipboard.js diff --git a/src/client-en.xml b/src/client-en.xml index 63ad84c93..be80e66a6 100644 --- a/src/client-en.xml +++ b/src/client-en.xml @@ -225,6 +225,7 @@ window.load_screen_timeout = window.setTimeout(function()