/************************************************************************************************************************************************************************************************************ * * JS PER AUDIO IN IMAGE PLUS * ************************************************************************************************************************************************************************************************************/ function ajaxAttachedDocsDrawer(elt, appendPopupDiv) { var tagsList = ""; appendPopupDiv = true; if (appendPopupDiv && isEmpty($('body').find('#iplus_popupMedia'))) $('body').append('
'); var fileContainerPath = contextPath + '/applications/webwork/parts/partFileContainer.jsp'; var $divPopMed = $("div#iplus_popupMedia"); var links = $("#" + $(elt).attr("id") + " a").map( function () { var href = $(this).attr('href'); if (href) { if (href.startsWith("#") && href.length > 1) { var $tag = $(href); var html = $tag.html(); if (html) { //findIPlusMedia($(this)); changeIplusMediaTextA($(this)); findIPlusMedia($(this)); } else { return href; } } } }).get(); if (links.length > 0) { links = jQuery.unique(links); tagsList = (("" + links ).split("[").join("")).split("]").join("").split(" ").join("");//.split("#").join("@"); ajaxAttMedia(tagsList, $divPopMed, fileContainerPath); //setTimeout( $("#" + $(elt).attr("id") + " a").map( function () { var href = $(this).attr('href'); if (href) { if (href.startsWith("#") && href.length > 1) { var $tag = $(href); var html = $tag.html(); if (html) { changeIplusMediaTextA($(this)); findIPlusMedia($(this)); } else { removeIPlusMediaClass($(this)); return href; } } } }).get(); // ,1000); } $("#" + $(elt).attr("id") + " a").map( function () { var href = $(this).attr('href'); if (href) { if (href.startsWith('^$^')) { ajaxAttTeo($(this), $divPopMed, fileContainerPath); return $(this); } } }).get(); /* if (linksA.length > 0) { console.debug("linksA"); console.debug(linksA); for (var prop in linksA) { ajaxAttTeo(prop, $divPopMed, fileContainerPath); } }*/ getMbMediaPlayer(); } function ajaxAttMedia( tagsList, $divPopMed, fileContainerPath) { var data = { 'TAGS':tagsList, 'isSingleFile':'yes'}; $.ajax({ async:false, data:data, url:fileContainerPath, dataType:'html', cache:false, success:function (html) { if (html) { var $absDiv = $(html); $absDiv.hide(); $absDiv.insertAfter($divPopMed); } } }); } function ajaxAttMediaTag( tag, $divPopMed, fileContainerPath) { var data = { 'TAG':tag, 'isSingleFile':'yes'}; $.ajax({ async:false, data:data, url:fileContainerPath, dataType:'html', cache:false, success:function (html) { if (html) { var $absDiv = $(html); $absDiv.hide(); $absDiv.insertAfter($divPopMed); } } }); } /*function mbMediaPlayer(elt) { $("#" + $(elt).attr("id") + " a").map( function () { var href = $(this).attr('tag'); if (href) { if (href.startsWith("#") && href.length > 1) { var $tag = $(href); var html = $tag.html(); if (html) { getmediaDesign($tag) ; } else { return href; } } } }).get(); }*/ function getMbMediaPlayer(){ if ($(".mb_mm_audio_player").length > 0) { $(".mb_mm_audio_player").each(function(){ var thisAudio = $(this); var thisId = thisAudio.attr("id"); if ($("#JPL_mb_" + thisId).attr("id")==undefined) { $.mbMiniPlayer.swfPath = "" + contextPath + "/commons/layout/multimedia/audioPlayer/inc/"; $(thisAudio).mb_miniPlayer({ inLine:false, width:120, skin:"black" }); } }); } } function ajaxAttTeo(ele, $divPopMed, fileContainerPath) { var $this = $(ele); var href = $this.attr('href'); var isSingleFile = href.startsWith('^$^SF_'); var isImagePlus = href.startsWith('^$^IPS_'); var elId; if (isSingleFile) elId = href.substring(6); else if (isImagePlus) elId = href.substring(7); var tag = ''; // per evitare di modificare tutti i link nei testi di Chambra if (!isSingleFile && !isImagePlus) { tag = href.substring(1); isSingleFile = true; } var str = $this.attr('data-elindom'); var elInDOM = !str || "yes" == str; data = {'elId':elId, 'isIncluded':elInDOM ? 'yes' : 'no', 'isSingleFile':(isSingleFile ? 'yes' : 'no' ), 'isImagePlus':(isImagePlus ? 'yes' : 'no'), 'TAG':tag}; $.ajax({ async:false, data:data, url:fileContainerPath, dataType:'html', cache:false, success:function (html) { if (html) { // elemento in page if (isImagePlus || elInDOM) { var $html = $(html); $html.insertAfter($this); //$('" + " " + " | " + "
" + html + " | " + "