初始化
修改了上一个版本的一些错误,第一次提交
25
.gitignore
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
.*.swp
|
||||
.*.swo
|
||||
._*
|
||||
.DS_Store
|
||||
/Debug/
|
||||
/ImgCache/
|
||||
/Backup_rar/
|
||||
/Debug/
|
||||
/debug/
|
||||
/upload/
|
||||
/avatar/
|
||||
/.idea/
|
||||
.svn/
|
||||
*.orig
|
||||
*.aps
|
||||
*.APS
|
||||
*.chm
|
||||
*.exp
|
||||
*.pdb
|
||||
*.rar
|
||||
.smbdelete*
|
||||
*.sublime*
|
||||
.sass-cache
|
||||
config.rb
|
||||
/config.inc.php
|
111
admin/common-js.php
Normal file
@ -0,0 +1,111 @@
|
||||
<?php if(!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
|
||||
<script type="text/javascript" src="<?php $options->adminUrl('javascript/mootools.js?v=' . $suffixVersion); ?>"></script>
|
||||
<script type="text/javascript" src="<?php $options->adminUrl('javascript/typecho.js?v=' . $suffixVersion); ?>"></script>
|
||||
<script type="text/javascript">
|
||||
(function () {
|
||||
window.addEvent('domready', function() {
|
||||
var _d = $(document);
|
||||
var handle = new Typecho.guid('typecho:guid', {offset: 1, type: 'mouse'});
|
||||
|
||||
//增加高亮效果
|
||||
(function () {
|
||||
var _hlId = '<?php echo $notice->highlight; ?>';
|
||||
|
||||
if (_hlId) {
|
||||
var _hl = _d.getElement('#' + _hlId);
|
||||
|
||||
if (_hl) {
|
||||
_hl.set('tween', {duration: 1500});
|
||||
|
||||
var _bg = _hl.getStyle('background-color');
|
||||
if (!_bg || 'transparent' == _bg) {
|
||||
_bg = '#F7FBE9';
|
||||
}
|
||||
|
||||
_hl.tween('background-color', '#AACB36', _bg);
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
||||
//增加淡出效果
|
||||
(function () {
|
||||
var _msg = _d.getElement('.popup');
|
||||
|
||||
if (_msg) {
|
||||
(function () {
|
||||
|
||||
var _messageEffect = new Fx.Morph(this, {
|
||||
duration: 'short',
|
||||
transition: Fx.Transitions.Sine.easeOut
|
||||
});
|
||||
|
||||
_messageEffect.addEvent('complete', function () {
|
||||
this.element.setStyle('display', 'none');
|
||||
});
|
||||
|
||||
_messageEffect.start({'margin-top': [30, 0], 'height': [21, 0], 'opacity': [1, 0]});
|
||||
|
||||
}).delay(5000, _msg);
|
||||
}
|
||||
})();
|
||||
|
||||
//增加滚动效果,滚动到上面的一条error
|
||||
(function () {
|
||||
var _firstError = _d.getElement('.typecho-option .error');
|
||||
|
||||
if (_firstError) {
|
||||
var _errorFx = new Fx.Scroll(window).toElement(_firstError.getParent('.typecho-option'));
|
||||
}
|
||||
})();
|
||||
|
||||
//禁用重复提交
|
||||
(function () {
|
||||
_d.getElements('input[type=submit]').removeProperty('disabled');
|
||||
_d.getElements('button[type=submit]').removeProperty('disabled');
|
||||
|
||||
var _disable = function (e) {
|
||||
e.stopPropagation();
|
||||
|
||||
this.setProperty('disabled', true);
|
||||
this.getParent('form').submit();
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
_d.getElements('input[type=submit]').addEvent('click', _disable);
|
||||
_d.getElements('button[type=submit]').addEvent('click', _disable);
|
||||
})();
|
||||
|
||||
//打开链接
|
||||
(function () {
|
||||
|
||||
_d.getElements('a').each(function (item) {
|
||||
var _href = item.href;
|
||||
|
||||
if (_href && 0 != _href.indexOf('#')) {
|
||||
//确认框
|
||||
item.addEvent('click', function (event) {
|
||||
var _lang = this.get('lang');
|
||||
var _c = _lang ? confirm(_lang) : true;
|
||||
|
||||
if (!_c) {
|
||||
event.stop();
|
||||
}
|
||||
});
|
||||
|
||||
/** 如果匹配则继续 */
|
||||
if (/^<?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;
|
||||
}
|
||||
|
||||
item.set('target', '_blank');
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
||||
Typecho.Table.init('.typecho-list-table');
|
||||
Typecho.Table.init('.typecho-list-notable');
|
||||
});
|
||||
})();
|
||||
</script>
|
57
admin/common.php
Normal file
@ -0,0 +1,57 @@
|
||||
<?php
|
||||
if (!defined('__DIR__')) {
|
||||
define('__DIR__', dirname(__FILE__));
|
||||
}
|
||||
|
||||
/** 载入配置文件 */
|
||||
if (!@include_once __DIR__ . '/../config.inc.php') {
|
||||
file_exists(__DIR__ . '/../install.php') ? header('Location: ../install.php') : print('Missing Config File');
|
||||
exit;
|
||||
}
|
||||
|
||||
/** 初始化组件 */
|
||||
Typecho_Widget::widget('Widget_Init');
|
||||
|
||||
/** 注册一个初始化插件 */
|
||||
Typecho_Plugin::factory('admin/common.php')->begin();
|
||||
|
||||
Typecho_Widget::widget('Widget_Options')->to($options);
|
||||
Typecho_Widget::widget('Widget_User')->to($user);
|
||||
Typecho_Widget::widget('Widget_Notice')->to($notice);
|
||||
Typecho_Widget::widget('Widget_Menu')->to($menu);
|
||||
|
||||
/** 初始化上下文 */
|
||||
$request = $options->request;
|
||||
$response = $options->response;
|
||||
|
||||
/** 检测是否是第一次登录 */
|
||||
$currentMenu = $menu->getCurrentMenu();
|
||||
list($prefixVersion, $suffixVersion) = explode('/', $options->version);
|
||||
$params = parse_url($currentMenu[2]);
|
||||
$adminFile = basename($params['path']);
|
||||
|
||||
if (!$user->logged && !Typecho_Cookie::get('__typecho_first_run') && !empty($currentMenu)) {
|
||||
|
||||
if ('welcome.php' != $adminFile) {
|
||||
$response->redirect(Typecho_Common::url('welcome.php', $options->adminUrl));
|
||||
} else {
|
||||
Typecho_Cookie::set('__typecho_first_run', 1);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
/** 检测版本是否升级 */
|
||||
if ($user->pass('administrator', true) && !empty($currentMenu)) {
|
||||
$mustUpgrade = (!defined('Typecho_Common::VERSION') || version_compare(str_replace('/', '.', Typecho_Common::VERSION),
|
||||
str_replace('/', '.', $options->version), '>'));
|
||||
|
||||
if ($mustUpgrade && 'upgrade.php' != $currentMenu[2]) {
|
||||
$response->redirect(Typecho_Common::url('upgrade.php', $options->adminUrl));
|
||||
} else if (!$mustUpgrade && 'upgrade.php' == $currentMenu[2]) {
|
||||
$response->redirect(Typecho_Common::url('index.php', $options->adminUrl));
|
||||
} else if (!$mustUpgrade && 'welcome.php' == $currentMenu[2] && $user->logged) {
|
||||
$response->redirect(Typecho_Common::url('index.php', $options->adminUrl));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
13
admin/copyright.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php if(!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
|
||||
<div class="typecho-foot">
|
||||
<h4><a href="http://typecho.org" class="logo-dark">typecho</a></h4>
|
||||
<div class="copyright"><?php _e('基于 <em>%s %s</em> <small> | %s</small> 构建', $options->software, $prefixVersion, $suffixVersion); ?></div>
|
||||
<div class="resource">
|
||||
<ul>
|
||||
<li><a href="http://docs.typecho.org"><?php _e('文档'); ?></a></li>
|
||||
<li><a href="http://forum.typecho.org"><?php _e('支持论坛'); ?></a></li>
|
||||
<li><a href="http://code.google.com/p/typecho/issues/entry"><?php _e('报告错误'); ?></a></li>
|
||||
<li><a href="http://extends.typecho.org"><?php _e('其他资源'); ?></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
262
admin/css/grid.source.css
Normal file
@ -0,0 +1,262 @@
|
||||
/* vim: set et sw=4 ts=4 sts=4 fdm=marker ff=unix fenc=utf8 */
|
||||
/**
|
||||
* 格栅系统
|
||||
*
|
||||
* 根据 Taobao 栅格系统规范制定
|
||||
*
|
||||
* @change
|
||||
* 2008-09-19
|
||||
* 初始化版本,使用“浮动定位布局”
|
||||
*
|
||||
* @author i.feelinglucky@gmail.com
|
||||
* @since 2008-09-19
|
||||
* @link http://www.gracecode.com/
|
||||
* @version $Id: grid.source.css 470 2008-09-26 15:23:38Z i.feelinglucky $
|
||||
*/
|
||||
|
||||
.body {
|
||||
clear:both;
|
||||
width:100%;
|
||||
}
|
||||
|
||||
.container {
|
||||
float:left;
|
||||
width:100%;
|
||||
}
|
||||
|
||||
.container:after {
|
||||
content: ".";
|
||||
display: block;
|
||||
height: 0;
|
||||
clear: both;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
/**
|
||||
* 目前制定的是 950px 宽度
|
||||
*/
|
||||
.body-950 {
|
||||
width: 950px;
|
||||
margin: 0px auto;
|
||||
}
|
||||
|
||||
.prefix {
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
.suffix {
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将页面分成了 24 份,同时指定每个栅格的基本样式
|
||||
*/
|
||||
.column-01, .column-02, .column-03, .column-04, .column-05,
|
||||
.column-06, .column-07, .column-08, .column-09, .column-10,
|
||||
.column-11, .column-12, .column-13, .column-14, .column-15,
|
||||
.column-16, .column-17, .column-18, .column-19, .column-20,
|
||||
.column-21, .column-22, .column-23, .column-24 {
|
||||
float: left;
|
||||
width: 100%;
|
||||
display: inline;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/**
|
||||
* 950 宽度的格栅
|
||||
*
|
||||
* 公式:(40 x N) - 10 = 950
|
||||
*/
|
||||
.body-950 .column-01 {
|
||||
width: 30px;
|
||||
}
|
||||
|
||||
.body-950 .column-02 {
|
||||
width: 70px;
|
||||
}
|
||||
|
||||
.body-950 .column-03 {
|
||||
width: 110px;
|
||||
}
|
||||
|
||||
.body-950 .column-04 {
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
.body-950 .column-05 {
|
||||
width: 190px;
|
||||
}
|
||||
|
||||
.body-950 .column-06 {
|
||||
width: 230px;
|
||||
}
|
||||
|
||||
.body-950 .column-07 {
|
||||
width: 270px;
|
||||
}
|
||||
|
||||
.body-950 .column-08 {
|
||||
width: 310px;
|
||||
}
|
||||
|
||||
.body-950 .column-09 {
|
||||
width: 350px;
|
||||
}
|
||||
|
||||
.body-950 .column-10 {
|
||||
width: 390px;
|
||||
}
|
||||
|
||||
.body-950 .column-11 {
|
||||
width: 430px;
|
||||
}
|
||||
|
||||
.body-950 .column-12 {
|
||||
width: 470px;
|
||||
}
|
||||
|
||||
.body-950 .column-13 {
|
||||
width: 510px;
|
||||
}
|
||||
|
||||
.body-950 .column-14 {
|
||||
width: 550px;
|
||||
}
|
||||
|
||||
.body-950 .column-15 {
|
||||
width: 590px;
|
||||
}
|
||||
|
||||
.body-950 .column-16 {
|
||||
width: 630px;
|
||||
}
|
||||
|
||||
.body-950 .column-17 {
|
||||
width: 670px;
|
||||
}
|
||||
|
||||
.body-950 .column-18 {
|
||||
width: 710px;
|
||||
}
|
||||
|
||||
.body-950 .column-19 {
|
||||
width: 750px;
|
||||
}
|
||||
|
||||
.body-950 .column-20 {
|
||||
width: 790px;
|
||||
}
|
||||
|
||||
.body-950 .column-21 {
|
||||
width: 830px;
|
||||
}
|
||||
|
||||
.body-950 .column-22 {
|
||||
width: 870px;
|
||||
}
|
||||
|
||||
.body-950 .column-23 {
|
||||
width: 910px;
|
||||
}
|
||||
|
||||
.body-950 .column-24 {
|
||||
width: 950px;
|
||||
}
|
||||
|
||||
/**
|
||||
* 对比栅格,设置偏移位置
|
||||
*/
|
||||
.body-950 .column, .body-950 .start-01 {
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.body-950 .start-02 {
|
||||
padding-left: 40px;
|
||||
}
|
||||
|
||||
.body-950 .start-03 {
|
||||
padding-left: 80px;
|
||||
}
|
||||
|
||||
.body-950 .start-04 {
|
||||
padding-left: 120px;
|
||||
}
|
||||
|
||||
.body-950 .start-05 {
|
||||
padding-left: 160px;
|
||||
}
|
||||
|
||||
.body-950 .start-06 {
|
||||
padding-left: 200px;
|
||||
}
|
||||
|
||||
.body-950 .start-07 {
|
||||
padding-left: 240px;
|
||||
}
|
||||
|
||||
.body-950 .start-08 {
|
||||
padding-left: 280px;
|
||||
}
|
||||
|
||||
.body-950 .start-09 {
|
||||
padding-left: 320px;
|
||||
}
|
||||
|
||||
.body-950 .start-10 {
|
||||
padding-left: 360px;
|
||||
}
|
||||
|
||||
.body-950 .start-11 {
|
||||
padding-left: 400px;
|
||||
}
|
||||
|
||||
.body-950 .start-12 {
|
||||
padding-left: 440px;
|
||||
}
|
||||
|
||||
.body-950 .start-13 {
|
||||
padding-left: 480px;
|
||||
}
|
||||
|
||||
.body-950 .start-14 {
|
||||
padding-left: 520px;
|
||||
}
|
||||
|
||||
.body-950 .start-15 {
|
||||
padding-left: 560px;
|
||||
}
|
||||
|
||||
.body-950 .start-16 {
|
||||
padding-left: 600px;
|
||||
}
|
||||
|
||||
.body-950 .start-17 {
|
||||
padding-left: 640px;
|
||||
}
|
||||
.body-950 .start-18 {
|
||||
padding-left: 680px;
|
||||
}
|
||||
.body-950 .start-19 {
|
||||
padding-left: 720px;
|
||||
}
|
||||
|
||||
.body-950 .start-20 {
|
||||
padding-left: 760px;
|
||||
}
|
||||
|
||||
.body-950 .start-21 {
|
||||
padding-left: 800px;
|
||||
}
|
||||
|
||||
.body-950 .start-22 {
|
||||
padding-left: 840px;
|
||||
}
|
||||
|
||||
.body-950 .start-23 {
|
||||
padding-left: 880px;
|
||||
}
|
||||
|
||||
.body-950 .start-24 {
|
||||
padding-left: 920px;
|
||||
}
|
79
admin/css/reset.source.css
Normal file
@ -0,0 +1,79 @@
|
||||
/* vim: set et sw=4 ts=4 sts=4 fdm=marker ff=unix fenc=utf8 */
|
||||
/**
|
||||
* CSS 重置样式
|
||||
*
|
||||
* 重置主流浏览器默认样式,参考 YUI 以及 Blueprint
|
||||
*
|
||||
* @author i.feelinglucky@gmail.com
|
||||
* @link http://www.gracecode.com/
|
||||
* @version $Id: reset.source.css 470 2008-09-26 15:23:38Z i.feelinglucky $
|
||||
*/
|
||||
html, body, div, span, object, iframe,
|
||||
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
||||
a, abbr, acronym, address, code,
|
||||
del, dfn, em, img, q, dl, dt, dd, ol, ul, li,
|
||||
fieldset, form, label, legend,
|
||||
table, caption, tbody, tfoot, thead, tr, th, td {
|
||||
margin: 0em; padding: 0em; border: 0em;
|
||||
font-weight: inherit;
|
||||
font-style: inherit;
|
||||
font-family: inherit;
|
||||
vertical-align: baseline;
|
||||
outline-style: none;
|
||||
outline-width: none;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 200%;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 180%;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 160%;
|
||||
}
|
||||
|
||||
h4 {
|
||||
font-size: 140%;
|
||||
}
|
||||
|
||||
h5 {
|
||||
font-size: 120%;
|
||||
}
|
||||
|
||||
h6, p {
|
||||
font-size: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
table {
|
||||
border-collapse: separate;
|
||||
border-spacing: 0;
|
||||
}
|
||||
|
||||
caption, th, td {
|
||||
text-align: left;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
table, td, th {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
blockquote:before, blockquote:after, q:before, q:after {
|
||||
content: "";
|
||||
}
|
||||
|
||||
blockquote, q {
|
||||
quotes: "" "";
|
||||
}
|
||||
|
||||
a img {
|
||||
border: none;
|
||||
outline: none;
|
||||
}
|
2425
admin/css/typecho.source.css
Normal file
20
admin/editor-js.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php if(!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
|
||||
<script type="text/javascript">
|
||||
var textEditor = new Typecho.textarea('#text', {
|
||||
autoSaveTime: 30,
|
||||
resizeAble: true,
|
||||
autoSave: <?php echo ($options->autoSave ? 'true' : 'false'); ?>,
|
||||
autoSaveMessageElement: 'auto-save-message',
|
||||
autoSaveLeaveMessage: '<?php _e('您的内容尚未保存, 是否离开此页面?'); ?>',
|
||||
resizeUrl: '<?php $options->index('/action/ajax'); ?>'
|
||||
});
|
||||
|
||||
/** 这两个函数在插件中必须实现 */
|
||||
var insertImageToEditor = function (title, url, link, cid) {
|
||||
textEditor.setContent('<a href="' + link + '" title="' + title + '"><img src="' + url + '" alt="' + title + '" /></a>', '');
|
||||
};
|
||||
|
||||
var insertLinkToEditor = function (title, url, link, cid) {
|
||||
textEditor.setContent('<a href="' + url + '" title="' + title + '">' + title + '</a>', '');
|
||||
};
|
||||
</script>
|
11
admin/extending.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
include 'common.php';
|
||||
|
||||
$panel = $request->get('panel');
|
||||
$panelTable = unserialize($options->panelTable);
|
||||
|
||||
if (!isset($panelTable['file']) || !in_array(urlencode($panel), $panelTable['file'])) {
|
||||
throw new Typecho_Plugin_Exception(_t('页面不存在'), 404);
|
||||
}
|
||||
|
||||
require_once $panel;
|
200
admin/file-upload-js.php
Normal file
@ -0,0 +1,200 @@
|
||||
<?php if(!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
|
||||
<?php
|
||||
if (isset($post) && $post instanceof Typecho_Widget && $post->have()) {
|
||||
$fileParentContent = $post;
|
||||
} else if (isset($page) && $page instanceof Typecho_Widget && $page->have()) {
|
||||
$fileParentContent = $page;
|
||||
}
|
||||
?>
|
||||
<script type="text/javascript" src="<?php $options->adminUrl('javascript/swfupload/swfupload.js?v=' . $suffixVersion); ?>"></script>
|
||||
<script type="text/javascript" src="<?php $options->adminUrl('javascript/swfupload/swfupload.queue.js?v=' . $suffixVersion); ?>"></script>
|
||||
<script type="text/javascript" src="<?php $options->adminUrl('javascript/swfupload/swfupload.cookies.js?v=' . $suffixVersion); ?>"></script>
|
||||
<script type="text/javascript">
|
||||
var deleteAttachment = function (cid, el) {
|
||||
|
||||
var _title = $(el).getParent('li').getElement('strong');
|
||||
|
||||
if (!confirm("<?php _e('你确认删除附件 %s 吗?'); ?>".replace("%s", _title.get('text').trim()))) {
|
||||
return;
|
||||
}
|
||||
|
||||
_title.addClass('delete');
|
||||
|
||||
new Request.JSON({
|
||||
method : 'post',
|
||||
url : '<?php $options->index('/action/contents-attachment-edit'); ?>',
|
||||
onComplete : function (result) {
|
||||
if (200 == result.code) {
|
||||
$(el).getParent('li').destroy();
|
||||
} else {
|
||||
_title.removeClass('delete');
|
||||
alert('<?php _e('删除失败'); ?>');
|
||||
}
|
||||
}
|
||||
}).send('do=delete&cid=' + cid);
|
||||
};
|
||||
|
||||
(function () {
|
||||
|
||||
window.addEvent('domready', function() {
|
||||
var _inited = false;
|
||||
|
||||
//begin parent tabshow
|
||||
$(document).getElement('#upload-panel').addEvent('tabShow', function () {
|
||||
|
||||
if (_inited) {
|
||||
return;
|
||||
}
|
||||
_inited = true;
|
||||
|
||||
var swfuploadLoaded = function () {
|
||||
$(document).getElement('#upload-panel .button')
|
||||
.set('html', '<?php _e('上传文件'); ?> <small style="font-weight:normal">(<?php echo function_exists('ini_get') ? ini_get('upload_max_filesize') : 0 ; ?>)</small>');
|
||||
};
|
||||
|
||||
var fileDialogComplete = function (numFilesSelected, numFilesQueued) {
|
||||
try {
|
||||
this.startUpload();
|
||||
} catch (ex) {
|
||||
this.debug(ex);
|
||||
}
|
||||
};
|
||||
|
||||
var uploadStart = function (file) {
|
||||
var _el = new Element('li', {
|
||||
'class' : 'upload-progress-item clearfix',
|
||||
'id' : file.id,
|
||||
'text' : file.name
|
||||
});
|
||||
|
||||
_el.inject($(document).getElement('ul.upload-progress'), 'top');
|
||||
};
|
||||
|
||||
var uploadSuccess = function (file, serverData) {
|
||||
var _el = $(document).getElement('#' + file.id);
|
||||
var _result = JSON.decode(serverData);
|
||||
|
||||
_el.set('html', '<strong>' + file.name +
|
||||
'<input type="hidden" name="attachment[]" value="' + _result.cid + '" /></strong>' +
|
||||
'<small><span class="insert"><?php _e('插入'); ?></span>' +
|
||||
' , <span class="delete"><?php _e('删除'); ?></span></small>');
|
||||
_el.set('tween', {duration: 1500});
|
||||
|
||||
_el.setStyles({
|
||||
'background-image' : 'none',
|
||||
'background-color' : '#D3DBB3'
|
||||
});
|
||||
|
||||
_el.tween('background-color', '#D3DBB3', '#FFFFFF');
|
||||
|
||||
var _insertBtn = _el.getElement('.insert');
|
||||
if (_result.isImage) {
|
||||
_insertBtn.addEvent('click', function () {
|
||||
insertImageToEditor(_result.title, _result.url, _result.permalink);
|
||||
});
|
||||
} else {
|
||||
_insertBtn.addEvent('click', function () {
|
||||
insertLinkToEditor(_result.title, _result.url, _result.permalink);
|
||||
});
|
||||
}
|
||||
|
||||
var _deleteBtn = _el.getElement('.delete');
|
||||
_deleteBtn.addEvent('click', function () {
|
||||
deleteAttachment(_result.cid, this);
|
||||
});
|
||||
};
|
||||
|
||||
var uploadComplete = function (file) {
|
||||
//console.dir(file);
|
||||
};
|
||||
|
||||
var uploadError = function (file, errorCode, message) {
|
||||
var _el = $(document).getElement('#' + file.id);
|
||||
var _fx = new Fx.Morph(_el, {
|
||||
duration: 3000,
|
||||
transition: Fx.Transitions.Sine.easeOut
|
||||
});
|
||||
_el.set('html', '<strong>' + file.name + ' <?php _e('上传失败'); ?></strong>');
|
||||
_el.setStyles({
|
||||
'background-image' : 'none',
|
||||
'color' : '#FFFFFF',
|
||||
'background-color' : '#CC0000'
|
||||
});
|
||||
|
||||
_fx.addEvent('complete', function () {
|
||||
_el.destroy();
|
||||
});
|
||||
|
||||
_fx.start({'opacity': [1, 0]});
|
||||
};
|
||||
|
||||
var uploadProgress = function (file, bytesLoaded, bytesTotal) {
|
||||
var _el = $(document).getElement('#' + file.id);
|
||||
var percent = Math.ceil((1 - (bytesLoaded / bytesTotal)) * _el.getSize().x);
|
||||
_el.setStyle('background-position', '-' + percent + 'px 0');
|
||||
};
|
||||
|
||||
var swfu, _size = $(document).getElement('.typecho-list-operate a.button').getCoordinates(),
|
||||
settings = {
|
||||
flash_url : "<?php $options->adminUrl('javascript/swfupload/swfupload.swf'); ?>",
|
||||
upload_url: "<?php $options->index('/action/upload'); ?>",
|
||||
<?php if (isset($fileParentContent)): ?>
|
||||
post_params: {"cid" : <?php $fileParentContent->cid(); ?>},
|
||||
<?php endif; ?>
|
||||
file_size_limit : "<?php $val = function_exists('ini_get') ? trim(ini_get('upload_max_filesize')) : 0;
|
||||
$last = strtolower($val[strlen($val)-1]);
|
||||
switch($last) {
|
||||
// The 'G' modifier is available since PHP 5.1.0
|
||||
case 'g':
|
||||
$val *= 1024;
|
||||
case 'm':
|
||||
$val *= 1024;
|
||||
case 'k':
|
||||
$val *= 1024;
|
||||
}
|
||||
|
||||
echo $val;
|
||||
?> byte",
|
||||
file_types : "<?php
|
||||
$attachmentTypes = $options->allowedAttachmentTypes;
|
||||
$attachmentTypesCount = count($attachmentTypes);
|
||||
for ($i = 0; $i < $attachmentTypesCount; $i ++) {
|
||||
echo '*.' . $attachmentTypes[$i];
|
||||
if ($i < $attachmentTypesCount - 1) {
|
||||
echo ';';
|
||||
}
|
||||
}
|
||||
?>",
|
||||
file_types_description : "<?php _e('所有文件'); ?>",
|
||||
file_upload_limit : 0,
|
||||
file_queue_limit : 0,
|
||||
debug: false,
|
||||
|
||||
//Handle Settings
|
||||
file_dialog_complete_handler : fileDialogComplete,
|
||||
upload_start_handler : uploadStart,
|
||||
upload_progress_handler : uploadProgress,
|
||||
upload_success_handler : uploadSuccess,
|
||||
queue_complete_handler : uploadComplete,
|
||||
upload_error_handler : uploadError,
|
||||
swfupload_loaded_handler : swfuploadLoaded,
|
||||
|
||||
// Button Settings
|
||||
button_placeholder_id : "swfu-placeholder",
|
||||
button_height: 25,
|
||||
button_text: '',
|
||||
button_text_style: '',
|
||||
button_text_left_padding: 14,
|
||||
button_text_top_padding: 0,
|
||||
button_width: _size.width,
|
||||
button_window_mode: SWFUpload.WINDOW_MODE.TRANSPARENT,
|
||||
button_cursor: SWFUpload.CURSOR.HAND
|
||||
};
|
||||
|
||||
swfu = new SWFUpload(settings);
|
||||
|
||||
});
|
||||
//end parent tabshow
|
||||
});
|
||||
})();
|
||||
</script>
|
97
admin/file-upload.php
Normal file
@ -0,0 +1,97 @@
|
||||
<?php if(!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
|
||||
|
||||
<?php
|
||||
if (isset($post) || isset($page)) {
|
||||
$cid = isset($post) ? $post->cid : $page->cid;
|
||||
|
||||
if ($cid) {
|
||||
Typecho_Widget::widget('Widget_Contents_Attachment_Related', 'parentId=' . $cid)->to($attachment);
|
||||
} else {
|
||||
Typecho_Widget::widget('Widget_Contents_Attachment_Unattached')->to($attachment);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<style>
|
||||
.upload-progress {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
#upload-panel ul li.upload-progress-item {
|
||||
background-image: url(<?php $options->adminUrl('images/progress.gif'); ?>);
|
||||
background-repeat: repeat-y;
|
||||
background-position: -1000px 0;
|
||||
background-color: #fff;
|
||||
padding: 5px;
|
||||
margin-bottom: 5px;
|
||||
border: 1px solid #C1CD94;
|
||||
|
||||
-moz-border-radius-topleft: 2px;
|
||||
-moz-border-radius-topright: 2px;
|
||||
-moz-border-radius-bottomleft: 2px;
|
||||
-moz-border-radius-bottomright: 2px;
|
||||
-webkit-border-top-left-radius: 2px;
|
||||
-webkit-border-top-right-radius: 2px;
|
||||
-webkit-border-bottom-left-radius: 2px;
|
||||
-webkit-border-bottom-right-radius: 2px;
|
||||
|
||||
/* hope IE support border radius, God save me! */
|
||||
border-top-left-radius: 2px;
|
||||
border-top-right-radius: 2px;
|
||||
border-bottom-left-radius: 2px;
|
||||
border-bottom-right-radius: 2px;
|
||||
}
|
||||
|
||||
.upload-progress-item strong {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.upload-progress-item strong.delete {
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
.upload-progress-item small {
|
||||
float: right;
|
||||
font-size: 8pt;
|
||||
}
|
||||
|
||||
.upload-progress-item small .insert, .upload-progress-item small .delete {
|
||||
cursor: pointer;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.upload-progress-item small .insert {
|
||||
color: #00AA00;
|
||||
}
|
||||
|
||||
.upload-progress-item small .delete {
|
||||
color: #CC0000;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="typecho-list-operate">
|
||||
<p class="operate">
|
||||
<a class="button"><?php _e('正在加载上传组件'); ?></a>
|
||||
<span id="swfu"><span id="swfu-placeholder"></span></span>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<ul class="upload-progress">
|
||||
<?php while ($attachment->next()): ?>
|
||||
<li class="upload-progress-item clearfix">
|
||||
<strong>
|
||||
<?php $attachment->title(); ?>
|
||||
<input type="hidden" name="attachment[]" value="<?php $attachment->cid(); ?>" />
|
||||
</strong>
|
||||
<small>
|
||||
<span class="insert" onclick="<?php if ($attachment->attachment->isImage){
|
||||
echo "insertImageToEditor('{$attachment->title}', '{$attachment->attachment->url}', '{$attachment->permalink}', {$attachment->cid});";
|
||||
} else {
|
||||
echo "insertLinkToEditor('{$attachment->title}', '{$attachment->attachment->url}', '{$attachment->permalink}', {$attachment->cid});";
|
||||
} ?>"><?php _e('插入'); ?></span>
|
||||
,
|
||||
<span class="delete" onclick="deleteAttachment(<?php $attachment->cid(); ?>, this);"><?php _e('删除'); ?></span>
|
||||
</small>
|
||||
</li>
|
||||
<?php endwhile; ?>
|
||||
</ul>
|
6
admin/footer.php
Normal file
@ -0,0 +1,6 @@
|
||||
<?php if(!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
/** 注册一个初始化插件 */
|
||||
Typecho_Plugin::factory('admin/footer.php')->end();
|
22
admin/header.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
if (!defined('__TYPECHO_ROOT_DIR__')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$header = '<link rel="stylesheet" type="text/css" href="' . Typecho_Common::url('css/reset.source.css?v=' . $suffixVersion, $options->adminUrl) . '" />
|
||||
<link rel="stylesheet" type="text/css" href="' . Typecho_Common::url('css/grid.source.css?v=' . $suffixVersion, $options->adminUrl) . '" />
|
||||
<link rel="stylesheet" type="text/css" href="' . Typecho_Common::url('css/typecho.source.css?v=' . $suffixVersion, $options->adminUrl) . '" />';
|
||||
|
||||
/** 注册一个初始化插件 */
|
||||
$header = Typecho_Plugin::factory('admin/header.php')->header($header);
|
||||
|
||||
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=<?php $options->charset(); ?>" />
|
||||
<title><?php _e('%s - %s - Powered by Typecho', $menu->title, $options->title); ?></title>
|
||||
<meta name="robots" content="noindex,nofollow" />
|
||||
<?php echo $header; ?>
|
||||
</head>
|
||||
<body<?php if (isset($bodyClass)) {echo ' class="' . $bodyClass . '"';} ?>>
|
BIN
admin/images/ajax-loader.gif
Normal file
After Width: | Height: | Size: 673 B |
BIN
admin/images/arrow.gif
Normal file
After Width: | Height: | Size: 180 B |
BIN
admin/images/attach.gif
Normal file
After Width: | Height: | Size: 307 B |
BIN
admin/images/comment.gif
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
admin/images/link.png
Normal file
After Width: | Height: | Size: 343 B |
BIN
admin/images/mime.gif
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
admin/images/noscreen.gif
Normal file
After Width: | Height: | Size: 511 B |
BIN
admin/images/notice.gif
Normal file
After Width: | Height: | Size: 580 B |
BIN
admin/images/progress.gif
Normal file
After Width: | Height: | Size: 72 B |
BIN
admin/images/size-btn.gif
Normal file
After Width: | Height: | Size: 55 B |
BIN
admin/images/sprite.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
166
admin/index.php
Normal file
@ -0,0 +1,166 @@
|
||||
<?php
|
||||
include 'common.php';
|
||||
include 'header.php';
|
||||
include 'menu.php';
|
||||
|
||||
$stat = Typecho_Widget::widget('Widget_Stat');
|
||||
?>
|
||||
<div class="main">
|
||||
<div class="body body-950">
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="container typecho-page-main">
|
||||
<div class="column-06 typecho-dashboard-nav suffix">
|
||||
<h3 class="intro"><?php _e('欢迎使用 Typecho, 您可以使用下面的链接开始您的 Blog 之旅:'); ?></h3>
|
||||
|
||||
<div class="intro-link">
|
||||
<ul>
|
||||
<li><a href="<?php $options->adminUrl('profile.php'); ?>"><?php _e('更新我的资料'); ?></a></li>
|
||||
<?php if($user->pass('contributor', true)): ?>
|
||||
<li><a href="<?php $options->adminUrl('write-post.php'); ?>"><?php _e('撰写一篇新文章'); ?></a></li>
|
||||
<?php if($user->pass('editor', true) && 'on' == $request->get('__typecho_all_comments') && $stat->waitingCommentsNum > 0): ?>
|
||||
<li><a href="<?php $options->adminUrl('manage-comments.php?status=waiting'); ?>"><?php _e('等待审核的评论'); ?></a>
|
||||
<span class="balloon"><?php $stat->waitingCommentsNum(); ?></span>
|
||||
</li>
|
||||
<?php elseif($stat->myWaitingCommentsNum > 0): ?>
|
||||
<li><a href="<?php $options->adminUrl('manage-comments.php?status=waiting'); ?>"><?php _e('等待审核的评论'); ?></a>
|
||||
<span class="balloon"><?php $stat->myWaitingCommentsNum(); ?></span>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php if($user->pass('editor', true) && 'on' == $request->get('__typecho_all_comments') && $stat->spamCommentsNum > 0): ?>
|
||||
<li><a href="<?php $options->adminUrl('manage-comments.php?status=spam'); ?>"><?php _e('垃圾评论'); ?></a>
|
||||
<span class="balloon"><?php $stat->spamCommentsNum(); ?></span>
|
||||
</li>
|
||||
<?php elseif($stat->mySpamCommentsNum > 0): ?>
|
||||
<li><a href="<?php $options->adminUrl('manage-comments.php?status=spam'); ?>"><?php _e('垃圾评论'); ?></a>
|
||||
<span class="balloon"><?php $stat->mySpamCommentsNum(); ?></span>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php if($user->pass('editor', true)): ?>
|
||||
<li><a href="<?php $options->adminUrl('write-page.php'); ?>"><?php _e('创建一个新页面'); ?></a></li>
|
||||
<?php if($user->pass('administrator', true)): ?>
|
||||
<li><a href="<?php $options->adminUrl('themes.php'); ?>"><?php _e('更换我的主题'); ?></a></li>
|
||||
<li><a href="<?php $options->adminUrl('options-general.php'); ?>"><?php _e('修改系统设置'); ?></a></li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<h3><?php _e('统计信息'); ?></h3>
|
||||
<div class="status">
|
||||
<p><?php _e('目前有 <em>%s</em> 篇 Blog,并有 <em>%s</em> 条关于你的评论在已设定的 <em>%s</em> 个分类中.',
|
||||
$stat->myPublishedPostsNum, $stat->myPublishedCommentsNum, $stat->categoriesNum); ?></p>
|
||||
|
||||
<p><?php
|
||||
if ($user->logged > 0) {
|
||||
_e('最后登录: %s', Typecho_I18n::dateWord($user->logged + $options->timezone, $options->gmtTime + $options->timezone));
|
||||
}
|
||||
?></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="column-12 typecho-dashboard-main">
|
||||
<div class="section">
|
||||
<h4><?php _e('最近发表的文章'); ?></h4>
|
||||
<?php Typecho_Widget::widget('Widget_Contents_Post_Recent', 'pageSize=5')->to($posts); ?>
|
||||
<ul>
|
||||
<?php if($posts->have()): ?>
|
||||
<?php while($posts->next()): ?>
|
||||
<li><a href="<?php $posts->permalink(); ?>" class="title"><?php $posts->title(); ?></a> <?php _e('发布于'); ?>
|
||||
<?php $posts->category(', '); ?> - <span class="date"><?php $posts->dateWord(); ?></span></li>
|
||||
<?php endwhile; ?>
|
||||
<?php else: ?>
|
||||
<li><em><?php _e('暂时没有文章'); ?></em></li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section">
|
||||
<h4><?php _e('最新得到的回复'); ?></h4>
|
||||
<ul>
|
||||
<?php Typecho_Widget::widget('Widget_Comments_Recent', 'pageSize=5')->to($comments); ?>
|
||||
<?php if($comments->have()): ?>
|
||||
<?php while($comments->next()): ?>
|
||||
<li><?php $comments->author(true); ?> <?php _e('发布于'); ?> <a href="<?php $comments->permalink(); ?>" class="title"><?php $comments->title(); ?></a> - <span class="date"><?php $comments->dateWord(); ?></span></li>
|
||||
<?php endwhile; ?>
|
||||
<?php else: ?>
|
||||
<li><em><?php _e('暂时没有回复'); ?></em></li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="column-06 typecho-dashboard-nav prefix">
|
||||
<?php $version = Typecho_Cookie::get('__typecho_check_version'); ?>
|
||||
<?php if ($version && $version['available']): ?>
|
||||
<div class="update-check typecho-radius-topleft typecho-radius-topright typecho-radius-bottomleft typecho-radius-bottomright">
|
||||
<p class="current"><?php _e('您当前使用的版本是'); ?> <em><?php echo $version['current']; ?></em></p>
|
||||
<p class="latest">
|
||||
<a href="<?php echo $version['link']; ?>"><?php _e('官方最新版本是'); ?> <em><?php echo $version['latest']; ?></em></a>
|
||||
</p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<h3><?php _e('官方消息'); ?></h3>
|
||||
<?php $feed = Typecho_Cookie::get('__typecho_feed'); ?>
|
||||
<div id="typecho-message" class="intro-link">
|
||||
<ul>
|
||||
<?php if (empty($feed)): ?>
|
||||
<li><?php _e('读取中...'); ?></li>
|
||||
<?php else: ?>
|
||||
<?php $feed = Typecho_Json::decode($feed);
|
||||
foreach ($feed as $item): ?>
|
||||
<?php $item = (array) $item; ?>
|
||||
<li><a href="<?php echo $item['link']; ?>"><?php echo $item['title']; ?></a> - <span class="date"><?php echo $item['date']; ?></span></li>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include 'copyright.php';
|
||||
include 'common-js.php';
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function () {
|
||||
window.addEvent('domready', function() {
|
||||
<?php if (!Typecho_Cookie::get('__typecho_feed')): ?>
|
||||
var _feedRequest = new Request.JSON({url: '<?php $options->index('/action/ajax'); ?>'}).send("do=feed");
|
||||
_feedRequest.addEvent('onSuccess', function (responseJSON) {
|
||||
$(document).getElement('#typecho-message ul li').destroy();
|
||||
|
||||
if (responseJSON) {
|
||||
responseJSON.each(function (item) {
|
||||
var _li = document.createElement('li');
|
||||
$(_li).set('html', '<a target="_blank" href="' + item.link + '">' + item.title + '</a> - <span class="date">' + item.date + '</span>');
|
||||
var _ul = $(document).getElement('#typecho-message ul');
|
||||
_ul.appendChild(_li);
|
||||
});
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($user->pass('editor', true) && !Typecho_Cookie::get('__typecho_check_version')): ?>
|
||||
var _checkVersionRequest = new Request.JSON({url: '<?php $options->index('/action/ajax'); ?>'}).send("do=checkVersion");
|
||||
_checkVersionRequest.addEvent('onSuccess', function (responseJSON) {
|
||||
if (responseJSON && responseJSON.available) {
|
||||
var _div = document.createElement('div', {
|
||||
'class' : 'update-check typecho-radius-topleft typecho-radius-topright typecho-radius-bottomleft typecho-radius-bottomright',
|
||||
'html' : '<p class="current"><?php _e('您当前使用的版本是'); ?> <em>' + responseJSON.current + '</em></p>' +
|
||||
'<p class="latest"><a target="_blank" href="' + responseJSON.link + '"><?php _e('官方最新版本是'); ?> <em>' + responseJSON.latest + '</em></a></p>'
|
||||
});
|
||||
|
||||
$(_div).fade('hide');
|
||||
$(document).getElement('.start-19').insertBefore(_div, $(document).getElement('.start-19 h3'));
|
||||
$(_div).fade('in');
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
<?php include 'footer.php'; ?>
|
5023
admin/javascript/mootools.js
Normal file
53
admin/javascript/swfupload/swfupload.cookies.js
Executable file
@ -0,0 +1,53 @@
|
||||
/*
|
||||
Cookie Plug-in
|
||||
|
||||
This plug in automatically gets all the cookies for this site and adds them to the post_params.
|
||||
Cookies are loaded only on initialization. The refreshCookies function can be called to update the post_params.
|
||||
The cookies will override any other post params with the same name.
|
||||
*/
|
||||
|
||||
var SWFUpload;
|
||||
if (typeof(SWFUpload) === "function") {
|
||||
SWFUpload.prototype.initSettings = function (oldInitSettings) {
|
||||
return function () {
|
||||
if (typeof(oldInitSettings) === "function") {
|
||||
oldInitSettings.call(this);
|
||||
}
|
||||
|
||||
this.refreshCookies(false); // The false parameter must be sent since SWFUpload has not initialzed at this point
|
||||
};
|
||||
}(SWFUpload.prototype.initSettings);
|
||||
|
||||
// refreshes the post_params and updates SWFUpload. The sendToFlash parameters is optional and defaults to True
|
||||
SWFUpload.prototype.refreshCookies = function (sendToFlash) {
|
||||
if (sendToFlash === undefined) {
|
||||
sendToFlash = true;
|
||||
}
|
||||
sendToFlash = !!sendToFlash;
|
||||
|
||||
// Get the post_params object
|
||||
var postParams = this.settings.post_params;
|
||||
|
||||
// Get the cookies
|
||||
var i, cookieArray = document.cookie.split(';'), caLength = cookieArray.length, c, eqIndex, name, value;
|
||||
for (i = 0; i < caLength; i++) {
|
||||
c = cookieArray[i];
|
||||
|
||||
// Left Trim spaces
|
||||
while (c.charAt(0) === " ") {
|
||||
c = c.substring(1, c.length);
|
||||
}
|
||||
eqIndex = c.indexOf("=");
|
||||
if (eqIndex > 0) {
|
||||
name = c.substring(0, eqIndex);
|
||||
value = c.substring(eqIndex + 1);
|
||||
postParams[name] = unescape(value);
|
||||
}
|
||||
}
|
||||
|
||||
if (sendToFlash) {
|
||||
this.setPostParams(postParams);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
980
admin/javascript/swfupload/swfupload.js
Normal file
@ -0,0 +1,980 @@
|
||||
/**
|
||||
* SWFUpload: http://www.swfupload.org, http://swfupload.googlecode.com
|
||||
*
|
||||
* mmSWFUpload 1.0: Flash upload dialog - http://profandesign.se/swfupload/, http://www.vinterwebb.se/
|
||||
*
|
||||
* SWFUpload is (c) 2006-2007 Lars Huring, Olov Nilzén and Mammon Media and is released under the MIT License:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
*
|
||||
* SWFUpload 2 is (c) 2007-2008 Jake Roberts and is released under the MIT License:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* ******************* */
|
||||
/* Constructor & Init */
|
||||
/* ******************* */
|
||||
var SWFUpload;
|
||||
|
||||
if (SWFUpload == undefined) {
|
||||
SWFUpload = function (settings) {
|
||||
this.initSWFUpload(settings);
|
||||
};
|
||||
}
|
||||
|
||||
SWFUpload.prototype.initSWFUpload = function (settings) {
|
||||
try {
|
||||
this.customSettings = {}; // A container where developers can place their own settings associated with this instance.
|
||||
this.settings = settings;
|
||||
this.eventQueue = [];
|
||||
this.movieName = "SWFUpload_" + SWFUpload.movieCount++;
|
||||
this.movieElement = null;
|
||||
|
||||
|
||||
// Setup global control tracking
|
||||
SWFUpload.instances[this.movieName] = this;
|
||||
|
||||
// Load the settings. Load the Flash movie.
|
||||
this.initSettings();
|
||||
this.loadFlash();
|
||||
this.displayDebugInfo();
|
||||
} catch (ex) {
|
||||
delete SWFUpload.instances[this.movieName];
|
||||
throw ex;
|
||||
}
|
||||
};
|
||||
|
||||
/* *************** */
|
||||
/* Static Members */
|
||||
/* *************** */
|
||||
SWFUpload.instances = {};
|
||||
SWFUpload.movieCount = 0;
|
||||
SWFUpload.version = "2.2.0 2009-03-25";
|
||||
SWFUpload.QUEUE_ERROR = {
|
||||
QUEUE_LIMIT_EXCEEDED : -100,
|
||||
FILE_EXCEEDS_SIZE_LIMIT : -110,
|
||||
ZERO_BYTE_FILE : -120,
|
||||
INVALID_FILETYPE : -130
|
||||
};
|
||||
SWFUpload.UPLOAD_ERROR = {
|
||||
HTTP_ERROR : -200,
|
||||
MISSING_UPLOAD_URL : -210,
|
||||
IO_ERROR : -220,
|
||||
SECURITY_ERROR : -230,
|
||||
UPLOAD_LIMIT_EXCEEDED : -240,
|
||||
UPLOAD_FAILED : -250,
|
||||
SPECIFIED_FILE_ID_NOT_FOUND : -260,
|
||||
FILE_VALIDATION_FAILED : -270,
|
||||
FILE_CANCELLED : -280,
|
||||
UPLOAD_STOPPED : -290
|
||||
};
|
||||
SWFUpload.FILE_STATUS = {
|
||||
QUEUED : -1,
|
||||
IN_PROGRESS : -2,
|
||||
ERROR : -3,
|
||||
COMPLETE : -4,
|
||||
CANCELLED : -5
|
||||
};
|
||||
SWFUpload.BUTTON_ACTION = {
|
||||
SELECT_FILE : -100,
|
||||
SELECT_FILES : -110,
|
||||
START_UPLOAD : -120
|
||||
};
|
||||
SWFUpload.CURSOR = {
|
||||
ARROW : -1,
|
||||
HAND : -2
|
||||
};
|
||||
SWFUpload.WINDOW_MODE = {
|
||||
WINDOW : "window",
|
||||
TRANSPARENT : "transparent",
|
||||
OPAQUE : "opaque"
|
||||
};
|
||||
|
||||
// Private: takes a URL, determines if it is relative and converts to an absolute URL
|
||||
// using the current site. Only processes the URL if it can, otherwise returns the URL untouched
|
||||
SWFUpload.completeURL = function(url) {
|
||||
if (typeof(url) !== "string" || url.match(/^https?:\/\//i) || url.match(/^\//)) {
|
||||
return url;
|
||||
}
|
||||
|
||||
var currentURL = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ":" + window.location.port : "");
|
||||
|
||||
var indexSlash = window.location.pathname.lastIndexOf("/");
|
||||
if (indexSlash <= 0) {
|
||||
path = "/";
|
||||
} else {
|
||||
path = window.location.pathname.substr(0, indexSlash) + "/";
|
||||
}
|
||||
|
||||
return /*currentURL +*/ path + url;
|
||||
|
||||
};
|
||||
|
||||
|
||||
/* ******************** */
|
||||
/* Instance Members */
|
||||
/* ******************** */
|
||||
|
||||
// Private: initSettings ensures that all the
|
||||
// settings are set, getting a default value if one was not assigned.
|
||||
SWFUpload.prototype.initSettings = function () {
|
||||
this.ensureDefault = function (settingName, defaultValue) {
|
||||
this.settings[settingName] = (this.settings[settingName] == undefined) ? defaultValue : this.settings[settingName];
|
||||
};
|
||||
|
||||
// Upload backend settings
|
||||
this.ensureDefault("upload_url", "");
|
||||
this.ensureDefault("preserve_relative_urls", false);
|
||||
this.ensureDefault("file_post_name", "Filedata");
|
||||
this.ensureDefault("post_params", {});
|
||||
this.ensureDefault("use_query_string", false);
|
||||
this.ensureDefault("requeue_on_error", false);
|
||||
this.ensureDefault("http_success", []);
|
||||
this.ensureDefault("assume_success_timeout", 0);
|
||||
|
||||
// File Settings
|
||||
this.ensureDefault("file_types", "*.*");
|
||||
this.ensureDefault("file_types_description", "All Files");
|
||||
this.ensureDefault("file_size_limit", 0); // Default zero means "unlimited"
|
||||
this.ensureDefault("file_upload_limit", 0);
|
||||
this.ensureDefault("file_queue_limit", 0);
|
||||
|
||||
// Flash Settings
|
||||
this.ensureDefault("flash_url", "swfupload.swf");
|
||||
this.ensureDefault("prevent_swf_caching", true);
|
||||
|
||||
// Button Settings
|
||||
this.ensureDefault("button_image_url", "");
|
||||
this.ensureDefault("button_width", 1);
|
||||
this.ensureDefault("button_height", 1);
|
||||
this.ensureDefault("button_text", "");
|
||||
this.ensureDefault("button_text_style", "color: #000000; font-size: 16pt;");
|
||||
this.ensureDefault("button_text_top_padding", 0);
|
||||
this.ensureDefault("button_text_left_padding", 0);
|
||||
this.ensureDefault("button_action", SWFUpload.BUTTON_ACTION.SELECT_FILES);
|
||||
this.ensureDefault("button_disabled", false);
|
||||
this.ensureDefault("button_placeholder_id", "");
|
||||
this.ensureDefault("button_placeholder", null);
|
||||
this.ensureDefault("button_cursor", SWFUpload.CURSOR.ARROW);
|
||||
this.ensureDefault("button_window_mode", SWFUpload.WINDOW_MODE.WINDOW);
|
||||
|
||||
// Debug Settings
|
||||
this.ensureDefault("debug", false);
|
||||
this.settings.debug_enabled = this.settings.debug; // Here to maintain v2 API
|
||||
|
||||
// Event Handlers
|
||||
this.settings.return_upload_start_handler = this.returnUploadStart;
|
||||
this.ensureDefault("swfupload_loaded_handler", null);
|
||||
this.ensureDefault("file_dialog_start_handler", null);
|
||||
this.ensureDefault("file_queued_handler", null);
|
||||
this.ensureDefault("file_queue_error_handler", null);
|
||||
this.ensureDefault("file_dialog_complete_handler", null);
|
||||
|
||||
this.ensureDefault("upload_start_handler", null);
|
||||
this.ensureDefault("upload_progress_handler", null);
|
||||
this.ensureDefault("upload_error_handler", null);
|
||||
this.ensureDefault("upload_success_handler", null);
|
||||
this.ensureDefault("upload_complete_handler", null);
|
||||
|
||||
this.ensureDefault("debug_handler", this.debugMessage);
|
||||
|
||||
this.ensureDefault("custom_settings", {});
|
||||
|
||||
// Other settings
|
||||
this.customSettings = this.settings.custom_settings;
|
||||
|
||||
// Update the flash url if needed
|
||||
if (!!this.settings.prevent_swf_caching) {
|
||||
this.settings.flash_url = this.settings.flash_url + (this.settings.flash_url.indexOf("?") < 0 ? "?" : "&") + "preventswfcaching=" + new Date().getTime();
|
||||
}
|
||||
|
||||
if (!this.settings.preserve_relative_urls) {
|
||||
//this.settings.flash_url = SWFUpload.completeURL(this.settings.flash_url); // Don't need to do this one since flash doesn't look at it
|
||||
this.settings.upload_url = SWFUpload.completeURL(this.settings.upload_url);
|
||||
this.settings.button_image_url = SWFUpload.completeURL(this.settings.button_image_url);
|
||||
}
|
||||
|
||||
delete this.ensureDefault;
|
||||
};
|
||||
|
||||
// Private: loadFlash replaces the button_placeholder element with the flash movie.
|
||||
SWFUpload.prototype.loadFlash = function () {
|
||||
var targetElement, tempParent;
|
||||
|
||||
// Make sure an element with the ID we are going to use doesn't already exist
|
||||
if (document.getElementById(this.movieName) !== null) {
|
||||
throw "ID " + this.movieName + " is already in use. The Flash Object could not be added";
|
||||
}
|
||||
|
||||
// Get the element where we will be placing the flash movie
|
||||
targetElement = document.getElementById(this.settings.button_placeholder_id) || this.settings.button_placeholder;
|
||||
|
||||
if (targetElement == undefined) {
|
||||
throw "Could not find the placeholder element: " + this.settings.button_placeholder_id;
|
||||
}
|
||||
|
||||
// Append the container and load the flash
|
||||
tempParent = document.createElement("div");
|
||||
tempParent.innerHTML = this.getFlashHTML(); // Using innerHTML is non-standard but the only sensible way to dynamically add Flash in IE (and maybe other browsers)
|
||||
targetElement.parentNode.replaceChild(tempParent.firstChild, targetElement);
|
||||
|
||||
// Fix IE Flash/Form bug
|
||||
if (window[this.movieName] == undefined) {
|
||||
window[this.movieName] = this.getMovieElement();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// Private: getFlashHTML generates the object tag needed to embed the flash in to the document
|
||||
SWFUpload.prototype.getFlashHTML = function () {
|
||||
// Flash Satay object syntax: http://www.alistapart.com/articles/flashsatay
|
||||
return ['<object id="', this.movieName, '" type="application/x-shockwave-flash" data="', this.settings.flash_url, '" width="', this.settings.button_width, '" height="', this.settings.button_height, '" class="swfupload">',
|
||||
'<param name="wmode" value="', this.settings.button_window_mode, '" />',
|
||||
'<param name="movie" value="', this.settings.flash_url, '" />',
|
||||
'<param name="quality" value="high" />',
|
||||
'<param name="menu" value="false" />',
|
||||
'<param name="allowScriptAccess" value="always" />',
|
||||
'<param name="flashvars" value="' + this.getFlashVars() + '" />',
|
||||
'</object>'].join("");
|
||||
};
|
||||
|
||||
// Private: getFlashVars builds the parameter string that will be passed
|
||||
// to flash in the flashvars param.
|
||||
SWFUpload.prototype.getFlashVars = function () {
|
||||
// Build a string from the post param object
|
||||
var paramString = this.buildParamString();
|
||||
var httpSuccessString = this.settings.http_success.join(",");
|
||||
|
||||
// Build the parameter string
|
||||
return ["movieName=", encodeURIComponent(this.movieName),
|
||||
"&uploadURL=", encodeURIComponent(this.settings.upload_url),
|
||||
"&useQueryString=", encodeURIComponent(this.settings.use_query_string),
|
||||
"&requeueOnError=", encodeURIComponent(this.settings.requeue_on_error),
|
||||
"&httpSuccess=", encodeURIComponent(httpSuccessString),
|
||||
"&assumeSuccessTimeout=", encodeURIComponent(this.settings.assume_success_timeout),
|
||||
"&params=", encodeURIComponent(paramString),
|
||||
"&filePostName=", encodeURIComponent(this.settings.file_post_name),
|
||||
"&fileTypes=", encodeURIComponent(this.settings.file_types),
|
||||
"&fileTypesDescription=", encodeURIComponent(this.settings.file_types_description),
|
||||
"&fileSizeLimit=", encodeURIComponent(this.settings.file_size_limit),
|
||||
"&fileUploadLimit=", encodeURIComponent(this.settings.file_upload_limit),
|
||||
"&fileQueueLimit=", encodeURIComponent(this.settings.file_queue_limit),
|
||||
"&debugEnabled=", encodeURIComponent(this.settings.debug_enabled),
|
||||
"&buttonImageURL=", encodeURIComponent(this.settings.button_image_url),
|
||||
"&buttonWidth=", encodeURIComponent(this.settings.button_width),
|
||||
"&buttonHeight=", encodeURIComponent(this.settings.button_height),
|
||||
"&buttonText=", encodeURIComponent(this.settings.button_text),
|
||||
"&buttonTextTopPadding=", encodeURIComponent(this.settings.button_text_top_padding),
|
||||
"&buttonTextLeftPadding=", encodeURIComponent(this.settings.button_text_left_padding),
|
||||
"&buttonTextStyle=", encodeURIComponent(this.settings.button_text_style),
|
||||
"&buttonAction=", encodeURIComponent(this.settings.button_action),
|
||||
"&buttonDisabled=", encodeURIComponent(this.settings.button_disabled),
|
||||
"&buttonCursor=", encodeURIComponent(this.settings.button_cursor)
|
||||
].join("");
|
||||
};
|
||||
|
||||
// Public: getMovieElement retrieves the DOM reference to the Flash element added by SWFUpload
|
||||
// The element is cached after the first lookup
|
||||
SWFUpload.prototype.getMovieElement = function () {
|
||||
if (this.movieElement == undefined) {
|
||||
this.movieElement = document.getElementById(this.movieName);
|
||||
}
|
||||
|
||||
if (this.movieElement === null) {
|
||||
throw "Could not find Flash element";
|
||||
}
|
||||
|
||||
return this.movieElement;
|
||||
};
|
||||
|
||||
// Private: buildParamString takes the name/value pairs in the post_params setting object
|
||||
// and joins them up in to a string formatted "name=value&name=value"
|
||||
SWFUpload.prototype.buildParamString = function () {
|
||||
var postParams = this.settings.post_params;
|
||||
var paramStringPairs = [];
|
||||
|
||||
if (typeof(postParams) === "object") {
|
||||
for (var name in postParams) {
|
||||
if (postParams.hasOwnProperty(name)) {
|
||||
paramStringPairs.push(encodeURIComponent(name.toString()) + "=" + encodeURIComponent(postParams[name].toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return paramStringPairs.join("&");
|
||||
};
|
||||
|
||||
// Public: Used to remove a SWFUpload instance from the page. This method strives to remove
|
||||
// all references to the SWF, and other objects so memory is properly freed.
|
||||
// Returns true if everything was destroyed. Returns a false if a failure occurs leaving SWFUpload in an inconsistant state.
|
||||
// Credits: Major improvements provided by steffen
|
||||
SWFUpload.prototype.destroy = function () {
|
||||
try {
|
||||
// Make sure Flash is done before we try to remove it
|
||||
this.cancelUpload(null, false);
|
||||
|
||||
|
||||
// Remove the SWFUpload DOM nodes
|
||||
var movieElement = null;
|
||||
movieElement = this.getMovieElement();
|
||||
|
||||
if (movieElement && typeof(movieElement.CallFunction) === "unknown") { // We only want to do this in IE
|
||||
// Loop through all the movie's properties and remove all function references (DOM/JS IE 6/7 memory leak workaround)
|
||||
for (var i in movieElement) {
|
||||
try {
|
||||
if (typeof(movieElement[i]) === "function") {
|
||||
movieElement[i] = null;
|
||||
}
|
||||
} catch (ex1) {}
|
||||
}
|
||||
|
||||
// Remove the Movie Element from the page
|
||||
try {
|
||||
movieElement.parentNode.removeChild(movieElement);
|
||||
} catch (ex) {}
|
||||
}
|
||||
|
||||
// Remove IE form fix reference
|
||||
window[this.movieName] = null;
|
||||
|
||||
// Destroy other references
|
||||
SWFUpload.instances[this.movieName] = null;
|
||||
delete SWFUpload.instances[this.movieName];
|
||||
|
||||
this.movieElement = null;
|
||||
this.settings = null;
|
||||
this.customSettings = null;
|
||||
this.eventQueue = null;
|
||||
this.movieName = null;
|
||||
|
||||
|
||||
return true;
|
||||
} catch (ex2) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Public: displayDebugInfo prints out settings and configuration
|
||||
// information about this SWFUpload instance.
|
||||
// This function (and any references to it) can be deleted when placing
|
||||
// SWFUpload in production.
|
||||
SWFUpload.prototype.displayDebugInfo = function () {
|
||||
this.debug(
|
||||
[
|
||||
"---SWFUpload Instance Info---\n",
|
||||
"Version: ", SWFUpload.version, "\n",
|
||||
"Movie Name: ", this.movieName, "\n",
|
||||
"Settings:\n",
|
||||
"\t", "upload_url: ", this.settings.upload_url, "\n",
|
||||
"\t", "flash_url: ", this.settings.flash_url, "\n",
|
||||
"\t", "use_query_string: ", this.settings.use_query_string.toString(), "\n",
|
||||
"\t", "requeue_on_error: ", this.settings.requeue_on_error.toString(), "\n",
|
||||
"\t", "http_success: ", this.settings.http_success.join(", "), "\n",
|
||||
"\t", "assume_success_timeout: ", this.settings.assume_success_timeout, "\n",
|
||||
"\t", "file_post_name: ", this.settings.file_post_name, "\n",
|
||||
"\t", "post_params: ", this.settings.post_params.toString(), "\n",
|
||||
"\t", "file_types: ", this.settings.file_types, "\n",
|
||||
"\t", "file_types_description: ", this.settings.file_types_description, "\n",
|
||||
"\t", "file_size_limit: ", this.settings.file_size_limit, "\n",
|
||||
"\t", "file_upload_limit: ", this.settings.file_upload_limit, "\n",
|
||||
"\t", "file_queue_limit: ", this.settings.file_queue_limit, "\n",
|
||||
"\t", "debug: ", this.settings.debug.toString(), "\n",
|
||||
|
||||
"\t", "prevent_swf_caching: ", this.settings.prevent_swf_caching.toString(), "\n",
|
||||
|
||||
"\t", "button_placeholder_id: ", this.settings.button_placeholder_id.toString(), "\n",
|
||||
"\t", "button_placeholder: ", (this.settings.button_placeholder ? "Set" : "Not Set"), "\n",
|
||||
"\t", "button_image_url: ", this.settings.button_image_url.toString(), "\n",
|
||||
"\t", "button_width: ", this.settings.button_width.toString(), "\n",
|
||||
"\t", "button_height: ", this.settings.button_height.toString(), "\n",
|
||||
"\t", "button_text: ", this.settings.button_text.toString(), "\n",
|
||||
"\t", "button_text_style: ", this.settings.button_text_style.toString(), "\n",
|
||||
"\t", "button_text_top_padding: ", this.settings.button_text_top_padding.toString(), "\n",
|
||||
"\t", "button_text_left_padding: ", this.settings.button_text_left_padding.toString(), "\n",
|
||||
"\t", "button_action: ", this.settings.button_action.toString(), "\n",
|
||||
"\t", "button_disabled: ", this.settings.button_disabled.toString(), "\n",
|
||||
|
||||
"\t", "custom_settings: ", this.settings.custom_settings.toString(), "\n",
|
||||
"Event Handlers:\n",
|
||||
"\t", "swfupload_loaded_handler assigned: ", (typeof this.settings.swfupload_loaded_handler === "function").toString(), "\n",
|
||||
"\t", "file_dialog_start_handler assigned: ", (typeof this.settings.file_dialog_start_handler === "function").toString(), "\n",
|
||||
"\t", "file_queued_handler assigned: ", (typeof this.settings.file_queued_handler === "function").toString(), "\n",
|
||||
"\t", "file_queue_error_handler assigned: ", (typeof this.settings.file_queue_error_handler === "function").toString(), "\n",
|
||||
"\t", "upload_start_handler assigned: ", (typeof this.settings.upload_start_handler === "function").toString(), "\n",
|
||||
"\t", "upload_progress_handler assigned: ", (typeof this.settings.upload_progress_handler === "function").toString(), "\n",
|
||||
"\t", "upload_error_handler assigned: ", (typeof this.settings.upload_error_handler === "function").toString(), "\n",
|
||||
"\t", "upload_success_handler assigned: ", (typeof this.settings.upload_success_handler === "function").toString(), "\n",
|
||||
"\t", "upload_complete_handler assigned: ", (typeof this.settings.upload_complete_handler === "function").toString(), "\n",
|
||||
"\t", "debug_handler assigned: ", (typeof this.settings.debug_handler === "function").toString(), "\n"
|
||||
].join("")
|
||||
);
|
||||
};
|
||||
|
||||
/* Note: addSetting and getSetting are no longer used by SWFUpload but are included
|
||||
the maintain v2 API compatibility
|
||||
*/
|
||||
// Public: (Deprecated) addSetting adds a setting value. If the value given is undefined or null then the default_value is used.
|
||||
SWFUpload.prototype.addSetting = function (name, value, default_value) {
|
||||
if (value == undefined) {
|
||||
return (this.settings[name] = default_value);
|
||||
} else {
|
||||
return (this.settings[name] = value);
|
||||
}
|
||||
};
|
||||
|
||||
// Public: (Deprecated) getSetting gets a setting. Returns an empty string if the setting was not found.
|
||||
SWFUpload.prototype.getSetting = function (name) {
|
||||
if (this.settings[name] != undefined) {
|
||||
return this.settings[name];
|
||||
}
|
||||
|
||||
return "";
|
||||
};
|
||||
|
||||
|
||||
|
||||
// Private: callFlash handles function calls made to the Flash element.
|
||||
// Calls are made with a setTimeout for some functions to work around
|
||||
// bugs in the ExternalInterface library.
|
||||
SWFUpload.prototype.callFlash = function (functionName, argumentArray) {
|
||||
argumentArray = argumentArray || [];
|
||||
|
||||
var movieElement = this.getMovieElement();
|
||||
var returnValue, returnString;
|
||||
|
||||
// Flash's method if calling ExternalInterface methods (code adapted from MooTools).
|
||||
try {
|
||||
returnString = movieElement.CallFunction('<invoke name="' + functionName + '" returntype="javascript">' + __flash__argumentsToXML(argumentArray, 0) + '</invoke>');
|
||||
returnValue = eval(returnString);
|
||||
} catch (ex) {
|
||||
throw "Call to " + functionName + " failed";
|
||||
}
|
||||
|
||||
// Unescape file post param values
|
||||
if (returnValue != undefined && typeof returnValue.post === "object") {
|
||||
returnValue = this.unescapeFilePostParams(returnValue);
|
||||
}
|
||||
|
||||
return returnValue;
|
||||
};
|
||||
|
||||
/* *****************************
|
||||
-- Flash control methods --
|
||||
Your UI should use these
|
||||
to operate SWFUpload
|
||||
***************************** */
|
||||
|
||||
// WARNING: this function does not work in Flash Player 10
|
||||
// Public: selectFile causes a File Selection Dialog window to appear. This
|
||||
// dialog only allows 1 file to be selected.
|
||||
SWFUpload.prototype.selectFile = function () {
|
||||
this.callFlash("SelectFile");
|
||||
};
|
||||
|
||||
// WARNING: this function does not work in Flash Player 10
|
||||
// Public: selectFiles causes a File Selection Dialog window to appear/ This
|
||||
// dialog allows the user to select any number of files
|
||||
// Flash Bug Warning: Flash limits the number of selectable files based on the combined length of the file names.
|
||||
// If the selection name length is too long the dialog will fail in an unpredictable manner. There is no work-around
|
||||
// for this bug.
|
||||
SWFUpload.prototype.selectFiles = function () {
|
||||
this.callFlash("SelectFiles");
|
||||
};
|
||||
|
||||
|
||||
// Public: startUpload starts uploading the first file in the queue unless
|
||||
// the optional parameter 'fileID' specifies the ID
|
||||
SWFUpload.prototype.startUpload = function (fileID) {
|
||||
this.callFlash("StartUpload", [fileID]);
|
||||
};
|
||||
|
||||
// Public: cancelUpload cancels any queued file. The fileID parameter may be the file ID or index.
|
||||
// If you do not specify a fileID the current uploading file or first file in the queue is cancelled.
|
||||
// If you do not want the uploadError event to trigger you can specify false for the triggerErrorEvent parameter.
|
||||
SWFUpload.prototype.cancelUpload = function (fileID, triggerErrorEvent) {
|
||||
if (triggerErrorEvent !== false) {
|
||||
triggerErrorEvent = true;
|
||||
}
|
||||
this.callFlash("CancelUpload", [fileID, triggerErrorEvent]);
|
||||
};
|
||||
|
||||
// Public: stopUpload stops the current upload and requeues the file at the beginning of the queue.
|
||||
// If nothing is currently uploading then nothing happens.
|
||||
SWFUpload.prototype.stopUpload = function () {
|
||||
this.callFlash("StopUpload");
|
||||
};
|
||||
|
||||
/* ************************
|
||||
* Settings methods
|
||||
* These methods change the SWFUpload settings.
|
||||
* SWFUpload settings should not be changed directly on the settings object
|
||||
* since many of the settings need to be passed to Flash in order to take
|
||||
* effect.
|
||||
* *********************** */
|
||||
|
||||
// Public: getStats gets the file statistics object.
|
||||
SWFUpload.prototype.getStats = function () {
|
||||
return this.callFlash("GetStats");
|
||||
};
|
||||
|
||||
// Public: setStats changes the SWFUpload statistics. You shouldn't need to
|
||||
// change the statistics but you can. Changing the statistics does not
|
||||
// affect SWFUpload accept for the successful_uploads count which is used
|
||||
// by the upload_limit setting to determine how many files the user may upload.
|
||||
SWFUpload.prototype.setStats = function (statsObject) {
|
||||
this.callFlash("SetStats", [statsObject]);
|
||||
};
|
||||
|
||||
// Public: getFile retrieves a File object by ID or Index. If the file is
|
||||
// not found then 'null' is returned.
|
||||
SWFUpload.prototype.getFile = function (fileID) {
|
||||
if (typeof(fileID) === "number") {
|
||||
return this.callFlash("GetFileByIndex", [fileID]);
|
||||
} else {
|
||||
return this.callFlash("GetFile", [fileID]);
|
||||
}
|
||||
};
|
||||
|
||||
// Public: addFileParam sets a name/value pair that will be posted with the
|
||||
// file specified by the Files ID. If the name already exists then the
|
||||
// exiting value will be overwritten.
|
||||
SWFUpload.prototype.addFileParam = function (fileID, name, value) {
|
||||
return this.callFlash("AddFileParam", [fileID, name, value]);
|
||||
};
|
||||
|
||||
// Public: removeFileParam removes a previously set (by addFileParam) name/value
|
||||
// pair from the specified file.
|
||||
SWFUpload.prototype.removeFileParam = function (fileID, name) {
|
||||
this.callFlash("RemoveFileParam", [fileID, name]);
|
||||
};
|
||||
|
||||
// Public: setUploadUrl changes the upload_url setting.
|
||||
SWFUpload.prototype.setUploadURL = function (url) {
|
||||
this.settings.upload_url = url.toString();
|
||||
this.callFlash("SetUploadURL", [url]);
|
||||
};
|
||||
|
||||
// Public: setPostParams changes the post_params setting
|
||||
SWFUpload.prototype.setPostParams = function (paramsObject) {
|
||||
this.settings.post_params = paramsObject;
|
||||
this.callFlash("SetPostParams", [paramsObject]);
|
||||
};
|
||||
|
||||
// Public: addPostParam adds post name/value pair. Each name can have only one value.
|
||||
SWFUpload.prototype.addPostParam = function (name, value) {
|
||||
this.settings.post_params[name] = value;
|
||||
this.callFlash("SetPostParams", [this.settings.post_params]);
|
||||
};
|
||||
|
||||
// Public: removePostParam deletes post name/value pair.
|
||||
SWFUpload.prototype.removePostParam = function (name) {
|
||||
delete this.settings.post_params[name];
|
||||
this.callFlash("SetPostParams", [this.settings.post_params]);
|
||||
};
|
||||
|
||||
// Public: setFileTypes changes the file_types setting and the file_types_description setting
|
||||
SWFUpload.prototype.setFileTypes = function (types, description) {
|
||||
this.settings.file_types = types;
|
||||
this.settings.file_types_description = description;
|
||||
this.callFlash("SetFileTypes", [types, description]);
|
||||
};
|
||||
|
||||
// Public: setFileSizeLimit changes the file_size_limit setting
|
||||
SWFUpload.prototype.setFileSizeLimit = function (fileSizeLimit) {
|
||||
this.settings.file_size_limit = fileSizeLimit;
|
||||
this.callFlash("SetFileSizeLimit", [fileSizeLimit]);
|
||||
};
|
||||
|
||||
// Public: setFileUploadLimit changes the file_upload_limit setting
|
||||
SWFUpload.prototype.setFileUploadLimit = function (fileUploadLimit) {
|
||||
this.settings.file_upload_limit = fileUploadLimit;
|
||||
this.callFlash("SetFileUploadLimit", [fileUploadLimit]);
|
||||
};
|
||||
|
||||
// Public: setFileQueueLimit changes the file_queue_limit setting
|
||||
SWFUpload.prototype.setFileQueueLimit = function (fileQueueLimit) {
|
||||
this.settings.file_queue_limit = fileQueueLimit;
|
||||
this.callFlash("SetFileQueueLimit", [fileQueueLimit]);
|
||||
};
|
||||
|
||||
// Public: setFilePostName changes the file_post_name setting
|
||||
SWFUpload.prototype.setFilePostName = function (filePostName) {
|
||||
this.settings.file_post_name = filePostName;
|
||||
this.callFlash("SetFilePostName", [filePostName]);
|
||||
};
|
||||
|
||||
// Public: setUseQueryString changes the use_query_string setting
|
||||
SWFUpload.prototype.setUseQueryString = function (useQueryString) {
|
||||
this.settings.use_query_string = useQueryString;
|
||||
this.callFlash("SetUseQueryString", [useQueryString]);
|
||||
};
|
||||
|
||||
// Public: setRequeueOnError changes the requeue_on_error setting
|
||||
SWFUpload.prototype.setRequeueOnError = function (requeueOnError) {
|
||||
this.settings.requeue_on_error = requeueOnError;
|
||||
this.callFlash("SetRequeueOnError", [requeueOnError]);
|
||||
};
|
||||
|
||||
// Public: setHTTPSuccess changes the http_success setting
|
||||
SWFUpload.prototype.setHTTPSuccess = function (http_status_codes) {
|
||||
if (typeof http_status_codes === "string") {
|
||||
http_status_codes = http_status_codes.replace(" ", "").split(",");
|
||||
}
|
||||
|
||||
this.settings.http_success = http_status_codes;
|
||||
this.callFlash("SetHTTPSuccess", [http_status_codes]);
|
||||
};
|
||||
|
||||
// Public: setHTTPSuccess changes the http_success setting
|
||||
SWFUpload.prototype.setAssumeSuccessTimeout = function (timeout_seconds) {
|
||||
this.settings.assume_success_timeout = timeout_seconds;
|
||||
this.callFlash("SetAssumeSuccessTimeout", [timeout_seconds]);
|
||||
};
|
||||
|
||||
// Public: setDebugEnabled changes the debug_enabled setting
|
||||
SWFUpload.prototype.setDebugEnabled = function (debugEnabled) {
|
||||
this.settings.debug_enabled = debugEnabled;
|
||||
this.callFlash("SetDebugEnabled", [debugEnabled]);
|
||||
};
|
||||
|
||||
// Public: setButtonImageURL loads a button image sprite
|
||||
SWFUpload.prototype.setButtonImageURL = function (buttonImageURL) {
|
||||
if (buttonImageURL == undefined) {
|
||||
buttonImageURL = "";
|
||||
}
|
||||
|
||||
this.settings.button_image_url = buttonImageURL;
|
||||
this.callFlash("SetButtonImageURL", [buttonImageURL]);
|
||||
};
|
||||
|
||||
// Public: setButtonDimensions resizes the Flash Movie and button
|
||||
SWFUpload.prototype.setButtonDimensions = function (width, height) {
|
||||
this.settings.button_width = width;
|
||||
this.settings.button_height = height;
|
||||
|
||||
var movie = this.getMovieElement();
|
||||
if (movie != undefined) {
|
||||
movie.style.width = width + "px";
|
||||
movie.style.height = height + "px";
|
||||
}
|
||||
|
||||
this.callFlash("SetButtonDimensions", [width, height]);
|
||||
};
|
||||
// Public: setButtonText Changes the text overlaid on the button
|
||||
SWFUpload.prototype.setButtonText = function (html) {
|
||||
this.settings.button_text = html;
|
||||
this.callFlash("SetButtonText", [html]);
|
||||
};
|
||||
// Public: setButtonTextPadding changes the top and left padding of the text overlay
|
||||
SWFUpload.prototype.setButtonTextPadding = function (left, top) {
|
||||
this.settings.button_text_top_padding = top;
|
||||
this.settings.button_text_left_padding = left;
|
||||
this.callFlash("SetButtonTextPadding", [left, top]);
|
||||
};
|
||||
|
||||
// Public: setButtonTextStyle changes the CSS used to style the HTML/Text overlaid on the button
|
||||
SWFUpload.prototype.setButtonTextStyle = function (css) {
|
||||
this.settings.button_text_style = css;
|
||||
this.callFlash("SetButtonTextStyle", [css]);
|
||||
};
|
||||
// Public: setButtonDisabled disables/enables the button
|
||||
SWFUpload.prototype.setButtonDisabled = function (isDisabled) {
|
||||
this.settings.button_disabled = isDisabled;
|
||||
this.callFlash("SetButtonDisabled", [isDisabled]);
|
||||
};
|
||||
// Public: setButtonAction sets the action that occurs when the button is clicked
|
||||
SWFUpload.prototype.setButtonAction = function (buttonAction) {
|
||||
this.settings.button_action = buttonAction;
|
||||
this.callFlash("SetButtonAction", [buttonAction]);
|
||||
};
|
||||
|
||||
// Public: setButtonCursor changes the mouse cursor displayed when hovering over the button
|
||||
SWFUpload.prototype.setButtonCursor = function (cursor) {
|
||||
this.settings.button_cursor = cursor;
|
||||
this.callFlash("SetButtonCursor", [cursor]);
|
||||
};
|
||||
|
||||
/* *******************************
|
||||
Flash Event Interfaces
|
||||
These functions are used by Flash to trigger the various
|
||||
events.
|
||||
|
||||
All these functions a Private.
|
||||
|
||||
Because the ExternalInterface library is buggy the event calls
|
||||
are added to a queue and the queue then executed by a setTimeout.
|
||||
This ensures that events are executed in a determinate order and that
|
||||
the ExternalInterface bugs are avoided.
|
||||
******************************* */
|
||||
|
||||
SWFUpload.prototype.queueEvent = function (handlerName, argumentArray) {
|
||||
// Warning: Don't call this.debug inside here or you'll create an infinite loop
|
||||
|
||||
if (argumentArray == undefined) {
|
||||
argumentArray = [];
|
||||
} else if (!(argumentArray instanceof Array)) {
|
||||
argumentArray = [argumentArray];
|
||||
}
|
||||
|
||||
var self = this;
|
||||
if (typeof this.settings[handlerName] === "function") {
|
||||
// Queue the event
|
||||
this.eventQueue.push(function () {
|
||||
this.settings[handlerName].apply(this, argumentArray);
|
||||
});
|
||||
|
||||
// Execute the next queued event
|
||||
setTimeout(function () {
|
||||
self.executeNextEvent();
|
||||
}, 0);
|
||||
|
||||
} else if (this.settings[handlerName] !== null) {
|
||||
throw "Event handler " + handlerName + " is unknown or is not a function";
|
||||
}
|
||||
};
|
||||
|
||||
// Private: Causes the next event in the queue to be executed. Since events are queued using a setTimeout
|
||||
// we must queue them in order to garentee that they are executed in order.
|
||||
SWFUpload.prototype.executeNextEvent = function () {
|
||||
// Warning: Don't call this.debug inside here or you'll create an infinite loop
|
||||
|
||||
var f = this.eventQueue ? this.eventQueue.shift() : null;
|
||||
if (typeof(f) === "function") {
|
||||
f.apply(this);
|
||||
}
|
||||
};
|
||||
|
||||
// Private: unescapeFileParams is part of a workaround for a flash bug where objects passed through ExternalInterface cannot have
|
||||
// properties that contain characters that are not valid for JavaScript identifiers. To work around this
|
||||
// the Flash Component escapes the parameter names and we must unescape again before passing them along.
|
||||
SWFUpload.prototype.unescapeFilePostParams = function (file) {
|
||||
var reg = /[$]([0-9a-f]{4})/i;
|
||||
var unescapedPost = {};
|
||||
var uk;
|
||||
|
||||
if (file != undefined) {
|
||||
for (var k in file.post) {
|
||||
if (file.post.hasOwnProperty(k)) {
|
||||
uk = k;
|
||||
var match;
|
||||
while ((match = reg.exec(uk)) !== null) {
|
||||
uk = uk.replace(match[0], String.fromCharCode(parseInt("0x" + match[1], 16)));
|
||||
}
|
||||
unescapedPost[uk] = file.post[k];
|
||||
}
|
||||
}
|
||||
|
||||
file.post = unescapedPost;
|
||||
}
|
||||
|
||||
return file;
|
||||
};
|
||||
|
||||
// Private: Called by Flash to see if JS can call in to Flash (test if External Interface is working)
|
||||
SWFUpload.prototype.testExternalInterface = function () {
|
||||
try {
|
||||
return this.callFlash("TestExternalInterface");
|
||||
} catch (ex) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
// Private: This event is called by Flash when it has finished loading. Don't modify this.
|
||||
// Use the swfupload_loaded_handler event setting to execute custom code when SWFUpload has loaded.
|
||||
SWFUpload.prototype.flashReady = function () {
|
||||
// Check that the movie element is loaded correctly with its ExternalInterface methods defined
|
||||
var movieElement = this.getMovieElement();
|
||||
|
||||
if (!movieElement) {
|
||||
this.debug("Flash called back ready but the flash movie can't be found.");
|
||||
return;
|
||||
}
|
||||
|
||||
this.cleanUp(movieElement);
|
||||
|
||||
this.queueEvent("swfupload_loaded_handler");
|
||||
};
|
||||
|
||||
// Private: removes Flash added fuctions to the DOM node to prevent memory leaks in IE.
|
||||
// This function is called by Flash each time the ExternalInterface functions are created.
|
||||
SWFUpload.prototype.cleanUp = function (movieElement) {
|
||||
// Pro-actively unhook all the Flash functions
|
||||
try {
|
||||
if (this.movieElement && typeof(movieElement.CallFunction) === "unknown") { // We only want to do this in IE
|
||||
this.debug("Removing Flash functions hooks (this should only run in IE and should prevent memory leaks)");
|
||||
for (var key in movieElement) {
|
||||
try {
|
||||
if (typeof(movieElement[key]) === "function") {
|
||||
movieElement[key] = null;
|
||||
}
|
||||
} catch (ex) {
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (ex1) {
|
||||
|
||||
}
|
||||
|
||||
// Fix Flashes own cleanup code so if the SWFMovie was removed from the page
|
||||
// it doesn't display errors.
|
||||
window["__flash__removeCallback"] = function (instance, name) {
|
||||
try {
|
||||
if (instance) {
|
||||
instance[name] = null;
|
||||
}
|
||||
} catch (flashEx) {
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
||||
/* This is a chance to do something before the browse window opens */
|
||||
SWFUpload.prototype.fileDialogStart = function () {
|
||||
this.queueEvent("file_dialog_start_handler");
|
||||
};
|
||||
|
||||
|
||||
/* Called when a file is successfully added to the queue. */
|
||||
SWFUpload.prototype.fileQueued = function (file) {
|
||||
file = this.unescapeFilePostParams(file);
|
||||
this.queueEvent("file_queued_handler", file);
|
||||
};
|
||||
|
||||
|
||||
/* Handle errors that occur when an attempt to queue a file fails. */
|
||||
SWFUpload.prototype.fileQueueError = function (file, errorCode, message) {
|
||||
file = this.unescapeFilePostParams(file);
|
||||
this.queueEvent("file_queue_error_handler", [file, errorCode, message]);
|
||||
};
|
||||
|
||||
/* Called after the file dialog has closed and the selected files have been queued.
|
||||
You could call startUpload here if you want the queued files to begin uploading immediately. */
|
||||
SWFUpload.prototype.fileDialogComplete = function (numFilesSelected, numFilesQueued, numFilesInQueue) {
|
||||
this.queueEvent("file_dialog_complete_handler", [numFilesSelected, numFilesQueued, numFilesInQueue]);
|
||||
};
|
||||
|
||||
SWFUpload.prototype.uploadStart = function (file) {
|
||||
file = this.unescapeFilePostParams(file);
|
||||
this.queueEvent("return_upload_start_handler", file);
|
||||
};
|
||||
|
||||
SWFUpload.prototype.returnUploadStart = function (file) {
|
||||
var returnValue;
|
||||
if (typeof this.settings.upload_start_handler === "function") {
|
||||
file = this.unescapeFilePostParams(file);
|
||||
returnValue = this.settings.upload_start_handler.call(this, file);
|
||||
} else if (this.settings.upload_start_handler != undefined) {
|
||||
throw "upload_start_handler must be a function";
|
||||
}
|
||||
|
||||
// Convert undefined to true so if nothing is returned from the upload_start_handler it is
|
||||
// interpretted as 'true'.
|
||||
if (returnValue === undefined) {
|
||||
returnValue = true;
|
||||
}
|
||||
|
||||
returnValue = !!returnValue;
|
||||
|
||||
this.callFlash("ReturnUploadStart", [returnValue]);
|
||||
};
|
||||
|
||||
|
||||
|
||||
SWFUpload.prototype.uploadProgress = function (file, bytesComplete, bytesTotal) {
|
||||
file = this.unescapeFilePostParams(file);
|
||||
this.queueEvent("upload_progress_handler", [file, bytesComplete, bytesTotal]);
|
||||
};
|
||||
|
||||
SWFUpload.prototype.uploadError = function (file, errorCode, message) {
|
||||
file = this.unescapeFilePostParams(file);
|
||||
this.queueEvent("upload_error_handler", [file, errorCode, message]);
|
||||
};
|
||||
|
||||
SWFUpload.prototype.uploadSuccess = function (file, serverData, responseReceived) {
|
||||
file = this.unescapeFilePostParams(file);
|
||||
this.queueEvent("upload_success_handler", [file, serverData, responseReceived]);
|
||||
};
|
||||
|
||||
SWFUpload.prototype.uploadComplete = function (file) {
|
||||
file = this.unescapeFilePostParams(file);
|
||||
this.queueEvent("upload_complete_handler", file);
|
||||
};
|
||||
|
||||
/* Called by SWFUpload JavaScript and Flash functions when debug is enabled. By default it writes messages to the
|
||||
internal debug console. You can override this event and have messages written where you want. */
|
||||
SWFUpload.prototype.debug = function (message) {
|
||||
this.queueEvent("debug_handler", message);
|
||||
};
|
||||
|
||||
|
||||
/* **********************************
|
||||
Debug Console
|
||||
The debug console is a self contained, in page location
|
||||
for debug message to be sent. The Debug Console adds
|
||||
itself to the body if necessary.
|
||||
|
||||
The console is automatically scrolled as messages appear.
|
||||
|
||||
If you are using your own debug handler or when you deploy to production and
|
||||
have debug disabled you can remove these functions to reduce the file size
|
||||
and complexity.
|
||||
********************************** */
|
||||
|
||||
// Private: debugMessage is the default debug_handler. If you want to print debug messages
|
||||
// call the debug() function. When overriding the function your own function should
|
||||
// check to see if the debug setting is true before outputting debug information.
|
||||
SWFUpload.prototype.debugMessage = function (message) {
|
||||
if (this.settings.debug) {
|
||||
var exceptionMessage, exceptionValues = [];
|
||||
|
||||
// Check for an exception object and print it nicely
|
||||
if (typeof message === "object" && typeof message.name === "string" && typeof message.message === "string") {
|
||||
for (var key in message) {
|
||||
if (message.hasOwnProperty(key)) {
|
||||
exceptionValues.push(key + ": " + message[key]);
|
||||
}
|
||||
}
|
||||
exceptionMessage = exceptionValues.join("\n") || "";
|
||||
exceptionValues = exceptionMessage.split("\n");
|
||||
exceptionMessage = "EXCEPTION: " + exceptionValues.join("\nEXCEPTION: ");
|
||||
SWFUpload.Console.writeLine(exceptionMessage);
|
||||
} else {
|
||||
SWFUpload.Console.writeLine(message);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
SWFUpload.Console = {};
|
||||
SWFUpload.Console.writeLine = function (message) {
|
||||
var console, documentForm;
|
||||
|
||||
try {
|
||||
console = document.getElementById("SWFUpload_Console");
|
||||
|
||||
if (!console) {
|
||||
documentForm = document.createElement("form");
|
||||
document.getElementsByTagName("body")[0].appendChild(documentForm);
|
||||
|
||||
console = document.createElement("textarea");
|
||||
console.id = "SWFUpload_Console";
|
||||
console.style.fontFamily = "monospace";
|
||||
console.setAttribute("wrap", "off");
|
||||
console.wrap = "off";
|
||||
console.style.overflow = "auto";
|
||||
console.style.width = "700px";
|
||||
console.style.height = "350px";
|
||||
console.style.margin = "5px";
|
||||
documentForm.appendChild(console);
|
||||
}
|
||||
|
||||
console.value += message + "\n";
|
||||
|
||||
console.scrollTop = console.scrollHeight - console.clientHeight;
|
||||
} catch (ex) {
|
||||
alert("Exception: " + ex.name + " Message: " + ex.message);
|
||||
}
|
||||
};
|
98
admin/javascript/swfupload/swfupload.queue.js
Normal file
@ -0,0 +1,98 @@
|
||||
/*
|
||||
Queue Plug-in
|
||||
|
||||
Features:
|
||||
*Adds a cancelQueue() method for cancelling the entire queue.
|
||||
*All queued files are uploaded when startUpload() is called.
|
||||
*If false is returned from uploadComplete then the queue upload is stopped.
|
||||
If false is not returned (strict comparison) then the queue upload is continued.
|
||||
*Adds a QueueComplete event that is fired when all the queued files have finished uploading.
|
||||
Set the event handler with the queue_complete_handler setting.
|
||||
|
||||
*/
|
||||
|
||||
var SWFUpload;
|
||||
if (typeof(SWFUpload) === "function") {
|
||||
SWFUpload.queue = {};
|
||||
|
||||
SWFUpload.prototype.initSettings = (function (oldInitSettings) {
|
||||
return function () {
|
||||
if (typeof(oldInitSettings) === "function") {
|
||||
oldInitSettings.call(this);
|
||||
}
|
||||
|
||||
this.queueSettings = {};
|
||||
|
||||
this.queueSettings.queue_cancelled_flag = false;
|
||||
this.queueSettings.queue_upload_count = 0;
|
||||
|
||||
this.queueSettings.user_upload_complete_handler = this.settings.upload_complete_handler;
|
||||
this.queueSettings.user_upload_start_handler = this.settings.upload_start_handler;
|
||||
this.settings.upload_complete_handler = SWFUpload.queue.uploadCompleteHandler;
|
||||
this.settings.upload_start_handler = SWFUpload.queue.uploadStartHandler;
|
||||
|
||||
this.settings.queue_complete_handler = this.settings.queue_complete_handler || null;
|
||||
};
|
||||
})(SWFUpload.prototype.initSettings);
|
||||
|
||||
SWFUpload.prototype.startUpload = function (fileID) {
|
||||
this.queueSettings.queue_cancelled_flag = false;
|
||||
this.callFlash("StartUpload", [fileID]);
|
||||
};
|
||||
|
||||
SWFUpload.prototype.cancelQueue = function () {
|
||||
this.queueSettings.queue_cancelled_flag = true;
|
||||
this.stopUpload();
|
||||
|
||||
var stats = this.getStats();
|
||||
while (stats.files_queued > 0) {
|
||||
this.cancelUpload();
|
||||
stats = this.getStats();
|
||||
}
|
||||
};
|
||||
|
||||
SWFUpload.queue.uploadStartHandler = function (file) {
|
||||
var returnValue;
|
||||
if (typeof(this.queueSettings.user_upload_start_handler) === "function") {
|
||||
returnValue = this.queueSettings.user_upload_start_handler.call(this, file);
|
||||
}
|
||||
|
||||
// To prevent upload a real "FALSE" value must be returned, otherwise default to a real "TRUE" value.
|
||||
returnValue = (returnValue === false) ? false : true;
|
||||
|
||||
this.queueSettings.queue_cancelled_flag = !returnValue;
|
||||
|
||||
return returnValue;
|
||||
};
|
||||
|
||||
SWFUpload.queue.uploadCompleteHandler = function (file) {
|
||||
var user_upload_complete_handler = this.queueSettings.user_upload_complete_handler;
|
||||
var continueUpload;
|
||||
|
||||
if (file.filestatus === SWFUpload.FILE_STATUS.COMPLETE) {
|
||||
this.queueSettings.queue_upload_count++;
|
||||
}
|
||||
|
||||
if (typeof(user_upload_complete_handler) === "function") {
|
||||
continueUpload = (user_upload_complete_handler.call(this, file) === false) ? false : true;
|
||||
} else if (file.filestatus === SWFUpload.FILE_STATUS.QUEUED) {
|
||||
// If the file was stopped and re-queued don't restart the upload
|
||||
continueUpload = false;
|
||||
} else {
|
||||
continueUpload = true;
|
||||
}
|
||||
|
||||
if (continueUpload) {
|
||||
var stats = this.getStats();
|
||||
if (stats.files_queued > 0 && this.queueSettings.queue_cancelled_flag === false) {
|
||||
this.startUpload();
|
||||
} else if (this.queueSettings.queue_cancelled_flag === false) {
|
||||
this.queueEvent("queue_complete_handler", [this.queueSettings.queue_upload_count]);
|
||||
this.queueSettings.queue_upload_count = 0;
|
||||
} else {
|
||||
this.queueSettings.queue_cancelled_flag = false;
|
||||
this.queueSettings.queue_upload_count = 0;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
BIN
admin/javascript/swfupload/swfupload.swf
Normal file
1246
admin/javascript/typecho.js
Normal file
60
admin/login.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
include 'common.php';
|
||||
include 'header.php';
|
||||
|
||||
$rememberName = Typecho_Cookie::get('__typecho_remember_name');
|
||||
Typecho_Cookie::delete('__typecho_remember_name');
|
||||
?>
|
||||
<div class="body body-950">
|
||||
<div class="container">
|
||||
<div class="column-07 start-09 typecho-login">
|
||||
<h2 class="logo-dark">typecho</h2>
|
||||
<form action="<?php $options->loginAction(); ?>" method="post" name="login">
|
||||
<fieldset>
|
||||
<?php if(!$user->hasLogin()): ?>
|
||||
<?php if($notice->have() && in_array($notice->noticeType, array('success', 'notice', 'error'))): ?>
|
||||
<div class="message <?php $notice->noticeType(); ?> typecho-radius-topleft typecho-radius-topright typecho-radius-bottomleft typecho-radius-bottomright">
|
||||
<ul>
|
||||
<?php $notice->lists(); ?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<p><label for="name"><?php _e('用户名'); ?>:</label> <input type="text" id="name" name="name" value="<?php echo $rememberName; ?>" class="text" /></p>
|
||||
<p><label for="password"><?php _e('密码'); ?>:</label> <input type="password" id="password" name="password" class="text" /></p>
|
||||
<p class="submit">
|
||||
<label for="remember"><input type="checkbox" name="remember" class="checkbox" value="1" id="remember" /> <?php _e('记住我'); ?></label>
|
||||
<button type="submit"><?php _e('登录'); ?></button>
|
||||
<input type="hidden" name="referer" value="<?php echo htmlspecialchars($request->get('referer')); ?>" />
|
||||
</p>
|
||||
<?php else: ?>
|
||||
<div class="message notice typecho-radius-topleft typecho-radius-topright typecho-radius-bottomleft typecho-radius-bottomright">
|
||||
<ul>
|
||||
<li><?php _e('您已经登录到%s', $options->title); ?></li>
|
||||
</ul>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
<div class="more-link">
|
||||
<p class="back-to-site">
|
||||
<a href="<?php $options->siteUrl(); ?>" class="important"><?php _e('« 返回%s', $options->title); ?></a>
|
||||
</p>
|
||||
<p class="forgot-password">
|
||||
<?php if($user->hasLogin()): ?>
|
||||
<a href="<?php $options->adminUrl(); ?>"><?php _e('进入后台 »'); ?></a>
|
||||
<?php elseif($options->allowRegister): ?>
|
||||
<a href="<?php $options->registerUrl(); ?>"><?php _e('注册 »'); ?></a>
|
||||
<?php endif; ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
(function () {
|
||||
var _form = document.login.name;
|
||||
_form.focus();
|
||||
})();
|
||||
</script>
|
||||
<?php include 'footer.php'; ?>
|
414
admin/manage-comments.php
Normal file
@ -0,0 +1,414 @@
|
||||
<?php
|
||||
include 'common.php';
|
||||
include 'header.php';
|
||||
include 'menu.php';
|
||||
|
||||
$stat = Typecho_Widget::widget('Widget_Stat');
|
||||
$comments = Typecho_Widget::widget('Widget_Comments_Admin');
|
||||
?>
|
||||
<div class="main">
|
||||
<div class="body body-950">
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="container typecho-page-main">
|
||||
<div class="column-24 start-01 typecho-list">
|
||||
<ul class="typecho-option-tabs">
|
||||
<li<?php if(!isset($request->status) || 'approved' == $request->get('status')): ?> class="current"<?php endif; ?>><a href="<?php $options->adminUrl('manage-comments.php'
|
||||
. (isset($request->cid) ? '?cid=' . $request->cid : '')); ?>"><?php _e('已通过'); ?></a></li>
|
||||
<li<?php if('waiting' == $request->get('status')): ?> class="current"<?php endif; ?>><a href="<?php $options->adminUrl('manage-comments.php?status=waiting'
|
||||
. (isset($request->cid) ? '&cid=' . $request->cid : '')); ?>"><?php _e('待审核'); ?>
|
||||
<?php if('on' != $request->get('__typecho_all_comments') && $stat->myWaitingCommentsNum > 0 && !isset($request->cid)): ?>
|
||||
<span class="balloon"><?php $stat->myWaitingCommentsNum(); ?></span>
|
||||
<?php elseif('on' == $request->get('__typecho_all_comments') && $stat->waitingCommentsNum > 0 && !isset($request->cid)): ?>
|
||||
<span class="balloon"><?php $stat->waitingCommentsNum(); ?></span>
|
||||
<?php elseif(isset($request->cid) && $stat->currentWaitingCommentsNum > 0): ?>
|
||||
<span class="balloon"><?php $stat->currentWaitingCommentsNum(); ?></span>
|
||||
<?php endif; ?>
|
||||
</a></li>
|
||||
<li<?php if('spam' == $request->get('status')): ?> class="current"<?php endif; ?>><a href="<?php $options->adminUrl('manage-comments.php?status=spam'
|
||||
. (isset($request->cid) ? '&cid=' . $request->cid : '')); ?>"><?php _e('垃圾'); ?>
|
||||
<?php if('on' != $request->get('__typecho_all_comments') && $stat->mySpamCommentsNum > 0 && !isset($request->cid)): ?>
|
||||
<span class="balloon"><?php $stat->mySpamCommentsNum(); ?></span>
|
||||
<?php elseif('on' == $request->get('__typecho_all_comments') && $stat->spamCommentsNum > 0 && !isset($request->cid)): ?>
|
||||
<span class="balloon"><?php $stat->spamCommentsNum(); ?></span>
|
||||
<?php elseif(isset($request->cid) && $stat->currentSpamCommentsNum > 0): ?>
|
||||
<span class="balloon"><?php $stat->currentSpamCommentsNum(); ?></span>
|
||||
<?php endif; ?>
|
||||
</a></li>
|
||||
<?php if($user->pass('editor', true) && !isset($request->cid)): ?>
|
||||
<li class="right<?php if('on' == $request->get('__typecho_all_comments')): ?> current<?php endif; ?>"><a href="<?php echo $request->makeUriByRequest('__typecho_all_comments=on'); ?>"><?php _e('所有'); ?></a></li>
|
||||
<li class="right<?php if('on' != $request->get('__typecho_all_comments')): ?> current<?php endif; ?>"><a href="<?php echo $request->makeUriByRequest('__typecho_all_comments=off'); ?>"><?php _e('我的'); ?></a></li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
|
||||
<div class="typecho-list-operate">
|
||||
<form method="get">
|
||||
<p class="operate"><?php _e('操作'); ?>:
|
||||
<span class="operate-button typecho-table-select-all"><?php _e('全选'); ?></span>,
|
||||
<span class="operate-button typecho-table-select-none"><?php _e('不选'); ?></span>
|
||||
<?php _e('选中项') ?>:
|
||||
<span rel="approved" class="operate-button typecho-table-select-submit"><?php _e('通过'); ?></span>,
|
||||
<span rel="waiting" class="operate-button typecho-table-select-submit"><?php _e('待审核'); ?></span>,
|
||||
<span rel="spam" class="operate-button typecho-table-select-submit"><?php _e('标记垃圾'); ?></span>,
|
||||
<span rel="delete" lang="<?php _e('你确认要删除这些评论吗?'); ?>" class="operate-button operate-delete typecho-table-select-submit"><?php _e('删除'); ?></span><?php if('spam' == $request->get('status')): ?>,
|
||||
<span rel="delete-spam" lang="<?php _e('你确认要删除所有垃圾评论吗?'); ?>" class="operate-button operate-delete typecho-table-select-submit"><?php _e('删除所有垃圾评论'); ?></span>
|
||||
<?php endif; ?>
|
||||
</p>
|
||||
<p class="search">
|
||||
<?php if ('' != $request->keywords || '' != $request->category): ?>
|
||||
<a href="<?php $options->adminUrl('manage-comments.php'
|
||||
. (isset($request->status) || isset($request->cid) ? '?' .
|
||||
(isset($request->status) ? 'status=' . htmlspecialchars($request->get('status')) : '') .
|
||||
(isset($request->cid) ? (isset($request->status) ? '&' : '') . 'cid=' . htmlspecialchars($request->get('cid')) : '') : '')); ?>"><?php _e('« 取消筛选'); ?></a>
|
||||
<?php endif; ?>
|
||||
<input type="text" value="<?php '' != $request->keywords ? print(htmlspecialchars($request->keywords)) : _e('请输入关键字'); ?>"<?php if ('' == $request->keywords): ?> onclick="value='';name='keywords';" <?php else: ?> name="keywords"<?php endif; ?>/>
|
||||
<?php if(isset($request->status)): ?>
|
||||
<input type="hidden" value="<?php echo htmlspecialchars($request->get('status')); ?>" name="status" />
|
||||
<?php endif; ?>
|
||||
<?php if(isset($request->cid)): ?>
|
||||
<input type="hidden" value="<?php echo htmlspecialchars($request->get('cid')); ?>" name="cid" />
|
||||
<?php endif; ?>
|
||||
<button type="submit"><?php _e('筛选'); ?></button>
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<form method="post" name="manage_comments" class="operate-form" action="<?php $options->index('/action/comments-edit'); ?>">
|
||||
<ul class="typecho-list-notable clearfix">
|
||||
<?php if($comments->have()): ?>
|
||||
<?php while($comments->next()): ?>
|
||||
<li class="column-24<?php $comments->alt(' even', ''); ?>" id="<?php $comments->theId(); ?>">
|
||||
<div class="column-01 center">
|
||||
<input type="checkbox" value="<?php $comments->coid(); ?>" name="coid[]"/>
|
||||
</div>
|
||||
<div class="column-23 comment-body">
|
||||
<div class="content">
|
||||
<div class="comment-avatar">
|
||||
<?php $comments->gravatar(); ?>
|
||||
</div>
|
||||
|
||||
<div class="comment-meta">
|
||||
<span class="<?php $comments->type(); ?>"></span>
|
||||
<span class="comment-author"><?php $comments->author(true); ?></span>
|
||||
<?php if($comments->mail): ?>
|
||||
|
|
||||
<a href="mailto:<?php $comments->mail(); ?>"><?php $comments->mail(); ?></a>
|
||||
<?php endif; ?>
|
||||
<?php if($comments->ip): ?>
|
||||
|
|
||||
<?php $comments->ip(); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="comment-content">
|
||||
<?php $comments->content(); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="line">
|
||||
<div class="left hidden-by-mouse">
|
||||
<?php if('approved' == $comments->status): ?>
|
||||
<span class="weak"><?php _e('通过'); ?></span>
|
||||
<?php else: ?>
|
||||
<a href="<?php $options->index('/action/comments-edit?do=approved&coid=' . $comments->coid); ?>" class="ajax"><?php _e('通过'); ?></a>
|
||||
<?php endif; ?>
|
||||
|
|
||||
<?php if('waiting' == $comments->status): ?>
|
||||
<span class="weak"><?php _e('待审核'); ?></span>
|
||||
<?php else: ?>
|
||||
<a href="<?php $options->index('/action/comments-edit?do=waiting&coid=' . $comments->coid); ?>" class="ajax"><?php _e('待审核'); ?></a>
|
||||
<?php endif; ?>
|
||||
|
|
||||
<?php if('spam' == $comments->status): ?>
|
||||
<span class="weak"><?php _e('垃圾'); ?></span>
|
||||
<?php else: ?>
|
||||
<a href="<?php $options->index('/action/comments-edit?do=spam&coid=' . $comments->coid); ?>" class="ajax"><?php _e('垃圾'); ?></a>
|
||||
<?php endif; ?>
|
||||
|
|
||||
<a href="#<?php $comments->theId(); ?>" rel="<?php $options->index('/action/comments-edit?do=get&coid=' . $comments->coid); ?>" class="ajax operate-edit"><?php _e('编辑'); ?></a>
|
||||
<?php if('approved' == $comments->status && 'comment' == $comments->type): ?>
|
||||
|
|
||||
<a href="#<?php $comments->theId(); ?>" rel="<?php $options->index('/action/comments-edit?do=reply&coid=' . $comments->coid); ?>" class="ajax operate-reply"><?php _e('回复'); ?></a>
|
||||
<?php endif; ?>
|
||||
|
|
||||
<a lang="<?php _e('你确认要删除%s的评论吗?', htmlspecialchars($comments->author)); ?>" href="<?php $options->index('/action/comments-edit?do=delete&coid=' . $comments->coid); ?>" class="ajax operate-delete"><?php _e('删除'); ?></a>
|
||||
</div>
|
||||
<div class="right">
|
||||
<?php $comments->dateWord(); ?>
|
||||
|
||||
<a href="<?php $comments->permalink(); ?>"><?php $comments->title(); ?></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<?php endwhile; ?>
|
||||
<?php else: ?>
|
||||
<li class="even">
|
||||
<h6 class="typecho-list-table-title"><?php _e('没有评论') ?></h6>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
<input type="hidden" name="do" value="delete" />
|
||||
<?php if(isset($request->cid)): ?>
|
||||
<input type="hidden" value="<?php echo htmlspecialchars($request->get('cid')); ?>" name="cid" />
|
||||
<?php endif; ?>
|
||||
</form>
|
||||
|
||||
<?php if($comments->have()): ?>
|
||||
<div class="typecho-pager">
|
||||
<div class="typecho-pager-content">
|
||||
<ul>
|
||||
<?php $comments->pageNav(); ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
include 'copyright.php';
|
||||
include 'common-js.php';
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
(function () {
|
||||
window.addEvent('domready', function() {
|
||||
|
||||
$(document).getElements('.typecho-list-notable li .operate-edit').addEvent('click', function () {
|
||||
|
||||
var form = this.getParent('li').getElement('.comment-form');
|
||||
var request;
|
||||
|
||||
if (form) {
|
||||
|
||||
if (request) {
|
||||
request.cancel();
|
||||
}
|
||||
|
||||
form.destroy();
|
||||
this.getParent('li').getElement('.content').setStyle('display', '');
|
||||
this.clicked = false;
|
||||
|
||||
} else {
|
||||
if ('undefined' == typeof(this.clicked) || !this.clicked) {
|
||||
this.clicked = true;
|
||||
this.getParent('.line').addClass('loading');
|
||||
|
||||
request = new Request.JSON({
|
||||
url: this.getProperty('rel'),
|
||||
|
||||
onComplete: (function () {
|
||||
this.clicked = false;
|
||||
}).bind(this),
|
||||
|
||||
onSuccess: (function (json) {
|
||||
|
||||
if (json.success) {
|
||||
var coid = this.getParent('li').getElement('input[type=checkbox]').get('value');
|
||||
|
||||
var form = new Element('div', {
|
||||
'class': 'comment-form',
|
||||
|
||||
'html': '<label for="author-' + coid + '"><?php _e('名称'); ?></label>' +
|
||||
'<input type="text" class="text" name="author" id="author-' + coid + '" />' +
|
||||
'<label for="mail"><?php _e('电子邮件'); ?></label>' +
|
||||
'<input type="text" class="text" name="mail" id="mail-' + coid + '" />' +
|
||||
'<label for="url"><?php _e('个人主页'); ?></label>' +
|
||||
'<input type="text" class="text" name="url" id="url-' + coid + '" />' +
|
||||
'<textarea name="text" id="text-' + coid + '"></textarea>' +
|
||||
'<p><button id="submit-' + coid + '"><?php _e('保存评论'); ?></button>' +
|
||||
'<input type="hidden" name="coid" id="coid-' + coid + '" /></p>'
|
||||
|
||||
});
|
||||
|
||||
form.getElement('input[name=author]').set('value', json.comment.author);
|
||||
form.getElement('input[name=mail]').set('value', json.comment.mail);
|
||||
form.getElement('input[name=url]').set('value', json.comment.url);
|
||||
form.getElement('input[name=coid]').set('value', coid);
|
||||
form.getElement('textarea[name=text]').set('value', json.comment.text);
|
||||
|
||||
this.getParent('li').getElement('.content').setStyle('display', 'none');
|
||||
form.inject(this.getParent('li').getElement('.line'), 'before');
|
||||
form.getElement('#submit-' + coid).addEvent('click', (function () {
|
||||
var query = this.getParent('li').getElement('.comment-form').toQueryString();
|
||||
|
||||
var sRequest = new Request.JSON({
|
||||
url: this.getProperty('rel').replace('do=get', 'do=edit'),
|
||||
|
||||
onComplete: (function () {
|
||||
var li = this.getParent('li');
|
||||
|
||||
li.getElement('.content').setStyle('display', '');
|
||||
li.getElement('.comment-form').destroy();
|
||||
var myFx = new Fx.Tween(li);
|
||||
|
||||
var bg = li.getStyle('background-color');
|
||||
if (!bg || 'transparent' == bg) {
|
||||
bg = '#F7FBE9';
|
||||
}
|
||||
|
||||
myFx.addEvent('complete', (function () {
|
||||
this.setStyle('background-color', '');
|
||||
}).bind(li));
|
||||
|
||||
myFx.start('background-color', '#AACB36', bg);
|
||||
}).bind(this),
|
||||
|
||||
onSuccess: (function (json) {
|
||||
if (json.success) {
|
||||
|
||||
var commentMeta = '';
|
||||
commentMeta += '<span class="' + json.comment.type + '"></span> ';
|
||||
|
||||
if (json.comment.url) {
|
||||
commentMeta += '<a target="_blank" href="' + json.comment.url + '">' + json.comment.author + '</a> | ';
|
||||
} else {
|
||||
commentMeta += json.comment.author + ' | ';
|
||||
}
|
||||
|
||||
if (json.comment.mail) {
|
||||
commentMeta += '<a href="mailto:' + json.comment.mail + '">' + json.comment.mail + '</a> | ';
|
||||
}
|
||||
|
||||
commentMeta += json.comment.ip;
|
||||
|
||||
this.getParent('li').getElement('.comment-meta').set('html', commentMeta);
|
||||
this.getParent('li').getElement('.comment-content').set('html', json.comment.content);
|
||||
}
|
||||
}).bind(this)
|
||||
}).send(query + '&do=edit');
|
||||
|
||||
return false;
|
||||
|
||||
}).bind(this));
|
||||
|
||||
this.getParent('.line').removeClass('loading');
|
||||
} else {
|
||||
alert(json.message);
|
||||
}
|
||||
|
||||
}).bind(this)
|
||||
}).send();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
$(document).getElements('.typecho-list-notable li .operate-reply').addEvent('click', function () {
|
||||
|
||||
var form = this.getParent('li').getElement('.reply-form');
|
||||
var request;
|
||||
|
||||
if (form) {
|
||||
|
||||
if (request) {
|
||||
request.cancel();
|
||||
}
|
||||
|
||||
form.destroy();
|
||||
this.clicked = false;
|
||||
|
||||
} else {
|
||||
if (('undefined' == typeof(this.clicked) || !this.clicked)
|
||||
&& ('undefined' == typeof(this.replied) || !this.replied)) {
|
||||
this.clicked = true;
|
||||
|
||||
var coid = this.getParent('li').getElement('input[type=checkbox]').get('value');
|
||||
|
||||
var form = new Element('div', {
|
||||
'class': 'reply-form',
|
||||
|
||||
'html': '<textarea name="text"></textarea>' +
|
||||
'<p><button id="reply-' + coid + '"><?php _e('回复评论'); ?></button></p>'
|
||||
|
||||
});
|
||||
|
||||
form.inject(this.getParent('li').getElement('.line'), 'after');
|
||||
|
||||
var ta = form.getElement('textarea'), rg = ta.getSelectedRange(),
|
||||
instStr = '<a href="#' + this.getParent('li').get('id') + '">@'
|
||||
+ this.getParent('li').getElement('.comment-author').get('text') + "</a>\n";
|
||||
|
||||
ta.set('value', instStr);
|
||||
ta.focus();
|
||||
ta.selectRange(instStr.length + 1, instStr.length + 1);
|
||||
|
||||
form.getElement('#reply-' + coid).addEvent('click', (function () {
|
||||
if ('' == this.getParent('li').getElement('.reply-form textarea[name=text]').get('value')) {
|
||||
alert('<?php _e('必须填写内容'); ?>');
|
||||
return false;
|
||||
}
|
||||
|
||||
var query = this.getParent('li').getElement('.reply-form').toQueryString();
|
||||
|
||||
var sRequest = new Request.JSON({
|
||||
url: this.getProperty('rel'),
|
||||
|
||||
onComplete: (function () {
|
||||
var li = this.getParent('li');
|
||||
li.getElement('.reply-form').destroy();
|
||||
li.removeClass('hover');
|
||||
li.getElement('.operate-reply').clicked = false;
|
||||
}).bind(this),
|
||||
|
||||
onSuccess: (function (json) {
|
||||
if (json.success) {
|
||||
var li = this.getParent('li');
|
||||
|
||||
var msg = new Element('div', {
|
||||
'class': 'reply-message',
|
||||
|
||||
'html': json.comment.content
|
||||
|
||||
});
|
||||
|
||||
li.getElement('.operate-reply').set('html', '<?php _e('取消回复'); ?>');
|
||||
li.getElement('.operate-reply').replied = true;
|
||||
li.getElement('.operate-reply').child = json.comment.coid;
|
||||
msg.inject(li.getElement('.line'), 'after');
|
||||
}
|
||||
}).bind(this)
|
||||
}).send(query);
|
||||
|
||||
return false;
|
||||
|
||||
}).bind(this));
|
||||
} else if (this.replied) {
|
||||
this.getParent('.line').addClass('loading');
|
||||
|
||||
var sRequest = new Request.JSON({
|
||||
url: '<?php $options->index('/action/comments-edit?do=delete'); ?>',
|
||||
|
||||
onComplete: (function () {
|
||||
var li = this.getParent('li');
|
||||
li.getElement('.operate-reply').clicked = false;
|
||||
this.getParent('.line').removeClass('loading');
|
||||
}).bind(this),
|
||||
|
||||
onSuccess: (function (json) {
|
||||
if (json.success) {
|
||||
var li = this.getParent('li');
|
||||
|
||||
li.getElement('.operate-reply').set('html', '<?php _e('回复'); ?>');
|
||||
li.getElement('.operate-reply').replied = false;
|
||||
li.getElement('.operate-reply').set('child', 0);
|
||||
li.getElement('.reply-message').destroy();
|
||||
}
|
||||
}).bind(this)
|
||||
}).send('coid=' + this.child);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
<?php
|
||||
include 'footer.php';
|
||||
?>
|
110
admin/manage-medias.php
Normal file
@ -0,0 +1,110 @@
|
||||
<?php
|
||||
include 'common.php';
|
||||
include 'header.php';
|
||||
include 'menu.php';
|
||||
|
||||
$stat = Typecho_Widget::widget('Widget_Stat');
|
||||
?>
|
||||
|
||||
<?php Typecho_Widget::widget('Widget_Contents_Attachment_Admin')->to($attachments); ?>
|
||||
<div class="main">
|
||||
<div class="body body-950">
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="container typecho-page-main">
|
||||
<div class="column-24 start-01">
|
||||
|
||||
<div class="typecho-list-operate">
|
||||
<form method="get">
|
||||
<p class="operate"><?php _e('操作'); ?>:
|
||||
<span class="operate-button typecho-table-select-all"><?php _e('全选'); ?></span>,
|
||||
<span class="operate-button typecho-table-select-none"><?php _e('不选'); ?></span>
|
||||
<?php _e('选中项'); ?>:
|
||||
<span rel="delete" lang="<?php _e('你确认要删除这些附件吗?'); ?>" class="operate-button operate-delete typecho-table-select-submit"><?php _e('删除'); ?></span>
|
||||
</p>
|
||||
<p class="search">
|
||||
<?php if ('' != $request->keywords): ?>
|
||||
<a href="<?php $options->adminUrl('manage-medias.php'); ?>"><?php _e('« 取消筛选'); ?></a>
|
||||
<?php endif; ?>
|
||||
<input type="text" value="<?php '' != $request->keywords ? print(htmlspecialchars($request->keywords)) : _e('请输入关键字'); ?>"<?php if ('' == $request->keywords): ?> onclick="value='';name='keywords';" <?php else: ?> name="keywords"<?php endif; ?>/>
|
||||
<button type="submit"><?php _e('筛选'); ?></button>
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<form method="post" name="manage_medias" class="operate-form" action="<?php $options->index('/action/contents-attachment-edit'); ?>">
|
||||
<table class="typecho-list-table draggable">
|
||||
<colgroup>
|
||||
<col width="25"/>
|
||||
<col width="50"/>
|
||||
<col width="20"/>
|
||||
<col width="275"/>
|
||||
<col width="30"/>
|
||||
<col width="120"/>
|
||||
<col width="220"/>
|
||||
<col width="150"/>
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="typecho-radius-topleft"> </th>
|
||||
<th> </th>
|
||||
<th> </th>
|
||||
<th><?php _e('文件名'); ?></th>
|
||||
<th> </th>
|
||||
<th><?php _e('上传者'); ?></th>
|
||||
<th><?php _e('所属文章'); ?></th>
|
||||
<th class="typecho-radius-topright"><?php _e('发布日期'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if($attachments->have()): ?>
|
||||
<?php while($attachments->next()): ?>
|
||||
<?php $mime = Typecho_Common::mimeIconType($attachments->attachment->mime); ?>
|
||||
<tr<?php $attachments->alt(' class="even"', ''); ?> id="<?php $attachments->theId(); ?>">
|
||||
<td><input type="checkbox" value="<?php $attachments->cid(); ?>" name="cid[]"/></td>
|
||||
<td><a href="<?php $options->adminUrl('manage-comments.php?cid=' . $attachments->cid); ?>" class="balloon-button right size-<?php echo Typecho_Common::splitByCount($attachments->commentsNum, 1, 10, 20, 50, 100); ?>"><?php $attachments->commentsNum(); ?></a></td>
|
||||
<td><span class="typecho-mime typecho-mime-<?php echo $mime; ?>"></span></td>
|
||||
<td><a href="<?php $options->adminUrl('media.php?cid=' . $attachments->cid); ?>"><?php $attachments->title(); ?></a></td>
|
||||
<td>
|
||||
<a class="right hidden-by-mouse" href="<?php $attachments->permalink(); ?>"><img src="<?php $options->adminUrl('images/link.png'); ?>" title="<?php _e('浏览 %s', $attachments->title); ?>" width="16" height="16" alt="view" /></a>
|
||||
</td>
|
||||
<td><?php $attachments->author(); ?></td>
|
||||
<td>
|
||||
<?php if ($attachments->parentPost->cid): ?>
|
||||
<a href="<?php $options->adminUrl('write-' . $attachments->parentPost->type . '.php?cid=' . $attachments->parentPost->cid); ?>"><?php $attachments->parentPost->title(); ?></a>
|
||||
<?php else: ?>
|
||||
<span class="description"><?php _e('未归档'); ?></span>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td><?php $attachments->dateWord(); ?></td>
|
||||
</tr>
|
||||
<?php endwhile; ?>
|
||||
<?php else: ?>
|
||||
<tr class="even">
|
||||
<td colspan="8"><h6 class="typecho-list-table-title"><?php _e('没有任何附件'); ?></h6></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<input type="hidden" name="do" value="delete" />
|
||||
</form>
|
||||
|
||||
<?php if($attachments->have()): ?>
|
||||
<div class="typecho-pager">
|
||||
<div class="typecho-pager-content">
|
||||
<ul>
|
||||
<?php $attachments->pageNav(); ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include 'copyright.php';
|
||||
include 'common-js.php';
|
||||
include 'footer.php';
|
||||
?>
|
189
admin/manage-metas.php
Normal file
@ -0,0 +1,189 @@
|
||||
<?php
|
||||
include 'common.php';
|
||||
include 'header.php';
|
||||
include 'menu.php';
|
||||
?>
|
||||
|
||||
<div class="main">
|
||||
<div class="body body-950">
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="container typecho-page-main manage-metas">
|
||||
<div class="column-16 suffix">
|
||||
<ul class="typecho-option-tabs">
|
||||
<li<?php if(!isset($request->type) || 'category' == $request->get('type')): ?> class="current"<?php endif; ?>><a href="<?php $options->adminUrl('manage-metas.php'); ?>"><?php _e('分类'); ?></a></li>
|
||||
<li<?php if('tag' == $request->get('type')): ?> class="current"<?php endif; ?>><a href="<?php $options->adminUrl('manage-metas.php?type=tag'); ?>"><?php _e('标签'); ?></a></li>
|
||||
</ul>
|
||||
|
||||
<?php if(!isset($request->type) || 'category' == $request->get('type')): ?>
|
||||
<?php Typecho_Widget::widget('Widget_Metas_Category_List')->to($categories); ?>
|
||||
<form method="post" name="manage_categories" class="operate-form" action="<?php $options->index('/action/metas-category-edit'); ?>">
|
||||
<div class="typecho-list-operate">
|
||||
<p class="operate"><?php _e('操作'); ?>:
|
||||
<span class="operate-button typecho-table-select-all"><?php _e('全选'); ?></span>,
|
||||
<span class="operate-button typecho-table-select-none"><?php _e('不选'); ?></span>
|
||||
<?php _e('选中项'); ?>:
|
||||
<span rel="delete" lang="<?php _e('此分类下的所有内容将被删除, 你确认要删除这些分类吗?'); ?>" class="operate-button operate-delete typecho-table-select-submit"><?php _e('删除'); ?></span>,
|
||||
<span rel="refresh" lang="<?php _e('刷新分类可能需要等待较长时间, 你确认要刷新这些分类吗?'); ?>" class="operate-button typecho-table-select-submit"><?php _e('刷新'); ?></span>,
|
||||
<span rel="merge" class="operate-button typecho-table-select-submit"><?php _e('合并到'); ?></span>
|
||||
<select name="merge">
|
||||
<?php $categories->parse('<option value="{mid}">{name}</option>'); ?>
|
||||
</select>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<table class="typecho-list-table draggable">
|
||||
<colgroup>
|
||||
<col width="25"/>
|
||||
<col width="230"/>
|
||||
<col width="30"/>
|
||||
<col width="170"/>
|
||||
<col width="50"/>
|
||||
<col width="65"/>
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="typecho-radius-topleft"> </th>
|
||||
<th><?php _e('名称'); ?></th>
|
||||
<th> </th>
|
||||
<th><?php _e('缩略名'); ?></th>
|
||||
<th> </th>
|
||||
<th class="typecho-radius-topright"><?php _e('文章数'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if($categories->have()): ?>
|
||||
<?php while ($categories->next()): ?>
|
||||
<tr<?php $categories->alt(' class="even"', ''); ?> id="<?php $categories->theId(); ?>">
|
||||
<td><input type="checkbox" value="<?php $categories->mid(); ?>" name="mid[]"/></td>
|
||||
<td><a href="<?php echo $request->makeUriByRequest('mid=' . $categories->mid); ?>"><?php $categories->name(); ?></a></td>
|
||||
<td>
|
||||
<a class="right hidden-by-mouse" href="<?php $categories->permalink(); ?>"><img src="<?php $options->adminUrl('images/link.png'); ?>" title="<?php _e('浏览 %s', $categories->name); ?>" width="16" height="16" alt="view" /></a>
|
||||
</td>
|
||||
<td><?php $categories->slug(); ?></td>
|
||||
<td>
|
||||
<?php if ($options->defaultCategory == $categories->mid): ?>
|
||||
<span class="balloon right"><?php _e('默认'); ?></span>
|
||||
<?php else: ?>
|
||||
<a class="balloon-button right hidden-by-mouse" href="<?php $options->index('/action/metas-category-edit?do=default&mid=' . $categories->mid); ?>"><?php _e('默认'); ?></a>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td><a class="balloon-button left size-<?php echo Typecho_Common::splitByCount($categories->count, 1, 10, 20, 50, 100); ?>" href="<?php $options->adminUrl('manage-posts.php?category=' . $categories->mid); ?>"><?php $categories->count(); ?></a></td>
|
||||
</tr>
|
||||
<?php endwhile; ?>
|
||||
<?php else: ?>
|
||||
<tr class="even">
|
||||
<td colspan="6"><h6 class="typecho-list-table-title"><?php _e('没有任何分类'); ?></h6></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<input type="hidden" name="do" value="delete" />
|
||||
</form>
|
||||
<?php else: ?>
|
||||
<?php Typecho_Widget::widget('Widget_Metas_Tag_Cloud', 'sort=mid&desc=0')->to($tags); ?>
|
||||
<form method="post" name="manage_tags" class="operate-form" action="<?php $options->index('/action/metas-tag-edit'); ?>">
|
||||
<div class="typecho-list-operate">
|
||||
<p class="operate"><?php _e('操作'); ?>:
|
||||
<span class="operate-button typecho-table-select-all"><?php _e('全选'); ?></span>,
|
||||
<span class="operate-button typecho-table-select-none"><?php _e('不选'); ?></span>
|
||||
<?php _e('选中项'); ?>:
|
||||
<span rel="delete" lang="<?php _e('此标签下的所有内容将被删除, 你确认要删除这些标签吗?'); ?>" class="operate-button operate-delete typecho-table-select-submit"><?php _e('删除'); ?></span>,
|
||||
<span rel="refresh" lang="<?php _e('刷新标签可能需要等待较长时间, 你确认要刷新这些分类吗?'); ?>" class="operate-button typecho-table-select-submit"><?php _e('刷新'); ?></span>,
|
||||
<span rel="merge" class="operate-button typecho-table-select-submit"><?php _e('合并到'); ?></span>
|
||||
<input type="text" name="merge" />
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<ul class="typecho-list-notable tag-list clearfix typecho-radius-topleft typecho-radius-topright typecho-radius-bottomleft typecho-radius-bottomright">
|
||||
<?php if($tags->have()): ?>
|
||||
<?php while ($tags->next()): ?>
|
||||
<li class="size-<?php $tags->split(5, 10, 20, 30); ?>" id="<?php $tags->theId(); ?>">
|
||||
<input type="checkbox" value="<?php $tags->mid(); ?>" name="mid[]"/>
|
||||
<span rel="<?php echo $request->makeUriByRequest('mid=' . $tags->mid); ?>"><?php $tags->name(); ?></span>
|
||||
</li>
|
||||
<?php endwhile; ?>
|
||||
<?php else: ?>
|
||||
<h6 class="typecho-list-table-title"><?php _e('没有任何标签'); ?></h6>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
<input type="hidden" name="do" value="delete" />
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
<div class="column-08 typecho-mini-panel typecho-radius-topleft typecho-radius-topright typecho-radius-bottomleft typecho-radius-bottomright">
|
||||
<?php if(!isset($request->type) || 'category' == $request->get('type')): ?>
|
||||
<?php Typecho_Widget::widget('Widget_Metas_Category_Edit')->form()->render(); ?>
|
||||
<?php else: ?>
|
||||
<?php Typecho_Widget::widget('Widget_Metas_Tag_Edit')->form()->render(); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include 'copyright.php';
|
||||
include 'common-js.php';
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function () {
|
||||
window.addEvent('domready', function() {
|
||||
var _selection;
|
||||
|
||||
<?php if (isset($request->mid)): ?>
|
||||
var _hl = $(document).getElement('.typecho-mini-panel');
|
||||
if (_hl) {
|
||||
_hl.set('tween', {duration: 1500});
|
||||
|
||||
var _bg = _hl.getStyle('background-color');
|
||||
if (!_bg || 'transparent' == _bg) {
|
||||
_bg = '#F7FBE9';
|
||||
}
|
||||
|
||||
_hl.tween('background-color', '#AACB36', _bg);
|
||||
}
|
||||
<?php endif; ?>
|
||||
|
||||
if ('tr' == Typecho.Table.table._childTag) {
|
||||
Typecho.Table.dragStop = function (obj, result) {
|
||||
var _r = new Request.JSON({
|
||||
url: '<?php $options->index('/action/metas-category-edit'); ?>'
|
||||
}).send(result + '&do=sort');
|
||||
};
|
||||
} else {
|
||||
Typecho.Table.checked = function (input, item) {
|
||||
if (!_selection) {
|
||||
_selection = document.createElement('div');
|
||||
$(_selection).addClass('tag-selection');
|
||||
$(_selection).addClass('clearfix');
|
||||
$(document).getElement('.typecho-mini-panel form')
|
||||
.insertBefore(_selection, $(document).getElement('.typecho-mini-panel form #typecho-option-item-name-0'));
|
||||
}
|
||||
|
||||
var _href = item.getElement('span').getProperty('rel');
|
||||
var _text = item.getElement('span').get('text');
|
||||
var _a = document.createElement('a');
|
||||
$(_a).addClass('button');
|
||||
$(_a).setProperty('href', _href);
|
||||
$(_a).set('text', _text);
|
||||
_selection.appendChild(_a);
|
||||
item.checkedElement = _a;
|
||||
};
|
||||
|
||||
Typecho.Table.unchecked = function (input, item) {
|
||||
if (item.checkedElement) {
|
||||
$(item.checkedElement).destroy();
|
||||
}
|
||||
|
||||
if (!$(_selection).getElement('a')) {
|
||||
_selection.destroy();
|
||||
_selection = null;
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
<?php include 'footer.php'; ?>
|
122
admin/manage-pages.php
Normal file
@ -0,0 +1,122 @@
|
||||
<?php
|
||||
include 'common.php';
|
||||
include 'header.php';
|
||||
include 'menu.php';
|
||||
|
||||
$stat = Typecho_Widget::widget('Widget_Stat');
|
||||
?>
|
||||
<div class="main">
|
||||
<div class="body body-950">
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="container typecho-page-main">
|
||||
<div class="column-24 start-01 typecho-list">
|
||||
<div class="typecho-list-operate">
|
||||
<form method="get">
|
||||
<p class="operate"><?php _e('操作'); ?>:
|
||||
<span class="operate-button typecho-table-select-all"><?php _e('全选'); ?></span>,
|
||||
<span class="operate-button typecho-table-select-none"><?php _e('不选'); ?></span>
|
||||
<?php _e('选中项'); ?>:
|
||||
<span rel="delete" lang="<?php _e('你确认要删除这些页面吗?'); ?>" class="operate-button operate-delete typecho-table-select-submit"><?php _e('删除'); ?></span>
|
||||
</p>
|
||||
<p class="search">
|
||||
<?php if ('' != $request->keywords): ?>
|
||||
<a href="<?php $options->adminUrl('manage-pages.php'); ?>"><?php _e('« 取消筛选'); ?></a>
|
||||
<?php endif; ?>
|
||||
<input type="text" value="<?php '' != $request->keywords ? print(htmlspecialchars($request->keywords)) : _e('请输入关键字'); ?>"<?php if ('' == $request->keywords): ?> onclick="value='';name='keywords';" <?php else: ?> name="keywords"<?php endif; ?>/>
|
||||
<button type="submit"><?php _e('筛选'); ?></button>
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<form method="post" name="manage_pages" class="operate-form" action="<?php $options->index('/action/contents-page-edit'); ?>">
|
||||
<table class="typecho-list-table draggable">
|
||||
<colgroup>
|
||||
<col width="25"/>
|
||||
<col width="50"/>
|
||||
<col width="295"/>
|
||||
<col width="60"/>
|
||||
<col width="30"/>
|
||||
<col width="180"/>
|
||||
<col width="120"/>
|
||||
<col width="150"/>
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="typecho-radius-topleft"> </th>
|
||||
<th> </th>
|
||||
<th><?php _e('标题'); ?></th>
|
||||
<th> </th>
|
||||
<th> </th>
|
||||
<th><?php _e('缩略名'); ?></th>
|
||||
<th><?php _e('作者'); ?></th>
|
||||
<th class="typecho-radius-topright"><?php _e('日期'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php Typecho_Widget::widget('Widget_Contents_Page_Admin')->to($pages); ?>
|
||||
<?php if($pages->have()): ?>
|
||||
<?php while($pages->next()): ?>
|
||||
<tr<?php $pages->alt(' class="even"', ''); ?> id="<?php $pages->theId(); ?>">
|
||||
<td><input type="checkbox" value="<?php $pages->cid(); ?>" name="cid[]"/></td>
|
||||
<td><a href="<?php $options->adminUrl('manage-comments.php?cid=' . $pages->cid); ?>" class="balloon-button right size-<?php echo Typecho_Common::splitByCount($pages->commentsNum, 1, 10, 20, 50, 100); ?>"><?php $pages->commentsNum(); ?></a></td>
|
||||
<td<?php if ('draft' != $pages->status): ?> colspan="2"<?php endif; ?>><a href="<?php $options->adminUrl('write-page.php?cid=' . $pages->cid); ?>"><?php $pages->title(); ?></a>
|
||||
<?php if ('draft' == $pages->status): ?>
|
||||
</td>
|
||||
<td>
|
||||
<span class="balloon right"><?php _e('草稿'); ?></span>
|
||||
<?php endif; ?></td>
|
||||
</td>
|
||||
<td>
|
||||
<?php if ('publish' == $pages->status): ?>
|
||||
<a class="right hidden-by-mouse" href="<?php $pages->permalink(); ?>"><img src="<?php $options->adminUrl('images/link.png'); ?>" title="<?php _e('浏览 %s', $pages->title); ?>" width="16" height="16" alt="view" /></a>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td><?php $pages->slug(); ?></td>
|
||||
<td><?php $pages->author(); ?></td>
|
||||
<td>
|
||||
<?php if ($pages->hasSaved): ?>
|
||||
<span class="description">
|
||||
<?php $modifyDate = new Typecho_Date($pages->modified); ?>
|
||||
<?php _e('保存于 %s', $modifyDate->word()); ?>
|
||||
</span>
|
||||
<?php else: ?>
|
||||
<?php $pages->dateWord(); ?>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endwhile; ?>
|
||||
<?php else: ?>
|
||||
<tr class="even">
|
||||
<td colspan="8"><h6 class="typecho-list-table-title"><?php _e('没有任何页面'); ?></h6></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<input type="hidden" name="do" value="delete" />
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include 'copyright.php';
|
||||
include 'common-js.php';
|
||||
?>
|
||||
|
||||
<?php if(!isset($request->status) || 'publish' == $request->get('status')): ?>
|
||||
<script type="text/javascript">
|
||||
(function () {
|
||||
window.addEvent('domready', function() {
|
||||
Typecho.Table.dragStop = function (item, result) {
|
||||
var _r = new Request.JSON({
|
||||
url: '<?php $options->index('/action/contents-page-edit'); ?>'
|
||||
}).send(result + '&do=sort');
|
||||
};
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php include 'footer.php'; ?>
|
135
admin/manage-posts.php
Normal file
@ -0,0 +1,135 @@
|
||||
<?php
|
||||
include 'common.php';
|
||||
include 'header.php';
|
||||
include 'menu.php';
|
||||
|
||||
$stat = Typecho_Widget::widget('Widget_Stat');
|
||||
?>
|
||||
<div class="main">
|
||||
<div class="body body-950">
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="container typecho-page-main">
|
||||
<div class="column-24 start-01 typecho-list">
|
||||
<div class="typecho-list-operate">
|
||||
<form method="get">
|
||||
<p class="operate"><?php _e('操作'); ?>:
|
||||
<span class="operate-button typecho-table-select-all"><?php _e('全选'); ?></span>,
|
||||
<span class="operate-button typecho-table-select-none"><?php _e('不选'); ?></span>
|
||||
<?php _e('选中项'); ?>:
|
||||
<span rel="delete" lang="<?php _e('你确认要删除这些文章吗?'); ?>" class="operate-button operate-delete typecho-table-select-submit"><?php _e('删除'); ?></span>
|
||||
</p>
|
||||
<p class="search">
|
||||
<?php if ('' != $request->keywords || '' != $request->category): ?>
|
||||
<a href="<?php $options->adminUrl('manage-posts.php' . (isset($request->uid) ? '?uid=' . htmlspecialchars($request->get('uid')) : '')); ?>"><?php _e('« 取消筛选'); ?></a>
|
||||
<?php endif; ?>
|
||||
<input type="text" value="<?php '' != $request->keywords ? print(htmlspecialchars($request->keywords)) : _e('请输入关键字'); ?>"<?php if ('' == $request->keywords): ?> onclick="value='';name='keywords';" <?php else: ?> name="keywords"<?php endif; ?>/>
|
||||
<select name="category">
|
||||
<option value=""><?php _e('所有分类'); ?></option>
|
||||
<?php Typecho_Widget::widget('Widget_Metas_Category_List')->to($category); ?>
|
||||
<?php while($category->next()): ?>
|
||||
<option value="<?php $category->mid(); ?>"<?php if($request->get('category') == $category->mid): ?> selected="true"<?php endif; ?>><?php $category->name(); ?></option>
|
||||
<?php endwhile; ?>
|
||||
</select>
|
||||
<button type="submit"><?php _e('筛选'); ?></button>
|
||||
<?php if(isset($request->uid)): ?>
|
||||
<input type="hidden" value="<?php echo htmlspecialchars($request->get('uid')); ?>" name="uid" />
|
||||
<?php endif; ?>
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<form method="post" name="manage_posts" class="operate-form" action="<?php $options->index('/action/contents-post-edit'); ?>">
|
||||
<table class="typecho-list-table">
|
||||
<colgroup>
|
||||
<col width="25"/>
|
||||
<col width="50"/>
|
||||
<col width="280"/>
|
||||
<col width="80"/>
|
||||
<col width="30"/>
|
||||
<col width="110"/>
|
||||
<col width="185"/>
|
||||
<col width="130"/>
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="typecho-radius-topleft"> </th>
|
||||
<th> </th>
|
||||
<th><?php _e('标题'); ?></th>
|
||||
<th> </th>
|
||||
<th> </th>
|
||||
<th><?php _e('作者'); ?></th>
|
||||
<th><?php _e('分类'); ?></th>
|
||||
<th class="typecho-radius-topright"><?php _e('日期'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php Typecho_Widget::widget('Widget_Contents_Post_Admin')->to($posts); ?>
|
||||
<?php if($posts->have()): ?>
|
||||
<?php while($posts->next()): ?>
|
||||
<tr<?php $posts->alt(' class="even"', ''); ?> id="<?php $posts->theId(); ?>">
|
||||
<td><input type="checkbox" value="<?php $posts->cid(); ?>" name="cid[]"/></td>
|
||||
<td><a href="<?php $options->adminUrl('manage-comments.php?cid=' . $posts->cid); ?>" class="balloon-button right size-<?php echo Typecho_Common::splitByCount($posts->commentsNum, 1, 10, 20, 50, 100); ?>"><?php $posts->commentsNum(); ?></a></td>
|
||||
<td<?php if ('draft' != $posts->status && 'waiting' != $posts->status && 'private' != $posts->status && !$posts->password): ?> colspan="2"<?php endif; ?>>
|
||||
<a href="<?php $options->adminUrl('write-post.php?cid=' . $posts->cid); ?>"><?php $posts->title(); ?></a>
|
||||
<?php if ('draft' == $posts->status || 'waiting' == $posts->status || 'private' == $posts->status || $posts->password): ?>
|
||||
</td>
|
||||
<td>
|
||||
<span class="balloon right"><?php 'draft' == $posts->status ? _e('草稿') : ('waiting' == $posts->status ? _e('待审核') : ('private' == $posts->status ? _e('私密') : _e(''))); ?> <?php $posts->password ? _e('密码') : _e(''); ?></span>
|
||||
<?php endif; ?></td>
|
||||
<td>
|
||||
<?php if ('publish' == $posts->status): ?>
|
||||
<a class="right hidden-by-mouse" href="<?php $posts->permalink(); ?>"><img src="<?php $options->adminUrl('images/link.png'); ?>" title="<?php _e('浏览 %s', htmlspecialchars($posts->title)); ?>" width="16" height="16" alt="view" /></a>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td><a href="<?php $options->adminUrl('manage-posts.php?uid=' . $posts->author->uid); ?>"><?php $posts->author(); ?></a></td>
|
||||
<td><?php $categories = $posts->categories; $length = count($categories); ?>
|
||||
<?php foreach ($categories as $key => $val): ?>
|
||||
<?php echo '<a href="';
|
||||
$options->adminUrl('manage-posts.php?category=' . $val['mid']
|
||||
. (isset($request->uid) ? '&uid=' . $request->uid : '')
|
||||
. (isset($request->status) ? '&status=' . $request->status : ''));
|
||||
echo '">' . $val['name'] . '</a>' . ($key < $length - 1 ? ', ' : ''); ?>
|
||||
<?php endforeach; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php if ($posts->hasSaved): ?>
|
||||
<span class="description">
|
||||
<?php $modifyDate = new Typecho_Date($posts->modified); ?>
|
||||
<?php _e('保存于 %s', $modifyDate->word()); ?>
|
||||
</span>
|
||||
<?php else: ?>
|
||||
<?php $posts->dateWord(); ?>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endwhile; ?>
|
||||
<?php else: ?>
|
||||
<tr class="even">
|
||||
<td colspan="8"><h6 class="typecho-list-table-title"><?php _e('没有任何文章'); ?></h6></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<input type="hidden" name="do" value="delete" />
|
||||
</form>
|
||||
|
||||
<?php if($posts->have()): ?>
|
||||
<div class="typecho-pager">
|
||||
<div class="typecho-pager-content">
|
||||
<ul>
|
||||
<?php $posts->pageNav(); ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include 'copyright.php';
|
||||
include 'common-js.php';
|
||||
include 'footer.php';
|
||||
?>
|
109
admin/manage-users.php
Normal file
@ -0,0 +1,109 @@
|
||||
<?php
|
||||
include 'common.php';
|
||||
include 'header.php';
|
||||
include 'menu.php';
|
||||
?>
|
||||
<div class="main">
|
||||
<div class="body body-950">
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="container typecho-page-main">
|
||||
<div class="column-24 start-01 typecho-list">
|
||||
<div class="typecho-list-operate">
|
||||
<form method="get">
|
||||
<p class="operate">
|
||||
<?php _e('操作'); ?>:
|
||||
<span class="operate-button typecho-table-select-all"><?php _e('全选'); ?></span>,
|
||||
<span class="operate-button typecho-table-select-none"><?php _e('不选'); ?></span>,
|
||||
<?php _e('选中项'); ?>:
|
||||
<span rel="delete" lang="<?php _e('你确认要删除这些用户吗?'); ?>" class="operate-button operate-delete typecho-table-select-submit"><?php _e('删除'); ?></span>
|
||||
</p>
|
||||
<p class="search">
|
||||
<?php if ('' != $request->keywords): ?>
|
||||
<a href="<?php $options->adminUrl('manage-users.php'); ?>"><?php _e('« 取消筛选'); ?></a>
|
||||
<?php endif; ?>
|
||||
<input type="text" value="<?php '' != $request->keywords ? print(htmlspecialchars($request->keywords)) : _e('请输入关键字'); ?>"<?php if ('' == $request->keywords): ?> onclick="value='';name='keywords';" <?php else: ?> name="keywords"<?php endif; ?>/>
|
||||
<button type="submit"><?php _e('筛选'); ?></button>
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<form method="post" name="manage_users" class="operate-form" action="<?php $options->index('/action/users-edit'); ?>">
|
||||
<table class="typecho-list-table">
|
||||
<colgroup>
|
||||
<col width="25"/>
|
||||
<col width="150"/>
|
||||
<col width="150"/>
|
||||
<col width="30"/>
|
||||
<col width="300"/>
|
||||
<col width="165"/>
|
||||
<col width="70"/>
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="typecho-radius-topleft"> </th>
|
||||
<th><?php _e('用户名'); ?></th>
|
||||
<th><?php _e('昵称'); ?></th>
|
||||
<th> </th>
|
||||
<th><?php _e('电子邮件'); ?></th>
|
||||
<th><?php _e('用户组'); ?></th>
|
||||
<th class="typecho-radius-topright"><?php _e('文章'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php Typecho_Widget::widget('Widget_Users_Admin')->to($users); ?>
|
||||
<?php while($users->next()): ?>
|
||||
<tr<?php $users->alt(' class="even"', ''); ?> id="user-<?php $users->uid(); ?>">
|
||||
<td><input type="checkbox" value="<?php $users->uid(); ?>" name="uid[]"/></td>
|
||||
<td><a href="<?php $options->adminUrl('user.php?uid=' . $users->uid); ?>"><?php $users->name(); ?></a></td>
|
||||
<td><?php $users->screenName(); ?></td>
|
||||
<td>
|
||||
<a class="right hidden-by-mouse" href="<?php $users->permalink(); ?>"><img src="<?php $options->adminUrl('images/link.png'); ?>" title="<?php _e('浏览 %s', $users->screenName); ?>" width="16" height="16" alt="view" /></a>
|
||||
</td>
|
||||
<td><?php if($users->mail): ?><a href="mailto:<?php $users->mail(); ?>"><?php $users->mail(); ?></a><?php else: _e('暂无'); endif; ?></td>
|
||||
<td><?php switch ($users->group) {
|
||||
case 'administrator':
|
||||
_e('管理员');
|
||||
break;
|
||||
case 'editor':
|
||||
_e('编辑');
|
||||
break;
|
||||
case 'contributor':
|
||||
_e('贡献者');
|
||||
break;
|
||||
case 'subscriber':
|
||||
_e('关注者');
|
||||
break;
|
||||
case 'visitor':
|
||||
_e('访问者');
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
} ?></td>
|
||||
<td><a href="<?php $options->adminUrl('manage-posts.php?uid=' . $users->uid); ?>" class="balloon-button left size-<?php echo Typecho_Common::splitByCount($users->postsNum, 1, 10, 20, 50, 100); ?>"><?php $users->postsNum(); ?></a></td>
|
||||
</tr>
|
||||
<?php endwhile; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<input type="hidden" name="do" value="delete" />
|
||||
</form>
|
||||
|
||||
<?php if($users->have()): ?>
|
||||
<div class="typecho-pager">
|
||||
<div class="typecho-pager-content">
|
||||
<ul>
|
||||
<?php $users->pageNav(); ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include 'copyright.php';
|
||||
include 'common-js.php';
|
||||
include 'footer.php';
|
||||
?>
|
186
admin/media.php
Normal file
@ -0,0 +1,186 @@
|
||||
<?php
|
||||
include 'common.php';
|
||||
include 'header.php';
|
||||
include 'menu.php';
|
||||
|
||||
Typecho_Widget::widget('Widget_Contents_Attachment_Edit')->to($attachment);
|
||||
?>
|
||||
|
||||
<div class="main">
|
||||
<div class="body body-950">
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="container typecho-page-main">
|
||||
<div class="column-16 suffix">
|
||||
<div class="typecho-attachment-photo-box">
|
||||
<?php if ($attachment->attachment->isImage): ?>
|
||||
<img src="<?php $attachment->attachment->url(); ?>" alt="<?php $attachment->attachment->name(); ?>" />
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="description">
|
||||
<ul>
|
||||
<?php $mime = Typecho_Common::mimeIconType($attachment->attachment->mime); ?>
|
||||
<li><span class="typecho-mime typecho-mime-<?php echo $mime; ?>"></span><strong><?php $attachment->attachment->name(); ?></strong> <small><?php echo number_format(ceil($attachment->attachment->size / 1024)); ?> Kb</small></li>
|
||||
<li><input id="attachment-url" type="text" readonly class="text" value="<?php $attachment->attachment->url(); ?>" />
|
||||
<button id="exchange" disabled><?php _e('替换'); ?></button>
|
||||
<span id="swfu"><span id="swfu-placeholder"></span></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="column-08 typecho-mini-panel typecho-radius-topleft typecho-radius-topright typecho-radius-bottomleft typecho-radius-bottomright">
|
||||
<?php $attachment->form()->render(); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include 'copyright.php';
|
||||
include 'common-js.php';
|
||||
?>
|
||||
<script type="text/javascript" src="<?php $options->adminUrl('javascript/swfupload/swfupload.js?v=' . $suffixVersion); ?>"></script>
|
||||
<script type="text/javascript" src="<?php $options->adminUrl('javascript/swfupload/swfupload.queue.js?v=' . $suffixVersion); ?>"></script>
|
||||
<script type="text/javascript">
|
||||
(function () {
|
||||
window.addEvent('domready', function() {
|
||||
|
||||
$(document).getElement('.typecho-attachment-photo-box .description input').addEvent('click', function () {
|
||||
this.select();
|
||||
});
|
||||
|
||||
var swfuploadLoaded = function () {
|
||||
var btn = $(document)
|
||||
.getElement('.typecho-attachment-photo-box button#exchange');
|
||||
|
||||
var obj = $(document)
|
||||
.getElement('.typecho-attachment-photo-box .description ul li #swfu');
|
||||
|
||||
offset = obj.getCoordinates(btn);
|
||||
obj.setStyles({
|
||||
'width': btn.getSize().x,
|
||||
'height': btn.getSize().y,
|
||||
'left': 0 - offset.left,
|
||||
'top': 0 - offset.top
|
||||
});
|
||||
|
||||
btn.removeAttribute('disabled');
|
||||
};
|
||||
|
||||
var fileDialogComplete = function (numFilesSelected, numFilesQueued) {
|
||||
try {
|
||||
this.startUpload();
|
||||
} catch (ex) {
|
||||
this.debug(ex);
|
||||
}
|
||||
};
|
||||
|
||||
var uploadStart = function (file) {
|
||||
$(document)
|
||||
.getElement('.typecho-attachment-photo-box button#exchange')
|
||||
.set('html', '<?php _e('上传中'); ?>')
|
||||
.setAttribute('disabled', '');
|
||||
};
|
||||
|
||||
var uploadSuccess = function (file, serverData) {
|
||||
var _el = $(document).getElement('#attachment-url');
|
||||
var _result = JSON.decode(serverData);
|
||||
|
||||
_el.set('tween', {duration: 1500});
|
||||
|
||||
_el.setStyles({
|
||||
'background-position' : '-1000px 0',
|
||||
'background-color' : '#D3DBB3'
|
||||
});
|
||||
|
||||
<?php if ($attachment->attachment->isImage): ?>
|
||||
var _img = new Image(), _date = new Date();
|
||||
|
||||
_img.src = _result.url + (_result.url.indexOf('?') > 0 ? '&' : '?') + '__rds=' + _date.toUTCString();
|
||||
_img.alt = _result.title;
|
||||
|
||||
$(document).getElement('.typecho-attachment-photo-box img').destroy();
|
||||
$(_img).inject($(document).getElement('.typecho-attachment-photo-box'), 'top');
|
||||
<?php endif; ?>
|
||||
|
||||
$(document).getElement('.typecho-attachment-photo-box .description small')
|
||||
.set('html', Math.ceil(_result.size / 1024) + ' Kb');
|
||||
|
||||
_el.tween('background-color', '#D3DBB3', '#EEEEEE');
|
||||
};
|
||||
|
||||
var uploadComplete = function (file) {
|
||||
$(document)
|
||||
.getElement('.typecho-attachment-photo-box button#exchange')
|
||||
.set('html', '<?php _e('替换'); ?>')
|
||||
.removeAttribute('disabled');
|
||||
};
|
||||
|
||||
var uploadError = function (file, errorCode, message) {
|
||||
var _el = $(document).getElement('#attachment-url');
|
||||
var _fx = new Fx.Tween(_el, {duration: 3000});
|
||||
|
||||
_fx.start('background-color', '#CC0000', '#EEEEEE');
|
||||
};
|
||||
|
||||
var uploadProgress = function (file, bytesLoaded, bytesTotal) {
|
||||
var _el = $(document).getElement('#attachment-url');
|
||||
var percent = Math.ceil((1 - (bytesLoaded / bytesTotal)) * _el.getSize().x);
|
||||
_el.setStyle('background-position', '-' + percent + 'px 0');
|
||||
};
|
||||
|
||||
var swfu, _size = $(document).getElement('.typecho-attachment-photo-box button#exchange').getCoordinates(),
|
||||
settings = {
|
||||
flash_url : "<?php $options->adminUrl('javascript/swfupload/swfupload.swf'); ?>",
|
||||
upload_url: "<?php $options->index('/action/upload?do=modify&cid=' . $attachment->cid); ?>",
|
||||
post_params: {"__typecho_uid" : "<?php echo Typecho_Cookie::get('__typecho_uid'); ?>",
|
||||
"__typecho_authCode" : "<?php echo addslashes(Typecho_Cookie::get('__typecho_authCode')); ?>"},
|
||||
file_size_limit : "<?php $val = function_exists('ini_get') ? trim(ini_get('upload_max_filesize')) : 0;
|
||||
$last = strtolower($val[strlen($val)-1]);
|
||||
switch($last) {
|
||||
// The 'G' modifier is available since PHP 5.1.0
|
||||
case 'g':
|
||||
$val *= 1024;
|
||||
case 'm':
|
||||
$val *= 1024;
|
||||
case 'k':
|
||||
$val *= 1024;
|
||||
}
|
||||
|
||||
echo $val;
|
||||
?> byte",
|
||||
file_types : "<?php echo '' == $attachment->attachment->type ? $attachment->attachment->name :
|
||||
'*.' . $attachment->attachment->type; ?>",
|
||||
file_types_description : "<?php _e('所有文件'); ?>",
|
||||
file_upload_limit : 0,
|
||||
file_queue_limit : 1,
|
||||
debug: false,
|
||||
|
||||
//Handle Settings
|
||||
file_dialog_complete_handler : fileDialogComplete,
|
||||
upload_start_handler : uploadStart,
|
||||
upload_progress_handler : uploadProgress,
|
||||
upload_success_handler : uploadSuccess,
|
||||
queue_complete_handler : uploadComplete,
|
||||
upload_error_handler : uploadError,
|
||||
swfupload_loaded_handler : swfuploadLoaded,
|
||||
|
||||
// Button Settings
|
||||
button_placeholder_id : "swfu-placeholder",
|
||||
button_height: _size.height,
|
||||
button_text: '',
|
||||
button_text_style: '',
|
||||
button_text_left_padding: 14,
|
||||
button_text_top_padding: 0,
|
||||
button_width: _size.width,
|
||||
button_window_mode: SWFUpload.WINDOW_MODE.TRANSPARENT,
|
||||
button_cursor: SWFUpload.CURSOR.HAND
|
||||
};
|
||||
|
||||
swfu = new SWFUpload(settings);
|
||||
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
<?php
|
||||
include 'footer.php';
|
||||
?>
|
8
admin/menu.php
Normal file
@ -0,0 +1,8 @@
|
||||
<?php if(!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
|
||||
<div class="typecho-head-guid body-950">
|
||||
<dl id="typecho:guid">
|
||||
<?php $menu->output(); ?>
|
||||
</dl>
|
||||
<p class="operate"><?php Typecho_Plugin::factory('admin/menu.php')->navBar(); _e('欢迎'); ?>, <a href="<?php $options->adminUrl('profile.php'); ?>" class="author important"><?php $user->screenName(); ?></a>
|
||||
<a class="exit" href="<?php $options->logoutUrl(); ?>" title="<?php _e('登出'); ?>"><?php _e('登出'); ?></a></p>
|
||||
</div>
|
22
admin/options-discussion.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
include 'common.php';
|
||||
include 'header.php';
|
||||
include 'menu.php';
|
||||
?>
|
||||
|
||||
<div class="main">
|
||||
<div class="body body-950">
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="container typecho-page-main">
|
||||
<div class="column-22 start-02">
|
||||
<?php Typecho_Widget::widget('Widget_Options_Discussion')->form()->render(); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include 'copyright.php';
|
||||
include 'common-js.php';
|
||||
include 'footer.php';
|
||||
?>
|
22
admin/options-general.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
include 'common.php';
|
||||
include 'header.php';
|
||||
include 'menu.php';
|
||||
?>
|
||||
|
||||
<div class="main">
|
||||
<div class="body body-950">
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="container typecho-page-main">
|
||||
<div class="column-22 start-02">
|
||||
<?php Typecho_Widget::widget('Widget_Options_General')->form()->render(); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include 'copyright.php';
|
||||
include 'common-js.php';
|
||||
include 'footer.php';
|
||||
?>
|
39
admin/options-permalink.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
include 'common.php';
|
||||
include 'header.php';
|
||||
include 'menu.php';
|
||||
?>
|
||||
|
||||
<div class="main">
|
||||
<div class="body body-950">
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="container typecho-page-main">
|
||||
<div class="column-22 start-02">
|
||||
<?php Typecho_Widget::widget('Widget_Options_Permalink')->form()->render(); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include 'copyright.php';
|
||||
include 'common-js.php';
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function () {
|
||||
window.addEvent('domready', function() {
|
||||
|
||||
$(document)
|
||||
.getElement('input[name=customPattern]')
|
||||
.addEvent('click', function (event) {
|
||||
$('postPattern-custom').set('checked', true);
|
||||
this.focus();
|
||||
event.stop();
|
||||
});
|
||||
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
|
||||
<?php include 'footer.php'; ?>
|
22
admin/options-plugin.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
include 'common.php';
|
||||
include 'header.php';
|
||||
include 'menu.php';
|
||||
?>
|
||||
|
||||
<div class="main">
|
||||
<div class="body body-950">
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="container typecho-page-main">
|
||||
<div class="column-22 start-02">
|
||||
<?php Typecho_Widget::widget('Widget_Plugins_Config')->config()->render(); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include 'copyright.php';
|
||||
include 'common-js.php';
|
||||
include 'footer.php';
|
||||
?>
|
22
admin/options-reading.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
include 'common.php';
|
||||
include 'header.php';
|
||||
include 'menu.php';
|
||||
?>
|
||||
|
||||
<div class="main">
|
||||
<div class="body body-950">
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="container typecho-page-main">
|
||||
<div class="column-22 start-02">
|
||||
<?php Typecho_Widget::widget('Widget_Options_Reading')->form()->render(); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include 'copyright.php';
|
||||
include 'common-js.php';
|
||||
include 'footer.php';
|
||||
?>
|
27
admin/options-theme.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
include 'common.php';
|
||||
include 'header.php';
|
||||
include 'menu.php';
|
||||
?>
|
||||
|
||||
<div class="main">
|
||||
<div class="body body-950">
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="container typecho-page-main">
|
||||
<ul class="typecho-option-tabs">
|
||||
<li><a href="<?php $options->adminUrl('themes.php'); ?>"><?php _e('可以使用的外观'); ?></a></li>
|
||||
<li><a href="<?php $options->adminUrl('theme-editor.php'); ?>"><?php _e('编辑当前外观'); ?></a></li>
|
||||
<li class="current"><a href="<?php $options->adminUrl('options-theme.php'); ?>"><?php _e('设置外观'); ?></a></li>
|
||||
</ul>
|
||||
<div class="column-22 start-02">
|
||||
<?php Typecho_Widget::widget('Widget_Themes_Config')->config()->render(); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include 'copyright.php';
|
||||
include 'common-js.php';
|
||||
include 'footer.php';
|
||||
?>
|
18
admin/page-title.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php if(!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
|
||||
<?php if($notice->have() && in_array($notice->noticeType, array('success', 'notice', 'error'))): ?>
|
||||
<div class="container message <?php $notice->noticeType(); ?> popup typecho-radius-topleft typecho-radius-topright typecho-radius-bottomleft typecho-radius-bottomright">
|
||||
<ul>
|
||||
<?php $notice->lists(); ?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="container typecho-page-title">
|
||||
<div class="column-24">
|
||||
<h2><?php echo $menu->title; ?><?php
|
||||
if (!empty($menu->addLink)) {
|
||||
echo "<a href=\"{$menu->addLink}\">" . _t("新增") . "</a>";
|
||||
}
|
||||
?></h2>
|
||||
<p><a href="<?php $options->siteUrl(); ?>"><?php _e('查看我的站点'); ?></a></p>
|
||||
</div>
|
||||
</div>
|
144
admin/plugins.php
Normal file
@ -0,0 +1,144 @@
|
||||
<?php
|
||||
include 'common.php';
|
||||
include 'header.php';
|
||||
include 'menu.php';
|
||||
?>
|
||||
<div class="main">
|
||||
<div class="body body-950">
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="container typecho-page-main">
|
||||
<div class="column-24 typecho-list">
|
||||
<?php Typecho_Widget::widget('Widget_Plugins_List_Activated')->to($activatedPlugins); ?>
|
||||
<?php if ($activatedPlugins->have()): ?>
|
||||
<h6 class="typecho-list-table-title"><?php _e('激活的插件'); ?></h6>
|
||||
<table class="typecho-list-table">
|
||||
<colgroup>
|
||||
<col width="10"/>
|
||||
<col width="200"/>
|
||||
<col width="360"/>
|
||||
<col width="90"/>
|
||||
<col width="105"/>
|
||||
<col width="125"/>
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="typecho-radius-topleft"> </th>
|
||||
<th><?php _e('名称'); ?></th>
|
||||
<th><?php _e('描述'); ?></th>
|
||||
<th><?php _e('版本'); ?></th>
|
||||
<th><?php _e('作者'); ?></th>
|
||||
<th class="typecho-radius-topright"><?php _e('操作'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php while ($activatedPlugins->next()): ?>
|
||||
<tr<?php $activatedPlugins->alt(' class="even"', ''); ?> id="plugin-<?php $activatedPlugins->name(); ?>">
|
||||
<td></td>
|
||||
<td><?php $activatedPlugins->title(); ?>
|
||||
<?php if (!$activatedPlugins->dependence): ?>
|
||||
<img src="<?php $options->adminUrl('images/notice.gif'); ?>" title="<?php _e('%s 无法在此版本的typecho下正常工作', $activatedPlugins->title); ?>" alt="<?php _e('%s 无法在此版本的typecho下正常工作', $activatedPlugins->title); ?>" class="tiny" />
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td><?php $activatedPlugins->description(); ?></td>
|
||||
<td><?php $activatedPlugins->version(); ?></td>
|
||||
<td><?php echo empty($activatedPlugins->homepage) ? $activatedPlugins->author : '<a href="' . $activatedPlugins->homepage
|
||||
. '">' . $activatedPlugins->author . '</a>'; ?></td>
|
||||
<td>
|
||||
<?php if ($activatedPlugins->activate || $activatedPlugins->deactivate || $activatedPlugins->config || $activatedPlugins->personalConfig): ?>
|
||||
<?php if ($activatedPlugins->activated): ?>
|
||||
<?php if ($activatedPlugins->config): ?>
|
||||
<a href="<?php $options->adminUrl('options-plugin.php?config=' . $activatedPlugins->name); ?>"><?php _e('设置'); ?></a>
|
||||
|
|
||||
<?php endif; ?>
|
||||
<a lang="<?php _e('你确认要禁用插件 %s 吗?', $activatedPlugins->name); ?>" href="<?php $options->index('/action/plugins-edit?deactivate=' . $activatedPlugins->name); ?>"><?php _e('禁用'); ?></a>
|
||||
<?php else: ?>
|
||||
<a href="<?php $options->index('/action/plugins-edit?activate=' . $activatedPlugins->name); ?>"><?php _e('激活'); ?></a>
|
||||
<?php endif; ?>
|
||||
<?php else: ?>
|
||||
<span class="important"><?php _e('即插即用'); ?></span>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endwhile; ?>
|
||||
|
||||
<?php if (!empty($activatedPlugins->activatedPlugins)): ?>
|
||||
<?php foreach ($activatedPlugins->activatedPlugins as $key => $val): ?>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><?php echo $key; ?></td>
|
||||
<td colspan="3"><span class="warning"><?php _e('此插件文件已经损坏或者被不安全移除, 强烈建议你禁用它'); ?></span></td>
|
||||
<td><a lang="<?php _e('你确认要禁用插件 %s 吗?', $key); ?>" href="<?php $options->index('/action/plugins-edit?deactivate=' . $key); ?>"><?php _e('禁用'); ?></a></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php Typecho_Widget::widget('Widget_Plugins_List_Deactivated')->to($deactivatedPlugins); ?>
|
||||
<?php if ($deactivatedPlugins->have() || !$activatedPlugins->have()): ?>
|
||||
<h6 class="typecho-list-table-title"><?php _e('禁用的插件'); ?></h6>
|
||||
<table class="typecho-list-table deactivate">
|
||||
<colgroup>
|
||||
<col width="10"/>
|
||||
<col width="200"/>
|
||||
<col width="360"/>
|
||||
<col width="90"/>
|
||||
<col width="105"/>
|
||||
<col width="125"/>
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="typecho-radius-topleft"> </th>
|
||||
<th><?php _e('名称'); ?></th>
|
||||
<th><?php _e('描述'); ?></th>
|
||||
<th><?php _e('版本'); ?></th>
|
||||
<th><?php _e('作者'); ?></th>
|
||||
<th class="typecho-radius-topright"><?php _e('操作'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if ($deactivatedPlugins->have()): ?>
|
||||
<?php while ($deactivatedPlugins->next()): ?>
|
||||
<tr<?php $deactivatedPlugins->alt(' class="even"', ''); ?> id="plugin-<?php $deactivatedPlugins->name(); ?>">
|
||||
<td></td>
|
||||
<td><?php $deactivatedPlugins->title(); ?></td>
|
||||
<td><?php $deactivatedPlugins->description(); ?></td>
|
||||
<td><?php $deactivatedPlugins->version(); ?></td>
|
||||
<td><?php echo empty($deactivatedPlugins->homepage) ? $deactivatedPlugins->author : '<a href="' . $deactivatedPlugins->homepage
|
||||
. '">' . $deactivatedPlugins->author . '</a>'; ?></td>
|
||||
<td>
|
||||
<?php if ($deactivatedPlugins->activate || $deactivatedPlugins->deactivate || $deactivatedPlugins->config || $deactivatedPlugins->personalConfig): ?>
|
||||
<?php if ($deactivatedPlugins->activated): ?>
|
||||
<?php if ($deactivatedPlugins->config): ?>
|
||||
<a href="<?php $options->adminUrl('options-plugin.php?config=' . $deactivatedPlugins->name); ?>"><?php _e('设置'); ?></a>
|
||||
|
|
||||
<?php endif; ?>
|
||||
<a href="<?php $options->index('/action/plugins-edit?deactivate=' . $deactivatedPlugins->name); ?>"><?php _e('禁用'); ?></a>
|
||||
<?php else: ?>
|
||||
<a href="<?php $options->index('/action/plugins-edit?activate=' . $deactivatedPlugins->name); ?>"><?php _e('激活'); ?></a>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endwhile; ?>
|
||||
<?php else: ?>
|
||||
<tr class="even">
|
||||
<td colspan="6"><?php _e('没有安装插件'); ?></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include 'copyright.php';
|
||||
include 'common-js.php';
|
||||
include 'footer.php';
|
||||
?>
|
46
admin/profile.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
include 'common.php';
|
||||
include 'header.php';
|
||||
include 'menu.php';
|
||||
|
||||
$stat = Typecho_Widget::widget('Widget_Stat');
|
||||
?>
|
||||
|
||||
<div class="main">
|
||||
<div class="body body-950">
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="container typecho-page-main">
|
||||
<div class="column-16 suffix typecho-content-panel">
|
||||
<h4>
|
||||
<?php echo '<img class="avatar" src="http://www.gravatar.com/avatar/' . md5($user->mail) . '?s=50&r=X' .
|
||||
'&d=" alt="' . $user->screenName . '" width="50" height="50" />'; ?>
|
||||
<?php $user->name(); ?><cite>(<?php $user->screenName(); ?>)</cite>
|
||||
</h4>
|
||||
<p><?php _e('目前有 <em>%s</em> 篇 Blog,并有 <em>%s</em> 条关于你的评论在已设定的 <em>%s</em> 个分类中.',
|
||||
$stat->myPublishedPostsNum, $stat->myPublishedCommentsNum, $stat->categoriesNum); ?></p>
|
||||
<p><?php
|
||||
if ($user->logged > 0) {
|
||||
_e('最后登录: %s', Typecho_I18n::dateWord($user->logged + $options->timezone, $options->gmtTime + $options->timezone));
|
||||
}
|
||||
?></p>
|
||||
<?php if($user->pass('contributor', true)): ?>
|
||||
<h3 id="writing-option"><?php _e('撰写设置'); ?></h3>
|
||||
<?php Typecho_Widget::widget('Widget_Users_Profile')->optionsForm()->render(); ?>
|
||||
<?php endif; ?>
|
||||
<?php Typecho_Widget::widget('Widget_Users_Profile')->personalFormList(); ?>
|
||||
<h3 id="change-password"><?php _e('设置密码'); ?></h3>
|
||||
<?php Typecho_Widget::widget('Widget_Users_Profile')->passwordForm()->render(); ?>
|
||||
</div>
|
||||
<div class="column-08 typecho-mini-panel typecho-radius-topleft typecho-radius-topright typecho-radius-bottomleft typecho-radius-bottomright">
|
||||
<?php Typecho_Widget::widget('Widget_Users_Profile')->profileForm()->render(); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include 'copyright.php';
|
||||
include 'common-js.php';
|
||||
Typecho_Plugin::factory('admin/profile.php')->bottom();
|
||||
include 'footer.php';
|
||||
?>
|
75
admin/register.php
Normal file
@ -0,0 +1,75 @@
|
||||
<?php
|
||||
include 'common.php';
|
||||
include 'header.php';
|
||||
|
||||
$rememberName = Typecho_Cookie::get('__typecho_remember_name');
|
||||
$rememberMail = Typecho_Cookie::get('__typecho_remember_mail');
|
||||
Typecho_Cookie::delete('__typecho_remember_name');
|
||||
Typecho_Cookie::delete('__typecho_remember_mail');
|
||||
?>
|
||||
<div class="body body-950">
|
||||
<div class="container">
|
||||
<div class="column-07 start-09 typecho-login">
|
||||
<h2 class="logo-dark">typecho</h2>
|
||||
<form action="<?php $options->registerAction(); ?>" method="post" name="register">
|
||||
<fieldset>
|
||||
<?php if(!$user->hasLogin() && $options->allowRegister): ?>
|
||||
<?php if($notice->have() && in_array($notice->noticeType, array('success', 'notice', 'error'))): ?>
|
||||
<div class="message <?php $notice->noticeType(); ?> typecho-radius-topleft typecho-radius-topright typecho-radius-bottomleft typecho-radius-bottomright">
|
||||
<ul>
|
||||
<?php $notice->lists(); ?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<p><label for="name"><?php _e('用户名'); ?>:</label> <input type="text" id="name" name="name" value="<?php echo $rememberName; ?>" class="text" /></p>
|
||||
<p><label for="mail"><?php _e('电子邮件'); ?>:</label> <input type="text" id="mail" name="mail" value="<?php echo $rememberMail; ?>" class="text" /></p>
|
||||
<p class="submit">
|
||||
<label for="remember"><input type="checkbox" name="remember" class="checkbox" value="1" id="remember" /> <?php _e('记住我'); ?></label>
|
||||
<button type="submit"><?php _e('注册'); ?></button>
|
||||
</p>
|
||||
<?php elseif (!$options->allowRegister): ?>
|
||||
<div class="message error typecho-radius-topleft typecho-radius-topright typecho-radius-bottomleft typecho-radius-bottomright">
|
||||
<ul>
|
||||
<li><?php _e('网站注册已关闭'); ?></li>
|
||||
</ul>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<?php if($notice->have() && in_array($notice->noticeType, array('success', 'notice', 'error'))): ?>
|
||||
<div class="message <?php $notice->noticeType(); ?> typecho-radius-topleft typecho-radius-topright typecho-radius-bottomleft typecho-radius-bottomright">
|
||||
<ul>
|
||||
<?php $notice->lists(); ?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="message notice typecho-radius-topleft typecho-radius-topright typecho-radius-bottomleft typecho-radius-bottomright">
|
||||
<ul>
|
||||
<li><?php _e('您已经登录到%s', $options->title); ?></li>
|
||||
</ul>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
<div class="more-link">
|
||||
<p class="back-to-site">
|
||||
<a href="<?php $options->siteUrl(); ?>" class="important"><?php _e('« 返回%s', $options->title); ?></a>
|
||||
</p>
|
||||
<p class="forgot-password">
|
||||
<?php if($user->hasLogin()): ?>
|
||||
<a href="<?php $options->adminUrl(); ?>"><?php _e('进入后台 »'); ?></a>
|
||||
<?php else: ?>
|
||||
<a href="<?php $options->adminUrl('login.php'); ?>"><?php _e('登录 »'); ?></a>
|
||||
<?php endif; ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
(function () {
|
||||
var _form = document.register.name;
|
||||
_form.focus();
|
||||
})();
|
||||
</script>
|
||||
<?php include 'footer.php'; ?>
|
62
admin/theme-editor.php
Normal file
@ -0,0 +1,62 @@
|
||||
<?php
|
||||
include 'common.php';
|
||||
include 'header.php';
|
||||
include 'menu.php';
|
||||
|
||||
Typecho_Widget::widget('Widget_Themes_Files')->to($files);
|
||||
?>
|
||||
|
||||
<div class="main">
|
||||
<div class="body body-950">
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="container typecho-page-main">
|
||||
<div class="column-24">
|
||||
<ul class="typecho-option-tabs">
|
||||
<li><a href="<?php $options->adminUrl('themes.php'); ?>"><?php _e('可以使用的外观'); ?></a></li>
|
||||
<li class="current"><a href="<?php $options->adminUrl('theme-editor.php'); ?>">
|
||||
<?php if ($options->theme == $files->theme): ?>
|
||||
<?php _e('编辑当前外观'); ?>
|
||||
<?php else: ?>
|
||||
<?php _e('编辑%s外观', ' <cite>' . $files->theme . '</cite> '); ?>
|
||||
<?php endif; ?>
|
||||
</a></li>
|
||||
<?php if (Widget_Themes_Config::isExists()): ?>
|
||||
<li><a href="<?php $options->adminUrl('options-theme.php'); ?>"><?php _e('设置外观'); ?></a></li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
|
||||
<div class="typecho-edit-theme">
|
||||
<div>
|
||||
<ul>
|
||||
<?php while($files->next()): ?>
|
||||
<li<?php if($files->current): ?> class="current"<?php endif; ?>>
|
||||
<a href="<?php $options->adminUrl('theme-editor.php?theme=' . $files->currentTheme() . '&file=' . $files->file); ?>"><?php $files->file(); ?></a></li>
|
||||
<?php endwhile; ?>
|
||||
</ul>
|
||||
<div class="content">
|
||||
<form method="post" name="theme" id="theme" action="<?php $options->index('/action/themes-edit'); ?>">
|
||||
<textarea name="content" id="content" <?php if(!$files->currentIsWriteable()): ?>readonly<?php endif; ?>><?php echo $files->currentContent(); ?></textarea>
|
||||
<div class="submit">
|
||||
<?php if($files->currentIsWriteable()): ?>
|
||||
<input type="hidden" name="theme" value="<?php echo $files->currentTheme(); ?>" />
|
||||
<input type="hidden" name="edit" value="<?php echo $files->currentFile(); ?>" />
|
||||
<button type="submit"><?php _e('保存文件'); ?></button>
|
||||
<?php else: ?>
|
||||
<h6 class="typecho-list-table-title"><?php _e('此文件无法写入'); ?></h6>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include 'copyright.php';
|
||||
include 'common-js.php';
|
||||
Typecho_Plugin::factory('admin/theme-editor.php')->bottom($files);
|
||||
include 'footer.php';
|
||||
?>
|
131
admin/themes.php
Normal file
@ -0,0 +1,131 @@
|
||||
<?php
|
||||
include 'common.php';
|
||||
include 'header.php';
|
||||
include 'menu.php';
|
||||
?>
|
||||
|
||||
<div class="main">
|
||||
<div class="body body-950">
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="container typecho-page-main">
|
||||
<div class="column-24">
|
||||
<ul class="typecho-option-tabs">
|
||||
<li class="current"><a href="<?php $options->adminUrl('themes.php'); ?>"><?php _e('可以使用的外观'); ?></a></li>
|
||||
<li><a href="<?php $options->adminUrl('theme-editor.php'); ?>"><?php _e('编辑当前外观'); ?></a></li>
|
||||
<?php if (Widget_Themes_Config::isExists()): ?>
|
||||
<li><a href="<?php $options->adminUrl('options-theme.php'); ?>"><?php _e('设置外观'); ?></a></li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
|
||||
<table class="typecho-list-table typecho-theme-list" cellspacing="0" cellpadding="0">
|
||||
<colgroup>
|
||||
<col width="450"/>
|
||||
<col width="450"/>
|
||||
</colgroup>
|
||||
<?php Typecho_Widget::widget('Widget_Themes_List')->to($themes); ?>
|
||||
<?php while($themes->next()): ?>
|
||||
<?php $themes->alt('<tr>', ''); ?>
|
||||
<?php
|
||||
$borderBottom = ($themes->length - $themes->sequence >= ($themes->length % 2 ? 1 : 2));
|
||||
?>
|
||||
<td id="theme-<?php $themes->name(); ?>" class="<?php if($themes->activated): ?>current <?php endif; $themes->alt('border-right', ''); if ($borderBottom): echo ' border-bottom'; endif; ?>">
|
||||
<div class="column-04">
|
||||
<img src="<?php $themes->screen(); ?>" width="120" height="90" align="left" />
|
||||
</div>
|
||||
<div class="column-08">
|
||||
<h4><?php '' != $themes->title ? $themes->title() : $themes->name(); ?></h4>
|
||||
<cite><?php if($themes->author): ?><?php _e('作者'); ?>: <?php if($themes->homepage): ?><a href="<?php $themes->homepage() ?>"><?php endif; ?><?php $themes->author(); ?><?php if($themes->homepage): ?></a><?php endif; ?> <?php endif; ?>
|
||||
<?php if($themes->version): ?><?php _e('版本'); ?>: <?php $themes->version() ?><?php endif; ?>
|
||||
</cite>
|
||||
<p><?php echo nl2br($themes->description); ?></p>
|
||||
</div>
|
||||
<?php if($options->theme != $themes->name): ?>
|
||||
<a class="edit" href="<?php $options->adminUrl('theme-editor.php?theme=' . $themes->name); ?>"><?php _e('编辑'); ?></a>
|
||||
<a class="activate" href="<?php $options->index('/action/themes-edit?change=' . $themes->name); ?>"><?php _e('激活'); ?></a>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<?php $last = $themes->sequence; ?>
|
||||
<?php $themes->alt('', '</tr>'); ?>
|
||||
<?php endwhile; ?>
|
||||
<?php if($last % 2): ?>
|
||||
<td> </td></tr>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include 'copyright.php';
|
||||
include 'common-js.php';
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function () {
|
||||
window.addEvent('domready', function() {
|
||||
$(document).getElements('table.typecho-list-table tr td').each(function (item, index) {
|
||||
var _a = item.getElement('a.activate'),
|
||||
_e = item.getElement('a.edit');
|
||||
|
||||
if (_a && _e) {
|
||||
item.addEvents({
|
||||
|
||||
'mouseover': function () {
|
||||
this.addClass('hover');
|
||||
|
||||
if (0 == index % 2) {
|
||||
_a.setStyles({
|
||||
|
||||
'right': _a.getParent('td').getNext('td').getSize().x + 1,
|
||||
|
||||
'top': _a.getParent('td').getPosition(_a.getParent('.column-24')).y
|
||||
|
||||
});
|
||||
|
||||
_a.addClass('typecho-radius-bottomleft');
|
||||
|
||||
_e.setStyles({
|
||||
|
||||
'right': _e.getParent('td').getNext('td').getSize().x + 1,
|
||||
|
||||
'top': _e.getParent('td').getPosition(_e.getParent('.column-24')).y + _e.getParent('td').getSize().y - _e.getSize().y - 1
|
||||
|
||||
});
|
||||
|
||||
_e.addClass('typecho-radius-topleft');
|
||||
} else {
|
||||
_a.setStyles({
|
||||
|
||||
'left': _a.getParent('td').getPosition(_a.getParent('.column-24')).x,
|
||||
|
||||
'top': _a.getParent('td').getPosition(_a.getParent('.column-24')).y
|
||||
|
||||
});
|
||||
|
||||
_a.addClass('typecho-radius-bottomright');
|
||||
|
||||
_e.setStyles({
|
||||
|
||||
'left': _e.getParent('td').getPosition(_e.getParent('.column-24')).x,
|
||||
|
||||
'top': _e.getParent('td').getPosition(_e.getParent('.column-24')).y + _e.getParent('td').getSize().y - _e.getSize().y - 1
|
||||
|
||||
});
|
||||
|
||||
_e.addClass('typecho-radius-topright');
|
||||
}
|
||||
},
|
||||
|
||||
'mouseleave': function () {
|
||||
this.removeClass('hover');
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
|
||||
<?php include 'footer.php'; ?>
|
36
admin/upgrade.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
include 'common.php';
|
||||
include 'header.php';
|
||||
include 'menu.php';
|
||||
?>
|
||||
|
||||
<div class="main">
|
||||
<div class="body body-950">
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="container typecho-page-main">
|
||||
<div class="column-22 start-02">
|
||||
<div class="message notice typecho-radius-topleft typecho-radius-topright typecho-radius-bottomleft typecho-radius-bottomright">
|
||||
<form action="<?php echo Typecho_Router::url('do', array('action' => 'upgrade', 'widget' => 'Upgrade'),
|
||||
Typecho_Common::url('index.php', $options->siteUrl)); ?>" method="post">
|
||||
<h6><?php _e('检测到新版本!'); ?></h6>
|
||||
<blockquote>
|
||||
<ul>
|
||||
<li><?php _e('您已经更新了系统程序, 我们还需要执行一些后续步骤来完成升级'); ?></li>
|
||||
<li><?php _e('此程序将把您的系统从 <strong>%s</strong> 升级到 <strong>%s</strong>', $options->version, Typecho_Common::VERSION); ?></li>
|
||||
<li><strong><?php _e('在升级之前强烈建议先备份您的数据'); ?></strong></li>
|
||||
</ul>
|
||||
</blockquote>
|
||||
<br />
|
||||
<p><button type="submit"><?php _e('完成升级 »'); ?></button></p>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include 'copyright.php';
|
||||
include 'common-js.php';
|
||||
include 'footer.php';
|
||||
?>
|
23
admin/user.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
include 'common.php';
|
||||
|
||||
include 'header.php';
|
||||
include 'menu.php';
|
||||
?>
|
||||
|
||||
<div class="main">
|
||||
<div class="body body-950">
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="container typecho-page-main">
|
||||
<div class="column-22 start-02">
|
||||
<?php Typecho_Widget::widget('Widget_Users_Edit')->form()->render(); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include 'copyright.php';
|
||||
include 'common-js.php';
|
||||
include 'footer.php';
|
||||
?>
|
40
admin/welcome.php
Normal file
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
include 'common.php';
|
||||
include 'header.php';
|
||||
include 'menu.php';
|
||||
?>
|
||||
|
||||
<div class="main">
|
||||
<div class="body body-950">
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="container typecho-page-main">
|
||||
<div class="column-22 start-02">
|
||||
<div class="message success typecho-radius-topleft typecho-radius-topright typecho-radius-bottomleft typecho-radius-bottomright">
|
||||
<form action="<?php $options->adminUrl(); ?>" method="get">
|
||||
<h6><?php _e('欢迎您使用 "%s" 管理后台!', $options->title); ?></h6>
|
||||
<blockquote>
|
||||
<ul>
|
||||
<li><strong><?php _e('快速导航'); ?></strong></li>
|
||||
<li><strong>1.</strong> <a class="operate-delete" href="<?php $options->adminUrl('profile.php#change-password'); ?>"><?php _e('强烈建议更改你的默认密码'); ?></a></li>
|
||||
<?php if($user->pass('contributor', true)): ?>
|
||||
<li><strong>2.</strong> <a href="<?php $options->adminUrl('write-post.php'); ?>"><?php _e('撰写第一篇日志'); ?></a></li>
|
||||
<li><strong>3.</strong> <a href="<?php $options->siteUrl(); ?>"><?php _e('查看我的站点'); ?></a></li>
|
||||
<?php else: ?>
|
||||
<li><strong>2.</strong> <a href="<?php $options->siteUrl(); ?>"><?php _e('查看我的站点'); ?></a></li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</blockquote>
|
||||
<br />
|
||||
<p><button type="submit"><?php _e('让我直接开始使用吧 »'); ?></button></p>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include 'copyright.php';
|
||||
include 'common-js.php';
|
||||
include 'footer.php';
|
||||
?>
|
89
admin/write-js.php
Normal file
@ -0,0 +1,89 @@
|
||||
<?php Typecho_Plugin::factory('admin/write-js.php')->trigger($plugged)->editorPreview(); ?>
|
||||
<?php if (!$plugged): ?>
|
||||
<script type="text/javascript">
|
||||
var editorPreview = function () {
|
||||
var textarea = $('text'), old = '', preview = $('typecho-preview-box');
|
||||
|
||||
var t = setInterval(function () {
|
||||
var current = textarea.get('value');
|
||||
|
||||
if (old != current) {
|
||||
preview.set('html', Typecho.preview.autop(current));
|
||||
old = current;
|
||||
}
|
||||
}, 100);
|
||||
}
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function () {
|
||||
window.addEvent('domready', function() {
|
||||
|
||||
$(document).getElements('.typecho-date').each(function (item) {
|
||||
item.setProperty('name', '_' + item.getProperty('name'));
|
||||
item.addEvent('change', function () {
|
||||
|
||||
$(document).getElements('.typecho-date').each(function (_item) {
|
||||
var name = _item.name;
|
||||
|
||||
if (0 == name.indexOf('_')) {
|
||||
_item.setProperty('name', name.slice(1));
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
item.removeProperty('disabled');
|
||||
});
|
||||
|
||||
/** 绑定按钮 */
|
||||
$(document).getElement('span.advance').addEvent('click', function () {
|
||||
Typecho.toggle('#advance-panel', this,
|
||||
'<?php _e('收起高级选项'); ?>', '<?php _e('展开高级选项'); ?>');
|
||||
});
|
||||
|
||||
$(document).getElement('span.attach').addEvent('click', function () {
|
||||
Typecho.toggle('#upload-panel', this,
|
||||
'<?php _e('收起附件'); ?>', '<?php _e('展开附件'); ?>');
|
||||
});
|
||||
|
||||
$('btn-save').removeProperty('disabled');
|
||||
$('btn-submit').removeProperty('disabled');
|
||||
|
||||
$('btn-save').addEvent('click', function (e) {
|
||||
this.getParent('span').addClass('loading');
|
||||
this.setProperty('disabled', true);
|
||||
$(document).getElement('input[name=do]').set('value', 'save');
|
||||
$(document).getElement('.typecho-post-area form').submit();
|
||||
});
|
||||
|
||||
$('btn-submit').addEvent('click', function (e) {
|
||||
this.getParent('span').addClass('loading');
|
||||
this.setProperty('disabled', true);
|
||||
$(document).getElement('input[name=do]').set('value', 'publish');
|
||||
$(document).getElement('.typecho-post-area form').submit();
|
||||
});
|
||||
|
||||
if ('undefined' != typeof(editorPreview)) {
|
||||
//$(document).getElement('.typecho-preview-label').setStyle('display', 'block');
|
||||
|
||||
function togglePreview(el) {
|
||||
if (el.getProperty('checked')) {
|
||||
$('typecho-preview-box').setStyle('display', 'block');
|
||||
} else {
|
||||
$('typecho-preview-box').setStyle('display', 'none');
|
||||
}
|
||||
|
||||
return el;
|
||||
}
|
||||
|
||||
togglePreview($('btn-preview')).addEvent('click', function (e) {
|
||||
togglePreview(this);
|
||||
});
|
||||
|
||||
editorPreview();
|
||||
}
|
||||
});
|
||||
})();
|
||||
</script>
|
141
admin/write-page.php
Normal file
@ -0,0 +1,141 @@
|
||||
<?php
|
||||
include 'common.php';
|
||||
include 'header.php';
|
||||
include 'menu.php';
|
||||
Typecho_Widget::widget('Widget_Contents_Page_Edit')->to($page);
|
||||
?>
|
||||
<div class="main">
|
||||
<div class="body body-950">
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="container typecho-page-main typecho-post-option typecho-post-area">
|
||||
<form action="<?php $options->index('/action/contents-page-edit'); ?>" method="post" name="write_page">
|
||||
<div class="column-18 suffix">
|
||||
<div class="column-18">
|
||||
<label for="title" class="typecho-label"><?php _e('标题'); ?>
|
||||
<?php if ($page->draft && $page->draft['cid'] != $page->cid): ?>
|
||||
<?php $pageModifyDate = new Typecho_Date($page->draft['modified']); ?>
|
||||
<cite><?php _e('当前正在编辑的是保存于%s的草稿, 你可以<a href="%s">删除它</a>', $pageModifyDate->word(),
|
||||
Typecho_Common::url('/action/contents-page-edit?do=deleteDraft&cid=' . $page->cid, $options->index)); ?></cite>
|
||||
<?php endif; ?>
|
||||
</label>
|
||||
<p class="title"><input type="text" id="title" name="title" value="<?php echo htmlspecialchars($page->title); ?>" class="text title" /></p>
|
||||
<label for="text" class="typecho-label"><?php _e('内容'); ?><cite id="auto-save-message"></cite></label>
|
||||
<p><textarea style="height: <?php $options->editorSize(); ?>px" autocomplete="off" id="text" name="text"><?php echo htmlspecialchars($page->text); ?></textarea></p>
|
||||
<?php Typecho_Plugin::factory('admin/write-page.php')->content($page); ?>
|
||||
<p class="submit">
|
||||
<span class="left">
|
||||
<span class="typecho-preview-label"><input type="checkbox" name="preview" id="btn-preview" /> <label for="btn-preview"><?php _e('预览内容'); ?></label></span>
|
||||
<span class="advance close" tabindex="0"><?php _e('展开高级选项'); ?></span>
|
||||
<span class="attach" tabindex="0"><?php _e('展开附件'); ?></span>
|
||||
</span>
|
||||
<span class="right">
|
||||
<input type="hidden" name="cid" value="<?php $page->cid(); ?>" />
|
||||
<input type="hidden" name="do" value="publish" />
|
||||
<button type="button" id="btn-save"><?php _e('保存草稿'); ?></button>
|
||||
<button type="button" id="btn-submit"><?php _e('发布页面 »'); ?></button>
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<ul id="advance-panel" class="typecho-post-option column-18">
|
||||
<li class="column-18">
|
||||
<div class="column-12">
|
||||
<label for="order" class="typecho-label"><?php _e('页面顺序'); ?></label>
|
||||
<p><input type="text" id="order" name="order" value="<?php $page->order(); ?>" class="mini" /></p>
|
||||
<p class="description"><?php _e('为你的自定义页面设定一个序列值以后, 能够使得它们按此值从小到大排列'); ?></p>
|
||||
<br />
|
||||
<label for="template" class="typecho-label"><?php _e('自定义模板'); ?></label>
|
||||
<p>
|
||||
<select name="template" id="template">
|
||||
<option value=""><?php _e('不选择'); ?></option>
|
||||
<?php $templates = $page->getTemplates(); foreach ($templates as $template => $name): ?>
|
||||
<option value="<?php echo $template; ?>"<?php if($template == $page->template): ?> selected="true"<?php endif; ?>><?php echo $name; ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</p>
|
||||
<p class="description"><?php _e('如果你为此页面选择了一个自定义模板, 系统将按照你选择的模板文件展现它'); ?></p>
|
||||
<?php Typecho_Plugin::factory('admin/write-page.php')->advanceOptionLeft($page); ?>
|
||||
</div>
|
||||
<div class="column-06">
|
||||
<label class="typecho-label"><?php _e('权限控制'); ?></label>
|
||||
<ul>
|
||||
<li><input id="allowComment" name="allowComment" type="checkbox" value="1" <?php if($page->allow('comment')): ?>checked="true"<?php endif; ?> />
|
||||
<label for="allowComment"><?php _e('允许评论'); ?></label></li>
|
||||
<li><input id="allowPing" name="allowPing" type="checkbox" value="1" <?php if($page->allow('ping')): ?>checked="true"<?php endif; ?> />
|
||||
<label for="allowPing"><?php _e('允许被引用'); ?></label></li>
|
||||
<li><input id="allowFeed" name="allowFeed" type="checkbox" value="1" <?php if($page->allow('feed')): ?>checked="true"<?php endif; ?> />
|
||||
<label for="allowFeed"><?php _e('允许在聚合中出现'); ?></label></li>
|
||||
<?php Typecho_Plugin::factory('admin/write-page.php')->advanceOptionRight($page); ?>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<ul id="upload-panel" class="column-18">
|
||||
<li class="column-18">
|
||||
<?php include 'file-upload.php'; ?>
|
||||
</li>
|
||||
</ul>
|
||||
<div id="typecho-preview-box"></div>
|
||||
</div>
|
||||
<div class="column-06">
|
||||
<ul class="typecho-post-option">
|
||||
<li>
|
||||
<label for="date" class="typecho-label"><?php _e('日期'); ?></label>
|
||||
<p>
|
||||
<select disabled class="typecho-date" name="month" id="month">
|
||||
<option value="1" <?php if (1 == $page->date->format('n')): ?>selected="true"<?php endif; ?>><?php _e('一月'); ?></option>
|
||||
<option value="2" <?php if (2 == $page->date->format('n')): ?>selected="true"<?php endif; ?>><?php _e('二月'); ?></option>
|
||||
<option value="3" <?php if (3 == $page->date->format('n')): ?>selected="true"<?php endif; ?>><?php _e('三月'); ?></option>
|
||||
<option value="4" <?php if (4 == $page->date->format('n')): ?>selected="true"<?php endif; ?>><?php _e('四月'); ?></option>
|
||||
<option value="5" <?php if (5 == $page->date->format('n')): ?>selected="true"<?php endif; ?>><?php _e('五月'); ?></option>
|
||||
<option value="6" <?php if (6 == $page->date->format('n')): ?>selected="true"<?php endif; ?>><?php _e('六月'); ?></option>
|
||||
<option value="7" <?php if (7 == $page->date->format('n')): ?>selected="true"<?php endif; ?>><?php _e('七月'); ?></option>
|
||||
<option value="8" <?php if (8 == $page->date->format('n')): ?>selected="true"<?php endif; ?>><?php _e('八月'); ?></option>
|
||||
<option value="9" <?php if (9 == $page->date->format('n')): ?>selected="true"<?php endif; ?>><?php _e('九月'); ?></option>
|
||||
<option value="10" <?php if (10 == $page->date->format('n')): ?>selected="true"<?php endif; ?>><?php _e('十月'); ?></option>
|
||||
<option value="11" <?php if (11 == $page->date->format('n')): ?>selected="true"<?php endif; ?>><?php _e('十一月'); ?></option>
|
||||
<option value="12" <?php if (12 == $page->date->format('n')): ?>selected="true"<?php endif; ?>><?php _e('十二月'); ?></option>
|
||||
</select>
|
||||
<input disabled class="typecho-date" size="4" maxlength="4" type="text" name="day" id="day" value="<?php $page->date('d'); ?>" />
|
||||
,
|
||||
<input disabled class="typecho-date" size="4" maxlength="4" type="text" name="year" id="year" value="<?php $page->date('Y'); ?>" />
|
||||
@
|
||||
<input disabled class="typecho-date" size="2" maxlength="2" type="text" name="hour" id="hour" value="<?php $page->date('H'); ?>" />
|
||||
:
|
||||
<input disabled class="typecho-date" size="2" maxlength="2" type="text" name="min" id="min" value="<?php $page->date('i'); ?>" />
|
||||
</p>
|
||||
<p class="description"><?php _e('请选择一个发布日期'); ?></p>
|
||||
</li>
|
||||
<li>
|
||||
<label for="slug" class="typecho-label"><?php _e('缩略名'); ?></label>
|
||||
<p><input type="text" id="slug" name="slug" value="<?php $page->slug(); ?>" class="mini" /></p>
|
||||
<p class="description"><?php _e('为这篇日志自定义链接地址, 有利于搜索引擎收录'); ?></p>
|
||||
</li>
|
||||
<?php Typecho_Plugin::factory('admin/write-page.php')->option($page); ?>
|
||||
<?php if($page->have()): ?>
|
||||
<?php $modified = new Typecho_Date($page->modified); ?>
|
||||
<li>
|
||||
<label class="typecho-label"><?php _e('本页面由 %s 创建', $page->author->screenName); ?></label>
|
||||
<p class="description"><?php _e('最后修改于 %s', $modified->word()); ?></p>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include 'copyright.php';
|
||||
include 'common-js.php';
|
||||
include 'write-js.php';
|
||||
|
||||
Typecho_Plugin::factory('admin/write-page.php')->trigger($plugged)->richEditor($page);
|
||||
if (!$plugged) {
|
||||
include 'editor-js.php';
|
||||
}
|
||||
Typecho_Plugin::factory('admin/write-page.php')->bottom($page);
|
||||
include 'file-upload-js.php';
|
||||
include 'footer.php';
|
||||
?>
|
177
admin/write-post.php
Normal file
@ -0,0 +1,177 @@
|
||||
<?php
|
||||
include 'common.php';
|
||||
include 'header.php';
|
||||
include 'menu.php';
|
||||
Typecho_Widget::widget('Widget_Contents_Post_Edit')->to($post);
|
||||
?>
|
||||
<div class="main">
|
||||
<div class="body body-950">
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="container typecho-page-main typecho-post-option typecho-post-area">
|
||||
<form action="<?php $options->index('/action/contents-post-edit'); ?>" method="post" name="write_post">
|
||||
<div class="column-18 suffix" id="test">
|
||||
<div class="column-18">
|
||||
<label for="title" class="typecho-label"><?php _e('标题'); ?>
|
||||
<?php if ($post->draft && $post->draft['cid'] != $post->cid): ?>
|
||||
<?php $postModifyDate = new Typecho_Date($post->draft['modified']); ?>
|
||||
<cite><?php _e('当前正在编辑的是保存于%s的草稿, 你可以<a href="%s">删除它</a>', $postModifyDate->word(),
|
||||
Typecho_Common::url('/action/contents-post-edit?do=deleteDraft&cid=' . $post->cid, $options->index)); ?></cite>
|
||||
<?php endif; ?>
|
||||
</label>
|
||||
<p class="title"><input type="text" id="title" name="title" value="<?php echo htmlspecialchars($post->title); ?>" class="text title" /></p>
|
||||
<label for="text" class="typecho-label"><?php _e('内容'); ?><cite id="auto-save-message"></cite></label>
|
||||
<p><textarea style="height: <?php $options->editorSize(); ?>px" autocomplete="off" id="text" name="text"><?php echo htmlspecialchars($post->text); ?></textarea></p>
|
||||
<label for="tags" class="typecho-label"><?php _e('标签'); ?></label>
|
||||
<p><input id="tags" name="tags" type="text" value="<?php $post->tags(',', false); ?>" class="text" /></p>
|
||||
<?php Typecho_Plugin::factory('admin/write-post.php')->content($post); ?>
|
||||
<p class="submit">
|
||||
<span class="left">
|
||||
<span class="typecho-preview-label"><input type="checkbox" name="preview" id="btn-preview" /> <label for="btn-preview"><?php _e('预览内容'); ?></label></span>
|
||||
<span class="advance close" tabindex="0"><?php _e('展开高级选项'); ?></span>
|
||||
<span class="attach" tabindex="0"><?php _e('展开附件'); ?></span>
|
||||
</span>
|
||||
<span class="right">
|
||||
<input type="hidden" name="cid" value="<?php $post->cid(); ?>" />
|
||||
<input type="hidden" name="do" value="publish" />
|
||||
<button type="button" id="btn-save"><?php _e('保存草稿'); ?></button>
|
||||
<button type="button" id="btn-submit"><?php _e('发布文章 »'); ?></button>
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
<ul id="advance-panel" class="typecho-post-option column-18">
|
||||
<li class="column-18">
|
||||
<div class="column-12 suffix">
|
||||
<?php if($user->pass('editor', true)): ?>
|
||||
<label class="typecho-label"><?php _e('公开度'); ?></label>
|
||||
<ul>
|
||||
<li><input id="publish" value="publish" name="visibility" type="radio"<?php if (($post->status == 'publish' && !$post->password) || !$post->status) { ?> checked="true"<?php } ?> /> <label for="publish"><?php _e('公开'); ?></label></li>
|
||||
<li><input id="password" value="password"name="visibility" type="radio"<?php if ($post->password) { ?> checked="true"<?php } ?> /> <label for="password">密码保护 <input type="text" id="password" name="password" value="<?php $post->password(); ?>" class="mini" /></label></li>
|
||||
<li><input id="private" value="private" name="visibility" type="radio"<?php if ($post->status == 'private') { ?> checked="true"<?php } ?> /> <label for="private">私密</label></li>
|
||||
<li><input id="waiting" value="waiting" name="visibility" type="radio"<?php if ($post->status == 'waiting') { ?> checked="true"<?php } ?> /> <label for="waiting">待审核</label></li>
|
||||
</ul>
|
||||
<br />
|
||||
<?php endif; ?>
|
||||
<label for="trackback" class="typecho-label"><?php _e('引用通告'); ?></label>
|
||||
<textarea id="trackback" name="trackback"></textarea>
|
||||
<p class="description"><?php _e('每一行一个引用地址, 用回车隔开'); ?></p>
|
||||
<?php Typecho_Plugin::factory('admin/write-post.php')->advanceOptionLeft($post); ?>
|
||||
</div>
|
||||
<div class="column-06">
|
||||
<label class="typecho-label"><?php _e('权限控制'); ?></label>
|
||||
<ul>
|
||||
<li><input id="allowComment" name="allowComment" type="checkbox" value="1" <?php if($post->allow('comment')): ?>checked="true"<?php endif; ?> />
|
||||
<label for="allowComment"><?php _e('允许评论'); ?></label></li>
|
||||
<li><input id="allowPing" name="allowPing" type="checkbox" value="1" <?php if($post->allow('ping')): ?>checked="true"<?php endif; ?> />
|
||||
<label for="allowPing"><?php _e('允许被引用'); ?></label></li>
|
||||
<li><input id="allowFeed" name="allowFeed" type="checkbox" value="1" <?php if($post->allow('feed')): ?>checked="true"<?php endif; ?> />
|
||||
<label for="allowFeed"><?php _e('允许在聚合中出现'); ?></label></li>
|
||||
<?php Typecho_Plugin::factory('admin/write-post.php')->advanceOptionRight($post); ?>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<ul id="upload-panel" class="column-18">
|
||||
<li class="column-18">
|
||||
<?php include 'file-upload.php'; ?>
|
||||
</li>
|
||||
</ul>
|
||||
<div id="typecho-preview-box"></div>
|
||||
</div>
|
||||
<div class="column-06">
|
||||
<ul class="typecho-post-option">
|
||||
<li>
|
||||
<label for="date" class="typecho-label"><?php _e('日期'); ?></label>
|
||||
<p>
|
||||
<select disabled class="typecho-date" name="month" id="month">
|
||||
<option value="1" <?php if (1 == $post->date->format('n')): ?>selected="true"<?php endif; ?>><?php _e('一月'); ?></option>
|
||||
<option value="2" <?php if (2 == $post->date->format('n')): ?>selected="true"<?php endif; ?>><?php _e('二月'); ?></option>
|
||||
<option value="3" <?php if (3 == $post->date->format('n')): ?>selected="true"<?php endif; ?>><?php _e('三月'); ?></option>
|
||||
<option value="4" <?php if (4 == $post->date->format('n')): ?>selected="true"<?php endif; ?>><?php _e('四月'); ?></option>
|
||||
<option value="5" <?php if (5 == $post->date->format('n')): ?>selected="true"<?php endif; ?>><?php _e('五月'); ?></option>
|
||||
<option value="6" <?php if (6 == $post->date->format('n')): ?>selected="true"<?php endif; ?>><?php _e('六月'); ?></option>
|
||||
<option value="7" <?php if (7 == $post->date->format('n')): ?>selected="true"<?php endif; ?>><?php _e('七月'); ?></option>
|
||||
<option value="8" <?php if (8 == $post->date->format('n')): ?>selected="true"<?php endif; ?>><?php _e('八月'); ?></option>
|
||||
<option value="9" <?php if (9 == $post->date->format('n')): ?>selected="true"<?php endif; ?>><?php _e('九月'); ?></option>
|
||||
<option value="10" <?php if (10 == $post->date->format('n')): ?>selected="true"<?php endif; ?>><?php _e('十月'); ?></option>
|
||||
<option value="11" <?php if (11 == $post->date->format('n')): ?>selected="true"<?php endif; ?>><?php _e('十一月'); ?></option>
|
||||
<option value="12" <?php if (12 == $post->date->format('n')): ?>selected="true"<?php endif; ?>><?php _e('十二月'); ?></option>
|
||||
</select>
|
||||
<input disabled class="typecho-date" size="4" maxlength="4" type="text" name="day" id="day" value="<?php $post->date('d'); ?>" />
|
||||
,
|
||||
<input disabled class="typecho-date" size="4" maxlength="4" type="text" name="year" id="year" value="<?php $post->date('Y'); ?>" />
|
||||
@
|
||||
<input disabled class="typecho-date" size="2" maxlength="2" type="text" name="hour" id="hour" value="<?php $post->date('H'); ?>" />
|
||||
:
|
||||
<input disabled class="typecho-date" size="2" maxlength="2" type="text" name="min" id="min" value="<?php $post->date('i'); ?>" />
|
||||
</p>
|
||||
<p class="description"><?php _e('请选择一个发布日期'); ?></p>
|
||||
</li>
|
||||
<li>
|
||||
<label class="typecho-label"><?php _e('分类'); ?></label>
|
||||
<?php Typecho_Widget::widget('Widget_Metas_Category_List')->to($category); ?>
|
||||
<ul<?php if ($category->length > 8): ?> style="height: 264px"<?php endif; ?>>
|
||||
<?php
|
||||
if ($post->have()) {
|
||||
$categories = Typecho_Common::arrayFlatten($post->categories, 'mid');
|
||||
} else {
|
||||
$categories = array();
|
||||
}
|
||||
?>
|
||||
<?php while($category->next()): ?>
|
||||
<li><input type="checkbox" id="category-<?php $category->mid(); ?>" value="<?php $category->mid(); ?>" name="category[]" <?php if(in_array($category->mid, $categories)): ?>checked="true"<?php endif; ?>/>
|
||||
<label for="category-<?php $category->mid(); ?>"><?php $category->name(); ?></label></li>
|
||||
<?php endwhile; ?>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<label for="slug" class="typecho-label"><?php _e('缩略名'); ?></label>
|
||||
<p><input type="text" id="slug" name="slug" value="<?php $post->slug(); ?>" class="mini" /></p>
|
||||
<p class="description"><?php _e('为这篇日志自定义链接地址, 有利于搜索引擎收录'); ?></p>
|
||||
</li>
|
||||
<?php Typecho_Plugin::factory('admin/write-post.php')->option($post); ?>
|
||||
<?php if($post->have()): ?>
|
||||
<?php $modified = new Typecho_Date($post->modified); ?>
|
||||
<li>
|
||||
<label class="typecho-label"><?php _e('本文由 <a href="%s">%s</a> 撰写',
|
||||
Typecho_Common::url('manage-posts.php?uid=' . $post->author->uid, $options->adminUrl), $post->author->screenName); ?></label>
|
||||
<p class="description"><?php _e('最后修改于 %s', $modified->word()); ?></p>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include 'copyright.php';
|
||||
include 'common-js.php';
|
||||
?>
|
||||
|
||||
<?php Typecho_Widget::widget('Widget_Metas_Tag_Cloud', 'sort=count&desc=1&limit=200')->to($tags); ?>
|
||||
<script type="text/javascript">
|
||||
(function () {
|
||||
window.addEvent('domready', function() {
|
||||
/** 标签自动完成 */
|
||||
var _tags = [<?php while ($tags->next()) { echo '"' . str_replace('"', '\"', $tags->name) . '"'
|
||||
. ($tags->sequence != $tags->length ? ',' : NULL); } ?>];
|
||||
|
||||
/** 自动完成 */
|
||||
Typecho.autoComplete('#tags', _tags);
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
|
||||
<?php
|
||||
include 'write-js.php';
|
||||
|
||||
Typecho_Plugin::factory('admin/write-post.php')->trigger($plugged)->richEditor($post);
|
||||
if (!$plugged) {
|
||||
include 'editor-js.php';
|
||||
}
|
||||
Typecho_Plugin::factory('admin/write-post.php')->bottom($post);
|
||||
include 'file-upload-js.php';
|
||||
include 'footer.php';
|
||||
?>
|
52
changelog.txt
Normal file
@ -0,0 +1,52 @@
|
||||
Version 0.8.1/12.4.1
|
||||
|
||||
修复同级子目录下安装多个站点引起的登录失效
|
||||
增加评论黑名单插件
|
||||
修复评论接口重用导致启用评论验证插件后,后台无法评论的bug
|
||||
修正年份路由的bug
|
||||
修正由于flash的cookie丢失bug导致的文件无法上传bug
|
||||
增加对ini_get的判断
|
||||
提交对Sina App Engine的兼容性判断
|
||||
增加对Sina App Engine环境的支持
|
||||
增加对ini_get的判断
|
||||
修正新注册用户登录后跳转错误bug
|
||||
修正对ssl的支持
|
||||
fix issue 510
|
||||
修复使用多层代理时, 获取ip地址错误
|
||||
修正修改文章时上传控件无法载入的问题
|
||||
修改后台错别字
|
||||
修正错别字
|
||||
兼容server不支持http 1.1的情况,典型问题如 sae环境404页面乱码
|
||||
修正由于SAE更改常用导致的数据库信息无法自动读入的问题
|
||||
增加上传插件接口
|
||||
提交Sina App Engine专用的文件上传插件,
|
||||
使用SAE的Storage做持久化存储。
|
||||
修正SaeUpload插件的说明地址
|
||||
new version library
|
||||
只是一些小修正
|
||||
fix bug report on segmentfault
|
||||
fix issue 536
|
||||
fix Issue 541
|
||||
fix Issue 544
|
||||
fix Issue 544
|
||||
fix Issue 540
|
||||
fix Issue 537
|
||||
fix Issue 529
|
||||
fix Issue 532
|
||||
fix issue 526
|
||||
文章增加待审核功能,下一步给文章增加private属性
|
||||
更新后台表单样式, 新增文章预览功能
|
||||
css细节微调
|
||||
文章增加private属性显示
|
||||
修正插件显示空白问题, 预览框box修正
|
||||
修改预览内容样式,修改预览选项位置,高级选项->权限控制增加“允许游客访问”选项,用于私密浏览
|
||||
fix Issue 545
|
||||
实现文章公开度:公开、密码保护、私有、未审核
|
||||
little change
|
||||
实现功能:1,当用户之前有审核通过的评论,再次发评论会直接为通过审核(可关闭);2,未通过审核的评论,评论作者可以在前台看到(他人不可见);3,隐藏功能;
|
||||
修正后台修改或添加页面状态错误的问题;修正保存私密、审核日志时会新增一篇同样日志的问题
|
||||
简单增强搜索功能 Issue 480
|
||||
添加有密码和未发布图标
|
||||
fix Issue 551
|
||||
将文章管理页的公开度草稿等信息改为文字
|
||||
接受插件返回的header
|
26
index.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* Typecho Blog Platform
|
||||
*
|
||||
* @copyright Copyright (c) 2008 Typecho team (http://www.typecho.org)
|
||||
* @license GNU General Public License 2.0
|
||||
* @version $Id: index.php 1153 2009-07-02 10:53:22Z magike.net $
|
||||
*/
|
||||
|
||||
/** 载入配置支持 */
|
||||
if (!@include_once 'config.inc.php') {
|
||||
file_exists('./install.php') ? header('Location: install.php') : print('Missing Config File');
|
||||
exit;
|
||||
}
|
||||
|
||||
/** 初始化组件 */
|
||||
Typecho_Widget::widget('Widget_Init');
|
||||
|
||||
/** 注册一个初始化插件 */
|
||||
Typecho_Plugin::factory('index.php')->begin();
|
||||
|
||||
/** 开始路由分发 */
|
||||
Typecho_Router::dispatch();
|
||||
|
||||
/** 注册一个结束插件 */
|
||||
Typecho_Plugin::factory('index.php')->end();
|
529
install.php
Normal file
@ -0,0 +1,529 @@
|
||||
<?php
|
||||
/**
|
||||
* Typecho Blog Platform
|
||||
*
|
||||
* @copyright Copyright (c) 2008 Typecho team (http://www.typecho.org)
|
||||
* @license GNU General Public License 2.0
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/** 定义根目录 */
|
||||
define('__TYPECHO_ROOT_DIR__', dirname(__FILE__));
|
||||
|
||||
/** 定义插件目录(相对路径) */
|
||||
define('__TYPECHO_PLUGIN_DIR__', '/usr/plugins');
|
||||
|
||||
/** 定义模板目录(相对路径) */
|
||||
define('__TYPECHO_THEME_DIR__', '/usr/themes');
|
||||
|
||||
/** 后台路径(相对路径) */
|
||||
define('__TYPECHO_ADMIN_DIR__', '/admin/');
|
||||
|
||||
/** 设置包含路径 */
|
||||
@set_include_path(get_include_path() . PATH_SEPARATOR .
|
||||
__TYPECHO_ROOT_DIR__ . '/var' . PATH_SEPARATOR .
|
||||
__TYPECHO_ROOT_DIR__ . __TYPECHO_PLUGIN_DIR__);
|
||||
|
||||
/** 载入API支持 */
|
||||
require_once 'Typecho/Common.php';
|
||||
|
||||
/** 载入Response支持 */
|
||||
require_once 'Typecho/Response.php';
|
||||
|
||||
/** 载入配置支持 */
|
||||
require_once 'Typecho/Config.php';
|
||||
|
||||
/** 载入异常支持 */
|
||||
require_once 'Typecho/Exception.php';
|
||||
|
||||
/** 载入插件支持 */
|
||||
require_once 'Typecho/Plugin.php';
|
||||
|
||||
/** 载入国际化支持 */
|
||||
require_once 'Typecho/I18n.php';
|
||||
|
||||
/** 载入数据库支持 */
|
||||
require_once 'Typecho/Db.php';
|
||||
|
||||
/** 载入路由器支持 */
|
||||
require_once 'Typecho/Router.php';
|
||||
|
||||
/** 程序初始化 */
|
||||
Typecho_Common::init();
|
||||
|
||||
ob_start();
|
||||
|
||||
//判断是否已经安装
|
||||
if (!isset($_GET['finish']) && file_exists(__TYPECHO_ROOT_DIR__ . '/config.inc.php')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取传递参数
|
||||
*
|
||||
* @param string $name 参数名称
|
||||
* @param string $default 默认值
|
||||
* @return string
|
||||
*/
|
||||
function _r($name, $default = NULL)
|
||||
{
|
||||
return isset($_REQUEST[$name]) ? $_REQUEST[$name] : $default;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取多个传递参数
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function _rFrom()
|
||||
{
|
||||
$result = array();
|
||||
$params = func_get_args();
|
||||
|
||||
foreach ($params as $param) {
|
||||
$result[$param] = isset($_REQUEST[$param]) ? $_REQUEST[$param] : NULL;
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 输出传递参数
|
||||
*
|
||||
* @param string $name 参数名称
|
||||
* @param string $default 默认值
|
||||
* @return string
|
||||
*/
|
||||
function _v($name, $default = '')
|
||||
{
|
||||
echo _r($name, $default);
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否兼容某个环境(perform)
|
||||
*
|
||||
* @param string $adapter 适配器
|
||||
* @return boolean
|
||||
*/
|
||||
function _p($adapter)
|
||||
{
|
||||
switch ($adapter) {
|
||||
case 'Mysql':
|
||||
return Typecho_Db_Adapter_Mysql::isAvailable();
|
||||
case 'Pdo_Mysql':
|
||||
return Typecho_Db_Adapter_Pdo_Mysql::isAvailable();
|
||||
case 'SQLite':
|
||||
return Typecho_Db_Adapter_SQLite::isAvailable();
|
||||
case 'Pdo_SQLite':
|
||||
return Typecho_Db_Adapter_Pdo_SQLite::isAvailable();
|
||||
case 'Pgsql':
|
||||
return Typecho_Db_Adapter_Pgsql::isAvailable();
|
||||
case 'Pdo_Pgsql':
|
||||
return Typecho_Db_Adapter_Pdo_Pgsql::isAvailable();
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取url地址
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function _u()
|
||||
{
|
||||
$url = "http://" . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
|
||||
if (isset($_SERVER["QUERY_STRING"])) {
|
||||
$url = str_replace("?" . $_SERVER["QUERY_STRING"], "", $url);
|
||||
}
|
||||
|
||||
return dirname($url);
|
||||
}
|
||||
|
||||
$options = new stdClass();
|
||||
$options->generator = 'Typecho ' . Typecho_Common::VERSION;
|
||||
list($soft, $currentVersion) = explode(' ', $options->generator);
|
||||
|
||||
$options->software = $soft;
|
||||
$options->version = $currentVersion;
|
||||
|
||||
list($prefixVersion, $suffixVersion) = explode('/', $currentVersion);
|
||||
|
||||
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=<?php _e('UTF-8'); ?>" />
|
||||
<title><?php _e('Typecho安装程序'); ?></title>
|
||||
<link rel="stylesheet" type="text/css" href="admin/css/reset.source.css" />
|
||||
<link rel="stylesheet" type="text/css" href="admin/css/grid.source.css" />
|
||||
<link rel="stylesheet" type="text/css" href="admin/css/typecho.source.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="typecho-install-patch">
|
||||
<ol class="path">
|
||||
<li<?php if (!isset($_GET['finish']) && !isset($_GET['config'])) : ?> class="current"<?php endif; ?>><?php _e('欢迎使用'); ?></li>
|
||||
<li<?php if (isset($_GET['config'])) : ?> class="current"<?php endif; ?>><?php _e('初始化您的配置'); ?></li>
|
||||
<li<?php if (isset($_GET['finish'])) : ?> class="current"<?php endif; ?>><?php _e('安装成功'); ?></li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="main">
|
||||
<div class="body body-950">
|
||||
<div class="container">
|
||||
<div class="column-14 start-06 typecho-install">
|
||||
<?php if (isset($_GET['finish'])) : ?>
|
||||
<?php if (!@file_exists(__TYPECHO_ROOT_DIR__ . '/config.inc.php')) : ?>
|
||||
<h1 class="typecho-install-title"><?php _e('安装失败!'); ?></h1>
|
||||
<div class="typecho-install-body">
|
||||
<form method="post" action="?config" name="config">
|
||||
<p class="message error typecho-radius-topleft typecho-radius-topright typecho-radius-bottomleft typecho-radius-bottomright"><?php _e('您没有上传 config.inc.php 文件,请您重新安装!'); ?> <button type="submit"><?php _e('重新安装 »'); ?></button></p>
|
||||
</form>
|
||||
</div>
|
||||
<?php else : ?>
|
||||
<h1 class="typecho-install-title"><?php _e('安装成功!'); ?></h1>
|
||||
<div class="typecho-install-body">
|
||||
<div class="message success typecho-radius-topleft typecho-radius-topright typecho-radius-bottomleft typecho-radius-bottomright">
|
||||
<?php if(isset($_GET['use_old']) ) : ?>
|
||||
<?php _e('您选择了使用原有的数据, 您的用户名和密码和原来的一致'); ?>
|
||||
<?php else : ?>
|
||||
<ul>
|
||||
<?php if (isset($_REQUEST['user']) && isset($_REQUEST['password'])): ?>
|
||||
<li><?php _e('您的用户名是'); ?>:<strong><?php echo htmlspecialchars(_r('user')); ?></strong></li>
|
||||
<li><?php _e('您的密码是'); ?>:<strong><?php echo htmlspecialchars(_r('password')); ?></strong></li>
|
||||
<?php endif;?>
|
||||
</ul>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
|
||||
<div class="message notice typecho-radius-topleft typecho-radius-topright typecho-radius-bottomleft typecho-radius-bottomright">
|
||||
<a target="_blank" href="http://spreadsheets.google.com/viewform?key=pd1Gl4Ur_pbniqgebs5JRIg&hl=en">参与用户调查, 帮助我们完善产品</a>
|
||||
</div>
|
||||
|
||||
<div class="session">
|
||||
<p><?php _e('您可以将下面两个链接保存到您的收藏夹'); ?>:</p>
|
||||
<ul>
|
||||
<?php
|
||||
if (isset($_REQUEST['user']) && isset($_REQUEST['password'])) {
|
||||
$loginUrl = _u() . '/index.php/action/login?name=' . urlencode(_r('user')) . '&password='
|
||||
. urlencode(_r('password')) . '&referer=' . _u() . '/admin/index.php';
|
||||
} else {
|
||||
$loginUrl = _u() . '/admin/index.php';
|
||||
}
|
||||
?>
|
||||
<li><a href="<?php echo $loginUrl; ?>"><?php _e('点击这里访问您的控制面板'); ?></a></li>
|
||||
<li><a href="<?php echo _u(); ?>/index.php"><?php _e('点击这里查看您的 Blog'); ?></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<p><?php _e('希望你能尽情享用 Typecho 带来的乐趣!'); ?></p>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<?php elseif (isset($_GET['config'])) : ?>
|
||||
<?php
|
||||
$adapter = _r('dbAdapter', 'Mysql');
|
||||
$type = explode('_', $adapter);
|
||||
$type = array_pop($type);
|
||||
?>
|
||||
<form method="post" action="?config" name="config">
|
||||
<h1 class="typecho-install-title"><?php _e('确认您的配置'); ?></h1>
|
||||
<div class="typecho-install-body">
|
||||
<h2><?php _e('数据库配置'); ?></h2>
|
||||
<?php
|
||||
if ('config' == _r('action')) {
|
||||
$success = true;
|
||||
|
||||
if (NULL == _r('userUrl')) {
|
||||
$success = false;
|
||||
echo '<p class="message error">' . _t('请填写您的网站地址') . '</p>';
|
||||
} else if (NULL == _r('userName')) {
|
||||
$success = false;
|
||||
echo '<p class="message error">' . _t('请填写您的用户名') . '</p>';
|
||||
} else if (NULL == _r('userMail')) {
|
||||
$success = false;
|
||||
echo '<p class="message error">' . _t('请填写您的邮箱地址') . '</p>';
|
||||
} else if (32 < strlen(_r('userName'))) {
|
||||
$success = false;
|
||||
echo '<p class="message error">' . _t('用户名长度超过限制, 请不要超过32个字符') . '</p>';
|
||||
} else if (200 < strlen(_r('userMail'))) {
|
||||
$success = false;
|
||||
echo '<p class="message error">' . _t('邮箱长度超过限制, 请不要超过200个字符') . '</p>';
|
||||
}
|
||||
|
||||
|
||||
if ($success) {
|
||||
$installDb = new Typecho_Db ($adapter, _r('dbPrefix'));
|
||||
$_dbConfig = _rFrom('dbHost', 'dbUser', 'dbPassword', 'dbCharset', 'dbPort', 'dbDatabase', 'dbFile', 'dbDsn');
|
||||
|
||||
$_dbConfig = array_filter($_dbConfig);
|
||||
$dbConfig = array();
|
||||
foreach ($_dbConfig as $key => $val) {
|
||||
$dbConfig[strtolower (substr($key, 2))] = $val;
|
||||
}
|
||||
|
||||
$installDb->addServer($dbConfig, Typecho_Db::READ | Typecho_Db::WRITE);
|
||||
|
||||
|
||||
/** 检测数据库配置 */
|
||||
try {
|
||||
$installDb->query('SELECT 1=1');
|
||||
} catch (Typecho_Db_Adapter_Exception $e) {
|
||||
$success = false;
|
||||
echo '<p class="message error typecho-radius-topleft typecho-radius-topright typecho-radius-bottomleft typecho-radius-bottomright">'
|
||||
. _t('对不起,无法连接数据库,请先检查数据库配置再继续进行安装') . '</p>';
|
||||
} catch (Typecho_Db_Exception $e) {
|
||||
$success = false;
|
||||
echo '<p class="message error typecho-radius-topleft typecho-radius-topright typecho-radius-bottomleft typecho-radius-bottomright">'
|
||||
. _t('安装程序捕捉到以下错误: "%s". 程序被终止, 请检查您的配置信息.',$e->getMessage()) . '</p>';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if($success)
|
||||
{
|
||||
/** 初始化配置文件 */
|
||||
$lines = array_slice(file(__FILE__), 0, 52);
|
||||
$lines[] = "
|
||||
/** 定义数据库参数 */
|
||||
\$db = new Typecho_Db('{$adapter}', '" . _r('dbPrefix') . "');
|
||||
\$db->addServer(" . var_export($dbConfig, true) . ", Typecho_Db::READ | Typecho_Db::WRITE);
|
||||
Typecho_Db::set(\$db);
|
||||
";
|
||||
|
||||
if (false === ($handle = @file_put_contents('./config.inc.php', implode('', $lines)))) {
|
||||
$creatConfigFile = false;
|
||||
}
|
||||
try {
|
||||
/** 初始化数据库结构 */
|
||||
$scripts = file_get_contents ('./install/' . $type . '.sql');
|
||||
$scripts = str_replace('typecho_', _r('dbPrefix'), $scripts);
|
||||
|
||||
if (isset($dbConfig['charset'])) {
|
||||
$scripts = str_replace('%charset%', $dbConfig['charset'], $scripts);
|
||||
}
|
||||
|
||||
$scripts = explode(';', $scripts);
|
||||
foreach ($scripts as $script) {
|
||||
$script = trim($script);
|
||||
if ($script) {
|
||||
$installDb->query($script, Typecho_Db::WRITE);
|
||||
}
|
||||
}
|
||||
|
||||
/** 全局变量 */
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'theme', 'user' => 0, 'value' => 'default')));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'timezone', 'user' => 0, 'value' => _t('28800'))));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'charset', 'user' => 0, 'value' => 'UTF-8')));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'contentType', 'user' => 0, 'value' => 'text/html')));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'gzip', 'user' => 0, 'value' => 0)));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'generator', 'user' => 0, 'value' => $options->generator)));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'title', 'user' => 0, 'value' => 'Hello World')));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'description', 'user' => 0, 'value' => 'Just So So ...')));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'keywords', 'user' => 0, 'value' => 'typecho,php,blog')));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'rewrite', 'user' => 0, 'value' => 0)));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'frontPage', 'user' => 0, 'value' => 'recent')));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'commentsRequireMail', 'user' => 0, 'value' => 1)));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'commentsWhitelist', 'user' => 0, 'value' => 1)));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'commentsRequireURL', 'user' => 0, 'value' => 0)));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'commentsRequireModeration', 'user' => 0, 'value' => 0)));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'plugins', 'user' => 0, 'value' => 'a:0:{}')));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'commentDateFormat', 'user' => 0, 'value' => 'F jS, Y \a\t h:i a')));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'siteUrl', 'user' => 0, 'value' => _r('userUrl'))));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'defaultCategory', 'user' => 0, 'value' => 1)));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'allowRegister', 'user' => 0, 'value' => 0)));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'defaultAllowComment', 'user' => 0, 'value' => 1)));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'defaultAllowPing', 'user' => 0, 'value' => 1)));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'defaultAllowFeed', 'user' => 0, 'value' => 1)));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'pageSize', 'user' => 0, 'value' => 5)));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'postsListSize', 'user' => 0, 'value' => 10)));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'commentsListSize', 'user' => 0, 'value' => 10)));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'commentsHTMLTagAllowed', 'user' => 0, 'value' => NULL)));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'postDateFormat', 'user' => 0, 'value' => 'Y-m-d')));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'feedFullText', 'user' => 0, 'value' => 1)));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'editorSize', 'user' => 0, 'value' => 350)));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'autoSave', 'user' => 0, 'value' => 0)));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'commentsMaxNestingLevels', 'user' => 0, 'value' => 5)));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'commentsPostTimeout', 'user' => 0, 'value' => 24 * 3600 * 30)));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'commentsUrlNofollow', 'user' => 0, 'value' => 1)));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'commentsShowUrl', 'user' => 0, 'value' => 1)));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'commentsPageBreak', 'user' => 0, 'value' => 0)));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'commentsThreaded', 'user' => 0, 'value' => 1)));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'commentsPageSize', 'user' => 0, 'value' => 20)));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'commentsPageDisplay', 'user' => 0, 'value' => 'last')));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'commentsOrder', 'user' => 0, 'value' => 'ASC')));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'commentsCheckReferer', 'user' => 0, 'value' => 1)));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'commentsAutoClose', 'user' => 0, 'value' => 0)));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'commentsPostIntervalEnable', 'user' => 0, 'value' => 1)));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'commentsPostInterval', 'user' => 0, 'value' => 60)));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'commentsShowCommentOnly', 'user' => 0, 'value' => 0)));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'commentsAvatar', 'user' => 0, 'value' => 1)));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'commentsAvatarRating', 'user' => 0, 'value' => 'G')));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'routingTable', 'user' => 0, 'value' => 'a:23:{s:5:"index";a:3:{s:3:"url";s:1:"/";s:6:"widget";s:14:"Widget_Archive";s:6:"action";s:6:"render";}s:2:"do";a:3:{s:3:"url";s:22:"/action/[action:alpha]";s:6:"widget";s:9:"Widget_Do";s:6:"action";s:6:"action";}s:4:"post";a:3:{s:3:"url";s:24:"/archives/[cid:digital]/";s:6:"widget";s:14:"Widget_Archive";s:6:"action";s:6:"render";}s:10:"attachment";a:3:{s:3:"url";s:26:"/attachment/[cid:digital]/";s:6:"widget";s:14:"Widget_Archive";s:6:"action";s:6:"render";}s:8:"category";a:3:{s:3:"url";s:17:"/category/[slug]/";s:6:"widget";s:14:"Widget_Archive";s:6:"action";s:6:"render";}s:3:"tag";a:3:{s:3:"url";s:12:"/tag/[slug]/";s:6:"widget";s:14:"Widget_Archive";s:6:"action";s:6:"render";}s:6:"author";a:3:{s:3:"url";s:22:"/author/[uid:digital]/";s:6:"widget";s:14:"Widget_Archive";s:6:"action";s:6:"render";}s:6:"search";a:3:{s:3:"url";s:19:"/search/[keywords]/";s:6:"widget";s:14:"Widget_Archive";s:6:"action";s:6:"render";}s:10:"index_page";a:3:{s:3:"url";s:21:"/page/[page:digital]/";s:6:"widget";s:14:"Widget_Archive";s:6:"action";s:6:"render";}s:13:"category_page";a:3:{s:3:"url";s:32:"/category/[slug]/[page:digital]/";s:6:"widget";s:14:"Widget_Archive";s:6:"action";s:6:"render";}s:8:"tag_page";a:3:{s:3:"url";s:27:"/tag/[slug]/[page:digital]/";s:6:"widget";s:14:"Widget_Archive";s:6:"action";s:6:"render";}s:11:"author_page";a:3:{s:3:"url";s:37:"/author/[uid:digital]/[page:digital]/";s:6:"widget";s:14:"Widget_Archive";s:6:"action";s:6:"render";}s:11:"search_page";a:3:{s:3:"url";s:34:"/search/[keywords]/[page:digital]/";s:6:"widget";s:14:"Widget_Archive";s:6:"action";s:6:"render";}s:12:"archive_year";a:3:{s:3:"url";s:18:"/[year:digital:4]/";s:6:"widget";s:14:"Widget_Archive";s:6:"action";s:6:"render";}s:13:"archive_month";a:3:{s:3:"url";s:36:"/[year:digital:4]/[month:digital:2]/";s:6:"widget";s:14:"Widget_Archive";s:6:"action";s:6:"render";}s:11:"archive_day";a:3:{s:3:"url";s:52:"/[year:digital:4]/[month:digital:2]/[day:digital:2]/";s:6:"widget";s:14:"Widget_Archive";s:6:"action";s:6:"render";}s:17:"archive_year_page";a:3:{s:3:"url";s:38:"/[year:digital:4]/page/[page:digital]/";s:6:"widget";s:14:"Widget_Archive";s:6:"action";s:6:"render";}s:18:"archive_month_page";a:3:{s:3:"url";s:56:"/[year:digital:4]/[month:digital:2]/page/[page:digital]/";s:6:"widget";s:14:"Widget_Archive";s:6:"action";s:6:"render";}s:16:"archive_day_page";a:3:{s:3:"url";s:72:"/[year:digital:4]/[month:digital:2]/[day:digital:2]/page/[page:digital]/";s:6:"widget";s:14:"Widget_Archive";s:6:"action";s:6:"render";}s:12:"comment_page";a:3:{s:3:"url";s:53:"[permalink:string]/comment-page-[commentPage:digital]";s:6:"widget";s:14:"Widget_Archive";s:6:"action";s:6:"render";}s:4:"feed";a:3:{s:3:"url";s:20:"/feed[feed:string:0]";s:6:"widget";s:14:"Widget_Archive";s:6:"action";s:4:"feed";}s:8:"feedback";a:3:{s:3:"url";s:31:"[permalink:string]/[type:alpha]";s:6:"widget";s:15:"Widget_Feedback";s:6:"action";s:6:"action";}s:4:"page";a:3:{s:3:"url";s:12:"/[slug].html";s:6:"widget";s:14:"Widget_Archive";s:6:"action";s:6:"render";}}')));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'actionTable', 'user' => 0, 'value' => 'a:0:{}')));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'panelTable', 'user' => 0, 'value' => 'a:0:{}')));
|
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'attachmentTypes', 'user' => 0, 'value' => '@image@')));
|
||||
|
||||
/** 初始分类 */
|
||||
$installDb->query($installDb->insert('table.metas')->rows(array('name' => _t('默认分类'), 'slug' => 'default', 'type' => 'category', 'description' => _t('只是一个默认分类'),
|
||||
'count' => 1, 'order' => 1)));
|
||||
|
||||
/** 初始关系 */
|
||||
$installDb->query($installDb->insert('table.relationships')->rows(array('cid' => 1, 'mid' => 1)));
|
||||
|
||||
/** 初始内容 */
|
||||
$installDb->query($installDb->insert('table.contents')->rows(array('title' => _t('欢迎使用Typecho'), 'slug' => 'start', 'created' => Typecho_Date::gmtTime(), 'modified' => Typecho_Date::gmtTime(),
|
||||
'text' => _t('如果您看到这篇文章,表示您的blog已经安装成功.'), 'authorId' => 1, 'type' => 'post', 'status' => 'publish', 'commentsNum' => 1, 'allowComment' => 1,
|
||||
'allowPing' => 1, 'allowFeed' => 1, 'parent' => 0)));
|
||||
|
||||
$installDb->query($installDb->insert('table.contents')->rows(array('title' => _t('关于'), 'slug' => 'start-page', 'created' => Typecho_Date::gmtTime(), 'modified' => Typecho_Date::gmtTime(),
|
||||
'text' => _t('本页面由Typecho创建, 这只是个测试页面.'), 'authorId' => 1, 'order' => 0, 'type' => 'page', 'status' => 'publish', 'commentsNum' => 0, 'allowComment' => 1,
|
||||
'allowPing' => 1, 'allowFeed' => 1, 'parent' => 0)));
|
||||
|
||||
/** 初始评论 */
|
||||
$installDb->query($installDb->insert('table.comments')->rows(array('cid' => 1, 'created' => Typecho_Date::gmtTime(), 'author' => 'Typecho', 'ownerId' => 1, 'url' => 'http://typecho.org',
|
||||
'ip' => '127.0.0.1', 'agent' => $options->generator, 'text' => '欢迎加入Typecho大家族', 'type' => 'comment', 'status' => 'approved', 'parent' => 0)));
|
||||
|
||||
/** 初始用户 */
|
||||
$password = substr(uniqid(), 7);
|
||||
|
||||
$installDb->query($installDb->insert('table.users')->rows(array('name' => _r('userName'), 'password' => Typecho_Common::hash($password), 'mail' => _r('userMail'),
|
||||
'url' => 'http://www.typecho.org', 'screenName' => _r('userName'), 'group' => 'administrator', 'created' => Typecho_Date::gmtTime())));
|
||||
echo '<p class="message error typecho-radius-topleft typecho-radius-topright typecho-radius-bottomleft typecho-radius-bottomright">抱歉,无法写入 config.inc.php 文件。<br />您可手动创建 config.inc.php,并复制如下代码至其中。</p>';
|
||||
echo '<textarea cols="66" rows="15" class="code">';
|
||||
foreach( $lines as $line ) {
|
||||
echo htmlentities($line, ENT_COMPAT, 'UTF-8');
|
||||
}
|
||||
echo '</textarea>';
|
||||
echo '<p class="message notice typecho-radius-topleft typecho-radius-topright typecho-radius-bottomleft typecho-radius-bottomright">上传完成之后,请点击<button type="submit" onclick="window.location.href=\''.'install.php?finish&user=' . _r('userName') . '&password=' . $password.'\';return false;" >上传完毕 »</button></p>';
|
||||
exit;
|
||||
} catch (Typecho_Db_Exception $e) {
|
||||
$success = false;
|
||||
$code = $e->getCode();
|
||||
|
||||
if(('Mysql' == $type && 1050 == $code) ||
|
||||
('SQLite' == $type && ('HY000' == $code || 1 == $code)) ||
|
||||
('Pgsql' == $type && '42P07' == $code)) {
|
||||
if(_r('delete')) {
|
||||
//删除原有数据
|
||||
$dbPrefix = _r('dbPrefix');
|
||||
$tableArray = array($dbPrefix . 'comments', $dbPrefix . 'contents', $dbPrefix . 'metas', $dbPrefix . 'options', $dbPrefix . 'relationships', $dbPrefix . 'users',);
|
||||
foreach($tableArray as $table) {
|
||||
if($type == 'Mysql') {
|
||||
$installDb->query("DROP TABLE IF EXISTS `{$table}`");
|
||||
} elseif($type == 'Pgsql') {
|
||||
$installDb->query("DROP TABLE {$table}");
|
||||
} elseif($type == 'SQLite') {
|
||||
$installDb->query("DROP TABLE {$table}");
|
||||
}
|
||||
}
|
||||
echo '<p class="message success typecho-radius-topleft typecho-radius-topright typecho-radius-bottomleft typecho-radius-bottomright">已经删除完原有数据,请点击继续安装<button type="submit">下一步</button></p>';
|
||||
} elseif (_r('goahead')) {
|
||||
//使用原有数据
|
||||
//但是要更新用户网站
|
||||
$installDb->query($installDb->update('table.options')->rows(array('value' => _r('userUrl')))->where('name = ?', 'siteUrl'));
|
||||
header('Location: install.php?finish&use_old');
|
||||
exit;
|
||||
} else {
|
||||
echo '<p class="message error typecho-radius-topleft typecho-radius-topright typecho-radius-bottomleft typecho-radius-bottomright">' . _t('安装程序检查到原有数据表已经存在,请先删除该表然后再继续进行安装.') . '您可以选择<button type="submit" name="delete" value="1">删除数据原有数据</button>或者直接<button type="submit" name="goahead" value="1">使用原有数据</button>安装</p>';
|
||||
}
|
||||
} else {
|
||||
echo '<p class="message error typecho-radius-topleft typecho-radius-topright typecho-radius-bottomleft typecho-radius-bottomright">' . _t('安装程序捕捉到以下错误: "%s". 程序被终止, 请检查您的配置信息.',$e->getMessage()) . '</p>';
|
||||
}
|
||||
}
|
||||
}
|
||||
if($success != true && file_exists(__TYPECHO_ROOT_DIR__ . '/config.inc.php')) {
|
||||
unlink(__TYPECHO_ROOT_DIR__ . '/config.inc.php');
|
||||
}
|
||||
}
|
||||
?>
|
||||
<ul class="typecho-option">
|
||||
<li>
|
||||
<label class="typecho-label"><?php _e('数据库适配器'); ?></label>
|
||||
<select name="dbAdapter">
|
||||
<?php if (_p('Mysql')): ?><option value="Mysql"<?php if('Mysql' == $adapter): ?> selected=true<?php endif; ?>><?php _e('Mysql原生函数适配器') ?></option><?php endif; ?>
|
||||
<?php if (_p('SQLite')): ?><option value="SQLite"<?php if('SQLite' == $adapter): ?> selected=true<?php endif; ?>><?php _e('SQLite原生函数适配器(SQLite 2.x)') ?></option><?php endif; ?>
|
||||
<?php if (_p('Pgsql')): ?><option value="Pgsql"<?php if('Pgsql' == $adapter): ?> selected=true<?php endif; ?>><?php _e('Pgsql原生函数适配器') ?></option><?php endif; ?>
|
||||
<?php if (_p('Pdo_Mysql')): ?><option value="Pdo_Mysql"<?php if('Pdo_Mysql' == $adapter): ?> selected=true<?php endif; ?>><?php _e('Pdo驱动Mysql适配器') ?></option><?php endif; ?>
|
||||
<?php if (_p('Pdo_SQLite')): ?><option value="Pdo_SQLite"<?php if('Pdo_SQLite' == $adapter): ?> selected=true<?php endif; ?>><?php _e('Pdo驱动SQLite适配器(SQLite 3.x)') ?></option><?php endif; ?>
|
||||
<?php if (_p('Pdo_Pgsql')): ?><option value="Pdo_Pgsql"<?php if('Pdo_Pgsql' == $adapter): ?> selected=true<?php endif; ?>><?php _e('Pdo驱动PostgreSql适配器') ?></option><?php endif; ?>
|
||||
</select>
|
||||
<p class="description"><?php _e('请根据你的数据库类型选择合适的适配器'); ?></p>
|
||||
</li>
|
||||
<?php require_once './install/' . $type . '.php'; ?>
|
||||
<li>
|
||||
<label class="typecho-label"><?php _e('数据库前缀'); ?></label>
|
||||
<input type="text" class="text mini" name="dbPrefix" value="<?php _v('dbPrefix', 'typecho_'); ?>" />
|
||||
<p class="description"><?php _e('默认前缀是 "typecho_"'); ?></p>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<script>
|
||||
var _select = document.config.dbAdapter;
|
||||
_select.onchange = function() {
|
||||
setTimeout("window.location.href = 'install.php?config&dbAdapter=" + this.value + "'; ",0);
|
||||
}
|
||||
</script>
|
||||
|
||||
<h2><?php _e('创建您的管理员帐号'); ?></h2>
|
||||
<ul class="typecho-option">
|
||||
<li>
|
||||
<label class="typecho-label"><?php _e('网站地址'); ?></label>
|
||||
<input type="text" name="userUrl" class="text" value="<?php _v('userUrl', _u()); ?>" />
|
||||
<p class="description"><?php _e('这是程序自动匹配的网站路径, 如果不正确请修改它'); ?></p>
|
||||
</li>
|
||||
<li>
|
||||
<label class="typecho-label"><?php _e('用户名'); ?></label>
|
||||
<input type="text" name="userName" class="text" value="<?php _v('userName', 'admin'); ?>" />
|
||||
<p class="description"><?php _e('请填写您的用户名'); ?></p>
|
||||
</li>
|
||||
<li>
|
||||
<label class="typecho-label"><?php _e('邮件地址'); ?></label>
|
||||
<input type="text" name="userMail" class="text" value="<?php _v('userMail', 'webmaster@yourdomain.com'); ?>" />
|
||||
<p class="description"><?php _e('请填写一个您的常用邮箱'); ?></p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<input type="hidden" name="action" value="config" />
|
||||
<p class="submit"><button type="submit"><?php _e('确认, 开始安装 »'); ?></button></p>
|
||||
</form>
|
||||
<?php else: ?>
|
||||
<form method="post" action="?config">
|
||||
<h1 class="typecho-install-title"><?php _e('欢迎使用Typecho'); ?></h1>
|
||||
<div class="typecho-install-body">
|
||||
<?php
|
||||
$success = true;
|
||||
if (false === ($handle = @fopen('./config.inc.php', 'ab'))) {
|
||||
echo '<p class="message error">' . _t('安装目录不可写, 请设置你的目录权限为可写。<br /><br />或者在安装过程中手动上传config.inc.php文件.') . '</p>';
|
||||
} else {
|
||||
fclose($handle);
|
||||
unlink('./config.inc.php');
|
||||
}
|
||||
?>
|
||||
<h2><?php _e('安装说明'); ?></h2>
|
||||
<p><strong><?php _e('本安装程序将自动检测服务器环境是否符合最低配置需求.如果不符合,将在上方出现提示信息,
|
||||
请按照提示信息检查你的主机配置.如果服务器环境符合要求,将在下方出现"同意并安装"的按钮,点击此按钮即可一步完成安装.'); ?></strong></p>
|
||||
<h2><?php _e('许可及协议'); ?></h2>
|
||||
<p><?php _e('Typecho基于GPL协议发布,我们允许用户在GPL协议许可的范围内使用,拷贝,修改和分发此程序.
|
||||
你可以自由地将其用于商业以及非商业用途.'); ?></p>
|
||||
<p><?php _e('Typecho软件由其社区提供支持,核心开发团队负责维护程序日常开发工作以及新特性的制定.如果你遇到使用上的问题,
|
||||
程序中的BUG,以及期许的新功能,欢迎你在社区中交流或者直接向我们贡献代码.对于贡献突出者,他的名字将出现在贡献者名单中.'); ?></p>
|
||||
<h2><?php _e('此版本贡献者(排名不分先后)'); ?></h2>
|
||||
<ol>
|
||||
|
||||
</ol>
|
||||
<p><a href="http://typecho.org"><?php _e('查看所有贡献者'); ?></a></p>
|
||||
</div>
|
||||
<?php
|
||||
if ($success) {
|
||||
echo '<p class="submit"><button type="submit">' . _t('我准备好了, 开始下一步 »') . '</button></p>';
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
include 'admin/copyright.php';
|
||||
include 'admin/footer.php';
|
||||
?>
|
58
install/Mysql.php
Normal file
@ -0,0 +1,58 @@
|
||||
<?php if(!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
|
||||
|
||||
<?php if (defined('SAE_ACCESSKEY') && defined('SAE_SECRETKEY')): ?>
|
||||
<?php //这里是专门为Sina App Engine做的判断 ?>
|
||||
<li>
|
||||
<label class="typecho-label"><?php _e('数据库地址'); ?></label>
|
||||
<input type="text" class="text" name="dbHost" value="<?php _v('dbHost', SAE_MYSQL_HOST_M); ?>" />
|
||||
<p class="description"><?php _e('这里Sina App Engine自动分配的数据库地址,请保留默认设置'); ?></p>
|
||||
</li>
|
||||
<li>
|
||||
<label class="typecho-label"><?php _e('数据库端口'); ?></label>
|
||||
<input type="text" class="text" name="dbPort" value="<?php _v('dbPort', SAE_MYSQL_PORT); ?>" />
|
||||
<p class="description"><?php _e('如果您不知道此选项的意义, 请保留默认设置'); ?></p>
|
||||
</li>
|
||||
<li>
|
||||
<label class="typecho-label"><?php _e('数据库用户名'); ?></label>
|
||||
<input type="text" class="text" name="dbUser" value="<?php _v('dbUser', SAE_MYSQL_USER); ?>" />
|
||||
<p class="description"><?php _e('这里Sina App Engine自动分配的用户名,请保留默认设置'); ?></p>
|
||||
</li>
|
||||
<li>
|
||||
<label class="typecho-label"><?php _e('数据库密码'); ?></label>
|
||||
<input type="password" class="text" name="dbPassword" value="<?php _v('dbPassword', SAE_MYSQL_PASS); ?>" />
|
||||
</li>
|
||||
<li>
|
||||
<label class="typecho-label"><?php _e('数据库名'); ?></label>
|
||||
<input type="text" class="text" name="dbDatabase" value="<?php _v('dbDatabase', SAE_MYSQL_DB); ?>" />
|
||||
<p class="description"><?php _e('请您指定数据库名称'); ?></p>
|
||||
</li>
|
||||
<?php //结束 ?>
|
||||
<?php else: ?>
|
||||
<li>
|
||||
<label class="typecho-label"><?php _e('数据库地址'); ?></label>
|
||||
<input type="text" class="text" name="dbHost" value="<?php _v('dbHost', 'localhost'); ?>"/>
|
||||
<p class="description"><?php _e('您可能会使用 "localhost"'); ?></p>
|
||||
</li>
|
||||
<li>
|
||||
<label class="typecho-label"><?php _e('数据库端口'); ?></label>
|
||||
<input type="text" class="text" name="dbPort" value="<?php _v('dbPort', '3306'); ?>"/>
|
||||
<p class="description"><?php _e('如果您不知道此选项的意义, 请保留默认设置'); ?></p>
|
||||
</li>
|
||||
<li>
|
||||
<label class="typecho-label"><?php _e('数据库用户名'); ?></label>
|
||||
<input type="text" class="text" name="dbUser" value="<?php _v('dbUser', 'root'); ?>" />
|
||||
<p class="description"><?php _e('您可能会使用 "root"'); ?></p>
|
||||
</li>
|
||||
<li>
|
||||
<label class="typecho-label"><?php _e('数据库密码'); ?></label>
|
||||
<input type="password" class="text" name="dbPassword" value="<?php _v('dbPassword'); ?>" />
|
||||
</li>
|
||||
<li>
|
||||
<label class="typecho-label"><?php _e('数据库名'); ?></label>
|
||||
<input type="text" class="text" name="dbDatabase" value="<?php _v('dbDatabase', 'typecho'); ?>" />
|
||||
<p class="description"><?php _e('请您指定数据库名称'); ?></p>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<input type="hidden" name="dbCharset" value="<?php _e('utf8'); ?>" />
|
133
install/Mysql.sql
Normal file
@ -0,0 +1,133 @@
|
||||
-- phpMyAdmin SQL Dump
|
||||
-- version 2.11.5
|
||||
-- http://www.phpmyadmin.net
|
||||
--
|
||||
-- 主机: localhost
|
||||
-- 生成日期: 2008 年 07 月 06 日 18:00
|
||||
-- 服务器版本: 5.0.51
|
||||
-- PHP 版本: 5.2.5
|
||||
|
||||
--
|
||||
-- 数据库: `typecho`
|
||||
--
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- 表的结构 `typecho_comments`
|
||||
--
|
||||
|
||||
CREATE TABLE `typecho_comments` (
|
||||
`coid` int(10) unsigned NOT NULL auto_increment,
|
||||
`cid` int(10) unsigned default '0',
|
||||
`created` int(10) unsigned default '0',
|
||||
`author` varchar(200) default NULL,
|
||||
`authorId` int(10) unsigned default '0',
|
||||
`ownerId` int(10) unsigned default '0',
|
||||
`mail` varchar(200) default NULL,
|
||||
`url` varchar(200) default NULL,
|
||||
`ip` varchar(64) default NULL,
|
||||
`agent` varchar(200) default NULL,
|
||||
`text` text,
|
||||
`type` varchar(16) default 'comment',
|
||||
`status` varchar(16) default 'approved',
|
||||
`parent` int(10) unsigned default '0',
|
||||
PRIMARY KEY (`coid`),
|
||||
KEY `cid` (`cid`),
|
||||
KEY `created` (`created`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=%charset%;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- 表的结构 `typecho_contents`
|
||||
--
|
||||
|
||||
CREATE TABLE `typecho_contents` (
|
||||
`cid` int(10) unsigned NOT NULL auto_increment,
|
||||
`title` varchar(200) default NULL,
|
||||
`slug` varchar(200) default NULL,
|
||||
`created` int(10) unsigned default '0',
|
||||
`modified` int(10) unsigned default '0',
|
||||
`text` text,
|
||||
`order` int(10) unsigned default '0',
|
||||
`authorId` int(10) unsigned default '0',
|
||||
`template` varchar(32) default NULL,
|
||||
`type` varchar(16) default 'post',
|
||||
`status` varchar(16) default 'publish',
|
||||
`password` varchar(32) default NULL,
|
||||
`commentsNum` int(10) unsigned default '0',
|
||||
`allowComment` char(1) default '0',
|
||||
`allowPing` char(1) default '0',
|
||||
`allowFeed` char(1) default '0',
|
||||
`parent` int(10) unsigned default '0',
|
||||
PRIMARY KEY (`cid`),
|
||||
UNIQUE KEY `slug` (`slug`),
|
||||
KEY `created` (`created`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=%charset%;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- 表的结构 `typecho_metas`
|
||||
--
|
||||
|
||||
CREATE TABLE `typecho_metas` (
|
||||
`mid` int(10) unsigned NOT NULL auto_increment,
|
||||
`name` varchar(200) default NULL,
|
||||
`slug` varchar(200) default NULL,
|
||||
`type` varchar(32) NOT NULL,
|
||||
`description` varchar(200) default NULL,
|
||||
`count` int(10) unsigned default '0',
|
||||
`order` int(10) unsigned default '0',
|
||||
PRIMARY KEY (`mid`),
|
||||
KEY `slug` (`slug`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=%charset%;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- 表的结构 `typecho_options`
|
||||
--
|
||||
|
||||
CREATE TABLE `typecho_options` (
|
||||
`name` varchar(32) NOT NULL,
|
||||
`user` int(10) unsigned NOT NULL default '0',
|
||||
`value` text,
|
||||
PRIMARY KEY (`name`,`user`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=%charset%;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- 表的结构 `typecho_relationships`
|
||||
--
|
||||
|
||||
CREATE TABLE `typecho_relationships` (
|
||||
`cid` int(10) unsigned NOT NULL,
|
||||
`mid` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY (`cid`,`mid`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=%charset%;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- 表的结构 `typecho_users`
|
||||
--
|
||||
|
||||
CREATE TABLE `typecho_users` (
|
||||
`uid` int(10) unsigned NOT NULL auto_increment,
|
||||
`name` varchar(32) default NULL,
|
||||
`password` varchar(64) default NULL,
|
||||
`mail` varchar(200) default NULL,
|
||||
`url` varchar(200) default NULL,
|
||||
`screenName` varchar(32) default NULL,
|
||||
`created` int(10) unsigned default '0',
|
||||
`activated` int(10) unsigned default '0',
|
||||
`logged` int(10) unsigned default '0',
|
||||
`group` varchar(16) default 'visitor',
|
||||
`authCode` varchar(64) default NULL,
|
||||
PRIMARY KEY (`uid`),
|
||||
UNIQUE KEY `name` (`name`),
|
||||
UNIQUE KEY `mail` (`mail`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=%charset%;
|
26
install/Pgsql.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php if(!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
|
||||
<li>
|
||||
<label class="typecho-label"><?php _e('数据库地址'); ?></label>
|
||||
<input type="text" class="text" name="dbHost" value="<?php _v('dbHost', 'localhost'); ?>"/>
|
||||
<p class="description"><?php _e('您可能会使用 "localhost"'); ?></p>
|
||||
</li>
|
||||
<li>
|
||||
<label class="typecho-label"><?php _e('数据库端口'); ?></label>
|
||||
<input type="text" class="text" name="dbPort" value="<?php _v('dbPort', '5432'); ?>"/>
|
||||
<p class="description"><?php _e('如果您不知道此选项的意义, 请保留默认设置'); ?></p>
|
||||
</li>
|
||||
<li>
|
||||
<label class="typecho-label"><?php _e('数据库用户名'); ?></label>
|
||||
<input type="text" class="text" name="dbUser" value="<?php _v('dbUser', 'postgres'); ?>" />
|
||||
<p class="description"><?php _e('您可能会使用 "postgres"'); ?></p>
|
||||
</li>
|
||||
<li>
|
||||
<label class="typecho-label"><?php _e('数据库密码'); ?></label>
|
||||
<input type="password" class="text" name="dbPassword" value="<?php _v('dbPassword'); ?>" />
|
||||
</li>
|
||||
<li>
|
||||
<label class="typecho-label"><?php _e('数据库名'); ?></label>
|
||||
<input type="text" class="text" name="dbDatabase" value="<?php _v('dbDatabase', 'typecho'); ?>" />
|
||||
<p class="description"><?php _e('请您指定数据库名称'); ?></p>
|
||||
</li>
|
||||
<input type="hidden" name="dbCharset" value="<?php _e('utf8'); ?>" />
|
114
install/Pgsql.sql
Normal file
@ -0,0 +1,114 @@
|
||||
--
|
||||
-- Table structure for table `typecho_comments`
|
||||
--
|
||||
CREATE SEQUENCE "typecho_comments_seq";
|
||||
|
||||
CREATE TABLE "typecho_comments" ( "coid" INT NOT NULL DEFAULT nextval('typecho_comments_seq'),
|
||||
"cid" INT NULL DEFAULT '0',
|
||||
"created" INT NULL DEFAULT '0',
|
||||
"author" VARCHAR(200) NULL DEFAULT NULL,
|
||||
"authorId" INT NULL DEFAULT '0',
|
||||
"ownerId" INT NULL DEFAULT '0',
|
||||
"mail" VARCHAR(200) NULL DEFAULT NULL,
|
||||
"url" VARCHAR(200) NULL DEFAULT NULL,
|
||||
"ip" VARCHAR(64) NULL DEFAULT NULL,
|
||||
"agent" VARCHAR(200) NULL DEFAULT NULL,
|
||||
"text" TEXT NULL DEFAULT NULL,
|
||||
"type" VARCHAR(16) NULL DEFAULT 'comment',
|
||||
"status" VARCHAR(16) NULL DEFAULT 'approved',
|
||||
"parent" INT NULL DEFAULT '0',
|
||||
PRIMARY KEY ("coid")
|
||||
);
|
||||
|
||||
CREATE INDEX "typecho_comments_cid" ON "typecho_comments" ("cid");
|
||||
CREATE INDEX "typecho_comments_created" ON "typecho_comments" ("created");
|
||||
|
||||
|
||||
--
|
||||
-- Table structure for table `typecho_contents`
|
||||
--
|
||||
|
||||
CREATE SEQUENCE "typecho_contents_seq";
|
||||
|
||||
CREATE TABLE "typecho_contents" ( "cid" INT NOT NULL DEFAULT nextval('typecho_contents_seq'),
|
||||
"title" VARCHAR(200) NULL DEFAULT NULL,
|
||||
"slug" VARCHAR(200) NULL DEFAULT NULL,
|
||||
"created" INT NULL DEFAULT '0',
|
||||
"modified" INT NULL DEFAULT '0',
|
||||
"text" TEXT NULL DEFAULT NULL,
|
||||
"order" INT NULL DEFAULT '0',
|
||||
"authorId" INT NULL DEFAULT '0',
|
||||
"template" VARCHAR(32) NULL DEFAULT NULL,
|
||||
"type" VARCHAR(16) NULL DEFAULT 'post',
|
||||
"status" VARCHAR(16) NULL DEFAULT 'publish',
|
||||
"password" VARCHAR(32) NULL DEFAULT NULL,
|
||||
"commentsNum" INT NULL DEFAULT '0',
|
||||
"allowComment" CHAR(1) NULL DEFAULT '0',
|
||||
"allowPing" CHAR(1) NULL DEFAULT '0',
|
||||
"allowFeed" CHAR(1) NULL DEFAULT '0',
|
||||
"parent" INT NULL DEFAULT '0',
|
||||
PRIMARY KEY ("cid"),
|
||||
UNIQUE ("slug")
|
||||
);
|
||||
|
||||
CREATE INDEX "typecho_contents_created" ON "typecho_contents" ("created");
|
||||
|
||||
|
||||
--
|
||||
-- Table structure for table `typecho_metas`
|
||||
--
|
||||
|
||||
CREATE SEQUENCE "typecho_metas_seq";
|
||||
|
||||
CREATE TABLE "typecho_metas" ( "mid" INT NOT NULL DEFAULT nextval('typecho_metas_seq'),
|
||||
"name" VARCHAR(200) NULL DEFAULT NULL,
|
||||
"slug" VARCHAR(200) NULL DEFAULT NULL,
|
||||
"type" VARCHAR(16) NOT NULL DEFAULT '',
|
||||
"description" VARCHAR(200) NULL DEFAULT NULL,
|
||||
"count" INT NULL DEFAULT '0',
|
||||
"order" INT NULL DEFAULT '0',
|
||||
PRIMARY KEY ("mid")
|
||||
);
|
||||
|
||||
CREATE INDEX "typecho_metas_slug" ON "typecho_metas" ("slug");
|
||||
|
||||
|
||||
--
|
||||
-- Table structure for table `typecho_options`
|
||||
--
|
||||
|
||||
CREATE TABLE "typecho_options" ( "name" VARCHAR(32) NOT NULL DEFAULT '',
|
||||
"user" INT NOT NULL DEFAULT '0',
|
||||
"value" TEXT NULL DEFAULT NULL,
|
||||
PRIMARY KEY ("name","user")
|
||||
);
|
||||
|
||||
--
|
||||
-- Table structure for table `typecho_relationships`
|
||||
--
|
||||
|
||||
CREATE TABLE "typecho_relationships" ( "cid" INT NOT NULL DEFAULT '0',
|
||||
"mid" INT NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY ("cid","mid")
|
||||
);
|
||||
|
||||
--
|
||||
-- Table structure for table `typecho_users`
|
||||
--
|
||||
CREATE SEQUENCE "typecho_users_seq";
|
||||
|
||||
CREATE TABLE "typecho_users" ( "uid" INT NOT NULL DEFAULT nextval('typecho_users_seq') ,
|
||||
"name" VARCHAR(32) NULL DEFAULT NULL,
|
||||
"password" VARCHAR(64) NULL DEFAULT NULL,
|
||||
"mail" VARCHAR(200) NULL DEFAULT NULL,
|
||||
"url" VARCHAR(200) NULL DEFAULT NULL,
|
||||
"screenName" VARCHAR(32) NULL DEFAULT NULL,
|
||||
"created" INT NULL DEFAULT '0',
|
||||
"activated" INT NULL DEFAULT '0',
|
||||
"logged" INT NULL DEFAULT '0',
|
||||
"group" VARCHAR(16) NULL DEFAULT 'visitor',
|
||||
"authCode" VARCHAR(64) NULL DEFAULT NULL,
|
||||
PRIMARY KEY ("uid"),
|
||||
UNIQUE ("name"),
|
||||
UNIQUE ("mail")
|
||||
);
|
7
install/SQLite.php
Normal file
@ -0,0 +1,7 @@
|
||||
<?php if(!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
|
||||
<?php $defaultDir = dirname($_SERVER['SCRIPT_FILENAME']) . '/usr/' . uniqid() . '.db'; ?>
|
||||
<li>
|
||||
<label class="typecho-label"><?php _e('数据库文件路径'); ?></label>
|
||||
<input type="text" class="text" name="dbFile" value="<?php _v('dbFile', $defaultDir); ?>"/>
|
||||
<p class="description"><?php _e('"%s" 是我们为您自动生成的地址', $defaultDir); ?></p>
|
||||
</li>
|
74
install/SQLite.sql
Normal file
@ -0,0 +1,74 @@
|
||||
CREATE TABLE typecho_comments ( "coid" INTEGER NOT NULL PRIMARY KEY,
|
||||
"cid" int(10) default '0' ,
|
||||
"created" int(10) default '0' ,
|
||||
"author" varchar(200) default NULL ,
|
||||
"authorId" int(10) default '0' ,
|
||||
"ownerId" int(10) default '0' ,
|
||||
"mail" varchar(200) default NULL ,
|
||||
"url" varchar(200) default NULL ,
|
||||
"ip" varchar(64) default NULL ,
|
||||
"agent" varchar(200) default NULL ,
|
||||
"text" text ,
|
||||
"type" varchar(16) default 'comment' ,
|
||||
"status" varchar(16) default 'approved' ,
|
||||
"parent" int(10) default '0' );
|
||||
|
||||
CREATE INDEX typecho_comments_cid ON typecho_comments ("cid");
|
||||
CREATE INDEX typecho_comments_created ON typecho_comments ("created");
|
||||
|
||||
CREATE TABLE typecho_contents ( "cid" INTEGER NOT NULL PRIMARY KEY,
|
||||
"title" varchar(200) default NULL ,
|
||||
"slug" varchar(200) default NULL ,
|
||||
"created" int(10) default '0' ,
|
||||
"modified" int(10) default '0' ,
|
||||
"text" text ,
|
||||
"order" int(10) default '0' ,
|
||||
"authorId" int(10) default '0' ,
|
||||
"template" varchar(32) default NULL ,
|
||||
"type" varchar(16) default 'post' ,
|
||||
"status" varchar(16) default 'publish' ,
|
||||
"password" varchar(32) default NULL ,
|
||||
"commentsNum" int(10) default '0' ,
|
||||
"allowComment" char(1) default '0' ,
|
||||
"allowPing" char(1) default '0' ,
|
||||
"allowFeed" char(1) default '0' ,
|
||||
"parent" int(10) default '0' );
|
||||
|
||||
CREATE UNIQUE INDEX typecho_contents_slug ON typecho_contents ("slug");
|
||||
CREATE INDEX typecho_contents_created ON typecho_contents ("created");
|
||||
|
||||
CREATE TABLE typecho_metas ( "mid" INTEGER NOT NULL PRIMARY KEY,
|
||||
"name" varchar(200) default NULL ,
|
||||
"slug" varchar(200) default NULL ,
|
||||
"type" varchar(32) NOT NULL ,
|
||||
"description" varchar(200) default NULL ,
|
||||
"count" int(10) default '0' ,
|
||||
"order" int(10) default '0' );
|
||||
|
||||
CREATE INDEX typecho_metas_slug ON typecho_metas ("slug");
|
||||
|
||||
CREATE TABLE typecho_options ( "name" varchar(32) NOT NULL ,
|
||||
"user" int(10) NOT NULL default '0' ,
|
||||
"value" text );
|
||||
|
||||
CREATE UNIQUE INDEX typecho_options_name_user ON typecho_options ("name", "user");
|
||||
|
||||
CREATE TABLE typecho_relationships ( "cid" int(10) NOT NULL ,
|
||||
"mid" int(10) NOT NULL );
|
||||
|
||||
CREATE UNIQUE INDEX typecho_relationships_cid_mid ON typecho_relationships ("cid", "mid");
|
||||
|
||||
CREATE TABLE typecho_users ( "uid" INTEGER NOT NULL PRIMARY KEY,
|
||||
"name" varchar(32) default NULL ,
|
||||
"password" varchar(64) default NULL ,
|
||||
"mail" varchar(200) default NULL ,
|
||||
"url" varchar(200) default NULL ,
|
||||
"screenName" varchar(32) default NULL ,
|
||||
"created" int(10) default '0' ,
|
||||
"activated" int(10) default '0' ,
|
||||
"logged" int(10) default '0' ,
|
||||
"group" varchar(16) default 'visitor' ,
|
||||
"authCode" varchar(64) default NULL);
|
||||
|
||||
CREATE UNIQUE INDEX typecho_users_name ON typecho_users ("name");
|
||||
CREATE UNIQUE INDEX typecho_users_mail ON typecho_users ("mail");
|
282
license.txt
Normal file
@ -0,0 +1,282 @@
|
||||
The GNU General Public License (GPL)
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
3
mockup/001.php
Normal file
@ -0,0 +1,3 @@
|
||||
<?php include 'slice/header.inc.html'; ?>
|
||||
<?php include 'slice/typecho-head-guid.inc.html'; ?>
|
||||
<?php include 'slice/footer.inc.html'; ?>
|
3
mockup/002.php
Normal file
@ -0,0 +1,3 @@
|
||||
<?php include 'slice/header.inc.html'; ?>
|
||||
<?php include 'slice/typecho-foot.inc.html'; ?>
|
||||
<?php include 'slice/footer.inc.html'; ?>
|
7
mockup/003.php
Normal file
@ -0,0 +1,7 @@
|
||||
<?php include 'slice/header.inc.html'; ?>
|
||||
<div class="body body-950">
|
||||
<div class="container">
|
||||
<?php include 'slice/typecho-login.inc.html'; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'slice/footer.inc.html'; ?>
|
11
mockup/004.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php include 'slice/header.inc.html'; ?>
|
||||
<?php include 'slice/typecho-install-path.inc.html'; ?>
|
||||
<div class="body body-950">
|
||||
<div class="container">
|
||||
<div class="column-14 start-06 typecho-install">
|
||||
<h1 class="typecho-install-title">安装成功!</h1>
|
||||
<?php include 'slice/typecho-install-success.inc.html'; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'slice/footer.inc.html'; ?>
|
7
mockup/005.php
Normal file
@ -0,0 +1,7 @@
|
||||
<?php include 'slice/header.inc.html'; ?>
|
||||
<div class="body body-950">
|
||||
<div class="container">
|
||||
<?php include 'slice/typecho-login-v2.inc.html'; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'slice/footer.inc.html'; ?>
|
15
mockup/006.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php include 'slice/header.inc.html'; ?>
|
||||
<?php include 'slice/typecho-head-guid.inc.html'; ?>
|
||||
<div class="main">
|
||||
<div class="body body-950">
|
||||
<?php include 'slice/typecho-page-title.inc.html'; ?>
|
||||
<div class="container typecho-page-main">
|
||||
<div class="column-24 start-01">
|
||||
<?php include 'slice/typecho-option-tabs.inc.html'; ?>
|
||||
<?php include 'slice/typecho-thumb-list.inc.html'; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'slice/typecho-foot.inc.html'; ?>
|
||||
<?php include 'slice/footer.inc.html'; ?>
|
12
mockup/007.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php include 'slice/header.inc.html'; ?>
|
||||
<?php include 'slice/typecho-install-path.inc.html'; ?>
|
||||
<div class="body body-950">
|
||||
<div class="container">
|
||||
<div class="column-14 start-06 typecho-install">
|
||||
<h1 class="typecho-install-title">确认您的配置</h1>
|
||||
<?php include 'slice/typecho-install-option.inc.html'; ?>
|
||||
<p class="submit"><button>确认,开始安装</button></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'slice/footer.inc.html'; ?>
|
10
mockup/008.php
Normal file
@ -0,0 +1,10 @@
|
||||
<?php include 'slice/header.inc.html'; ?>
|
||||
<?php include 'slice/typecho-head-guid.inc.html'; ?>
|
||||
<div class="main">
|
||||
<div class="body body-950">
|
||||
<?php include 'slice/typecho-page-title.inc.html'; ?>
|
||||
<?php include 'slice/typecho-page-option.inc.html'; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'slice/typecho-foot.inc.html'; ?>
|
||||
<?php include 'slice/footer.inc.html'; ?>
|
32
mockup/010.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php include 'slice/header.inc.html'; ?>
|
||||
<div class="typecho-popup">
|
||||
<div class="typecho-popup-content">
|
||||
<div class="typecho-view-comment">
|
||||
<ul>
|
||||
<li><label>Name</label><input type="text" value="admin" /></li>
|
||||
<li><label>Email</label><input type="text" value="admin@admin.com" /></li>
|
||||
<li><label>Name</label><input type="text" value="http://www.typecho.net" /></li>
|
||||
</ul>
|
||||
<h4>Mesage</h4>
|
||||
<textarea cols="30" rows="10"></textarea>
|
||||
<p class="status">
|
||||
Comment at <em>10 Mar 2009 4:53:23AM</em> form IP <a href="#">127.0.0.1</a> <a href="#" class="ban">Ban?</a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="submit">
|
||||
<button>保存修改</button>
|
||||
<button>关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'slice/typecho-head-guid.inc.html'; ?>
|
||||
<div class="main">
|
||||
<div class="body body-950">
|
||||
<?php include 'slice/typecho-page-title.inc.html'; ?>
|
||||
<div class="container typecho-page-main">
|
||||
<?php include 'slice/typecho-list-table.inc.html'; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'slice/typecho-foot.inc.html'; ?>
|
||||
<?php include 'slice/footer.inc.html'; ?>
|
12
mockup/011.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php include 'slice/header.inc.html'; ?>
|
||||
<?php include 'slice/typecho-head-guid.inc.html'; ?>
|
||||
<div class="main">
|
||||
<div class="body body-950">
|
||||
<?php include 'slice/typecho-page-title.inc.html'; ?>
|
||||
<div class="container typecho-page-main">
|
||||
<?php include 'slice/typecho-list-table.inc.html'; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'slice/typecho-foot.inc.html'; ?>
|
||||
<?php include 'slice/footer.inc.html'; ?>
|
14
mockup/012.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php include 'slice/header.inc.html'; ?>
|
||||
<?php include 'slice/typecho-install-path.inc.html'; ?>
|
||||
<div class="main">
|
||||
<div class="body body-950">
|
||||
<div class="container">
|
||||
<div class="column-14 start-06 typecho-install">
|
||||
<h1 class="typecho-install-title">开始安装</h1>
|
||||
<?php include 'slice/typecho-install-body.inc.html'; ?>
|
||||
<p class="submit"><button>我同意,并准备好了</button></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'slice/footer.inc.html'; ?>
|
19
mockup/013.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php include 'slice/header.inc.html'; ?>
|
||||
<?php include 'slice/typecho-head-guid.inc.html'; ?>
|
||||
<div class="main">
|
||||
<div class="body body-950">
|
||||
<?php include 'slice/typecho-page-title.inc.html'; ?>
|
||||
<div class="container typecho-page-main">
|
||||
<div class="column-24 start-01">
|
||||
|
||||
<div class="typecho-post-option">
|
||||
<?php include 'slice/typecho-post-area.inc.html'; ?>
|
||||
<?php include 'slice/typecho-option-tabs.inc.html'; ?>
|
||||
<?php include 'slice/typecho-post-option-content.inc.html'; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'slice/typecho-foot.inc.html'; ?>
|
||||
<?php include 'slice/footer.inc.html'; ?>
|
15
mockup/014.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php include 'slice/header.inc.html'; ?>
|
||||
<?php include 'slice/typecho-head-guid.inc.html'; ?>
|
||||
<div class="main">
|
||||
<div class="body body-950">
|
||||
<?php include 'slice/typecho-page-title.inc.html'; ?>
|
||||
<div class="container typecho-page-main">
|
||||
<div class="column-24 start-01">
|
||||
<?php include 'slice/typecho-option-tabs.inc.html'; ?>
|
||||
<?php include 'slice/typecho-edit-theme.inc.html'; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'slice/typecho-foot.inc.html'; ?>
|
||||
<?php include 'slice/footer.inc.html'; ?>
|
14
mockup/015.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php include 'slice/header.inc.html'; ?>
|
||||
<?php include 'slice/typecho-head-guid.inc.html'; ?>
|
||||
<div class="main">
|
||||
<div class="body body-950">
|
||||
<?php include 'slice/typecho-page-title.inc.html'; ?>
|
||||
<div class="container typecho-page-main">
|
||||
<?php include 'slice/typecho-dashboard-left.inc.html'; ?>
|
||||
<?php include 'slice/typecho-dashboard-main.inc.html'; ?>
|
||||
<?php include 'slice/typecho-dashboard-right.inc.html'; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'slice/typecho-foot.inc.html'; ?>
|
||||
<?php include 'slice/footer.inc.html'; ?>
|
60
mockup/016.php
Normal file
@ -0,0 +1,60 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>Error</title>
|
||||
|
||||
<style type="text/css">
|
||||
body {
|
||||
background: #f7fbe9;
|
||||
font-family: "Lucida Grande","Lucida Sans Unicode",Tahoma,Verdana;
|
||||
}
|
||||
|
||||
#error {
|
||||
background: #333;
|
||||
width: 360px;
|
||||
margin: 0 auto;
|
||||
margin-top: 100px;
|
||||
color: #fff;
|
||||
padding: 10px;
|
||||
|
||||
-moz-border-radius-topleft: 4px;
|
||||
-moz-border-radius-topright: 4px;
|
||||
-moz-border-radius-bottomleft: 4px;
|
||||
-moz-border-radius-bottomright: 4px;
|
||||
-webkit-border-top-left-radius: 4px;
|
||||
-webkit-border-top-right-radius: 4px;
|
||||
-webkit-border-bottom-left-radius: 4px;
|
||||
-webkit-border-bottom-right-radius: 4px;
|
||||
|
||||
border-top-left-radius: 4px;
|
||||
border-top-right-radius: 4px;
|
||||
border-bottom-left-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
padding: 10px;
|
||||
margin: 0;
|
||||
font-size: 36px;
|
||||
}
|
||||
|
||||
p {
|
||||
padding: 0 20px 20px 20px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
img {
|
||||
padding: 0 0 5px 260px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="error">
|
||||
<h1>404</h1>
|
||||
<p>There is an error</p>
|
||||
<img src="../index.php?464D-E63E-9D08-97E2-16DD-6A37-BDEC-6021" />
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
261
mockup/css/grid.source.css
Normal file
@ -0,0 +1,261 @@
|
||||
/* vim: set et sw=4 ts=4 sts=4 fdm=marker ff=unix fenc=utf8 */
|
||||
/**
|
||||
* 格栅系统
|
||||
*
|
||||
* 根据 Taobao 栅格系统规范制定
|
||||
*
|
||||
* @change
|
||||
* 2008-09-19
|
||||
* 初始化版本,使用“浮动定位布局”
|
||||
*
|
||||
* @author i.feelinglucky@gmail.com
|
||||
* @since 2008-09-19
|
||||
* @link http://www.gracecode.com/
|
||||
* @version $Id: grid.source.css 470 2008-09-26 15:23:38Z i.feelinglucky $
|
||||
*/
|
||||
|
||||
.body {
|
||||
clear:both;
|
||||
overflow:hidden;
|
||||
position:relative;
|
||||
width:100%;
|
||||
}
|
||||
|
||||
.container {
|
||||
float:left;
|
||||
position:relative;
|
||||
width:100%;
|
||||
left:100%;
|
||||
}
|
||||
|
||||
.container:after {
|
||||
content: ".";
|
||||
display: block;
|
||||
height: 0;
|
||||
clear: both;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
/**
|
||||
* 目前制定的是 950px 宽度
|
||||
*/
|
||||
.body-950 {
|
||||
width: 950px;
|
||||
margin: 0px auto;
|
||||
}
|
||||
|
||||
.body-950 .container {
|
||||
left: 950px;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将页面分成了 24 份,同时指定每个栅格的基本样式
|
||||
*/
|
||||
.column-01, .column-02, .column-03, .column-04, .column-05,
|
||||
.column-06, .column-07, .column-08, .column-09, .column-10,
|
||||
.column-11, .column-12, .column-13, .column-14, .column-15,
|
||||
.column-16, .column-17, .column-18, .column-19, .column-20,
|
||||
.column-21, .column-22, .column-23, .column-24 {
|
||||
float:left;
|
||||
overflow:hidden;
|
||||
position:relative;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/**
|
||||
* 950 宽度的格栅
|
||||
*
|
||||
* 公式:(40 x N) - 10 = 950
|
||||
*/
|
||||
.body-950 .column-01 {
|
||||
width: 30px;
|
||||
}
|
||||
|
||||
.body-950 .column-02 {
|
||||
width: 70px;
|
||||
}
|
||||
|
||||
.body-950 .column-03 {
|
||||
width: 110px;
|
||||
}
|
||||
|
||||
.body-950 .column-04 {
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
.body-950 .column-05 {
|
||||
width: 190px;
|
||||
}
|
||||
|
||||
.body-950 .column-06 {
|
||||
width: 230px;
|
||||
}
|
||||
|
||||
.body-950 .column-07 {
|
||||
width: 270px;
|
||||
}
|
||||
|
||||
.body-950 .column-08 {
|
||||
width: 310px;
|
||||
}
|
||||
|
||||
.body-950 .column-09 {
|
||||
width: 350px;
|
||||
}
|
||||
|
||||
.body-950 .column-10 {
|
||||
width: 390px;
|
||||
}
|
||||
|
||||
.body-950 .column-11 {
|
||||
width: 430px;
|
||||
}
|
||||
|
||||
.body-950 .column-12 {
|
||||
width: 470px;
|
||||
}
|
||||
|
||||
.body-950 .column-13 {
|
||||
width: 510px;
|
||||
}
|
||||
|
||||
.body-950 .column-14 {
|
||||
width: 550px;
|
||||
}
|
||||
|
||||
.body-950 .column-15 {
|
||||
width: 590px;
|
||||
}
|
||||
|
||||
.body-950 .column-16 {
|
||||
width: 630px;
|
||||
}
|
||||
|
||||
.body-950 .column-17 {
|
||||
width: 670px;
|
||||
}
|
||||
|
||||
.body-950 .column-18 {
|
||||
width: 710px;
|
||||
}
|
||||
|
||||
.body-950 .column-19 {
|
||||
width: 750px;
|
||||
}
|
||||
|
||||
.body-950 .column-20 {
|
||||
width: 790px;
|
||||
}
|
||||
|
||||
.body-950 .column-21 {
|
||||
width: 830px;
|
||||
}
|
||||
|
||||
.body-950 .column-22 {
|
||||
width: 870px;
|
||||
}
|
||||
|
||||
.body-950 .column-23 {
|
||||
width: 910px;
|
||||
}
|
||||
|
||||
.body-950 .column-24 {
|
||||
width: 950px;
|
||||
}
|
||||
|
||||
/**
|
||||
* 对比栅格,设置偏移位置
|
||||
*/
|
||||
.body-950 .column, .body-950 .start-01 {
|
||||
margin-left: -950px;
|
||||
}
|
||||
|
||||
.body-950 .start-02 {
|
||||
margin-left: -910px;
|
||||
}
|
||||
|
||||
.body-950 .start-03 {
|
||||
margin-left: -870px;
|
||||
}
|
||||
|
||||
.body-950 .start-04 {
|
||||
margin-left: -830px;
|
||||
}
|
||||
|
||||
.body-950 .start-05 {
|
||||
margin-left: -790px;
|
||||
}
|
||||
|
||||
.body-950 .start-06 {
|
||||
margin-left: -750px;
|
||||
}
|
||||
|
||||
.body-950 .start-07 {
|
||||
margin-left: -710px;
|
||||
}
|
||||
|
||||
.body-950 .start-08 {
|
||||
margin-left: -670px;
|
||||
}
|
||||
|
||||
.body-950 .start-09 {
|
||||
margin-left: -630px;
|
||||
}
|
||||
|
||||
.body-950 .start-10 {
|
||||
margin-left: -590px;
|
||||
}
|
||||
|
||||
.body-950 .start-11 {
|
||||
margin-left: -550px;
|
||||
}
|
||||
|
||||
.body-950 .start-12 {
|
||||
margin-left: -510px;
|
||||
}
|
||||
|
||||
.body-950 .start-13 {
|
||||
margin-left: -470px;
|
||||
}
|
||||
|
||||
.body-950 .start-14 {
|
||||
margin-left: -430px;
|
||||
}
|
||||
|
||||
.body-950 .start-15 {
|
||||
margin-left: -390px;
|
||||
}
|
||||
|
||||
.body-950 .start-16 {
|
||||
margin-left: -350px;
|
||||
}
|
||||
|
||||
.body-950 .start-17 {
|
||||
margin-left: -310px;
|
||||
}
|
||||
.body-950 .start-18 {
|
||||
margin-left: -270px;
|
||||
}
|
||||
.body-950 .start-19 {
|
||||
margin-left: -230px;
|
||||
}
|
||||
|
||||
.body-950 .start-20 {
|
||||
margin-left: -190px;
|
||||
}
|
||||
|
||||
.body-950 .start-21 {
|
||||
margin-left: -150px;
|
||||
}
|
||||
|
||||
.body-950 .start-22 {
|
||||
margin-left: -110px;
|
||||
}
|
||||
|
||||
.body-950 .start-23 {
|
||||
margin-left: -70px;
|
||||
}
|
||||
|
||||
.body-950 .start-24 {
|
||||
margin-left: -30px;
|
||||
}
|
77
mockup/css/reset.source.css
Normal file
@ -0,0 +1,77 @@
|
||||
/* vim: set et sw=4 ts=4 sts=4 fdm=marker ff=unix fenc=utf8 */
|
||||
/**
|
||||
* CSS 重置样式
|
||||
*
|
||||
* 重置主流浏览器默认样式,参考 YUI 以及 Blueprint
|
||||
*
|
||||
* @author i.feelinglucky@gmail.com
|
||||
* @link http://www.gracecode.com/
|
||||
* @version $Id: reset.source.css 470 2008-09-26 15:23:38Z i.feelinglucky $
|
||||
*/
|
||||
html, body, div, span, object, iframe,
|
||||
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
||||
a, abbr, acronym, address, code,
|
||||
del, dfn, em, img, q, dl, dt, dd, ol, ul, li,
|
||||
fieldset, form, label, legend,
|
||||
table, caption, tbody, tfoot, thead, tr, th, td {
|
||||
margin: 0em; padding: 0em; border: 0em;
|
||||
font-weight: inherit;
|
||||
font-style: inherit;
|
||||
font-family: inherit;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 200%;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 180%;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 160%;
|
||||
}
|
||||
|
||||
h4 {
|
||||
font-size: 140%;
|
||||
}
|
||||
|
||||
h5 {
|
||||
font-size: 120%;
|
||||
}
|
||||
|
||||
h6, p {
|
||||
font-size: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
table {
|
||||
border-collapse: separate;
|
||||
border-spacing: 0;
|
||||
}
|
||||
|
||||
caption, th, td {
|
||||
text-align: left;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
table, td, th {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
blockquote:before, blockquote:after, q:before, q:after {
|
||||
content: "";
|
||||
}
|
||||
|
||||
blockquote, q {
|
||||
quotes: "" "";
|
||||
}
|
||||
|
||||
a img {
|
||||
border: none;
|
||||
outline: none;
|
||||
}
|
1477
mockup/css/typecho.source.css
Normal file
BIN
mockup/images/grid.png
Normal file
After Width: | Height: | Size: 128 B |
BIN
mockup/images/psd&png/sprite.png
Normal file
After Width: | Height: | Size: 61 KiB |
BIN
mockup/images/psd&png/sprite.psd
Normal file
BIN
mockup/images/psd&png/typecho-head-guid-shadow.png
Normal file
After Width: | Height: | Size: 47 KiB |
BIN
mockup/images/sprite.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
40
mockup/index.html
Normal file
@ -0,0 +1,40 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>Typecho 静态模板</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Typecho 静态模板</h1>
|
||||
<p>版本:$Id: index.html 541 2008-10-21 14:22:21Z i.feelinglucky $</p>
|
||||
<h2>安装</h2>
|
||||
<ol>
|
||||
<li><a href="mockup/012.png">原型</a> <a href="012.php?bright">简述[已完成]</a></li>
|
||||
<li><a href="mockup/007.png">原型</a> <a href="007.php?bright">配置[已完成]</a></li>
|
||||
<li><a href="mockup/004.png">原型</a> <a href="004.php?bright">安装成功[已完成]</a></li>
|
||||
</ol>
|
||||
|
||||
<h2>后台</h2>
|
||||
<ol>
|
||||
<li><a href="mockup/003.png">原型</a> <a href="003.php">登录页1[已完成]</a></li>
|
||||
<!--
|
||||
<li><del><a href="mockup/005.png">原型</a> <a href="005.php">登录页2[废弃]</a></del></li>
|
||||
-->
|
||||
<li><a href="mockup/015.png">原型</a> <a href="015.php">主页[已完成]</a></li>
|
||||
<li><a href="mockup/011.png">原型</a> <a href="011.php">列表[已完成]</a></li>
|
||||
<li><a href="mockup/010.png">原型</a> <a href="010.php">遮层[已完成]</a></li>
|
||||
<li><a href="mockup/013.png">原型</a> <a href="013.php">撰写[已完成]</a></li>
|
||||
<li><a href="mockup/008.png">原型</a> <a href="008.php">配置[已完成]</a></li>
|
||||
<li><a href="mockup/006.png">原型</a> <a href="006.php">模板[已完成]</a></li>
|
||||
<li><a href="mockup/014.png">原型</a> <a href="014.php">编辑模板[已完成]</a></li>
|
||||
</ol>
|
||||
|
||||
<h2>结构</h2>
|
||||
<ol>
|
||||
<li><a href="mockup/001.png">原型</a> <a href="001.php">菜单[已完成]</a></li>
|
||||
<li><a href="mockup/002.png">原型</a> <a href="002.php">脚注[已完成]</a> <a href="002.php?v2">脚注2[已完成]</a>
|
||||
</li>
|
||||
<li><a href="mockup/009.png">原型</a> <a href="#">汇总</a></li>
|
||||
</ol>
|
||||
</body>
|
||||
</html>
|
349
mockup/javascript/mootools-1.2.1-core-yc.js
vendored
Normal file
@ -0,0 +1,349 @@
|
||||
//MooTools, <http://mootools.net>, My Object Oriented (JavaScript) Tools. Copyright (c) 2006-2008 Valerio Proietti, <http://mad4milk.net>, MIT Style License.
|
||||
|
||||
var MooTools={version:"1.2.1",build:"0d4845aab3d9a4fdee2f0d4a6dd59210e4b697cf"};var Native=function(K){K=K||{};var A=K.name;var I=K.legacy;var B=K.protect;
|
||||
var C=K.implement;var H=K.generics;var F=K.initialize;var G=K.afterImplement||function(){};var D=F||I;H=H!==false;D.constructor=Native;D.$family={name:"native"};
|
||||
if(I&&F){D.prototype=I.prototype;}D.prototype.constructor=D;if(A){var E=A.toLowerCase();D.prototype.$family={name:E};Native.typize(D,E);}var J=function(N,L,O,M){if(!B||M||!N.prototype[L]){N.prototype[L]=O;
|
||||
}if(H){Native.genericize(N,L,B);}G.call(N,L,O);return N;};D.alias=function(N,L,O){if(typeof N=="string"){if((N=this.prototype[N])){return J(this,L,N,O);
|
||||
}}for(var M in N){this.alias(M,N[M],L);}return this;};D.implement=function(M,L,O){if(typeof M=="string"){return J(this,M,L,O);}for(var N in M){J(this,N,M[N],L);
|
||||
}return this;};if(C){D.implement(C);}return D;};Native.genericize=function(B,C,A){if((!A||!B[C])&&typeof B.prototype[C]=="function"){B[C]=function(){var D=Array.prototype.slice.call(arguments);
|
||||
return B.prototype[C].apply(D.shift(),D);};}};Native.implement=function(D,C){for(var B=0,A=D.length;B<A;B++){D[B].implement(C);}};Native.typize=function(A,B){if(!A.type){A.type=function(C){return($type(C)===B);
|
||||
};}};(function(){var A={Array:Array,Date:Date,Function:Function,Number:Number,RegExp:RegExp,String:String};for(var G in A){new Native({name:G,initialize:A[G],protect:true});
|
||||
}var D={"boolean":Boolean,"native":Native,object:Object};for(var C in D){Native.typize(D[C],C);}var F={Array:["concat","indexOf","join","lastIndexOf","pop","push","reverse","shift","slice","sort","splice","toString","unshift","valueOf"],String:["charAt","charCodeAt","concat","indexOf","lastIndexOf","match","replace","search","slice","split","substr","substring","toLowerCase","toUpperCase","valueOf"]};
|
||||
for(var E in F){for(var B=F[E].length;B--;){Native.genericize(window[E],F[E][B],true);}}})();var Hash=new Native({name:"Hash",initialize:function(A){if($type(A)=="hash"){A=$unlink(A.getClean());
|
||||
}for(var B in A){this[B]=A[B];}return this;}});Hash.implement({forEach:function(B,C){for(var A in this){if(this.hasOwnProperty(A)){B.call(C,this[A],A,this);
|
||||
}}},getClean:function(){var B={};for(var A in this){if(this.hasOwnProperty(A)){B[A]=this[A];}}return B;},getLength:function(){var B=0;for(var A in this){if(this.hasOwnProperty(A)){B++;
|
||||
}}return B;}});Hash.alias("forEach","each");Array.implement({forEach:function(C,D){for(var B=0,A=this.length;B<A;B++){C.call(D,this[B],B,this);}}});Array.alias("forEach","each");
|
||||
function $A(C){if(C.item){var D=[];for(var B=0,A=C.length;B<A;B++){D[B]=C[B];}return D;}return Array.prototype.slice.call(C);}function $arguments(A){return function(){return arguments[A];
|
||||
};}function $chk(A){return !!(A||A===0);}function $clear(A){clearTimeout(A);clearInterval(A);return null;}function $defined(A){return(A!=undefined);}function $each(C,B,D){var A=$type(C);
|
||||
((A=="arguments"||A=="collection"||A=="array")?Array:Hash).each(C,B,D);}function $empty(){}function $extend(C,A){for(var B in (A||{})){C[B]=A[B];}return C;
|
||||
}function $H(A){return new Hash(A);}function $lambda(A){return(typeof A=="function")?A:function(){return A;};}function $merge(){var E={};for(var D=0,A=arguments.length;
|
||||
D<A;D++){var B=arguments[D];if($type(B)!="object"){continue;}for(var C in B){var G=B[C],F=E[C];E[C]=(F&&$type(G)=="object"&&$type(F)=="object")?$merge(F,G):$unlink(G);
|
||||
}}return E;}function $pick(){for(var B=0,A=arguments.length;B<A;B++){if(arguments[B]!=undefined){return arguments[B];}}return null;}function $random(B,A){return Math.floor(Math.random()*(A-B+1)+B);
|
||||
}function $splat(B){var A=$type(B);return(A)?((A!="array"&&A!="arguments")?[B]:B):[];}var $time=Date.now||function(){return +new Date;};function $try(){for(var B=0,A=arguments.length;
|
||||
B<A;B++){try{return arguments[B]();}catch(C){}}return null;}function $type(A){if(A==undefined){return false;}if(A.$family){return(A.$family.name=="number"&&!isFinite(A))?false:A.$family.name;
|
||||
}if(A.nodeName){switch(A.nodeType){case 1:return"element";case 3:return(/\S/).test(A.nodeValue)?"textnode":"whitespace";}}else{if(typeof A.length=="number"){if(A.callee){return"arguments";
|
||||
}else{if(A.item){return"collection";}}}}return typeof A;}function $unlink(C){var B;switch($type(C)){case"object":B={};for(var E in C){B[E]=$unlink(C[E]);
|
||||
}break;case"hash":B=new Hash(C);break;case"array":B=[];for(var D=0,A=C.length;D<A;D++){B[D]=$unlink(C[D]);}break;default:return C;}return B;}var Browser=$merge({Engine:{name:"unknown",version:0},Platform:{name:(window.orientation!=undefined)?"ipod":(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase()},Features:{xpath:!!(document.evaluate),air:!!(window.runtime),query:!!(document.querySelector)},Plugins:{},Engines:{presto:function(){return(!window.opera)?false:((arguments.callee.caller)?960:((document.getElementsByClassName)?950:925));
|
||||
},trident:function(){return(!window.ActiveXObject)?false:((window.XMLHttpRequest)?5:4);},webkit:function(){return(navigator.taintEnabled)?false:((Browser.Features.xpath)?((Browser.Features.query)?525:420):419);
|
||||
},gecko:function(){return(document.getBoxObjectFor==undefined)?false:((document.getElementsByClassName)?19:18);}}},Browser||{});Browser.Platform[Browser.Platform.name]=true;
|
||||
Browser.detect=function(){for(var B in this.Engines){var A=this.Engines[B]();if(A){this.Engine={name:B,version:A};this.Engine[B]=this.Engine[B+A]=true;
|
||||
break;}}return{name:B,version:A};};Browser.detect();Browser.Request=function(){return $try(function(){return new XMLHttpRequest();},function(){return new ActiveXObject("MSXML2.XMLHTTP");
|
||||
});};Browser.Features.xhr=!!(Browser.Request());Browser.Plugins.Flash=(function(){var A=($try(function(){return navigator.plugins["Shockwave Flash"].description;
|
||||
},function(){return new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version");})||"0 r0").match(/\d+/g);return{version:parseInt(A[0]||0+"."+A[1]||0),build:parseInt(A[2]||0)};
|
||||
})();function $exec(B){if(!B){return B;}if(window.execScript){window.execScript(B);}else{var A=document.createElement("script");A.setAttribute("type","text/javascript");
|
||||
A[(Browser.Engine.webkit&&Browser.Engine.version<420)?"innerText":"text"]=B;document.head.appendChild(A);document.head.removeChild(A);}return B;}Native.UID=1;
|
||||
var $uid=(Browser.Engine.trident)?function(A){return(A.uid||(A.uid=[Native.UID++]))[0];}:function(A){return A.uid||(A.uid=Native.UID++);};var Window=new Native({name:"Window",legacy:(Browser.Engine.trident)?null:window.Window,initialize:function(A){$uid(A);
|
||||
if(!A.Element){A.Element=$empty;if(Browser.Engine.webkit){A.document.createElement("iframe");}A.Element.prototype=(Browser.Engine.webkit)?window["[[DOMElement.prototype]]"]:{};
|
||||
}A.document.window=A;return $extend(A,Window.Prototype);},afterImplement:function(B,A){window[B]=Window.Prototype[B]=A;}});Window.Prototype={$family:{name:"window"}};
|
||||
new Window(window);var Document=new Native({name:"Document",legacy:(Browser.Engine.trident)?null:window.Document,initialize:function(A){$uid(A);A.head=A.getElementsByTagName("head")[0];
|
||||
A.html=A.getElementsByTagName("html")[0];if(Browser.Engine.trident&&Browser.Engine.version<=4){$try(function(){A.execCommand("BackgroundImageCache",false,true);
|
||||
});}if(Browser.Engine.trident){A.window.attachEvent("onunload",function(){A.window.detachEvent("onunload",arguments.callee);A.head=A.html=A.window=null;
|
||||
});}return $extend(A,Document.Prototype);},afterImplement:function(B,A){document[B]=Document.Prototype[B]=A;}});Document.Prototype={$family:{name:"document"}};
|
||||
new Document(document);Array.implement({every:function(C,D){for(var B=0,A=this.length;B<A;B++){if(!C.call(D,this[B],B,this)){return false;}}return true;
|
||||
},filter:function(D,E){var C=[];for(var B=0,A=this.length;B<A;B++){if(D.call(E,this[B],B,this)){C.push(this[B]);}}return C;},clean:function(){return this.filter($defined);
|
||||
},indexOf:function(C,D){var A=this.length;for(var B=(D<0)?Math.max(0,A+D):D||0;B<A;B++){if(this[B]===C){return B;}}return -1;},map:function(D,E){var C=[];
|
||||
for(var B=0,A=this.length;B<A;B++){C[B]=D.call(E,this[B],B,this);}return C;},some:function(C,D){for(var B=0,A=this.length;B<A;B++){if(C.call(D,this[B],B,this)){return true;
|
||||
}}return false;},associate:function(C){var D={},B=Math.min(this.length,C.length);for(var A=0;A<B;A++){D[C[A]]=this[A];}return D;},link:function(C){var A={};
|
||||
for(var E=0,B=this.length;E<B;E++){for(var D in C){if(C[D](this[E])){A[D]=this[E];delete C[D];break;}}}return A;},contains:function(A,B){return this.indexOf(A,B)!=-1;
|
||||
},extend:function(C){for(var B=0,A=C.length;B<A;B++){this.push(C[B]);}return this;},getLast:function(){return(this.length)?this[this.length-1]:null;},getRandom:function(){return(this.length)?this[$random(0,this.length-1)]:null;
|
||||
},include:function(A){if(!this.contains(A)){this.push(A);}return this;},combine:function(C){for(var B=0,A=C.length;B<A;B++){this.include(C[B]);}return this;
|
||||
},erase:function(B){for(var A=this.length;A--;A){if(this[A]===B){this.splice(A,1);}}return this;},empty:function(){this.length=0;return this;},flatten:function(){var D=[];
|
||||
for(var B=0,A=this.length;B<A;B++){var C=$type(this[B]);if(!C){continue;}D=D.concat((C=="array"||C=="collection"||C=="arguments")?Array.flatten(this[B]):this[B]);
|
||||
}return D;},hexToRgb:function(B){if(this.length!=3){return null;}var A=this.map(function(C){if(C.length==1){C+=C;}return C.toInt(16);});return(B)?A:"rgb("+A+")";
|
||||
},rgbToHex:function(D){if(this.length<3){return null;}if(this.length==4&&this[3]==0&&!D){return"transparent";}var B=[];for(var A=0;A<3;A++){var C=(this[A]-0).toString(16);
|
||||
B.push((C.length==1)?"0"+C:C);}return(D)?B:"#"+B.join("");}});Function.implement({extend:function(A){for(var B in A){this[B]=A[B];}return this;},create:function(B){var A=this;
|
||||
B=B||{};return function(D){var C=B.arguments;C=(C!=undefined)?$splat(C):Array.slice(arguments,(B.event)?1:0);if(B.event){C=[D||window.event].extend(C);
|
||||
}var E=function(){return A.apply(B.bind||null,C);};if(B.delay){return setTimeout(E,B.delay);}if(B.periodical){return setInterval(E,B.periodical);}if(B.attempt){return $try(E);
|
||||
}return E();};},run:function(A,B){return this.apply(B,$splat(A));},pass:function(A,B){return this.create({bind:B,arguments:A});},bind:function(B,A){return this.create({bind:B,arguments:A});
|
||||
},bindWithEvent:function(B,A){return this.create({bind:B,arguments:A,event:true});},attempt:function(A,B){return this.create({bind:B,arguments:A,attempt:true})();
|
||||
},delay:function(B,C,A){return this.create({bind:C,arguments:A,delay:B})();},periodical:function(C,B,A){return this.create({bind:B,arguments:A,periodical:C})();
|
||||
}});Number.implement({limit:function(B,A){return Math.min(A,Math.max(B,this));},round:function(A){A=Math.pow(10,A||0);return Math.round(this*A)/A;},times:function(B,C){for(var A=0;
|
||||
A<this;A++){B.call(C,A,this);}},toFloat:function(){return parseFloat(this);},toInt:function(A){return parseInt(this,A||10);}});Number.alias("times","each");
|
||||
(function(B){var A={};B.each(function(C){if(!Number[C]){A[C]=function(){return Math[C].apply(null,[this].concat($A(arguments)));};}});Number.implement(A);
|
||||
})(["abs","acos","asin","atan","atan2","ceil","cos","exp","floor","log","max","min","pow","sin","sqrt","tan"]);String.implement({test:function(A,B){return((typeof A=="string")?new RegExp(A,B):A).test(this);
|
||||
},contains:function(A,B){return(B)?(B+this+B).indexOf(B+A+B)>-1:this.indexOf(A)>-1;},trim:function(){return this.replace(/^\s+|\s+$/g,"");},clean:function(){return this.replace(/\s+/g," ").trim();
|
||||
},camelCase:function(){return this.replace(/-\D/g,function(A){return A.charAt(1).toUpperCase();});},hyphenate:function(){return this.replace(/[A-Z]/g,function(A){return("-"+A.charAt(0).toLowerCase());
|
||||
});},capitalize:function(){return this.replace(/\b[a-z]/g,function(A){return A.toUpperCase();});},escapeRegExp:function(){return this.replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1");
|
||||
},toInt:function(A){return parseInt(this,A||10);},toFloat:function(){return parseFloat(this);},hexToRgb:function(B){var A=this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);
|
||||
return(A)?A.slice(1).hexToRgb(B):null;},rgbToHex:function(B){var A=this.match(/\d{1,3}/g);return(A)?A.rgbToHex(B):null;},stripScripts:function(B){var A="";
|
||||
var C=this.replace(/<script[^>]*>([\s\S]*?)<\/script>/gi,function(){A+=arguments[1]+"\n";return"";});if(B===true){$exec(A);}else{if($type(B)=="function"){B(A,C);
|
||||
}}return C;},substitute:function(A,B){return this.replace(B||(/\\?\{([^{}]+)\}/g),function(D,C){if(D.charAt(0)=="\\"){return D.slice(1);}return(A[C]!=undefined)?A[C]:"";
|
||||
});}});Hash.implement({has:Object.prototype.hasOwnProperty,keyOf:function(B){for(var A in this){if(this.hasOwnProperty(A)&&this[A]===B){return A;}}return null;
|
||||
},hasValue:function(A){return(Hash.keyOf(this,A)!==null);},extend:function(A){Hash.each(A,function(C,B){Hash.set(this,B,C);},this);return this;},combine:function(A){Hash.each(A,function(C,B){Hash.include(this,B,C);
|
||||
},this);return this;},erase:function(A){if(this.hasOwnProperty(A)){delete this[A];}return this;},get:function(A){return(this.hasOwnProperty(A))?this[A]:null;
|
||||
},set:function(A,B){if(!this[A]||this.hasOwnProperty(A)){this[A]=B;}return this;},empty:function(){Hash.each(this,function(B,A){delete this[A];},this);
|
||||
return this;},include:function(B,C){var A=this[B];if(A==undefined){this[B]=C;}return this;},map:function(B,C){var A=new Hash;Hash.each(this,function(E,D){A.set(D,B.call(C,E,D,this));
|
||||
},this);return A;},filter:function(B,C){var A=new Hash;Hash.each(this,function(E,D){if(B.call(C,E,D,this)){A.set(D,E);}},this);return A;},every:function(B,C){for(var A in this){if(this.hasOwnProperty(A)&&!B.call(C,this[A],A)){return false;
|
||||
}}return true;},some:function(B,C){for(var A in this){if(this.hasOwnProperty(A)&&B.call(C,this[A],A)){return true;}}return false;},getKeys:function(){var A=[];
|
||||
Hash.each(this,function(C,B){A.push(B);});return A;},getValues:function(){var A=[];Hash.each(this,function(B){A.push(B);});return A;},toQueryString:function(A){var B=[];
|
||||
Hash.each(this,function(F,E){if(A){E=A+"["+E+"]";}var D;switch($type(F)){case"object":D=Hash.toQueryString(F,E);break;case"array":var C={};F.each(function(H,G){C[G]=H;
|
||||
});D=Hash.toQueryString(C,E);break;default:D=E+"="+encodeURIComponent(F);}if(F!=undefined){B.push(D);}});return B.join("&");}});Hash.alias({keyOf:"indexOf",hasValue:"contains"});
|
||||
var Event=new Native({name:"Event",initialize:function(A,F){F=F||window;var K=F.document;A=A||F.event;if(A.$extended){return A;}this.$extended=true;var J=A.type;
|
||||
var G=A.target||A.srcElement;while(G&&G.nodeType==3){G=G.parentNode;}if(J.test(/key/)){var B=A.which||A.keyCode;var M=Event.Keys.keyOf(B);if(J=="keydown"){var D=B-111;
|
||||
if(D>0&&D<13){M="f"+D;}}M=M||String.fromCharCode(B).toLowerCase();}else{if(J.match(/(click|mouse|menu)/i)){K=(!K.compatMode||K.compatMode=="CSS1Compat")?K.html:K.body;
|
||||
var I={x:A.pageX||A.clientX+K.scrollLeft,y:A.pageY||A.clientY+K.scrollTop};var C={x:(A.pageX)?A.pageX-F.pageXOffset:A.clientX,y:(A.pageY)?A.pageY-F.pageYOffset:A.clientY};
|
||||
if(J.match(/DOMMouseScroll|mousewheel/)){var H=(A.wheelDelta)?A.wheelDelta/120:-(A.detail||0)/3;}var E=(A.which==3)||(A.button==2);var L=null;if(J.match(/over|out/)){switch(J){case"mouseover":L=A.relatedTarget||A.fromElement;
|
||||
break;case"mouseout":L=A.relatedTarget||A.toElement;}if(!(function(){while(L&&L.nodeType==3){L=L.parentNode;}return true;}).create({attempt:Browser.Engine.gecko})()){L=false;
|
||||
}}}}return $extend(this,{event:A,type:J,page:I,client:C,rightClick:E,wheel:H,relatedTarget:L,target:G,code:B,key:M,shift:A.shiftKey,control:A.ctrlKey,alt:A.altKey,meta:A.metaKey});
|
||||
}});Event.Keys=new Hash({enter:13,up:38,down:40,left:37,right:39,esc:27,space:32,backspace:8,tab:9,"delete":46});Event.implement({stop:function(){return this.stopPropagation().preventDefault();
|
||||
},stopPropagation:function(){if(this.event.stopPropagation){this.event.stopPropagation();}else{this.event.cancelBubble=true;}return this;},preventDefault:function(){if(this.event.preventDefault){this.event.preventDefault();
|
||||
}else{this.event.returnValue=false;}return this;}});var Class=new Native({name:"Class",initialize:function(B){B=B||{};var A=function(){for(var E in this){if($type(this[E])!="function"){this[E]=$unlink(this[E]);
|
||||
}}this.constructor=A;if(Class.prototyping){return this;}var D=(this.initialize)?this.initialize.apply(this,arguments):this;if(this.options&&this.options.initialize){this.options.initialize.call(this);
|
||||
}return D;};for(var C in Class.Mutators){if(!B[C]){continue;}B=Class.Mutators[C](B,B[C]);delete B[C];}$extend(A,this);A.constructor=Class;A.prototype=B;
|
||||
return A;}});Class.Mutators={Extends:function(C,A){Class.prototyping=A.prototype;var B=new A;delete B.parent;B=Class.inherit(B,C);delete Class.prototyping;
|
||||
return B;},Implements:function(A,B){$splat(B).each(function(C){Class.prototying=C;$extend(A,($type(C)=="class")?new C:C);delete Class.prototyping;});return A;
|
||||
}};Class.extend({inherit:function(B,E){var A=arguments.callee.caller;for(var D in E){var C=E[D];var G=B[D];var F=$type(C);if(G&&F=="function"){if(C!=G){if(A){C.__parent=G;
|
||||
B[D]=C;}else{Class.override(B,D,C);}}}else{if(F=="object"){B[D]=$merge(G,C);}else{B[D]=C;}}}if(A){B.parent=function(){return arguments.callee.caller.__parent.apply(this,arguments);
|
||||
};}return B;},override:function(B,A,E){var D=Class.prototyping;if(D&&B[A]!=D[A]){D=null;}var C=function(){var F=this.parent;this.parent=D?D[A]:B[A];var G=E.apply(this,arguments);
|
||||
this.parent=F;return G;};B[A]=C;}});Class.implement({implement:function(){var A=this.prototype;$each(arguments,function(B){Class.inherit(A,B);});return this;
|
||||
}});var Chain=new Class({$chain:[],chain:function(){this.$chain.extend(Array.flatten(arguments));return this;},callChain:function(){return(this.$chain.length)?this.$chain.shift().apply(this,arguments):false;
|
||||
},clearChain:function(){this.$chain.empty();return this;}});var Events=new Class({$events:{},addEvent:function(C,B,A){C=Events.removeOn(C);if(B!=$empty){this.$events[C]=this.$events[C]||[];
|
||||
this.$events[C].include(B);if(A){B.internal=true;}}return this;},addEvents:function(A){for(var B in A){this.addEvent(B,A[B]);}return this;},fireEvent:function(C,B,A){C=Events.removeOn(C);
|
||||
if(!this.$events||!this.$events[C]){return this;}this.$events[C].each(function(D){D.create({bind:this,delay:A,"arguments":B})();},this);return this;},removeEvent:function(B,A){B=Events.removeOn(B);
|
||||
if(!this.$events[B]){return this;}if(!A.internal){this.$events[B].erase(A);}return this;},removeEvents:function(C){if($type(C)=="object"){for(var D in C){this.removeEvent(D,C[D]);
|
||||
}return this;}if(C){C=Events.removeOn(C);}for(var D in this.$events){if(C&&C!=D){continue;}var B=this.$events[D];for(var A=B.length;A--;A){this.removeEvent(D,B[A]);
|
||||
}}return this;}});Events.removeOn=function(A){return A.replace(/^on([A-Z])/,function(B,C){return C.toLowerCase();});};var Options=new Class({setOptions:function(){this.options=$merge.run([this.options].extend(arguments));
|
||||
if(!this.addEvent){return this;}for(var A in this.options){if($type(this.options[A])!="function"||!(/^on[A-Z]/).test(A)){continue;}this.addEvent(A,this.options[A]);
|
||||
delete this.options[A];}return this;}});var Element=new Native({name:"Element",legacy:window.Element,initialize:function(A,B){var C=Element.Constructors.get(A);
|
||||
if(C){return C(B);}if(typeof A=="string"){return document.newElement(A,B);}return $(A).set(B);},afterImplement:function(A,B){Element.Prototype[A]=B;if(Array[A]){return ;
|
||||
}Elements.implement(A,function(){var C=[],G=true;for(var E=0,D=this.length;E<D;E++){var F=this[E][A].apply(this[E],arguments);C.push(F);if(G){G=($type(F)=="element");
|
||||
}}return(G)?new Elements(C):C;});}});Element.Prototype={$family:{name:"element"}};Element.Constructors=new Hash;var IFrame=new Native({name:"IFrame",generics:false,initialize:function(){var E=Array.link(arguments,{properties:Object.type,iframe:$defined});
|
||||
var C=E.properties||{};var B=$(E.iframe)||false;var D=C.onload||$empty;delete C.onload;C.id=C.name=$pick(C.id,C.name,B.id,B.name,"IFrame_"+$time());B=new Element(B||"iframe",C);
|
||||
var A=function(){var F=$try(function(){return B.contentWindow.location.host;});if(F&&F==window.location.host){var G=new Window(B.contentWindow);new Document(B.contentWindow.document);
|
||||
$extend(G.Element.prototype,Element.Prototype);}D.call(B.contentWindow,B.contentWindow.document);};(window.frames[C.id])?A():B.addListener("load",A);return B;
|
||||
}});var Elements=new Native({initialize:function(F,B){B=$extend({ddup:true,cash:true},B);F=F||[];if(B.ddup||B.cash){var G={},E=[];for(var C=0,A=F.length;
|
||||
C<A;C++){var D=$.element(F[C],!B.cash);if(B.ddup){if(G[D.uid]){continue;}G[D.uid]=true;}E.push(D);}F=E;}return(B.cash)?$extend(F,this):F;}});Elements.implement({filter:function(A,B){if(!A){return this;
|
||||
}return new Elements(Array.filter(this,(typeof A=="string")?function(C){return C.match(A);}:A,B));}});Document.implement({newElement:function(A,B){if(Browser.Engine.trident&&B){["name","type","checked"].each(function(C){if(!B[C]){return ;
|
||||
}A+=" "+C+'="'+B[C]+'"';if(C!="checked"){delete B[C];}});A="<"+A+">";}return $.element(this.createElement(A)).set(B);},newTextNode:function(A){return this.createTextNode(A);
|
||||
},getDocument:function(){return this;},getWindow:function(){return this.window;}});Window.implement({$:function(B,C){if(B&&B.$family&&B.uid){return B;}var A=$type(B);
|
||||
return($[A])?$[A](B,C,this.document):null;},$$:function(A){if(arguments.length==1&&typeof A=="string"){return this.document.getElements(A);}var F=[];var C=Array.flatten(arguments);
|
||||
for(var D=0,B=C.length;D<B;D++){var E=C[D];switch($type(E)){case"element":F.push(E);break;case"string":F.extend(this.document.getElements(E,true));}}return new Elements(F);
|
||||
},getDocument:function(){return this.document;},getWindow:function(){return this;}});$.string=function(C,B,A){C=A.getElementById(C);return(C)?$.element(C,B):null;
|
||||
};$.element=function(A,D){$uid(A);if(!D&&!A.$family&&!(/^object|embed$/i).test(A.tagName)){var B=Element.Prototype;for(var C in B){A[C]=B[C];}}return A;
|
||||
};$.object=function(B,C,A){if(B.toElement){return $.element(B.toElement(A),C);}return null;};$.textnode=$.whitespace=$.window=$.document=$arguments(0);
|
||||
Native.implement([Element,Document],{getElement:function(A,B){return $(this.getElements(A,true)[0]||null,B);},getElements:function(A,D){A=A.split(",");
|
||||
var C=[];var B=(A.length>1);A.each(function(E){var F=this.getElementsByTagName(E.trim());(B)?C.extend(F):C=F;},this);return new Elements(C,{ddup:B,cash:!D});
|
||||
}});(function(){var H={},F={};var I={input:"checked",option:"selected",textarea:(Browser.Engine.webkit&&Browser.Engine.version<420)?"innerHTML":"value"};
|
||||
var C=function(L){return(F[L]||(F[L]={}));};var G=function(N,L){if(!N){return ;}var M=N.uid;if(Browser.Engine.trident){if(N.clearAttributes){var P=L&&N.cloneNode(false);
|
||||
N.clearAttributes();if(P){N.mergeAttributes(P);}}else{if(N.removeEvents){N.removeEvents();}}if((/object/i).test(N.tagName)){for(var O in N){if(typeof N[O]=="function"){N[O]=$empty;
|
||||
}}Element.dispose(N);}}if(!M){return ;}H[M]=F[M]=null;};var D=function(){Hash.each(H,G);if(Browser.Engine.trident){$A(document.getElementsByTagName("object")).each(G);
|
||||
}if(window.CollectGarbage){CollectGarbage();}H=F=null;};var J=function(N,L,S,M,P,R){var O=N[S||L];var Q=[];while(O){if(O.nodeType==1&&(!M||Element.match(O,M))){if(!P){return $(O,R);
|
||||
}Q.push(O);}O=O[L];}return(P)?new Elements(Q,{ddup:false,cash:!R}):null;};var E={html:"innerHTML","class":"className","for":"htmlFor",text:(Browser.Engine.trident||(Browser.Engine.webkit&&Browser.Engine.version<420))?"innerText":"textContent"};
|
||||
var B=["compact","nowrap","ismap","declare","noshade","checked","disabled","readonly","multiple","selected","noresize","defer"];var K=["value","accessKey","cellPadding","cellSpacing","colSpan","frameBorder","maxLength","readOnly","rowSpan","tabIndex","useMap"];
|
||||
Hash.extend(E,B.associate(B));Hash.extend(E,K.associate(K.map(String.toLowerCase)));var A={before:function(M,L){if(L.parentNode){L.parentNode.insertBefore(M,L);
|
||||
}},after:function(M,L){if(!L.parentNode){return ;}var N=L.nextSibling;(N)?L.parentNode.insertBefore(M,N):L.parentNode.appendChild(M);},bottom:function(M,L){L.appendChild(M);
|
||||
},top:function(M,L){var N=L.firstChild;(N)?L.insertBefore(M,N):L.appendChild(M);}};A.inside=A.bottom;Hash.each(A,function(L,M){M=M.capitalize();Element.implement("inject"+M,function(N){L(this,$(N,true));
|
||||
return this;});Element.implement("grab"+M,function(N){L($(N,true),this);return this;});});Element.implement({set:function(O,M){switch($type(O)){case"object":for(var N in O){this.set(N,O[N]);
|
||||
}break;case"string":var L=Element.Properties.get(O);(L&&L.set)?L.set.apply(this,Array.slice(arguments,1)):this.setProperty(O,M);}return this;},get:function(M){var L=Element.Properties.get(M);
|
||||
return(L&&L.get)?L.get.apply(this,Array.slice(arguments,1)):this.getProperty(M);},erase:function(M){var L=Element.Properties.get(M);(L&&L.erase)?L.erase.apply(this):this.removeProperty(M);
|
||||
return this;},setProperty:function(M,N){var L=E[M];if(N==undefined){return this.removeProperty(M);}if(L&&B[M]){N=!!N;}(L)?this[L]=N:this.setAttribute(M,""+N);
|
||||
return this;},setProperties:function(L){for(var M in L){this.setProperty(M,L[M]);}return this;},getProperty:function(M){var L=E[M];var N=(L)?this[L]:this.getAttribute(M,2);
|
||||
return(B[M])?!!N:(L)?N:N||null;},getProperties:function(){var L=$A(arguments);return L.map(this.getProperty,this).associate(L);},removeProperty:function(M){var L=E[M];
|
||||
(L)?this[L]=(L&&B[M])?false:"":this.removeAttribute(M);return this;},removeProperties:function(){Array.each(arguments,this.removeProperty,this);return this;
|
||||
},hasClass:function(L){return this.className.contains(L," ");},addClass:function(L){if(!this.hasClass(L)){this.className=(this.className+" "+L).clean();
|
||||
}return this;},removeClass:function(L){this.className=this.className.replace(new RegExp("(^|\\s)"+L+"(?:\\s|$)"),"$1");return this;},toggleClass:function(L){return this.hasClass(L)?this.removeClass(L):this.addClass(L);
|
||||
},adopt:function(){Array.flatten(arguments).each(function(L){L=$(L,true);if(L){this.appendChild(L);}},this);return this;},appendText:function(M,L){return this.grab(this.getDocument().newTextNode(M),L);
|
||||
},grab:function(M,L){A[L||"bottom"]($(M,true),this);return this;},inject:function(M,L){A[L||"bottom"](this,$(M,true));return this;},replaces:function(L){L=$(L,true);
|
||||
L.parentNode.replaceChild(this,L);return this;},wraps:function(M,L){M=$(M,true);return this.replaces(M).grab(M,L);},getPrevious:function(L,M){return J(this,"previousSibling",null,L,false,M);
|
||||
},getAllPrevious:function(L,M){return J(this,"previousSibling",null,L,true,M);},getNext:function(L,M){return J(this,"nextSibling",null,L,false,M);},getAllNext:function(L,M){return J(this,"nextSibling",null,L,true,M);
|
||||
},getFirst:function(L,M){return J(this,"nextSibling","firstChild",L,false,M);},getLast:function(L,M){return J(this,"previousSibling","lastChild",L,false,M);
|
||||
},getParent:function(L,M){return J(this,"parentNode",null,L,false,M);},getParents:function(L,M){return J(this,"parentNode",null,L,true,M);},getChildren:function(L,M){return J(this,"nextSibling","firstChild",L,true,M);
|
||||
},getWindow:function(){return this.ownerDocument.window;},getDocument:function(){return this.ownerDocument;},getElementById:function(O,N){var M=this.ownerDocument.getElementById(O);
|
||||
if(!M){return null;}for(var L=M.parentNode;L!=this;L=L.parentNode){if(!L){return null;}}return $.element(M,N);},getSelected:function(){return new Elements($A(this.options).filter(function(L){return L.selected;
|
||||
}));},getComputedStyle:function(M){if(this.currentStyle){return this.currentStyle[M.camelCase()];}var L=this.getDocument().defaultView.getComputedStyle(this,null);
|
||||
return(L)?L.getPropertyValue([M.hyphenate()]):null;},toQueryString:function(){var L=[];this.getElements("input, select, textarea",true).each(function(M){if(!M.name||M.disabled){return ;
|
||||
}var N=(M.tagName.toLowerCase()=="select")?Element.getSelected(M).map(function(O){return O.value;}):((M.type=="radio"||M.type=="checkbox")&&!M.checked)?null:M.value;
|
||||
$splat(N).each(function(O){if(typeof O!="undefined"){L.push(M.name+"="+encodeURIComponent(O));}});});return L.join("&");},clone:function(O,L){O=O!==false;
|
||||
var R=this.cloneNode(O);var N=function(V,U){if(!L){V.removeAttribute("id");}if(Browser.Engine.trident){V.clearAttributes();V.mergeAttributes(U);V.removeAttribute("uid");
|
||||
if(V.options){var W=V.options,S=U.options;for(var T=W.length;T--;){W[T].selected=S[T].selected;}}}var X=I[U.tagName.toLowerCase()];if(X&&U[X]){V[X]=U[X];
|
||||
}};if(O){var P=R.getElementsByTagName("*"),Q=this.getElementsByTagName("*");for(var M=P.length;M--;){N(P[M],Q[M]);}}N(R,this);return $(R);},destroy:function(){Element.empty(this);
|
||||
Element.dispose(this);G(this,true);return null;},empty:function(){$A(this.childNodes).each(function(L){Element.destroy(L);});return this;},dispose:function(){return(this.parentNode)?this.parentNode.removeChild(this):this;
|
||||
},hasChild:function(L){L=$(L,true);if(!L){return false;}if(Browser.Engine.webkit&&Browser.Engine.version<420){return $A(this.getElementsByTagName(L.tagName)).contains(L);
|
||||
}return(this.contains)?(this!=L&&this.contains(L)):!!(this.compareDocumentPosition(L)&16);},match:function(L){return(!L||(L==this)||(Element.get(this,"tag")==L));
|
||||
}});Native.implement([Element,Window,Document],{addListener:function(O,N){if(O=="unload"){var L=N,M=this;N=function(){M.removeListener("unload",N);L();
|
||||
};}else{H[this.uid]=this;}if(this.addEventListener){this.addEventListener(O,N,false);}else{this.attachEvent("on"+O,N);}return this;},removeListener:function(M,L){if(this.removeEventListener){this.removeEventListener(M,L,false);
|
||||
}else{this.detachEvent("on"+M,L);}return this;},retrieve:function(M,L){var O=C(this.uid),N=O[M];if(L!=undefined&&N==undefined){N=O[M]=L;}return $pick(N);
|
||||
},store:function(M,L){var N=C(this.uid);N[M]=L;return this;},eliminate:function(L){var M=C(this.uid);delete M[L];return this;}});window.addListener("unload",D);
|
||||
})();Element.Properties=new Hash;Element.Properties.style={set:function(A){this.style.cssText=A;},get:function(){return this.style.cssText;},erase:function(){this.style.cssText="";
|
||||
}};Element.Properties.tag={get:function(){return this.tagName.toLowerCase();}};Element.Properties.html=(function(){var C=document.createElement("div");
|
||||
var A={table:[1,"<table>","</table>"],select:[1,"<select>","</select>"],tbody:[2,"<table><tbody>","</tbody></table>"],tr:[3,"<table><tbody><tr>","</tr></tbody></table>"]};
|
||||
A.thead=A.tfoot=A.tbody;var B={set:function(){var E=Array.flatten(arguments).join("");var F=Browser.Engine.trident&&A[this.get("tag")];if(F){var G=C;G.innerHTML=F[1]+E+F[2];
|
||||
for(var D=F[0];D--;){G=G.firstChild;}this.empty().adopt(G.childNodes);}else{this.innerHTML=E;}}};B.erase=B.set;return B;})();if(Browser.Engine.webkit&&Browser.Engine.version<420){Element.Properties.text={get:function(){if(this.innerText){return this.innerText;
|
||||
}var A=this.ownerDocument.newElement("div",{html:this.innerHTML}).inject(this.ownerDocument.body);var B=A.innerText;A.destroy();return B;}};}Element.Properties.events={set:function(A){this.addEvents(A);
|
||||
}};Native.implement([Element,Window,Document],{addEvent:function(E,G){var H=this.retrieve("events",{});H[E]=H[E]||{keys:[],values:[]};if(H[E].keys.contains(G)){return this;
|
||||
}H[E].keys.push(G);var F=E,A=Element.Events.get(E),C=G,I=this;if(A){if(A.onAdd){A.onAdd.call(this,G);}if(A.condition){C=function(J){if(A.condition.call(this,J)){return G.call(this,J);
|
||||
}return true;};}F=A.base||F;}var D=function(){return G.call(I);};var B=Element.NativeEvents[F];if(B){if(B==2){D=function(J){J=new Event(J,I.getWindow());
|
||||
if(C.call(I,J)===false){J.stop();}};}this.addListener(F,D);}H[E].values.push(D);return this;},removeEvent:function(C,B){var A=this.retrieve("events");if(!A||!A[C]){return this;
|
||||
}var F=A[C].keys.indexOf(B);if(F==-1){return this;}A[C].keys.splice(F,1);var E=A[C].values.splice(F,1)[0];var D=Element.Events.get(C);if(D){if(D.onRemove){D.onRemove.call(this,B);
|
||||
}C=D.base||C;}return(Element.NativeEvents[C])?this.removeListener(C,E):this;},addEvents:function(A){for(var B in A){this.addEvent(B,A[B]);}return this;
|
||||
},removeEvents:function(A){if($type(A)=="object"){for(var C in A){this.removeEvent(C,A[C]);}return this;}var B=this.retrieve("events");if(!B){return this;
|
||||
}if(!A){for(var C in B){this.removeEvents(C);}this.eliminate("events");}else{if(B[A]){while(B[A].keys[0]){this.removeEvent(A,B[A].keys[0]);}B[A]=null;}}return this;
|
||||
},fireEvent:function(D,B,A){var C=this.retrieve("events");if(!C||!C[D]){return this;}C[D].keys.each(function(E){E.create({bind:this,delay:A,"arguments":B})();
|
||||
},this);return this;},cloneEvents:function(D,A){D=$(D);var C=D.retrieve("events");if(!C){return this;}if(!A){for(var B in C){this.cloneEvents(D,B);}}else{if(C[A]){C[A].keys.each(function(E){this.addEvent(A,E);
|
||||
},this);}}return this;}});Element.NativeEvents={click:2,dblclick:2,mouseup:2,mousedown:2,contextmenu:2,mousewheel:2,DOMMouseScroll:2,mouseover:2,mouseout:2,mousemove:2,selectstart:2,selectend:2,keydown:2,keypress:2,keyup:2,focus:2,blur:2,change:2,reset:2,select:2,submit:2,load:1,unload:1,beforeunload:2,resize:1,move:1,DOMContentLoaded:1,readystatechange:1,error:1,abort:1,scroll:1};
|
||||
(function(){var A=function(B){var C=B.relatedTarget;if(C==undefined){return true;}if(C===false){return false;}return($type(this)!="document"&&C!=this&&C.prefix!="xul"&&!this.hasChild(C));
|
||||
};Element.Events=new Hash({mouseenter:{base:"mouseover",condition:A},mouseleave:{base:"mouseout",condition:A},mousewheel:{base:(Browser.Engine.gecko)?"DOMMouseScroll":"mousewheel"}});
|
||||
})();Element.Properties.styles={set:function(A){this.setStyles(A);}};Element.Properties.opacity={set:function(A,B){if(!B){if(A==0){if(this.style.visibility!="hidden"){this.style.visibility="hidden";
|
||||
}}else{if(this.style.visibility!="visible"){this.style.visibility="visible";}}}if(!this.currentStyle||!this.currentStyle.hasLayout){this.style.zoom=1;}if(Browser.Engine.trident){this.style.filter=(A==1)?"":"alpha(opacity="+A*100+")";
|
||||
}this.style.opacity=A;this.store("opacity",A);},get:function(){return this.retrieve("opacity",1);}};Element.implement({setOpacity:function(A){return this.set("opacity",A,true);
|
||||
},getOpacity:function(){return this.get("opacity");},setStyle:function(B,A){switch(B){case"opacity":return this.set("opacity",parseFloat(A));case"float":B=(Browser.Engine.trident)?"styleFloat":"cssFloat";
|
||||
}B=B.camelCase();if($type(A)!="string"){var C=(Element.Styles.get(B)||"@").split(" ");A=$splat(A).map(function(E,D){if(!C[D]){return"";}return($type(E)=="number")?C[D].replace("@",Math.round(E)):E;
|
||||
}).join(" ");}else{if(A==String(Number(A))){A=Math.round(A);}}this.style[B]=A;return this;},getStyle:function(G){switch(G){case"opacity":return this.get("opacity");
|
||||
case"float":G=(Browser.Engine.trident)?"styleFloat":"cssFloat";}G=G.camelCase();var A=this.style[G];if(!$chk(A)){A=[];for(var F in Element.ShortStyles){if(G!=F){continue;
|
||||
}for(var E in Element.ShortStyles[F]){A.push(this.getStyle(E));}return A.join(" ");}A=this.getComputedStyle(G);}if(A){A=String(A);var C=A.match(/rgba?\([\d\s,]+\)/);
|
||||
if(C){A=A.replace(C[0],C[0].rgbToHex());}}if(Browser.Engine.presto||(Browser.Engine.trident&&!$chk(parseInt(A)))){if(G.test(/^(height|width)$/)){var B=(G=="width")?["left","right"]:["top","bottom"],D=0;
|
||||
B.each(function(H){D+=this.getStyle("border-"+H+"-width").toInt()+this.getStyle("padding-"+H).toInt();},this);return this["offset"+G.capitalize()]-D+"px";
|
||||
}if((Browser.Engine.presto)&&String(A).test("px")){return A;}if(G.test(/(border(.+)Width|margin|padding)/)){return"0px";}}return A;},setStyles:function(B){for(var A in B){this.setStyle(A,B[A]);
|
||||
}return this;},getStyles:function(){var A={};Array.each(arguments,function(B){A[B]=this.getStyle(B);},this);return A;}});Element.Styles=new Hash({left:"@px",top:"@px",bottom:"@px",right:"@px",width:"@px",height:"@px",maxWidth:"@px",maxHeight:"@px",minWidth:"@px",minHeight:"@px",backgroundColor:"rgb(@, @, @)",backgroundPosition:"@px @px",color:"rgb(@, @, @)",fontSize:"@px",letterSpacing:"@px",lineHeight:"@px",clip:"rect(@px @px @px @px)",margin:"@px @px @px @px",padding:"@px @px @px @px",border:"@px @ rgb(@, @, @) @px @ rgb(@, @, @) @px @ rgb(@, @, @)",borderWidth:"@px @px @px @px",borderStyle:"@ @ @ @",borderColor:"rgb(@, @, @) rgb(@, @, @) rgb(@, @, @) rgb(@, @, @)",zIndex:"@",zoom:"@",fontWeight:"@",textIndent:"@px",opacity:"@"});
|
||||
Element.ShortStyles={margin:{},padding:{},border:{},borderWidth:{},borderStyle:{},borderColor:{}};["Top","Right","Bottom","Left"].each(function(G){var F=Element.ShortStyles;
|
||||
var B=Element.Styles;["margin","padding"].each(function(H){var I=H+G;F[H][I]=B[I]="@px";});var E="border"+G;F.border[E]=B[E]="@px @ rgb(@, @, @)";var D=E+"Width",A=E+"Style",C=E+"Color";
|
||||
F[E]={};F.borderWidth[D]=F[E][D]=B[D]="@px";F.borderStyle[A]=F[E][A]=B[A]="@";F.borderColor[C]=F[E][C]=B[C]="rgb(@, @, @)";});(function(){Element.implement({scrollTo:function(H,I){if(B(this)){this.getWindow().scrollTo(H,I);
|
||||
}else{this.scrollLeft=H;this.scrollTop=I;}return this;},getSize:function(){if(B(this)){return this.getWindow().getSize();}return{x:this.offsetWidth,y:this.offsetHeight};
|
||||
},getScrollSize:function(){if(B(this)){return this.getWindow().getScrollSize();}return{x:this.scrollWidth,y:this.scrollHeight};},getScroll:function(){if(B(this)){return this.getWindow().getScroll();
|
||||
}return{x:this.scrollLeft,y:this.scrollTop};},getScrolls:function(){var I=this,H={x:0,y:0};while(I&&!B(I)){H.x+=I.scrollLeft;H.y+=I.scrollTop;I=I.parentNode;
|
||||
}return H;},getOffsetParent:function(){var H=this;if(B(H)){return null;}if(!Browser.Engine.trident){return H.offsetParent;}while((H=H.parentNode)&&!B(H)){if(D(H,"position")!="static"){return H;
|
||||
}}return null;},getOffsets:function(){if(Browser.Engine.trident){var L=this.getBoundingClientRect(),J=this.getDocument().documentElement;return{x:L.left+J.scrollLeft-J.clientLeft,y:L.top+J.scrollTop-J.clientTop};
|
||||
}var I=this,H={x:0,y:0};if(B(this)){return H;}while(I&&!B(I)){H.x+=I.offsetLeft;H.y+=I.offsetTop;if(Browser.Engine.gecko){if(!F(I)){H.x+=C(I);H.y+=G(I);
|
||||
}var K=I.parentNode;if(K&&D(K,"overflow")!="visible"){H.x+=C(K);H.y+=G(K);}}else{if(I!=this&&Browser.Engine.webkit){H.x+=C(I);H.y+=G(I);}}I=I.offsetParent;
|
||||
}if(Browser.Engine.gecko&&!F(this)){H.x-=C(this);H.y-=G(this);}return H;},getPosition:function(K){if(B(this)){return{x:0,y:0};}var L=this.getOffsets(),I=this.getScrolls();
|
||||
var H={x:L.x-I.x,y:L.y-I.y};var J=(K&&(K=$(K)))?K.getPosition():{x:0,y:0};return{x:H.x-J.x,y:H.y-J.y};},getCoordinates:function(J){if(B(this)){return this.getWindow().getCoordinates();
|
||||
}var H=this.getPosition(J),I=this.getSize();var K={left:H.x,top:H.y,width:I.x,height:I.y};K.right=K.left+K.width;K.bottom=K.top+K.height;return K;},computePosition:function(H){return{left:H.x-E(this,"margin-left"),top:H.y-E(this,"margin-top")};
|
||||
},position:function(H){return this.setStyles(this.computePosition(H));}});Native.implement([Document,Window],{getSize:function(){var I=this.getWindow();
|
||||
if(Browser.Engine.presto||Browser.Engine.webkit){return{x:I.innerWidth,y:I.innerHeight};}var H=A(this);return{x:H.clientWidth,y:H.clientHeight};},getScroll:function(){var I=this.getWindow();
|
||||
var H=A(this);return{x:I.pageXOffset||H.scrollLeft,y:I.pageYOffset||H.scrollTop};},getScrollSize:function(){var I=A(this);var H=this.getSize();return{x:Math.max(I.scrollWidth,H.x),y:Math.max(I.scrollHeight,H.y)};
|
||||
},getPosition:function(){return{x:0,y:0};},getCoordinates:function(){var H=this.getSize();return{top:0,left:0,bottom:H.y,right:H.x,height:H.y,width:H.x};
|
||||
}});var D=Element.getComputedStyle;function E(H,I){return D(H,I).toInt()||0;}function F(H){return D(H,"-moz-box-sizing")=="border-box";}function G(H){return E(H,"border-top-width");
|
||||
}function C(H){return E(H,"border-left-width");}function B(H){return(/^(?:body|html)$/i).test(H.tagName);}function A(H){var I=H.getDocument();return(!I.compatMode||I.compatMode=="CSS1Compat")?I.html:I.body;
|
||||
}})();Native.implement([Window,Document,Element],{getHeight:function(){return this.getSize().y;},getWidth:function(){return this.getSize().x;},getScrollTop:function(){return this.getScroll().y;
|
||||
},getScrollLeft:function(){return this.getScroll().x;},getScrollHeight:function(){return this.getScrollSize().y;},getScrollWidth:function(){return this.getScrollSize().x;
|
||||
},getTop:function(){return this.getPosition().y;},getLeft:function(){return this.getPosition().x;}});Native.implement([Document,Element],{getElements:function(H,G){H=H.split(",");
|
||||
var C,E={};for(var D=0,B=H.length;D<B;D++){var A=H[D],F=Selectors.Utils.search(this,A,E);if(D!=0&&F.item){F=$A(F);}C=(D==0)?F:(C.item)?$A(C).concat(F):C.concat(F);
|
||||
}return new Elements(C,{ddup:(H.length>1),cash:!G});}});Element.implement({match:function(B){if(!B||(B==this)){return true;}var D=Selectors.Utils.parseTagAndID(B);
|
||||
var A=D[0],E=D[1];if(!Selectors.Filters.byID(this,E)||!Selectors.Filters.byTag(this,A)){return false;}var C=Selectors.Utils.parseSelector(B);return(C)?Selectors.Utils.filter(this,C,{}):true;
|
||||
}});var Selectors={Cache:{nth:{},parsed:{}}};Selectors.RegExps={id:(/#([\w-]+)/),tag:(/^(\w+|\*)/),quick:(/^(\w+|\*)$/),splitter:(/\s*([+>~\s])\s*([a-zA-Z#.*:\[])/g),combined:(/\.([\w-]+)|\[(\w+)(?:([!*^$~|]?=)(["']?)([^\4]*?)\4)?\]|:([\w-]+)(?:\(["']?(.*?)?["']?\)|$)/g)};
|
||||
Selectors.Utils={chk:function(B,C){if(!C){return true;}var A=$uid(B);if(!C[A]){return C[A]=true;}return false;},parseNthArgument:function(F){if(Selectors.Cache.nth[F]){return Selectors.Cache.nth[F];
|
||||
}var C=F.match(/^([+-]?\d*)?([a-z]+)?([+-]?\d*)?$/);if(!C){return false;}var E=parseInt(C[1]);var B=(E||E===0)?E:1;var D=C[2]||false;var A=parseInt(C[3])||0;
|
||||
if(B!=0){A--;while(A<1){A+=B;}while(A>=B){A-=B;}}else{B=A;D="index";}switch(D){case"n":C={a:B,b:A,special:"n"};break;case"odd":C={a:2,b:0,special:"n"};
|
||||
break;case"even":C={a:2,b:1,special:"n"};break;case"first":C={a:0,special:"index"};break;case"last":C={special:"last-child"};break;case"only":C={special:"only-child"};
|
||||
break;default:C={a:(B-1),special:"index"};}return Selectors.Cache.nth[F]=C;},parseSelector:function(E){if(Selectors.Cache.parsed[E]){return Selectors.Cache.parsed[E];
|
||||
}var D,H={classes:[],pseudos:[],attributes:[]};while((D=Selectors.RegExps.combined.exec(E))){var I=D[1],G=D[2],F=D[3],B=D[5],C=D[6],J=D[7];if(I){H.classes.push(I);
|
||||
}else{if(C){var A=Selectors.Pseudo.get(C);if(A){H.pseudos.push({parser:A,argument:J});}else{H.attributes.push({name:C,operator:"=",value:J});}}else{if(G){H.attributes.push({name:G,operator:F,value:B});
|
||||
}}}}if(!H.classes.length){delete H.classes;}if(!H.attributes.length){delete H.attributes;}if(!H.pseudos.length){delete H.pseudos;}if(!H.classes&&!H.attributes&&!H.pseudos){H=null;
|
||||
}return Selectors.Cache.parsed[E]=H;},parseTagAndID:function(B){var A=B.match(Selectors.RegExps.tag);var C=B.match(Selectors.RegExps.id);return[(A)?A[1]:"*",(C)?C[1]:false];
|
||||
},filter:function(F,C,E){var D;if(C.classes){for(D=C.classes.length;D--;D){var G=C.classes[D];if(!Selectors.Filters.byClass(F,G)){return false;}}}if(C.attributes){for(D=C.attributes.length;
|
||||
D--;D){var B=C.attributes[D];if(!Selectors.Filters.byAttribute(F,B.name,B.operator,B.value)){return false;}}}if(C.pseudos){for(D=C.pseudos.length;D--;D){var A=C.pseudos[D];
|
||||
if(!Selectors.Filters.byPseudo(F,A.parser,A.argument,E)){return false;}}}return true;},getByTagAndID:function(B,A,D){if(D){var C=(B.getElementById)?B.getElementById(D,true):Element.getElementById(B,D,true);
|
||||
return(C&&Selectors.Filters.byTag(C,A))?[C]:[];}else{return B.getElementsByTagName(A);}},search:function(I,H,N){var B=[];var C=H.trim().replace(Selectors.RegExps.splitter,function(Y,X,W){B.push(X);
|
||||
return":)"+W;}).split(":)");var J,E,U;for(var T=0,P=C.length;T<P;T++){var S=C[T];if(T==0&&Selectors.RegExps.quick.test(S)){J=I.getElementsByTagName(S);
|
||||
continue;}var A=B[T-1];var K=Selectors.Utils.parseTagAndID(S);var V=K[0],L=K[1];if(T==0){J=Selectors.Utils.getByTagAndID(I,V,L);}else{var D={},G=[];for(var R=0,Q=J.length;
|
||||
R<Q;R++){G=Selectors.Getters[A](G,J[R],V,L,D);}J=G;}var F=Selectors.Utils.parseSelector(S);if(F){E=[];for(var O=0,M=J.length;O<M;O++){U=J[O];if(Selectors.Utils.filter(U,F,N)){E.push(U);
|
||||
}}J=E;}}return J;}};Selectors.Getters={" ":function(H,G,I,A,E){var D=Selectors.Utils.getByTagAndID(G,I,A);for(var C=0,B=D.length;C<B;C++){var F=D[C];if(Selectors.Utils.chk(F,E)){H.push(F);
|
||||
}}return H;},">":function(H,G,I,A,F){var C=Selectors.Utils.getByTagAndID(G,I,A);for(var E=0,D=C.length;E<D;E++){var B=C[E];if(B.parentNode==G&&Selectors.Utils.chk(B,F)){H.push(B);
|
||||
}}return H;},"+":function(C,B,A,E,D){while((B=B.nextSibling)){if(B.nodeType==1){if(Selectors.Utils.chk(B,D)&&Selectors.Filters.byTag(B,A)&&Selectors.Filters.byID(B,E)){C.push(B);
|
||||
}break;}}return C;},"~":function(C,B,A,E,D){while((B=B.nextSibling)){if(B.nodeType==1){if(!Selectors.Utils.chk(B,D)){break;}if(Selectors.Filters.byTag(B,A)&&Selectors.Filters.byID(B,E)){C.push(B);
|
||||
}}}return C;}};Selectors.Filters={byTag:function(B,A){return(A=="*"||(B.tagName&&B.tagName.toLowerCase()==A));},byID:function(A,B){return(!B||(A.id&&A.id==B));
|
||||
},byClass:function(B,A){return(B.className&&B.className.contains(A," "));},byPseudo:function(A,D,C,B){return D.call(A,C,B);},byAttribute:function(C,D,B,E){var A=Element.prototype.getProperty.call(C,D);
|
||||
if(!A){return(B=="!=");}if(!B||E==undefined){return true;}switch(B){case"=":return(A==E);case"*=":return(A.contains(E));case"^=":return(A.substr(0,E.length)==E);
|
||||
case"$=":return(A.substr(A.length-E.length)==E);case"!=":return(A!=E);case"~=":return A.contains(E," ");case"|=":return A.contains(E,"-");}return false;
|
||||
}};Selectors.Pseudo=new Hash({checked:function(){return this.checked;},empty:function(){return !(this.innerText||this.textContent||"").length;},not:function(A){return !Element.match(this,A);
|
||||
},contains:function(A){return(this.innerText||this.textContent||"").contains(A);},"first-child":function(){return Selectors.Pseudo.index.call(this,0);},"last-child":function(){var A=this;
|
||||
while((A=A.nextSibling)){if(A.nodeType==1){return false;}}return true;},"only-child":function(){var B=this;while((B=B.previousSibling)){if(B.nodeType==1){return false;
|
||||
}}var A=this;while((A=A.nextSibling)){if(A.nodeType==1){return false;}}return true;},"nth-child":function(G,E){G=(G==undefined)?"n":G;var C=Selectors.Utils.parseNthArgument(G);
|
||||
if(C.special!="n"){return Selectors.Pseudo[C.special].call(this,C.a,E);}var F=0;E.positions=E.positions||{};var D=$uid(this);if(!E.positions[D]){var B=this;
|
||||
while((B=B.previousSibling)){if(B.nodeType!=1){continue;}F++;var A=E.positions[$uid(B)];if(A!=undefined){F=A+F;break;}}E.positions[D]=F;}return(E.positions[D]%C.a==C.b);
|
||||
},index:function(A){var B=this,C=0;while((B=B.previousSibling)){if(B.nodeType==1&&++C>A){return false;}}return(C==A);},even:function(B,A){return Selectors.Pseudo["nth-child"].call(this,"2n+1",A);
|
||||
},odd:function(B,A){return Selectors.Pseudo["nth-child"].call(this,"2n",A);}});Element.Events.domready={onAdd:function(A){if(Browser.loaded){A.call(this);
|
||||
}}};(function(){var B=function(){if(Browser.loaded){return ;}Browser.loaded=true;window.fireEvent("domready");document.fireEvent("domready");};if(Browser.Engine.trident){var A=document.createElement("div");
|
||||
(function(){($try(function(){A.doScroll("left");return $(A).inject(document.body).set("html","temp").dispose();}))?B():arguments.callee.delay(50);})();
|
||||
}else{if(Browser.Engine.webkit&&Browser.Engine.version<525){(function(){(["loaded","complete"].contains(document.readyState))?B():arguments.callee.delay(50);
|
||||
})();}else{window.addEvent("load",B);document.addEvent("DOMContentLoaded",B);}}})();var JSON=new Hash({$specialChars:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},$replaceChars:function(A){return JSON.$specialChars[A]||"\\u00"+Math.floor(A.charCodeAt()/16).toString(16)+(A.charCodeAt()%16).toString(16);
|
||||
},encode:function(B){switch($type(B)){case"string":return'"'+B.replace(/[\x00-\x1f\\"]/g,JSON.$replaceChars)+'"';case"array":return"["+String(B.map(JSON.encode).filter($defined))+"]";
|
||||
case"object":case"hash":var A=[];Hash.each(B,function(E,D){var C=JSON.encode(E);if(C){A.push(JSON.encode(D)+":"+C);}});return"{"+A+"}";case"number":case"boolean":return String(B);
|
||||
case false:return"null";}return null;},decode:function(string,secure){if($type(string)!="string"||!string.length){return null;}if(secure&&!(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(string.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,""))){return null;
|
||||
}return eval("("+string+")");}});Native.implement([Hash,Array,String,Number],{toJSON:function(){return JSON.encode(this);}});var Cookie=new Class({Implements:Options,options:{path:false,domain:false,duration:false,secure:false,document:document},initialize:function(B,A){this.key=B;
|
||||
this.setOptions(A);},write:function(B){B=encodeURIComponent(B);if(this.options.domain){B+="; domain="+this.options.domain;}if(this.options.path){B+="; path="+this.options.path;
|
||||
}if(this.options.duration){var A=new Date();A.setTime(A.getTime()+this.options.duration*24*60*60*1000);B+="; expires="+A.toGMTString();}if(this.options.secure){B+="; secure";
|
||||
}this.options.document.cookie=this.key+"="+B;return this;},read:function(){var A=this.options.document.cookie.match("(?:^|;)\\s*"+this.key.escapeRegExp()+"=([^;]*)");
|
||||
return(A)?decodeURIComponent(A[1]):null;},dispose:function(){new Cookie(this.key,$merge(this.options,{duration:-1})).write("");return this;}});Cookie.write=function(B,C,A){return new Cookie(B,A).write(C);
|
||||
};Cookie.read=function(A){return new Cookie(A).read();};Cookie.dispose=function(B,A){return new Cookie(B,A).dispose();};var Swiff=new Class({Implements:[Options],options:{id:null,height:1,width:1,container:null,properties:{},params:{quality:"high",allowScriptAccess:"always",wMode:"transparent",swLiveConnect:true},callBacks:{},vars:{}},toElement:function(){return this.object;
|
||||
},initialize:function(L,M){this.instance="Swiff_"+$time();this.setOptions(M);M=this.options;var B=this.id=M.id||this.instance;var A=$(M.container);Swiff.CallBacks[this.instance]={};
|
||||
var E=M.params,G=M.vars,F=M.callBacks;var H=$extend({height:M.height,width:M.width},M.properties);var K=this;for(var D in F){Swiff.CallBacks[this.instance][D]=(function(N){return function(){return N.apply(K.object,arguments);
|
||||
};})(F[D]);G[D]="Swiff.CallBacks."+this.instance+"."+D;}E.flashVars=Hash.toQueryString(G);if(Browser.Engine.trident){H.classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";
|
||||
E.movie=L;}else{H.type="application/x-shockwave-flash";H.data=L;}var J='<object id="'+B+'"';for(var I in H){J+=" "+I+'="'+H[I]+'"';}J+=">";for(var C in E){if(E[C]){J+='<param name="'+C+'" value="'+E[C]+'" />';
|
||||
}}J+="</object>";this.object=((A)?A.empty():new Element("div")).set("html",J).firstChild;},replaces:function(A){A=$(A,true);A.parentNode.replaceChild(this.toElement(),A);
|
||||
return this;},inject:function(A){$(A,true).appendChild(this.toElement());return this;},remote:function(){return Swiff.remote.apply(Swiff,[this.toElement()].extend(arguments));
|
||||
}});Swiff.CallBacks={};Swiff.remote=function(obj,fn){var rs=obj.CallFunction('<invoke name="'+fn+'" returntype="javascript">'+__flash__argumentsToXML(arguments,2)+"</invoke>");
|
||||
return eval(rs);};var Fx=new Class({Implements:[Chain,Events,Options],options:{fps:50,unit:false,duration:500,link:"ignore"},initialize:function(A){this.subject=this.subject||this;
|
||||
this.setOptions(A);this.options.duration=Fx.Durations[this.options.duration]||this.options.duration.toInt();var B=this.options.wait;if(B===false){this.options.link="cancel";
|
||||
}},getTransition:function(){return function(A){return -(Math.cos(Math.PI*A)-1)/2;};},step:function(){var A=$time();if(A<this.time+this.options.duration){var B=this.transition((A-this.time)/this.options.duration);
|
||||
this.set(this.compute(this.from,this.to,B));}else{this.set(this.compute(this.from,this.to,1));this.complete();}},set:function(A){return A;},compute:function(C,B,A){return Fx.compute(C,B,A);
|
||||
},check:function(A){if(!this.timer){return true;}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(A.bind(this,Array.slice(arguments,1)));
|
||||
return false;}return false;},start:function(B,A){if(!this.check(arguments.callee,B,A)){return this;}this.from=B;this.to=A;this.time=0;this.transition=this.getTransition();
|
||||
this.startTimer();this.onStart();return this;},complete:function(){if(this.stopTimer()){this.onComplete();}return this;},cancel:function(){if(this.stopTimer()){this.onCancel();
|
||||
}return this;},onStart:function(){this.fireEvent("start",this.subject);},onComplete:function(){this.fireEvent("complete",this.subject);if(!this.callChain()){this.fireEvent("chainComplete",this.subject);
|
||||
}},onCancel:function(){this.fireEvent("cancel",this.subject).clearChain();},pause:function(){this.stopTimer();return this;},resume:function(){this.startTimer();
|
||||
return this;},stopTimer:function(){if(!this.timer){return false;}this.time=$time()-this.time;this.timer=$clear(this.timer);return true;},startTimer:function(){if(this.timer){return false;
|
||||
}this.time=$time()-this.time;this.timer=this.step.periodical(Math.round(1000/this.options.fps),this);return true;}});Fx.compute=function(C,B,A){return(B-C)*A+C;
|
||||
};Fx.Durations={"short":250,normal:500,"long":1000};Fx.CSS=new Class({Extends:Fx,prepare:function(D,E,B){B=$splat(B);var C=B[1];if(!$chk(C)){B[1]=B[0];
|
||||
B[0]=D.getStyle(E);}var A=B.map(this.parse);return{from:A[0],to:A[1]};},parse:function(A){A=$lambda(A)();A=(typeof A=="string")?A.split(" "):$splat(A);
|
||||
return A.map(function(C){C=String(C);var B=false;Fx.CSS.Parsers.each(function(F,E){if(B){return ;}var D=F.parse(C);if($chk(D)){B={value:D,parser:F};}});
|
||||
B=B||{value:C,parser:Fx.CSS.Parsers.String};return B;});},compute:function(D,C,B){var A=[];(Math.min(D.length,C.length)).times(function(E){A.push({value:D[E].parser.compute(D[E].value,C[E].value,B),parser:D[E].parser});
|
||||
});A.$family={name:"fx:css:value"};return A;},serve:function(C,B){if($type(C)!="fx:css:value"){C=this.parse(C);}var A=[];C.each(function(D){A=A.concat(D.parser.serve(D.value,B));
|
||||
});return A;},render:function(A,D,C,B){A.setStyle(D,this.serve(C,B));},search:function(A){if(Fx.CSS.Cache[A]){return Fx.CSS.Cache[A];}var B={};Array.each(document.styleSheets,function(E,D){var C=E.href;
|
||||
if(C&&C.contains("://")&&!C.contains(document.domain)){return ;}var F=E.rules||E.cssRules;Array.each(F,function(I,G){if(!I.style){return ;}var H=(I.selectorText)?I.selectorText.replace(/^\w+/,function(J){return J.toLowerCase();
|
||||
}):null;if(!H||!H.test("^"+A+"$")){return ;}Element.Styles.each(function(K,J){if(!I.style[J]||Element.ShortStyles[J]){return ;}K=String(I.style[J]);B[J]=(K.test(/^rgb/))?K.rgbToHex():K;
|
||||
});});});return Fx.CSS.Cache[A]=B;}});Fx.CSS.Cache={};Fx.CSS.Parsers=new Hash({Color:{parse:function(A){if(A.match(/^#[0-9a-f]{3,6}$/i)){return A.hexToRgb(true);
|
||||
}return((A=A.match(/(\d+),\s*(\d+),\s*(\d+)/)))?[A[1],A[2],A[3]]:false;},compute:function(C,B,A){return C.map(function(E,D){return Math.round(Fx.compute(C[D],B[D],A));
|
||||
});},serve:function(A){return A.map(Number);}},Number:{parse:parseFloat,compute:Fx.compute,serve:function(B,A){return(A)?B+A:B;}},String:{parse:$lambda(false),compute:$arguments(1),serve:$arguments(0)}});
|
||||
Fx.Tween=new Class({Extends:Fx.CSS,initialize:function(B,A){this.element=this.subject=$(B);this.parent(A);},set:function(B,A){if(arguments.length==1){A=B;
|
||||
B=this.property||this.options.property;}this.render(this.element,B,A,this.options.unit);return this;},start:function(C,E,D){if(!this.check(arguments.callee,C,E,D)){return this;
|
||||
}var B=Array.flatten(arguments);this.property=this.options.property||B.shift();var A=this.prepare(this.element,this.property,B);return this.parent(A.from,A.to);
|
||||
}});Element.Properties.tween={set:function(A){var B=this.retrieve("tween");if(B){B.cancel();}return this.eliminate("tween").store("tween:options",$extend({link:"cancel"},A));
|
||||
},get:function(A){if(A||!this.retrieve("tween")){if(A||!this.retrieve("tween:options")){this.set("tween",A);}this.store("tween",new Fx.Tween(this,this.retrieve("tween:options")));
|
||||
}return this.retrieve("tween");}};Element.implement({tween:function(A,C,B){this.get("tween").start(arguments);return this;},fade:function(C){var E=this.get("tween"),D="opacity",A;
|
||||
C=$pick(C,"toggle");switch(C){case"in":E.start(D,1);break;case"out":E.start(D,0);break;case"show":E.set(D,1);break;case"hide":E.set(D,0);break;case"toggle":var B=this.retrieve("fade:flag",this.get("opacity")==1);
|
||||
E.start(D,(B)?0:1);this.store("fade:flag",!B);A=true;break;default:E.start(D,arguments);}if(!A){this.eliminate("fade:flag");}return this;},highlight:function(C,A){if(!A){A=this.retrieve("highlight:original",this.getStyle("background-color"));
|
||||
A=(A=="transparent")?"#fff":A;}var B=this.get("tween");B.start("background-color",C||"#ffff88",A).chain(function(){this.setStyle("background-color",this.retrieve("highlight:original"));
|
||||
B.callChain();}.bind(this));return this;}});Fx.Morph=new Class({Extends:Fx.CSS,initialize:function(B,A){this.element=this.subject=$(B);this.parent(A);},set:function(A){if(typeof A=="string"){A=this.search(A);
|
||||
}for(var B in A){this.render(this.element,B,A[B],this.options.unit);}return this;},compute:function(E,D,C){var A={};for(var B in E){A[B]=this.parent(E[B],D[B],C);
|
||||
}return A;},start:function(B){if(!this.check(arguments.callee,B)){return this;}if(typeof B=="string"){B=this.search(B);}var E={},D={};for(var C in B){var A=this.prepare(this.element,C,B[C]);
|
||||
E[C]=A.from;D[C]=A.to;}return this.parent(E,D);}});Element.Properties.morph={set:function(A){var B=this.retrieve("morph");if(B){B.cancel();}return this.eliminate("morph").store("morph:options",$extend({link:"cancel"},A));
|
||||
},get:function(A){if(A||!this.retrieve("morph")){if(A||!this.retrieve("morph:options")){this.set("morph",A);}this.store("morph",new Fx.Morph(this,this.retrieve("morph:options")));
|
||||
}return this.retrieve("morph");}};Element.implement({morph:function(A){this.get("morph").start(A);return this;}});Fx.implement({getTransition:function(){var A=this.options.transition||Fx.Transitions.Sine.easeInOut;
|
||||
if(typeof A=="string"){var B=A.split(":");A=Fx.Transitions;A=A[B[0]]||A[B[0].capitalize()];if(B[1]){A=A["ease"+B[1].capitalize()+(B[2]?B[2].capitalize():"")];
|
||||
}}return A;}});Fx.Transition=function(B,A){A=$splat(A);return $extend(B,{easeIn:function(C){return B(C,A);},easeOut:function(C){return 1-B(1-C,A);},easeInOut:function(C){return(C<=0.5)?B(2*C,A)/2:(2-B(2*(1-C),A))/2;
|
||||
}});};Fx.Transitions=new Hash({linear:$arguments(0)});Fx.Transitions.extend=function(A){for(var B in A){Fx.Transitions[B]=new Fx.Transition(A[B]);}};Fx.Transitions.extend({Pow:function(B,A){return Math.pow(B,A[0]||6);
|
||||
},Expo:function(A){return Math.pow(2,8*(A-1));},Circ:function(A){return 1-Math.sin(Math.acos(A));},Sine:function(A){return 1-Math.sin((1-A)*Math.PI/2);
|
||||
},Back:function(B,A){A=A[0]||1.618;return Math.pow(B,2)*((A+1)*B-A);},Bounce:function(D){var C;for(var B=0,A=1;1;B+=A,A/=2){if(D>=(7-4*B)/11){C=A*A-Math.pow((11-6*B-11*D)/4,2);
|
||||
break;}}return C;},Elastic:function(B,A){return Math.pow(2,10*--B)*Math.cos(20*B*Math.PI*(A[0]||1)/3);}});["Quad","Cubic","Quart","Quint"].each(function(B,A){Fx.Transitions[B]=new Fx.Transition(function(C){return Math.pow(C,[A+2]);
|
||||
});});var Request=new Class({Implements:[Chain,Events,Options],options:{url:"",data:"",headers:{"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript, text/html, application/xml, text/xml, */*"},async:true,format:false,method:"post",link:"ignore",isSuccess:null,emulation:true,urlEncoded:true,encoding:"utf-8",evalScripts:false,evalResponse:false},initialize:function(A){this.xhr=new Browser.Request();
|
||||
this.setOptions(A);this.options.isSuccess=this.options.isSuccess||this.isSuccess;this.headers=new Hash(this.options.headers);},onStateChange:function(){if(this.xhr.readyState!=4||!this.running){return ;
|
||||
}this.running=false;this.status=0;$try(function(){this.status=this.xhr.status;}.bind(this));if(this.options.isSuccess.call(this,this.status)){this.response={text:this.xhr.responseText,xml:this.xhr.responseXML};
|
||||
this.success(this.response.text,this.response.xml);}else{this.response={text:null,xml:null};this.failure();}this.xhr.onreadystatechange=$empty;},isSuccess:function(){return((this.status>=200)&&(this.status<300));
|
||||
},processScripts:function(A){if(this.options.evalResponse||(/(ecma|java)script/).test(this.getHeader("Content-type"))){return $exec(A);}return A.stripScripts(this.options.evalScripts);
|
||||
},success:function(B,A){this.onSuccess(this.processScripts(B),A);},onSuccess:function(){this.fireEvent("complete",arguments).fireEvent("success",arguments).callChain();
|
||||
},failure:function(){this.onFailure();},onFailure:function(){this.fireEvent("complete").fireEvent("failure",this.xhr);},setHeader:function(A,B){this.headers.set(A,B);
|
||||
return this;},getHeader:function(A){return $try(function(){return this.xhr.getResponseHeader(A);}.bind(this));},check:function(A){if(!this.running){return true;
|
||||
}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(A.bind(this,Array.slice(arguments,1)));return false;}return false;
|
||||
},send:function(I){if(!this.check(arguments.callee,I)){return this;}this.running=true;var G=$type(I);if(G=="string"||G=="element"){I={data:I};}var D=this.options;
|
||||
I=$extend({data:D.data,url:D.url,method:D.method},I);var E=I.data,B=I.url,A=I.method;switch($type(E)){case"element":E=$(E).toQueryString();break;case"object":case"hash":E=Hash.toQueryString(E);
|
||||
}if(this.options.format){var H="format="+this.options.format;E=(E)?H+"&"+E:H;}if(this.options.emulation&&["put","delete"].contains(A)){var F="_method="+A;
|
||||
E=(E)?F+"&"+E:F;A="post";}if(this.options.urlEncoded&&A=="post"){var C=(this.options.encoding)?"; charset="+this.options.encoding:"";this.headers.set("Content-type","application/x-www-form-urlencoded"+C);
|
||||
}if(E&&A=="get"){B=B+(B.contains("?")?"&":"?")+E;E=null;}this.xhr.open(A.toUpperCase(),B,this.options.async);this.xhr.onreadystatechange=this.onStateChange.bind(this);
|
||||
this.headers.each(function(K,J){try{this.xhr.setRequestHeader(J,K);}catch(L){this.fireEvent("exception",[J,K]);}},this);this.fireEvent("request");this.xhr.send(E);
|
||||
if(!this.options.async){this.onStateChange();}return this;},cancel:function(){if(!this.running){return this;}this.running=false;this.xhr.abort();this.xhr.onreadystatechange=$empty;
|
||||
this.xhr=new Browser.Request();this.fireEvent("cancel");return this;}});(function(){var A={};["get","post","put","delete","GET","POST","PUT","DELETE"].each(function(B){A[B]=function(){var C=Array.link(arguments,{url:String.type,data:$defined});
|
||||
return this.send($extend(C,{method:B.toLowerCase()}));};});Request.implement(A);})();Element.Properties.send={set:function(A){var B=this.retrieve("send");
|
||||
if(B){B.cancel();}return this.eliminate("send").store("send:options",$extend({data:this,link:"cancel",method:this.get("method")||"post",url:this.get("action")},A));
|
||||
},get:function(A){if(A||!this.retrieve("send")){if(A||!this.retrieve("send:options")){this.set("send",A);}this.store("send",new Request(this.retrieve("send:options")));
|
||||
}return this.retrieve("send");}};Element.implement({send:function(A){var B=this.get("send");B.send({data:this,url:A||B.options.url});return this;}});Request.HTML=new Class({Extends:Request,options:{update:false,evalScripts:true,filter:false},processHTML:function(C){var B=C.match(/<body[^>]*>([\s\S]*?)<\/body>/i);
|
||||
C=(B)?B[1]:C;var A=new Element("div");return $try(function(){var D="<root>"+C+"</root>",G;if(Browser.Engine.trident){G=new ActiveXObject("Microsoft.XMLDOM");
|
||||
G.async=false;G.loadXML(D);}else{G=new DOMParser().parseFromString(D,"text/xml");}D=G.getElementsByTagName("root")[0];for(var F=0,E=D.childNodes.length;
|
||||
F<E;F++){var H=Element.clone(D.childNodes[F],true,true);if(H){A.grab(H);}}return A;})||A.set("html",C);},success:function(D){var C=this.options,B=this.response;
|
||||
B.html=D.stripScripts(function(E){B.javascript=E;});var A=this.processHTML(B.html);B.tree=A.childNodes;B.elements=A.getElements("*");if(C.filter){B.tree=B.elements.filter(C.filter);
|
||||
}if(C.update){$(C.update).empty().set("html",B.html);}if(C.evalScripts){$exec(B.javascript);}this.onSuccess(B.tree,B.elements,B.html,B.javascript);}});
|
||||
Element.Properties.load={set:function(A){var B=this.retrieve("load");if(B){B.cancel();}return this.eliminate("load").store("load:options",$extend({data:this,link:"cancel",update:this,method:"get"},A));
|
||||
},get:function(A){if(A||!this.retrieve("load")){if(A||!this.retrieve("load:options")){this.set("load",A);}this.store("load",new Request.HTML(this.retrieve("load:options")));
|
||||
}return this.retrieve("load");}};Element.implement({load:function(){this.get("load").send(Array.link(arguments,{data:Object.type,url:String.type}));return this;
|
||||
}});Request.JSON=new Class({Extends:Request,options:{secure:true},initialize:function(A){this.parent(A);this.headers.extend({Accept:"application/json","X-Request":"JSON"});
|
||||
},success:function(A){this.response.json=JSON.decode(A,this.options.secure);this.onSuccess(this.response.json,A);}});
|
10
mockup/javascript/mootools-1.2.1-more.js
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
//MooTools More, <http://mootools.net/more>. Copyright (c) 2006-2008 Valerio Proietti, <http://mad4milk.net>, MIT Style License.
|
||||
|
||||
Fx.Scroll=new Class({Extends:Fx,options:{offset:{x:0,y:0},wheelStops:true},initialize:function(B,A){this.element=this.subject=$(B);this.parent(A);var D=this.cancel.bind(this,false);
|
||||
if($type(this.element)!="element"){this.element=$(this.element.getDocument().body);}var C=this.element;if(this.options.wheelStops){this.addEvent("start",function(){C.addEvent("mousewheel",D);
|
||||
},true);this.addEvent("complete",function(){C.removeEvent("mousewheel",D);},true);}},set:function(){var A=Array.flatten(arguments);this.element.scrollTo(A[0],A[1]);
|
||||
},compute:function(E,D,C){var B=[];var A=2;A.times(function(F){B.push(Fx.compute(E[F],D[F],C));});return B;},start:function(C,H){if(!this.check(arguments.callee,C,H)){return this;
|
||||
}var E=this.element.getSize(),F=this.element.getScrollSize();var B=this.element.getScroll(),D={x:C,y:H};for(var G in D){var A=F[G]-E[G];if($chk(D[G])){D[G]=($type(D[G])=="number")?D[G].limit(0,A):A;
|
||||
}else{D[G]=B[G];}D[G]+=this.options.offset[G];}return this.parent([B.x,B.y],[D.x,D.y]);},toTop:function(){return this.start(false,0);},toLeft:function(){return this.start(0,false);
|
||||
},toRight:function(){return this.start("right",false);},toBottom:function(){return this.start(false,"bottom");},toElement:function(B){var A=$(B).getPosition(this.element);
|
||||
return this.start(A.x,A.y);}});
|
BIN
mockup/mockup/001.png
Normal file
After Width: | Height: | Size: 87 KiB |
BIN
mockup/mockup/002.png
Normal file
After Width: | Height: | Size: 89 KiB |
BIN
mockup/mockup/003.png
Normal file
After Width: | Height: | Size: 102 KiB |
BIN
mockup/mockup/004.png
Normal file
After Width: | Height: | Size: 107 KiB |
BIN
mockup/mockup/005.png
Normal file
After Width: | Height: | Size: 112 KiB |
BIN
mockup/mockup/006.png
Normal file
After Width: | Height: | Size: 126 KiB |