diff --git a/.gitignore b/.gitignore index a86162b..5ae1286 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ /_site /_exclude *.sln -*.suo \ No newline at end of file +*.suo +Web.config \ No newline at end of file diff --git a/tools/coil/cache.manifest b/tools/coil/cache.manifest index b67d3df..4adebc3 100644 --- a/tools/coil/cache.manifest +++ b/tools/coil/cache.manifest @@ -1,7 +1,8 @@ CACHE MANIFEST # https://developer.mozilla.org/en/docs/HTML/Using_the_application_cache -# version 20140414 +# version 20140520-1 CACHE: +embed.html ../content/css/bootstrap.min.css ../content/js/angular.min.js ../content/js/ui-bootstrap-custom-tpls-0.10.0.min.js @@ -10,6 +11,8 @@ CACHE: ../content/fonts/glyphicons-halflings-regular.ttf ../content/fonts/glyphicons-halflings-regular.woff content/js/app.js +content/js/res.fr.json +content/js/res.en.json content/js/wire.json content/css/app.css content/img/apple-touch-icon.png @@ -18,4 +21,4 @@ content/img/apple-touch-icon-120x120.png content/img/apple-touch-icon-152x152.png # These are allowed to load when a connection is availiable NETWORK: -http://www.google-analytics.com/analytics.js \ No newline at end of file +* \ No newline at end of file diff --git a/tools/coil/content/css/app.css b/tools/coil/content/css/app.css index 285232d..ea93994 100644 --- a/tools/coil/content/css/app.css +++ b/tools/coil/content/css/app.css @@ -19,6 +19,11 @@ input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; } + +.navbar-brand { + font-size: small; +} + /* Mobile Overrides*/ @media (max-width: 768px) { .navbar { diff --git a/tools/coil/content/js/app.js b/tools/coil/content/js/app.js index 44926bc..3082c13 100644 --- a/tools/coil/content/js/app.js +++ b/tools/coil/content/js/app.js @@ -3,7 +3,45 @@ /* App Module */ var coilApp = angular.module("coil", ['ui.bootstrap', 'ui.bootstrap.collapse']); -coilApp.controller("CoilCtrl", function ($scope, $http, $filter) { +/* Modal Code */ +var ModalCtrl = function ($scope, $modalInstance, res) { + $scope.res = res; + $scope.ok = function () { + $modalInstance.close(); + }; +}; + +coilApp.controller("CoilCtrl", function ($scope, $http, $modal) { + + // Iframe behavior + $scope.iframe = (window.top !== window.self); + $scope.target = $scope.iframe ? "_blank" : "_self"; + + //#region Translations, + var supported = { "en": "en", "fr": "fr" }; + var current = navigator.language.substr(0, 2); + + $http.get("content/js/res." + (supported[current] || "fr") + ".json") + .success(function (data) { + $scope.res = angular.fromJson(data); + }); + //#endregion + + //#region Modal + $scope.embed = function() { + $modal.open({ + templateUrl: "embed.html", + controller: ModalCtrl, + size: 400, + resolve: { + res: function () { + return $scope.res; + } + } + }); + } + //#endregion + // default model $scope.model = { wire: { diff --git a/tools/coil/content/js/res.en.json b/tools/coil/content/js/res.en.json new file mode 100644 index 0000000..4baf1da --- /dev/null +++ b/tools/coil/content/js/res.en.json @@ -0,0 +1,25 @@ +{ + "ConsumptionTitle": "E-Liquid Consumption", + "CalculatorTitle" : "Micro-Coil Calculator ", + "Social" : "Sociaux Networks", + "EmbedLink" : "Embed", + "EmbedTitle" : "Propose it on your site", + "EmbedPreview" : "Preview", + + "WireType" : "Wire: Type", + "WireHeight" : "Wire: Height", + "WireWidth" : "Wire: Width", + "WireDiameter": "Wire: Diametre", + "CoilDiameter": "Coil: Diametre", + "CoilTurns" : "Coil: Turns", + "CoilFeet" : "Coil: Feet", + "Resistance" : "Resistance", + "Coefficient" : "Heating Coefficient", + "Power" : "Power", + "Amperes" : "Amperes", + "Voltage" : "Tension", + "CoilCount" : "Coil: Count", + "WireCount" : "Wire: Count", + "WireLength" : "Length of a Wire", + "CoilWidth" : "Width of a Coil" +} \ No newline at end of file diff --git a/tools/coil/content/js/res.fr.json b/tools/coil/content/js/res.fr.json new file mode 100644 index 0000000..e5407dc --- /dev/null +++ b/tools/coil/content/js/res.fr.json @@ -0,0 +1,25 @@ +{ + "ConsumptionTitle": "Consommation E-Liquide", + "CalculatorTitle" : "Calculateur Micro-Coil", + "Social" : "Réseaux Sociaux", + "EmbedLink" : "Intégrer", + "EmbedTitle" : "Proposez le sur votre site", + "EmbedPreview" : "Aperçu", + + "WireType" : "Fil: Type", + "WireHeight" : "Fil: Hauteur", + "WireWidth" : "Fil: Largeur", + "WireDiameter": "Fil: Diamètre", + "CoilDiameter": "Coil: Diamètre", + "CoilTurns" : "Coil: Spires", + "CoilFeet" : "Coil: Pattes", + "Resistance" : "Résistance", + "Coefficient" : "Coefficient de Chauffe", + "Power" : "Puissance", + "Amperes" : "Intensité", + "Voltage" : "Tension", + "CoilCount" : "Coil: Nombres", + "WireCount" : "Fils: Nombres", + "WireLength" : "Longeur d'un Fil", + "CoilWidth" : "Largeur d'une Coil" +} \ No newline at end of file diff --git a/tools/coil/embed.html b/tools/coil/embed.html new file mode 100644 index 0000000..4d94753 --- /dev/null +++ b/tools/coil/embed.html @@ -0,0 +1,10 @@ + + + \ No newline at end of file diff --git a/tools/coil/index.html b/tools/coil/index.html index 062a7b6..ec28ad1 100644 --- a/tools/coil/index.html +++ b/tools/coil/index.html @@ -55,36 +55,41 @@ - -
+ + + + +

- +
@@ -95,7 +100,7 @@
- +
{{ model.wire.height | number:2 }} @@ -103,7 +108,7 @@
- +
{{ model.wire.width | number:2 }} @@ -114,7 +119,7 @@
- +
{{ model.wire.width | number:2 }} @@ -125,7 +130,7 @@
- +
{{ model.coil.diameter | number:1 }} @@ -137,7 +142,7 @@
- +
{{ model.coil.turns }} @@ -148,7 +153,7 @@
- +
2x {{ model.coil.stubs }} @@ -164,21 +169,21 @@ - + - + - + - +
Résistance{{ res.Resistance }} {{ result.ohms | number:2 }} Ω
Coeff. de Chauffe{{ res.Coefficient }} {{ result.coeff | number:2 }} W/mm²
Puissance{{ res.Power }} {{ result.watts | number:2 }} W
Intensité{{ res.Amperes }} {{ result.amps | number:2 }} A
@@ -187,7 +192,7 @@
- +
{{ model.coil.volts | number:2 }} V @@ -198,7 +203,7 @@
- +
{{ model.coil.count }} @@ -206,7 +211,7 @@
- +
{{ model.wire.count }} @@ -221,17 +226,16 @@
- + - +
Longeur d'un Fil{{ res.WireLength }} {{ result.length | number:2 }} cm
Largeur d'une Coil{{ res.CoilWidth }} {{ result.width | number:2 }} cm
-
- +
@@ -243,7 +247,7 @@