Skip to content

Commit

Permalink
Merge branch 'master' into frapell-tinymce
Browse files Browse the repository at this point in the history
  • Loading branch information
frapell committed Sep 18, 2018
2 parents 9ac8508 + 37ae9de commit 8a34ef6
Show file tree
Hide file tree
Showing 6 changed files with 6,213 additions and 5 deletions.
14 changes: 13 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ Breaking changes:

New features:

- Include TinyMCE 4.7.13
[erral]

- pat-structure: Use the datatables pattern for sorting columns
[frapell]

Expand All @@ -19,7 +22,9 @@ New features:
- Add a new pattern, to provide the DataTables functionality
https://datatables.net/
[frapell]
- *add item here*

- Add package-lock.json to git.
See https://github.com/npm/npm/blob/v5.0.0/doc/files/package-lock.json.md

Bug fixes:

Expand All @@ -33,6 +38,13 @@ Bug fixes:
- fix small message typos
[tkimnguyen]

- Remove patternslib "This pattern without a name attribute will not be
registered!" warnings by setting dummy name and trigger properties.
[sunew]

- Fix error when running tests: "Some of your tests did a full page reload!", due to a form submit with no preventDefault.
[sunew]


2.7.4 (2018-06-21)
------------------
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"requirejs-text": "2.0.15",
"select2": "3.5.4",
"selectivizr": "1.0.2",
"tinymce-builded": "4.7.6",
"tinymce-builded": "4.7.13",
"js-shortcuts": "^1.0.1",
"cs-jqtree-contextmenu": "^0.1.0"
},
Expand Down
8 changes: 5 additions & 3 deletions mockup/patterns/thememapper/pattern.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ define([
var inspectorTemplate = _.template(InspectorTemplate);

var Inspector = Base.extend({
name: 'thememapper-inspector',
trigger: '.pat-thememapper-inspector-dummy',
defaults: {
name: 'name',
ruleBuilder: null,
Expand Down Expand Up @@ -505,7 +507,7 @@ define([
self.hideInspectors();
}
});

self.btns.buildRuleButton = new AnchorView({
id: 'buildrule',
title: _t('Build rule'),
Expand Down Expand Up @@ -588,7 +590,7 @@ define([
triggerView: self.btns.buildLessButton,
app: self
});


self.menus.tools = new DropdownView({
title: _t('Tools'),
Expand All @@ -601,7 +603,7 @@ define([
icon: 'file',
disable: function() {}
});

self.buttonGroup = new ButtonGroup({
items: [
self.menus.tools,
Expand Down
14 changes: 14 additions & 0 deletions mockup/patterns/tinymce/js/links.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ define([
'use strict';

var LinkType = Base.extend({
name: 'linktype',
trigger: '.pat-linktype-dummy',
defaults: {
linkModal: null // required
},
Expand Down Expand Up @@ -55,6 +57,8 @@ define([
});

var ExternalLink = LinkType.extend({
name: 'externallinktype',
trigger: '.pat-externallinktype-dummy',
init: function() {
LinkType.prototype.init.call(this);
this.getEl().on('change', function(){
Expand All @@ -73,6 +77,8 @@ define([
});

var InternalLink = LinkType.extend({
name: 'internallinktype',
trigger: '.pat-internallinktype-dummy',
init: function() {
LinkType.prototype.init.call(this);
this.getEl().addClass('pat-relateditems');
Expand Down Expand Up @@ -134,6 +140,8 @@ define([
});

var UploadLink = LinkType.extend({
name: 'uploadlinktype',
trigger: '.pat-uploadlinktype-dummy',
/* need to do it a bit differently here.
when a user uploads and tries to upload from
it, you need to delegate to the real insert
Expand Down Expand Up @@ -163,13 +171,17 @@ define([
});

var ImageLink = InternalLink.extend({
name: 'imagelinktype',
trigger: '.pat-imagelinktype-dummy',
toUrl: function() {
var value = this.value();
return this.tinypattern.generateImageUrl(value, this.linkModal.$scale.val());
}
});

var EmailLink = LinkType.extend({
name: 'emaillinktype',
trigger: '.pat-emaillinktype-dummy',
toUrl: function() {
var self = this;
var val = self.value();
Expand Down Expand Up @@ -201,6 +213,8 @@ define([
});

var AnchorLink = LinkType.extend({
name: 'anchorlinktype',
trigger: '.pat-anchorlinktype-dummy',
init: function() {
LinkType.prototype.init.call(this);
this.$select = this.$el.find('select');
Expand Down
4 changes: 4 additions & 0 deletions mockup/tests/pattern-tinymce-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,10 @@ define([
var changed_txt = 'changed contents';
$editable.html(changed_txt);
var $form = $container.find('form');
// Avoid error when running tests: "Some of your tests did a full page reload!"
$container.submit(function(e) {
e.preventDefault();
});
$container.trigger('submit');
expect($el.val()).to.be.equal(changed_txt);
tinymce.get(0).remove();
Expand Down
Loading

0 comments on commit 8a34ef6

Please sign in to comment.