For Bug 43992, Bug 57181, Bug 44992
This commit is contained in:
parent
2db9b044c5
commit
34b3a968d3
|
@ -802,13 +802,13 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
onHyperlinkClick: function(url) {
|
onHyperlinkClick: function(url) {
|
||||||
var me = this;
|
|
||||||
if (url) {
|
if (url) {
|
||||||
if (me.api.asc_getUrlType(url)>0)
|
var type = this.api.asc_getUrlType(url);
|
||||||
|
if (type===AscCommon.c_oAscUrlType.Http || type===AscCommon.c_oAscUrlType.Email)
|
||||||
window.open(url);
|
window.open(url);
|
||||||
else
|
else
|
||||||
Common.UI.warning({
|
Common.UI.warning({
|
||||||
msg: me.documentHolder.txtWarnUrl,
|
msg: this.documentHolder.txtWarnUrl,
|
||||||
buttons: ['yes', 'no'],
|
buttons: ['yes', 'no'],
|
||||||
primary: 'yes',
|
primary: 'yes',
|
||||||
callback: function(btn) {
|
callback: function(btn) {
|
||||||
|
|
|
@ -98,6 +98,7 @@ define([
|
||||||
this.options.tpl = _.template(this.template)(this.options);
|
this.options.tpl = _.template(this.template)(this.options);
|
||||||
this.api = this.options.api;
|
this.api = this.options.api;
|
||||||
this._originalProps = null;
|
this._originalProps = null;
|
||||||
|
this.urlType = AscCommon.c_oAscUrlType.Invalid;
|
||||||
|
|
||||||
Common.UI.Window.prototype.initialize.call(this, this.options);
|
Common.UI.Window.prototype.initialize.call(this, this.options);
|
||||||
},
|
},
|
||||||
|
@ -135,9 +136,8 @@ define([
|
||||||
var trimmed = $.trim(value);
|
var trimmed = $.trim(value);
|
||||||
if (trimmed.length>2083) return me.txtSizeLimit;
|
if (trimmed.length>2083) return me.txtSizeLimit;
|
||||||
|
|
||||||
var urltype = me.api.asc_getUrlType(trimmed);
|
me.urlType = me.api.asc_getUrlType(trimmed);
|
||||||
me.isEmail = (urltype==2);
|
return (me.urlType!==AscCommon.c_oAscUrlType.Invalid) ? true : me.txtNotUrl;
|
||||||
return (urltype>0) ? true : me.txtNotUrl;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
me.inputUrl._input.on('input', function (e) {
|
me.inputUrl._input.on('input', function (e) {
|
||||||
|
@ -377,8 +377,8 @@ define([
|
||||||
if (type==c_oHyperlinkType.WebLink) {//WebLink
|
if (type==c_oHyperlinkType.WebLink) {//WebLink
|
||||||
var url = $.trim(me.inputUrl.getValue());
|
var url = $.trim(me.inputUrl.getValue());
|
||||||
|
|
||||||
if (! /(((^https?)|(^ftp)):\/\/)|(^mailto:)/i.test(url) )
|
if (me.urlType!==AscCommon.c_oAscUrlType.Unsafe && ! /(((^https?)|(^ftp)):\/\/)|(^mailto:)/i.test(url) )
|
||||||
url = ( (me.isEmail) ? 'mailto:' : 'http://' ) + url;
|
url = ( (me.urlType==AscCommon.c_oAscUrlType.Email) ? 'mailto:' : 'http://' ) + url;
|
||||||
|
|
||||||
url = url.replace(new RegExp("%20",'g')," ");
|
url = url.replace(new RegExp("%20",'g')," ");
|
||||||
props.put_Value(url);
|
props.put_Value(url);
|
||||||
|
|
|
@ -759,13 +759,13 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
onHyperlinkClick: function(url) {
|
onHyperlinkClick: function(url) {
|
||||||
var me = this;
|
|
||||||
if (url) {
|
if (url) {
|
||||||
if (me.api.asc_getUrlType(url)>0)
|
var type = this.api.asc_getUrlType(url);
|
||||||
|
if (type===AscCommon.c_oAscUrlType.Http || type===AscCommon.c_oAscUrlType.Email)
|
||||||
window.open(url);
|
window.open(url);
|
||||||
else
|
else
|
||||||
Common.UI.warning({
|
Common.UI.warning({
|
||||||
msg: me.documentHolder.txtWarnUrl,
|
msg: this.documentHolder.txtWarnUrl,
|
||||||
buttons: ['yes', 'no'],
|
buttons: ['yes', 'no'],
|
||||||
primary: 'yes',
|
primary: 'yes',
|
||||||
callback: function(btn) {
|
callback: function(btn) {
|
||||||
|
|
|
@ -100,6 +100,7 @@ define([
|
||||||
this.options.tpl = _.template(this.template)(this.options);
|
this.options.tpl = _.template(this.template)(this.options);
|
||||||
this.slides = this.options.slides;
|
this.slides = this.options.slides;
|
||||||
this.api = this.options.api;
|
this.api = this.options.api;
|
||||||
|
this.urlType = AscCommon.c_oAscUrlType.Invalid;
|
||||||
|
|
||||||
Common.UI.Window.prototype.initialize.call(this, this.options);
|
Common.UI.Window.prototype.initialize.call(this, this.options);
|
||||||
},
|
},
|
||||||
|
@ -137,9 +138,8 @@ define([
|
||||||
var trimmed = $.trim(value);
|
var trimmed = $.trim(value);
|
||||||
if (trimmed.length>2083) return me.txtSizeLimit;
|
if (trimmed.length>2083) return me.txtSizeLimit;
|
||||||
|
|
||||||
var urltype = me.api.asc_getUrlType(trimmed);
|
me.urlType = me.api.asc_getUrlType(trimmed);
|
||||||
me.isEmail = (urltype==2);
|
return (me.urlType!==AscCommon.c_oAscUrlType.Invalid) ? true : me.txtNotUrl;
|
||||||
return (urltype>0) ? true : me.txtNotUrl;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
me.inputUrl._input.on('input', function (e) {
|
me.inputUrl._input.on('input', function (e) {
|
||||||
|
@ -236,8 +236,8 @@ define([
|
||||||
def_display = tip;
|
def_display = tip;
|
||||||
} else {
|
} else {
|
||||||
var url = $.trim(me.inputUrl.getValue());
|
var url = $.trim(me.inputUrl.getValue());
|
||||||
if (! /(((^https?)|(^ftp)):\/\/)|(^mailto:)/i.test(url) )
|
if (me.urlType!==AscCommon.c_oAscUrlType.Unsafe && ! /(((^https?)|(^ftp)):\/\/)|(^mailto:)/i.test(url) )
|
||||||
url = ( (me.isEmail) ? 'mailto:' : 'http://' ) + url;
|
url = ( (me.urlType==AscCommon.c_oAscUrlType.Email) ? 'mailto:' : 'http://' ) + url;
|
||||||
url = url.replace(new RegExp("%20",'g')," ");
|
url = url.replace(new RegExp("%20",'g')," ");
|
||||||
props.put_Value( url );
|
props.put_Value( url );
|
||||||
props.put_ToolTip(me.inputTip.getValue());
|
props.put_ToolTip(me.inputTip.getValue());
|
||||||
|
|
|
@ -1662,7 +1662,8 @@ define([
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this.api.asc_getUrlType(url)>0)
|
var type = this.api.asc_getUrlType(url);
|
||||||
|
if (type===AscCommon.c_oAscUrlType.Http || type===AscCommon.c_oAscUrlType.Email)
|
||||||
window.open(url, '_blank');
|
window.open(url, '_blank');
|
||||||
else
|
else
|
||||||
Common.UI.warning({
|
Common.UI.warning({
|
||||||
|
|
|
@ -107,6 +107,7 @@ define([
|
||||||
this.api = this.options.api;
|
this.api = this.options.api;
|
||||||
this.appOptions = options.appOptions;
|
this.appOptions = options.appOptions;
|
||||||
this.dataRangeValid = '';
|
this.dataRangeValid = '';
|
||||||
|
this.urlType = AscCommon.c_oAscUrlType.Invalid;
|
||||||
|
|
||||||
Common.UI.Window.prototype.initialize.call(this, this.options);
|
Common.UI.Window.prototype.initialize.call(this, this.options);
|
||||||
},
|
},
|
||||||
|
@ -144,9 +145,8 @@ define([
|
||||||
var trimmed = $.trim(value);
|
var trimmed = $.trim(value);
|
||||||
if (me.api.asc_getFullHyperlinkLength(trimmed)>2083) return me.txtSizeLimit;
|
if (me.api.asc_getFullHyperlinkLength(trimmed)>2083) return me.txtSizeLimit;
|
||||||
|
|
||||||
var urltype = me.api.asc_getUrlType(trimmed);
|
me.urlType = me.api.asc_getUrlType(trimmed);
|
||||||
me.isEmail = (urltype==2);
|
return (me.urlType!==AscCommon.c_oAscUrlType.Invalid) ? true : me.txtNotUrl;
|
||||||
return (urltype>0) ? true : me.txtNotUrl;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
me.inputUrl._input.on('input', function (e) {
|
me.inputUrl._input.on('input', function (e) {
|
||||||
|
@ -326,8 +326,8 @@ define([
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
var url = this.inputUrl.getValue().replace(/^\s+|\s+$/g,'');
|
var url = this.inputUrl.getValue().replace(/^\s+|\s+$/g,'');
|
||||||
if (! /(((^https?)|(^ftp)):\/\/)|(^mailto:)/i.test(url) )
|
if (me.urlType!==AscCommon.c_oAscUrlType.Unsafe && ! /(((^https?)|(^ftp)):\/\/)|(^mailto:)/i.test(url) )
|
||||||
url = ( (this.isEmail) ? 'mailto:' : 'http://' ) + url;
|
url = ( (me.urlType==AscCommon.c_oAscUrlType.Email) ? 'mailto:' : 'http://' ) + url;
|
||||||
url = url.replace(new RegExp("%20",'g')," ");
|
url = url.replace(new RegExp("%20",'g')," ");
|
||||||
props.asc_setHyperlinkUrl(url);
|
props.asc_setHyperlinkUrl(url);
|
||||||
def_display = url;
|
def_display = url;
|
||||||
|
|
Loading…
Reference in a new issue