Skip to content

Commit 2eddb58

Browse files
committed
update assets
1 parent 8e7ee58 commit 2eddb58

File tree

4 files changed

+33
-15
lines changed

4 files changed

+33
-15
lines changed

Rakefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ task 'update' do
88
dest_javascript_path = "vendor/assets/javascripts/bootstrap-wysihtml5"
99
dest_css_path = "vendor/assets/stylesheets/bootstrap-wysihtml5"
1010

11-
system("rm -rf bootstrap-wysihtml5")
12-
system("git clone git://github.com/jhollingworth/bootstrap-wysihtml5.git")
11+
if Dir.exist?('bootstrap-wysihtml5')
12+
system("cd bootstrap-wysihtml5 && git pull && cd ..")
13+
else
14+
system("git clone git://github.com/jhollingworth/bootstrap-wysihtml5.git bootstrap-wysihtml5")
15+
end
1316

1417
system("cp #{origin_src_path}/bootstrap-wysihtml5.css #{dest_css_path}/core.css")
1518

@@ -42,6 +45,8 @@ end
4245

4346
desc "Publish a new version"
4447
task :publish => :build do
48+
tags = `git tag`.split
49+
system("git tag #{BootstrapWysihtml5Rails::Rails::VERSION}") unless tags.include?(BootstrapWysihtml5Rails::Rails::VERSION)
4550
system("gem push bootstrap-wysihtml5-rails-#{BootstrapWysihtml5Rails::Rails::VERSION}.gem")
4651
system("git push")
4752
end
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module BootstrapWysihtml5Rails
22
module Rails
3-
VERSION = "0.3.1.19"
3+
VERSION = "0.3.1.20"
44
end
55
end

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

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
"<li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='h1' tabindex='-1'>" + locale.font_styles.h1 + "</a></li>" +
1414
"<li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='h2' tabindex='-1'>" + locale.font_styles.h2 + "</a></li>" +
1515
"<li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='h3' tabindex='-1'>" + locale.font_styles.h3 + "</a></li>" +
16+
"<li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='h4'>" + locale.font_styles.h4 + "</a></li>" +
17+
"<li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='h5'>" + locale.font_styles.h5 + "</a></li>" +
18+
"<li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='h6'>" + locale.font_styles.h6 + "</a></li>" +
1619
"</ul>" +
1720
"</li>";
1821
},
@@ -50,6 +53,7 @@
5053
"</div>" +
5154
"<div class='modal-body'>" +
5255
"<input value='http://' class='bootstrap-wysihtml5-insert-link-url input-xlarge'>" +
56+
"<label class='checkbox'> <input type='checkbox' class='bootstrap-wysihtml5-insert-link-target' checked>" + locale.link.target + "</label>" +
5357
"</div>" +
5458
"<div class='modal-footer'>" +
5559
"<a href='#' class='btn' data-dismiss='modal'>" + locale.link.cancel + "</a>" +
@@ -282,6 +286,7 @@
282286
var self = this;
283287
var insertLinkModal = toolbar.find('.bootstrap-wysihtml5-insert-link-modal');
284288
var urlInput = insertLinkModal.find('.bootstrap-wysihtml5-insert-link-url');
289+
var targetInput = insertLinkModal.find('.bootstrap-wysihtml5-insert-link-target');
285290
var insertButton = insertLinkModal.find('a.btn-primary');
286291
var initialValue = urlInput.val();
287292
var caretBookmark;
@@ -294,10 +299,12 @@
294299
self.editor.composer.selection.setBookmark(caretBookmark);
295300
caretBookmark = null;
296301
}
302+
303+
var newWindow = targetInput.prop("checked");
297304
self.editor.composer.commands.exec("createLink", {
298-
href: url,
299-
target: "_blank",
300-
rel: "nofollow"
305+
'href' : url,
306+
'target' : (newWindow ? '_blank' : '_self'),
307+
'rel' : (newWindow ? 'nofollow' : '')
301308
});
302309
};
303310
var pressedEnter = false;
@@ -350,7 +357,7 @@
350357
});
351358
},
352359
shallowExtend: function (options) {
353-
var settings = $.extend({}, $.fn.wysihtml5.defaultOptions, options || {});
360+
var settings = $.extend({}, $.fn.wysihtml5.defaultOptions, options || {}, $(this).data());
354361
var that = this;
355362
return methods.bypassDefaults.apply(that, [settings]);
356363
},
@@ -416,6 +423,9 @@
416423
"h1": {},
417424
"h2": {},
418425
"h3": {},
426+
"h4": {},
427+
"h5": {},
428+
"h6": {},
419429
"blockquote": {},
420430
"u": 1,
421431
"img": {
@@ -427,12 +437,10 @@
427437
}
428438
},
429439
"a": {
430-
set_attributes: {
431-
target: "_blank",
432-
rel: "nofollow"
433-
},
434440
check_attributes: {
435-
href: "url" // important to avoid XSS
441+
'href': "url", // important to avoid XSS
442+
'target': 'alt',
443+
'rel': 'alt'
436444
}
437445
},
438446
"span": 1,
@@ -456,7 +464,10 @@
456464
normal: "Normal text",
457465
h1: "Heading 1",
458466
h2: "Heading 2",
459-
h3: "Heading 3"
467+
h3: "Heading 3",
468+
h4: "Heading 4",
469+
h5: "Heading 5",
470+
h6: "Heading 6"
460471
},
461472
emphasis: {
462473
bold: "Bold",
@@ -471,7 +482,8 @@
471482
},
472483
link: {
473484
insert: "Insert link",
474-
cancel: "Cancel"
485+
cancel: "Cancel",
486+
target: "Open link in new window"
475487
},
476488
image: {
477489
insert: "Insert image",

vendor/assets/javascripts/bootstrap-wysihtml5/locales/de-DE.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
},
2323
link: {
2424
insert: "Link einfügen",
25-
cancel: "Abbrechen"
25+
cancel: "Abbrechen",
26+
target: "Link in neuen Fenster öffnen"
2627
},
2728
image: {
2829
insert: "Bild einfügen",

0 commit comments

Comments
 (0)