0
class Tags extends Modules {
0
public function __init() {
0
- $this->addAlias(
'metaWeblog_newPost_preQuery', 'metaWeblog_editPost_preQuery');
0
+ $this->addAlias(
"metaWeblog_newPost_preQuery", "metaWeblog_editPost_preQuery");
0
$this->addAlias("post_grab", "posts_get");
0
+ $this->addAlias("javascript", "cloudSelectorJS");
0
static function __install() {
0
$config = Config::current();
0
<script type="text/javascript">
0
- $(".tags_select a").each(function(){
0
- regexp = new RegExp("(, ?|^)"+ $(this).text() +"(, ?|$)", "g")
0
- if ($("#tags").val().match(regexp))
0
- $(this).addClass("tag_added")
0
- $(this).removeClass("tag_added")
0
- $("#tags").livequery("keyup", scanTags)
0
- $(".tag_cloud > span").livequery("mouseover", function(){
0
- $(this).find(".controls").css("opacity", 1)
0
- }).livequery("mouseout", function(){
0
- $(this).find(".controls").css("opacity", 0)
0
- function add_tag(name, link) {
0
- if ($("#tags").val().match("(, |^)"+ name +"(, |$)")) {
0
- regexp = new RegExp("(, |^)"+ name +"(, |$)", "g")
0
- $("#tags").val($("#tags").val().replace(regexp, function(match, before, after){
0
- if (before == ", " && after == ", ")
0
- $(link).removeClass("tag_added")
0
- if ($("#tags").val() == "")
0
- $("#tags").val($("#tags").val() + ", "+ name)
0
- $(link).addClass("tag_added")
0
+<?php $this->cloudSelectorJS(); ?>
0
<link rel="stylesheet" href="<?php echo $config->chyrp_url; ?>/modules/tags/admin.css" type="text/css" media="screen" title="no title" charset="utf-8" />
0
$atom.= " <chyrp:tags>".fix(implode(", ", self::unlinked_tags($tags)))."</chyrp:tags>\r";
0
+ public function cloudSelectorJS() {
0
+ $(".tags_select a").each(function(){
0
+ regexp = new RegExp("(, ?|^)"+ $(this).text() +"(, ?|$)", "g")
0
+ if ($("#tags").val().match(regexp))
0
+ $(this).addClass("tag_added")
0
+ $(this).removeClass("tag_added")
0
+ $("#tags").livequery("keyup", scanTags)
0
+ $(".tag_cloud > span").livequery("mouseover", function(){
0
+ $(this).find(".controls").css("opacity", 1)
0
+ }).livequery("mouseout", function(){
0
+ $(this).find(".controls").css("opacity", 0)
0
+ function add_tag(name, link) {
0
+ if ($("#tags").val().match("(, |^)"+ name +"(, |$)")) {
0
+ regexp = new RegExp("(, |^)"+ name +"(, |$)", "g")
0
+ $("#tags").val($("#tags").val().replace(regexp, function(match, before, after){
0
+ if (before == ", " && after == ", ")
0
+ $(link).removeClass("tag_added")
0
+ if ($("#tags").val() == "")
0
+ $("#tags").val($("#tags").val() + ", "+ name)
0
+ $(link).addClass("tag_added")