Press This styling updates from noel. fixes #6998
git-svn-id: http://svn.automattic.com/wordpress/trunk@7957 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
01acf41355
commit
60e440142e
|
@ -1,147 +1,14 @@
|
|||
/* jquery tabs css */
|
||||
|
||||
/* Caution! Ensure accessibility in print and other media types... */
|
||||
@media projection, screen { /* Use class for showing/hiding tab content, so that visibility can be better controlled in different media types... */
|
||||
.ui-tabs-hide {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* Hide useless elements in print layouts... */
|
||||
@media print {
|
||||
.ui-tabs-nav {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* Skin */
|
||||
.ui-tabs-nav, .ui-tabs-panel {
|
||||
font-family: "Trebuchet MS", Trebuchet, Verdana, Helvetica, Arial, sans-serif;
|
||||
font-size: 12px;
|
||||
}
|
||||
.ui-tabs-nav {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0 0 0 4px;
|
||||
}
|
||||
.ui-tabs-nav:after { /* clearing without presentational markup, IE gets extra treatment */
|
||||
display: block;
|
||||
clear: both;
|
||||
content: " ";
|
||||
}
|
||||
.ui-tabs-nav li {
|
||||
float: left;
|
||||
margin: 0 0 0 1px;
|
||||
min-width: 84px; /* be nice to Opera */
|
||||
}
|
||||
.ui-tabs-nav a, .ui-tabs-nav a span {
|
||||
display: block;
|
||||
padding: 0 10px;
|
||||
background: url(../images/tab.png) no-repeat;
|
||||
}
|
||||
.ui-tabs-nav a {
|
||||
margin: 1px 0 0; /* position: relative makes opacity fail for disabled tab in IE */
|
||||
padding-left: 0;
|
||||
color: #27537a;
|
||||
font-weight: bold;
|
||||
line-height: 1.2;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
white-space: nowrap; /* required in IE 6 */
|
||||
outline: 0; /* prevent dotted border in Firefox */
|
||||
}
|
||||
.ui-tabs-nav .ui-tabs-selected a {
|
||||
position: relative;
|
||||
top: 1px;
|
||||
z-index: 2;
|
||||
margin-top: 0;
|
||||
color: #000;
|
||||
}
|
||||
.ui-tabs-nav a span {
|
||||
width: 64px; /* IE 6 treats width as min-width */
|
||||
min-width: 64px;
|
||||
height: 18px; /* IE 6 treats height as min-height */
|
||||
min-height: 18px;
|
||||
padding-top: 6px;
|
||||
padding-right: 0;
|
||||
}
|
||||
*>.ui-tabs-nav a span { /* hide from IE 6 */
|
||||
width: auto;
|
||||
height: auto;
|
||||
}
|
||||
.ui-tabs-nav .ui-tabs-selected a span {
|
||||
padding-bottom: 1px;
|
||||
}
|
||||
.ui-tabs-nav .ui-tabs-selected a, .ui-tabs-nav a:hover, .ui-tabs-nav a:focus, .ui-tabs-nav a:active {
|
||||
background-position: 100% -150px;
|
||||
}
|
||||
.ui-tabs-nav a, .ui-tabs-nav .ui-tabs-disabled a:hover, .ui-tabs-nav .ui-tabs-disabled a:focus, .ui-tabs-nav .ui-tabs-disabled a:active {
|
||||
background-position: 100% -100px;
|
||||
}
|
||||
.ui-tabs-nav .ui-tabs-selected a span, .ui-tabs-nav a:hover span, .ui-tabs-nav a:focus span, .ui-tabs-nav a:active span {
|
||||
background-position: 0 -50px;
|
||||
}
|
||||
.ui-tabs-nav a span, .ui-tabs-nav .ui-tabs-disabled a:hover span, .ui-tabs-nav .ui-tabs-disabled a:focus span, .ui-tabs-nav .ui-tabs-disabled a:active span {
|
||||
background-position: 0 0;
|
||||
}
|
||||
.ui-tabs-nav .ui-tabs-selected a:link, .ui-tabs-nav .ui-tabs-selected a:visited, .ui-tabs-nav .ui-tabs-disabled a:link, .ui-tabs-nav .ui-tabs-disabled a:visited { /* @ Opera, use pseudo classes otherwise it confuses cursor... */
|
||||
cursor: text;
|
||||
}
|
||||
.ui-tabs-nav a:hover, .ui-tabs-nav a:focus, .ui-tabs-nav a:active,
|
||||
.ui-tabs-nav .ui-tabs-unselect a:hover, .ui-tabs-nav .ui-tabs-unselect a:focus, .ui-tabs-nav .ui-tabs-unselect a:active { /* @ Opera, we need to be explicit again here now... */
|
||||
cursor: pointer;
|
||||
}
|
||||
.ui-tabs-disabled {
|
||||
opacity: .4;
|
||||
filter: alpha(opacity=40);
|
||||
}
|
||||
.ui-tabs-panel {
|
||||
border-top: 1px solid #97a5b0;
|
||||
padding: 1em 8px;
|
||||
background: #fff; /* declare background color for container to avoid distorted fonts in IE while fading */
|
||||
}
|
||||
.ui-tabs-loading em {
|
||||
padding: 0 0 0 20px;
|
||||
background: url(../images/loading.gif) no-repeat 0 50%;
|
||||
}
|
||||
|
||||
/* Additional IE specific bug fixes... */
|
||||
* html .ui-tabs-nav { /* auto clear, @ IE 6 & IE 7 Quirks Mode */
|
||||
display: inline-block;
|
||||
}
|
||||
*:first-child+html .ui-tabs-nav { /* @ IE 7 Standards Mode - do not group selectors, otherwise IE 6 will ignore complete rule (because of the unknown + combinator)... */
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
/* end jquery tabs css */
|
||||
/* jquery thickbox css */
|
||||
/* ----------------------------------------------------------------------------------------------------------------*/
|
||||
/* ---------->>> global settings needed for thickbox <<<-----------------------------------------------------------*/
|
||||
/* ----------------------------------------------------------------------------------------------------------------*/
|
||||
*{padding: 0; margin: 0;}
|
||||
|
||||
/* ----------------------------------------------------------------------------------------------------------------*/
|
||||
/* ---------->>> thickbox specific link and font settings <<<------------------------------------------------------*/
|
||||
/* ----------------------------------------------------------------------------------------------------------------*/
|
||||
#TB_window {
|
||||
font: 12px Arial, Helvetica, sans-serif;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
#TB_secondLine {
|
||||
font: 10px Arial, Helvetica, sans-serif;
|
||||
color:#666666;
|
||||
}
|
||||
|
||||
#TB_window a:link {color: #666666;}
|
||||
#TB_window a:visited {color: #666666;}
|
||||
#TB_window a:hover {color: #000;}
|
||||
#TB_window a:active {color: #666666;}
|
||||
#TB_window a:focus{color: #666666;}
|
||||
|
||||
/* ----------------------------------------------------------------------------------------------------------------*/
|
||||
/* ---------->>> thickbox settings <<<-----------------------------------------------------------------------------*/
|
||||
/* ----------------------------------------------------------------------------------------------------------------*/
|
||||
#TB_overlay {
|
||||
position: fixed;
|
||||
z-index:100;
|
||||
|
@ -277,22 +144,205 @@ margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = d
|
|||
/* end jquery thickbox css */
|
||||
|
||||
/* quickpost css */
|
||||
div#container {
|
||||
background-color: #fff;
|
||||
padding: 0px 15px 0px 15px;
|
||||
|
||||
|
||||
|
||||
|
||||
body {
|
||||
font: 13px "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;
|
||||
}
|
||||
/* jquery tabs css */
|
||||
|
||||
/* Caution! Ensure accessibility in print and other media types... */
|
||||
@media projection, screen { /* Use class for showing/hiding tab content, so that visibility can be better controlled in different media types... */
|
||||
.ui-tabs-hide {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* Hide useless elements in print layouts... */
|
||||
@media print {
|
||||
.ui-tabs-nav {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* Skin */
|
||||
div.ui-tabs-panel {
|
||||
border: none;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
position: relative;
|
||||
}
|
||||
.ui-tabs-nav {
|
||||
list-style: none;
|
||||
border-bottom: 1px solid #C6D9E9;
|
||||
padding-left: 8px;
|
||||
margin-bottom: .5em;
|
||||
margin-top: -2em;
|
||||
|
||||
}
|
||||
.ui-tabs-nav:after { /* clearing without presentational markup, IE gets extra treatment */
|
||||
display: block;
|
||||
clear: both;
|
||||
content: " ";
|
||||
}
|
||||
.ui-tabs-nav li {
|
||||
float: left;
|
||||
margin: 0;
|
||||
height: 2em;
|
||||
line-height: 2em;
|
||||
}
|
||||
.ui-tabs-nav a, .ui-tabs-nav a span {
|
||||
display: block;
|
||||
}
|
||||
.ui-tabs-nav a {
|
||||
margin: 1px 0 0; /* position: relative makes opacity fail for disabled tab in IE */
|
||||
padding-left: 0;
|
||||
color: #27537a;
|
||||
font-weight: bold;
|
||||
line-height: 2em;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
white-space: nowrap; /* required in IE 6 */
|
||||
outline: 0; /* prevent dotted border in Firefox */
|
||||
padding: 0 1em;
|
||||
}
|
||||
.ui-tabs-nav .ui-tabs-selected a {
|
||||
position: relative;
|
||||
top: 1px;
|
||||
z-index: 2;
|
||||
margin-top: 0;
|
||||
-moz-border-radius-topleft:4px;
|
||||
-moz-border-radius-topright:4px;
|
||||
-webkit-border-top-left-radius: 4px;
|
||||
-webkit-border-top-right-radius: 4px;
|
||||
border-style:solid;
|
||||
border-width:1px;
|
||||
border-color:#C6D9E9 rgb(198, 217, 233) rgb(255, 255, 255);
|
||||
color:#D54E21;
|
||||
|
||||
}
|
||||
|
||||
div#container h2 {
|
||||
margin: 15px 0px 0px 0px;
|
||||
font-size: 15px;
|
||||
.ui-tabs-nav .ui-tabs-selected a {
|
||||
background: white;
|
||||
border-bottom-width:2px;
|
||||
margin-top: -2px;
|
||||
}
|
||||
|
||||
div#container h2 span.optional {
|
||||
font-size: 10px;
|
||||
color: #bbb;
|
||||
font-style: italic;
|
||||
font-weight: normal;
|
||||
.ui-tabs-nav .ui-tabs-selected a:link, .ui-tabs-nav .ui-tabs-selected a:visited, .ui-tabs-nav .ui-tabs-disabled a:link, .ui-tabs-nav .ui-tabs-disabled a:visited {
|
||||
/* @ Opera, use pseudo classes otherwise it confuses cursor... */
|
||||
cursor: pointer;
|
||||
|
||||
}
|
||||
.ui-tabs-nav a:hover, .ui-tabs-nav a:focus, .ui-tabs-nav a:active,
|
||||
.ui-tabs-nav .ui-tabs-unselect a:hover, .ui-tabs-nav .ui-tabs-unselect a:focus, .ui-tabs-nav .ui-tabs-unselect a:active {
|
||||
/* @ Opera, we need to be explicit again here now... */
|
||||
cursor: pointer;
|
||||
}
|
||||
.ui-tabs-loading em {
|
||||
padding: 0 0 0 20px;
|
||||
background: url(../images/loading.gif) no-repeat 0 50%;
|
||||
}
|
||||
|
||||
/* Additional IE specific bug fixes... */
|
||||
* html .ui-tabs-nav { /* auto clear, @ IE 6 & IE 7 Quirks Mode */
|
||||
display: inline-block;
|
||||
}
|
||||
*:first-child+html .ui-tabs-nav { /* @ IE 7 Standards Mode - do not group selectors, otherwise IE 6 will ignore complete rule (because of the unknown + combinator)... */
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
#wphead {
|
||||
border-top: none;
|
||||
}
|
||||
.submit input {
|
||||
}
|
||||
|
||||
#wphead {
|
||||
height: 2em;
|
||||
padding-top: 8px;
|
||||
}
|
||||
|
||||
#wphead #viewsite {
|
||||
position: absolute;
|
||||
margin-top: 12px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
#viewsite {
|
||||
position: relative;
|
||||
right: 8px;
|
||||
top: 6px;
|
||||
margin: 0 !important;
|
||||
}
|
||||
#wphead #viewsite a {
|
||||
font: 12px "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;
|
||||
padding: 3px 4px;
|
||||
display: block;
|
||||
letter-spacing: normal;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
-moz-border-radius: 3px;
|
||||
-khtml-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#previewview {
|
||||
padding-top: 8px !important;
|
||||
padding-bottom: 8px !important;
|
||||
}
|
||||
h1 {
|
||||
font-size: .75em;
|
||||
line-height: 2.666em;
|
||||
top: .5em;
|
||||
right: 0;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
width:236px;
|
||||
background: none;
|
||||
}
|
||||
|
||||
|
||||
input.text {
|
||||
border:0pt none;
|
||||
outline-color:-moz-use-text-color;
|
||||
outline-style:none;
|
||||
outline-width:medium;
|
||||
padding:0pt;
|
||||
width:100%;
|
||||
border-style:solid;
|
||||
color:#333333;
|
||||
}
|
||||
.titlewrap {
|
||||
border-style:solid;
|
||||
border-width:1px;
|
||||
padding:2px 3px;
|
||||
border-color:#CCCCCC;
|
||||
}
|
||||
div#container {
|
||||
|
||||
margin: 0;
|
||||
min-width: 500px;
|
||||
|
||||
}
|
||||
|
||||
div#posting {
|
||||
padding-left: 16px;
|
||||
position:absolute;
|
||||
z-index:1;
|
||||
width: 66%;
|
||||
}
|
||||
|
||||
div#posting h2 {
|
||||
margin: .5em 0 .25em 0 ;
|
||||
font-size: 12px;
|
||||
padding: 3px;
|
||||
background: ;
|
||||
}
|
||||
|
||||
div#container form {
|
||||
|
@ -301,42 +351,23 @@ div#container form {
|
|||
}
|
||||
|
||||
div#categories {
|
||||
float:right;
|
||||
width:30%;
|
||||
padding: 0px 5px 0px 5px;
|
||||
font-size: 85%;
|
||||
position: absolute;
|
||||
top: 1.9em;
|
||||
right: 16px;
|
||||
width: 27%;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
div#posting {
|
||||
float:left;
|
||||
width:65%;
|
||||
padding: 0px 5px 0px 5px;
|
||||
}
|
||||
|
||||
textarea, input.text {
|
||||
font: Normal 12px 'Lucida Grande', Verdana, Helvetica, sans-serif;
|
||||
border: solid 1px #ccc;
|
||||
background-color: #f4f4f4;
|
||||
}
|
||||
|
||||
input.text {
|
||||
width: 99%;
|
||||
padding: 3px;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: #fff;
|
||||
margin: 0px;
|
||||
padding: 5px;
|
||||
font: Normal 13px 'Lucida Grande', Verdana, Helvetica, sans-serif;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #007BFF;
|
||||
div#categories h2 {
|
||||
font-size: 12px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#categories-all {
|
||||
overflow: auto;
|
||||
height: 30em;
|
||||
padding: 1em;
|
||||
height: 20em;
|
||||
}
|
||||
|
||||
#categories ul {
|
||||
|
@ -349,6 +380,7 @@ a {
|
|||
border-width: 1px;
|
||||
border-color: #ccc;
|
||||
border-style: solid;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
#tagsdiv #newtag {
|
||||
|
@ -395,4 +427,72 @@ a {
|
|||
display: block;
|
||||
}
|
||||
|
||||
/* end quickpost css */
|
||||
#post_title {
|
||||
width: 99%;
|
||||
}
|
||||
|
||||
/* end quickpost css */
|
||||
#img_container {
|
||||
background-color: #fff;
|
||||
margin-top:10px; overflow:auto; height:100px;
|
||||
}
|
||||
#img_container img {
|
||||
width: 75px;
|
||||
height: 75px;
|
||||
padding: 2px;
|
||||
background-color: #f4f4f4;
|
||||
margin-right: 7px;
|
||||
margin-bottom: 7px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.submitbox {
|
||||
width: 180px;
|
||||
float: right;
|
||||
}
|
||||
|
||||
|
||||
.submitbox .submit {
|
||||
text-align: left;
|
||||
padding: 12px 10px 10px 10px;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.submit {
|
||||
border-top: 1px solid #ccc;
|
||||
padding: 1.5em 0 0 0;
|
||||
margin: 10px 0 0 0;
|
||||
-moz-border-radius-bottomleft: 3px;
|
||||
-khtml-border-bottom-left-radius: 3px;
|
||||
-webkit-border-bottom-left-radius: 3px;
|
||||
border-bottom-left-radius: 3px;
|
||||
-moz-border-radius-bottomright: 3px;
|
||||
-khtml-border-bottom-right-radius: 3px;
|
||||
-webkit-border-bottom-right-radius: 3px;
|
||||
border-bottom-right-radius: 3px;
|
||||
}
|
||||
.submitbox .submit a:hover {
|
||||
border-bottom-width: 1px;
|
||||
border-bottom-style: solid;
|
||||
}
|
||||
|
||||
.submitbox .submit input {
|
||||
margin-bottom: 8px;
|
||||
margin-right: 3px;
|
||||
padding: 6px 4px;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.submitbox #previewview {
|
||||
padding: 15px 10px;
|
||||
-moz-border-radius-topleft: 3px;
|
||||
-khtml-border-top-left-radius: 3px;
|
||||
-webkit-border-top-left-radius: 3px;
|
||||
border-top-left-radius: 3px;
|
||||
-moz-border-radius-topright: 3px;
|
||||
-khtml-border-top-right-radius: 3px;
|
||||
-webkit-border-top-right-radius: 3px;
|
||||
border-top-right-radius: 3px;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,8 +1,15 @@
|
|||
<?php
|
||||
require_once('admin.php');
|
||||
|
||||
if ( ! current_user_can('publish_posts') )
|
||||
wp_die( __( 'Cheatin’ uh?' ));
|
||||
if ( ! current_user_can('publish_posts') ) wp_die( __( 'Cheatin’ uh?' ));
|
||||
|
||||
if ( 'post' == $_REQUEST['action'] ) {
|
||||
check_admin_referer('press-this');
|
||||
$post_ID = press_it(); ?>
|
||||
<script>if(confirm("<?php _e('Your post is saved. Do you want to view the post?') ?>")) {window.opener.location.replace("<?php echo get_permalink($post_ID);?>");}window.close();</script>
|
||||
<?php
|
||||
die;
|
||||
}
|
||||
|
||||
function press_it() {
|
||||
$quick['post_status'] = 'publish';
|
||||
|
@ -15,36 +22,36 @@ function press_it() {
|
|||
case 'regular':
|
||||
$content = $_REQUEST['content'];
|
||||
if ($_REQUEST['content2'])
|
||||
$content .= '<p>' . $_REQUEST['content2'];
|
||||
$content .= '<p>' . $_REQUEST['content2'];
|
||||
break;
|
||||
|
||||
case 'quote':
|
||||
$content = '<blockquote>' . $_REQUEST['content'];
|
||||
if ($_REQUEST['content2']) {
|
||||
$content .= '</blockquote>';
|
||||
$content = $content . '<p>' . $_REQUEST['content2'];
|
||||
$content = $content . '<p>' . $_REQUEST['content2'].'</p>';
|
||||
}
|
||||
break;
|
||||
|
||||
case 'photo':
|
||||
if ($_REQUEST['photo_link'])
|
||||
$content = '<a href="' . $_REQUEST['photo_link'] . '" target="_new">';
|
||||
$content = '<p><a href="' . $_REQUEST['photo_link'] . '" target="_new">';
|
||||
|
||||
$content .= '<img src="' . $_REQUEST['photo_src'] . '" style="float:left;padding:5px;">';
|
||||
$content .= '<img src="' . $_REQUEST['photo_src'] . '" alt=""/>';
|
||||
|
||||
if ($_REQUEST['photo_link'])
|
||||
$content .= '</a>';
|
||||
$content .= '</a></p>';
|
||||
|
||||
if ($_REQUEST['content'])
|
||||
$content = $content . '<br clear="all">' . $_REQUEST['content'];
|
||||
$content = $content . $_REQUEST['content'];
|
||||
|
||||
break;
|
||||
case "video":
|
||||
list($garbage,$video_id) = split("v=", $_REQUEST['content']);
|
||||
$content = '<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/' . $video_id . '"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/' . $video_id . '" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>';
|
||||
if ($_REQUEST['content2'])
|
||||
$content .= '</br><p>' . $_REQUEST['content2'] . '</p>';
|
||||
break;
|
||||
$content .= '<p>' . $_REQUEST['content2'] . '</p>';
|
||||
break;
|
||||
}
|
||||
|
||||
$quick['post_content'] = $content;
|
||||
|
@ -57,70 +64,71 @@ function press_it() {
|
|||
return $post_ID;
|
||||
}
|
||||
|
||||
function tag_div() {
|
||||
?>
|
||||
<h2><?php _e('Tags') ?></h2>
|
||||
<div id="tagsdiv">
|
||||
<div class="inside">
|
||||
<p id="jaxtag"><label class="hidden" for="newtag"><?php _e('Tags'); ?></label><input type="text" name="tags_input" class="tags-input" id="tags-input" size="40" tabindex="3" value="<?php echo get_tags_to_edit( $post->ID ); ?>" /></p>
|
||||
<div id="tagchecklist"></div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
function tag_div() { ?>
|
||||
<p id="jaxtag"><label class="hidden" for="newtag"><?php _e('Tags'); ?></label><input type="text" name="tags_input" class="tags-input" id="tags-input" size="40" tabindex="3" value="<?php echo get_tags_to_edit( $post->ID ); ?>" /></p>
|
||||
<div id="tagchecklist"></div>
|
||||
<?php
|
||||
}
|
||||
|
||||
function category_div() {
|
||||
?>
|
||||
<div id="categories">
|
||||
<h2><?php _e('Categories') ?></h2>
|
||||
<div id="categories-all">
|
||||
<ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
|
||||
<?php wp_category_checklist() ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div id="categories">
|
||||
<div class="submitbox" id="submitpost">
|
||||
<div id="previewview"> <h2><?php _e('Categories') ?></h2></div>
|
||||
<div class="inside">
|
||||
<div id="categories-all">
|
||||
<ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
|
||||
<?php wp_category_checklist() ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<p class="submit">
|
||||
<input type="submit" value="<?php _e('Publish') ?>" onclick="document.getElementById('photo_saving').style.display = '';"/>
|
||||
<img src="/images/bookmarklet_loader.gif" alt="" id="photo_saving" style="width:16px; height:16px; vertical-align:-4px; display:none;"/>
|
||||
</p>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
function get_images_from_uri($uri) {
|
||||
|
||||
$content = wp_remote_fopen($uri);
|
||||
if ( false === $content )
|
||||
return '';
|
||||
if ( false === $content ) return '';
|
||||
|
||||
$pattern = '/<img[^>]+src=[\'"]([^\'" >]+?)[\'" >]/is';
|
||||
preg_match_all($pattern, $content, $matches);
|
||||
if ( empty($matches[1]) )
|
||||
return '';
|
||||
|
||||
/*
|
||||
$from_host = parse_url($uri);
|
||||
$from_host = $from_host['host'];
|
||||
$from_host = explode('.', $from_host);
|
||||
$count = count($from_host);
|
||||
$from_host = $from_host[$count - 2] . '.' . $from_host[$count - 1];
|
||||
*/
|
||||
|
||||
if ( empty($matches[1]) ) return '';
|
||||
|
||||
$sources = array();
|
||||
foreach ($matches[1] as $src) {
|
||||
if ( false !== strpos($src, '&') )
|
||||
continue;
|
||||
|
||||
/*
|
||||
$img_host = parse_url($src);
|
||||
$img_host = $img_host['host'];
|
||||
if ( false === strpos($img_host, $from_host) )
|
||||
continue;
|
||||
*/
|
||||
|
||||
|
||||
$host = parse_url($_GET['u'], PHP_URL_HOST);
|
||||
|
||||
if (strpos($src, 'http://') === false) {
|
||||
$src = 'http://'.str_replace('//','/', $host.'/'.$src);
|
||||
}
|
||||
|
||||
$sources[] = $src;
|
||||
}
|
||||
return "'" . implode("','", $sources) . "'";
|
||||
}
|
||||
|
||||
function press_this_js_init() {
|
||||
if ( user_can_richedit() ) {
|
||||
$language = ( '' == get_locale() ) ? 'en' : strtolower( substr(get_locale(), 0, 2) );
|
||||
?>
|
||||
function press_this_js_init() { ?>
|
||||
<?php if ( user_can_richedit() ) {
|
||||
$language = ( '' == get_locale() ) ? 'en' : strtolower( substr(get_locale(), 0, 2) );
|
||||
// Add TinyMCE languages
|
||||
@include_once( dirname(__FILE__).'/../wp-includes/js/tinymce/langs/wp-langs.php' );
|
||||
if ( isset($strings) ) echo $strings; ?>
|
||||
(function() {
|
||||
var base = tinymce.baseURL, sl = tinymce.ScriptLoader, ln = "<?php echo $language; ?>";
|
||||
|
||||
sl.markDone(base + '/langs/' + ln + '.js');
|
||||
sl.markDone(base + '/themes/advanced/langs/' + ln + '.js');
|
||||
sl.markDone(base + '/themes/advanced/langs/' + ln + '_dlg.js');
|
||||
})();
|
||||
|
||||
tinyMCE.init({
|
||||
mode: "textareas",
|
||||
editor_selector: "mceEditor",
|
||||
|
@ -147,10 +155,14 @@ function press_this_js_init() {
|
|||
plugins : "safari,inlinepopups"
|
||||
});
|
||||
<?php } ?>
|
||||
|
||||
jQuery('#tags-input').hide();
|
||||
|
||||
tag_update_quickclicks();
|
||||
|
||||
// add the quickadd form
|
||||
jQuery('#jaxtag').prepend('<span id="ajaxtag"><input type="text" name="newtag" id="newtag" class="form-input-tip" size="16" autocomplete="off" value="'+postL10n.addTag+'" /><input type="button" class="button" id="tagadd" value="' + postL10n.add + '" tabindex="3" /><input type="hidden"/><input type="hidden"/><span class="howto">'+postL10n.separate+'</span></span>');
|
||||
|
||||
jQuery('#tagadd').click( tag_flush_to_text );
|
||||
jQuery('#newtag').focus(function() {
|
||||
if ( this.value == postL10n.addTag )
|
||||
|
@ -170,7 +182,7 @@ function press_this_js_init() {
|
|||
// Clean up the data being passed in
|
||||
$title = wp_specialchars(stripslashes($_GET['t']));
|
||||
$selection = wp_specialchars(stripslashes($_GET['s']));
|
||||
$url = clean_url($_GET['u']);
|
||||
$url = clean_url($_GET['u']);
|
||||
|
||||
if ( empty($_GET['tab']) ) {
|
||||
?>
|
||||
|
@ -178,65 +190,23 @@ if ( empty($_GET['tab']) ) {
|
|||
<html xmlns="http://www.w3.org/1999/xhtml" <?php do_action('admin_xml_ns'); ?> <?php language_attributes(); ?>>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
|
||||
<title><?php _e('Quick Post') ?></title>
|
||||
|
||||
<title><?php _e('Press This') ?></title>
|
||||
<script type="text/javascript" src="../wp-includes/js/tinymce/tiny_mce.js"></script>
|
||||
|
||||
<?php
|
||||
wp_enqueue_script('jquery-ui-tabs');
|
||||
wp_enqueue_script('thickbox');
|
||||
wp_enqueue_script('post');
|
||||
do_action('admin_print_scripts'); do_action('admin_head');
|
||||
do_action('admin_print_scripts');
|
||||
do_action('admin_head');
|
||||
wp_admin_css('css/press-this');
|
||||
wp_admin_css( 'css/colors' );
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
<?php if ( user_can_richedit() ) {
|
||||
$language = ( '' == get_locale() ) ? 'en' : strtolower( substr(get_locale(), 0, 2) );
|
||||
// Add TinyMCE languages
|
||||
@include_once( dirname(__FILE__).'/../wp-includes/js/tinymce/langs/wp-langs.php' );
|
||||
if ( isset($strings) ) echo $strings;
|
||||
?>
|
||||
|
||||
(function() {
|
||||
var base = tinymce.baseURL, sl = tinymce.ScriptLoader, ln = "<?php echo $language; ?>";
|
||||
|
||||
sl.markDone(base + '/langs/' + ln + '.js');
|
||||
sl.markDone(base + '/themes/advanced/langs/' + ln + '.js');
|
||||
sl.markDone(base + '/themes/advanced/langs/' + ln + '_dlg.js');
|
||||
})();
|
||||
|
||||
tinyMCE.init({
|
||||
mode: "textareas",
|
||||
editor_selector: "mceEditor",
|
||||
language : "<?php echo $language; ?>",
|
||||
width: "100%",
|
||||
theme : "advanced",
|
||||
theme_advanced_buttons1 : "bold,italic,underline,blockquote,separator,strikethrough,bullist,numlist,undo,redo,link,unlink",
|
||||
theme_advanced_buttons2 : "",
|
||||
theme_advanced_buttons3 : "",
|
||||
theme_advanced_toolbar_location : "top",
|
||||
theme_advanced_toolbar_align : "left",
|
||||
theme_advanced_statusbar_location : "bottom",
|
||||
theme_advanced_resizing : true,
|
||||
theme_advanced_resize_horizontal : false,
|
||||
skin : "wp_theme",
|
||||
dialog_type : "modal",
|
||||
relative_urls : false,
|
||||
remove_script_host : false,
|
||||
convert_urls : false,
|
||||
apply_source_formatting : false,
|
||||
remove_linebreaks : true,
|
||||
accessibility_focus : false,
|
||||
tab_focus : ":next",
|
||||
plugins : "safari,inlinepopups"
|
||||
});
|
||||
<?php } ?>
|
||||
|
||||
jQuery(document).ready(function() {
|
||||
<?php if ( preg_match("/youtube\.com\/watch/i", $_GET['u']) ) { ?>
|
||||
<?php if ( preg_match("/youtube\.com\/watch/i", $url) ) { ?>
|
||||
jQuery('#container > ul').tabs({ selected: 3 });
|
||||
<?php } elseif ( preg_match("/flickr\.com/i", $_GET['u']) ) { ?>
|
||||
<?php } elseif ( preg_match("/flickr\.com/i", $url) ) { ?>
|
||||
jQuery('#container > ul').tabs({ selected: 1 });
|
||||
<?php } else { ?>
|
||||
jQuery('#container > ul').tabs();
|
||||
|
@ -246,33 +216,21 @@ if ( empty($_GET['tab']) ) {
|
|||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<?php
|
||||
if ( 'post' == $_REQUEST['action'] ) {
|
||||
check_admin_referer('press-this');
|
||||
$post_ID = press_it();
|
||||
?>
|
||||
<script>if(confirm("<?php _e('Your post is saved. Do you want to view the post?') ?>")) {window.opener.location.replace("<?php echo get_permalink($post_ID);?>");}window.close();</script>
|
||||
</body></html>
|
||||
<?php
|
||||
die;
|
||||
}
|
||||
?>
|
||||
<div id="wphead">
|
||||
<h1><span id="viewsite"><a href="<?php echo get_option('home'); ?>/">Visit: <?php bloginfo('name'); ?></a></span></h1>
|
||||
</div>
|
||||
<div id="container">
|
||||
<ul>
|
||||
<li><a href="<?php echo clean_url(add_query_arg('tab', 'text', stripslashes($_SERVER['REQUEST_URI']))) ?>"><span><?php _e('Text/Link') ?></span></a></li>
|
||||
<li><a href="<?php echo clean_url(add_query_arg('tab', 'photo', stripslashes($_SERVER['REQUEST_URI']))) ?>"><span><?php _e('Photo') ?></span></a></li>
|
||||
<li><a href="<?php echo clean_url(add_query_arg('tab', 'quote', stripslashes($_SERVER['REQUEST_URI']))) ?>"><span><?php _e('Quote') ?></span></a></li>
|
||||
<li><a href="<?php echo clean_url(add_query_arg('tab', 'video', stripslashes($_SERVER['REQUEST_URI']))) ?>"><span><?php _e('Video') ?></span></a></li>
|
||||
<li><a href="<?php echo clean_url(add_query_arg('tab', 'text', stripslashes($_SERVER['REQUEST_URI']))) ?>"><?php _e('Text') ?></a></li>
|
||||
<li><a href="<?php echo clean_url(add_query_arg('tab', 'photo', stripslashes($_SERVER['REQUEST_URI']))) ?>"><?php _e('Photo') ?></a></li>
|
||||
<li><a href="<?php echo clean_url(add_query_arg('tab', 'quote', stripslashes($_SERVER['REQUEST_URI']))) ?>"><?php _e('Quote') ?></a></li>
|
||||
<li><a href="<?php echo clean_url(add_query_arg('tab', 'video', stripslashes($_SERVER['REQUEST_URI']))) ?>"><?php _e('Video') ?></a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
exit;
|
||||
} elseif ( 'photo' == $_GET['tab'] ) {
|
||||
?>
|
||||
<?php exit; } elseif ( 'photo' == $_GET['tab'] ) { ?>
|
||||
<script type="text/javascript">
|
||||
<?php press_this_js_init(); ?>
|
||||
var last = null;
|
||||
|
@ -285,6 +243,7 @@ exit;
|
|||
last = img;
|
||||
return false;
|
||||
}
|
||||
|
||||
jQuery(document).ready(function() {
|
||||
var img, img_tag, aspect, w, h, skip, i, strtoappend = "";
|
||||
var my_src = [<?php echo get_images_from_uri($url); ?>];
|
||||
|
@ -317,56 +276,50 @@ exit;
|
|||
strtoappend += '<a href="' + img.src + '" title="" class="thickbox"><img src="' + img.src + '" ' + img_attr + '/></a>'
|
||||
}
|
||||
}
|
||||
|
||||
jQuery('#img_container').html(strtoappend);
|
||||
|
||||
tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
|
||||
});
|
||||
</script>
|
||||
|
||||
<form action="press-this.php?action=post" method="post" id="photo_form">
|
||||
<?php wp_nonce_field('press-this') ?>
|
||||
<input type="hidden" name="source" value="bookmarklet"/>
|
||||
<input type="hidden" name="post_type" value="photo"/>
|
||||
<div id="posting">
|
||||
<h2><?php _e('Post Title') ?></h2>
|
||||
|
||||
<h2><?php _e('Title') ?></h2>
|
||||
<div class="titlewrap">
|
||||
<input name="post_title" id="post_title" class="text" value="<?php echo attribute_escape($title);?>"/>
|
||||
|
||||
</div>
|
||||
|
||||
<h2><?php _e('Photo URL') ?></h2>
|
||||
<div class="titlewrap">
|
||||
<input name="photo_src" id="photo_src" class="text" onkeydown="pick(0);"/>
|
||||
</div>
|
||||
|
||||
<h2><?php _e('Link Photo to following URL') ?></h2><?php _e('(leave blank to leave the photo unlinked)') ?>
|
||||
<div class="titlewrap">
|
||||
<input name="photo_link" id="photo_link" class="text" value="<?php echo attribute_escape($url);?>"/>
|
||||
</div>
|
||||
|
||||
<small>Click images to select:</small>
|
||||
<div class="titlewrap">
|
||||
<div id="img_container">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<h2><?php _e('Caption') ?></h2>
|
||||
<div class="editor-container">
|
||||
<textarea name="content" id="photo_post_two" style="height:130px;width:100%;" class="mceEditor"><?php echo $selection;?>
|
||||
<br><a href="<?php echo $url;?>"><?php echo $title;?></a></textarea>
|
||||
<textarea name="content" id="photo_post_two" style="" class="mceEditor"><?php echo $selection;?>
|
||||
<a href="<?php echo attribute_escape($url);?>"><?php echo $title;?></a></textarea>
|
||||
</div>
|
||||
|
||||
<h2><?php _e('Photo URL') ?></h2>
|
||||
<input name="photo_src" id="photo_src" class="text" onkeydown="pick(0);"/>
|
||||
|
||||
<style type="text/css">
|
||||
#img_container img {
|
||||
width: 75px;
|
||||
height: 75px;
|
||||
padding: 2px;
|
||||
background-color: #f4f4f4;
|
||||
margin-right: 7px;
|
||||
margin-bottom: 7px;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
<div id="img_container" style="border:solid 1px #ccc; background-color:#f4f4f4; padding:5px; width:370px; margin-top:10px; overflow:auto; height:100px;">
|
||||
</div>
|
||||
|
||||
<h2><?php _e('Link Photo to following URL') ?></h2><?php _e('(leave blank to leave the photo unlinked)') ?>
|
||||
<input name="photo_link" id="photo_link" class="text" value="<?php echo attribute_escape($url);?>"/>
|
||||
|
||||
<?php tag_div(); ?>
|
||||
|
||||
<div>
|
||||
<input type="submit" value="<?php _e('Create Photo') ?>" style="margin-top:15px;" onclick="document.getElementById('photo_saving').style.display = '';"/>
|
||||
|
||||
<a href="#" onclick="if (confirm('<?php _e('Are you sure?') ?>')) { self.close(); } else { return false; }" style="color:#007BFF;"><?php _e('Cancel') ?></a>
|
||||
<img src="/images/bookmarklet_loader.gif" alt="" id="photo_saving" style="width:16px; height:16px; vertical-align:-4px; display:none;"/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<?php category_div() ?>
|
||||
<?php category_div() ?>
|
||||
</form>
|
||||
<?php
|
||||
exit;
|
||||
|
@ -381,21 +334,18 @@ exit;
|
|||
<input type="hidden" name="source" value="bookmarklet"/>
|
||||
<input type="hidden" name="post_type" value="regular"/>
|
||||
<div id="posting">
|
||||
<h2><?php _e('Post Title') ?></h2>
|
||||
<h2><?php _e('Title') ?></h2>
|
||||
<div class="titlewrap">
|
||||
<input name="post_title" id="post_title" class="text" value="<?php echo attribute_escape($title);?>"/>
|
||||
|
||||
</div>
|
||||
|
||||
<h2><?php _e('Post') ?></h2>
|
||||
<div class="editor-container">
|
||||
<textarea name="content" id="regular_post_two" style="height:170px;width:100%;" class="mceEditor"><?php echo $selection;?><br><a href="<?php echo $url;?>"><?php echo $title;?></a></textarea>
|
||||
</div>
|
||||
<textarea name="content" id="regular_post_two" style="height:170px;width:100%;" class="mceEditor"><?php echo $selection;?><a href="<?php echo $url;?>"><?php echo $title;?></a></textarea>
|
||||
</div>
|
||||
|
||||
<?php tag_div(); ?>
|
||||
|
||||
<div>
|
||||
<input type="submit" value="<?php _e('Create Post') ?>" style="margin-top:15px;" onclick="document.getElementById('regular_saving').style.display = '';"/>
|
||||
<a href="#" onclick="if (confirm('<?php _e('Are you sure?') ?>')) { self.close(); } else { return false; }" style="color:#007BFF;"><?php _e('Cancel') ?></a>
|
||||
<img src="/images/bookmarklet_loader.gif" alt="" id="regular_saving" style="width:16px; height:16px; vertical-align:-4px; display:none;"/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<?php category_div() ?>
|
||||
</form>
|
||||
|
@ -412,9 +362,11 @@ exit;
|
|||
<input type="hidden" name="source" value="bookmarklet"/>
|
||||
<input type="hidden" name="post_type" value="quote"/>
|
||||
<div id="posting">
|
||||
<h2><?php _e('Post Title') ?></h2>
|
||||
<h2><?php _e('Title') ?></h2>
|
||||
<div class="titlewrap">
|
||||
<input name="post_title" id="post_title" class="text" value="<?php echo attribute_escape(sprintf(__('Quote by %s'), $title)); ?>"/>
|
||||
|
||||
</div>
|
||||
|
||||
<h2><?php _e('Quote') ?></h2>
|
||||
<div class="editor-container">
|
||||
<textarea name="content" id="quote_post_one" style="height:130px;width:100%;" class="mceEditor"><?php echo $selection;?></textarea>
|
||||
|
@ -422,16 +374,10 @@ exit;
|
|||
|
||||
<h2><?php _e('Source <span class="optional">(optional)</span>') ?></h2>
|
||||
<div class="editor-container">
|
||||
<textarea name="content2" id="quote_post_two" style="height:130px;width:100%;" class="mceEditor"><br><a href="<?php echo $url;?>"><?php echo $title;?></a></textarea>
|
||||
<textarea name="content2" id="quote_post_two" style="height:130px;width:100%;" class="mceEditor"><cite><a href="<?php echo $url;?>"><?php echo $title;?></a></cite></textarea>
|
||||
</div>
|
||||
|
||||
<?php tag_div(); ?>
|
||||
|
||||
<div>
|
||||
<input type="submit" value="<?php echo attribute_escape(__('Create Quote')) ?>" style="margin-top:15px;" onclick="document.getElementById('quote_saving').style.display = '';"/>
|
||||
<a href="#" onclick="if (confirm('<?php _e('Are you sure?') ?>')) { self.close(); } else { return false; }" style="color:#007BFF;"><?php _e('Cancel') ?></a>
|
||||
<img src="/images/bookmarklet_loader.gif" alt="" id="quote_saving" style="width:16px; height:16px; vertical-align:-4px; display:none;"/>
|
||||
</div>
|
||||
</div>
|
||||
<?php category_div() ?>
|
||||
</form>
|
||||
|
@ -448,16 +394,19 @@ exit;
|
|||
<input type="hidden" name="source" value="bookmarklet"/>
|
||||
<input type="hidden" name="post_type" value="video"/>
|
||||
<div id="posting">
|
||||
<h2><?php _e('Post Title') ?></h2>
|
||||
|
||||
<h2><?php _e('Video Title') ?></h2>
|
||||
<div class="titlewrap">
|
||||
<input name="post_title" id="post_title" class="text" value="<?php echo attribute_escape($title);?>"/>
|
||||
|
||||
<?php
|
||||
</div>
|
||||
<?php
|
||||
if ( preg_match("/youtube\.com\/watch/i", $url) ) {
|
||||
list($domain, $video_id) = split("v=", $url);
|
||||
?>
|
||||
<input type="hidden" name="content" value="<?php echo attribute_escape($url); ?>" />
|
||||
<img src="http://img.youtube.com/vi/<?php echo $video_id; ?>/default.jpg" align="right" style="border:solid 1px #aaa;" width="130" height="97"/><br clear="all" />
|
||||
<img src="http://img.youtube.com/vi/<?php echo $video_id; ?>/default.jpg" align="right" style="border:solid 1px #aaa;" width="130" height="97"/>
|
||||
<?php } else { ?>
|
||||
|
||||
<h2><?php _e('Embed Code') ?></h2>
|
||||
<textarea name="content" id="video_post_one" style="height:80px;width:100%;"></textarea>
|
||||
<?php } ?>
|
||||
|
@ -465,20 +414,14 @@ exit;
|
|||
<h2><?php _e('Caption <span class="optional">(optional)</span>') ?></h2>
|
||||
|
||||
<div class="editor-container">
|
||||
<textarea name="content2" id="video_post_two" style="height:130px;width:100%;" class="mceEditor"><?php echo $selection;?><br><a href="<?php echo $url;?>"><?php echo $title;?></a></textarea>
|
||||
<textarea name="content2" id="video_post_two" style="height:130px;width:100%;" class="mceEditor"><?php echo $selection; ?> <a href="<?php echo $url; ?>"><?php echo $title;?></a></textarea>
|
||||
</div>
|
||||
|
||||
<?php tag_div(); ?>
|
||||
|
||||
<div>
|
||||
<input type="submit" value="<?php _e('Create Video') ?>" style="margin-top:15px;" onclick="document.getElementById('video_saving').style.display = '';"/>
|
||||
<a href="#" onclick="if (confirm('<?php _e('Are you sure?') ?>')) { self.close(); } else { return false; }" style="color:#007BFF;"><?php _e('Cancel'); ?></a>
|
||||
<img src="/images/bookmarklet_loader.gif" alt="" id="video_saving" style="width:16px; height:16px; vertical-align:-4px; display:none;"/>
|
||||
</div>
|
||||
</div>
|
||||
<?php category_div() ?>
|
||||
</form>
|
||||
<?php
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
?>
|
Loading…
Reference in New Issue