diff --git a/source/lib/RippingCluster/Main.class.php b/source/lib/RippingCluster/Main.class.php index ea2bb98..e7318c3 100644 --- a/source/lib/RippingCluster/Main.class.php +++ b/source/lib/RippingCluster/Main.class.php @@ -25,11 +25,12 @@ class RippingCluster_Main extends SihnonFramework_Main { $this->smarty->compile_dir = static::makeAbsolutePath($smarty_tmp . '/tmp/templates'); $this->smarty->cache_dir = static::makeAbsolutePath($smarty_tmp . '/tmp/cache'); $this->smarty->config_dir = static::makeAbsolutePath($smarty_tmp . '/config'); + $this->smarty->plugins_dir[]= static::makeAbsolutePath('./source/smarty/plugins'); $this->smarty->registerPlugin('modifier', 'formatDuration', array('RippingCluster_Main', 'formatDuration')); $this->smarty->registerPlugin('modifier', 'formatFilesize', array('RippingCluster_Main', 'formatFilesize')); - $this->smarty->assign('version', '0.2.1'); + $this->smarty->assign('version', '0.3'); $this->smarty->assign('messages', array()); $this->smarty->assign('base_uri', $this->base_uri); diff --git a/webui/scripts/main.js b/webui/scripts/main.js index 660f16c..e45dd74 100644 --- a/webui/scripts/main.js +++ b/webui/scripts/main.js @@ -23,7 +23,8 @@ var rc = { }, post: function(url, data) { - $.ajax(url, { + $.ajax({ + url: url, type: "POST", dataType: "json", data: data, @@ -35,6 +36,7 @@ var rc = { success: function(d, s, x) { rc.page.update(d); rc.dialog.prepare(d); + rc.trigger_all(d); }, failure: function(x, s, e) { @@ -54,6 +56,23 @@ var rc = { if (d.dialog.buttons) { switch (d.dialog.buttons.type) { + case 'ok': + $("#dialogfooterok").click( + function() { + rc.trigger(d.dialog.buttons.actions.ok, d.dialog.buttons.params); + } + ); + $("#dialogfooterok").show(); + break; + case 'okcancel': + $("#dialogfooterokcancel_ok").click(function() { + rc.trigger(d.dialog.buttons.actions.ok, d.dialog.buttons.params); + }); + $("#dialogfooterokcancel_cancel").click(function() { + rc.trigger(d.dialog.buttons.actions.cancel, d.dialog.buttons.params); + }); + $("#dialogfooterokcancel").show(); + break; case 'yesno': $("#dialogfooteryes").click( function() { @@ -70,15 +89,56 @@ var rc = { } } + if (d.dialog.title) { + $('#dialogheadertitle').html(d.dialog.title); + } + + if (d.dialog.content) { + $('#dialogcontent').html(d.dialog.content); + } + $("#dialog").show(); } }, close: function() { + // Hide the dialog $("#dialog").hide(); - $(".dialogfooterbuttonset").hide(); + + // Remove the dialog content $("#dialogcontent").html(); - } + + // Hide all buttons + $(".dialogfooterbuttonset").hide(); + // Strip all event handlers + $(".dialogfooterbuttonset input[type='button']").unbind('click'); + }, + + error: function(title, content, messages) { + var formatted_content = $('
').append($('

').text('content')); + if (messages) { + var formatted_messages = $('

+ +
  • Admin + +
  • diff --git a/webui/styles/normal.css b/webui/styles/normal.css index 58bf818..773ab72 100644 --- a/webui/styles/normal.css +++ b/webui/styles/normal.css @@ -142,6 +142,23 @@ label { text-align: right; } +table#settings { + +} + +table#settings td { + padding: 1.0em; + border: 1px solid; + border-collapse: collapse; +} + +table#settings input[type=text] { + width: 40em; +} +.settings_addfieldcontainer { + text-align: right; +} + .default { background: beige; color: darkgray; diff --git a/webui/tmp/cache/.gitignore b/webui/tmp/cache/.gitignore deleted file mode 100644 index e69de29..0000000 diff --git a/webui/tmp/templates/.gitignore b/webui/tmp/templates/.gitignore deleted file mode 100644 index e69de29..0000000