-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathindex.php
251 lines (220 loc) · 9.53 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
<?php
$aKanban["name"] = "aKanban";
$aKanban["datafilename"] = basename(__FILE__, '.php').".txt";
if(isset($_GET["save"])){
if(file_put_contents($aKanban["datafilename"], stripslashes($_POST["data"])))
echo "ok";
die();
}
if(isset($_GET["load"])){
echo file_get_contents($aKanban["datafilename"]);
die();
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>aKanban</title>
<meta name="description" content="">
<meta name="author" content="Arthur Puyou">
<style type="text/css">
body {
padding-top: 60px;
padding-bottom: 40px;
}
.sidebar-nav {
padding: 9px 0;
}
#dialog-form {
display: none;
}
#dialog {
display: none;
text-align: center;
font-size: 12px;
}
#dialog img {
margin-top: 30px;
}
#dialog-contents, #dialog-title {
width: 100%;
}
#dialog-contents {
height: 150px;
font-size: 10px;
}
.column { width: 170px; float: left; padding-bottom: 100px; }
.portlet { margin: 0 1em 1em 0; }
.portlet-header { margin: 0.3em; padding-bottom: 4px; padding-left: 0.2em; }
.portlet-header .ui-icon { float: right; }
.portlet-content { padding: 0.4em; font-size: 12px; }
.ui-sortable-placeholder { border: 1px dotted black; visibility: visible !important; height: 50px !important; }
.ui-sortable-placeholder * { visibility: hidden; }
</style>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script src="http://code.jquery.com/ui/1.9.1/jquery-ui.js"></script>
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap.no-responsive.no-icons.min.css" rel="stylesheet">
<script type="text/javascript">
var currentPortlet;
function nl2br(str, is_xhtml) {
var breakTag = (is_xhtml || typeof is_xhtml === 'undefined') ? '<br ' + '/>' : '<br>'; // Adjust comment to avoid issue on phpjs.org display
return (str + '').replace(/(\r\n|\n\r|\r|\n)/g, breakTag);
}
function br2nl(varTest){
return varTest.replace(/<br\s*\/?>/mg,"\n");
}
function save(){
$("#dialog").dialog({resizable: false});
$(".ui-dialog-titlebar").hide();
$.post('?save', {data: $("#holder").html() }, function(data) {
setTimeout('$("#dialog").dialog("close");', 500);
});
}
function initMap(){
$(".column").sortable({
connectWith: ".column"
});
$(".portlet-header .ui-icon-pencil").click(function() {
currentPortlet = $(this);
$("#dialog-title").val(currentPortlet.siblings(".title").html());
$("#dialog-contents").val(br2nl(currentPortlet.parent().parent().find(".portlet-content").html()));
$("#dialog-form").dialog("open");
});
$(".portlet-header .ui-icon-trash").click(function() {
currentPortlet = $(this);
currentPortlet.parent().parent().remove();
});
$(".column").disableSelection();
}
function load(){
$("#dialog").dialog({resizable: false});
$(".ui-dialog-titlebar").hide();
$.get('?load', function(data) {
$("#holder").html(data);
initMap();
$("#dialog").dialog("close");
});
}
$(document).ready(function() {
$("#save").click(save);
$("#update").click(load);
load();
$("#dialog-form").dialog({
autoOpen: false,
height: 420,
width: 550,
modal: true,
buttons: {
"OK": function() {
currentPortlet.siblings(".title").html($("#dialog-title").val());
currentPortlet.parent().parent().find(".portlet-content").html(nl2br($("#dialog-contents").val()));
$(this).dialog("close");
save();
},
Cancel: function() {
$(this).dialog("close");
}
}
});
$("#addlink").click(function(){
$(".column").first().append('<div class="portlet ui-widget ui-widget-content ui-helper-clearfix ui-corner-all">'
+'<div class="portlet-header ui-widget-header ui-corner-all"><span class="ui-icon ui-icon-trash"></span><span class="ui-icon ui-icon-pencil"></span><span class="title">Title</span></div>'
+'<div class="portlet-content">Text</div>'
+'</div>');
initMap();
});
});
</script>
<!-- Fav and touch icons -->
<link rel="shortcut icon" href="../assets/ico/favicon.ico">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="../assets/ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="../assets/ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="../assets/ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="../assets/ico/apple-touch-icon-57-precomposed.png">
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container-fluid">
<a class="brand" href="#"><?php echo $aKanban["name"] ?></a>
<div class="nav-collapse collapse">
<p class="navbar-text pull-right">
<a href="#" class="navbar-link" id="update">Update</a>
<a href="#" class="navbar-link" id="save">Save</a>
<a href="#" class="navbar-link" id="addlink">New</a>
</p>
</div><!--/.nav-collapse -->
</div>
</div>
</div>
<div id="dialog">
<img src="data:image/gif;base64,R0lGODlhGAAYAPYAAP///4Wex/j5+9Xd66u82Jmt0I2kytPb6v39/cbS5I6ly4Wex/L0+J+z056y
0vT2+ZSqzZOpzfH0+Pv7/MTQ5Pf4+s3X58zW56q715yw0YegyIqiyZmu0Ovv9d7l75GnzLbF3fX3
+qi515arzq292dXe64ihyM/Y6O/y9+nt9IujyrvJ38PP49ri7cHO4snU5rPD3Pr6/Juw0ebr89ff
7NLb6rnH3qW31aS21Zesz6K11OP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MJBguZmpkbCQiUDw2bo5oyDIcMEKSrCyMShQiirKQ3FYUJs6Q2hgIKuZomNYcD
v5kfM4gExQ0PlAW/MBOUAJizL9OC1awik9PPuTKvlMq/x5QHxQsbNIgC2r8JiLjpCzCfsA70Czi2
hQwR9FwdkiAL3ClEEyi829Tp3rQKFzBkWKDBgYgDArBpRBQIADsAAAAAAAAAAAA=" /><br />Loading...
</div>
<div id="dialog-form" title="Edit">
<form>
<fieldset>
<label for="dialog-title">Title</label>
<input type="text" id="dialog-title" class="text ui-widget-content ui-corner-all" />
<label for="dialog-contents">Contents</label>
<textarea class="text ui-widget-content ui-corner-all" id="dialog-contents"></textarea>
</fieldset>
</form>
</div>
<div class="container-fluid">
<div class="row-fluid">
<span class="span3">
<h3>ToDo</h3>
</span>
<span class="span3">
<h3>Doing</h3>
</span>
<span class="span3">
<h3>Waiting on</h3>
</span>
<span class="span3">
<h3>Done</h3>
</span>
</div>
<div id="holder" class="row-fluid"></div>
<hr>
<footer>
<p>Powered by <a href="https://github.com/apuyou/akanban">aKanban</a></p>
</footer>
</div>
</body>
</html>