- Change login action prefix.

- Hide/Display buttons based on the selected items.
This commit is contained in:
Paulo Gustavo Veiga 2012-05-13 18:28:00 -03:00
parent df4100cbc4
commit 0e83d56b94
5 changed files with 66 additions and 30 deletions

View File

@ -79,7 +79,7 @@ mindplot.widget.LinkEditor = new Class({
placeholder: 'http://www.example.com/', placeholder: 'http://www.example.com/',
type:'url', type:'url',
required:true, required:true,
autofocus:'' autofocus:'autofocus'
}); });
if (model.getValue() != null) if (model.getValue() != null)
input.value = model.getValue(); input.value = model.getValue();

View File

@ -45,7 +45,7 @@
default-target-url='/c/mymaps.htm' default-target-url='/c/mymaps.htm'
always-use-default-target='false' always-use-default-target='false'
authentication-failure-url="/c/login.htm?login_error=2" authentication-failure-url="/c/login.htm?login_error=2"
login-processing-url="/j_spring_security_check"/> login-processing-url="/c/j_spring_security_check"/>
<sec:remember-me key="wisemapping-hashed-key"/> <sec:remember-me key="wisemapping-hashed-key"/>
<sec:logout logout-url="/c/logout.htm" invalidate-session="true" logout-success-url="/c/login.htm"/> <sec:logout logout-url="/c/logout.htm" invalidate-session="true" logout-success-url="/c/login.htm"/>
</sec:http> </sec:http>

View File

