Skip to content

Commit

Permalink
Factored out the JS for the editor of Routines, Triggers and Events a…
Browse files Browse the repository at this point in the history
…nd moved it into a namespace.
  • Loading branch information
roccivic committed Jul 5, 2011
1 parent 1bbb2ea commit 55d2358
Show file tree
Hide file tree
Showing 10 changed files with 360 additions and 358 deletions.
2 changes: 1 addition & 1 deletion db_events.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
*/
$GLOBALS['js_include'][] = 'jquery/jquery-ui-1.8.custom.js';
$GLOBALS['js_include'][] = 'jquery/timepicker.js';
$GLOBALS['js_include'][] = 'rte_common.js';
$GLOBALS['js_include'][] = 'db_events.js';
$GLOBALS['js_include'][] = 'db_routines.js'; // FIXME

/**
* Include all other files
Expand Down
1 change: 1 addition & 0 deletions db_routines.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/
$GLOBALS['js_include'][] = 'jquery/jquery-ui-1.8.custom.js';
$GLOBALS['js_include'][] = 'jquery/timepicker.js';
$GLOBALS['js_include'][] = 'rte_common.js';
$GLOBALS['js_include'][] = 'db_routines.js';

/**
Expand Down
2 changes: 1 addition & 1 deletion db_triggers.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
* Include JavaScript libraries
*/
$GLOBALS['js_include'][] = 'jquery/jquery-ui-1.8.custom.js';
$GLOBALS['js_include'][] = 'rte_common.js';
$GLOBALS['js_include'][] = 'db_triggers.js';
$GLOBALS['js_include'][] = 'db_routines.js'; // FIXME

/**
* Include all other files
Expand Down
16 changes: 16 additions & 0 deletions js/db_events.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,18 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */

/**
* What type of item the editor is for.
*/
RTE.editor = 'event';

/**
* Attach Ajax event handlers for the "Change event type"
* functionality in the events editor.
*
* @see $cfg['AjaxEnable']
*/
$(document).ready(function () {
$('select[name=item_type]').live('change', function() {
$('.recurring_event_row, .onetime_event_row').toggle();
}); // end $.live()
}); // end of $(document).ready()
369 changes: 18 additions & 351 deletions js/db_routines.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions js/db_triggers.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */

/**
* What type of item the editor is for.
*/
RTE.editor = 'trigger';
317 changes: 317 additions & 0 deletions js/rte_common.js

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions libraries/rte/rte_events.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,7 @@ function PMA_EVN_handleEditor()
// Show form
$editor = PMA_EVN_getEditorForm($mode, $operation, $item);
if ($GLOBALS['is_ajax_request']) {
$extra_data = array('title' => $title,
'editor' => 'event');
$extra_data = array('title' => $title);
PMA_ajaxResponse($editor, true, $extra_data);
} else {
echo "\n\n<h2>$title</h2>\n\n$editor";
Expand Down
1 change: 0 additions & 1 deletion libraries/rte/rte_routines.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,6 @@ function PMA_RTN_handleEditor()
if ($GLOBALS['is_ajax_request']) {
$template = PMA_RTN_getParameterRow();
$extra_data = array('title' => $title,
'editor' => 'routine',
'param_template' => $template,
'type' => $routine['type']);
PMA_ajaxResponse($editor, true, $extra_data);
Expand Down
3 changes: 1 addition & 2 deletions libraries/rte/rte_triggers.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,7 @@ function PMA_TRI_handleEditor()
// Show form
$editor = PMA_TRI_getEditorForm($mode, $item);
if ($GLOBALS['is_ajax_request']) {
$extra_data = array('title' => $title,
'editor' => 'trigger');
$extra_data = array('title' => $title);
PMA_ajaxResponse($editor, true, $extra_data);
} else {
echo "\n\n<h2>$title</h2>\n\n$editor";
Expand Down

0 comments on commit 55d2358

Please sign in to comment.