Sha256: f9f5c15027b732f565c36fadf5e7c2396a2df0e8160a8c58d3076304ed728443

Contents?: true

Size: 1000 Bytes

Versions: 2

Compression:

Stored size: 1000 Bytes

Contents

#!/bin/sh

DESTINATION=beautifier.js

echo '// ==UserScript==
// @name        Scripts beautifier for Opera
// @author      Rafal Chlodnicki
// @author      Einar Lielmanis
// @version     1.1
// @include     *
// ==/UserScript==

(function(){

  // Enabling this setting will beautify all scripts on page
  var enabled = /*@Beautify all scripts@bool@*/false/*@*/;

  /* Specially formated comment above is for use with Opera Unite UJS Manager
     https://unite.opera.com/application/401/ */

' > $DESTINATION
cat ../beautify.js >> $DESTINATION

echo '
  var toString = String.prototype.toString;

  // Set up tidy method on strings and functions
  // @returns beautified string representation
  var tidy =
    Function.prototype.tidy =
    String.prototype.tidy =
    function(){ return js_beautify( toString.call(this) ) };

  if (enabled)
  {
    opera.addEventListener("BeforeScript", function(ev) {
      ev.element.text = tidy.call(ev.element.text);
    }, false);
  }

})();
' >> $DESTINATION

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
js-beautify-0.1.8 js-beautify-copy/attic/opera-userscript/make_opera_userscript.sh
js-beautify-0.1.7 js-beautify-copy/attic/opera-userscript/make_opera_userscript.sh