Skip to content

Commit

Permalink
fix a build mistake.
Browse files Browse the repository at this point in the history
  • Loading branch information
lordfriend committed Jan 17, 2015
1 parent 466aa5e commit f8d2272
Show file tree
Hide file tree
Showing 10 changed files with 133 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ module.exports = function(grunt) {
banner: grunt.file.read('src/banner')
},
dist: {
src: ['src/nya.prefix', 'src/nya-bs-public.js', 'src/nya-bs-select-ctrl.js', 'src/nya-bs-select.js', 'src/nya-bs-option.js', 'src/nya.suffix'],
src: ['src/nya.prefix', 'src/nya-bs-public.js', 'src/nya-bs-config.js', 'src/nya-bs-select-ctrl.js', 'src/nya-bs-select.js', 'src/nya-bs-option.js', 'src/nya.suffix'],
dest: 'dist/js/nya-bs-select.js'
}
},
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nya-bootstrap-select",
"version": "2.0.6",
"version": "2.0.7",
"main": [
"dist/js/nya-bs-select.js",
"dist/css/nya-bs-select.css"
Expand Down
2 changes: 1 addition & 1 deletion dist/css/nya-bs-select.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* nya-bootstrap-select v2.0.6
* nya-bootstrap-select v2.0.7
* Copyright 2014 Nyasoft
* Licensed under MIT license
*/
Expand Down
2 changes: 1 addition & 1 deletion dist/css/nya-bs-select.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

63 changes: 62 additions & 1 deletion dist/js/nya-bs-select.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* nya-bootstrap-select v2.0.6
* nya-bootstrap-select v2.0.7
* Copyright 2014 Nyasoft
* Licensed under MIT license
*/
Expand Down Expand Up @@ -319,6 +319,67 @@ var extend = angular.extend;

var nyaBsSelect = angular.module('nya.bootstrap.select', []);

/**
* A service for configuration. the configuration is shared globally.
*/
nyaBsSelect.provider('nyaBsConfig', function() {

var locale = null;

// default localized text. cannot be modified.
var defaultText = {
'en-us': {
defaultNoneSelection: 'Nothing selected',
noSearchResult: 'NO SEARCH RESULT',
numberItemSelected: '%d item selected'
}
};

// localized text which actually being used.
var interfaceText = deepCopy(defaultText);

/**
* Merge with default localized text.
* @param localeId a string formatted as languageId-countryId
* @param obj localized text object.
*/
this.setLocalizedText = function(localeId, obj) {
if(!localeId) {
throw new Error('localeId must be a string formatted as languageId-countryId');
}
if(!interfaceText[localeId]) {
interfaceText[localeId] = {};
}
interfaceText[localeId] = extend(interfaceText[localeId], obj);
};

/**
* Force to use a special locale id. if localeId is null. reset to user-agent locale.
* @param localeId a string formatted as languageId-countryId
*/
this.useLocale = function(localeId) {
locale = localeId;
};

/**
* get the localized text according current locale or forced locale
* @returns localizedText
*/
this.$get = ['$locale', function($locale){
var localizedText;
if(locale) {
localizedText = interfaceText[locale];
} else {
localizedText = interfaceText[$locale.id];
}
if(!localizedText) {
localizedText = defaultText['en-us'];
}
return localizedText;
}];

});


nyaBsSelect.controller('nyaBsSelectCtrl', function(){

Expand Down
4 changes: 2 additions & 2 deletions dist/js/nya-bs-select.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/dist/css/main.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* nya-bootstrap-select v2.0.6
* nya-bootstrap-select v2.0.7
* Copyright 2014 Nyasoft
* Licensed under MIT license
*/
Expand Down
2 changes: 1 addition & 1 deletion docs/dist/css/nya-bs-select.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* nya-bootstrap-select v2.0.6
* nya-bootstrap-select v2.0.7
* Copyright 2014 Nyasoft
* Licensed under MIT license
*/
Expand Down
63 changes: 62 additions & 1 deletion docs/dist/js/nya-bs-select.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* nya-bootstrap-select v2.0.6
* nya-bootstrap-select v2.0.7
* Copyright 2014 Nyasoft
* Licensed under MIT license
*/
Expand Down Expand Up @@ -319,6 +319,67 @@ var extend = angular.extend;

var nyaBsSelect = angular.module('nya.bootstrap.select', []);

/**
* A service for configuration. the configuration is shared globally.
*/
nyaBsSelect.provider('nyaBsConfig', function() {

var locale = null;

// default localized text. cannot be modified.
var defaultText = {
'en-us': {
defaultNoneSelection: 'Nothing selected',
noSearchResult: 'NO SEARCH RESULT',
numberItemSelected: '%d item selected'
}
};

// localized text which actually being used.
var interfaceText = deepCopy(defaultText);

/**
* Merge with default localized text.
* @param localeId a string formatted as languageId-countryId
* @param obj localized text object.
*/
this.setLocalizedText = function(localeId, obj) {
if(!localeId) {
throw new Error('localeId must be a string formatted as languageId-countryId');
}
if(!interfaceText[localeId]) {
interfaceText[localeId] = {};
}
interfaceText[localeId] = extend(interfaceText[localeId], obj);
};

/**
* Force to use a special locale id. if localeId is null. reset to user-agent locale.
* @param localeId a string formatted as languageId-countryId
*/
this.useLocale = function(localeId) {
locale = localeId;
};

/**
* get the localized text according current locale or forced locale
* @returns localizedText
*/
this.$get = ['$locale', function($locale){
var localizedText;
if(locale) {
localizedText = interfaceText[locale];
} else {
localizedText = interfaceText[$locale.id];
}
if(!localizedText) {
localizedText = defaultText['en-us'];
}
return localizedText;
}];

});


nyaBsSelect.controller('nyaBsSelectCtrl', function(){

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nya-bootstrap-select",
"version": "2.0.6",
"version": "2.0.7",
"description": "An angular directive wraps bootstrap-select",
"repository": {
"type": "git",
Expand Down

0 comments on commit f8d2272

Please sign in to comment.