medium-editor-rails 2.3.1 → 2.3.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: 0f5170fedbb8513e3621aa2bd56e4b2de9f65943
4
- data.tar.gz: 95a99b8927552565bc6f3df3edb9f42856a58178
3
+ metadata.gz: 517e7d49f074c079067439b81a4a18c6f823fd0e
4
+ data.tar.gz: 267ee3cda3176cb44557ec1ba3b925b26eaf86ec
5
5
  SHA512:
6
- metadata.gz: a3db5c5c294bc980a65a95ca600ea5ebb2699d9883ac7787fd0e4e83bd92ee13a64df45b8801ad8328a57423812138bf725e5cc934b3e5c568ac7a28f8658cb6
7
- data.tar.gz: 1c79610e55fb2eee7403912309938477fa31f0d374f4cb04a571f8a9c101efb5b2aaf4372bdba5ee7125ab004858ebb2ebfebf56cf18ee76f16392c9cece83fe
6
+ metadata.gz: f3b2005cc03fba7ddf20dbc2ddf726bfaa6e87f1609d5a286bd8d035cf170d24ac28882eca9557c3d70a6538018ea1a2b18eb15d50f597bda2f3cefd841c19de
7
+ data.tar.gz: d0bbbd59734f772531e0464a810b9633bb621ade8dd0d973bbaf50e1a31a0a7e0305f6923141f7363a2e4f41165db64a84052ffc54eba90d9c382d36dc9ead99
data/.gitignore CHANGED
@@ -3,6 +3,7 @@
3
3
  .bundle
4
4
  .config
5
5
  .yardoc
6
+ bower_components/
6
7
  Gemfile.lock
7
8
  InstalledFiles
8
9
  _yardoc
@@ -16,4 +17,4 @@ test/tmp
16
17
  test/version_tmp
17
18
  tmp
18
19
  .idea/
