Author: rgardler
Date: Thu Mar  3 23:07:00 2011
New Revision: 1076871

URL: http://svn.apache.org/viewvc?rev=1076871&view=rev
Log:
A simple RSS reader using JQueryMobile (it works in desktop browsers too)

Added:
    incubator/wookie/trunk/widgets/freeder/
    incubator/wookie/trunk/widgets/freeder/build.xml   (with props)
    incubator/wookie/trunk/widgets/freeder/config.xml   (with props)
    incubator/wookie/trunk/widgets/freeder/images/
    incubator/wookie/trunk/widgets/freeder/images/icon.png   (with props)
    incubator/wookie/trunk/widgets/freeder/images/icon_16x16.png   (with props)
    incubator/wookie/trunk/widgets/freeder/images/icon_32x32.png   (with props)
    incubator/wookie/trunk/widgets/freeder/index.html   (with props)
    incubator/wookie/trunk/widgets/freeder/legal/
    
incubator/wookie/trunk/widgets/freeder/legal/jquery.jfeed.pack.js.licence.txt   
(with props)
    incubator/wookie/trunk/widgets/freeder/lib/
    incubator/wookie/trunk/widgets/freeder/scripts/
    incubator/wookie/trunk/widgets/freeder/scripts/controller.js   (with props)
    incubator/wookie/trunk/widgets/freeder/scripts/jquery.jfeed.pack.js   (with 
props)
    incubator/wookie/trunk/widgets/freeder/scripts/properties.js   (with props)
    incubator/wookie/trunk/widgets/freeder/style/

Added: incubator/wookie/trunk/widgets/freeder/build.xml
URL: 
http://svn.apache.org/viewvc/incubator/wookie/trunk/widgets/freeder/build.xml?rev=1076871&view=auto
==============================================================================
--- incubator/wookie/trunk/widgets/freeder/build.xml (added)
+++ incubator/wookie/trunk/widgets/freeder/build.xml Thu Mar  3 23:07:00 2011
@@ -0,0 +1,23 @@
+<?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 default="build-widget" basedir="." name="widget build file">
+       <property name="wookie.widgets.dir" location="../"/>
+       <property name="widget.shortname" value="freeder"/>
+       
+       <import file="../build.xml"/>
+</project>
\ No newline at end of file

Propchange: incubator/wookie/trunk/widgets/freeder/build.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/wookie/trunk/widgets/freeder/config.xml
URL: 
http://svn.apache.org/viewvc/incubator/wookie/trunk/widgets/freeder/config.xml?rev=1076871&view=auto
==============================================================================
--- incubator/wookie/trunk/widgets/freeder/config.xml (added)
+++ incubator/wookie/trunk/widgets/freeder/config.xml Thu Mar  3 23:07:00 2011
@@ -0,0 +1,47 @@
+<!--
+  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.
+-->
+<widget xmlns="http://www.w3.org/ns/widgets";
+               id="http://wookie.apache.org/widgets/freeder";
+               version="0.1"
+        width="320"
+        height="480"
+        >
+  <name>freeder</name>
+  <description>An RSS reader widget optimised for small screens or desktop 
widgets.</description>
+  <content src="index.html"/>
+  <icon src="images/icon.png"/>  
+  <access origin="http://osswatch.jiscinvolve.org/feed"/>  
+  <author>Apache Wookie (Incubating) Team</author>
+  <licence>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.</licence>
+
+</widget>
+
+
+

