-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #171 from purplebricks/CustomPageHref
Binding handler page-href name can now be over-ridden by the user
- Loading branch information
Showing
6 changed files
with
174 additions
and
7 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
Large diffs are not rendered by default.
Oops, something went wrong.
47 changes: 47 additions & 0 deletions
47
test/should_throw_when_blank_custom_binding_handler_name_set.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Should access URI parameters</title> | ||
<script type="text/javascript" src="../lib/jquery-2.0.3.min.js"></script> | ||
<script type="text/javascript" src="../lib/underscore-min.js"></script> | ||
<script type="text/javascript" src="../lib/knockout-3.0.0.js"></script> | ||
<script type="text/javascript" src="../lib/jquery.ba-hashchange.min.js"></script> | ||
<script type="text/javascript" src="../pager.js"></script> | ||
|
||
<link rel="stylesheet" href="../lib/qunit.css"/> | ||
</head> | ||
<body> | ||
<div id="qunit"></div> | ||
<div data-bind="page: {id: 'first'}"></div> | ||
|
||
<script type="text/javascript"> | ||
|
||
var viewModel = { | ||
}; | ||
|
||
pager.extendWithPage(viewModel); | ||
ko.applyBindings(viewModel); | ||
pager.start(); | ||
|
||
</script> | ||
|
||
<script type="text/javascript" src="../lib/qunit-until.js"></script> | ||
<script type="text/javascript" src="../lib/qunit.js"></script> | ||
|
||
<script type="text/javascript"> | ||
|
||
asyncTest("Should throw when setting blank data attribute", function () { | ||
raises(function(){ | ||
pager.dataAttribute(''); | ||
}, | ||
function(err) { | ||
return err.message === 'Data Attribute cannot be blank'; | ||
}, | ||
'Throws an error when attempting to set a blank dataAttribute'); | ||
|
||
start(); | ||
}); | ||
|
||
</script> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Should access URI parameters</title> | ||
<script type="text/javascript" src="../lib/jquery-2.0.3.min.js"></script> | ||
<script type="text/javascript" src="../lib/underscore-min.js"></script> | ||
<script type="text/javascript" src="../lib/knockout-3.0.0.js"></script> | ||
<script type="text/javascript" src="../lib/jquery.ba-hashchange.min.js"></script> | ||
<script type="text/javascript" src="../pager.js"></script> | ||
|
||
<link rel="stylesheet" href="../lib/qunit.css"/> | ||
</head> | ||
<body> | ||
<div id="qunit"></div> | ||
<div data-bind="page: {id: 'first'}"></div> | ||
|
||
<script type="text/javascript"> | ||
|
||
var viewModel = { | ||
}; | ||
|
||
pager.dataAttribute('pageHref'); | ||
pager.extendWithPage(viewModel); | ||
ko.applyBindings(viewModel); | ||
pager.start(); | ||
|
||
</script> | ||
|
||
<script type="text/javascript" src="../lib/qunit-until.js"></script> | ||
<script type="text/javascript" src="../lib/qunit.js"></script> | ||
|
||
<script type="text/javascript"> | ||
|
||
asyncTest("Should have custom data attribute", function () { | ||
ok(ko.bindingHandlers['pageHref']); | ||
|
||
start(); | ||
}); | ||
|
||
</script> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Should access URI parameters</title> | ||
<script type="text/javascript" src="../lib/jquery-2.0.3.min.js"></script> | ||
<script type="text/javascript" src="../lib/underscore-min.js"></script> | ||
<script type="text/javascript" src="../lib/knockout-3.0.0.js"></script> | ||
<script type="text/javascript" src="../lib/jquery.ba-hashchange.min.js"></script> | ||
<script type="text/javascript" src="../pager.js"></script> | ||
|
||
<link rel="stylesheet" href="../lib/qunit.css"/> | ||
</head> | ||
<body> | ||
|
||
<div id="qunit"></div> | ||
|
||
<div data-bind="page: {id: 'first', params: ['nam','ans']}"> | ||
<div id="answer" data-bind="text: ans"></div> | ||
<div id="name" data-bind="text: nam"></div> | ||
</div> | ||
|
||
<script type="text/javascript"> | ||
|
||
|
||
var viewModel = { | ||
}; | ||
|
||
pager.extendWithPage(viewModel); | ||
ko.applyBindings(viewModel); | ||
|
||
pager.start(); | ||
</script> | ||
|
||
<script type="text/javascript" src="../lib/qunit-until.js"></script> | ||
<script type="text/javascript" src="../lib/qunit.js"></script> | ||
|
||
<script type="text/javascript"> | ||
|
||
asyncTest("Should have default data attribute", function () { | ||
ok(ko.bindingHandlers['page-href']); | ||
|
||
start(); | ||
}); | ||
</script> | ||
|
||
|
||
</body> | ||
</html> |