From 45168998ebca0abb0671d09ffc4d9b0a15179f36 Mon Sep 17 00:00:00 2001 From: Sergey Romanenko Date: Mon, 12 Nov 2012 15:44:37 +0200 Subject: [PATCH] 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