diff --git a/.gitignore b/.gitignore index 2c8d6334..776b260a 100644 --- a/.gitignore +++ b/.gitignore @@ -11,16 +11,11 @@ data/applicantFiles data/meetingFiles data/legislationFiles data/reports -data/Themes/Kirkwood/public/fn1 data/user *.mo .config .cache screen-*.css* +*-*.js build vendor -node_modules -gulpfile.js -.ftppass -.gulp-build -package.json diff --git a/Makefile b/Makefile index f60ae65e..44cdcebb 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,7 @@ APPNAME := onboard SASS := $(shell command -v sassc 2> /dev/null) MSGFMT := $(shell command -v msgfmt 2> /dev/null) LANGUAGES := $(wildcard language/*/LC_MESSAGES) +JAVASCRIPT := $(shell find public -name '*.js' ! -name '*-*.js') VERSION := $(shell cat VERSION | tr -d "[:space:]") @@ -22,12 +23,14 @@ clean: rm -Rf public/css/.sass-cache rm -Rf data/Themes/Kirkwood/public/css/.sass-cache - for f in $(shell find data/Themes -name 'screen-*.css*' ); do rm $$f; done - for f in $(shell find public/css -name 'screen-*.css*' ); do rm $$f; done + for f in $(shell find data/Themes -name 'screen-*.css*'); do rm $$f; done + for f in $(shell find public/css -name 'screen-*.css*'); do rm $$f; done + for f in $(shell find public/js -name '*-*.js' ); do rm $$f; done compile: deps $(LANGUAGES) cd public/css && sassc -t compact -m screen.scss screen-${VERSION}.css cd data/Themes/Kirkwood/public/css && sassc -t compact -m screen.scss screen-${VERSION}.css + for f in ${JAVASCRIPT}; do cp $$f $${f%.js}-${VERSION}.js; done package: [[ -d build ]] || mkdir build diff --git a/blocks/html/committees/history.inc b/blocks/html/committees/history.inc index 4a8885ee..eba278b1 100644 --- a/blocks/html/committees/history.inc +++ b/blocks/html/committees/history.inc @@ -1,12 +1,12 @@ history An array of CommitteeHistory objects */ use Blossom\Classes\Block; -$this->template->addToAsset('scripts', BASE_URI.'/js/changeLog.js'); +$this->template->addToAsset('scripts', BASE_URI.'/js/changeLog-'.VERSION.'.js'); ?>

_('committeeHistory'); ?>

diff --git a/blocks/html/people/list.inc b/blocks/html/people/list.inc index 7b909c73..cae53c83 100644 --- a/blocks/html/people/list.inc +++ b/blocks/html/people/list.inc @@ -1,7 +1,7 @@ people */ use Application\Models\Person; @@ -24,7 +24,7 @@ use Blossom\Classes\Url; $button = $helper->buttonLink($url, $this->_('person_choose'), 'choosePerson'); } elseif (isset($_REQUEST['callback'])) { - $this->template->addToAsset('scripts', BASE_URI.'/js/people/chooser.js'); + $this->template->addToAsset('scripts', BASE_URI.'/js/people/chooser-'.VERSION.'.js'); $callback = preg_replace('/[^a-zA-Z_\.]/', '', $_REQUEST['callback']); $url = "javascript:self.opener.$callback('{$person->getId()}');"; diff --git a/data/Themes/Kirkwood/templates/html/partials/header.inc b/data/Themes/Kirkwood/templates/html/partials/header.inc index e0e97cbb..b0c4f267 100644 --- a/data/Themes/Kirkwood/templates/html/partials/header.inc +++ b/data/Themes/Kirkwood/templates/html/partials/header.inc @@ -4,7 +4,7 @@

City of Bloomington, Indiana – John Hamilton, Mayor

addToAsset('scripts', BASE_URI.'/js/menus.js'); + $this->addToAsset('scripts', BASE_URI.'/js/menus-'.VERSION.'.js'); $this->_include('/partials/panel-widgets/user_menu.inc'); $this->_include('/partials/panel-widgets/admin_menu.inc'); diff --git a/templates/html/helpers/PersonChooser.php b/templates/html/helpers/PersonChooser.php index 1c9689f2..2c8788e4 100644 --- a/templates/html/helpers/PersonChooser.php +++ b/templates/html/helpers/PersonChooser.php @@ -41,7 +41,7 @@ public function __construct(Template $template) */ public function personChooser($fieldname, $fieldId, Person $person=null) { - $this->template->addToAsset('scripts', BASE_URI.'/js/people/chooser.js'); + $this->template->addToAsset('scripts', BASE_URI.'/js/people/chooser-'.VERSION.'.js'); $id = ''; $name = ''; diff --git a/templates/html/partials/head.inc b/templates/html/partials/head.inc index daf7c0e5..0299ad94 100644 --- a/templates/html/partials/head.inc +++ b/templates/html/partials/head.inc @@ -3,7 +3,7 @@ _include('partials/stylesheets.inc'); ?> <?= isset($this->title) ? self::escape($this->title) : APPLICATION_NAME; ?> -