@ -31,6 +31,7 @@ jQuery.fn.dataTableExt.selectAllMaps = function() {
$(this).prop("checked", false); $(this).prop("checked", false);
}); });
} }
updateToolbar();
}; };
jQuery.fn.dataTableExt.getSelectedMapsIds = function() { jQuery.fn.dataTableExt.getSelectedMapsIds = function() {
@ -138,3 +139,17 @@ jQuery.fn.dialogForm = function(options) {
this.dialog(options); this.dialog(options);
}; };
// Update toolbar events ...
function updateToolbar() {
var selected = $("#mindmapListTable tbody input:checked").length > 0;
if (selected) {
$("#actionButtons").show();
} else {
$("#actionButtons").hide();
}
}

View File

@ -17,7 +17,7 @@
<spring:message code="SIGN_IN"/> <spring:message code="SIGN_IN"/>
</h1> </h1>
<form action="<c:url value='/j_spring_security_check'/>" method="POST"> <form action="<c:url value='/c/j_spring_security_check'/>" method="POST">
<table> <table>
<tbody> <tbody>
<c:if test="${not empty param.login_error}"> <c:if test="${not empty param.login_error}">

View File

@ -28,6 +28,9 @@
bProcessing : true, bProcessing : true,
sAjaxSource : "../service/maps", sAjaxSource : "../service/maps",
sAjaxDataProp: 'mindmapsInfo', sAjaxDataProp: 'mindmapsInfo',
fnInitComplete: function() {
$('#mindmapListTable tbody').change(updateToolbar);
},
aoColumns: [ aoColumns: [
{ {
sTitle : '<input type="checkbox" id="selectAll"/>', sTitle : '<input type="checkbox" id="selectAll"/>',
@ -87,7 +90,7 @@
}); });
$('#mindmapListTable_filter').appendTo("#toolbar"); $('#mindmapListTable_filter').appendTo("#toolbar");
$("#mindmapListTable_length").appendTo("#buttons"); $("#mindmapListTable_length").appendTo("#actionButtons");
$('input:checkbox[id="selectAll"]').click(function() { $('input:checkbox[id="selectAll"]').click(function() {
$("#mindmapListTable").dataTableExt.selectAllMaps(); $("#mindmapListTable").dataTableExt.selectAllMaps();
@ -123,7 +126,7 @@
<!--Buttons--> <!--Buttons-->
<script type="text/javascript" charset="utf-8"> <script type="text/javascript" charset="utf-8">
$(function() { $(function() {
$("#buttons .show-tags").button({ $("#actionButtons .show-tags").button({
icons: { primary: "ui-icon-folder-open" } icons: { primary: "ui-icon-folder-open" }
}).click(function() { }).click(function() {
if ($("#tags").css("opacity") == 0) { if ($("#tags").css("opacity") == 0) {
@ -140,7 +143,7 @@
} }
}); });
$("#buttons .share").button({ $("#actionButtons .share").button({
icons: { primary: "ui-icon-transferthick-e-w" } icons: { primary: "ui-icon-transferthick-e-w" }
}).click(function() { }).click(function() {
var selectedMaps = $('#mindmapListTable').dataTableExt.getSelectedMapsIds(); var selectedMaps = $('#mindmapListTable').dataTableExt.getSelectedMapsIds();
@ -162,7 +165,8 @@
} }
}); });
$("#buttons .newMap").button({ // Creation buttons actions ...
$("#createButtons .newMap").button({
icons: { primary: "ui-icon-circle-plus" } icons: { primary: "ui-icon-circle-plus" }
}).click(function() { }).click(function() {
$("#new-dialog-modal").dialogForm({ $("#new-dialog-modal").dialogForm({
@ -174,8 +178,16 @@
}); });
}); });
$("#createButtons .importMap").button({
icons: { primary: "ui-icon-trash" }
}).click(function() {
window.open('c/map/import.htm');
});
$("#buttons .duplicateMap").button({ $("#createButtons").buttonset();
$("#actionButtons .duplicateMap").button({
icons: { primary: "ui-icon-copy" } icons: { primary: "ui-icon-copy" }
}).click(function() { }).click(function() {
// Map to be cloned ... // Map to be cloned ...
@ -201,7 +213,7 @@
} }
}); });
$("#buttons .renameMap").button({ $("#actionButtons .renameMap").button({
icons: { primary: "ui-icon-gear" } icons: { primary: "ui-icon-gear" }
}).click(function() { }).click(function() {
// Map to be cloned ... // Map to be cloned ...
@ -239,7 +251,7 @@
}); });
$("#buttons .delete").button({ $("#actionButtons .delete").button({
icons: { primary: "ui-icon-trash" } icons: { primary: "ui-icon-trash" }
}).click(function() { }).click(function() {
var mapIds = $('#mindmapListTable').dataTableExt.getSelectedMapsIds(); var mapIds = $('#mindmapListTable').dataTableExt.getSelectedMapsIds();
@ -261,13 +273,7 @@
} }
}); });
$("#buttons .importMap").button({ $("#actionButtons .printMap").button({
icons: { primary: "ui-icon-trash" }
}).click(function() {
window.open('c/map/import.htm');
});
$("#buttons .printMap").button({
icons: { primary: "ui-icon-print" } icons: { primary: "ui-icon-print" }
}).click(function() { }).click(function() {
var mapIds = $('#mindmapListTable').dataTableExt.getSelectedMapsIds(); var mapIds = $('#mindmapListTable').dataTableExt.getSelectedMapsIds();
@ -276,21 +282,29 @@
} }
}); });
$("#buttons .publishMap").button({ $("#actionButtons .publishMap").button({
icons: { primary: "ui-icon-print" } icons: { primary: "ui-icon-print" }
}).click(function() { }).click(function() {
}); });
$("#buttons .shareMap").button({ $("#actionButtons .shareMap").button({
icons: { primary: "ui-icon-print" } icons: { primary: "ui-icon-print" }
}).click(function() { }).click(function() {
}); });
$("#buttons .tagMap").button({ $("#actionButtons .tagMap").button({
icons: { primary: "ui-icon-print" } icons: { primary: "ui-icon-print" }
}).click(function() { }).click(function() {
}); });
$("#actionButtons .moreActions").button({
icons: {
primary: "ui-icon-gear",
secondary: "ui-icon-triangle-1-s"
},
text: false
}).click(function() {
});
}); });
@ -298,6 +312,7 @@
setTimeout(function() { setTimeout(function() {
jQuery("abbr.timeago").timeago() jQuery("abbr.timeago").timeago()
}, 50000); }, 50000);
</script> </script>
</head> </head>
<body> <body>
@ -313,16 +328,22 @@
</div> </div>
<div id="buttons"> <div id="buttonsToolbar">
<button class="newMap">New</button> <div id="createButtons">
<button class="importMap">Import</button> <button class="newMap">New</button>
<button class="duplicateMap">Duplicate</button> <button class="importMap">Import</button>
<button class="delete">Delete</button> </div>
<button class="renameMap">Rename</button> <div id="actionButtons" style="display:none">
<button class="printMap">Print</button> <button class="duplicateMap">Duplicate</button>
<button class="publishMap">Publish</button> <button class="delete">Delete</button>
<button class="shareMap">Collaborate</button> <button class="renameMap">Rename</button>
<button class="tagMap">Tag</button> <button class="printMap">Print</button>
<button class="publishMap">Publish</button>
<button class="shareMap">Collaborate</button>
<button class="tagMap">Tag</button>
<button class="moreActions">More</button>
</div>
</div> </div>
<div> <div>