Skip to content

Commit

Permalink
Add the KWS.fusen Class [0.1.4]
Browse files Browse the repository at this point in the history
  • Loading branch information
mtsgi committed Apr 1, 2019
1 parent a52f9ab commit 9b79c31
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/settings/system.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script>
$( "#settings-startup" ).val( localStorage.getItem( "kit-startup" ) );
if( System.bootopt.get("safe") ) $("#settings-issafe").html("<strong>[!]現在セーフモードで起動しています</strong><br>");
$("#settings-system-debugmode").prop('checked', false);
if( System.debugmode ) $("#settings-system-debugmode").prop('checked', true);
$("#settings-system-debugmode").on("change", function(){
if( $("#settings-system-debugmode").is(':checked') ){
//localStorage.setItem("kit-debugmode", "true");
Expand Down
40 changes: 39 additions & 1 deletion system.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ function kit() {

if( !localStorage.getItem( "kit-default-browser" ) ) localStorage.setItem( "kit-default-browser", "browser" );

if( localStorage.getItem("kit-fusen") ){
this.list = JSON.parse(localStorage.getItem("kit-fusen"));
for( let i in this.list ){
KWS.fusen.add(this.list[i]);
}
}

//if( !localStorage.getItem( "kit-debugmode" ) ) localStorage.setItem( "kit-debugmode", "false" );
//if( localStorage.getItem( "kit-debugmode" ) == "true" ) System.debugmode = true;
//else System.debugmode = false;
Expand Down Expand Up @@ -262,7 +269,7 @@ function kit() {
System.mouseX = event.clientX;
System.mouseY = event.clientY;
}).delegate( ".textbox", "keypress", function( e ) {
if( e.which == 13 && $("#" + this.id + " + .kit-button") ){
if( e.which == 13 && this.id && $("#" + this.id + " + .kit-button") ){
Notification.push("debug", this.id, "system");
$("#" + this.id + " + .kit-button").click();
}
Expand Down Expand Up @@ -783,6 +790,37 @@ const KWS = new function(){
if( _width ) $("#winc"+_pid).css("width", _width)
if( _height ) $("#winc"+_pid).css("height", _height);
}

this.fusen = new function(){
this.fid = 0;
this.list = new Object();

this.add = function(_text){
KWS.fusen.list[KWS.fusen.fid] = String(_text);
$("#desktop-"+currentDesktop).append("<div class='kit-fusen' id='kit-f"+KWS.fusen.fid+"'><i class='fa fa-quote-left'></i>"+_text+"</div>");
$("#kit-f"+KWS.fusen.fid).css("left", Number(KWS.fusen.fid)*20 + 20).pep({
elementsWithInteraction: ".winc, .ui-resizable-handle",
useCSSTranslation: false,
disableSelect: false,
shouldEase: true,
initiate: function(){
$(this.el).css("ui-opacity", "0.7");
},
stop: function(){
this.el.style.transition = "none";
$(this.el).css("ui-opacity", "1.0");
}
})
localStorage.setItem("kit-fusen", JSON.stringify( KWS.fusen.list ));
KWS.fusen.fid++;
}

this.remove = function(_fid){
delete KWS.fusen.list[_fid];
localStorage.setItem("kit-fusen", JSON.stringify( KWS.fusen.list ));
$("#kit-f"+KWS.fusen.fid).remove();
}
}
}

const Notification = new function() {
Expand Down
13 changes: 13 additions & 0 deletions system/theme/theme-default.css
Original file line number Diff line number Diff line change
Expand Up @@ -891,6 +891,19 @@ h3{
color: #a0a0a0;
text-align: right;
}
.kit-fusen{
background: rgba(255,250,220,.9);
width: 200px;
padding: 4px;KWS.
margin: 8px;
box-sizing: border-box;
border-radius: 6px;
box-shadow:inset 0 1px 1px 0 rgba(0,0,0,.5), 0 1px 4px 0 rgba(0,0,0,.5);
position: absolute;
bottom: 20px;
height: 60px;
}

@keyframes activeAnim{
from{
box-shadow: 0 2px 15px 0 rgba(0,0,0,.7), 0 0 0 0 rgba(50,200,90,1.0);
Expand Down

0 comments on commit 9b79c31

Please sign in to comment.