Commit 3f423885 authored by François Billioud's avatar François Billioud

add dialog box actions

parent 15d6eafd
......@@ -124,7 +124,10 @@ Page.prototype = {
//document information
displayLastUserName: function(doc) {$("a#author").html(doc.getAuthor());},
displayLastModification: function(doc) {$("a#last_update").html(doc.getLastModification());},
displayDocumentTitle: function(doc) {$("a#document_title").html(doc.getTitle());},
displayDocumentTitle: function(doc) {
var title = (doc.getTitle().length < 30) ? doc.getTitle() : doc.getTitle().substring(0,30) + "...";
$("a#document_title").html(title);
},
displayDocumentContent: function(doc) {this.getEditor().loadContentFromDocument(doc);},
displayDocumentState: function(doc) {$("a#document_state").html(doc.getState()[getCurrentUser().getLanguage()]);},
......@@ -300,6 +303,57 @@ editDocumentSettings = function() {
}
)}
/**
* open a dialog box to upload a document
*/
uploadDocument = function() {
loadFile("xml/xmlElements.xml", "html", function(data) {
$("upload", data).dialog({
autoOpen: false,
height: 116,
width: 346,
modal: true
});
});
}
/**
* open a dialog box to propose gadgets
*/
gadgetListBox = function() {
loadFile("xml/xmlElements.xml", "html", function(data) {
$("gadget", data).dialog({
autoOpen: false,
height: 416,
width: 600,
modal: true,
buttons: {
"Add": function(){
var gadgetIdList = Array();
$("table#gadget-table tbody tr td input").each(function(){
if (this.checked){
gadgetIdList.push($(this).attr("id"));
}
});
if (gadgetIdList.length == 0){
$(this).dialog("close");
}
var tabTitle = $("div#tabs ul li.tab_selected span").html();
$.ajax({
type: "post",
url:"WebSection_addGadgetList",
data: [{name:"gadget_id_list", value: gadgetIdList}],
success: function(data) {
window.location.reload();
}
});
}
}
});
});
}
saveCurrentDocument = function() {
getCurrentPage().getEditor().saveEdition();
getCurrentDocument().save();
......
......@@ -40,6 +40,37 @@
</fieldset>
</form>
</upload>
<settings>
<form id="erp5_preference">
<fieldset class="center editable">
<div class="field" title="The text editor used by default">
<label> Text Editor </label>
<div class="input">
<input type="radio" value="fck_editor" name="field_my_preferred_text_editor" checked="checked"/>
Xinha Editor&nbsp;&nbsp;
<input type="radio" value="text_area" name="field_my_preferred_text_editor"/>
Plain Text&nbsp;&nbsp;
<input type="hidden" value="" name="default_field_my_preferred_text_editor"/>
</div>
</div>
<div class="field" title="The text format used by default">
<label> Text Format </label>
<div class="input">
<input type="radio" value="text/html" name="field_my_preferred_text_format"/>
HTML&nbsp;&nbsp;
<input type="radio" value="text/plain" name="field_my_preferred_text_format" checked="checked"/>
Plain Text&nbsp;&nbsp;
<input type="radio" value="text/x-rst" name="field_my_preferred_text_format"/>
reStructuredText&nbsp;&nbsp;
<input type="hidden" value="" name="default_field_my_preferred_text_format"/>
</div>
</div>
</fieldset>
</form>
</settings>
<line>
<table>
<tbody>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment