Commit 43703777 authored by Thomas Flemmer's avatar Thomas Flemmer

add editpanel

parent 4d70e716
......@@ -207,9 +207,17 @@ Ext.define('ARSnova.view.home.motdPanel', {
form.show();
var buttonHandler = function (options) {
var hideLoadMask = ARSnova.app.showLoadMask(Messages.LOAD_MASK_LOGIN);
ARSnova.app.getController('Sessions').login({
keyword: options.config.sessionObj.keyword
var hideLoadMask = ARSnova.app.showLoadMask(Messages.LOAD_MASK);
//ARSnova.app.getController('Sessions').login({
//keyword: options.config.sessionObj.keyword
//});
console.log("buttonhandler");
this.editMotdPanel = Ext.create('ARSnova.view.home.editMotdPanel');
var hTP = ARSnova.app.mainTabPanel.tabPanel.homeTabPanel;
hTP.animateActiveItem(hTP.editMotdPanel, {
type: 'slide',
direction: 'right',
duration: 700
});
hideLoadMask();
};
......
......@@ -25,7 +25,8 @@ Ext.define('ARSnova.view.home.TabPanel', {
'ARSnova.view.home.MySessionsPanel',
'ARSnova.view.home.NewSessionPanel',
'ARSnova.view.home.motdPanel',
'ARSnova.view.home.NewMotdPanel'
'ARSnova.view.home.NewMotdPanel',
'ARSnova.view.home.editMotdPanel'
],
config: {
......@@ -43,13 +44,15 @@ Ext.define('ARSnova.view.home.TabPanel', {
this.newSessionPanel = Ext.create('ARSnova.view.home.NewSessionPanel');
this.motdPanel = Ext.create('ARSnova.view.home.motdPanel');
this.newMotdPanel = Ext.create('ARSnova.view.home.NewMotdPanel');
this.editMotdPanel = Ext.create('ARSnova.view.home.editMotdPanel');
this.add([
this.homePanel,
this.mySessionsPanel,
this.newSessionPanel,
this.motdPanel,
this.newMotdPanel
this.newMotdPanel,
this.editMotdPanel
]);
}
});
/*
* This file is part of ARSnova Mobile.
* Copyright (C) 2011-2012 Christian Thomas Weber
* Copyright (C) 2012-2015 The ARSnova Team
*
* ARSnova Mobile is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ARSnova Mobile is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ARSnova Mobile. If not, see <http://www.gnu.org/licenses/>.
*/
Ext.define('ARSnova.view.home.editMotdPanel', {
extend: 'Ext.Panel',
config: {
fullscreen: true,
scrollable: null,
scroll: 'vertical'
},
sessionKey: null,
/* toolbar items */
toolbar: null,
backButton: null,
/*Editor Panel*/
markdownEditPanel: null,
subject: null,
textarea: null,
saveAndContinueButton: null,
constructor: function (args) {
this.callParent(arguments);
this.backButton = Ext.create('Ext.Button', {
text: Messages.BACK,
ui: 'back',
handler: function () {
var hTP = ARSnova.app.mainTabPanel.tabPanel.homeTabPanel;
hTP.animateActiveItem(hTP.motdPanel, {
type: 'slide',
direction: 'right',
duration: 700
});
}
});
this.toolbar = Ext.create('Ext.Toolbar', {
title: "Edit",//Messages.NEW_MOTD,
cls: 'titlePaddingLeft',
docked: 'top',
ui: 'light',
items: [
this.backButton
]
});
this.markdownEditPanel = Ext.create('ARSnova.view.MarkDownEditorPanel', {
processElement: this.textarea
});
this.subject = Ext.create('Ext.field.Text', {
name: 'subject',
placeHolder: Messages.CATEGORY_PLACEHOLDER
});
this.textarea = Ext.create('Ext.plugins.ResizableTextArea', {
name: 'text',
placeHolder: Messages.FORMAT_PLACEHOLDER
});
this.mainPart = Ext.create('Ext.form.FormPanel', {
cls: 'newQuestion',
scrollable: null,
items: [{
xtype: 'fieldset',
items: [this.subject]
}, {
xtype: 'fieldset',
items: [this.markdownEditPanel, this.textarea]
}]
});
this.saveAndContinueButton = Ext.create('Ext.Button', {
ui: 'confirm',
cls: 'saveQuestionButton',
text: Messages.SAVE_NEW_MESSAGE,
style: 'margin-top: 70px',
handler: function (button) {
this.saveHandler(button);//.then(function () {
//Ext.toast(Messages.QUESTION_SAVED, 3000);
//});
},
scope: this
});
this.add([this.toolbar, {
title: 'createMessage',
style: {
marginTop: '15px'
},
xtype: 'formpanel',
scrollable: null,
id: 'createMessage',
submitOnAction: false,
items: [
this.mainPart,
this.saveAndContinueButton
]
}]);
},
saveHandler: function (button) {
var mainPartValues = this.mainPart.getValues();
var values = null;
//values.text = mainPartValues.text;
//values.subject = mainPartValues.subject;
console.log("save button clicked :", mainPartValues);
}
});
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