Skip to content

Commit

Permalink
Item12481: fixing open search profile
Browse files Browse the repository at this point in the history
also:
- remove spurious "d" in printout
- fixing cross-language navigation using MultiLingualPlugin
- added css colors for disabled form elements
- improved <meta xxx > info in page for better seo
- added <link rel="alternative" hreflang="..." > pointing to different translations of a topic
- remove "revinfo" from printable view; this is added below the H1 by the plugin now
  • Loading branch information
MichaelDaum committed Dec 16, 2014
1 parent a080a09 commit 62f542c
Show file tree
Hide file tree
Showing 13 changed files with 115 additions and 66 deletions.
4 changes: 2 additions & 2 deletions lib/Foswiki/Contrib/NatSkin.pm
Expand Up @@ -3,8 +3,8 @@ package Foswiki::Contrib::NatSkin;
use strict;
use warnings;

our $VERSION = '3.99_022';
our $RELEASE = '3.99_022';
our $VERSION = '3.99_023';
our $RELEASE = '3.99_023';
our $SHORTDESCRIPTION = 'Modern web design for Foswiki';

1;
16 changes: 2 additions & 14 deletions pub/System/CustomatoTheme/customato-base.uncompressed.css
Expand Up @@ -404,20 +404,8 @@ a.jqButton:link {

.natLangs {
position:absolute;
top:0.2em;
right:0.5em;
}
.natLangs img {
margin-right:0.5em;
vertical-align:middle;
}
.natLangs a {
color:#444;
text-decoration:none;
}

.natSolrBody .natLangs {
display:none;
top:1em;
right:0;
}

/* menu */
Expand Down
8 changes: 8 additions & 0 deletions pub/System/CustomatoTheme/customato-colors.uncompressed.css
Expand Up @@ -193,6 +193,14 @@ select,
box-shadow:none;
box-shadow:inset 2px 2px 4px #f4f4f4;
}

select[disabled],
input[disabled],
textarea[disabled] {
color:#aaa;
background-color: #f8f8f8;
}

input[type=search],
input[type=text],
input[type=password],
Expand Down
24 changes: 10 additions & 14 deletions pub/System/CustomatoTheme/customato.uncompressed.css
Expand Up @@ -405,20 +405,8 @@ a.jqButton:link {

.natLangs {
position:absolute;
top:0.2em;
right:0.5em;
}
.natLangs img {
margin-right:0.5em;
vertical-align:middle;
}
.natLangs a {
color:#444;
text-decoration:none;
}

.natSolrBody .natLangs {
display:none;
top:1em;
right:0;
}

/* menu */
Expand Down Expand Up @@ -960,6 +948,14 @@ select,
box-shadow:none;
box-shadow:inset 2px 2px 4px #f4f4f4;
}

select[disabled],
input[disabled],
textarea[disabled] {
color:#aaa;
background-color: #f8f8f8;
}

input[type=search],
input[type=text],
input[type=password],
Expand Down
28 changes: 21 additions & 7 deletions pub/System/NatSkin/BaseStyle.uncompressed.css
Expand Up @@ -741,6 +741,7 @@ button[disabled],
input[disabled],
textarea[disabled] {
color:#cfcfcf;
background-color: #fafafa;
}

