This file contains hidden or 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
| // Handles JavaScript history management and callbacks. To use, register a | |
| // regexp that matches the history hash with its corresponding callback: | |
| // | |
| // dc.history.register(/^#search/, controller.runSearch); | |
| // | |
| // And then you can save arbitrary history fragments. | |
| // | |
| // dc.history.save('search/freedom/p3'); | |
| // | |
| DV.history = { |
This file contains hidden or 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
| # TODO: Think of a name for this crazy thing. | |
| # Functions: | |
| square: x => x * x. | |
| sum: x, y => x + y. | |
| odd: x => x % 2 is 0. | |
| even: x => x % 2 aint 0. |
This file contains hidden or 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
| (function(){ | |
| var square = function(x) { | |
| return (x * x); | |
| }; | |
| var sum = function(x, y) { | |
| return (x + y); | |
| }; | |
| var odd = function(x) { | |
| return ((x % 2) === 0); | |
| }; |
This file contains hidden or 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
| dc.ui.Dialog = dc.View.extend({ | |
| className : 'dialog', | |
| callbacks : [ | |
| ['.cancel', 'click', 'cancel'], | |
| ['.ok', 'click', 'confirm'] | |
| ], | |
| constructor : function(options) { |
This file contains hidden or 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
| <div class="title"><%= title %></div> | |
| <% if (text) { %> | |
| <div class="text"><%= text %></div> | |
| <% } %> | |
| <% if( mode == 'prompt' || mode == 'short_prompt') { %> | |
| <div class="<%= mode %>"> | |
| <% if( mode == 'prompt') { %> | |
| <textarea class="content"></textarea> | |
| <% } else { %> | |
| <input class="content" type="text" value="" /> |
This file contains hidden or 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
| ///////////////////////////////////////////////////////////////////////////// | |
| // The public DocumentViewer API. Available for other scripts to access: | |
| ///////////////////////////////////////////////////////////////////////////// | |
| // Return the total number of pages in the document. | |
| DV.controller.numberOfPages = function() { | |
| return this.models.document.totalPages; | |
| }; | |
| // Change the documents' sections, re-rendering the navigation. "sections" |
This file contains hidden or 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
| redraw : function(stopResetOfPosition){ | |
| // console.log('forcing') | |
| this.pages['p0'].draw({ force: true }); | |
| this.pages['p1'].draw({ force: true }); | |
| this.pages['p2'].draw({ force: true }); | |
| if(this.application.state != 'InitialLoad' && !stopResetOfPosition){ | |
| this.application.helpers.jumpTo(this.application.models.document.currentIndex()); | |
| } | |
| }, |
This file contains hidden or 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
| # Any list of expressions or method body, seperated by line breaks or semis. | |
| Expressions: | |
| Expression { result = Nodes.new(val) } | |
| | Expressions Terminator Expression { result = val[0] << val[2] } | |
| | Expressions Terminator { result = val[0] } | |
| | Terminator Expressions { result = val[1] } | |
| ; |
This file contains hidden or 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
| state 67 | |
| 5) Expressions : Expressions _ Terminator Expression | |
| 6) Expressions : Expressions _ Terminator | |
| 7) Expressions : Terminator Expressions _ | |
| "\n" shift, and go to state 23 | |
| "\n" [reduce using rule 7 (Expressions)] | |
| ";" shift, and go to state 29 | |
| ";" [reduce using rule 7 (Expressions)] |