bug fixing & tidying

This commit is contained in:
Shish 2009-07-19 08:56:24 +01:00
parent 627ecdbf4c
commit d8c394c7a5
3 changed files with 6 additions and 9 deletions

View File

@ -20,7 +20,7 @@ class ResolutionLimit implements Extension {
if($min_w > 0 && $image->width < $min_w) throw new UploadException("Image too small"); if($min_w > 0 && $image->width < $min_w) throw new UploadException("Image too small");
if($min_h > 0 && $image->height < $min_h) throw new UploadException("Image too small"); if($min_h > 0 && $image->height < $min_h) throw new UploadException("Image too small");
if($max_w > 0 && $image->width > $min_w) throw new UploadExceptiono("Image too large"); if($max_w > 0 && $image->width > $min_w) throw new UploadException("Image too large");
if($max_h > 0 && $image->height > $min_h) throw new UploadException("Image too large"); if($max_h > 0 && $image->height > $min_h) throw new UploadException("Image too large");
if(count($ratios) > 0) { if(count($ratios) > 0) {

View File

@ -1,20 +1,17 @@
<?php <?php
class TagHistoryTest extends ShimmieWebTestCase { class TagHistoryTest extends ShimmieWebTestCase {
function testTagHistory() { function testTagHistory() {
$this->log_in_as_user(); $this->log_in_as_admin();
$image_id = $this->post_image("ext/simpletest/data/pbx_screenshot.jpg", "pbx"); $image_id = $this->post_image("ext/simpletest/data/pbx_screenshot.jpg", "pbx");
$this->get_page("post/view/$image_id"); $this->get_page("post/view/$image_id");
$this->assertTitle("Image $image_id: pbx"); $this->assertTitle("Image $image_id: pbx");
$this->setField("tags", "new"); $this->setField("tag_edit__tags", "new");
$this->click("Set"); $this->click("Set");
$this->assertTitle("Image $image_id: new"); $this->assertTitle("Image $image_id: new");
$this->click("Tag History"); $this->click("Tag History");
$this->assertText("new (Set by test"); $this->assertText("new (Set by demo");
$this->click("Revert"); $this->click("Revert");
$this->assertTitle("Image $image_id: pbx"); $this->assertTitle("Image $image_id: pbx");
$this->log_out();
$this->log_in_as_admin();
$this->delete_image($image_id); $this->delete_image($image_id);
$this->log_out(); $this->log_out();
} }

View File

@ -77,7 +77,7 @@ EOD;
$html = ""; $html = "";
$i = str_replace(' ', '_', $h) . $salt; $i = str_replace(' ', '_', $h) . $salt;
if($hidable) $html .= " if($hidable) $html .= "
<script> <script><!--
$(document).ready(function() { $(document).ready(function() {
$(\"#$i-toggle\").click(function() { $(\"#$i-toggle\").click(function() {
$(\"#$i\").slideToggle(\"slow\", function() { $(\"#$i\").slideToggle(\"slow\", function() {
@ -93,7 +93,7 @@ EOD;
$(\"#$i\").hide(); $(\"#$i\").hide();
} }
}); });
</script> //--></script>
"; ";
if(!is_null($h)) $html .= " if(!is_null($h)) $html .= "
<div class='hrr' id='$i-toggle'> <div class='hrr' id='$i-toggle'>