forked from unconed/TermKit
-
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.
- Loading branch information
Showing
10 changed files
with
91 additions
and
177 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
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
(function ($) { | ||
|
||
var ov = termkit.outputView; | ||
|
||
/** | ||
* Constructs node objects of the right class. | ||
*/ | ||
ov.outputFactory = function () { | ||
|
||
}; | ||
|
||
ov.outputFactory.prototype = { | ||
|
||
construct: function (properties) { | ||
var type = widgets[properties.type]; | ||
if (type) { | ||
return new type(properties); | ||
} | ||
}, | ||
|
||
}; | ||
|
||
var widgets = ov.outputFactory.widgets = {}; | ||
|
||
/////////////////////////////////////////////////////////////////////////////// | ||
|
||
/** | ||
* Raw output | ||
*/ | ||
widgets.raw = function (properties) { | ||
|
||
// Initialize node. | ||
ov.outputNode.call(this, properties); | ||
|
||
this.$contents = this.$element.find('> div.contents'); | ||
}; | ||
|
||
widgets.raw.prototype = $.extend(new ov.outputNode(), { | ||
|
||
// Return active markup for this widget. | ||
$markup: function () { | ||
var $outputNode = $('<div class="termkitOutputNode widgetRaw"><div class="contents"></div></div>').data('controller', this); | ||
var self = this; | ||
return $outputNode; | ||
}, | ||
|
||
// Update markup to match. | ||
updateElement: function () { | ||
this.$contents.text(this.contents); | ||
this.$element.data('controller', this); | ||
}, | ||
|
||
}); | ||
|
||
})(jQuery); |
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
This file was deleted.
Oops, something went wrong.
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.