Skip to content
This repository has been archived by the owner on May 4, 2022. It is now read-only.

Commit

Permalink
Merge branch 'minifyPedigree' of https://github.com/mjshepherd/phenotips
Browse files Browse the repository at this point in the history
  • Loading branch information
sdumitriu committed Oct 5, 2015
2 parents 3f2ffc8 + 67d4b06 commit 8440fd4
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 9 deletions.
37 changes: 37 additions & 0 deletions components/pedigree/resources/pom.xml
Expand Up @@ -27,4 +27,41 @@
</parent>
<artifactId>pedigree-editor</artifactId>
<name>PhenoTips - Pedigree - JS and CSS Resources</name>
<build>
<plugins>
<plugin>
<groupId>com.github.bringking</groupId>
<artifactId>requirejs-maven-plugin</artifactId>
<version>2.0.4</version>
<executions>
<execution>
<goals>
<goal>optimize</goal>
</goals>
</execution>
</executions>
<configuration>
<!-- path to optimizer json config file(s) -->
<configFile>
src/main/resources/pedigree/requireConfigs/build.js
</configFile>
<!-- optional parameters to optimizer executable -->
<optimizerParameters>
</optimizerParameters>
<!--
Whether or not to process configFile with maven filters.
If you use this option, some options in your configFile
must resolve to absolute paths (see below)
-->
<filterConfig>
true
</filterConfig>
<!-- Skip requirejs optimization if true -->
<skip>
false
</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>
@@ -1,9 +1,4 @@
//Configures requireJS and starts the PedigreeEditor
require.config({
paths : {
pedigree : "$stringtool.substringBefore($xwiki.getSkinFile('uicomponents/pedigree/pedigree.js', true), 'pedigree.js')"
}
})

require(["pedigree/pedigree"], function (PedigreeEditor){
(XWiki && XWiki.domIsLoaded && new PedigreeEditor()) || document.observe("xwiki:dom:loaded", function(){new PedigreeEditor();});
Expand Down
@@ -0,0 +1,10 @@
({
mainConfigFile : '${basedir}/src/main/resources/pedigree/requireConfigs/optimizerConfig.js',
baseUrl: "${basedir}/src/main/resources/pedigree",
name : 'pedigreeApp',
out : '${basedir}/target/classes/pedigree/minified/pedigree.min.js',
//Do not minify prototype key variable "$super"
uglify: {
except: ["$super"]
}
})
@@ -0,0 +1,5 @@
require.config({
paths : {
pedigree : "../pedigree"
}
})
@@ -0,0 +1,5 @@
require.config({
paths : {
pedigree : "$stringtool.substringBefore($xwiki.getSkinFile('uicomponents/pedigree/pedigree.js', true), 'pedigree.js')"
}
});
Expand Up @@ -29,8 +29,8 @@
<parent>PhenoTips.WebHome</parent>
<author>xwiki:XWiki.Admin</author>
<contentAuthor>xwiki:XWiki.Admin</contentAuthor>
<date>1440701829000</date>
<contentUpdateDate>1440701602000</contentUpdateDate>
<date>1440795631000</date>
<contentUpdateDate>1440795601000</contentUpdateDate>
<version>1.1</version>
<title>Pedigree editor#if ($request.id): $request.id#end</title>
<comment/>
Expand All @@ -46,8 +46,12 @@ $xwiki.ssx.use('XWiki.DateTimePicker')##
$xwiki.jsx.use('PhenoTips.Widgets')##
$xwiki.ssx.use('PhenoTips.Widgets')##
$xwiki.ssfx.use('uicomponents/pedigree/editor.css', true)##
$xwiki.jsfx.use('uicomponents/pedigree/pedigreeApp.js', true)##

$xwiki.jsfx.use('uicomponents/pedigree/requireConfigs/runtimeConfig.js', true)##
#if ($request.getParameter('minify') == 'false')
$xwiki.jsfx.use('uicomponents/pedigree/pedigreeApp.js', true)##
#else
$xwiki.jsfx.use('uicomponents/pedigree/minified/pedigree.min.js', true)##
#end
{{/velocity}}

{{html}}
Expand Down

0 comments on commit 8440fd4

Please sign in to comment.