Skip to content
This repository has been archived by the owner on Dec 4, 2018. It is now read-only.

Commit

Permalink
Merge pull request #51 from Lostmyname/feature/chameleon
Browse files Browse the repository at this point in the history
Use Chameleon API
  • Loading branch information
Vitor Arimitsu committed Aug 26, 2015
2 parents 4051b70 + 35dfa20 commit 55697fb
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion demo/base.erb.html
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ <h5>The most extraordinary and priceless gift I have ever given to any one befor
locale: 'en-GB'
},
//server: 'http://localhost:3020/widgets/actuallymonkey.json?callback=?',
server: 'http://lostmyname-staging.herokuapp.com/widgets/actuallymonkey.json?callback=?',
server: 'https://chameleon.lostmy.name/preview.json?callback=?',
icons: true
});

Expand Down
2 changes: 1 addition & 1 deletion src/js/monkey.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ window.Monkey = module.exports = (function () {
showCharPicker: true || $monkeyContainer.data('show-picker'),
showOverlay: $monkeyContainer.data('show-overlay'),

server: 'https://secure.lostmy.name/widgets/actuallymonkey.json?callback=?',
server: 'https://chameleon.lostmy.name/preview.json?callback=?',

book: {
name: $monkeyContainer.data('name'),
Expand Down
2 changes: 1 addition & 1 deletion src/js/steps/getData.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var $ = require('jquery');
* information on the pages. Seriously, just use a debugger.
*/
module.exports = function (options) {
return $.getJSON(options.server, { widget: options.book })
return $.getJSON(options.server, { book: options.book })
.then(function (data) {
// For backwards compatibility
if (!data.book.spreads) {
Expand Down
2 changes: 1 addition & 1 deletion src/js/steps/spread/getData.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ module.exports = function (monkeyData, options) {
return defer.promise();

function makeRequest() {
$.getJSON(options.server, { widget: options.book })
$.getJSON(options.server, { book: options.book })
.then(function (data) {
$.each(data.book.letters, function (i, letter) {
if (letter.type === 'spread' && letter.ready) {
Expand Down
2 changes: 1 addition & 1 deletion test/_helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ var options = {
bookFor: 'A personalised book made for',
noAltText: 'No alternative text for this page, sorry.'
},
server: 'https://secure.lostmy.name/widgets/actuallymonkey.json?callback=?',
server: 'https://chameleon.lostmy.name/preview.json?callback=?',
icons: true
};
2 changes: 1 addition & 1 deletion test/desktop.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe('Using monkey on desktop', function () {
monkey = new Monkey($container, {
monkeyType: 'desktop',
book: options.book,
server: 'http://lostmyname-staging.herokuapp.com/widgets/actuallymonkey.json?callback=?',
server: 'https://chameleon.lostmy.name/preview.json?callback=?',
icons: true
});

Expand Down
7 changes: 4 additions & 3 deletions test/loading.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ describe('Loading Monkey', function () {
gender: 'girl',
locale: 'en-GB'
},
server: 'http://lostmyname-staging.herokuapp.com/widgets/actuallymonkey.json?callback=?',
server: 'https://chameleon.lostmy.name/preview.json?callback=?',
icons: true
});

Expand All @@ -239,7 +239,7 @@ describe('Loading Monkey', function () {

return spreadPromise.then(function (monkeyData, spreadUrl) {
monkeyData.should.equal(data);
spreadUrl.should.containEql('spread.jpg');
spreadUrl.should.containEql('TEST.jpg');
});
});
});
Expand Down Expand Up @@ -313,7 +313,8 @@ describe('Loading Monkey', function () {
.then(Monkey.letters._generateHtml(options))
.then(function (data) {
var spans = data.lettersElement.find('.letter');
spans.length.should.equal(5 + 2);
// 4 stories + 1 bridge + 1 space + 2 covers
spans.length.should.equal(8);
spans.find('.char')[4].should.match(/ /);
});
});
Expand Down

0 comments on commit 55697fb

Please sign in to comment.