Skip to content

Commit

Permalink
Reformatted the code and added changelog.txt details.
Browse files Browse the repository at this point in the history
  • Loading branch information
spocke committed Aug 27, 2014
1 parent 336a3aa commit cca01dd
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 43 deletions.
1 change: 1 addition & 0 deletions changelog.txt
Expand Up @@ -4,6 +4,7 @@ Version 4.1.5 (2014-08-xx)
Fixed bug where empty list elements would result in empty LI elements without it's parent container.
Fixed bug where backspace in empty caret formated element could produce an type error exception of Gecko.
Fixed bug where lists pasted from word with a custom start index above 9 wouldn't be properly handled.
Fixed so custom images for menubutton/splitbutton can be provided. Patch contributed by Naim Hammadi.
Version 4.1.4 (2014-08-21)
Added new media_filter_html option to media plugin that blocks any conditional comments, scripts etc within a video element.
Added new content_security_policy option allows you to set custom policy for iframe contents. Patch contributed by Francois Chagnon.
Expand Down
47 changes: 24 additions & 23 deletions js/tinymce/classes/ui/MenuButton.js
Expand Up @@ -147,36 +147,37 @@ define("tinymce/ui/MenuButton", [
* @method renderHtml
* @return {String} HTML representing the control.
*/
renderHtml: function () {
var self = this, id = self._id, prefix = self.classPrefix;
var icon = self.settings.icon, image;

image = self.settings.image;
if (image) {
icon = 'none';

// Support for [high dpi, low dpi] image sources
if (typeof image != "string") {
image = window.getSelection ? image[0] : image[1];
}

image = ' style="background-image: url(\'' + image + '\')"';
} else {
image = '';
}
icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + icon : '';

self.aria('role', self.parent() instanceof MenuBar ? 'menuitem' : 'button');

return (
renderHtml: function () {
var self = this, id = self._id, prefix = self.classPrefix;
var icon = self.settings.icon, image;

image = self.settings.image;
if (image) {
icon = 'none';

// Support for [high dpi, low dpi] image sources
if (typeof image != "string") {
image = window.getSelection ? image[0] : image[1];
}

image = ' style="background-image: url(\'' + image + '\')"';
} else {
image = '';
}

icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + icon : '';

self.aria('role', self.parent() instanceof MenuBar ? 'menuitem' : 'button');

return (
'<div id="' + id + '" class="' + self.classes() + '" tabindex="-1" aria-labelledby="' + id + '">' +
'<button id="' + id + '-open" role="presentation" type="button" tabindex="-1">' +
(icon ? '<i class="' + icon + '"' + image + '></i>' : '') +
'<span>' + (self._text ? (icon ? '\u00a0' : '') + self.encode(self._text) : '') + '</span>' +
' <i class="' + prefix + 'caret"></i>' +
'</button>' +
'</div>'
);
);
},

/**
Expand Down
42 changes: 22 additions & 20 deletions js/tinymce/classes/ui/SplitButton.js
Expand Up @@ -67,25 +67,27 @@ define("tinymce/ui/SplitButton", [
* @method renderHtml
* @return {String} HTML representing the control.
*/
renderHtml: function () {
var self = this, id = self._id, prefix = self.classPrefix, image;
var icon = self.settings.icon;

image = self.settings.image;
if (image) {
icon = 'none';

// Support for [high dpi, low dpi] image sources
if (typeof image != "string") {
image = window.getSelection ? image[0] : image[1];
}

image = ' style="background-image: url(\'' + image + '\')"';
} else {
image = '';
}
icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + icon : '';
return (
renderHtml: function () {
var self = this, id = self._id, prefix = self.classPrefix, image;
var icon = self.settings.icon;

image = self.settings.image;
if (image) {
icon = 'none';

// Support for [high dpi, low dpi] image sources
if (typeof image != "string") {
image = window.getSelection ? image[0] : image[1];
}

image = ' style="background-image: url(\'' + image + '\')"';
} else {
image = '';
}

icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + icon : '';

return (
'<div id="' + id + '" class="' + self.classes() + '" role="button" tabindex="-1">' +
'<button type="button" hidefocus="1" tabindex="-1">' +
(icon ? '<i class="' + icon + '"' + image + '></i>' : '') +
Expand All @@ -97,7 +99,7 @@ define("tinymce/ui/SplitButton", [
' <i class="' + prefix + 'caret"></i>' +
'</button>' +
'</div>'
);
);
},

/**
Expand Down

0 comments on commit cca01dd

Please sign in to comment.