Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
syon committed Jan 8, 2017
1 parent 6d8ac9e commit e644502
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 59 deletions.
47 changes: 47 additions & 0 deletions public/app.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
.container {
width: 320px;
}
h1 img {
width: 40px;
height: 40px;
position: relative;
padding-right: 6px;
top: -3px;
}
.addr {
margin-top: -10px;
color: #aaa;
}
.switches {
margin: 20px 0;
}
.switches a span {
font-size: 26px;
}
.switches button {
position: relative;
}
.switches .glyphicon {
left: 10px;
top: 10px;
position: absolute;
font-size: 24px;
color: #ccc;
}
#saveform {
margin-top: 10px;
}
pre {
font-size: 11px;
}
.cell {
float: left;
margin-right: 1.5em;
font-size: 2em;
color: #000000;
width: 17em;
overflow: hidden;
}
#ir_key {
width: 100%;
}
15 changes: 15 additions & 0 deletions public/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
$(function() {

$(document).on('click', '.switches button', function(){
var ir_key = $(this).prop('id');
$.ajax({
type: "POST",
url: "/",
data: {"ir_key": ir_key},
success: function(data) {
$('#result').text(data).show();
}
});
});

});
59 changes: 0 additions & 59 deletions views/index.slim
Original file line number Diff line number Diff line change
@@ -1,49 +1,4 @@
- content_for :title do "IRKit GUI" end
css:
.container {
width: 320px;
}
h1 img {
width: 40px;
height: 40px;
position: relative;
padding-right: 6px;
top: -3px;
}
.addr {
margin-top: -10px;
color: #aaa;
}
.switches {
margin: 20px 0;
}
.switches a span {
font-size: 26px;
}
.switches button {
position: relative;
}
.switches .glyphicon {
left: 10px;
top: 10px;
position: absolute;
font-size: 24px;
color: #ccc;
}
#saveform {
margin-top: 10px;
}
pre {
font-size: 11px;
}
.cell {
float: left;
margin-right: 1.5em;
font-size: 2em;
color: #000000;
width: 17em;
overflow: hidden;
}

h1.text-center
img src="icon.png"
Expand All @@ -63,17 +18,3 @@ div.switches.well
input#ir_key.form-control name="ir_key" placeholder="Enter new name" type="text"

p#result class="alert alert-info" role="alert" style="display:none;"


javascript:
$(document).on('click', '.switches button', function(){
var ir_key = $(this).prop('id');
$.ajax({
type: "POST",
url: "/",
data: {"ir_key": ir_key},
success: function(data) {
$('#result').text(data).show();
}
});
});
3 changes: 3 additions & 0 deletions views/layout.slim
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ html
link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"
script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"
script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"
link rel="stylesheet" href="/app.css"

body

.container

== yield

script src="/app.js"

0 comments on commit e644502

Please sign in to comment.