PyukiWiki CVS Commit
pyuki****@lists*****
2012年 3月 22日 (木) 18:40:09 JST
Index: PyukiWiki-Devel/lib/wiki.cgi diff -u PyukiWiki-Devel/lib/wiki.cgi:1.753 PyukiWiki-Devel/lib/wiki.cgi:1.754 --- PyukiWiki-Devel/lib/wiki.cgi:1.753 Wed Mar 21 17:35:03 2012 +++ PyukiWiki-Devel/lib/wiki.cgi Thu Mar 22 18:40:09 2012 @@ -1,6 +1,6 @@ ###################################################################### # wiki.cgi - This is PyukiWiki, yet another Wiki clone. -# $Id: wiki.cgi,v 1.753 2012/03/21 08:35:03 papu Exp $ +# $Id: wiki.cgi,v 1.754 2012/03/22 09:40:09 papu Exp $ # # "PyukiWiki" ver 0.2.0-p3-dev2 $$ # Copyright (C) 2004-2012 Nekyo @@ -943,7 +943,7 @@ # 0.2.0-p4 change if($ret{init}) { $::_exec_plugined{$explugin} = 2; - $::IN_HEAD.=&jscss_include($::skin_dir, $explugin); + $::IN_HEAD.=&jscss_include($explugin); } # 重複関数の検査 # comment foreach(split(/,/,$ret{func})) { @@ -1049,8 +1049,63 @@ next if($f eq ''); return $f if(-r "$::skin_dir/$f"); } - die sprintf("$f not found",""); - exit; + $::debug.="skin_check: $::skin_dir/$fmt not found\n"; # debug + return ''; +} + +=lang ja + +=head2 jscss_include + +=over 4 + +=item 入力値 + +& jscss_include(plugin name); + +=item 出力 + +HTMLタグ + +=item オーバーライド + +可 + +=item 概要 + +プラグイン向けのJavaScript、CSSの読み込み文字列を生成する。 + +Nekyo氏のPyukiWikiと互換性はありません。 + +=back + +=cut + +sub jscss_include { + my($name)=@_; + my $head; + my $dir="$skin_dir"; + + if(!$::jscss_included{$name}) { + $::jscss_included{$name}=1; + return if($name!~/^\w{1,64}/); + + foreach("$name%s.js", "$::skin_name.$name%s.js", "$name%s.css") { + my $result=&skin_check($_, ".$kanjicode.$::lang", ".$::lang", ""); + if($result ne '') { + if($result=~/\.js$/) { + $head.=<<EOM; +<script type="text/javascript" src="$dir/$result" charset="$::charset"></script> +EOM + } elsif($result=~/\.css$/) { + $head.=<<EOM; +<link rel="stylesheet" href="$dir/$result" type="text/css" media="screen" charset="$::charset" /> +EOM + } + } + } + } + return $head; } =lang ja @@ -4973,7 +5028,7 @@ $::debug.=$@; $_plugined{$1} = 1; # Pyuki # 0.2.0-p4 # comment - $::IN_HEAD.=&jscss_include($::skin_dir, $plugin); + $::IN_HEAD.=&jscss_include($plugin); # v0.1.6 # comment $path="$::res_dir/$plugin.$::lang.txt"; %::resource = &read_resource($path,%::resource) if(-r $path); @@ -5079,59 +5134,6 @@ =lang ja -=head2 jscss_include - -=over 4 - -=item 入力値 - -&jscss_include(dir, plugin name); - -=item 出力 - -HTMLタグ - -=item オーバーライド - -可 - -=item 概要 - -プラグイン向けのJavaScript、CSSの読み込み文字列を生成する。 - -Nekyo氏のPyukiWikiと互換性はありません。 - -=back - -=cut - -sub jscss_include { - my($dir, $name)=@_; - my $head; - - if(!$::jscss_included{$name}) { - $::jscss_included{$name}=1; - return if($name!~/^\w{1,64}/); - foreach("$::skin_dir/$name.js", "$::skin_dir/$::skin_name.$name.js" - , "$::skin_dir/$name.css","$::skin_dir/$::skin_name.$name.js") { - if(-r $_) { - if(/\.js$/) { - $head.=<<EOM; -<script type="text/javascript" src="$_" charset="$::charset"></script> -EOM - } elsif(/\.css$/) { - $head.=<<EOM; -<link rel="stylesheet" href="$_" type="text/css" media="screen" charset="$::charset" /> -EOM - } - } - } - } - return $head; -} - -=lang ja - =head2 embedded_to_html =over 4