1/** 2 * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved. 3 * @license GNU General Public License version 2 or later; see LICENSE.txt 4 */ 5 6/** 7 * JCaption javascript behavior 8 * 9 * Used for displaying image captions 10 * 11 * @package Joomla 12 * @since 1.5 13 * @version 1.0 14 */ 15var JCaption = new Class({ 16 initialize: function(selector) 17 { 18 this.selector = selector; 19 20 var images = $$(selector); 21 images.each(function(image){ this.createCaption(image); }, this); 22 }, 23 24 createCaption: function(element) 25 { 26 // ignore if this caption is parsed - modified by JA 27 if (element.getParent().hasClass ('img_caption')) return; 28 var caption = document.createTextNode(element.title); 29 var container = document.createElement("div"); 30 var text = document.createElement("p"); 31 var width = element.getAttribute("width"); 32 var align = element.getAttribute("align"); 33 34 if(!width) { 35 width = element.width; 36 } 37 38 //Windows fix 39 if (!align) 40 align = element.getStyle("float"); // Rest of the world fix 41 if (!align) // IE DOM Fix 42 align = element.style.styleFloat; 43 44 if (align=="" || !align) { 45 align="none"; 46 } 47 48 text.appendChild(caption); 49 text.className = this.selector.replace('.', '_'); 50 51 element.parentNode.insertBefore(container, element); 52 container.appendChild(element); 53 if (element.title != "") { 54 container.appendChild(text); 55 } 56 container.className = this.selector.replace('.', '_'); 57 container.className = container.className + " " + align; 58 container.setAttribute("style","float:"+align); 59 60 container.style.width = width + "px"; 61 62 } 63}); 64
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.