Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge

  • Loading branch information...
commit d696da1d678533eae5e985ecbdbe9e9dd22bd6ad 2 parents 7dbff28 + 64dc755
@hzr hzr authored
View
167 LICENSE
@@ -0,0 +1,167 @@
+Apache License, Version 2.0
+
+
+Apache License
+Version 2.0, January 2004
+http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction, and
+distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by the copyright
+owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and all other entities
+that control, are controlled by, or are under common control with that entity.
+For the purposes of this definition, "control" means (i) the power, direct or
+indirect, to cause the direction or management of such entity, whether by
+contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
+outstanding shares, or (iii) beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity exercising
+permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications, including
+but not limited to software source code, documentation source, and configuration
+files.
+
+"Object" form shall mean any form resulting from mechanical transformation or
+translation of a Source form, including but not limited to compiled object code,
+generated documentation, and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object form, made
+available under the License, as indicated by a copyright notice that is included
+in or attached to the work (an example is provided in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object form, that
+is based on (or derived from) the Work and for which the editorial revisions,
+annotations, elaborations, or other modifications represent, as a whole, an
+original work of authorship. For the purposes of this License, Derivative Works
+shall not include works that remain separable from, or merely link (or bind by
+name) to the interfaces of, the Work and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original version
+of the Work and any modifications or additions to that Work or Derivative Works
+thereof, that is intentionally submitted to Licensor for inclusion in the Work
+by the copyright owner or by an individual or Legal Entity authorized to submit
+on behalf of the copyright owner. For the purposes of this definition,
+"submitted" means any form of electronic, verbal, or written communication sent
+to the Licensor or its representatives, including but not limited to
+communication on electronic mailing lists, source code control systems, and
+issue tracking systems that are managed by, or on behalf of, the Licensor for
+the purpose of discussing and improving the Work, but excluding communication
+that is conspicuously marked or otherwise designated in writing by the copyright
+owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
+of whom a Contribution has been received by Licensor and subsequently
+incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of this
+License, each Contributor hereby grants to You a perpetual, worldwide,
+non-exclusive, no-charge, royalty-free, irrevocable copyright license to
+reproduce, prepare Derivative Works of, publicly display, publicly perform,
+sublicense, and distribute the Work and such Derivative Works in Source or
+Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of this License,
+each Contributor hereby grants to You a perpetual, worldwide, non-exclusive,
+no-charge, royalty-free, irrevocable (except as stated in this section) patent
+license to make, have made, use, offer to sell, sell, import, and otherwise
+transfer the Work, where such license applies only to those patent claims
+licensable by such Contributor that are necessarily infringed by their
+Contribution(s) alone or by combination of their Contribution(s) with the Work
+to which such Contribution(s) was submitted. If You institute patent litigation
+against any entity (including a cross-claim or counterclaim in a lawsuit)
+alleging that the Work or a Contribution incorporated within the Work
+constitutes direct or contributory patent infringement, then any patent licenses
+granted to You under this License for that Work shall terminate as of the date
+such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the Work or
+Derivative Works thereof in any medium, with or without modifications, and in
+Source or Object form, provided that You meet the following conditions:
+You must give any other recipients of the Work or Derivative Works a copy of
+this License; and
+
+You must cause any modified files to carry prominent notices stating that You
+changed the files; and
+
+You must retain, in the Source form of any Derivative Works that You distribute,
+all copyright, patent, trademark, and attribution notices from the Source form
+of the Work, excluding those notices that do not pertain to any part of the
+Derivative Works; and
+
+If the Work includes a "NOTICE" text file as part of its distribution, then any
+Derivative Works that You distribute must include a readable copy of the
+attribution notices contained within such NOTICE file, excluding those notices
+that do not pertain to any part of the Derivative Works, in at least one of the
+following places: within a NOTICE text file distributed as part of the
+Derivative Works; within the Source form or documentation, if provided along
+with the Derivative Works; or, within a display generated by the Derivative
+Works, if and wherever such third-party notices normally appear. The contents of
+the NOTICE file are for informational purposes only and do not modify the
+License. You may add Your own attribution notices within Derivative Works that
+You distribute, alongside or as an addendum to the NOTICE text from the Work,
+provided that such additional attribution notices cannot be construed as
+modifying the License.
+You may add Your own copyright statement to Your modifications and may provide
+additional or different license terms and conditions for use, reproduction, or
+distribution of Your modifications, or for any such Derivative Works as a whole,
+provided Your use, reproduction, and distribution of the Work otherwise complies
+with the conditions stated in this License.
+
+
+5. Submission of Contributions. Unless You explicitly state otherwise, any
+Contribution intentionally submitted for inclusion in the Work by You to the
+Licensor shall be under the terms and conditions of this License, without any
+additional terms or conditions. Notwithstanding the above, nothing herein shall
+supersede or modify the terms of any separate license agreement you may have
+executed with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade names,
+trademarks, service marks, or product names of the Licensor, except as required
+for reasonable and customary use in describing the origin of the Work and
+reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or agreed to in
+writing, Licensor provides the Work (and each Contributor provides its
+Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied, including, without limitation, any warranties
+or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+PARTICULAR PURPOSE. You are solely responsible for determining the
+appropriateness of using or redistributing the Work and assume any risks
+associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory, whether in
+tort (including negligence), contract, or otherwise, unless required by
+applicable law (such as deliberate and grossly negligent acts) or agreed to in
+writing, shall any Contributor be liable to You for damages, including any
+direct, indirect, special, incidental, or consequential damages of any character
+arising as a result of this License or out of the use or inability to use the
+Work (including but not limited to damages for loss of goodwill, work stoppage,
+computer failure or malfunction, or any and all other commercial damages or
+losses), even if such Contributor has been advised of the possibility of such
+damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing the Work or
+Derivative Works thereof, You may choose to offer, and charge a fee for,
+acceptance of support, warranty, indemnity, or other liability obligations
+and/or rights consistent with this License. However, in accepting such
+obligations, You may act only on Your own behalf and on Your sole
+responsibility, not on behalf of any other Contributor, and only if You agree to
+indemnify, defend, and hold each Contributor harmless for any liability incurred
+by, or claims asserted against, such Contributor by reason of your accepting any
+such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+
+Copyright © 2010 The Apache Software Foundation, Licensed under the Apache
+License, Version 2.0.
+Apache and the Apache feather logo are trademarks of The Apache Software
+Foundation.
View
1  build.sh
@@ -0,0 +1 @@
+python tools/dfbuild.py -dsm src build
View
17 include-license.txt
@@ -0,0 +1,17 @@
+/**
+ * Copyright 2006 - 2010 Opera Software ASA
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ **/
+
View
34 license.txt
@@ -1,34 +0,0 @@
-/**
- *
- * Copyright (c) 2008, Opera Software ASA
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms,
- * with or without modification, are permitted provided
- * that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * - Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * - Neither the name of Opera Software nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- **/
-
View
4 readme.txt
@@ -39,7 +39,7 @@ Options:
-h, --help show this help message and exit
-c, --no-concat Do NOT concatenate script and css
-l, --no-license Do NOT append license file to js and css. (license is
- taken from $cwd/license.txt
+ taken from $cwd/include-license.txt
-k key=value, --keyword=key=value
A key/value pair. All instances of key will be
replaced by value in all files. More than one
@@ -68,7 +68,7 @@ Options:
Suitable command line for release builds
-pyhton tools/dfbuild.py -l license.txt -m -t -k "$dfversion$=Dragonfly testversion" -k "$revdate$=<todays datetime>" src build
+pyhton tools/dfbuild.py -l include-license.txt -m -t -k "$dfversion$=Dragonfly testversion" -k "$revdate$=<todays datetime>" src build
View
1  src/build-application/build_ecmascript_debugger_5_0.js
@@ -21,7 +21,6 @@ window.app.builders.EcmascriptDebugger["5.0"] = function(service)
namespace.Object_inspection_data.prototype = ObjectDataBase;
window.object_inspection_data = new namespace.Object_inspection_data();
- var service_interface = service_interface;
window.runtimes = new namespace.Runtimes();
window.runtimes.bind(service_interface);
View
1  src/console-logger/console.js
@@ -253,6 +253,7 @@ var ErrorConsoleView = function(id, name, container_class, source)
// Switch on whether we have a table element allready. If we do, just
// render the latest log entry
var entries = error_console_data.getMessages(source);
+ topCell.statusbar.updateInfo(ui_strings.S_CONSOLE_TOOLBAR_MESSAGES_COUNT.replace("%s", entries.length));
var expand_all = settings.console.get('expand-all-entries');
// If there is no table, it's empty or expand state changed, render all
View
50 src/debug/build_debug.js
@@ -14,11 +14,11 @@ cls.debug.wrap_transmit = function()
cls.debug.guess_message_map = function()
{
- var
- service = '',
- versions = null,
- version_arr = null,
- version = '',
+ var
+ service = '',
+ versions = null,
+ version_arr = null,
+ version = '',
re_version = /^\d+\.\d+$/;
for(service in window.message_maps)
@@ -45,12 +45,12 @@ cls.debug.create_debug_environment = function(params)
{
window.ini.debug = true;
cls.debug.guess_message_map();
- window.cls.TestFramework.prototype = ViewBase;
- cls.debug.Debug.prototype =
- window.cls.debug.TestScopeMessages.prototype =
+ window.cls.TestFramework.prototype = ViewBase;
+ cls.debug.Debug.prototype =
+ window.cls.debug.TestScopeMessages.prototype =
new window.cls.TestFramework();
window.debug = new cls.debug.Debug('debug', 'Debug', 'scroll debug-container');
- new cls.debug.ConfigureMessgeFilters(
+ new cls.debug.ConfigureMessageFilters(
'configure-message-filters', 'Message Filters', 'scroll filter-container');
var test_messages = new cls.debug.TestScopeMessages(
'test-messages', 'Test Messages', 'scroll test-messages');
@@ -58,21 +58,21 @@ cls.debug.create_debug_environment = function(params)
eventHandlers.change['test-messages'] = test_messages.get_bound_change_handler();
new CompositeView('debug_new', 'Debug', {
dir: 'v', width: 700, height: 700,
- children:
+ children:
[
{ height: 200, tabs: ['debug', 'test-messages'] }
]
});
-
+
new Settings
(
// id
- 'debug',
+ 'debug',
// kel-value map
{
'show-as-tab': true,
'pretty-print-messages': true
- },
+ },
// key-label map
{
'show-as-tab': 'Show view in a tab',
@@ -92,11 +92,15 @@ cls.debug.create_debug_environment = function(params)
[
{
handler: 'debug-clear-log',
- title: 'clear debug log'
+ title: 'Clear debug log'
},
{
handler: 'configure-message-filters',
title: 'Configure Message Filters'
+ },
+ {
+ handler: 'reload-dragonfly',
+ title: 'Reload Dragonfly'
}
]
)
@@ -106,7 +110,13 @@ cls.debug.create_debug_environment = function(params)
[
'pretty-print-messages',
]
- )
+ );
+
+ eventHandlers.click['reload-dragonfly'] = function(event, target)
+ {
+ window.location.reload();
+ }
+
eventHandlers.click['debug-clear-log'] = function(event, target)
{
window.debug.clear_log();
@@ -140,7 +150,7 @@ cls.debug.create_debug_environment = function(params)
eventHandlers.change['config-filter-msg'] = function(event, target)
{
- var
+ var
parent = event.target.parentNode.parentNode.parentNode,
msg = event.target.getAttribute('data-filter-target'),
type = parent.getAttribute('data-filter-type'),
@@ -174,12 +184,12 @@ cls.debug.create_debug_environment = function(params)
* Set a cookie named "key" to the value "value" with expiry in "time "
* seconds. If time is not set, time out after a year
*/
- this.set = function(key, value, time)
+ this.set = function(key, value, time)
{
document.cookie = (
key + "=" + encodeURIComponent(value) +
- "; expires=" +
- ( new Date( new Date().getTime() + ( time || 360*24*60*60*1000 ) ) ).toGMTString() +
+ "; expires=" +
+ ( new Date( new Date().getTime() + ( time || 360*24*60*60*1000 ) ) ).toGMTString() +
"; path=/");
return value;
}
@@ -187,7 +197,7 @@ cls.debug.create_debug_environment = function(params)
/**
* Get a cookie with name "key"
*/
- this.get = function(key)
+ this.get = function(key)
{
var value = new RegExp(key + "=([^;]*)").exec(document.cookie);
return value && decodeURIComponent(value[1]);
View
26 src/debug/configure_message_filter.js
@@ -1,7 +1,7 @@
window.cls || (window.cls = {});
cls.debug || (cls.debug = {});
-cls.debug.ConfigureMessgeFilters = function(id, name, container_class)
+cls.debug.ConfigureMessageFilters = function(id, name, container_class)
{
/* interface */
this.createView = function(container){};
@@ -29,15 +29,15 @@ cls.debug.ConfigureMessgeFilters = function(id, name, container_class)
['label',
['input',
'type', 'checkbox',
- 'data-filter-target', msg,
+ 'data-filter-target', msg,
'handler', 'config-filter-msg'
- ].concat(is_disabled ? ['disabled', 'disabled'] : []).
+ ].concat(is_disabled ? ['disabled', 'disabled'] : []).
concat(this[msg] ? ['checked', 'checked'] : []),
' '+ (label && typeof label == 'string' ? label : msg)
]
].concat(is_disabled ? ['class', 'disabled'] : []));
}
-
+
this._template_messages = function(service, title, type, messages, filter)
{
return (
@@ -53,37 +53,37 @@ cls.debug.ConfigureMessgeFilters = function(id, name, container_class)
this._template_service_config = function(service)
{
- var
+ var
ret = ['div'],
event_map_service = this._event_map[service],
messages = event_map_service.filter(this._filter_command),
filter = window.debug.get_log_filter()[service];
-
+
if (messages.length)
{
- ret.push(this._template_messages(service, 'Commands', 'commands',
+ ret.push(this._template_messages(service, 'Commands', 'commands',
['all'].concat(messages.map(this._get_message_class)), filter.commands));
}
messages = event_map_service.filter(this._filter_event);
if (messages.length)
{
- ret.push(this._template_messages(service, 'Events', 'events',
+ ret.push(this._template_messages(service, 'Events', 'events',
['all'].concat(messages.map(this._get_message_class)), filter.events));
}
return ret;
}
-
+
this._template_service = function(service)
{
// this is a temporary object with a view and a filter property
// to pass context to map
return (
- ['li',
+ ['li',
['input',
'type', 'button',
'handler', 'toggle-filter-messages',
'data-service-name', service
- ].concat(this.filter.all ? ['disabled', 'disabled'] : []),
+ ].concat(this.filter.all ? ['disabled', 'disabled'] : []),
['h3', window.helpers.service_class_name(service)],
(this.view._unfolded[service] ? this.view._template_service_config(service) : [])
].concat(this.view._unfolded[service] ? ['class', 'open']: []));
@@ -107,7 +107,7 @@ cls.debug.ConfigureMessgeFilters = function(id, name, container_class)
'data-filter-type', 'all',
'data-service-name', 'all',
],
- ['ul',
+ ['ul',
services.map(this._template_service, {view: this, filter: filter})
].concat(filter.all ? ['class', 'disabled'] : []),
'class', 'padding'
@@ -134,4 +134,4 @@ cls.debug.ConfigureMessgeFilters = function(id, name, container_class)
this.init(id, name, container_class);
}
-cls.debug.ConfigureMessgeFilters.prototype = ViewBase;
+cls.debug.ConfigureMessageFilters.prototype = ViewBase;
View
5 src/ecma-debugger/formatter.js
@@ -592,7 +592,7 @@ window.cls.SimpleJSParser = function()
{
__parse_error_line_buffer += __buffer;
- if(__parse_error_line_offset > __parse_error_line_buffer.length)
+ if(__parse_error_line_offset >= __parse_error_line_buffer.length)
{
read_buffer_default();
@@ -737,8 +737,7 @@ window.cls.SimpleJSParser = function()
__parse_error_line_offset = script.parse_error.error_line_offset;
__parse_error_line_buffer ='';
__parse_error_first_token = true;
- __parse_error_description =
- script.parse_error.reason + '\n' + script.parse_error.expected_token;
+ __parse_error_description = script.parse_error.description;
}
else
{
View
2  src/ecma-debugger/js-source-view.js
@@ -524,7 +524,7 @@ cls.JsSourceView = function(id, name, container_class)
}
if(script.parse_error)
{
- views.js_source.showLinePointer(script.parse_error.error_line, true )
+ views.js_source.showLinePointer(script.parse_error.error_line + 1, true )
}
}
__current_line = line_nr;
View
6 src/ecma-debugger/runtimes.js
@@ -644,8 +644,6 @@ cls.EcmascriptDebugger["5.0"].Runtimes = function()
if(__scripts[message[SCRIPT_ID]])
{
- var reason = /^[^:]*/.exec(message[DESCRIPTION]);
- var expected_token = /Expected token: '[^']*'/i.exec(message[DESCRIPTION]);
var error = __scripts[message[SCRIPT_ID]].parse_error =
{
runtime_id: message[RUNTIME_ID],
@@ -653,9 +651,7 @@ cls.EcmascriptDebugger["5.0"].Runtimes = function()
line_nr: message[LINE_NUMBER],
offset: message[OFFSET],
context: message[CONTEXT],
- description: message[DESCRIPTION],
- reason: reason && reason[0] || '',
- expected_token: expected_token && expected_token[0] || ''
+ description: message[DESCRIPTION]
};
if(settings['js_source'].get('error'))
{
View
208 src/ecma-debugger/view-commandline.js
@@ -42,11 +42,11 @@ cls.CommandLineView = function(id, name, container_class, html, default_handler)
__console_output.render
(
[
- 'pre',
- entry.value,
+ 'pre',
+ entry.value,
['d', ' [' + entry.obj_id + ']'],
- 'handler', 'inspect-object-link',
- 'rt-id', entry.runtime_id.toString(),
+ 'handler', 'inspect-object-link',
+ 'rt-id', entry.runtime_id.toString(),
'obj-id', entry.obj_id.toString()
]
);
@@ -56,14 +56,14 @@ cls.CommandLineView = function(id, name, container_class, html, default_handler)
__console_output.render
(
['pre', entry.value ].concat
- (
- entry.obj_id
+ (
+ entry.obj_id
? [
- 'handler', 'inspect-object-link',
- 'rt-id', entry.runtime_id.toString(),
+ 'handler', 'inspect-object-link',
+ 'rt-id', entry.runtime_id.toString(),
'obj-id', entry.obj_id.toString()
]
- : []
+ : []
)
);
}
@@ -119,71 +119,85 @@ cls.CommandLineView = function(id, name, container_class, html, default_handler)
PROTOTYPE_ID = 4,
NAME = 5;
- var value_type = message[TYPE];
-
- if( message[STATUS] == 'completed' )
+ if (status)
+ {
+ cons_out_render_return_val
+ (
+ console_output_data[console_output_data.length] =
+ {
+ type: "return-value",
+ value: ui_strings.S_INFO_NO_JAVASCRIPT_IN_CONTEXT
+ }
+ );
+ }
+ else
{
- var return_value = message[VALUE];
- if(return_value || /null|undefined/.test(value_type) )
+ var value_type = message[TYPE];
+
+ if( message[STATUS] == 'completed' )
{
- var value = return_value || '';
- if( !obj_id )
+ var return_value = message[VALUE];
+ if(return_value || /null|undefined/.test(value_type) )
{
- switch (value_type)
+ var value = return_value || '';
+ if( !obj_id )
{
- case 'string':
+ switch (value_type)
{
- var delimiter = "\"";
- // Escape ' and " Python command line interpreter style
- if (value.indexOf("\"") != -1) {
- delimiter = "'";
- if (value.indexOf("'") != -1) {
- value = value.replace(/'/g, "\\'");
+ case 'string':
+ {
+ var delimiter = "\"";
+ // Escape ' and " Python command line interpreter style
+ if (value.indexOf("\"") != -1) {
+ delimiter = "'";
+ if (value.indexOf("'") != -1) {
+ value = value.replace(/'/g, "\\'");
+ }
}
+ value = delimiter + value + delimiter;
+ break;
+ }
+ case 'null':
+ case 'undefined':
+ {
+ value = value_type;
+ break;
}
- value = delimiter + value + delimiter;
- break;
}
- case 'null':
- case 'undefined':
+ }
+ if(callback)
+ {
+ callback(runtime_id, obj_id);
+ }
+ cons_out_render_return_val
+ (
+ console_output_data[console_output_data.length] =
{
- value = value_type;
- break;
+ type: "return-value",
+ obj_id: obj_id,
+ runtime_id: runtime_id,
+ value: value
}
- }
+ );
+ __container.scrollTop = __container.scrollHeight;
}
- if(callback)
+ else if (return_value = message[OBJECT_VALUE])
{
- callback(runtime_id, obj_id);
+ var object_id = return_value[OBJECT_ID];
+ var tag = tagManager.set_callback(null, handleEval, [runtime_id, object_id, callback] );
+ var script_string = "return Object.prototype.toString.call(obj)";
+ services['ecmascript-debugger'].requestEval(tag,
+ [runtime_id, 0, 0, script_string, [['obj', object_id]]]);
}
- cons_out_render_return_val
- (
- console_output_data[console_output_data.length] =
- {
- type: "return-value",
- obj_id: obj_id,
- runtime_id: runtime_id,
- value: value
- }
- );
- __container.scrollTop = __container.scrollHeight;
- }
- else if (return_value = message[OBJECT_VALUE])
- {
- var object_id = return_value[OBJECT_ID];
- var tag = tagManager.set_callback(null, handleEval, [runtime_id, object_id, callback] );
- var script_string = "return Object.prototype.toString.call(obj)";
- services['ecmascript-debugger'].requestEval(tag,
- [runtime_id, 0, 0, script_string, [['obj', object_id]]]);
}
- }
- else
- {
- var error_id = message[OBJECT_VALUE][OBJECT_ID];
- if( error_id )
+ else
{
- var tag = tagManager.set_callback(null, handleError, [message[STATUS]]);
- services['ecmascript-debugger'].requestExamineObjects(tag, [runtime_id, [error_id]]);
+ var error_id = message[OBJECT_VALUE][OBJECT_ID];
+ if( error_id )
+ {
+ var tag = tagManager.set_callback(null, handleError, [message[STATUS]]);
+ services['ecmascript-debugger'].requestExamineObjects(tag, [runtime_id, [error_id]]);
+ }
}
}
}
@@ -192,14 +206,14 @@ cls.CommandLineView = function(id, name, container_class, html, default_handler)
{
const
OBJECT_LIST = 0,
- // sub message ObjectInfo
+ // sub message ObjectInfo
PROPERTY_LIST = 1,
- // sub message Property
+ // sub message Property
PROPERTY_NAME = 0,
PROPERTY_VALUE = 2;
- var
- obj = message[OBJECT_LIST][0],
+ var
+ obj = message[OBJECT_LIST][0],
props = obj && obj[PROPERTY_LIST] || [],
prop = null,
i = 0,
@@ -277,9 +291,9 @@ cls.CommandLineView = function(id, name, container_class, html, default_handler)
var submit = function(input)
{
- var
+ var
rt_id = runtimes.getSelectedRuntimeId(),
- frame_id = 0,
+ frame_id = 0,
thread_id = 0,
script_string = '',
command = '',
@@ -312,12 +326,11 @@ cls.CommandLineView = function(id, name, container_class, html, default_handler)
}
else
{
- alert(ui_strings.S_INFO_NO_RUNTIME_SELECTED);
+ opera.postError(ui_strings.DRAGONFLY_INFO_MESSAGE + " This should never happen");
}
}
-
var line_buffer_push = function(line)
{
line = line.replace(/\r\n/g, "");
@@ -339,7 +352,7 @@ cls.CommandLineView = function(id, name, container_class, html, default_handler)
{
/*
TODO use the Keyhandler Classes
- */
+ */
switch(event.keyCode)
{
case 46: // delete
@@ -349,7 +362,7 @@ cls.CommandLineView = function(id, name, container_class, html, default_handler)
}
// modifier keys shall not change the autocomplete state
case 16: // shift
- case 17: // ctrl
+ case 17: // ctrl
case 18: // alt
{
break;
@@ -378,7 +391,7 @@ cls.CommandLineView = function(id, name, container_class, html, default_handler)
{
/*
TODO use the Keyhandler Classes
- */
+ */
if(event.keyCode == 38 || event.keyCode == 40)
{
event.preventDefault();
@@ -415,12 +428,12 @@ cls.CommandLineView = function(id, name, container_class, html, default_handler)
}
-
+
eventHandlers.keypress['commandline'] = function(event)
{
/*
TODO use the Keyhandler Classes
- */
+ */
var target = event.target, key_code = event.keyCode;
if( !(event.shiftKey || event.ctrlKey || event.altKey ) )
{
@@ -431,12 +444,12 @@ cls.CommandLineView = function(id, name, container_class, html, default_handler)
{
// workaround as long as we don't have support for keyIdentifier
// event.which is 0 in a keypress event for function keys
- if( !event.which )
+ if( !event.which )
{
line_buffer_cursor += key_code == 38 ? -1 : 1;
- line_buffer_cursor =
+ line_buffer_cursor =
line_buffer_cursor < 0 ? line_buffer.length-1 : line_buffer_cursor > line_buffer.length-1 ? 0 : line_buffer_cursor;
- __textarea_value = event.target.value = (line_buffer.length ? line_buffer[line_buffer_cursor] : '').replace(/\r\n/g, '');
+ __textarea_value = event.target.value = (line_buffer.length ? line_buffer[line_buffer_cursor] : '').replace(/\r\n/g, '');
event.preventDefault();
break;
}
@@ -484,15 +497,15 @@ cls.CommandLineView = function(id, name, container_class, html, default_handler)
const
- SCRIPT = "var a = '', b= ''; for( a in %s ){ b += a + '_,_'; }; return b;",
+ SCRIPT = "(function(){var a = '', b= ''; for( a in %s ){ b += a + '_,_'; }; return b;})()",
KEY = 0,
DEPTH = 3;
var get_scope = function(path, old_args)
{
- var
+ var
rt_id = runtimes.getSelectedRuntimeId(),
- frame_id = 0,
+ frame_id = 0,
thread_id = 0;
if(rt_id)
@@ -534,12 +547,19 @@ cls.CommandLineView = function(id, name, container_class, html, default_handler)
}
}
var tag = tagManager.set_callback(null, handleEvalScope, [__frame_index, rt_id, path, old_args] );
- services['ecmascript-debugger'].requestEval(tag, [rt_id, thread_id,
+ services['ecmascript-debugger'].requestEval(tag, [rt_id, thread_id,
frame_id, SCRIPT.replace(/%s/, path)]);
}
else
{
- alert('select a window');
+ cons_out_render_return_val
+ (
+ console_output_data[console_output_data.length] =
+ {
+ type: "return-value",
+ value: "Select a window"
+ }
+ )
}
return null;
}
@@ -607,14 +627,14 @@ cls.CommandLineView = function(id, name, container_class, html, default_handler)
last_brace = str.lastIndexOf(')') <= last_brace ? last_brace : -1;
last_bracket = str.lastIndexOf(']') <= last_bracket ? last_bracket : -1;
str = str.slice( Math.max(
- last_brace,
- last_bracket,
- str.lastIndexOf('=') ) + 1
+ last_brace,
+ last_bracket,
+ str.lastIndexOf('=') ) + 1
).replace(/^ +/, '').replace(/ $/, '');
- var
- last_dot = str.lastIndexOf('.'),
- new_path = '',
+ var
+ last_dot = str.lastIndexOf('.'),
+ new_path = '',
new_id = '',
ret = '';
@@ -662,7 +682,7 @@ cls.CommandLineView = function(id, name, container_class, html, default_handler)
{
// it could be that this check is too simple
// basically the global scope is invalided with a new thread
- // but the tab completion feature is not very helpfull
+ // but the tab completion feature is not very helpfull
// with sites with intervals or timeouts
if( frame_index > -1 || frame_index != local_frame_index )
{
@@ -727,7 +747,7 @@ cls.CommandLineView = function(id, name, container_class, html, default_handler)
}
var checkToolbarVisibility = function(msg)
- {
+ {
var isMultiRuntime = host_tabs.isMultiRuntime();
if( toolbar_visibility != isMultiRuntime )
{
@@ -749,11 +769,11 @@ cls.CommandLineView.create_ui_widgets = function()
new Settings
(
// id
- 'command_line',
+ 'command_line',
// key-value map
{
"show-ecma-errors": true,
- },
+ },
// key-label map
{
"show-ecma-errors": ui_strings.S_SWITCH_SHOW_ECMA_ERRORS_IN_COMMAND_LINE
@@ -803,7 +823,7 @@ cls.CndRtSelect = function(id, class_name)
var rt = runtimes.getRuntime(selected_rt_id);
if( rt )
{
- return rt['title'] || helpers.shortenURI(rt.uri).uri;
+ return rt['title'] || helpers.shortenURI(rt.uri).uri;
}
}
return '';
@@ -822,9 +842,9 @@ cls.CndRtSelect = function(id, class_name)
if( active_window_id )
{
- var
+ var
_runtimes = runtimes.getRuntimes(active_window_id),
- rt = null,
+ rt = null,
i = 0;
for( ; ( rt = _runtimes[i] ) && !rt['selected']; i++);
@@ -843,7 +863,7 @@ cls.CndRtSelect = function(id, class_name)
var rt_id = parseInt(target_ele.getAttribute('rt-id'));
if( rt_id && rt_id != runtimes.getSelectedRuntimeId() )
{
- runtimes.setSelectedRuntimeId(rt_id)
+ runtimes.setSelectedRuntimeId(rt_id);
}
return true;
}
View
25 src/ecma-debugger/views-dom.js
@@ -85,21 +85,18 @@ cls.DOMView = function(id, name, container_class)
this.scrollTargetIntoView = function()
{
- var target = document.getElementById('target-element');
- var container = target;
- while( container && !/container/i.test(container.nodeName) &&
- ( container = container.parentElement) );
- if(target && container)
+ var target = document.getElementById('target-element'), container = target;
+ while (container && !/container/i.test(container.nodeName))
{
- // if there are no scrollbars scrollIntoView
- // causes a 'jump' of the whole viewport
- if (container.scrollHeight > container.offsetHeight)
- {
- target.scrollIntoView();
- }
- container.scrollTop -=
- ( container.offsetHeight < 100 ? container.offsetHeight * .7 : 100 ) -
- ( target.offsetTop - container.scrollTop );
+ container = container.parentElement;
+ }
+ if (target && container)
+ {
+ container.scrollTop -= (
+ container.getBoundingClientRect().top -
+ target.getBoundingClientRect().top +
+ Math.min(container.offsetHeight * .5, 100)
+ );
container.scrollLeft = 0;
}
return target && container;
View
2  src/exec/color_picker_data.js
@@ -286,7 +286,7 @@ cls.Exec["2.0"].ColorPickerDate = function()
also it would not work with e.g. flash videos.
if this will not work we will have to try that. */
click_catcher = (document.body || document.documentElement).
- appendChild(document.createElement('click-catcher'));
+ appendChild(document.createElementNS('http://www.w3.org/1999/xhtml', 'click-catcher'));
click_catcher.style.cssText =
"display: block !important;" +
"margin: 0 !important;" +
View
6 src/exec/color_picker_view.js
@@ -151,7 +151,7 @@ cls.Exec["2.0"].ColorPicker = function(id, name, container_class)
this._selected_color = hex;
}
- this._set_dimesions = function(container, screenshot_width, screenshot_height)
+ this._set_dimensions = function(container, screenshot_width, screenshot_height)
{
this._width = container.offsetWidth - (2 * 280);
this._height = container.offsetHeight - (2* 12);
@@ -177,7 +177,7 @@ cls.Exec["2.0"].ColorPicker = function(id, name, container_class)
this._container = container;
var scale = window.settings['color_picker'].get('color-picker-scale');
scale != this._scale && ( this._scale = scale);
- this._set_dimesions(container);
+ this._set_dimensions(container);
container.render(window.templates.color_picker(
this._screenshot_width,
this._screenshot_height,
@@ -228,7 +228,7 @@ cls.Exec["2.0"].ColorPicker = function(id, name, container_class)
var area = JSON.parse(json_obj);
if (this.isvisible())
{
- this._set_dimesions (this._container, area.w, area.h);
+ this._set_dimensions (this._container, area.w, area.h);
this._container.innerHTML = "";
this.createView(this._container);
}
View
24 src/exec/templates.js
@@ -8,18 +8,18 @@ window.templates.color_picker = function(
return (
['div',
['div',
- ['h2', 'Pixel Magnifier and Color Picker'],
+ ['h2', ui_strings.M_VIEW_LABEL_COLOR_MAGNIFIER_AND_PICKER],
['p',
['label',
- 'Area' + ': ',
+ ui_strings.S_LABEL_UTIL_SCALE + ': ',
['select',
- this.color_picker_create_dimesion_select(screenshot_width, screenshot_height),
+ this.color_picker_create_dimension_select(screenshot_width, screenshot_height),
'id', 'color-picker-area',
'handler', 'update-area']
],
' ',
['label',
- 'Scale' + ': ',
+ ui_strings.S_LABEL_UTIL_SCALE + ': ',
['select',
this.color_picker_create_scale_select(scale, delta_scale),
'id', 'color-picker-scale',
@@ -29,16 +29,16 @@ window.templates.color_picker = function(
['p',
['input',
'type', 'button',
- 'value', 'Reset default values',
+ 'value', ui_strings.S_BUTTON_COLOR_RESTORE_DEFAULTS,
'handler', 'color-picker-reset-default-values'],
'class', 'color-picker-button-controls'
],
- ['h2', 'Stored colors'],
+ ['h2', ui_strings.M_VIEW_LABEL_STORED_COLORS],
this.color_picker_stored_colors(),
['p',
['input',
'type', 'button',
- 'value', 'Manage stored colors',
+ 'value', ui_strings.S_BUTTON_COLOR_MANAGE_STORED,
'handler', 'color-picker-manage-stored-colors'],
'class', 'color-picker-button-controls'
],
@@ -55,14 +55,14 @@ window.templates.color_picker = function(
'handler', 'color-picker-picked'],
'class', 'color-picker'],
['div',
- ['h2', 'Color Select'],
+ ['h2', ui_strings.M_VIEW_LABEL_COLOR_SELECT],
this.color_picker_average_select(),
['div', 'id', 'center-color'],
['pre', 'id', 'center-color-values'],
['p',
['input',
'type', 'button',
- 'value', 'Store color',
+ 'value', ui_strings.S_BUTTON_COLOR_STORE_COLOR,
'handler', 'color-picker-store-color'],
'class', 'color-picker-button-controls'
],
@@ -95,7 +95,7 @@ window.templates.manage_stored_colors = function()
return (
['div',
['div',
- ['h2', 'Manage stored colors'],
+ ['h2', ui_strings.S_BUTTON_COLOR_MANAGE_STORED],
['ul',
(window.settings.color_picker.get('color-picker-stored-colors') || []).map(this.color_picker_manage_stored_color, this),
@@ -136,13 +136,13 @@ window.templates.color_picker_average_select = function()
}
return (
['p',
- ['label', 'Average color of ',
+ ['label', 'FIXMEAverage color of ',
['select', ret, 'handler', 'update-average'],
' pixels'],
]);
}
-window.templates.color_picker_create_dimesion_select = function(width, height)
+window.templates.color_picker_create_dimension_select = function(width, height)
{
// width and height are the actual pixel values of the screenshot
var
View
11 src/http-logger/httplogger_view.js
@@ -43,7 +43,7 @@ cls.HttpLogger["2.0"].RequestListView = function(id, name, container_class)
// later if it isn't allready so.
if (!updateTimer) {
updateTimer = window.setTimeout(
- function() { self.createView(container) },
+ function() { self.createView(container); },
this.minUpdateInterval
);
}
@@ -79,7 +79,7 @@ cls.HttpLogger["2.0"].RequestListView = function(id, name, container_class)
if (log.length && log[0].id == keyEntryId) {
return true;
} else {
- if (log.length) { keyEntryId = log[0].id }
+ if (log.length) { keyEntryId = log[0].id; }
return false;
}
};
@@ -91,6 +91,7 @@ cls.HttpLogger["2.0"].RequestListView = function(id, name, container_class)
this.doCreateView = function(container)
{
var log = HTTPLoggerData.getLog();
+ topCell.statusbar.updateInfo(ui_strings.S_HTTP_TOOLBAR_REQUEST_COUNT.replace("%s", log.length));
if (!this.viewIsValid(log)) {
container.clearAndRender(['table',['tbody'], 'class',
@@ -101,9 +102,9 @@ cls.HttpLogger["2.0"].RequestListView = function(id, name, container_class)
if (log.length) {
var times = log.map(function(e) {
- return e.response ? e.response.time : e.request.time
+ return e.response ? e.response.time : e.request.time;
});
- var times = times.sort();
+ times = times.sort();
var lastTime = times[times.length-1];
} else {
var lastTime = new Date().getTime();
@@ -155,7 +156,7 @@ cls.HttpLogger["2.0"].RequestListView = function(id, name, container_class)
{
e.className = e.className.replace("expanded", "collapsed");
tableBodyEle.removeChild(e.nextSibling);
- return
+ return;
}
}
};
View
74 src/scripts/cell-layout.js
@@ -17,10 +17,10 @@
this.init = function(rough_cell, dir, parent, container)
{
- this.width =
+ this.width =
rough_cell.width && rough_cell.width > defaults.min_width ?
rough_cell.width : defaults.min_width;
- this.height =
+ this.height =
rough_cell.height && rough_cell.height > defaults.min_height ?
rough_cell.height : defaults.min_height;
this.id = rough_cell.id || getId();
@@ -110,13 +110,13 @@
}
else
{
- opera.postError(ui_strings.DRAGONFLY_INFO_MESSAGE +
+ opera.postError(ui_strings.DRAGONFLY_INFO_MESSAGE +
'missing container in cell.update');
}
}
if(this.is_dirty)
{
- ele.style.cssText =
+ ele.style.cssText =
'left:' + ( this.left = left ) + 'px;' +
'top:' + ( this.top = top ) + 'px;' +
'width:' + this.width + 'px;' +
@@ -125,7 +125,7 @@
this.is_dirty = false;
}
}
-
+
// create sliders
@@ -143,16 +143,16 @@
}
else
{
- opera.postError(ui_strings.DRAGONFLY_INFO_MESSAGE +
+ opera.postError(ui_strings.DRAGONFLY_INFO_MESSAGE +
'missing container in cell.update');
}
}
if( is_dirty )
{
-
+
if( this.dir == HOR )
{
- ele.style.cssText =
+ ele.style.cssText =
'left:' + left + 'px;' +
'top:' + ( 2 * defaults.view_border_width + top + this.height ) + 'px;' +
'width:' + ( 2 * defaults.view_border_width + this.width ) + 'px;' +
@@ -160,7 +160,7 @@
}
else
{
- ele.style.cssText =
+ ele.style.cssText =
'left:' + ( 2 * defaults.view_border_width + left + this.width ) + 'px;' +
'top:' + top + 'px;' +
'width:' + defaults.border_width + 'px;' +
@@ -169,10 +169,10 @@
}
}
- return ( this.dir == VER ? this.width : this.height ) +
+ return ( this.dir == VER ? this.width : this.height ) +
2 * defaults.view_border_width + defaults.border_width;
}
- // helper to get the totalised dimesion
+ // helper to get the totalised dimension
this.checkChildren = function(dim)
{
var child = null, i = 0, sum = 0, length = this.children.length;
@@ -209,11 +209,11 @@
}
else
{
- this.children[length][dim] = defaults['min_' + dim ];
+ this.children[length][dim] = defaults['min_' + dim ];
}
}
- // min_width is to big
+ // min_width is to big
if( !length )
{
@@ -224,10 +224,10 @@
{
this.children[i][dim] = average_width;
}
- this.children[length - 1][dim] = sum - ( length - 1 ) * average_width;
+ this.children[length - 1][dim] = sum - ( length - 1 ) * average_width;
}
- // inherit one dimesion from the parent
+ // inherit one dimension from the parent
dim = this.dir == HOR ? 'height' : 'width';
for( i = 0 ; child = this.children[i]; i++)
@@ -238,7 +238,7 @@
}
}
-
+
this.getCellById = function(id)
{
var child = null, i = 0, ret = null;
@@ -256,9 +256,9 @@
return null;
}
- // confirme the tested dimesions
+ // confirme the tested dimensions
- this.setCheckedDimesions = function()
+ this.setCheckedDimensions = function()
{
if( this.checked_height )
{
@@ -273,20 +273,20 @@
var child = null, i = 0;
for( ; ( child = this.children[i] ) ; i++)
{
- child.setCheckedDimesions();
+ child.setCheckedDimensions();
}
}
// clear the tested dimensions
- this.clearCheckedDimesions = function()
+ this.clearCheckedDimensions = function()
{
this.checked_height = this.checked_width = 0;
this.is_dirty = false;
var child = null, i = 0;
for( ; ( child = this.children[i] ) ; i++)
{
- child.clearCheckedDimesions();
+ child.clearCheckedDimensions();
}
}
@@ -351,7 +351,7 @@
{
this['checked_' + dim] = defaults['min_' + dim]
}
- delta_applied = delta - ( this['checked_' + dim] - this[dim] );
+ delta_applied = delta - ( this['checked_' + dim] - this[dim] );
}
else // clear
{
@@ -360,13 +360,13 @@
}
return delta_applied;
}
-
+
this.getCapTarget = function(dim, target)
{
if( !this.children.length ) return 0;
- var child = null, i = 0, length = this.children.length - 1,
+ var child = null, i = 0, length = this.children.length - 1,
sum = length * 2 * defaults.view_border_width + ( length ) * defaults.border_width;
-
+
for( ; ( child = this.children[i] ) ; i++)
{
if( child != target )
@@ -376,7 +376,7 @@
}
return this[dim] - sum;
}
-
+
this.handleResizeEvent = function(event, _delta)
{
var dim = this.dir == HOR ? 'height' : 'width';
@@ -400,21 +400,21 @@
}
while (sibling && consumed);
cap_holder = this;
-
+
//cap = this.parent.getCapTarget(dim, this) - this[dim];
/*
if( cap = delta + consumed )
{
this.checkDelta(dim, cap, 'next');
- this.parent.setCheckedDimesions();
+ this.parent.setCheckedDimensions();
this.parent.update(this.parent.left, this.parent.top);
}
else
{
- this.parent.clearCheckedDimesions();
+ this.parent.clearCheckedDimensions();
}
*/
-
+
}
else
{
@@ -429,28 +429,28 @@
if( cap = delta + consumed )
{
this.next.checkDelta(dim, cap, 'next');
- this.parent.setCheckedDimesions();
+ this.parent.setCheckedDimensions();
this.parent.update(this.parent.left, this.parent.top);
}
else
{
- this.parent.clearCheckedDimesions();
+ this.parent.clearCheckedDimensions();
}
*/
-
+
}
-
+
if( cap = delta + consumed )
{
cap_holder.checkDelta(dim, cap, 'next');
- this.parent.setCheckedDimesions();
+ this.parent.setCheckedDimensions();
this.parent.update(this.parent.left, this.parent.top);
}
else
{
- this.parent.clearCheckedDimesions();
+ this.parent.clearCheckedDimensions();
}
-
+
}
}
}
View
80 src/ui-scripts/cells.js
@@ -120,10 +120,10 @@
this.init = function(rough_cell, dir, parent, container_id)
{
- this.width =
+ this.width =
rough_cell.width && rough_cell.width > defaults.min_view_width ?
rough_cell.width : defaults.min_view_width;
- this.height =
+ this.height =
rough_cell.height && rough_cell.height > defaults.min_view_height ?
rough_cell.height : defaults.min_view_height;
ids[ this.id = rough_cell.id || getId()] = this;
@@ -146,7 +146,7 @@
var rough_children = rough_cell.children, rough_child = null, i = 0;
var child = null, previous = null, next = null;
-
+
if( rough_children )
{
@@ -163,7 +163,7 @@
// is previoue set for the last?
}
}
- else
+ else
{
this.appendUiNodes();
@@ -237,7 +237,7 @@
}
else
{
-
+
this.toolbar.setDimensions(force_redraw);
this.tab.setDimensions(force_redraw);
this.container.setDimensions(force_redraw, is_resize);
@@ -246,7 +246,7 @@
this.is_dirty = false;
}
}
-
+
// create sliders
@@ -256,7 +256,7 @@
if( !ele )
{
var container = document.getElementById( this.container_id ) || window.viewport; // set name in defualts
-
+
if( container )
{
ele = container.appendChild( document.createElement(defaults.slider_name));
@@ -265,16 +265,16 @@
}
else
{
- opera.postError(ui_strings.DRAGONFLY_INFO_MESSAGE +
+ opera.postError(ui_strings.DRAGONFLY_INFO_MESSAGE +
'missing container in cell.update');
}
}
if( is_dirty )
{
-
+
if( this.dir == HOR )
{
- css_text =
+ css_text =
'left:' + left + 'px;' +
'top:' + ( 2 * defaults.view_border_width + top + this.height ) + 'px;' +
'width:' + ( 2 * defaults.view_border_width + this.width ) + 'px;' +
@@ -282,7 +282,7 @@
}
else
{
- css_text =
+ css_text =
'left:' + ( 2 * defaults.view_border_width + left + this.width ) + 'px;' +
'top:' + top + 'px;' +
'width:' + defaults.slider_border_width + 'px;' +
@@ -295,11 +295,11 @@
}
}
- return ( this.dir == VER ? this.width : this.height ) +
+ return ( this.dir == VER ? this.width : this.height ) +
2 * defaults.view_border_width + defaults.slider_border_width;
}
- // helper to get the totalised dimesion
+ // helper to get the totalised dimension
this.checkChildren = function(dim)
{
@@ -337,11 +337,11 @@
}
else
{
- this.children[length][dim] = defaults['min_view_' + dim ];
+ this.children[length][dim] = defaults['min_view_' + dim ];
}
}
- // min_width is to big
+ // min_width is to big
if( !length )
{
@@ -352,10 +352,10 @@
{
this.children[i][dim] = average_width;
}
- this.children[length - 1][dim] = sum - ( length - 1 ) * average_width;
+ this.children[length - 1][dim] = sum - ( length - 1 ) * average_width;
}
- // inherit one dimesion from the parent
+ // inherit one dimension from the parent
dim = this.dir == HOR ? 'height' : 'width';
for( i = 0 ; child = this.children[i]; i++)
@@ -366,7 +366,7 @@
}
}
-
+
this.getCellById = function(id)
{
return ids[id];
@@ -377,9 +377,9 @@
delete ids[id];
}
- // confirme the tested dimesions
+ // confirme the tested dimensions
- this.setCheckedDimesions = function()
+ this.setCheckedDimensions = function()
{
if( this.checked_height )
{
@@ -396,20 +396,20 @@
var child = null, i = 0;
for( ; ( child = this.children[i] ) ; i++)
{
- child.setCheckedDimesions();
+ child.setCheckedDimensions();
}
}
// clear the tested dimensions
- this.clearCheckedDimesions = function()
+ this.clearCheckedDimensions = function()
{
this.checked_height = this.checked_width = 0;
this.is_dirty = false;
var child = null, i = 0;
for( ; ( child = this.children[i] ) ; i++)
{
- child.clearCheckedDimesions();
+ child.clearCheckedDimensions();
}
}
@@ -474,7 +474,7 @@
{
this['checked_' + dim] = defaults['min_view_' + dim]
}
- delta_applied = delta - ( this['checked_' + dim] - this[dim] );
+ delta_applied = delta - ( this['checked_' + dim] - this[dim] );
}
else // clear
{
@@ -483,13 +483,13 @@
}
return delta_applied;
}
-
+
this.getCapTarget = function(dim, target)
{
if( !this.children.length ) return 0;
- var child = null, i = 0, length = this.children.length - 1,
+ var child = null, i = 0, length = this.children.length - 1,
sum = length * 2 * defaults.view_border_width + ( length ) * defaults.slider_border_width;
-
+
for( ; ( child = this.children[i] ) ; i++)
{
if( child != target )
@@ -502,7 +502,7 @@
this.handleResizeEvent = function(event, _delta)
{
-
+
var dim = this.dir == HOR ? 'height' : 'width';
var pos = this.dir == HOR ? 'top' : 'left';
var delta = Math.round( event[this.dir == HOR ? 'pageY' : 'pageX'] - _delta - ( this[pos] + this[dim] ) );
@@ -524,21 +524,21 @@
}
while (sibling && consumed);
cap_holder = this;
-
+
//cap = this.parent.getCapTarget(dim, this) - this[dim];
/*
if( cap = delta + consumed )
{
this.checkDelta(dim, cap, 'next');
- this.parent.setCheckedDimesions();
+ this.parent.setCheckedDimensions();
this.parent.update(this.parent.left, this.parent.top);
}
else
{
- this.parent.clearCheckedDimesions();
+ this.parent.clearCheckedDimensions();
}
*/
-
+
}
else
{
@@ -553,34 +553,34 @@
if( cap = delta + consumed )
{
this.next.checkDelta(dim, cap, 'next');
- this.parent.setCheckedDimesions();
+ this.parent.setCheckedDimensions();
this.parent.update(this.parent.left, this.parent.top);
}
else
{
- this.parent.clearCheckedDimesions();
+ this.parent.clearCheckedDimensions();
}
*/
-
+
}
-
+
if( cap = delta + consumed )
{
cap_holder.checkDelta(dim, cap, 'next');
- this.parent.setCheckedDimesions();
+ this.parent.setCheckedDimensions();
this.parent.update(this.parent.left, this.parent.top);
}
else
{
- this.parent.clearCheckedDimesions();
+ this.parent.clearCheckedDimensions();
}
-
+
}
}
}
/**
- * @constructor
+ * @constructor
* @extends ViewBase
*/
View
22 src/ui-scripts/topCell.js
@@ -1,6 +1,6 @@
/**
- * @constructor
+ * @constructor
* @extends CellBase
* a bit different from a normal cell, it holds the main view ui elements but also the main conatiner
*/
@@ -9,7 +9,7 @@ var TopCell = function(layout, setDimensions, onresize, TopToolbar, TopStatusbar
{
var self = this;
var resize_timeout = new Timeouts();
- this.setStartDimesions = setDimensions || function()
+ this.setStartDimensions = setDimensions || function()
{
this.top = 0;
this.left = 0;
@@ -18,7 +18,7 @@ var TopCell = function(layout, setDimensions, onresize, TopToolbar, TopStatusbar
};
this.onresize = onresize || function()
{
- this.setStartDimesions();
+ this.setStartDimensions();
this.update();
var view_id = this.tab && this.tab.activeTab;
if( view_id )
@@ -33,7 +33,7 @@ var TopCell = function(layout, setDimensions, onresize, TopToolbar, TopStatusbar
self.onresize();
messages.post('resize');
}
-
+
var setDelayedResize = function()
{
resize_timeout.set(delayed_resize, 32);
@@ -83,7 +83,7 @@ var TopCell = function(layout, setDimensions, onresize, TopToolbar, TopStatusbar
}
-
+
this.showView = function(view_id)
{
@@ -147,9 +147,9 @@ var TopCell = function(layout, setDimensions, onresize, TopToolbar, TopStatusbar
this.addTemporaryTabs = function()
{
- var
+ var
store = global_state.ui_framework.temporary_tabs,
- view_id = '',
+ view_id = '',
i = 0;
for( ; view_id = store[i]; i++)
@@ -166,7 +166,7 @@ var TopCell = function(layout, setDimensions, onresize, TopToolbar, TopStatusbar
// constructor calls
window.topCell = this;
this.init(layout);
- this.setStartDimesions();
+ this.setStartDimensions();
if(this.toolbar)
{
this.toolbar.setup(this.id);
@@ -177,11 +177,11 @@ var TopCell = function(layout, setDimensions, onresize, TopToolbar, TopStatusbar
}
this.addTemporaryTabs();
this.tab.setActiveTab
- (
- global_state
+ (
+ global_state
&& global_state.ui_framework.last_selected_top_tab
&& composite_view_convert_table[opera.attached.toString()][global_state.ui_framework.last_selected_top_tab]
- || this.tab.tabs[0].ref_id
+ || this.tab.tabs[0].ref_id
);
this.container.setup(this.id);
this.update(this.left, this.top, true);
View
16 src/ui-scripts/viewSlider.js
@@ -1,18 +1,18 @@
/**
- * @constructor
+ * @constructor
*/
var SlideViews = function(container)
{
const VER = 'v', HOR = 'h';
- var self = this;
+ var self = this;
var focus_catcher = null;
var mousedownevents = null;
var resizehandler = function()
{
- if( !self.checkDimesions() )
+ if( !self.checkDimensions() )
{
self.cell.update(self.cell.left, self.cell.top, true);
}
@@ -29,8 +29,8 @@ var SlideViews = function(container)
var intervaled_mousemovehandler = function(event)
{
_target.handleResizeEvent(_event, _delta);
-
- }
+
+ }
var mousemovehandler = function(event)
{
@@ -69,7 +69,7 @@ var SlideViews = function(container)
}
else
{
- opera.postError(ui_strings.DRAGONFLY_INFO_MESSAGE +
+ opera.postError(ui_strings.DRAGONFLY_INFO_MESSAGE +
'missing target in mousedownhandler in slideViews');
}
@@ -77,10 +77,10 @@ var SlideViews = function(container)
{
focus_catcher = UIBase.getFocusCatcher();
}
-
+
}
}
- container.addEventListener('mousedown', mousedownhandler, false);
+ container.addEventListener('mousedown', mousedownhandler, false);
}
View
50 src/ui-scripts/window.js
@@ -1,5 +1,5 @@
/**
- * @constructor
+ * @constructor
*/
var UIWindowBase = new function()
@@ -14,14 +14,14 @@ var UIWindowBase = new function()
}
this.default_width = 500;
- this.default_height = 300;
+ this.default_height = 300;
this.default_top = 100;
this.default_left = 100;
-
-
- var
- min_width = 200,
+
+
+ var
+ min_width = 200,
min_height = 100,
min_z_index = 100;
@@ -54,13 +54,13 @@ var UIWindowBase = new function()
{
var win = viewport.render(templates._window(this));
-
+
if( this.toolbar )
{
this.toolbar.setDimensions();
this.toolbar.setup(this.view_id);
}
-
+
this.container.setup(this.view_id);
this.statusbar.setup(this.view_id);
@@ -70,8 +70,8 @@ var UIWindowBase = new function()
this._delete = function(id)
{
- var
- _id = '',
+ var
+ _id = '',
i = 0;
for( ; ( _id = ids[i] ) && _id != id; i++);
if(_id)
@@ -89,7 +89,7 @@ var UIWindowBase = new function()
for( ; id = ids[i]; i++)
{
win = document.getElementById( id );
- if( win )
+ if( win )
{
if( ( z = parseInt( win.style.zIndex ) ) && z > min_z_index )
win.style.zIndex = z - 1;
@@ -102,7 +102,7 @@ var UIWindowBase = new function()
var win = null, id = '', i = 0;
for( ; id = ids[i]; i++)
{
- if( ui_windows[id].view_id == view_id )
+ if( ui_windows[id].view_id == view_id )
{
return ui_windows[id];
}
@@ -141,8 +141,8 @@ var UIWindowBase = new function()
/* event handling */
- var
- handlers =
+ var
+ handlers =
{
'window-scale-top-left': true,
'window-scale-top': true,
@@ -160,7 +160,7 @@ var UIWindowBase = new function()
current_target = null,
__event = null,
interval = 0,
- current_style = null,
+ current_style = null,
update_handler = null,
left_delta = 0,
top_delta = 0,
@@ -174,7 +174,7 @@ var UIWindowBase = new function()
__event = event;
focus_catcher.focus();
},
-
+
force_reflow_shadows = function()
{
if(window_shadows)
@@ -189,7 +189,7 @@ var UIWindowBase = new function()
"<window-shadow class='bottom'></window-shadow>" +
"<window-shadow class='bottom-right'></window-shadow>";
}
- }
+ },
mousedown = function(event)
{
@@ -292,7 +292,7 @@ var UIWindowBase = new function()
{
current_style.height = ( current_target.height = height ) + 'px';
current_style.top = ( current_target.top = top ) + 'px';
- current_target.update();
+ current_target.update();
focus_catcher.focus();
}
}
@@ -311,7 +311,7 @@ var UIWindowBase = new function()
if( width > min_width )
{
current_style.width = ( current_target.width = width ) + 'px';
- current_target.update();
+ current_target.update();
focus_catcher.focus();
}
}
@@ -333,7 +333,7 @@ var UIWindowBase = new function()
{
current_style.width = ( current_target.width = width ) + 'px';
current_style.left = ( current_target.left = left ) + 'px';
- current_target.update();
+ current_target.update();
focus_catcher.focus();
}
}
@@ -352,7 +352,7 @@ var UIWindowBase = new function()
if( height > min_height )
{
current_style.height = ( current_target.height = height ) + 'px';
- current_target.update();
+ current_target.update();
focus_catcher.focus();
force_reflow_shadows();
}
@@ -414,7 +414,7 @@ var UIWindowBase = new function()
{
ref_obj = ui_windows[win.id];
ref_obj.container.onclose();
- messages.post("hide-view", {id: win.getAttribute('ref_id')});
+ messages.post("hide-view", {id: win.getAttribute('view_id')});
win.parentElement.removeChild(win);
}
}
@@ -426,7 +426,7 @@ var UIWindowBase = new function()
if(!viewport)
{
self.showWindow = function(){};
- opera.postError(ui_strings.DRAGONFLY_INFO_MESSAGE +
+ opera.postError(ui_strings.DRAGONFLY_INFO_MESSAGE +
'missing view port in init in windows');
}
}
@@ -434,11 +434,11 @@ var UIWindowBase = new function()
document.addEventListener('mousedown', mousedown, false);
document.addEventListener('click', mouseclick, false);
window.addEventListener('load', init, false);
-
+
}
/**
- * @constructor
+ * @constructor
* @extends UIWindowBase
*/
View
31 src/ui-strings/ui_strings-en.js
@@ -127,10 +127,19 @@ ui_strings.M_VIEW_LABEL_SESSION_STORAGE = 'Session Storage';
ui_strings.M_VIEW_LABEL_COOKIES = 'Cookies';