19
- .DS*
20
+ .DS*
data/README.md CHANGED
@@ -8,7 +8,7 @@ This gem integrates [Medium Editor](https://github.com/yabwe/medium-editor) with
8
8
 
9
9
  ## Version
10
10
 
11
- The latest version of Medium Editor bundled by this gem is [5.22.0](https://github.com/yabwe/medium-editor/releases)
11
+ The latest version of Medium Editor bundled by this gem is [5.22.1](https://github.com/yabwe/medium-editor/releases)
12
12
 
13
13
  ## Installation
14
14
 
@@ -54,7 +54,7 @@ You need to initialize Medium Editor with any selector of div, example:
54
54
  <div class="editable"></div>
55
55
 
56
56
  <script>
57
- var editor = new MediumEditor('.editor', {
57
+ var editor = new MediumEditor('.editable', {
58
58
  // options go here
59
59
  });
60
60
  </script>
data/Rakefile CHANGED
@@ -1 +1,54 @@
1
1
  require 'bundler/gem_tasks'
2
+ require 'json'
3
+
4
+ README_VERSION_REGEXP = /bundled by this gem is \[([^\]]*)\]/
5
+ VERSION_FILE_REGEXP = /MEDIUM_EDITOR_VERSION\s.*/
6
+
7
+ namespace :bower do
8
+ task :bump do
9
+ bump_readme_file
10
+ bump_version_file
11
+ end
12
+
13
+ desc "updates javascripts from bower package manager"
14
+ task :update do
15
+ puts `bower install medium-editor --save`
16
+ end
17
+
18
+ desc "vendors javascripts and stylesheets for rails assets pipeline"
19
+ task :vendor do
20
+ cp_asset "bower_components/medium-editor/dist/js/medium-editor.js"
21
+ cp_asset "bower_components/medium-editor/dist/css/medium-editor.css"
22
+ cp_themes
23
+ end
24
+ end
25
+
26
+ def version_from_bower
27
+ data = JSON.load File.read "bower_components/medium-editor/.bower.json"
28
+ data["version"]
29
+ end
30
+
31
+ def cp_themes
32
+ puts "vendoring themes"
33
+ FileUtils.cp_r "bower_components/medium-editor/dist/css/themes", "vendor/assets/stylesheets/medium-editor"
34
+ end
35
+
36
+ def cp_asset filename
37
+ base_filename = File.basename(filename)
38
+ asset_folder = base_filename.include?(".js") ? "javascripts" : "stylesheets/medium-editor"
39
+ puts "vendoring " + base_filename
40
+ FileUtils.cp filename, File.join("vendor/assets/#{asset_folder}", base_filename)
41
+ end
42
+
43
+ def bump_readme_file
44
+ latest_version = "bundled by this gem is [#{version_from_bower}]"
45
+ lines = File.read('README.md')
46
+ File.open('README.md', 'w'){ |f| f.puts lines.gsub(README_VERSION_REGEXP, latest_version) }
47
+ end
48
+
49
+ def bump_version_file
50
+ version_filename = File.join("lib", "medium-editor-rails", "version.rb")
51
+ latest_version = "MEDIUM_EDITOR_VERSION = '#{version_from_bower}'"
52
+ lines = File.read(version_filename)
53
+ File.open(version_filename, 'w') { |f| f.puts lines.gsub(VERSION_FILE_REGEXP, latest_version) }
54
+ end
@@ -1,6 +1,6 @@
1
1
  module MediumEditorRails
2
2
  module Rails
3
- VERSION = '2.3.1'
4
- MEDIUM_EDITOR_VERSION = '5.22.0'
3
+ VERSION = '2.3.2'
4
+ MEDIUM_EDITOR_VERSION = '5.22.1'
5
5
  end
6
6
  end
@@ -16,6 +16,6 @@ Gem::Specification.new do |gem|
16
16
  gem.files = `git ls-files`.split($/)
17
17
  gem.require_paths = ['lib']
18
18
 
19
- gem.add_dependency 'railties', '>= 3.0'
19
+ gem.add_dependency 'railties', '~> 3.0'
20
20
  gem.add_development_dependency 'bundler', '~> 1.0'
21
21
  end
@@ -385,7 +385,7 @@ if (!("classList" in document.createElement("_"))) {
385
385
 
386
386
  (function (root, factory) {
387
387
  'use strict';
388
- var isElectron = typeof module === 'object' && process && process.versions && process.versions.electron;
388
+ var isElectron = typeof module === 'object' && typeof process !== 'undefined' && process && process.versions && process.versions.electron;
389
389
  if (!isElectron && typeof module === 'object') {
390
390
  module.exports = factory;
391
391
  } else if (typeof define === 'function' && define.amd) {
@@ -780,7 +780,7 @@ MediumEditor.extensions = {};
780
780
  timeout = null,
781
781
  previous = 0,
782
782
  later = function () {
783
- previous = new Date().getTime();
783
+ previous = Date.now();
784
784
  timeout = null;
785
785
  result = func.apply(context, args);
786
786
  if (!timeout) {
@@ -793,7 +793,7 @@ MediumEditor.extensions = {};
793
793
  }
794
794
 
795
795
  return function () {
796
- var now = new Date().getTime(),
796
+ var now = Date.now(),
797
797
  remaining = wait - (now - previous);
798
798
 
799
799
  context = this;
@@ -3864,19 +3864,47 @@ MediumEditor.extensions = {};
3864
3864
  this.base.checkSelection();
3865
3865
  },
3866
3866
 
3867
+ ensureEncodedUri: function (str) {
3868
+ return str === decodeURI(str) ? encodeURI(str) : str;
3869
+ },
3870
+
3871
+ ensureEncodedUriComponent: function (str) {
3872
+ return str === decodeURIComponent(str) ? encodeURIComponent(str) : str;
3873
+ },
3874
+
3875
+ ensureEncodedParam: function (param) {
3876
+ var split = param.split('='),
3877
+ key = split[0],
3878
+ val = split[1];
3879
+
3880
+ return key + (val === undefined ? '' : '=' + this.ensureEncodedUriComponent(val));
3881
+ },
3882
+
3883
+ ensureEncodedQuery: function (queryString) {
3884
+ return queryString.split('&').map(this.ensureEncodedParam.bind(this)).join('&');
3885
+ },
3886
+
3867
3887
  checkLinkFormat: function (value) {
3868
3888
  // Matches any alphabetical characters followed by ://
3869
3889
  // Matches protocol relative "//"
3870
3890
  // Matches common external protocols "mailto:" "tel:" "maps:"
3871
3891
  // Matches relative hash link, begins with "#"
3872
3892
  var urlSchemeRegex = /^([a-z]+:)?\/\/|^(mailto|tel|maps):|^\#/i,
3873
- // var te is a regex for checking if the string is a telephone number
3874
- telRegex = /^\+?\s?\(?(?:\d\s?\-?\)?){3,20}$/;
3893
+ // telRegex is a regex for checking if the string is a telephone number
3894
+ telRegex = /^\+?\s?\(?(?:\d\s?\-?\)?){3,20}$/,
3895
+ split = value.split('?'),
3896
+ path = split[0],
3897
+ query = split[1];
3898
+
3875
3899
  if (telRegex.test(value)) {
3876
3900
  return 'tel:' + value;
3877
3901
  } else {
3878
3902
  // Check for URL scheme and default to http:// if none found
3879
- return (urlSchemeRegex.test(value) ? '' : 'http://') + encodeURI(value);
3903
+ return (urlSchemeRegex.test(value) ? '' : 'http://') +
3904
+ // Ensure path is encoded
3905
+ this.ensureEncodedUri(path) +
3906
+ // Ensure query is encoded
3907
+ (query === undefined ? '' : '?' + this.ensureEncodedQuery(query));
3880
3908
  }
3881
3909
  },
3882
3910
 
@@ -6839,7 +6867,7 @@ MediumEditor.extensions = {};
6839
6867
 
6840
6868
  function createContentEditable(textarea) {
6841
6869
  var div = this.options.ownerDocument.createElement('div'),
6842
- now = new Date().getTime(),
6870
+ now = Date.now(),
6843
6871
  uniqueId = 'medium-editor-' + now,
6844
6872
  atts = textarea.attributes;
6845
6873
 
@@ -7798,7 +7826,7 @@ MediumEditor.parseVersionString = function (release) {
7798
7826
 
7799
7827
  MediumEditor.version = MediumEditor.parseVersionString.call(this, ({
7800
7828
  // grunt-bump looks for this:
7801
- 'version': '5.22.0'
7829
+ 'version': '5.22.1'
7802
7830
  }).version);
7803
7831
 
7804
7832
  return MediumEditor;
@@ -1 +1 @@
1
- .medium-toolbar-arrow-under:after{top:60px;border-color:#57ad68 transparent transparent}.medium-toolbar-arrow-over:before{top:-8px;border-color:transparent transparent #57ad68}.medium-editor-toolbar{background-color:#57ad68}.medium-editor-toolbar li{padding:0}.medium-editor-toolbar li button{min-width:60px;height:60px;border:none;border-right:1px solid #9ccea6;background-color:transparent;color:#fff;-webkit-transition:background-color .2s ease-in,color .2s ease-in;transition:background-color .2s ease-in,color .2s ease-in}.medium-editor-toolbar li button:hover{background-color:#346a3f;color:#fff}.medium-editor-toolbar li .medium-editor-button-active{background-color:#23482a;color:#fff}.medium-editor-toolbar li .medium-editor-button-last{border-right:none}.medium-editor-toolbar-form .medium-editor-toolbar-input{height:60px;background:#57ad68;color:#fff}.medium-editor-toolbar-form .medium-editor-toolbar-input::-webkit-input-placeholder{color:#fff;color:rgba(255,255,255,.8)}.medium-editor-toolbar-form .medium-editor-toolbar-input:-moz-placeholder{color:#fff;color:rgba(255,255,255,.8)}.medium-editor-toolbar-form .medium-editor-toolbar-input::-moz-placeholder{color:#fff;color:rgba(255,255,255,.8)}.medium-editor-toolbar-form .medium-editor-toolbar-input:-ms-input-placeholder{color:#fff;color:rgba(255,255,255,.8)}.medium-editor-toolbar-form a{color:#fff}.medium-editor-toolbar-anchor-preview{background:#57ad68;color:#fff}.medium-editor-placeholder:after{color:#9ccea6}
1
+ .medium-toolbar-arrow-under:after{top:60px;border-color:#57ad68 transparent transparent}.medium-toolbar-arrow-over:before{top:-8px;border-color:transparent transparent #57ad68}.medium-editor-toolbar{background-color:#57ad68}.medium-editor-toolbar li{padding:0}.medium-editor-toolbar li button{min-width:60px;height:60px;border:none;border-right:1px solid #9ccea6;background-color:transparent;color:#fff;-webkit-transition:background-color .2s ease-in,color .2s ease-in;transition:background-color .2s ease-in,color .2s ease-in}.medium-editor-toolbar li button:hover{background-color:#346a3f;color:#fff}.medium-editor-toolbar li .medium-editor-button-active{background-color:#23482a;color:#fff}.medium-editor-toolbar li .medium-editor-button-last{border-right:none}.medium-editor-toolbar-form .medium-editor-toolbar-input{height:60px;background:#57ad68;color:#fff}.medium-editor-toolbar-form .medium-editor-toolbar-input::-webkit-input-placeholder{color:#fff;color:rgba(255,255,255,.8)}.medium-editor-toolbar-form .medium-editor-toolbar-input:-moz-placeholder{color:#fff;color:rgba(255,255,255,.8)}.medium-editor-toolbar-form .medium-editor-toolbar-input::-moz-placeholder{color:#fff;color:rgba(255,255,255,.8)}.medium-editor-toolbar-form .medium-editor-toolbar-input:-ms-input-placeholder{color:#fff;color:rgba(255,255,255,.8)}.medium-editor-toolbar-form a{color:#fff}.medium-editor-toolbar-anchor-preview{background:#57ad68;color:#fff}.medium-editor-placeholder:after{color:#9ccea6}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: medium-editor-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.1
4
+ version: 2.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ahmet Sezgin Duran
@@ -9,20 +9,20 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-09-21 00:00:00.000000000 Z
12
+ date: 2017-01-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ">="
18
+ - - "~>"
19
19
  - !ruby/object:Gem::Version
20
20
  version: '3.0'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - ">="
25
+ - - "~>"
26
26
  - !ruby/object:Gem::Version
27
27
  version: '3.0'
28
28
  - !ruby/object:Gem::Dependency