Re: [xwiki-devs] [xwiki-notifications] r28793 - platform/xwiki-applications/trunk/administration/src/main/resources/XWiki
On 05/07/2010 10:21 PM, cjdelisle (SVN) wrote:
Author: cjdelisle Date: 2010-05-07 22:21:45 +0200 (Fri, 07 May 2010) New Revision: 28793
Modified: platform/xwiki-applications/trunk/administration/src/main/resources/XWiki/ConfigurableClass.xml Log: XAADMINISTRATION-129: Fix save button for 'Registration> Customize XWiki.RegistrationConfig' Javascript (which fixes buttons) now tested and working in IE7
Modified: platform/xwiki-applications/trunk/administration/src/main/resources/XWiki/ConfigurableClass.xml =================================================================== --- platform/xwiki-applications/trunk/administration/src/main/resources/XWiki/ConfigurableClass.xml 2010-05-07 18:00:43 UTC (rev 28792) +++ platform/xwiki-applications/trunk/administration/src/main/resources/XWiki/ConfigurableClass.xml 2010-05-07 20:21:45 UTC (rev 28793) @@ -222,15 +222,16 @@ var errorShown = false; for (var i = elementsInPage.length - 1; i> -1; i--) { var e = elementsInPage[i]; - if (e.tagName == 'DIV'&& e.getAttribute('class').indexOf('errormessage') != -1) + if (e.tagName != undefined&& e.tagName.toLowerCase() == 'div'&& e.getAttribute('class') != undefined&& e.getAttribute('class').indexOf('errormessage') != -1)
$(e).hasClassName('errormessage') is a better alternative, since indexOf can also match <div class="notanerrormessage">
{ errorShown = true; } else if (!errorShown -&& e.tagName == 'H1' -&& e.getAttribute('class') == 'wikigeneratedheader' -&& e.getAttribute('id').indexOf('HCustomize') == 0) +&& e.tagName != undefined +&& e.tagName.toLowerCase() == 'h1' +&& e.getAttribute('id') != undefined +&& e.getAttribute('id').toLowerCase().indexOf('hcustomize') == 0) { - e.setAttribute('class', 'hidden'); + e.parentNode.removeChild(e);
$(e).remove() or $(e).hide(); You should have a look at what Prototype can offer, see http://www.prototypejs.org/api/element
errorShown = false; } } @@ -239,8 +240,8 @@ var forms = document.getElementsByTagName('form'); var inputs = document.getElementsByTagName('input'); for (var i = 0; i< inputs.length; i++) { - if (inputs[i].getAttribute('type') == 'submit') { - inputs[i].setAttribute('class', 'hidden'); + if (inputs[i].getAttribute('type') != undefined&& inputs[i].getAttribute('type').toLowerCase() == 'submit') { + inputs[i].parentNode.removeChild(inputs[i]);
$(inputs[i]).remove();
} }
@@ -302,6 +303,9 @@ <number>0</number> <className>XWiki.TagClass</className> <guid>ddb1f0f6-1943-4e80-824a-0718cdbf1892</guid> +<property> +<tags/> +</property>
This looks like a leftover tag object which should be removed.
</object> <content>{{velocity}} #*
-- Sergiu Dumitriu http://purl.org/net/sergiu/
participants (1)
-
Sergiu Dumitriu