JsMinify: Add basic template and js for minifier

master
sdua 2016-07-05 22:41:51 +00:00
parent 090784945d
commit a76abb9bad
3 changed files with 50 additions and 11 deletions

View File

@ -1,3 +1,8 @@
<div> <h5>Minify JavaScript Code on the go!</h5>
<span>JS Minifier</span> <div class="js_minify__io_box">
<textarea name="js_minify__input" id="js_input" rows="20" cols="60"></textarea>
<textarea name="js_minify__output" id="js_output" rows="20" cols="60"></textarea><br>
</div>
<div class="js_minify__action_box">
<button class="js_minify__action">Minify</button>
</div> </div>

View File

@ -0,0 +1,21 @@
.zci--js_minify .js_minify__action_box {
margin-top: 3.25em;
}
.zci--js_minify .js_minify__action {
background: #5DA4DC;
color: #fff;
text-decoration: none;
font-size: 1.25em;
padding: 10px 15px;
border: none;
border-radius: 4px;
position: absolute;
bottom: 0;
margin-bottom: .25em;
cursor: pointer;
}
.zci--js_minify .js_minify__action:active {
background: #4793D0;
}

View File

@ -1,14 +1,27 @@
DDH.js_minify = DDH.js_minify || {}; DDH.js_minify = DDH.js_minify || {};
(function(DDH) { "use strict";
"use strict";
DDH.js_minify.build = function(ops) { DDH.js_minify.build = function(ops) {
return { var shown = false;
onShow: function() {
} return {
}; onShow: function() {
} console.log("onShow called");
}); // make sure this function is run only once, the first time
// the IA is shown otherwise things will get initialized more than once
if (shown)
return;
// set the flag to true so it doesn't get run again
shown = true;
var $dom = $('#zci-js_minify'),
$main = $dom.find('.zci__main');
$main.toggleClass('c-base');
}
};
};