- Integrate to editor menu

This commit is contained in:
Paulo Gustavo Veiga 2012-06-16 12:12:53 -03:00
parent 2f52856ea1
commit 65db1acf6a
4 changed files with 20 additions and 16 deletions

View File

@ -315,7 +315,7 @@ mindplot.widget.Menu = new Class({
var tagElem = $('tagIt'); var tagElem = $('tagIt');
if (tagElem) { if (tagElem) {
this._addButton('tagIt', false, false, function() { this._addButton('tagIt', false, false, function() {
var reqDialog = new MooDialog.Request('c/tags.htm?mapId=' + mapId, null, var reqDialog = new MooDialog.Request('c/tags?mapId=' + mapId, null,
{'class': 'modalDialog tagItModalDialog', {'class': 'modalDialog tagItModalDialog',
closeButton:true, closeButton:true,
destroyOnClose:true, destroyOnClose:true,
@ -333,11 +333,11 @@ mindplot.widget.Menu = new Class({
var shareElem = $('shareIt'); var shareElem = $('shareIt');
if (shareElem) { if (shareElem) {
this._addButton('shareIt', false, false, function() { this._addButton('shareIt', false, false, function() {
var reqDialog = new MooDialog.Request('c/iframeWrapper.htm?url=c/maps/' + mapId + "/publishf", null, var reqDialog = new MooDialog.Request('c/iframeWrapper?url=c/maps/' + mapId + "/sharef", null,
{'class': 'modalDialog shareItModalDialog', {'class': 'modalDialog shareModalDialog',
closeButton:true, closeButton:true,
destroyOnClose:true, destroyOnClose:true,
title:'Share It' title:'Share'
}); });
reqDialog.setRequestOptions({ reqDialog.setRequestOptions({
onRequest: function() { onRequest: function() {
@ -353,7 +353,7 @@ mindplot.widget.Menu = new Class({
var publishElem = $('publishIt'); var publishElem = $('publishIt');
if (publishElem) { if (publishElem) {
this._addButton('publishIt', false, false, function() { this._addButton('publishIt', false, false, function() {
var reqDialog = new MooDialog.Request('c/iframeWrapper.htm?url=c/maps/' + mapId + "/publishf", null, var reqDialog = new MooDialog.Request('c/iframeWrapper?url=c/maps/' + mapId + "/publishf", null,
{'class': 'modalDialog publishModalDialog', {'class': 'modalDialog publishModalDialog',
closeButton:true, closeButton:true,
destroyOnClose:true, destroyOnClose:true,
@ -374,7 +374,7 @@ mindplot.widget.Menu = new Class({
if (historyElem) { if (historyElem) {
this._addButton('history', false, false, function() { this._addButton('history', false, false, function() {
var reqDialog = new MooDialog.Request('c/history.htm?action=list&goToMindmapList&mapId=' + mapId, null, var reqDialog = new MooDialog.Request('c/history?action=list&goToMindmapList&mapId=' + mapId, null,
{'class': 'modalDialog historyModalDialog', {'class': 'modalDialog historyModalDialog',
closeButton:true, closeButton:true,
destroyOnClose:true, destroyOnClose:true,

View File

@ -189,5 +189,13 @@ div.modalDialog .title
height:400px; height:400px;
} }
.shareModalDialog .content {
height:440px;
}
div.shareModalDialog {
width: 550px;
}

View File

@ -456,7 +456,7 @@ $(function() {
var mapId = mapIds[0]; var mapId = mapIds[0];
$('#' + dialogElemId + ' .modal-body').load(urlTemplate.replace("{mapId}", mapId), $('#' + dialogElemId + ' .modal-body').load(urlTemplate.replace("{mapId}", mapId),
function() { function() {
$('#' + dialogElemId + ' .btn-accept').click(function() { $('#' + dialogElemId + ' .btn-accept').unbind('click').click(function() {
submitDialogForm(); submitDialogForm();
}); });
$('#' + dialogElemId).modal(); $('#' + dialogElemId).modal();
@ -464,11 +464,6 @@ $(function() {
} }
}; };
$("#actionButtons .shareMap").click(function() {
});
$('#foldersContainer li').click(function(event) { $('#foldersContainer li').click(function(event) {
// Deselect previous option ... // Deselect previous option ...
$('#foldersContainer li').removeClass('active'); $('#foldersContainer li').removeClass('active');

View File

@ -56,7 +56,7 @@
<p><strong>Add People:</strong></p> <p><strong>Add People:</strong></p>
<input type="text" id="collabEmails" name="collabEmails" <input type="text" id="collabEmails" name="collabEmails"
placeholder="Enter collaborators emails separared by comas."/> placeholder="Enter collaborators emails separared by comas." class="span1"/>
<div class="btn-group" id="roleBtn"> <div class="btn-group" id="roleBtn">
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">Can edit <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">Can edit
@ -101,14 +101,14 @@ function onClickShare(aElem) {
return role; return role;
} }
function addCollaboration(email, role) { function addCollaboration(email, role, changeType) {
var rowStr; var rowStr;
var tableElem = $("#collabsTable"); var tableElem = $("#collabsTable");
if (role != "owner") { if (role != "owner") {
// Add row to the table ... // Add row to the table ...
var rowTemplate = '\ var rowTemplate = '\
<tr data-collab="{email}" data-role="{role}">\ <tr data-collab="{email}" data-role="{role}">\
<td>{email}</td>\ <td>{email}{typeIcon}</td>\
<td>\ <td>\
<div class="btn-group">\ <div class="btn-group">\
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#""></a>\ <a class="btn dropdown-toggle" data-toggle="dropdown" href="#""></a>\
@ -123,6 +123,7 @@ function addCollaboration(email, role) {
rowStr = rowTemplate.replace(/{email}/g, email); rowStr = rowTemplate.replace(/{email}/g, email);
rowStr = rowStr.replace(/{role}/g, role); rowStr = rowStr.replace(/{role}/g, role);
rowStr = rowStr.replace(/{typeIcon}/g, changeType ? ' <span class="label label-success">' + changeType + '</span>' : "");
var elem = tableElem.append(rowStr); var elem = tableElem.append(rowStr);
// Register change role event ... // Register change role event ...
@ -228,7 +229,7 @@ $("#addBtn").click(function(event) {
$("#collabEmails").val(""); $("#collabEmails").val("");
for (i = 0; i < emails.length; i++) { for (i = 0; i < emails.length; i++) {
email = emails[i]; email = emails[i];
addCollaboration(email, role); addCollaboration(email, role, 'New');
} }
} else { } else {