Propchange: incubator/wookie/trunk/widgets/freeder/config.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/wookie/trunk/widgets/freeder/images/icon.png
URL: 
http://svn.apache.org/viewvc/incubator/wookie/trunk/widgets/freeder/images/icon.png?rev=1076871&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/wookie/trunk/widgets/freeder/images/icon.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/wookie/trunk/widgets/freeder/images/icon_16x16.png
URL: 
http://svn.apache.org/viewvc/incubator/wookie/trunk/widgets/freeder/images/icon_16x16.png?rev=1076871&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/wookie/trunk/widgets/freeder/images/icon_16x16.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/wookie/trunk/widgets/freeder/images/icon_32x32.png
URL: 
http://svn.apache.org/viewvc/incubator/wookie/trunk/widgets/freeder/images/icon_32x32.png?rev=1076871&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/wookie/trunk/widgets/freeder/images/icon_32x32.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/wookie/trunk/widgets/freeder/index.html
URL: 
http://svn.apache.org/viewvc/incubator/wookie/trunk/widgets/freeder/index.html?rev=1076871&view=auto
==============================================================================
--- incubator/wookie/trunk/widgets/freeder/index.html (added)
+++ incubator/wookie/trunk/widgets/freeder/index.html Thu Mar  3 23:07:00 2011
@@ -0,0 +1,75 @@
+<!--
+  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" />
+        <link rel="stylesheet" 
href="http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.css"; />
+               <script type="text/javascript" 
src="http://code.jquery.com/jquery-1.5.min.js";></script>
+               <script type="text/javascript" 
src="http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.js";></script>
+               <script type="text/javascript" 
src="scripts/jquery.jfeed.pack.js" charset="utf-8"></script>
+               <script type="text/javascript" src="scripts/properties.js" 
charset="utf-8"></script>  
+        <script type="text/javascript" src="scripts/controller.js" 
charset="utf-8"></script> 
+               <title>Freeder</title>
+       </head>
+       <body onLoad="Controller.init()">
+               <div data-role="page" id="storiesIndex">
+               
+                   <div data-role="header" data-position="fixed">
+                               <h4 id="storiesIndex-title">Freeder</h4>
+                               <a onClick="Controller.update()" 
data-role="button" data-icon="refresh" data-iconpos="notext">Refresh</a>
+                               <a href="#settings" data-role="button" 
data-icon="gear" data-iconpos="notext">Settings</a>
+                       </div> <!-- /header -->
+               
+                       <div data-role="content">       
+                               <ul data-role="listview" id="stories-listview">
+                               </ul>
+                       </div><!-- /content -->
+               
+                       <!--
+                       <div data-role="footer" data-position="fixed">
+                               <h4>Footer</h4>
+                       </div> /footer -->
+               </div><!-- /page -->
+               
+               <div data-role="page" id="settings">
+               
+                       <div data-role="header" data-position="fixed">
+                               <h4>Settings</h4>
+                       </div> <!-- /header -->
+               
+                       <div data-role="content" id="settings-content"> 
+                       <form action="" method="post">
+                               <div data-role="fieldcontain">
+                                               <label for="feedURL">Feed 
URL:</label>
+                                               <input type="url" name="name" 
id="name"  />
+                                               <p>Note, your URL must be 
whitelisted on the Wookie server.</p>
+                                       </div>
+                                       <div data-role="fieldcontain">
+                                               <button type="submit" 
onClick="Properties.submitForm(this.form)" value="save-settings" 
name="save-settings">Save</button>
+                                       </div>
+                       </form>
+                       </div><!-- /content -->
+               
+                       <!--
+                       <div data-role="footer" data-position="fixed">
+                               <h4>Footer</h4>
+                       </div> /footer -->
+               </div><!-- /page -->
+       </body>
+</html>
\ No newline at end of file

Propchange: incubator/wookie/trunk/widgets/freeder/index.html
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 
incubator/wookie/trunk/widgets/freeder/legal/jquery.jfeed.pack.js.licence.txt
URL: 
http://svn.apache.org/viewvc/incubator/wookie/trunk/widgets/freeder/legal/jquery.jfeed.pack.js.licence.txt?rev=1076871&view=auto
==============================================================================
--- 
incubator/wookie/trunk/widgets/freeder/legal/jquery.jfeed.pack.js.licence.txt 
(added)
+++ 
incubator/wookie/trunk/widgets/freeder/legal/jquery.jfeed.pack.js.licence.txt 
Thu Mar  3 23:07:00 2011
@@ -0,0 +1,20 @@
+Copyright (C) 2007 Jean-François Hovinne - http://www.hovinne.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.

