Author: olli
Date: Mon Feb 23 18:14:17 2015
New Revision: 1661736
URL: http://svn.apache.org/r1661736
Log:
SLING-4456 change Fling sample pages to HTML5 with data-th-* attributes
Modified:
sling/trunk/samples/fling/src/main/resources/apps/fling/page/fragments/head.html
sling/trunk/samples/fling/src/main/resources/apps/fling/page/fragments/navigation.html
sling/trunk/samples/fling/src/main/resources/apps/fling/page/fragments/panel.html
sling/trunk/samples/fling/src/main/resources/apps/fling/page/simple/html.html
sling/trunk/samples/fling/src/main/resources/apps/fling/page/user/html.html
sling/trunk/samples/fling/src/main/resources/content/fling.json
Modified:
sling/trunk/samples/fling/src/main/resources/apps/fling/page/fragments/head.html
URL:
http://svn.apache.org/viewvc/sling/trunk/samples/fling/src/main/resources/apps/fling/page/fragments/head.html?rev=1661736&r1=1661735&r2=1661736&view=diff
==============================================================================
---
sling/trunk/samples/fling/src/main/resources/apps/fling/page/fragments/head.html
(original)
+++
sling/trunk/samples/fling/src/main/resources/apps/fling/page/fragments/head.html
Mon Feb 23 18:14:17 2015
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
@@ -17,12 +17,11 @@
specific language governing permissions and limitations
under the License.
-->
-<!DOCTYPE html>
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
xml:lang="en">
-<head th:fragment="default">
+<html>
+<head data-th-fragment="default">
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
- <title th:text="${page.title}">Page Title</title>
+ <title data-th-text="${page.title}">Page Title</title>
<link rel="stylesheet"
href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"/>
<link rel="stylesheet" href="/fling/assets/css/fling.css"/>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"
type="text/javascript"></script>
Modified:
sling/trunk/samples/fling/src/main/resources/apps/fling/page/fragments/navigation.html
URL:
http://svn.apache.org/viewvc/sling/trunk/samples/fling/src/main/resources/apps/fling/page/fragments/navigation.html?rev=1661736&r1=1661735&r2=1661736&view=diff
==============================================================================
---
sling/trunk/samples/fling/src/main/resources/apps/fling/page/fragments/navigation.html
(original)
+++
sling/trunk/samples/fling/src/main/resources/apps/fling/page/fragments/navigation.html
Mon Feb 23 18:14:17 2015
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
@@ -17,33 +17,32 @@
specific language governing permissions and limitations
under the License.
-->
-<!DOCTYPE html>
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
xml:lang="en">
+<html>
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
</head>
<body>
- <ul th:fragment="breadcrumb" class="breadcrumb" style="direction: rtl">
+ <ul data-th-fragment="breadcrumb" class="breadcrumb" style="direction: rtl">
<li class="active dropdown">
- <span th:text="${page.title}">current page</span>
+ <span data-th-text="${page.title}">current page</span>
</li>
- <li th:each="parent : ${page.parents}" class="dropdown">
- <a th:if="${parent.children.iterator().hasNext()}" href="#"
class="dropdown-toggle" role="button" data-toggle="dropdown"><span
class="caret"></span></a>
- <a th:href="${#strings.substringAfter(parent.path, '/content')} +
'.html'" th:text="${parent.title}">parent page</a>
+ <li data-th-each="parent : ${page.parents}" class="dropdown">
+ <a data-th-if="${parent.children.iterator().hasNext()}" href="#"
class="dropdown-toggle" role="button" data-toggle="dropdown"><span
class="caret"></span></a>
+ <a data-th-href="${#strings.substringAfter(parent.path, '/content')} +
'.html'" data-th-text="${parent.title}">parent page</a>
<ul class="dropdown-menu" role="menu">
- <li th:each="child : ${parent.children}" role="presentation"><a
role="menuitem" tabindex="-1" th:href="${#strings.substringAfter(child.path,
'/content')} + '.html'" th:text="${child.title}">child page</a></li>
+ <li data-th-each="child : ${parent.children}" role="presentation"><a
role="menuitem" tabindex="-1"
data-th-href="${#strings.substringAfter(child.path, '/content')} + '.html'"
data-th-text="${child.title}">child page</a></li>
</ul>
</li>
</ul>
- <ul th:fragment="children" class="nav nav-pills" role="tablist">
- <li th:each="child : ${page.children}"><a th:href="${page.name + '/' +
child.name} + '.html'" th:text="${child.title}">child page</a></li>
+ <ul data-th-fragment="children" class="nav nav-pills" role="tablist">
+ <li data-th-each="child : ${page.children}"><a data-th-href="${page.name +
'/' + child.name} + '.html'" data-th-text="${child.title}">child page</a></li>
</ul>
- <ul th:fragment="siblings" class="nav nav-pills" role="tablist">
- <li th:each="sibling : ${page.siblings}"><a th:href="${sibling.name} +
'.html'" th:text="${sibling.title}">sibling</a></li>
+ <ul data-th-fragment="siblings" class="nav nav-pills" role="tablist">
+ <li data-th-each="sibling : ${page.siblings}"><a
data-th-href="${sibling.name} + '.html'"
data-th-text="${sibling.title}">sibling</a></li>
</ul>
</body>
Modified:
sling/trunk/samples/fling/src/main/resources/apps/fling/page/fragments/panel.html
URL:
http://svn.apache.org/viewvc/sling/trunk/samples/fling/src/main/resources/apps/fling/page/fragments/panel.html?rev=1661736&r1=1661735&r2=1661736&view=diff
==============================================================================
---
sling/trunk/samples/fling/src/main/resources/apps/fling/page/fragments/panel.html
(original)
+++
sling/trunk/samples/fling/src/main/resources/apps/fling/page/fragments/panel.html
Mon Feb 23 18:14:17 2015
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
@@ -17,16 +17,15 @@
specific language governing permissions and limitations
under the License.
-->
-<!DOCTYPE html>
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
xml:lang="en">
+<html>
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
</head>
<body>
- <div th:fragment="footer" class="panel-footer">
- <span th:text="${request.remoteUser}">remote user</span> (<a
th:unless="${'anonymous'.equals(request.remoteUser)}"
href="/system/sling/logout?resource=/fling.html"
th:text="#{action.logout}">logout</a><a
th:if="${'anonymous'.equals(request.remoteUser)}"
th:href="${'/system/sling/login?resource=' + #strings.substringAfter(page.path,
'/content')} + '.html'">login</a>) | <span th:text="${request.authType} ?:
#{no_auth}">auth type</span>
+ <div data-th-fragment="footer" class="panel-footer">
+ <span data-th-text="${request.remoteUser}">remote user</span> (<a
data-th-unless="${'anonymous'.equals(request.remoteUser)}"
href="/system/sling/logout?resource=/fling.html"
data-th-text="#{action.logout}">logout</a><a
data-th-if="${'anonymous'.equals(request.remoteUser)}"
data-th-href="${'/system/sling/login?resource=' +
#strings.substringAfter(page.path, '/content')} + '.html'">login</a>) | <span
data-th-text="${request.authType} ?: #{no_auth}">auth type</span>
</div>
</body>
Modified:
sling/trunk/samples/fling/src/main/resources/apps/fling/page/simple/html.html
URL:
http://svn.apache.org/viewvc/sling/trunk/samples/fling/src/main/resources/apps/fling/page/simple/html.html?rev=1661736&r1=1661735&r2=1661736&view=diff
==============================================================================
---
sling/trunk/samples/fling/src/main/resources/apps/fling/page/simple/html.html
(original)
+++
sling/trunk/samples/fling/src/main/resources/apps/fling/page/simple/html.html
Mon Feb 23 18:14:17 2015
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
@@ -17,9 +17,8 @@
specific language governing permissions and limitations
under the License.
-->
-<!DOCTYPE html>
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
xml:lang="en"
th:with="page=${resource.adaptTo(@org.apache.sling.samples.fling.Page@class)}">
-<head th:replace="/apps/fling/page/fragments/head.html::default">
+<html
data-th-with="page=${resource.adaptTo(@org.apache.sling.samples.fling.Page@class)}">
+<head data-th-replace="/apps/fling/page/fragments/head.html::default">
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>SIMPLE PAGE</title>
@@ -32,7 +31,7 @@
<div class="container">
<nav class="nav-main">
<div class="pull-left">
- <ul class="breadcrumb" style="direction: rtl"
th:replace="/apps/fling/page/fragments/navigation.html::breadcrumb">
+ <ul class="breadcrumb" style="direction: rtl"
data-th-replace="/apps/fling/page/fragments/navigation.html::breadcrumb">
<li class="active dropdown">
<span>2rd BAR</span>
</li>
@@ -48,19 +47,19 @@
</li>
</ul>
</div>
- <ul class="nav nav-pills" role="tablist"
th:replace="/apps/fling/page/fragments/navigation.html::children">
+ <ul class="nav nav-pills" role="tablist"
data-th-replace="/apps/fling/page/fragments/navigation.html::children">
<li><a href="../user/html.html">3rd BAZ</a></li>
</ul>
</nav>
<div class="panel panel-primary">
<div class="panel-heading">
- <span th:text="${page.title}">SIMPLE PAGE</span>
+ <span data-th-text="${page.title}">SIMPLE PAGE</span>
</div>
<div class="panel-body">
- <div th:utext="${page.content}"><p>Lorem ipsum dolor sit amet,
consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore
et dolore magna aliquyam erat, sed diam voluptua.</p><pre>At vero eos et
accusam et justo duo dolores et ea rebum.</pre></div>
- <img src="../../../../assets/images/feather.png" width="355"
height="111" th:attr="src='/fling/assets/images/feather.png'"/>
+ <div data-th-utext="${page.content}"><p>Lorem ipsum dolor sit amet,
consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore
et dolore magna aliquyam erat, sed diam voluptua.</p><pre>At vero eos et
accusam et justo duo dolores et ea rebum.</pre></div>
+ <img src="../../../../assets/images/feather.png" width="355"
height="111" data-th-attr="src='/fling/assets/images/feather.png'"/>
</div>
- <div class="panel-footer"
th:replace="/apps/fling/page/fragments/panel.html::footer">
+ <div class="panel-footer"
data-th-replace="/apps/fling/page/fragments/panel.html::footer">
<span>user | auth type</span>
</div>
</div>
Modified:
sling/trunk/samples/fling/src/main/resources/apps/fling/page/user/html.html
URL:
http://svn.apache.org/viewvc/sling/trunk/samples/fling/src/main/resources/apps/fling/page/user/html.html?rev=1661736&r1=1661735&r2=1661736&view=diff
==============================================================================
--- sling/trunk/samples/fling/src/main/resources/apps/fling/page/user/html.html
(original)
+++ sling/trunk/samples/fling/src/main/resources/apps/fling/page/user/html.html
Mon Feb 23 18:14:17 2015
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
@@ -17,9 +17,8 @@
specific language governing permissions and limitations
under the License.
-->
-<!DOCTYPE html>
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
xml:lang="en"
th:with="page=${resource.adaptTo(@org.apache.sling.samples.fling.UserPage@class)}">
-<head th:replace="/apps/fling/page/fragments/head.html::default">
+<html
data-th-with="page=${resource.adaptTo(@org.apache.sling.samples.fling.UserPage@class)}">
+<head data-th-replace="/apps/fling/page/fragments/head.html::default">
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>USER PAGE</title>
@@ -32,7 +31,7 @@
<div class="container">
<nav class="nav-main">
<div class="pull-left">
- <ul class="breadcrumb" style="direction: rtl"
th:replace="/apps/fling/page/fragments/navigation.html::breadcrumb">
+ <ul class="breadcrumb" style="direction: rtl"
data-th-replace="/apps/fling/page/fragments/navigation.html::breadcrumb">
<li class="active dropdown">
<span>2rd BAR</span>
</li>
@@ -48,40 +47,40 @@
</li>
</ul>
</div>
- <ul class="nav nav-pills" role="tablist"
th:replace="/apps/fling/page/fragments/navigation.html::children">
+ <ul class="nav nav-pills" role="tablist"
data-th-replace="/apps/fling/page/fragments/navigation.html::children">
<li><a href="../user/html.html">3rd BAZ</a></li>
</ul>
</nav>
<div class="panel panel-primary">
<div class="panel-heading">
- <span th:text="${page.title}">USER PAGE</span>
+ <span data-th-text="${page.title}">USER PAGE</span>
</div>
- <div class="panel-body" th:with="user=${page.user}">
+ <div class="panel-body" data-th-with="user=${page.user}">
<form role="form">
<div class="form-group">
<label>User ID of current JCR session</label>
- <input type="text" class="form-control" readonly="readonly"
value="dummy" th:attr="value=${user.getID()}"/>
+ <input type="text" class="form-control" readonly="readonly"
value="dummy" data-th-attr="value=${user.getID()}"/>
</div>
<div class="form-group">
<label>principal name</label>
- <input type="text" class="form-control" readonly="readonly"
value="dummy" th:attr="value=${user.getPrincipal().getName()}"/>
+ <input type="text" class="form-control" readonly="readonly"
value="dummy" data-th-attr="value=${user.getPrincipal().getName()}"/>
</div>
- <div class="form-group" th:each="property : ${page.userProperties}">
- <label th:text="${property.key}">key</label>
- <input type="text" class="form-control" readonly="readonly"
value="value" th:attr="value=${property.value}"/>
+ <div class="form-group" data-th-each="property :
${page.userProperties}">
+ <label data-th-text="${property.key}">key</label>
+ <input type="text" class="form-control" readonly="readonly"
value="value" data-th-attr="value=${property.value}"/>
</div>
- <div class="form-group" th:remove="all">
+ <div class="form-group" data-th-remove="all">
<label>firstName</label>
<input type="text" class="form-control" readonly="readonly"
value="Foo"/>
</div>
- <div class="form-group" th:remove="all">
+ <div class="form-group" data-th-remove="all">
<label>lastName</label>
<input type="text" class="form-control" readonly="readonly"
value="Bar"/>
</div>
</form>
- <img src="../../../../assets/images/feather.png" width="355"
height="111" th:attr="src='/fling/assets/images/feather.png'"/>
+ <img src="../../../../assets/images/feather.png" width="355"
height="111" data-th-attr="src='/fling/assets/images/feather.png'"/>
</div>
- <div class="panel-footer"
th:replace="/apps/fling/page/fragments/panel.html::footer">
+ <div class="panel-footer"
data-th-replace="/apps/fling/page/fragments/panel.html::footer">
<span>user | auth type</span>
</div>
</div>
Modified: sling/trunk/samples/fling/src/main/resources/content/fling.json
URL:
http://svn.apache.org/viewvc/sling/trunk/samples/fling/src/main/resources/content/fling.json?rev=1661736&r1=1661735&r2=1661736&view=diff
==============================================================================
--- sling/trunk/samples/fling/src/main/resources/content/fling.json (original)
+++ sling/trunk/samples/fling/src/main/resources/content/fling.json Mon Feb 23
18:14:17 2015
@@ -19,7 +19,7 @@
"jcr:primaryType": "nt:unstructured",
"sling:resourceType": "fling:page:simple",
"title": "Sling Scripting Thymeleaf",
- "content": "<p><em>Sling Scripting Thymeleaf</em> with <em>Sling
Models</em> and <code>adaptTo()</code> to render resources:</p><pre><html
xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\"\n
th:with=\"page=${resource.adaptTo(@org.apache.sling.samples.fling.Page@class)}\">\n<head>\n
<meta charset=\"UTF-8\"/>\n <meta name=\"viewport\"
content=\"width=device-width, initial-scale=1.0\"/>\n <title
th:text=\"${page.title}\">Page Title</title>\n[...]</pre><p><em>Sling
Scripting Thymeleaf</em> with <em>Sling i18n</em> for localized
messages:</p><pre><a href=\"/system/sling/logout\"
th:text=\"#{action.logout}\">logout</a></pre><pre>{\n \"en\": {\n
\"jcr:mixinTypes\": [\n \"mix:language\"\n ],\n
\"jcr:language\": \"en\",\n \"sling:basename\":
\"org.apache.sling.samples.fling\",\n \"action.logout\": {\n
\"jcr:primaryType\": \"sling:MessageEntry\",\n \"slin
g:key\": \"action.logout\",\n \"sling:message\": \"logout\"\n
},\n [...]\n }\n}\n</pre>"
+ "content": "<p><em>Sling Scripting Thymeleaf</em> with <em>Sling
Models</em> and <code>adaptTo()</code> to render resources:</p><pre><html
data-th-with=\"page=${resource.adaptTo(@org.apache.sling.samples.fling.Page@class)}\">\n<head>\n
<meta charset=\"UTF-8\"/>\n <meta name=\"viewport\"
content=\"width=device-width, initial-scale=1.0\"/>\n <title
data-th-text=\"${page.title}\">Page
Title</title>\n[...]</pre><p><em>Sling Scripting Thymeleaf</em> with
<em>Sling i18n</em> for localized messages:</p><pre><a
href=\"/system/sling/logout\"
data-th-text=\"#{action.logout}\">logout</a></pre><pre>{\n \"en\":
{\n \"jcr:mixinTypes\": [\n \"mix:language\"\n ],\n
\"jcr:language\": \"en\",\n \"sling:basename\":
\"org.apache.sling.samples.fling\",\n \"action.logout\": {\n
\"jcr:primaryType\": \"sling:MessageEntry\",\n \"sling:key\":
\"action.logout\",\n \"slin
g:message\": \"logout\"\n },\n [...]\n }\n}\n</pre>"
},
"auth": {
"jcr:primaryType": "nt:unstructured",