wisemapping-open-source/wise-webapp/src/main/webapp/jsp/mindmapList.jsp

455 lines
18 KiB
Plaintext
Raw Normal View History

<!DOCTYPE HTML>
<%@ include file="/jsp/init.jsp" %>
<html>
<head>
<base href="${pageContext.request.contextPath}/"/>
2012-04-06 22:05:42 +02:00
<title><spring:message code="SITE.TITLE"/></title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
<link rel="icon" href="${pageContext.request.contextPath}/images/favicon.ico" type="image/x-icon"/>
<link rel="shortcut icon" href="${pageContext.request.contextPath}/images/favicon.ico" type="image/x-icon"/>
2012-04-06 22:05:42 +02:00
<link rel="stylesheet/less" type="text/css" href="css/mymaps.less"/>
<script type="text/javascript" language="javascript" src="js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" language="javascript" src="bootstrap/js/bootstrap.js"></script>
2012-05-20 17:28:10 +02:00
<script src="js/less.js" type="text/javascript"></script>
2012-04-06 22:05:42 +02:00
<!--jQuery DataTables-->
<script type="text/javascript" language="javascript" src="js/jquery.dataTables.min.js"></script>
2012-05-20 07:25:54 +02:00
<script type="text/javascript" language="javascript" src="js/mymaps.js"></script>
<!-- Update timer plugging -->
<script type="text/javascript" language="javascript" src="js/jquery.timeago.js"></script>
2012-04-06 22:05:42 +02:00
<script type="text/javascript" charset="utf-8">
$(function() {
var jQueryDataTable = $('#mindmapListTable').dataTable({
bProcessing : true,
sAjaxSource : "../service/maps",
sAjaxDataProp: 'mindmapsInfo',
fnInitComplete: function() {
$('#mindmapListTable tbody').change(updateToolbar);
},
2012-04-06 22:05:42 +02:00
aoColumns: [
{
sTitle : '<input type="checkbox" id="selectAll"/>',
sWidth : "15px",
sClass : "select center",
bSortable : false,
bSearchable : false,
fnRender : function(obj) {
return '<input type="checkbox" id="' + obj.aData.id + '"/>';
}
},
{
sClass : "columName",
sTitle : "Name",
bUseRendered : false,
2012-04-08 01:05:50 +02:00
mDataProp: "title",
fnRender : function(obj) {
return '<a href="c/map/' + obj.aData.id + '/edit.htm">' + obj.aData.title + '</a>';
2012-04-08 01:05:50 +02:00
}
2012-04-06 22:05:42 +02:00
},
{
sTitle : "Owner",
mDataProp :"creator"
},
{
bSearchable : false,
sTitle : "Last Modified",
bUseRendered: false,
sType: "date",
mDataProp: "lastModificationTime",
2012-04-06 22:05:42 +02:00
fnRender : function(obj) {
var time = obj.aData.lastModificationTime;
return '<abbr class="timeago" title="' + time + '">' + jQuery.timeago(time) + '</abbr>' + ' ' + '<span style="color: #777;font-size: 75%;padding-left: 5px;">' + obj.aData.lastModifierUser + '</span>';
2012-04-06 22:05:42 +02:00
}
}
],
2012-05-20 17:28:10 +02:00
bAutoWidth : false,
2012-05-19 07:32:09 +02:00
oLanguage : {
2012-05-20 17:28:10 +02:00
"sSearch" : "",
"sInfo" : "_START_-_END_ of _TOTAL_"
2012-04-06 22:05:42 +02:00
},
bStateSave:true
});
2012-05-20 17:28:10 +02:00
// Customize search action ...
$('#mindmapListTable_filter').appendTo("#tableActions");
$('#mindmapListTable_filter input').addClass('input-medium search-query');
$('#mindmapListTable_filter input').attr('placeholder', 'Search');
$("#mindmapListTable_info").appendTo("#pageInfo");
// Re-arrange pagination actions ...
$("#tableFooter").appendTo("#mindmapListTable_wrapper");
$("#mindmapListTable_length").appendTo("#tableFooter");
$('#mindmapListTable_length select').addClass('span1');
2012-04-06 22:05:42 +02:00
$('input:checkbox[id="selectAll"]').click(function() {
$("#mindmapListTable").dataTableExt.selectAllMaps();
});
2012-05-20 17:28:10 +02:00
// Hack for changing the lagination buttons ...
$('#nPageBtn').click(function() {
$('#mindmapListTable_next').click();
2012-04-06 22:05:42 +02:00
});
2012-05-20 17:28:10 +02:00
$('#pPageBtn').click(function() {
$('#mindmapListTable_previous').click();
});
2012-04-06 22:05:42 +02:00
});
</script>
2012-04-06 22:05:42 +02:00
<!--Buttons-->
<script type="text/javascript" charset="utf-8">
$(function() {
// Creation buttons actions ...
$("#newBtn").click(
function() {
2012-04-08 01:05:50 +02:00
$("#new-dialog-modal").dialogForm({
modal: true,
2012-04-15 11:59:32 +02:00
redirect: "c/map/{header.resourceId}/edit.htm",
2012-04-08 01:05:50 +02:00
url : "../service/maps"
});
});
2012-04-06 22:05:42 +02:00
2012-05-19 04:43:22 +02:00
$("#importBtn").click(function() {
window.open('c/map/import.htm');
});
$("#duplicateBtn").click(function() {
// Map to be cloned ...
var tableElem = $('#mindmapListTable');
var rows = tableElem.dataTableExt.getSelectedRows();
if (rows.length > 0) {
2012-04-08 01:05:50 +02:00
// Obtain map name ...
var rowData = tableElem.dataTable().fnGetData(rows[0]);
2012-05-19 04:43:22 +02:00
$('#dupDialogTitle').text("Duplicate '" + rowData.title + "'");
2012-04-08 01:05:50 +02:00
// Obtains map id ...
var mapId = rowData.id;
2012-04-08 01:05:50 +02:00
// Initialize dialog ...
$("#duplicate-dialog-modal").dialogForm({
modal: true,
redirect: "c/map/{header.resourceId}/edit.htm",
url : "../service/maps/" + mapId
2012-04-08 01:05:50 +02:00
});
}
});
2012-04-08 01:05:50 +02:00
2012-05-19 04:43:22 +02:00
$("#renameBtn").click(function() {
2012-05-19 05:13:06 +02:00
// Map to be cloned ...
var tableElem = $('#mindmapListTable');
var rows = tableElem.dataTableExt.getSelectedRows();
if (rows.length > 0) {
// Obtain map name ...
var dataTable = tableElem.dataTable();
var rowData = dataTable.fnGetData(rows[0]);
2012-04-08 01:05:50 +02:00
2012-05-19 05:13:06 +02:00
// Fill dialog with default values ...
var mapId = rowData.id;
$("#rename-dialog-modal input[name='title']").attr('value', rowData.title);
$("#rename-dialog-modal input[name='description']").attr('value', rowData.description);
// Set title ...
$('#renameDialogTitle').text("Rename '" + rowData.title + "'");
// Initialize dialog ...
$("#rename-dialog-modal").dialogForm({
modal: true,
type: 'PUT',
postUpdate: function(reqBodyData) {
// Remove old entry ...
dataTable.fnDeleteRow(rowData);
// Add a new one...
rowData.title = reqBodyData.title;
rowData.description = reqBodyData.description;
dataTable.fnAddData(rowData);
},
url : "../service/maps/" + mapId + "/title"
});
}
});
2012-04-06 22:05:42 +02:00
2012-05-19 04:43:22 +02:00
$("#deleteBtn").click(function() {
2012-05-20 02:36:34 +02:00
var tableUI = $('#mindmapListTable');
var mapIds = tableUI.dataTableExt.getSelectedMapsIds();
2012-05-19 04:43:22 +02:00
if (mapIds.length > 0) {
2012-05-20 02:36:34 +02:00
// Initialize dialog ...
$("#delete-dialog-modal").dialogForm({
2012-05-19 04:43:22 +02:00
modal: true,
2012-05-20 02:36:34 +02:00
type: 'DELETE',
postUpdate: function(reqBodyData) {
// Remove old entry ...
tableUI.dataTableExt.removeSelectedRows();
},
2012-05-20 07:25:54 +02:00
url : "../service/maps/batch?ids=" + mapIds.join(',')
});
2012-05-19 04:43:22 +02:00
}
});
2012-04-08 01:05:50 +02:00
2012-05-19 05:13:06 +02:00
$("#printBtn").click(function() {
var mapIds = $('#mindmapListTable').dataTableExt.getSelectedMapsIds();
if (mapIds.length > 0) {
window.open('c/map/' + mapIds[0] + '/print.htm');
}
});
2012-04-15 13:00:51 +02:00
2012-05-20 07:25:54 +02:00
$("#infoBtn").click(function() {
var mapIds = $('#mindmapListTable').dataTableExt.getSelectedMapsIds();
if (mapIds.length > 0) {
$('#info-dialog-modal .modal-body').load("c/map/" + mapIds[0] + "/details.htm", function() {
$('#info-dialog-modal').modal();
});
}
});
$("#exportBtn").click(function() {
var mapIds = $('#mindmapListTable').dataTableExt.getSelectedMapsIds();
if (mapIds.length > 0) {
$('#export-dialog-modal .modal-body').load("c/map/" + mapIds[0] + "/export.htm", function() {
$('#export-dialog-modal').modal();
});
}
});
2012-05-19 05:13:06 +02:00
$("#actionButtons .publishMap").click(function() {
});
2012-04-15 13:00:51 +02:00
2012-05-19 05:13:06 +02:00
$("#actionButtons .shareMap").click(function() {
});
$("#actionButtons .tagMap").click(function() {
});
$("#actionButtons .share").click(function() {
});
$("#actionButtons .tags").click(function() {
});
2012-04-15 13:00:51 +02:00
2012-04-08 01:05:50 +02:00
});
// Register time update functions ....
setTimeout(function() {
jQuery("abbr.timeago").timeago()
}, 50000);
</script>
2012-04-06 22:05:42 +02:00
</head>
<body>
<div class="content">
<jsp:include page="header.jsp">
<jsp:param name="removeSignin" value="false"/>
<jsp:param name="showLogout" value="true"/>
</jsp:include>
<div id="mindmapListContainer">
<div id="buttonsToolbar" class="btn-toolbar">
2012-04-06 22:05:42 +02:00
<div class="btn-group">
<button class="btn" id="newBtn"><i class="icon-file"></i> New</button>
<button class="btn" id="importBtn"><i class="icon-upload"></i> Import</button>
</div>
<div class="btn-group" id="deleteBtn" style="display:none">
<button class="btn"><i class="icon-trash"></i> Delete</button>
</div>
2012-05-20 07:25:54 +02:00
<div class="btn-group" id="infoBtn" style="display:none">
<button class="btn"><i class="icon-exclamation-sign"></i> Info</button>
</div>
<div class="btn-group" id="actionsBtn" style="display:none">
<button class="btn dropdown-toggle" data-toggle="dropdown">
<i class="icon-asterisk"></i> More
<span class="caret"></span>
</button>
2012-05-20 07:25:54 +02:00
<ul class="dropdown-menu">
2012-05-20 17:28:10 +02:00
<li id="duplicateBtn"><a href="#" onclick="return false"><i class="icon-plus-sign"></i>
Duplicate</a></li>
2012-05-19 04:43:22 +02:00
<li id="renameBtn"><a href="#" onclick="return false"><i class="icon-edit"></i> Rename</a></li>
2012-05-19 05:13:06 +02:00
<li id="printBtn"><a href="#" onclick="return false"><i class="icon-print"></i> Print</a></li>
<li id="publishMap"><a href="#" onclick="return false"><i class="icon-globe"></i>Publish</a></li>
2012-05-20 17:28:10 +02:00
<li id="exportBtn"><a href="#" onclick="return false"><i class="icon-download-alt"></i> Export</a>
</li>
<li id="shareMap"><a href="#" onclick="return false"><i class="icon-share"></i> Share</a></li>
<li id="tagMap"><a href="#" onclick="return false"><i class="icon-tags"></i> Tag</a></li>
</ul>
</div>
2012-05-20 17:28:10 +02:00
<div id="tableActions" class="btn-toolbar">
<div class="btn-group" id="pageButtons">
<button class="btn" id="pPageBtn"><strong>&lt;</strong></button>
<button class="btn" id="nPageBtn"><strong>&gt;</strong></button>
</div>
<div id="pageInfo"></div>
</div>
2012-04-15 13:00:51 +02:00
</div>
<div>
<!-- New map dialog -->
<div id="new-dialog-modal" title="Add new map" class="modal fade" style="display:none">
<div class="modal-header">
<button class="close" data-dismiss="modal">x</button>
<h3>Create a new map</h3>
</div>
<div class="modal-body">
2012-05-20 02:36:34 +02:00
<div class="errorMessage"></div>
<form class="form-horizontal">
<fieldset>
<div class="control-group">
<label class="control-label" for="newTitle"><spring:message code="NAME"/>:</label>
<input class="control" name="title" id="newTitle" type="text" required="true"
2012-05-19 07:32:09 +02:00
placeholder="Name of the new map to create" autofocus="autofocus"/>
</div>
<div class="control-group">
<label class="control-label" for="newDec"><spring:message code="DESCRIPTION"/>:</label>
<input class="control" name="description" id="newDec" type="text"
placeholder="Some description for your map"/>
</div>
</fieldset>
</form>
</div>
<div class="modal-footer">
2012-05-19 05:13:06 +02:00
<button class="btn btn-primary btn-accept" data-loading-text="Creating ...">Create</button>
2012-05-20 07:25:54 +02:00
<button class="btn btn-cancel" data-dismiss="modal">Cancel</button>
</div>
2012-04-08 01:05:50 +02:00
</div>
<!-- Duplicate map dialog -->
<div id="duplicate-dialog-modal" class="modal fade" style="display: none">
<div class="modal-header">
<button class="close" data-dismiss="modal">X</button>
2012-05-19 04:43:22 +02:00
<h3 id="dupDialogTitle"></h3>
</div>
<div class="modal-body">
2012-05-20 02:36:34 +02:00
<div class="errorMessage"></div>
<form class="form-horizontal">
<fieldset>
<div class="control-group">
2012-05-20 02:36:34 +02:00
<label for="title" class="control-label"><spring:message code="NAME"/>: </label>
<input name="title" id="title" type="text" required="required"
placeholder="Name of the new map to create" autofocus="autofocus"
class="control"/>
</div>
<div class="control-group">
<label for="description" class="control-label"><spring:message
code="DESCRIPTION"/>: </label>
<input name="description" id="description" type="text"
placeholder="Some description for your map" class="control"/>
</div>
</fieldset>
</form>
</div>
<div class="modal-footer">
2012-05-19 06:19:55 +02:00
<button class="btn btn-primary btn-accept" data-loading-text="Duplicating ...">Duplicate</button>
2012-05-20 07:25:54 +02:00
<button class="btn btn-cancel" data-dismiss="modal">Cancel</button>
</div>
</div>
2012-04-08 01:05:50 +02:00
2012-05-19 04:43:22 +02:00
<!-- Rename map dialog -->
<div id="rename-dialog-modal" class="modal fade" style="display: none">
<div class="modal-header">
<button class="close" data-dismiss="modal">x</button>
<h3 id="renameDialogTitle"></h3>
</div>
<div class="modal-body">
2012-05-20 02:36:34 +02:00
<div class="errorMessage"></div>
2012-05-19 04:43:22 +02:00
<form class="form-horizontal">
<fieldset>
<div class="control-group">
<label for="renTitle" class="control-label"><spring:message code="NAME"/>: </label>
2012-05-20 02:36:34 +02:00
<input name="title" id="renTitle" required="required" autofocus="autofocus"
class="control"/>
2012-05-19 04:43:22 +02:00
</div>
<div class="control-group">
<label for="renDescription" class="control-label"><spring:message
code="DESCRIPTION"/>:</label>
<input name="description" class="control" id="renDescription"/>
</div>
</fieldset>
</form>
</div>
<div class="modal-footer">
<button class="btn btn-primary btn-accept">Rename</button>
2012-05-20 07:25:54 +02:00
<button class="btn btn-cancel" data-dismiss="modal">Cancel</button>
2012-05-19 04:43:22 +02:00
</div>
2012-04-06 22:05:42 +02:00
</div>
</div>
2012-05-20 02:36:34 +02:00
<!-- Delete map dialog -->
<div id="delete-dialog-modal" class="modal fade" style="display: none">
<div class="modal-header">
<button class="close" data-dismiss="modal">x</button>
<h3>Delete MindMap</h3>
</div>
<div class="modal-body">
<div class="alert alert-block">
2012-05-20 07:25:54 +02:00
<h4 class="alert-heading">Warning!</h4>Deleted mindmap can not be recovered. Do you want to
continue ?.
2012-05-20 02:36:34 +02:00
</div>
</div>
<div class="modal-footer">
<button class="btn btn-primary btn-accept">Delete</button>
2012-05-20 07:25:54 +02:00
<button class="btn btn-cancel" data-dismiss="modal">Cancel</button>
</div>
</div>
<!-- Info map dialog -->
<div id="info-dialog-modal" class="modal fade" style="display: none">
<div class="modal-header">
<button class="close" data-dismiss="modal">x</button>
<h3>Info</h3>
</div>
<div class="modal-body">
</div>
<div class="modal-footer">
<button class="btn btn-cancel" data-dismiss="modal">Close</button>
</div>
</div>
<div id="export-dialog-modal" class="modal fade" style="display: none">
<div class="modal-header">
<button class="close" data-dismiss="modal">x</button>
<h3>Export</h3>
</div>
<div class="modal-body">
</div>
<div class="modal-footer">
<button class="btn btn-cancel" data-dismiss="modal">Close</button>
2012-05-20 02:36:34 +02:00
</div>
</div>
2012-04-06 22:05:42 +02:00
2012-05-20 17:28:10 +02:00
<div id="map-table">
<table class="table table-bordered" id="mindmapListTable">
</table>
<div id="tableFooter" class="form-inline"></div>
2012-04-06 22:05:42 +02:00
</div>
2012-05-20 17:28:10 +02:00
2012-04-06 22:05:42 +02:00
</div>
2012-05-20 02:36:34 +02:00
</div>
2012-04-06 22:05:42 +02:00
<jsp:include page="footer.jsp"/>
</body>
</html>