Commit 195f7e6c authored by Xavier Guimard's avatar Xavier Guimard

Propage minifier to portal (#908)

parent 0b610b5b
......@@ -469,6 +469,26 @@ install_portal_site: install_conf_dir
@cp -pR -f ${SRCPORTALDIR}/example/cdc.pl ${RPORTALDIR}
@cp -pR -f ${SRCPORTALDIR}/example/register.pl ${RPORTALDIR}
@tar -cf - -C ${SRCPORTALDIR}/example/skins/ $$(ls ${SRCPORTALDIR}/example/skins/) |tar -xf - -C $(RPORTALSKINSDIR)
@for f in `find $(RPORTALSKINSDIR) -type f -name '*.tpl'`; do \
./scripts/transform-templates jsminified $(JSCOMPRESS) cssminified $(CSSCOMPRESS) <$$f >$$f.tmp; \
mv -f $$f.tmp $$f; \
done
@if test "$(CSSCOMPRESS)" = "yes"; then \
for f in `find $(RPORTALSKINSDIR) -type f -name '*.css'`; do \
if test "$${f%%.min.css}" = "$$f"; then \
echo "Compressing $$f"; \
yui-compressor $$f >$${f%%.css}.min.css; \
fi; \
done; \
fi
@if test "$(JSCOMPRESS)" = "yes"; then \
for f in `find $(RPORTALSKINSDIR) -type f -name '*.js'`; do \
if test "$${f%%.min.js}" = "$$f"; then \
echo "Compressing $$f"; \
yui-compressor $$f >$${f%%.js}.min.js; \
fi; \
done; \
fi
@if [ "$(PORTALDIR)/skins/" != "$(PORTALSKINSDIR)/" ]; then \
for skin in $$(ls $(SRCPORTALDIR)/example/skins/); do \
rm -rf $(RPORTALDIR)/skins/$$skin/; \
......
......@@ -168,14 +168,14 @@
<TMPL_INCLUDE NAME="scripts.tpl">
<!-- //if:jsminified
<script type="text/javascript" src="<TMPL_VAR NAME="STATIC_PREFIX">js/conftree.min.js"></script>
<script type="text/javascript" src="<TMPL_VAR NAME="STATIC_PREFIX">js/filterFunctions.min.js"></script>
<script type="text/javascript" src="<TMPL_VAR NAME="STATIC_PREFIX">js/manager.min.js"></script>
//else -->
<script type="text/javascript" src="<TMPL_VAR NAME="STATIC_PREFIX">js/conftree.js"></script>
<script type="text/javascript" src="<TMPL_VAR NAME="STATIC_PREFIX">js/filterFunctions.js"></script>
<script type="text/javascript" src="<TMPL_VAR NAME="STATIC_PREFIX">js/manager.js"></script>
<!-- //endif -->
<!-- //if:jsminified
<script type="text/javascript" src="<TMPL_VAR NAME="STATIC_PREFIX">js/conftree.min.js"></script>
<script type="text/javascript" src="<TMPL_VAR NAME="STATIC_PREFIX">js/filterFunctions.min.js"></script>
<script type="text/javascript" src="<TMPL_VAR NAME="STATIC_PREFIX">js/manager.min.js"></script>
//else -->
<script type="text/javascript" src="<TMPL_VAR NAME="STATIC_PREFIX">js/conftree.js"></script>
<script type="text/javascript" src="<TMPL_VAR NAME="STATIC_PREFIX">js/filterFunctions.js"></script>
<script type="text/javascript" src="<TMPL_VAR NAME="STATIC_PREFIX">js/manager.js"></script>
<!-- //endif -->
<TMPL_INCLUDE NAME="footer.tpl">
......@@ -133,10 +133,10 @@
<TMPL_INCLUDE NAME="scripts.tpl">
<!-- //if:jsminified
<script type="text/javascript" src="<TMPL_VAR NAME="STATIC_PREFIX">js/notifications.min.js"></script>
//else -->
<script type="text/javascript" src="<TMPL_VAR NAME="STATIC_PREFIX">js/notifications.js"></script>
<!-- //endif -->
<!-- //if:jsminified
<script type="text/javascript" src="<TMPL_VAR NAME="STATIC_PREFIX">js/notifications.min.js"></script>
//else -->
<script type="text/javascript" src="<TMPL_VAR NAME="STATIC_PREFIX">js/notifications.js"></script>
<!-- //endif -->
<TMPL_INCLUDE NAME="footer.tpl">
......@@ -111,10 +111,10 @@
<TMPL_INCLUDE NAME="scripts.tpl">
<!-- //if:jsminified
<script type="text/javascript" src="<TMPL_VAR NAME="STATIC_PREFIX">js/sessions.min.js"></script>
//else -->
<script type="text/javascript" src="<TMPL_VAR NAME="STATIC_PREFIX">js/sessions.js"></script>
<!-- //endif -->
<!-- //if:jsminified
<script type="text/javascript" src="<TMPL_VAR NAME="STATIC_PREFIX">js/sessions.min.js"></script>
//else -->
<script type="text/javascript" src="<TMPL_VAR NAME="STATIC_PREFIX">js/sessions.js"></script>
<!-- //endif -->
<TMPL_INCLUDE NAME="footer.tpl">
......@@ -65,7 +65,11 @@
<p id="timer"><lang en="Automatically accept in 5 seconds" fr="Acceptation automatique dans 5 secondes"/></p>
</div>
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/confirm.js"></script>
<!-- //if:jsminified
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/confirm.min.js"></script>
//else -->
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/confirm.js"></script>
<!-- //endif -->
</TMPL_IF>
<div class="buttons">
......
......@@ -9,9 +9,15 @@
<TMPL_IF NAME="browserIdEnabled">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
</TMPL_IF>
<!-- //if:cssminified
<link href="<TMPL_VAR NAME="SKIN_PATH">/<TMPL_VAR NAME="SKIN">/css/bootstrap.min.css" rel="stylesheet">
<link href="<TMPL_VAR NAME="SKIN_PATH">/<TMPL_VAR NAME="SKIN">/css/bootstrap-theme.min.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="<TMPL_VAR NAME="SKIN_PATH">/<TMPL_VAR NAME="SKIN">/css/styles.min.css" />
//else -->
<link href="<TMPL_VAR NAME="SKIN_PATH">/<TMPL_VAR NAME="SKIN">/css/bootstrap.css" rel="stylesheet">
<link href="<TMPL_VAR NAME="SKIN_PATH">/<TMPL_VAR NAME="SKIN">/css/bootstrap-theme.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="<TMPL_VAR NAME="SKIN_PATH">/<TMPL_VAR NAME="SKIN">/css/styles.css" />
<!-- //endif -->
<TMPL_INCLUDE NAME="../common/background.tpl">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
......@@ -26,9 +32,15 @@
<link rel="openid2.provider" href="<TMPL_VAR NAME="PROVIDERURI">" />
</TMPL_IF>
<TMPL_INCLUDE NAME="../common/script.tpl">
<script src="<TMPL_VAR NAME="SKIN_PATH">/<TMPL_VAR NAME="SKIN">/js/skin.js"></script>
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/portal.js"></script>
<script src="<TMPL_VAR NAME="SKIN_PATH">/<TMPL_VAR NAME="SKIN">/js/bootstrap.js"></script>
<!-- //if:jsminified
<script src="<TMPL_VAR NAME="SKIN_PATH">/<TMPL_VAR NAME="SKIN">/js/skin.min.js"></script>
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/portal.min.js"></script>
<script src="<TMPL_VAR NAME="SKIN_PATH">/<TMPL_VAR NAME="SKIN">/js/bootstrap.min.js"></script>
//else -->
<script src="<TMPL_VAR NAME="SKIN_PATH">/<TMPL_VAR NAME="SKIN">/js/skin.js"></script>
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/portal.js"></script>
<script src="<TMPL_VAR NAME="SKIN_PATH">/<TMPL_VAR NAME="SKIN">/js/bootstrap.js"></script>
<!-- //endif -->
<TMPL_INCLUDE NAME="customhead.tpl">
</head>
<body>
......
......@@ -29,7 +29,11 @@
</button>
</div>
</form>
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/info.js"></script>
<!-- //if:jsminified
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/info.min.js"></script>
//else -->
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/info.js"></script>
<!-- //endif -->
</div>
......
<!-- Load javascript common to all skins -->
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/jquery-1.10.2.js"></script>
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/jquery-ui-1.10.3.custom.js"></script>
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/jquery.base64.js"></script>
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/jquery.cookie.js"></script>
<!-- //if:jsminified
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/jquery-ui-1.10.3.custom.min.js"></script>
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/jquery.base64.min.js"></script>
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/jquery.cookie.min.js"></script>
//else -->
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/jquery-1.10.2.js"></script>
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/jquery-ui-1.10.3.custom.js"></script>
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/jquery.base64.js"></script>
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/jquery.cookie.js"></script>
<!-- //endif -->
<TMPL_IF NAME="browserIdEnabled">
<script src="https://login.persona.org/include.js"></script>
<!-- //if:jsminified
<script src="https://login.persona.org/include.min.js"></script>
//else -->
<script src="https://login.persona.org/include.js"></script>
<!-- //endif -->
</TMPL_IF>
<TMPL_IF NAME="browserIdLoadLoginScript">
<script type="text/javascript">//<![CDATA[
......@@ -13,12 +24,22 @@
var browserIdBackgroundColor="<TMPL_VAR NAME="browserIdBackgroundColor">";
var browserIdAutoLogin="<TMPL_VAR NAME="browserIdAutoLogin">";
//]]></script>
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/browserid.js"></script>
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/browseridlogin.js"></script>
<!-- //if:jsminified
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/browserid.min.js"></script>
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/browseridlogin.min.js"></script>
//else -->
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/browserid.js"></script>
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/browseridlogin.js"></script>
<!-- //endif -->
</TMPL_IF>
<TMPL_IF NAME="browserIdLoadLogoutScript">
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/browserid.js"></script>
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/browseridlogout.js"></script>
<!-- //if:jsminified
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/browserid.min.js"></script>
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/browseridlogout.min.js"></script>
//else -->
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/browserid.js"></script>
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/browseridlogout.js"></script>
<!-- //endif -->
</TMPL_IF>
<script type="text/javascript">//<![CDATA[
var displaytab="<TMPL_VAR NAME="DISPLAY_TAB">";
......
......@@ -10,7 +10,11 @@
<TMPL_UNLESS NAME="LIST"><TMPL_IF NAME="ACTIVE_TIMER">
<p id="timer" class="text-error"><lang en="Automaticaly accept in 5 seconds" fr="Acceptation automatique dans 5 secondes"/></p>
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/info.js"></script>
<!-- //if:jsminified
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/info.min.js"></script>
//else -->
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/info.js"></script>
<!-- //endif -->
</TMPL_IF></TMPL_UNLESS>
<form id="form" action="#" method="<TMPL_VAR NAME="FORM_METHOD">" class="login">
......
......@@ -10,7 +10,11 @@
<TMPL_IF NAME="browserIdEnabled">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
</TMPL_IF>
<link rel="stylesheet" type="text/css" href="<TMPL_VAR NAME="SKIN_PATH">/<TMPL_VAR NAME="SKIN">/css/styles.css" />
<!-- //if:cssminified
<link rel="stylesheet" type="text/css" href="<TMPL_VAR NAME="SKIN_PATH">/<TMPL_VAR NAME="SKIN">/css/styles.min.css" />
//else -->
<link rel="stylesheet" type="text/css" href="<TMPL_VAR NAME="SKIN_PATH">/<TMPL_VAR NAME="SKIN">/css/styles.css" />
<!-- //endif -->
<TMPL_INCLUDE NAME="../common/background.tpl">
<link href="<TMPL_VAR NAME="SKIN_PATH">/common/favicon.ico" rel="icon" type="image/vnd.microsoft.icon" sizes="16x16 32x32 48x48 64x64 128x128" />
<link href="<TMPL_VAR NAME="SKIN_PATH">/common/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" sizes="16x16 32x32 48x48 64x64 128x128" />
......@@ -19,7 +23,11 @@
<link rel="openid2.provider" href="<TMPL_VAR NAME="PROVIDERURI">" />
</TMPL_IF>
<TMPL_INCLUDE NAME="../common/script.tpl">
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/portal.js"></script>
<!-- //if:jsminified
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/portal.min.js"></script>
//else -->
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/portal.js"></script>
<!-- //endif -->
<TMPL_INCLUDE NAME="customhead.tpl">
</head>
<body>
......
......@@ -28,7 +28,11 @@
</div>
</div>
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/info.js"></script>
<!-- //if:jsminified
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/info.min.js"></script>
//else -->
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/info.js"></script>
<!-- //endif -->
<TMPL_INCLUDE NAME="footer.tpl">
......@@ -41,7 +41,11 @@
<TMPL_IF NAME="ACTIVE_TIMER">
<p id="timer"><lang en="Automatically accept in 5 seconds" fr="Acceptation automatique dans 5 secondes"/></p>
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/info.js"></script>
<!-- //if:jsminified
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/info.min.js"></script>
//else -->
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/info.js"></script>
<!-- //endif -->
</TMPL_IF>
<table><tr><td>
......
......@@ -10,7 +10,11 @@
<TMPL_IF NAME="browserIdEnabled">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
</TMPL_IF>
<link rel="stylesheet" type="text/css" href="<TMPL_VAR NAME="SKIN_PATH">/<TMPL_VAR NAME="SKIN">/css/styles.css" />
<!-- //if:cssminified
<link rel="stylesheet" type="text/css" href="<TMPL_VAR NAME="SKIN_PATH">/<TMPL_VAR NAME="SKIN">/css/styles.min.css" />
//else -->
<link rel="stylesheet" type="text/css" href="<TMPL_VAR NAME="SKIN_PATH">/<TMPL_VAR NAME="SKIN">/css/styles.css" />
<!-- //endif -->
<TMPL_INCLUDE NAME="../common/background.tpl">
<link href="<TMPL_VAR NAME="SKIN_PATH">/common/favicon.ico" rel="icon" type="image/vnd.microsoft.icon" sizes="16x16 32x32 48x48 64x64 128x128" />
<link href="<TMPL_VAR NAME="SKIN_PATH">/common/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" sizes="16x16 32x32 48x48 64x64 128x128" />
......@@ -19,7 +23,11 @@
<link rel="openid2.provider" href="<TMPL_VAR NAME="PROVIDERURI">" />
</TMPL_IF>
<TMPL_INCLUDE NAME="../common/script.tpl">
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/portal.js"></script>
<!-- //if:jsminified
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/portal.min.js"></script>
//else -->
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/portal.js"></script>
<!-- //endif -->
<TMPL_INCLUDE NAME="customhead.tpl">
</head>
<body>
......
......@@ -26,7 +26,11 @@
</div>
</td></tr></tbody></table>
</form>
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/info.js"></script>
<!-- //if:jsminified
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/info.min.js"></script>
//else -->
<script type="text/javascript" src="<TMPL_VAR NAME="SKIN_PATH">/common/js/info.js"></script>
<!-- //endif -->
</div>
......
......@@ -10,14 +10,17 @@ for ( my $i = 0 ; $i < @ARGV ; $i += 2 ) {
}
while (<STDIN>) {
if (m#//endif#) {
$cond = 1;
if (m#//if:(\w+)#) {
$cond = $args{$1};
}
elsif (m#//elsif:(\w+)# and not $cond) {
$cond = $args{$1};
}
elsif (m#//else#) {
$cond = !$cond;
}
elsif (m#//if:(\w+)#) {
$cond = $args{$1};
elsif (m#//endif#) {
$cond = 1;
}
else {
print if ($cond);
......
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