| author | rougeronj |
| Mon, 22 Dec 2014 12:38:16 +0100 | |
| changeset 350 | 0b6f2883a67b |
| parent 316 | 242510015401 |
| child 435 | e529b633c339 |
| permissions | -rw-r--r-- |
|
150
5b62100b8562
- replace simple http authentication by form auth
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
1 |
<!DOCTYPE html> |
|
224
0167b777ad15
remove deprecated warnings + fix date picker default langauge
ymh <ymh.work@gmail.com>
parents:
150
diff
changeset
|
2 |
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" th:lang="${#ctx.getLocale().toLanguageTag()}" > |
|
76
523f0647513e
add the count of project by spaces, add pagination, update libraries and add some more unit tests.
ymh <ymh.work@gmail.com>
parents:
71
diff
changeset
|
3 |
<head> |
| 71 | 4 |
<title>Renkan</title> |
5 |
||
6 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
|
7 |
<meta charset="utf-8"/> |
|
8 |
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/> |
|
9 |
||
| 127 | 10 |
<link rel="shortcut icon" href="../../static/img/favicon.ico" th:href="@{/static/img/favicon.ico}"/> |
| 123 | 11 |
|
| 350 | 12 |
<script th:remove="all" type="text/javascript" src="../../static/lib/jquery/jquery.js"></script> |
|
305
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
13 |
<script th:remove="all" type="text/javascript" src="../../static/js/thymol.js"></script> |
| 123 | 14 |
|
| 350 | 15 |
<script src="../../static/lib/jquery/jquery.js" th:src="@{/static/lib/jquery/jquery.js}" ></script> |
|
305
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
16 |
<script src="../../static/lib/jquery-ui/jquery-ui.min.js" th:src="@{/static/lib/jquery-ui/jquery-ui.min.js}" ></script> |
| 350 | 17 |
<script src="../../static/lib/underscore/underscore.js" th:src="@{/static/lib/underscore/underscore.js}" ></script> |
|
305
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
18 |
<script src="../../static/lib/URI.js" th:src="@{/static/lib/URI.js}" ></script> |
| 71 | 19 |
|
|
305
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
20 |
<link href="../../static/lib/jquery-ui/css/ui-lightness/jquery-ui.min.css" rel="stylesheet" th:href="@{/static/lib/jquery-ui/css/ui-lightness/jquery-ui.min.css}"/> |
|
97
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
21 |
<link href="../../static/css/style.css" rel="stylesheet" th:href="@{/static/css/style.css}"/> |
|
305
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
22 |
<link href="../../static/css/index.css" rel="stylesheet" th:href="@{/static/css/index.css}"/> |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
23 |
|
|
76
523f0647513e
add the count of project by spaces, add pagination, update libraries and add some more unit tests.
ymh <ymh.work@gmail.com>
parents:
71
diff
changeset
|
24 |
</head> |
|
523f0647513e
add the count of project by spaces, add pagination, update libraries and add some more unit tests.
ymh <ymh.work@gmail.com>
parents:
71
diff
changeset
|
25 |
<body> |
|
97
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
26 |
<div id="container"> |
| 71 | 27 |
<div id="wrapper"> |
|
150
5b62100b8562
- replace simple http authentication by form auth
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
28 |
<header id="header"> |
|
5b62100b8562
- replace simple http authentication by form auth
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
29 |
<h1><a href="renkanIndex.html" th:href="@{'/'}" id="home-link" th:text="#{renkanIndex.renkan_space}">Renkan Space</a>: <span th:text="${space.title}">Titre</span></h1> |
|
5b62100b8562
- replace simple http authentication by form auth
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
30 |
<div id="headerNav" th:include="fragment/pageFragment :: headerNavFragment"></div> |
|
5b62100b8562
- replace simple http authentication by form auth
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
31 |
</header> |
| 71 | 32 |
<div id="inner"> |
| 87 | 33 |
<div id="label" class="translate" th:text="#{renkanIndex.renkan_exp}">Create a Renkan</div> |
| 298 | 34 |
<form action="#" id="new-renkan-form"> |
35 |
<fieldset id="form-fields"> |
|
36 |
<div id="title-field"><label th:text="#{renkanIndex.renkan_title}" for="renkantitle">title</label><input type="text" id="renkantitle" autofocus="autofocus" x-webkit-speech="x-webkit-speech"/></div> |
|
37 |
<div id="file-field"><label th:text="#{renkanIndex.renkan_file}" for="renkanfile">file</label><input type="file" id="renkanfile"/></div> |
|
38 |
</fieldset> |
|
39 |
<div id="form-submit"><button type="submit">OK</button></div> |
|
| 71 | 40 |
</form> |
41 |
</div> |
|
| 137 | 42 |
<div id="project-list-container"> |
43 |
<h2 th:text="#{renkanIndex.project_list}">Project list</h2> |
|
44 |
<div id="project-filter-container"> |
|
45 |
<form method="get"> |
|
46 |
<input type="text" id="project-filter" name="filter" placeholder="filter title" th:placeholder="#{renkanIndex.project_filter}" th:value="${param['filter']}?${param['filter'][0]}:''" /> |
|
47 |
<button type="submit">OK</button> |
|
| 298 | 48 |
</form> |
| 137 | 49 |
</div> |
50 |
<div th:include="fragment/paginationFragment :: paginationFragment" class="pagination-container"> |
|
| 298 | 51 |
<div> |
52 |
<a href="#?p.page=1"><<</a> |
|
| 137 | 53 |
<a href="#?p.page=3"><</a> |
54 |
<span>...</span> |
|
55 |
<a href="#?p.page=2">2</a> |
|
56 |
<a href="#?p.page=3">3</a> |
|
57 |
<span>4</span> |
|
58 |
<a href="#?p.page=5">5</a> |
|
59 |
<a href="#?p.page=6">6</a> |
|
60 |
<span>...</span> |
|
61 |
<a href="#?p.page=5">></a> |
|
62 |
<a href="#?p.page=7">>></a> |
|
63 |
</div> |
|
64 |
</div> |
|
65 |
<table th:with="columnSort=${param['p.sort']}?${param['p.sort'][0]}:'updated',sortDir=${param['p.sort.dir']}?${param['p.sort.dir'][0]}:'desc'"> |
|
66 |
<thead th:with="sortDirInv=${sortDir}=='desc'?'asc':'desc'"> |
|
67 |
<tr> |
|
68 |
<th th:with="sorted=(${columnSort}=='title')"><span th:text="#{renkanIndex.project_name}">Name</span><form method="get" class="proj-sort-form"><input type="hidden" name="p.sort" value="title"/><input type="hidden" name="p.sort.dir" th:value="${sorted}?${sortDirInv}:'desc'"/><input th:if="${param['filter']}" name="filter" type="hidden" th:value="${param['filter'][0]}"/><input type="submit" class="proj-sortable-col" th:class="${sorted}?'proj-sort-'+${sortDir}+'-col':'proj-sortable-col'" value=""/></form></th> |
|
69 |
<th th:with="sorted=(${columnSort}=='updated')"><span th:text="#{renkanIndex.project_updated}">Updated</span><form method="get" class="proj-sort-form"><input type="hidden" name="p.sort" value="updated"/><input type="hidden" name="p.sort.dir" th:value="(${sorted})?${sortDirInv}:'desc'"/><input th:if="${param['filter']}" name="filter" type="hidden" th:value="${param['filter'][0]}"/><input type="submit" class="proj-sort-desc-col" th:class="${sorted}?'proj-sort-'+${sortDir}+'-col':'proj-sortable-col'" value=""/></form></th> |
|
70 |
<th th:with="sorted=(${columnSort}=='created')"><span th:text="#{renkanIndex.project_creation}" >Creation</span><form method="get" class="proj-sort-form"><input type="hidden" name="p.sort" value="created"/><input type="hidden" name="p.sort.dir" th:value="${sorted}?${sortDirInv}:'desc'"/><input th:if="${param['filter']}" name="filter" type="hidden" th:value="${param['filter'][0]}"/><input type="submit" class="proj-sort-asc-col" th:class="${sorted}?'proj-sort-'+${sortDir}+'-col':'proj-sortable-col'" value=""/></form></th> |
|
|
305
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
71 |
<th th:text="#{renkanIndex.project_commands}">Comm.</th> |
| 137 | 72 |
</tr> |
73 |
</thead> |
|
74 |
<tbody> |
|
75 |
<tr th:each="project: ${page}"> |
|
76 |
<th th:text="${project.title}">title</th> |
|
77 |
<td th:text="${project.updated}?${#dates.format(project.updated, #messages.msg('date.format'))}:''">update</td> |
|
78 |
<td th:text="${#dates.format(project.created, #messages.msg('date.format'))}">date</td> |
|
|
305
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
79 |
<td> |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
80 |
<a href="#" th:href="@{'/p/'+${project.id}(cowebkey=${project.getKey(2)})}" th:title="#{renkanIndex.project_edit_link}"><span class="ui-icon ui-icon-pencil renkan-basic-action"></span></a> |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
81 |
<a href="#" th:href="@{'/p/pub/'+${project.id}(cowebkey=${project.getKey(1)})}" th:title="#{renkanIndex.project_render_link}"><span class="ui-icon renkan-icon-eye renkan-basic-action"></span></a> |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
82 |
<span class="ui-icon ui-icon-triangle-1-e renkan-basic-action renkan-action-button" th:id="'renkan-action-button-'+${project.id}" th:attr="data-project_id=${project.id}"></span> |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
83 |
</td> |
| 137 | 84 |
</tr> |
85 |
</tbody> |
|
86 |
</table> |
|
|
305
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
87 |
<ul th:each="project: ${page}" class="action-menu" id="action-menu-" th:id="'action-menu-'+${project.id}"> |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
88 |
<li><a href="#" th:href="@{'/p/'+${project.id}(cowebkey=${project.getKey(2)})}"><span class="ui-icon ui-icon-pencil"></span><span th:text="#{renkanIndex.project_edit_link}">Edit project</span></a></li> |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
89 |
<li><a href="#" th:attr="data-project_id=${project.id}" class="copy-project"><span class="ui-icon ui-icon-copy"></span><span th:text="#{renkanIndex.project_copy_link}">Copy project</span></a></li> |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
90 |
<li><a href="#" th:attr="data-project_id=${project.id},data-project_title=${project.title}" class="delete-project"><span class="ui-icon ui-icon-trash"></span><span th:text="#{renkanIndex.project_delete_link}">Delete project</span></a></li> |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
91 |
<li><a href="#" th:href="@{'/p/pub/'+${project.id}(cowebkey=${project.getKey(1)})}"><span class=" ui-icon renkan-icon-eye"></span><span th:text="#{renkanIndex.project_render_link}">View project</span></a></li> |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
92 |
<li><a href="#" th:href="@{'/p/exp/'+${project.id}}"><span class="ui-icon ui-icon-arrowthickstop-1-s"></span><span th:text="#{renkanIndex.project_export_link}">Export project</span></a></li> |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
93 |
</ul> |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
94 |
|
| 298 | 95 |
</div> |
| 71 | 96 |
</div> |
| 127 | 97 |
<footer id="footer" th:include="fragment/pageFragment :: footerFragment"> |
| 257 | 98 |
<div id="version">© <span class="version-date">2014</span> <a href="http://www.iri.centrepompidou.fr" target="_blanck">IRI</a> - Version <span class="version-version">0.0</span></div> |
| 127 | 99 |
</footer> |
|
97
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
100 |
</div> |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
101 |
<script th:inline="javascript" > |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
102 |
/*<![CDATA[*/ |
|
305
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
103 |
'use strict'; |
|
97
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
104 |
function go2Title() |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
105 |
{ |
| 298 | 106 |
var renkantitle = $("#renkantitle").val(), |
107 |
renkanfiles = $("#renkanfile").prop("files"); |
|
108 |
|
|
|
305
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
109 |
if(renkantitle.length === 0 && renkanfiles.length === 0) { |
| 298 | 110 |
var alert_message = /*[[#{renkanIndex.js.empty_form_error}]]*/"Please enter a title or a file"; |
|
97
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
111 |
alert(alert_message); |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
112 |
return false; |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
113 |
} |
| 298 | 114 |
var post_url = /*[[@{/rest/projects/}]]*/"/rest/projects/", |
115 |
deferred = $.Deferred(); |
|
|
97
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
116 |
|
| 298 | 117 |
deferred.done(function(new_renkan) { |
118 |
new_renkan.space_id = /*[[${space.id}]]*/"_"; |
|
119 |
$.ajax(post_url, { |
|
120 |
data:JSON.stringify(new_renkan), |
|
121 |
type: "POST", |
|
122 |
dataType: "json", |
|
123 |
contentType: "application/json; charset=UTF-8" |
|
124 |
}).done(function(project){ |
|
125 |
var uri = new URI(window.location); |
|
126 |
window.location = uri.setSearch("p.sort","created").setSearch("p.sort.dir", "desc").href(); |
|
127 |
}); |
|
|
97
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
128 |
}); |
| 298 | 129 |
|
|
305
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
130 |
if(renkanfiles.length === 0) { |
| 298 | 131 |
deferred.resolve({ |
132 |
title: renkantitle, |
|
133 |
description: "", |
|
134 |
uri: null, |
|
135 |
}); |
|
136 |
} |
|
137 |
else { |
|
|
308
7fcb9d12e181
Correct problem with project id and exported/imported project
ymh <ymh.work@gmail.com>
parents:
305
diff
changeset
|
138 |
var fr = new FileReader(); |
| 298 | 139 |
fr.onload = function() { |
140 |
var new_renkan = JSON.parse(fr.result); |
|
141 |
if(renkantitle.length > 0) { |
|
142 |
new_renkan.title = renkantitle; |
|
143 |
} |
|
144 |
if(typeof new_renkan.created !== "undefined") { |
|
145 |
delete new_renkan.created; |
|
146 |
} |
|
147 |
if(typeof new_renkan.updated !== "undefined") { |
|
148 |
delete new_renkan.updated; |
|
149 |
} |
|
150 |
deferred.resolve(new_renkan); |
|
151 |
}; |
|
152 |
fr.readAsText(renkanfiles[0]); |
|
153 |
} |
|
154 |
} |
|
155 |
||
156 |
function copyProject(project_id) |
|
157 |
{ |
|
158 |
var post_url = /*[[@{/p/copy}]]*/"#"; |
|
159 |
$.post(post_url, {"project_id": project_id}) |
|
160 |
.done(function(p){ |
|
161 |
window.location.reload(); |
|
162 |
}); |
|
|
97
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
163 |
} |
| 71 | 164 |
|
| 298 | 165 |
function deleteProject(project_id, project_title) |
166 |
{ |
|
167 |
var message = /*[[#{renkanIndex.project_delete_confirm}]]*/"Delete project \"<%= title %>\""; |
|
168 |
if(confirm(_.template(message, {title: project_title}))) { |
|
169 |
var delete_url = /*[[@{/rest/projects}]]*/"#"; |
|
170 |
$.ajax(delete_url+"/"+project_id, { |
|
171 |
type: "DELETE" |
|
172 |
}).done(function(){ |
|
173 |
window.location.reload(); |
|
174 |
}); |
|
175 |
} |
|
176 |
} |
|
177 |
|
|
|
305
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
178 |
function createMenuHandler(menu, timeoutCallback) { |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
179 |
return function(e) { |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
180 |
menu.toggle(); |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
181 |
$(e.target).toggleClass("ui-icon-triangle-1-e").toggleClass("ui-icon-triangle-1-se"); |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
182 |
$('.renkan-action-button').each(function() { |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
183 |
if($(this).prop('id') !== $(e.target).prop('id')) { |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
184 |
$(this).removeClass("ui-icon-triangle-1-se").addClass("ui-icon-triangle-1-e"); |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
185 |
$("#action-menu-"+$(this).data('project_id')).hide(); |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
186 |
var timeout = $("#action-menu-"+$(this).data('project_id')).data('blurtimeout'); |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
187 |
if(typeof timeout !== 'undefined') { |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
188 |
clearTimeout(menu.data('blurtimeout')); |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
189 |
menu.removeData('blurtimeout'); |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
190 |
} |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
191 |
} |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
192 |
}); |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
193 |
if(menu.is(":visible")) { |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
194 |
menu.data('blurtimeout', setTimeout( timeoutCallback,5000)); |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
195 |
} |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
196 |
} |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
197 |
} |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
198 |
|
| 298 | 199 |
$(function(){ |
200 |
|
|
201 |
$(".copy-project").click(function(event) { |
|
|
305
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
202 |
var project_id = $(event.currentTarget).data("project_id"); |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
203 |
copyProject(project_id); |
| 298 | 204 |
}); |
205 |
||
206 |
$(".delete-project").click(function(event) { |
|
|
305
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
207 |
deleteProject($(event.currentTarget).data("project_id"), $(event.currentTarget).data("project_title")); |
| 298 | 208 |
}); |
209 |
||
210 |
|
|
211 |
$("#new-renkan-form").submit(function(e) { |
|
212 |
e.preventDefault(); |
|
213 |
go2Title(); |
|
214 |
return false; |
|
215 |
}); |
|
216 |
|
|
217 |
$("#import-renkan-form").submit(function(e) { |
|
218 |
e.preventDefault(); |
|
219 |
console.log("import form event :", e); |
|
220 |
}); |
|
|
305
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
221 |
|
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
222 |
$('.renkan-action-button').each(function() { |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
223 |
var projectId = $(this).data('project_id'); |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
224 |
var menu = $('#action-menu-'+projectId).menu().position({ my: "left top", at: "right top", of: this }).hide(); |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
225 |
var that = this; |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
226 |
|
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
227 |
var timeoutCallback = function() { |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
228 |
menu.hide(); |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
229 |
$(that).removeClass("ui-icon-triangle-1-se").addClass("ui-icon-triangle-1-e"); |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
230 |
menu.removeData('blurtimeout'); |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
231 |
}; |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
232 |
|
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
233 |
menu.on('menufocus', function() { |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
234 |
clearTimeout(menu.data('blurtimeout')); |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
235 |
menu.removeData('blurtimeout'); |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
236 |
}); |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
237 |
menu.on('menublur',function(e) { |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
238 |
menu.data('blurtimeout', setTimeout( timeoutCallback,200)); |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
239 |
}); |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
240 |
|
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
241 |
$(this).click(createMenuHandler(menu, timeoutCallback)); |
|
4dc484119b4c
Streamline commands. Add popup menus. new version
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
242 |
}); |
|
97
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
243 |
}); |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
244 |
|
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
245 |
/*]]>*/ |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
246 |
</script> |
|
76
523f0647513e
add the count of project by spaces, add pagination, update libraries and add some more unit tests.
ymh <ymh.work@gmail.com>
parents:
71
diff
changeset
|
247 |
</body> |
| 71 | 248 |
</html> |