-
Notifications
You must be signed in to change notification settings - Fork 150
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
33 changed files
with
1,861 additions
and
1,058 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Include advanced </title> | ||
<link rel="stylesheet" href="http://getbootstrap.com/dist/css/bootstrap.min.css"> | ||
</head> | ||
<body> | ||
|
||
|
||
<script type='text/tpl' id="modal"> | ||
<div class="fade in modal" tabindex="-1" role="dialog" style="display:block;"> | ||
<div class="modal-dialog"> | ||
<div class="modal-content" role="document"> | ||
<div class="modal-header"> | ||
{#if closeBtn} | ||
<button class="close" aria-label="Close"> | ||
<span aria-hidden="true">×</span> | ||
</button> | ||
{/if} | ||
<h4 class="modal-title">{#inc title || 'Modal'}</h4> | ||
</div> | ||
<div class="modal-body"> | ||
{#inc body || this.$body} | ||
</div> | ||
<div class="modal-footer"> | ||
{#if foot} | ||
{#inc foot} | ||
{#else} | ||
<button type="button" class="btn btn-default" on-click={this.confirm(true)}>Confirm</button> | ||
<button type="button" class="btn btn-default" on-click={this.confirm(false)}>Cancel</button> | ||
{/if} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</script> | ||
|
||
<script src="https://rawgit.com/sindresorhus/multiline/master/browser.js"></script> | ||
<script src="https://rawgit.com/regularjs/regular/group/dist/regular.js"></script> | ||
<script> | ||
var Modal = Regular.extend({ | ||
name: "modal", | ||
template: "#modal", | ||
config: function(data){ | ||
var target = data.target = data.target || document.body; | ||
this.$watch('show', function(show){ | ||
this.$inject(show? target: false) | ||
}) | ||
}, | ||
confirm: function(accept){ | ||
this.$emit(accept? 'confirm': 'cancel'); | ||
if(this.data.autohide){ | ||
this.$update('show', false) | ||
} | ||
} | ||
}) | ||
Modal.title = Regular.extend({ | ||
name: 'modal.title', | ||
init: function(){ | ||
this.$outer.data.title = this.$body; | ||
} | ||
}) | ||
Modal.body = Regular.extend({ | ||
name: 'modal.body', | ||
init: function(){ | ||
this.$outer.data.body = this.$body; | ||
} | ||
}) | ||
Modal.foot = Regular.extend({ | ||
name: 'modal.foot', | ||
init: function(){ | ||
this.$outer.data.foot = this.$body; | ||
} | ||
}) | ||
|
||
var app = new Regular({ | ||
template: multiline(function(){/* | ||
<button class='btn' on-click={show = !show}>show</button> | ||
<input r-model='num' /> | ||
<modal show={show} autohide={true} title.cmpl='Virtual Box' close-btn > | ||
<modal.foot>Custom Title <span class="badge" >{num}</span> <button class='btn btn-primary' on-click={show=false}>CLose it!</button> </modal.foot> | ||
<nav class="navbar navbar-default"> | ||
<div class="container-fluid"> | ||
<div class="navbar-header"> | ||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false"> | ||
<span class="sr-only">Toggle navigation</span> | ||
<span class="icon-bar"></span> | ||
<span class="icon-bar"></span> | ||
<span class="icon-bar"></span> | ||
</button> | ||
<a class="navbar-brand" href="#">Brand</a> | ||
</div> | ||
</div> | ||
</nav> | ||
</modal> | ||
*/}), | ||
data: { "num": 100, show: true } | ||
}).$inject(document.body) | ||
</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
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
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.