Press This UI changes and photo loading fixes from noel. fixes #7120 see #6813

git-svn-id: http://svn.automattic.com/wordpress/trunk@8071 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-06-11 17:45:50 +00:00
parent 2787d1fde5
commit 830428b928
2 changed files with 23 additions and 14 deletions

View File

@ -1,5 +1,6 @@
body { body {
font: 13px "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif; font: 13px "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;
color: #333;
margin: 0px; margin: 0px;
padding: 0px; padding: 0px;
} }
@ -213,15 +214,16 @@ div#categories {
} }
div#categories h2 { div#categories h2 {
color: #333;
font-size: 12px; font-size: 12px;
margin: 0; margin: .5em 0 0 1em;
padding: 0; padding: 0;
} }
#categories-all { #categories-all {
overflow: auto; overflow: auto;
padding: 1em; padding: 1em;
height: 20em; height: 15em;
} }
#categories ul { #categories ul {
@ -243,18 +245,20 @@ div#categories h2 {
} }
#tagchecklist { #tagchecklist {
margin-left: 10px; padding-left: 1em;
margin-bottom: 1em;
font-size: 12px; font-size: 12px;
overflow: auto; overflow: auto;
} }
#tagchecklist strong { #tagchecklist strong {
margin-left: -8px;
position: absolute; position: absolute;
font-size: .75em;
} }
#tagchecklist span { #tagchecklist span {
margin-right: 25px; margin-right: .5em;
margin-left: 10px;
display: block; display: block;
float: left; float: left;
font-size: 11px; font-size: 11px;
@ -369,6 +373,7 @@ padding: 0;
#jaxtag { #jaxtag {
clear: both; clear: both;
padding-left: 1em;
} }
.ac_results { .ac_results {

View File

@ -57,21 +57,22 @@ function press_it() {
return $post_ID; return $post_ID;
} }
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() { ?> function category_div() { ?>
<div id="categories"> <div id="categories">
<div class="submitbox" id="submitpost"> <div class="submitbox" id="submitpost">
<div id="previewview"> <h2><?php _e('Categories') ?></h2></div> <div id="previewview"></div>
<div class="inside"> <div class="inside">
<h2><?php _e('Categories') ?></h2>
<div id="categories-all"> <div id="categories-all">
<ul id="categorychecklist" class="list:category categorychecklist form-no-clear"> <ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
<?php wp_category_checklist() ?> <?php wp_category_checklist() ?>
</ul> </ul>
</div> </div>
<h2><?php _e('Tags') ?></h2>
<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>
<p class="submit"> <p class="submit">
<input type="submit" value="<?php _e('Publish') ?>" onclick="document.getElementById('photo_saving').style.display = '';"/> <input type="submit" value="<?php _e('Publish') ?>" onclick="document.getElementById('photo_saving').style.display = '';"/>
@ -157,6 +158,7 @@ $url = urldecode($url);
$url = str_replace(' ', '%20', $url); $url = str_replace(' ', '%20', $url);
function get_images_from_uri($uri) { function get_images_from_uri($uri) {
if(preg_match('/\.(jpg|png|gif)/', $uri)) return "'".$uri."'";
$content = wp_remote_fopen($uri); $content = wp_remote_fopen($uri);
$host = parse_url($uri); $host = parse_url($uri);
if ( false === $content ) return ''; if ( false === $content ) return '';
@ -179,7 +181,8 @@ $url = str_replace(' ', '%20', $url);
$sources[] = $src; $sources[] = $src;
} }
return "'" . implode("','", $sources) . "'"; return "'" . implode("','", $sources) . "'";
} }
echo 'new Array('.get_images_from_uri($url).')'; echo 'new Array('.get_images_from_uri($url).')';
die; die;
@ -251,7 +254,7 @@ if($_REQUEST['ajax'] == 'photo') { ?>
<small><?php _e('Click images to select:') ?></small> <small><?php _e('Click images to select:') ?></small>
<div class="titlewrap"> <div class="titlewrap">
<div id="img_container">Loading Images...</div> <div id="img_container"></div>
</div> </div>
<?php die; } <?php die; }
@ -422,8 +425,8 @@ if($_REQUEST['ajax'] == 'photo') { ?>
set_editor('') set_editor('')
<?php } ?> <?php } ?>
jQuery('#extra_fields').show(); jQuery('#extra_fields').show();
jQuery('#extra_fields').prepend('<h2 id="waiting"><img src="images/loading.gif" alt="" /> Loading...</h2>');
jQuery('#extra_fields').load('<?php echo clean_url($_SERVER['PHP_SELF']).'/?ajax=photo&u='.attribute_escape($url); ?>'); jQuery('#extra_fields').load('<?php echo clean_url($_SERVER['PHP_SELF']).'/?ajax=photo&u='.attribute_escape($url); ?>');
jQuery('#extra_fields').prepend('<h2><img src="images/loading.gif" alt="" /> Loading...</h2>');
jQuery.ajax({ jQuery.ajax({
type: "GET", type: "GET",
cache : false, cache : false,
@ -431,6 +434,7 @@ if($_REQUEST['ajax'] == 'photo') { ?>
data: "ajax=photo_js&u=<?php echo urlencode($url)?>", data: "ajax=photo_js&u=<?php echo urlencode($url)?>",
dataType : "script", dataType : "script",
success : function() { success : function() {
jQuery('#waiting').innerHTML('');
} }
}); });
@ -490,7 +494,7 @@ if($_REQUEST['ajax'] == 'photo') { ?>
</textarea> </textarea>
</div> </div>
</div> </div>
<?php tag_div(); ?>
</div> </div>
<?php category_div(); ?> <?php category_div(); ?>
</form> </form>