From addadde7f4761239abe9452f252530f978ef514f Mon Sep 17 00:00:00 2001 From: teramako Date: Sun, 21 Sep 2008 02:03:56 +0000 Subject: fix: indent git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@19659 d0d07461-0603-4401-acd4-de1884942a52 --- bufferecho.js | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'bufferecho.js') diff --git a/bufferecho.js b/bufferecho.js index 18e2eee..c1826a9 100644 --- a/bufferecho.js +++ b/bufferecho.js @@ -10,38 +10,38 @@ liberator.plugins.buffer_echo = (function(){ var title = "bufferecho results"; var prefix = 'data:text/html,'; function execute(str){ - var result; - try { - result = (function(){ return window.eval("with(liberator) {" + str + "}") })(); - } catch (e) { + var result; + try { + result = (function(){ return window.eval("with(liberator) {" + str + "}") })(); + } catch (e) { result = e.name + ":\n" + e.message; - } - return result; + } + return result; } liberator.commands.addUserCommand(['bufferecho','becho'],'Display results of JavaScript to a buffer(browser)', - function(args, special){ + function(args, special){ liberator.plugins.buffer_echo.open(args, special); - },{ - completer: function(filter) liberator.completion.javascript(filter) - },true + },{ + completer: function(filter) liberator.completion.javascript(filter) + },true ); var manager = { append: function(htmlString){ var body = liberator.buffer.evaluateXPath('/html/body').snapshotItem(0); body.innerHTML += htmlString; }, - open: function(str, forceNewTab) { - var result = execute(str); + open: function(str, forceNewTab) { + var result = execute(str); if (typeof(result) == "object") result = liberator.util.objectToString(result,true); - var data = '
' + result + '
' + result + '