1/** 2 * Define Javascript function for refreshing attachments lists 3 * 4 * Copyright (C) 2010-2016 Jonathan M. Cameron, All Rights Reserved 5 * License: http://www.gnu.org/licenses/gpl-3.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 lang the current language ('' if not specified) 14 * @param from string the 'from' clause to pass in the request 15 */ 16 17function refreshAttachments(siteUrl, ptype, pentity, pid, lang, from) { 18 var id = "attachmentsList_" + ptype + "_" + pentity + "_" + pid, 19 alist = document.getElementById(id), 20 url = siteUrl + "/index.php?option=com_attachments&task=attachmentsList"; 21 url += "&parent_id=" + pid; 22 url += "&parent_type=" + ptype + "&parent_entity=" + pentity; 23 url += "&lang=" + lang; 24 url += "&from=" + from + "&tmpl=component&format=raw"; 25 if (!alist) { 26 alist = window.parent.document.getElementById(id); 27 } 28 if (!alist) { 29 id = "attachmentsList_" + ptype + "_default_" + pid; 30 alist = window.parent.document.getElementById(id); 31 } 32 new window.Request({ 33 url: url, 34 method: 'get', 35 onComplete: function (response) { 36 37 // Refresh the attachments list 38 alist.innerHTML = response; 39 40 // Remove any old click events (since they are for a deleted/updated SqueezeBox) 41 $$('a.modal-button').removeEvents('click'); 42 43 // Since the html has been replaced, we need to reconnect the modal button events 44 window.SqueezeBox.initialize({}); 45 window.SqueezeBox.assign($$('a.modal-button'), { parse: 'rel' }); 46 } 47 }).send(); 48}; 49 50
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.