[Bps-public-commit] r10240 - in dashboard: hiveminder/todo
sartak at bestpractical.com
sartak at bestpractical.com
Thu Jan 3 13:29:44 EST 2008
Author: sartak
Date: Thu Jan 3 13:29:43 2008
New Revision: 10240
Added:
dashboard/hiveminder/todo/Default.png (contents, props changed)
dashboard/hiveminder/todo/HiveminderTodo.css
dashboard/hiveminder/todo/HiveminderTodo.html
dashboard/hiveminder/todo/HiveminderTodo.js
dashboard/hiveminder/todo/Icon.png (contents, props changed)
dashboard/hiveminder/todo/Info.plist
dashboard/hiveminder/todo/version.plist
Modified:
dashboard/ (props changed)
Log:
r49858 at onn: sartak | 2008-01-03 13:29:19 -0500
Initial import of the todo widget
Added: dashboard/hiveminder/todo/Default.png
==============================================================================
Binary file. No diff available.
Added: dashboard/hiveminder/todo/HiveminderTodo.css
==============================================================================
--- (empty file)
+++ dashboard/hiveminder/todo/HiveminderTodo.css Thu Jan 3 13:29:43 2008
@@ -0,0 +1,55 @@
+.text {
+ font: 12px "Lucida Grande";
+ color: black;
+}
+
+#name {
+ font-weight: bold;
+ text-align: center;
+ position: absolute;
+ top: 10px;
+ width: 100%;
+}
+
+hr {
+ border-top: 1px solid black;
+ border-bottom: 0;
+ border-left: 0;
+ border-right: 0;
+}
+
+#tasklist {
+ position: absolute;
+ top: 25px;
+ left: 5px;
+}
+
+body {
+ margin: 0;
+ background: orange;
+}
+
+ul, li {
+ padding-left: 0;
+}
+
+#front {
+ display: block;
+}
+
+#back {
+ display: none;
+}
+
+#infoButton {
+ position: absolute;
+ bottom: 15px;
+ right: 15px;
+}
+
+#doneButton {
+ position: absolute;
+ bottom: 20px;
+ left: 82px;
+}
+
Added: dashboard/hiveminder/todo/HiveminderTodo.html
==============================================================================
--- (empty file)
+++ dashboard/hiveminder/todo/HiveminderTodo.html Thu Jan 3 13:29:43 2008
@@ -0,0 +1,31 @@
+<html>
+ <head>
+ <style type="text/css">
+ @import "HiveminderTodo.css";
+ </style>
+
+ <script type='text/javascript' src='HiveminderTodo.js' charset='utf-8'/>
+
+ <script type='text/javascript' src='/System/Library/WidgetResources/AppleClasses/AppleInfoButton.js' charset='utf-8'/>
+ <script type='text/javascript' src='/System/Library/WidgetResources/AppleClasses/AppleAnimator.js' charset='utf-8'/>
+ <script type='text/javascript' src='/System/Library/WidgetResources/AppleClasses/AppleButton.js' charset='utf-8'/>
+ </head>
+
+ <body onload='setup();'>
+ <div id="front">
+ <div id="name" class="text"><a href="http://hiveminder.com/">Hiveminder</a><hr /></div>
+ <div id="tasklist" class="text"></div>
+ <div id="infoButton"></div>
+ </div>
+ <div id="back">
+ <dl>
+ <dt class="text">Email:</dt>
+ <dd><input id="hiveminderEmail" onchange='changePref(this);'></input></dd>
+ <dt class="text">Password:</dt>
+ <dd><input type="password" id="hiveminderPassword" onchange='changePref(this);'></input></dd>
+ </dl>
+
+ <div id="doneButton"></div>
+ </div>
+ </body>
+</html>
Added: dashboard/hiveminder/todo/HiveminderTodo.js
==============================================================================
--- (empty file)
+++ dashboard/hiveminder/todo/HiveminderTodo.js Thu Jan 3 13:29:43 2008
@@ -0,0 +1,92 @@
+var gDoneButton;
+var gInfoButton;
+
+function setup() {
+ gDoneButton = new AppleGlassButton(document.getElementById("doneButton"), "Done", hidePrefs);
+ gInfoButton = new AppleInfoButton(document.getElementById("infoButton"), document.getElementById("front"), "white", "white", showPrefs);
+
+ var email = document.getElementById("hiveminderEmail");
+ var password = document.getElementById("hiveminderPassword");
+ email.value = widget.preferenceForKey("hiveminderEmail");
+ password.value = widget.preferenceForKey("hiveminderPassword");
+
+ getTasks();
+
+ return 0;
+}
+
+function changePref(element) {
+ var key = element.id;
+ var pref = element.value;
+
+ widget.setPreferenceForKey(pref, key);
+}
+
+function showPrefs() {
+ var front = document.getElementById("front");
+ var back = document.getElementById("back");
+
+ if (window.widget) {
+ widget.prepareForTransition("ToBack");
+ }
+
+ front.style.display = "none";
+ back.style.display = "block";
+
+ if (window.widget) {
+ setTimeout ('widget.performTransition();', 0);
+ }
+}
+
+function hidePrefs() {
+ var front = document.getElementById("front");
+ var back = document.getElementById("back");
+
+ if (window.widget) {
+ widget.prepareForTransition("ToFront");
+ }
+
+ back.style.display = "none";
+ front.style.display = "block";
+
+ if (window.widget) {
+ setTimeout ('widget.performTransition();', 0);
+ }
+
+ getTasks();
+}
+
+function doneGettingTasks(command) {
+ var out = command.outputString;
+
+ if (!out) {
+ out = command.errorString;
+ }
+
+ populateTaskList(out);
+}
+
+function populateTaskList(tasks) {
+ var tasklist = document.getElementById("tasklist");
+ var t = tasks.split(/\n/);
+ var html = "<ul>";
+ for (i in t) {
+ html += "<li>" + t[i] + "</li>";
+ }
+ html += "</ul>";
+ tasklist.innerHTML = html;
+}
+
+function getTasks() {
+ var email = widget.preferenceForKey("hiveminderEmail");
+ var password = widget.preferenceForKey("hiveminderPassword");
+
+ var perl = "eval { require Net::Hiveminder; 1 } or do { print 'You do not have Net::Hiveminder.'; exit }; my $hm = Net::Hiveminder->new(email => '" + email + "', password => '" + password + "'); my @tasks = grep { defined } ($hm->todo_tasks)[0..9]; print scalar $hm->display_tasks(@tasks);";
+
+ populateTaskList("Downloading tasks...");
+
+ var command = widget.system("/opt/local/bin/perl", doneGettingTasks);
+ command.write(perl);
+ command.close();
+}
+
Added: dashboard/hiveminder/todo/Icon.png
==============================================================================
Binary file. No diff available.
Added: dashboard/hiveminder/todo/Info.plist
==============================================================================
--- (empty file)
+++ dashboard/hiveminder/todo/Info.plist Thu Jan 3 13:29:43 2008
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDisplayName</key>
+ <string>Hiveminder Todo</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.hiveminder.widget.todo</string>
+ <key>CFBundleName</key>
+ <string>Hiveminder Todo</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>CloseBoxInsetX</key>
+ <integer>5</integer>
+ <key>CloseBoxInsetY</key>
+ <integer>5</integer>
+ <key>MainHTML</key>
+ <string>HiveminderTodo.html</string>
+ <key>Width</key>
+ <integer>200</integer>
+ <key>Height</key>
+ <integer>250</integer>
+ <key>AllowSystem</key>
+ <true />
+</dict>
+</plist>
Added: dashboard/hiveminder/todo/version.plist
==============================================================================
--- (empty file)
+++ dashboard/hiveminder/todo/version.plist Thu Jan 3 13:29:43 2008
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>BuildVersion</key>
+ <string>254</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>ProjectName</key>
+ <string>Hiveminder</string>
+ <key>SourceVersion</key>
+ <string>60000</string>
+</dict>
+</plist>
More information about the Bps-public-commit
mailing list