',
'',
'',
@@ -128,6 +148,38 @@ define([
value : ''
});
+ this.cmbShow = new Common.UI.ComboBox({
+ el: $('#control-settings-combo-show'),
+ cls: 'input-group-nr',
+ menuStyle: 'min-width: 120px;',
+ editable: false,
+ data: [
+ { displayValue: this.textBox, value: Asc.c_oAscSdtAppearance.Frame },
+ { displayValue: this.textNone, value: Asc.c_oAscSdtAppearance.Hidden }
+ ]
+ });
+ this.cmbShow.setValue(Asc.c_oAscSdtAppearance.Frame);
+
+ this.btnColor = new Common.UI.ColorButton({
+ style: "width:45px;",
+ menu : new Common.UI.Menu({
+ items: [
+ { template: _.template('') },
+ { template: _.template('' + me.textNewColor + '') }
+ ]
+ })
+ });
+
+ this.btnColor.on('render:after', function(btn) {
+ me.colors = new Common.UI.ThemeColorPalette({
+ el: $('#control-settings-color-menu')
+ });
+ me.colors.on('select', _.bind(me.onColorsSelect, me));
+ });
+ this.btnColor.render( $('#control-settings-color-btn'));
+ this.btnColor.setColor('000000');
+ this.btnColor.menu.items[1].on('click', _.bind(this.addNewColor, this, this.colors, this.btnColor));
+
this.chLockDelete = new Common.UI.CheckBox({
el: $('#control-settings-chb-lock-delete'),
labelText: this.txtLockDelete
@@ -141,7 +193,20 @@ define([
this.afterRender();
},
+ onColorsSelect: function(picker, color) {
+ this.btnColor.setColor(color);
+ },
+
+ updateThemeColors: function() {
+ this.colors.updateColors(Common.Utils.ThemeColor.getEffectColors(), Common.Utils.ThemeColor.getStandartColors());
+ },
+
+ addNewColor: function(picker, btn) {
+ picker.addNewColor((typeof(btn.color) == 'object') ? btn.color.color : btn.color);
+ },
+
afterRender: function() {
+ this.updateThemeColors();
this._setDefaults(this.props);
},
@@ -157,6 +222,14 @@ define([
val = props.get_Tag();
this.txtTag.setValue(val ? val : '');
+ val = props.get_Appearance();
+ (val!==null && val!==undefined) && this.cmbShow.setValue(val);
+
+ val = props.get_Color();
+ val = (val) ? Common.Utils.ThemeColor.getHexColor(val.r, val.g, val.b) : '#000000';
+ this.btnColor.setColor(val);
+ this.colors.select(val,true);
+
val = props.get_Lock();
(val===undefined) && (val = Asc.c_oAscSdtLockType.Unlocked);
this.chLockDelete.setValue(val==Asc.c_oAscSdtLockType.SdtContentLocked || val==Asc.c_oAscSdtLockType.SdtLocked);
@@ -166,11 +239,12 @@ define([
getSettings: function () {
var props = new AscCommon.CContentControlPr();
-
-
props.put_Alias(this.txtName.getValue());
props.put_Tag(this.txtTag.getValue());
+ props.put_Appearance(this.cmbShow.getValue());
+ var color = Common.Utils.ThemeColor.getRgbColor(this.colors.getColor());
+ props.put_Color(color.get_r(), color.get_g(), color.get_b());
var lock = Asc.c_oAscSdtLockType.Unlocked;
@@ -206,7 +280,12 @@ define([
txtLockEdit: 'Contents cannot be edited',
textLock: 'Locking',
cancelButtonText: 'Cancel',
- okButtonText: 'Ok'
+ okButtonText: 'Ok',
+ textShowAs: 'Show as',
+ textColor: 'Color',
+ textBox: 'Bounding box',
+ textNone: 'None',
+ textNewColor: 'Add New Custom Color'
}, DE.Views.ControlSettingsDialog || {}))
});
\ No newline at end of file
diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json
index b2522d08c..4e20642b9 100644
--- a/apps/documenteditor/main/locale/en.json
+++ b/apps/documenteditor/main/locale/en.json
@@ -848,6 +848,11 @@
"DE.Views.ControlSettingsDialog.textTitle": "Content Control Settings",
"DE.Views.ControlSettingsDialog.txtLockDelete": "Content control cannot be deleted",
"DE.Views.ControlSettingsDialog.txtLockEdit": "Contents cannot be edited",
+ "DE.Views.ControlSettingsDialog.textShowAs": "Show as",
+ "DE.Views.ControlSettingsDialog.textColor": "Color",
+ "DE.Views.ControlSettingsDialog.textBox": "Bounding box",
+ "DE.Views.ControlSettingsDialog.textNone": "None",
+ "DE.Views.ControlSettingsDialog.textNewColor": "Add New Custom Color",
"DE.Views.CustomColumnsDialog.cancelButtonText": "Cancel",
"DE.Views.CustomColumnsDialog.okButtonText": "Ok",
"DE.Views.CustomColumnsDialog.textColumns": "Number of columns",
|