Propchange: 
incubator/wookie/trunk/widgets/freeder/legal/jquery.jfeed.pack.js.licence.txt
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/wookie/trunk/widgets/freeder/scripts/controller.js
URL: 
http://svn.apache.org/viewvc/incubator/wookie/trunk/widgets/freeder/scripts/controller.js?rev=1076871&view=auto
==============================================================================
--- incubator/wookie/trunk/widgets/freeder/scripts/controller.js (added)
+++ incubator/wookie/trunk/widgets/freeder/scripts/controller.js Thu Mar  3 
23:07:00 2011
@@ -0,0 +1,72 @@
+/*
+ * 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.
+ */
+
+/**
+ * The Controller object
+ * This is used to wire up the view and model with actions
+ */ 
+var Controller = {
+       init:function() {
+               Controller.update();
+       },
+
+       /**
+        * Update the hello world message, and the updated time
+        */
+       items: [],
+       update:function() {
+               $.mobile.pageLoading();
+               jQuery.getFeed({
+               url: Widget.proxify(Properties.getFeedURL()),
+               success: function(feed) {
+                               Controller.items = feed.items;
+                               var index = $('#stories-listview');
+                   index.empty();
+                               $.each(Controller.items, function(key, item) {
+                       index.append($("<li/>")
+                                    .append($("<a/>")
+                                                                
.attr("onClick", "Controller.gotoStory(" + key + ")")
+                                                                
.text(item.title)));
+                       })
+                       index.listview("refresh");
+               }
+           });
+               $.mobile.pageLoading(true);
+       },
+       
+       /**
+        * Create the page for a given story and navigate to it.
+        */
+       gotoStory:function(key) {
+               item = Controller.items[key];
+               var header = $('<div data-role="header" 
data-position="fixed"></div>')
+          .append("<h4>" + item.title + "</h4>")
+               //var footer = $('<div data-role="footer" 
data-position="fixed"><h4>Footer<h4></div>');
+               var content = $("<div data-role='content'/>")
+                .append($('<h2>' + item.title + '</h2>'))
+                .append($('<div>' + item.description + '</div>')
+            .append($('<div><a href="' + item.link + '">Read original</a>')))
+                
+               $.mobile.pageContainer.append($("<div data-role='page'/>")
+                                                         .attr("id", key)
+                                                         .attr("data-url", key)
+                                                         .append(header)
+                                                         .append(content));
+               $('#' + key).page();
+               $.mobile.changePage("#" + key);
+       }               
+}
\ No newline at end of file

Propchange: incubator/wookie/trunk/widgets/freeder/scripts/controller.js
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/wookie/trunk/widgets/freeder/scripts/jquery.jfeed.pack.js
URL: 
http://svn.apache.org/viewvc/incubator/wookie/trunk/widgets/freeder/scripts/jquery.jfeed.pack.js?rev=1076871&view=auto
==============================================================================
--- incubator/wookie/trunk/widgets/freeder/scripts/jquery.jfeed.pack.js (added)
+++ incubator/wookie/trunk/widgets/freeder/scripts/jquery.jfeed.pack.js Thu Mar 
 3 23:07:00 2011
@@ -0,0 +1 @@
+eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};while(c--)if(k[c])p=p.replace(new
 RegExp('\\b'+e(c)+'\\b','g'),k[c]);return 
p}('2.1b=a(b){b=2.N({w:x,H:x,G:1a,v:x,F:x},b);h(b.w){$.19({u:\'18\',w:b.w,H:b.H,G:b.G,17:(2.P.O)?"6":"4",v:a(4){f
 i=k E(4);h(2.S(b.v))b.v(i)},16:a(15,R,e){h(2.S(b.F))b.F(R,e)}})}};a 
