From 183851b06bd6c52f3cae5375f433da720d410447 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 11 Oct 2006 18:12:39 +0000 Subject: MediaWiki 1.7.1 wiederhergestellt --- skins/common/metadata.js | 49 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 skins/common/metadata.js (limited to 'skins/common/metadata.js') diff --git a/skins/common/metadata.js b/skins/common/metadata.js new file mode 100644 index 00000000..9f7a8e01 --- /dev/null +++ b/skins/common/metadata.js @@ -0,0 +1,49 @@ +// Exif metadata display for MediaWiki file uploads +// +// Add an expand/collapse link and collapse by default if set to +// (with JS disabled, user will see all items) +// +// attachMetadataToggle("mw_metadata", "More...", "Fewer..."); + + +function attachMetadataToggle(tableId, showText, hideText) { + if (document.createTextNode) { + var box = document.getElementById(tableId); + if (!box) + return false; + + var tbody = box.getElementsByTagName('tbody')[0]; + + var row = document.createElement('tr'); + + var col = document.createElement('td'); + col.colSpan = 2; + + var link = document.createElement('a'); + link.href = '#'; + + link.onclick = function() { + if (box.className == 'mw_metadata collapsed') { + changeText(link, hideText); + box.className = 'mw_metadata expanded'; + } else { + changeText(link, showText); + box.className = 'mw_metadata collapsed'; + } + return false; + } + + var text = document.createTextNode(hideText); + + link.appendChild(text); + col.appendChild(link); + row.appendChild(col); + tbody.appendChild(row); + + // And collapse! + link.onclick(); + + return true; + } + return false; +} -- cgit v1.2.3-54-g00ecf