|
|
@ -901,17 +901,49 @@ $.fn.popup.settings = { |
|
|
|
popup : '.ui.popup' |
|
|
|
}, |
|
|
|
|
|
|
|
template: function(text) { |
|
|
|
var html = ''; |
|
|
|
if(typeof text !== undefined) { |
|
|
|
if(typeof text.title !== undefined && text.title) { |
|
|
|
html += '<div class="header">' + text.title + '</div class="header">'; |
|
|
|
escape: function() { |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
templates: { |
|
|
|
escape: function(string) { |
|
|
|
var |
|
|
|
badChars = /[&<>"'`]/g, |
|
|
|
shouldEscape = /[&<>"'`]/, |
|
|
|
escape = { |
|
|
|
"&": "&", |
|
|
|
"<": "<", |
|
|
|
">": ">", |
|
|
|
'"': """, |
|
|
|
"'": "'", |
|
|
|
"`": "`" |
|
|
|
}, |
|
|
|
escapedChar = function(chr) { |
|
|
|
return escape[chr]; |
|
|
|
} |
|
|
|
; |
|
|
|
if(shouldEscape.test(string)) { |
|
|
|
return string.replace(badChars, escapedChar); |
|
|
|
} |
|
|
|
if(typeof text.content !== undefined && text.content) { |
|
|
|
html += '<div class="content">' + text.content + '</div>'; |
|
|
|
return string; |
|
|
|
}, |
|
|
|
popup: function(text) { |
|
|
|
var |
|
|
|
html = '', |
|
|
|
escape = $.fn.popup.settings.templates.escape |
|
|
|
; |
|
|
|
if(typeof text !== undefined) { |
|
|
|
if(typeof text.title !== undefined && text.title) { |
|
|
|
text.title = escape(text.title); |
|
|
|
html += '<div class="header">' + text.title + '</div class="header">'; |
|
|
|
} |
|
|
|
if(typeof text.content !== undefined && text.content) { |
|
|
|
text.content = escape(text.content); |
|
|
|
html += '<div class="content">' + text.content + '</div>'; |
|
|
|
} |
|
|
|
} |
|
|
|
return html; |
|
|
|
} |
|
|
|
return html; |
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|