From: <mol...@us...> - 2012-02-17 17:42:57
|
Revision: 3735 http://openutils.svn.sourceforge.net/openutils/?rev=3735&view=rev Author: molaschi Date: 2012-02-17 17:42:45 +0000 (Fri, 17 Feb 2012) Log Message: ----------- groovy shell IDE Modified Paths: -------------- trunk/openutils-mgnlgroovy/src/main/resources/mgnl-bootstrap/groovyshell/config.modules.adminInterface.config.menu.tools.groovyShell.xml Added Paths: ----------- trunk/openutils-mgnlgroovy/src/main/java/net/sourceforge/openutils/mgnlgroovy/pages/GroovyShellPage.java.bk trunk/openutils-mgnlgroovy/src/main/java/net/sourceforge/openutils/mgnlgroovy/pages/GroovyShellScript.java trunk/openutils-mgnlgroovy/src/main/resources/mgnl-bootstrap/groovyshell/config.modules.groovyshell.pages.groovyShellScript.xml trunk/openutils-mgnlgroovy/src/main/resources/mgnl-resources/groovyshell/css/bootstrap/ trunk/openutils-mgnlgroovy/src/main/resources/mgnl-resources/groovyshell/css/bootstrap/bootstrap.css trunk/openutils-mgnlgroovy/src/main/resources/mgnl-resources/groovyshell/css/bootstrap/images/ trunk/openutils-mgnlgroovy/src/main/resources/mgnl-resources/groovyshell/css/bootstrap/images/ui-bg_flat_0_aaaaaa_40x100.png trunk/openutils-mgnlgroovy/src/main/resources/mgnl-resources/groovyshell/css/bootstrap/images/ui-bg_glass_55_fbf9ee_1x400.png trunk/openutils-mgnlgroovy/src/main/resources/mgnl-resources/groovyshell/css/bootstrap/images/ui-bg_glass_65_ffffff_1x400.png trunk/openutils-mgnlgroovy/src/main/resources/mgnl-resources/groovyshell/css/bootstrap/images/ui-bg_glass_75_dadada_1x400.png trunk/openutils-mgnlgroovy/src/main/resources/mgnl-resources/groovyshell/css/bootstrap/images/ui-bg_glass_75_e6e6e6_1x400.png trunk/openutils-mgnlgroovy/src/main/resources/mgnl-resources/groovyshell/css/bootstrap/images/ui-bg_glass_75_ffffff_1x400.png trunk/openutils-mgnlgroovy/src/main/resources/mgnl-resources/groovyshell/css/bootstrap/images/ui-bg_highlight-soft_75_cccccc_1x100.png trunk/openutils-mgnlgroovy/src/main/resources/mgnl-resources/groovyshell/css/bootstrap/images/ui-bg_inset-soft_95_fef1ec_1x100.png trunk/openutils-mgnlgroovy/src/main/resources/mgnl-resources/groovyshell/css/bootstrap/images/ui-icons_222222_256x240.png trunk/openutils-mgnlgroovy/src/main/resources/mgnl-resources/groovyshell/css/bootstrap/images/ui-icons_2e83ff_256x240.png trunk/openutils-mgnlgroovy/src/main/resources/mgnl-resources/groovyshell/css/bootstrap/images/ui-icons_454545_256x240.png trunk/openutils-mgnlgroovy/src/main/resources/mgnl-resources/groovyshell/css/bootstrap/images/ui-icons_888888_256x240.png trunk/openutils-mgnlgroovy/src/main/resources/mgnl-resources/groovyshell/css/bootstrap/images/ui-icons_cd0a0a_256x240.png trunk/openutils-mgnlgroovy/src/main/resources/mgnl-resources/groovyshell/css/bootstrap/images/ui-icons_f6cf3b_256x240.png trunk/openutils-mgnlgroovy/src/main/resources/mgnl-resources/groovyshell/css/bootstrap/jquery-ui-1.8.16.custom.css trunk/openutils-mgnlgroovy/src/main/resources/mgnl-resources/groovyshell/css/bootstrap/jquery-ui-fileinput/ trunk/openutils-mgnlgroovy/src/main/resources/mgnl-resources/groovyshell/css/bootstrap/jquery-ui-fileinput/enhanced.css trunk/openutils-mgnlgroovy/src/main/resources/mgnl-resources/groovyshell/css/bootstrap/jquery-ui-fileinput/images/ trunk/openutils-mgnlgroovy/src/main/resources/mgnl-resources/groovyshell/css/bootstrap/jquery-ui-fileinput/images/icon-generic.gif trunk/openutils-mgnlgroovy/src/main/resources/mgnl-resources/groovyshell/css/bootstrap/jquery-ui-fileinput/images/icon-image.gif trunk/openutils-mgnlgroovy/src/main/resources/mgnl-resources/groovyshell/css/bootstrap/jquery-ui-fileinput/images/icon-media.gif trunk/openutils-mgnlgroovy/src/main/resources/mgnl-resources/groovyshell/css/bootstrap/jquery-ui-fileinput/images/icon-zip.gif trunk/openutils-mgnlgroovy/src/main/resources/mgnl-resources/groovyshell/css/bootstrap/jquery.layout.css trunk/openutils-mgnlgroovy/src/main/resources/mgnl-resources/groovyshell/css/bootstrap/jquery.ui.1.8.16.ie.css trunk/openutils-mgnlgroovy/src/main/resources/mgnl-resources/groovyshell/css/console.css trunk/openutils-mgnlgroovy/src/main/resources/mgnl-resources/groovyshell/css/editor.css trunk/openutils-mgnlgroovy/src/main/resources/mgnl-resources/groovyshell/js/ace/ trunk/openutils-mgnlgroovy/src/main/resources/mgnl-resources/groovyshell/js/ace/ace.js trunk/openutils-mgnlgroovy/src/main/resources/mgnl-resources/groovyshell/js/ace/mode-groovy.js trunk/openutils-mgnlgroovy/src/main/resources/mgnl-resources/groovyshell/js/ace/theme-eclipse.js trunk/openutils-mgnlgroovy/src/main/resources/mgnl-resources/groovyshell/js/jquery-ui-fileinput/ trunk/openutils-mgnlgroovy/src/main/resources/mgnl-resources/groovyshell/js/jquery-ui-fileinput/enhance.min.js trunk/openutils-mgnlgroovy/src/main/resources/mgnl-resources/groovyshell/js/jquery-ui-fileinput/fileinput.jquery.js trunk/openutils-mgnlgroovy/src/main/resources/mgnl-resources/groovyshell/js/jquery.cookie.js trunk/openutils-mgnlgroovy/src/main/resources/net/sourceforge/openutils/mgnlgroovy/pages/GroovyShellPage.html.bk trunk/openutils-mgnlgroovy/src/main/resources/net/sourceforge/openutils/mgnlgroovy/pages/GroovyShellScript.html Removed Paths: ------------- trunk/openutils-mgnlgroovy/src/main/java/net/sourceforge/openutils/mgnlgroovy/pages/GroovyShellPage.java trunk/openutils-mgnlgroovy/src/main/resources/net/sourceforge/openutils/mgnlgroovy/pages/GroovyShellPage.html Deleted: trunk/openutils-mgnlgroovy/src/main/java/net/sourceforge/openutils/mgnlgroovy/pages/GroovyShellPage.java =================================================================== --- trunk/openutils-mgnlgroovy/src/main/java/net/sourceforge/openutils/mgnlgroovy/pages/GroovyShellPage.java 2012-01-17 12:05:14 UTC (rev 3734) +++ trunk/openutils-mgnlgroovy/src/main/java/net/sourceforge/openutils/mgnlgroovy/pages/GroovyShellPage.java 2012-02-17 17:42:45 UTC (rev 3735) @@ -1,193 +0,0 @@ -/** - * - * Groovy Shell for Magnolia CMS (http://www.openmindlab.com/lab/products/groovy.html) - * Copyright(C) 2008-2011, Openmind S.r.l. http://www.openmindonline.it - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -package net.sourceforge.openutils.mgnlgroovy.pages; - -import groovy.lang.GroovyShell; -import groovy.lang.Script; -import info.magnolia.cms.beans.runtime.Document; -import info.magnolia.cms.util.AlertUtil; -import info.magnolia.module.admininterface.TemplatedMVCHandler; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileReader; -import java.io.IOException; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.commons.io.IOUtils; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.lang.exception.ExceptionUtils; -import org.codehaus.groovy.control.CompilationFailedException; -import org.codehaus.groovy.runtime.InvokerHelper; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - - -/** - * A basic Groovy shell to be embedded in Magnolia. - * @author fgrilli - * @version $Id: GroovyShellPage.java 5074 2008-10-21 13:16:36Z federico.grilli $ - */ -public class GroovyShellPage extends TemplatedMVCHandler -{ - - private static final String LINE_SEP = System.getProperty("line.separator"); - - private static final String GROOVY_VERSION = InvokerHelper.getVersion(); - - private static final long serialVersionUID = 222L; - - private static Logger log = LoggerFactory.getLogger(GroovyShellPage.class); - - private String groovyScript; - - private Document groovyScriptFile; - - public GroovyShellPage(String name, HttpServletRequest request, HttpServletResponse response) - { - super(name, request, response); - - } - - public String executeGroovyScript() - { - if (StringUtils.isBlank(groovyScript)) - { - String msg = "No script to execute"; - log.warn(msg); - AlertUtil.setMessage(msg); - return this.show(); - } - - log.debug("executing script {}", groovyScript); - - Object retVal; - - try - { - GroovyShell shell = new GroovyShell(); - Script script = shell.parse(getGroovyScript()); - retVal = script.run(); - AlertUtil.setMessage("Script executed successfully. Return value is " + retVal); - } - - catch (CompilationFailedException e) - { - log.error("An error occurred while parsing the script. Error message is {}", e.getMessage()); - AlertUtil.setMessage("An error occurred while parsing the script. Error message is " + e.getMessage()); - } - catch (Throwable e) - { - log.error("An error occurred while executing the script. Error message is " + e.getMessage(), e); - AlertUtil.setMessage("An error occurred while executing the script. Error message is " - + e.getMessage() - + "\n" - + ExceptionUtils.getFullStackTrace(e)); - } - - return this.show(); - } - - public String getGroovyScript() - { - return groovyScript; - } - - public void setGroovyScript(String groovyScript) - { - this.groovyScript = groovyScript; - } - - public String getGroovyVersion() - { - return GROOVY_VERSION; - } - - public Document getGroovyScriptFile() - { - return groovyScriptFile; - } - - public void setGroovyScriptFile(Document groovyScriptFile) - { - this.groovyScriptFile = groovyScriptFile; - } - - public String loadGroovyScript() - { - if (groovyScriptFile == null) - { - String msg = "Please, select a file"; - log.warn(msg); - AlertUtil.setMessage(msg); - return this.show(); - } - if (!groovyScriptFile.getExtension().equalsIgnoreCase("groovy")) - { - String msg = groovyScriptFile.getFileNameWithExtension() + " doesn't seem to be a valid groovy file"; - log.warn(msg); - AlertUtil.setMessage(msg); - return this.show(); - } - groovyScript = readFile(groovyScriptFile.getFile()); - - String msg = groovyScriptFile.getFileNameWithExtension() + " loaded"; - log.info(msg); - AlertUtil.setMessage(msg); - return this.show(); - - } - - private String readFile(File file) - { - StringBuilder contents = new StringBuilder(); - - try - { - // use buffering, reading one line at a time - // FileReader always assumes default encoding is OK! - BufferedReader input = new BufferedReader(new FileReader(file)); - try - { - String line = null; // not declared within while loop - /* - * readLine is a bit quirky : it returns the content of a line MINUS the newline. it returns null only - * for the END of the stream. it returns an empty String if two newlines appear in a row. - */ - while ((line = input.readLine()) != null) - { - contents.append(line); - contents.append(LINE_SEP); - } - } - finally - { - IOUtils.closeQuietly(input); - } - } - catch (IOException ex) - { - log.error(ex.getMessage()); - } - return contents.toString(); - } -} \ No newline at end of file Copied: trunk/openutils-mgnlgroovy/src/main/java/net/sourceforge/openutils/mgnlgroovy/pages/GroovyShellPage.java.bk (from rev 3734, trunk/openutils-mgnlgroovy/src/main/java/net/sourceforge/openutils/mgnlgroovy/pages/GroovyShellPage.java) =================================================================== --- trunk/openutils-mgnlgroovy/src/main/java/net/sourceforge/openutils/mgnlgroovy/pages/GroovyShellPage.java.bk (rev 0) +++ trunk/openutils-mgnlgroovy/src/main/java/net/sourceforge/openutils/mgnlgroovy/pages/GroovyShellPage.java.bk 2012-02-17 17:42:45 UTC (rev 3735) @@ -0,0 +1,193 @@ +/** + * + * Groovy Shell for Magnolia CMS (http://www.openmindlab.com/lab/products/groovy.html) + * Copyright(C) 2008-2011, Openmind S.r.l. http://www.openmindonline.it + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +package net.sourceforge.openutils.mgnlgroovy.pages; + +import groovy.lang.GroovyShell; +import groovy.lang.Script; +import info.magnolia.cms.beans.runtime.Document; +import info.magnolia.cms.util.AlertUtil; +import info.magnolia.module.admininterface.TemplatedMVCHandler; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang.exception.ExceptionUtils; +import org.codehaus.groovy.control.CompilationFailedException; +import org.codehaus.groovy.runtime.InvokerHelper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +/** + * A basic Groovy shell to be embedded in Magnolia. + * @author fgrilli + * @version $Id: GroovyShellPage.java 5074 2008-10-21 13:16:36Z federico.grilli $ + */ +public class GroovyShellPage extends TemplatedMVCHandler +{ + + private static final String LINE_SEP = System.getProperty("line.separator"); + + private static final String GROOVY_VERSION = InvokerHelper.getVersion(); + + private static final long serialVersionUID = 222L; + + private static Logger log = LoggerFactory.getLogger(GroovyShellPage.class); + + private String groovyScript; + + private Document groovyScriptFile; + + public GroovyShellPage(String name, HttpServletRequest request, HttpServletResponse response) + { + super(name, request, response); + + } + + public String executeGroovyScript() + { + if (StringUtils.isBlank(groovyScript)) + { + String msg = "No script to execute"; + log.warn(msg); + AlertUtil.setMessage(msg); + return this.show(); + } + + log.debug("executing script {}", groovyScript); + + Object retVal; + + try + { + GroovyShell shell = new GroovyShell(); + Script script = shell.parse(getGroovyScript()); + retVal = script.run(); + AlertUtil.setMessage("Script executed successfully. Return value is " + retVal); + } + + catch (CompilationFailedException e) + { + log.error("An error occurred while parsing the script. Error message is {}", e.getMessage()); + AlertUtil.setMessage("An error occurred while parsing the script. Error message is " + e.getMessage()); + } + catch (Throwable e) + { + log.error("An error occurred while executing the script. Error message is " + e.getMessage(), e); + AlertUtil.setMessage("An error occurred while executing the script. Error message is " + + e.getMessage() + + "\n" + + ExceptionUtils.getFullStackTrace(e)); + } + + return this.show(); + } + + public String getGroovyScript() + { + return groovyScript; + } + + public void setGroovyScript(String groovyScript) + { + this.groovyScript = groovyScript; + } + + public String getGroovyVersion() + { + return GROOVY_VERSION; + } + + public Document getGroovyScriptFile() + { + return groovyScriptFile; + } + + public void setGroovyScriptFile(Document groovyScriptFile) + { + this.groovyScriptFile = groovyScriptFile; + } + + public String loadGroovyScript() + { + if (groovyScriptFile == null) + { + String msg = "Please, select a file"; + log.warn(msg); + AlertUtil.setMessage(msg); + return this.show(); + } + if (!groovyScriptFile.getExtension().equalsIgnoreCase("groovy")) + { + String msg = groovyScriptFile.getFileNameWithExtension() + " doesn't seem to be a valid groovy file"; + log.warn(msg); + AlertUtil.setMessage(msg); + return this.show(); + } + groovyScript = readFile(groovyScriptFile.getFile()); + + String msg = groovyScriptFile.getFileNameWithExtension() + " loaded"; + log.info(msg); + AlertUtil.setMessage(msg); + return this.show(); + + } + + private String readFile(File file) + { + StringBuilder contents = new StringBuilder(); + + try + { + // use buffering, reading one line at a time + // FileReader always assumes default encoding is OK! + BufferedReader input = new BufferedReader(new FileReader(file)); + try + { + String line = null; // not declared within while loop + /* + * readLine is a bit quirky : it returns the content of a line MINUS the newline. it returns null only + * for the END of the stream. it returns an empty String if two newlines appear in a row. + */ + while ((line = input.readLine()) != null) + { + contents.append(line); + contents.append(LINE_SEP); + } + } + finally + { + IOUtils.closeQuietly(input); + } + } + catch (IOException ex) + { + log.error(ex.getMessage()); + } + return contents.toString(); + } +} \ No newline at end of file Added: trunk/openutils-mgnlgroovy/src/main/java/net/sourceforge/openutils/mgnlgroovy/pages/GroovyShellScript.java =================================================================== --- trunk/openutils-mgnlgroovy/src/main/java/net/sourceforge/openutils/mgnlgroovy/pages/GroovyShellScript.java (rev 0) +++ trunk/openutils-mgnlgroovy/src/main/java/net/sourceforge/openutils/mgnlgroovy/pages/GroovyShellScript.java 2012-02-17 17:42:45 UTC (rev 3735) @@ -0,0 +1,278 @@ +/** + * + * Groovy Shell for Magnolia CMS (http://www.openmindlab.com/lab/products/groovy.html) + * Copyright(C) 2008-2010, Openmind S.r.l. http://www.openmindonline.it + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +package net.sourceforge.openutils.mgnlgroovy.pages; + +import groovy.lang.GroovyShell; +import groovy.lang.GroovySystem; +import groovy.lang.Script; +import info.magnolia.cms.beans.runtime.Document; +import info.magnolia.cms.util.AlertUtil; +import info.magnolia.context.MgnlContext; +import info.magnolia.module.admininterface.TemplatedMVCHandler; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.io.PrintWriter; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang.exception.ExceptionUtils; +import org.codehaus.groovy.control.CompilationFailedException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +/** + * A basic Groovy shell to be embedded in Magnolia. + * @author fgrilli + * @version $Id$ + */ +public class GroovyShellScript extends TemplatedMVCHandler +{ + + private static final String LINE_SEP = System.getProperty("line.separator"); + + private static final String GROOVY_VERSION = GroovySystem.getVersion(); + + private static Logger log = LoggerFactory.getLogger(GroovyShellScript.class); + + private String groovyScript; + + private Document groovyScriptFile; + + private String title; + + public GroovyShellScript(String name, HttpServletRequest request, HttpServletResponse response) + { + super(name, request, response); + + } + + public String save() + { + if (StringUtils.isBlank(title)) + { + title = "script"; + } + + response.setHeader( + "Content-Disposition", + "attachment;filename=\"" + + title + + (StringUtils.endsWith(title, ".groovy") ? StringUtils.EMPTY : ".groovy") + + "\""); + response.setContentType("application/octet-stream;charset=UTF-8"); + response.setCharacterEncoding("UTF-8"); + + try + { + response.getWriter().print(groovyScript); + response.flushBuffer(); + } + catch (IOException e) + { + log.error("Error writing file to response", e); + } + + return null; + } + + public String run() + { + response.setContentType("text/html"); + response.setStatus(200); + // response.setBufferSize(1); + response.setCharacterEncoding("UTF-8"); + + if (StringUtils.isBlank(groovyScript)) + { + String msg = "No script to execute"; + log.warn(msg); + AlertUtil.setMessage(msg); + return this.show(); + } + + log.debug("executing script {}", groovyScript); + + Object retVal; + // final OutputStream os = osTmp; + + PrintWriter w = null; + try + { + w = response.getWriter(); + } + catch (IOException e1) + { + } + w + .print("<!doctype html><html lang=\"en\"><head><meta charset=\"utf-8\"><title>Groovy shell execution console</title><link href=\""); + w.print(request.getContextPath()); + w + .println("/.resources/groovyshell/css/console.css\" type=\"text/css\" rel=\"stylesheet\" /></head><body><pre>"); + w.println("Running script..."); + w.println("--------------------------------------\n"); + w.flush(); + + try + { + GroovyShell shell = new GroovyShell(); + shell.setProperty("ctx", MgnlContext.getInstance()); + + PrintWriter pout = new PrintWriter(w) + { + + /** + * {@inheritDoc} + */ + @Override + public void print(String s) + { + super.print(s); + super.flush(); + } + + }; + shell.setProperty("out", pout); + shell.setProperty("err", pout); + Script script = shell.parse(getGroovyScript()); + retVal = script.run(); + if (retVal != null) + { + w.println("\n--------------------------------------"); + w.println("Return value is:"); + w.println(retVal); + } + // AlertUtil.setMessage("Script executed successfully. Return value is " + retVal); + } + + catch (CompilationFailedException e) + { + log.error("An error occurred while parsing the script. Error message is {}", e.getMessage()); + AlertUtil.setMessage("An error occurred while parsing the script. Error message is " + e.getMessage()); + w.println("<span class=\"err\">"); + e.printStackTrace(w); + w.println("</span>"); + } + catch (Throwable e) + { + log.error("An error occurred while executing the script. Error message is " + e.getMessage(), e); + AlertUtil.setMessage("An error occurred while executing the script. Error message is " + + e.getMessage() + + "\n" + + ExceptionUtils.getFullStackTrace(e)); + w.println("<span class=\"err\">"); + e.printStackTrace(w); + w.println("</span>"); + } + w.print("</pre></body></html>"); + + return null; // this.show(); + } + + public String load() + { + if (groovyScriptFile == null) + { + String msg = "Please, select a file"; + log.warn(msg); + AlertUtil.setMessage(msg); + return this.show(); + } + if (!groovyScriptFile.getExtension().equalsIgnoreCase("groovy")) + { + String msg = groovyScriptFile.getFileNameWithExtension() + " doesn't seem to be a valid groovy file"; + log.warn(msg); + AlertUtil.setMessage(msg); + return this.show(); + } + groovyScript = readFile(groovyScriptFile.getFile()); + + String msg = groovyScriptFile.getFileNameWithExtension() + " loaded"; + log.info(msg); + AlertUtil.setMessage(msg); + return this.show(); + + } + + private String readFile(File file) + { + StringBuilder contents = new StringBuilder(); + + try + { + // use buffering, reading one line at a time + // FileReader always assumes default encoding is OK! + BufferedReader input = new BufferedReader(new FileReader(file)); + try + { + String line = null; // not declared within while loop + /* + * readLine is a bit quirky : it returns the content of a line MINUS the newline. it returns null only + * for the END of the stream. it returns an empty String if two newlines appear in a row. + */ + while ((line = input.readLine()) != null) + { + contents.append(line); + contents.append(LINE_SEP); + } + } + finally + { + IOUtils.closeQuietly(input); + } + } + catch (IOException ex) + { + log.error(ex.getMessage()); + } + return contents.toString(); + } + + public String getGroovyScript() + { + return groovyScript; + } + + public void setGroovyScript(String groovyScript) + { + this.groovyScript = groovyScript; + } + + public String getGroovyVersion() + { + return GROOVY_VERSION; + } + + public Document getGroovyScriptFile() + { + return groovyScriptFile; + } + + public void setGroovyScriptFile(Document groovyScriptFile) + { + this.groovyScriptFile = groovyScriptFile; + } +} \ No newline at end of file Property changes on: trunk/openutils-mgnlgroovy/src/main/java/net/sourceforge/openutils/mgnlgroovy/pages/GroovyShellScript.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Modified: trunk/openutils-mgnlgroovy/src/main/resources/mgnl-bootstrap/groovyshell/config.modules.adminInterface.config.menu.tools.groovyShell.xml =================================================================== --- trunk/openutils-mgnlgroovy/src/main/resources/mgnl-bootstrap/groovyshell/config.modules.adminInterface.config.menu.tools.groovyShell.xml 2012-01-17 12:05:14 UTC (rev 3734) +++ trunk/openutils-mgnlgroovy/src/main/resources/mgnl-bootstrap/groovyshell/config.modules.adminInterface.config.menu.tools.groovyShell.xml 2012-02-17 17:42:45 UTC (rev 3735) @@ -9,16 +9,22 @@ <sv:property sv:name="icon" sv:type="String"> <sv:value>/.resources/groovyshell/icons/groovy-small.png</sv:value> </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> <sv:property sv:name="label" sv:type="String"> <sv:value>Groovy Shell</sv:value> </sv:property> <sv:property sv:name="onclick" sv:type="String"> - <sv:value>MgnlAdminCentral.showContent('/.magnolia/pages/groovyShell.html');</sv:value> + <sv:value>window.open('/.magnolia/pages/groovyShell.html');</sv:value> </sv:property> <sv:node sv:name="MetaData"> <sv:property sv:name="jcr:primaryType" sv:type="Name"> <sv:value>mgnl:metaData</sv:value> </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> <sv:property sv:name="mgnl:Data" sv:type="String"> <sv:value>MetaData</sv:value> </sv:property> @@ -29,7 +35,7 @@ <sv:value>superuser</sv:value> </sv:property> <sv:property sv:name="mgnl:authorid" sv:type="String"> - <sv:value>admin</sv:value> + <sv:value>superuser</sv:value> </sv:property> <sv:property sv:name="mgnl:creationdate" sv:type="Date"> <sv:value>2005-05-16T20:46:43.549+02:00</sv:value> @@ -38,7 +44,7 @@ <sv:value>2006-05-04T12:02:10.817+02:00</sv:value> </sv:property> <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> - <sv:value>2008-08-22T16:58:05.902+02:00</sv:value> + <sv:value>2012-02-17T17:53:37.468+01:00</sv:value> </sv:property> </sv:node> </sv:node> Added: trunk/openutils-mgnlgroovy/src/main/resources/mgnl-bootstrap/groovyshell/config.modules.groovyshell.pages.groovyShellScript.xml =================================================================== --- trunk/openutils-mgnlgroovy/src/main/resources/mgnl-bootstrap/groovyshell/config.modules.groovyshell.pages.groovyShellScript.xml (rev 0) +++ trunk/openutils-mgnlgroovy/src/main/resources/mgnl-bootstrap/groovyshell/config.modules.groovyshell.pages.groovyShellScript.xml 2012-02-17 17:42:45 UTC (rev 3735) @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sv:node sv:name="groovyShellScript" xmlns:sv="http://www.jcp.org/jcr/sv/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:contentNode</sv:value> + </sv:property> + <sv:property sv:name="jcr:uuid" sv:type="String"> + <sv:value>2d1ea4dc-8d4c-4540-94c0-69d75b6f8252</sv:value> + </sv:property> + <sv:property sv:name="class" sv:type="String"> + <sv:value>net.sourceforge.openutils.mgnlgroovy.pages.GroovyShellScript</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:node sv:name="MetaData"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:metaData</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:property sv:name="mgnl:activated" sv:type="Boolean"> + <sv:value>false</sv:value> + </sv:property> + <sv:property sv:name="mgnl:activatorid" sv:type="String"> + <sv:value>superuser</sv:value> + </sv:property> + <sv:property sv:name="mgnl:authorid" sv:type="String"> + <sv:value>superuser</sv:value> + </sv:property> + <sv:property sv:name="mgnl:creationdate" sv:type="Date"> + <sv:value>2006-06-10T17:40:37.578+02:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastaction" sv:type="Date"> + <sv:value>2006-07-11T21:37:16.259+02:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2012-02-16T23:59:16.648+01:00</sv:value> + </sv:property> + </sv:node> +</sv:node> Property changes on: trunk/openutils-mgnlgroovy/src/main/resources/mgnl-bootstrap/groovyshell/config.modules.groovyshell.pages.groovyShellScript.xml ___________________________________________________________________ Added: svn:mime-type + text/xml Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/openutils-mgnlgroovy/src/main/resources/mgnl-resources/groovyshell/css/bootstrap/bootstrap.css =================================================================== --- trunk/openutils-mgnlgroovy/src/main/resources/mgnl-resources/groovyshell/css/bootstrap/bootstrap.css (rev 0) +++ trunk/openutils-mgnlgroovy/src/main/resources/mgnl-resources/groovyshell/css/bootstrap/bootstrap.css 2012-02-17 17:42:45 UTC (rev 3735) @@ -0,0 +1,2476 @@ +/*! + * Bootstrap v1.4.0 + * + * Copyright 2011 Twitter, Inc + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Designed and built with all the love in the world @twitter by @mdo and @fat. + * Date: Sun Dec 25 20:18:31 PST 2011 + */ +/* Reset.less + * Props to Eric Meyer (meyerweb.com) for his CSS reset file. We're using an adapted version here that cuts out some of the reset HTML elements we will never need here (i.e., dfn, samp, etc). + * ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- */ +html, body { + margin: 0; + padding: 0; +} +h1, +h2, +h3, +h4, +h5, +h6, +p, +blockquote, +pre, +a, +abbr, +acronym, +address, +cite, +code, +del, +dfn, +em, +img, +q, +s, +samp, +small, +strike, +strong, +sub, +sup, +tt, +var, +dd, +dl, +dt, +li, +ol, +ul, +fieldset, +form, +label, +legend, +button, +table, +caption, +tbody, +tfoot, +thead, +tr, +th, +td { + margin: 0; + padding: 0; + border: 0; + font-weight: normal; + font-style: normal; + font-size: 100%; + line-height: 1; + font-family: inherit; +} +table { + border-collapse: collapse; + border-spacing: 0; +} +ol, ul { + list-style: none; +} +q:before, +q:after, +blockquote:before, +blockquote:after { + content: ""; +} +html { + overflow-y: scroll; + font-size: 100%; + -webkit-text-size-adjust: 100%; + -ms-text-size-adjust: 100%; +} +a:focus { + outline: thin dotted; +} +a:hover, a:active { + outline: 0; +} +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +nav, +section { + display: block; +} +audio, canvas, video { + display: inline-block; + *display: inline; + *zoom: 1; +} +audio:not([controls]) { + display: none; +} +sub, sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} +sup { + top: -0.5em; +} +sub { + bottom: -0.25em; +} +img { + border: 0; + -ms-interpolation-mode: bicubic; +} + +/* +button, +input, +select, +textarea { + font-size: 100%; + margin: 0; + vertical-align: baseline; + *vertical-align: middle; +} +button, input { + line-height: normal; + *overflow: visible; +} +button::-moz-focus-inner, input::-moz-focus-inner { + border: 0; + padding: 0; +} +button, +input[type="button"], +input[type="reset"], +input[type="submit"] { + cursor: pointer; + -webkit-appearance: button; +} +input[type="search"] { + -webkit-appearance: textfield; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; +} +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +}*/ +textarea { + overflow: auto; + vertical-align: top; +} +/* Variables.less + * Variables to customize the look and feel of Bootstrap + * ----------------------------------------------------- */ +/* Mixins.less + * Snippets of reusable CSS to develop faster and keep code readable + * ----------------------------------------------------------------- */ +/* + * Scaffolding + * Basic and global styles for generating a grid system, structural layout, and page templates + * ------------------------------------------------------------------------------------------- */ +body { + background-color: #ffffff; + margin: 0; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 13px; + font-weight: normal; + line-height: 18px; + color: #404040; +} +.container { + width: 940px; + margin-left: auto; + margin-right: auto; + zoom: 1; +} +.container:before, .container:after { + display: table; + content: ""; + zoom: 1; +} +.container:after { + clear: both; +} +.container-fluid { + position: relative; + min-width: 940px; + padding-left: 20px; + padding-right: 20px; + zoom: 1; +} +.container-fluid:before, .container-fluid:after { + display: table; + content: ""; + zoom: 1; +} +.container-fluid:after { + clear: both; +} +.container-fluid > .sidebar { + position: absolute; + top: 0; + left: 20px; + width: 220px; +} +.container-fluid > .content { + margin-left: 240px; +} +a { + color: #0069d6; + text-decoration: none; + line-height: inherit; + font-weight: inherit; +} +a:hover { + color: #00438a; + text-decoration: underline; +} +.pull-right { + float: right; +} +.pull-left { + float: left; +} +.hide { + display: none; +} +.show { + display: block; +} +.row { + zoom: 1; + margin-left: -20px; +} +.row:before, .row:after { + display: table; + content: ""; + zoom: 1; +} +.row:after { + clear: both; +} +.row > [class*="span"] { + display: inline; + float: left; + margin-left: 20px; +} +.span1 { + width: 40px; +} +.span2 { + width: 100px; +} +.span3 { + width: 160px; +} +.span4 { + width: 220px; +} +.span5 { + width: 280px; +} +.span6 { + width: 340px; +} +.span7 { + width: 400px; +} +.span8 { + width: 460px; +} +.span9 { + width: 520px; +} +.span10 { + width: 580px; +} +.span11 { + width: 640px; +} +.span12 { + width: 700px; +} +.span13 { + width: 760px; +} +.span14 { + width: 820px; +} +.span15 { + width: 880px; +} +.span16 { + width: 940px; +} +.span17 { + width: 1000px; +} +.span18 { + width: 1060px; +} +.span19 { + width: 1120px; +} +.span20 { + width: 1180px; +} +.span21 { + width: 1240px; +} +.span22 { + width: 1300px; +} +.span23 { + width: 1360px; +} +.span24 { + width: 1420px; +} +.row > .offset1 { + margin-left: 80px; +} +.row > .offset2 { + margin-left: 140px; +} +.row > .offset3 { + margin-left: 200px; +} +.row > .offset4 { + margin-left: 260px; +} +.row > .offset5 { + margin-left: 320px; +} +.row > .offset6 { + margin-left: 380px; +} +.row > .offset7 { + margin-left: 440px; +} +.row > .offset8 { + margin-left: 500px; +} +.row > .offset9 { + margin-left: 560px; +} +.row > .offset10 { + margin-left: 620px; +} +.row > .offset11 { + margin-left: 680px; +} +.row > .offset12 { + margin-left: 740px; +} +.span-one-third { + width: 300px; +} +.span-two-thirds { + width: 620px; +} +.row > .offset-one-third { + margin-left: 340px; +} +.row > .offset-two-thirds { + margin-left: 660px; +} +/* Typography.less + * Headings, body text, lists, code, and more for a versatile and durable typography system + * ---------------------------------------------------------------------------------------- */ + + +p { + font-size: 13px; + font-weight: normal; + line-height: 18px; + margin-bottom: 9px; +} +p small { + font-size: 11px; + color: #bfbfbf; +} + +h1, +h2, +h3, +h4, +h5, +h6 { + font-weight: bold; + color: #404040; +} +h1 small, +h2 small, +h3 small, +h4 small, +h5 small, +h6 small { + color: #bfbfbf; +} +h1 { + margin-bottom: 18px; + font-size: 30px; + line-height: 36px; +} +h1 small { + font-size: 18px; +} +h2 { + font-size: 24px; + line-height: 36px; +} +h2 small { + font-size: 14px; +} +h3, +h4, +h5, +h6 { + line-height: 36px; +} +h3 { + font-size: 18px; +} +h3 small { + font-size: 14px; +} +h4 { + font-size: 16px; +} +h4 small { + font-size: 12px; +} +h5 { + font-size: 14px; +} +h6 { + font-size: 13px; + color: #bfbfbf; + text-transform: uppercase; +} +ul, ol { + margin: 0 0 18px 25px; +} +ul ul, +ul ol, +ol ol, +ol ul { + margin-bottom: 0; +} +ul { + list-style: disc; +} +ol { + list-style: decimal; +} +li { + line-height: 18px; + color: #808080; +} +ul.unstyled { + list-style: none; + margin-left: 0; +} +dl { + margin-bottom: 18px; +} +dl dt, dl dd { + line-height: 18px; +} +dl dt { + font-weight: bold; +} +dl dd { + margin-left: 9px; +} +hr { + margin: 20px 0 19px; + border: 0; + border-bottom: 1px solid #eee; +} +strong { + font-style: inherit; + font-weight: bold; +} +em { + font-style: italic; + font-weight: inherit; + line-height: inherit; +} +.muted { + color: #bfbfbf; +} +blockquote { + margin-bottom: 18px; + border-left: 5px solid #eee; + padding-left: 15px; +} +blockquote p { + font-size: 14px; + font-weight: 300; + line-height: 18px; + margin-bottom: 0; +} +blockquote small { + display: block; + font-size: 12px; + font-weight: 300; + line-height: 18px; + color: #bfbfbf; +} +blockquote small:before { + content: '\2014 \00A0'; +} +address { + display: block; + line-height: 18px; + margin-bottom: 18px; +} +code, pre { + padding: 0 3px 2px; + font-family: Monaco, Andale Mono, Courier New, monospace; + font-size: 12px; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} +code { + background-color: #fee9cc; + color: rgba(0, 0, 0, 0.75); + padding: 1px 3px; +} +pre { + background-color: #f5f5f5; + display: block; + padding: 8.5px; + margin: 0 0 18px; + line-height: 18px; + font-size: 12px; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, 0.15); + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + white-space: pre; + white-space: pre-wrap; + word-wrap: break-word; +} +/* Forms.less + * Base styles for various input types, form layouts, and states + * ------------------------------------------------------------- */ +form { + margin-bottom: 18px; +} +fieldset { + margin-bottom: 18px; + padding-top: 18px; +} +fieldset legend { + display: block; + padding-left: 150px; + font-size: 19.5px; + line-height: 1; + color: #404040; + *padding: 0 0 5px 145px; + /* IE6-7 */ + + *line-height: 1.5; + /* IE6-7 */ + +} +form .clearfix { + margin-bottom: 18px; + zoom: 1; +} +form .clearfix:before, form .clearfix:after { + display: table; + content: ""; + zoom: 1; +} +form .clearfix:after { + clear: both; +} + +/* +label, +input, +select, +textarea { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 13px; + font-weight: normal; + line-height: normal; +} +label { + padding-top: 6px; + font-size: 13px; + line-height: 18px; + float: left; + width: 130px; + text-align: right; + color: #404040; +} +form .input { + margin-left: 150px; +} +input[type=checkbox], input[type=radio] { + cursor: pointer; +} +input, +textarea, +select, +.uneditable-input { + display: inline-block; + width: 210px; + height: 18px; + padding: 4px; + font-size: 13px; + line-height: 18px; + color: #808080; + border: 1px solid #ccc; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} +select { + padding: initial; +} +input[type=checkbox], input[type=radio] { + width: auto; + height: auto; + padding: 0; + margin: 3px 0; + *margin-top: 0; + + line-height: normal; + border: none; +} +input[type=file] { + background-color: #ffffff; + padding: initial; + border: initial; + line-height: initial; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; +} +input[type=button], input[type=reset], input[type=submit] { + width: auto; + height: auto; +} +select, input[type=file] { + height: 27px; + *height: auto; + line-height: 27px; + *margin-top: 4px; + +} +*/ +select[multiple] { + height: inherit; + background-color: #ffffff; +} +textarea { + height: auto; +} +.uneditable-input { + background-color: #ffffff; + display: block; + border-color: #eee; + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); + -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); + cursor: not-allowed; +} +:-moz-placeholder { + color: #bfbfbf; +} +::-webkit-input-placeholder { + color: #bfbfbf; +} +input, textarea { + -webkit-transition: border linear 0.2s, box-shadow linear 0.2s; + -moz-transition: border linear 0.2s, box-shadow linear 0.2s; + -ms-transition: border linear 0.2s, box-shadow linear 0.2s; + -o-transition: border linear 0.2s, box-shadow linear 0.2s; + transition: border linear 0.2s, box-shadow linear 0.2s; + -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1); + -moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1); + box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1); +} +input:focus, textarea:focus { + outline: 0; + border-color: rgba(82, 168, 236, 0.8); + -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6); + -moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6); + box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6); +} +input[type=file]:focus, input[type=checkbox]:focus, select:focus { + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; + outline: 1px dotted #666; +} +form .clearfix.error > label, form .clearfix.error .help-block, form .clearfix.error .help-inline { + color: #b94a48; +} +form .clearfix.error input, form .clearfix.error textarea { + color: #b94a48; + border-color: #ee5f5b; +} +form .clearfix.error input:focus, form .clearfix.error textarea:focus { + border-color: #e9322d; + -webkit-box-shadow: 0 0 6px #f8b9b7; + -moz-box-shadow: 0 0 6px #f8b9b7; + box-shadow: 0 0 6px #f8b9b7; +} +form .clearfix.error .input-prepend .add-on, form .clearfix.error .input-append .add-on { + color: #b94a48; + background-color: #fce6e6; + border-color: #b94a48; +} +form .clearfix.warning > label, form .clearfix.warning .help-block, form .clearfix.warning .help-inline { + color: #c09853; +} +form .clearfix.warning input, form .clearfix.warning textarea { + color: #c09853; + border-color: #ccae64; +} +form .clearfix.warning input:focus, form .clearfix.warning textarea:focus { + border-color: #be9a3f; + -webkit-box-shadow: 0 0 6px #e5d6b1; + -moz-box-shadow: 0 0 6px #e5d6b1; + box-shadow: 0 0 6px #e5d6b1; +} +form .clearfix.warning .input-prepend .add-on, form .clearfix.warning .input-append .add-on { + color: #c09853; + background-color: #d2b877; + border-color: #c09853; +} +form .clearfix.success > label, form .clearfix.success .help-block, form .clearfix.success .help-inline { + color: #468847; +} +form .clearfix.success input, form .clearfix.success textarea { + color: #468847; + border-color: #57a957; +} +form .clearfix.success input:focus, form .clearfix.success textarea:focus { + border-color: #458845; + -webkit-box-shadow: 0 0 6px #9acc9a; + -moz-box-shadow: 0 0 6px #9acc9a; + box-shadow: 0 0 6px #9acc9a; +} +form .clearfix.success .input-prepend .add-on, form .clearfix.success .input-append .add-on { + color: #468847; + background-color: #bcddbc; + border-color: #468847; +} +.input-mini, +input.mini, +textarea.mini, +select.mini { + width: 60px; +} +.input-small, +input.small, +textarea.small, +select.small { + width: 90px; +} +.input-medium, +input.medium, +textarea.medium, +select.medium { + width: 150px; +} +.input-large, +input.large, +textarea.large, +select.large { + width: 210px; +} +.input-xlarge, +input.xlarge, +textarea.xlarge, +select.xlarge { + width: 270px; +} +.input-xxlarge, +input.xxlarge, +textarea.xxlarge, +select.xxlarge { + width: 530px; +} +textarea.xxlarge { + overflow-y: auto; +} +input.span1, textarea.span1 { + display: inline-block; + float: none; + width: 30px; + margin-left: 0; +} +input.span2, textarea.span2 { + display: inline-block; + float: none; + width: 90px; + margin-left: 0; +} +input.span3, textarea.span3 { + display: inline-block; + float: none; + width: 150px; + margin-left: 0; +} +input.span4, textarea.span4 { + display: inline-block; + float: none; + width: 210px; + margin-left: 0; +} +input.span5, textarea.span5 { + display: inline-block; + float: none; + width: 270px; + margin-left: 0; +} +input.span6, textarea.span6 { + display: inline-block; + float: none; + width: 330px; + margin-left: 0; +} +input.span7, textarea.span7 { + display: inline-block; + float: none; + width: 390px; + margin-left: 0; +} +input.span8, textarea.span8 { + display: inline-block; + float: none; + width: 450px; + margin-left: 0; +} +input.span9, textarea.span9 { + display: inline-block; + float: none; + width: 510px; + margin-left: 0; +} +input.span10, textarea.span10 { + display: inline-block; + float: none; + width: 570px; + margin-left: 0; +} +input.span11, textarea.span11 { + display: inline-block; + float: none; + width: 630px; + margin-left: 0; +} +input.span12, textarea.span12 { + display: inline-block; + float: none; + width: 690px; + margin-left: 0; +} +input.span13, textarea.span13 { + display: inline-block; + float: none; + width: 750px; + margin-left: 0; +} +input.span14, textarea.span14 { + display: inline-block; + float: none; + width: 810px; + margin-left: 0; +} +input.span15, textarea.span15 { + display: inline-block; + float: none; + width: 870px; + margin-left: 0; +} +input.span16, textarea.span16 { + display: inline-block; + float: none; + width: 930px; + margin-left: 0; +} +input[disabled], +select[disabled], +textarea[disabled], +input[readonly], +select[readonly], +textarea[readonly] { + background-color: #f5f5f5; + border-color: #ddd; + cursor: not-allowed; +} +.actions { + background: #f5f5f5; + margin-top: 18px; + margin-bottom: 18px; + padding: 17px 20px 18px 150px; + border-top: 1px solid #ddd; + -webkit-border-radius: 0 0 3px 3px; + -moz-border-radius: 0 0 3px 3px; + border-radius: 0 0 3px 3px; +} +.actions .secondary-action { + float: right; +} +.actions .secondary-action a { + line-height: 30px; +} +.actions .secondary-action a:hover { + text-decoration: underline; +} +.help-inline, .help-block { + font-size: 13px; + line-height: 18px; + color: #bfbfbf; +} +.help-inline { + padding-left: 5px; + *position: relative; + /* IE6-7 */ + + *top: -5px; + /* IE6-7 */ + +} +.help-block { + display: block; + max-width: 600px; +} +.inline-inputs { + color: #808080; +} +.inline-inputs span { + padding: 0 2px 0 1px; +} +.input-prepend input, .input-append input { + -webkit-border-radius: 0 3px 3px 0; + -moz-border-radius: 0 3px 3px 0; + border-radius: 0 3px 3px 0; +} +.input-prepend .add-on, .input-append .add-on { + position: relative; + background: #f5f5f5; + border: 1px solid #ccc; + z-index: 2; + float: left; + display: block; + width: auto; + min-width: 16px; + height: 18px; + padding: 4px 4px 4px 5px; + margin-right: -1px; + font-weight: normal; + line-height: 18px; + color: #bfbfbf; + text-align: center; + text-shadow: 0 1px 0 #ffffff; + -webkit-border-radius: 3px 0 0 3px; + -moz-border-radius: 3px 0 0 3px; + border-radius: 3px 0 0 3px; +} +.input-prepend .active, .input-append .active { + background: #a9dba9; + border-color: #46a546; +} +.input-prepend .add-on { + *margin-top: 1px; + /* IE6-7 */ + +} +.input-append input { + float: left; + -webkit-border-radius: 3px 0 0 3px; + -moz-border-radius: 3px 0 0 3px; + border-radius: 3px 0 0 3px; +} +.input-append .add-on { + -webkit-border-radius: 0 3px 3px 0; + -moz-border-radius: 0 3px 3px 0; + border-radius: 0 3px 3px 0; + margin-right: 0; + margin-left: -1px; +} +.inputs-list { + margin: 0 0 5px; + width: 100%; +} +.inputs-list li { + display: block; + padding: 0; + width: 100%; +} +.inputs-list label { + display: block; + float: none; + width: auto; + padding: 0; + margin-left: 20px; + line-height: 18px; + text-align: left; + white-space: normal; +} +.inputs-list label strong { + color: #808080; +} +.inputs-list label small { + font-size: 11px; + font-weight: normal; +} +.inputs-list .inputs-list { + margin-left: 25px; + margin-bottom: 10px; + padding-top: 0; +} +.inputs-list:first-child { + padding-top: 6px; +} +.inputs-list li + li { + padding-top: 2px; +} +.inputs-list input[type=radio], .inputs-list input[type=checkbox] { + margin-bottom: 0; + margin-left: -20px; + float: left; +} +.form-stacked { + padding-left: 20px; +} +.form-stacked fieldset { + padding-top: 9px; +} +.form-stacked legend { + padding-left: 0; +} +.form-stacked label { + display: block; + float: none; + width: auto; + font-weight: bold; + text-align: left; + line-height: 20px; + padding-top: 0; +} +.form-stacked .clearfix { + margin-bottom: 9px; +} +.form-stacked .clearfix div.input { + margin-left: 0; +} +.form-stacked .inputs-list { + margin-bottom: 0; +} +.form-stacked .inputs-list li { + padding-top: 0; +} +.form-stacked .inputs-list li label { + font-weight: normal; + padding-top: 0; +} +.form-stacked div.clearfix.error { + padding-top: 10px; + padding-bottom: 10px; + padding-left: 10px; + margin-top: 0; + margin-left: -10px; +} +.form-stacked .actions { + margin-left: -20px; + padding-left: 20px; +} +/* + * Tables.less + * Tables for, you guessed it, tabular data + * ---------------------------------------- */ +table { + width: 100%; + margin-bottom: 18px; + padding: 0; + font-size: 13px; + border-collapse: collapse; +} +table th, table td { + padding: 10px 10px 9px; + line-height: 18px; + text-align: left; +} +table th { + padding-top: 9px; + font-weight: bold; + vertical-align: middle; +} +table td { + vertical-align: top; + border-top: 1px solid #ddd; +} +table tbody th { + border-top: 1px solid #ddd; + vertical-align: top; +} +.condensed-table th, .condensed-table td { + padding: 5px 5px 4px; +} +.bordered-table { + border: 1px solid #ddd; + border-collapse: separate; + *border-collapse: collapse; + /* IE7, collapse table to remove spacing */ + + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.bordered-table th + th, .bordered-table td + td, .bordered-table th + td { + border-left: 1px solid #ddd; +} +.bordered-table thead tr:first-child th:first-child, .bordered-table tbody tr:first-child td:first-child { + -webkit-border-radius: 4px 0 0 0; + -moz-border-radius: 4px 0 0 0; + border-radius: 4px 0 0 0; +} +.bordered-table thead tr:first-child th:last-child, .bordered-table tbody tr:first-child td:last-child { + -webkit-border-radius: 0 4px 0 0; + -moz-border-radius: 0 4px 0 0; + border-radius: 0 4px 0 0; +} +.bordered-table tbody tr:last-child td:first-child { + -webkit-border-radius: 0 0 0 4px; + -moz-border-radius: 0 0 0 4px; + border-radius: 0 0 0 4px; +} +.bordered-table tbody tr:last-child td:last-child { + -webkit-border-radius: 0 0 4px 0; + -moz-border-radius: 0 0 4px 0; + border-radius: 0 0 4px 0; +} +table .span1 { + width: 20px; +} +table .span2 { + width: 60px; +} +table .span3 { + width: 100px; +} +table .span4 { + width: 140px; +} +table .span5 { + width: 180px; +} +table .span6 { + width: 220px; +} +table .span7 { + width: 260px; +} +table .span8 { + width: 300px; +} +table .span9 { + width: 340px; +} +table .span10 { + width: 380px; +} +table .span11 { + width: 420px; +} +table .span12 { + width: 460px; +} +table .span13 { + width: 500px; +} +table .span14 { + width: 540px; +} +table .span15 { + width: 580px; +} +table .span16 { + width: 620px; +} +.zebra-striped tbody tr:nth-child(odd) td, .zebra-striped tbody tr:nth-child(odd) th { + background-color: #f9f9f9; +} +.zebra-striped tbody tr:hover td, .zebra-striped tbody tr:hover th { + background-color: #f5f5f5; +} +table .header { + cursor: pointer; +} +table .header:after { + content: ""; + float: right; + margin-top: 7px; + border-width: 0 4px 4px; + border-style: solid; + border-color: #000 transparent; + visibility: hidden; +} +table .headerSortUp, table .headerSortDown { + background-color: rgba(141, 192, 219, 0.25); + text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); +} +table .header:hover:after { + visibility: visible; +} +table .headerSortDown:after, table .headerSortDown:hover:after { + visibility: visible; + filter: alpha(opacity=60); + -khtml-opacity: 0.6; + -moz-opacity: 0.6; + opacity: 0.6; +} +table .headerSortUp:after { + border-bottom: none; + border-left: 4px solid transparent; + border-right: 4px solid transparent; + border-top: 4px solid #000; + visibility: visible; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; + filter: alpha(opacity=60); + -khtml-opacity: 0.6; + -moz-opacity: 0.6; + opacity: 0.6; +} +table .blue { + color: #049cdb; + border-bottom-color: #049cdb; +} +table .headerSortUp.blue, table .headerSortDown.blue { + background-color: #ade6fe; +} +table .green { + color: #46a546; + border-bottom-color: #46a546; +} +table .headerSortUp.green, table .headerSortDown.green { + background-color: #cdeacd; +} +table .red { + color: #9d261d; + border-bottom-color: #9d261d; +} +table .headerSortUp.red, table .headerSortDown.red { + background-color: #f4c8c5; +} +table .yellow { + color: #ffc40d; + border-bottom-color: #ffc40d; +} +table .headerSortUp.yellow, table .headerSortDown.yellow { + background-color: #fff6d9; +} +table .orange { + color: #f89406; + border-bottom-color: #f89406; +} +table .headerSortUp.orange, table .headerSortDown.orange { + background-color: #fee9cc; +} +table .purple { + color: #7a43b6; + border-bottom-color: #7a43b6; +} +table .headerSortUp.purple, table .headerSortDown.purple { + background-color: #e2d5f0; +} +/* Patterns.less + * Repeatable UI elements outside the base styles provided from the scaffolding + * ---------------------------------------------------------------------------- */ +.topbar { + height: 40px; + position: fixed; + top: 0; + left: 0; + right: 0; + z-index: 10000; + overflow: visible; +} +.topbar a { + color: #bfbfbf; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); +} +.topbar h3 a:hover, .topbar .brand:hover, .topbar ul .active > a { + background-color: #333; + background-color: rgba(255, 255, 255, 0.05); + color: #ffffff; + text-decoration: none; +} +.topbar h3 { + position: relative; +} +.topbar h3 a, .topbar .brand { + float: left; + display: block; + padding: 8px 20px 12px; + margin-left: -20px; + color: #ffffff; + font-size: 20px; + font-weight: 200; + line-height: 1; +} +.topbar p { + margin: 0; + line-height: 40px; +} +.topbar p a:hover { + background-color: transparent; + color: #ffffff; +} +.topbar form { + float: left; + margin: 5px 0 0 0; + position: relative; + filter: alpha(opacity=100); + -khtml-opacity: 1; + -moz-opacity: 1; + opacity: 1; +} +.topbar form.pull-right { + float: right; +} +.topbar input { + background-color: #444; + background-color: rgba(255, 255, 255, 0.3); + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: normal; + font-weight: 13px; + line-height: 1; + padding: 4px 9px; + color: #ffffff; + color: rgba(255, 255, 255, 0.75); + border: 1px solid #111; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 2px rgba(0... [truncated message content] |