Widget interface updates from mdawaffe. see #5583

git-svn-id: http://svn.automattic.com/wordpress/trunk@6754 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-02-07 21:57:54 +00:00
parent 47faf261ba
commit f8be8cb880
6 changed files with 209 additions and 430 deletions

View File

@ -1,38 +1,44 @@
.dropzone,
#palettediv,
.handle,
.controlform {
direction: rtl;
text-align: justify;
}
.dropzone {
div.widget-liquid-left-holder {
float: right;
margin-left: 10px;
margin-right: auto;
width: 240px;
}
* html .dropzone ul {
clear: right;
margin-left: -310px;
margin-right: 0;
}
* .handle, #lastmodule span {
border-left: 1px solid #e8e8e8;
border-right: 1px solid #f2f2f2;
}
* .popper {
}
div.widget-liquid-left {
margin-right: 0;
margin-left: 310px;
}
div.widget-liquid-right {
float: left;
clear: left;
}
p#widget-search {
left: 0;
right: auto;
left: 3px;
}
#palettediv .module, #lastmodule {
margin-right: auto;
margin-left: 10px;
}
ul#widget-list li.widget-list-item h4.widget-title {
float: right;
}
#palettediv ul {
padding: 0 10px 0 0;
}
ul#widget-list li.widget-list-item div.widget-description {
margin: 0 200px 0 0;
padding: 0 4em 0 0;
}
h4.widget-title a {
left: 1em;
right: auto;
}
li.widget-list-control-item div.widget-control {
padding: 0 0 0 10px;
}
ul.widget-control-list div.widget-control-actions {
margin-left: -10px;
margin-right: 0;
width: 100%;
}
.placemat {
margin-right: 0;
float: right;
}
}

View File

