mirror of
https://github.com/typecho/typecho.git
synced 2025-03-23 19:40:22 +01:00
将撰写页的附件上传移动到侧栏
移除 jQuery ui 里的 tabs
This commit is contained in:
parent
381a08ed65
commit
b2681975be
@ -599,17 +599,24 @@ button {
|
||||
*/
|
||||
.typecho-option-tabs {
|
||||
list-style: none;
|
||||
margin: 1em 0;
|
||||
padding: 0; }
|
||||
margin: 1em 0 0;
|
||||
padding: 0;
|
||||
font-size: 13px;
|
||||
text-align: center; }
|
||||
.typecho-option-tabs.fix-tabs {
|
||||
margin-bottom: 1em; }
|
||||
|
||||
.typecho-option-tabs a {
|
||||
display: block;
|
||||
margin-right: -1px;
|
||||
border: 1px solid #D9D9D6;
|
||||
padding: 0 15px;
|
||||
height: 24px;
|
||||
line-height: 24px;
|
||||
color: #666; }
|
||||
height: 26px;
|
||||
line-height: 26px;
|
||||
color: #666;
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box; }
|
||||
|
||||
.typecho-option-tabs a:hover {
|
||||
background-color: #E9E9E6;
|
||||
@ -618,11 +625,24 @@ button {
|
||||
|
||||
.typecho-option-tabs li {
|
||||
float: left; }
|
||||
.typecho-option-tabs li:first-child a {
|
||||
-webkit-border-radius: 2px 0 0 2px;
|
||||
-moz-border-radius: 2px 0 0 2px;
|
||||
-ms-border-radius: 2px 0 0 2px;
|
||||
-o-border-radius: 2px 0 0 2px;
|
||||
border-radius: 2px 0 0 2px; }
|
||||
.typecho-option-tabs li:last-child a {
|
||||
-webkit-border-radius: 0 2px 2px 0;
|
||||
-moz-border-radius: 0 2px 2px 0;
|
||||
-ms-border-radius: 0 2px 2px 0;
|
||||
-o-border-radius: 0 2px 2px 0;
|
||||
border-radius: 0 2px 2px 0; }
|
||||
|
||||
.typecho-option-tabs li.right {
|
||||
.typecho-option-tabs.right {
|
||||
float: right; }
|
||||
|
||||
.typecho-option-tabs li.current a {
|
||||
.typecho-option-tabs li.current a,
|
||||
.typecho-option-tabs li.active a {
|
||||
background-color: #E9E9E6; }
|
||||
|
||||
/**
|
||||
@ -937,12 +957,12 @@ a.operate-reply {
|
||||
list-style: none;
|
||||
padding: 0; }
|
||||
|
||||
#edit-secondary #tab-advance {
|
||||
display: none; }
|
||||
|
||||
/**
|
||||
* 标签列表
|
||||
*/
|
||||
.manage-metas .typecho-list-operate {
|
||||
margin-top: 0; }
|
||||
|
||||
.typecho-page-main ul.tag-list {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
@ -994,21 +1014,37 @@ a.operate-reply {
|
||||
*/
|
||||
#upload-panel {
|
||||
padding: 15px;
|
||||
border: 1px dashed #D9D9D6;
|
||||
border: 1px solid #D9D9D6;
|
||||
background-color: #FFF;
|
||||
color: #999;
|
||||
font-size: .92857em; }
|
||||
font-size: .92857em;
|
||||
-webkit-border-radius: 2px;
|
||||
-moz-border-radius: 2px;
|
||||
-ms-border-radius: 2px;
|
||||
-o-border-radius: 2px;
|
||||
border-radius: 2px; }
|
||||
#upload-panel.drag {
|
||||
background-color: #FFFBCC; }
|
||||
|
||||
#file-list {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0; }
|
||||
margin: 15px 0 0;
|
||||
padding: 0;
|
||||
border-top: 1px dashed #EEE;
|
||||
min-height: 180px; }
|
||||
#file-list li {
|
||||
margin-top: 5px; }
|
||||
padding: 5px 0;
|
||||
border-top: 1px dashed #EEE; }
|
||||
#file-list li:first-child {
|
||||
border: none; }
|
||||
#file-list .file {
|
||||
margin-left: 5px; }
|
||||
#file-list .insert {
|
||||
display: block;
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis; }
|
||||
|
||||
/**
|
||||
* 附件管理
|
||||
|
@ -7,7 +7,7 @@
|
||||
$(document).ready(function () {
|
||||
var textarea = $('#text'),
|
||||
toolbar = $('<div class="editor" id="wmd-button-bar" />').insertBefore(textarea.parent())
|
||||
preview = $('<div id="wmd-preview" />').insertAfter('#upload-panel');
|
||||
preview = $('<div id="wmd-preview" />').insertAfter('.submit');
|
||||
|
||||
var options = {};
|
||||
|
||||
|
@ -37,10 +37,10 @@ $(document).ready(function() {
|
||||
.data('url', data.url)
|
||||
.data('image', data.isImage)
|
||||
.html('<input type="hidden" name="attachment[]" value="' + data.cid + '" />'
|
||||
+ '<a class="insert" target="_blank" href="###" title="<?php _e('点击插入文件'); ?>">' + data.title + '</a> ' + data.bytes
|
||||
+ '<a class="insert" target="_blank" href="###" title="<?php _e('点击插入文件'); ?>">' + data.title + '</a><div class="info">' + data.bytes
|
||||
+ ' <a class="file" target="_blank" href="<?php $options->adminUrl('media.php'); ?>?cid='
|
||||
+ data.cid + '" title="<?php _e('编辑'); ?>"><i class="i-edit"></i></a>'
|
||||
+ ' <a class="delete" href="###" title="<?php _e('删除'); ?>"><i class="i-delete"></i></a>')
|
||||
+ ' <a class="delete" href="###" title="<?php _e('删除'); ?>"><i class="i-delete"></i></a></div>')
|
||||
.effect('highlight', 1000);
|
||||
|
||||
attachInsertEvent(li);
|
||||
|
@ -18,9 +18,12 @@ if (isset($post) || isset($page)) {
|
||||
<?php while ($attachment->next()): ?>
|
||||
<li data-cid="<?php $attachment->cid(); ?>" data-url="<?php echo $attachment->attachment->url; ?>" data-image="<?php echo $attachment->attachment->isImage ? 1 : 0; ?>"><input type="hidden" name="attachment[]" value="<?php $attachment->cid(); ?>" />
|
||||
<a class="insert" title="<?php _e('点击插入文件'); ?>" href="###"><?php $attachment->title(); ?></a>
|
||||
<?php echo number_format(ceil($attachment->attachment->size / 1024)); ?> Kb
|
||||
<a class="file" target="_blank" href="<?php $options->adminUrl('media.php?cid=' . $attachment->cid); ?>" title="<?php _e('编辑'); ?>"><i class="i-edit"></i></a>
|
||||
<a href="###" class="delete" title="<?php _e('删除'); ?>"><i class="i-delete"></i></a></li>
|
||||
<div class="info">
|
||||
<?php echo number_format(ceil($attachment->attachment->size / 1024)); ?> Kb
|
||||
<a class="file" target="_blank" href="<?php $options->adminUrl('media.php?cid=' . $attachment->cid); ?>" title="<?php _e('编辑'); ?>"><i class="i-edit"></i></a>
|
||||
<a href="###" class="delete" title="<?php _e('删除'); ?>"><i class="i-delete"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
<?php endwhile; ?>
|
||||
</ul>
|
||||
</div>
|
||||
|
836
admin/js/jquery-ui.js
vendored
Executable file → Normal file
836
admin/js/jquery-ui.js
vendored
Executable file → Normal file
@ -1,6 +1,6 @@
|
||||
/*! jQuery UI - v1.10.3 - 2013-11-25
|
||||
/*! jQuery UI - v1.10.3 - 2013-10-16
|
||||
* http://jqueryui.com
|
||||
* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.datepicker.js, jquery.ui.slider.js, jquery.ui.tabs.js, jquery.ui.effect.js, jquery.ui.effect-highlight.js
|
||||
* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.datepicker.js, jquery.ui.slider.js, jquery.ui.effect.js, jquery.ui.effect-highlight.js
|
||||
* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
|
||||
|
||||
(function( $, undefined ) {
|
||||
@ -3662,838 +3662,6 @@ $.widget( "ui.slider", $.ui.mouse, {
|
||||
});
|
||||
|
||||
}(jQuery));
|
||||
(function( $, undefined ) {
|
||||
|
||||
var tabId = 0,
|
||||
rhash = /#.*$/;
|
||||
|
||||
function getNextTabId() {
|
||||
return ++tabId;
|
||||
}
|
||||
|
||||
function isLocal( anchor ) {
|
||||
return anchor.hash.length > 1 &&
|
||||
decodeURIComponent( anchor.href.replace( rhash, "" ) ) ===
|
||||
decodeURIComponent( location.href.replace( rhash, "" ) );
|
||||
}
|
||||
|
||||
$.widget( "ui.tabs", {
|
||||
version: "1.10.3",
|
||||
delay: 300,
|
||||
options: {
|
||||
active: null,
|
||||
collapsible: false,
|
||||
event: "click",
|
||||
heightStyle: "content",
|
||||
hide: null,
|
||||
show: null,
|
||||
|
||||
// callbacks
|
||||
activate: null,
|
||||
beforeActivate: null,
|
||||
beforeLoad: null,
|
||||
load: null
|
||||
},
|
||||
|
||||
_create: function() {
|
||||
var that = this,
|
||||
options = this.options;
|
||||
|
||||
this.running = false;
|
||||
|
||||
this.element
|
||||
.addClass( "ui-tabs ui-widget ui-widget-content ui-corner-all" )
|
||||
.toggleClass( "ui-tabs-collapsible", options.collapsible )
|
||||
// Prevent users from focusing disabled tabs via click
|
||||
.delegate( ".ui-tabs-nav > li", "mousedown" + this.eventNamespace, function( event ) {
|
||||
if ( $( this ).is( ".ui-state-disabled" ) ) {
|
||||
event.preventDefault();
|
||||
}
|
||||
})
|
||||
// support: IE <9
|
||||
// Preventing the default action in mousedown doesn't prevent IE
|
||||
// from focusing the element, so if the anchor gets focused, blur.
|
||||
// We don't have to worry about focusing the previously focused
|
||||
// element since clicking on a non-focusable element should focus
|
||||
// the body anyway.
|
||||
.delegate( ".ui-tabs-anchor", "focus" + this.eventNamespace, function() {
|
||||
if ( $( this ).closest( "li" ).is( ".ui-state-disabled" ) ) {
|
||||
this.blur();
|
||||
}
|
||||
});
|
||||
|
||||
this._processTabs();
|
||||
options.active = this._initialActive();
|
||||
|
||||
// Take disabling tabs via class attribute from HTML
|
||||
// into account and update option properly.
|
||||
if ( $.isArray( options.disabled ) ) {
|
||||
options.disabled = $.unique( options.disabled.concat(
|
||||
$.map( this.tabs.filter( ".ui-state-disabled" ), function( li ) {
|
||||
return that.tabs.index( li );
|
||||
})
|
||||
) ).sort();
|
||||
}
|
||||
|
||||
// check for length avoids error when initializing empty list
|
||||
if ( this.options.active !== false && this.anchors.length ) {
|
||||
this.active = this._findActive( options.active );
|
||||
} else {
|
||||
this.active = $();
|
||||
}
|
||||
|
||||
this._refresh();
|
||||
|
||||
if ( this.active.length ) {
|
||||
this.load( options.active );
|
||||
}
|
||||
},
|
||||
|
||||
_initialActive: function() {
|
||||
var active = this.options.active,
|
||||
collapsible = this.options.collapsible,
|
||||
locationHash = location.hash.substring( 1 );
|
||||
|
||||
if ( active === null ) {
|
||||
// check the fragment identifier in the URL
|
||||
if ( locationHash ) {
|
||||
this.tabs.each(function( i, tab ) {
|
||||
if ( $( tab ).attr( "aria-controls" ) === locationHash ) {
|
||||
active = i;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// check for a tab marked active via a class
|
||||
if ( active === null ) {
|
||||
active = this.tabs.index( this.tabs.filter( ".ui-tabs-active" ) );
|
||||
}
|
||||
|
||||
// no active tab, set to false
|
||||
if ( active === null || active === -1 ) {
|
||||
active = this.tabs.length ? 0 : false;
|
||||
}
|
||||
}
|
||||
|
||||
// handle numbers: negative, out of range
|
||||
if ( active !== false ) {
|
||||
active = this.tabs.index( this.tabs.eq( active ) );
|
||||
if ( active === -1 ) {
|
||||
active = collapsible ? false : 0;
|
||||
}
|
||||
}
|
||||
|
||||
// don't allow collapsible: false and active: false
|
||||
if ( !collapsible && active === false && this.anchors.length ) {
|
||||
active = 0;
|
||||
}
|
||||
|
||||
return active;
|
||||
},
|
||||
|
||||
_getCreateEventData: function() {
|
||||
return {
|
||||
tab: this.active,
|
||||
panel: !this.active.length ? $() : this._getPanelForTab( this.active )
|
||||
};
|
||||
},
|
||||
|
||||
_tabKeydown: function( event ) {
|
||||
/*jshint maxcomplexity:15*/
|
||||
var focusedTab = $( this.document[0].activeElement ).closest( "li" ),
|
||||
selectedIndex = this.tabs.index( focusedTab ),
|
||||
goingForward = true;
|
||||
|
||||
if ( this._handlePageNav( event ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch ( event.keyCode ) {
|
||||
case $.ui.keyCode.RIGHT:
|
||||
case $.ui.keyCode.DOWN:
|
||||
selectedIndex++;
|
||||
break;
|
||||
case $.ui.keyCode.UP:
|
||||
case $.ui.keyCode.LEFT:
|
||||
goingForward = false;
|
||||
selectedIndex--;
|
||||
break;
|
||||
case $.ui.keyCode.END:
|
||||
selectedIndex = this.anchors.length - 1;
|
||||
break;
|
||||
case $.ui.keyCode.HOME:
|
||||
selectedIndex = 0;
|
||||
break;
|
||||
case $.ui.keyCode.SPACE:
|
||||
// Activate only, no collapsing
|
||||
event.preventDefault();
|
||||
clearTimeout( this.activating );
|
||||
this._activate( selectedIndex );
|
||||
return;
|
||||
case $.ui.keyCode.ENTER:
|
||||
// Toggle (cancel delayed activation, allow collapsing)
|
||||
event.preventDefault();
|
||||
clearTimeout( this.activating );
|
||||
// Determine if we should collapse or activate
|
||||
this._activate( selectedIndex === this.options.active ? false : selectedIndex );
|
||||
return;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
// Focus the appropriate tab, based on which key was pressed
|
||||
event.preventDefault();
|
||||
clearTimeout( this.activating );
|
||||
selectedIndex = this._focusNextTab( selectedIndex, goingForward );
|
||||
|
||||
// Navigating with control key will prevent automatic activation
|
||||
if ( !event.ctrlKey ) {
|
||||
// Update aria-selected immediately so that AT think the tab is already selected.
|
||||
// Otherwise AT may confuse the user by stating that they need to activate the tab,
|
||||
// but the tab will already be activated by the time the announcement finishes.
|
||||
focusedTab.attr( "aria-selected", "false" );
|
||||
this.tabs.eq( selectedIndex ).attr( "aria-selected", "true" );
|
||||
|
||||
this.activating = this._delay(function() {
|
||||
this.option( "active", selectedIndex );
|
||||
}, this.delay );
|
||||
}
|
||||
},
|
||||
|
||||
_panelKeydown: function( event ) {
|
||||
if ( this._handlePageNav( event ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Ctrl+up moves focus to the current tab
|
||||
if ( event.ctrlKey && event.keyCode === $.ui.keyCode.UP ) {
|
||||
event.preventDefault();
|
||||
this.active.focus();
|
||||
}
|
||||
},
|
||||
|
||||
// Alt+page up/down moves focus to the previous/next tab (and activates)
|
||||
_handlePageNav: function( event ) {
|
||||
if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_UP ) {
|
||||
this._activate( this._focusNextTab( this.options.active - 1, false ) );
|
||||
return true;
|
||||
}
|
||||
if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_DOWN ) {
|
||||
this._activate( this._focusNextTab( this.options.active + 1, true ) );
|
||||
return true;
|
||||
}
|
||||
},
|
||||
|
||||
_findNextTab: function( index, goingForward ) {
|
||||
var lastTabIndex = this.tabs.length - 1;
|
||||
|
||||
function constrain() {
|
||||
if ( index > lastTabIndex ) {
|
||||
index = 0;
|
||||
}
|
||||
if ( index < 0 ) {
|
||||
index = lastTabIndex;
|
||||
}
|
||||
return index;
|
||||
}
|
||||
|
||||
while ( $.inArray( constrain(), this.options.disabled ) !== -1 ) {
|
||||
index = goingForward ? index + 1 : index - 1;
|
||||
}
|
||||
|
||||
return index;
|
||||
},
|
||||
|
||||
_focusNextTab: function( index, goingForward ) {
|
||||
index = this._findNextTab( index, goingForward );
|
||||
this.tabs.eq( index ).focus();
|
||||
return index;
|
||||
},
|
||||
|
||||
_setOption: function( key, value ) {
|
||||
if ( key === "active" ) {
|
||||
// _activate() will handle invalid values and update this.options
|
||||
this._activate( value );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( key === "disabled" ) {
|
||||
// don't use the widget factory's disabled handling
|
||||
this._setupDisabled( value );
|
||||
return;
|
||||
}
|
||||
|
||||
this._super( key, value);
|
||||
|
||||
if ( key === "collapsible" ) {
|
||||
this.element.toggleClass( "ui-tabs-collapsible", value );
|
||||
// Setting collapsible: false while collapsed; open first panel
|
||||
if ( !value && this.options.active === false ) {
|
||||
this._activate( 0 );
|
||||
}
|
||||
}
|
||||
|
||||
if ( key === "event" ) {
|
||||
this._setupEvents( value );
|
||||
}
|
||||
|
||||
if ( key === "heightStyle" ) {
|
||||
this._setupHeightStyle( value );
|
||||
}
|
||||
},
|
||||
|
||||
_tabId: function( tab ) {
|
||||
return tab.attr( "aria-controls" ) || "ui-tabs-" + getNextTabId();
|
||||
},
|
||||
|
||||
_sanitizeSelector: function( hash ) {
|
||||
return hash ? hash.replace( /[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g, "\\$&" ) : "";
|
||||
},
|
||||
|
||||
refresh: function() {
|
||||
var options = this.options,
|
||||
lis = this.tablist.children( ":has(a[href])" );
|
||||
|
||||
// get disabled tabs from class attribute from HTML
|
||||
// this will get converted to a boolean if needed in _refresh()
|
||||
options.disabled = $.map( lis.filter( ".ui-state-disabled" ), function( tab ) {
|
||||
return lis.index( tab );
|
||||
});
|
||||
|
||||
this._processTabs();
|
||||
|
||||
// was collapsed or no tabs
|
||||
if ( options.active === false || !this.anchors.length ) {
|
||||
options.active = false;
|
||||
this.active = $();
|
||||
// was active, but active tab is gone
|
||||
} else if ( this.active.length && !$.contains( this.tablist[ 0 ], this.active[ 0 ] ) ) {
|
||||
// all remaining tabs are disabled
|
||||
if ( this.tabs.length === options.disabled.length ) {
|
||||
options.active = false;
|
||||
this.active = $();
|
||||
// activate previous tab
|
||||
} else {
|
||||
this._activate( this._findNextTab( Math.max( 0, options.active - 1 ), false ) );
|
||||
}
|
||||
// was active, active tab still exists
|
||||
} else {
|
||||
// make sure active index is correct
|
||||
options.active = this.tabs.index( this.active );
|
||||
}
|
||||
|
||||
this._refresh();
|
||||
},
|
||||
|
||||
_refresh: function() {
|
||||
this._setupDisabled( this.options.disabled );
|
||||
this._setupEvents( this.options.event );
|
||||
this._setupHeightStyle( this.options.heightStyle );
|
||||
|
||||
this.tabs.not( this.active ).attr({
|
||||
"aria-selected": "false",
|
||||
tabIndex: -1
|
||||
});
|
||||
this.panels.not( this._getPanelForTab( this.active ) )
|
||||
.hide()
|
||||
.attr({
|
||||
"aria-expanded": "false",
|
||||
"aria-hidden": "true"
|
||||
});
|
||||
|
||||
// Make sure one tab is in the tab order
|
||||
if ( !this.active.length ) {
|
||||
this.tabs.eq( 0 ).attr( "tabIndex", 0 );
|
||||
} else {
|
||||
this.active
|
||||
.addClass( "ui-tabs-active ui-state-active" )
|
||||
.attr({
|
||||
"aria-selected": "true",
|
||||
tabIndex: 0
|
||||
});
|
||||
this._getPanelForTab( this.active )
|
||||
.show()
|
||||
.attr({
|
||||
"aria-expanded": "true",
|
||||
"aria-hidden": "false"
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
_processTabs: function() {
|
||||
var that = this;
|
||||
|
||||
this.tablist = this._getList()
|
||||
.addClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" )
|
||||
.attr( "role", "tablist" );
|
||||
|
||||
this.tabs = this.tablist.find( "> li:has(a[href])" )
|
||||
.addClass( "ui-state-default ui-corner-top" )
|
||||
.attr({
|
||||
role: "tab",
|
||||
tabIndex: -1
|
||||
});
|
||||
|
||||
this.anchors = this.tabs.map(function() {
|
||||
return $( "a", this )[ 0 ];
|
||||
})
|
||||
.addClass( "ui-tabs-anchor" )
|
||||
.attr({
|
||||
role: "presentation",
|
||||
tabIndex: -1
|
||||
});
|
||||
|
||||
this.panels = $();
|
||||
|
||||
this.anchors.each(function( i, anchor ) {
|
||||
var selector, panel, panelId,
|
||||
anchorId = $( anchor ).uniqueId().attr( "id" ),
|
||||
tab = $( anchor ).closest( "li" ),
|
||||
originalAriaControls = tab.attr( "aria-controls" );
|
||||
|
||||
// inline tab
|
||||
if ( isLocal( anchor ) ) {
|
||||
selector = anchor.hash;
|
||||
panel = that.element.find( that._sanitizeSelector( selector ) );
|
||||
// remote tab
|
||||
} else {
|
||||
panelId = that._tabId( tab );
|
||||
selector = "#" + panelId;
|
||||
panel = that.element.find( selector );
|
||||
if ( !panel.length ) {
|
||||
panel = that._createPanel( panelId );
|
||||
panel.insertAfter( that.panels[ i - 1 ] || that.tablist );
|
||||
}
|
||||
panel.attr( "aria-live", "polite" );
|
||||
}
|
||||
|
||||
if ( panel.length) {
|
||||
that.panels = that.panels.add( panel );
|
||||
}
|
||||
if ( originalAriaControls ) {
|
||||
tab.data( "ui-tabs-aria-controls", originalAriaControls );
|
||||
}
|
||||
tab.attr({
|
||||
"aria-controls": selector.substring( 1 ),
|
||||
"aria-labelledby": anchorId
|
||||
});
|
||||
panel.attr( "aria-labelledby", anchorId );
|
||||
});
|
||||
|
||||
this.panels
|
||||
.addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" )
|
||||
.attr( "role", "tabpanel" );
|
||||
},
|
||||
|
||||
// allow overriding how to find the list for rare usage scenarios (#7715)
|
||||
_getList: function() {
|
||||
return this.element.find( "ol,ul" ).eq( 0 );
|
||||
},
|
||||
|
||||
_createPanel: function( id ) {
|
||||
return $( "<div>" )
|
||||
.attr( "id", id )
|
||||
.addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" )
|
||||
.data( "ui-tabs-destroy", true );
|
||||
},
|
||||
|
||||
_setupDisabled: function( disabled ) {
|
||||
if ( $.isArray( disabled ) ) {
|
||||
if ( !disabled.length ) {
|
||||
disabled = false;
|
||||
} else if ( disabled.length === this.anchors.length ) {
|
||||
disabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
// disable tabs
|
||||
for ( var i = 0, li; ( li = this.tabs[ i ] ); i++ ) {
|
||||
if ( disabled === true || $.inArray( i, disabled ) !== -1 ) {
|
||||
$( li )
|
||||
.addClass( "ui-state-disabled" )
|
||||
.attr( "aria-disabled", "true" );
|
||||
} else {
|
||||
$( li )
|
||||
.removeClass( "ui-state-disabled" )
|
||||
.removeAttr( "aria-disabled" );
|
||||
}
|
||||
}
|
||||
|
||||
this.options.disabled = disabled;
|
||||
},
|
||||
|
||||
_setupEvents: function( event ) {
|
||||
var events = {
|
||||
click: function( event ) {
|
||||
event.preventDefault();
|
||||
}
|
||||
};
|
||||
if ( event ) {
|
||||
$.each( event.split(" "), function( index, eventName ) {
|
||||
events[ eventName ] = "_eventHandler";
|
||||
});
|
||||
}
|
||||
|
||||
this._off( this.anchors.add( this.tabs ).add( this.panels ) );
|
||||
this._on( this.anchors, events );
|
||||
this._on( this.tabs, { keydown: "_tabKeydown" } );
|
||||
this._on( this.panels, { keydown: "_panelKeydown" } );
|
||||
|
||||
this._focusable( this.tabs );
|
||||
this._hoverable( this.tabs );
|
||||
},
|
||||
|
||||
_setupHeightStyle: function( heightStyle ) {
|
||||
var maxHeight,
|
||||
parent = this.element.parent();
|
||||
|
||||
if ( heightStyle === "fill" ) {
|
||||
maxHeight = parent.height();
|
||||
maxHeight -= this.element.outerHeight() - this.element.height();
|
||||
|
||||
this.element.siblings( ":visible" ).each(function() {
|
||||
var elem = $( this ),
|
||||
position = elem.css( "position" );
|
||||
|
||||
if ( position === "absolute" || position === "fixed" ) {
|
||||
return;
|
||||
}
|
||||
maxHeight -= elem.outerHeight( true );
|
||||
});
|
||||
|
||||
this.element.children().not( this.panels ).each(function() {
|
||||
maxHeight -= $( this ).outerHeight( true );
|
||||
});
|
||||
|
||||
this.panels.each(function() {
|
||||
$( this ).height( Math.max( 0, maxHeight -
|
||||
$( this ).innerHeight() + $( this ).height() ) );
|
||||
})
|
||||
.css( "overflow", "auto" );
|
||||
} else if ( heightStyle === "auto" ) {
|
||||
maxHeight = 0;
|
||||
this.panels.each(function() {
|
||||
maxHeight = Math.max( maxHeight, $( this ).height( "" ).height() );
|
||||
}).height( maxHeight );
|
||||
}
|
||||
},
|
||||
|
||||
_eventHandler: function( event ) {
|
||||
var options = this.options,
|
||||
active = this.active,
|
||||
anchor = $( event.currentTarget ),
|
||||
tab = anchor.closest( "li" ),
|
||||
clickedIsActive = tab[ 0 ] === active[ 0 ],
|
||||
collapsing = clickedIsActive && options.collapsible,
|
||||
toShow = collapsing ? $() : this._getPanelForTab( tab ),
|
||||
toHide = !active.length ? $() : this._getPanelForTab( active ),
|
||||
eventData = {
|
||||
oldTab: active,
|
||||
oldPanel: toHide,
|
||||
newTab: collapsing ? $() : tab,
|
||||
newPanel: toShow
|
||||
};
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
if ( tab.hasClass( "ui-state-disabled" ) ||
|
||||
// tab is already loading
|
||||
tab.hasClass( "ui-tabs-loading" ) ||
|
||||
// can't switch durning an animation
|
||||
this.running ||
|
||||
// click on active header, but not collapsible
|
||||
( clickedIsActive && !options.collapsible ) ||
|
||||
// allow canceling activation
|
||||
( this._trigger( "beforeActivate", event, eventData ) === false ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
options.active = collapsing ? false : this.tabs.index( tab );
|
||||
|
||||
this.active = clickedIsActive ? $() : tab;
|
||||
if ( this.xhr ) {
|
||||
this.xhr.abort();
|
||||
}
|
||||
|
||||
if ( !toHide.length && !toShow.length ) {
|
||||
$.error( "jQuery UI Tabs: Mismatching fragment identifier." );
|
||||
}
|
||||
|
||||
if ( toShow.length ) {
|
||||
this.load( this.tabs.index( tab ), event );
|
||||
}
|
||||
this._toggle( event, eventData );
|
||||
},
|
||||
|
||||
// handles show/hide for selecting tabs
|
||||
_toggle: function( event, eventData ) {
|
||||
var that = this,
|
||||
toShow = eventData.newPanel,
|
||||
toHide = eventData.oldPanel;
|
||||
|
||||
this.running = true;
|
||||
|
||||
function complete() {
|
||||
that.running = false;
|
||||
that._trigger( "activate", event, eventData );
|
||||
}
|
||||
|
||||
function show() {
|
||||
eventData.newTab.closest( "li" ).addClass( "ui-tabs-active ui-state-active" );
|
||||
|
||||
if ( toShow.length && that.options.show ) {
|
||||
that._show( toShow, that.options.show, complete );
|
||||
} else {
|
||||
toShow.show();
|
||||
complete();
|
||||
}
|
||||
}
|
||||
|
||||
// start out by hiding, then showing, then completing
|
||||
if ( toHide.length && this.options.hide ) {
|
||||
this._hide( toHide, this.options.hide, function() {
|
||||
eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" );
|
||||
show();
|
||||
});
|
||||
} else {
|
||||
eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" );
|
||||
toHide.hide();
|
||||
show();
|
||||
}
|
||||
|
||||
toHide.attr({
|
||||
"aria-expanded": "false",
|
||||
"aria-hidden": "true"
|
||||
});
|
||||
eventData.oldTab.attr( "aria-selected", "false" );
|
||||
// If we're switching tabs, remove the old tab from the tab order.
|
||||
// If we're opening from collapsed state, remove the previous tab from the tab order.
|
||||
// If we're collapsing, then keep the collapsing tab in the tab order.
|
||||
if ( toShow.length && toHide.length ) {
|
||||
eventData.oldTab.attr( "tabIndex", -1 );
|
||||
} else if ( toShow.length ) {
|
||||
this.tabs.filter(function() {
|
||||
return $( this ).attr( "tabIndex" ) === 0;
|
||||
})
|
||||
.attr( "tabIndex", -1 );
|
||||
}
|
||||
|
||||
toShow.attr({
|
||||
"aria-expanded": "true",
|
||||
"aria-hidden": "false"
|
||||
});
|
||||
eventData.newTab.attr({
|
||||
"aria-selected": "true",
|
||||
tabIndex: 0
|
||||
});
|
||||
},
|
||||
|
||||
_activate: function( index ) {
|
||||
var anchor,
|
||||
active = this._findActive( index );
|
||||
|
||||
// trying to activate the already active panel
|
||||
if ( active[ 0 ] === this.active[ 0 ] ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// trying to collapse, simulate a click on the current active header
|
||||
if ( !active.length ) {
|
||||
active = this.active;
|
||||
}
|
||||
|
||||
anchor = active.find( ".ui-tabs-anchor" )[ 0 ];
|
||||
this._eventHandler({
|
||||
target: anchor,
|
||||
currentTarget: anchor,
|
||||
preventDefault: $.noop
|
||||
});
|
||||
},
|
||||
|
||||
_findActive: function( index ) {
|
||||
return index === false ? $() : this.tabs.eq( index );
|
||||
},
|
||||
|
||||
_getIndex: function( index ) {
|
||||
// meta-function to give users option to provide a href string instead of a numerical index.
|
||||
if ( typeof index === "string" ) {
|
||||
index = this.anchors.index( this.anchors.filter( "[href$='" + index + "']" ) );
|
||||
}
|
||||
|
||||
return index;
|
||||
},
|
||||
|
||||
_destroy: function() {
|
||||
if ( this.xhr ) {
|
||||
this.xhr.abort();
|
||||
}
|
||||
|
||||
this.element.removeClass( "ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible" );
|
||||
|
||||
this.tablist
|
||||
.removeClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" )
|
||||
.removeAttr( "role" );
|
||||
|
||||
this.anchors
|
||||
.removeClass( "ui-tabs-anchor" )
|
||||
.removeAttr( "role" )
|
||||
.removeAttr( "tabIndex" )
|
||||
.removeUniqueId();
|
||||
|
||||
this.tabs.add( this.panels ).each(function() {
|
||||
if ( $.data( this, "ui-tabs-destroy" ) ) {
|
||||
$( this ).remove();
|
||||
} else {
|
||||
$( this )
|
||||
.removeClass( "ui-state-default ui-state-active ui-state-disabled " +
|
||||
"ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel" )
|
||||
.removeAttr( "tabIndex" )
|
||||
.removeAttr( "aria-live" )
|
||||
.removeAttr( "aria-busy" )
|
||||
.removeAttr( "aria-selected" )
|
||||
.removeAttr( "aria-labelledby" )
|
||||
.removeAttr( "aria-hidden" )
|
||||
.removeAttr( "aria-expanded" )
|
||||
.removeAttr( "role" );
|
||||
}
|
||||
});
|
||||
|
||||
this.tabs.each(function() {
|
||||
var li = $( this ),
|
||||
prev = li.data( "ui-tabs-aria-controls" );
|
||||
if ( prev ) {
|
||||
li
|
||||
.attr( "aria-controls", prev )
|
||||
.removeData( "ui-tabs-aria-controls" );
|
||||
} else {
|
||||
li.removeAttr( "aria-controls" );
|
||||
}
|
||||
});
|
||||
|
||||
this.panels.show();
|
||||
|
||||
if ( this.options.heightStyle !== "content" ) {
|
||||
this.panels.css( "height", "" );
|
||||
}
|
||||
},
|
||||
|
||||
enable: function( index ) {
|
||||
var disabled = this.options.disabled;
|
||||
if ( disabled === false ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( index === undefined ) {
|
||||
disabled = false;
|
||||
} else {
|
||||
index = this._getIndex( index );
|
||||
if ( $.isArray( disabled ) ) {
|
||||
disabled = $.map( disabled, function( num ) {
|
||||
return num !== index ? num : null;
|
||||
});
|
||||
} else {
|
||||
disabled = $.map( this.tabs, function( li, num ) {
|
||||
return num !== index ? num : null;
|
||||
});
|
||||
}
|
||||
}
|
||||
this._setupDisabled( disabled );
|
||||
},
|
||||
|
||||
disable: function( index ) {
|
||||
var disabled = this.options.disabled;
|
||||
if ( disabled === true ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( index === undefined ) {
|
||||
disabled = true;
|
||||
} else {
|
||||
index = this._getIndex( index );
|
||||
if ( $.inArray( index, disabled ) !== -1 ) {
|
||||
return;
|
||||
}
|
||||
if ( $.isArray( disabled ) ) {
|
||||
disabled = $.merge( [ index ], disabled ).sort();
|
||||
} else {
|
||||
disabled = [ index ];
|
||||
}
|
||||
}
|
||||
this._setupDisabled( disabled );
|
||||
},
|
||||
|
||||
load: function( index, event ) {
|
||||
index = this._getIndex( index );
|
||||
var that = this,
|
||||
tab = this.tabs.eq( index ),
|
||||
anchor = tab.find( ".ui-tabs-anchor" ),
|
||||
panel = this._getPanelForTab( tab ),
|
||||
eventData = {
|
||||
tab: tab,
|
||||
panel: panel
|
||||
};
|
||||
|
||||
// not remote
|
||||
if ( isLocal( anchor[ 0 ] ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.xhr = $.ajax( this._ajaxSettings( anchor, event, eventData ) );
|
||||
|
||||
// support: jQuery <1.8
|
||||
// jQuery <1.8 returns false if the request is canceled in beforeSend,
|
||||
// but as of 1.8, $.ajax() always returns a jqXHR object.
|
||||
if ( this.xhr && this.xhr.statusText !== "canceled" ) {
|
||||
tab.addClass( "ui-tabs-loading" );
|
||||
panel.attr( "aria-busy", "true" );
|
||||
|
||||
this.xhr
|
||||
.success(function( response ) {
|
||||
// support: jQuery <1.8
|
||||
// http://bugs.jquery.com/ticket/11778
|
||||
setTimeout(function() {
|
||||
panel.html( response );
|
||||
that._trigger( "load", event, eventData );
|
||||
}, 1 );
|
||||
})
|
||||
.complete(function( jqXHR, status ) {
|
||||
// support: jQuery <1.8
|
||||
// http://bugs.jquery.com/ticket/11778
|
||||
setTimeout(function() {
|
||||
if ( status === "abort" ) {
|
||||
that.panels.stop( false, true );
|
||||
}
|
||||
|
||||
tab.removeClass( "ui-tabs-loading" );
|
||||
panel.removeAttr( "aria-busy" );
|
||||
|
||||
if ( jqXHR === that.xhr ) {
|
||||
delete that.xhr;
|
||||
}
|
||||
}, 1 );
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
_ajaxSettings: function( anchor, event, eventData ) {
|
||||
var that = this;
|
||||
return {
|
||||
url: anchor.attr( "href" ),
|
||||
beforeSend: function( jqXHR, settings ) {
|
||||
return that._trigger( "beforeLoad", event,
|
||||
$.extend( { jqXHR : jqXHR, ajaxSettings: settings }, eventData ) );
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
_getPanelForTab: function( tab ) {
|
||||
var id = $( tab ).attr( "aria-controls" );
|
||||
return this.element.find( this._sanitizeSelector( "#" + id ) );
|
||||
}
|
||||
});
|
||||
|
||||
})( jQuery );
|
||||
(function($, undefined) {
|
||||
|
||||
var dataSpace = "ui-effects-";
|
||||
|
@ -12,34 +12,38 @@ $isAllComments = ('on' == $request->get('__typecho_all_comments') || 'on' == Typ
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="colgroup typecho-page-main" role="main">
|
||||
<div class="col-mb-12 typecho-list">
|
||||
<ul class="typecho-option-tabs clearfix">
|
||||
<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(!$isAllComments && $stat->myWaitingCommentsNum > 0 && !isset($request->cid)): ?>
|
||||
<span class="balloon"><?php $stat->myWaitingCommentsNum(); ?></span>
|
||||
<?php elseif($isAllComments && $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(!$isAllComments && $stat->mySpamCommentsNum > 0 && !isset($request->cid)): ?>
|
||||
<span class="balloon"><?php $stat->mySpamCommentsNum(); ?></span>
|
||||
<?php elseif($isAllComments && $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>
|
||||
<div class="clearfix">
|
||||
<ul class="typecho-option-tabs right">
|
||||
<?php if($user->pass('editor', true) && !isset($request->cid)): ?>
|
||||
<li class="right<?php if($isAllComments): ?> current<?php endif; ?>"><a href="<?php echo $request->makeUriByRequest('__typecho_all_comments=on'); ?>"><?php _e('所有'); ?></a></li>
|
||||
<li class="right<?php if(!$isAllComments): ?> current<?php endif; ?>"><a href="<?php echo $request->makeUriByRequest('__typecho_all_comments=off'); ?>"><?php _e('我的'); ?></a></li>
|
||||
<li class="<?php if($isAllComments): ?> current<?php endif; ?>"><a href="<?php echo $request->makeUriByRequest('__typecho_all_comments=on'); ?>"><?php _e('所有'); ?></a></li>
|
||||
<li class="<?php if(!$isAllComments): ?> current<?php endif; ?>"><a href="<?php echo $request->makeUriByRequest('__typecho_all_comments=off'); ?>"><?php _e('我的'); ?></a></li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</ul>
|
||||
<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(!$isAllComments && $stat->myWaitingCommentsNum > 0 && !isset($request->cid)): ?>
|
||||
<span class="balloon"><?php $stat->myWaitingCommentsNum(); ?></span>
|
||||
<?php elseif($isAllComments && $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(!$isAllComments && $stat->mySpamCommentsNum > 0 && !isset($request->cid)): ?>
|
||||
<span class="balloon"><?php $stat->mySpamCommentsNum(); ?></span>
|
||||
<?php elseif($isAllComments && $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>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="typecho-list-operate clearfix">
|
||||
<form method="get">
|
||||
|
@ -9,7 +9,7 @@ include 'menu.php';
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="colgroup typecho-page-main">
|
||||
<div class="col-mb-12">
|
||||
<ul class="typecho-option-tabs clearfix">
|
||||
<ul class="typecho-option-tabs fix-tabs clearfix">
|
||||
<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>
|
||||
|
@ -304,8 +304,13 @@ a.button:hover, a.balloon-button:hover {
|
||||
*/
|
||||
.typecho-option-tabs {
|
||||
list-style: none;
|
||||
margin: 1em 0;
|
||||
margin: 1em 0 0;
|
||||
padding: 0;
|
||||
font-size: 13px;
|
||||
text-align: center;
|
||||
&.fix-tabs {
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
}
|
||||
|
||||
.typecho-option-tabs a {
|
||||
@ -313,9 +318,11 @@ a.button:hover, a.balloon-button:hover {
|
||||
margin-right: -1px;
|
||||
border: 1px solid #D9D9D6;
|
||||
padding: 0 15px;
|
||||
height: 24px;
|
||||
line-height: 24px;
|
||||
height: 26px;
|
||||
line-height: 26px;
|
||||
color: #666;
|
||||
@include box-sizing(border-box);
|
||||
|
||||
}
|
||||
.typecho-option-tabs a:hover {
|
||||
background-color: #E9E9E6;
|
||||
@ -325,13 +332,20 @@ a.button:hover, a.balloon-button:hover {
|
||||
|
||||
.typecho-option-tabs li {
|
||||
float: left;
|
||||
&:first-child a {
|
||||
@include border-radius(2px 0 0 2px);
|
||||
}
|
||||
&:last-child a {
|
||||
@include border-radius(0 2px 2px 0);
|
||||
}
|
||||
}
|
||||
|
||||
.typecho-option-tabs li.right {
|
||||
.typecho-option-tabs.right {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.typecho-option-tabs li.current a {
|
||||
.typecho-option-tabs li.current a,
|
||||
.typecho-option-tabs li.active a {
|
||||
background-color: #E9E9E6;
|
||||
}
|
||||
|
||||
@ -730,14 +744,14 @@ background: #FFF1A8;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#edit-secondary {
|
||||
#tab-advance { display: none; }
|
||||
}
|
||||
|
||||
/**
|
||||
* 标签列表
|
||||
*/
|
||||
|
||||
.manage-metas .typecho-list-operate {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.typecho-page-main ul.tag-list {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
@ -784,10 +798,11 @@ background: #FFF1A8;
|
||||
*/
|
||||
#upload-panel {
|
||||
padding: 15px;
|
||||
border: 1px dashed #D9D9D6;
|
||||
border: 1px solid #D9D9D6;
|
||||
background-color: #FFF;
|
||||
color: #999;
|
||||
font-size: .92857em;
|
||||
@include border-radius(2px);
|
||||
&.drag {
|
||||
background-color: #FFFBCC;
|
||||
}
|
||||
@ -795,12 +810,25 @@ background: #FFF1A8;
|
||||
|
||||
#file-list {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
margin: 15px 0 0;
|
||||
padding: 0;
|
||||
li { margin-top: 5px; }
|
||||
border-top: 1px dashed #EEE;
|
||||
min-height: 180px;
|
||||
li {
|
||||
padding: 5px 0;
|
||||
border-top: 1px dashed #EEE;
|
||||
&:first-child { border: none; }
|
||||
}
|
||||
.file {
|
||||
margin-left: 5px;
|
||||
}
|
||||
.insert {
|
||||
display: block;
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -11,7 +11,7 @@ Typecho_Widget::widget('Widget_Themes_Files')->to($files);
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="colgroup typecho-page-main">
|
||||
<div class="col-mb-12">
|
||||
<ul class="typecho-option-tabs clearfix">
|
||||
<ul class="typecho-option-tabs fix-tabs clearfix">
|
||||
<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): ?>
|
||||
@ -29,10 +29,8 @@ Typecho_Widget::widget('Widget_Themes_Files')->to($files);
|
||||
<div class="typecho-edit-theme">
|
||||
<div class="col-mb-12 col-tb-8 col-9 content">
|
||||
<form method="post" name="theme" id="theme" action="<?php $options->index('/action/themes-edit'); ?>">
|
||||
<p>
|
||||
<label for="content" class="visuallyhidden"><?php _e('编辑源码'); ?></label>
|
||||
<textarea name="content" id="content" class="w-100 mono" <?php if(!$files->currentIsWriteable()): ?>readonly<?php endif; ?>><?php echo $files->currentContent(); ?></textarea>
|
||||
</p>
|
||||
<label for="content" class="visuallyhidden"><?php _e('编辑源码'); ?></label>
|
||||
<textarea name="content" id="content" class="w-100 mono" <?php if(!$files->currentIsWriteable()): ?>readonly<?php endif; ?>><?php echo $files->currentContent(); ?></textarea>
|
||||
<p class="submit">
|
||||
<?php if($files->currentIsWriteable()): ?>
|
||||
<input type="hidden" name="theme" value="<?php echo $files->currentTheme(); ?>" />
|
||||
|
@ -9,7 +9,7 @@ include 'menu.php';
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="colgroup typecho-page-main">
|
||||
<div class="col-mb-12">
|
||||
<ul class="typecho-option-tabs clearfix">
|
||||
<ul class="typecho-option-tabs fix-tabs clearfix">
|
||||
<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()): ?>
|
||||
|
@ -185,6 +185,17 @@ $(document).ready(function() {
|
||||
}
|
||||
});
|
||||
|
||||
// 控制附件和参数的转换
|
||||
$("#edit-secondary .typecho-option-tabs li").click(function() {
|
||||
$("#edit-secondary .typecho-option-tabs li").removeClass('active');
|
||||
$(this).addClass("active");
|
||||
$(".tab_content").hide();
|
||||
var selected_tab = $(this).find("a").attr("href");
|
||||
$(selected_tab).show();
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
// 高级选项控制
|
||||
$('#advance-panel-btn').click(function() {
|
||||
$('#advance-panel').toggle();
|
||||
|
@ -38,8 +38,6 @@ Typecho_Widget::widget('Widget_Contents_Page_Edit')->to($page);
|
||||
<textarea style="height: <?php $options->editorSize(); ?>px" autocomplete="off" id="text" name="text" class="w-100 mono"><?php echo htmlspecialchars($page->text); ?></textarea>
|
||||
</p>
|
||||
|
||||
<?php include 'file-upload.php'; ?>
|
||||
|
||||
<?php Typecho_Plugin::factory('admin/write-page.php')->content($page); ?>
|
||||
<p class="submit clearfix">
|
||||
<span class="right">
|
||||
@ -52,7 +50,15 @@ Typecho_Widget::widget('Widget_Contents_Page_Edit')->to($page);
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-mb-12 col-tb-3" role="complementary">
|
||||
<div id="edit-secondary" class="col-mb-12 col-tb-3" role="complementary">
|
||||
<ul class="typecho-option-tabs clearfix">
|
||||
<li class="active w-50"><a href="#tab-files">附件</a></li>
|
||||
<li class="w-50"><a href="#tab-advance">更多</a></li>
|
||||
</ul>
|
||||
<div id="tab-files" class="tab_content">
|
||||
<?php include 'file-upload.php'; ?>
|
||||
</div>
|
||||
<div id="tab-advance" class="tab_content">
|
||||
<section class="typecho-post-option" role="application">
|
||||
<label for="date" class="typecho-label"><?php _e('发布日期'); ?></label>
|
||||
<p><input class="typecho-date w-100" type="text" name="date" id="date" value="<?php $page->have() ? $page->date('Y-m-d H:i') : ''; ?>" /></p>
|
||||
@ -114,7 +120,7 @@ Typecho_Widget::widget('Widget_Contents_Page_Edit')->to($page);
|
||||
</p>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
@ -60,89 +60,98 @@ Typecho_Widget::widget('Widget_Contents_Post_Edit')->to($post);
|
||||
</span>
|
||||
</p>
|
||||
|
||||
<?php include 'file-upload.php'; ?>
|
||||
|
||||
<?php Typecho_Plugin::factory('admin/write-post.php')->content($post); ?>
|
||||
</div>
|
||||
<div class="col-mb-12 col-tb-3" role="complementary">
|
||||
<section class="typecho-post-option" role="application">
|
||||
<label for="date" class="typecho-label"><?php _e('发布日期'); ?></label>
|
||||
<p><input class="typecho-date w-100" type="text" name="date" id="date" value="<?php $post->have() ? $post->date('Y-m-d H:i') : ''; ?>" /></p>
|
||||
</section>
|
||||
|
||||
<section class="typecho-post-option category-option">
|
||||
<label class="typecho-label"><?php _e('分类'); ?></label>
|
||||
<?php Typecho_Widget::widget('Widget_Metas_Category_List')->to($category); ?>
|
||||
<ul>
|
||||
<?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>
|
||||
</section>
|
||||
<div id="edit-secondary" class="col-mb-12 col-tb-3" role="complementary">
|
||||
<ul class="typecho-option-tabs clearfix">
|
||||
<li class="active w-50"><a href="#tab-files">附件</a></li>
|
||||
<li class="w-50"><a href="#tab-advance">更多</a></li>
|
||||
</ul>
|
||||
|
||||
<section class="typecho-post-option">
|
||||
<label for="token-input-tags" class="typecho-label"><?php _e('标签'); ?></label>
|
||||
<p><input id="tags" name="tags" type="text" value="<?php $post->tags(',', false); ?>" class="w-100 text" /></p>
|
||||
</section>
|
||||
<div id="tab-files" class="tab_content">
|
||||
<?php include 'file-upload.php'; ?>
|
||||
</div>
|
||||
<div id="tab-advance" class="tab_content">
|
||||
<section class="typecho-post-option" role="application">
|
||||
<label for="date" class="typecho-label"><?php _e('发布日期'); ?></label>
|
||||
<p><input class="typecho-date w-100" type="text" name="date" id="date" value="<?php $post->have() ? $post->date('Y-m-d H:i') : ''; ?>" /></p>
|
||||
</section>
|
||||
|
||||
<?php Typecho_Plugin::factory('admin/write-post.php')->option($post); ?>
|
||||
|
||||
<button type="button" id="advance-panel-btn" class="btn-xs"><?php _e('高级选项'); ?> <i class="i-caret-down"></i></button>
|
||||
<div id="advance-panel">
|
||||
<?php if($user->pass('editor', true)): ?>
|
||||
<section class="typecho-post-option visibility-option">
|
||||
<label class="typecho-label"><?php _e('公开度'); ?></label>
|
||||
<section class="typecho-post-option category-option">
|
||||
<label class="typecho-label"><?php _e('分类'); ?></label>
|
||||
<?php Typecho_Widget::widget('Widget_Metas_Category_List')->to($category); ?>
|
||||
<ul>
|
||||
<?php if ($user->pass('editor', true)): ?>
|
||||
<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="hidden" value="hidden" name="visibility" type="radio"<?php if ($post->status == 'hidden') { ?> checked="true"<?php } ?> /> <label for="hidden"><?php _e('隐藏'); ?></label></li>
|
||||
<li><input id="password" value="password" name="visibility" type="radio"<?php if ($post->password) { ?> checked="true"<?php } ?> /> <label for="password"><?php _e('密码保护'); ?> <input type="text" id="post-password" name="password" class="text-s" value="<?php $post->password(); ?>" size="16" /></label></li>
|
||||
<li><input id="private" value="private" name="visibility" type="radio"<?php if ($post->status == 'private') { ?> checked="true"<?php } ?> /> <label for="private"><?php _e('私密'); ?></label></li>
|
||||
<?php endif; ?>
|
||||
<li><input id="waiting" value="waiting" name="visibility" type="radio"<?php if (!$user->pass('editor', true) || $post->status == 'waiting') { ?> checked="true"<?php } ?> /> <label for="waiting"><?php _e('待审核'); ?></label></li>
|
||||
<?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>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
|
||||
<section class="typecho-post-option">
|
||||
<label for="trackback" class="typecho-label"><?php _e('引用通告'); ?></label>
|
||||
<p><textarea id="trackback" class="w-100 mono" name="trackback" rows="3"></textarea></p>
|
||||
<p class="description"><?php _e('每一行一个引用地址, 用回车隔开'); ?></p>
|
||||
<label for="token-input-tags" class="typecho-label"><?php _e('标签'); ?></label>
|
||||
<p><input id="tags" name="tags" type="text" value="<?php $post->tags(',', false); ?>" class="w-100 text" /></p>
|
||||
</section>
|
||||
|
||||
<section class="typecho-post-option allow-option">
|
||||
<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>
|
||||
</ul>
|
||||
</section>
|
||||
<?php Typecho_Plugin::factory('admin/write-post.php')->advanceOption($post); ?>
|
||||
</div><!-- end #advance-panel -->
|
||||
<?php Typecho_Plugin::factory('admin/write-post.php')->option($post); ?>
|
||||
|
||||
<?php if($post->have()): ?>
|
||||
<?php $modified = new Typecho_Date($post->modified); ?>
|
||||
<section class="typecho-post-option">
|
||||
<p class="description">
|
||||
<br>—<br>
|
||||
<?php _e('本文由 <a href="%s">%s</a> 撰写',
|
||||
Typecho_Common::url('manage-posts.php?uid=' . $post->author->uid, $options->adminUrl), $post->author->screenName); ?><br>
|
||||
<?php _e('最后更新于 %s', $modified->word()); ?>
|
||||
</p>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
<button type="button" id="advance-panel-btn" class="btn-xs"><?php _e('高级选项'); ?> <i class="i-caret-down"></i></button>
|
||||
<div id="advance-panel">
|
||||
<?php if($user->pass('editor', true)): ?>
|
||||
<section class="typecho-post-option visibility-option">
|
||||
<label class="typecho-label"><?php _e('公开度'); ?></label>
|
||||
<ul>
|
||||
<?php if ($user->pass('editor', true)): ?>
|
||||
<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="hidden" value="hidden" name="visibility" type="radio"<?php if ($post->status == 'hidden') { ?> checked="true"<?php } ?> /> <label for="hidden"><?php _e('隐藏'); ?></label></li>
|
||||
<li><input id="password" value="password" name="visibility" type="radio"<?php if ($post->password) { ?> checked="true"<?php } ?> /> <label for="password"><?php _e('密码保护'); ?> <input type="text" id="post-password" name="password" class="text-s" value="<?php $post->password(); ?>" size="16" /></label></li>
|
||||
<li><input id="private" value="private" name="visibility" type="radio"<?php if ($post->status == 'private') { ?> checked="true"<?php } ?> /> <label for="private"><?php _e('私密'); ?></label></li>
|
||||
<?php endif; ?>
|
||||
<li><input id="waiting" value="waiting" name="visibility" type="radio"<?php if (!$user->pass('editor', true) || $post->status == 'waiting') { ?> checked="true"<?php } ?> /> <label for="waiting"><?php _e('待审核'); ?></label></li>
|
||||
</ul>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
|
||||
<section class="typecho-post-option">
|
||||
<label for="trackback" class="typecho-label"><?php _e('引用通告'); ?></label>
|
||||
<p><textarea id="trackback" class="w-100 mono" name="trackback" rows="3"></textarea></p>
|
||||
<p class="description"><?php _e('每一行一个引用地址, 用回车隔开'); ?></p>
|
||||
</section>
|
||||
|
||||
<section class="typecho-post-option allow-option">
|
||||
<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>
|
||||
</ul>
|
||||
</section>
|
||||
<?php Typecho_Plugin::factory('admin/write-post.php')->advanceOption($post); ?>
|
||||
</div><!-- end #advance-panel -->
|
||||
|
||||
<?php if($post->have()): ?>
|
||||
<?php $modified = new Typecho_Date($post->modified); ?>
|
||||
<section class="typecho-post-option">
|
||||
<p class="description">
|
||||
<br>—<br>
|
||||
<?php _e('本文由 <a href="%s">%s</a> 撰写',
|
||||
Typecho_Common::url('manage-posts.php?uid=' . $post->author->uid, $options->adminUrl), $post->author->screenName); ?><br>
|
||||
<?php _e('最后更新于 %s', $modified->word()); ?>
|
||||
</p>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user