]> git.quilime.com - clmpr.git/commitdiff
working on tagging
authorGabriel Dunne <gdunne@quilime.com>
Wed, 21 Dec 2011 15:33:59 +0000 (07:33 -0800)
committerGabriel Dunne <gdunne@quilime.com>
Wed, 21 Dec 2011 15:33:59 +0000 (07:33 -0800)
TODO
new.php
put.php
signup.php
style.css

diff --git a/TODO b/TODO
index fa0a6fa05e38995a7ad8252591fabdd300f0b837..823a3a6b1adde821bb7988439e3fbe225de08273 100644 (file)
--- a/TODO
+++ b/TODO
@@ -17,3 +17,5 @@ ref
        http://code.google.com/p/mysqlicious/
 
 
+tag complete
+       http://jqueryui.com/demos/autocomplete/#multiple
diff --git a/new.php b/new.php
index 165980c1f236476cbb18bac07c69073413e70c6c..e3e59904a9c30d8b96b47cead2714aea6cde585d 100644 (file)
--- a/new.php
+++ b/new.php
@@ -19,34 +19,40 @@ try {
 
             <p>
                <label>title</label>
-               <input type="text" name="title" value="<?=htmlentities($params['title'])?>">
+               <input type="text" name="title" tabindex="1" value="<?=htmlentities($params['title'])?>">
             </p>
 
             <p>
                <label>url</label>
-               <input type="text" name="url" value="<?=$params['url']?>">              
-            </p>
-               
-            <p>
-               <label>tags <span style="font-weight:normal">(space " " or comma "," delimited)</span></label>
-               <input type="text" name="tags" value="">                                
+               <input type="text" name="url" tabindex="2" value="<?=$params['url']?>">
             </p>
 
+               <label>tags <a href="#" class="tag-help" onClick="$('#tag-help').toggle();return false;">how to tag &raquo;</a></label>
+            <ul id="tag-help" style="display:none">
+                <li><span class="bull">&bull;</span>tag characters: [a-z 0-9 + # - .]</li>
+                <li><span class="bull">&bull;</span>combine multiple words into single-words with dashes</li>
+                <li><span class="bull">&bull;</span>delimit tags by space, semicolon, or comma</li>
+            </ul>
+               <input type="text" name="tags" tabindex="3" value="">
+
             <p>
             <label>description</label>
-            <input type="text" name="description" value="">                        
-            </p>            
+            <input type="text" name="description" tabindex="4" value="">
+            </p>
 
                <br />
 
             <p>
-               <input type="submit" value="save">
+               <input type="submit" tabindex="5" value="save">
                <a href="javascript:window.close();">cancel</a>
             </p>
 
                <br />
                <br />
 
+
+
+
        </form>
 
        <?php // include 'footer.html'; ?>
@@ -55,7 +61,7 @@ try {
                window.onload = function() {
                        document.forms[0].tags.focus();
                }
-           </script>           
+           </script>
 
        <?php
 
diff --git a/put.php b/put.php
index 942cd00010b0d06484c85edb1ad8dca49cfcd8c2..b4a1d11a4c239e403117ff57aa595ea0732b7fdd 100644 (file)
--- a/put.php
+++ b/put.php
@@ -26,28 +26,28 @@ try {
         #insert tags
         if (count($tags) > 0) {
             foreach($tags as $key => $tag) {
-                $q = $dbh->prepare("INSERT INTO `clmpr`.`tags` (`tag`, `count`) 
-                                    VALUES ( ?, 1 ) 
-                                    ON DUPLICATE KEY 
+                $q = $dbh->prepare("INSERT INTO `clmpr`.`tags` (`tag`, `count`)
+                                    VALUES ( ?, 1 )
+                                    ON DUPLICATE KEY
                                         UPDATE `count` = `count` + 1");
-                $q->execute( array( $tag ));
+                $q->execute(array($tag));
             }
         }
 
         # insert clump
-        $q = $dbh->prepare("INSERT INTO `clmpr`.`clumps` 
-                          ( `user_id`, 
-                            `title`, 
-                            `url`, 
-                            `tags`, 
-                            `description`, 
+        $q = $dbh->prepare("INSERT INTO `clmpr`.`clumps`
+                          ( `user_id`,
+                            `title`,
+                            `url`,
+                            `tags`,
+                            `description`,
                             `date` )
                         VALUES ( ?, ?, ?, ?, ?, NOW() ) ");
-        $insert = $q->execute( array( 
-                    $user['id'], 
-                    $params['title'], 
-                    $params['url'], 
-                    implode(" ", $tags), 
+        $insert = $q->execute( array(
+                    $user['id'],
+                    $params['title'],
+                    $params['url'],
+                    implode(" ", $tags),
                     htmlentities($params['description'])));
 
         echo "clumped.<br/><br/>";
@@ -55,7 +55,7 @@ try {
         echo '<script>window.close();</script>';
 
         $dbh = null;
-        $q = null;    
+        $q = null;
 
     } else {
         include 'signin.php';
index 47025179e6f787501ff439912260cfd26dc9c259..26370bd05fcfc2597f62ee921f7cbb1560a040cf 100644 (file)
@@ -50,4 +50,4 @@
         echo json_encode(array('success' => true, 'mssg' => $e->getMessage() ));
     }
 
-    exit;
\ No newline at end of file
+    exit;
index 10f26c856957100dc6618cfee85e48c1a6de2a51..7f4749913016289d50d2d0667c95d537fd90f3ca 100644 (file)
--- a/style.css
+++ b/style.css
@@ -24,6 +24,11 @@ hr {
     border-bottom:1px dotted #888;
 }
 
+.bull {
+    display:inline-block;
+    margin-right:0.6em;
+}
+
 
 .header, .header a {
      color: #888888;
@@ -126,6 +131,14 @@ ul.tags li:last-child:after {
     content:"";
 }
 
+.tag-help {
+    font-weight:normal;
+    font-size:12px;
+}
+#tag-help {
+    margin:0.1em 0 0.3em 0.5em;
+    font-size:12px;
+}
 
 #tags li {
     font-size:14px;