Skip to content

Commit

Permalink
add some readme
Browse files Browse the repository at this point in the history
  • Loading branch information
sharvit committed Jan 2, 2016
1 parent 1d2baa8 commit b36afdb
Show file tree
Hide file tree
Showing 7 changed files with 143 additions and 39 deletions.
11 changes: 9 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,16 @@ after_success:
- echo "Deploying build $TRAVIS_BUILD_NUMBER - $TRAVIS_TAG"
- gulp deploy:gh-pages
deploy:
provider: npm
email: [email protected]
- provider: releases
skip_cleanup: true
api_key:
secure: ZZu4Tw4QOBZyN3kmK8OxVM+tMg3GbRtqoceuAlj8HmRxRL2LzQR3oQLsPvvwEBcrZH6MG2mQAEzWyjkkZPhwjvCwAhemGrlX1wSzEQQlnjsaxRXEAnsV7bHT2damtmi8JE4z8y6ldTRRsu+UNr5n7Kuo754wJGhzAqnxkL1GXyPCmT2iIHc3Xfz9I9T7HgTYhrEYVGNJO2umd8AXn/B9uSaxia6xpBRTlnueTqQ/BjVLfw9aLbezP0ZoFtecKdsW9tLPGl8wHs7Rb/iYWQu47eqkyPpHNYWjXuw5oNOxEs1QErtRkCXRNOQI9uFDzjFFIdzbPlQgHAP2B/nYAdqS2eIeo0x2MH1K/nv7I9msTf+GrOX0fYftQYf7OM1k2rlvbxYYB5K3x4M7nbbUYMlQXXXlhZ2ydKRXlR4sy0ekbqtOF1ewz5qnK2DiudvRajvqtcySz///lu2EgHW+9JUotKnqsypsl8b1xCNeeQbyLGKCPfqiX14WWISCTlkfzTL6x92NJD6tP9/NWZtQOs+VSU5bPAqY72TGJWbszb9LItfY3JDC0a0iVpugI/TLgsFd9roLVZa167kx5BaTLlZpuOoiFuKQ6eOJioJCgHxSi6EzNKMkAOMlamrIWzEx3DSEMVfu6pVm3ZqnnL+v29D3Az9Y8i5pzIcF9w484SscFYY=
on:
tags: true
repo: sharvit/angular-bootstrap-locale-dialog
- provider: npm
skip_cleanup: true
email: [email protected]
api_key:
secure: GaCzA/GIAkqyyS+mzV9DC9irWv+4PxnphKClM7jV+TpuitPOZG0rPTk5uLzd4pCcU6haQHxHkqmwAUnox+YWMR7ugPnKEp0K3Znkgxc7s6mOY2OnbfF8+8UbNHp11eNkOnSmK5zUTOY9v0GNO8RshOnrGm5JD6ITThWZGTgXHAiZ3xh2+Tcwe6MvxOZBLVRuOrfD57Eqkb7HhZERRj10VJyGXAfrgvE41Dh8sV0Xz51xzukj/tHGdYEI+z9Bmf1CcXej2Hv0r6MJqzBTrwDA09C95N752Z1sM0w0Qd8zqm5WXNMxH9WXXOarSomE/eKGkkNix8LtELepetRGWySv3MdhKx3SxVpILUuoIBVL1p/5Oo+FtQT83fVHowe9rn9oXRpzm3gIg0M/27FfAHjptKEGt3byZA47I4wIx090bj9ZysaflbdTqzXoFyquoAjrDvu13bCZL4fD8fiDgRxzBt9CSfJDdkUDTzul+a5LacQ3xmi7lPuaBWiuycfazVTV03jNsJT5SCcRFkol4jIb9CzSh+IO6tuiY8Eli5D63J9xTr6oLKBuiyxwQsWxT7PEJCuwTsyH0eCJuztHaZXz1eqmLEdKPge72qM4hIuh5JtC3978G5n1AQEYfbG1MkpA0JeMlnPT/Ma6ee3H0kFrDaQvXEM9/pu2K3b8wEN82I4=
on:
Expand Down
73 changes: 69 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,70 @@
# Angular Bootstrap Locale Dialog
Locale selector dialog for angular-bootstrap

# Getting started
Getting started here

## Angular Bootstrap Locale Dialog - [AngularJS] service to open locale (language) selector dialog using [AngularUI Bootstrap]

