tinymce-rails-imageupload 3.5.8.2 → 3.5.8.3

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.asc CHANGED
@@ -2,17 +2,17 @@
2
2
  Version: GnuPG/MacGPG2 v2.0.19 (Darwin)
3
3
  Comment: GPGTools - http://gpgtools.org
4
4
 
5
- iQIcBAABAgAGBQJRPcrbAAoJEH1ncb0Txu7X100QAIdeXTJIOfwbEzoFFZaG2bYH
6
- rYBVikOAftAFlESiuPawPmnzAjNBQjoDCxCfaO77hgEGuc8VT9Ffnfvy/rpMZNhP
7
- 78Ivj1yN86yahDmu0adzUklmWqMJriVA0JRhxHnYkvBRQWzIupQaS0x/sBNYYlUh
8
- 004257tZf/dnJZGIS6gF7L2JZHEoyCeikKDMoFZ+cR8ICWNoN0N7q0jXANwyIw1V
9
- kakPub45fLT/9yTbZ+/aBMmZ29qB01yB0kG2q3zAOWBP81hT5dZ7sUxFfjjHXvEC
10
- N/4/6egjz1fJ0n1rif0C6SgA45DlMB4RS5AtxQgcSlJP1+SHRI6zTCoRHbZOkeGE
11
- QGuCaUN/2cM+GkCyjaTf/SIhprP7T6OJdgF4HNzZNQwGblnytI7hfefLIfoKLlDd
12
- G9qopp6u+ZxJPT4MBQhSIdSlvQzlup1dKADhTtoDZ8GppoNieGrmRxdyRWpusm2+
13
- BONwijsAW8v3J8UW4kaFc6fAakv66sLf7YyK1CNmn0KuKmeiFInWAP9Ahgxj2Q/J
14
- i7GdMkT7A7203Q/D9kxZO1w5z6xH8gY1GejbcYhT5kVrmGgbhz8lybfqLdJY3xEo
15
- +OLk1PDjp1/FS5AYg+B2k88VEnKl5R1R2PYpG/6Kvz0mCdteCOJUoxgHQ1fzyd6v
16
- OGhUP/jAdovgjUijgOQx
17
- =y3Fq
5
+ iQIcBAABAgAGBQJRRv6YAAoJEH1ncb0Txu7XC7IP/25BWQn8lYTaEHKhDCjrrYeH
6
+ cuSTmNmhwCZdCl+lwPSeRcEFX1qRB04AALKw/2nr4tBBOfdbOJLBkAU5xKw99sx9
7
+ 0kLYTgpvUag4j7wxOZAy+Asj4UxeQo9DJkyjrLm6Q5q6gvA8oHQWIiTDtDJONOdc
8
+ vOFVz1dA8TWggK7zlLurlo8ujXMESzdPT3YxBxW393FaJhESVBxzFuxuiiUiMORQ
9
+ aS9ck5Ty+ZC2AFh+z/jX7rcSUzBtAZgdYKnzqD6O6f5DuAzbAkoxO4P4kj8Lb+Zp
10
+ upXk1X0N6GseAsNkhHIwDltVv6qWXgHytYecBNyicBXqLXjNVZUAvxp6EWkwzAUp
11
+ k1zZirRYCEUaaIox6U2DQHXLXjo3kLSDr4/1tWN9AMemxobuaVC+ZuGrNG3++FA0
12
+ hNNNMQl+l+YHLsJEEZ3gQIyLsydKjglb8DOkOjgJgnDjvAzy/ZlMYMnty/ltyA36
13
+ 5eVvkZyobUl1oYM1all4eI4PBuGMTHmq8vOWDBNDIdvNUxN997+jiA+PQ7Ovj8qj
14
+ z9j3B8Da2UP9nN+nE9QU8Tlh2PYrxBRkPZUGXg0nmA/Nxw/ewmPom+CiGpq4DLtg
15
+ 2w+CBwk86mXwnF/Kgng7/9fdCoc4SYCeEAQzfNFdI35D0/HiT27BzsnDx9MTOpZh
16
+ hxURDjQbCwBQPnUsWGs5
17
+ =g0oZ
18
18
  -----END PGP SIGNATURE-----
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ # 3.5.8.3 / 2013-03-18
2
+
3
+ * Add option for assigning class to img tag. Thanks to nathanshox (Nathan Shaughnessy)
4
+ * Add alt attribute to img tag and input for user to set it. Thanks to nathanshox (Nathan Shaughnessy)
5
+
1
6
  # 3.5.8.2 / 2013-03-11
2
7
 
3
8
  * Added fr-FR translations. Thanks to pompombidou (Harold Simpson)
data/README.md CHANGED
@@ -56,6 +56,12 @@
56
56
 
57
57
  If the JSON response contains a `width` and/or `height` key, those will be used in the inserted HTML (`<img src="..." width="..." height="...">`), but if those are not present, the inserted HTML is just `<img src="...">`.
58
58
 
59
+ ### Default class for img tag
60
+
61
+ By default the plugin doesn't assign any class to the img tag. You can set the class(es) by supplying the `uploadimage_default_img_class` option in the call to `.tinymce()`.
62
+
63
+ `class="..."` will only be added to the img tag if a default is specified. Otherwise the inserted HTML is just `<img src="...">`.
64
+
59
65
  ## Error handling
60
66
 
61
67
  To notify the uploader that an error occurred, return JSON containing a `error` key with a `message`.
@@ -1,7 +1,7 @@
1
1
  module Tinymce
2
2
  module Rails
3
3
  module Imageupload
4
- VERSION = "3.5.8.2"
4
+ VERSION = "3.5.8.3"
5
5
  end
6
6
  end
7
7
  end
@@ -17,6 +17,6 @@ Gem::Specification.new do |s|
17
17
 
18
18
  s.add_runtime_dependency "railties", ">= 3.1"
19
19
  s.add_runtime_dependency "tinymce-rails", ">= 3.4.9"
20
- s.add_development_dependency "bundler", "~> 1.0.0"
20
+ s.add_development_dependency "bundler", "~> 1.0"
21
21
  s.add_development_dependency "rails", ">= 3.1"
22
22
  end
@@ -65,14 +65,20 @@
65
65
  },
66
66
 
67
67
  buildHTML: function(json) {
68
- var imgstr = "<br><img src='" + json["image"]["url"] + "'";
68
+ var default_class = tinyMCEPopup.getParam("uploadimage_default_img_class", "");
69
+ var alt_text = document.getElementById("alt_text").value;
70
+
71
+ var imgstr = "<img src='" + json["image"]["url"] + "'";
72
+
73
+ if(default_class != "")
74
+ imgstr += " class='" + default_class + "'";
69
75
 
70
76
  if(json["image"]["height"])
71
77
  imgstr += " height='" + json["image"]["height"] + "'";
72
78
  if(json["image"]["width"])
73
79
  imgstr += " width='" + json["image"]["width"] + "'";
74
80
 
75
- imgstr += "/>";
81
+ imgstr += " alt='" + alt_text + "'/>";
76
82
 
77
83
  return imgstr;
78
84
  },
