Something changed this month in git making this not work anymore,
function JidanniLessRedNavigation($sktemplate,$links){ foreach($links['namespaces'] as $ns=>&$value){ if($value['context']=='talk' && $value['class']=='new' && !$sktemplate->getTitle()->quickUserCan('createtalk')){ unset($links['namespaces'][$ns]);} if($ns=='category' && $value['class']=='selected new'){ $value['class']='selected'; if(isset($links['actions']['watch'])){unset($links['actions']['watch']);}}} return true;} $wgHooks['SkinTemplateNavigation'][]='JidanniLessRedNavigation';
Maybe I should just give up on trying to use this as the internals it depends on keep on getting changed.
On Mon, 01 Oct 2012 04:39:59 -0700, jidanni@jidanni.org wrote:
Something changed this month in git making this not work anymore,
function JidanniLessRedNavigation($sktemplate,$links){ foreach($links['namespaces'] as $ns=>&$value){ if($value['context']=='talk' && $value['class']=='new' && !$sktemplate->getTitle()->quickUserCan('createtalk')){ unset($links['namespaces'][$ns]);} if($ns=='category' && $value['class']=='selected new'){ $value['class']='selected'; if(isset($links['actions']['watch'])){unset($links['actions']['watch']);}}} return true;} $wgHooks['SkinTemplateNavigation'][]='JidanniLessRedNavigation';
Maybe I should just give up on trying to use this as the internals it depends on keep on getting changed.
Wait, all you've been doing this tim is removing redlinks... why don't you just use css for that?
On Mon, Oct 1, 2012 at 2:59 PM, Antoine Musso hashar+wmf@free.fr wrote:
Le 01/10/12 16:50, Daniel Friesen a écrit :
Wait, all you've been doing this tim is removing redlinks... why don't you just use css for that?
That will not work on text browsers which is what Jidanni uses.
-- Antoine "hashar" Musso
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
In which case the links wouldn't be red in the first place :P
-bawolff
I would be happy to use CSS, just tell me how to rewrite the final function of
$wgNamespaceProtection[NS_CATEGORY]=$wgNamespaceProtection[NS_CATEGORY_TALK]=array('editinterface'); function JidanniBlueLinkCategoryPages($linker,$target,&$text,&$customAttribs,&$query,&$options){ switch($target->getNamespace()){case NS_CATEGORY:case NS_CATEGORY_TALK:$options[0]='known';}return true;} $wgHooks['LinkBegin'][]='JidanniBlueLinkCategoryPages'; function JidanniDontInviteEdit(&$article,&$outputDone){if($article->getID()===0){ switch($article->getTitle()->getNamespace()){case NS_CATEGORY:case NS_CATEGORY_TALK:$outputDone=true;}}return true;} $wgHooks['ArticleViewHeader'][]='JidanniDontInviteEdit';//Bug 17630 function JidanniLessRedNavigation($sktemplate,$links){ foreach($links['namespaces'] as $ns=>&$value){ if($value['context']=='talk' && $value['class']=='new' && !$sktemplate->getTitle()->quickUserCan('createtalk')){ unset($links['namespaces'][$ns]);} if($ns=='category' && $value['class']=='selected new'){ $value['class']='selected'; if(isset($links['actions']['watch'])){unset($links['actions']['watch']);}}} //var_dump('AFTER',$links); return true;} $wgHooks['SkinTemplateNavigation'][]='JidanniLessRedNavigation';
to make it work again. Thanks.
On Mon, 01 Oct 2012 23:10:11 -0700, jidanni@jidanni.org wrote:
I would be happy to use CSS, just tell me how to rewrite the final function of
$wgNamespaceProtection[NS_CATEGORY]=$wgNamespaceProtection[NS_CATEGORY_TALK]=array('editinterface'); function JidanniBlueLinkCategoryPages($linker,$target,&$text,&$customAttribs,&$query,&$options){ switch($target->getNamespace()){case NS_CATEGORY:case NS_CATEGORY_TALK:$options[0]='known';}return true;} $wgHooks['LinkBegin'][]='JidanniBlueLinkCategoryPages'; function JidanniDontInviteEdit(&$article,&$outputDone){if($article->getID()===0){ switch($article->getTitle()->getNamespace()){case NS_CATEGORY:case NS_CATEGORY_TALK:$outputDone=true;}}return true;} $wgHooks['ArticleViewHeader'][]='JidanniDontInviteEdit';//Bug 17630 function JidanniLessRedNavigation($sktemplate,$links){ foreach($links['namespaces'] as $ns=>&$value){ if($value['context']=='talk' && $value['class']=='new' && !$sktemplate->getTitle()->quickUserCan('createtalk')){ unset($links['namespaces'][$ns]);} if($ns=='category' && $value['class']=='selected new'){ $value['class']='selected'; if(isset($links['actions']['watch'])){unset($links['actions']['watch']);}}} //var_dump('AFTER',$links); return true;} $wgHooks['SkinTemplateNavigation'][]='JidanniLessRedNavigation';
to make it work again. Thanks.
We're saying you don't need to rewrite it.
Assuming you're using Vector. The standard link blue is #0645AD and the standard :visited blue is #0B0080. So to override the .new styles in the personal area with standard colors, just use:
#p-personal a.new { color: #0645AD; } #p-personal a.new:visited { color: #0B0080; }
And you can use that everywhere in your own personal css, not just your own wikis.
I don't want to change link colors. I want to remove links.
This used to work up until a month ago. Please tell me what I need to do to make it work again.
Please.
function JidanniLessUselessNavigation($sktemplate,$links){ foreach($links['namespaces'] as $ns=>&$value){ if($value['context']=='talk' && $value['class']=='new' && !$sktemplate->getTitle()->quickUserCan('createtalk')){ unset($links['namespaces'][$ns]);} if($ns=='category' && $value['class']=='selected new'){ $value['class']='selected'; if(isset($links['actions']['watch'])){unset($links['actions']['watch']);}}} return true;} $wgHooks['SkinTemplateNavigation'][]='JidanniLessUselessNavigation';
Thanks.
It turns out the ($sktemplate,$links) which worked a month ago, now needs to be (&$sktemplate,&$links)!
On Wed, 10 Oct 2012 02:57:40 -0700, jidanni@jidanni.org wrote:
It turns out the ($sktemplate,$links) which worked a month ago, now needs to be (&$sktemplate,&$links)!
You shouldn't need the & on $sktemplate. But obviously $links needs a &. This should have never worked in the first place without that. How do you expect to modify the links when you're dealing with a copy?
"DF" == Daniel Friesen daniel@nadir-seen-fire.com writes:
DF> obviously $links needs a &. This should have never worked in the DF> first place without that. How do you expect to modify the links when DF> you're dealing with a copy?
I don't know but it indeed did until about a month ago. That's what's in my backups. Anyway now I use &$ so no more problem.
wikitech-l@lists.wikimedia.org