[![Build Status](https://travis-ci.org/sharvit/angular-bootstrap-locale-dialog.svg?branch=master)](https://travis-ci.org/sharvit/angular-bootstrap-locale-dialog)
[![devDependency Status](https://david-dm.org/sharvit/angular-bootstrap-locale-dialog/dev-status.svg?branch=master)](https://david-dm.org/sharvit/angular-bootstrap-locale-dialog#info=devDependencies)

### Quick links
- [Demo](#demo)
- [Installation](#installation)
- [Download the build](#download-the-build)
- [NPM](#install-with-npm)
- [Bower](#install-with-bower)
- [Manual](#manual-download)
- [Adding dependency to your project](#adding-dependency-to-your-project)


## Demo

Do you want to see dialog in action?
Visit http://sharvit.github.io/angular-bootstrap-locale-dialog/!


## Installation

Installation is easy as [angular-bootstrap-locale-dialog] has minimal dependencies - only the [AngularJS] and [AngularUI Bootstrap] are required.

Additionally, it is recommended to use some other dependencies:
- [font-awesome] - use to render extra icons for the dialog
- [flag-icon-css] - use to render flag icons for each locale

### Download the build

#### Install with NPM

```sh
$ npm install angular-bootstrap-locale-dialog
```

This will install [AngularJS] and [AngularUI Bootstrap] NPM packages.

#### Install with Bower
```sh
$ bower install angular-bootstrap-locale-dialog
```

This will install [AngularJS] and [AngularUI Bootstrap] bower packages.

#### Manual download

All the build files for all version can manually downloaded (or better yet, referencing them from the CDN):
https://github.com/sharvit/angular-bootstrap-locale-dialog/tree/gh-pages

### Adding dependency to your project

When you are done downloading all the dependencies and project files the only remaining part is to add dependencies on the `angular-bootstrap-locale-dialog` [AngularJS] module:

```js
angular.module('myModule', [
'ui.bootstrap',
'angular-bootstrap-locale-dialog'
]);
```


[angular-bootstrap-locale-dialog]: http://sharvit.github.io/angular-bootstrap-locale-dialog/
[AngularJS]: https://angularjs.org/
[AngularUI Bootstrap]: https://angular-ui.github.io/bootstrap/
[font-awesome]: https://fortawesome.github.io/Font-Awesome/
[flag-icon-css]: https://lipis.github.io/flag-icon-css/
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-bootstrap-locale-dialog",
"version": "1.0.11",
"version": "1.0.12",
"description": "Locale selector dialog for angular-bootstrap",
"author": "Avi Sharvit <[email protected]> (https://sharvit.github.io)",
"homepage": "https://sharvit.github.io/angular-bootstrap-locale-dialog/",
Expand Down
6 changes: 1 addition & 5 deletions src/demo/assets/app.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
body {
padding-top: 50px;
}

.nav, .pagination, .carousel, .panel-title a {
cursor: pointer;
cursor: pointer;
}

/**
Expand Down
29 changes: 5 additions & 24 deletions src/demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
<!-- bootstrap css -->
<link href="//netdna.bootstrapcdn.com/bootstrap/@@bsversion/css/bootstrap.min.css" rel="stylesheet" type="text/css" />

<!-- font awesome -->
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" />

<link href="//lipis.github.io/flag-icon-css/css/flag-icon.css" rel="stylesheet" type="text/css" />


<!-- inject:assets-styles:css --><!-- endinject -->
</head>
Expand All @@ -22,30 +27,6 @@

<!-- inject:assets-scripts:js --><!-- endinject -->

<header class="navbar navbar-default navbar-fixed-top app-top-navbar" role="navigation">
<div class="container" ng-init="isNavbarCollapsed = true">

<!-- Brand and toggle get grouped for better mobile display -->
<nav class="navbar-header">
<button type="button" class="navbar-toggle" ng-click="isNavbarCollapsed = !isNavbarCollapsed">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/">@@name</a>
</nav>

<!-- Collect the nav links, forms, and other content for toggling -->
<nav class="navbar-collapse" uib-collapse="isNavbarCollapsed">
<ul class="nav navbar-nav">
<li><a href="#">Getting started</a></li>
<li><a href="#">Demo</a></li>
</ul>
</nav>

</div>
</header>

<div role="main">

<div class="bs-docs-masthead">
Expand Down
4 changes: 3 additions & 1 deletion src/docs/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ angular.module('demo')

vm.changeLocale = function () {
$localeSelectorDialog.open({
locales: avilableLocales
locales: avilableLocales,
showFlags: true,
showSearch: true
});
};
});
57 changes: 55 additions & 2 deletions src/docs/readme.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,55 @@
# angular-bootstrap-locale-dialog
Locale selector dialog for angular-bootstrap
`$localeSelectorDialog` is a service to open the locale selector dialog.
It based on [AngularBS] `$uibModal` witch can create modal windows.

The `$localeSelectorDialog` service has only one method: `open(options)`.

### $localeSelectorDialog's open function

#### options parameter

* `locales`
_(Type: `object`, Default: `{}`)_ -
An `object` with all the supported locales of your app.
The `keys` inside the object should be your locale id, for example: `en-US`
The `value` for each `key` should fill the following requirements:
- `name`
_(Type: `string`)_ -
The locale readable name, for example `English (US)`

- `language`
_(Type: `string`)_ -
The language key, for example `en`

- `country`
_(Type: `string`)_ -
The country key, for example `us`

**Their is an example for the `locale` object at the demo.**
* `templateUrl`
_(Type: `string`, Default: `angular-bootstrap-locale-dialog/angular-bootstrap-locale-dialog.html`)_ -
A path to a template representing modal's content.
Use it if you don't want to use the default template.

* `showFlags`
_(Type: `boolean`, Default: `false`)_ -
Set to true to show flags next to the locale name.
Need to install [flag-icon-css] so it will match the css to the flag icon.

* `showSearch`
_(Type: `boolean`, Default: `false`)_ -
Set to true to show the search field.
Useful when you have a big list of locales.

* `contributeUrl`
_(Type: `string`, Default: `null`)_ -
Have a contribute url that your users can help localize your app?
Set it in order to show contribute box with that url.

---

#### return

The `open` method returns the `$uibModal` modal instance and use his `promise` to let you know when the dialog is getting closed and what locale did the user choose.
You can get the selected locale from the `result` property of the returned `$uibModal` modal instance.
See the example.
[read more about the $uibModal]

0 comments on commit b36afdb

Please sign in to comment.