Author: rgardler
Date: Sat Feb 11 16:52:05 2012
New Revision: 1243092
URL: http://svn.apache.org/viewvc?rev=1243092&view=rev
Log:
create a twoColumn template which handles layout details previously in browse
template. Browse template now only provides search code not layout code.
Added:
incubator/wookie/trunk/widgets/templates/twoColumn/
incubator/wookie/trunk/widgets/templates/twoColumn/content_primary.html
(with props)
incubator/wookie/trunk/widgets/templates/twoColumn/content_secondary.html
(with props)
incubator/wookie/trunk/widgets/templates/twoColumn/index.html (with props)
incubator/wookie/trunk/widgets/templates/twoColumn/readme.txt (with props)
incubator/wookie/trunk/widgets/templates/twoColumn/scripts/
incubator/wookie/trunk/widgets/templates/twoColumn/scripts/twoColumn_controller.js
(with props)
incubator/wookie/trunk/widgets/templates/twoColumn/style/
incubator/wookie/trunk/widgets/templates/twoColumn/style/screen.css.add
(with props)
incubator/wookie/trunk/widgets/templates/twoColumn/template_build.xml
(with props)
Removed:
incubator/wookie/trunk/widgets/templates/browse/index.html
incubator/wookie/trunk/widgets/templates/browse/style/media.css
Modified:
incubator/wookie/trunk/widgets/templates/browse/scripts/browse_controller.js
incubator/wookie/trunk/widgets/templates/browse/template_build.xml
Modified:
incubator/wookie/trunk/widgets/templates/browse/scripts/browse_controller.js
URL:
http://svn.apache.org/viewvc/incubator/wookie/trunk/widgets/templates/browse/scripts/browse_controller.js?rev=1243092&r1=1243091&r2=1243092&view=diff
==============================================================================
---
incubator/wookie/trunk/widgets/templates/browse/scripts/browse_controller.js
(original)
+++
incubator/wookie/trunk/widgets/templates/browse/scripts/browse_controller.js
Sat Feb 11 16:52:05 2012
@@ -28,7 +28,6 @@ var ${widget.shortname}_browse_controlle
var query = "";
var searchUrl = '${browse.search.url}';
if(searchUrl === "") $("#searchPanel").hide();
- ${widget.shortname}_browse_controller.update();
//
// If there is a "requiresLogin" attribute, don't
// trigger search just yet
@@ -62,21 +61,7 @@ var ${widget.shortname}_browse_controlle
var order = ($("input[@name='sortOrder']:checked").val());
${widget.shortname}_browse_controller.search(query, sort, order);
},
-
- /**
- * Update the display
- */
- update:function() {
- // expand the search box on screens that are either wide enough
(alongside results) or tall enough
- if ($.mobile.media("${widget.media.screen.tall}")) {
- $('#searchPanel').trigger('expand');
- } else if ($.mobile.media("${widget.media.screen.moderateWidth}") ||
$.mobile.media("${widget.media.screen.veryWide}")) {
- $('#searchPanel').trigger('expand');
- } else {
- $('#searchPanel').trigger('collapse');
- }
- },
-
+
/**
* Get the current title for this widget.
*/
@@ -93,7 +78,6 @@ var ${widget.shortname}_browse_controlle
$('#content-primary').html(html).trigger("create");
$('body').trigger("results_updated");
$('.result:first').trigger('expand');
- ${widget.shortname}_browse_controller.update();
},
/**
Modified: incubator/wookie/trunk/widgets/templates/browse/template_build.xml
URL:
http://svn.apache.org/viewvc/incubator/wookie/trunk/widgets/templates/browse/template_build.xml?rev=1243092&r1=1243091&r2=1243092&view=diff
==============================================================================
--- incubator/wookie/trunk/widgets/templates/browse/template_build.xml
(original)
+++ incubator/wookie/trunk/widgets/templates/browse/template_build.xml Sat Feb
11 16:52:05 2012
@@ -196,7 +196,7 @@
<!-- Build from base template -->
<ant antfile="../../build.xml"
target="_generate_widget">
- <property name="template.name" value="base"/>
+ <property name="template.name" value="twoColumn"/>
<property name="copyWidgetFiles" value="false"/>
</ant>
</target>
Added: incubator/wookie/trunk/widgets/templates/twoColumn/content_primary.html
URL:
http://svn.apache.org/viewvc/incubator/wookie/trunk/widgets/templates/twoColumn/content_primary.html?rev=1243092&view=auto
==============================================================================
--- incubator/wookie/trunk/widgets/templates/twoColumn/content_primary.html
(added)
+++ incubator/wookie/trunk/widgets/templates/twoColumn/content_primary.html Sat
Feb 11 16:52:05 2012
@@ -0,0 +1,17 @@
+<!--
+ 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.
+-->
+<p>This the primary content<p>
Propchange:
incubator/wookie/trunk/widgets/templates/twoColumn/content_primary.html
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/wookie/trunk/widgets/templates/twoColumn/content_primary.html
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/wookie/trunk/widgets/templates/twoColumn/content_secondary.html
URL:
http://svn.apache.org/viewvc/incubator/wookie/trunk/widgets/templates/twoColumn/content_secondary.html?rev=1243092&view=auto
==============================================================================
--- incubator/wookie/trunk/widgets/templates/twoColumn/content_secondary.html
(added)
+++ incubator/wookie/trunk/widgets/templates/twoColumn/content_secondary.html
Sat Feb 11 16:52:05 2012
@@ -0,0 +1,17 @@
+<!--
+ 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.
+-->
+<div>This is the secondary content</div>
Propchange:
incubator/wookie/trunk/widgets/templates/twoColumn/content_secondary.html
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/wookie/trunk/widgets/templates/twoColumn/content_secondary.html
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/wookie/trunk/widgets/templates/twoColumn/index.html
URL:
http://svn.apache.org/viewvc/incubator/wookie/trunk/widgets/templates/twoColumn/index.html?rev=1243092&view=auto
==============================================================================
--- incubator/wookie/trunk/widgets/templates/twoColumn/index.html (added)
+++ incubator/wookie/trunk/widgets/templates/twoColumn/index.html Sat Feb 11
16:52:05 2012
@@ -0,0 +1,67 @@
+<!--
+ 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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="pragma" 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="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" />
+<link rel="stylesheet" href="style/all.css" />
+
+${content.scripts}
+
+<title>${widget.name}</title>
+</head>
+
+<body>
+ <div data-role="page" class="type-home" id="home" data-theme="d">
+ <div class="header" data-role="header" data-position="fixed">
+ ${content.header}
+ </div>
+
+ <div data-role="content">
+ <div class="content-secondary" id="content-secondary">
+ ${content.secondary}
+ </div>
+
+ <div class="content-primary" id="content-primary">
+ ${content.primary}
+ </div>
+ </div>
+
+ <div data-role="footer" class="footer" id="footer" data-position="fixed">
+ ${content.footer}
+ </div>
+ </div>
+
+
+ <div data-role="dialog" id="help">
+ <div data-role="header">
+ <h4>Help: ${widget.name}</h4>
+ </div>
+ <!-- /header -->
+
+ <div data-role="content" class="ui-content" id="content-help">
+ ${widget.help}</div>
+ <!-- /content -->
+ </div>
+ <!-- /page -->
+
+</body>
+</html>
Propchange: incubator/wookie/trunk/widgets/templates/twoColumn/index.html
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/wookie/trunk/widgets/templates/twoColumn/index.html
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/wookie/trunk/widgets/templates/twoColumn/readme.txt
URL:
http://svn.apache.org/viewvc/incubator/wookie/trunk/widgets/templates/twoColumn/readme.txt?rev=1243092&view=auto
==============================================================================
--- incubator/wookie/trunk/widgets/templates/twoColumn/readme.txt (added)
+++ incubator/wookie/trunk/widgets/templates/twoColumn/readme.txt Sat Feb 11
16:52:05 2012
@@ -0,0 +1,10 @@
+This is a simple template that provides a two column layout.
+
+content_primary.html will be the main body, by default this will be
+rendered on the right of the page.
+
+content_secondary.html will commonly be used for navigation or sidebar
+content. By default it is rendered either to the left of the screeen
+or, where the screen is too narrow the secondary content will appear
+above the primary. Any collapsible items in this area will be expanded
+or collpsed as appropriate for the screen dimensions.
Propchange: incubator/wookie/trunk/widgets/templates/twoColumn/readme.txt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/wookie/trunk/widgets/templates/twoColumn/readme.txt
------------------------------------------------------------------------------
svn:executable = *
Added:
incubator/wookie/trunk/widgets/templates/twoColumn/scripts/twoColumn_controller.js
URL:
http://svn.apache.org/viewvc/incubator/wookie/trunk/widgets/templates/twoColumn/scripts/twoColumn_controller.js?rev=1243092&view=auto
==============================================================================
---
incubator/wookie/trunk/widgets/templates/twoColumn/scripts/twoColumn_controller.js
(added)
+++
incubator/wookie/trunk/widgets/templates/twoColumn/scripts/twoColumn_controller.js
Sat Feb 11 16:52:05 2012
@@ -0,0 +1,50 @@
+/*
+ * 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.
+ */
+
+var ${widget.shortname}_twoColumn_controller = {
+ init:function() {
+ ${widget.shortname}_twoColumn_controller.update();
+ },
+
+ /**
+ * Update the display
+ */
+ update:function() {
+ // expand the search box on screens that are either wide enough
(alongside results) or tall enough
+ if ($.mobile.media("${widget.media.screen.tall}")) {
+ $('#content-secondary .ui-collapsible').each(
+ function() {
+ $(this).trigger('expand');
+ });
+ } else if ($.mobile.media("${widget.media.screen.moderateWidth}") ||
$.mobile.media("${widget.media.screen.veryWide}")) {
+ $('#content-secondary .ui-collapsible').each(
+ function() {
+ $(this).trigger('expand');
+ });
+ } else {
+ $('#content-secondary .ui-collapsible').each(
+ function() {
+ $(this).trigger('collapse');
+ });
+ }
+ },
+
+}
+
+$('#home').live('pageinit',function(event) {
+ ${widget.shortname}_twoColumn_controller.init();
+})
Propchange:
incubator/wookie/trunk/widgets/templates/twoColumn/scripts/twoColumn_controller.js
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/wookie/trunk/widgets/templates/twoColumn/scripts/twoColumn_controller.js
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/wookie/trunk/widgets/templates/twoColumn/style/screen.css.add
URL:
http://svn.apache.org/viewvc/incubator/wookie/trunk/widgets/templates/twoColumn/style/screen.css.add?rev=1243092&view=auto
==============================================================================
--- incubator/wookie/trunk/widgets/templates/twoColumn/style/screen.css.add
(added)
+++ incubator/wookie/trunk/widgets/templates/twoColumn/style/screen.css.add Sat
Feb 11 16:52:05 2012
@@ -0,0 +1,69 @@
+/*
+ * 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.
+ */
+
+ @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: left;
+ width: 42%;
+ margin-right: 1%;
+ padding-right: 2%;
+ }
+ .content-primary {
+ width: 55%;
+ float: right;
+ }
+ }
+
+ @media ${widget.media.screen.wide} {
+ .content-secondary {
+ text-align: left;
+ float: left;
+ width: 32%;
+ margin-right: 1%;
+ padding-right: 2%;
+ }
+ .content-primary {
+ width: 65%;
+ float: right;
+ }
+ }
+
+@media ${widget.media.screen.veryWide} {
+ .content-secondary {
+ text-align: left;
+ float: left;
+ width: 22%;
+ margin-right: 1%;
+ padding-right: 2%;
+ }
+ .content-primary {
+ width: 75%;
+ }
+}
\ No newline at end of file
Propchange:
incubator/wookie/trunk/widgets/templates/twoColumn/style/screen.css.add
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/wookie/trunk/widgets/templates/twoColumn/template_build.xml
URL:
http://svn.apache.org/viewvc/incubator/wookie/trunk/widgets/templates/twoColumn/template_build.xml?rev=1243092&view=auto
==============================================================================
--- incubator/wookie/trunk/widgets/templates/twoColumn/template_build.xml
(added)
+++ incubator/wookie/trunk/widgets/templates/twoColumn/template_build.xml Sat
Feb 11 16:52:05 2012
@@ -0,0 +1,155 @@
+<?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="browse_template">
+ <target name="_init_template"
+ description="Define any template specifc properties">
+ <echo message="+------------------------------------------"/>
+ <echo message="| Initialising template properties"/>
+ <echo message="+------------------------------------------"/>
+
+
+ <loadfile property="content.scripts"
+ srcFile="content_scripts.html"
+ failonerror="false">
+ <filterchain>
+ <expandproperties/>
+ </filterchain>
+ </loadfile>
+
+ <loadfile property="content.scripts"
+ srcFile="${template.dir}/${template.name}/content_scripts.html"
+ failonerror="false">
+ <filterchain>
+ <expandproperties/>
+ </filterchain>
+ </loadfile>
+
+ <loadfile property="content.header"
+ srcFile="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.header"
+ srcFile="${template.dir}/${template.name}/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="../common/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>
+
+ <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/twoColumn/template_build.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml