Skip to content

Commit

Permalink
Merge branch 'master' into Item14288
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDaum committed Mar 8, 2017
2 parents 00344d7 + 7a6f2e7 commit 6f3164a
Show file tree
Hide file tree
Showing 12 changed files with 135 additions and 132 deletions.
4 changes: 2 additions & 2 deletions EditTablePlugin/lib/Foswiki/Plugins/EditTablePlugin.pm
Expand Up @@ -83,7 +83,7 @@ We cannot do table parsing in commonTagsHandler because by then the TML has been
=cut

sub beforeCommonTagsHandler {
return unless $_[0] =~ /%EDIT(?:TABLE|CELL){.*}%/;
return unless $_[0] =~ /%EDIT(?:TABLE|CELL)\{.*\}%/;
Foswiki::Func::writeDebug(
"EditTablePlugin::beforeCommonTagsHandler( $web.$topic )")
if $debug;
Expand All @@ -108,7 +108,7 @@ Calls EditTablePlugin::Core::parseTables for INCLUDEd topics.
=cut

sub commonTagsHandler {
return unless $_[0] =~ /%EDIT(?:TABLE|CELL|TABLESTUB){.*}%/;
return unless $_[0] =~ /%EDIT(?:TABLE|CELL|TABLESTUB)\{.*\}%/;

Foswiki::Func::writeDebug(
"EditTablePlugin::commonTagsHandler( $web.$topic )")
Expand Down
20 changes: 10 additions & 10 deletions PatternSkin/data/System/PatternSkinElements.txt
@@ -1,4 +1,4 @@
%META:TOPICINFO{author="ProjectContributor" date="1424432594" format="1.1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" date="1488399691" format="1.1" version="1"}%
%META:TOPICPARENT{name="PatternSkin"}%
---+!! Pattern Skin Elements
Some intro text.
Expand Down Expand Up @@ -46,14 +46,14 @@ paragraphs:

<h3>Definition List</h3>
<DL>
<DT><STRONG>Lower cost</STRONG>
<DT><STRONG>Lower cost</STRONG></DT>
<DD>The new version of this product costs significantly less than the
previous one!
<DT><STRONG>Easier to use</STRONG>
<DD>We've changed the product so that it's much easier to use!
<DT><STRONG>Safe for kids</STRONG>
previous one!</DD>
<DT><STRONG>Easier to use</STRONG></DT>
<DD>We've changed the product so that it's much easier to use!</DD>
<DT><STRONG>Safe for kids</STRONG></DT>
<DD>You can leave your kids alone in a room with this product and
they won't get hurt (not a guarantee).
they won't get hurt (not a guarantee).</DD>
</DL>


Expand Down Expand Up @@ -722,7 +722,7 @@ text="<style>
---++ Search results and search form

<noautolink>
</div><h2 id="Search_results"> Search results </h2>
<h2 id="Search_results"> Search results </h2>
<div><span class='foswikiIcon'><img src='/pub/%SYSTEMWEB%/DocumentGraphics/rss-small.png' width='16' height='16' alt='rss-small' /></span>
<a href='%SCRIPTURL{"view"}%/%SYSTEMWEB%/WebRss?search=caching;type=word;excludetopic=WebSearch,%HOMETOPIC%,WebStatistics;web=System;recurse=;limit=all;scope=all;casesensitive=off'>Get notified on changes on this search</a></div>
<div class="foswikiSearchResultsHeader"><span>Searched: <b>caching</b></span>
Expand Down Expand Up @@ -782,7 +782,7 @@ text="<style>
<h3><a name="Attach_new_file"></a> Attach new file </h3>
Upload up to 10000 KB.
<input type="hidden" name="filename" value="" />
<input class="foswikiInputField" type="file" name="filepath" value="" size="70" />
<input class="foswikiInputField" type="file" name="filepath" size="70" />
</div>
<div class="foswikiFormStep">
<h3><a name="Comment"></a> Comment </h3>
Expand All @@ -793,7 +793,7 @@ text="<style>
</div>
<div class="foswikiFormStep">
<h3><a name="Properties"></a> Properties </h3>
<input type="checkbox" class="foswikiCheckbox" id="createlink" name="createlink"><label for="createlink">Create a link to the attached file</label> <span class="foswikiGrayText">Images will be displayed, for other attachments a link will be created.</span>
<input type="checkbox" class="foswikiCheckbox" id="createlink" name="createlink" /><label for="createlink">Create a link to the attached file</label> <span class="foswikiGrayText">Images will be displayed, for other attachments a link will be created.</span>
<input type="checkbox" class="foswikiCheckbox" id="hidefile" name="hidefile" /><label for="hidefile">Do not show attachment in table</label> <span class="foswikiGrayText">Attachments will not be shown in topic view page.</span>
</div>
<div class="patternTopicActions foswikiFormStep">
Expand Down
7 changes: 3 additions & 4 deletions TopicUserMappingContrib/data/System/BulkRegistration.txt
@@ -1,4 +1,4 @@
%META:TOPICINFO{author="ProjectContributor" comment="" date="1487907314" format="1.1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" comment="" date="1488333719" format="1.1" version="1"}%
%META:TOPICPARENT{name="AdminToolsCategory"}%
%ADDTOZONE{"head" text="<style type='text/css'>
#bulkReg .col1 {float:left; width:30%; margin:0 3% 0 0;}
Expand Down Expand Up @@ -58,7 +58,7 @@ Use the following form to create a new Unprocessed Registration topic.
<div class="col1">
<select name="usertemplate" onchange="picker.submit()">
<option>%URLPARAM{"usertemplate" default="%SYSTEMWEB%.NewUserTemplate"}%</option>
%SEARCH{"%VALUE%%SPLIT%" scope="all" topic="*Template" web="%USERSWEB%" type="literal" nonoise="on" format="<option value=\"%USERSWEB%.$topic\">%USERSWEB%.$topic</option>"}%</select>
%SEARCH{"%VALUE%%SPLIT%" scope="all" topic="*Template" web="%USERSWEB%" type="literal" nonoise="on" format="<option value=\"%USERSWEB%.$topic\">%USERSWEB%.$topic</option>"}%
</select>
</div><!--//col1-->
<div class="col2">
Expand Down Expand Up @@ -119,12 +119,11 @@ Use the following form to create a new Unprocessed Registration topic.
<div class="foswikiClear"></div>
</div> <!-- foswikkFormStep -->
<input type="hidden" name="usertemplate" value="%URLPARAM{"usertemplate" default="NewUserTemplate"}%" />
<input type="hidden" name="action" value="save" />
<input type="hidden" name="topicparent" value="BulkRegistration" />
<input type="hidden" name="templatetopic" value="%SYSTEMWEB%.BulkRegistrationInputTemplate" />
<input type="submit" class="foswikiSubmit" value="Create the topic" />
</div><!-- foswikiFormSteps -->
</form>
</div><!-- foswikiFormSteps -->
</noautolink>


Expand Down
6 changes: 3 additions & 3 deletions WysiwygPlugin/lib/Foswiki/Plugins/WysiwygPlugin/TML2HTML.pm
Expand Up @@ -289,17 +289,17 @@ sub _processTags {
while ( scalar(@queue) ) {
my $token = shift(@queue);
if ( $token =~ /^\n?%$/s ) {
if ( $token eq '%' && $stackTop =~ /}$/ ) {
if ( $token eq '%' && $stackTop =~ /\}$/ ) {
while ( scalar(@stack)
&& $stackTop !~
/^\n?%(?:~~ )?($Foswiki::regex{tagNameRegex}){.*}$/os )
/^\n?%(?:~~ )?($Foswiki::regex{tagNameRegex})\{.*\}$/os )
{
$stackTop = pop(@stack) . $stackTop;
}
}
if ( $token eq '%'
&& $stackTop =~
m/^(\n?)%(~~ )?($Foswiki::regex{tagNameRegex})({.*})?$/os )
m/^(\n?)%(~~ )?($Foswiki::regex{tagNameRegex})(\{.*\})?$/os )
{
my $nl = $1;
my $glue = $2 || '';
Expand Down
4 changes: 2 additions & 2 deletions core/data/System/CompleteDocumentation.txt
@@ -1,4 +1,4 @@
%META:TOPICINFO{author="ProjectContributor" comment="reprev" date="1456497941" format="1.1" reprev="1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" date="1488593563" format="1.1" version="1"}%
---+!! Reference Manual (%WIKIVERSION%)

This page contains all documentation topics as one long, complete reference sheet.
Expand All @@ -8,7 +8,7 @@ This page contains all documentation topics as one long, complete reference shee
%BUTTON{
"%MAKETEXT{"Load content"}%"
icon="book"
onclick="window.location.href='%SCRIPTURL{"view"}%/%WEB%/%TOPIC%?section=content';"
onclick="window.location.href='%SCRIPTURLPATH{"view"}%/%WEB%/%TOPIC%?section=content';"
}% %MAKETEXT{"Use this button to load the content.%BR% *Caution* the content is very large and loading it will put a high load on your browser. Only load the content if you are going to print it - otherwise use the [[ReferenceManual][online reference manual]]."}%

<verbatim class="foswikiHidden">
Expand Down
112 changes: 10 additions & 102 deletions core/data/System/SiteChanges.txt
@@ -1,4 +1,4 @@
%META:TOPICINFO{author="ProjectContributor" date="1434484983" format="1.1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" date="1488593563" format="1.1" version="1"}%
%META:TOPICPARENT{name="UserToolsCategory"}%
---+ %TOPIC%
Recent changes
Expand All @@ -10,7 +10,7 @@ performance.</div>'}%
%BUTTON{
"%MAKETEXT{"Load content"}%"
icon="book"
onclick="window.location.href='%SCRIPTURL{"view"}%/%WEB%/%TOPIC%?section=content';"
onclick="window.location.href='%SCRIPTURLPATH{"view"}%/%WEB%/%TOPIC%?section=content';"
}% %MAKETEXT{"Use this button to load the content.%BR% *Caution* the search on this topic can be very resource intensive. Only load the content if you really need it, otherwise review the WebChanges topic from each web."}%

<verbatim class="foswikiHidden">
Expand Down Expand Up @@ -101,112 +101,20 @@ performance.</div>'}%
</div>
</div>
</noautolink>
</form>%ADDTOZONE{
</form>
%ADDTOZONE{ "script"
id="SiteChangesScript"
requires="JavascriptFiles/foswikiPrefs"
text="<script type='text/javascript' src='%PUBURLPATH{"sitechanges.js" topic="%BASEWEB%.%BASETOPIC%"}%'></script>"
}%
%ADDTOZONE{
"head"
id="sitechanges"
text="<literal><style type='text/css' media='all'>
#siteChangesForm .foswikiTable {
margin-top: 20px;
}
</style></literal>"
}%%ADDTOZONE{
"script"
id="sitechanges"
text="<literal><script type='text/javascript'>
(function($) {

var DEBUG;

function updateLastTimeCheckedOption (inDate) {
var el = document.getElementById('last_time_checked');
if (el) {
el.value = inDate;
el.text = 'last time I checked';
}
}

function setOptionSelected (inId) {
if (DEBUG && console) {
console.log('setOptionSelected:inId=' + inId);
}
var el = document.getElementById(inId);
if (el) {
el.selected = 'selected';
}
}

function processFormValue (inValue) {
if (DEBUG && console) {
console.log('submitted:' + inValue);
}
return true;
}

// stores the name
function storeSelectedOption (inName, inValue, inStorageField) {
if (DEBUG && console) {
console.log('storeSelectedOption:inName=' + inName + ';inValue=' + inValue + ';inStorageField=' + inStorageField);
}
// store readable value so we can use it when reloading the page
inStorageField.value=inName;
return true;
}

function init() {
var DEFAULT_OPTION_ID = '24_hours_ago';

var dateLastCheck = foswiki.Pref.getPref('WebChangesForAllWebs_dateLastCheck');
if (dateLastCheck) {
var selectedOption = $('input[name=\"sinceReadable\"]').val();
if (DEBUG && console) {
console.log('sinceReadable selectedOption:' + selectedOption);
}
if (selectedOption) {
setOptionSelected(selectedOption);
} else {
setOptionSelected(DEFAULT_OPTION_ID);
}
}
var d = new Date();
var now = d.getFullYear() + '-' +
(d.getMonth() + 1) + '-' +
d.getDate() + ' ' +
d.getHours() + ':' +
d.getMinutes() + ':' +
d.getSeconds();
now = now.replace(/([-: ])(\d)([-: ]|$)/g, '$1\60$2$3');
if (DEBUG && console) {
console.log('now:' + now);
}
if (now) {
foswiki.Pref.setPref(foswiki.getPreference('WEB') +
'_' + foswiki.getPreference('TOPIC') +
'_dateLastCheck', now);
updateLastTimeCheckedOption(now);
}
}

function submitForm() {
document.forms.seeChangesSince.web.value = document.forms.seeChangesSince.web.value.replace(/\s*,\s*/, ', ');
processFormValue(document.forms.seeChangesSince.since.value);
document.forms.seeChangesSince.submit();
}

$(function() {
DEBUG = $(\"input[name='debugJs']\").val();
$('#siteChangesSelect').change(function() {
var $selected = $('option:selected', this);
storeSelectedOption($selected.attr('id'), $selected.attr('value'), document.forms.seeChangesSince.sinceReadable);
submitForm();
});
$(document.forms.seeChangesSince).submit(function() {
submitForm();
});
init();
});
}(jQuery));
</script></literal>"
requires="JavascriptFiles/foswikiPrefs"
}%<!-- END DATE SELECTION -->
}%
%ENDSECTION{"content"}%
</verbatim>
3 changes: 3 additions & 0 deletions core/lib/Foswiki/Contrib/core/MANIFEST
Expand Up @@ -781,6 +781,9 @@ pub/System/ProjectLogos/foswiki-logo.png 0644
pub/System/ProjectLogos/foswiki-logo-large.png 0644
pub/System/ProjectLogos/foswiki-logo-icon.png 0644
pub/System/ProjectLogos/foswiki-poweredby.gif 0644
pub/System/SiteChanges/sitechanges.js 0644
pub/System/SiteChanges/sitechanges.js.gz 0644
pub/System/SiteChanges/sitechanges.uncompressed.js 0644
pub/System/Skins/js.js 0644
pub/System/SkinTemplates/base.css 0644
pub/System/SkinTemplates/base.css.gz 0644
Expand Down
2 changes: 1 addition & 1 deletion core/lib/Foswiki/Net.pm
Expand Up @@ -526,7 +526,7 @@ sub _fixMimePart {
# Skip if it's a multipart.
return if $part->subparts;

if ( $part->content_type =~ /^text\//i ) {
if ( $part->content_type && $part->content_type =~ /^text\//i ) {

# XXX It looks like Email::MIME has a bug with processing body
# texts when they heave utf8 flag on. The bug is preventing it from
Expand Down
8 changes: 4 additions & 4 deletions core/lib/Foswiki/Render.pm
Expand Up @@ -669,11 +669,11 @@ sub TML2PlainText {
$text =~ s/%META:/%<nop>META:/g;
}
else {
$text =~ s/%META:[A-Z].*?}%//g;
$text =~ s/%META:[A-Z].*?\}%//g;
}

if ( $opts =~ m/expandvar/ ) {
$text =~ s/(\%)(SEARCH){/$1<nop>$2/g; # prevent recursion
$text =~ s/(\%)(SEARCH)\{/$1<nop>$2/g; # prevent recursion
$topicObject = Foswiki::Meta->new( $this->{session} )
unless $topicObject;
$text = $topicObject->expandMacros($text);
Expand All @@ -685,10 +685,10 @@ sub TML2PlainText {
|| '';
$text =~ s/%WIKITOOLNAME%/$wtn/g;
if ( $opts =~ m/showvar/ ) {
$text =~ s/%(\w+({.*?}))%/$1/g; # defuse
$text =~ s/%(\w+(\{.*?\}))%/$1/g; # defuse
}
else {
$text =~ s/%$Foswiki::regex{tagNameRegex}({.*?})?%//g; # remove
$text =~ s/%$Foswiki::regex{tagNameRegex}(\{.*?\})?%//g; # remove
}
}

Expand Down
6 changes: 3 additions & 3 deletions core/lib/Foswiki/Serialise/Embedded.pm
Expand Up @@ -67,7 +67,7 @@ sub read {

# head meta-data
# NO THIS CANNOT BE /g - TOPICINFO is _only_ valid as the first line!
$text =~ s<^(%META:(TOPICINFO){(.*)}%\n)>
$text =~ s<^(%META:(TOPICINFO)\{(.*)\}%\n)>
<_readMETA($meta, $1, $2, $3, 1)>e;

# WARNING: if the TOPICINFO *looks* valid but has has unrecognisable
Expand Down Expand Up @@ -100,7 +100,7 @@ sub read {
if ( $format !~ /^[\d.]+$/ || $format < 1.1 ) {
require Foswiki::Compatibility;
if (
$text =~ s/^%META:([^{]+){(.*)}%\n/
$text =~ s/^%META:([^{]+)\{(.*)\}%\n/
Foswiki::Compatibility::readSymmetricallyEncodedMETA(
$meta, $1, $2 ); ''/gem
)
Expand All @@ -110,7 +110,7 @@ sub read {
}
else {
if (
$text =~ s<^(%META:([^{]+){(.*)}%\n)>
$text =~ s<^(%META:([^{]+)\{(.*)\}%\n)>
<_readMETA($meta, $1, $2, $3, 0)>gem
)
{
Expand Down

0 comments on commit 6f3164a

Please sign in to comment.