Merge pull request #28 from green-ponies/master

Issue #5 - Confim Delete
This commit is contained in:
Shish Moom 2011-08-14 13:56:01 -07:00
commit b201098ef9
19 changed files with 25 additions and 23 deletions

View File

@ -138,7 +138,7 @@ class BlotterTheme extends Themelet {
#blotter1 {font-size: 80%; position: relative;} #blotter1 {font-size: 80%; position: relative;}
#blotter2 {font-size: 80%;} #blotter2 {font-size: 80%;}
</style>"; </style>";
$html .= "<script><!-- $html .= "<script type='text/javascript'><!--
$(document).ready(function() { $(document).ready(function() {
$(\"#blotter2-toggle\").click(function() { $(\"#blotter2-toggle\").click(function() {
$(\"#blotter2\").slideToggle(\"slow\", function() { $(\"#blotter2\").slideToggle(\"slow\", function() {

View File

@ -39,7 +39,7 @@ class ImageBanTheme extends Themelet {
"; ";
} }
$html = " $html = "
<script> <script type='text/javascript'>
$(document).ready(function() { $(document).ready(function() {
$(\"#image_bans\").tablesorter(); $(\"#image_bans\").tablesorter();
}); });

View File

@ -36,7 +36,7 @@ class IPBanTheme extends Themelet {
"; ";
} }
$html = " $html = "
<script> <script type='text/javascript'>
$(document).ready(function() { $(document).ready(function() {
$(\"#bans\").tablesorter(); $(\"#bans\").tablesorter();
}); });

View File

@ -5,7 +5,7 @@ class PrivMsgTheme extends Themelet {
global $user; global $user;
$html = " $html = "
<script> <script type='text/javascript'>
$(document).ready(function() { $(document).ready(function() {
$(\"#pms\").tablesorter(); $(\"#pms\").tablesorter();
}); });

View File

@ -218,13 +218,14 @@ function make_http($link) {
/** /**
* Make a form tag with relevant auth token and stuff * Make a form tag with relevant auth token and stuff
* (Added optional Form ID field for helping jquery.)
* *
* @retval string * @retval string
*/ */
function make_form($target, $method="POST", $multipart=False) { function make_form($target, $method="POST", $multipart=False, $form_id="") {
global $user; global $user;
$auth = $user->get_auth_html(); $auth = $user->get_auth_html();
$extra = ""; $extra = empty($form_id) ? '' : " id='$form_id'";
if($multipart) { if($multipart) {
$extra .= " enctype='multipart/form-data'"; $extra .= " enctype='multipart/form-data'";
} }

View File

@ -46,7 +46,7 @@ class AliasEditorTheme extends Themelet {
$h_aliases .= "</tr>"; $h_aliases .= "</tr>";
} }
$html = " $html = "
<script> <script type='text/javascript'>
$(document).ready(function() { $(document).ready(function() {
$(\"#aliases\").tablesorter(); $(\"#aliases\").tablesorter();
}); });

View File

@ -6,7 +6,7 @@ class ExtManagerTheme extends Themelet {
$en = $editable ? "<th>Enabled</th>" : ""; $en = $editable ? "<th>Enabled</th>" : "";
$html = " $html = "
".make_form(make_link("ext_manager/set"))." ".make_form(make_link("ext_manager/set"))."
<script> <script type='text/javascript'>
$(document).ready(function() { $(document).ready(function() {
$(\"#extensions\").tablesorter(); $(\"#extensions\").tablesorter();
}); });

View File

@ -2,6 +2,7 @@
class ImageIOTheme { class ImageIOTheme {
/* /*
* Display a link to delete an image * Display a link to delete an image
* (Added inline Javascript to confirm the deletion)
* *
* $image_id = the image to delete * $image_id = the image to delete
*/ */
@ -10,9 +11,9 @@ class ImageIOTheme {
$i_image_id = int_escape($image_id); $i_image_id = int_escape($image_id);
$html = " $html = "
".make_form(make_link("image_admin/delete"))." ".make_form(make_link("image_admin/delete"),'POST',false,'delete_image')."
<input type='hidden' name='image_id' value='$i_image_id'> <input type='hidden' name='image_id' value='$i_image_id'>
<input type='submit' value='Delete'> <input type='submit' value='Delete' onclick='return confirm(\"Delete the image?\");'>
</form> </form>
"; ";
return $html; return $html;

View File

@ -79,7 +79,7 @@ EOD;
$h_search_string = html_escape(implode(" ", $search_terms)); $h_search_string = html_escape(implode(" ", $search_terms));
$h_search_link = make_link(); $h_search_link = make_link();
$h_search = " $h_search = "
<script><!-- <script type='text/javascript'><!--
$(document).ready(function() { $(document).ready(function() {
$('#search_input').DefaultValue('Search'); $('#search_input').DefaultValue('Search');
$('#search_input').autocomplete('".make_link("api/internal/tag_list/complete")."', { $('#search_input').autocomplete('".make_link("api/internal/tag_list/complete")."', {

View File

@ -79,7 +79,7 @@ class SetupTheme extends Themelet {
} }
$table = " $table = "
<script> <script type='text/javascript'>
$(document).ready(function() { $(document).ready(function() {
$(\"#settings\").tablesorter(); $(\"#settings\").tablesorter();
}); });

View File

@ -35,7 +35,7 @@ class UploadTheme extends Themelet {
$max_size = $config->get_int('upload_size'); $max_size = $config->get_int('upload_size');
$max_kb = to_shorthand_int($max_size); $max_kb = to_shorthand_int($max_size);
$html = " $html = "
<script> <script type='text/javascript'>
$(document).ready(function() { $(document).ready(function() {
$('#tag_box').DefaultValue('tagme'); $('#tag_box').DefaultValue('tagme');
$('#tag_box').autocomplete('".make_link("api/internal/tag_list/complete")."', { $('#tag_box').autocomplete('".make_link("api/internal/tag_list/complete")."', {
@ -105,7 +105,7 @@ class UploadTheme extends Themelet {
$max_kb = to_shorthand_int($max_size); $max_kb = to_shorthand_int($max_size);
// <input type='hidden' name='max_file_size' value='$max_size' /> // <input type='hidden' name='max_file_size' value='$max_size' />
return " return "
<script> <script type='text/javascript'>
$(document).ready(function() { $(document).ready(function() {
$('#tag_input').DefaultValue('tagme'); $('#tag_input').DefaultValue('tagme');
$('#tag_input').autocomplete('".make_link("api/internal/tag_list/complete")."', { $('#tag_input').autocomplete('".make_link("api/internal/tag_list/complete")."', {

View File

@ -44,7 +44,7 @@ class ViewImageTheme extends Themelet {
$h_index = "<a href='".make_link()."'>Index</a>"; $h_index = "<a href='".make_link()."'>Index</a>";
$h_next = "<a id='nextlink' href='".make_link("post/next/{$image->id}", $query)."'>Next</a>"; $h_next = "<a id='nextlink' href='".make_link("post/next/{$image->id}", $query)."'>Next</a>";
$script = " $script = "
<script><!-- <script type='text/javascript'><!--
$(document).ready(function() { $(document).ready(function() {
if(document.location.hash.length > 3) { if(document.location.hash.length > 3) {
query = document.location.hash.substring(1); query = document.location.hash.substring(1);
@ -63,7 +63,7 @@ class ViewImageTheme extends Themelet {
protected function build_navigation(Image $image) { protected function build_navigation(Image $image) {
$h_pin = $this->build_pin($image); $h_pin = $this->build_pin($image);
$h_search = " $h_search = "
<script><!-- <script type='text/javascript'><!--
$(document).ready(function() { $(document).ready(function() {
$(\"#search_input\").DefaultValue(\"Search\"); $(\"#search_input\").DefaultValue(\"Search\");
}); });

View File

@ -89,7 +89,7 @@ EOD;
$html = ""; $html = "";
$i = str_replace(' ', '_', $h) . $salt; $i = str_replace(' ', '_', $h) . $salt;
if($hidable) $html .= " if($hidable) $html .= "
<script><!-- <script type='text/javascript'><!--
$(document).ready(function() { $(document).ready(function() {
$(\"#$i-toggle\").click(function() { $(\"#$i-toggle\").click(function() {
$(\"#$i\").slideToggle(\"slow\", function() { $(\"#$i\").slideToggle(\"slow\", function() {

View File

@ -8,7 +8,7 @@ class CustomSetupTheme extends SetupTheme {
$b = $block->body; $b = $block->body;
$i = preg_replace('/[^a-zA-Z0-9]/', '_', $h) . "-setup"; $i = preg_replace('/[^a-zA-Z0-9]/', '_', $h) . "-setup";
$html = " $html = "
<script><!-- <script type='text/javascript'><!--
$(document).ready(function() { $(document).ready(function() {
$(\"#$i-toggle\").click(function() { $(\"#$i-toggle\").click(function() {
$(\"#$i\").slideToggle(\"slow\", function() { $(\"#$i\").slideToggle(\"slow\", function() {

View File

@ -90,7 +90,7 @@ EOD;
$html = ""; $html = "";
$i = str_replace(' ', '_', $h) . $salt; $i = str_replace(' ', '_', $h) . $salt;
if($hidable) $html .= " if($hidable) $html .= "
<script><!-- <script type='text/javascript'><!--
$(document).ready(function() { $(document).ready(function() {
$(\"#$i-toggle\").click(function() { $(\"#$i-toggle\").click(function() {
$(\"#$i\").slideToggle(\"slow\", function() { $(\"#$i\").slideToggle(\"slow\", function() {

View File

@ -8,7 +8,7 @@ class CustomSetupTheme extends SetupTheme {
$b = $block->body; $b = $block->body;
$i = preg_replace('/[^a-zA-Z0-9]/', '_', $h) . "-setup"; $i = preg_replace('/[^a-zA-Z0-9]/', '_', $h) . "-setup";
$html = " $html = "
<script><!-- <script type='text/javascript'><!--
$(document).ready(function() { $(document).ready(function() {
$(\"#$i-toggle\").click(function() { $(\"#$i-toggle\").click(function() {
$(\"#$i\").slideToggle(\"slow\", function() { $(\"#$i\").slideToggle(\"slow\", function() {

View File

@ -196,7 +196,7 @@ EOD;
$html = ""; $html = "";
$i = str_replace(' ', '_', $h) . $salt; $i = str_replace(' ', '_', $h) . $salt;
if($hidable) $html .= " if($hidable) $html .= "
<script><!-- <script type='text/javascript'><!--
$(document).ready(function() { $(document).ready(function() {
$(\"#$i-toggle\").click(function() { $(\"#$i-toggle\").click(function() {
$(\"#$i\").slideToggle(\"slow\", function() { $(\"#$i\").slideToggle(\"slow\", function() {

View File

@ -8,7 +8,7 @@ class CustomSetupTheme extends SetupTheme {
$b = $block->body; $b = $block->body;
$i = preg_replace('/[^a-zA-Z0-9]/', '_', $h) . "-setup"; $i = preg_replace('/[^a-zA-Z0-9]/', '_', $h) . "-setup";
$html = " $html = "
<script><!-- <script type='text/javascript'><!--
$(document).ready(function() { $(document).ready(function() {
$(\"#$i-toggle\").click(function() { $(\"#$i-toggle\").click(function() {
$(\"#$i\").slideToggle(\"slow\", function() { $(\"#$i\").slideToggle(\"slow\", function() {

View File

@ -102,7 +102,7 @@ EOD;
$html = ""; $html = "";
$i = str_replace(' ', '_', $h) . $salt; $i = str_replace(' ', '_', $h) . $salt;
if($hidable) $html .= " if($hidable) $html .= "
<script><!-- <script type='text/javascript'><!--
$(document).ready(function() { $(document).ready(function() {
$(\"#$i-toggle\").click(function() { $(\"#$i-toggle\").click(function() {
$(\"#$i\").slideToggle(\"slow\", function() { $(\"#$i\").slideToggle(\"slow\", function() {