diff --git a/static/js/embedDialog.js b/static/js/embedDialog.js index 3348e705..1142cddb 100644 --- a/static/js/embedDialog.js +++ b/static/js/embedDialog.js @@ -212,11 +212,40 @@ pandora.ui.embedDialog = function(/*[url, ]callback*/) { }).join(find.operator); } + function getData() { + var type = $input.type.value(), + view = $list.options('selected')[0]; + return Ox.map($input, function($element, key) { + return Ox.contains(Ox.getObjectById(views, view).inputs, key) + && ( + !Ox.contains(['map', 'calendar'], view) + || ($input.mapMode.value() == 'item' && key != 'find') + || ($input.mapMode.value() == 'find' && key != 'item') + ) + && $element.value ? $element.value() : void 0; + }) + } + function formatHTML() { - var type = $input.type.value(); + var type = $input.type.value(), + view = $list.options('selected')[0], + value = $input.link.value(), + data = getData(); + if (view == 'document') { + var prefix = type == 'iframe' + ? (pandora.site.site.https ? 'https' : 'http') + + '://' + pandora.site.site.url + '/' + : '/', + page = type == 'iframe' ? 'documents' : 'document', + resolution = 480; + if (value == '...' || !value.length) { + value = ''; + } + return '' + value + ''; + } return type == 'link' ? '' + $input.link.value() + + '">' + value + '' : '