-
Notifications
You must be signed in to change notification settings - Fork 80
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
1 parent
7e7d19b
commit 7d797fd
Showing
9 changed files
with
246 additions
and
22 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 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 |
---|---|---|
@@ -0,0 +1,131 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf8"> | ||
<title>nya-bootstrap-select demo</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> | ||
|
||
<link rel="stylesheet" href="../../bower_components/bootstrap/dist/css/bootstrap.css" type="text/css"> | ||
<link rel="stylesheet" href="../../dist/css/nya-bs-select.css"/> | ||
<link rel="stylesheet" href="../main.css"/> | ||
</head> | ||
<body ng-app="demoApp"> | ||
<nav class="navbar navbar-default"> | ||
<div class="container"> | ||
<div class="navbar-header"> | ||
<a class="navbar-brand" href="/">nya-bootstrap-select</a> | ||
</div> | ||
<ul class="nav navbar-nav"> | ||
<li> | ||
<a href="/">Basic Examples</a> | ||
</li> | ||
<li> | ||
<a href="#">Localized Default Examples</a> | ||
</li> | ||
<li> | ||
<a href="manual.html">Localized Manual Examples</a> | ||
</li> | ||
<li class="active"> | ||
<a href="angular-translate-filter.html">Angular Translate filter Example</a> | ||
</li> | ||
</ul> | ||
</div> | ||
</nav> | ||
<div class="masthead"> | ||
<div class="container"> | ||
<h1>nya-bootstrap-select</h1> | ||
|
||
<p>An angular wrapper for Bootstrap-select with dynamic loading options support</p> | ||
<a class="btn btn-default btn-lg" href="#">View on Github</a> | ||
</div> | ||
</div> | ||
<div class="container" ng-controller="MainCtrl"> | ||
<section> | ||
<h1 id="bs-features" class="page-header">Bootstrap-select Features</h1> | ||
|
||
<h3>Default Text</h3> | ||
|
||
<p>Default Text using angular-translate</p> | ||
|
||
<button class="btn btn-default" ng-click="changeLocale('en')">English</button> | ||
<button class="btn btn-default" ng-click="changeLocale('jp')">Japanese</button> | ||
|
||
<p>Current Locale: {{'LANG' | translate}}</p> | ||
<form class="form-inline"> | ||
<ol class="nya-bs-select" ng-model="staticModel3" data-live-search="true" multiple title-tpl="<span>{{'NOTHING' | translate}}</spa>"> | ||
<li class="nya-bs-option" value="a"><a>Alpha<span class="glyphicon glyphicon-ok check-mark"></span></a></li> | ||
<li class="nya-bs-option" value="b"><a>Bravo<span class="glyphicon glyphicon-ok check-mark"></span></a></li> | ||
<li class="nya-bs-option" value="c"><a>Charlie<span class="glyphicon glyphicon-ok check-mark"></span></a></li> | ||
</ol> | ||
</form> | ||
|
||
|
||
<h3>selection display format</h3> | ||
|
||
<p>Using the <code>data-selected-text-format</code> attribute on an <code>multiple nya-bs-select</code> you can specify how the selection is displayed.</p> | ||
<ul> | ||
<li> | ||
<p><code>values</code> A comma delimited list of selected values.(default)</p> | ||
|
||
<form class="form-inline"> | ||
<ol id="values-example" class="nya-bs-select" ng-model="model1" data-selected-text-format="values" multiple> | ||
<li nya-bs-option="option in options1"> | ||
<a> | ||
{{option}} | ||
<span class="glyphicon glyphicon-ok check-mark"></span> | ||
</a> | ||
</li> | ||
</ol> | ||
</form> | ||
</li> | ||
<li> | ||
<p><code>count</code> If one item is selected, then the value is shown, if more than one is selected then the number of selected items is displayed.</p> | ||
<form class="form-inline"> | ||
<ol id="count-example" class="nya-bs-select" ng-model="model1" data-selected-text-format="count" multiple> | ||
<li nya-bs-option="option in options1"> | ||
<a> | ||
{{option}} | ||
<span class="glyphicon glyphicon-ok check-mark"></span> | ||
</a> | ||
</li> | ||
</ol> | ||
</form> | ||
</li> | ||
<li> | ||
<p><code>count > x</code> Where X is the number of items selected when the display format changes from <code>values</code> to | ||
<code>count</code></p> | ||
<form class="form-inline"> | ||
<ol id="count-number-example" class="nya-bs-select" ng-model="model1" data-selected-text-format="count>3" multiple> | ||
<li nya-bs-option="option in options1"> | ||
<a> | ||
{{option}} | ||
<span class="glyphicon glyphicon-ok check-mark"></span> | ||
</a> | ||
</li> | ||
</ol> | ||
</form> | ||
</li> | ||
</ul> | ||
|
||
|
||
</section> | ||
</div> | ||
<footer class="footer"> | ||
<div class="container"> | ||
<p>Designed and built by <a href="http://nya.io">Nyasoft</a></p> | ||
|
||
<p>Code licensed under MIT License</p> | ||
</div> | ||
</footer> | ||
|
||
|
||
<script src="../../bower_components/angular/angular.js"></script> | ||
<script src="../../bower_components/angular-translate/angular-translate.js"></script> | ||
<script src="../../src/nya-bs-public.js"></script> | ||
<script src="../../src/nya-bs-config.js"></script> | ||
<script src="../../src/nya-bs-select-ctrl.js"></script> | ||
<script src="../../src/nya-bs-select.js"></script> | ||
<script src="../../src/nya-bs-option.js"></script> | ||
<script src="angular-translate-filter.js"></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,33 @@ | ||
'use strict'; | ||
|
||
angular.module('demoApp', ['nya.bootstrap.select', 'pascalprecht.translate']) | ||
.config(function($translateProvider, nyaBsConfigProvider) { | ||
$translateProvider.translations('en', { | ||
LANG: 'English', | ||
NOTHING: 'Nothing Selected!' | ||
}); | ||
$translateProvider.translations('jp', { | ||
LANG: '日本語', | ||
NOTHING: '未選択' | ||
}); | ||
}) | ||
.controller('MainCtrl', function($scope, $translate){ | ||
|
||
$translate.use('en'); | ||
|
||
$scope.changeLocale = function(locale) { | ||
$translate.use(locale); | ||
}; | ||
|
||
|
||
$scope.options1 = [ | ||
'Alpha', | ||
'Bravo', | ||
'Charlie', | ||
'Golf', | ||
'Hotel', | ||
'Juliet', | ||
'Kilo', | ||
'Lima' | ||
]; | ||
}); |
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.