fieldset {
Expand Down Expand Up @@ -2015,6 +2016,26 @@ a:active.natScrollTop {
background-repeat:no-repeat;
}

/* language switcher */
.natLangs {
position:absolute;
top:0.2em;
right:0.5em;
}
.natLangs img {
margin-right:0.5em;
vertical-align:middle;
}
.natLangs a {
color:#444;
text-decoration:none;
}

.natSolrBody .natLangs {
display:none;
}


/* search box */
.natSearchBox form {
position:relative;
Expand Down Expand Up @@ -2526,13 +2547,6 @@ a:active.natScrollTop {
}

/* some print styles affecting cover=print.nat as well */
.natPrintBody .foswikiRevisionSep:first-of-type {
display:none;
}
.natPrintBody .foswikiRevision {
display:none;
}

.natPrintBody {
margin:0px !important;
padding:0px !important;
Expand Down
2 changes: 2 additions & 0 deletions pub/System/NatSkin/angular.uncompressed.js
Expand Up @@ -17,6 +17,8 @@ foswikiApp.directive("natBody", [ '$rootScope',
}
angular.element('ul.sf-js-enabled').hideSuperfishUl();
isEmptySideBar = _testSideBar();

angular.element(".natSearchBox .foswikiInputField").val("");
});

// update the body class according to natskin settings
Expand Down
7 changes: 3 additions & 4 deletions templates/foswiki.nat.tmpl
Expand Up @@ -229,9 +229,9 @@
%TMPL:DEF{"titlesep"}%%IF{"defined 'HTMLTITLESEP'" then="%HTMLTITLESEP%" else="&#183;"}%%TMPL:END%

%TMPL:DEF{"favicon"}%%TMPL:P{context="msie" then="favicon::msie" else="favicon::default"}%%TMPL:END%
%TMPL:DEF{"favicon::msie"}%<link rel='shortcut icon' href='%TMPL:P{"favicon::msie::url"}%' />%TMPL:END%
%TMPL:DEF{"favicon::msie"}%<link rel="shortcut icon" href="%TMPL:P{"favicon::msie::url"}%" />%TMPL:END%
%TMPL:DEF{"favicon::msie::url"}%%TMPL:P{"favicon::url"}%%TMPL:END%
%TMPL:DEF{"favicon::default"}%<link rel='icon' href='%TMPL:P{"favicon::default::url"}%' />%TMPL:END%
%TMPL:DEF{"favicon::default"}%<link rel="icon" href="%TMPL:P{"favicon::default::url"}%" />%TMPL:END%
%TMPL:DEF{"favicon::default::url"}%%TMPL:P{"favicon::url"}%%TMPL:END%
%TMPL:DEF{"favicon::url"}%%FAVICON%%TMPL:END%

Expand Down Expand Up @@ -294,8 +294,7 @@
"%count% > 1" then="%plural%"
}%%TMPL:END%


d%TMPL:DEF{"LIBJS"}%%ADDTOZONE{
%TMPL:DEF{"LIBJS"}%%ADDTOZONE{
"script"
id="%id%"
text="<script src='%PUBURLPATH%/%SYSTEMWEB%/%id%.js'></script>"
Expand Down
2 changes: 1 addition & 1 deletion templates/languageselector.nat.tmpl
Expand Up @@ -45,7 +45,7 @@ jQuery(function($) {

%{ ################################################################################ }%
%TMPL:DEF{"languages::multilingual"}%%LANGUAGES{
format="<option $marker value='$code'>$language$percntIF{\"'$language'!='$name'\" then=\" - $name\"}$percnt</option>"
format="<option $marker value='$code'>$label_name</option>"
selection="%LANGUAGE%"
marker="selected='selected'"
separator="$n"
Expand Down
9 changes: 6 additions & 3 deletions templates/opensearch.nat.tmpl
@@ -1,6 +1,9 @@
%TMPL:DEF{"metaopensearch"}%%TMPL:P{"opensearch::content::link"}%
%TMPL:DEF{"metaopensearch"}%%TMPL:P{"opensearch::profile"}%
%TMPL:P{"opensearch::content::link"}%
%TMPL:P{"opensearch::person::link"}%%TMPL:END%

%TMPL:DEF{"opensearch::profile"}%<link rel="profile" href="http://a9.com/-/spec/opensearch/1.1/" />%TMPL:END%

%TMPL:DEF{"opensearch::header"}%<?xml version="1.0" encoding="UTF-8"?><OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">%TMPL:END%
%TMPL:DEF{"opensearch::footer"}%</OpenSearchDescription>%TMPL:END%
%TMPL:DEF{"opensearch::encoding"}%<InputEncoding>%CHARSET%</InputEncoding><OutputEncoding>%CHARSET%</OutputEncoding>%TMPL:END%
Expand All @@ -10,7 +13,7 @@
%{ Image height="64" width="64" type="image/png">http://example.com/websearch.png</Image --> }%

%{ content search }%
%TMPL:DEF{"opensearch::content::link"}%<link rel='search' type='application/opensearchdescription+xml' href='%SCRIPTURLPATH{"rest"}%/RenderPlugin/template?topic=%SYSTEMWEB%.WebSearch&name=opensearch&expand=opensearch::content&contenttype=text/xml' title='%MAKETEXT{"[_1] Content Search" args="%WIKITOOLNAME%"}%' />%TMPL:END%
%TMPL:DEF{"opensearch::content::link"}%<link rel="search" type="application/opensearchdescription+xml" href="%SCRIPTURLPATH{"rest"}%/RenderPlugin/template?topic=%SYSTEMWEB%.WebSearch&name=opensearch&expand=opensearch::content&contenttype=text/xml" title="%MAKETEXT{"[_1] Content Search" args="%WIKITOOLNAME%"}%" />%TMPL:END%

%TMPL:DEF{"opensearch::content"}%%TMPL:P{"opensearch::content::header"}%
%TMPL:P{"opensearch::content::name"}%
Expand All @@ -35,7 +38,7 @@


%{ person search }%
%TMPL:DEF{"opensearch::person::link"}%<link rel='search' type='application/opensearchdescription+xml' href='%SCRIPTURLPATH{"rest"}%/RenderPlugin/template?topic=%USERSWEB%.WikiUsers&name=opensearch&expand=opensearch::person&contenttype=text/xml' title='%MAKETEXT{"[_1] Person Search" args="%WIKITOOLNAME%"}%' />%TMPL:END%
%TMPL:DEF{"opensearch::person::link"}%<link rel="search" type="application/opensearchdescription+xml" href="%SCRIPTURLPATH{"rest"}%/RenderPlugin/template?topic=%USERSWEB%.WikiUsers&name=opensearch&expand=opensearch::person&contenttype=text/xml" title="%MAKETEXT{"[_1] Person Search" args="%WIKITOOLNAME%"}%" />%TMPL:END%

%TMPL:DEF{"opensearch::person"}%%TMPL:P{"opensearch::person::header"}%
%TMPL:P{"opensearch::person::name"}%
Expand Down
2 changes: 1 addition & 1 deletion templates/page.nat.tmpl
Expand Up @@ -6,7 +6,7 @@
</html>
%TMPL:END%

%TMPL:DEF{"head"}%<head profile="http://a9.com/-/spec/opensearch/1.1/">
%TMPL:DEF{"head"}%<head>
<meta charset="%CHARSET%" />
%TMPL:P{"pagetitle"}%
%TMPL:P{"favicon"}%<!-- -->
Expand Down
2 changes: 1 addition & 1 deletion templates/translatetopic.nat.tmpl
Expand Up @@ -67,7 +67,7 @@
<select class='foswikiSelect' name='Set+CONTENT_LANGUAGE'>
<option></option>
%LANGUAGES{
format="<option value='$code' class='$code'>$label$percntIF{\"'$label'!='$name'\" then=\" - $name\"}$percnt</option>"
format="<option value='$code' class='$code'>$label_name</option>"
selection="selected='selected'"
separator="$n "
sort="label"
Expand Down
76 changes: 58 additions & 18 deletions templates/view.nat.tmpl
Expand Up @@ -17,39 +17,79 @@
%TMPL:P{"metadescription"}%<!-- -->
%TMPL:P{"metakeywords"}%<!-- -->
%TMPL:P{"metaauthor"}%<!-- -->
%TMPL:P{"metacanonical"}%<!-- -->
%TMPL:P{"metarelations"}%<!-- -->
%TMPL:P{"metaedit"}%<!-- -->
%TMPL:P{"metaatom"}%<!-- -->
%TMPL:P{"metarss"}%<!-- -->
%TMPL:P{"metaopensearch"}%%TMPL:END%

%TMPL:DEF{"metagenerator"}%<meta name='generator' content='Foswiki %WIKIVERSION%' />%TMPL:END%

%TMPL:DEF{"metaauthor"}%%IF{
"defined 'METAAUTHOR'"
then="<meta name='author' content='$percntENCODE{\"$percntMETAAUTHOR$percnt\" type=\"html\"}$percnt' />"
else="<meta name='author' content='%SPACEOUT{"%USERINFO{"%TMPL:P{context="DBCachePluginEnabled" then="metaauthor::dbcache" else="metaauthor::default"}%" format="$wikiname"}%"}%' />"
}%%TMPL:END%
%TMPL:DEF{"metagenerator"}%<meta name="generator" content="Foswiki %WIKIVERSION%" />%TMPL:END%

%TMPL:DEF{"metaauthor"}%<meta name="author" content="%ENCODE{
"%IF{"defined 'METAAUTHOR'"
then="$percntMETAAUTHOR$percnt"
else="%SPACEOUT{
"%USERINFO{
"%TMPL:P{context="DBCachePluginEnabled" then="metaauthor::dbcache" else="metaauthor::default"}%"
format="$wikiname"
}%"
}%"
}%"
type="html"
}%" />%TMPL:END%

%TMPL:DEF{"metaauthor::default"}%%QUERY{"'%WEB%.%TOPIC%'/versions[1].info.author"}%%TMPL:END%
%TMPL:DEF{"metaauthor::dbcache"}%%DBQUERY{topic="%WEB%.%TOPIC%" format="$expand(createauthor)"}%%TMPL:END%

%TMPL:DEF{"metadescription"}%%IF{"defined 'METADESCRIPTION'"
then="<meta name='description' content='$percntENCODE{\"$percntMETADESCRIPTION$percnt\" type=\"html\"}$percnt' />"
else="$percntFORMFIELD{\"Summary\" format=\"<meta name='description' content='$dollarpercntENCODE{\\"$value\\" type=\\"html\\"}$dollarpercnt' />\"}$percnt"
%TMPL:DEF{"metadescription"}%<meta name="description" content="%ENCODE{
"%IF{"defined 'METADESCRIPTION'"
then="$percntMETADESCRIPTION$percnt"
else="$percntFORMFIELD{\"Summary\" default=\"$percntTOPICTITLE$percnt\" alttext=\"$percntTOPICTITLE$percnt\"}$percnt"
}%"
type="html"
}%" />%TMPL:END%

%TMPL:DEF{"metakeywords"}%<meta name="keywords" content="%ENCODE{
"%IF{"defined 'METAKEYWORDS'"
then="$percntMETAKEYWORDS$percnt"
else="$percntFORMFIELD{\"Tag\" default=\"Foswiki, %WEB%, %TOPIC%\" alttext=\"Foswiki, %WEB%, %TOPIC%\"}$percnt"
}%"
type="html"
}%" />%TMPL:END%

%TMPL:DEF{"metaedit"}%%IF{
"'%WEB%.%TOPIC%' allows 'change'"
then="<link rel=\"alternate\" type=\"application/x-wiki\" title=\"Edit this page!\" href=\"%SCRIPTURLPATH{"edit"}%/%WEB%/%TOPIC%?t=%GMTIME{"$epoch"}%\" />"
}%%TMPL:END%

%TMPL:DEF{"metakeywords"}%%IF{"defined 'METAKEYWORDS'"
then="<meta name='keywords' content='$percntENCODE{\"$percntMETAKEYWORDS$percnt\" type=\"html\"}$percnt' />"
else="$percntFORMFIELD{\"Tag\" format=\"<meta name='keywords' content='$dollarpercntENCODE{\\"$value\\" type=\\"html\\"}$dollarpercnt' />\"}$percnt"
%TMPL:DEF{"metarss"}%<link rel="alternate" type="application/rss+xml" title="RSS Feed" href="%SCRIPTURLPATH{"view"}%/%WEB%/WebRss?contenttype=text/xml" />%TMPL:END%
%TMPL:DEF{"metaatom"}%<link rel="alternate" type="application/atom+xml" title="Atom Feed" href="%SCRIPTURLPATH{"view"}%/%WEB%/WebAtom?contenttype=text/xml" />%TMPL:END%

%TMPL:DEF{"metarelations"}%%IF{"context i18n_enabled and $MULTILINGUAL = 'on'"
then="$percntTMPL:P{\"metarelations::langs\"}$percnt"
}%%TMPL:END%

%TMPL:DEF{"metaedit"}%%IF{
"'%WEB%.%TOPIC%' allows 'change'"
then="<link rel='alternate' type='application/x-wiki' title='Edit this page!' href='%SCRIPTURLPATH{"edit"}%/%WEB%/%TOPIC%?t=%GMTIME{"$epoch"}%' />"
%TMPL:DEF{"metacanonical"}%<link rel="canonical" href="%SCRIPTURL{"view"}%/%WEB%/%TOPIC%" />%TMPL:END%

%TMPL:DEF{"metarelations::langs"}%%DBQUERY{
"(preferences.BASETRANSLATION = '%BASETRANSLATION{default="%TOPIC%"}%' OR topic = '%BASETRANSLATION{default="%TOPIC%"}%')"
format="<link rel=\"alternate\" hreflang=\"$expand(preferences.CONTENT_LANGUAGE or '%DEFAULTLANGUAGE{default="en"}%')\" href=\"%SCRIPTURL{"view"}%/$web/$topic\" />"
separator="$n"
}%%TMPL:END%

%TMPL:DEF{"metarss"}%<link rel='alternate' type='application/rss+xml' title='RSS Feed' href='%SCRIPTURLPATH{"view"}%/%WEB%/WebRss?contenttype=text/xml' />%TMPL:END%
%TMPL:DEF{"metaatom"}%<link rel='alternate' type='application/atom+xml' title='Atom Feed' href='%SCRIPTURLPATH{"view"}%/%WEB%/WebAtom?contenttype=text/xml' />%TMPL:END%
%{ ########################################################################## }%
%TMPL:DEF{"langswitcher"}%%IF{"context i18n_enabled and $MULTILINGUAL = 'on'" then="$percntTMPL:P{\"langswitcher::impl\"}$percnt"}%%TMPL:END%

%{ ########################################################################## }%
%TMPL:DEF{"langswitcher::impl"}%<div class="natLangs foswikiContents" name="langswitcher::contents">%TMPL:P{"langswitcher::contents"}%</div>%TMPL:END%
%TMPL:DEF{"langswitcher::contents"}%<literal>%DBQUERY{
"(preferences.BASETRANSLATION = '%BASETRANSLATION{default="%TOPIC%"}%' OR topic = '%BASETRANSLATION{default="%TOPIC%"}%') AND topic != '%TOPIC%'"
format="$percntLANGUAGES{\"$expand(preferences.CONTENT_LANGUAGE or '%DEFAULTLANGUAGE{default="en"}%')\"
format=\"<a href='%SCRIPTURLPATH{"view"}%/$web/$topic' class='jqUITooltip' data-theme='info' data-delay='0' title='$percntMAKETEXT{\"Select translation in [_1]\" args=\"$dollarlabel_name\"}$percnt'>$icon(24)</a>\"
}$percnt"
separator="$n"
}%</literal>%TMPL:END%

%{ ################################################################################ }%
%TMPL:DEF{"content"}%<!-- -->
Expand Down
1 change: 0 additions & 1 deletion templates/view.print.nat.tmpl
Expand Up @@ -2,7 +2,6 @@
%TMPL:DEF{"bodyclass"}%natPrintBody%TMPL:END%
%TMPL:DEF{"defaultbody"}%<div class="natBodyContents">
<div class="natMainContents" id="natMainContents">
%TMPL:P{"revinfo"}%
%TMPL:P{"content"}%
</div>
</div>%TMPL:END%
Expand Down

0 comments on commit 62f542c

Please sign in to comment.