diff --git a/src/build-application/build_ecmascript_debugger_6_0.js b/src/build-application/build_ecmascript_debugger_6_0.js
index 6fc0e7c1a..0490f1097 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/client-en.xml b/src/client-en.xml
index e330985a0..510738fd5 100644
--- a/src/client-en.xml
+++ b/src/client-en.xml
@@ -226,6 +226,7 @@ window.load_screen_timeout = window.setTimeout(function()
+
@@ -414,7 +415,6 @@ window.load_screen_timeout = window.setTimeout(function()
-
diff --git a/src/ecma-debugger/action_handler.js b/src/ecma-debugger/action_handler.js
index 99ea04141..5f14f032e 100644
--- a/src/ecma-debugger/action_handler.js
+++ b/src/ecma-debugger/action_handler.js
@@ -101,65 +101,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/dominspection/actions.js b/src/ecma-debugger/dominspection/actions.js
index c5e39437f..dc1adb1f6 100644
--- a/src/ecma-debugger/dominspection/actions.js
+++ b/src/ecma-debugger/dominspection/actions.js
@@ -8,14 +8,16 @@
cls.DOMInspectorActions = function(id)
{
+ ActionHandlerInterface.apply(this);
this.view_id = id;
this.id = id;
- const
- SCROLL_IN_PADDING = 30,
- MODE_DEFAULT = "default",
- MODE_EDIT_ATTR_TEXT = "edit-attributes-and-text",
- MODE_EDIT_MARKUP = "edit-markup";
+ var SCROLL_IN_PADDING = 30;
+ var MODE_DEFAULT = "default";
+ var MODE_EDIT_ATTR_TEXT = "edit-attributes-and-text";
+ var MODE_EDIT_MARKUP = "edit-markup";
+ var LEFT_CLICK = 1;
+ var SUCCESS = 0;
this.mode_labels =
{
@@ -33,8 +35,6 @@ cls.DOMInspectorActions = function(id)
var broker = ActionBroker.get_instance();
- this.serializer = new cls.DOMSerializer();
-
this._handlers = {};
this._mode = MODE_DEFAULT;
this.__defineSetter__("mode", function(mode)
@@ -368,10 +368,10 @@ cls.DOMInspectorActions = function(id)
}
}
if (!nav_target)
- {
nav_target = this.getFirstTarget();
- }
- this.setSelected(nav_target);
+
+ if (event.which == LEFT_CLICK)
+ this.setSelected(nav_target);
}
}
@@ -478,9 +478,11 @@ cls.DOMInspectorActions = function(id)
{
var target = event.target;
var is_in_container = view_container && view_container.contains(target);
- if(is_in_container)
+ if (is_in_container)
{
- if(target != nav_target && /^input|node|key|value|text$/i.test(target.nodeName))
+ if (event.which == LEFT_CLICK &&
+ target != nav_target &&
+ /^input|node|key|value|text$/i.test(target.nodeName))
{
this.setSelected(target);
}
@@ -497,9 +499,10 @@ cls.DOMInspectorActions = function(id)
this.blur = function(event)
{
+
if (this.mode != MODE_DEFAULT && this.editor)
this.editor.submit();
- if (selection)
+ if (selection && !selection.isCollapsed)
selection.removeAllRanges();
view_container = null;
view_container_first_child = null;
@@ -610,12 +613,6 @@ cls.DOMInspectorActions = function(id)
}
}.bind(this);
- this._handlers["export-markup"] = function(event, target)
- {
- var data = this.serializer.serialize(window.dom_data);
- window.open("data:text/plain;charset=utf-8," + encodeURIComponent(data));
- }.bind(this);
-
this._handlers["expand-whole-dom"] = function(event, target)
{
window.dom_data.get_snapshot();
@@ -892,6 +889,48 @@ cls.DOMInspectorActions = function(id)
}
}.bind(this);
+ this._handlers["copy-xpath"] = function(event, target)
+ {
+ var model = window.dominspections[target.get_ancestor_attr("data-model-id")];
+ var obj_id = parseInt(target.get_ancestor_attr("ref-id"));
+ if (model && obj_id)
+ {
+ var force_lower_case = window.settings.dom.get("force-lowercase");
+ model.get_xpath(obj_id, force_lower_case, function(path)
+ {
+ if (path)
+ Clipboard.set_string(path);
+ });
+ }
+ }.bind(this);
+
+ this._handlers["copy-css-path"] = function(event, target)
+ {
+ var model = window.dominspections[target.get_ancestor_attr("data-model-id")];
+ var obj_id = parseInt(target.get_ancestor_attr("ref-id"));
+ if (model && obj_id)
+ {
+ var force_lower_case = window.settings.dom.get("force-lowercase");
+ var path = model.get_unique_css_path(obj_id, force_lower_case);
+ if (path)
+ Clipboard.set_string(path);
+ }
+ }.bind(this);
+
+ this._handlers["copy-markup"] = function(event, target)
+ {
+ var model = window.dominspections[target.get_ancestor_attr("data-model-id")];
+ var obj_id = parseInt(target.get_ancestor_attr("ref-id"));
+ if (model && obj_id)
+ {
+ model.serialize_to_string(obj_id, function(markup)
+ {
+ if (markup)
+ Clipboard.set_string(markup);
+ });
+ }
+ }.bind(this);
+
this.edit_onclick = function(event)
{
if( this.editor )
@@ -961,11 +1000,6 @@ window.event_handlers.mouseover['spotlight-node'] = function(event, target)
this.broker.dispatch_action("dom", "spotlight-node", event, target);
}
-window.event_handlers.click['dom-inspection-export'] = function(event, target)
-{
- this.broker.dispatch_action("dom", "export-markup", event, target);
-};
-
window.event_handlers.click['dom-inspection-snapshot'] = function(event, target)
{
this.broker.dispatch_action("dom", "expand-whole-dom", event, target);
diff --git a/src/ecma-debugger/dominspection/domdata.js b/src/ecma-debugger/dominspection/domdata.js
index e0de6ef08..ac369108b 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;
@@ -243,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);
}
@@ -274,6 +281,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)
@@ -291,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())
@@ -402,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)
@@ -419,8 +425,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 +468,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 +496,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 +520,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 +539,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 +553,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/dominspection/domserializer.js b/src/ecma-debugger/dominspection/domserializer.js
deleted file mode 100644
index 7aacb413f..000000000
--- a/src/ecma-debugger/dominspection/domserializer.js
+++ /dev/null
@@ -1,241 +0,0 @@
-window.cls || (window.cls = {});
-
-window.cls.DOMSerializer = function(){};
-
-window.cls.DOMSerializer.prototype = new function()
-{
-
- const
- ID = 0,
- TYPE = 1,
- NAME = 2,
- DEPTH = 3,
- NAMESPACE = 4,
- VALUE = 7,
- ATTRS = 5,
- ATTR_PREFIX = 0,
- ATTR_KEY = 1,
- ATTR_VALUE = 2,
- CHILDREN_LENGTH = 6,
- PUBLIC_ID = 8,
- SYSTEM_ID = 9,
- INDENT = " ",
- LINEBREAK = '\n',
- VOID_ELEMENTS =
- {
- 'area': 1,
- 'base': 1,
- 'basefont': 1,
- 'bgsound': 1,
- 'br': 1,
- 'col': 1,
- 'embed': 1,
- 'frame': 1,
- 'hr': 1,
- 'img': 1,
- 'input': 1,
- 'link': 1,
- 'meta': 1,
- 'param': 1,
- 'spacer': 1,
- 'wbr': 1,
- 'command': 1,
- 'event-source': 1,
- 'source': 1,
- };
-
- var getIndent = function(count)
- {
- var ret = '';
- if (count)
- {
- count--;
- }
- while (count > 0)
- {
- ret += INDENT;
- count--;
- }
- return ret;
- };
-
- this['text/html'] = function(model, is_xml)
- {
- const LINEBREAK = '\r\n';
-
- var
- data = model.getData(),
- tree = '',
- i = 0,
- node = null,
- length = data.length,
- attrs = '',
- attr = null,
- k = 0,
- key = '',
- is_open = 0,
- has_only_one_child = 0,
- one_child_value = '',
- current_depth = 0,
- child_pointer = 0,
- child_level = 0,
- j = 0,
- children_length = 0,
- closing_tags = [],
- force_lower_case = window.settings.dom.get('force-lowercase'),
- node_name = '',
- tag_head = '',
- start_depth = data[0][DEPTH] - 1,
- disregard_force_lower_case_whitelist =
- cls.EcmascriptDebugger["6.0"].DOMData.DISREGARD_FORCE_LOWER_CASE_WHITELIST,
- disregard_force_lower_case_depth = 0;
-
- for( ; node = data[i]; i++ )
- {
- while( current_depth > node[DEPTH] )
- {
- tree += closing_tags.pop();
- current_depth--;
- }
- current_depth = node[DEPTH];
- children_length = node[CHILDREN_LENGTH];
- child_pointer = 0;
- node_name = node[NAME];
-
- if (force_lower_case && disregard_force_lower_case_whitelist.indexOf(node[NAME].toLowerCase()) != -1)
- {
- 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();
- }
- switch (node[TYPE])
- {
- case 0: // pseudos
- {
- break;
- }
- case 1: // elements
- {
- attrs = '';
- for( k = 0; attr = node[ATTRS][k]; k++ )
- {
- attrs += " " +
- (attr[ATTR_PREFIX] ? attr[ATTR_PREFIX] + ':' : '') +
- ( force_lower_case ? attr[ATTR_KEY].toLowerCase() : attr[ATTR_KEY] ) +
- "=\"" +
- attr[ATTR_VALUE].replace(/"/g, """) +
- "\"";
- }
- child_pointer = i + 1;
- is_open = ( data[child_pointer] && ( node[DEPTH] < data[child_pointer][DEPTH] ) );
- if( is_open )
- {
- has_only_one_child = 1;
- one_child_value = '';
- child_level = data[child_pointer][DEPTH];
- for( ; data[child_pointer] && data[child_pointer][DEPTH] == child_level; child_pointer++ )
- {
- one_child_value += data[child_pointer][VALUE];
- if( data[child_pointer][TYPE] != 3 )
- {
- has_only_one_child = 0;
- one_child_value = '';
- break;
- }
- }
- }
- if( is_open )
- {
- if( has_only_one_child )
- {
- tree += LINEBREAK + getIndent(node[DEPTH] - start_depth) +
- "<" + node_name + attrs + ">" +
- helpers.escape_html(one_child_value) +
- "" + node_name + ">";
- i = child_pointer - 1;
- }
- else
- {
- tree += LINEBREAK + getIndent(node[DEPTH] - start_depth) +
- "<" + node_name + attrs + ">";
- if( !(node_name in VOID_ELEMENTS) ) // TODO: why?
- {
- closing_tags.push
- (
- LINEBREAK + getIndent(node[DEPTH] - start_depth) + "" + node_name + ">"
- );
- }
- }
- }
- else // is closed or empty
- {
- tree += LINEBREAK + getIndent(node[DEPTH] - start_depth) + "<" + node_name + attrs +
- ( is_xml && "/>" || ">" + ( node_name in VOID_ELEMENTS ? "" : "" + node_name + ">" ) );
- }
- break;
- }
- case 7: // processing instruction
- {
- tree += LINEBREAK + getIndent(node[DEPTH] - start_depth) +
- "" + node[NAME] + ( node[VALUE] ? ' ' + node[VALUE] : '' ) + "?>";
- break;
- }
- case 8: // comments
- {
- tree += LINEBREAK + getIndent(node[DEPTH] - start_depth) +
- "";
- break;
- }
- case 9: // document node
- {
- break;
- }
- case 10: // doctype
- {
- tree += LINEBREAK + getIndent(node[DEPTH] - start_depth) +
- "";
- break;
- }
- default:
- {
- if( !/^\s*$/.test(node[ VALUE ] ) )
- {
- tree += LINEBREAK + getIndent(node[DEPTH] - start_depth) + helpers.escape_html(node[VALUE]);
- }
- }
- }
- }
- while( closing_tags.length )
- {
- tree += closing_tags.pop();
- }
- return tree.replace(/^(?:\r\n)+/, '');
- };
-
- this['application/xml'] = function(model)
- {
- // TODO
- return this['text/html'](model, true);
- };
-
- this.serialize = function(model /* of type InspectableDOMNode */)
- {
- return this[model.get_mime()](model);
- }
-};
diff --git a/src/ecma-debugger/dominspection/domview.js b/src/ecma-debugger/dominspection/domview.js
index 4b5c72fb6..31cb526b5 100644
--- a/src/ecma-debugger/dominspection/domview.js
+++ b/src/ecma-debugger/dominspection/domview.js
@@ -339,10 +339,6 @@ cls.DOMView.create_ui_widgets = function()
{
handler: 'dom-inspection-snapshot',
title: ui_strings.S_BUTTON_LABEL_GET_THE_WOHLE_TREE
- },
- {
- handler: 'dom-inspection-export',
- title: ui_strings.S_BUTTON_LABEL_EXPORT_DOM
}
],
null,
@@ -370,6 +366,18 @@ cls.DOMView.create_ui_widgets = function()
{
label: ui_strings.M_CONTEXTMENU_REMOVE_NODE,
handler: contextmenu_remove_node
+ },
+ {
+ label: ui_strings.M_CONTEXTMENU_COPY_XPATH,
+ handler: contextmenu_copy_xpath
+ },
+ {
+ label: ui_strings.M_CONTEXTMENU_COPY_CSS_PATH,
+ handler: contextmenu_copy_css_path
+ },
+ {
+ label: ui_strings.M_CONTEXTMENU_COPY_MARKUP,
+ handler: contextmenu_copy_markup
}
];
@@ -509,6 +517,21 @@ cls.DOMView.create_ui_widgets = function()
broker.dispatch_action("dom", "remove-node", event, event.target);
}
+ function contextmenu_copy_xpath(event, target)
+ {
+ broker.dispatch_action("dom", "copy-xpath", event, event.target);
+ };
+
+ function contextmenu_copy_markup(event, target)
+ {
+ broker.dispatch_action("dom", "copy-markup", event, event.target);
+ };
+
+ function contextmenu_copy_css_path(event, target)
+ {
+ broker.dispatch_action("dom", "copy-css-path", event, event.target);
+ };
+
new Switches
(
'dom',
diff --git a/src/ecma-debugger/dominspection/inspectabledomnode.js b/src/ecma-debugger/dominspection/inspectabledomnode.js
index 43636139b..9fb258c38 100644
--- a/src/ecma-debugger/dominspection/inspectabledomnode.js
+++ b/src/ecma-debugger/dominspection/inspectabledomnode.js
@@ -64,6 +64,9 @@ cls.EcmascriptDebugger["6.0"].InspectableDOMNode.prototype = new function()
var ERROR_MSG = 0;
var PSEUDO_NAME = {};
var EVENT_LISTENER_LIST = cls.EcmascriptDebugger["6.0"].InspectableDOMNode.EVENT_LISTENER_LIST;
+ var SUCCESS = 0;
+ var STATUS = 0;
+ var VALUE = 2;
PSEUDO_NAME[BEFORE] = "before";
PSEUDO_NAME[AFTER] = "after";
@@ -444,6 +447,114 @@ cls.EcmascriptDebugger["6.0"].InspectableDOMNode.prototype = new function()
return path;
}
+ this.get_attr = function(node, attr_key)
+ {
+ var attrs = node && node[ATTRS];
+ if (attrs)
+ {
+ for (var i = 0, attr; attr = attrs[i]; i++)
+ {
+ if (attr[ATTR_KEY] == attr_key)
+ return attr[ATTR_VALUE];
+ }
+ }
+ return null;
+ };
+
+ this.get_xpath = function(object_id, force_lower_case, callback)
+ {
+ var script = "ele.namespaceURI == \"http://www.w3.org/1999/xhtml\"";
+ var ex_ctx = window.runtimes.get_execution_context(this._data_runtime_id);
+ var tag = window.tag_manager.set_callback(this,
+ this._handle_get_xpath,
+ [object_id, force_lower_case, callback]);
+ var msg = [ex_ctx.rt_id, ex_ctx.thread_id, ex_ctx.frame_index, script, [["ele", object_id]]];
+ window.services["ecmascript-debugger"].requestEval(tag, msg);
+ };
+
+ this._handle_get_xpath = function(status, message, object_id, force_lower_case, callback)
+ {
+ if (status != SUCCESS || message[STATUS] != "completed")
+ return callback(null);
+ var is_in_xhtml_ns = message[VALUE] == "true";
+ var path = this._get_unique_path("XPath", object_id, force_lower_case, is_in_xhtml_ns);
+ callback(path);
+ };
+
+ this.get_unique_css_path = function(object_id, force_lower_case)
+ {
+ return this._get_unique_path("CSS", object_id, force_lower_case, true);
+ };
+
+ this._get_unique_path = function(type, object_id, force_lower_case, is_in_xhtml_ns)
+ {
+ var path = "";
+ var name = "";
+ var name_count = 0;
+ var ele = null;
+ var prev_ele = null;
+ var selector = this._selectors[type];
+ if (object_id)
+ {
+ for (var i = 0; (ele = this._data[i]) && ele[ID] != object_id; i++);
+ if (ele)
+ {
+ if (ele[TYPE] == Node.ELEMENT_NODE)
+ {
+ var id = is_in_xhtml_ns && this.get_attr(ele, "id");
+ if (id)
+ return selector.get_id(id);
+ name = this._get_element_name(ele, force_lower_case);
+ name_count = 1;
+ }
+ prev_ele = ele;
+ i--;
+ for ( ; ele = this._data[i]; i--)
+ {
+ if (ele[TYPE] == Node.ELEMENT_NODE)
+ {
+ if (ele[DEPTH] < prev_ele[DEPTH])
+ {
+ path = selector.get_part(name, name_count) + path;
+ name = this._get_element_name(ele, force_lower_case);
+ name_count = 1;
+ prev_ele = ele;
+ }
+ else if (ele[DEPTH] == prev_ele[DEPTH] && ele[NAME] == prev_ele[NAME])
+ name_count++;
+ }
+ }
+ if (name)
+ path = selector.get_part(name, name_count) + path;
+ }
+ }
+ return path.replace(/^ > /, "");
+ };
+
+ this._selectors = {};
+ this._selectors["XPath"] =
+ {
+ get_id: function(id)
+ {
+ return "//*[@id=\"" + id + "\"]";
+ },
+ get_part: function(name, name_count)
+ {
+ return "/" + name + (name_count > 1 ? "[" + name_count + "]" : "");
+ }
+ };
+ this._selectors["CSS"] =
+ {
+ get_id: function(id)
+ {
+ return "#" + id;
+ },
+ get_part: function(name, name_count)
+ {
+ return " > " + name + (name_count > 1 ? ":nth-of-type(" + name_count + ")" : "");
+ }
+ };
+
this.has_data = function()
{
return Boolean(this._data && this._data.length);
@@ -507,6 +618,22 @@ cls.EcmascriptDebugger["6.0"].InspectableDOMNode.prototype = new function()
return this._data_runtime_id;
}
+ this.serialize_to_string = function(node_id, callback)
+ {
+ var script = "ele.namespaceURI == \"http://www.w3.org/1999/xhtml\"" +
+ "? ele.outerHTML" +
+ ": new XMLSerializer().serializeToString(ele);";
+ var ex_ctx = window.runtimes.get_execution_context(this._data_runtime_id);
+ var tag = window.tag_manager.set_callback(this, this._handle_serialize_to_string, [callback]);
+ var msg = [ex_ctx.rt_id, ex_ctx.thread_id, ex_ctx.frame_index, script, [["ele", node_id]]];
+ window.services["ecmascript-debugger"].requestEval(tag, msg);
+ };
+
+ this._handle_serialize_to_string = function(status, message, callback)
+ {
+ callback(status == SUCCESS && message[STATUS] == "completed" ? message[VALUE] : null);
+ };
+
this._get_id = (function()
{
var id_counter = 0;
diff --git a/src/ecma-debugger/dominspection/markupeditor.js b/src/ecma-debugger/dominspection/markupeditor.js
index 576608363..2c91c8676 100644
--- a/src/ecma-debugger/dominspection/markupeditor.js
+++ b/src/ecma-debugger/dominspection/markupeditor.js
@@ -7,7 +7,6 @@ var DOMMarkupEditor = function()
{
this.base_init(this);
this.type = "dom-markup-editor";
- this.domnodeserializer = new cls.DOMSerializer();
// specific context
this.context_enter =
{
@@ -35,25 +34,13 @@ var DOMMarkupEditor = function()
this.edit = function(event, ref_ele)
{
- var
- ele = ref_ele || event.target,
- rt_id = parseInt(ele.get_attr('parent-node-chain', 'rt-id')),
- obj_id = parseInt(ele.parentElement.getAttribute('ref-id')),
- model_id = ele.get_attr('parent-node-chain', 'data-model-id'),
- script = '',
- tag = '',
- prop = '',
- container = ele,
- model = null,
- dom = null,
- cb = null;
-
- while( container
- && !/container/i.test(container.nodeName)
- && ( container = container.parentElement ) );
- if(container && model_id)
+ var ele = ref_ele || event.target;
+ var rt_id = parseInt(ele.get_ancestor_attr("rt-id"));
+ var obj_id = parseInt(ele.get_ancestor_attr("ref-id"));
+ var model = window.dominspections[ele.get_ancestor_attr("data-model-id")];
+ var container = ele.get_ancestor("container");
+ if (container && model)
{
- model = window.dominspections[model_id];
this.context_enter =
{
rt_id: rt_id,
@@ -64,18 +51,17 @@ var DOMMarkupEditor = function()
model: model
};
this.context_cur = {};
- for( prop in this.context_enter )
+ for (var prop in this.context_enter )
{
this.context_cur[prop] = this.context_enter[prop];
}
- script = this["return new Host_updater(target)"];
- tag = tagManager.set_callback(this, this.register_host_updater, [rt_id]);
- services['ecmascript-debugger'].requestEval(tag, [rt_id, 0, 0, script, [['target', obj_id]]]);
- dom = new cls.InspectableDOMNode(rt_id, obj_id);
- cb = this.handle_get_outer_html.bind(this, dom, rt_id, obj_id, ele, event);
- dom.expand(cb, obj_id, "subtree");
+ var script = this["return new Host_updater(target)"];
+ var tag = tagManager.set_callback(this, this.register_host_updater, [rt_id]);
+ window.services['ecmascript-debugger'].requestEval(tag, [rt_id, 0, 0, script, [['target', obj_id]]]);
+ var cb = this.handle_get_outer_html.bind(this, rt_id, obj_id, ele, event);
+ model.serialize_to_string(obj_id, cb);
}
- }
+ };
this.oninput = function(event)
{
@@ -163,6 +149,8 @@ var DOMMarkupEditor = function()
{
this.textarea.style.height = 0;
this.textarea.style.height = this.textarea.scrollHeight + 'px';
+ this.textarea_container.offsetHeight;
+ this.textarea.style.height = this.textarea.scrollHeight + 'px';
}
this.__is_active = function()
@@ -303,48 +291,31 @@ var DOMMarkupEditor = function()
}
// complete the edit call
- this.handle_get_outer_html = function(dom, rt_id, obj_id, ele, event)
+ this.handle_get_outer_html = function(rt_id, obj_id, ele, event, outer_html)
{
- var
- outerHTML = this.domnodeserializer.serialize(dom),
- parent = ele.parentNode,
- parent_parent = parent.parentElement,
- margin = parseInt(parent.style.marginLeft),
- next = null;
- this.context_enter.outerHTML = this.context_cur.outerHTML = outerHTML;
- if( !this.base_style['font-size'] )
- {
+ var parent = ele.parentNode;
+ var parent_parent = parent.parentElement;
+ var margin = parseInt(parent.style.marginLeft);
+ var next = null;
+ if (!this.base_style['font-size'] )
this.get_base_style(ele);
- }
- // this should never be needed
- if( this.textarea_container.parentElement )
- {
- opera.postError(ui_strings.S_DRAGONFLY_INFO_MESSAGE +
- "this.textarea_container.parentElement is not null in submit");
- }
- this.textarea.value = outerHTML;
+ this.textarea.value = this.context_enter.outer_html = this.context_cur.outer_html = outer_html;
var scroll_position = new Element.ScrollPosition(parent);
parent.innerHTML = "";
parent.appendChild(this.textarea_container);
- while( ( next = parent.nextElementSibling ) && parseInt(next.style.marginLeft) > margin )
+ while ((next = parent.nextElementSibling ) && parseInt(next.style.marginLeft) > margin)
{
parent_parent.removeChild(next);
};
- if( next && parseInt(next.style.marginLeft) == margin && /<\//.test(next.textContent) )
- {
+ if (next && parseInt(next.style.marginLeft) == margin && /<\//.test(next.textContent))
parent_parent.removeChild(next);
- }
- this.set_textarea_dimensions();
// only for click events
- if( event )
- {
+ if (event)
this.textarea.focus();
- }
scroll_position.reset(null, this.textarea);
this.textarea.selectionEnd = this.textarea.selectionStart = 0;
- // it seems it needs to be set twice to get set correctly
this.set_textarea_dimensions();
- }
+ };
this._onmonospacefontchange = function(msg)
{
diff --git a/src/ecma-debugger/eventlisteners/evlistenertooltip.js b/src/ecma-debugger/eventlisteners/evlistenertooltip.js
index 8a3578e29..8fb4d51ea 100644
--- a/src/ecma-debugger/eventlisteners/evlistenertooltip.js
+++ b/src/ecma-debugger/eventlisteners/evlistenertooltip.js
@@ -55,8 +55,11 @@ 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,
+ set_selected: true});
_tooltip.ontooltip = _ontooltip;
_tooltip.onhide = _hide_tooltip;
_tooltip.ontooltipclick = _ontooltipclick;
diff --git a/src/ecma-debugger/js-source-view.js b/src/ecma-debugger/js-source-view.js
index a1992514c..e984a0958 100644
--- a/src/ecma-debugger/js-source-view.js
+++ b/src/ecma-debugger/js-source-view.js
@@ -2,6 +2,7 @@
cls.JsSourceView = function(id, name, container_class)
{
+ ActionHandlerInterface.apply(this);
// TODO this view can just be visible once at the time otherwise there will be problems
// this must be refactored. line_arr, state_arr, breakpoints must be added to the script object
// getting context values must move out of this class
@@ -541,7 +542,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)
@@ -839,7 +839,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)
@@ -908,6 +908,18 @@ cls.JsSourceView = function(id, name, container_class)
return actions;
};
+ this.get_selection_string = function()
+ {
+ var selection = window.getSelection();
+ if (source_content && !selection.isCollapsed)
+ {
+ var range = selection.getRangeAt(0);
+ if (range.toString() == source_content.textContent)
+ return __current_script.script_data;
+ }
+ return this._tooltip.get_selection_string();
+ };
+
this.mode = "default";
this._handlers = {};
@@ -1418,18 +1430,6 @@ cls.JsSourceView.create_ui_widgets = function()
}
if (line)
{
- var selection = window.getSelection();
- if (!selection.isCollapsed)
- {
- var key = selection.toString();
- items.push({
- label: ui_strings.M_CONTEXTMENU_ADD_WATCH.replace("%s", key),
- handler: function(event, target) {
- window.views.watches.add_watch(key);
- }
- });
- }
-
var bp = breakpoints.get_breakpoint_on_script_line(script_id, line);
if (bp)
{
@@ -1484,6 +1484,20 @@ cls.JsSourceView.create_ui_widgets = function()
}
}
+ var script = window.views.js_source.get_current_script();
+ if (script)
+ {
+ items.push({label: ui_strings.M_CONTEXTMENU_COPY_CONTENT,
+ handler: Clipboard.set_string.bind(Clipboard, script.script_data),
+ id: "copy-clipboard"});
+ if (script.uri)
+ {
+ items.push({label: ui_strings.M_CONTEXTMENU_COPY_URL,
+ handler: Clipboard.set_string.bind(Clipboard, script.uri),
+ id: "copy-clipboard"});
+ }
+ }
+
if (items.length)
items.push(ContextMenu.separator);
@@ -1491,4 +1505,20 @@ cls.JsSourceView.create_ui_widgets = function()
}
}
], true); // extend the default existing menu
+
+ contextmenu.register("js_source", [
+ {
+ callback: function(event, target, selection)
+ {
+ var items = [];
+ items.push({
+ label: ui_strings.M_CONTEXTMENU_ADD_WATCH.replace("%s", selection),
+ handler: function(event, target) {
+ window.views.watches.add_watch(selection);
+ }
+ });
+ return items;
+ }
+ }
+ ], false, ContextMenu.SELECTION);
};
diff --git a/src/ecma-debugger/jssourcetooltip.js b/src/ecma-debugger/jssourcetooltip.js
index b1a7bae01..32137e686 100644
--- a/src/ecma-debugger/jssourcetooltip.js
+++ b/src/ecma-debugger/jssourcetooltip.js
@@ -156,11 +156,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];
@@ -1044,7 +1049,6 @@ cls.JSSourceTooltip = function(view)
if (_poll_interval)
{
clearInterval(_poll_interval);
- _clear_selection();
_tooltip_target_ele.removeEventListener('mousemove', _onmousemove, false);
_poll_interval = 0;
_tooltip_target_ele = null;
@@ -1124,8 +1128,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;
@@ -1148,6 +1154,11 @@ cls.JSSourceTooltip = function(view)
document.addEventListener("mouseup", _onmouseup, false);
};
+ this.get_selection_string = function()
+ {
+ return _last_script_text;
+ };
+
this.unregister = function()
{
Tooltips.unregister(cls.JSSourceTooltip.tooltip_name, _tooltip);
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/runtime_onload_handler.js b/src/ecma-debugger/runtime_onload_handler.js
index 69d60c019..1027dbdb7 100644
--- a/src/ecma-debugger/runtime_onload_handler.js
+++ b/src/ecma-debugger/runtime_onload_handler.js
@@ -15,124 +15,144 @@ 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._error_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, timeout)
{
- 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;
+ }
+ 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 __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)
+ this.is_loaded = function(rt_id)
{
- register(rt_id, callback);
- }
-
- var blocked_rts = {};
+ return this._rts[rt_id] == COMPLETE;
+ };
- 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(this._onload_handlers[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._timeouts = {};
+ 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 fc487c7f3..d8fe4d795 100644
--- a/src/ecma-debugger/runtimes.js
+++ b/src/ecma-debugger/runtimes.js
@@ -50,97 +50,61 @@ 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 _scripts = {};
+ var _replaced_scripts = {};
+ var _selected_runtime_id = "";
+ var _next_runtime_id_to_select = "";
+ 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 = {};
-
- 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)
{
@@ -151,123 +115,95 @@ 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();
- }
+ this._on_reset_state = function()
+ {
+ _runtimes = {};
+ _old_runtimes = {};
+ _runtime_ids = []; // runtime ids
+ _window_ids = {};
+ _windows_reloaded = {};
+ _selected_window = '';
+ _threads = [];
+ _old_selected_window = '';
+ _next_runtime_id_to_select = '';
+ this.setSelectedRuntime();
+ this.setSelectedScript();
+ };
- var _on_profile_disabled = function(msg)
+ this._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 = '';
- current_threads = {};
- updateRuntimeViews();
+ _runtimes = {};
+ _old_runtimes = {};
+ _runtime_ids = []; // runtime ids
+ _window_ids = {};
+ _windows_reloaded = {};
+ _threads = [];
+ _next_runtime_id_to_select = '';
+ _thread_queues = {};
+ this.setSelectedRuntime();
+ this.setSelectedScript();
}
};
- 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)
+ if (_selected_runtime_id == id)
{
- __runtimes_arr.splice(cur, 1);
- }
- /*
- TODO check for existing breakpoints before cleaning up
- for( sc in __scripts )
- {
- if( __scripts[sc].runtime_id == id )
+ this.setSelectedRuntime();
+ if (_runtimes[id] && !_runtimes[id].is_top)
{
- delete __scripts[sc];
- }
- }
- */
- if (__selected_runtime_id == id)
- {
- __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);
- window['cst-selects']['cmd-runtime-select'].updateElement();
- }
+ this.setSelectedRuntime(rt);
}
}
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.
@@ -275,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
@@ -322,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,
@@ -365,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
@@ -401,106 +317,99 @@ 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;
+ runtime.opener_window_id = _selected_window;
}
- if (!debug_context_frame_path)
- {
- debug_context_frame_path = runtime.html_frame_path;
- }
- __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;
+
+ this.setSelectedScript();
}
- else
+
+ 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)
{
- // 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();
- 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)
- {
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 = {};
+
/** 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 ||
@@ -512,35 +421,30 @@ 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)
- {
- __selected_script = new_script_id;
- }
+ this._bps.copy_breakpoints(script, _scripts[sc]);
+ if (_scripts[sc].script_id == _selected_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)
{
- __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;
- views['js_source'].update();
- window['cst-selects']['js-script-select'].updateElement();
- window['cst-selects']['cmd-runtime-select'].updateElement();
+ this.setSelectedScript(new_script_id);
}
}
@@ -567,19 +471,19 @@ 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);
/*
thread.threads = [];
- for( i = 0; key = __runtimes_arr[i]; i++ )
+ for( i = 0; key = _runtime_ids[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]);
}
}
*/
@@ -604,45 +508,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();
}
}
@@ -652,56 +528,45 @@ 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 = '';
- /*
- 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;
- }
- */
- var tag = tagManager.set_callback(null, set_new_debug_context, [win_id]);
- ecma_debugger.requestListRuntimes(tag, [[],1]);
+ _debug_context_frame_path = '';
+ _windows_reloaded = {};
+ this.setSelectedScript();
+ 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;
+ this.setSelectedRuntime();
+ this.setSelectedScript();
}
}
this.getThreads = function()
{
- return __threads;
+ return _threads;
}
this.clearThreadLog = function()
{
- __threads = [];
+ _threads = [];
}
this.onNewScript = function(status, message)
@@ -713,7 +578,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);
}
}
@@ -727,9 +592,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],
@@ -760,20 +625,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);
};
@@ -781,20 +645,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)
@@ -805,23 +669,21 @@ 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)
{
- 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)
{
@@ -829,206 +691,108 @@ 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);
+ };
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)
- {
- 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);
-
- if (message[STATUS] == "cancelled-by-scheduler" && stop_at.is_stopped)
- {
- stop_at.on_thread_cancelled(message);
- }
+ 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 (!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();
- }
+ 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];
if(rt_id)
{
- removeRuntime(rt_id);
- updateRuntimeViews();
+ this._remove_runtime(rt_id);
host_tabs.updateActiveTab();
messages.post('runtime-stopped', {id: rt_id} );
}
@@ -1036,12 +800,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])
@@ -1061,7 +825,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);
@@ -1073,7 +837,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);
@@ -1106,13 +870,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;
@@ -1120,27 +884,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;
}
}
@@ -1150,22 +914,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;
@@ -1173,11 +937,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 '';
@@ -1185,25 +949,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;
}
@@ -1218,9 +982,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 ||
@@ -1232,31 +996,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
@@ -1265,68 +1015,64 @@ 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;
- __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] )
- {
- __runtimes[r]['selected'] = false;
- }
+ if( _runtimes[r] )
+ _runtimes[r]["selected"] = false;
}
}
- }
- // only one script can be selected at a time
- this.setSelectedScript = function( script_id )
- {
- __selected_script = script_id;
- window['cst-selects']['js-script-select'].updateElement();
+ if (!runtime)
+ _selected_runtime_id = "";
+ window.messages.post("runtime-selected", {id: _selected_runtime_id});
+ };
- /*
- 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++)
+ this.setSelectedScript = function(script_id)
+ {
+ if (script_id != _selected_script_id)
{
- script.selected = script.script_id == script_id ;
+ _selected_script_id = script_id || 0;
+ 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()
{
- return __selected_script;
+ return _selected_script_id;
}
this.setSelectedRuntimeId = function(id)
{
- if(__runtimes[id])
- {
- this.setSelectedRuntime(__runtimes[id]);
- // this is not clean
- // views.runtimes.update();
- }
+ if (_runtimes[id])
+ 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 )
@@ -1339,18 +1085,18 @@ 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(window_id)
{
if (!window_id)
- window_id = __selected_window;
+ window_id = _selected_window;
if (window_id)
{
- if (!__windows_reloaded[window_id])
- __windows_reloaded[window_id] = 1;
+ if (!_windows_reloaded[window_id])
+ _windows_reloaded[window_id] = 1;
var rt_id = this.getRuntimeIdsFromWindow(window_id)[0];
if (window.services['ecmascript-debugger'] &&
@@ -1360,7 +1106,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()'];
@@ -1377,7 +1123,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)
@@ -1387,14 +1133,14 @@ cls.EcmascriptDebugger["6.0"].Runtimes = function(service_version)
return win_id ? this.isReloadedWindow(win_id) : false;
};
- this.get_execution_context = function()
+ this.get_execution_context = function(rt_id)
{
var selected_frame = window.stop_at.getSelectedFrame();
- return selected_frame
+ return selected_frame && (!rt_id || selected_frame.runtime_id == rt_id)
? {rt_id: selected_frame.runtime_id,
thread_id: selected_frame.thread_id,
frame_index: selected_frame.index}
- : {rt_id: this.getSelectedRuntimeId(),
+ : {rt_id: rt_id || this.getSelectedRuntimeId(),
thread_id: 0,
frame_index: 0};
};
@@ -1403,9 +1149,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;
}
@@ -1416,7 +1162,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;
@@ -1435,7 +1181,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);
};
@@ -1443,74 +1189,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('reset-state', this._on_reset_state.bind(this));
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.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-disabled', this._on_profile_disabled.bind(this));
+ 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));
+ };
}
-
-
diff --git a/src/ecma-debugger/scriptselect.js b/src/ecma-debugger/scriptselect.js
index c8c91eb55..002afc702 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");
this._setting = null;
this._match_history = [];
this._match_cursor = 0;
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");
+ }
}
}
diff --git a/src/ecma-debugger/templates.js b/src/ecma-debugger/templates.js
index fa0845b10..58d287d88 100644
--- a/src/ecma-debugger/templates.js
+++ b/src/ecma-debugger/templates.js
@@ -280,6 +280,11 @@
script.filename || script.uri,
"data-tooltip", is_linked && "js-script-select",
"data-tooltip-text", is_linked && script.uri]];
+ if (is_linked && script.uri)
+ {
+ ret.push("data-copy", script.uri,
+ "data-copy-label", ui_strings.M_CONTEXTMENU_COPY_URL)
+ }
if (script.search)
ret.push(["span", script.search, "class", "js-dd-scr-query"]);
diff --git a/src/lib/clipboard.js b/src/lib/clipboard.js
new file mode 100644
index 000000000..032347cbe
--- /dev/null
+++ b/src/lib/clipboard.js
@@ -0,0 +1,71 @@
+var Clipboard = function() {};
+
+(function()
+{
+ var _content_editable_ele = null;
+ var _is_supported = false;
+ var _is_copy_action = false;
+
+ /* static methods */
+
+ this.set_string = function(string)
+ {
+ _is_copy_action = true;
+ var listener = _set_string.bind(null, string);
+ document.addEventListener("copy", listener, false);
+ document.execCommand("copy");
+ setTimeout(_remove_listener.bind(null, listener), 0);
+ };
+
+ this.populate_menu = function(event, all_items)
+ {
+ if (!_is_supported)
+ return;
+ var copy_string = event.target.get_ancestor_attr("data-copy");
+ if (copy_string)
+ {
+ var label = event.target.get_ancestor_attr("data-copy-label") || ui_strings.M_CONTEXTMENU_COPY;
+ if (all_items.length)
+ all_items.push(ContextMenu.separator);
+ all_items.push({label: label,
+ handler: this.set_string.bind(this, copy_string),
+ id: "copy-clipboard"});
+ }
+ };
+
+ this.add_listener = function(type, listener, is_capturing)
+ {
+ var wrapped = function(event)
+ {
+ if (!_is_copy_action)
+ listener(event);
+ };
+ document.addEventListener(type, wrapped, Boolean(is_capturing));
+ };
+
+ var _set_string = function(string, event)
+ {
+ event.clipboardData.setData("text/plain", string);
+ event.preventDefault();
+ };
+
+ var _remove_listener = function(listener)
+ {
+ document.removeEventListener("copy", listener, false);
+ _is_copy_action = false;
+ };
+
+ var _test_support = function()
+ {
+ var listener = function(event) { _is_supported = true; };
+ document.addEventListener("copy", listener, false);
+ setTimeout(_remove_listener.bind(null, listener), 0);
+ try { document.execCommand("copy"); } catch(e) {};
+ };
+
+ this.__defineGetter__("is_supported", function() { return _is_supported; });
+ this.__defineSetter__("is_supported", function() { });
+
+ window.addEventListener("load", _test_support, false);
+
+}).apply(Clipboard);
diff --git a/src/network/network_templates.js b/src/network/network_templates.js
index 8b1f0e800..73dbedbce 100644
--- a/src/network/network_templates.js
+++ b/src/network/network_templates.js
@@ -198,6 +198,8 @@ templates.url_list_entry = function(selected, entry)
],
"handler", "select-network-request",
"data-object-id", String(entry.id),
+ "data-copy", entry.url,
+ "data-copy-label", ui_strings.M_CONTEXTMENU_COPY_URL,
"class", (selected === entry.id ? "selected" : "") +
(error_in_current_response ? " " + ERROR_RESPONSE : "") +
(not_requested ? " " + NOT_REQUESTED : "")
diff --git a/src/network/network_view.js b/src/network/network_view.js
index 588e2685a..217fb8a89 100644
--- a/src/network/network_view.js
+++ b/src/network/network_view.js
@@ -417,10 +417,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");
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/repl/commandtransformer.js b/src/repl/commandtransformer.js
index 9b2e27646..7ba7ec114 100644
--- a/src/repl/commandtransformer.js
+++ b/src/repl/commandtransformer.js
@@ -96,6 +96,20 @@ 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; target_token = target_tokens[i]; i++)
+ {
+ if (token_type == target_token[TYPE] && token == target_token[VALUE])
+ matches.push([token_type, token]);
+ }
+ });
+ return matches;
+ };
+
this.transform = function(source)
{
var tokens = [];
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/repl_view.js b/src/repl/repl_view.js
index e4a96bd5e..26dff11f2 100644
--- a/src/repl/repl_view.js
+++ b/src/repl/repl_view.js
@@ -6,6 +6,7 @@
*/
cls.ReplView = function(id, name, container_class, html, default_handler) {
+ ActionHandlerInterface.apply(this);
this._resolver = new cls.PropertyFinder();
this._data = new cls.ReplData(this);
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();
diff --git a/src/shortcutconfig/shortcutconfig.js b/src/shortcutconfig/shortcutconfig.js
index 80bdf65a9..03b11c90b 100644
--- a/src/shortcutconfig/shortcutconfig.js
+++ b/src/shortcutconfig/shortcutconfig.js
@@ -7,6 +7,7 @@
cls.ShortcutConfigView = function(id, name, container_class)
{
+ ActionHandlerInterface.apply(this);
this.init(id, name, container_class);
/* ActionHandler interface */
diff --git a/src/style/css_inspector_actions.js b/src/style/css_inspector_actions.js
index 3fcddae4f..1262a1c98 100644
--- a/src/style/css_inspector_actions.js
+++ b/src/style/css_inspector_actions.js
@@ -6,6 +6,7 @@
*/
cls.CSSInspectorActions = function(id)
{
+ ActionHandlerInterface.apply(this);
this.editor = new Editor(this);
this._es_debugger = window.services['ecmascript-debugger'];
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/actions/actionbroker.js b/src/ui-scripts/actions/actionbroker.js
index 8b03f5c7d..548497f69 100644
--- a/src/ui-scripts/actions/actionbroker.js
+++ b/src/ui-scripts/actions/actionbroker.js
@@ -262,10 +262,22 @@ var ActionBroker = function()
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);
+ Clipboard.add_listener("copy", this._oncopy.bind(this));
window.messages.post('shortcuts-changed');
}.bind(this));
};
+ this._oncopy = function(event)
+ {
+ var selection = this._action_context && this._action_context.get_selection_string();
+ if (selection)
+ {
+ event.preventDefault();
+ Clipboard.set_string(selection);
+ }
+
+ };
+
/* handling of the shortcuts map */
this._retrieve_shortcuts = function()
diff --git a/src/ui-scripts/actions/actionhandlerinterface.js b/src/ui-scripts/actions/actionhandlerinterface.js
index 20133e716..2b32fc7da 100644
--- a/src/ui-scripts/actions/actionhandlerinterface.js
+++ b/src/ui-scripts/actions/actionhandlerinterface.js
@@ -36,6 +36,8 @@
*/
this.onclick = function(event){};
+ this.get_selection_string = function() {};
+
this.handle = function(action_id, event, target)
{
if (action_id in this._handlers)
diff --git a/src/ui-scripts/actions/globalactionhandler.js b/src/ui-scripts/actions/globalactionhandler.js
index 8017dd6f7..8428449dd 100644
--- a/src/ui-scripts/actions/globalactionhandler.js
+++ b/src/ui-scripts/actions/globalactionhandler.js
@@ -1,5 +1,6 @@
var GlobalActionHandler = function(id)
{
+ ActionHandlerInterface.apply(this);
/* interface */
/**
* A view id to identify an action handler.
diff --git a/src/ui-scripts/contextmenu.js b/src/ui-scripts/contextmenu.js
index 563cd19bd..9f3963686 100644
--- a/src/ui-scripts/contextmenu.js
+++ b/src/ui-scripts/contextmenu.js
@@ -27,15 +27,22 @@ function ContextMenu() {
* for showing a checkbox before the item, or 'selected'
* (boolean) for showing the selected item in a group.
*/
- this.register = function(menu_id, item_list, extend)
+ this.register = function(menu_id, item_list, extend, type)
{
+ if (!type)
+ type = ContextMenu.DEFAULT;
+
+ if (!this._registered_menus[type])
+ this._registered_menus[type] = {};
+
+ var registered_menus = this._registered_menus[type];
if (item_list)
{
- if (this._registered_menus[menu_id] && extend)
+ if (registered_menus[menu_id] && extend)
{
- item_list.extend(this._registered_menus[menu_id]);
+ item_list.extend(registered_menus[menu_id]);
}
- this._registered_menus[menu_id] = item_list;
+ registered_menus[menu_id] = item_list;
}
};
@@ -44,7 +51,6 @@ function ContextMenu() {
*/
this.oncontextmenu = function(event)
{
-
var parents = [];
var cur = event.target;
while (cur)
@@ -55,8 +61,6 @@ function ContextMenu() {
Tooltips.handle_contextmenu_event(event);
- CstSelectBase.close_opened_select();
-
if (/*!window.getSelection().isCollapsed ||*/ event.shiftKey) // Shift key overrides for debugging
{
return;
@@ -108,6 +112,19 @@ function ContextMenu() {
var last_found_menu_id = '';
var collected_menus = [];
var items = null;
+ var selection = window.getSelection();
+ var range = Clipboard.is_supported && !selection.isCollapsed && selection.getRangeAt(0);
+ var cur_handler_id = ActionBroker.get_instance().get_current_handler_id();
+ var view = window.views[cur_handler_id];
+ if (view && !view.get_selection_string)
+ {
+ opera.postError(ui_strings.S_DRAGONFLY_INFO_MESSAGE +
+ " action handler without get_selection_string method: " + view_id + ".");
+
+ }
+ var selection_string = (view && view.get_selection_string && view.get_selection_string()) ||
+ (range && range.intersectsNode(ele) && String(selection));
+ var type = selection_string ? ContextMenu.SELECTION : ContextMenu.DEFAULT;
// This traverses up the tree and collects all menus it finds, and
// concatenates them with a separator between each menu. It stops if it
// finds a data-menu attribute with a blank value.
@@ -122,10 +139,10 @@ function ContextMenu() {
if (collected_menus.indexOf(menu_id) == -1) {
collected_menus.push(menu_id);
- var menus = this._registered_menus[menu_id];
+ var menus = this._registered_menus[type][menu_id];
if (menus && menus.length)
{
- var items = this._expand_all_items(menus, event, menu_id);
+ var items = this._expand_all_items(menus, event, menu_id, selection_string);
if (items.length)
{
if (all_items.length)
@@ -137,81 +154,91 @@ function ContextMenu() {
}
ele = ele.parentNode;
}
-
- // This should preferably not be done inside ContextMenu.
- var spec = event.target.get_attr("parent-node-chain", "data-spec");
- if (spec)
+ if (type == ContextMenu.DEFAULT)
{
- var speclinks = SpecLinks.get_instance();
- var specs = speclinks.get_spec_links(spec);
- if (specs.length)
+ // This should preferably not be done inside ContextMenu.
+ var spec = event.target.get_attr("parent-node-chain", "data-spec");
+ if (spec)
{
- items = specs.map(function(spec)
+ var speclinks = SpecLinks.get_instance();
+ var specs = speclinks.get_spec_links(spec);
+ if (specs.length)
{
- return {
- label: ui_strings.M_CONTEXTMENU_SPEC_LINK.replace("%s", spec.prop),
- handler: function(event, target) {
- speclinks.open_spec_link(spec.url);
- },
- id: spec.prop,
- menu_id: "spec"
- };
- });
- this.register("spec", items);
+ items = specs.map(function(spec)
+ {
+ return {
+ label: ui_strings.M_CONTEXTMENU_SPEC_LINK.replace("%s", spec.prop),
+ handler: function(event, target) {
+ speclinks.open_spec_link(spec.url);
+ },
+ id: spec.prop,
+ menu_id: "spec"
+ };
+ });
+ this.register("spec", items);
+
+ if (all_items.length)
+ {
+ all_items.push(ContextMenu.separator);
+ }
+ }
- if (all_items.length)
+ if (items)
{
- all_items.push(ContextMenu.separator);
+ all_items = all_items.concat(items);
}
}
- if (items)
- {
- all_items = all_items.concat(items);
- }
- }
+ Clipboard.populate_menu(event, all_items);
- var res_id_or_url = event.target.get_attr("parent-node-chain", "data-resource-id") ||
- event.target.get_attr("parent-node-chain", "data-resource-url");
- var line_number = event.target.get_attr('parent-node-chain', 'data-resource-line-number');
- if (res_id_or_url)
- {
- if (last_found_menu_id == "dom")
- {
- var rt_id = event.target.get_attr('parent-node-chain', 'rt-id');
- res_id_or_url = helpers.resolveURLS(runtimes.getURI(rt_id), res_id_or_url);
- }
- var broker = cls.ResourceDisplayBroker.get_instance();
- var rid = parseInt(res_id_or_url, 10);
- if (rid)
+ var res_id_or_url = event.target.get_attr("parent-node-chain", "data-resource-id") ||
+ event.target.get_attr("parent-node-chain", "data-resource-url");
+ var line_number = event.target.get_attr('parent-node-chain', 'data-resource-line-number');
+ if (res_id_or_url)
{
- // data-resource-line-number
- var fun = function()
+ if (last_found_menu_id == "dom")
{
- broker.show_resource_for_id(rid, line_number);
+ var rt_id = event.target.get_attr('parent-node-chain', 'rt-id');
+ res_id_or_url = helpers.resolveURLS(runtimes.getURI(rt_id), res_id_or_url);
}
- }
- else
- {
- var fun = function()
+ var broker = cls.ResourceDisplayBroker.get_instance();
+ var rid = parseInt(res_id_or_url, 10);
+ if (rid)
{
- broker.show_resource_for_url(res_id_or_url, line_number);
+ // data-resource-line-number
+ var fun = function()
+ {
+ broker.show_resource_for_id(rid, line_number);
+ }
+ }
+ else
+ {
+ var fun = function()
+ {
+ broker.show_resource_for_url(res_id_or_url, line_number);
+ }
}
- }
-
- if (all_items.length)
- {
- all_items.push(ContextMenu.separator);
- }
- all_items.push(
+ if (all_items.length)
{
- label: ui_strings.M_CONTEXTMENU_SHOW_RESOURCE,
- handler: fun,
- id: res_id_or_url,
- menu_id: "resource"
+ all_items.push(ContextMenu.separator);
}
- )
+
+ all_items.push(
+ {
+ label: ui_strings.M_CONTEXTMENU_SHOW_RESOURCE,
+ handler: fun,
+ id: res_id_or_url,
+ menu_id: "resource"
+ }
+ )
+ }
+ }
+ else if (type == ContextMenu.SELECTION)
+ {
+ all_items.push({label: ui_strings.M_CONTEXTMENU_COPY,
+ handler: Clipboard.set_string.bind(Clipboard, selection_string),
+ id: "copy-clipboard"});
}
this._current_items = all_items;
@@ -297,7 +324,7 @@ function ContextMenu() {
this.is_visible = false;
};
- this._expand_all_items = function(items, event, menu_id)
+ this._expand_all_items = function(items, event, menu_id, selection)
{
var all_items = [];
@@ -305,7 +332,7 @@ function ContextMenu() {
{
if (typeof item.callback == "function")
{
- var callback_items = item.callback(event, event.target);
+ var callback_items = item.callback(event, event.target, selection);
if (callback_items)
{
all_items = all_items.concat(callback_items);
@@ -384,3 +411,6 @@ ContextMenu.get_instance = function()
};
ContextMenu.separator = {separator: true};
+ContextMenu.DEFAULT = 0;
+ContextMenu.SELECTION = 1;
+
diff --git a/src/ui-scripts/cst-select.js b/src/ui-scripts/cst-select.js
index cb1335be3..1a8065c6f 100644
--- a/src/ui-scripts/cst-select.js
+++ b/src/ui-scripts/cst-select.js
@@ -50,6 +50,7 @@
var _modal_box = null;
var _select_obj = null;
var self = this;
+ var RIGHT_CLICK = 3;
var modal_mousedown_handler = function(event)
{
@@ -83,6 +84,13 @@
event.target.type == "text"))
return;
+ if (event.which == RIGHT_CLICK)
+ {
+ if (window.Tooltips)
+ window.Tooltips.hide_tooltip();
+ return;
+ }
+
event.stopPropagation();
event.preventDefault();
while (ele != _modal_box && (ele = ele.parentElement));
@@ -118,6 +126,7 @@
}
self.remove_select();
+ ContextMenu.get_instance().dismiss();
if (window.Tooltips)
window.Tooltips.hide_tooltip();
}
diff --git a/src/ui-scripts/editor.js b/src/ui-scripts/editor.js
index 5ef0de4a0..98750b282 100644
--- a/src/ui-scripts/editor.js
+++ b/src/ui-scripts/editor.js
@@ -61,7 +61,7 @@ var BaseEditor = new function()
this.textarea = this.textarea_container.
appendChild(document.createElement('textarea'));
this.textarea.style.cssText = cssText;
- this.textarea.oninput = this.getInputHandler();
+ this.textarea.addEventListener("input", this.getInputHandler(), false);
}
this.__is_active = function(){return false};
this.__defineGetter__("is_active", function(){return this.__is_active()});
diff --git a/src/ui-scripts/sortable_table/sortable_table.js b/src/ui-scripts/sortable_table/sortable_table.js
index f1d27b55f..62c7eddaa 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 22a11aac6..ead85b319 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()
@@ -10,9 +13,28 @@ 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
+ 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
+ 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);
};
Tooltip.prototype = new function()
@@ -63,11 +85,34 @@ 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 || "";
+ 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
+ {
+ 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 = "";
+ this.preferred_position = "bottom";
+ this.type = Tooltips.TYPE_SIMPLE
+ }
}
/* implementation */
@@ -98,6 +143,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;
@@ -278,6 +325,12 @@ Tooltips.CSS_TOOLTIP_SELECTED = "tooltip-selected";
_cur_ctx.tooltip_ele.innerHTML = "";
+ 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,
@@ -307,80 +360,122 @@ 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)
- {
- 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
+ if (box.bottom - box.top < _window_height / 3 ||
+ Math.max(box.left, _window_width - box.right) < _window_height / 3)
{
- 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 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";
+ }
- 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";
+ // 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";
+ }
}
-
}
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 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)
{
- 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";
+ distance_x = DISTANCE_X;
+ distance_y = DISTANCE_Y;
}
-
- if (box.mouse_y < _window_height / 2)
+ // positioning horizontally
+ if (tooltip.preferred_position == "bottom" &&
+ _window_height - box.bottom > tooltip_height + distance_y)
{
- var top = box.mouse_y + DISTANCE_Y;
+ 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.mouse_y - DISTANCE_Y;
- _cur_ctx.tooltip_ele.style.bottom = bottom + "px";
+ var bottom = _window_height - box.top + distance_y;
_cur_ctx.tooltip_ele.style.top = "auto";
- max_h = box.mouse_y - MARGIN_Y - _padding_height;
- max_height_target.style.maxHeight = max_h + "px";
+ _cur_ctx.tooltip_ele.style.bottom = bottom + "px";
+ }
+ // positioning vertically
+ if (_window_width - box.mouse_x > tooltip_width + distance_x)
+ {
+ 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 = _window_width - box.mouse_x + distance_x;
+ _cur_ctx.tooltip_ele.style.left = "auto";
+ _cur_ctx.tooltip_ele.style.right = right + "px";
}
}
}
@@ -410,7 +505,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;
@@ -433,7 +527,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)
{
@@ -443,11 +537,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-scripts/view.js b/src/ui-scripts/view.js
index 1a0c57dbe..4f7517920 100644
--- a/src/ui-scripts/view.js
+++ b/src/ui-scripts/view.js
@@ -255,6 +255,11 @@ var ViewBase = new function()
}
+ this.get_selection_string = function()
+ {
+
+ };
+
var onHideView = function(msg)
{
var view = window.views[msg.id];
diff --git a/src/ui-strings/ui_strings-en.js b/src/ui-strings/ui_strings-en.js
index 215b8b142..d670f2178 100644
--- a/src/ui-strings/ui_strings-en.js
+++ b/src/ui-strings/ui_strings-en.js
@@ -45,6 +45,24 @@ 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: Generic context menu item to copy something. */
+ui_strings.M_CONTEXTMENU_COPY = "Copy";
+
+/* DESC: Context menu item to copy content, e.g of a file. */
+ui_strings.M_CONTEXTMENU_COPY_CONTENT = "Copy content";
+
+/* DESC: Context menu item to copy the CSS path. */
+ui_strings.M_CONTEXTMENU_COPY_CSS_PATH = "Copy CSS path";
+
+/* DESC: Context menu item to copy the markup. */
+ui_strings.M_CONTEXTMENU_COPY_MARKUP = "Copy markup";
+
+/* DESC: Context menu item to copy a URL. */
+ui_strings.M_CONTEXTMENU_COPY_URL = "Copy URL";
+
+/* DESC: Context menu item to copy the XPath expression. */
+ui_strings.M_CONTEXTMENU_COPY_XPATH = "Copy XPath";
+
/* DESC: Context menu item, general "Delete" in a context, e.g. a breakpoint */
ui_strings.M_CONTEXTMENU_DELETE = "Delete";
@@ -915,9 +933,6 @@ 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.";
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 c51ab7223..4ca45ae52 100644
--- a/src/ui-style/ui.css
+++ b/src/ui-style/ui.css
@@ -1,1853 +1,1848 @@
-/* Font stack defaults */
-viewport,
-.info-box,
-.ui-button,
-.ui-font
-{
- font-family: sans-serif;
- font: menu;
- font-style: normal;
- font-variant: normal;
- font-weight: 400;
- font-size: 11px;
- line-height: normal;
- color: #444;
-}
-
-.mono
-{
- font-family: "Menlo", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Consolas", "Monaco", "Lucida Console", monospace;
- font-size: 11px;
- line-height: 15px;
- color: #111;
-}
-
-textarea,
-input,
-code,
-pre
-{
- font: inherit;
-}
-
-/* UI Style */
-viewport
-{
- width: 100%;
- height: 100%;
- display: block;
- overflow: hidden;
- cursor: default;
-}
-
-main-view {
- width: 100%;
- display: block;
-}
-
-windows-container,
-toolbar,
-modebar,
-searchbar,
-tabs,
-container,
-top-tabs,
-top-container {
- position: absolute;
-}
-
-panel-container {
- width: 100%;
- display: block;
- /* not sure if this is needed
- so far any container was positioned absolute */
- position: relative;
-}
-
-container,
-top-tabs,
-tabs,
-modebar,
-searchbar,
-toolbar,
-panel-toolbar,
-window-toolbar,
-.js-dd-filter-bar
-{
- border: 0 solid #999;
-}
-
-top-tabs,
-tabs
-{
- border-bottom-width: 1px;
-}
-
-modebar
-{
- border-top-width: 1px;
-}
-
-top-container
-{
- background-color: #e6e6e6;
-}
-
-container
-{
- border-width: 0 1px;
- background-color: #fefefe;
- overflow: hidden;
-}
-
-window-statusbar
-{
- display: block;
- background: #e6e6e6 url('../ui-images/window-dragger.png') no-repeat 100% 100%;
- line-height: 20px;
- height: 20px;
-}
-
-window-toolbar
-{
- display: block;
-}
-
-toolbar,
-panel-toolbar,
-window-toolbar,
-.js-dd-filter-bar,
-.disabled-toolbar-overlay
-{
- border-width: 0 1px 1px;
- padding: 3px 2px;
- height: 21px; /* 21 + 3 + 3 (padding) = 27 */
- background-color: #e9e9e9;
- background-image: -o-linear-gradient(-90deg,
- rgba(255, 255, 255, 0.85) 0,
- rgba(255, 255, 255, 0.25) 100%);
- background-image: linear-gradient(rgba(255, 255, 255, 0.85) 0,
- rgba(255, 255, 255, 0.25) 100%);
-}
-
-.disabled-toolbar-overlay
-{
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
- opacity: 0.7;
- padding: 0;
-}
-
-panel-toolbar
-{
- display: block;
- border-width: 0 0 1px 0;
- background-color: #e9e9e9;
- background-image: -o-linear-gradient(-90deg,
- rgba(255, 255, 255, 0.55) 0,
- rgba(255, 255, 255, 0.25) 100%);
- background-image: linear-gradient(rgba(255, 255, 255, 0.55) 0,
- rgba(255, 255, 255, 0.25) 100%);
- border-color: #bfbfbf;
- box-shadow: inset 0 0 0 1px rgba(255,255,255,0.35),
- inset 0 1px 1px 0 rgba(255, 255, 255,0.9);
-}
-
-toolbar-buttons
-{
- display: block;
- float: left;
- height: 100%;
- padding: 0 4px;
-}
-
-/* Pop-ups */
-cst-select-option-list,
-#contextmenu,
-.tooltip-container,
-.error-description
-{
- background-color: #ededed;
- background-image: -o-linear-gradient(-90deg,
- rgba(255, 255, 255, 0.25) 0,
- transparent 25px);
- background-image: linear-gradient(rgba(255, 255, 255, 0.25) 0,
- transparent 25px);
- border-radius: 4px;
- padding: 8px;
- box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.9),
- 0 1px 6px 0 rgba(0, 0, 0, 0.45),
- 0 0 1px 1px rgba(0, 0, 0, 0.3);
- color: #333;
-}
-
-.reload-window::before
-{
- background-image: url("../ui-images/icons/icon_reload.png");
-}
-
-
-/* Window control buttons */
-
-#toggle-console::before
-{
- background-image: url("../ui-images/icons/icon_console.png");
-}
-
-#toggle-settings-overlay::before
-{
- background-image: url("../ui-images/icons/icon_settings.png");
-}
-
-#toggle-remote-debug-overlay::before
-{
- background-image: url("../ui-images/icons/icon_remote.png");
-}
-
-#toggle-remote-debug-overlay.remote-active::before
-{
- background-image: url("../ui-images/icons/icon_remote_active.png");
-}
-
-#toggle-remote-debug-overlay.alert::before
-{
- background-image: url("../ui-images/icons/icon_remote_alert.png");
-}
-
-#top-window-toggle-attach::before
-{
- background-image: url("../ui-images/icons/icon_attach.png");
-}
-
-#top-window-toggle-attach.attached::before
-{
- background-image: url("../ui-images/icons/icon_detach.png");
-}
-
-#top-window-close::before
-{
- background-image: url("../ui-images/icons/icon_close.png");
-}
-
-/* View buttons */
-.search::before
-{
- background-image: url("../ui-images/icons/icon_search.png");
-}
-
-.dom-inspection-snapshot::before
-{
- background-image: url("../ui-images/icons/icon_expand.png");
-}
-
-.dom-inspection-export::before
-{
- background-image: url("../ui-images/icons/icon_export.png");
-}
-
-.dom\.find-with-click::before
-{
- background-image: url("../ui-images/icons/icon_click.png");
-}
-
-.dom\.highlight-on-hover::before
-{
- background-image: url("../ui-images/icons/icon_hover.png");
-}
-
-.dom\.update-on-dom-node-inserted::before
-{
- background-image: url("../ui-images/icons/icon_update_on_delete.png");
-}
-
-.dom\.lock-selected-elements::before
-{
- background-image: url("../ui-images/icons/icon_border.png");
-}
-
-.stylesheets.shortcuts::before
-{
- background-image: url("../ui-images/icons/icon_shorthand.png");
-}
-
-.css-comp-style\.show-initial-values::before
-{
- background-image: url("../ui-images/icons/icon_hidedefaults.png");
-}
-
-.css-inspector.hide-shorthands::before
-{
- background-image: url("../ui-images/icons/icon_shorthand.png");
-}
-
-.dom_attrs.hide-null-values::before
-{
- background-image: url("../ui-images/icons/icon_empty.png");
-}
-
-#continue-run::before
-{
- background-image: url("../ui-images/icons/icon_play.png");
-}
-
-#continue-step-into-call::before
-{
- background-image: url("../ui-images/icons/icon_stepinto.png");
-}
-
-#continue-step-next-line::before
-{
- background-image: url("../ui-images/icons/icon_stepover.png");
-}
-
-#continue-step-out-of-call::before
-{
- background-image: url("../ui-images/icons/icon_stepout.png");
-}
-
-.js_source\.script::before
-{
- background-image: url("../ui-images/icons/icon_haltonscript.png");
-}
-
-.js_source\.error::before
-{
- background-image: url("../ui-images/icons/icon_haltonerror.png");
-}
-
-.js_source\.reformat_javascript::before
-{
- background-image: url("../ui-images/icons/icon_reformat.png");
-}
-
-.threads\.log-threads::before
-{
- background-image: url("../ui-images/icons/icon_threads.png");
-}
-
-.inspection\.show-prototypes::before
-{
- background-image: url("../ui-images/icons/icon_prototype.png");
-}
-
-.inspection\.show-non-enumerables::before
-{
- background-image: url("../ui-images/icons/icon_hidedefaults.png"); /* temporarily using this icon */
-}
-
-.inspection\.show-default-nulls-and-empty-strings::before
-{
- background-image: url("../ui-images/icons/icon_empty.png");
-}
-
-.threads-clear-log::before
-{
- background-image: url("../ui-images/icons/icon_clear.png");
-}
-
-.threads-export-log::before
-{
- background-image: url("../ui-images/icons/icon_export.png");
-}
-
-.clear-request-list::before
-{
- background-image: url("../ui-images/icons/icon_clear.png");
-}
-
-.clear-log-network-view::before
-{
- background-image: url("../ui-images/icons/icon_clear.png");
-}
-
-.network-view-toggle-graphs:before
-{
- background-image: url("../ui-images/icons/icon_graph.png");
-}
-
-.network-view-toggle-data:before
-{
- background-image: url("../ui-images/icons/icon_table.png");
-}
-
-
-.request_list\.clear-log-on-runtime-switch::before
-{
- background-image: url("../ui-images/icons/icon_clearonreload.png");
-}
-
-.request_list\.auto-scroll-request-list::before
-{
- background-image: url("../ui-images/icons/icon_autoscroll.png");
-}
-
-.update-ev-listeners::before
-{
- background-image: url("../ui-images/icons/icon_refetch_listeners.png");
-}
-
-.close-overlay-view::before
-{
- background-image: url("../ui-images/icons/icon_close.png");
-}
-
-.storage-delete
-{
- background-image: url("../ui-images/icons/icon_clear.png");
- content: "";
- display: inline-block;
- width: 17px;
- height: 17px;
-}
-
-.clear-log::before
-{
- background-image: url("../ui-images/icons/icon_clear.png");
-}
-
-.console\.expand-all-entries::before
-{
- background-image: url("../ui-images/icons/icon_expand.png");
-}
-
-.disable-all-breakpoints::before,
-.ev-brp-remove-all-breakpoints::before
-{
- background-image: url("../ui-images/icons/icon_disable.png");
-}
-
-.delete-all-breakpoints::before
-{
- background-image: url("../ui-images/icons/icon_clear.png");
-}
-
-.ev-brp-expand-all-sections::before
-{
- background-image: url("../ui-images/icons/icon_expand.png");
-}
-
-.network_logger\.pause::before
-{
- background-image: url("../ui-images/icons/icon_pause.png");
-}
-
-.network_logger\.network-profiler-mode::before
-{
- background-image: url("../ui-images/icons/icon_network_profiler.png");
-}
-
-.profiler-start-stop::before
-{
- background-image: url("../ui-images/icons/icon_record.png");
-}
-
-.profiler_all\.zero-at-first-event::before
-{
- background-image: url("../ui-images/icons/icon_zero_at_first_event.png");
-}
-
-.pseudo-items cst-icon
-{
- background-image: url("../ui-images/icons/icon_hidedefaults.png");
-}
-
-cst-icon[class="debugger-menu"]
-{
- background-image: url("../ui-images/icons/icon_tabs.png");
-}
-
-
-/* Buttons */
-
-.ui-control,
-.ui-button
-{
- background: #e6e6e6 repeat-x -o-linear-gradient(-90deg,
- rgba(255, 255, 255, 0.75) 0,
- rgba(255, 255, 255, 0.25) 100%);
- background: #e6e6e6 repeat-x linear-gradient(rgba(255, 255, 255, 0.75) 0,
- rgba(255, 255, 255, 0.25) 100%);
- border-radius: 3px;
- line-height: 19px;
- margin: 0 3px;
- padding: 1px 11px;
- box-sizing: content-box;
- display: inline-block;
- box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.45),
- inset 0 0 0 2px rgba(255, 255, 255, 0.55);
- vertical-align: middle;
- -o-transition: background-color 0.2s;
- transition: background-color 0.2s;
-}
-
-.ui-control[disabled],
-.ui-button[disabled]
-{ /* :disabled seems to be buggy */
- opacity: 0.45;
-}
-
-.ui-control:not([disabled]):active,
-.ui-button:not([disabled]):active,
-toolbar-buttons .is-active
-{
- background-color: #c6c6c6;
- background-image: -o-linear-gradient(-90deg,
- rgba(255, 255, 255, 0.45) 0,
- rgba(255, 255, 255, 0.25) 100%);
- background-image: linear-gradient(rgba(255, 255, 255, 0.45) 0,
- rgba(255, 255, 255, 0.25) 100%);
- box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3),
- inset 0 1px 3px rgba(0, 0, 0, 0.35);
-}
-
-
-/* Buttons with icons */
-
-.ui-button:empty::before
-{
- content: "";
- display: block;
- height: 19px;
- width: 19px;
- background-position: 50%;
- background-repeat: no-repeat;
-}
-
-
-/* Toolbar buttons */
-
-toolbar .ui-button,
-toolbar .ui-control,
-panel-toolbar .ui-button,
-panel-toolbar .ui-control,
-window-controls .ui-button,
-window-controls .ui-control
-{
- box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35),
- inset 0 2px 0 0 rgba(255, 255, 255, 0.55),
- 0 1px rgba(255, 255, 255, 0.6);
-}
-
-toolbar .ui-button:not([disabled]):active,
-toolbar .ui-control:not([disabled]):active,
-panel-toolbar .ui-button:not([disabled]):active,
-panel-toolbar .ui-control:not([disabled]):active,
-window-controls .ui-button:not([disabled]):active,
-window-controls .ui-control:not([disabled]):active,
-toolbar-buttons .is-active,
-window-controls .is-active
-{
- box-shadow: 0 1px rgba(255, 255, 255, 0.6),
- inset 0 0 0 1px rgba(0, 0, 0, 0.15),
- inset 0 0 2px rgba(0, 0, 0, 0.25),
- inset 0 1px 4px rgba(0, 0, 0, 0.35);
-}
-
-toolbar .ui-button:empty,
-panel-toolbar .ui-button:empty,
-.advanced-search .ui-button,
-window-controls .ui-button,
-.ui-control /* cst-select needs to be tweaked before changing this */
-{
- padding-left: 5px;
- padding-right: 5px;
-}
-
-
-/* Grouping the toolbar buttons */
-
-/* All Buttons in a group*/
-toolbar-buttons .ui-button,
-#toggle-settings-overlay,
-#toggle-remote-debug-overlay,
-#top-window-toggle-attach.attached,
-#top-window-close,
-.advanced-search .ui-button
-{
- border-radius: 0;
- margin: 0 -1px 0 0;
-}
-
-/* Leftmost Button*/
-toolbar-buttons .ui-button:first-of-type,
-#toggle-settings-overlay,
-#top-window-toggle-attach.attached
-{
- border-top-left-radius: 3px;
- border-bottom-left-radius: 3px;
-}
-
-#toggle-settings-overlay,
-#top-window-toggle-attach.attached
-{
- margin-left: 3px;
-}
-
-/* Rightmost Button*/
-toolbar-buttons .ui-button:last-of-type,
-#toggle-remote-debug-overlay,
-#top-window-close,
-.advanced-search .search-move-highlight-down
-{
- border-top-right-radius: 3px;
- border-bottom-right-radius: 3px;
-}
-
-#toggle-remote-debug-overlay,
-#top-window-close
-{
- margin-right: 3px;
-}
-
-/* Show the button topmost when the overlay is visible */
-#toggle-settings-overlay.is-active,
-#toggle-remote-debug-overlay.is-active
-{
- position: relative;
- z-index: 301;
- box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.5),
- inset 0 1px 3px rgba(0, 0, 0, 0.5);
-}
-
-
-/* Alert state */
-.ui-control.alert
-{
- background-color: #ff8040;
- border-color: #bf3000;
- color: #993d1f;
- box-shadow: inset 0 0 1px #fff,
- inset 0 0 10px #ff4433,
- 0 1px rgba(255, 255, 255, 0.5),
- 0 0 2px #ff0000;
-}
-
-.ui-control.alert:not([disabled]):active
-{
- background-color: #ff8040;
- border-color: #bf3000;
- box-shadow: inset 0 1px 2px #bf1000,
- inset 0 0 10px #ff4433,
- 0 1px rgba(255, 255, 255, 0.5),
- 0 0 2px #ff0000;
-}
-
-.ui-control.alert.is-active
-{
- background-color: #e54c2e;
- border-color: #bf3000;
- box-shadow: inset 0 1px 2px #bf1000,
- inset 0 0 10px #ff4433,
- 0 1px rgba(255, 255, 255, 0.5),
- 0 0 2px #ff0000;
-}
-
-.ui-control.alert.is-active:active
-{
- background-color: #bf381d;
-}
-
-#toggle-settings-overlay.alert.is-active,
-#toggle-remote-debug-overlay.alert.is-active,
-#toggle-settings-overlay.alert.is-active:active,
-#toggle-remote-debug-overlay.alert.is-active:active
-{
- border-color: #721;
- box-shadow: inset 0 1px 2px #bf1000,
- inset 0 0 10px #ff4433,
- 0 1px rgba(255, 255, 255, 0.2),
- 0 0 4px #ff0000;
-}
-
-.ui-control.dropdown,
-cst-select[cst-id="debugger-menu"]
-{
- width: 28px;
-}
-
-cst-icon
-{
- vertical-align: middle;
- display: inline-block;
- height: 100%;
- width: 17px;
- height: 17px;
-}
-
-toolbar-filters,
-toolbar-search
-{
- display: block;
- float: right;
-}
-
-filter,
-.advanced-search,
-.js-dd-filter-container,
-.color-picker-number,
-.color-picker-text
-{
- margin: 0 2px;
- padding-left: 20px;
- height: 19px;
- line-height: 19px;
- border: 1px solid #8e8e8e;
- border-radius: 3px;
- box-shadow: 0 1px #fff,
- inset 0 1px 1px #d5d5d5;
-}
-
-filter,
-.advanced-search,
-.js-dd-filter-container
-{
- background: #fff url("../ui-images/icon_search.png") 2px 50% no-repeat;
-}
-
-
-filter
-{
- display: inline-block;
-}
-
-filter.filter,
-.js-dd-filter-container
-{
- background-image: url("../ui-images/filter.png");
- background-position: 5px 50%;
-}
-
-filter input
-{
- width: 138px;
- height: 19px;
- background: none;
- border: none;
- padding: 0;
- padding-right: 2px;
- color: #666;
-}
-
-toolbar-filters filter.focus input
-{
- color: #000;
-}
-
-modebar
-{
- height: 21px;
- line-height: 21px;
- background: #d7d7d7;
-}
-
-modebar.hidden
-{
- display: none;
-}
-
-searchbar
-{
- border-top: none;
- border-width: 0 1px 1px;
- padding: 3px;
- height: 21px; /* 21 + 3 + 2 (padding) = 26 */
- line-height: 21px;
- background: #eee;
-}
-
-.advanced-searchbar
-{
- height: 43px;
-}
-
-window-select
-{
- position: relative;
- padding: 2px 0;
-}
-
-window-select select
-{
- width: 100%;
- max-width: 400px;
- margin:0;
- height: 22px;
-}
-
-window-select select option[value="-1"]
-{
- color: #999;
-}
-
-window-controls
-{
- display: block;
- position: absolute;
- top: 0;
- right: 0;
- padding: 5px 3px 3px 4px;
- height: 22px;
-}
-
-window-controls:not(.no-tabbar)
-{
- background-color: #f3f3f3;
- background-image: -o-linear-gradient(-90deg,
- rgba(255, 255, 255, 0.75) 0,
- rgba(255, 255, 255, 0.25) 100%),
- -o-linear-gradient(-90deg,
- rgba(0, 0, 0, 0.05) 0,
- rgba(0, 0, 0, 0.3) 70%),
- -o-linear-gradient(-90deg,
- rgba(255, 255, 255, 0.1) 0,
- rgba(255, 255, 255, 0.6) 70%);
- background-image: linear-gradient(rgba(255, 255, 255, 0.75) 0,
- rgba(255, 255, 255, 0.25) 100%),
- linear-gradient(rgba(0, 0, 0, 0.05) 0,
- rgba(0, 0, 0, 0.3) 70%),
- linear-gradient(rgba(255, 255, 255, 0.1) 0,
- rgba(255, 255, 255, 0.6) 70%);
- background-size: 100% 100%, 1px 100%, 1px 100%;
- background-repeat: repeat, repeat-y, repeat-y;
- background-position: left top, left top, 1px top;
-}
-
-window-controls.no-tabbar
-{
- z-index: 2;
-}
-
-.default-container
-{
- padding: 7px;
-}
-
-settings-container,
-settings,
-settings-header,
-checkboxes,
-checkbox,
-setting-composite
-{
- display: block;
-}
-
-settings-container label
-{
- display: block;
-}
-
-settings-container input {
- margin-left: 0;
- margin-right: 5px;
-}
-
-settings
-{
- margin: 12px 0;
- padding: 3px 0;
-}
-
-settings-header
-{
- font-size: 1.2em;
- clear: both;
-}
-
-setting-composite select
-{
- padding: 0;
- margin: 0;
- height: 2em;
- vertical-align: middle;
-}
-
-setting-buttons {
- text-align: right;
- padding-right: 26px;
-}
-
-settings-container { /**/
- padding: 0 8px 8px;
-}
-
-settings hr
-{
- border: 1px dotted #333;
- margin: 9px 26px;
-}
-
-.change-ui-lang-info
-{
- padding: 7px 0;
-}
-
-.change-ui-lang-info a
-{
- color: inherit;
-}
-
-.change-ui-lang-info ul
-{
- margin-top: 5px;
-}
-
-view-slider
-{
- display: block;
- position: absolute;
-}
-
-view-slider.vertical
-{
- cursor: col-resize;
-}
-
-view-slider.horizontal
-{
- cursor: row-resize;
- border-top: 1px solid #b3b3b3;
-}
-
-ui-menu
-{
- display: block;
- width: 180px;
- position: absolute;
- right:30px;
- top: 0;
- z-index:10;
- right: 200px;
-}
-
-ui-menu > h2
-{
- padding-left: 10px;
- font-weight: normal;
- font-size: 11px;
- background: #fff;
- width: 170px;
- height: 18px;
- line-height: 14px;
- border: 1px solid #000;
- border-top-width: 0;
-}
-
-ui-menu ul
-{ /* The list needs a bottom shadow when opened */
- position: absolute;
- right: 9px;
- top: 18px;
- margin: 0;
- padding: 0;
- list-style: none;
- background: #fff;
- border: 1px solid #000;
- border-top-width: 0;
-}
-
-ui-menu li
-{
- padding: 0;
- margin-right: 6px;
- padding-left: 10px;
- width: 155px;
-}
-
-ui-menu li h2 {
- padding: 0;
- margin: 0;
- width: 165px;
- height: 22px;
- line-height: 22px;
- font-weight: normal;
- font-size: 12px;
- white-space: nowrap;
-}
-
-ui-menu ul li:hover
-{
- background: #eee;
-}
-
-window-control {
- display: block;
- position: absolute;
- cursor: default;
-}
-
-window-header
-{
- display: block;
- font-weight: bold;
- text-shadow: 0 1px 1px #000;
- height: 21px;
- line-height: 21px;
- padding-left: 5px;
- background: rgba(255, 255, 255, 0.1);
- border-radius: 3px 3px 0 0;
- border-top: 1px solid rgba(255, 255, 255, 0.2);
- border-bottom: 1px solid rgba(0, 0, 0, 0.4);
-}
-
-windows-container .window-move
-{
- cursor: move;
-}
-
-windows-container .window-close
-{
- float: right;
- width: 17px;
- height: 17px;
- position: relative;
- top: 4px;
- right: 1px;
- background: transparent url('../ui-images/icons/hud_close.png') scroll no-repeat 0 0;
- z-index: 11;
-}
-
-windows-container .window-close:active
-{
- background-position: 0 1px;
-}
-
-windows-container .window-scale-top-left
-{
- left: -5px;
- top: -5px;
- width: 10px;
- height: 10px;
- cursor: nw-resize;
-}
-
-windows-container .window-scale-top
-{
- left: 5px;
- right: 5px;
- top: -5px;
- height: 10px;
- cursor: n-resize;
-}
-
-windows-container .window-scale-top-right
-{
- right: -5px;
- width: 10px;
- height: 10px;
- top: -5px;
- cursor: ne-resize;
-}
-
-windows-container .window-scale-right
-{
- right: -5px;
- width: 10px;
- top: 5px;
- bottom: 5px;
- cursor: e-resize;
-}
-
-windows-container .window-scale-left
-{
- left: -5px;
- width: 10px;
- top: 5px;
- bottom: 5px;
- cursor: w-resize;
-}
-
-windows-container .window-scale-bottom
-{
- left: 0;
- bottom: -5px;
- height: 10px;
- right: 5px;
- cursor: s-resize;
-}
-
-windows-container .window-scale-bottom-right
-{
- bottom: -5px;
- height: 10px;
- width: 10px;
- right: -5px;
- cursor: se-resize;
-}
-
-windows-container .window-scale-bottom-left
-{
- bottom: -5px;
- height: 10px;
- width: 10px;
- left: -5px;
- cursor: sw-resize;
-}
-
-windows-container
-{
- width: 100%;
- height: 100%;
- display: block;
- overflow: hidden;
-}
-
-window
-{
- display: block;
- position: absolute;
- height: 300px;
- left: 20px;
- color: #fff;
- border-radius: 3px;
- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
- border: 1px solid rgba(0, 0, 0, 0.3);
- background: rgba(50, 50, 50, 0.9);
- background-size: auto 100%;
-}
-
-/* clear painting artefacts on moving the window */
-window:after
-{
- content: "";
- display: block;
- top: 100%;
- left: 0;
- height: 10px;
- width: 100%;
-}
-
-window-container
-{
- /* border: 1px solid #000; <-- TODO: Do we need this */
- border-width: 0 1px 1px;
- display: block;
- position: relative;
- background-color: rgba(0, 0, 0, 0.4);
- width: 100%;
-}
-
-window.hud
-{
- border-width: 0;
- border-top-width: 2px;
- border-radius: 0;
- background: rgba(0, 0, 0, 0.75);
-}
-
-window.hud window-container
-{
- border-radius: 0;
- border: 0;
-}
-
-.hud window-toolbar,
-.hud .disabled-toolbar-overlay
-{
- background-color: #000;
- background-image: -o-linear-gradient(-90deg,
- rgba(255, 255, 255, 0.25) 0,
- rgba(255, 255, 255, 0.15) 100%);
- background-image: linear-gradient(rgba(255, 255, 255, 0.25) 0,
- rgba(255, 255, 255, 0.15) 100%);
- border: 0;
- border-bottom: 1px solid rgba(0, 0, 0, 0.65);
- padding-bottom: 3px;
-}
-
-.hud window-toolbar
-{
- position: relative;
-}
-
-.hud .disabled-toolbar-overlay
-{
- padding: 3px 2px;
- margin: -3px -2px;
-}
-
-.hud cst-select cst-value
-{
- text-shadow: none;
-}
-
-.hud .window-scale-top
-{
- cursor: row-resize;
-}
-
-/* editing */
-textarea
-{
- resize: none;
-}
-
-textarea-container
-{
- display: block;
- padding: 1px;
- margin: -2px -4px -2px -2px;
- position:relative;
- z-index: 10;
- background: #fff;
- border: 1px solid #808080;
- box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
-}
-
-textarea-container,
-textarea-container-inline,
-textarea
-{
- border-radius: 3px;
-}
-
-textarea-container textarea
-{
- display: block;
- width: 100%;
- border: none;
- margin: 0;
- padding: 0;
- vertical-align: text-top;
- overflow: hidden;
-}
-
-textarea-container-inline
-{
- display: inline-block;
- padding: 1px;
- margin: -2px -3px -5px;
- position:relative;
- z-index: 10;
- background: #fff;
- border: 1px solid #808080;
- box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
- box-decoration-break: clone;
-}
-
-textarea-container-inline textarea
-{
- border: none;
- margin: 0;
- padding: 0 1px;
- vertical-align: text-top;
- overflow: hidden;
- height: 0;
-}
-
-cst-select-toolbar-setting
-{
- float: left;
-}
-
-cst-value
-{
- display: inline-block;
- overflow: hidden;
- padding: 0 4px;
- height: 19px;
- line-height: 19px;
- white-space: nowrap;
- text-overflow: ellipsis;
- vertical-align: top;
- width: 95%; /* TODO: this is ugly, might push down the dropdown */
- box-sizing: border-box;
-}
-
-cst-drop-down
-{
- display: block;
- width: 7px;
- height: 19px;
- background: transparent url("../ui-images/dropdown.png") 50% 50% no-repeat;
- float: right;
- position: relative;
-}
-
-.hud cst-drop-down
-{
- background: transparent url("../ui-images/dropdown_white.png") 50% 50% no-repeat;
-}
-
-cst-select cst-value
-{
- text-shadow: 0 1px rgba(255, 255, 255, 0.5);
-}
-
-cst-select[disabled]
-{
- background-color: #ccc !important;
-}
-
-cst-select-option-list-container
-{
- /* don't add here any border, padding or margin */
- display: block;
- position:absolute;
- z-index: 150;
- border: 1px solid transparent;
-}
-
-.cmd-line-runtimes
-{
- z-index: 302;
-}
-
-cst-select[disabled] cst-drop-down
-{
- opacity: 0.3;
-}
-
-cst-select-option-list
-{
- display: block;
- background-color: #fcfcfc;
- max-height: 200px;
- overflow: auto;
- width: auto;
- padding-left: 0px;
- padding-right: 0px;
- box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.35),
- 0 0 1px 1px rgba(90, 90, 90, 0.35);
-}
-
-cst-option,
-cst-title
-{
- display: block;
- padding: 2px 8px;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-
-cst-select-option-list hr
-{
- margin: 4px 0;
- padding: 0;
- height: 1px;
- border: none;
- background-color: #ccc;
-}
-
-cst-option:hover
-{
- background-color: #bbcef1;
- color: #000;
-}
-
-cst-option.selected,
-cst-option:active
-{
- background-color: #598bec;
- color: #fff;
-}
-
-cst-option.selected span,
-cst-option.selected code,
-cst-option:active span,
-cst-option:active code
-{
- color: #fff;
-}
-
-cst-select-option-list code
-{
- font-family: monospace;
- color: rgba(0, 0, 0, 0.44);
-}
-
-.debugger-menu cst-option,
-.debugger-menu cst-title
-{
- padding-left: 28px;
-}
-
-.debugger-menu cst-option.selected
-{
- background-image: url('../ui-images/dragonfly-favicon.png');
- background-repeat: no-repeat;
- background-position: 6px 50%;
-}
-
-cst-select.color
-{
- background: none;
- width: 22px;
- margin: 0 0.2em;
-}
-
-cst-select.color cst-value
-{
- border: 1px solid #999;
- width: 4px;
- margin: 0;
-}
-
-cst-select.color[disabled] cst-value
-{
- background-color: #ccc !important;
-}
-
-cst-select-option-list-container.color cst-select-option-list
-{
- padding: 2px 11px 8px 8px;
- overflow: visible;
- border: none;
- background: none;
- max-height: none;
-}
-
-cst-option-list-background
-{
- display:block;
- position: relative;
- width: 160px;
- padding: 10px 15px 15px 10px;
- margin: -1px -11px -8px -8px;
-}
-
-cst-option-list-background > div
-{
- width: 160px;
-}
-
-cst-select-option-list-container.color cst-option
-{
- float: left;
- width: 32px;
- height: 24px;
- padding: 0;
- margin: 3px;
- border: 1px solid #999;
- position: relative;
- background-color: transparent;
-}
-
-cst-select-option-list-container.color cst-option cst-color
-{
- display: inline-block;
- width: 32px;
- height: 24px;
- vertical-align: text-top;
-}
-
-cst-select-option-list-container.color cst-selected-border
-{
- float: left;
- width: 32px;
- height: 24px;
- padding: 2px;
- margin: 0 0 0 -40px;
- border: 2px solid #999;
-}
-
-cst-option-list-background > div > div
-{
- clear: both;
- padding-top: 5px;
-}
-
-cst-select-option-list-container.color label
-{
- display: block;
- margin: 2px 3px;
- line-height: 1.4em;
- clear: both;
-}
-
-cst-select-option-list-container.color label input
-{
- float: right;
- vertical-align: middle;
- height: 1.1em;
- padding: 0;
- width: 4.2em;
-}
-
-cst-select-option-list-container.color .text,
-cst-select-option-list-container.color .text input
-{
- text-align: right;
-}
-
-cst-select-option-list-container.color .text input
-{
- margin-left: 0.2em;
-}
-
-cst-select-option-list-container.color .ok-cancel
-{
- margin: 5px 3px;
-}
-
-cst-select-option-list-container.color .ok-cancel input + input
-{
- float: right;
-}
-
-.info-box
-{
- margin: 30px 50px 0 50px;
- text-align: center;
- padding: 1em;
- border: 1px dashed #b3b3b3;
- border-radius: 4px;
- background: #f3f3f3;
-}
-
-.info-box p
-{
- margin: 5px 0 0;
- padding: 0;
-}
-
-.placeholder
-{
- color: #999;
- font-style: italic;
-}
-
-horizontal-navigation
-{
- height: 21px;
- line-height: 21px;
- display: block;
- position: relative;
- overflow: hidden;
-}
-
-nav {
- position: absolute;
- border: 0 solid #b3b3b3;
- color: #444;
- width: 15px;
- text-align: center;
- z-index: 1;
- display: none;
- background: #d9d9d9 50% 7px no-repeat;
- content: "\00A0";
- overflow: hidden;
-}
-
-nav:active
-{
- color: #000;
-}
-
-nav::selection
-{
- background: inherit;
-}
-
-.navs nav
-{
- display: inline;
-}
-
-nav[dir="back"]
-{
- background-image: url("../ui-images/nav_back.png");
- border-right-width: 1px;
-}
-
-nav[dir="forward"]
-{
- background-image: url("../ui-images/nav_forward.png");
- right: 0;
- border-left-width: 1px;
-}
-
-nav[dir="back"].disabled
-{
- background-image: url("../ui-images/nav_back_disabled.png");
-}
-
-nav[dir="forward"].disabled
-{
- background-image: url("../ui-images/nav_forward_disabled.png");
-}
-
-nav:not(.disabled):hover
-{
- background-color: #cecece;
-}
-
-nav.disabled
-{
- cursor: default;
-}
-
-breadcrumbs
-{
- box-sizing: border-box;
- position: absolute;
- overflow: hidden;
- white-space: nowrap;
- left: 0;
- right: 0;
- background: #d7d7d7 url("../ui-images/shadow_0.png");
-}
-
-.navs breadcrumbs
-{
- left: 16px;
- right: 15px; /* minus one pixel to hide the right border of the last breadcrumb */
-}
-
-breadcrumbs breadcrumb
-{
- height: 21px;
- line-height: 21px;
- display: inline-block;
- position: relative;
- padding: 0 0 0 15px;
- background: transparent url("../ui-images/crumb_middle.png");
-}
-
-breadcrumbs breadcrumbs::selection
-{
- background: transparent;
-}
-
-breadcrumbs .drag breadcrumb
-{
- cursor: move;
-}
-
-
-/* Styling of arrows */
-
-breadcrumbs breadcrumb:not(:first-of-type)::before,
-breadcrumbs breadcrumb:last-of-type::after
-{
- content: "";
- height: 21px;
- width: 11px;
- position: absolute;
- left: 0;
- background-image: url("../ui-images/crumb_arrow.png");
-}
-
-breadcrumbs breadcrumb:last-of-type::after
-{
- left: auto;
- right: -11px;
-}
-
-.navs breadcrumbs breadcrumb:last-of-type
-{
- padding-right: 4px;
-}
-
-.navs breadcrumbs breadcrumb:last-of-type::after
-{
- display: none;
-}
-
-breadcrumbs breadcrumb:first-of-type {
- padding-left: 4px;
-}
-
-breadcrumb:hover,
-breadcrumb:hover + breadcrumb::before,
-breadcrumb:hover:last-of-type::after
-{
- background-position: 0 -21px;
-}
-
-breadcrumb.active,
-breadcrumb.active:last-of-type::after
-{
- background-position: 0 -42px;
-}
-
-breadcrumb.active + breadcrumb::before
-{
- background-position: 0 -105px;
-}
-
-breadcrumb:hover::before
-{
- background-position: 0 -126px;
-}
-
-breadcrumb.active + breadcrumb:hover::before
-{
- background-position: 0 -168px;
-}
-
-breadcrumb.active::before
-{
- background-position: 0 -189px;
-}
-
-.window-select-gadgets,
-cst-title
-{
- background-color: hsl(0, 0%, 40%);
- color: #fff;
- font-style: normal;
-}
-
-cst-group
-{
- display: block;
-}
-
-/* Temporary fix for flickering */
-tabs,
-toolbar
-{
- top: -1000px;
-}
-
-/* TODO: this is just a temp workaround. */
-#waiting-for-connection
-{
- position: relative;
- z-index: 2;
-}
-
-.close-tab-button
-{
- display: inline-block;
- background: transparent url("../ui-images/icons/icon_close_tab_small.png") no-repeat 50% 50%;
- border: none;
- width: 11px;
- height: 11px;
- margin: -1px -4px 0 4px;
- opacity: 0.4;
-}
-
-tab.active .close-tab-button
-{
- opacity: 0.6;
-}
-
-.close-tab-button:active
-{
- background-position: 50% 100%;
-}
-
-.first-temp-tab
-{
- margin-left: 20px;
-}
-
-.context-window
-{
- border-bottom-right-radius: 0;
- border-bottom-left-radius: 0;
- background: #fff;
- color: #000;
-}
-
-.search-window-content
-{
- background-color: #fff;
- height: 100%;
-}
-
-.context-window,
-.context-window window-toolbar,
-.context-window window-header,
-.context-window window-container
-{
- border: none;
-}
-
-.context-window window-header
-{
- color: #000;
- background-color: #eee;
- text-shadow: 0 1px 1px #fff;
-}
-
-.context-window window-toolbar
-{
- border-bottom: 1px solid #999;
- background: #eee;
-}
-
-.context-window window-container
-{
- background: transparent;
-}
-
-.context-window .window-close
-{
- background-image: url('../ui-images/icons/context_window_close.png');
-}
-
-.context-window
-{
- background-color: #fff;
- color: #000;
-}
-
-info {
- padding: 0 7px;
-}
-
-.scroll {
- overflow: auto;
-}
-
-.badge.paused
-{
- background: transparent url("../ui-images/pause.png") 50% no-repeat;
- height: 15px;
- width: 15px;
- left: 22px;
- top: -1px;
-}
-
-.inspect-node-link
-{
- cursor: pointer;
-}
-
-.inspect-node-link:hover
-{
- text-decoration: underline;
-}
-
-.internal-link
-{
- cursor: pointer;
- text-decoration: underline;
-}
-
-.internal-link:hover
-{
- text-decoration: none;
-}
-
-.inline-block
-{
- display: inline-block;
- vertical-align: middle;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-
-.block-content
-{
- display: block;
- line-height: 1.1;
- text-align: center;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-
-.background-overlay
-{
- position: absolute;
- border: 1px solid #999;
- box-shadow: 0 5px 5px hsla(0, 0%, 0%, 0.30),
- 0 2px 2px hsla(0, 0%, 0%, 0.25)
-}
+/* Font stack defaults */
+viewport,
+.info-box,
+.ui-button,
+.ui-font
+{
+ font-family: sans-serif;
+ font: menu;
+ font-style: normal;
+ font-variant: normal;
+ font-weight: 400;
+ font-size: 11px;
+ line-height: normal;
+ color: #444;
+}
+
+.mono
+{
+ font-family: "Menlo", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Consolas", "Monaco", "Lucida Console", monospace;
+ font-size: 11px;
+ line-height: 15px;
+ color: #111;
+}
+
+textarea,
+input,
+code,
+pre
+{
+ font: inherit;
+}
+
+/* UI Style */
+viewport
+{
+ width: 100%;
+ height: 100%;
+ display: block;
+ overflow: hidden;
+ cursor: default;
+}
+
+main-view {
+ width: 100%;
+ display: block;
+}
+
+windows-container,
+toolbar,
+modebar,
+searchbar,
+tabs,
+container,
+top-tabs,
+top-container {
+ position: absolute;
+}
+
+panel-container {
+ width: 100%;
+ display: block;
+ /* not sure if this is needed
+ so far any container was positioned absolute */
+ position: relative;
+}
+
+container,
+top-tabs,
+tabs,
+modebar,
+searchbar,
+toolbar,
+panel-toolbar,
+window-toolbar,
+.js-dd-filter-bar
+{
+ border: 0 solid #999;
+}
+
+top-tabs,
+tabs
+{
+ border-bottom-width: 1px;
+}
+
+modebar
+{
+ border-top-width: 1px;
+}
+
+top-container
+{
+ background-color: #e6e6e6;
+}
+
+container
+{
+ border-width: 0 1px;
+ background-color: #fefefe;
+ overflow: hidden;
+}
+
+window-statusbar
+{
+ display: block;
+ background: #e6e6e6 url('../ui-images/window-dragger.png') no-repeat 100% 100%;
+ line-height: 20px;
+ height: 20px;
+}
+
+window-toolbar
+{
+ display: block;
+}
+
+toolbar,
+panel-toolbar,
+window-toolbar,
+.js-dd-filter-bar,
+.disabled-toolbar-overlay
+{
+ border-width: 0 1px 1px;
+ padding: 3px 2px;
+ height: 21px; /* 21 + 3 + 3 (padding) = 27 */
+ background-color: #e9e9e9;
+ background-image: -o-linear-gradient(-90deg,
+ rgba(255, 255, 255, 0.85) 0,
+ rgba(255, 255, 255, 0.25) 100%);
+ background-image: linear-gradient(rgba(255, 255, 255, 0.85) 0,
+ rgba(255, 255, 255, 0.25) 100%);
+}
+
+.disabled-toolbar-overlay
+{
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 100%;
+ height: 100%;
+ opacity: 0.7;
+ padding: 0;
+}
+
+panel-toolbar
+{
+ display: block;
+ border-width: 0 0 1px 0;
+ background-color: #e9e9e9;
+ background-image: -o-linear-gradient(-90deg,
+ rgba(255, 255, 255, 0.55) 0,
+ rgba(255, 255, 255, 0.25) 100%);
+ background-image: linear-gradient(rgba(255, 255, 255, 0.55) 0,
+ rgba(255, 255, 255, 0.25) 100%);
+ border-color: #bfbfbf;
+ box-shadow: inset 0 0 0 1px rgba(255,255,255,0.35),
+ inset 0 1px 1px 0 rgba(255, 255, 255,0.9);
+}
+
+toolbar-buttons
+{
+ display: block;
+ float: left;
+ height: 100%;
+ padding: 0 4px;
+}
+
+/* Pop-ups */
+cst-select-option-list,
+#contextmenu,
+.tooltip-container,
+.error-description
+{
+ background-color: #ededed;
+ background-image: -o-linear-gradient(-90deg,
+ rgba(255, 255, 255, 0.25) 0,
+ transparent 25px);
+ background-image: linear-gradient(rgba(255, 255, 255, 0.25) 0,
+ transparent 25px);
+ border-radius: 4px;
+ padding: 8px;
+ box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.9),
+ 0 1px 6px 0 rgba(0, 0, 0, 0.45),
+ 0 0 1px 1px rgba(0, 0, 0, 0.3);
+ color: #333;
+}
+
+.reload-window::before
+{
+ background-image: url("../ui-images/icons/icon_reload.png");
+}
+
+
+/* Window control buttons */
+
+#toggle-console::before
+{
+ background-image: url("../ui-images/icons/icon_console.png");
+}
+
+#toggle-settings-overlay::before
+{
+ background-image: url("../ui-images/icons/icon_settings.png");
+}
+
+#toggle-remote-debug-overlay::before
+{
+ background-image: url("../ui-images/icons/icon_remote.png");
+}
+
+#toggle-remote-debug-overlay.remote-active::before
+{
+ background-image: url("../ui-images/icons/icon_remote_active.png");
+}
+
+#toggle-remote-debug-overlay.alert::before
+{
+ background-image: url("../ui-images/icons/icon_remote_alert.png");
+}
+
+#top-window-toggle-attach::before
+{
+ background-image: url("../ui-images/icons/icon_attach.png");
+}
+
+#top-window-toggle-attach.attached::before
+{
+ background-image: url("../ui-images/icons/icon_detach.png");
+}
+
+#top-window-close::before
+{
+ background-image: url("../ui-images/icons/icon_close.png");
+}
+
+/* View buttons */
+.search::before
+{
+ background-image: url("../ui-images/icons/icon_search.png");
+}
+
+.dom-inspection-snapshot::before
+{
+ background-image: url("../ui-images/icons/icon_expand.png");
+}
+
+.dom\.find-with-click::before
+{
+ background-image: url("../ui-images/icons/icon_click.png");
+}
+
+.dom\.highlight-on-hover::before
+{
+ background-image: url("../ui-images/icons/icon_hover.png");
+}
+
+.dom\.update-on-dom-node-inserted::before
+{
+ background-image: url("../ui-images/icons/icon_update_on_delete.png");
+}
+
+.dom\.lock-selected-elements::before
+{
+ background-image: url("../ui-images/icons/icon_border.png");
+}
+
+.stylesheets.shortcuts::before
+{
+ background-image: url("../ui-images/icons/icon_shorthand.png");
+}
+
+.css-comp-style\.show-initial-values::before
+{
+ background-image: url("../ui-images/icons/icon_hidedefaults.png");
+}
+
+.css-inspector.hide-shorthands::before
+{
+ background-image: url("../ui-images/icons/icon_shorthand.png");
+}
+
+.dom_attrs.hide-null-values::before
+{
+ background-image: url("../ui-images/icons/icon_empty.png");
+}
+
+#continue-run::before
+{
+ background-image: url("../ui-images/icons/icon_play.png");
+}
+
+#continue-step-into-call::before
+{
+ background-image: url("../ui-images/icons/icon_stepinto.png");
+}
+
+#continue-step-next-line::before
+{
+ background-image: url("../ui-images/icons/icon_stepover.png");
+}
+
+#continue-step-out-of-call::before
+{
+ background-image: url("../ui-images/icons/icon_stepout.png");
+}
+
+.js_source\.script::before
+{
+ background-image: url("../ui-images/icons/icon_haltonscript.png");
+}
+
+.js_source\.error::before
+{
+ background-image: url("../ui-images/icons/icon_haltonerror.png");
+}
+
+.js_source\.reformat_javascript::before
+{
+ background-image: url("../ui-images/icons/icon_reformat.png");
+}
+
+.threads\.log-threads::before
+{
+ background-image: url("../ui-images/icons/icon_threads.png");
+}
+
+.inspection\.show-prototypes::before
+{
+ background-image: url("../ui-images/icons/icon_prototype.png");
+}
+
+.inspection\.show-non-enumerables::before
+{
+ background-image: url("../ui-images/icons/icon_hidedefaults.png"); /* temporarily using this icon */
+}
+
+.inspection\.show-default-nulls-and-empty-strings::before
+{
+ background-image: url("../ui-images/icons/icon_empty.png");
+}
+
+.threads-clear-log::before
+{
+ background-image: url("../ui-images/icons/icon_clear.png");
+}
+
+.threads-export-log::before
+{
+ background-image: url("../ui-images/icons/icon_export.png");
+}
+
+.clear-request-list::before
+{
+ background-image: url("../ui-images/icons/icon_clear.png");
+}
+
+.clear-log-network-view::before
+{
+ background-image: url("../ui-images/icons/icon_clear.png");
+}
+
+.network-view-toggle-graphs:before
+{
+ background-image: url("../ui-images/icons/icon_graph.png");
+}
+
+.network-view-toggle-data:before
+{
+ background-image: url("../ui-images/icons/icon_table.png");
+}
+
+
+.request_list\.clear-log-on-runtime-switch::before
+{
+ background-image: url("../ui-images/icons/icon_clearonreload.png");
+}
+
+.request_list\.auto-scroll-request-list::before
+{
+ background-image: url("../ui-images/icons/icon_autoscroll.png");
+}
+
+.update-ev-listeners::before
+{
+ background-image: url("../ui-images/icons/icon_refetch_listeners.png");
+}
+
+.close-overlay-view::before
+{
+ background-image: url("../ui-images/icons/icon_close.png");
+}
+
+.storage-delete
+{
+ background-image: url("../ui-images/icons/icon_clear.png");
+ content: "";
+ display: inline-block;
+ width: 17px;
+ height: 17px;
+}
+
+.clear-log::before
+{
+ background-image: url("../ui-images/icons/icon_clear.png");
+}
+
+.console\.expand-all-entries::before
+{
+ background-image: url("../ui-images/icons/icon_expand.png");
+}
+
+.disable-all-breakpoints::before,
+.ev-brp-remove-all-breakpoints::before
+{
+ background-image: url("../ui-images/icons/icon_disable.png");
+}
+
+.delete-all-breakpoints::before
+{
+ background-image: url("../ui-images/icons/icon_clear.png");
+}
+
+.ev-brp-expand-all-sections::before
+{
+ background-image: url("../ui-images/icons/icon_expand.png");
+}
+
+.network_logger\.pause::before
+{
+ background-image: url("../ui-images/icons/icon_pause.png");
+}
+
+.network_logger\.network-profiler-mode::before
+{
+ background-image: url("../ui-images/icons/icon_network_profiler.png");
+}
+
+.profiler-start-stop::before
+{
+ background-image: url("../ui-images/icons/icon_record.png");
+}
+
+.profiler_all\.zero-at-first-event::before
+{
+ background-image: url("../ui-images/icons/icon_zero_at_first_event.png");
+}
+
+.pseudo-items cst-icon
+{
+ background-image: url("../ui-images/icons/icon_hidedefaults.png");
+}
+
+cst-icon[class="debugger-menu"]
+{
+ background-image: url("../ui-images/icons/icon_tabs.png");
+}
+
+
+/* Buttons */
+
+.ui-control,
+.ui-button
+{
+ background: #e6e6e6 repeat-x -o-linear-gradient(-90deg,
+ rgba(255, 255, 255, 0.75) 0,
+ rgba(255, 255, 255, 0.25) 100%);
+ background: #e6e6e6 repeat-x linear-gradient(rgba(255, 255, 255, 0.75) 0,
+ rgba(255, 255, 255, 0.25) 100%);
+ border-radius: 3px;
+ line-height: 19px;
+ margin: 0 3px;
+ padding: 1px 11px;
+ box-sizing: content-box;
+ display: inline-block;
+ box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.45),
+ inset 0 0 0 2px rgba(255, 255, 255, 0.55);
+ vertical-align: middle;
+ -o-transition: background-color 0.2s;
+ transition: background-color 0.2s;
+}
+
+.ui-control[disabled],
+.ui-button[disabled]
+{ /* :disabled seems to be buggy */
+ opacity: 0.45;
+}
+
+.ui-control:not([disabled]):active,
+.ui-button:not([disabled]):active,
+toolbar-buttons .is-active
+{
+ background-color: #c6c6c6;
+ background-image: -o-linear-gradient(-90deg,
+ rgba(255, 255, 255, 0.45) 0,
+ rgba(255, 255, 255, 0.25) 100%);
+ background-image: linear-gradient(rgba(255, 255, 255, 0.45) 0,
+ rgba(255, 255, 255, 0.25) 100%);
+ box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3),
+ inset 0 1px 3px rgba(0, 0, 0, 0.35);
+}
+
+
+/* Buttons with icons */
+
+.ui-button:empty::before
+{
+ content: "";
+ display: block;
+ height: 19px;
+ width: 19px;
+ background-position: 50%;
+ background-repeat: no-repeat;
+}
+
+
+/* Toolbar buttons */
+
+toolbar .ui-button,
+toolbar .ui-control,
+panel-toolbar .ui-button,
+panel-toolbar .ui-control,
+window-controls .ui-button,
+window-controls .ui-control
+{
+ box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35),
+ inset 0 2px 0 0 rgba(255, 255, 255, 0.55),
+ 0 1px rgba(255, 255, 255, 0.6);
+}
+
+toolbar .ui-button:not([disabled]):active,
+toolbar .ui-control:not([disabled]):active,
+panel-toolbar .ui-button:not([disabled]):active,
+panel-toolbar .ui-control:not([disabled]):active,
+window-controls .ui-button:not([disabled]):active,
+window-controls .ui-control:not([disabled]):active,
+toolbar-buttons .is-active,
+window-controls .is-active
+{
+ box-shadow: 0 1px rgba(255, 255, 255, 0.6),
+ inset 0 0 0 1px rgba(0, 0, 0, 0.15),
+ inset 0 0 2px rgba(0, 0, 0, 0.25),
+ inset 0 1px 4px rgba(0, 0, 0, 0.35);
+}
+
+toolbar .ui-button:empty,
+panel-toolbar .ui-button:empty,
+.advanced-search .ui-button,
+window-controls .ui-button,
+.ui-control /* cst-select needs to be tweaked before changing this */
+{
+ padding-left: 5px;
+ padding-right: 5px;
+}
+
+
+/* Grouping the toolbar buttons */
+
+/* All Buttons in a group*/
+toolbar-buttons .ui-button,
+#toggle-settings-overlay,
+#toggle-remote-debug-overlay,
+#top-window-toggle-attach.attached,
+#top-window-close,
+.advanced-search .ui-button
+{
+ border-radius: 0;
+ margin: 0 -1px 0 0;
+}
+
+/* Leftmost Button*/
+toolbar-buttons .ui-button:first-of-type,
+#toggle-settings-overlay,
+#top-window-toggle-attach.attached
+{
+ border-top-left-radius: 3px;
+ border-bottom-left-radius: 3px;
+}
+
+#toggle-settings-overlay,
+#top-window-toggle-attach.attached
+{
+ margin-left: 3px;
+}
+
+/* Rightmost Button*/
+toolbar-buttons .ui-button:last-of-type,
+#toggle-remote-debug-overlay,
+#top-window-close,
+.advanced-search .search-move-highlight-down
+{
+ border-top-right-radius: 3px;
+ border-bottom-right-radius: 3px;
+}
+
+#toggle-remote-debug-overlay,
+#top-window-close
+{
+ margin-right: 3px;
+}
+
+/* Show the button topmost when the overlay is visible */
+#toggle-settings-overlay.is-active,
+#toggle-remote-debug-overlay.is-active
+{
+ position: relative;
+ z-index: 301;
+ box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.5),
+ inset 0 1px 3px rgba(0, 0, 0, 0.5);
+}
+
+
+/* Alert state */
+.ui-control.alert
+{
+ background-color: #ff8040;
+ border-color: #bf3000;
+ color: #993d1f;
+ box-shadow: inset 0 0 1px #fff,
+ inset 0 0 10px #ff4433,
+ 0 1px rgba(255, 255, 255, 0.5),
+ 0 0 2px #ff0000;
+}
+
+.ui-control.alert:not([disabled]):active
+{
+ background-color: #ff8040;
+ border-color: #bf3000;
+ box-shadow: inset 0 1px 2px #bf1000,
+ inset 0 0 10px #ff4433,
+ 0 1px rgba(255, 255, 255, 0.5),
+ 0 0 2px #ff0000;
+}
+
+.ui-control.alert.is-active
+{
+ background-color: #e54c2e;
+ border-color: #bf3000;
+ box-shadow: inset 0 1px 2px #bf1000,
+ inset 0 0 10px #ff4433,
+ 0 1px rgba(255, 255, 255, 0.5),
+ 0 0 2px #ff0000;
+}
+
+.ui-control.alert.is-active:active
+{
+ background-color: #bf381d;
+}
+
+#toggle-settings-overlay.alert.is-active,
+#toggle-remote-debug-overlay.alert.is-active,
+#toggle-settings-overlay.alert.is-active:active,
+#toggle-remote-debug-overlay.alert.is-active:active
+{
+ border-color: #721;
+ box-shadow: inset 0 1px 2px #bf1000,
+ inset 0 0 10px #ff4433,
+ 0 1px rgba(255, 255, 255, 0.2),
+ 0 0 4px #ff0000;
+}
+
+.ui-control.dropdown,
+cst-select[cst-id="debugger-menu"]
+{
+ width: 28px;
+}
+
+cst-icon
+{
+ vertical-align: middle;
+ display: inline-block;
+ height: 100%;
+ width: 17px;
+ height: 17px;
+}
+
+toolbar-filters,
+toolbar-search
+{
+ display: block;
+ float: right;
+}
+
+filter,
+.advanced-search,
+.js-dd-filter-container,
+.color-picker-number,
+.color-picker-text
+{
+ margin: 0 2px;
+ padding-left: 20px;
+ height: 19px;
+ line-height: 19px;
+ border: 1px solid #8e8e8e;
+ border-radius: 3px;
+ box-shadow: 0 1px #fff,
+ inset 0 1px 1px #d5d5d5;
+}
+
+filter,
+.advanced-search,
+.js-dd-filter-container
+{
+ background: #fff url("../ui-images/icon_search.png") 2px 50% no-repeat;
+}
+
+
+filter
+{
+ display: inline-block;
+}
+
+filter.filter,
+.js-dd-filter-container
+{
+ background-image: url("../ui-images/filter.png");
+ background-position: 5px 50%;
+}
+
+filter input
+{
+ width: 138px;
+ height: 19px;
+ background: none;
+ border: none;
+ padding: 0;
+ padding-right: 2px;
+ color: #666;
+}
+
+toolbar-filters filter.focus input
+{
+ color: #000;
+}
+
+modebar
+{
+ height: 21px;
+ line-height: 21px;
+ background: #d7d7d7;
+}
+
+modebar.hidden
+{
+ display: none;
+}
+
+searchbar
+{
+ border-top: none;
+ border-width: 0 1px 1px;
+ padding: 3px;
+ height: 21px; /* 21 + 3 + 2 (padding) = 26 */
+ line-height: 21px;
+ background: #eee;
+}
+
+.advanced-searchbar
+{
+ height: 43px;
+}
+
+window-select
+{
+ position: relative;
+ padding: 2px 0;
+}
+
+window-select select
+{
+ width: 100%;
+ max-width: 400px;
+ margin:0;
+ height: 22px;
+}
+
+window-select select option[value="-1"]
+{
+ color: #999;
+}
+
+window-controls
+{
+ display: block;
+ position: absolute;
+ top: 0;
+ right: 0;
+ padding: 5px 3px 3px 4px;
+ height: 22px;
+}
+
+window-controls:not(.no-tabbar)
+{
+ background-color: #f3f3f3;
+ background-image: -o-linear-gradient(-90deg,
+ rgba(255, 255, 255, 0.75) 0,
+ rgba(255, 255, 255, 0.25) 100%),
+ -o-linear-gradient(-90deg,
+ rgba(0, 0, 0, 0.05) 0,
+ rgba(0, 0, 0, 0.3) 70%),
+ -o-linear-gradient(-90deg,
+ rgba(255, 255, 255, 0.1) 0,
+ rgba(255, 255, 255, 0.6) 70%);
+ background-image: linear-gradient(rgba(255, 255, 255, 0.75) 0,
+ rgba(255, 255, 255, 0.25) 100%),
+ linear-gradient(rgba(0, 0, 0, 0.05) 0,
+ rgba(0, 0, 0, 0.3) 70%),
+ linear-gradient(rgba(255, 255, 255, 0.1) 0,
+ rgba(255, 255, 255, 0.6) 70%);
+ background-size: 100% 100%, 1px 100%, 1px 100%;
+ background-repeat: repeat, repeat-y, repeat-y;
+ background-position: left top, left top, 1px top;
+}
+
+window-controls.no-tabbar
+{
+ z-index: 2;
+}
+
+.default-container
+{
+ padding: 7px;
+}
+
+settings-container,
+settings,
+settings-header,
+checkboxes,
+checkbox,
+setting-composite
+{
+ display: block;
+}
+
+settings-container label
+{
+ display: block;
+}
+
+settings-container input {
+ margin-left: 0;
+ margin-right: 5px;
+}
+
+settings
+{
+ margin: 12px 0;
+ padding: 3px 0;
+}
+
+settings-header
+{
+ font-size: 1.2em;
+ clear: both;
+}
+
+setting-composite select
+{
+ padding: 0;
+ margin: 0;
+ height: 2em;
+ vertical-align: middle;
+}
+
+setting-buttons {
+ text-align: right;
+ padding-right: 26px;
+}
+
+settings-container { /**/
+ padding: 0 8px 8px;
+}
+
+settings hr
+{
+ border: 1px dotted #333;
+ margin: 9px 26px;
+}
+
+.change-ui-lang-info
+{
+ padding: 7px 0;
+}
+
+.change-ui-lang-info a
+{
+ color: inherit;
+}
+
+.change-ui-lang-info ul
+{
+ margin-top: 5px;
+}
+
+view-slider
+{
+ display: block;
+ position: absolute;
+}
+
+view-slider.vertical
+{
+ cursor: col-resize;
+}
+
+view-slider.horizontal
+{
+ cursor: row-resize;
+ border-top: 1px solid #b3b3b3;
+}
+
+ui-menu
+{
+ display: block;
+ width: 180px;
+ position: absolute;
+ right:30px;
+ top: 0;
+ z-index:10;
+ right: 200px;
+}
+
+ui-menu > h2
+{
+ padding-left: 10px;
+ font-weight: normal;
+ font-size: 11px;
+ background: #fff;
+ width: 170px;
+ height: 18px;
+ line-height: 14px;
+ border: 1px solid #000;
+ border-top-width: 0;
+}
+
+ui-menu ul
+{ /* The list needs a bottom shadow when opened */
+ position: absolute;
+ right: 9px;
+ top: 18px;
+ margin: 0;
+ padding: 0;
+ list-style: none;
+ background: #fff;
+ border: 1px solid #000;
+ border-top-width: 0;
+}
+
+ui-menu li
+{
+ padding: 0;
+ margin-right: 6px;
+ padding-left: 10px;
+ width: 155px;
+}
+
+ui-menu li h2 {
+ padding: 0;
+ margin: 0;
+ width: 165px;
+ height: 22px;
+ line-height: 22px;
+ font-weight: normal;
+ font-size: 12px;
+ white-space: nowrap;
+}
+
+ui-menu ul li:hover
+{
+ background: #eee;
+}
+
+window-control {
+ display: block;
+ position: absolute;
+ cursor: default;
+}
+
+window-header
+{
+ display: block;
+ font-weight: bold;
+ text-shadow: 0 1px 1px #000;
+ height: 21px;
+ line-height: 21px;
+ padding-left: 5px;
+ background: rgba(255, 255, 255, 0.1);
+ border-radius: 3px 3px 0 0;
+ border-top: 1px solid rgba(255, 255, 255, 0.2);
+ border-bottom: 1px solid rgba(0, 0, 0, 0.4);
+}
+
+windows-container .window-move
+{
+ cursor: move;
+}
+
+windows-container .window-close
+{
+ float: right;
+ width: 17px;
+ height: 17px;
+ position: relative;
+ top: 4px;
+ right: 1px;
+ background: transparent url('../ui-images/icons/hud_close.png') scroll no-repeat 0 0;
+ z-index: 11;
+}
+
+windows-container .window-close:active
+{
+ background-position: 0 1px;
+}
+
+windows-container .window-scale-top-left
+{
+ left: -5px;
+ top: -5px;
+ width: 10px;
+ height: 10px;
+ cursor: nw-resize;
+}
+
+windows-container .window-scale-top
+{
+ left: 5px;
+ right: 5px;
+ top: -5px;
+ height: 10px;
+ cursor: n-resize;
+}
+
+windows-container .window-scale-top-right
+{
+ right: -5px;
+ width: 10px;
+ height: 10px;
+ top: -5px;
+ cursor: ne-resize;
+}
+
+windows-container .window-scale-right
+{
+ right: -5px;
+ width: 10px;
+ top: 5px;
+ bottom: 5px;
+ cursor: e-resize;
+}
+
+windows-container .window-scale-left
+{
+ left: -5px;
+ width: 10px;
+ top: 5px;
+ bottom: 5px;
+ cursor: w-resize;
+}
+
+windows-container .window-scale-bottom
+{
+ left: 0;
+ bottom: -5px;
+ height: 10px;
+ right: 5px;
+ cursor: s-resize;
+}
+
+windows-container .window-scale-bottom-right
+{
+ bottom: -5px;
+ height: 10px;
+ width: 10px;
+ right: -5px;
+ cursor: se-resize;
+}
+
+windows-container .window-scale-bottom-left
+{
+ bottom: -5px;
+ height: 10px;
+ width: 10px;
+ left: -5px;
+ cursor: sw-resize;
+}
+
+windows-container
+{
+ width: 100%;
+ height: 100%;
+ display: block;
+ overflow: hidden;
+}
+
+window
+{
+ display: block;
+ position: absolute;
+ height: 300px;
+ left: 20px;
+ color: #fff;
+ border-radius: 3px;
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
+ border: 1px solid rgba(0, 0, 0, 0.3);
+ background: rgba(50, 50, 50, 0.9);
+ background-size: auto 100%;
+}
+
+/* clear painting artefacts on moving the window */
+window:after
+{
+ content: "";
+ display: block;
+ top: 100%;
+ left: 0;
+ height: 10px;
+ width: 100%;
+}
+
+window-container
+{
+ /* border: 1px solid #000; <-- TODO: Do we need this */
+ border-width: 0 1px 1px;
+ display: block;
+ position: relative;
+ background-color: rgba(0, 0, 0, 0.4);
+ width: 100%;
+}
+
+window.hud
+{
+ border-width: 0;
+ border-top-width: 2px;
+ border-radius: 0;
+ background: rgba(0, 0, 0, 0.75);
+}
+
+window.hud window-container
+{
+ border-radius: 0;
+ border: 0;
+}
+
+.hud window-toolbar,
+.hud .disabled-toolbar-overlay
+{
+ background-color: #000;
+ background-image: -o-linear-gradient(-90deg,
+ rgba(255, 255, 255, 0.25) 0,
+ rgba(255, 255, 255, 0.15) 100%);
+ background-image: linear-gradient(rgba(255, 255, 255, 0.25) 0,
+ rgba(255, 255, 255, 0.15) 100%);
+ border: 0;
+ border-bottom: 1px solid rgba(0, 0, 0, 0.65);
+ padding-bottom: 3px;
+}
+
+.hud window-toolbar
+{
+ position: relative;
+}
+
+.hud .disabled-toolbar-overlay
+{
+ padding: 3px 2px;
+ margin: -3px -2px;
+}
+
+.hud cst-select cst-value
+{
+ text-shadow: none;
+}
+
+.hud .window-scale-top
+{
+ cursor: row-resize;
+}
+
+/* editing */
+textarea
+{
+ resize: none;
+}
+
+textarea-container
+{
+ display: block;
+ padding: 1px;
+ margin: -1px -4px -1px -2px;
+ position:relative;
+ z-index: 10;
+ background: #fff;
+ border: 1px solid #808080;
+ box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
+}
+
+textarea-container,
+textarea-container-inline,
+textarea
+{
+ border-radius: 3px;
+}
+
+textarea-container textarea
+{
+ display: block;
+ width: 100%;
+ border: none;
+ margin: 0;
+ padding: 0;
+ vertical-align: text-top;
+ overflow: hidden;
+}
+
+textarea-container-inline
+{
+ display: inline-block;
+ padding: 1px;
+ margin: -2px -3px -5px;
+ position:relative;
+ z-index: 10;
+ background: #fff;
+ border: 1px solid #808080;
+ box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
+ box-decoration-break: clone;
+}
+
+textarea-container-inline textarea
+{
+ border: none;
+ margin: 0;
+ padding: 0 1px;
+ vertical-align: text-top;
+ overflow: hidden;
+ height: 0;
+}
+
+cst-select-toolbar-setting
+{
+ float: left;
+}
+
+cst-value
+{
+ display: inline-block;
+ overflow: hidden;
+ padding: 0 4px;
+ height: 19px;
+ line-height: 19px;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ vertical-align: top;
+ width: 95%; /* TODO: this is ugly, might push down the dropdown */
+ box-sizing: border-box;
+}
+
+cst-drop-down
+{
+ display: block;
+ width: 7px;
+ height: 19px;
+ background: transparent url("../ui-images/dropdown.png") 50% 50% no-repeat;
+ float: right;
+ position: relative;
+}
+
+.hud cst-drop-down
+{
+ background: transparent url("../ui-images/dropdown_white.png") 50% 50% no-repeat;
+}
+
+cst-select cst-value
+{
+ text-shadow: 0 1px rgba(255, 255, 255, 0.5);
+}
+
+cst-select[disabled]
+{
+ background-color: #ccc !important;
+}
+
+cst-select-option-list-container
+{
+ /* don't add here any border, padding or margin */
+ display: block;
+ position:absolute;
+ z-index: 150;
+ border: 1px solid transparent;
+}
+
+.cmd-line-runtimes
+{
+ z-index: 302;
+}
+
+cst-select[disabled] cst-drop-down
+{
+ opacity: 0.3;
+}
+
+cst-select-option-list
+{
+ display: block;
+ background-color: #fcfcfc;
+ max-height: 200px;
+ overflow: auto;
+ width: auto;
+ padding-left: 0px;
+ padding-right: 0px;
+ box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.35),
+ 0 0 1px 1px rgba(90, 90, 90, 0.35);
+}
+
+cst-option,
+cst-title
+{
+ display: block;
+ padding: 2px 8px;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+cst-select-option-list hr
+{
+ margin: 4px 0;
+ padding: 0;
+ height: 1px;
+ border: none;
+ background-color: #ccc;
+}
+
+cst-option:hover
+{
+ background-color: #bbcef1;
+ color: #000;
+}
+
+cst-option.selected,
+cst-option:active
+{
+ background-color: #598bec;
+ color: #fff;
+}
+
+cst-option.selected span,
+cst-option.selected code,
+cst-option:active span,
+cst-option:active code
+{
+ color: #fff;
+}
+
+cst-select-option-list code
+{
+ font-family: monospace;
+ color: rgba(0, 0, 0, 0.44);
+}
+
+.debugger-menu cst-option,
+.debugger-menu cst-title
+{
+ padding-left: 28px;
+}
+
+.debugger-menu cst-option.selected
+{
+ background-image: url('../ui-images/dragonfly-favicon.png');
+ background-repeat: no-repeat;
+ background-position: 6px 50%;
+}
+
+cst-select.color
+{
+ background: none;
+ width: 22px;
+ margin: 0 0.2em;
+}
+
+cst-select.color cst-value
+{
+ border: 1px solid #999;
+ width: 4px;
+ margin: 0;
+}
+
+cst-select.color[disabled] cst-value
+{
+ background-color: #ccc !important;
+}
+
+cst-select-option-list-container.color cst-select-option-list
+{
+ padding: 2px 11px 8px 8px;
+ overflow: visible;
+ border: none;
+ background: none;
+ max-height: none;
+}
+
+cst-option-list-background
+{
+ display:block;
+ position: relative;
+ width: 160px;
+ padding: 10px 15px 15px 10px;
+ margin: -1px -11px -8px -8px;
+}
+
+cst-option-list-background > div
+{
+ width: 160px;
+}
+
+cst-select-option-list-container.color cst-option
+{
+ float: left;
+ width: 32px;
+ height: 24px;
+ padding: 0;
+ margin: 3px;
+ border: 1px solid #999;
+ position: relative;
+ background-color: transparent;
+}
+
+cst-select-option-list-container.color cst-option cst-color
+{
+ display: inline-block;
+ width: 32px;
+ height: 24px;
+ vertical-align: text-top;
+}
+
+cst-select-option-list-container.color cst-selected-border
+{
+ float: left;
+ width: 32px;
+ height: 24px;
+ padding: 2px;
+ margin: 0 0 0 -40px;
+ border: 2px solid #999;
+}
+
+cst-option-list-background > div > div
+{
+ clear: both;
+ padding-top: 5px;
+}
+
+cst-select-option-list-container.color label
+{
+ display: block;
+ margin: 2px 3px;
+ line-height: 1.4em;
+ clear: both;
+}
+
+cst-select-option-list-container.color label input
+{
+ float: right;
+ vertical-align: middle;
+ height: 1.1em;
+ padding: 0;
+ width: 4.2em;
+}
+
+cst-select-option-list-container.color .text,
+cst-select-option-list-container.color .text input
+{
+ text-align: right;
+}
+
+cst-select-option-list-container.color .text input
+{
+ margin-left: 0.2em;
+}
+
+cst-select-option-list-container.color .ok-cancel
+{
+ margin: 5px 3px;
+}
+
+cst-select-option-list-container.color .ok-cancel input + input
+{
+ float: right;
+}
+
+.info-box
+{
+ margin: 30px 50px 0 50px;
+ text-align: center;
+ padding: 1em;
+ border: 1px dashed #b3b3b3;
+ border-radius: 4px;
+ background: #f3f3f3;
+}
+
+.info-box p
+{
+ margin: 5px 0 0;
+ padding: 0;
+}
+
+.placeholder
+{
+ color: #999;
+ font-style: italic;
+}
+
+horizontal-navigation
+{
+ height: 21px;
+ line-height: 21px;
+ display: block;
+ position: relative;
+ overflow: hidden;
+}
+
+nav {
+ position: absolute;
+ border: 0 solid #b3b3b3;
+ color: #444;
+ width: 15px;
+ text-align: center;
+ z-index: 1;
+ display: none;
+ background: #d9d9d9 50% 7px no-repeat;
+ content: "\00A0";
+ overflow: hidden;
+}
+
+nav:active
+{
+ color: #000;
+}
+
+nav::selection
+{
+ background: inherit;
+}
+
+.navs nav
+{
+ display: inline;
+}
+
+nav[dir="back"]
+{
+ background-image: url("../ui-images/nav_back.png");
+ border-right-width: 1px;
+}
+
+nav[dir="forward"]
+{
+ background-image: url("../ui-images/nav_forward.png");
+ right: 0;
+ border-left-width: 1px;
+}
+
+nav[dir="back"].disabled
+{
+ background-image: url("../ui-images/nav_back_disabled.png");
+}
+
+nav[dir="forward"].disabled
+{
+ background-image: url("../ui-images/nav_forward_disabled.png");
+}
+
+nav:not(.disabled):hover
+{
+ background-color: #cecece;
+}
+
+nav.disabled
+{
+ cursor: default;
+}
+
+breadcrumbs
+{
+ box-sizing: border-box;
+ position: absolute;
+ overflow: hidden;
+ white-space: nowrap;
+ left: 0;
+ right: 0;
+ background: #d7d7d7 url("../ui-images/shadow_0.png");
+}
+
+.navs breadcrumbs
+{
+ left: 16px;
+ right: 15px; /* minus one pixel to hide the right border of the last breadcrumb */
+}
+
+breadcrumbs breadcrumb
+{
+ height: 21px;
+ line-height: 21px;
+ display: inline-block;
+ position: relative;
+ padding: 0 0 0 15px;
+ background: transparent url("../ui-images/crumb_middle.png");
+}
+
+breadcrumbs breadcrumbs::selection
+{
+ background: transparent;
+}
+
+breadcrumbs .drag breadcrumb
+{
+ cursor: move;
+}
+
+
+/* Styling of arrows */
+
+breadcrumbs breadcrumb:not(:first-of-type)::before,
+breadcrumbs breadcrumb:last-of-type::after
+{
+ content: "";
+ height: 21px;
+ width: 11px;
+ position: absolute;
+ left: 0;
+ background-image: url("../ui-images/crumb_arrow.png");
+}
+
+breadcrumbs breadcrumb:last-of-type::after
+{
+ left: auto;
+ right: -11px;
+}
+
+.navs breadcrumbs breadcrumb:last-of-type
+{
+ padding-right: 4px;
+}
+
+.navs breadcrumbs breadcrumb:last-of-type::after
+{
+ display: none;
+}
+
+breadcrumbs breadcrumb:first-of-type {
+ padding-left: 4px;
+}
+
+breadcrumb:hover,
+breadcrumb:hover + breadcrumb::before,
+breadcrumb:hover:last-of-type::after
+{
+ background-position: 0 -21px;
+}
+
+breadcrumb.active,
+breadcrumb.active:last-of-type::after
+{
+ background-position: 0 -42px;
+}
+
+breadcrumb.active + breadcrumb::before
+{
+ background-position: 0 -105px;
+}
+
+breadcrumb:hover::before
+{
+ background-position: 0 -126px;
+}
+
+breadcrumb.active + breadcrumb:hover::before
+{
+ background-position: 0 -168px;
+}
+
+breadcrumb.active::before
+{
+ background-position: 0 -189px;
+}
+
+.window-select-gadgets,
+cst-title
+{
+ background-color: hsl(0, 0%, 40%);
+ color: #fff;
+ font-style: normal;
+}
+
+cst-group
+{
+ display: block;
+}
+
+/* Temporary fix for flickering */
+tabs,
+toolbar
+{
+ top: -1000px;
+}
+
+/* TODO: this is just a temp workaround. */
+#waiting-for-connection
+{
+ position: relative;
+ z-index: 2;
+}
+
+.close-tab-button
+{
+ display: inline-block;
+ background: transparent url("../ui-images/icons/icon_close_tab_small.png") no-repeat 50% 50%;
+ border: none;
+ width: 11px;
+ height: 11px;
+ margin: -1px -4px 0 4px;
+ opacity: 0.4;
+}
+
+tab.active .close-tab-button
+{
+ opacity: 0.6;
+}
+
+.close-tab-button:active
+{
+ background-position: 50% 100%;
+}
+
+.first-temp-tab
+{
+ margin-left: 20px;
+}
+
+.context-window
+{
+ border-bottom-right-radius: 0;
+ border-bottom-left-radius: 0;
+ background: #fff;
+ color: #000;
+}
+
+.search-window-content
+{
+ background-color: #fff;
+ height: 100%;
+}
+
+.context-window,
+.context-window window-toolbar,
+.context-window window-header,
+.context-window window-container
+{
+ border: none;
+}
+
+.context-window window-header
+{
+ color: #000;
+ background-color: #eee;
+ text-shadow: 0 1px 1px #fff;
+}
+
+.context-window window-toolbar
+{
+ border-bottom: 1px solid #999;
+ background: #eee;
+}
+
+.context-window window-container
+{
+ background: transparent;
+}
+
+.context-window .window-close
+{
+ background-image: url('../ui-images/icons/context_window_close.png');
+}
+
+.context-window
+{
+ background-color: #fff;
+ color: #000;
+}
+
+info {
+ padding: 0 7px;
+}
+
+.scroll {
+ overflow: auto;
+}
+
+.badge.paused
+{
+ background: transparent url("../ui-images/pause.png") 50% no-repeat;
+ height: 15px;
+ width: 15px;
+ left: 22px;
+ top: -1px;
+}
+
+.inspect-node-link
+{
+ cursor: pointer;
+}
+
+.inspect-node-link:hover
+{
+ text-decoration: underline;
+}
+
+.internal-link
+{
+ cursor: pointer;
+ text-decoration: underline;
+}
+
+.internal-link:hover
+{
+ text-decoration: none;
+}
+
+.inline-block
+{
+ display: inline-block;
+ vertical-align: middle;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.block-content
+{
+ display: block;
+ line-height: 1.1;
+ text-align: center;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.background-overlay
+{
+ position: absolute;
+ border: 1px solid #999;
+ box-shadow: 0 5px 5px hsla(0, 0%, 0%, 0.30),
+ 0 2px 2px hsla(0, 0%, 0%, 0.25)
+}