pageflow-internal-links 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +15 -0
  2. data/.gitignore +22 -0
  3. data/.jshintrc +22 -0
  4. data/CHANGELOG.md +7 -0
  5. data/Gemfile +10 -0
  6. data/README.md +63 -0
  7. data/Rakefile +7 -0
  8. data/app/assets/images/pageflow/internal_links_grid_pictogram.png +0 -0
  9. data/app/assets/images/pageflow/internal_links_grid_pictogram_small.png +0 -0
  10. data/app/assets/images/pageflow/internal_links_grid_sprite.png +0 -0
  11. data/app/assets/images/pageflow/internal_links_list_pictogram.png +0 -0
  12. data/app/assets/images/pageflow/internal_links_list_pictogram_small.png +0 -0
  13. data/app/assets/images/pageflow/internal_links_list_sprite.png +0 -0
  14. data/app/assets/images/pageflow/ov-internal_links_grid.png +0 -0
  15. data/app/assets/javascripts/pageflow/internal_links/editor/collections/grid_page_links_collection.js +20 -0
  16. data/app/assets/javascripts/pageflow/internal_links/editor/collections/list_page_links_collection.js +12 -0
  17. data/app/assets/javascripts/pageflow/internal_links/editor/collections/page_links_collection.js +90 -0
  18. data/app/assets/javascripts/pageflow/internal_links/editor/config.js +45 -0
  19. data/app/assets/javascripts/pageflow/internal_links/editor/controllers/side_bar_controller.js +14 -0
  20. data/app/assets/javascripts/pageflow/internal_links/editor/models/page_configuration_mixin.js +19 -0
  21. data/app/assets/javascripts/pageflow/internal_links/editor/models/page_link.js +35 -0
  22. data/app/assets/javascripts/pageflow/internal_links/editor/routers/side_bar_router.js +5 -0
  23. data/app/assets/javascripts/pageflow/internal_links/editor/templates/edit_page_link.jst.ejs +3 -0
  24. data/app/assets/javascripts/pageflow/internal_links/editor/templates/grid_item_embedded.jst.ejs +4 -0
  25. data/app/assets/javascripts/pageflow/internal_links/editor/templates/list_item_embedded.jst.ejs +7 -0
  26. data/app/assets/javascripts/pageflow/internal_links/editor/views/edit_page_link_view.js +67 -0
  27. data/app/assets/javascripts/pageflow/internal_links/editor/views/editable_links_mode_view.js +10 -0
  28. data/app/assets/javascripts/pageflow/internal_links/editor/views/grid_configuration_editor_view.js +30 -0
  29. data/app/assets/javascripts/pageflow/internal_links/editor/views/grid_item_embedded_view.js +227 -0
  30. data/app/assets/javascripts/pageflow/internal_links/editor/views/list_configuration_editor_view.js +29 -0
  31. data/app/assets/javascripts/pageflow/internal_links/editor/views/list_embedded_view.js +23 -0
  32. data/app/assets/javascripts/pageflow/internal_links/editor/views/list_item_embedded_view.js +103 -0
  33. data/app/assets/javascripts/pageflow/internal_links/editor/views/page_link_embedded_view.js +106 -0
  34. data/app/assets/javascripts/pageflow/internal_links/editor.js +11 -0
  35. data/app/assets/javascripts/pageflow/internal_links/grid_page_type.js +31 -0
  36. data/app/assets/javascripts/pageflow/internal_links/list_page_type.js +29 -0
  37. data/app/assets/javascripts/pageflow/internal_links.js +2 -0
  38. data/app/assets/stylesheets/pageflow/internal_links/editor/embedded_grid_item.css.scss +118 -0
  39. data/app/assets/stylesheets/pageflow/internal_links/editor/embedded_list_item.scss +33 -0
  40. data/app/assets/stylesheets/pageflow/internal_links/editor.css.scss +2 -0
  41. data/app/assets/stylesheets/pageflow/internal_links/grid.scss +230 -0
  42. data/app/assets/stylesheets/pageflow/internal_links/list.scss +76 -0
  43. data/app/assets/stylesheets/pageflow/internal_links.css.scss +2 -0
  44. data/app/helpers/pageflow/internal_links/grid_helper.rb +50 -0
  45. data/app/helpers/pageflow/internal_links/list_helper.rb +10 -0
  46. data/app/helpers/pageflow/internal_links/page_links.rb +79 -0
  47. data/app/views/pageflow/internal_links/grid/_grid.html.erb +7 -0
  48. data/app/views/pageflow/internal_links/grid/page.html.erb +25 -0
  49. data/app/views/pageflow/internal_links/list/_list.html.erb +6 -0
  50. data/app/views/pageflow/internal_links/list/_page_link.html.erb +14 -0
  51. data/app/views/pageflow/internal_links/list/page.html.erb +26 -0
  52. data/config/locales/de.yml +61 -0
  53. data/config/locales/en.yml +64 -0
  54. data/db/migrate/20150109121800_rename_internal_links_page_type.rb +13 -0
  55. data/lib/pageflow/internal_links/engine.rb +9 -0
  56. data/lib/pageflow/internal_links/grid_page_type.rb +19 -0
  57. data/lib/pageflow/internal_links/list_page_type.rb +19 -0
  58. data/lib/pageflow/internal_links/plugin.rb +9 -0
  59. data/lib/pageflow-internal-links.rb +17 -0
  60. data/pageflow-internal-links.gemspec +18 -0
  61. metadata +117 -0
