Skip to content

Commit

Permalink
Merge branch '2.1.4' into fix-no-label-capitalize-in-css
Browse files Browse the repository at this point in the history
  • Loading branch information
aeschylus committed Feb 22, 2017
2 parents 0959175 + 6a56c3e commit 28fbbc3
Show file tree
Hide file tree
Showing 12 changed files with 44 additions and 40 deletions.
2 changes: 2 additions & 0 deletions Gruntfile.js
Expand Up @@ -39,6 +39,8 @@ module.exports = function(grunt) {
'js/lib/paper-core.min.js',
'js/lib/spectrum.js',
'js/lib/i18next.min.js',
'js/lib/i18nextBrowserLanguageDetector.min.js',
'js/lib/i18nextXHRBackend.min.js',
'js/lib/modernizr.custom.js',
'js/lib/sanitize-html.min.js'
],
Expand Down
8 changes: 3 additions & 5 deletions js/lib/i18next.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions js/lib/i18nextBrowserLanguageDetector.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions js/lib/i18nextXHRBackend.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions js/src/annotations/annotationTooltip.js
Expand Up @@ -196,18 +196,18 @@
event.preventDefault();
var elem = this;
new $.DialogBuilder(viewerParams.container).dialog({
message: i18n.t('deleteAnnotation'),
message: i18next.t('deleteAnnotation'),
closeButton: false,
buttons: {
'no': {
label: i18n.t('no'),
label: i18next.t('no'),
className: 'btn-default',
callback: function() {
return;
}
},
'yes': {
label: i18n.t('yes'),
label: i18next.t('yes'),
className: 'btn-primary',
callback: function() {
var display = jQuery(elem).parents('.annotation-display');
Expand Down
20 changes: 10 additions & 10 deletions js/src/annotations/osd-svg-overlay.js
Expand Up @@ -147,19 +147,19 @@
handleDeleteShapeEvent: function (event, shape) {
var _this = this;
new $.DialogBuilder(this.slotWindowElement).dialog({
message: i18n.t('deleteShape'),
message: i18next.t('deleteShape'),
closeButton: false,
className: 'mirador-dialog',
buttons: {
'no': {
label: i18n.t('no'),
label: i18next.t('no'),
className: 'btn-default',
callback: function() {
return;
}
},
'yes': {
label: i18n.t('yes'),
label: i18next.t('yes'),
className: 'btn-primary',
callback: function() {
_this.deleteShape(shape);
Expand Down Expand Up @@ -257,12 +257,12 @@
var onAnnotationSaved = jQuery.Deferred();
if (!_this.draftPaths.length) {
new $.DialogBuilder(_this.slotWindowElement).dialog({
message: i18n.t('editModalSaveAnnotationWithNoShapesMsg'),
message: i18next.t('editModalSaveAnnotationWithNoShapesMsg'),
closeButton: false,
className: 'mirador-dialog',
buttons: {
success: {
label: i18n.t('editModalBtnSaveWithoutShapes'),
label: i18next.t('editModalBtnSaveWithoutShapes'),
className: 'btn-success',
callback: function () {
oaAnno.on = {
Expand All @@ -275,15 +275,15 @@
}
},
danger: {
label: i18n.t('editModalBtnDeleteAnnotation'),
label: i18next.t('editModalBtnDeleteAnnotation'),
className: 'btn-danger',
callback: function () {
_this.eventEmitter.publish('annotationDeleted.' + _this.windowId, [oaAnno['@id']]);
onAnnotationSaved.resolve();
}
},
main: {
label: i18n.t('cancel'),
label: i18next.t('cancel'),
className: 'btn-default',
callback: function () {
onAnnotationSaved.reject();
Expand Down Expand Up @@ -382,19 +382,19 @@
};
if (!immediate) {
new $.DialogBuilder(_this.slotWindowElement).dialog({
message: i18n.t('cancelAnnotation'),
message: i18next.t('cancelAnnotation'),
closeButton: false,
className: 'mirador-dialog',
buttons: {
'no': {
label: i18n.t('no'),
label: i18next.t('no'),
className: 'btn-default',
callback: function() {
return;
}
},
'yes': {
label: i18n.t('yes'),
label: i18next.t('yes'),
className: 'btn-primary',
callback: function() {
cancel();
Expand Down
4 changes: 2 additions & 2 deletions js/src/viewer.js
Expand Up @@ -44,7 +44,7 @@
var _this = this;

//initialize i18next
i18n.init({
i18next.use(i18nextXHRBackend).use(i18nextBrowserLanguageDetector).init({
fallbackLng: 'en',
load: 'unspecific',
debug: false,
Expand All @@ -63,7 +63,7 @@

//register Handlebars helper
Handlebars.registerHelper('t', function(i18n_key) {
var result = i18n.t(i18n_key);
var result = i18next.t(i18n_key);
return new Handlebars.SafeString(result);
});

Expand Down
10 changes: 5 additions & 5 deletions js/src/widgets/metadataView.js
Expand Up @@ -145,17 +145,17 @@

getMetadataRights: function(jsonLd) {
return [
{label: i18n.t('license'), value: jsonLd.license || ''},
{label: i18n.t('attribution'), value: $.JsonLd.getTextValue(jsonLd.attribution) || ''}
{label: i18next.t('license'), value: jsonLd.license || ''},
{label: i18next.t('attribution'), value: $.JsonLd.getTextValue(jsonLd.attribution) || ''}
];
},

getMetadataLinks: function(jsonLd) {
// #414
return [
{label: i18n.t('related'), value: this.stringifyRelated(jsonLd.related || '')},
{label: i18n.t('seeAlso'), value: this.stringifyRelated(jsonLd.seeAlso || '')},
{label: i18n.t('within'), value: this.stringifyObject(jsonLd.within || '')}
{label: i18next.t('related'), value: this.stringifyRelated(jsonLd.related || '')},
{label: i18next.t('seeAlso'), value: this.stringifyRelated(jsonLd.seeAlso || '')},
{label: i18next.t('within'), value: this.stringifyObject(jsonLd.within || '')}
];
},

Expand Down
2 changes: 2 additions & 0 deletions karma.conf.js
Expand Up @@ -31,6 +31,8 @@ module.exports = function(config) {
'js/lib/paper-core.min.js',
'js/lib/spectrum.js',
'js/lib/i18next.min.js',
'js/lib/i18nextBrowserLanguageDetector.min.js',
'js/lib/i18nextXHRBackend.min.js',
'js/lib/modernizr.custom.js',
'js/lib/sanitize-html.min.js',
'node_modules/sinon/pkg/sinon.js',
Expand Down
6 changes: 3 additions & 3 deletions spec/annotations/osd-svg-overlay.test.js
Expand Up @@ -15,7 +15,7 @@ describe('Overlay', function() {
beforeEach(function() {
//register Handlebars helper
Handlebars.registerHelper('t', function(i18n_key) {
var result = i18n.t(i18n_key);
var result = i18next.t(i18n_key);
return new Handlebars.SafeString(result);
});

Expand Down Expand Up @@ -526,11 +526,11 @@ describe('Overlay', function() {
it('set and remove mouse tool', function() {
var key = this.overlay.mouseToolKey;
var paperScope = this.overlay.paperScope;

this.overlay.setMouseTool();
expect(paperScope.tools.length).toEqual(1);
expect(jQuery.data(document.body, key)).toBe(paperScope.tools[0]);

this.overlay.removeMouseTool();
expect(paperScope.tools.length).toEqual(0);
expect(jQuery.data(document.body, key)).toBeUndefined();
Expand Down
2 changes: 1 addition & 1 deletion spec/viewer/mainMenu.js
Expand Up @@ -5,7 +5,7 @@ describe('MainMenu', function () {

//register Handlebars helper
Handlebars.registerHelper('t', function(i18n_key) {
var result = i18n.t(i18n_key);
var result = i18next.t(i18n_key);
return new Handlebars.SafeString(result);
});

Expand Down
22 changes: 11 additions & 11 deletions spec/workspace.test.js
Expand Up @@ -4,10 +4,10 @@ describe('Workspace', function() {
this.viewer = {};
this.viewerDiv = jQuery('<div/>');
jasmine.getFixtures().set(this.viewerDiv);

//register Handlebars helper
Handlebars.registerHelper('t', function(i18n_key) {
var result = i18n.t(i18n_key);
var result = i18next.t(i18n_key);
return new Handlebars.SafeString(result);
});
});
Expand Down Expand Up @@ -46,7 +46,7 @@ describe('Workspace', function() {
expect(this.workspace.slots.length).toBe(3);
expect(this.workspace.layoutDescription.children[0].children[0].id).toBe(originalId);
});

it('should have new children and structure (even if root)', function() {
this.workspace = new Mirador.Workspace({
parent: this.viewer, //viewer
Expand All @@ -65,7 +65,7 @@ describe('Workspace', function() {
expect(this.workspace.slots.length).toEqual(2);
expect(this.workspace.layoutDescription.children[0].id).toBe(originalId);
});

it('should have new children and structure splitting down or up (even if root)', function() {
this.workspace = new Mirador.Workspace({
parent: this.viewer, //viewer
Expand Down Expand Up @@ -104,7 +104,7 @@ describe('Workspace', function() {
return child.id;
});
newDescriptionChildrenIds.splice(0,1);

newSlotIDs = this.workspace.slots.map(function(slot) {
return slot.slotID;
});
Expand All @@ -122,7 +122,7 @@ describe('Workspace', function() {
return slot.slotID;
})).toEqual(newSlotIDs);
});

it('should remove sibling and create new parent with same id as target', function() {
this.workspace = new Mirador.Workspace({
parent: this.viewer, //viewer
Expand All @@ -137,15 +137,15 @@ describe('Workspace', function() {

this.workspace.splitDown(this.workspace.slots[0]);
var newSlotID = this.workspace.slots[2].slotID;

this.workspace.removeNode(this.workspace.slots[0]);

expect(this.workspace.layoutDescription.children.length).toBe(2);
expect(this.workspace.slots.length).toEqual(2);
expect(this.workspace.layoutDescription.children[0].id).toBe(newSlotID);
expect(this.workspace.slots[1].slotID).toBe(newSlotID);
});

xit('should remove sibling and create new parent with same id as target (even if siblings have children)', function() {
this.workspace = new Mirador.Workspace({
parent: this.viewer, //viewer
Expand All @@ -161,7 +161,7 @@ describe('Workspace', function() {
// split the right slot (column)
this.workspace.splitDown(this.workspace.slots[1]);
var newSlotID = this.workspace.slots[2].slotID;

// remove the left slot...
this.workspace.removeNode(this.workspace.slots[0]);

Expand All @@ -171,7 +171,7 @@ describe('Workspace', function() {
expect(this.workspace.layoutDescription.children[1].id).toBe(newSlotID);
expect(this.workspace.slots[1].slotID).toBe(newSlotID);
});

xit('should remove sibling and create new parent with same id as target (even if root)', function() {
this.workspace = new Mirador.Workspace({
parent: this.viewer, //viewer
Expand All @@ -191,7 +191,7 @@ describe('Workspace', function() {
expect(this.workspace.layoutDescription.id).toBe(originalId);
expect(this.workspace.slots[0].slotID).toBe(originalId);
});

});

xdescribe('Adding Windows', function() {
Expand Down

0 comments on commit 28fbbc3

Please sign in to comment.