From 45168998ebca0abb0671d09ffc4d9b0a15179f36 Mon Sep 17 00:00:00 2001 From: Sergey Romanenko Date: Mon, 12 Nov 2012 15:44:37 +0200 Subject: [PATCH 1/2] Blocks Plugin: general js refactoring --- plugins/box/blocks/js/blocks.js | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/plugins/box/blocks/js/blocks.js b/plugins/box/blocks/js/blocks.js index a85cf37..cbf64d0 100644 --- a/plugins/box/blocks/js/blocks.js +++ b/plugins/box/blocks/js/blocks.js @@ -1,5 +1,18 @@ -function embedCodes(name) { - $('#shortcode').html('{block get="'+name+'"}'); - $('#phpcode').html('<?php echo Block::get("'+name+'"); ?>'); - $('#embedCodes').modal(); -} \ No newline at end of file +if (typeof $.monstra == 'undefined') $.monstra = {}; + +$.monstra.blocks = { + + init: function() { }, + + embedCodes: function(name) { + $('#shortcode').html('{block get="'+name+'"}'); + $('#phpcode').html('<?php echo Block::get("'+name+'"); ?>'); + $('#embedCodes').modal(); + } + +}; + + +$(document).ready(function(){ + $.monstra.blocks.init(); +}); \ No newline at end of file From e9ceea44a886dcafedf79fa2bfd7d08982b17df8 Mon Sep 17 00:00:00 2001 From: Sergey Romanenko Date: Mon, 12 Nov 2012 15:45:49 +0200 Subject: [PATCH 2/2] Blocks Plugin: general js refactoring --- plugins/box/blocks/views/backend/index.view.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/box/blocks/views/backend/index.view.php b/plugins/box/blocks/views/backend/index.view.php index 28e3f5a..893bc35 100755 --- a/plugins/box/blocks/views/backend/index.view.php +++ b/plugins/box/blocks/views/backend/index.view.php @@ -29,7 +29,7 @@ 'btn btn-actions')); ?>