Browse files

Adding YUI as the default compression.

In the steal build script, do concat only, then use YUI compression from compress.sh to do the actual compression.
  • Loading branch information...
1 parent 787cff0 commit 32ed992c28b849580d27b7960c57f1809eb4000c @shane-tomlinson shane-tomlinson committed Jul 20, 2011
View
13 browserid/compress.sh
@@ -1,22 +1,29 @@
#!/bin/sh
+YUI_LOCATION='../../static/steal/build/scripts/yui.jar'
+
echo ''
echo '****Building dialog HTML, CSS, and JS****'
echo ''
cd static
steal/js dialog/scripts/build.js
+cd dialog
+java -jar $YUI_LOCATION production.js -o production.min.js
+mv production.min.js production.js
+
echo ''
echo '****Building BrowserID.org HTML, CSS, and JS****'
echo ''
-cd js
-uglifyjs browserid.js > browserid.min.js
+cd ../js
+java -jar $YUI_LOCATION browserid.js -o browserid.min.js
cat jquery-1.6.2.min.js ../dialog/resources/underscore-min.js browserid.min.js > lib.min.js
cd ../css
-cat github.css style.css > browserid.min.css
+cat github.css style.css > browserid.css
+java -jar $YUI_LOCATION browserid.css -o browserid.min.css
View
3 browserid/static/dialog/scripts/build.js
@@ -3,6 +3,7 @@
load("steal/rhino/steal.js");
steal.plugins('steal/build','steal/build/scripts','steal/build/styles',function() {
steal.build('../static/dialog/scripts/build.html',{
- to: '../static/dialog'
+ to: '../static/dialog',
+ compressor: 'concatOnly'
});
});
View
2 browserid/static/js/lib.min.js
@@ -41,4 +41,4 @@ b.isNumber=function(a){return!!(a===0||a&&a.toExponential&&a.toFixed)};b.isNaN=f
0;e<a;e++)b.call(d,e)};b.mixin=function(a){h(b.functions(a),function(c){H(c,b[c]=a[c])})};var I=0;b.uniqueId=function(a){var b=I++;return a?a+b:b};b.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g};b.template=function(a,c){var d=b.templateSettings;d="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(d.interpolate,function(a,b){return"',"+b.replace(/\\'/g,"'")+",'"}).replace(d.evaluate||
null,function(a,b){return"');"+b.replace(/\\'/g,"'").replace(/[\r\n\t]/g," ")+"__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');";d=new Function("obj",d);return c?d(c):d};var j=function(a){this._wrapped=a};b.prototype=j.prototype;var r=function(a,c){return c?b(a).chain():a},H=function(a,c){j.prototype[a]=function(){var a=f.call(arguments);D.call(a,this._wrapped);return r(c.apply(b,a),this._chain)}};b.mixin(b);h(["pop","push","reverse","shift","sort",
"splice","unshift"],function(a){var b=i[a];j.prototype[a]=function(){b.apply(this._wrapped,arguments);return r(this._wrapped,this._chain)}});h(["concat","join","slice"],function(a){var b=i[a];j.prototype[a]=function(){return r(b.apply(this._wrapped,arguments),this._chain)}});j.prototype.chain=function(){this._chain=!0;return this};j.prototype.value=function(){return this._wrapped}})();
-function display_saved_ids(){var a={};window.localStorage.emails&&(a=JSON.parse(window.localStorage.emails)),$("#cancellink").click(function(){confirm("Are you sure you want to cancel your account?")&&$.post("/wsapi/account_cancel",{csrf:window.csrf},function(a){window.localStorage.emails=null,document.location="/"})}),$("#emailList").empty(),_(a).each(function(a,b){var c=$("<div>").addClass("emailblock"),d=$("<div>").addClass("email").text(b),e=$("<div>").addClass("meta"),f=$("<div class='keyblock'>").text(a.pub);f.hide();var g=$("<div>"),h=$("<a>").text("[show public key]");h.click(function(){f.show()}),g.append(h);var i=$("<button>").text("Forget this Email");e.append(i),i.click(function(){var a=JSON.parse(window.localStorage.emails);$.post("/wsapi/remove_email",{email:b,csrf:window.csrf},function(c){delete a[b],window.localStorage.emails=JSON.stringify(a),display_saved_ids()})});var j=new Date(a.created),k=$("<div class='date'>").text("Signed in at "+j.getHours()+":"+j.getMinutes()+":"+j.getSeconds()+", "+j.getMonth()+"/"+j.getDay()+"/"+j.getUTCFullYear());e.append(k),e.append(g),c.append(d),c.append(e),c.append(f),$("#emailList").append(c)})}$(function(){$("#emailList")&&display_saved_ids()})
+$(function(){if($("#emailList")){display_saved_ids()}});function display_saved_ids(){var a={};if(window.localStorage.emails){a=JSON.parse(window.localStorage.emails)}$("#cancellink").click(function(){if(confirm("Are you sure you want to cancel your account?")){$.post("/wsapi/account_cancel",{csrf:window.csrf},function(b){window.localStorage.emails=null;document.location="/"})}});$("#emailList").empty();_(a).each(function(g,h){var c=$("<div>").addClass("emailblock");var k=$("<div>").addClass("email").text(h);var n=$("<div>").addClass("meta");var f=$("<div class='keyblock'>").text(g.pub);f.hide();var l=$("<div>");var m=$("<a>").text("[show public key]");m.click(function(){f.show()});l.append(m);var b=$("<button>").text("Forget this Email");n.append(b);b.click(function(){var d=JSON.parse(window.localStorage.emails);$.post("/wsapi/remove_email",{email:h,csrf:window.csrf},function(e){delete d[h];window.localStorage.emails=JSON.stringify(d);display_saved_ids()})});var i=new Date(g.created);var j=$("<div class='date'>").text("Signed in at "+i.getHours()+":"+i.getMinutes()+":"+i.getSeconds()+", "+i.getMonth()+"/"+i.getDay()+"/"+i.getUTCFullYear());n.append(j);n.append(l);c.append(k);c.append(n);c.append(f);$("#emailList").append(c)})};
View
2 browserid/views/layout.ejs
@@ -5,7 +5,7 @@
<title><%- title %></title>
<% if (production) { %>
<link rel="stylesheet" type="text/css" href="/css/browserid.min.css">
- <script src="/js/lib.min.js" type="text/javascript"></script>
+ <script src="/js/browserid.min.js" type="text/javascript"></script>
<% } else { %>
<link rel="stylesheet" type="text/css" href="/css/github.css">
<link rel="stylesheet" type="text/css" href="/css/style.css">

0 comments on commit 32ed992

Please sign in to comment.