url = url.replace('$uuid', this.stats.vid);
+ var attrs = "";
+
if (target == undefined) {
target = '_self';
}
options = '';
}
+ if (target === '_download') {
+ var e = url.split('/');
+ var last = e.pop();
+ e = last.split('?');
+ var name = e.shift();
+ this.clickFakeLink('<a href="' + url + '" download="' + name + '"></a>');
+ return false;
+ }
+
// fix #3407
if (target === '_popupiframe' && Modernizr.ios && url.search(/\.pdf$/) >= 0) {
target = '_blank';
if (options == undefined && replace == undefined) {
if (this.support.IE == 0) {
w = win.open(url, mtarget);
- console.log(w);
} else {
- $("#wopen").remove();
- $('body').append('<a id="wopen" href="' + url + '" target="' + mtarget + '"></a>');
- $("#wopen").get(0).click();
- setTimeout(function () {
- $("#wopen").remove();
- }, 200);
+ this.clickFakeLink('<a href="' + url + '" target="' + mtarget + '"></a>');
}
} else {
w = win.open(url, mtarget, options, replace);
return w;
},
+ clickFakeLink: function (html) {
+ var a = $(html);
+ $(a).attr('id', 'wopen');
+ $("#wopen").remove();
+ $('body').append(a);
+ $("#wopen").get(0).click();
+ setTimeout(function () {
+ $("#wopen").remove();
+ }, 200);
+ },
+
openInPopupIframe: function (url, callback) {
this.menu.openView('freeiframe', url, '', function () {
if (callback !== undefined) {