Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

1st try @ 11.0 compatibility

  • Loading branch information...
commit b698e3f17661d59bfce5b40e3e495fccfdf3f133 1 parent 8cfc093
@Dither authored
View
2  config.xml
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
-<widget xmlns="http://www.w3.org/ns/widgets" id="extensions:readable-javascript" version="1.1">
+<widget xmlns="http://www.w3.org/ns/widgets" id="extensions:readable-javascript" version="1.11">
<name>Readable JavaScript</name>
<author href="http://my.opera.com/DitherSky/blog/">Dither</author>
<description>Extension for auto-formatting and colorizing JavaScript code. Triggered by files with .js extension in their URL or by toolbar button.</description>
View
3  includes/injected.js
@@ -3,7 +3,7 @@ if (!window.location.href.match(/\.js(?:\?|$)/) || typeof document === 'undefine
var storage;
if (typeof widget === 'undefined' || typeof widget.preferences === 'undefined') {
- storage = {'autoparse_js': 'false','enable_button': 'true','indent_size': '4','preserve_newlines':'true','keep_array_indentation':'true','detect_packers':'true','braces_on_own_line':'false','indent_char':' ','debug_output':'false','enable_coloring':'false'}
+ storage = window.opera.scriptStorage;
} else { storage = widget.preferences; }
function log(){ if (s2b(storage['debug_output'])) opera.postError(Array.prototype.slice.call(arguments))}
@@ -32,6 +32,7 @@ if (!window.location.href.match(/\.js(?:\?|$)/) || typeof document === 'undefine
cursor: pointer;\
background-image: -o-linear-gradient( top, rgb(250,233,167) 0%, rgb(254,243,197) 100% );\
border-bottom: 1px solid #8e8e8e;\
+ background-color: #FEF3C5;\
padding-top: 6px;\
padding-left: 12px;\
font-family: "Helvetica", "Arial", sans-serif;\
View
7 index.html
@@ -4,7 +4,12 @@
<title>Readable JavaScript</title>
<script type="text/javascript">
window.addEventListener('load', function () {
-if (typeof widget === 'undefined' || typeof widget.preferences === 'undefined' || (widget.preferences['enable_button'] === 'true')) {
+var storage;
+if (typeof widget === 'undefined' || typeof widget.preferences === 'undefined') {
+ storage = window.opera.scriptStorage;
+} else { storage = widget.preferences; }
+
+if (storage['enable_button'] === 'true') {
var theButton;
var toolbarUIItemProperties = {
title: 'Readable JavaScript',
View
5 options.html
@@ -66,8 +66,9 @@ <h3 id='label_preferences'>Preferences</h3>
addEventListener('DOMContentLoaded', function() {
var storage;
-if (typeof widget === 'undefined' || typeof widget.preferences === 'undefined' ) {window.alert("Opera "+(window.navigator.userAgent.match(/(Version\/)(\d+\.\d+)/))[2]+" doesn't support widget.preferences.\nThis extension will be always using predefined options.");
-storage = {'autoparse_js': 'false','enable_button': 'true','indent_size': '4','preserve_newlines':'true','keep_array_indentation':'true','detect_packers':'true','braces_on_own_line':'false','indent_char':' ','debug_output':'false','enable_coloring':'false'}
+if (typeof widget === 'undefined' || typeof widget.preferences === 'undefined' ) {
+//opera.postError("Opera "+(window.navigator.userAgent.match(/(Version\/)(\d+\.\d+)/))[2]+" doesn't support widget.preferences.\nThis extension will be always using predefined options.");
+storage = window.opera.scriptStorage
} else { storage = widget.preferences; }
function setRadioValue(radioNodeList, value) {
View
2  popup.html
@@ -13,7 +13,7 @@
var storage;
if (typeof widget === 'undefined' || typeof widget.preferences === 'undefined') {
- storage = {'autoparse_js': 'false','enable_button': 'true','indent_size': '4','preserve_newlines':'true','keep_array_indentation':'true','detect_packers':'true','braces_on_own_line':'false','indent_char':' ','debug_output':'false','enable_coloring':'false'}
+ storage = window.opera.scriptStorage;
} else { storage = widget.preferences; }
function make_readable() {
Please sign in to comment.
Something went wrong with that request. Please try again.