From 66d23ef24e3fc0aff9b5ddc9937d13c231ff25b1 Mon Sep 17 00:00:00 2001 From: MichaelDaum Date: Tue, 30 Oct 2012 11:31:09 +0000 Subject: [PATCH] Item12192: don't use $(".jqButton").show() on a display:none button as jquery will happily make it a display:inline instead of a display:inline-block. Adding/removing a .foswikiHidden class now instead. git-svn-id: http://svn.foswiki.org/trunk/TopicInteractionPlugin@15786 0b4bb1d4-4e5a-0410-9cc4-b2b747904278 --- pub/System/TopicInteractionPlugin/Makefile | 4 +-- .../jquery.uploader.uncompressed.css | 1 - .../jquery.uploader.uncompressed.js | 27 ++++++++++++------- templates/metadata.tmpl | 2 +- 4 files changed, 21 insertions(+), 13 deletions(-) diff --git a/pub/System/TopicInteractionPlugin/Makefile b/pub/System/TopicInteractionPlugin/Makefile index c9c28c2..478d299 100644 --- a/pub/System/TopicInteractionPlugin/Makefile +++ b/pub/System/TopicInteractionPlugin/Makefile @@ -2,7 +2,6 @@ FOSWIKI_ROOT?=~/foswiki/trunk/core TARGET= \ metadata.js \ metadata.css \ - metadata.pattern.css \ gears.init.js \ browserplus.init.js \ plupload.browserplus.js \ @@ -13,7 +12,8 @@ TARGET= \ plupload.silverlight.js \ plupload.js \ jquery.uploader.js \ - jquery.uploader.css + jquery.uploader.css \ + jquery.natedit.insertattachment.js SUBDIRS=i18n diff --git a/pub/System/TopicInteractionPlugin/jquery.uploader.uncompressed.css b/pub/System/TopicInteractionPlugin/jquery.uploader.uncompressed.css index 1bef5e8..4c9c411 100644 --- a/pub/System/TopicInteractionPlugin/jquery.uploader.uncompressed.css +++ b/pub/System/TopicInteractionPlugin/jquery.uploader.uncompressed.css @@ -113,7 +113,6 @@ color: #777; } -.jqUploaderStop, .jqUploaderMessage { display:none; } diff --git a/pub/System/TopicInteractionPlugin/jquery.uploader.uncompressed.js b/pub/System/TopicInteractionPlugin/jquery.uploader.uncompressed.js index 11271e2..90f6182 100644 --- a/pub/System/TopicInteractionPlugin/jquery.uploader.uncompressed.js +++ b/pub/System/TopicInteractionPlugin/jquery.uploader.uncompressed.js @@ -46,7 +46,8 @@ if (!autoStartBox.is(".foswikiHidden")) { if (typeof(foswiki.Pref) !== 'undefined' && foswiki.Pref.getPref("UPLOADER::AUTOSTART")== "true") { autoStartBox.attr("checked", "checked"); - startButton.hide(); + //startButton.hide(); + startButton.addClass("foswikiHidden"); } else { autoStartBox.removeAttr("checked"); } @@ -59,9 +60,11 @@ foswiki.Pref.setPref("UPLOADER::AUTOSTART", autoStart?"true":"false"); autoStartBox.blur(); if (autoStart) { - startButton.hide(); + //startButton.hide(); + startButton.addClass("foswikiHidden"); } else { - startButton.show(); + //startButton.show(); + startButton.removeClass("foswikiHidden"); } }); @@ -374,9 +377,11 @@ } } - stopButton.hide(); + //stopButton.hide(); + stopButton.addClass("foswikiHidden"); if (!autoStartBox.is(":checked")) { - startButton.show(); + //startButton.show(); + startButton.removeClass("foswikiHidden"); } } else if (uploader.state === plupload.STARTED) { @@ -479,8 +484,10 @@ if (nrFiles) { if (!$(this).is("plupload_disabled")) { $.log("UPLOADER: starting ..."); - startButton.hide(); - stopButton.show(); + //startButton.hide(); + //stopButton.show(); + startButton.addClass("foswikiHidden"); + stopButton.removeClass("foswikiHidden"); uploader.start(); } } else { @@ -493,9 +500,11 @@ $.log("UPLOADER: got Stop event"); stopClicked = true; if (!autoStartBox.is(":checked")) { - startButton.show(); + //startButton.show(); + startButton.removeClass("foswikiHidden"); } - stopButton.hide(); + //stopButton.hide(); + stopButton.addClass("foswikiHidden"); $.each(uploader.files, function(i, file) { if(file.status == plupload.UPLOADING) { $.log("UPLOADER: ... setting file "+file.name+" to FAILED"); diff --git a/templates/metadata.tmpl b/templates/metadata.tmpl index 1af4b53..6f11d64 100644 --- a/templates/metadata.tmpl +++ b/templates/metadata.tmpl @@ -594,7 +594,7 @@ %TMPL:DEF{"uploadform::buttonsstep::startbutton"}%%BUTTON{"%MAKETEXT{"Start upload"}%" icon="tick" class="jqUploaderStart"}%%TMPL:END% %TMPL:DEF{"uploadform::buttonsstep::addbutton"}%%BUTTON{"%MAKETEXT{"Choose files"}%" icon="folder" class="jqUploaderBrowse"}%%TMPL:END% -%TMPL:DEF{"uploadform::buttonsstep::cancelbutton"}%%BUTTON{"%MAKETEXT{"Cancel upload"}%" icon="cross" class="jqUploaderStop"}%%TMPL:END% +%TMPL:DEF{"uploadform::buttonsstep::cancelbutton"}%%BUTTON{"%MAKETEXT{"Cancel upload"}%" icon="cross" class="jqUploaderStop foswikiHidden"}%%TMPL:END% %TMPL:DEF{"uploadform::buttonsstep::autostart"}%