@ -1,236 +1,155 @@
body {
height: 100%;
}
#sbadmin #zones {
-moz-user-select: none;
-khtml-user-select: none;
user-select: none;
}
#sbreset {
/* 2 column liquid layout */
div.widget-liquid-left-holder {
float: left;
margin: 1px 0;
}
.dropzone {
border: 1px solid #bbb;
float: left;
margin-right: 10px;
padding: 5px;
background-color: #f0f8ff;
}
.dropzone h3 {
text-align: center;
color: #333;
}
.dropzone input {
display: none;
}
.dropzone ul {
float: left;
list-style-type: none;
width: 240px;
margin: 0;
min-height: 200px;
padding: 0;
display: block;
}
* .module {
width: 238px;
padding: 0;
margin: 5px 0;
cursor: move;
display: block;
border: 1px solid #ccc;
background-color: #fbfbfb;
position: relative;
text-align: left;
line-height: 25px;
}
* .handle {
display: block;
width: 216px;
padding: 0 10px;
position: relative;
border-top: 1px solid #f2f2f2;
border-right: 1px solid #e8e8e8;
border-bottom: 1px solid #e8e8e8;
border-left: 1px solid #f2f2f2;
}
* .popper {
margin: 0;
display: inline;
position: absolute;
top: 3px;
right: 3px;
overflow: hidden;
text-align: center;
height: 16px;
font-size: 18px;
line-height: 14px;
cursor: pointer;
padding: 0 3px 1px;
border-top: 4px solid #6da6d1;
background: url( ../images/fade-butt.png ) -5px 0px;
}
* html .popper {
padding: 1px 6px 0;
font-size: 16px;
}
#sbadmin p.submit {
padding-right: 10px;
clear: left;
width: 100%;
margin-right: -310px;
}
.placemat {
cursor: default;
margin: 0;
padding: 0;
div.widget-liquid-left {
margin-right: 310px;
}
div.widget-liquid-right {
float: right;
clear: right;
width: 300px;
}
/* pasitioning etc. */
form#widgets-filter {
position: relative;
}
.placemat h4 {
text-align: center;
div#available-widgets-filter {
border-bottom: 1px solid #ccc;
}
.placemat span {
background-color: #ffe;
border: 1px solid #ccc;
padding: 0 10px 10px;
p#widget-search {
position: absolute;
text-align: justify;
}
#palettediv {
border: 1px solid #bbb;
background-color: #f0f8ff;
height:auto;
margin-top: 10px;
padding-bottom: 10px;
}
#palettediv:after, #zones:after, .dropzone:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
#palettediv, #zones, .dropzone {
display: block;
min-height: 1px;
}
* html #palettediv, * html #zones, * html .dropzone {
height: 1%;
}
#palettediv h3 {
text-align: center;
color: #333;
min-height: 1px;
}
#palettediv ul {
padding: 0 0 0 10px;
}
#palettediv .module {
margin-right: 10px;
float: left;
width: 120px;
}
#palettediv .handle {
height: 40px;
font-size: 90%;
width: 110px;
padding: 0 5px;
}
#palettediv .popper {
visibility: hidden;
}
* html #palettediv ul {
right: 0;
top: 0;
margin: 0;
padding: 0 0 0 10px;
}
#controls {
height: 0px;
div#widget-content {
border-bottom: 1px solid #ccc;
}
.control {
position: absolute;
display: block;
background: #f9fcfe;
ul#widget-list {
list-style: none;
margin: 0;
padding: 0;
}
.controlhandle {
cursor: move;
background-color: #6da6d1;
border-bottom: 2px solid #448abd;
color: #333;
display: block;
margin: 0 0 5px;
padding: 4px;
font-size: 120%;
ul#widget-list li.widget-list-item {
padding: .7em 1em;
margin: 0;
border-bottom: 1px solid #ccc;
background-color: transparent;
line-height: 1;
}
.controlcloser {
cursor: pointer;
font-size: 120%;
display: block;
position: absolute;
top: 2px;
right: 8px;
padding: 0 3px;
font-weight: bold;
}
.controlform {
margin: 20px 30px;
}
.controlform p {
text-align: center;
}
.control .checkbox {
border: none;
background: transparent;
}
.hidden {
display: none;
}
#shadow {
background: black;
display: none;
position: absolute;
top: 0px;
left: 0px;
width: 100%;
}
#dragHelper {
position: absolute;
}
#dragHelper li.module {
display: block;
ul#widget-list li.widget-list-item h4.widget-title {
position: relative;
margin: 0;
padding: .5em 1em;
width: 200px;
float: left;
background-color: #f0f0f0;
color: #000;
}
#dragHelper h4.widget-title {
color: #fff;
background-color: #2683ae;
padding: .5em 1em;
margin: 0;
}
ul#widget-list li.widget-list-item div.widget-description {
display: block;
margin: 0 0 0 200px;
padding: 0 0 0 4em;
}
ul#widget-list li.widget-list-item ul.widget-control-info {
display: none;
}
div#sidebar-info {
padding: 0 1em;
margin-bottom: 1em;
}
ul.widget-control-list {
list-style: none;
margin: 0;
padding: 0 1em;
}
li.widget-list-control-item {
background-color: #eaf3fa;
margin: 0 0 1em;
}
li.widget-list-control-item h4, #dragHelper li.widget-list-control-item h4 {
position: relative;
margin: 0;
background-color: #2683ae;
padding: .5em 1em;
color: #fff;
}
div.widget-control a.widget-action, div.widget-control a.widget-action:hover {
padding: .5em 1em;
}
h4.widget-title a {
position: absolute;
right: 1em;
text-decoration: underline;
border-bottom: none;
}
li.widget-list-control-item h4.widget-title a, li.widget-list-control-item h4.widget-title a:visited {
color: #fff;
}
li.widget-list-control-item h4.widget-title a:hover {
color: #fff;
text-decoration: none;
border-bottom: none;
}
li.widget-list-control-item div.widget-control {
display: none;
margin: 1em;
padding: 0 10px 0 0; /* Correction for padding, margin, border of inputs */
}
li.widget-list-control-item div.widget-control p {
margin: 0 0 1em;
padding: 0;
}
ul.widget-control-list div.widget-control-actions {
margin-right: -10px; /* Correction for padding, margin, border of inputs */
padding: 0 0 1em;
}
ul.widget-control-list .sorthelper {
background-color: #ccf3fa;
}
div#current-widgets {
padding-top: 1em;
border-top: 1px solid #ccc;
border-bottom: 1px solid #ccc;
}
#current-widgets .drop-widget-here {
background-color: #ffc
}

