Start working on a folders support.

This commit is contained in:
Paulo Gustavo Veiga
2012-05-23 21:54:03 -03:00
parent 9bc4504aea
commit b21fd642a5
5 changed files with 136 additions and 18 deletions

View File

@@ -85,6 +85,11 @@ input#selectAll {
.dataTables_filter {
float:right;
}
#mindmapListTable th {
padding: 4px;
}
/* Pagination Styles */
#paginateContainer {
height:40px;
@@ -162,3 +167,10 @@ input#selectAll {
height:50px;
white-space:nowrap;
}
#foldersContainer {
width: 15%;
float: left;
margin-right: 2%;
margin-top: 80px
}

View File

@@ -18,6 +18,46 @@ jQuery.fn.dataTableExt.oSort['es_date-desc'] = function(a, b) {
return ((x < y) ? 1 : ((x > y) ? -1 : 0));
};
$.fn.dataTableExt.oApi.fnReloadAjax = function (oSettings, sNewSource, fnCallback, bStandingRedraw) {
if (typeof sNewSource != 'undefined' && sNewSource != null) {
oSettings.sAjaxSource = sNewSource;
}
this.oApi._fnProcessingDisplay(oSettings, true);
var that = this;
var iStart = oSettings._iDisplayStart;
var aData = [];
this.oApi._fnServerParams(oSettings, aData);
oSettings.fnServerData(oSettings.sAjaxSource, aData, function(json) {
/* Clear the old information from the table */
that.oApi._fnClearTable(oSettings);
/* Got the data - add it to the table */
var aData = (oSettings.sAjaxDataProp !== "") ?
that.oApi._fnGetObjectDataFn(oSettings.sAjaxDataProp)(json) : json;
for (var i = 0; i < aData.length; i++) {
that.oApi._fnAddData(oSettings, aData[i]);
}
oSettings.aiDisplay = oSettings.aiDisplayMaster.slice();
that.fnDraw();
if (typeof bStandingRedraw != 'undefined' && bStandingRedraw === true) {
oSettings._iDisplayStart = iStart;
that.fnDraw(false);
}
that.oApi._fnProcessingDisplay(oSettings, false);
/* Callback user function - for event handlers etc */
if (typeof fnCallback == 'function' && fnCallback != null) {
fnCallback(oSettings);
}
}, oSettings);
}
jQuery.fn.dataTableExt.selectAllMaps = function() {
var total = $('.select input:checkbox[id!="selectAll"]').size();
var selected = $('.select input:checked[id!="selectAll"]').size();

View File

@@ -52,12 +52,6 @@
return '<a href="c/map/' + obj.aData.id + '/edit.htm">' + obj.aData.title + '</a>';
}
},
{
bVisible: false,
bSearchable : false,
sTitle : "Owner Email",
mDataProp: "ownerEmail"
},
{
sTitle : "Owner",
mDataProp :"owner"
@@ -78,7 +72,7 @@
oLanguage : {
"sSearch" : "",
"sInfo" : "_START_-_END_ of _TOTAL_",
"sEmptyTable": "Hey, you don't have any mindmap. Go ahead and create one clicking on the 'New' button !!!"
"sEmptyTable": "No mindmap available for the selected filter criteria."
},
bStateSave:true
});
@@ -233,12 +227,24 @@
$("#actionButtons .tagMap").click(function() {
});
$("#actionButtons .share").click(function() {
});
$("#actionButtons .tags").click(function() {
});
$('#foldersContainer li').click(function(event) {
// Deselect previous option ...
$('#foldersContainer li').removeClass('active');
$('#foldersContainer i').removeClass('icon-white');
// Select the new item ...
var dataTable = $('#mindmapListTable').dataTable();
$(this).addClass('active').filter('i').addClass('icon-white');
// Reload the table data ...
dataTable.fnReloadAjax("../service/maps?q=" + $(this).attr('data-filter'));
event.preventDefault();
});
});
// Register time update functions ....
@@ -265,13 +271,13 @@
</div>
<div id="mindmapListContainer">
<div style="width: 15%;float: left;margin-right: 2%;margin-top: 80px">
<div id="foldersContainer">
<ul class="nav nav-list">
<li class="nav-header">Folders</li>
<li class="active"><a href="#"><i class="icon-inbox"></i> All</a></li>
<li><a href="#"><i class="icon-share"></i> Shared With Me</a></li>
<li><a href="#"><i class="icon-globe"></i> Public Maps</a></li>
<li data-filter="all" class="active"><a href="#"><i class="icon-inbox"></i> All</a></li>
<li data-filter="my_maps" ><a href="#"><i class="icon-user"></i> My Maps</a></li>
<li data-filter="shared_with_me"><a href="#"><i class="icon-share"></i> Shared With Me</a></li>
<li data-filter="public"><a href="#"><i class="icon-globe"></i> Public Maps</a></li>
</ul>
</div>