Skip to content

Commit

Permalink
Merge pull request #358 from madebymany/title-validation-fix
Browse files Browse the repository at this point in the history
Closes #357
  • Loading branch information
raffij committed Jul 9, 2015
2 parents a2716f6 + 8a33380 commit d435419
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 26 deletions.
30 changes: 24 additions & 6 deletions build/sir-trevor.debug.js
Expand Up @@ -2482,6 +2482,25 @@ return /******/ (function(modules) { // webpackBootstrap
'propertyIsEnumerable',
'constructor'
];
var equalsConstructorPrototype = function (o) {
var ctor = o.constructor;
return ctor && ctor.prototype === o;
};
var blacklistedKeys = ['window', 'console', 'parent', 'self', 'frames'];
var hasAutomationEqualityBug = (function () {
/* global window */
if (typeof window === 'undefined') { return false; }
for (var k in window) {
if (blacklistedKeys.indexOf(k) === -1 && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {
try {
equalsConstructorPrototype(window[k]);
} catch (e) {
return true;
}
}
}
return false;
}());

var keysShim = function keys(object) {
var isObject = object !== null && typeof object === 'object';
Expand Down Expand Up @@ -2514,8 +2533,7 @@ return /******/ (function(modules) { // webpackBootstrap
}

if (hasDontEnumBug) {
var ctor = object.constructor;
var skipConstructor = ctor && ctor.prototype === object;
var skipConstructor = hasAutomationEqualityBug || equalsConstructorPrototype(object);

for (var k = 0; k < dontEnums.length; ++k) {
if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {
Expand Down Expand Up @@ -22078,7 +22096,7 @@ return /******/ (function(modules) { // webpackBootstrap
icon_name: 'default',

validationFailMsg: function() {
return i18n.t('errors:validation_fail', { type: this.title() });
return i18n.t('errors:validation_fail', { type: this.title });
},

editorHTML: '<div class="st-block__editor"></div>',
Expand Down Expand Up @@ -22634,9 +22652,9 @@ return /******/ (function(modules) { // webpackBootstrap
*
* Example:
var opts = {
lines: 12, // The number of lines to draw
, length: 7, // The length of each line
, width: 5, // The line thickness
lines: 12 // The number of lines to draw
, length: 7 // The length of each line
, width: 5 // The line thickness
, radius: 10 // The radius of the inner circle
, scale: 1.0 // Scales overall size of the spinner
, corners: 1 // Roundness (0..1)
Expand Down
30 changes: 24 additions & 6 deletions build/sir-trevor.js
Expand Up @@ -2482,6 +2482,25 @@ return /******/ (function(modules) { // webpackBootstrap
'propertyIsEnumerable',
'constructor'
];
var equalsConstructorPrototype = function (o) {
var ctor = o.constructor;
return ctor && ctor.prototype === o;
};
var blacklistedKeys = ['window', 'console', 'parent', 'self', 'frames'];
var hasAutomationEqualityBug = (function () {
/* global window */
if (typeof window === 'undefined') { return false; }
for (var k in window) {
if (blacklistedKeys.indexOf(k) === -1 && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {
try {
equalsConstructorPrototype(window[k]);
} catch (e) {
return true;
}
}
}
return false;
}());

var keysShim = function keys(object) {
var isObject = object !== null && typeof object === 'object';
Expand Down Expand Up @@ -2514,8 +2533,7 @@ return /******/ (function(modules) { // webpackBootstrap
}

if (hasDontEnumBug) {
var ctor = object.constructor;
var skipConstructor = ctor && ctor.prototype === object;
var skipConstructor = hasAutomationEqualityBug || equalsConstructorPrototype(object);

for (var k = 0; k < dontEnums.length; ++k) {
if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {
Expand Down Expand Up @@ -22078,7 +22096,7 @@ return /******/ (function(modules) { // webpackBootstrap
icon_name: 'default',

validationFailMsg: function() {
return i18n.t('errors:validation_fail', { type: this.title() });
return i18n.t('errors:validation_fail', { type: this.title });
},

editorHTML: '<div class="st-block__editor"></div>',
Expand Down Expand Up @@ -22634,9 +22652,9 @@ return /******/ (function(modules) { // webpackBootstrap
*
* Example:
var opts = {
lines: 12, // The number of lines to draw
, length: 7, // The length of each line
, width: 5, // The line thickness
lines: 12 // The number of lines to draw
, length: 7 // The length of each line
, width: 5 // The line thickness
, radius: 10 // The radius of the inner circle
, scale: 1.0 // Scales overall size of the spinner
, corners: 1 // Roundness (0..1)
Expand Down
24 changes: 12 additions & 12 deletions build/sir-trevor.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion contributing.md
Expand Up @@ -69,6 +69,6 @@ SirTrevor saves json and relies on markdown parsers and third party image upload

We'd love SirTrevor to be available in as many languages as possible. If you would like to add a translations file it would be most welcome. Translations can be found in the ``/locales`` directory. Simply copy one of the existing translation files and replace the copy appropriately.

# Thats it
# That’s it

If you have further questions, contact one of the core team members or file an issue.
2 changes: 1 addition & 1 deletion src/block.js
Expand Up @@ -52,7 +52,7 @@ Object.assign(Block.prototype, SimpleBlock.fn, require('./block-validations'), {
icon_name: 'default',

validationFailMsg: function() {
return i18n.t('errors:validation_fail', { type: this.title() });
return i18n.t('errors:validation_fail', { type: this.title });
},

editorHTML: '<div class="st-block__editor"></div>',
Expand Down

0 comments on commit d435419

Please sign in to comment.