mcWebTTSPlugin ********************************************* /config ============================================= * *app.yml* - settings for connection to the TTS server (e.g. *username* or *tts_request_url*) /lib ============================================= * *ttsTools.class.php* - helper functions for connecting to the TTS server /modules ============================================= Contains the main action and its template for the TTS-reader component, which is inserted into the main template in */apps/frontend/templates/layout.php* ```` .. important:: File *_webTTSReader.php* contains the main functionality for parsing the HTML and reading. .. method:: cleanDOM() - remove unnecessary tags, i.e. empty tags or spans and divs with no attribute .. method:: processFormulas() - make formulas pretty, i.e. swap the content and name-attribute .. method:: markTexts() - mark what to read .. method:: processSolutions() - hide solutions of examples .. method:: processPauses() - change images of pauses .. method:: buildPlaylist() - build playlist from selected texts .. method:: registerControls() - register touch control events using the *Hammer.js* library /web ============================================= Contains CSS definitions and additional Javascript functionality needed for reading and parsing the HTML code. /web/js --------------------------------------------- * *hammer.min.\** - the Hammer.js library for touch gestures needed for controlling the application on tablets and mobile phones. * *tts.js* - functions for controlling the jPlayer and sending requests for mp3 files to the TTS server via AJAX requests. .. method:: buildJSON(index) - build a JSON string containing data for the current TTS request .. method:: getData(indexFrom) - sends request to the TTS server for mp3s of HTML elements .. method:: getHeadersData(headersCount) - sends request to the TTS server for a specified number of mp3s for reading header elements .. method:: playListMoveTo(group, tabindex) - starts playing a specific mp3 depending on clicked HTML element * *ttsContentProcessing.js* - helper functions for processing parts of the whole HTML document .. method:: processFormulas() - swap the *name* attribute with the content of a formula. Remove redundant *alt* attributes. .. method:: processSolutions() - hide solutions. Prepend buttons for showing the solutions and register *onClick* events. * *ttsTagProcessing.js* - functions for processing different HTML tags. .. method:: ttsProcessDiv(jsonTag) - add an element for reading depending on the DIVs class .. method:: ttsProcessTable(jsonTag) - if table has a *summary* attribute, read it instead of the table content .. method:: ttsProcessImg(jsonTag, tag) - if an image has an *alt* attribute, read it. Don't read images in hidden solutions or in tables with *summary*. .. method:: clearText(inputText) - remove unnecessary strings from text .. method:: ttsProcessSpan(jsonTag, tag) - process the SPAN tags: * preserve inline-formulas and chemical-formulas * remove unwanted characters using clearText() * determine the voice type with which to read the tag. Depends on tag type (ordinary or header) and language (czech, english or german).