From 9830ab988c7d670c3aa67a4116b8002122a15f32 Mon Sep 17 00:00:00 2001 From: ryan Date: Mon, 12 May 2008 19:08:39 +0000 Subject: [PATCH] Quick post bookmarklet. First cut. see #6813 git-svn-id: http://svn.automattic.com/wordpress/trunk@7919 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/css/quick-post.css | 342 ++++++++++++++++++++++++++++++ wp-admin/edit-form-advanced.php | 3 + wp-admin/images/tab.png | Bin 0 -> 1006 bytes wp-admin/quick-post.php | 358 ++++++++++++++++++++++++++++++++ wp-includes/link-template.php | 38 ++++ 5 files changed, 741 insertions(+) create mode 100644 wp-admin/css/quick-post.css create mode 100644 wp-admin/images/tab.png create mode 100644 wp-admin/quick-post.php diff --git a/wp-admin/css/quick-post.css b/wp-admin/css/quick-post.css new file mode 100644 index 000000000..7ee22329d --- /dev/null +++ b/wp-admin/css/quick-post.css @@ -0,0 +1,342 @@ +/* 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(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; + top: 0px; + left: 0px; + background-color:#000; + filter:alpha(opacity=75); + -moz-opacity: 0.75; + opacity: 0.75; + height:100%; + width:100%; +} + +* html #TB_overlay { /* ie6 hack */ + position: absolute; + height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px'); +} + +#TB_window { + position: fixed; + background: #ffffff; + z-index: 102; + color:#000000; + display:none; + border: 4px solid #525252; + text-align:left; + top:50%; + left:50%; +} + +* html #TB_window { /* ie6 hack */ +position: absolute; +margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px'); +} + +#TB_window img#TB_Image { + display:block; + margin: 15px 0 0 15px; + border-right: 1px solid #ccc; + border-bottom: 1px solid #ccc; + border-top: 1px solid #666; + border-left: 1px solid #666; +} + +#TB_caption{ + height:25px; + padding:7px 30px 10px 25px; + float:left; +} + +#TB_closeWindow{ + height:25px; + padding:11px 25px 10px 0; + float:right; +} + +#TB_closeAjaxWindow{ + padding:7px 10px 5px 0; + margin-bottom:1px; + text-align:right; + float:right; +} + +#TB_ajaxWindowTitle{ + float:left; + padding:7px 0 5px 10px; + margin-bottom:1px; +} + +#TB_title{ + background-color:#e8e8e8; + height:27px; +} + +#TB_ajaxContent{ + clear:both; + padding:2px 15px 15px 15px; + overflow:auto; + text-align:left; + line-height:1.4em; +} + +#TB_ajaxContent.TB_modal{ + padding:15px; +} + +#TB_ajaxContent p{ + padding:5px 0px 5px 0px; +} + +#TB_load{ + position: fixed; + display:none; + height:13px; + width:208px; + z-index:103; + top: 50%; + left: 50%; + margin: -6px 0 0 -104px; /* -height/2 0 0 -width/2 */ +} + +* html #TB_load { /* ie6 hack */ +position: absolute; +margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px'); +} + +#TB_HideSelect{ + z-index:99; + position:fixed; + top: 0; + left: 0; + background-color:#fff; + border:none; + filter:alpha(opacity=0); + -moz-opacity: 0; + opacity: 0; + height:100%; + width:100%; +} + +* html #TB_HideSelect { /* ie6 hack */ + position: absolute; + height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px'); +} + +#TB_iframeContent{ + clear:both; + border:none; + margin-bottom:-1px; + margin-top:1px; + _margin-bottom:1px; +} +/* end jquery thickbox css */ + +/* quickpost css */ +div#container { + background-color: #fff; + padding: 0px 15px 0px 15px; + +} + +div#container h2 { + margin: 15px 0px 0px 0px; + font-size: 15px; +} + +div#container h2 span.optional { + font-size: 10px; + color: #bbb; + font-style: italic; + font-weight: normal; +} + +div#container form { + margin: 0px; + padding: 0px; +} + +div#categories { + float:right; + width:30%; + padding: 0px 5px 0px 5px; +} + +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: 100%; +} + +body { + background-color: #fff; + margin: 0px; + padding: 5px; + font: Normal 13px 'Lucida Grande', Verdana, Helvetica, sans-serif; +} + +a { + color: #007BFF; +} + +#categories ul { + list-style: none; + padding: 0; + margin: 0; +} + +/* end quickpost css */ \ No newline at end of file diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index 188b95135..c623225ef 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -189,6 +189,9 @@ if ( ( 'edit' == $action) && current_user_can('delete_post', $post_ID) )
  • + +
    +

    diff --git a/wp-admin/images/tab.png b/wp-admin/images/tab.png new file mode 100644 index 0000000000000000000000000000000000000000..413c755983631ad6ef0ac976772dfe51766f99d0 GIT binary patch literal 1006 zcmeAS@N?(olHy`uVBq!ia0y~yVAKJ!PjD~;$y7$2bRflC?Bp53!NGC+q5lIQw=TdZ z#P$FG|3Cl!|Mv6Whwp#ief#ziHF zIys}NBe|+4rl`R`qb4w|(j&gmHLl1dzQiUx$38U6CN#TDF!?3WC7cBwk;M!QTpvJ~ z(P@pz44|NViEBhjaDG}zd16s2gKuJTQGRY}N@k*hTV_#ed45rLv4X|cj7t?jr4k^e z&PAz-C7Jno3L%-fsSJkZdIrXNMg|7v+OA@83=B*=JY5_^D(1YsdoW1YQN-FI5H0``20^l+3rkDBFHZ9MUT|IXXioOGrZ$;# z_cd17r0QpQth~uBm87%a%JwcJu>>G3>?+BvvGw(?H-c+tBx@dva9H_XB=l9atE}Mb z!$RlluQbc-Zus->%jTtdX0w&&f8K9+JjiFIyy(`PHT&W}UHrFm-~Zq832W^4$h^M% z@@3QcZ8w}#D=fp-Ya}xsW9ng*;5Go-av-8%BLhK!hBx|4P17o5j(=Rvbn58(^*8my zt>yLu-FzbWTf?-P^Kus^+X$e2O~gA zkL0D8UehTHU9vIl7*o>5b=g3*K+V6;pSoUGGJ}-xgZN_Ub-|terSB%mvHViI}|H8~{w`44$rjF6*2UngG9hz$O3y literal 0 HcmV?d00001 diff --git a/wp-admin/quick-post.php b/wp-admin/quick-post.php new file mode 100644 index 000000000..185cb4ec5 --- /dev/null +++ b/wp-admin/quick-post.php @@ -0,0 +1,358 @@ +' . $_REQUEST['content2']; + break; + + case 'quote': + $content = '
    ' . $_REQUEST['content']; + if ($_REQUEST['content2']) { + $content = $content . '
    '; + $content = $content . '

    ' . $_REQUEST['content2']; + } + break; + + case 'photo': + if ($_REQUEST['photo_link']) + $content = ''; + + $content .= ''; + + if ($_REQUEST['photo_link']) + $content .= ''; + + if ($_REQUEST['content']) + $content = $content . "
    " . $_REQUEST['content']; + + break; + case "video": + list($garbage,$video_id) = split("v=", $_REQUEST['content']); + $content = ""; + if ($_REQUEST['content2']) + $content = $content ."

    " .$_REQUEST['content2'] ."

    "; + break; + } + + $quick['post_content'] = $content; + + $post_ID = wp_insert_post($quick, true); + + if ( is_wp_error($post_ID) ) + wp_die($wp_error); + + return $post_ID; +} + +function tag_input() { + $s = '
    +

    ' . __('Tags') . '

    +
    ' . + __('Comma separated (e.g. Wordpress, Plugins)') . + '
    '; + + return $s; +} + +?> + + > + + + <?php _e('Quick Post') ?> + + + + + + + + + + + + + + + + +
    + +
      +
    • +
    • +
    • +
    • +
    + + +
    +
    + + + +
    +

    + + +

    +
    + +
    + + + +
    +    +    + +
    +
    +
    +

    +
      + +
    +
    +
    +
    + + +
    +
    + + + +
    +

    + + +

    +
    + +
    + +

    + + + + +
    + +
    + +

    + + + + +
    +    + + Cancel   + +
    +
    +
    +

    +
      + +
    +
    +
    +
    + + +
    +
    + + + +
    +

    + + +

    +
    + +
    + +

    (optional)') ?>

    +
    + +
    + + + +
    +    +    + +
    +
    +
    +

    +
      + +
    +
    +
    +
    + + +
    +
    + + + +
    +

    + + + + +
    + +

    + + + +

    (optional)') ?>

    + +
    + +
    + + + +
    +    +    + +
    +
    +
    +

    +
      + +
    +
    +
    +
    + +
    + + + diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index d9763c515..af63f38ef 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -742,4 +742,42 @@ function posts_nav_link($sep=' — ', $prelabel='« Previous Page', $nx } } +function get_shortcut_link() { + $link = "javascript: + var imgstr=''; + var reg=new RegExp('&'); + for(i=0;i