E(4){h(4)3.Q(4)};E.s={u:\'\',m:\'\',d:\'\',c:\'\',j:\'\',Q:a(4){h(2.P.O){f D=k 
14("13.12");D.11(4);4=D}h(2(\'8\',4).A==1){3.u=\'z\';f t=k B(4)}L 
h(2(\'i\',4).A==1){3.u=\'10\';f t=k C(4)}h(t)2.N(3,t)}};a 
p(){};p.s={d:\'\',c:\'\',j:\'\',l:\'\',o:\'\'};a C(4){3.r(4)};C.s={r:a(4){f 
8=2(\'i\',4).9(0);3.m=\'1.0\';3.d=2(8).5(\'d:g\').6();3.c=2(8).5(\'c:g\').q(\'M\');3.j=2(8).5(\'Z:g\').6();3.y=2(8).q(\'4:Y\');3.l=2(8).5(\'l:g\').6();3.n=k
 K();f i=3;2(\'X\',4).J(a(){f 7=k 
p();7.d=2(3).5(\'d\').9(0).6();7.c=2(3).5(\'c\').9(0).q(\'M\');7.j=2(3).5(\'W\').9(0).6();7.l=2(3).5(\'l\').9(0).6();7.o=2(3).5(\'o\')
 .9(0).6();i.n.I(7)})}};a 
B(4){3.r(4)};B.s={r:a(4){h(2(\'z\',4).A==0)3.m=\'1.0\';L 
3.m=2(\'z\',4).9(0).q(\'m\');f 
8=2(\'8\',4).9(0);3.d=2(8).5(\'d:g\').6();3.c=2(8).5(\'c:g\').6();3.j=2(8).5(\'j:g\').6();3.y=2(8).5(\'y:g\').6();3.l=2(8).5(\'V:g\').6();3.n=k
 K();f i=3;2(\'7\',4).J(a(){f 7=k 
p();7.d=2(3).5(\'d\').9(0).6();7.c=2(3).5(\'c\').9(0).6();7.j=2(3).5(\'j\').9(0).6();7.l=2(3).5(\'U\').9(0).6();7.o=2(3).5(\'T\').9(0).6();i.n.I(7)})}};',62,74,'||jQuery|this|xml|find|text|item|channel|eq|function|options|link|title||var|first|if|feed|description|new|updated|version|items|id|JFeedItem|attr|_parse|prototype|feedClass|type|success|url|null|language|rss|length|JRss|JAtom|xmlDoc|JFeed|failure|cache|data|push|each|Array|else|href|extend|msie|browser|parse|msg|isFunction|guid|pubDate|lastBuildDate|content|entry|lang|subtitle|atom|loadXML|XMLDOM|Microsoft|ActiveXObject|xhr|error|dataType|GET|ajax|true|getFeed'.split('|')))

Propchange: incubator/wookie/trunk/widgets/freeder/scripts/jquery.jfeed.pack.js
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/wookie/trunk/widgets/freeder/scripts/properties.js
URL: 
http://svn.apache.org/viewvc/incubator/wookie/trunk/widgets/freeder/scripts/properties.js?rev=1076871&view=auto
==============================================================================
--- incubator/wookie/trunk/widgets/freeder/scripts/properties.js (added)
+++ incubator/wookie/trunk/widgets/freeder/scripts/properties.js Thu Mar  3 
23:07:00 2011
@@ -0,0 +1,40 @@
+/*
+ * 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.
+ */
+
+/**
+ * Utility methods for working with widget properties.
+ */ 
+var Properties = {
+       
+       submitForm: function() {
+               var url = dwr.util.getValue("feedURL");
+               Widget.preferences.setItem("feedURL", url);
+               Controller.update();
+               $.mobile.changePage("#storiesIndex");
+       },
+
+       /**
+        * Get the base URL for the Simal REST interface.
+        */
+       getFeedURL: function() {
+               var url = Widget.preferences.getItem("feedURL");
+               if (url == undefined) {
+                       url = "http://osswatch.jiscinvolve.org/feed";;
+               }
+               return url;
+       }               
+}
\ No newline at end of file

Propchange: incubator/wookie/trunk/widgets/freeder/scripts/properties.js
------------------------------------------------------------------------------
    svn:mime-type = text/plain


Reply via email to