@@ -0,0 +1,227 @@
1
+ pageflow.internalLinks.GridItemEmbeddedView = Backbone.Marionette.ItemView.extend({
2
+ template: 'pageflow/internal_links/editor/templates/grid_item_embedded',
3
+
4
+ modelEvents: {
5
+ 'change': 'update'
6
+ },
7
+
8
+ ui: {
9
+ title: '.title'
10
+ },
11
+
12
+ events: {
13
+ 'click .edit': function() {
14
+ pageflow.editor.navigate(this.pageLink().editPath(), {trigger: true});
15
+ return false;
16
+ },
17
+
18
+ 'click .set': function() {
19
+ var view = this;
20
+
21
+ pageflow.editor.selectPage().then(function(page) {
22
+ view.setTargetPage(page.get('perma_id'));
23
+ });
24
+ },
25
+
26
+ 'click .thumbnail': function () {
27
+ if (!this.$el.hasClass('editable')) {
28
+ var pageLink = this.pageLink();
29
+
30
+ pageflow.slides.goToByPermaId(pageLink.get('target_page_id'), {
31
+ transition: pageLink.get('page_transition')
32
+ });
33
+ }
34
+
35
+ return false;
36
+ },
37
+
38
+ 'mousedown': function() {
39
+ if (this.$el.hasClass('editable') && !this.$el.hasClass('unassigned')) {
40
+ return false;
41
+ }
42
+ }
43
+ },
44
+
45
+ initialize: function() {
46
+ this.pageLinks = this.model.page.pageLinks();
47
+ },
48
+
49
+ onRender: function() {
50
+ var view = this;
51
+
52
+ this.$el.droppable({
53
+ tolerance: 'pointer',
54
+
55
+ accept: function() {
56
+ return view.$el.hasClass('editable') && view.$el.hasClass('unassigned');
57
+ },
58
+
59
+ activate: function() {
60
+ view.$el.addClass('droppable');
61
+ },
62
+
63
+ deactivate: function() {
64
+ view.$el.removeClass('droppable over');
65
+ },
66
+
67
+ over: function() {
68
+ view.$el.addClass('over');
69
+ },
70
+
71
+ out: function() {
72
+ view.$el.removeClass('over');
73
+ },
74
+
75
+ drop: function(event, ui) {
76
+ view.$el.removeClass('droppable over');
77
+ view.movePageLinkFrom(ui.draggable.data('referenceKey'));
78
+ }
79
+ });
80
+
81
+ this.$el.draggable({
82
+ disabled: true,
83
+
84
+ helper: 'clone',
85
+
86
+ revert: function(droppable) {
87
+ if (droppable) {
88
+ view.resetPageLink();
89
+ }
90
+
91
+ return !droppable;
92
+ },
93
+
94
+ start: function() {
95
+ view.$el.addClass('dragged');
96
+ },
97
+
98
+ stop: function() {
99
+ view.$el.removeClass('dragged');
100
+ },
101
+
102
+ revertDuration: 200
103
+ });
104
+
105
+ this.listenTo(this.model.page, 'change:' + 'internal_links_editable', function() {
106
+ view.updateClassNames();
107
+ view.updateDraggable();
108
+ view.options.container.refreshScroller();
109
+ });
110
+
111
+ this.update();
112
+ },
113
+
114
+ update: function() {
115
+ var targetPage = this.targetPage();
116
+ var pageLink = this.pageLink();
117
+
118
+ this.$el.attr('data-page-transition', pageLink ? pageLink.get('page_transition') : null);
119
+
120
+ this.updateTexts();
121
+ this.updateCurrentPageLink();
122
+ this.updateThumbnailView();
123
+ this.updateClassNames();
124
+ this.updateDraggable();
125
+ },
126
+
127
+ updateCurrentPageLink: function() {
128
+ var pageLink = this.pageLink();
129
+
130
+ if (this.currentPageLink !== pageLink) {
131
+ if (this.currentPageLink) {
132
+ this.stopListening(this.currentPageLink, 'change');
133
+ }
134
+
135
+ this.currentPageLink = pageLink;
136
+
137
+ if (pageLink) {
138
+ this.listenTo(pageLink, 'change', function() {
139
+ this.updateClassNames();
140
+ this.updateThumbnailView();
141
+ });
142
+ }
143
+ }
144
+ },
145
+
146
+ updateTexts: function() {
147
+ var targetPage = this.targetPage();
148
+ var pageLink = this.pageLink();
149
+
150
+ if (pageLink && pageLink.get('description')) {
151
+ this.ui.title.html(pageLink.get('description'));
152
+ }
153
+ else {
154
+ this.ui.title.html(targetPage ? targetPage.configuration.get('description') : '');
155
+ }
156
+ },
157
+
158
+ updateThumbnailView: function() {
159
+ var targetPage = this.targetPage();
160
+
161
+ if (this.currentLinkedPage !== targetPage) {
162
+ if (this.currentLinkedPage) {
163
+ this.stopListening(this.currentLinkedPage, 'change:highlighted');
164
+ this.stopListening(this.currentLinkedPage.configuration, 'change:description');
165
+ }
166
+
167
+ this.currentLinkedPage = targetPage;
168
+
169
+ if (this.thumbnailView) {
170
+ this.thumbnailView.close();
171
+ }
172
+
173
+ if (targetPage) {
174
+ this.thumbnailView = this.subview(new pageflow.PageThumbnailView({
175
+ model: targetPage,
176
+ imageUrlPropertyName: 'link_thumbnail_url'
177
+ }));
178
+
179
+ this.$el.append(this.thumbnailView.el);
180
+
181
+ this.listenTo(targetPage, 'change:highlighted', this.updateClassNames);
182
+ this.listenTo(targetPage.configuration, 'change:description', this.updateTitle);
183
+ }
184
+ }
185
+ },
186
+
187
+ updateClassNames: function() {
188
+ var editable = this.model.page.get('internal_links_editable');
189
+ var targetPage = this.targetPage();
190
+
191
+ this.$el.toggleClass('title_hover', !editable);
192
+ this.$el.toggleClass('editable', !!editable);
193
+ this.$el.toggleClass('empty', !targetPage && !editable);
194
+ this.$el.toggleClass('no_page', !targetPage);
195
+ this.$el.toggleClass('unassigned', !this.currentPageLink);
196
+ this.$el.toggleClass('highlighted', !!(this.currentPageLink && this.currentPageLink.get('highlighted')));
197
+ },
198
+
199
+ updateDraggable: function() {
200
+ this.$el.draggable('option', 'disabled', !this.$el.hasClass('editable') || this.$el.hasClass('unassigned'));
201
+ },
202
+
203
+ setTargetPage: function(pagePermaId) {
204
+ this.pageLinks.addWithPosition(this.position(), pagePermaId);
205
+ },
206
+
207
+ movePageLinkFrom: function(position) {
208
+ this.pageLinks.findByPosition(position).set('position', this.position());
209
+ },
210
+
211
+ resetPageLink: function() {
212
+ this.pageLinks.removeByPosition(this.position());
213
+ },
214
+
215
+ targetPage: function() {
216
+ var pageLink = this.pageLink();
217
+ return pageLink && pageLink.targetPage();
218
+ },
219
+
220
+ pageLink: function() {
221
+ return this.pageLinks.findByPosition(this.position());
222
+ },
223
+
224
+ position: function() {
225
+ return this.$el.data('referenceKey');
226
+ }
227
+ });
@@ -0,0 +1,29 @@
1
+ pageflow.internalLinks.ListConfigurationEditorView = pageflow.ConfigurationEditorView.extend({
2
+ configure: function() {
3
+ this.tab('general', function() {
4
+ this.group('general');
5
+ });
6
+
7
+ this.tab('files', function() {
8
+ this.input('background_image_id', pageflow.FileInputView, {collection: pageflow.imageFiles});
9
+ this.input('thumbnail_image_id', pageflow.FileInputView, {
10
+ collection: pageflow.imageFiles,
11
+ positioning: false
12
+ });
13
+ });
14
+
15
+ this.tab('links', function() {
16
+ this.view(pageflow.internalLinks.EditableLinksModeView, {
17
+ model: this.model.page
18
+ });
19
+
20
+ this.view(pageflow.PageLinksView, {
21
+ model: this.model.page
22
+ });
23
+ });
24
+
25
+ this.tab('options', function() {
26
+ this.group('options');
27
+ });
28
+ }
29
+ });
@@ -0,0 +1,23 @@
1
+ pageflow.internalLinks.ListEmbeddedView = Backbone.Marionette.View.extend({
2
+ render: function() {
3
+ this.subview(new pageflow.CollectionView({
4
+ el: this.$el.find('ul'),
5
+ collection: this.model.internalLinksList(),
6
+ itemViewConstructor: pageflow.internalLinks.ListItemEmbeddedView,
7
+ itemViewOptions: {
8
+ page: this.model.page
9
+ }
10
+ }));
11
+
12
+ this.listenTo(this.model.page.pageLinks(), 'add remove', function() {
13
+ this.refreshScroller();
14
+ });
15
+
16
+ this.refreshScroller();
17
+
18
+ return this;
19
+ },
20
+
21
+ refreshScroller: function() {
22
+ }
23
+ });
@@ -0,0 +1,103 @@
1
+ pageflow.internalLinks.ListItemEmbeddedView = Backbone.Marionette.ItemView.extend({
2
+ template: 'pageflow/internal_links/editor/templates/list_item_embedded',
3
+
4
+ tagName: 'li',
5
+
6
+ modelEvents: {
7
+ 'change': 'update'
8
+ },
9
+
10
+ ui: {
11
+ description: '.page_description',
12
+ link: '.page_link'
13
+ },
14
+
15
+ events: {
16
+ 'click .edit': function() {
17
+ pageflow.editor.navigate(this.model.editPath(), {trigger: true});
18
+ return false;
19
+ },
20
+
21
+ 'click': function() {
22
+ if (this.$el.hasClass('editable')) {
23
+ return false;
24
+ }
25
+ }
26
+ },
27
+
28
+ onRender: function() {
29
+ this.listenTo(this.options.page, 'change:internal_links_editable', function() {
30
+ this.updateClassNames();
31
+ });
32
+
33
+ this.update();
34
+ },
35
+
36
+ update: function() {
37
+ var targetPage = this.targetPage();
38
+
39
+ if (!('currentTargetPage' in this) || this.currentTargetPage !== targetPage) {
40
+ if (this.currentTargetPage) {
41
+ this.stopListening(this.currentTargetPage.configuration, 'change:description');
42
+ }
43
+
44
+ this.currentTargetPage = targetPage;
45
+
46
+ this.ui.link.attr('data-page', targetPage ? targetPage.get('perma_id') : null);
47
+
48
+ this.updateThumbnail();
49
+
50
+ if (targetPage) {
51
+ this.listenTo(targetPage.configuration, 'change:description', this.updateTexts);
52
+ }
53
+ }
54
+
55
+ this.updatePageTransition();
56
+ this.updateClassNames();
57
+ this.updateTexts();
58
+ },
59
+
60
+ updatePageTransition: function() {
61
+ this.ui.link.attr('data-page-transition', this.model.get('page_transition'));
62
+ },
63
+
64
+ updateTexts: function() {
65
+ var targetPage = this.targetPage();
66
+
67
+ if (this.model.get('description')) {
68
+ this.ui.description.html(this.model.get('description'));
69
+ }
70
+ else {
71
+ this.ui.description.html(targetPage ? targetPage.configuration.get('description') : '');
72
+ }
73
+ },
74
+
75
+ updateThumbnail: function() {
76
+ var targetPage = this.targetPage();
77
+
78
+ if (this.thumbnailView) {
79
+ this.thumbnailView.close();
80
+ }
81
+
82
+ this.thumbnailView = this.subview(new pageflow.PageThumbnailView({
83
+ model: targetPage,
84
+ imageUrlPropertyName: 'link_thumbnail_url'
85
+ }));
86
+
87
+ this.ui.link.prepend(this.thumbnailView.el);
88
+ },
89
+
90
+ updateClassNames: function() {
91
+ var editable = this.options.page.get('internal_links_editable');
92
+ var targetPage = this.targetPage();
93
+
94
+ this.$el.toggleClass('editable', !!editable);
95
+ this.$el.toggleClass('empty', !targetPage && !editable);
96
+ this.$el.toggleClass('unassigned', !targetPage);
97
+ this.$el.toggleClass('highlighted', !!this.model.get('highlighted'));
98
+ },
99
+
100
+ targetPage: function() {
101
+ return this.model.targetPage();
102
+ }
103
+ });
@@ -0,0 +1,106 @@
1
+ pageflow.internalLinks.PageLinkEmbeddedView = Backbone.Marionette.ItemView.extend({
2
+ modelEvents: {
3
+ 'change': 'update'
4
+ },
5
+
6
+ ui: {
7
+ title: '.title',
8
+ description: '.description'
9
+ },
10
+
11
+ events: {
12
+ 'click .reset': function() {
13
+ this.setTargetPage(null);
14
+ },
15
+
16
+ 'click .set': function() {
17
+ var view = this;
18
+
19
+ pageflow.editor.selectPage().then(function(page) {
20
+ view.setTargetPage(page.get('perma_id'));
21
+ });
22
+ },
23
+
24
+ 'click .thumbnail': function () {
25
+ if (!this.$el.hasClass('editable')) {
26
+ pageflow.slides.goToById(this.targetPage().id);
27
+ }
28
+
29
+ return false;
30
+ },
31
+
32
+ 'mousedown': function() {
33
+ if (this.$el.hasClass('editable') && !this.$el.hasClass('unassigned')) {
34
+ return false;
35
+ }
36
+ }
37
+ },
38
+
39
+ onRender: function() {
40
+ var view = this;
41
+
42
+ this.listenTo(this.model.page, 'change:' + this.options.propertyName + '_editable', function() {
43
+ view.updateClassName();
44
+ view.updateDraggable();
45
+ view.options.container.refreshScroller();
46
+ });
47
+
48
+ this.update();
49
+ },
50
+
51
+ update: function() {
52
+ var targetPage = this.targetPage();
53
+
54
+ this.$el.data('permaId', targetPage ? targetPage.get('perma_id') : null);
55
+
56
+ this.updateTexts();
57
+ this.updateThumbnailView();
58
+ this.updateClassNames();
59
+ },
60
+
61
+ updateTexts: function() {
62
+ var targetPage = this.targetPage();
63
+
64
+ this.ui.title.html(targetPage ? targetPage.configuration.get('description') : '');
65
+ },
66
+
67
+ updateThumbnailView: function() {
68
+ var targetPage = this.targetPage();
69
+
70
+ if (this.currentLinkedPage !== targetPage) {
71
+ if (this.currentLinkedPage) {
72
+ this.stopListening(this.currentLinkedPage, 'change:highlighted');
73
+ this.stopListening(this.currentLinkedPage.configuration, 'change:description');
74
+ }
75
+
76
+ this.currentLinkedPage = targetPage;
77
+
78
+ if (this.thumbnailView) {
79
+ this.thumbnailView.close();
80
+ }
81
+
82
+ if (targetPage) {
83
+ this.thumbnailView = this.subview(new pageflow.PageThumbnailView({
84
+ model: targetPage,
85
+ imageUrlPropertyName: 'link_thumbnail_url'
86
+ }));
87
+
88
+ this.$el.append(this.thumbnailView.el);
89
+
90
+ this.listenTo(targetPage, 'change:highlighted', this.updateClassName);
91
+ this.listenTo(targetPage.configuration, 'change:description', this.updateTitle);
92
+ }
93
+ }
94
+ },
95
+
96
+ updateClassNames: function() {
97
+ var editable = this.model.page.get(this.options.propertyName + '_editable');
98
+ var targetPage = this.targetPage();
99
+
100
+ this.$el.toggleClass('title_hover', !editable);
101
+ this.$el.toggleClass('editable', !!editable);
102
+ this.$el.toggleClass('empty', !targetPage && !editable);
103
+ this.$el.toggleClass('unassigned', !targetPage);
104
+ this.$el.toggleClass('highlighted', !!targetPage && !!targetPage.get('highlighted'));
105
+ }
106
+ });
@@ -0,0 +1,11 @@
1
+ //= require_self
2
+ //= require_tree ./editor/models
3
+ //= require_tree ./editor/collections
4
+ //= require_tree ./editor/templates
5
+ //= require_tree ./editor/views
6
+ //= require_tree ./editor/routers
7
+ //= require_tree ./editor/controllers
8
+
9
+ //= require ./editor/config
10
+
11
+ pageflow.internalLinks = pageflow.internalLinks || {};
@@ -0,0 +1,31 @@
1
+ pageflow.pageType.register('internal_links_grid', _.extend({
2
+ prepareNextPageTimeout: 0,
3
+
4
+ enhance: function(pageElement, configuration) {
5
+ pageElement.on('click', 'nav .thumbnail', function() {
6
+ pageflow.slides.goToByPermaId($(this).data('page'), {
7
+ transition: $(this).data('pageTransition')
8
+ });
9
+ return false;
10
+ });
11
+ },
12
+
13
+ preload: function(pageElement, configuration) {
14
+ return pageflow.preload.backgroundImage(pageElement.find('.background_image'));
15
+ },
16
+
17
+ update: function(pageElement, configuration) {
18
+ pageElement.find('h2 .tagline').text(configuration.get('tagline') || '');
19
+ pageElement.find('h2 .title').text(configuration.get('title') || '');
20
+ pageElement.find('h2 .subtitle').text(configuration.get('subtitle') || '');
21
+ pageElement.find('p').html(configuration.get('text') || '');
22
+
23
+ this.updateCommonPageCssClasses(pageElement, configuration);
24
+
25
+ pageElement.find('.shadow').css({
26
+ opacity: configuration.get('gradient_opacity') / 100
27
+ });
28
+
29
+ pageElement.find('nav').attr('data-layout', configuration.get('linked_pages_layout'));
30
+ }
31
+ }, pageflow.commonPageCssClasses));
@@ -0,0 +1,29 @@
1
+ pageflow.pageType.register('internal_links_list', _.extend({
2
+ prepareNextPageTimeout: 0,
3
+
4
+ enhance: function(pageElement, configuration) {
5
+ pageElement.on('click', 'nav a[data-page]', function() {
6
+ pageflow.slides.goToByPermaId($(this).data('page'), {
7
+ transition: $(this).data('pageTransition')
8
+ });
9
+ return false;
10
+ });
11
+ },
12
+
13
+ preload: function(pageElement, configuration) {
14
+ return pageflow.preload.backgroundImage(pageElement.find('.background_image'));
15
+ },
16
+
17
+ update: function(pageElement, configuration) {
18
+ pageElement.find('h2 .tagline').text(configuration.get('tagline') || '');
19
+ pageElement.find('h2 .title').text(configuration.get('title') || '');
20
+ pageElement.find('h2 .subtitle').text(configuration.get('subtitle') || '');
21
+ pageElement.find('.contentText p').html(configuration.get('text') || '');
22
+
23
+ this.updateCommonPageCssClasses(pageElement, configuration);
24
+
25
+ pageElement.find('.shadow').css({
26
+ opacity: configuration.get('gradient_opacity') / 100
27
+ });
28
+ }
29
+ }, pageflow.commonPageCssClasses));
@@ -0,0 +1,2 @@
1
+ //= require ./internal_links/grid_page_type
2
+ //= require ./internal_links/list_page_type
@@ -0,0 +1,118 @@
1
+ .page_link_grid li {
2
+ position: relative;
3
+ cursor: pointer;
4
+
5
+ .placeholder {
6
+ display: none;
7
+ }
8
+
9
+ .title {
10
+ pointer-events: none;
11
+ }
12
+
13
+ .edit,
14
+ .set {
15
+ @include icon-only-button(white);
16
+ position: absolute;
17
+ display: none;
18
+ z-index: 1;
19
+ top: 5px;
20
+ right: 15px;
21
+ background-color: #fff;
22
+ border: solid 1px #888;
23
+ }
24
+
25
+ .edit {
26
+ @include pencil-icon;
27
+ }
28
+
29
+ .set {
30
+ @include plus-icon;
31
+ }
32
+
33
+ @import "pageflow/editor/file_thumbnails";
34
+
35
+ .pictogram {
36
+ pointer-events: none;
37
+ background-color: #444;
38
+ position: absolute !important;
39
+ bottom: 0;
40
+ }
41
+
42
+ &.editable {
43
+ cursor: default;
44
+
45
+ &:hover .edit {
46
+ display: block;
47
+ }
48
+
49
+ &.unassigned:hover .set {
50
+ display: block;
51
+ }
52
+
53
+ &.unassigned {
54
+ .edit {
55
+ display: none;
56
+ }
57
+ }
58
+
59
+ &.no_page {
60
+ .placeholder {
61
+ display: block;
62
+ }
63
+ }
64
+
65
+ %highlight {
66
+ z-index: 0;
67
+ position: relative;
68
+ outline: solid 1px #000;
69
+
70
+ &:before {
71
+ content: "";
72
+ position: absolute;
73
+ top: -1px;
74
+ left: -1px;
75
+ width: 100%;
76
+ height: 100%;
77
+ border: solid 1px #fff;
78
+ @include animation(blink 3s linear infinite);
79
+ z-index: 1;
80
+ }
81
+ }
82
+ }
83
+
84
+ &.droppable %highlight {
85
+ background-color: rgba(0, 0, 0, 0.3);
86
+
87
+ &:before {
88
+ background-color: rgba(255, 255, 255, 0.6);
89
+ }
90
+ }
91
+
92
+ &.editable.highlighted %highlight,
93
+ &.over %highlight {
94
+ &:after {
95
+ content: "";
96
+ position: absolute;
97
+ top: 0;
98
+ width: 100%;
99
+ height: 100%;
100
+ background-color: rgba(255, 255, 255, 0.6);
101
+ }
102
+ }
103
+
104
+ .placeholder,
105
+ .thumbnail {
106
+ @extend %highlight;
107
+ }
108
+
109
+ &.dragged {
110
+ .thumbnail {
111
+ background-image: none !important;
112
+ }
113
+
114
+ .pictogram {
115
+ display: none;
116
+ }
117
+ }
118
+ }