Permalink
Browse files

The camelCase is getting annoying.

  • Loading branch information...
nicksergeant committed Aug 22, 2012
1 parent 8f7ed4f commit 199e88ce1376e236919e66089042426ed1bff427
Showing with 17 additions and 17 deletions.
  1. +16 −16 media/js/embedder/amara.js
  2. +1 −1 media/js/embedder/embedder.js
View
@@ -9532,13 +9532,13 @@ Popcorn.plugin('amarasubtitle', {
// This var will be true once we've retrieved the rest of the model attrs
// from the Amara API.
- isComplete: false,
+ is_complete: false,
// Set from within the embedder.
div: '',
height: '',
- initialLanguage: null,
- isOnAmara: null,
+ initial_language: null,
+ is_on_amara: null,
subtitles: [], // Backbone collection
url: '',
width: '',
@@ -9575,7 +9575,7 @@ Popcorn.plugin('amarasubtitle', {
if (resp.objects.length) {
// The video exists on Amara.
- video.set('isOnAmara', true);
+ video.set('is_on_amara', true);
// There should only be one object.
if (resp.objects.length === 1) {
@@ -9585,21 +9585,21 @@ Popcorn.plugin('amarasubtitle', {
// Set the initial language to either the one provided by the initial
// options, or the original language from the API.
- video.set('initialLanguage',
- video.get('initialLanguage') ||
+ video.set('initial_language',
+ video.get('initial_language') ||
video.get('original_language')
);
}
} else {
// The video does not exist on Amara.
- video.set('isOnAmara', false);
+ video.set('is_on_amara', false);
}
// Mark that the video model has been completely populated.
- video.set('isComplete', true);
+ video.set('is_complete', true);
}
});
}
@@ -9678,7 +9678,7 @@ Popcorn.plugin('amarasubtitle', {
// Create the actual core DOM for the Amara container.
that.$el.append(that.template({
- video_url: 'http://www.universalsubtitles.org/en/videos/' + that.model.get('id'),
+ video_url: 'http://staging.universalsubtitles.org/en/videos/' + that.model.get('id'),
width: that.model.get('width')
}));
@@ -9697,15 +9697,15 @@ Popcorn.plugin('amarasubtitle', {
function() {
// Grab the subtitles for the initial language and do yo' thang.
- if (that.model.get('isOnAmara')) {
+ if (that.model.get('is_on_amara')) {
// Make the request to fetch the initial subtitles.
- that.fetchSubtitles(that.model.get('initialLanguage'), function() {
+ that.fetchSubtitles(that.model.get('initial_language'), function() {
// When we've got a response with the subtitles, start building
// out the transcript viewer and subtitles.
- that.buildTranscript(that.model.get('initialLanguage'));
- that.buildSubtitles(that.model.get('initialLanguage'));
+ that.buildTranscript(that.model.get('initial_language'));
+ that.buildSubtitles(that.model.get('initial_language'));
});
} else {
// Do some other stuff for videos that aren't yet on Amara.
@@ -9824,9 +9824,9 @@ Popcorn.plugin('amarasubtitle', {
var that = this;
- // isComplete gets set as soon as the initial API call to build out the video
+ // is_complete gets set as soon as the initial API call to build out the video
// instance has finished.
- if (!this.model.get('isComplete')) {
+ if (!this.model.get('is_complete')) {
setTimeout(function() { that.waitUntilVideoIsComplete(callback); }, 100);
} else {
callback();
@@ -9939,7 +9939,7 @@ Popcorn.plugin('amarasubtitle', {
// Call embedVideo with this div and URL.
that.push(['embedVideo', {
'div': this,
- 'initialLanguage': $div.data('initial-language'),
+ 'initial_language': $div.data('initial-language'),
'url': $div.data('url')
}]);
});
@@ -205,7 +205,7 @@
// Create the actual core DOM for the Amara container.
that.$el.append(that.template({
- video_url: 'http://www.universalsubtitles.org/en/videos/' + that.model.get('id'),
+ video_url: 'http://staging.universalsubtitles.org/en/videos/' + that.model.get('id'),
width: that.model.get('width')
}));

8 comments on commit 199e88c

@honza

This comment has been minimized.

Show comment Hide comment
@honza

honza Aug 22, 2012

Contributor

You don't like camel case? Why?

Contributor

honza replied Aug 22, 2012

You don't like camel case? Why?

@fernandotakai

This comment has been minimized.

Show comment Hide comment
@fernandotakai

fernandotakai Aug 22, 2012

Contributor

but camel_case is default on js…………………

Contributor

fernandotakai replied Aug 22, 2012

but camel_case is default on js…………………

@honza

This comment has been minimized.

Show comment Hide comment
@honza

honza Aug 22, 2012

Contributor

That was my thought ... It's like saying

class team_video(models.Model):
    ...
Contributor

honza replied Aug 22, 2012

That was my thought ... It's like saying

class team_video(models.Model):
    ...
@nicksergeant

This comment has been minimized.

Show comment Hide comment
@nicksergeant

nicksergeant Aug 23, 2012

Contributor

lulwut? I was referring to the model attrs - the JSON gives me back vars like_this and I had camelCase vars mixed in with these_guys. I kept forgetting which format those were in.

Duh, guys.

:)

Contributor

nicksergeant replied Aug 23, 2012

lulwut? I was referring to the model attrs - the JSON gives me back vars like_this and I had camelCase vars mixed in with these_guys. I kept forgetting which format those were in.

Duh, guys.

:)

@honza

This comment has been minimized.

Show comment Hide comment
@honza

honza Aug 23, 2012

Contributor

You win. :)

Contributor

honza replied Aug 23, 2012

You win. :)

@nicksergeant

This comment has been minimized.

Show comment Hide comment
@nicksergeant

nicksergeant Aug 23, 2012

Contributor

yuss

Contributor

nicksergeant replied Aug 23, 2012

yuss

@honza

This comment has been minimized.

Show comment Hide comment
@honza

honza Aug 23, 2012

Contributor

alt

Contributor

honza replied Aug 23, 2012

alt

@nicksergeant

This comment has been minimized.

Show comment Hide comment
@nicksergeant

nicksergeant Aug 23, 2012

Contributor

wut

Contributor

nicksergeant replied Aug 23, 2012

wut

Please sign in to comment.