promethee 1.2.20 → 1.2.21
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/promethee-edit.sass +43 -0
- data/app/views/promethee/_edit.html.erb +11 -5
- data/lib/promethee/rails/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b7c7244c1524f3d91a8406ee1f4f5b7a87c1153
|
4
|
+
data.tar.gz: dd59b976501c09befe08aa26ae1f17c95967b293
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bda68c297c84feb1a67c7ce30621da147a407758662c52285f8740ba2c1c31e48960be8de29d43af7f153895cdf3b9180a42bb8470f67fbe4b3e7a048106514c
|
7
|
+
data.tar.gz: d0d1c85a5b31860b15a7f9e73b449c2b014be7ff401a16255ed8c1e4db4fbe40264d580b38ed1866b9c77aa92ae0c14aca0e9804c7085ae31e7acc8e1756fdc6
|
@@ -7,6 +7,49 @@ $promethee-color: #ff9900 !default
|
|
7
7
|
@import 'promethee-edit/move'
|
8
8
|
@import 'promethee-edit/preview'
|
9
9
|
|
10
|
+
.promethee-open
|
11
|
+
$real-width: 300px
|
12
|
+
$real-height: 500px
|
13
|
+
$rendered-width: 1280px
|
14
|
+
$rendered-height: $real-height/$real-width*$rendered-width
|
15
|
+
$size-ratio: $real-width/$rendered-width
|
16
|
+
|
17
|
+
width: $real-width
|
18
|
+
height: $real-height
|
19
|
+
overflow: hidden
|
20
|
+
position: relative
|
21
|
+
display: inline-block
|
22
|
+
|
23
|
+
&, &::after, &__button, &__thumb-preview
|
24
|
+
cursor: pointer
|
25
|
+
|
26
|
+
&::after
|
27
|
+
content: ''
|
28
|
+
width: 100%
|
29
|
+
height: 100%
|
30
|
+
top: 0
|
31
|
+
left: 0
|
32
|
+
border: 2px solid #253742
|
33
|
+
box-sizing: border-box
|
34
|
+
position: absolute
|
35
|
+
display: block
|
36
|
+
|
37
|
+
&__button
|
38
|
+
background: #253742
|
39
|
+
padding: 10px
|
40
|
+
margin-bottom: 5px
|
41
|
+
display: block
|
42
|
+
text-align: center
|
43
|
+
color: #fff
|
44
|
+
|
45
|
+
&__thumb-preview
|
46
|
+
width: $rendered-width
|
47
|
+
height: $rendered-height
|
48
|
+
border: none
|
49
|
+
display: block
|
50
|
+
transform: scale(#{$size-ratio})
|
51
|
+
transform-origin: 0 0
|
52
|
+
|
10
53
|
.promethee-edit
|
11
54
|
background: white
|
12
55
|
position: fixed
|
@@ -43,12 +43,15 @@ promethee.controller('PrometheeController', ['$scope', function($scope) {
|
|
43
43
|
$scope.enablePreview = function() {
|
44
44
|
if (this.promethee.mode === 'preview') return;
|
45
45
|
this.promethee.mode = 'preview';
|
46
|
+
this.sendPreviewData('preview');
|
47
|
+
}
|
46
48
|
|
49
|
+
$scope.sendPreviewData = function(target) {
|
47
50
|
var form = document.createElement('form');
|
48
51
|
document.body.appendChild(form);
|
49
52
|
form.method = 'POST';
|
50
53
|
form.action = <%= promethee_preview_path.to_json.html_safe %>;
|
51
|
-
form.target =
|
54
|
+
form.target = target;
|
52
55
|
|
53
56
|
var input = document.createElement('input');
|
54
57
|
input.type = 'text';
|
@@ -64,6 +67,9 @@ promethee.controller('PrometheeController', ['$scope', function($scope) {
|
|
64
67
|
components.splice(index, 1);
|
65
68
|
}
|
66
69
|
|
70
|
+
$scope.promethee.data = <%= promethee_data.to_json.html_safe %>;
|
71
|
+
|
72
|
+
$scope.sendPreviewData('thumb-preview');
|
67
73
|
}]);
|
68
74
|
</script>
|
69
75
|
|
@@ -71,11 +77,11 @@ promethee.controller('PrometheeController', ['$scope', function($scope) {
|
|
71
77
|
id="promethee"
|
72
78
|
ng-app="Promethee"
|
73
79
|
ng-controller="PrometheeController as prometheeController"
|
74
|
-
|
75
|
-
>
|
80
|
+
>
|
76
81
|
|
77
|
-
<div class="
|
78
|
-
<span class="
|
82
|
+
<div class="promethee-open" ng-click="opened = true">
|
83
|
+
<span class="promethee-open__button">Open Prométhée Editor</span>
|
84
|
+
<iframe class="promethee-open__thumb-preview" id="thumb-preview"></iframe>
|
79
85
|
</div>
|
80
86
|
|
81
87
|
<div class="promethee-edit" ng-class="{'promethee-edit--closed': !opened}">
|