mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
feature(config) add
This commit is contained in:
parent
3e96c13157
commit
6b0b33cec3
7 changed files with 172 additions and 11 deletions
58
css/config.css
Normal file
58
css/config.css
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
#config {
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
.list li{
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
-o-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
#config .form-control{
|
||||
padding: 0 12px;
|
||||
font-size: 16px;
|
||||
line-height: 1.428571429;
|
||||
color: #555555;
|
||||
background-color: #ffffff;
|
||||
border: 1px solid #cccccc;
|
||||
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
|
||||
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
|
||||
-webkit-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
|
||||
transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
|
||||
}
|
||||
|
||||
#config .form-control:focus {
|
||||
border-color: #66afe9;
|
||||
outline: 0;
|
||||
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 1px rgba(102, 175, 233, 0.6);
|
||||
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 1px rgba(102, 175, 233, 0.6);
|
||||
}
|
||||
|
||||
#config .form-control:-moz-placeholder {
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
#config .form-control::-moz-placeholder {
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
#config .form-control:-ms-input-placeholder {
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
#config .form-control::-webkit-input-placeholder {
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
#config .list {
|
||||
text-align:left;
|
||||
margin: 5%;
|
||||
}
|
||||
|
||||
#config #DivBorder{
|
||||
margin : 10% auto;
|
||||
border :1px solid #ADCAFD;
|
||||
width :300px;
|
||||
}
|
||||
21
html/config.html
Normal file
21
html/config.html
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
<div id="DivBorder">
|
||||
<ul class="list" >
|
||||
<li><input class="form-control" placeholder="Api url" value="{{ api_url}}"></input></li>
|
||||
<li><span><input checked type="checkbox" id="appcache" {{ appcache }} ></input></span><label for="appcache"> App cache</label></li>
|
||||
<li><span><input checked type="checkbox" id="analytics" {{ analytics }} ></input></span><label for="analytics"> Analytics</label></li>
|
||||
<li><span><input checked type="checkbox" id="localStorage" {{ localStorage }} ></input></span><label for="localStorage"> Local Storage</label></li>
|
||||
<li><span><input checked type="checkbox" id="minify" {{ minify }} ></input></span><label for="minify"> Minify</label></li>
|
||||
<li><span><input checked type="checkbox" id="online" {{ online }} ></input></span><label for="online"> Online</label></li>
|
||||
<li><span><input checked type="checkbox" id="cache" {{ cache }} ></input></span><label for="cache"> Cache</label></li>
|
||||
<li><span><input checked type="checkbox" id="logs" {{ logs }} ></input></span><label for="logs"> Logs</label></li>
|
||||
<li><span><input checked type="checkbox" id="show_keys_panel" {{ show_keys_panel }}></input></span><label for="show_keys_panel"> Show keys panel</label></li>
|
||||
<li><span><input checked type="checkbox" id="server"{{ server }}></input></span><label for="server"> Server</label></li>
|
||||
|
||||
<li><span><input checked type="checkbox" id="socket" {{ socket }} ></input></span><label for="socket"> Socket</label></li>
|
||||
<li><input class="form-control" placeholder="Port" id="port" value="{{ port }}"></input></li>
|
||||
<li><input class="form-control" placeholder="Ssl Port" id="sslPort" value="{{ sslPort }}"></input></li>
|
||||
<li><input class="form-control" placeholder="IP" id="ip" value="{{ ip }}"></input></li>
|
||||
<li><span><input checked type="checkbox" id="ssl" {{ ssl }} ></input></span><label for="ssl"> SSL</label></li>
|
||||
<li><span><input checked type="checkbox" id="rest" {{ rest }} ></input></span><label for="rest"> REST</label></li>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -26,6 +26,7 @@
|
|||
<button id=f7 class=cmd-button>F7 - make dir</button>
|
||||
<button id=f8 class=cmd-button>F8 - delete</button>
|
||||
<button id=f9 class=cmd-button>F9 - menu</button>
|
||||
<button id=f10 class="cmd-button hidden">F10 - config</button>
|
||||
<button id=~ class=cmd-button>~ - console</button>
|
||||
</div>
|
||||
<script src=/lib/util.js></script>
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
"menu",
|
||||
"view",
|
||||
"help",
|
||||
"config",
|
||||
"console", {
|
||||
"name": "storage",
|
||||
"data": [{
|
||||
|
|
|
|||
72
lib/client/config.js
Normal file
72
lib/client/config.js
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
var CloudCmd, Util, DOM;
|
||||
(function(CloudCmd, Util, DOM){
|
||||
'use strict';
|
||||
|
||||
CloudCmd.Config = new ConfigProto(CloudCmd, Util, DOM);
|
||||
|
||||
function ConfigProto(CloudCmd, Util, DOM){
|
||||
var Key = CloudCmd.Key,
|
||||
Images = DOM.Images,
|
||||
Config = this;
|
||||
|
||||
this.init = function(pCallBack){
|
||||
Util.loadOnLoad([
|
||||
Config.show,
|
||||
CloudCmd.View,
|
||||
]);
|
||||
|
||||
DOM.Events.addKey(listener);
|
||||
DOM.setButtonKey('f10', Config.show);
|
||||
|
||||
delete Config.init;
|
||||
};
|
||||
|
||||
this.show = function(){
|
||||
Images.showLoad({top:true});
|
||||
|
||||
DOM.ajax({
|
||||
url: '/css/config.css',
|
||||
success: function (data){
|
||||
DOM.cssSet({
|
||||
id : 'config-css',
|
||||
inner : data
|
||||
});
|
||||
|
||||
Images.hideLoad();
|
||||
},
|
||||
|
||||
error:Images.showError
|
||||
});
|
||||
|
||||
DOM.ajax({
|
||||
url: '/html/config.html',
|
||||
success: function (data){
|
||||
var lDiv = DOM.anyload({
|
||||
name : 'div',
|
||||
id : 'config',
|
||||
inner : data.toString()
|
||||
});
|
||||
|
||||
Images.hideLoad();
|
||||
CloudCmd.View.show(lDiv);
|
||||
},
|
||||
|
||||
error:Images.showError
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
this.hide = CloudCmd.View.hide;
|
||||
|
||||
function listener(pEvent){
|
||||
var f10 = Key.F10,
|
||||
isBind = Key.isBind(),
|
||||
key = pEvent.keyCode;
|
||||
|
||||
/* если клавиши можно обрабатывать */
|
||||
if (isBind && key === f10)
|
||||
Config.show();
|
||||
}
|
||||
}
|
||||
|
||||
})(CloudCmd, Util, DOM);
|
||||
|
|
@ -39,6 +39,7 @@ var CloudCmd, Util, DOM;
|
|||
F7 : 118,
|
||||
F8 : 119,
|
||||
F9 : 120,
|
||||
F10 : 121,
|
||||
|
||||
TRA : 192 /* Typewritten Reverse Apostrophe (`) */
|
||||
};
|
||||
|
|
@ -163,6 +164,12 @@ var CloudCmd, Util, DOM;
|
|||
|
||||
break;
|
||||
|
||||
case Key.F10:
|
||||
Util.exec(CloudCmd.Config);
|
||||
DOM.preventDefault(pEvent);
|
||||
|
||||
break;
|
||||
|
||||
case Key.TRA:
|
||||
DOM.Images.showLoad({top: true});
|
||||
Util.exec(CloudCmd.Console);
|
||||
|
|
|
|||
|
|
@ -43,23 +43,24 @@ var Util, DOM, CloudCmd;
|
|||
|
||||
lFuncs =[
|
||||
null,
|
||||
CloudCmd.Help, /* f1 */
|
||||
DOM.renameCurrent, /* f2 */
|
||||
CloudCmd.View, /* f3 */
|
||||
CloudCmd.Edit, /* f4 */
|
||||
DOM.copyCurrent, /* f5 */
|
||||
DOM.moveCurrent, /* f6 */
|
||||
DOM.promptNewDir, /* f7 */
|
||||
DOM.promptDeleteSelected, /* f8 */
|
||||
CloudCmd.Menu, /* f9 */
|
||||
CloudCmd.Help, /* f1 */
|
||||
DOM.renameCurrent, /* f2 */
|
||||
CloudCmd.View, /* f3 */
|
||||
CloudCmd.Edit, /* f4 */
|
||||
DOM.copyCurrent, /* f5 */
|
||||
DOM.moveCurrent, /* f6 */
|
||||
DOM.promptNewDir, /* f7 */
|
||||
DOM.promptDeleteSelected, /* f8 */
|
||||
CloudCmd.Menu, /* f9 */
|
||||
CloudCmd.Config, /* f10 */
|
||||
];
|
||||
|
||||
for (i = 1; i <= 9; i++) {
|
||||
for (i = 1; i <= 10; i++) {
|
||||
lButton = 'f' + i,
|
||||
lEl = DOM.getById('f' + i);
|
||||
lKeysPanel[lButton] = lEl;
|
||||
|
||||
if (i === 1 || i === 3 || i === 4 || i === 9)
|
||||
if (i === 1 || i === 3 || i === 4 || i === 9 || i === 10)
|
||||
Events.addOnce('click', lFuncs[i], lEl);
|
||||
else
|
||||
Events.addClick(lFuncs[i], lEl);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue