Skip to content

Commit bb68dfc

Browse files
Merge pull request #1 from teespring/platform#162432786-fix_insert_images
Fix bug in which we could not insert images or links using the editor
2 parents 3a2ecde + 1305a63 commit bb68dfc

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

vendor/assets/javascripts/bootstrap-wysihtml5/core-b3.js.erb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"<h3 class='modal-title'>" + locale.link.insert + "</h3>" +
5757
"</div>" +
5858
"<div class='modal-body'>" +
59-
"<input value='http://' class='bootstrap-wysihtml5-insert-link-url form-control'>" +
59+
"<input placeholder='http://' class='bootstrap-wysihtml5-insert-link-url form-control'>" +
6060
"<label class='checkbox'> <input type='checkbox' class='bootstrap-wysihtml5-insert-link-target' checked>" + locale.link.target + "</label>" +
6161
"</div>" +
6262
"<div class='modal-footer'>" +
@@ -81,7 +81,7 @@
8181
"<h3 class='modal-title'>" + locale.image.insert + "</h3>" +
8282
"</div>" +
8383
"<div class='modal-body'>" +
84-
"<input value='http://' class='bootstrap-wysihtml5-insert-image-url form-control'>" +
84+
"<input placeholder='http://link-to-your-image.png' class='bootstrap-wysihtml5-insert-image-url form-control'>" +
8585
"</div>" +
8686
"<div class='modal-footer'>" +
8787
"<a href='#' class='btn btn-default' data-dismiss='modal'>" + locale.image.cancel + "</a>" +
@@ -278,7 +278,7 @@
278278
var activeButton = $(this).hasClass("wysihtml5-command-active");
279279

280280
if (!activeButton) {
281-
self.editor.currentView.element.focus(false);
281+
self.editor.currentView.element.focus({});
282282
caretBookmark = self.editor.composer.selection.getBookmark();
283283
insertImageModal.appendTo('body').modal('show');
284284
insertImageModal.on('click.dismiss.modal', '[data-dismiss="modal"]', function(e) {
@@ -340,7 +340,7 @@
340340
var activeButton = $(this).hasClass("wysihtml5-command-active");
341341

342342
if (!activeButton) {
343-
self.editor.currentView.element.focus(false);
343+
self.editor.currentView.element.focus({});
344344
caretBookmark = self.editor.composer.selection.getBookmark();
345345
insertLinkModal.appendTo('body').modal('show');
346346
insertLinkModal.on('click.dismiss.modal', '[data-dismiss="modal"]', function(e) {
@@ -496,7 +496,7 @@
496496
target: "Open link in new window"
497497
},
498498
image: {
499-
insert: "Insert image",
499+
insert: "Insert image URL",
500500
cancel: "Cancel"
501501
},
502502
html: {

vendor/assets/javascripts/bootstrap-wysihtml5/core.js.erb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"<h3>" + locale.link.insert + "</h3>" +
5555
"</div>" +
5656
"<div class='modal-body'>" +
57-
"<input value='http://' class='bootstrap-wysihtml5-insert-link-url input-xlarge'>" +
57+
"<input placeholder='http://' class='bootstrap-wysihtml5-insert-link-url input-xlarge'>" +
5858
"<label class='checkbox'> <input type='checkbox' class='bootstrap-wysihtml5-insert-link-target' checked>" + locale.link.target + "</label>" +
5959
"</div>" +
6060
"<div class='modal-footer'>" +
@@ -75,7 +75,7 @@
7575
"<h3>" + locale.image.insert + "</h3>" +
7676
"</div>" +
7777
"<div class='modal-body'>" +
78-
"<input value='http://' class='bootstrap-wysihtml5-insert-image-url input-xlarge'>" +
78+
"<input placeholder='http://link-to-your-image.png' class='bootstrap-wysihtml5-insert-image-url input-xlarge'>" +
7979
"</div>" +
8080
"<div class='modal-footer'>" +
8181
"<a href='#' class='btn' data-dismiss='modal'>" + locale.image.cancel + "</a>" +
@@ -270,7 +270,7 @@
270270
var activeButton = $(this).hasClass("wysihtml5-command-active");
271271

272272
if (!activeButton) {
273-
self.editor.currentView.element.focus(false);
273+
self.editor.currentView.element.focus({});
274274
caretBookmark = self.editor.composer.selection.getBookmark();
275275
insertImageModal.appendTo('body').modal('show');
276276
insertImageModal.on('click.dismiss.modal', '[data-dismiss="modal"]', function(e) {
@@ -332,7 +332,7 @@
332332
var activeButton = $(this).hasClass("wysihtml5-command-active");
333333

334334
if (!activeButton) {
335-
self.editor.currentView.element.focus(false);
335+
self.editor.currentView.element.focus({});
336336
caretBookmark = self.editor.composer.selection.getBookmark();
337337
insertLinkModal.appendTo('body').modal('show');
338338
insertLinkModal.on('click.dismiss.modal', '[data-dismiss="modal"]', function(e) {

vendor/assets/javascripts/bootstrap-wysihtml5/wysihtml5.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9136,7 +9136,7 @@ wysihtml5.views.Textarea = wysihtml5.views.View.extend(
91369136
});
91379137

91389138
dialog.observe("cancel", function() {
9139-
that.editor.focus(false);
9139+
that.editor.focus({});
91409140
that.editor.fire("cancel:dialog", { command: command, dialogContainer: dialogElement, commandLink: link });
91419141
});
91429142
}
@@ -9166,7 +9166,7 @@ wysihtml5.views.Textarea = wysihtml5.views.View.extend(
91669166

91679167
_execCommand: function(command, commandValue) {
91689168
// Make sure that composer is focussed (false => don't move caret to the end)
9169-
this.editor.focus(false);
9169+
this.editor.focus({});
91709170

91719171
this.composer.commands.exec(command, commandValue);
91729172
this._updateLinkStates();

0 commit comments

Comments
 (0)