summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.build_number2
-rw-r--r--lib/gallery.ajax.js4
-rw-r--r--lib/gallery.panel.js164
-rw-r--r--modules/gallery/views/menu_ajax_link.html.php2
-rw-r--r--modules/user/views/admin_users.html.php2
5 files changed, 87 insertions, 87 deletions
diff --git a/.build_number b/.build_number
index 9c7bcceb..1d10b46b 100644
--- a/.build_number
+++ b/.build_number
@@ -3,4 +3,4 @@
; process. You don't need to edit it. In fact..
;
; DO NOT EDIT THIS FILE BY HAND!
-build_number=359
+build_number=361
diff --git a/lib/gallery.ajax.js b/lib/gallery.ajax.js
index f27f3969..08f1fede 100644
--- a/lib/gallery.ajax.js
+++ b/lib/gallery.ajax.js
@@ -2,10 +2,10 @@
$.widget("ui.gallery_ajax", {
_init: function() {
this.element.click(function(event) {
- eval("var ajax_handler = " + $(event.currentTarget).attr("ajax_handler"));
+ eval("var ajax_handler = " + $(event.currentTarget).attr("data-ajax-handler"));
$.get($(event.currentTarget).attr("href"), function(data) {
ajax_handler(data);
- });
+ });
event.preventDefault();
return false;
});
diff --git a/lib/gallery.panel.js b/lib/gallery.panel.js
index e5028f2a..877faf64 100644
--- a/lib/gallery.panel.js
+++ b/lib/gallery.panel.js
@@ -1,90 +1,90 @@
(function($) {
- $.widget("ui.gallery_panel", {
- _init: function() {
- var self = this;
- this.element.click(function(event) {
- event.preventDefault();
- var element = event.currentTarget;
- var parent = $(element).parent().parent();
- var sHref = $(element).attr("href");
- var parentClass = $(parent).attr("class");
- var ePanel = "<tr id=\"g-panel\"><td colspan=\"6\"></td></tr>";
+ $.widget("ui.gallery_panel", {
+ _init: function() {
+ var self = this;
+ this.element.click(function(event) {
+ event.preventDefault();
+ var element = event.currentTarget;
+ var parent = $(element).parent().parent();
+ var sHref = $(element).attr("href");
+ var parentClass = $(parent).attr("class");
+ var ePanel = "<tr id=\"g-panel\"><td colspan=\"6\"></td></tr>";
- // We keep track of the open vs. closed state by looking to see if there'
- // an orig_text attr. If that attr is missing, then the panel is closed
- // and we want to open it
- var should_open = !$(element).attr("orig_text");
+ // We keep track of the open vs. closed state by looking to see if there's
+ // a data-orig-text attr. If that attr is missing, then the panel is closed
+ // and we want to open it
+ var should_open = !$(element).attr("data-orig-text");
- // Close any open panels and reset their button text
- if ($("#g-panel").length) {
- $("#g-panel").slideUp("slow").remove();
- $.each($(".g-panel-link"),
- function() {
- if ($(this).attr("orig_text")) {
- $(this).children(".g-button-text").text($(this).attr("orig_text"));
- $(this).attr("orig_text", "");
- }
- }
- );
- }
+ // Close any open panels and reset their button text
+ if ($("#g-panel").length) {
+ $("#g-panel").slideUp("slow").remove();
+ $.each($(".g-panel-link"),
+ function() {
+ if ($(this).attr("data-orig-text")) {
+ $(this).children(".g-button-text").text($(this).attr("data-orig-text"));
+ $(this).attr("data-orig-text", "");
+ }
+ }
+ );
+ }
- if (should_open) {
- $(parent).after(ePanel);
- $("#g-panel td").html(sHref);
- $.ajax({
- url: sHref,
- type: "GET",
- success: function(data, textStatus, xhr) {
- var mimeType = /^(\w+\/\w+)\;?/.exec(xhr.getResponseHeader("Content-Type"));
- var content = "";
- if (mimeType[1] == "application/json") {
- content = unescape(data.html);
- } else {
- content = data;
- }
+ if (should_open) {
+ $(parent).after(ePanel);
+ $("#g-panel td").html(sHref);
+ $.ajax({
+ url: sHref,
+ type: "GET",
+ success: function(data, textStatus, xhr) {
+ var mimeType = /^(\w+\/\w+)\;?/.exec(xhr.getResponseHeader("Content-Type"));
+ var content = "";
+ if (mimeType[1] == "application/json") {
+ content = unescape(data.html);
+ } else {
+ content = data;
+ }
- $("#g-panel td").html(content);
- self._ajaxify_panel();
- if ($(element).attr("open_text")) {
- $(element).attr("orig_text", $(element).children(".g-button-text").text());
- $(element).children(".g-button-text").text($(element).attr("open_text"));
- }
- $("#g-panel").addClass(parentClass).show().slideDown("slow");
- }
- });
- }
+ $("#g-panel td").html(content);
+ self._ajaxify_panel();
+ if ($(element).attr("data-open-text")) {
+ $(element).attr("data-orig-text", $(element).children(".g-button-text").text());
+ $(element).children(".g-button-text").text($(element).attr("data-open-text"));
+ }
+ $("#g-panel").addClass(parentClass).show().slideDown("slow");
+ }
+ });
+ }
- return false;
- });
- },
+ return false;
+ });
+ },
- _ajaxify_panel: function () {
- var self = this;
- $("#g-panel td form").ajaxForm({
- dataType: "json",
- beforeSubmit: function(formData, form, options) {
- form.find(":submit")
- .addClass("ui-state-disabled")
- .attr("disabled", "disabled");
- return true;
- },
- success: function(data) {
- if (data.html) {
- $("#g-panel td").html(data.html);
- self._ajaxify_panel();
- }
- if (data.result == "success") {
- self._trigger("success", null, {});
- if (data.location) {
- window.location = data.location;
- } else {
- window.location.reload();
- }
- }
- }
- });
- },
+ _ajaxify_panel: function () {
+ var self = this;
+ $("#g-panel td form").ajaxForm({
+ dataType: "json",
+ beforeSubmit: function(formData, form, options) {
+ form.find(":submit")
+ .addClass("ui-state-disabled")
+ .attr("disabled", "disabled");
+ return true;
+ },
+ success: function(data) {
+ if (data.html) {
+ $("#g-panel td").html(data.html);
+ self._ajaxify_panel();
+ }
+ if (data.result == "success") {
+ self._trigger("success", null, {});
+ if (data.location) {
+ window.location = data.location;
+ } else {
+ window.location.reload();
+ }
+ }
+ }
+ });
+ },
- success: function(event, ui) {}
- });
- })(jQuery);
+ success: function(event, ui) {}
+ });
+})(jQuery);
diff --git a/modules/gallery/views/menu_ajax_link.html.php b/modules/gallery/views/menu_ajax_link.html.php
index 06cd6f92..66df84c9 100644
--- a/modules/gallery/views/menu_ajax_link.html.php
+++ b/modules/gallery/views/menu_ajax_link.html.php
@@ -4,7 +4,7 @@
class="g-ajax-link <?= $menu->css_class ?>"
href="<?= $menu->url ?>"
title="<?= $menu->label->for_html_attr() ?>"
- ajax_handler="<?= $menu->ajax_handler ?>">
+ data-ajax-handler="<?= $menu->ajax_handler ?>">
<?= $menu->label->for_html() ?>
</a>
</li>
diff --git a/modules/user/views/admin_users.html.php b/modules/user/views/admin_users.html.php
index 033c9dae..e7abbef9 100644
--- a/modules/user/views/admin_users.html.php
+++ b/modules/user/views/admin_users.html.php
@@ -92,7 +92,7 @@
</td>
<td>
<a href="<?= url::site("admin/users/edit_user_form/$user->id") ?>"
- open_text="<?= t("Close") ?>"
+ data-open-text="<?= t("Close") ?>"
class="g-panel-link g-button ui-state-default ui-corner-all ui-icon-left">
<span class="ui-icon ui-icon-pencil"></span><span class="g-button-text"><?= t("Edit") ?></span></a>
<? if (identity::active_user()->id != $user->id && !$user->guest): ?>