mirror of https://github.com/sipwise/ngcp-csc.git
What was done: 1. Tooltip for toggle should say "Allow everything except..."/"Block everything except..." depending on current value 2. Remove theme roller module from menu 3. Also fix tooltip for reminder module toggle button Change-Id: Ia2435f6296d026afca4c7f1543b7f2eaa9e9cb72changes/93/13993/3
parent
b8d458bd2f
commit
68cf98a0bb
@ -1,15 +0,0 @@
|
|||||||
Ext.define('NgcpCsc.model.ThemeRoller', {
|
|
||||||
extend: 'Ext.data.Model',
|
|
||||||
|
|
||||||
fields: ['basecolor', 'fontcolor', 'bodybgcolor', 'fontfamily', 'fontweight', 'fontsize'],
|
|
||||||
|
|
||||||
proxy: {
|
|
||||||
type: 'ajax',
|
|
||||||
url: '/resources/data/themeroller.json',
|
|
||||||
autoLoad: true,
|
|
||||||
reader: {
|
|
||||||
type: 'json',
|
|
||||||
rootProperty: 'data'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
@ -1,176 +0,0 @@
|
|||||||
Ext.define('NgcpCsc.view.pages.themeroller.ThemeRoller', {
|
|
||||||
extend: 'Ext.form.Panel',
|
|
||||||
|
|
||||||
xtype: 'themeroller',
|
|
||||||
|
|
||||||
viewModel: 'themeroller',
|
|
||||||
|
|
||||||
controller: 'themeroller',
|
|
||||||
|
|
||||||
items: [{
|
|
||||||
defaults: {
|
|
||||||
ui: 'core-container',
|
|
||||||
collapsible: true,
|
|
||||||
collapsed: false,
|
|
||||||
layout: 'responsivecolumn',
|
|
||||||
margin:10,
|
|
||||||
defaults:{
|
|
||||||
padding: 20
|
|
||||||
}
|
|
||||||
},
|
|
||||||
items: [{
|
|
||||||
title: Ngcp.csc.locales.themeroller.first_section_title[localStorage.getItem('languageSelected')],
|
|
||||||
items: [{
|
|
||||||
userCls: 'big-66 small-100',
|
|
||||||
items: [{
|
|
||||||
xtype: 'container',
|
|
||||||
defaults: {
|
|
||||||
width: '100%'
|
|
||||||
},
|
|
||||||
items: [{
|
|
||||||
xtype: 'colorfield',
|
|
||||||
fieldLabel: 'Base color',
|
|
||||||
bind: '{themeroller.basecolor}',
|
|
||||||
listeners: {
|
|
||||||
change: 'applyTheme'
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
xtype: 'colorselector',
|
|
||||||
hidden: true
|
|
||||||
}]
|
|
||||||
}, {
|
|
||||||
xtype: 'container',
|
|
||||||
defaults: {
|
|
||||||
width: '100%'
|
|
||||||
},
|
|
||||||
items: [{
|
|
||||||
xtype: 'colorfield',
|
|
||||||
fieldLabel: 'Font color',
|
|
||||||
bind: '{themeroller.fontcolor}',
|
|
||||||
listeners: {
|
|
||||||
change: 'applyTheme'
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
xtype: 'colorselector',
|
|
||||||
hidden: true
|
|
||||||
}]
|
|
||||||
}, {
|
|
||||||
xtype: 'container',
|
|
||||||
defaults: {
|
|
||||||
width: '100%'
|
|
||||||
},
|
|
||||||
items: [{
|
|
||||||
xtype: 'colorfield',
|
|
||||||
fieldLabel: 'Body bgcolor',
|
|
||||||
bind: '{themeroller.bodybgcolor}',
|
|
||||||
listeners: {
|
|
||||||
change: 'applyTheme'
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
xtype: 'colorselector',
|
|
||||||
hidden: true
|
|
||||||
}]
|
|
||||||
}, {
|
|
||||||
layout: 'hbox',
|
|
||||||
margin: '10 0 0 0',
|
|
||||||
defaults: {
|
|
||||||
xtype: 'button',
|
|
||||||
flex: 1
|
|
||||||
},
|
|
||||||
items: [{
|
|
||||||
text: 'reset',
|
|
||||||
handler: 'resetTheme',
|
|
||||||
margin: '0 5 0 0'
|
|
||||||
}, {
|
|
||||||
text: 'save',
|
|
||||||
handler: 'saveTheme'
|
|
||||||
}]
|
|
||||||
}]
|
|
||||||
}]
|
|
||||||
}, {
|
|
||||||
title: Ngcp.csc.locales.themeroller.second_section_title[localStorage.getItem('languageSelected')],
|
|
||||||
items: [{
|
|
||||||
userCls: 'big-66 small-100',
|
|
||||||
defaults: {
|
|
||||||
width: '100%',
|
|
||||||
listeners: {
|
|
||||||
change: 'applyTheme'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
items: [{
|
|
||||||
xtype: 'textfield',
|
|
||||||
fieldLabel: Ngcp.csc.locales.themeroller.font_family[localStorage.getItem('languageSelected')],
|
|
||||||
bind: '{themeroller.fontfamily}'
|
|
||||||
}, {
|
|
||||||
xtype: 'combo',
|
|
||||||
fieldLabel: Ngcp.csc.locales.themeroller.font_weight[localStorage.getItem('languageSelected')],
|
|
||||||
bind: '{themeroller.fontweight}',
|
|
||||||
editable: false,
|
|
||||||
// left inline until new specs regardng themeroller
|
|
||||||
store: Ext.create('Ext.data.Store', {
|
|
||||||
fields: ['id'],
|
|
||||||
data: [{
|
|
||||||
"id": "normal"
|
|
||||||
}, {
|
|
||||||
"id": "bold"
|
|
||||||
}]
|
|
||||||
}),
|
|
||||||
valueField: 'id',
|
|
||||||
displayField: 'id'
|
|
||||||
}, {
|
|
||||||
xtype: 'numberfield',
|
|
||||||
minValue: 6,
|
|
||||||
editable: false,
|
|
||||||
bind: '{themeroller.fontsize}',
|
|
||||||
fieldLabel: Ngcp.csc.locales.themeroller.font_size[localStorage.getItem('languageSelected')]
|
|
||||||
}, {
|
|
||||||
layout: 'hbox',
|
|
||||||
margin: '10 0 0 0',
|
|
||||||
defaults: {
|
|
||||||
xtype: 'button',
|
|
||||||
flex: 1
|
|
||||||
},
|
|
||||||
items: [{
|
|
||||||
text: 'reset',
|
|
||||||
handler: 'resetTheme',
|
|
||||||
margin: '0 5 0 0'
|
|
||||||
}, {
|
|
||||||
text: 'save',
|
|
||||||
handler: 'saveTheme'
|
|
||||||
}]
|
|
||||||
}]
|
|
||||||
}]
|
|
||||||
}, {
|
|
||||||
title: Ngcp.csc.locales.themeroller.third_section_title[localStorage.getItem('languageSelected')],
|
|
||||||
items: [{
|
|
||||||
userCls: 'big-66 small-100',
|
|
||||||
defaults: {
|
|
||||||
width: '100%'
|
|
||||||
},
|
|
||||||
items: [{
|
|
||||||
xtype: 'filefield',
|
|
||||||
fieldLabel: Ngcp.csc.locales.themeroller.logo[localStorage.getItem('languageSelected')],
|
|
||||||
reference: 'logoField',
|
|
||||||
listeners: {
|
|
||||||
change: 'toggleLogo'
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
layout: 'hbox',
|
|
||||||
margin: '10 0 0 0',
|
|
||||||
defaults: {
|
|
||||||
xtype: 'button',
|
|
||||||
flex: 1
|
|
||||||
},
|
|
||||||
items: [{
|
|
||||||
text: 'reset',
|
|
||||||
handler: 'resetTheme',
|
|
||||||
margin: '0 5 0 0'
|
|
||||||
}, {
|
|
||||||
text: 'save',
|
|
||||||
handler: 'saveTheme'
|
|
||||||
}]
|
|
||||||
}]
|
|
||||||
}]
|
|
||||||
}]
|
|
||||||
}]
|
|
||||||
});
|
|
@ -1,66 +0,0 @@
|
|||||||
Ext.define('NgcpCsc.view.pages.themeroller.ThemeRollerController', {
|
|
||||||
extend: 'Ext.app.ViewController',
|
|
||||||
|
|
||||||
alias: 'controller.themeroller',
|
|
||||||
|
|
||||||
applyTheme: function() {
|
|
||||||
var vm = this.getViewModel();
|
|
||||||
// defer is needed because binding is slower than change listener callback
|
|
||||||
Ext.Function.defer(function() {
|
|
||||||
Fashion.css.setVariables({
|
|
||||||
'base-color': '#' + vm.get('basecolor'),
|
|
||||||
'color': '#' + vm.get('fontcolor'),
|
|
||||||
'body-background-color': '#' + vm.get('bodybgcolor'),
|
|
||||||
'font-family': vm.get('fontfamily'),
|
|
||||||
'font-weight': vm.get('fontweight'),
|
|
||||||
'font-size': vm.get('fontsize') + 'px',
|
|
||||||
'form-field-font-size': vm.get('fontsize') + 'px'
|
|
||||||
});
|
|
||||||
this.getView().updateLayout()
|
|
||||||
}, 300, this);
|
|
||||||
},
|
|
||||||
|
|
||||||
resetTheme: function() {
|
|
||||||
var vm = this.getViewModel();
|
|
||||||
var logoCont = Ext.getCmp('logoContainer');
|
|
||||||
var logoField = this.lookupReference('logoField');
|
|
||||||
|
|
||||||
// TODO use model and model.reset()
|
|
||||||
vm.setData({
|
|
||||||
basecolor: '66A648',
|
|
||||||
fontcolor: '000',
|
|
||||||
bodybgcolor: 'fff',
|
|
||||||
fontfamily: 'Open Sans, Helvetica Neue',
|
|
||||||
fontweight: 'normal',
|
|
||||||
fontsize: '13'
|
|
||||||
});
|
|
||||||
|
|
||||||
logoCont.removeAll();
|
|
||||||
logoField.reset();
|
|
||||||
this.applyTheme();
|
|
||||||
},
|
|
||||||
|
|
||||||
toggleLogo: function(field) {
|
|
||||||
|
|
||||||
var logoCont = Ext.getCmp('logoContainer');
|
|
||||||
|
|
||||||
if (field && field.getValue()) {
|
|
||||||
var reader = new FileReader();
|
|
||||||
var file = field.getEl().down('input[type=file]').dom.files[0];
|
|
||||||
|
|
||||||
reader.onload = function(e) {
|
|
||||||
logoCont.removeAll();
|
|
||||||
logoCont.add(Ext.create('Ext.Img', {
|
|
||||||
src: e.target.result
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
reader.readAsDataURL(file);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
saveTheme: function() {
|
|
||||||
this.fireEvent('showmessage', true, Ngcp.csc.locales.common.save_success[localStorage.getItem('languageSelected')]);
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
@ -1,11 +0,0 @@
|
|||||||
Ext.define('NgcpCsc.view.pages.themeroller.ThemeRollerModel', {
|
|
||||||
extend: 'Ext.app.ViewModel',
|
|
||||||
alias: 'viewmodel.themeroller',
|
|
||||||
|
|
||||||
links: {
|
|
||||||
themeroller:{
|
|
||||||
type: 'NgcpCsc.model.ThemeRoller',
|
|
||||||
id: Ext.id()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
@ -1,10 +0,0 @@
|
|||||||
{
|
|
||||||
"data": {
|
|
||||||
"basecolor": "66A648",
|
|
||||||
"fontcolor": "000",
|
|
||||||
"bodybgcolor": "fff",
|
|
||||||
"fontfamily": "Open Sans, Helvetica Neue",
|
|
||||||
"fontweight": "normal",
|
|
||||||
"fontsize": "13"
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in new issue