mirror of
https://github.com/typecho/typecho.git
synced 2025-04-14 06:41:53 +02:00
修正一些错误
This commit is contained in:
parent
ca155fce44
commit
6b0d6887e3
@ -32,17 +32,19 @@
|
||||
}
|
||||
})();
|
||||
|
||||
$('a').each(function () {
|
||||
var t = $(this), href = t.attr('href');
|
||||
if ($('.typecho-login').length == 0) {
|
||||
$('a').each(function () {
|
||||
var t = $(this), href = t.attr('href');
|
||||
|
||||
if ((href.length > 1 && href[0] == '#')
|
||||
|| /^<?php echo preg_quote($options->adminUrl, '/'); ?>.*$/.exec(href)
|
||||
|| /^<?php echo substr(preg_quote(Typecho_Common::url('s', $options->index), '/'), 0, -1); ?>action\/[_a-zA-Z0-9\/]+.*$/.exec(href)) {
|
||||
return;
|
||||
}
|
||||
if ((href.length > 1 && href[0] == '#')
|
||||
|| /^<?php echo preg_quote($options->adminUrl, '/'); ?>.*$/.exec(href)
|
||||
|| /^<?php echo substr(preg_quote(Typecho_Common::url('s', $options->index), '/'), 0, -1); ?>action\/[_a-zA-Z0-9\/]+.*$/.exec(href)) {
|
||||
return;
|
||||
}
|
||||
|
||||
t.attr('target', '_blank');
|
||||
});
|
||||
t.attr('target', '_blank');
|
||||
});
|
||||
}
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
|
@ -12,7 +12,7 @@ update:
|
||||
git clone https://github.com/typecho/typecho-replica.git build
|
||||
rm -Rf build/.git
|
||||
rm -Rf build/.gitignore
|
||||
for i in `find build/ -name '*.source.css'`; do echo $$i && java -Xmx32m -jar yuicompressor-2.4.2.jar $$i --charset UTF-8 -o $$i; done;
|
||||
for i in `find build/ -name '*.css'`; do echo $$i && java -Xmx32m -jar yuicompressor-2.4.2.jar $$i --charset UTF-8 -o $$i; done;
|
||||
for i in `find build/admin/javascript/ -name '*.js'`; do echo $$i && java -Xmx32m -jar yuicompressor-2.4.2.jar $$i --charset UTF-8 -o $$i; done;
|
||||
for i in `find build/ -name '*.php'`; do php -l $$i; done;
|
||||
|
||||
|
@ -1,106 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* 用于格式化tab
|
||||
*
|
||||
* @author qining
|
||||
* @category typecho
|
||||
* @package default
|
||||
* @copyright Copyright (c) 2008 Typecho team (http://www.typecho.org)
|
||||
* @license GNU General Public License 2.0
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/** 定义程序运行的根目录 */
|
||||
define('ROOT_DIR', '../var/');
|
||||
|
||||
//获取一个目录下的文件
|
||||
function mgGetFile($inpath,$trim = false,$stamp = NULL)
|
||||
{
|
||||
$files = array();
|
||||
if(!is_dir($inpath))
|
||||
{
|
||||
return $files;
|
||||
}
|
||||
|
||||
$it = new DirectoryIterator($inpath);
|
||||
$stamp = (NULL === $stamp) ? NULL : explode("|",$stamp);
|
||||
|
||||
foreach($it as $file)
|
||||
{
|
||||
if($file->isFile())
|
||||
{
|
||||
$file = $file->__toString();
|
||||
$fileExt = (false === ($pos = strrpos($file,'.'))) ? NULL : substr($file,$pos + 1);
|
||||
$fileName = (false === $pos) ? $file : substr($file,0,$pos);
|
||||
|
||||
if(NULL !== $stamp && in_array($fileExt,$stamp))
|
||||
{
|
||||
$files[] = $trim ? $file : $fileName;
|
||||
}
|
||||
else if(NULL === $stamp)
|
||||
{
|
||||
$files[] = $trim ? $file : $fileName;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $files;
|
||||
}
|
||||
|
||||
//获取一个目录下的目录
|
||||
function mgGetDir($inpath)
|
||||
{
|
||||
$dirs = array();
|
||||
|
||||
if(!is_dir($inpath))
|
||||
{
|
||||
return $dirs;
|
||||
}
|
||||
$it = new DirectoryIterator($inpath);
|
||||
|
||||
foreach($it as $dir)
|
||||
{
|
||||
if($dir->isDir() && !$dir->isDot())
|
||||
{
|
||||
$dirs[] = $dir->__toString();
|
||||
}
|
||||
}
|
||||
return $dirs;
|
||||
}
|
||||
|
||||
function tabsize($dir = ROOT_DIR)
|
||||
{
|
||||
if($files = mgGetFile($dir, true, 'php'))
|
||||
{
|
||||
foreach($files as $file)
|
||||
{
|
||||
if($contents = file_get_contents($dir . '/' . $file))
|
||||
{
|
||||
$lines = preg_split("(\r\n|\r|\n)", $contents);
|
||||
$result = array();
|
||||
foreach($lines as $line)
|
||||
{
|
||||
preg_match("/^(\s+)(.*)$/", $line, $out);
|
||||
if($out && strlen($out[1]) > 0)
|
||||
{
|
||||
$line = str_replace("\t", ' ', $out[1]) . $out[2];
|
||||
}
|
||||
|
||||
$result[] = rtrim($line, "\r\n") . "\n";
|
||||
}
|
||||
|
||||
file_put_contents($dir . '/' . $file, trim(implode('', $result)) . "\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if($dirs = mgGetDir($dir))
|
||||
{
|
||||
foreach($dirs as $indir)
|
||||
{
|
||||
tabsize($dir . '/' . $indir);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tabsize();
|
@ -563,6 +563,14 @@ class Widget_Archive extends Widget_Abstract_Contents
|
||||
return $this->_total;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the $_currentPage
|
||||
*/
|
||||
public function getCurrentPage()
|
||||
{
|
||||
return $this->_currentPage;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the $_themeFile
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user