[Bps-public-commit] r10241 - in dashboard: hiveminder/newtask

sartak at bestpractical.com sartak at bestpractical.com
Thu Jan 3 13:34:39 EST 2008


Author: sartak
Date: Thu Jan  3 13:34:39 2008
New Revision: 10241

Added:
   dashboard/hiveminder/newtask/Default.png   (contents, props changed)
   dashboard/hiveminder/newtask/HiveminderNewTask.css
   dashboard/hiveminder/newtask/HiveminderNewTask.html
   dashboard/hiveminder/newtask/HiveminderNewTask.js
   dashboard/hiveminder/newtask/Icon.png   (contents, props changed)
   dashboard/hiveminder/newtask/Info.plist
   dashboard/hiveminder/newtask/version.plist
Modified:
   dashboard/   (props changed)

Log:
 r49860 at onn:  sartak | 2008-01-03 13:34:16 -0500
 Initial import of (broken) newtask widget


Added: dashboard/hiveminder/newtask/Default.png
==============================================================================
Binary file. No diff available.

Added: dashboard/hiveminder/newtask/HiveminderNewTask.css
==============================================================================
--- (empty file)
+++ dashboard/hiveminder/newtask/HiveminderNewTask.css	Thu Jan  3 13:34:39 2008
@@ -0,0 +1,65 @@
+.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;
+}
+
+#quickcreate {
+    position: absolute;
+    top:      40px;
+    left:     5px;
+}
+
+#newtask {
+    width: 190px;
+}
+
+#results {
+    position: absolute;
+    top:      70px;
+    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:       0px;
+    right:        65px;
+}
+

Added: dashboard/hiveminder/newtask/HiveminderNewTask.html
==============================================================================
--- (empty file)
+++ dashboard/hiveminder/newtask/HiveminderNewTask.html	Thu Jan  3 13:34:39 2008
@@ -0,0 +1,34 @@
+<html>
+    <head>
+        <style type="text/css">
+            @import "HiveminderNewTask.css";
+        </style>
+
+        <script type='text/javascript' src='HiveminderNewTask.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>
+            <form id="quickcreate" onsubmit="createTask(this); return 0;">
+                <input id="newtask"></input>
+            </form>
+            <div id="results" class="text">Whatcha got?</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/newtask/HiveminderNewTask.js
==============================================================================
--- (empty file)
+++ dashboard/hiveminder/newtask/HiveminderNewTask.js	Thu Jan  3 13:34:39 2008
@@ -0,0 +1,81 @@
+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");
+
+	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);
+    }
+}
+
+function doneSubmitting(command) {
+    var out = command.outputString;
+
+    if (!out) {
+        out = "An error has occurred. Sorry!";
+    }
+
+    results(out);
+}
+
+function results(text) {
+    document.getElementById("results").innerText = text;
+}
+
+function createTask(form) {
+    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 $task = <DATA>; $hm->create_task($task);\n__END__\n" + form.newtask.value;
+
+    results("Creating...");
+
+    var command = widget.system("/opt/local/bin/perl", doneSubmitting);
+    command.write(perl);
+    command.close();
+}
+

Added: dashboard/hiveminder/newtask/Icon.png
==============================================================================
Binary file. No diff available.

Added: dashboard/hiveminder/newtask/Info.plist
==============================================================================
--- (empty file)
+++ dashboard/hiveminder/newtask/Info.plist	Thu Jan  3 13:34:39 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 NewTask</string>
+	<key>CFBundleIdentifier</key>
+	<string>com.hiveminder.widget.newtask</string>
+	<key>CFBundleName</key>
+	<string>Hiveminder NewTask</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>HiveminderNewTask.html</string>
+    <key>Width</key>
+    <integer>200</integer>
+    <key>Height</key>
+    <integer>100</integer>
+    <key>AllowSystem</key>
+    <true />
+</dict>
+</plist>

Added: dashboard/hiveminder/newtask/version.plist
==============================================================================
--- (empty file)
+++ dashboard/hiveminder/newtask/version.plist	Thu Jan  3 13:34:39 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