diff --git a/data/System/TagsPluginTagList.txt b/data/System/TagsPluginTagList.txt index 5baac31..229ba30 100644 --- a/data/System/TagsPluginTagList.txt +++ b/data/System/TagsPluginTagList.txt @@ -1,9 +1,9 @@ -%META:TOPICINFO{author="BaseUserMapping_333" date="1252679284" format="1.1" version="1.13"}% +%META:TOPICINFO{author="BaseUserMapping_333" date="1253480019" format="1.1" reprev="1.14" version="1.14"}% %META:TOPICPARENT{name="TagsPlugin"}% %TAGSEARCH{ query="tag" web="%URLPARAM{"tagweb" default="%TAGWEB%"}%" topic="%URLPARAM{"tagtopic" default="%TAGTOPIC%" }%" - format="
  • $percntICON{tag}$percnt $tag
  • " + format="
  • $percntICON{tag}$percnt $tag
  • " sep="$n" }% diff --git a/lib/Foswiki/Plugins/TagsPlugin.pm b/lib/Foswiki/Plugins/TagsPlugin.pm index 5e40685..991092f 100644 --- a/lib/Foswiki/Plugins/TagsPlugin.pm +++ b/lib/Foswiki/Plugins/TagsPlugin.pm @@ -45,15 +45,12 @@ sub initPlugin { return 0; } - Foswiki::Func::addToHEAD('TAGSPLUGIN',''); - - # $debug = $Foswiki::cfg{Plugins}{TagsPlugin}{Debug} || 0; - Foswiki::Func::registerTagHandler( 'TAGLIST', \&_TAGLIST ); Foswiki::Func::registerTagHandler( 'TAGENTRY', \&_TAGENTRY ); Foswiki::Func::registerTagHandler( 'TAGCLOUD', \&_TAGCLOUD ) if ( defined($Foswiki::cfg{TagsPlugin}{EnableTagCloud}) && $Foswiki::cfg{TagsPlugin}{EnableTagCloud} ); Foswiki::Func::registerTagHandler( 'TAGSEARCH', \&_TAGSEARCH ); Foswiki::Func::registerTagHandler( 'TAGGROUPS', \&_TAGGROUPS ); + Foswiki::Func::registerTagHandler( 'TAGPUBLIC', \&_TAGPUBLIC ); Foswiki::Func::registerTagHandler( 'ISTAGADMIN', \&_ISTAGADMIN ); Foswiki::Func::registerRESTHandler( 'tag', \&tagCall ); @@ -65,9 +62,17 @@ sub initPlugin { # Foswiki::Func::registerRESTHandler('updateGeoTags', \&updateGeoTags); #TODO: augment the IfParser and the QuerySearch Parsers to add Tags? - #TODO: add a SEARCH{type="tags"} search type + # load some js and css in the header + # plus add some data through meta tags + my $header= <<'HERE'; + + + +HERE + Foswiki::Func::addToHEAD('TAGSPLUGIN', "\n".$header ); + return 1; } @@ -310,6 +315,11 @@ sub _ISTAGADMIN { } } +sub _TAGPUBLIC { + my $guest = $Foswiki::cfg{DefaultUserWikiName} || "!DefaultUserWikiName NOT DEFINED!"; + return $guest; +} + =pod ---++ tagCall($session) -> $text diff --git a/lib/Foswiki/Plugins/TagsPlugin/TAGSEARCH.pm b/lib/Foswiki/Plugins/TagsPlugin/TAGSEARCH.pm index 0ce6a15..5fbe4b8 100644 --- a/lib/Foswiki/Plugins/TagsPlugin/TAGSEARCH.pm +++ b/lib/Foswiki/Plugins/TagsPlugin/TAGSEARCH.pm @@ -184,6 +184,7 @@ $order"; my $item = $row->[1]; my $cuid = $row->[2]; my $tag_count = $row->[3]; + my $user = Foswiki::Func::getWikiName($cuid); # replace all variable occurrences if ( $entry =~ m/\$(item|topic|web)/ ) { @@ -195,7 +196,7 @@ $order"; if ( $entry =~ m/\$(cuid|user)/ ) { $entry =~ s/\$cuid/$cuid/g; - $entry =~ s/\$user/Foswiki::Func::getWikiName($cuid)/ge; + $entry =~ s/\$user/$user/ge; } $entry =~ s/\$tag/$tag/g; @@ -214,6 +215,13 @@ $order"; } else { $entry =~ s/\$untaggable//g; } + + # flag this entry as public + if ( $user eq $Foswiki::cfg{DefaultUserWikiName} ) { + $entry =~ s/\$public/tagsplugin_public/g; + } else { + $entry =~ s/\$public//g; + } # insert seperator only if needed if ( $output ne '' ) { diff --git a/pub/System/TagsPlugin/tagsplugin.css b/pub/System/TagsPlugin/tagsplugin.css index 81bcf33..3601238 100644 --- a/pub/System/TagsPlugin/tagsplugin.css +++ b/pub/System/TagsPlugin/tagsplugin.css @@ -40,7 +40,6 @@ float: left; margin-left: 5px; padding: 0px; - width: 64%; } li.tagsplugin_tag { float: left; @@ -60,8 +59,10 @@ a.tagsplugin_tag_remove { display: none; } - a.tagsplugin_untaggable { - display: none; + .tagsplugin_untaggable { + } + li.tagsplugin_public { + background-color: #B9DAFF; } a.tagsplugin_untag_link { color: #FF0000; diff --git a/pub/System/TagsPlugin/tagsplugin.js b/pub/System/TagsPlugin/tagsplugin.js index 08bf0a2..a9fce1e 100644 --- a/pub/System/TagsPlugin/tagsplugin.js +++ b/pub/System/TagsPlugin/tagsplugin.js @@ -7,11 +7,28 @@ event.preventDefault(); $("#tagsplugin_processing img").show(); var tag = $("#tagsplugin_taginput_input").val(); - tagsplugin_be_tag(tag, foswiki.web+'.'+foswiki.topic, foswiki.wikiName ); + var user = $("div#tagsplugin_taginput form input[name=user]").attr("value"); + tagsplugin_be_tag(tag, foswiki.web+'.'+foswiki.topic, user ); $("#tagsplugin_taginput_input").trigger("blur").val("").focus(); } ); + // public checkbox + $("div#tagsplugin_taginput form input[name=user]") + .attr("checked", "checked") + .val(foswiki.tagsplugin.public) + .removeAttr("disabled") + .bind( + 'click', + function(event) { + if ( $(this).is(":checked") ) { + $(this).val(foswiki.tagsplugin.public); + } else { + $(this).val(""); + } + } + ); + $("#tagsplugin_taginput_input").autocomplete( foswiki.scriptUrl+"/view/"+foswiki.systemWebName+"/TagsPluginAutoCompleteBackend", { extraParams: { skin:"text", cover:"text" }, diff --git a/templates/view.tagspluginjquery.tmpl b/templates/view.tagspluginjquery.tmpl index 912367d..3403dcd 100644 --- a/templates/view.tagspluginjquery.tmpl +++ b/templates/view.tagspluginjquery.tmpl @@ -8,7 +8,7 @@ - + public