break;
case 'article':
h = hh * 0.9;
- w = Math.min(ww,1000);
- if(ww<800){
- w=ww;
- h=hh;
- fullscreen=true;
+ w = Math.min(ww, 1000);
+ if (ww < 800) {
+ w = ww;
+ h = hh;
+ fullscreen = true;
}
break;
case 'iframe':
case 'webvideo':
var w = Math.max(ww * 0.8, 600);
h = (w / 16) * 9;
+ if (h > hh * 0.9) {
+ h = hh * 0.9;
+ w = (h / 9) * 16;
+ }
+
forceHeight = true;
if (w > ww * 0.9) {
fullscreen = true;
if (action === 'link') {
menu += 'href="' + data + '" target="_blank"';
} else if (action === 'copy') {
- menu += 'data-clipboard-text="' + encodeURIComponent(data) + '" ';
+ menu += 'data-clipboard-text="' + escapeHtml(data) + '" ';
} else if (action === 'video') {
var e = data.split(':', 2);
menu += ' href="#/webvideo/' + e[0] + '/' + e[1] + '" ';
return url;
}
+function escapeHtml(text) {
+ return text
+ .replace(/&/g, "&")
+ .replace(/</g, "<")
+ .replace(/>/g, ">")
+ .replace(/"/g, """)
+ .replace(/'/g, "'");
+}
+
$(function () {
$.fn.isLoaded = function () {
if ($(this).length === 0) {