View File

@ -14,7 +14,6 @@ require_once(ABSPATH . 'wp-admin/includes/template.php');
require_once(ABSPATH . 'wp-admin/includes/theme.php');
require_once(ABSPATH . 'wp-admin/includes/user.php');
require_once(ABSPATH . 'wp-admin/includes/update.php');
require_once(ABSPATH . 'wp-admin/includes/widgets.php');
require_once(ABSPATH . WPINC . '/registration.php');

View File

@ -205,164 +205,10 @@ function wp_widget_control( $key, $widget, $display = 'display' ) {
<?php
}
function temp_widget_css() {
?>
<style type="text/css">
/* 2 column liquid layout */
div.widget-liquid-left-holder {
float: left;
clear: left;
width: 100%;
margin-right: -310px;
function widget_css() {
wp_admin_css( 'css/widgets' );
}
div.widget-liquid-left {
margin-right: 310px;
}
div.widget-liquid-right {
float: right;
clear: right;
width: 300px;
}
p.submit {
clear: both;
}
/* pasitioning etc. */
form#widgets-filter {
position: relative;
}
p#widget-search {
position: absolute;
right: 0;
top: 0;
margin: 0;
}
ul#widget-list {
list-style: none;
margin: 0;
padding: 0;
}
ul#widget-list li.widget-list-item {
padding: .7em 1em;
margin: 0;
border-top: 1px solid #ccc;
border-bottom: 1px solid #ccc;
background-color: transparent;
line-height: 1;
}
ul#widget-list li.widget-list-item h4.widget-title {
position: relative;
margin: 0;
padding: .5em 1em;
width: 200px;
float: left;
background-color: #ccc;
color: #000;
}
#dragHelper h4.widget-title {
color: #fff;
background-color: #2683ae;
padding: .5em 1em;
margin: 0;
}
ul#widget-list li.widget-list-item div.widget-description {
display: block;
margin: 0 0 0 200px;
padding: 0 0 0 4em;
}
ul#widget-list li.widget-list-item ul.widget-control-info {
display: none;
}
div#sidebar-info {
padding: 0 1em;
margin-bottom: 1em;
}
ul.widget-control-list {
list-style: none;
margin: 0;
padding: 0 1em;
}
li.widget-list-control-item {
background-color: #eaf3fa;
margin: 0 0 1em;
}
li.widget-list-control-item h4, #dragHelper li.widget-list-control-item h4 {
position: relative;
margin: 0;
background-color: #2683ae;
padding: .5em 1em;
color: #fff;
}
div.widget-control a.widget-action, div.widget-control a.widget-action:hover {
padding: .5em 1em;
}
h4.widget-title a {
position: absolute;
right: 1em;
text-decoration: underline;
border-bottom: none;
}
li.widget-list-control-item h4.widget-title a, li.widget-list-control-item h4.widget-title a:visited {
color: #fff;
}
li.widget-list-control-item h4.widget-title a:hover {
color: #fff;
text-decoration: none;
border-bottom: none;
}
li.widget-list-control-item div.widget-control {
display: none;
margin: 1em;
padding: 0 10px 0 0; /* Correction for padding, margin, border of inputs */
}
li.widget-list-control-item div.widget-control p {
margin: 0 0 1em;
padding: 0;
}
ul.widget-control-list div.widget-control-actions {
margin-right: -10px; /* Correction for padding, margin, border of inputs */
padding: 0 0 1em;
}
ul.widget-control-list .sorthelper {
background-color: #ccf3fa;
}
#current-widgets .drop-widget-here {
background-color: #ffc
}
ul.widget-control-list select option {
}
</style>
<?php
}
add_action( 'admin_head', 'temp_widget_css' );
add_action( 'admin_head', 'widget_css' );
?>

View File

