Skip to content

Commit

Permalink
Item12180: Refactor autofix JS; switch to a button.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/trunk@16291 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
TimotheLitt authored and TimotheLitt committed Dec 28, 2012
1 parent 1f4c3de commit 56ddd2e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
6 changes: 4 additions & 2 deletions core/lib/Foswiki/Configure/Checkers/ScriptUrlPaths.pm
Original file line number Diff line number Diff line change
Expand Up @@ -208,13 +208,15 @@ sub testPath {
}
else {
$e .= $this->ERROR(
"Server received \"<tt>$server[0]</tt>\", but the expected path is \"<tt>$viewtarget</tt>\"<br >Changing {ScriptUrlPaths}{view} to <tt>$server[0]</tt> will probably correct this error. <a href='#' onclick=\"\$('[name=&quot;\\{ScriptUrlPaths\\}\\{view\\}&quot;]').get(0).value='$server[0]';valueChanged(\$('[name=&quot;\\{ScriptUrlPaths\\}\\{view\\}&quot;]').get(0));return false;\">(Click to use this value)</a>"
"Server received \"<tt>$server[0]</tt>\", but the expected path is \"<tt>$viewtarget</tt>\"<br >
Changing {ScriptUrlPaths}{view} to <tt>$server[0]</tt> will probably correct this error. <a href='#' class='foswikiButtonMini' onclick='return feedback.setValue(&quot;{ScriptUrlPaths}{view}&quot;, &quot;$server[0]&quot;);'>(Click to use this value)</a>"
);
}
}
else {
$e .= $this->ERROR(
"Server received \"<tt>$server[0]</tt>\", but the expected path is \"<tt>$target</tt>\"<br >The correct setting for $keys is probably <tt>$server[0]</tt> <a href='#' onclick=\"\$('[name=&quot;\Q$keys\E&quot;]').get(0).value='$server[0]';valueChanged(\$('[name=&quot;\Q$keys\E&quot;]').get(0));return false;\">(Click to use this value)</a>"
"Server received \"<tt>$server[0]</tt>\", but the expected path is \"<tt>$target</tt>\"<br >
The correct setting for $keys is probably <tt>$server[0]</tt>. <a href='#' class='foswikiButtonMini' onclick='return feedback.setValue(&quot;$keys&quot;, &quot;$server[0]&quot;);'>(Click to use this value)</a>"
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion core/lib/Foswiki/Configure/Dispatch.pm
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use version 0.77;

# minimum version of client JavaScript that configure requires.
#
my $minScriptVersion = version->parse("v3.118");
my $minScriptVersion = version->parse("v3.119");

use Foswiki::Configure (qw/:DEFAULT :auth :cgi :config :session :trace/);

Expand Down
11 changes: 10 additions & 1 deletion core/lib/Foswiki/Configure/resources/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var configure = (function ($) {

"use strict";

var VERSION = "v3.118";
var VERSION = "v3.119";
/* Do not merge, move or change format of VERSION, parsed by perl.
*/

Expand Down Expand Up @@ -1347,6 +1347,15 @@ var feedback = ( function ($) {
});
return vset;
},
setValue: function (keys,value) {
var ele = $('[name="' + configure.utils.quoteName(keys) + '"]').get(0);

if( ele !== undefined ) {
ele.value = value;
valueChanged(ele);
}
return false;
},
updateExpanders: function () {
$('.configureFeedbackExpander').each(function () {
feedback.setExpander(this.id.replace(/expander$/,''), this);
Expand Down

0 comments on commit 56ddd2e

Please sign in to comment.