]> gitweb.fluxo.info Git - semanticscuttle.git/commitdiff
Interface fix: add suggested anchors to bookmarks' description field.
authormensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>
Mon, 12 Jan 2009 13:45:49 +0000 (13:45 +0000)
committermensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>
Mon, 12 Jan 2009 13:45:49 +0000 (13:45 +0000)
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@229 b3834d28-1941-0410-a4f8-b48e95affb8f

config.inc.php.example
jsScuttle.php
scuttle.css
templates/editbookmark.tpl.php

index 56cf957b4de7e405caa630dc7ecdcc172bcfc8db..e8fc9b243a3470e60b254791cf3887225aacc3d2 100644 (file)
@@ -88,5 +88,8 @@ $enableGoogleCustomSearch = true; #Enable Google Search Engine into "gsearch/" f
 
 ### Other ###
 $enableAdminColors = true;  #Enables special colors on admin pages and bookmarks marking the difference with normal user.
+$descriptionAnchors = array("author", "isbn", "address"=>"[address][street][/street][city][/city][/address]"); #add a possible anchor (structured content) for bookmarks' description field
+                                                       # a simple value "xxx" (like "author") automatically associates xxx with [xxx][/xxx].
+                                                       # a complex value "xxx"=>"yyy" (like "address") direclty associates xxx with yyy. 
 
 ?>
index 222b91d93aa47f5817c55cd280f5ea3cd287f1d5..c21fa0e20c0d1c642d8cb878af7750e009983442 100644 (file)
@@ -141,3 +141,9 @@ function playerLoad() {
         }
     }
 }
+
+function addAnchor(anchorForm, where) {
+    var whereZone = document.getElementById(where);    
+    whereZone.value = whereZone.value + anchorForm;    
+    document.getElementById(where).focus();
+}
index 7f9b579062790a5066eeff9cea57ba3b8a4512a6..5c9aba60ca2fd052205684458a012d1d4fd795ef 100644 (file)
@@ -325,6 +325,11 @@ p.tags span.selected {
     background: #CEC;
 }
 
+.anchor {
+    cursor: pointer;
+    text-decoration: underline;
+}
+
 .treeTag {
        color: #999955;
 }
index 264a3c1efd8c4f28c11e1a5a66c00f5ceebdcdda..ab0e861056917084b94f07294a76c73ab86bf3ef 100644 (file)
@@ -41,8 +41,20 @@ $this->includeTemplate("dojo.inc");
 </tr>
 <tr>
     <th align="left"><?php echo T_('Description'); ?></th>
-    <td><textarea name="description" rows="5" cols="63" ><?php echo filter($row['bDescription'], 'xml'); ?></textarea></td>
-    <td>&larr; <?php echo T_('You can use anchors to delimite attributes. for example: [publisher]blah[/publisher] '); ?></td>
+    <td><textarea name="description" id="description" rows="5" cols="63" ><?php echo filter($row['bDescription'], 'xml'); ?></textarea></td>
+    <td>&larr; <?php echo T_('You can use anchors to delimite attributes. for example: [publisher]blah[/publisher] '); ?> 
+    <?php if(count($GLOBALS['descriptionAnchors'])>0): ?>
+    <br /><br />
+    <?php echo T_('Suggested anchors: '); ?>
+       <?php foreach($GLOBALS['descriptionAnchors'] as $anchorName => $anchorValue): ?>
+    <?php if(is_numeric($anchorName)) {
+       $anchorName = $anchorValue;
+       $anchorValue = '['.$anchorValue.']'.'[/'.$anchorValue.']';
+    } ?>
+    <span class="anchor" title="<?php echo $anchorValue ?>" onclick="addAnchor('<?php echo $anchorValue ?>', 'description')"><?php echo $anchorName ?></span>
+    <?php endforeach; ?>
+    <?php endif; ?>
+    </td>
 </tr>
 <tr>
     <th align="left"><?php echo T_('Tags'); ?></th>