jscolor-rails 1.4.2.1 → 1.4.4

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: 28e7c9707d4ad8626443343e3835a8c7b72c54a6
4
- data.tar.gz: 9c7cfa92ecfedf6a4c1dcdad77e48ae698dca137
3
+ metadata.gz: 7c8b738367b93829016f47eb5c306d7eddd26a34
4
+ data.tar.gz: 732e7973702e75ec40fef205194bacce0045bdf0
5
5
  SHA512:
6
- metadata.gz: ee3b9ab388b5e09a519c04dc1b9c55864e5ee1cbcea52eab54916f96ef2093d8d1d4015d051f6004f513f40b38eb1d1eb94edaec3a4c52ded5c40b874f533be7
7
- data.tar.gz: 6765f071644c6c1378ccd87c387f2b41afda9d875c7c6909beca428557c67f036e33cf659f326a860b60844da5c4b4dee1bd676739de48afcbe7b4327c5f12c9
6
+ metadata.gz: 73d2251bff047218d51455b0c54e8ffeb0ea0eab1d9dd5be492a86ee29991645488e9c65979aee51a08aafac69a5e72db0fd0912bf3723ce191eab4c24717f80
7
+ data.tar.gz: 3cac16dbe6decf568a19791a21508a92a564cac6d2b97b3a4d975e71a82e8a117dab6e52ee90219b555ef551f62de7ca9a970e448974b1cc128186018ec6c931
@@ -1,5 +1,5 @@
1
1
  module Jscolor
2
2
  module Rails
3
- VERSION = "1.4.2.1"
3
+ VERSION = "1.4.4"
4
4
  end
5
5
  end
@@ -1,11 +1,11 @@
1
1
  /**
2
2
  * jscolor, JavaScript Color Picker
3
3
  *
4
- * @version 1.4.2
4
+ * @version 1.4.4
5
5
  * @license GNU Lesser General Public License, http://www.gnu.org/copyleft/lesser.html
6
6
  * @author Jan Odvarko, http://odvarko.cz
7
7
  * @created 2008-06-15
8
- * @updated 2013-11-25
8
+ * @updated 2014-12-09
9
9
  * @link http://jscolor.com
10
10
  */
11
11
 
@@ -67,15 +67,19 @@ var jscolor = {
67
67
 
68
68
 
69
69
  bind : function() {
70
- var matchClass = new RegExp('(^|\\s)('+jscolor.bindClass+')\\s*(\\{[^}]*\\})?', 'i');
70
+ var matchClass = new RegExp('(^|\\s)('+jscolor.bindClass+')(\\s*(\\{[^}]*\\})|\\s|$)', 'i');
71
71
  var e = document.getElementsByTagName('input');
72
72
  for(var i=0; i<e.length; i+=1) {
73
+ if(jscolor.isColorAttrSupported && e[i].type.toLowerCase() == 'color') {
74
+ // skip inputs of type 'color' if the browser supports this feature
75
+ continue;
76
+ }
73
77
  var m;
74
78
  if(!e[i].color && e[i].className && (m = e[i].className.match(matchClass))) {
75
79
  var prop = {};
76
- if(m[3]) {
80
+ if(m[4]) {
77
81
  try {
78
- prop = (new Function ('return (' + m[3] + ')'))();
82
+ prop = (new Function ('return (' + m[4] + ')'))();
79
83
  } catch(eInvalidProp) {}
80
84
  }
81
85
  e[i].color = new jscolor.color(e[i], prop);
@@ -947,6 +951,15 @@ var jscolor = {
947
951
  leavePad = 1<<2,
948
952
  leaveSld = 1<<3;
949
953
 
954
+ jscolor.isColorAttrSupported = false;
955
+ var el = document.createElement('input');
956
+ if(el.setAttribute) {
957
+ el.setAttribute('type', 'color');
958
+ if(el.type.toLowerCase() == 'color') {
959
+ jscolor.isColorAttrSupported = true;
960
+ }
961
+ }
962
+
950
963
  // target
951
964
  jscolor.addEvent(target, 'focus', function() {
952
965
  if(THIS.pickerOnfocus) { THIS.showPicker(); }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jscolor-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.2.1
4
+ version: 1.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Moandji Ezana
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-07 00:00:00.000000000 Z
11
+ date: 2014-12-17 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email:
@@ -46,7 +46,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
46
46
  version: '0'
47
47
  requirements: []
48
48
  rubyforge_project:
49
- rubygems_version: 2.2.1
49
+ rubygems_version: 2.4.5
50
50
  signing_key:
51
51
  specification_version: 4
52
52
  summary: Integrates JSColor with Rails's asset pipeline