Skip to content

Commit

Permalink
Merge pull request #6 from deltanet/Fixes#5
Browse files Browse the repository at this point in the history
Fixes #5
  • Loading branch information
dancgray authored Jul 14, 2016
2 parents 822faac + af936ce commit 536255d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 52 deletions.
5 changes: 0 additions & 5 deletions example.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@
"body":"Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis.",
"instruction":"",
"_columns":3,
"displayTitleReduced": "Reduced title",
"bodyReduced": "Reduced text",
"_reducedText": {
"_isEnabled": true
},
"_items": [
{
"title": "Grid Item 1",
Expand Down
22 changes: 7 additions & 15 deletions js/adapt-hotgrid-audio.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ define(function(require) {
this.setReadyStatus();
}, this));

if (Adapt.config.get('_audio') && Adapt.config.get('_audio')._isReducedTextEnabled && this.model.get('_reducedText') && this.model.get('_reducedText')._isEnabled) {
if (Adapt.course.get('_audio') && Adapt.course.get('_audio')._reducedTextisEnabled && this.model.get('_audio') && this.model.get('_audio')._reducedTextisEnabled) {
this.replaceText(Adapt.audio.textSize);
}
var componentActive = false;
Expand Down Expand Up @@ -162,7 +162,7 @@ define(function(require) {
var interactionObject_body = "";

// If reduced text is enabled and selected
if (Adapt.config.get('_audio') && Adapt.config.get('_audio')._isReducedTextEnabled && this.model.get('_reducedText') && this.model.get('_reducedText')._isEnabled && Adapt.audio.textSize == 1) {
if (Adapt.course.get('_audio') && Adapt.course.get('_audio')._reducedTextisEnabled && this.model.get('_audio') && this.model.get('_audio')._reducedTextisEnabled && Adapt.audio.textSize == 1) {
popupObject_title = itemModel.titleReduced;
popupObject_body = itemModel.bodyReduced;
}
Expand Down Expand Up @@ -212,7 +212,7 @@ define(function(require) {


///// Audio /////
if (Adapt.config.get('_audio') && Adapt.config.get('_audio')._isEnabled && this.model.has('_audio') && this.model.get('_audio')._isEnabled && Adapt.audio.audioClip[this.model.get('_audio')._channel].status==1) {
if (Adapt.course.get('_audio') && Adapt.course.get('_audio')._isEnabled && this.model.has('_audio') && this.model.get('_audio')._isEnabled && Adapt.audio.audioClip[this.model.get('_audio')._channel].status==1) {
// Trigger audio
Adapt.trigger('audio:playAudio', itemModel._audio.src, this.model.get('_id'), this.model.get('_audio')._channel);
}
Expand All @@ -221,7 +221,7 @@ define(function(require) {
Adapt.once("notify:closed", _.bind(function() {
//this.isPopupOpen = false;
///// Audio /////
if (Adapt.config.get('_audio') && Adapt.config.get('_audio')._isEnabled && this.model.has('_audio') && this.model.get('_audio')._isEnabled) {
if (Adapt.course.get('_audio') && Adapt.course.get('_audio')._isEnabled && this.model.has('_audio') && this.model.get('_audio')._isEnabled) {
Adapt.trigger('audio:pauseAudio', this.model.get('_audio')._channel);
}
///// End of Audio /////
Expand Down Expand Up @@ -276,7 +276,7 @@ define(function(require) {
var interactionObject_body = "";

// If reduced text is enabled and selected
if (Adapt.config.get('_audio') && Adapt.config.get('_audio')._isReducedTextEnabled && this.model.get('_reducedText') && this.model.get('_reducedText')._isEnabled && Adapt.audio.textSize == 1) {
if (Adapt.course.get('_audio') && Adapt.course.get('_audio')._reducedTextisEnabled && this.model.get('_audio') && this.model.get('_audio')._reducedTextisEnabled && Adapt.audio.textSize == 1) {
popupObject_title = itemModel.titleReduced;
popupObject_body = itemModel.bodyReduced;
}
Expand All @@ -298,7 +298,7 @@ define(function(require) {
$('.notify-popup-body-inner').html(interactionObject_body);

///// Audio /////
if (Adapt.config.get('_audio') && Adapt.config.get('_audio')._isEnabled && this.model.has('_audio') && this.model.get('_audio')._isEnabled && Adapt.audio.audioClip[this.model.get('_audio')._channel].status==1) {
if (Adapt.course.get('_audio') && Adapt.course.get('_audio')._isEnabled && this.model.has('_audio') && this.model.get('_audio')._isEnabled && Adapt.audio.audioClip[this.model.get('_audio')._channel].status==1) {
// Trigger audio
Adapt.trigger('audio:playAudio', itemModel._audio.src, this.model.get('_id'), this.model.get('_audio')._channel);
}
Expand Down Expand Up @@ -337,15 +337,7 @@ define(function(require) {
// Reduced text
replaceText: function(value) {
// If enabled
if (Adapt.config.get('_audio') && Adapt.config.get('_audio')._isReducedTextEnabled && this.model.get('_reducedText') && this.model.get('_reducedText')._isEnabled) {
// Change component title and body
if(value == 0) {
this.$('.component-title-inner').html(this.model.get('displayTitle')).a11y_text();
this.$('.component-body-inner').html(this.model.get('body')).a11y_text();
} else {
this.$('.component-title-inner').html(this.model.get('displayTitleReduced')).a11y_text();
this.$('.component-body-inner').html(this.model.get('bodyReduced')).a11y_text();
}
if (Adapt.course.get('_audio') && Adapt.course.get('_audio')._reducedTextisEnabled && this.model.get('_audio') && this.model.get('_audio')._reducedTextisEnabled) {
// Change each items title and body
for (var i = 0; i < this.model.get('_items').length; i++) {
if(value == 0) {
Expand Down
32 changes: 0 additions & 32 deletions properties.schema
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,6 @@
"validators": ["number"],
"help": "This value determines the number of columns within the grid. Any number of columns can be set however keep in mind the more columns there are the smaller the items will be."
},
"displayTitleReduced": {
"type": "string",
"required": false,
"default": "",
"title": "Reduced Text Display Title",
"inputType": "Text",
"validators": []
},
"bodyReduced": {
"type": "string",
"required": false,
"default": "",
"title": "Reduced Text Body",
"inputType": "TextArea",
"validators": []
},
"_items": {
"type":"array",
"required":true,
Expand Down Expand Up @@ -179,22 +163,6 @@
}
}
}
},
"_reducedText": {
"type":"object",
"required":false,
"title": "Reduced Text Options",
"help": "The Audio extension must be installed for reduced text options to work",
"properties":{
"_isEnabled": {
"type":"boolean",
"required":false,
"default": true,
"title": "Reduced Text Enabled",
"inputType": { "type": "Boolean", "options": [false, true]},
"validators": []
}
}
}
}
}

0 comments on commit 536255d

Please sign in to comment.