promethee 1.2.5 → 1.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3990e672da334008485f049f367526eb7d1de150
|
4
|
+
data.tar.gz: 734e6bf4740e8921560d4f9d7d2996097171b987
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac9f482156241a315f378b62258e931d905543b4b74bdec8770cf44b09f65317fb2ec11cac484ec9b92f3e6735c9830d0b8de97b1e0021a9848d66f73dd98bd4
|
7
|
+
data.tar.gz: 35611d794ddf5c884e8ba4efd8b31e0785ecac3aca7d70d3bb579ee4ae40ffdfff538f62a3274f7cb1c6bd7e45f0230a0432433f285c97bb9489bd8ffe5baf62
|
@@ -52,6 +52,21 @@ var promethee = angular
|
|
52
52
|
|
53
53
|
return words[0] === '' ? 0 : words.length;
|
54
54
|
};
|
55
|
+
})
|
56
|
+
// Why doesn't this method just live in the adder controller ?
|
57
|
+
// Because the row component also need a special access to it in order to create cols with an id. So we make it global to the application.
|
58
|
+
.provider('identifier', function() {
|
59
|
+
this.$get = function() {
|
60
|
+
return {
|
61
|
+
// https://gist.github.com/gordonbrander/2230317
|
62
|
+
generate: function() {
|
63
|
+
// Math.random should be unique because of its seeding algorithm.
|
64
|
+
// Convert it to base 36 (numbers + letters), and grab the first 9 characters
|
65
|
+
// after the decimal.
|
66
|
+
return '' + Math.random().toString(36).substr(2, 9);
|
67
|
+
}
|
68
|
+
};
|
69
|
+
};
|
55
70
|
});
|
56
71
|
|
57
72
|
promethee.controller('PrometheeController', ['$scope', function($scope) {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<script type="text/ng-template" id="promethee/components/row/edit/write">
|
2
2
|
<div ng-controller="RowController"
|
3
3
|
ng-click="inspect(component, $event)"
|
4
|
-
class=" row
|
4
|
+
class=" row
|
5
5
|
promethee-edit__component
|
6
6
|
promethee-edit__component--row">
|
7
7
|
<div class="promethee-edit__component-selected" ng-class="{'promethee-edit__component-selected--visible': promethee.inspected === component}">
|
@@ -17,10 +17,11 @@
|
|
17
17
|
</script>
|
18
18
|
|
19
19
|
<script>
|
20
|
-
promethee.controller('RowController', ['$scope', function($scope) {
|
20
|
+
promethee.controller('RowController', ['$scope', 'identifier', function($scope, identifier) {
|
21
21
|
$scope.addColumn = function() {
|
22
22
|
this.component.children.push({
|
23
23
|
type: 'column',
|
24
|
+
id: identifier.generate(),
|
24
25
|
attributes: {
|
25
26
|
size: 4,
|
26
27
|
offset: 0
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<script type="text/javascript">
|
2
|
-
promethee.controller('AdderController', ['$scope', '$rootScope', 'definitions', function($scope, $rootScope, definitions) {
|
2
|
+
promethee.controller('AdderController', ['$scope', '$rootScope', 'definitions', 'identifier', function($scope, $rootScope, definitions, identifier) {
|
3
3
|
|
4
4
|
$scope.adding = false;
|
5
5
|
$scope.childrenToAddTo = null;
|
@@ -12,7 +12,7 @@ promethee.controller('AdderController', ['$scope', '$rootScope', 'definitions',
|
|
12
12
|
|
13
13
|
$scope.pushComponent = function(definition) {
|
14
14
|
var definition = angular.copy(definition.data);
|
15
|
-
definition.id =
|
15
|
+
definition.id = identifier.generate();
|
16
16
|
$scope.childrenToAddTo.push(definition);
|
17
17
|
$scope.close();
|
18
18
|
};
|
@@ -22,21 +22,13 @@ promethee.controller('AdderController', ['$scope', '$rootScope', 'definitions',
|
|
22
22
|
$scope.childrenToAddTo = components;
|
23
23
|
};
|
24
24
|
|
25
|
-
// https://gist.github.com/gordonbrander/2230317
|
26
|
-
$scope.createIdentifier = function () {
|
27
|
-
// Math.random should be unique because of its seeding algorithm.
|
28
|
-
// Convert it to base 36 (numbers + letters), and grab the first 9 characters
|
29
|
-
// after the decimal.
|
30
|
-
return '' + Math.random().toString(36).substr(2, 9);
|
31
|
-
};
|
32
|
-
|
33
25
|
}])
|
34
26
|
</script>
|
35
27
|
|
36
28
|
<div class="promethee-edit__write" ng-show="promethee.mode == 'write'">
|
37
29
|
<div ng-class="{ 'container-fluid': promethee.fullscreen }">
|
38
30
|
<div ng-init="component = promethee.data"
|
39
|
-
class=" promethee-edit__component
|
31
|
+
class=" promethee-edit__component
|
40
32
|
promethee-edit__component--page">
|
41
33
|
<ng-include src="'promethee/write/components'"></ng-include>
|
42
34
|
</div>
|