Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

initial interface

  • Loading branch information...
commit dba6efe04ed88b7df2638f4fd1a000c09088e9ae 1 parent 3e201f6
@SlexAxton authored
Showing with 75 additions and 2 deletions.
  1. +10 −1 index.html
  2. +64 −0 js/uglifui.js
  3. +1 −1  js/uglifyjs/lib/squeeze-more.js
View
11 index.html
@@ -6,7 +6,16 @@
<link rel="stylesheet" href="css/main.css" media="all" />
</head>
<body>
- Nothing to see here yet.
+ <h1>UglifUI</h1>
+ <form id="ugForm" action="" method="GET">
+ <fieldset>
+ <label for="code">Code</label><br />
+ <textarea rows="20" cols="105" id="code"></textarea>
+ <br />
+ <input type="submit" id="uglify" value="Uglify" />
+ </fieldset>
+ </form>
+
<script src="js/console.js"></script>
<script src="js/jquery.min.js"></script>
<script src="js/uglifyjs/lib/parse-js.js"></script>
View
64 js/uglifui.js
@@ -0,0 +1,64 @@
+/**
+ * UglifUI
+ * by Alex Sexton - AlexSexton@gmail.com
+ *
+ * A web interface to UglifyJS
+ *
+ * All the UglifyJS Code plus the modifications made to it
+ * in order to make UglifUI work are subject to the license
+ * that UglifyJS is released under (currently BSD)
+ *
+ * The rest of the code (more or less this file) is WTFPL
+ * so go crazy.
+ *
+ * I pronounce it "UG-LIH-FEW-EYE" ["JAY-ESS"] - but I don't
+ * care how you say it.
+ */
+(function ( global, doc, $, uglify, undef ) {
+ // Create our app object
+ var uglifui = {
+ init: function () {
+ var self = this;
+
+ // Dom ready
+ $(function () {
+ self.setElements();
+ self.hookEvents();
+ });
+ },
+
+ elements : {},
+
+ setElements : function () {
+ // Main code text area
+ this.elements.ta_code = $('#code');
+ // The form element
+ this.elements.frm_uglify = $('#ugForm');
+ },
+
+ getCode : function () {
+ return this.elements.ta_code.val();
+ },
+
+ getFlags : function () {
+ return [];
+ },
+
+ submit : function () {
+ this.elements.ta_code.val( uglify( this.getCode(), this.getFlags() ) );
+ },
+
+ hookEvents : function () {
+ var self = this;
+
+ // Hook up the submit event
+ this.elements.frm_uglify.submit(function (){
+ self.submit();
+ return false;
+ });
+ }
+ };
+
+ // Start it up
+ uglifui.init();
+})( this, this.document, this.jQuery, this.uglify );
View
2  js/uglifyjs/lib/squeeze-more.js
@@ -35,7 +35,7 @@ exports.ast_squeeze_more = ast_squeeze_more;
})( squeezemore );
//global.squeezemore = squeezemore;
-global.process.ast_squeeze_more = squeezemore;
+global.process.ast_squeeze_more = squeezemore.ast_squeeze_more;
})( this );
//>> End Uglifui
Please sign in to comment.
Something went wrong with that request. Please try again.