Skip to content

Commit

Permalink
Change hooks.js to hooks.html so it is only included once.
Browse files Browse the repository at this point in the history
  • Loading branch information
andrey-git committed Aug 30, 2017
1 parent d96849b commit 2931696
Show file tree
Hide file tree
Showing 10 changed files with 114 additions and 679 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
},
"scripts": {
"init": "yarn install",
"test": "eslint src/* panel/*",
"test": "eslint src/*",
"vulcanize": "node script/vulcanize.js",
"gzip": "gzip state-card-custom-ui.html -9fk",
"build": "npm run vulcanize && npm run gzip",
"deploy": "npm run test && npm run build && cp state-card-custom-ui.html* ~/.homeassistant/www/custom_ui/ && cp ha-panel-custom-ui.html* ~/.homeassistant/panels/",
"deploy_dev": "npm run test && rm -f ~/.homeassistant/www/custom_ui/*.gz ~/.homeassistant/panels/*.gz && cp src/* ~/.homeassistant/www/custom_ui/ && cp panel/* ~/.homeassistant/panels/",
"deploy": "npm run test && npm run build && cp state-card-custom-ui.html* ~/.homeassistant/www/custom_ui/",
"deploy_dev": "npm run test && rm -f ~/.homeassistant/www/custom_ui/* && cp src/* ~/.homeassistant/www/custom_ui/",
"fix_date": "script/fix_date.sh",
"release": "npm run test && npm run fix_date && npm run deploy"
},
Expand Down
2 changes: 1 addition & 1 deletion script/fix_date.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/bash
sed -i -r "s/(VERSION: ')[^']+/\1`date +%Y%m%d`/" src/hooks.js
sed -i -r "s/(VERSION: ')[^']+/\1`date +%Y%m%d`/" src/hooks.html
2 changes: 1 addition & 1 deletion script/vulcanize.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function vulcanizeEntry(entry) {
const haMain = homeAssistantPolymerPath + 'src/home-assistant.html';

copyHtmlSources('src/');
copyFile('src/hooks.js', 'build/hooks.js');
//copyFile('src/hooks.js', 'build/hooks.js');
//compileJs('src/hooks.js');

// Fetch all dependencies of main app and exclude them from panels
Expand Down
2 changes: 1 addition & 1 deletion src/ha-config-custom-ui.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script src="hooks.js"></script>
<link rel="import" href="hooks.html">

<dom-module id="ha-config-custom-ui">
<template>
Expand Down
5 changes: 0 additions & 5 deletions src/ha-themed-slider.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
<!-- This file assumes that the following are already imported by Homeassistant
<link rel='import' href='../../bower_components/polymer/polymer.html'>
<link rel='import' href='../../bower_components/paper-slider/paper-slider.html'>
-->

<dom-module id='ha-themed-slider'>
<template>
<style>
Expand Down
2 changes: 2 additions & 0 deletions src/hooks.js → src/hooks.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<script>
window.customUI = window.customUI || {
VERSION: '20170830',

Expand Down Expand Up @@ -280,3 +281,4 @@
};

window.customUI.init();
</script>
2 changes: 1 addition & 1 deletion src/state-card-custom-ui.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script src="hooks.js"></script>
<link rel="import" href="hooks.html">
<link rel="import" href="ha-config-custom-ui.html" async>
<link rel="import" href="state-card-with-slider.html" async>

Expand Down
2 changes: 1 addition & 1 deletion src/state-card-with-slider.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<!-- dynamic-element should be loaded syncronously so correct size can be measured on startup. -->
<link rel="import" href="dynamic-with-extra.html">
<script src="hooks.js"></script>
<link rel="import" href="hooks.html">

<dom-module id="state-card-with-slider">
<template>
Expand Down
Loading

0 comments on commit 2931696

Please sign in to comment.