123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>JSDoc: Source: presentation.js</title>
- <script src="scripts/prettify/prettify.js"> </script>
- <script src="scripts/prettify/lang-css.js"> </script>
- <!--[if lt IE 9]>
- <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
- <![endif]-->
- <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
- <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
- </head>
- <body>
- <div id="main">
- <h1 class="page-title">Source: presentation.js</h1>
-
-
- <section>
- <article>
- <pre class="prettyprint source linenums"><code>/**
- * An object for managing the blob of text at the top of a problem describing it.
- * This isn't a very busy component.
- *
- * TODO: Isn't most of this redundant now?
- *
- * @constructor
- * @this {BlockPyEditor}
- * @param {Object} main - The main BlockPy instance
- * @param {HTMLElement} tag - The HTML object this is attached to.
- */
- function BlockPyPresentation(main, tag) {
- this.main = main;
- this.tag = tag;
-
- var presentationEditor = this;
- //this.main.model.settings.instructor.subscribe(function() {presentationEditor.setVisible()});
- }
- /**
- * Removes the editor when it's not in use.
- * DEPRECATED
- */
- BlockPyPresentation.prototype.closeEditor = function() {
- this.tag.destroy();
- };
- /**
- * Updates the contents of the presentation blob, possibly updating the
- * editor's size too.
- *
- * @param {String} content - The new text of the presentation blob.
- */
- BlockPyPresentation.prototype.setBody = function(content) {
- this.main.model.assignment.introduction(content);
- this.main.components.editor.blockly.resize();
- };
- /**
- * Makes the editor available or not.
- * DEPRECATED.
- */
- BlockPyPresentation.prototype.setVisible = function() {
- if (this.main.model.settings.instructor()) {
- this.startEditor();
- } else {
- this.closeEditor();
- }
- }
- /**
- * Creates the Summer Note editor for the presentation blob.
- * DEPRECATED.
- */
- BlockPyPresentation.prototype.startEditor = function() {
- var presentationEditor = this;
- this.tag.summernote({
- codemirror: { // codemirror options
- theme: 'monokai'
- },
- onChange: function(content) {presentationEditor.setBody(content)},
- toolbar: [
- ['style', ['bold', 'italic', 'underline', 'clear']],
- ['font', ['fontname', 'fontsize']],
- ['insert', ['link', 'table', 'ul', 'ol']],
- ['misc', ['codeview', 'help']]
- ]
- });
- this.tag.code(this.main.model.assignment.introduction());
- //this.name.tag();
- };</code></pre>
- </article>
- </section>
- </div>
- <nav>
- <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BlockPy.html">BlockPy</a></li><li><a href="BlockPyCorgis.html">BlockPyCorgis</a></li><li><a href="BlockPyDialog.html">BlockPyDialog</a></li><li><a href="BlockPyEditor.html">BlockPyEditor</a></li><li><a href="BlockPyEngine.html">BlockPyEngine</a></li><li><a href="BlockPyEnglish.html">BlockPyEnglish</a></li><li><a href="BlockPyFeedback.html">BlockPyFeedback</a></li><li><a href="BlockPyHistory.html">BlockPyHistory</a></li><li><a href="BlockPyPresentation.html">BlockPyPresentation</a></li><li><a href="BlockPyPrinter.html">BlockPyPrinter</a></li><li><a href="BlockPyServer.html">BlockPyServer</a></li><li><a href="BlockPyToolbar.html">BlockPyToolbar</a></li><li><a href="LocalStorageWrapper.html">LocalStorageWrapper</a></li><li><a href="PythonToBlocks.html">PythonToBlocks</a></li></ul><h3>Global</h3><ul><li><a href="global.html#BlockPyInterface">BlockPyInterface</a></li><li><a href="global.html#cloneNode">cloneNode</a></li><li><a href="global.html#encodeHTML">encodeHTML</a></li><li><a href="global.html#expandArray">expandArray</a></li><li><a href="global.html#EXTENDED_ERROR_EXPLANATION">EXTENDED_ERROR_EXPLANATION</a></li><li><a href="global.html#indent">indent</a></li><li><a href="global.html#instructor_module">instructor_module</a></li><li><a href="global.html#prettyPrintDateTime">prettyPrintDateTime</a></li><li><a href="global.html#randomInteger">randomInteger</a></li><li><a href="global.html#set_button_loaded">set_button_loaded</a></li><li><a href="global.html#timerGuard">timerGuard</a></li></ul>
- </nav>
- <br class="clear">
- <footer>
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sun Mar 26 2017 09:45:03 GMT-0400 (Eastern Daylight Time)
- </footer>
- <script> prettyPrint(); </script>
- <script src="scripts/linenumber.js"> </script>
- </body>
- </html>
|