Author: rgardler
Date: Fri Dec 2 13:53:14 2011
New Revision: 1209481
URL: http://svn.apache.org/viewvc?rev=1209481&view=rev
Log:
turn the walkthrough widget into a template and prove some of the styling so it
works better on a small screen
Added:
incubator/wookie/trunk/widgets/templates/testWidgets/walkthroughTestWidget/
incubator/wookie/trunk/widgets/templates/testWidgets/walkthroughTestWidget/widget.properties
(with props)
incubator/wookie/trunk/widgets/templates/walkthrough/
- copied from r1197684,
incubator/wookie/trunk/scratchpad/widgets/walkthrough/
incubator/wookie/trunk/widgets/templates/walkthrough/scripts/walkthrough_controller.js
- copied, changed from r1197684,
incubator/wookie/trunk/scratchpad/widgets/walkthrough/scripts/questions.js
incubator/wookie/trunk/widgets/templates/walkthrough/style/screen.css.add
- copied, changed from r1197684,
incubator/wookie/trunk/scratchpad/widgets/walkthrough/style/style.css
incubator/wookie/trunk/widgets/templates/walkthrough/template_build.xml
(with props)
Removed:
incubator/wookie/trunk/scratchpad/widgets/walkthrough/
incubator/wookie/trunk/widgets/templates/walkthrough/build.xml
incubator/wookie/trunk/widgets/templates/walkthrough/config.xml
incubator/wookie/trunk/widgets/templates/walkthrough/legal/
incubator/wookie/trunk/widgets/templates/walkthrough/scripts/questions.js
incubator/wookie/trunk/widgets/templates/walkthrough/style/style.css
Modified:
incubator/wookie/trunk/widgets/templates/walkthrough/LICENCE.txt
incubator/wookie/trunk/widgets/templates/walkthrough/index.html
Added:
incubator/wookie/trunk/widgets/templates/testWidgets/walkthroughTestWidget/widget.properties
URL:
http://svn.apache.org/viewvc/incubator/wookie/trunk/widgets/templates/testWidgets/walkthroughTestWidget/widget.properties?rev=1209481&view=auto
==============================================================================
---
incubator/wookie/trunk/widgets/templates/testWidgets/walkthroughTestWidget/widget.properties
(added)
+++
incubator/wookie/trunk/widgets/templates/testWidgets/walkthroughTestWidget/widget.properties
Fri Dec 2 13:53:14 2011
@@ -0,0 +1,6 @@
+template.name=walkthrough
+widget.shortname=WalkthroughTestWidget
+widget.name=Walkthrough Test
+widget.description=A simple widget that demonstrates the walkthrough test
widget with simple question and answer set.
+widget.help=<p>Work through the questions clicking on links to create a
customised task and reading list for your work.</p>
+
Propchange:
incubator/wookie/trunk/widgets/templates/testWidgets/walkthroughTestWidget/widget.properties
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/wookie/trunk/widgets/templates/walkthrough/LICENCE.txt
URL:
http://svn.apache.org/viewvc/incubator/wookie/trunk/widgets/templates/walkthrough/LICENCE.txt?rev=1209481&r1=1197684&r2=1209481&view=diff
==============================================================================
--- incubator/wookie/trunk/widgets/templates/walkthrough/LICENCE.txt (original)
+++ incubator/wookie/trunk/widgets/templates/walkthrough/LICENCE.txt Fri Dec 2
13:53:14 2011
@@ -85,3 +85,70 @@ APPENDIX: How to apply the Apache Licens
See the License for the specific language governing permissions and
limitations under the License.
+===============================================================================
+
+This distribution includes a number of subcomponents
+with separate copyright notices and license terms. Your use of the
+code for the these subcomponents is subject to the terms and
+conditions of the following licenses.
+
+===============================================================================
+
+===============================================================================
+The following components are MIT Licensed
+===============================================================================
+
+Creole 1.0 wiki markup parser
+http://www.ivan.fomichev.name/2008/04/javascript-creole-10-wiki-markup-parser.html
+
+
+The MIT License (MIT)
+Copyright (c) 2009 Ivan Fomichev
+
+Portions Copyright (c) 2007 Chris Purcell
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and
+associated documentation files (the "Software"), to deal in the Software
without restriction,
+including without limitation the rights to use, copy, modify, merge, publish,
distribute,
+sublicense, and/or sell copies of the Software, and to permit persons to whom
the Software is furnished
+to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT
+LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
AND NONINFRINGEMENT. IN
+NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+jquery.js
+jquery-ui-1.6.4.min.js
+ Containing Project URL: http://jquery.org
+jquery.mobile.1.0rc1.*
+ Containing Project URL: http://jquerymobile.org/
+
+Copyright (c) 2011 John Resig, http://jquery.com/
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+
Modified: incubator/wookie/trunk/widgets/templates/walkthrough/index.html
URL:
http://svn.apache.org/viewvc/incubator/wookie/trunk/widgets/templates/walkthrough/index.html?rev=1209481&r1=1197684&r2=1209481&view=diff
==============================================================================
--- incubator/wookie/trunk/widgets/templates/walkthrough/index.html (original)
+++ incubator/wookie/trunk/widgets/templates/walkthrough/index.html Fri Dec 2
13:53:14 2011
@@ -16,56 +16,44 @@
limitations under the License.
-->
<html>
- <head>
+ <head>
<meta http-equiv="pragma" content="no-cache"/>
<meta http-equiv="Cache-control" content="no-cache">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
+
<link rel="stylesheet"
href="lib/jqueryMobile/jquery.mobile-1.0rc1.min.css" />
+ <link rel="stylesheet" href="style/all.css" />
+
<script type="text/javascript"
src="lib/jqueryMobile/jquery-1.6.4.min.js"></script>
<script type="text/javascript"
src="lib/jqueryMobile/jquery.mobile-1.0rc1.min.js"></script>
- <link rel="stylesheet" type="text/css" href="style/style.css" />
- <script type="text/javascript" src="scripts/questions.js"
charset="utf-8"></script>
- </head>
- <body>
- <div data-role="page" id='page'>
- <div data-role="header" id='header' role="banner">
- <a href = '#' data-role="button" data-rel="back"
data-icon="back" data-theme="c" >Back</a>
- <h1 id='title'><!-- Question set title inserted
here --></h1>
- </div> <!-- /header -->
-
- <div data-role="content" class="ui-content ui-grid-a"
id='content'>
- <div id='question' class="ui-block-a" role="article">
- <h1 id="question_title">
- <!-- Question title inserted here -->
- </h1>
- <div id="question_body">
- <!-- Question body inserted here -->
- </div>
- <div id="answer_text">
- <!-- Answer text inserted here -->
- </div>
- <ul data-role='zzzlistview' id='answer_links'
data-theme='b'>
- <!-- Answer links inserted here -->
- </ul>
- </div>
-
- <div id='actions' class="ui-block-b"
role="complementary">
- <h1>Actions</h1>
- <ol data-role='zzzlistview' id='todo_list' data-theme='b'>
- <!-- Actions inserted here -->
- </ol>
- </div>
- </div><!-- /content -->
+ <script type="text/javascript" src="scripts/controller.js"></script>
- <div data-role="footer" id='footer' role="contentinfo">
- <a href='actions.php' data-role="button"
data-theme="c" id="save">Save actions</a>
- </div> <!-- /footer -->
-
- </div><!-- /page -->
-
- <form id="actions_form" action="server/actions.php" method="post"
target="q_actions">
- <input type='hidden' name='the_actions' id='the_actions' value=''
/>
- </form>
- </body>
+ <title>${widget.name}</title>
+ </head>
+ <body>
+ <div data-role="page" id='home' class="type-home">
+ <div data-role="header" id='header' role="banner">
+ ${content.header}
+ </div> <!-- /header -->
+
+ <div data-role="content" id='content'>
+ <div class="content-primary" id="content-primary">
+ ${content.primary}
+ </div>
+ <div class="content-secondary" id="content-secondary">
+ ${content.secondary}
+ </div>
+ </div><!-- /content -->
+
+ <div data-role="footer" id='footer' role="contentinfo">
+ ${content.footer}
+ </div> <!-- /footer -->
+
+ </div><!-- /page -->
+
+ <form id="actions_form" action="server/actions.php" method="post"
target="q_actions">
+ <input type='hidden' name='the_actions' id='the_actions' value='' />
+ </form>
+ </body>
</html>
Copied:
incubator/wookie/trunk/widgets/templates/walkthrough/scripts/walkthrough_controller.js
(from r1197684,
incubator/wookie/trunk/scratchpad/widgets/walkthrough/scripts/questions.js)
URL:
http://svn.apache.org/viewvc/incubator/wookie/trunk/widgets/templates/walkthrough/scripts/walkthrough_controller.js?p2=incubator/wookie/trunk/widgets/templates/walkthrough/scripts/walkthrough_controller.js&p1=incubator/wookie/trunk/scratchpad/widgets/walkthrough/scripts/questions.js&r1=1197684&r2=1209481&rev=1209481&view=diff
==============================================================================
--- incubator/wookie/trunk/scratchpad/widgets/walkthrough/scripts/questions.js
(original)
+++
incubator/wookie/trunk/widgets/templates/walkthrough/scripts/walkthrough_controller.js
Fri Dec 2 13:53:14 2011
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-var Controller =
+var ${widget.shortname}_walkthrough_controller =
{
initPage: function()
{
@@ -40,7 +40,7 @@ var Controller =
this.setupSave();
},
- showQuestion: function(url, options)
+ showQuestion: function(url, options)
{
if (url == '')
{
@@ -61,7 +61,7 @@ var Controller =
this.showQuestionText(question);
this.showAnswerText(question);
- var page = $("#page");
+ var page = $("#home");
page.page();
//var content = page.children( ":jqmData(role=content)" );
@@ -207,10 +207,10 @@ var Controller =
}
};
-$("#page").live('pagebeforecreate',function(event)
+$("#home").live('pagebeforecreate',function(event)
{
// called for URL without hash or F5 on any page
- Controller.initPage();
+ ${widget.shortname}_walkthrough_controller.initPage();
});
@@ -223,7 +223,7 @@ $(document).bind( "pagebeforechange", fu
return;
var hash = $.mobile.path.parseUrl( data.toPage ).hash;
- Controller.showQuestion( hash, data.options );
+ ${widget.shortname}_walkthrough_controller.showQuestion( hash,
data.options );
e.preventDefault();
}
});
Copied:
incubator/wookie/trunk/widgets/templates/walkthrough/style/screen.css.add (from
r1197684, incubator/wookie/trunk/scratchpad/widgets/walkthrough/style/style.css)
URL:
http://svn.apache.org/viewvc/incubator/wookie/trunk/widgets/templates/walkthrough/style/screen.css.add?p2=incubator/wookie/trunk/widgets/templates/walkthrough/style/screen.css.add&p1=incubator/wookie/trunk/scratchpad/widgets/walkthrough/style/style.css&r1=1197684&r2=1209481&rev=1209481&view=diff
==============================================================================
--- incubator/wookie/trunk/scratchpad/widgets/walkthrough/style/style.css
(original)
+++ incubator/wookie/trunk/widgets/templates/walkthrough/style/screen.css.add
Fri Dec 2 13:53:14 2011
@@ -14,17 +14,62 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
+ @media ${widget.media.screen.veryNarrow}, ${widget.media.screen.narrow} {
+ .content-secondary {
+ text-align: left;
+ margin-right: 1%;
+ padding-right: 1%;
+ }
+ .content-primary {
+ margin-right: 1%;
+ padding-right: 1%;
+ }
+ }
+
+ @media ${widget.media.screen.moderateWidth} {
+ .content-secondary {
+ text-align: left;
+ float: right;
+ width: 42%;
+ margin-right: 1%;
+ padding-right: 2%;
+ }
+ .content-primary {
+ width: 55%;
+ float: left;
+ }
+ }
+
+ @media ${widget.media.screen.wide} {
+ .content-secondary {
+ text-align: left;
+ float: right;
+ width: 32%;
+ margin-right: 1%;
+ padding-right: 2%;
+ }
+ .content-primary {
+ width: 65%;
+ float: left;
+ }
+ }
- .ui-grid-a .ui-block-a {
- width:70%;
-}
-.ui-grid-a .ui-block-b {
- width:28%;
- float:right;
+@media ${widget.media.screen.veryWide} {
+ .content-secondary {
+ text-align: left;
+ float: right;
+ width: 22%;
+ margin-right: 1%;
+ padding-right: 2%;
+ }
+ .content-primary {
+ width: 75%;
+ float: left;
+ }
}
-
-#page {
+#home {
/* background: #f1f2ea url(images/background.gif) repeat-y right;*/
background: #f1f2ea;
text-shadow: none;
@@ -79,4 +124,6 @@ a.action_delete {
#actions_form {
display: hidden;
-}
\ No newline at end of file
+}
+
+
Added: incubator/wookie/trunk/widgets/templates/walkthrough/template_build.xml
URL:
http://svn.apache.org/viewvc/incubator/wookie/trunk/widgets/templates/walkthrough/template_build.xml?rev=1209481&view=auto
==============================================================================
--- incubator/wookie/trunk/widgets/templates/walkthrough/template_build.xml
(added)
+++ incubator/wookie/trunk/widgets/templates/walkthrough/template_build.xml Fri
Dec 2 13:53:14 2011
@@ -0,0 +1,138 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<project basedir="." name="walkthrough_template">
+ <target name="_init_template"
+ description="Define any template specifc properties">
+ <echo message="+------------------------------------------"/>
+ <echo message="| Initialising template properties"/>
+ <echo message="+------------------------------------------"/>
+
+ <loadfile property="content.header"
+ srcFile="content_header.html"
+ failonerror="false">
+ <filterchain>
+ <expandproperties/>
+ </filterchain>
+ </loadfile>
+
+ <loadfile property="content.header"
+ srcFile="${template.dir}/${template.name}/content_header.html"
+ failonerror="false">
+ <filterchain>
+ <expandproperties/>
+ </filterchain>
+ </loadfile>
+
+ <loadfile property="content.header"
+ srcFile="../common/content_header.html"
+ failonerror="false">
+ <filterchain>
+ <expandproperties/>
+ </filterchain>
+ </loadfile>
+
+ <loadfile property="content.primary"
+ srcFile="content_primary.html"
+ failonerror="false">
+ <filterchain>
+ <expandproperties/>
+ </filterchain>
+ </loadfile>
+
+ <loadfile property="content.primary"
+ srcFile="../common/content_primary.html"
+ failonerror="false">
+ <filterchain>
+ <expandproperties/>
+ </filterchain>
+ </loadfile>
+
+ <loadfile property="content.primary"
+ srcFile="${template.dir}/${template.name}/content_primary.html"
+ failonerror="false">
+ <filterchain>
+ <expandproperties/>
+ </filterchain>
+ </loadfile>
+
+ <loadfile property="content.secondary"
+ srcFile="content_secondary.html"
+ failonerror="false">
+ <filterchain>
+ <expandproperties/>
+ </filterchain>
+ </loadfile>
+
+
+ <loadfile property="content.secondary"
+ srcFile="../common/content_secondary.html"
+ failonerror="false">
+ <filterchain>
+ <expandproperties/>
+ </filterchain>
+ </loadfile>
+
+ <loadfile property="content.secondary"
+ srcFile="${template.dir}/${template.name}/content_secondary.html"
+ failonerror="false">
+ <filterchain>
+ <expandproperties/>
+ </filterchain>
+ </loadfile>
+
+ <loadfile property="content.footer"
+ srcFile="content_footer.html"
+ failonerror="false">
+ <filterchain>
+ <expandproperties/>
+ </filterchain>
+ </loadfile>
+
+ <loadfile property="content.footer"
+ srcFile="${template.dir}/${template.name}/content_footer.html"
+ failonerror="false">
+ <filterchain>
+ <expandproperties/>
+ </filterchain>
+ </loadfile>
+
+ <loadfile property="content.footer"
+ srcFile="../common/content_footer.html"
+ failonerror="false">
+ <filterchain>
+ <expandproperties/>
+ </filterchain>
+ </loadfile>
+
+ <echoproperties
destfile="${widget.build.dir}/${widget.shortname}.properties" prefix=""/>
+ </target>
+
+
+ <target name="_generate_from_parent_templates">
+ <echo message="+------------------------------------------"/>
+ <echo message="| Generating from parent templates for ${template.name}"/>
+ <echo message="+------------------------------------------"/>
+
+ <!-- Build from base template -->
+ <ant antfile="../../build.xml"
+ target="_generate_widget">
+ <property name="template.name" value="base"/>
+ <property name="copyWidgetFiles" value="false"/>
+ </ant>
+ </target>
+</project>
\ No newline at end of file
Propchange:
incubator/wookie/trunk/widgets/templates/walkthrough/template_build.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml