Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: matthewmcvickar/taskpaper-tiles
base: 1a80cfaf88
...
head fork: matthewmcvickar/taskpaper-tiles
compare: 28f41cdfbe
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Showing with 34 additions and 16 deletions.
  1. +34 −16 generate_taskpaper_month.php
View
50 generate_taskpaper_month.php
@@ -14,6 +14,7 @@
- 'next month' button
- 'now' button
+- Take care of backslashes and other quoted characters.
- Using cookies for storage is OK, but only if the user always uses the same browser. LocalStorage has the same problem. Use a text file in the directory?
- way to set events on the last day of month (because it changes).
- The plaintext list should allow for notes below items.
@@ -21,10 +22,14 @@
*/
-
// If a new 'items' value was set, update the cookie. Expiration is one year, and should always be enough, since this will be set by this script running at least once a month.
-if ($_REQUEST['items'])
- setcookie('items', $_REQUEST['items'], time()+315569260);
+if ($_REQUEST['items_text'])
+{
+ setcookie('items', $_REQUEST['items_text'], time() + 315569260);
+
+ // Reload the page, since we just set a cookie.
+ header('Location: ' . $_SERVER['SCRIPT_NAME']);
+}
// If the cookie exists, get its value. Otherwise populate the items with sample data.
if ($_COOKIE['items'])
@@ -54,34 +59,46 @@
// Capture POST and GET.
$month = $_REQUEST['month'];
$year = $_REQUEST['year'];
-?>
+?><!doctype html>
<html>
<head>
<title>Taskpaper Month Generator</title>
<style>
+ html,
+ body
+ {
+ height: 100%;
+ margin: 0;
+ padding: 0;
+ overflow: hidden;
+ }
+
body
{
font-family: Helvetica, Arial, sans-serif;
font-size: 16px;
- margin: 1em;
+ min-height: 100%;
}
form
{
float: left;
background: #eee;
- margin-right: 5%;
+ width: 48%;
padding: 1%;
- width: 43%;
+ height: 98%;
}
form textarea
{
+ border: 0;
font-family: Helvetica, Arial, sans-serif;
font-size: 16px;
- height: 80%;
- width: 100%;
+ height: 88%;
+ width: 98%;
+ padding: 1%;
+ resize: none;
}
form select,
@@ -89,25 +106,26 @@
{
float: left;
font-size: 16px;
- margin: 1em 1em 1em 0;
+ margin: 1em 1em 0 0;
}
textarea.taskpaper_month
{
float: left;
- height: 95%;
- width: 50%;
+ height: 98%;
+ width: 48%;
border: 0;
font-family: Helvetica, Arial, sans-serif;
font-size: 16px;
- line-height: 1.2;
- padding: 0;
+
+ padding: 1%;
+ resize: none;
}
</style>
</head>
<body>
<form action="./generate_taskpaper_month.php" method="post">
- <textarea name="items"><?php print($items_plaintext); ?></textarea>
+ <textarea name="items_text"><?php print($items_plaintext); ?></textarea>
<select name="month">
<?php
@@ -147,7 +165,7 @@
<input type="submit" value="Go">
</form>
-<textarea class="taskpaper_month" onclick="this.select();"><?php
+<textarea class="taskpaper_month" readonly onclick="this.select();"><?php
if ($month)
$days = date('t', mktime(0, 0, 0, $month, 1, date('Y')));

No commit comments for this range

Something went wrong with that request. Please try again.