[DE] Change hyperlink settings.
This commit is contained in:
parent
0b18b03060
commit
7cbbdeccc9
|
@ -512,6 +512,12 @@
|
||||||
border: 1px solid @input-border;
|
border: 1px solid @input-border;
|
||||||
.border-radius(@border-radius-small);
|
.border-radius(@border-radius-small);
|
||||||
|
|
||||||
|
&.auto {
|
||||||
|
width: auto;
|
||||||
|
padding-left: 10px;
|
||||||
|
padding-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
&:hover:not(.disabled),
|
&:hover:not(.disabled),
|
||||||
.over:not(.disabled) {
|
.over:not(.disabled) {
|
||||||
background-color: @secondary !important;
|
background-color: @secondary !important;
|
||||||
|
@ -520,6 +526,7 @@
|
||||||
&:active:not(.disabled),
|
&:active:not(.disabled),
|
||||||
&.active:not(.disabled) {
|
&.active:not(.disabled) {
|
||||||
background-color: @primary !important;
|
background-color: @primary !important;
|
||||||
|
border-color: @primary;
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,6 +42,11 @@
|
||||||
if (Common === undefined)
|
if (Common === undefined)
|
||||||
var Common = {};
|
var Common = {};
|
||||||
|
|
||||||
|
var c_oHyperlinkType = {
|
||||||
|
InternalLink:0,
|
||||||
|
WebLink: 1
|
||||||
|
};
|
||||||
|
|
||||||
define([
|
define([
|
||||||
'common/main/lib/util/utils',
|
'common/main/lib/util/utils',
|
||||||
'common/main/lib/component/InputField',
|
'common/main/lib/component/InputField',
|
||||||
|
@ -61,11 +66,20 @@ define([
|
||||||
}, options || {});
|
}, options || {});
|
||||||
|
|
||||||
this.template = [
|
this.template = [
|
||||||
'<div class="box">',
|
'<div class="box" style="height: 260px;">',
|
||||||
'<div class="input-row">',
|
'<div class="input-row" style="margin-bottom: 10px;">',
|
||||||
'<label>' + this.textUrl + ' *</label>',
|
'<button type="button" class="btn btn-text-default auto" id="id-dlg-hyperlink-external" style="border-top-right-radius: 0;border-bottom-right-radius: 0;">', this.textExternal,'</button>',
|
||||||
|
'<button type="button" class="btn btn-text-default auto" id="id-dlg-hyperlink-internal" style="border-top-left-radius: 0;border-bottom-left-radius: 0;">', this.textInternal,'</button>',
|
||||||
|
'</div>',
|
||||||
|
'<div id="id-external-link">',
|
||||||
|
'<div class="input-row">',
|
||||||
|
'<label>' + this.textUrl + ' *</label>',
|
||||||
|
'</div>',
|
||||||
|
'<div id="id-dlg-hyperlink-url" class="input-row" style="margin-bottom: 5px;"></div>',
|
||||||
|
'</div>',
|
||||||
|
'<div id="id-internal-link">',
|
||||||
|
'<div id="id-dlg-hyperlink-list" style="width:100%; height: 130px;"></div>',
|
||||||
'</div>',
|
'</div>',
|
||||||
'<div id="id-dlg-hyperlink-url" class="input-row" style="margin-bottom: 5px;"></div>',
|
|
||||||
'<div class="input-row">',
|
'<div class="input-row">',
|
||||||
'<label>' + this.textDisplay + '</label>',
|
'<label>' + this.textDisplay + '</label>',
|
||||||
'</div>',
|
'</div>',
|
||||||
|
@ -94,6 +108,23 @@ define([
|
||||||
var me = this,
|
var me = this,
|
||||||
$window = this.getChild();
|
$window = this.getChild();
|
||||||
|
|
||||||
|
me.btnExternal = new Common.UI.Button({
|
||||||
|
el: $('#id-dlg-hyperlink-external'),
|
||||||
|
enableToggle: true,
|
||||||
|
toggleGroup: 'hyperlink-type',
|
||||||
|
allowDepress: false,
|
||||||
|
pressed: true
|
||||||
|
});
|
||||||
|
me.btnExternal.on('click', _.bind(me.onLinkTypeClick, me, c_oHyperlinkType.WebLink));
|
||||||
|
|
||||||
|
me.btnInternal = new Common.UI.Button({
|
||||||
|
el: $('#id-dlg-hyperlink-internal'),
|
||||||
|
enableToggle: true,
|
||||||
|
toggleGroup: 'hyperlink-type',
|
||||||
|
allowDepress: false
|
||||||
|
});
|
||||||
|
me.btnInternal.on('click', _.bind(me.onLinkTypeClick, me, c_oHyperlinkType.InternalLink));
|
||||||
|
|
||||||
me.inputUrl = new Common.UI.InputField({
|
me.inputUrl = new Common.UI.InputField({
|
||||||
el : $('#id-dlg-hyperlink-url'),
|
el : $('#id-dlg-hyperlink-url'),
|
||||||
allowBlank : false,
|
allowBlank : false,
|
||||||
|
@ -124,6 +155,17 @@ define([
|
||||||
|
|
||||||
$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
|
$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
|
||||||
$window.find('input').on('keypress', _.bind(this.onKeyPress, this));
|
$window.find('input').on('keypress', _.bind(this.onKeyPress, this));
|
||||||
|
me.externalPanel = $window.find('#id-external-link');
|
||||||
|
me.internalPanel = $window.find('#id-internal-link');
|
||||||
|
},
|
||||||
|
|
||||||
|
ShowHideElem: function(value) {
|
||||||
|
this.externalPanel.toggleClass('hidden', value !== c_oHyperlinkType.WebLink);
|
||||||
|
this.internalPanel.toggleClass('hidden', value !== c_oHyperlinkType.InternalLink);
|
||||||
|
},
|
||||||
|
|
||||||
|
onLinkTypeClick: function(type, btn, event) {
|
||||||
|
this.ShowHideElem(type);
|
||||||
},
|
},
|
||||||
|
|
||||||
show: function() {
|
show: function() {
|
||||||
|
@ -139,6 +181,10 @@ define([
|
||||||
if (props) {
|
if (props) {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
|
||||||
|
var type = c_oHyperlinkType.WebLink;//props.get_Type();
|
||||||
|
(type == c_oHyperlinkType.WebLink) ? me.btnExternal.toggle(true) : me.btnInternal.toggle(true);
|
||||||
|
me.ShowHideElem(type);
|
||||||
|
|
||||||
if (props.get_Value()) {
|
if (props.get_Value()) {
|
||||||
me.inputUrl.setValue(props.get_Value().replace(new RegExp(" ",'g'), "%20"));
|
me.inputUrl.setValue(props.get_Value().replace(new RegExp(" ",'g'), "%20"));
|
||||||
} else {
|
} else {
|
||||||
|
@ -225,6 +271,8 @@ define([
|
||||||
txtNotUrl: 'This field should be a URL in the format \"http://www.example.com\"',
|
txtNotUrl: 'This field should be a URL in the format \"http://www.example.com\"',
|
||||||
textTooltip: 'ScreenTip text',
|
textTooltip: 'ScreenTip text',
|
||||||
textDefault: 'Selected text',
|
textDefault: 'Selected text',
|
||||||
textTitle: 'Hyperlink Settings'
|
textTitle: 'Hyperlink Settings',
|
||||||
|
textExternal: 'External Link',
|
||||||
|
textInternal: 'Place in Document'
|
||||||
}, DE.Views.HyperlinkSettingsDialog || {}))
|
}, DE.Views.HyperlinkSettingsDialog || {}))
|
||||||
});
|
});
|
Loading…
Reference in a new issue