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
| let config = { | |
| // Callback to create the todo item controllers - are added as needed | |
| cb_todo: function (app, todo) { | |
| new ControllerTodoItem( | |
| app, | |
| todo, | |
| { $todolist: $('ul.todo-list') } | |
| ) | |
| }, |
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 (window) { | |
| let config = {...} | |
| new Application(config) | |
| })(window); |
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
| class Application { | |
| constructor(config) { | |
| this.todos = [] // model collection | |
| this.filter = 'all' // view model, options are: 'all', 'active', 'completed' | |
| ... | |
| } |
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
| class TodoItem { | |
| constructor(title, id, completed) { | |
| this._title = title == undefined ? "" : title; | |
| this._completed = completed == undefined ? false : completed; | |
| this.id = id == undefined ? util.uuid() : id; // no getter/setter needed | |
| } | |
| get title() { | |
| return this._title; | |
| } |
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
| # Generated from CSharpLexer.g4 by ANTLR 4.7.2 | |
| from antlr4 import * | |
| from io import StringIO | |
| from typing.io import TextIO | |
| import sys | |
| # import java.util.Stack; | |
| def serializedATN(): |
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
| class Compact { | |
| .. def <u><b>fred() .. | |
| <i>Mainly responsible for this and that | |
| <i>Calls GetShapeList() to get all the shapes | |
| + for shape in self.GetDiagram().<b>GetShapeList()</b>: <u>1 | |
| <i>Then process this and that calling the parent | |
| + if shape.<b>GetParent()</b> == None: <u>2 |
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
| class Observer: | |
| def __init__(self): | |
| self.subject = None | |
| def Notify(self, target, data): | |
| if target: | |
| print(f" Observer {self.__class__} got notification from: {target.__class__}, data: '{data}'") | |
| else: | |
| print(f"Observer {self.__class__} got direct call to notify(), data: '{data}'") |
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
| do = DirtyObserver(world) | |
| do.add_dependency(ModelRef, [entity_welcome_left, entity_edit_welcome_msg, entity_edit_user_name_msg, entity_edit_user_surname_msg]) | |
| do.add_dependency(MultiModelRef, [entity_welcome_user_right]) | |
| do.add_dependency("welcome display only, not via model", [entity_welcome_left, entity_welcome_user_right]) | |
| do.add_dependency("user display only, not via model", [entity_welcome_user_right]) | |
| do.add_dependency("just top right", [entity_welcome_user_right]) |
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
| do = DirtyObserver(world) | |
| do.add_dependency(ModelRef, [entity_welcome_left, entity_edit_welcome_msg, entity_edit_user_name_msg, entity_edit_user_surname_msg]) | |
| do.add_dependency(MultiModelRef, [entity_welcome_user_right]) | |
| do.add_dependency("welcome display only, not via model", [entity_welcome_left, entity_welcome_user_right]) | |
| do.add_dependency("user display only, not via model", [entity_welcome_user_right]) | |
| do.add_dependency("just top right", [entity_welcome_user_right]) |
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
| // | |
| // GUI events | |
| // | |
| $('#change_welcome_model').on('click', function(e) { | |
| model.welcomemsg = isUpperCaseAt(model.welcomemsg, 1) ? model.welcomemsg.toLowerCase() : model.welcomemsg.toUpperCase() | |
| world.tick() | |
| }) | |
| $('#change_user_model').on('click', function(e) { |