This repository has been archived by the owner on Oct 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Quick-edit is also available without whole word selection.
- Loading branch information
1 parent
73a4327
commit ea92f08
Showing
6 changed files
with
54 additions
and
40 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
<html> | ||
<head> | ||
<script> | ||
// Here's my data model | ||
var ViewModel = function(first, last) { | ||
this.firstName = ko.observable(first); | ||
this.lastName = ko.observable(last); | ||
|
||
this.fullName = ko.computed(function() { | ||
// Knockout tracks dependencies automatically. It knows that fullName depends on firstName and lastName, because these get called when evaluating fullName. | ||
return this.firstName() + " " + this.lastName(); | ||
}, this); | ||
|
||
}; | ||
<head> | ||
<script> | ||
// Here's my data model | ||
var ViewModel = function(first, last) { | ||
this.firstName = ko.observable(first); | ||
this.lastName = ko.observable(last); | ||
|
||
ViewModel(); | ||
testFunction(); | ||
ko.applyBindings(new ViewModel("Planet", "Earth")); // This makes Knockout get to work | ||
</script> | ||
</head> | ||
this.fullName = ko.computed(function() { | ||
// Knockout tracks dependencies automatically. It knows that fullName depends on firstName and lastName, because these get called when evaluating fullName. | ||
return this.firstName() + " " + this.lastName(); | ||
}, this); | ||
|
||
<body> | ||
<p>First name: <input data-bind="value: firstName" /></p> | ||
<p>Last name: <input data-bind="value: lastName" /></p> | ||
<h2>Hello <span data-bind="value: fullName"> </span>!</h2> | ||
</body> | ||
}; | ||
|
||
ViewModel(); | ||
testFunction(); | ||
ko.applyBindings(new ViewModel("Planet", "Earth")); // This makes Knockout get to work | ||
</script> | ||
</head> | ||
|
||
<body> | ||
<p>First name: <input data-bind="value: firstName" /></p> | ||
<p>Last name: <input data-bind="value: lastName" /></p> | ||
<h2>Hello <span data-bind="value: fullName"> </span>!</h2> | ||
</body> | ||
</html> |
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 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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
{ | ||
"name": "ericsmekens.knockoutjs", | ||
"title": "KnockoutJS for Brackets", | ||
"description": "Adding knockout quickedits to brackets (only basic quick-edit for ko.computed at the moment.)", | ||
"description": "Adding knockout quickedits to brackets (only basic quick-edit for ko.computed at the moment. Ideas are welcome!)", | ||
"homepage": "https://github.com/EricSmekens/KnockoutJS-brackets", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"author": "Eric Smekens (https://github.com/EricSmekens)", | ||
"license": "MIT", | ||
"engines": { | ||
"brackets": ">=0.34.0" | ||
"brackets": ">=1.0.0" | ||
} | ||
} |