Permalink
Browse files

Add build and makefile

  • Loading branch information...
1 parent fe6f6b9 commit cffb90dbeb488840cfa096ea745f9118673ccf96 @afshinm afshinm committed May 21, 2013
Showing with 61 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +6 −0 Makefile
  3. +30 −0 build/build.js
  4. +1 −0 minified/widearea.min.css
  5. +6 −0 minified/widearea.min.js
  6. +17 −0 package.json
View
1 .gitignore
@@ -0,0 +1 @@
+node_modules/*
View
6 Makefile
@@ -0,0 +1,6 @@
+BASE = .
+
+build:
+ cd BUILD && node BUILD.js
+
+.PHONY: build
View
30 build/build.js
@@ -0,0 +1,30 @@
+#!/usr/bin/env node
+
+var fs = require('fs'),
+ compressor = require('node-minify');
+
+new compressor.minify({
+ type: 'gcc',
+ fileIn: '../widearea.js',
+ fileOut: '../minified/widearea.min.js',
+ callback: function (err) {
+ if (err) {
+ console.log(err);
+ } else {
+ console.log("JS minified successfully.");
+ }
+ }
+});
+
+new compressor.minify({
+ type: 'yui-css',
+ fileIn: '../widearea.css',
+ fileOut: '../minified/widearea.min.css',
+ callback: function (err) {
+ if (err) {
+ console.log(err);
+ } else {
+ console.log("Main CSS minified successfully.");
+ }
+ }
+});
View
1 minified/widearea.min.css
@@ -0,0 +1 @@
+.widearea-overlayLayer{position:fixed;top:0;bottom:0;left:0;right:0;z-index:999998;-webkit-transition:all .2s ease-out;-moz-transition:all .2s ease-out;-ms-transition:all .2s ease-out;-o-transition:all .2s ease-out;transition:all .2s ease-out}.widearea-overlayLayer.light{background-color:#fff}.widearea-overlayLayer textarea{-webkit-transition:all .2s ease-out;-moz-transition:all .2s ease-out;-ms-transition:all .2s ease-out;-o-transition:all .2s ease-out;transition:all .2s ease-out}.widearea-overlayLayer.light textarea{color:#ccc;background-color:#fff}.widearea-overlayLayer.light textarea:hover,.widearea-overlayLayer.light textarea:focus{color:black}.widearea-overlayLayer.dark{background-color:#2f3030}.widearea-overlayLayer.dark textarea{color:#999;background-color:#2f3030}.widearea-overlayLayer.dark textarea:hover,.widearea-overlayLayer.dark textarea:focus{color:#eee}.widearea-wrapper{position:relative}.widearea-wrapper textarea{padding-right:20px}textarea.widearea-fullscreen{padding:20px;padding-top:30px;border:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;max-width:900px;height:100%;margin:0 auto;display:block;font-size:20px;box-shadow:none;resize:none;line-height:1.6em}.widearea-controlPanel{position:absolute;right:0;top:0;padding-top:30px;padding-right:20px}.widearea-icons{width:16px;height:16px;position:absolute;top:0;right:0;padding-top:5px;padding-right:5px}.widearea-icon{height:16px;width:16px;-ms-filter:"alpha(opacity=50)";filter:alpha(opacity=50);-khtml-opacity:.5;opacity:.5;display:block;-webkit-transition:all .1s ease-out;-moz-transition:all .1s ease-out;-ms-transition:all .1s ease-out;-o-transition:all .1s ease-out;transition:all .1s ease-out}.widearea-icon:hover{-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100);-khtml-opacity:1;opacity:1}.widearea-icon.fullscreen{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpDNjVFRDY3OUI3MTAxMUUyQjA3QkQ4Nzg0REMzNTFCNyIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpDNjVFRDY3QUI3MTAxMUUyQjA3QkQ4Nzg0REMzNTFCNyI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkM2NUVENjc3QjcxMDExRTJCMDdCRDg3ODREQzM1MUI3IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkM2NUVENjc4QjcxMDExRTJCMDdCRDg3ODREQzM1MUI3Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+INk8jQAAAORJREFUeNqs070KwjAUBeCr6CCCu6C4CHUqOnXooLPPoB36aNbRxUW6qW8gfYCW4iB0EQRxrCdwCiHWxRj4SEhu/tobEZEMSk0s30tsxGYNNrZwgCvkrOvKEEasl7CqFljAGabQhT70IOLENTzgBk+4wBxOoi3gGsdTk9sUGWMu56i27GACvhagdnO0ozvsq8Z9ztnp9ws4+GJdwJgKYyyo+0AhbMCDOwNzKtnnMSasW6CjtQeQakdO2fcR25Q/Fusr/PwRrX+jVSK1uIPqTGBmpHJVjrDXUjlhKov1YxLb5/wWYADvoXd4CZG5iQAAAABJRU5ErkJggg==)}.widearea-icon.close{width:18px;height:18px;margin-bottom:15px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEU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-0,0 +1,6 @@
+(function(g,b){"object"===typeof exports?b(exports):"function"===typeof define&&define.amd?define(["exports"],b):b(g)})(this,function(g){function b(a){this._targetElement=a;this._options={wideAreaAttr:"data-widearea",exitOnEsc:!0,defaultColorScheme:"light",closeIconLabel:"Close WideArea",changeThemeIconLabel:"Toggle Color Scheme",fullScreenIconLabel:"WideArea Mode"};var k=this;a=this._targetElement.querySelectorAll("textarea["+this._options.wideAreaAttr+"='enable']");for(var d=a.length-1;0<=d;d--){var b=
+a[d],c=document.createElement("div"),e=document.createElement("div");fullscreenIcon=document.createElement("a");c.className="widearea-wrapper";e.className="widearea-icons";fullscreenIcon.className="widearea-icon fullscreen";fullscreenIcon.title=this._options.fullScreenIconLabel;fullscreenIcon.href="javascript:void(0);";fullscreenIcon.onclick=function(){l.call(k,this)};c.appendChild(b.cloneNode());e.appendChild(fullscreenIcon);c.appendChild(e);b.parentNode.replaceChild(c,b)}}function l(a){var b=this;
+a=a.parentNode.parentNode.querySelector("textarea");var d=a.cloneNode();d.className=("widearea-fullscreen "+a.className).trim();a.className=("widearea-fullscreened "+a.className).trim();var f=document.createElement("div");f.className="widearea-controlPanel";var c=document.createElement("a");c.href="javascript:void(0);";c.className="widearea-icon close";c.title=this._options.closeIconLabel;c.onclick=function(){j.call(b)};var e=document.createElement("a");e.href="javascript:void(0);";e.className="widearea-icon changeTheme";
+e.title=this._options.changeThemeIconLabel;e.onclick=function(){m.call(b)};f.appendChild(c);f.appendChild(e);c=document.createElement("div");c.className="widearea-overlayLayer "+this._options.defaultColorScheme;c.appendChild(d);c.appendChild(f);document.body.appendChild(c);d.focus();d.value=a.value;this._onKeyDown=function(a){27===a.keyCode&&!0==b._options.exitOnEsc&&j.call(b)};window.addEventListener?window.addEventListener("keydown",b._onKeyDown,!0):document.attachEvent&&document.attachEvent("onkeydown",
+b._onKeyDown)}function m(){var a=document.querySelector(".widearea-overlayLayer");a.className=/dark/gi.test(a.className)?a.className.replace("dark","light"):a.className.replace("light","dark")}function j(){var a=document.querySelector("textarea.widearea-fullscreened"),b=document.querySelector(".widearea-overlayLayer"),d=b.querySelector("textarea");a.focus();a.value=d.value;b.parentNode.removeChild(b);window.removeEventListener?window.removeEventListener("keydown",this._onKeyDown,!0):document.detachEvent&&
+document.detachEvent("onkeydown",this._onKeyDown)}var h=function(a){if("string"===typeof a){if(a=document.querySelector(a))return new b(a);throw Error("There is no element with given selector.");}return new b(document.body)};h.version="0.1.0";h.fn=b.prototype={clone:function(){return new b(this)}};return g.wideArea=h});
View
17 package.json
@@ -0,0 +1,17 @@
+{
+ "name": "WideArea",
+ "description": "Create expandable textarea and write large amount of text easily.",
+ "version": "0.1.0",
+ "author": "Afshin Mehrabani <afshin.meh@gmail.com>",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/usablica/widearea"
+ },
+ "devDependencies": {
+ "node-minify": "*"
+ },
+ "engine": [
+ "node >=0.1.90"
+ ],
+ "main": "widearea.js"
+}

0 comments on commit cffb90d

Please sign in to comment.