[DE][SSE] Editing oleObjects.
This commit is contained in:
parent
c144db698e
commit
e51f4b5502
|
@ -39,17 +39,22 @@
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan=2>
|
<td colspan=2>
|
||||||
<label class="header"><%= scope.textInsert %></label>
|
<label class="header" id="image-lbl-replace" ><%= scope.textInsert %></label>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="padding-small" width="50%">
|
<td width="50%">
|
||||||
<button type="button" class="btn btn-text-default" id="image-button-from-file" style="width:85px;"><%= scope.textFromFile %></button>
|
<button type="button" class="btn btn-text-default" id="image-button-from-file" style="width:85px;"><%= scope.textFromFile %></button>
|
||||||
</td>
|
</td>
|
||||||
<td class="padding-small" width="50%">
|
<td width="50%">
|
||||||
<button type="button" class="btn btn-text-default" id="image-button-from-url" style="width:85px;"><%= scope.textFromUrl %></button>
|
<button type="button" class="btn btn-text-default" id="image-button-from-url" style="width:85px;"><%= scope.textFromUrl %></button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="padding-small" colspan=2>
|
||||||
|
<button type="button" class="btn btn-text-default hidden" id="image-button-edit-object" style="width:85px;"><%= scope.textEdit %></button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="padding-small" colspan=2>
|
<td class="padding-small" colspan=2>
|
||||||
<div class="separator horizontal"></div>
|
<div class="separator horizontal"></div>
|
||||||
|
|
|
@ -73,7 +73,8 @@ define([
|
||||||
Width: 0,
|
Width: 0,
|
||||||
Height: 0,
|
Height: 0,
|
||||||
FromGroup: false,
|
FromGroup: false,
|
||||||
DisabledControls: false
|
DisabledControls: false,
|
||||||
|
isOleObject: false
|
||||||
};
|
};
|
||||||
this.lockedControls = [];
|
this.lockedControls = [];
|
||||||
this._locked = false;
|
this._locked = false;
|
||||||
|
@ -133,12 +134,21 @@ define([
|
||||||
});
|
});
|
||||||
this.lockedControls.push(this.btnInsertFromUrl);
|
this.lockedControls.push(this.btnInsertFromUrl);
|
||||||
|
|
||||||
|
this.btnEditObject = new Common.UI.Button({
|
||||||
|
el: $('#image-button-edit-object')
|
||||||
|
});
|
||||||
|
this.lockedControls.push(this.btnEditObject);
|
||||||
|
|
||||||
this.btnOriginalSize.on('click', _.bind(this.setOriginalSize, this));
|
this.btnOriginalSize.on('click', _.bind(this.setOriginalSize, this));
|
||||||
this.btnInsertFromFile.on('click', _.bind(function(btn){
|
this.btnInsertFromFile.on('click', _.bind(function(btn){
|
||||||
if (this.api) this.api.ChangeImageFromFile();
|
if (this.api) this.api.ChangeImageFromFile();
|
||||||
this.fireEvent('editcomplete', this);
|
this.fireEvent('editcomplete', this);
|
||||||
}, this));
|
}, this));
|
||||||
this.btnInsertFromUrl.on('click', _.bind(this.insertFromUrl, this));
|
this.btnInsertFromUrl.on('click', _.bind(this.insertFromUrl, this));
|
||||||
|
this.btnEditObject.on('click', _.bind(function(btn){
|
||||||
|
if (this.api) this.api.asc_pluginRun(this._originalProps.asc_getPluginGuid(), 0, this._originalProps.asc_getPluginData());
|
||||||
|
this.fireEvent('editcomplete', this);
|
||||||
|
}, this));
|
||||||
$(this.el).on('click', '#image-advanced-link', _.bind(this.openAdvancedSettings, this));
|
$(this.el).on('click', '#image-advanced-link', _.bind(this.openAdvancedSettings, this));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -149,6 +159,7 @@ define([
|
||||||
}));
|
}));
|
||||||
|
|
||||||
this.linkAdvanced = $('#image-advanced-link');
|
this.linkAdvanced = $('#image-advanced-link');
|
||||||
|
this.lblReplace = $('#image-lbl-replace');
|
||||||
},
|
},
|
||||||
|
|
||||||
setApi: function(api) {
|
setApi: function(api) {
|
||||||
|
@ -215,6 +226,24 @@ define([
|
||||||
}
|
}
|
||||||
|
|
||||||
this.btnOriginalSize.setDisabled(props.get_ImageUrl()===null || props.get_ImageUrl()===undefined || this._locked);
|
this.btnOriginalSize.setDisabled(props.get_ImageUrl()===null || props.get_ImageUrl()===undefined || this._locked);
|
||||||
|
|
||||||
|
var pluginGuid = props.asc_getPluginGuid();
|
||||||
|
value = (pluginGuid !== null && pluginGuid !== undefined);
|
||||||
|
if (this._state.isOleObject!==value) {
|
||||||
|
this.btnInsertFromUrl.setVisible(!value);
|
||||||
|
this.btnInsertFromFile.setVisible(!value);
|
||||||
|
this.btnEditObject.setVisible(value);
|
||||||
|
this.lblReplace.text(value ? this.textEditObject : this.textInsert);
|
||||||
|
this._state.isOleObject=value;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this._state.isOleObject) {
|
||||||
|
var plugin = DE.getCollection('Common.Collections.Plugins').findWhere({guid: pluginGuid});
|
||||||
|
this.btnEditObject.setDisabled(plugin===null || plugin ===undefined);
|
||||||
|
} else {
|
||||||
|
this.btnInsertFromUrl.setDisabled(pluginGuid===null);
|
||||||
|
this.btnInsertFromFile.setDisabled(pluginGuid===null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -372,7 +401,7 @@ define([
|
||||||
textWidth: 'Width',
|
textWidth: 'Width',
|
||||||
textHeight: 'Height',
|
textHeight: 'Height',
|
||||||
textOriginalSize: 'Default Size',
|
textOriginalSize: 'Default Size',
|
||||||
textInsert: 'Insert Image',
|
textInsert: 'Replace Image',
|
||||||
textFromUrl: 'From URL',
|
textFromUrl: 'From URL',
|
||||||
textFromFile: 'From File',
|
textFromFile: 'From File',
|
||||||
textAdvanced: 'Show advanced settings',
|
textAdvanced: 'Show advanced settings',
|
||||||
|
@ -382,7 +411,9 @@ define([
|
||||||
txtThrough: 'Through',
|
txtThrough: 'Through',
|
||||||
txtTopAndBottom: 'Top and bottom',
|
txtTopAndBottom: 'Top and bottom',
|
||||||
txtBehind: 'Behind',
|
txtBehind: 'Behind',
|
||||||
txtInFront: 'In front'
|
txtInFront: 'In front',
|
||||||
|
textEditObject: 'Edit Object',
|
||||||
|
textEdit: 'Edit'
|
||||||
|
|
||||||
}, DE.Views.ImageSettings || {}));
|
}, DE.Views.ImageSettings || {}));
|
||||||
});
|
});
|
|
@ -946,6 +946,8 @@
|
||||||
"DE.Views.HyperlinkSettingsDialog.txtEmpty": "This field is required",
|
"DE.Views.HyperlinkSettingsDialog.txtEmpty": "This field is required",
|
||||||
"DE.Views.HyperlinkSettingsDialog.txtNotUrl": "This field should be a URL in the \"http://www.example.com\" format",
|
"DE.Views.HyperlinkSettingsDialog.txtNotUrl": "This field should be a URL in the \"http://www.example.com\" format",
|
||||||
"DE.Views.ImageSettings.textAdvanced": "Show advanced settings",
|
"DE.Views.ImageSettings.textAdvanced": "Show advanced settings",
|
||||||
|
"DE.Views.ImageSettings.textEdit": "Edit",
|
||||||
|
"DE.Views.ImageSettings.textEditObject": "Edit Object",
|
||||||
"DE.Views.ImageSettings.textFromFile": "From File",
|
"DE.Views.ImageSettings.textFromFile": "From File",
|
||||||
"DE.Views.ImageSettings.textFromUrl": "From URL",
|
"DE.Views.ImageSettings.textFromUrl": "From URL",
|
||||||
"DE.Views.ImageSettings.textHeight": "Height",
|
"DE.Views.ImageSettings.textHeight": "Height",
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan=2>
|
<td colspan=2>
|
||||||
<label class="header"><%= scope.textInsert %></label>
|
<label class="header" id="image-lbl-replace"><%= scope.textInsert %></label>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -42,5 +42,10 @@
|
||||||
<button type="button" class="btn btn-text-default" id="image-button-from-url" style="width:85px;"><%= scope.textFromUrl %></button>
|
<button type="button" class="btn btn-text-default" id="image-button-from-url" style="width:85px;"><%= scope.textFromUrl %></button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan=2>
|
||||||
|
<button type="button" class="btn btn-text-default hidden" id="image-button-edit-object" style="width:85px;"><%= scope.textEdit %></button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr class="finish-cell"></tr>
|
<tr class="finish-cell"></tr>
|
||||||
</table>
|
</table>
|
|
@ -72,7 +72,8 @@ define([
|
||||||
Width: 0,
|
Width: 0,
|
||||||
Height: 0,
|
Height: 0,
|
||||||
DisabledControls: false,
|
DisabledControls: false,
|
||||||
keepRatio: false
|
keepRatio: false,
|
||||||
|
isOleObject: false
|
||||||
};
|
};
|
||||||
this.spinners = [];
|
this.spinners = [];
|
||||||
this.lockedControls = [];
|
this.lockedControls = [];
|
||||||
|
@ -142,6 +143,11 @@ define([
|
||||||
});
|
});
|
||||||
this.lockedControls.push(this.btnInsertFromUrl);
|
this.lockedControls.push(this.btnInsertFromUrl);
|
||||||
|
|
||||||
|
this.btnEditObject = new Common.UI.Button({
|
||||||
|
el: $('#image-button-edit-object')
|
||||||
|
});
|
||||||
|
this.lockedControls.push(this.btnEditObject);
|
||||||
|
|
||||||
this.spnWidth.on('change', _.bind(this.onWidthChange, this));
|
this.spnWidth.on('change', _.bind(this.onWidthChange, this));
|
||||||
this.spnHeight.on('change', _.bind(this.onHeightChange, this));
|
this.spnHeight.on('change', _.bind(this.onHeightChange, this));
|
||||||
this.btnOriginalSize.on('click', _.bind(this.setOriginalSize, this));
|
this.btnOriginalSize.on('click', _.bind(this.setOriginalSize, this));
|
||||||
|
@ -149,6 +155,10 @@ define([
|
||||||
if (this.api) this.api.asc_changeImageFromFile();
|
if (this.api) this.api.asc_changeImageFromFile();
|
||||||
Common.NotificationCenter.trigger('edit:complete', this);
|
Common.NotificationCenter.trigger('edit:complete', this);
|
||||||
}, this));
|
}, this));
|
||||||
|
this.btnEditObject.on('click', _.bind(function(btn){
|
||||||
|
if (this.api) this.api.asc_pluginRun(this._originalProps.asc_getPluginGuid(), 0, this._originalProps.asc_getPluginData());
|
||||||
|
Common.NotificationCenter.trigger('edit:complete', this);
|
||||||
|
}, this));
|
||||||
this.btnInsertFromUrl.on('click', _.bind(this.insertFromUrl, this));
|
this.btnInsertFromUrl.on('click', _.bind(this.insertFromUrl, this));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -157,6 +167,7 @@ define([
|
||||||
el.html(this.template({
|
el.html(this.template({
|
||||||
scope: this
|
scope: this
|
||||||
}));
|
}));
|
||||||
|
this.lblReplace = $('#image-lbl-replace');
|
||||||
},
|
},
|
||||||
|
|
||||||
setApi: function(api) {
|
setApi: function(api) {
|
||||||
|
@ -212,6 +223,24 @@ define([
|
||||||
}
|
}
|
||||||
|
|
||||||
this.btnOriginalSize.setDisabled(props.asc_getImageUrl()===null || props.asc_getImageUrl()===undefined || this._locked);
|
this.btnOriginalSize.setDisabled(props.asc_getImageUrl()===null || props.asc_getImageUrl()===undefined || this._locked);
|
||||||
|
|
||||||
|
var pluginGuid = props.asc_getPluginGuid();
|
||||||
|
value = (pluginGuid !== null && pluginGuid !== undefined);
|
||||||
|
if (this._state.isOleObject!==value) {
|
||||||
|
this.btnInsertFromUrl.setVisible(!value);
|
||||||
|
this.btnInsertFromFile.setVisible(!value);
|
||||||
|
this.btnEditObject.setVisible(value);
|
||||||
|
this.lblReplace.text(value ? this.textEditObject : this.textInsert);
|
||||||
|
this._state.isOleObject=value;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this._state.isOleObject) {
|
||||||
|
var plugin = SSE.getCollection('Common.Collections.Plugins').findWhere({guid: pluginGuid});
|
||||||
|
this.btnEditObject.setDisabled(plugin===null || plugin ===undefined);
|
||||||
|
} else {
|
||||||
|
this.btnInsertFromUrl.setDisabled(pluginGuid===null);
|
||||||
|
this.btnInsertFromFile.setDisabled(pluginGuid===null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -307,8 +336,10 @@ define([
|
||||||
textWidth: 'Width',
|
textWidth: 'Width',
|
||||||
textHeight: 'Height',
|
textHeight: 'Height',
|
||||||
textOriginalSize: 'Default Size',
|
textOriginalSize: 'Default Size',
|
||||||
textInsert: 'Insert Image',
|
textInsert: 'Replace Image',
|
||||||
textFromUrl: 'From URL',
|
textFromUrl: 'From URL',
|
||||||
textFromFile: 'From File'
|
textFromFile: 'From File',
|
||||||
|
textEditObject: 'Edit Object',
|
||||||
|
textEdit: 'Edit'
|
||||||
}, SSE.Views.ImageSettings || {}));
|
}, SSE.Views.ImageSettings || {}));
|
||||||
});
|
});
|
|
@ -616,6 +616,8 @@
|
||||||
"SSE.Views.HyperlinkSettingsDialog.textTitle": "Hyperlink Settings",
|
"SSE.Views.HyperlinkSettingsDialog.textTitle": "Hyperlink Settings",
|
||||||
"SSE.Views.HyperlinkSettingsDialog.txtEmpty": "This field is required",
|
"SSE.Views.HyperlinkSettingsDialog.txtEmpty": "This field is required",
|
||||||
"SSE.Views.HyperlinkSettingsDialog.txtNotUrl": "This field should be a URL in the \"http://www.example.com\" format",
|
"SSE.Views.HyperlinkSettingsDialog.txtNotUrl": "This field should be a URL in the \"http://www.example.com\" format",
|
||||||
|
"SSE.Views.ImageSettings.textEdit": "Edit",
|
||||||
|
"SSE.Views.ImageSettings.textEditObject": "Edit Object",
|
||||||
"SSE.Views.ImageSettings.textFromFile": "From File",
|
"SSE.Views.ImageSettings.textFromFile": "From File",
|
||||||
"SSE.Views.ImageSettings.textFromUrl": "From URL",
|
"SSE.Views.ImageSettings.textFromUrl": "From URL",
|
||||||
"SSE.Views.ImageSettings.textHeight": "Height",
|
"SSE.Views.ImageSettings.textHeight": "Height",
|
||||||
|
|
Loading…
Reference in a new issue