This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eventWebXmlEnd = { String tmpfile -> | |
def contextParam = '''<context-param> | |
<description>Spring Expression Language Support</description> | |
<param-name>springJspExpressionSupport</param-name> | |
<param-value>false</param-value> | |
</context-param>''' | |
def root = new XmlParser().parse(webXmlFile) | |
root.children().add(0, new XmlParser().parseText(contextParam)) | |
new XmlNodePrinter(new PrintWriter(new FileWriter(webXmlFile))).print(root) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eventCreateWarStart = { warName, stagingDir -> | |
def curDir = new File('Scripts'); | |
ant.exec(outputproperty: "cmdOut", errorproperty: "cmdErr", resultproperty: "cmdExit", failonerror: "false", executable: "java") { | |
arg(line: "-cp ${new File(curDir, 'js.jar').absolutePath}") | |
arg(line: "org.mozilla.javascript.tools.shell.Main") | |
arg(line: "${new File(curDir, 'r.js').absolutePath}") | |
arg(line: "-o") | |
arg(line: "name=bootstrap") | |
arg(line: "baseUrl=${stagingDir}/js") | |
arg(line: "out=${stagingDir}/js/bootstrap-build.js") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="js/lib/require-2.1.2.js" | |
data-main="js/bootstrap${grailsApplication.isWarDeployed() ? '-build' : ''}"> | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define('view/person', ['domain/person', 'jQuery', 'window'], function(Person, $, Win) { | |
var person = Person.createPerson(); | |
return { | |
showPerson: function() { | |
$('#person-div').html(person.name); | |
Win.alert('Person updated!'); | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<a onclick="view.person.showPerson(); return false;">Show person</a> | |
<div id="person-div"></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.all('/:controller/:action/:id?', function(req, res) { | |
require(['app/controller/' + req.params.controller], function(Controller) { | |
Controller[req.params.action](req, res); | |
}); | |
}); | |
app.all('/:controller', function(req, res) { | |
require(['app/controller/' + req.params.controller], function(Controller) { | |
Controller.index(req, res); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UrlMappings.config.forEach(function(mapping) { | |
app[mapping.verb](mapping.route, function(req, res) { | |
require(['app/controller/' + mapping.controller], function(Controller) { | |
Controller[mapping.action](req, res); | |
}); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<r:require module="test_dialog"/> | |
<div id="test-dialog" title="Test Dialog"> | |
<div class="test-dialog-content"> | |
This is a test. | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
modules = { | |
application { | |
resource url:'js/application.js' | |
} | |
test_dialog { | |
dependsOn 'jquery, jquery-ui' | |
resource url:'css/testDialog.css' | |
resource url:'js/testDialog.js' | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.test-dialog-content { | |
font-weight: normal; | |
color: red; | |
} |