Skip to content

Commit

Permalink
Merge branch 'master' of github.com:dongkang/Dot
Browse files Browse the repository at this point in the history
Conflicts:
	static/style.css
  • Loading branch information
chorr committed Feb 19, 2012
2 parents a812628 + 34971dd commit 1ed3b7b
Show file tree
Hide file tree
Showing 7 changed files with 107 additions and 38 deletions.
18 changes: 12 additions & 6 deletions app.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,31 @@
<script src="./lib/backbone.js" type="text/javascript"></script>
<script src="./static/dot.app.js" type="text/javascript"></script>
<script src="./static/dot.canvas.js" type="text/javascript"></script>
<script src="./static/dot.ui.js" type="text/javascript"></script>
<style type="text/css">
#app {-webkit-tap-highlight-color:rgba(0,0,0,0);}
.stage {width:320px;height:320px;margin:0 auto;}

.ui-slider {}
.slider-less, .slider-more {float:left;width:32px;height:32px;}
.slider-bar {float:left;position:relative;width:245px;height:22px;padding:5px;background-color:rgb(57,45,44);}
.slider-point {left:0;top:0;width:22px;height:22px;background-color:#E7E9E1;}
</style>
</head>
<body>

<div id="app">
<div class="menu menu-top">
<div class="ui-slider"></div>
<div class="menu-slider"></div>
</div>
<div class="stage canvas"></div>
<div class="menu menu-bottom">
<div class="ico-pen item item-selected"></div>
<div class="ico-move item"></div>
<div class="ico-pen item btn-draw item-selected"></div>
<div class="ico-move item btn-move"></div>
<div class="ico-color item"><span><span style="background-color:#fff;"></span></span></div>
<div class="ico-undo item"></div>
<div class="ico-redo item"></div>
<div class="ico-clear item"></div>
<div class="ico-undo item btn-undo"></div>
<div class="ico-redo item btn-redo"></div>
<div class="ico-clear item btn-clear"></div>
<div class="ico-save item"></div>
<div class="ico-export item"></div>
</div>
Expand Down
Binary file modified images/btn_export.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions sftp-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
// The tab key will cycle through the settings when first created

// sftp, ftp or ftps
"type": "sftp",
"save_before_upload": true,
"upload_on_save": false,
"sync_down_on_open": false,
"sync_skip_deletes": false,
"confirm_sync": true,
"confirm_overwrite_newer": false,

"host": "grouv.net",
"user": "dongkang",
"password": "dong1324",
"port": "21",

"remote_path": "/home/dongkang/Dot",
"ignore_regex": "(\\.sublime-project|\\.sublime-workspace|sftp-config\\.json|sftp-settings\\.json|\\.svn|\\.hg|\\.git|\\.bzr|_darcs|CVS|\\.DS_Store|Thumbs\\.db|desktop\\.ini)",
//"file_permissions": "664",
//"dir_permissions": "775",

"connect_timeout": 30,
//"ftp_passive_mode": true,
//"ssh_key_file": "~/.ssh/id_rsa",
//"sftp_flags": "-F /path/to/ssh_config",

//"preserve_modification_times": false,
//"remote_time_offset_in_hours": 0,
//"remote_encoding": "utf-8",
//"remote_locale": "C",
}
27 changes: 17 additions & 10 deletions static/dot.app.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,27 @@ dot.App = {
_view: Backbone.View.extend({
el: "#app",
events: {
"click .btn_draw": "selectDraw",
"click .btn_move": "selectMove",
"click .btn_undo": "undo",
"click .btn_redo": "redo",
"click .btn_clear": "clear"
"click .btn-draw": "selectDraw",
"click .btn-move": "selectMove",
"click .btn-undo": "undo",
"click .btn-redo": "redo",
"click .btn-clear": "clear"
},

initialize: function() {
this.$canvas = $(".canvas");
dot.App.canvas = this.canvas = new dot.CanvasView({ target: this.$canvas }).model;

new dot.UI.Slider({
target: $(".menu-slider"),
events: {
minus: this.zoomOut,
plus: this.zoomIn
}
});

this.scrollTop();
$(window).bind("orientationchange", this.scrollTop);
$(window).bind("orientationchange", function(ev) {
alert(ev);
ev.preventDefault();
});
},

scrollTop: function() {
Expand All @@ -60,7 +64,6 @@ dot.App = {
},

selectMove: function() {
console.log("move!!")
this.canvas.setHandMode(true);
},

Expand All @@ -74,6 +77,10 @@ dot.App = {

clear: function() {
this.canvas.clearPixel();
},

zoomOut: function() {
console.log('zoom out')
}

})
Expand Down
22 changes: 19 additions & 3 deletions static/dot.ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,23 @@ if (typeof dot === "undefined") dot = {};
dot.UI = {};

/* slider 컴포넌트 */
dot.UI.Slider = Backbone.View({
template: ""

dot.UI.Slider = Backbone.View.extend({
template: '<div class="ui-slider"><button class="slider-less">-</button><div class="slider-bar"><div class="slider-point"></div></div><button class="slider-more">+</button></div>',
events: {
"click .slider-less": "minusHandler",
"click .slider-more": "plusHandler"
},
initialize: function(options) {
this.$target = options.target;
this.events = options.events;
this.render();
},
render: function() {
this.setElement(this.template);
this.$target.html(this.$el);
return this;
},
minusHandler: function() {
this.events.minus();
}
});
46 changes: 27 additions & 19 deletions static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
/* YUI3 CSS reset */
html{color:#000;background:#FFF}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0}table{border-collapse:collapse;border-spacing:0}fieldset,img{border:0}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal}ol,ul{list-style:none}caption,th{text-align:left}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal}q:before,q:after{content:''}abbr,acronym{border:0;font-variant:normal}sup{vertical-align:text-top}sub{vertical-align:text-bottom}input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit}input,textarea,select{*font-size:100%}legend{color:#000}


.ico-clear {background:url('../images/btn_clear.png') no-repeat center center;}
.ico-export {background:url('../images/btn_export.png') no-repeat center center;}
.ico-move {background:url('../images/btn_move.png') no-repeat center center;}
Expand All @@ -12,38 +11,47 @@ html{color:#000;background:#FFF}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre
.ico-save {background:url('../images/btn_save.png') no-repeat center center;}
.ico-undo {background:url('../images/btn_undo.png') no-repeat center center;}

.ico-clear {background-size:16px 16px;}
.ico-cloud {background-size:16px 16px;}
.ico-config {background-size:16px 16px;}
.ico-export {background-size:16px 16px;}
.ico-eye {background-size:16px 12px;}
.ico-minus {background-size:16px 4px;}
.ico-move {background-size:16px 16px;}
.ico-pen {background-size:16px 16px;}
.ico-plus {background-size:16px 16px;}
.ico-redo {background-size:16px 16px;}
.ico-save {background-size:16px 16px;}
.ico-undo {background-size:16px 16px;}

.ico-color {position:relative;}
.ico-color span {position:absolute;left:26px;top:26px;width:33px;height:33px;background-color:#000;}
.ico-color span span {left:4px;top:4px;width:25px;height:25px;background-color:#fff;}
.ico-color span {position:absolute;left:13px;top:13px;width:16px;height:16px;background-color:#000;}
.ico-color span span {left:2px;top:2px;width:12px;height:12px;background-color:#fff;}

.stage {border-top:1px solid #c6c7c2;border-bottom:1px solid #c6c7c2;background:#fff;}
.menu {overflow:hidden;height:85px;padding:0 22px;background:#e7e9e1;text-align:center;}
.menu {overflow:hidden;float:left;width:100%;height:42px;padding:0 13px;text-align:center;background:#e7e9e1;}
.menu-top {border-bottom:1px solid #abaca7;}
.menu-bottom {border-top:1px solid #abaca7;}
.item {display:inline-block;overflow:hidden;width:85px;height:85px;cursor:pointer;}
.item {overflow:hidden;float:left;width:42px;height:42px;margin:0;padding:0;cursor:pointer;}
.item-selected {background-color:#b8b9b3;}
.item-disabled {opacity:0.3;}

.item-spacer {width:21px;cursor:default;}
.item-slider {width:126px;}

/* low resolution phone */
/* for iphone */
@media
only screen and (min-device-width : 320px) and (max-device-width : 480px) {
.ico-clear, .ico-export, .ico-move, .ico-pen, .ico-redo, .ico-save, .ico-undo {background-size:16px 16px}
.ico-color span {left:13px;top:13px;width:16px;height:16px;}
.ico-color span span {left:2px;top:2px;width:12px;height:12px;}
.menu {height:42px;padding:0 11px;}
.item {width:42px;height:42px;}
}

/* high resolution phone */
/* for iphone retina */
@media
only screen and (-webkit-min-device-pixel-ratio : 2),
only screen and (min-device-pixel-ratio : 2) {
}

/* for android */
@media
only screen and (-webkit-min-device-pixel-ratio : 1.5),
only screen and (min-device-pixel-ratio : 1.5) {
.ico-clear, .ico-export, .ico-move, .ico-pen, .ico-redo, .ico-save, .ico-undo {background-size:24px 24px}
.ico-color span {left:19px;top:19px;width:24px;height:24px;}
.ico-color span span {left:3px;top:3px;width:18px;height:18px;}
.menu {height:63px;padding:0 16px;}
.item {width:63px;height:63px;}
}

/* pad */
Expand Down
Empty file added test.js
Empty file.

0 comments on commit 1ed3b7b

Please sign in to comment.