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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 24b2c2773708e0df6476395b505a74b78cc1054f
4
- data.tar.gz: dd0e10e569b6413eb902ffac451c4617277fec77
3
+ metadata.gz: 762476b953b26b88a37914e46787eeaaacd82596
4
+ data.tar.gz: 25c0bc9cff5263e913a7f3e6e3c5fb12bd54c983
5
5
  SHA512:
6
- metadata.gz: 30682abf63cd5eda5168b2ffefeff5aacbc6317d2bad48d9080263301fb9100866cb57cb60e45439855ccd06e087e2a7c5dde528f3a6a457b8410853859b0946
7
- data.tar.gz: 4c995dcc44cfc2e49be8608913b4f2de156bc0627d56955a64c9de2f00abfb43416dfc10444e182135d61e580ecbfe1435f5e832dcccf769c56e4641220bf2e8
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
- /= require scrivito_table_widget/styles
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 - 16), left: (base.left + 5)});
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("bold", "", "table-bold") +
118
- $.fn.edittable.button("italic", "", "table-italic") +
119
- $.fn.edittable.button("align-left", "", "table-left") +
120
- $.fn.edittable.button("align-center", "", "table-center") +
121
- $.fn.edittable.button("align-right", "", "table-right");
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("pencil", "", "edit-the-table alert-gray") +
139
- $.fn.edittable.button("none", "striped", "stripe-table alert-gray") +
140
- $.fn.edittable.button("none", "condenced", "condence-table alert-gray") +
141
- $.fn.edittable.button("none", "hover", "hover-table alert-gray") +
142
- $.fn.edittable.button("none", "border", "border-table alert-gray") +
143
- $.fn.edittable.button("none", "first-column", "first-column alert-gray") +
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
- $('.table-options.main div').not(':first').fadeToggle(100);
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 div {
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
  }
@@ -1,4 +1,5 @@
1
1
  /*
2
+ *= require font-awesome
2
3
  *= require_tree .
3
4
  *= require_self
4
5
  */
@@ -1,3 +1,3 @@
1
1
  module ScrivitoTableWidget
2
- VERSION = "0.5.1"
2
+ VERSION = "0.5.2"
3
3
  end
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.1
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 00:00:00.000000000 Z
11
+ date: 2015-03-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler