scrivito_table_widget 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/app/assets/javascripts/scrivito_table_widget/jquery.edit.table.js +27 -19
- data/app/assets/stylesheets/scrivito_table_widget/editing.css +14 -7
- data/app/assets/stylesheets/scrivito_table_widget/styles.css +1 -0
- data/lib/scrivito_table_widget/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 762476b953b26b88a37914e46787eeaaacd82596
|
4
|
+
data.tar.gz: 25c0bc9cff5263e913a7f3e6e3c5fb12bd54c983
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc48538a53b4f5d55e5421cee6da5422a6ceaed259e8887ae9aa9934fe27139a1f1a594a93e50459df6f38bffbac812f37d811a71e8c910d1037f95283673b52
|
7
|
+
data.tar.gz: f52d5b0e2a4afedb65bfd43dadf97946db640e9a70765a094fa76d23dd2dfcb0c9bec4837586a5bbb6d071982b2c2725e360f2727602ef6e57f96948c84d6bc6
|
data/README.md
CHANGED
@@ -11,6 +11,7 @@ A Widget for Scrivito for a table. It is using Bootstrap 3.
|
|
11
11
|
Add this line to your application's `Gemfile`:
|
12
12
|
|
13
13
|
gem 'scrivito_table_widget'
|
14
|
+
gem 'font-awesome-rails'
|
14
15
|
|
15
16
|
Add this line to your editing javascript manifest:
|
16
17
|
|
@@ -18,7 +19,7 @@ Add this line to your editing javascript manifest:
|
|
18
19
|
|
19
20
|
Add this line to your application stylesheet manifest:
|
20
21
|
|
21
|
-
|
22
|
+
*= require scrivito_table_widget/styles
|
22
23
|
|
23
24
|
After that, execute:
|
24
25
|
|
@@ -59,11 +59,13 @@
|
|
59
59
|
var height = activeElement.outerHeight();
|
60
60
|
|
61
61
|
$('.table-buttons.top').css({ top: "-11px", left: (base.left - 11), width: width + 23});
|
62
|
-
$('.table-buttons.edit').css({ top: (base.top -
|
62
|
+
$('.table-buttons.edit').css({ top: (base.top - 12), left: (base.left - 5)});
|
63
63
|
$('.table-buttons.left').css({ top: (base.top - 12), left: -17, height: height + 24});
|
64
64
|
$('.table-buttons.bottom').css({ bottom: "-4px", left: (base.left + width/2 - 12)});
|
65
65
|
$('.table-buttons.right').css({ top: (base.top + height/2 - 11), right: -23});
|
66
66
|
|
67
|
+
$.fn.edittable.toggleTableOptions('.table-buttons.edit', 'hide');
|
68
|
+
|
67
69
|
if(activeElement.get(0).tagName == "TH") {
|
68
70
|
$('.table-buttons .add-top').hide();
|
69
71
|
} else {
|
@@ -114,11 +116,16 @@
|
|
114
116
|
}
|
115
117
|
|
116
118
|
$.fn.edittable.buttonsEdit = function() {
|
117
|
-
return $.fn.edittable.button("
|
118
|
-
$.fn.edittable.button("
|
119
|
-
$.fn.edittable.button("
|
120
|
-
$.fn.edittable.button("align-
|
121
|
-
$.fn.edittable.button("align-
|
119
|
+
return $.fn.edittable.button("pencil", "", "edit-the-cell alert-gray") +
|
120
|
+
$.fn.edittable.button("bold", "", "table-bold alert-gray") +
|
121
|
+
$.fn.edittable.button("italic", "", "table-italic alert-gray") +
|
122
|
+
$.fn.edittable.button("align-left", "", "table-left alert-gray") +
|
123
|
+
$.fn.edittable.button("align-center", "", "table-center alert-gray") +
|
124
|
+
$.fn.edittable.button("align-right", "", "table-right alert-gray") +
|
125
|
+
$.fn.edittable.button("crosshairs", "", "add-success alert-success") +
|
126
|
+
$.fn.edittable.button("crosshairs", "", "add-info alert-info") +
|
127
|
+
$.fn.edittable.button("crosshairs", "", "add-warning alert-warning") +
|
128
|
+
$.fn.edittable.button("crosshairs", "", "add-danger alert-danger");
|
122
129
|
}
|
123
130
|
|
124
131
|
$.fn.edittable.buttonsBottom = function() {
|
@@ -135,16 +142,12 @@
|
|
135
142
|
}
|
136
143
|
|
137
144
|
$.fn.edittable.buttonsMain = function() {
|
138
|
-
return $.fn.edittable.button("
|
139
|
-
$.fn.edittable.button("none", "striped", "stripe-table
|
140
|
-
$.fn.edittable.button("none", "condenced", "condence-table
|
141
|
-
$.fn.edittable.button("none", "hover", "hover-table
|
142
|
-
$.fn.edittable.button("none", "border", "border-table
|
143
|
-
$.fn.edittable.button("none", "first-column", "first-column
|
144
|
-
$.fn.edittable.button("none", "success", "add-success alert-success") +
|
145
|
-
$.fn.edittable.button("none", "info", "add-info alert-info") +
|
146
|
-
$.fn.edittable.button("none", "warning", "add-warning alert-warning") +
|
147
|
-
$.fn.edittable.button("none", "danger", "add-danger alert-danger");
|
145
|
+
return $.fn.edittable.button("cog", "", "edit-the-table") +
|
146
|
+
$.fn.edittable.button("none", "striped", "stripe-table") +
|
147
|
+
$.fn.edittable.button("none", "condenced", "condence-table") +
|
148
|
+
$.fn.edittable.button("none", "hover", "hover-table") +
|
149
|
+
$.fn.edittable.button("none", "border", "border-table") +
|
150
|
+
$.fn.edittable.button("none", "first-column", "first-column");
|
148
151
|
}
|
149
152
|
|
150
153
|
$.fn.edittable.button = function(icon, text, f) {
|
@@ -179,7 +182,8 @@
|
|
179
182
|
$('.table-widget').find('.table-center').on('click', function() { $.fn.edittable.tableCenter(); });
|
180
183
|
$('.table-widget').find('.table-right').on('click', function() { $.fn.edittable.tableRight(); });
|
181
184
|
|
182
|
-
$('.table-widget').find('.edit-the-table').on('click', function() { $.fn.edittable.toggleTableOptions(); });
|
185
|
+
$('.table-widget').find('.edit-the-table').on('click', function() { $.fn.edittable.toggleTableOptions('.table-options.main'); });
|
186
|
+
$('.table-widget').find('.edit-the-cell').on('click', function() { $.fn.edittable.toggleTableOptions('.table-buttons.edit'); });
|
183
187
|
|
184
188
|
$('.table-widget').find('.add-left, .add-right').on('mouseover', function() { $.fn.edittable.addHoverVerticalAdd($(this)); });
|
185
189
|
$('.table-widget').find('.add-top, .add-bottom').on('mouseover', function() { $.fn.edittable.addHoverHorizontalAdd($(this)); });
|
@@ -249,8 +253,12 @@
|
|
249
253
|
* Button methods
|
250
254
|
****/
|
251
255
|
|
252
|
-
$.fn.edittable.toggleTableOptions = function() {
|
253
|
-
|
256
|
+
$.fn.edittable.toggleTableOptions = function(bar, option) {
|
257
|
+
if(option === 'hide') {
|
258
|
+
$(bar +' div').not(':first').hide();
|
259
|
+
} else {
|
260
|
+
$(bar +' div').not(':first').fadeToggle(100);
|
261
|
+
}
|
254
262
|
}
|
255
263
|
|
256
264
|
$.fn.edittable.bold = function() {
|
@@ -24,7 +24,16 @@
|
|
24
24
|
margin-bottom: 0;
|
25
25
|
}
|
26
26
|
|
27
|
-
.table-buttons
|
27
|
+
.table-buttons.edit {
|
28
|
+
width: 245px;
|
29
|
+
}
|
30
|
+
|
31
|
+
.table-options.main {
|
32
|
+
width: 333px;
|
33
|
+
}
|
34
|
+
|
35
|
+
.table-buttons.edit div.alert-gray,
|
36
|
+
.table-options div {
|
28
37
|
background: #444444;
|
29
38
|
}
|
30
39
|
|
@@ -91,10 +100,6 @@
|
|
91
100
|
position: relative;
|
92
101
|
}
|
93
102
|
|
94
|
-
.alert-gray {
|
95
|
-
background-color: #444444;
|
96
|
-
}
|
97
|
-
|
98
103
|
.table-options .alert-success {
|
99
104
|
margin-left: 5px;
|
100
105
|
}
|
@@ -118,10 +123,12 @@ td.active-field {
|
|
118
123
|
outline: 2px solid #444;
|
119
124
|
}
|
120
125
|
|
121
|
-
.table-options.main div
|
126
|
+
.table-options.main div,
|
127
|
+
.table-buttons.edit div {
|
122
128
|
display: none;
|
123
129
|
}
|
124
130
|
|
125
|
-
.table-options.main div:first-child
|
131
|
+
.table-options.main div:first-child,
|
132
|
+
.table-buttons.edit div:first-child {
|
126
133
|
display: block;
|
127
134
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scrivito_table_widget
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scrivito
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|