1/** 2 * Define Javascript function for refreshing attachments lists 3 * 4 * Copyright (C) 2010 Jonathan M. Cameron, All Rights Reserved 5 * License: http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL 6 * 7 * By Jonathan Cameron 8 * 9 * @param siteURL string the site base URL for the request 10 * @param ptype string parent_type for the attachments list parent 11 * @param pentity string parent_entity for the attachments list parent 12 * @param pid integer parent_id for the attachments list parent 13 * @param from string the 'from' clause to pass in the request 14 */ 15 16function refreshAttachments(siteUrl, ptype, pentity, pid, from) { 17 var url = siteUrl + "/index.php?option=com_attachments&task=attachmentsList"; 18 url += "&parent_id=" + pid; 19 url += "&parent_type=" + ptype + "&parent_entity=" + pentity; 20 url += "&from=" + from + "&tmpl=component&format=raw"; 21 id = "attachmentsList_" + ptype + "_" + pentity + "_" + pid; 22 var alist = document.getElementById(id); 23 if ( !alist ) { 24 alist = window.parent.document.getElementById(id); 25 } 26 var a = new Ajax( url, { 27 method: 'get', 28 onComplete: function( response ) { 29 30 // Refresh the attachments list 31 alist.innerHTML = response; 32 33 // Since the html has been replaced, we need to reconnect the events 34 // (Note: addEvent checks to prevent adding duplicate events) 35 $$('a.modal-button').each(function(el) { 36 el.addEvent('click', function(e) { 37 new Event(e).stop(); 38 SqueezeBox.fromElement(el); 39 }); 40 }); 41 42 }}).request(); 43};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.