Tagger 20070926 0240
git-svn-id: file:///home/shish/svn/shimmie2/trunk@494 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
parent
aa2d6537de
commit
27473f272a
@ -16,11 +16,23 @@ function tagExists(tag) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function addTag(tag) {
|
function toggleTag(tag) {
|
||||||
|
var tags = byId("tags");
|
||||||
|
var tag_link = byId("tagger_tag_"+tag);
|
||||||
if (!tagExists(tag)) {
|
if (!tagExists(tag)) {
|
||||||
// append tag to tag box.
|
// append tag to tag box.
|
||||||
var tags = byId("tags");
|
|
||||||
tags.value = tags.value +" "+ tag;
|
tags.value = tags.value +" "+ tag;
|
||||||
|
// set indicator
|
||||||
|
if(tag_link) {
|
||||||
|
tag_link.style.fontWeight = "bold";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// remove tag
|
||||||
|
tags.value=tags.value.replace(" "+tag,"");
|
||||||
|
// set indicator
|
||||||
|
if(tag_link) {
|
||||||
|
tag_link.style.fontWeight = "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -29,6 +41,23 @@ function addTagById(id) {
|
|||||||
addTag(tag.value);
|
addTag(tag.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setTagIndicators(id) {
|
||||||
|
tagger = byId(id);
|
||||||
|
tagger.onclick = null;
|
||||||
|
|
||||||
|
tags = byId("tags");
|
||||||
|
|
||||||
|
tags = tags.value.split(" ");
|
||||||
|
|
||||||
|
for (x in tags) {
|
||||||
|
tag = tags[x];
|
||||||
|
obj = byId("tagger_tag_"+tag);
|
||||||
|
if(obj) {
|
||||||
|
obj.style.fontWeight="bold";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function tagger_filter(id) {
|
function tagger_filter(id) {
|
||||||
var filter = byId(id);
|
var filter = byId(id);
|
||||||
var e;
|
var e;
|
||||||
|
@ -25,3 +25,7 @@
|
|||||||
border-top:none;
|
border-top:none;
|
||||||
background-color:white;
|
background-color:white;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#tagger_body a {
|
||||||
|
font-size:1.5em;
|
||||||
|
}
|
||||||
|
@ -1,35 +1,29 @@
|
|||||||
<?php
|
<?php
|
||||||
class taggerTheme extends Themelet {
|
class taggerTheme extends Themelet {
|
||||||
public function build ($page, $tags) {
|
public function build ($page, $tags) {
|
||||||
|
|
||||||
$tag_html = "";
|
$tag_html = "";
|
||||||
foreach ($tags as $tag) {
|
foreach ($tags as $tag) {
|
||||||
$tag_name = $tag['tag'];
|
$tag_name = $tag['tag'];
|
||||||
$tag_trunc = $this->trimTag($tag_name,32);
|
$tag_trunc = $this->trimTag($tag_name,16);
|
||||||
$tag_html .= "<div id='tagger_tag_".$tag_name."'>"."
|
$tag_html .= "<div id='tagger_tag_".$tag_name."'>"."
|
||||||
<a style='cursor:pointer;' onclick='addTag("".$tag_name."");' ".
|
<a style='cursor:pointer;' onclick='toggleTag("".$tag_name."");' ".
|
||||||
"title='Add "".$tag_name."" to the tag list'>".$tag_trunc."</a>".
|
"title='Add "".$tag_name."" to the tag list'>".$tag_trunc."</a>".
|
||||||
"</div>";
|
"</div>";
|
||||||
}
|
}
|
||||||
$url_more = make_link("about/tagger");
|
$url_more = make_link("about/tagger");
|
||||||
|
|
||||||
$html = <<<EOD
|
$html = <<<EOD
|
||||||
<span style="font-size:.7em;">Collapse this block to hide Tagger.</span>
|
<span style="font-size:.7em;">Collapse this block to hide Tagger.</span>
|
||||||
<br/>
|
<br/>
|
||||||
<h4>Use</h4>
|
<a href='$url_more'>About Tagger</a>
|
||||||
<ul>
|
<div id="tagger_window" style="top:100px;left:100px;" onmousedown="setTagIndicators("tagger_window");">
|
||||||
<li>Click the links to add the tag to the list, when done, press Set to save the tags.</li>
|
|
||||||
<li>Type in the filter box to remove tags you aren't looking for.</li>
|
|
||||||
<li>Enter tags not on the list in the second box. Tags must have 2 uses to display in the list.</li>
|
|
||||||
<li><a href='$url_more'>More</a></li>
|
|
||||||
</ul>
|
|
||||||
<div id="tagger_window" style="top:100px;left:800px;">
|
|
||||||
<div id="tagger_titlebar" title="'Drag to move" onmousedown="dragStart(event,"tagger_window");">
|
<div id="tagger_titlebar" title="'Drag to move" onmousedown="dragStart(event,"tagger_window");">
|
||||||
Tagger
|
Tagger
|
||||||
</div>
|
</div>
|
||||||
<div id="tagger_body" style="height:300px;">
|
<div id="tagger_body" style="height:300px;">
|
||||||
<input type="text" id="tagger_filter" onkeyup="tagger_filter("tagger_filter")" size="12"></input>
|
<input type="text" id="tagger_custTag" value="" onkeyup="tagger_filter("tagger_custTag")" size='12'></input>
|
||||||
<hr/>
|
<input type="button" value="Add" onclick="addTagById("tagger_custTag")"></input>
|
||||||
<input type="text" id="custTag" value="" size='12'></input>
|
|
||||||
<input type="button" value="Add" onclick="addTagById("custTag")"></input>
|
|
||||||
<hr/>
|
<hr/>
|
||||||
$tag_html
|
$tag_html
|
||||||
</div>
|
</div>
|
||||||
@ -52,21 +46,20 @@ EOD;
|
|||||||
public function show_about ($event) {
|
public function show_about ($event) {
|
||||||
global $page;
|
global $page;
|
||||||
$html = <<<EOD
|
$html = <<<EOD
|
||||||
<h4>Author</h4>
|
|
||||||
Erik Youngren (Artanis) artanis.00@gmail.com
|
|
||||||
<h4>Use</h4>
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>Click the links to add the tag to the image's tag list, when done, press Set to save the tags.</li>
|
<li>Click the links to add the tag to the image's tag list, when done, press Set to save the tags.</li>
|
||||||
<li>Type in the filter box to remove tags you aren't looking for.<ul>
|
<li>
|
||||||
<li>Single letter filters will only match the first letter of the tags.</li>
|
If you are having trouble finding the tag you are looking for, enter it into the box at the top.<br/>
|
||||||
<li>2 or more will match that letter combination anywhere in the tag. Starting a
|
As you type, Tagger will remove tags that do not match to aid your search.<br/>
|
||||||
filter with a space (' ') will prevent this behaviour.</li>
|
If it is not in the list, click Add to add the tag to the image's tag list.<br/>
|
||||||
</ul></li>
|
Tags must have two uses to appear in Tagger's list, so you'll have to enter the tag at least once more.
|
||||||
<li>Enter tags not on the list in the second box. Tags must have 2 uses to display in the list.</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
EOD;
|
EOD;
|
||||||
|
$page->set_title("About Extension: Tagger");
|
||||||
$page->add_block( new Block("About Tagger", $html,"main"));
|
$page->set_heading("About Extension: Tagger");
|
||||||
|
$page->add_block( new Block("Author","Erik Youngren (Artanis) artanis.00@gmail.com","main",0));
|
||||||
|
$page->add_block( new Block("Use", $html,"main",1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user