@ -1,6 +1,7 @@
<?php
require_once( 'admin.php' );
require_once(ABSPATH . 'wp-admin/includes/widgets.php');
if ( ! current_user_can('switch_themes') )
wp_die( __( 'Cheatin&#8217; uh?' ));
@ -146,7 +147,7 @@ $page_links = paginate_links( array(
'current' => $page
));
*/
$page_links = false;
$page_links = '&nbsp;';
// Unsanitized!
$widget_search = isset($_GET['s']) ? $_GET['s'] : false;
@ -180,44 +181,37 @@ if ( isset($_GET['message']) && isset($messages[$_GET['message']]) ) : ?>
<h2><?php _e( 'Widgets' ); ?></h2>
<p id="widget-search">
<input type="text" id="widget-search-input" name="s" value="<?php echo attribute_escape( $widget_search ); ?>" />
<input type="submit" value="<?php _e( 'Search Widgets' ); ?>" />
<input type="submit" class="button" value="<?php _e( 'Search Widgets' ); ?>" />
</p>
<div class="widget-liquid-left-holder">
<div id="available-widgets-filter" class="widget-liquid-left">
<h3><?php printf( __('Available Widgets %s'), '<a href="#help:avaliable-widgets" class="wp-context-help">?</a>' ); ?></h3>
<p>
<div class="nav">
<select name="show">
<?php foreach ( $show_values as $show_value => $show_text ) : $show_value = attribute_escape( $show_value ); ?>
<option value='<?php echo $show_value; ?>'<?php selected( $show_value, $show ); ?>><?php echo wp_specialchars( $show_text ); ?></option>
<?php endforeach; ?>
</select>
<input type="submit" value="<?php _e('Show' ); ?>" />
</p>
<?php if ( $page_links ) : ?>
<p class="pagenav">
<?php echo $page_links; ?>
</p>
<?php endif; ?>
</div>
</div>
</div>
<div id="available-sidebars" class="widget-liquid-right">
<h3><?php printf( __('Current Widgets %s'), '<a href="#help:current-widgets" class="wp-context-help">?</a>' ); ?></h3>
<?php if ( 1 < $sidebars_count ) : ?>
<p>
<div class="nav">
<select id="sidebar-selector" name="sidebar">
<?php foreach ( $wp_registered_sidebars as $sidebar_id => $registered_sidebar ) : $sidebar_id = attribute_escape( $sidebar_id ); ?>
<option value='<?php echo $sidebar_id; ?>'<?php selected( $sidebar_id, $sidebar ); ?>><?php echo wp_specialchars( $registered_sidebar['name'] ); ?></option>
<?php endforeach; ?>
</select>
<input type="submit" value="<?php _e('Go' ); ?>" />
</p>
<?php endif; ?>
</div>
</div>
@ -229,13 +223,11 @@ if ( isset($_GET['message']) && isset($messages[$_GET['message']]) ) : ?>
<?php wp_list_widgets( $show, $widget_search ); // This lists all the widgets for the query ( $show, $search ) ?>
<?php if ( $page_links ) : ?>
<div class="nav">
<p class="pagenav">
<?php echo $page_links; ?>
</p>
<?php endif; ?>
</div>
</div>
</div>
@ -260,6 +252,8 @@ if ( isset($_GET['message']) && isset($messages[$_GET['message']]) ) : ?>
</div>
</div>
<br class="clear" />
<p class="submit">
<input type="hidden" id="generated-time" name="generated-time" value="<?php echo time(); ?>" />
<input type="submit" name="save-widgets" value="<?php _e( 'Save Changes' ); ?>" />

View File

@ -268,12 +268,16 @@ form#upload #post_content {
font: 12px Georgia, "Times New Roman", Times, serif;
}
.submit {
margin: 1.5em 0;
}
.submit input, .submit input:focus, .button, .button:focus {
color: #246;
padding: 2px;
}
.submit, .editform th, #postcustomsubmit {
.editform th, #postcustomsubmit {
text-align: right;
}
@ -731,6 +735,12 @@ set display:none; */
}
div.nav {
background-color: #eaf3fa;
padding: 0.7em 1em;
margin: .7em 0;
}
.page-numbers {
padding: 4px 7px;
border: 1px solid #fff;
@ -750,6 +760,11 @@ a.page-numbers:hover {
font-weight: bold;
}
p.pagenav {
margin: 0;
display: inline;
}
.pagenav span {
font-weight: bold;
margin: 0 6px;