Commit 7bf303db authored by Christoph Thelen's avatar Christoph Thelen

Minify JS files and package inside war archive

parent 1bf9e0f5
......@@ -4,8 +4,12 @@
<property name="sencha.dir" value="${lib.dir}/sencha1.1.1" />
<property name="build.dir" value="src/main/build" />
<target name="-build:init">
<mkdir dir="${build.dir}" />
</target>
<target name="-min:js:minify">
<apply executable="java" dest="${main.dir}/app">
<apply executable="java" dest="${main.dir}" failonerror="true">
<arg value="-jar"/>
<arg value="${lib.dir}/compiler.jar"/>
<arg value="--js"/>
......@@ -13,21 +17,40 @@
<arg value="--js_output_file"/>
<targetfile/>
<fileset dir="${main.dir}/app" includes="**/*.js" />
<fileset dir="${main.dir}">
<include name="**/*.js"/>
<!-- do not process Touch Charts - it throws errors! -->
<exclude name="**/*touch-charts-debug.js"/>
<exclude name="**/*touch-charts.js"/>
</fileset>
<mapper type="glob" from="*.js" to="*.js.min"/>
</apply>
</target>
<target name="-min:js:move" depends="-min:js:minify">
<move todir="${build.dir}" verbose="true">
<fileset dir="${main.dir}/app">
<fileset dir="${main.dir}">
<include name="**/*.js.min"/>
</fileset>
<mapper type="glob" from="*.min" to="*"/>
</move>
</target>
<target name="min:js" depends="-min:js:move" />
<target name="-assets:copy" depends="-build:init">
<copy todir="${build.dir}/resources">
<fileset dir="${main.dir}/resources" />
</copy>
<copy todir="${build.dir}">
<fileset dir="${main.dir}">
<include name="st2-index.html" />
<include name="st2-arsnova.manifest" />
<include name="favicon.png" />
<include name="WEB-INF/**" />
</fileset>
</copy>
</target>
<target name="min:js" depends="-build:init,-assets:copy,-min:js:move" />
<target name="min:css">
<java jar="${sencha.dir}/jsbuilder/ycompressor/ycompressor.jar" fork="true" failonerror="true" output="${main.dir}/resources/css/arsnova_min.css">
......
......@@ -54,6 +54,25 @@
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<phase>compile</phase>
<configuration>
<target>
<!-- ant target="min:css" /-->
<ant target="min:js" />
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
......@@ -68,16 +87,11 @@
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
<configuration>
<warSourceIncludes>
st2-index.html,
st2-developer.html,
resources/**,
screenshots/**,
app/**,
lib/**
</warSourceIncludes>
<warSourceDirectory>
src/main/build
</warSourceDirectory>
<webXml>
src/main/webapp/WEB-INF/web.xml
src/main/build/WEB-INF/web.xml
</webXml>
</configuration>
</plugin>
......
......@@ -25,7 +25,7 @@ Ext.define('ARSnova.view.Caption', {
this.listButton = Ext.create('ARSnova.view.MultiBadgeButton', {
ui : 'small',
text : "",
cls : 'forwardListButton caption',
cls : 'forwardListButton caption'
});
this.add([].concat(window.innerWidth > 320 ? [{
......
......@@ -39,11 +39,11 @@ Ext.define('ARSnova.view.FreetextAnswerPanel', {
freetextAnswerStore: null
},
constructor: function(arguments) {
this.callParent(arguments);
constructor: function(args) {
this.callParent(args);
this.questionObj = arguments.question;
this.lastPanel = arguments.lastPanel;
this.questionObj = args.question;
this.lastPanel = args.lastPanel;
var self = this;
this.checkFreetextAnswersTask = {
......
......@@ -30,11 +30,11 @@ Ext.define('ARSnova.view.FreetextDetailAnswer', {
}
},
constructor: function(arguments) {
this.callParent(arguments);
constructor: function(args) {
this.callParent(args);
this.answer = arguments.answer;
this.sTP = arguments.sTP;
this.answer = args.answer;
this.sTP = args.sTP;
var self = this;
......
......@@ -29,12 +29,12 @@ Ext.define('ARSnova.view.FreetextQuestion', {
}
},
constructor: function(arguments) {
this.callParent(arguments);
constructor: function(args) {
this.callParent(args);
var self = this;
this.questionObj = arguments.questionObj;
this.viewOnly = typeof arguments.viewOnly === "undefined" ? false : arguments.viewOnly;
this.questionObj = args.questionObj;
this.viewOnly = typeof args.viewOnly === "undefined" ? false : args.viewOnly;
this.on('preparestatisticsbutton', function(button) {
button.scope = this;
......
......@@ -33,10 +33,10 @@ Ext.define('ARSnova.view.QuestionStatusButton', {
questionIsOpenButton: null,
questionIsClosedButton: null,
constructor: function(arguments) {
this.callParent(arguments);
constructor: function(args) {
this.callParent(args);
this.questionObj = arguments.questionObj;
this.questionObj = args.questionObj;
this.questionIsClosedButton = Ext.create('Ext.Button', {
cls : 'closedSession',
......
......@@ -85,5 +85,5 @@ Ext.define('ARSnova.view.TextCheckfield', {
}
this.config.checked = !this.config.checked;
},
}
});
......@@ -226,7 +226,7 @@ Ext.define('ARSnova.view.feedback.StatisticPanel', {
color:0x6238A7,
size:8,
fill: 'blue'
},
}
}]
});
......
......@@ -38,10 +38,10 @@ Ext.define('ARSnova.view.feedbackQuestions.DetailsPanel', {
backButton : null,
questionObj : null,
constructor: function(arguments){
this.callParent(arguments);
constructor: function(args){
this.callParent(args);
this.questionObj = arguments.question;
this.questionObj = args.question;
this.backButton = Ext.create('Ext.Button', {
text : Messages.QUESTIONS,
......
......@@ -39,15 +39,13 @@ Ext.define('ARSnova.view.home.NewSessionPanel', {
toolbar : null,
backButton : null,
constructor: function(arguments) {
this.callParent(arguments);
constructor: function(args) {
this.callParent(args);
this.mycoursesStore = new Ext.data.JsonStore({
model: 'ARSnova.model.Course'
});
var mycoursesStore = this.mycoursesStore;
this.mycourses = Ext.create('Ext.List', {
store: this.mycoursesStore,
hidden: true,
......@@ -104,7 +102,7 @@ Ext.define('ARSnova.view.home.NewSessionPanel', {
this.add([this.toolbar, {
title: 'createSession',
style: {
marginTop: '15px',
marginTop: '15px'
},
xtype: 'formpanel',
scrollable: null,
......
......@@ -165,7 +165,7 @@ Ext.define('ARSnova.view.speaker.InClass', {
style : { marginTop: '50px' },
layout : {
type: 'hbox',
pack: 'center',
pack: 'center'
},
items: [
......
......@@ -75,11 +75,11 @@ Ext.define('ARSnova.view.speaker.QuestionDetailsPanel', {
interval: 20000 //20 seconds
},
constructor: function(arguments){
this.callParent(arguments);
constructor: function(args){
this.callParent(args);
var me = this;
this.questionObj = arguments.question;
this.questionObj = args.question;
if( this.questionObj.questionType == "yesno" ||
this.questionObj.questionType == "mc" ||
......
......@@ -58,11 +58,11 @@ Ext.define('ARSnova.view.speaker.QuestionStatisticChart', {
interval: 15000
},
constructor: function(arguments){
this.callParent(arguments);
constructor: function(args){
this.callParent(args);
this.questionObj = arguments.question;
this.lastPanel = arguments.lastPanel;
this.questionObj = args.question;
this.lastPanel = args.lastPanel;
this.questionStore = Ext.create('Ext.data.Store', {
fields: ['text', 'value', 'percent']
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment