From 02f9f7f01a2c9a7bdf346620f8224bb29607e687 Mon Sep 17 00:00:00 2001 From: Awilum Date: Sat, 17 Nov 2012 19:25:24 +0200 Subject: [PATCH] Snippets Plugin: view embed code feature added. --- plugins/box/snippets/js/snippets.js | 18 +++++++++ plugins/box/snippets/snippets.admin.php | 4 ++ .../box/snippets/views/backend/index.view.php | 40 +++++++++++++++---- 3 files changed, 54 insertions(+), 8 deletions(-) create mode 100644 plugins/box/snippets/js/snippets.js diff --git a/plugins/box/snippets/js/snippets.js b/plugins/box/snippets/js/snippets.js new file mode 100644 index 0000000..6cdf9d3 --- /dev/null +++ b/plugins/box/snippets/js/snippets.js @@ -0,0 +1,18 @@ +if (typeof $.monstra == 'undefined') $.monstra = {}; + +$.monstra.snippets = { + + init: function() { }, + + showEmbedCodes: function(name) { + $('#shortcode').html('{snippet get="'+name+'"}'); + $('#phpcode').html('<?php echo Snippet::get("'+name+'"); ?>'); + $('#embedCodes').modal(); + } + +}; + + +$(document).ready(function(){ + $.monstra.snippets.init(); +}); \ No newline at end of file diff --git a/plugins/box/snippets/snippets.admin.php b/plugins/box/snippets/snippets.admin.php index eb65067..c933af6 100755 --- a/plugins/box/snippets/snippets.admin.php +++ b/plugins/box/snippets/snippets.admin.php @@ -1,7 +1,11 @@
- + - - 'btn btn-actions')); ?> - 'btn btn-actions', 'onclick' => "return confirmDelete('".__('Delete snippet: :snippet', 'snippets', array(':snippet' => basename($snippet, '.snippet.php')))."')")); - ?> + +
+
+ 'btn btn-actions')); ?> + + + 'btn btn-actions', 'onclick' => "return confirmDelete('".__('Delete snippet: :snippet', 'snippets', array(':snippet' => basename($snippet, '.snippet.php')))."')")); + ?> +
+
- \ No newline at end of file + + + \ No newline at end of file