promethee 1.0.14 → 1.0.15

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 015e43dd4219428e600f3d92561e7f3278337d69
4
- data.tar.gz: 8ad05e21264ef4945f3a811cb620932fbeeb4b97
3
+ metadata.gz: bf524320f8f8d60d0d5a4e335afb167c92bc4250
4
+ data.tar.gz: 7d9767e4312ed8f1cb76be8e9b4592903b19b32e
5
5
  SHA512:
6
- metadata.gz: 6ecbd712471d0692f881983a089d3b9d11ab0d86c6defdaa457f0fa846d5770d276063e41bf4615f1663a6c4c65206b9f8a1852311b3968b96805703e9df435f
7
- data.tar.gz: 1842b06180cb6df6c14e8e1a2e7bc145e1ffbdf46555f879960b704ffb867854ed2df8e3cc3a1578834c075bdfe89c50f98dcbbd284bd463562a9df08df0625d
6
+ metadata.gz: 5b20e829e0796d9ee3968a48ae899b07dd52ab470e89e755500d5e6c5d0a41c482cd3ac5057b6e2913e8de93d274e1e42a7b09904737b9e6d525646da4e7cec5
7
+ data.tar.gz: 43a6f69ad9e2e89efb355d6702292431f91f59418977d7eb21f6c7136964bc5d8e056cabc5a1ce10e2ccfc3683792b26c2f3ca701880a6353f501c7b334b5f33
@@ -4,10 +4,52 @@ promethee_data = Promethee::Data.new master_data
4
4
  %>
5
5
 
6
6
  <script>
7
+ var State = function(value) {
8
+ this.default = this.current = value;
9
+ };
10
+
11
+ State.prototype = {
12
+ get enabled() {
13
+ return !!this.current;
14
+ },
15
+
16
+ get disabled() {
17
+ return !this.enabled;
18
+ },
19
+
20
+ enable: function() {
21
+ this.set(true);
22
+ },
23
+
24
+ disable: function() {
25
+ this.set(false);
26
+ },
27
+
28
+ is: function(state) {
29
+ return this.current === state;
30
+ },
31
+
32
+ set: function(state) {
33
+ this.current = state
34
+ },
35
+
36
+ exit: function(state) {
37
+ if(this.is(state)) this.current = this.default;
38
+ },
39
+
40
+ toggle: function(state) {
41
+ if(arguments.length === 0) state = true;
42
+ this.is(state) ? this.exit(state) : this.set(state)
43
+ }
44
+ };
45
+
7
46
  var promethee = angular
8
47
  .module('Promethee', ['summernote', 'ngAnimate'])
9
48
  .value('data', <%= promethee_data.to_json.html_safe %>)
10
49
  .value('definitions', [])
50
+ .value('action', new State('write'))
51
+ .value('preview', new State('desktop'))
52
+ .value('fullscreen', new State(false))
11
53
  .config(function($rootScopeProvider) {
12
54
  $rootScopeProvider.digestTtl(20);
13
55
  })
@@ -28,7 +70,7 @@ promethee_data = Promethee::Data.new master_data
28
70
  };
29
71
  });
30
72
 
31
- promethee.controller('PrometheeController', ['data', '$scope', 'definitions', '$http', function(data, $scope, definitions, $http) {
73
+ promethee.controller('PrometheeController', ['data', '$scope', 'definitions', '$http', 'action', 'preview', 'fullscreen', function(data, $scope, definitions, $http, action, preview, fullscreen) {
32
74
 
33
75
  // Data (TODO use Adder and probably page definition to init)
34
76
  if(data === null || data === '') {
@@ -42,49 +84,10 @@ promethee_data = Promethee::Data.new master_data
42
84
 
43
85
  $scope.data = $scope.component = data;
44
86
 
45
- var State = function(value) {
46
- this.default = this.current = value;
47
- };
48
-
49
- State.prototype = {
50
- get enabled() {
51
- return !!this.current;
52
- },
53
-
54
- get disabled() {
55
- return !this.enabled;
56
- },
57
-
58
- enable: function() {
59
- this.set(true);
60
- },
61
-
62
- disable: function() {
63
- this.set(false);
64
- },
65
-
66
- is: function(state) {
67
- return this.current === state;
68
- },
69
-
70
- set: function(state) {
71
- this.current = state
72
- },
73
-
74
- exit: function(state) {
75
- if(this.is(state)) this.current = this.default;
76
- },
77
-
78
- toggle: function(state) {
79
- if(arguments.length === 0) state = true;
80
- this.is(state) ? this.exit(state) : this.set(state)
81
- }
82
- };
83
-
84
87
  // Application states
85
- $scope.action = new State('write');
86
- $scope.preview = new State('desktop');
87
- $scope.fullscreen = new State(false);
88
+ $scope.action = action;
89
+ $scope.preview = preview;
90
+ $scope.fullscreen = fullscreen;
88
91
 
89
92
  // $scope.enablePreview = function() {
90
93
  // this.preview = true;
@@ -3,7 +3,7 @@
3
3
  type="button"
4
4
  class="btn btn-default btn-block"
5
5
  ng-click="addComponentTo(data.children)"
6
- ng-hide="preview"
6
+ ng-hide="action.is('preview')"
7
7
  style="margin-bottom: 6px"
8
8
  >
9
9
  Add component
@@ -38,8 +38,9 @@
38
38
  </script>
39
39
 
40
40
  <script type="text/javascript">
41
- promethee.controller('AdderController', ['$scope', '$rootScope', 'definitions', function($scope, $rootScope, definitions) {
41
+ promethee.controller('AdderController', ['$scope', '$rootScope', 'definitions', 'action', function($scope, $rootScope, definitions, action) {
42
42
 
43
+ $scope.action = action;
43
44
  $scope.adding = false;
44
45
  $scope.childrenToAddTo = null;
45
46
  $scope.definitions = definitions;
@@ -1,5 +1,5 @@
1
1
  module Promethee
2
2
  module Rails
3
- VERSION = '1.0.14'
3
+ VERSION = '1.0.15'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: promethee
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.14
4
+ version: 1.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julien Dargelos