forked from oppia/oppia
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…ppia#3818) * Add automatics text to speech * lint * Minor refactoring in AudioControlsDirective. * Suggested changes * Making Links and LateX speakable * lint * Add language object factories; update LaTeX formatting for speakable text; add tests for LaTeX conversion to speakable text * lint * lint * Change variable name; add dependencies to collection editor
- Loading branch information
Showing
19 changed files
with
750 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
core/templates/dev/head/domain/utilities/AudioLanguageObjectFactory.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright 2017 The Oppia Authors. All Rights Reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS-IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
/** | ||
* @fileoverview Object factory for creating audio languages. | ||
*/ | ||
|
||
oppia.factory('AudioLanguageObjectFactory', function() { | ||
var AudioLanguage = function(id, description, relatedLanguages) { | ||
this.id = id; | ||
this.description = description; | ||
this.relatedLanguages = relatedLanguages; | ||
}; | ||
|
||
AudioLanguage.createFromDict = function(audioLanguageDict) { | ||
return new AudioLanguage( | ||
audioLanguageDict.id, | ||
audioLanguageDict.text, | ||
audioLanguageDict.related_languages); | ||
}; | ||
|
||
return AudioLanguage; | ||
}); |
38 changes: 38 additions & 0 deletions
38
core/templates/dev/head/domain/utilities/AutogeneratedAudioLanguageObjectFactory.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Copyright 2017 The Oppia Authors. All Rights Reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS-IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
/** | ||
* @fileoverview Object factory for creating autogenerated audio languages. | ||
*/ | ||
|
||
oppia.factory('AutogeneratedAudioLanguageObjectFactory', function() { | ||
var AutogeneratedAudioLanguage = | ||
function(id, description, explorationLanguage, speechSynthesisCode) { | ||
this.id = id; | ||
this.description = description; | ||
this.explorationLanguage = explorationLanguage; | ||
this.speechSynthesisCode = speechSynthesisCode; | ||
}; | ||
|
||
AutogeneratedAudioLanguage.createFromDict = ( | ||
function(autogeneratedAudioLanguageDict) { | ||
return new AutogeneratedAudioLanguage( | ||
autogeneratedAudioLanguageDict.id, | ||
autogeneratedAudioLanguageDict.text, | ||
autogeneratedAudioLanguageDict.exploration_language, | ||
autogeneratedAudioLanguageDict.speech_synthesis_code); | ||
}); | ||
|
||
return AutogeneratedAudioLanguage; | ||
}); |
48 changes: 48 additions & 0 deletions
48
core/templates/dev/head/domain/utilities/BrowserCheckerService.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Copyright 2017 The Oppia Authors. All Rights Reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS-IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
/** | ||
* @fileoverview Utility service for checking web browser type. | ||
*/ | ||
|
||
oppia.factory('BrowserCheckerService', function() { | ||
var isChromium = window.chrome; | ||
var winNav = window.navigator; | ||
var vendorName = winNav.vendor; | ||
var isOpera = winNav.userAgent.indexOf('OPR') > -1; | ||
var isIEedge = winNav.userAgent.indexOf('Edge') > -1; | ||
var isIOSChrome = winNav.userAgent.match('CriOS'); | ||
|
||
var _isChrome = function() { | ||
// For details on the reliability of this check, see | ||
// https://stackoverflow.com/questions/4565112/ | ||
// javascript-how-to-find-out-if-the-user-browser-is-chrome | ||
if (isIOSChrome || | ||
(isChromium !== null && | ||
isChromium !== undefined && | ||
vendorName === 'Google Inc.' && | ||
isOpera == false && | ||
isIEedge == false)) { | ||
return true; | ||
} else { | ||
return false; | ||
} | ||
}; | ||
|
||
return { | ||
isChrome: function() { | ||
return _isChrome(); | ||
} | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.