@@ -122,6 +128,8 @@
122
128
  <label id='file_upload_label' for='file_upload'>{#uploadimage_dlg.input}:</label>
123
129
  <input type='file' name='file' id='file_upload'>
124
130
  <p id="error_message"></p>
131
+ <label id='alt_text_label' for='alt_text'>{#uploadimage_dlg.alt_text}:</label>
132
+ <input type="text" name="alt" id="alt_text">
125
133
 
126
134
  <div class="mceActionPanel">
127
135
  <input type="button" id="insert" name="insert" value="{#uploadimage_dlg.insert}" onclick="UploadImageDialog.insert();"/>
@@ -5,7 +5,7 @@
5
5
  ed.addCommand('mceUploadImage', function() {
6
6
  return ed.windowManager.open({
7
7
  file: url + '/dialog.html',
8
- width: 320 + parseInt(ed.getLang('uploadimage.delta_width', 0)),
8
+ width: 350 + parseInt(ed.getLang('uploadimage.delta_width', 0)),
9
9
  height: 180 + parseInt(ed.getLang('uploadimage.delta_height', 0)),
10
10
  inline: 1
11
11
  }, {
@@ -7,5 +7,6 @@ tinyMCE.addI18n('en.uploadimage_dlg', {
7
7
  bad_response: "Got a bad response from the server",
8
8
  blank_response: "Didn't get a response from the server",
9
9
  insert: "Insert",
10
- cancel: "Cancel"
10
+ cancel: "Cancel",
11
+ alt_text: "Image description"
11
12
  });
@@ -7,5 +7,6 @@ tinyMCE.addI18n('fr.uploadimage_dlg', {
7
7
  bad_response: "Le serveur a envoyé une réponse erronée",
8
8
  blank_response: "Le serveur n'a pas renvoyé de réponse",
9
9
  insert: "Insérer",
10
- cancel: "Annuler"
10
+ cancel: "Annuler",
11
+ alt_text: "Description de l'image"
11
12
  });
@@ -7,5 +7,6 @@ tinyMCE.addI18n('nb.uploadimage_dlg', {
7
7
  bad_response: "Fikk et ugyldig svar fra serveren",
8
8
  blank_response: "Fikk ikke svar fra serveren",
9
9
  insert: "Sett inn",
10
- cancel: "Avbryt"
10
+ cancel: "Avbryt",
11
+ alt_text: "Alternativ tekst for bilde"
11
12
  });
@@ -7,5 +7,6 @@ tinyMCE.addI18n('pt_BR.uploadimage_dlg', {
7
7
  bad_response: "Resposta inesperada do servidor",
8
8
  blank_response: "Servidor não está respondendo",
9
9
  insert: "Inserir",
10
- cancel: "Cancelar"
10
+ cancel: "Cancelar",
11
+ alt_text: "Image description"
11
12
  });
@@ -7,5 +7,6 @@ tinyMCE.addI18n('pt.uploadimage_dlg', {
7
7
  bad_response: "Resposta inesperada do servidor",
8
8
  blank_response: "Não foi obtida uma resposta do servidor",
9
9
  insert: "Inserir",
10
- cancel: "Cancelar"
10
+ cancel: "Cancelar",
11
+ alt_text: "Image description"
11
12
  });
@@ -7,5 +7,6 @@ tinyMCE.addI18n('ru.uploadimage_dlg', {
7
7
  bad_response: "Получен некорректный ответ с сервера",
8
8
  blank_response: "Не получен ответ с сервера",
9
9
  insert: "Вставить",
10
- cancel: "Отмена"
10
+ cancel: "Отмена",
11
+ alt_text: "Информация об изображении"
11
12
  });
metadata CHANGED
@@ -2,14 +2,14 @@
2
2
  name: tinymce-rails-imageupload
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 3.5.8.2
5
+ version: 3.5.8.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - Per Christian B. Viken
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-11 00:00:00.000000000 Z
12
+ date: 2013-03-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
@@ -51,14 +51,14 @@ dependencies:
51
51
  requirements:
52
52
  - - ~>
53
53
  - !ruby/object:Gem::Version
54
- version: 1.0.0
54
+ version: '1.0'
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  none: false
58
58
  requirements:
59
59
  - - ~>
60
60
  - !ruby/object:Gem::Version
61
- version: 1.0.0
61
+ version: '1.0'
62
62
  - !ruby/object:Gem::Dependency
63
63
  name: rails
64
64
  type: :development
metadata.gz.asc CHANGED
@@ -2,17 +2,17 @@
2
2
  Version: GnuPG/MacGPG2 v2.0.19 (Darwin)
3
3
  Comment: GPGTools - http://gpgtools.org
4
4
 
5
- iQIcBAABAgAGBQJRPcrbAAoJEH1ncb0Txu7XOL8P+wQsEHn3wWkBsrE80RIPrkmE
6
- aImqjgWKSsTHu0SPNLLVD39BUfh45p8nBlqTGwZ3i37IFZ5DzFfVa1/VjdQZmvIs
7
- Q01QoN/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