adding new text categories is now possible
This commit is contained in:
parent
74e122461a
commit
0855ce4881
@ -25,6 +25,8 @@ function init__SYSTEM_SAI_saimod_sys_locale() {
|
|||||||
$('#newtext').click(function(){
|
$('#newtext').click(function(){
|
||||||
$('#addtext').show();
|
$('#addtext').show();
|
||||||
saimod_sys_locale_savenewcontent();
|
saimod_sys_locale_savenewcontent();
|
||||||
|
$('#new_text_id_input').val('');
|
||||||
|
$('#new_category_id_input').val('');
|
||||||
cData.editmode = false;});
|
cData.editmode = false;});
|
||||||
|
|
||||||
$('.groups').click(function(){
|
$('.groups').click(function(){
|
||||||
@ -75,12 +77,13 @@ function saimod_sys_locale_newtext(){
|
|||||||
type: 'GET',
|
type: 'GET',
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
$('#contenttextarea').text('');
|
$('#contenttextarea').text('');
|
||||||
$('#new_text_id').attr('placeholder', 'new title here...').blur();
|
$('#new_category_id input').attr('value', cData.group);
|
||||||
|
$('#new_category_id').show();
|
||||||
$('#new_text_id').show();
|
$('#new_text_id').show();
|
||||||
$('#newtext').show();
|
$('#newtext').show();
|
||||||
$('#changetext').hide();
|
$('#changetext').hide();
|
||||||
$('#newcontenttextarea').hide();
|
$('#newcontenttextarea').hide();
|
||||||
$('#modal').modal('show');
|
$('#modal_main').modal('show');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -88,6 +91,9 @@ function saimod_sys_locale_newtext(){
|
|||||||
function saimod_sys_locale_savecontent(id, lang){
|
function saimod_sys_locale_savecontent(id, lang){
|
||||||
tinyMCE.triggerSave();
|
tinyMCE.triggerSave();
|
||||||
newtext = $('#contenttextarea').val();
|
newtext = $('#contenttextarea').val();
|
||||||
|
newgroup = $('#new_category_id_input').val();
|
||||||
|
console.log($('#new_category_id_input'));
|
||||||
|
console.log(newgroup);
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: SAI_ENDPOINT,
|
url: SAI_ENDPOINT,
|
||||||
data: { sai_mod: '.SYSTEM.SAI.saimod_sys_locale',
|
data: { sai_mod: '.SYSTEM.SAI.saimod_sys_locale',
|
||||||
@ -112,10 +118,10 @@ function saimod_sys_locale_savecontent(id, lang){
|
|||||||
|
|
||||||
function saimod_sys_locale_savenewcontent(){
|
function saimod_sys_locale_savenewcontent(){
|
||||||
tinyMCE.triggerSave();
|
tinyMCE.triggerSave();
|
||||||
newtext = $('#contenttextarea').val();
|
id = $('#new_text_id_input').val();
|
||||||
id = $('#new_text_id').val();
|
cData.group = $('#new_category_id_input').val();
|
||||||
console.log("id "+id);
|
console.log("id: "+id);
|
||||||
category = cData.group;
|
console.log("category: "+cData.group);
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: SAI_ENDPOINT,
|
url: SAI_ENDPOINT,
|
||||||
data: { sai_mod: '.SYSTEM.SAI.saimod_sys_locale',
|
data: { sai_mod: '.SYSTEM.SAI.saimod_sys_locale',
|
||||||
@ -132,6 +138,7 @@ function saimod_sys_locale_savenewcontent(){
|
|||||||
|
|
||||||
function saimod_sys_locale_loadsinglecontent(id, lang){
|
function saimod_sys_locale_loadsinglecontent(id, lang){
|
||||||
$('#new_text_id').hide();
|
$('#new_text_id').hide();
|
||||||
|
$('#new_category_id').hide();
|
||||||
$('#newtext').hide();
|
$('#newtext').hide();
|
||||||
$('#modaltextarea').show();
|
$('#modaltextarea').show();
|
||||||
$('#changetext').show();
|
$('#changetext').show();
|
||||||
@ -152,7 +159,7 @@ function saimod_sys_locale_loadsinglecontent(id, lang){
|
|||||||
$('#modaltitle').html(id);
|
$('#modaltitle').html(id);
|
||||||
$('#modaltitle').show();
|
$('#modaltitle').show();
|
||||||
cData.id = id;
|
cData.id = id;
|
||||||
$('#modal').modal('show');
|
$('#modal_main').modal('show');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -173,15 +180,16 @@ function saimod_sys_locale_delete(buttonID){
|
|||||||
saimod_sys_locale_loadcontent(cData.lang,cData.group);}});
|
saimod_sys_locale_loadcontent(cData.lang,cData.group);}});
|
||||||
|
|
||||||
saimod_sys_locale_loadcontent(cData.lang,cData.group);
|
saimod_sys_locale_loadcontent(cData.lang,cData.group);
|
||||||
$('#modal').modal('hide');
|
$('#modal_main').modal('hide');
|
||||||
}
|
}
|
||||||
|
|
||||||
function init_tinymce(){
|
function init_tinymce(){
|
||||||
tinymce.init({ // General options
|
tinymce.init({ // General options
|
||||||
mode : "textareas",
|
mode : "textareas",
|
||||||
theme : "modern",
|
theme : "modern",
|
||||||
plugins : "anchor,bbcode,charmap,code,contextmenu,directionality,link,textcolor,table,hr,fullscreen,autolink,lists,spellchecker,pagebreak,layer,table,save,emoticons,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,template",
|
|
||||||
|
|
||||||
|
formats : {
|
||||||
|
italic : {inline : 'span', 'classes' : 'italic'}},
|
||||||
// Theme options
|
// Theme options
|
||||||
theme_modern_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
|
theme_modern_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
|
||||||
theme_modern_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
|
theme_modern_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
|
||||||
|
|||||||
@ -10,12 +10,19 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="editfield">
|
<div id="editfield">
|
||||||
<div class="modal fade" id="modal" style="width: 700px;" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
<div class="modal fade" id="modal_main" style="width: 700px;" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h4 class="modal-title" id="modaltitle">${id}</h4>
|
<h4 class="modal-title" id="modaltitle">${id}</h4>
|
||||||
<input type="text" id="new_text_id" placeholder="new title here..." style="display: none;" />
|
<div id="new_category_id" style="display: none;">
|
||||||
|
<h5>Category ID</h5>
|
||||||
|
<input id="new_category_id_input" type="text" placeholder="New category ID here..."/>
|
||||||
|
</div>
|
||||||
|
<div id="new_text_id" style="display: none;">
|
||||||
|
<h5>Text ID</h5>
|
||||||
|
<input id="new_text_id_input" type="text" placeholder="New text ID here..."/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="addtext" style="display: none;">
|
<div id="addtext" style="display: none;">
|
||||||
<div class="tabbable">
|
<div class="tabbable">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user