lalala 4.0.0.dev.344 → 4.0.0.dev.349

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: eff2ff2adf549dd218bc1ed27fa4fb8a0113a08a
4
- data.tar.gz: d8431b3a2e7657a00658ff58ebad819246863d4f
3
+ metadata.gz: 4d5eccfb6ba59a7e2b37202787566bf88aa2a0cf
4
+ data.tar.gz: ba7d8acaf3a176fe432c1c29dc9bac3afad3470d
5
5
  SHA512:
6
- metadata.gz: f4df78cf5886fb2b488137e4d89871f8df1addd0664edc98887723f5fdbc3de7823d13858ed8698eed6bd6ae139bd0ec709201875c546023ede3fc6b7fc9033f
7
- data.tar.gz: b3dd01fc8222e320a8ef91a075ce7ad41e9fafe4cc54df5b2ea6eadded7e21015a6c8a4dc31241278f05281973aeda07320735f92c5c0ddf4968fc55346385e2
6
+ metadata.gz: 34eab6e8d3bcb3a9cde5753e243de6313c37f2d27f6c12e32a93adfea9783db64485ea470d72f9281f22fdd6a5181c35809dd1b018ae1a5195ef61e80c8a274d
7
+ data.tar.gz: 2cba029a02b40fe253206aff313de504e63df3c30b98fdfbc3cd7da12f63b230e247ae257d5ae5c9f5fdeb0cfb13a5655c57b9559208b3bfd3955632562af062
@@ -6,7 +6,8 @@ var console = require('browser/console'),
6
6
  sorted_pages_tree = require("lalala/modules/sorted_pages_tree"),
7
7
  login = require("lalala/modules/login"),
8
8
  dashboard = require("lalala/modules/dashboard"),
9
- collapsible_pages_tree = require("lalala/modules/collapsible_pages_tree");
9
+ collapsible_pages_tree = require("lalala/modules/collapsible_pages_tree"),
10
+ input_group = require("lalala/modules/input_group");
10
11
 
11
12
  $(function() {
12
13
  login.init();
@@ -17,6 +18,7 @@ $(function() {
17
18
  sorted_pages_tree.init();
18
19
  dashboard.init();
19
20
  collapsible_pages_tree.init();
21
+ input_group.init();
20
22
 
21
23
  $('select').not(".bypass-chosen").chosen();
22
24
  });
@@ -0,0 +1,36 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * Append or prepend placeholders to certain inputs
5
+ */
6
+
7
+ exports.init = function () {
8
+ $('.js-prepend-placeholder[placeholder], .js-append-placeholder[placeholder]').each(function () {
9
+ var $this = $(this);
10
+ replace_input_with_group($this, $this.attr('placeholder'), $this.hasClass('js-append-placeholder'));
11
+ });
12
+ }
13
+
14
+ /**
15
+ * Replace an <input> element with an appended/prepended placeholder
16
+ * @param {jQuery} $input
17
+ * @param {string} placeholder
18
+ * @param {optional} {bool} reverse - false: prepend, true: append (default false)
19
+ * @return {jQuery} The new input group
20
+ */
21
+ function replace_input_with_group ($input, placeholder, reverse) {
22
+ var placeholder = placeholder || '',
23
+ reverse = (typeof reverse === 'undefined') ? false : reverse,
24
+ span_class = !!reverse ? 'input-append' : 'input-prepend',
25
+ $clone = $input.clone(),
26
+ $input_group = $('<div class="input-group"></div>'),
27
+ $prepend = $('<span class="' + span_class + '">' + placeholder + '</span>');
28
+
29
+ $prepend.prependTo($input_group);
30
+ $clone.attr('placeholder', '')
31
+ .appendTo($input_group);
32
+ $input.replaceWith($input_group);
33
+ $clone.css(!!reverse ? 'padding-right' : 'padding-left', (parseInt($clone.css('padding-right'), 10) + parseInt($prepend.outerWidth(), 10)) + 'px');
34
+
35
+ return $input_group;
36
+ }
@@ -276,3 +276,37 @@ select:focus {
276
276
  .chosen-container {
277
277
  margin-top: 4px;
278
278
  }
279
+
280
+ .input-group {
281
+ display: inline-block;
282
+ position: relative;
283
+ width: $input_width;
284
+
285
+ input {
286
+ width: 100%;
287
+ }
288
+
289
+ .input-prepend,
290
+ .input-append {
291
+ background-color: rgb(220, 220, 220);
292
+ color: rgb(110, 110, 110);
293
+ bottom: 0;
294
+ line-height: 2.875;
295
+ padding: 0 15px;
296
+ position: absolute;
297
+ text-shadow: 0 1px 0 rgb(240, 240, 240);
298
+ top: 0;
299
+ }
300
+
301
+ .input-prepend {
302
+ border-top-left-radius: 5px;
303
+ border-bottom-left-radius: 5px;
304
+ left: 0;
305
+ }
306
+
307
+ .input-append {
308
+ border-top-right-radius: 5px;
309
+ border-bottom-right-radius: 5px;
310
+ right: 0;
311
+ }
312
+ }
@@ -1,6 +1,6 @@
1
1
  module Lalala
2
2
  VERSION = "4.0.0"
3
- BUILD = "344"
3
+ BUILD = "349"
4
4
 
5
5
  if BUILD != ("{{BUILD_NUMBER" + "}}") # prevent sed replacement (see script/ci)
6
6
  BUILD_VERSION = "#{VERSION}.dev.#{BUILD}"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lalala
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0.dev.344
4
+ version: 4.0.0.dev.349
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Menke
@@ -1319,6 +1319,7 @@ files:
1319
1319
  - app/assets/javascripts/lalala/modules/grid.module.js
1320
1320
  - app/assets/javascripts/lalala/modules/helpers.module.js
1321
1321
  - app/assets/javascripts/lalala/modules/init.module.js
1322
+ - app/assets/javascripts/lalala/modules/input_group.module.js
1322
1323
  - app/assets/javascripts/lalala/modules/locale_chooser.module.js
1323
1324
  - app/assets/javascripts/lalala/modules/login.module.js
1324
1325
  - app/assets/javascripts/lalala/modules/sorted_pages_tree.module.js