Actualizado todo el sistema de idiomas con el plugin de lenguaje y adaptado el css para pantallas pequeñas
25
Gruntfile.js
Normal file
@ -0,0 +1,25 @@
|
||||
module.exports = function(grunt) {
|
||||
grunt.loadNpmTasks('grunt-angular-gettext');
|
||||
grunt.initConfig({
|
||||
nggettext_extract: {
|
||||
pot: {
|
||||
files: {
|
||||
'po/template.pot': ['partials/*.html']
|
||||
}
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
grunt.initConfig({
|
||||
nggettext_compile: {
|
||||
all: {
|
||||
files: {
|
||||
'src/js/translations.js': ['po/*.po']
|
||||
}
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
// Default task(s).
|
||||
grunt.registerTask('default', ['nggettext_compile']);
|
||||
};
|
35
app/anorgatarrak.js
Normal file
@ -0,0 +1,35 @@
|
||||
//var anApp = angular.module('anApp',[]);
|
||||
angular.module('anApp',[
|
||||
'catalog',
|
||||
'item',
|
||||
'ngRoute',
|
||||
'ngSanitize'
|
||||
]);
|
||||
|
||||
jQuery(document).ready(function() {
|
||||
console.log('ready');
|
||||
//$('video, audio').mediaelementplayer();
|
||||
//
|
||||
//var slsh;
|
||||
//var slsh = new SlideShow('.slideshow', {timeout: 5000});
|
||||
/*jQuery(document)
|
||||
.ajaxStart(function() {console.log('ajax start')})
|
||||
.ajaxStop(function() {console.log('ajax stop')});*/
|
||||
});
|
||||
|
||||
/*
|
||||
anApp.controller('anListController',function anListController($scope){
|
||||
$scope.catalog = [
|
||||
{ id: '1', title: 'Item 1', description: 'Description 1', img: 'assets/anorga.jpg'},
|
||||
{ id: '2',title: 'Item 2', description: 'Description 2', img: 'assets/anorga1.jpg'},
|
||||
{ id: '3', title: 'Item 2', description: 'Description 2', img: 'assets/anorga2.jpg'},
|
||||
{ id: '4', title: 'Item 2', description: 'Description 2', img: 'assets/anorga3.jpg'},
|
||||
{ id: '5', title: 'Item 2', description: 'Description 2', img: 'assets/anorga.jpg'},
|
||||
{ id: '6', title: 'Item 2', description: 'Description 2', img: 'assets/anorga1.jpg'},
|
||||
{ id: '7', title: 'Item 2', description: 'Description 2', img: 'assets/anorga2.jpg'},
|
||||
{ id: '8', title: 'Item 2', description: 'Description 2', img: 'assets/anorga3.jpg'},
|
||||
{ id: '9', title: 'Item 2', description: 'Description 2', img: 'assets/anorga.jpg'},
|
||||
{ id: '10', title: 'Item 2', description: 'Description 2', img: 'assets/anorga1.jpg'}
|
||||
]
|
||||
});
|
||||
*/
|
96
app/catalog/catalog.component.js
Normal file
@ -0,0 +1,96 @@
|
||||
angular.
|
||||
module('catalog').
|
||||
component('anList',{
|
||||
templateUrl : localized.partials + 'catalog.template.html',
|
||||
//'<a ng-repeat="item in $ctrl.catalog" class="square" style="background-image:url(\'{{item.img}}\');" ng-href="#!/catalog/{{item.id}}"></a>',
|
||||
controller :
|
||||
function($scope, $http, $routeParams, $rootScope) {
|
||||
$rootScope.lanEs = "http://es.anorgatarrak.eus/catalog/";
|
||||
$rootScope.lanEu = "http://anorgatarrak.eus/catalog2/";
|
||||
|
||||
$http.get('wp-json/wp/v2/entrevista/?per_page=100').then(function(res) {
|
||||
$scope.entrevistas = res.data;
|
||||
console.log(res);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
angular.
|
||||
module('catalog').
|
||||
component('anHome',{
|
||||
templateUrl: localized.partials + 'home.template.html',
|
||||
controller: function($scope, $rootScope, $http, $routeParams) {
|
||||
$rootScope.lanEs = "http://es.anorgatarrak.eus";
|
||||
$rootScope.lanEu = "http://anorgatarrak.eus";
|
||||
console.log($rootScope.loading);
|
||||
$scope.loading = true;
|
||||
window.scrollTo(0,0);
|
||||
$http.get('wp-json/wp/v2/slideshow').then(function(res) {
|
||||
$scope.slides = res.data;
|
||||
$scope.loading = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
angular.
|
||||
module('catalog').
|
||||
component('anContact',{
|
||||
templateUrl: localized.partials + 'contact.template.html'
|
||||
});
|
||||
|
||||
angular.
|
||||
module('catalog').
|
||||
component('anInfo',{
|
||||
templateUrl: localized.partials + 'info.template.html',
|
||||
controller: function($rootScope) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
angular.
|
||||
module('catalog').
|
||||
component('anLanguage', {
|
||||
templateUrl: localized.partials + 'language.template.html',
|
||||
controller: function($scope,$http,$routeParams,$sce,$rootScope,$location) {
|
||||
|
||||
console.log($rootScope);
|
||||
$scope.lan = function (l) {
|
||||
|
||||
if (l=='es') {
|
||||
window.location.assign($rootScope.lanEs);
|
||||
} else {
|
||||
window.location.assign($rootScope.lanEu);
|
||||
}
|
||||
};
|
||||
//console.log("anLanguage:"+$routeParams);
|
||||
//$http.get('wp-json/anorgatarrak/v1/link/'+$routeParams.slug).then(function(res) {
|
||||
// data = res.data;
|
||||
// console.log(data);
|
||||
//jQuery('#lan_link_eus').attr('href',data[1][1]);
|
||||
//jQuery('#lan_link_es').attr('href',data[0][1]);
|
||||
//});
|
||||
}
|
||||
});
|
||||
|
||||
angular
|
||||
.module('catalog')
|
||||
.component('anContent',{
|
||||
templateUrl: localized.partials + 'content.template.html',
|
||||
controller: function($scope, $http, $routeParams, $sce,$rootScope) {
|
||||
$rootScope.startLoading();
|
||||
console.log($routeParams.slug);
|
||||
window.scrollTo(0,0);
|
||||
$http.get('wp-json/wp/v2/pages/?slug='+$routeParams.slug).then(function(res) {
|
||||
$scope.post = res.data[0];
|
||||
console.log($scope.post.link_es);
|
||||
$scope.content = $sce.trustAsHtml($scope.post.content.rendered);
|
||||
//console.log('llamamos el cambi ode idioma');
|
||||
$rootScope.lanEs = $scope.post.link_es;
|
||||
$rootScope.lanEu = $scope.post.link_eu;
|
||||
//jQuery('#lan_link_eus').attr('href',"/"+$scope.post.link_eu); //.on('click',function() { alert('sss'); });
|
||||
//jQuery('#lan_link_es').attr('href',"/"+$scope.post.link_es);
|
||||
$rootScope.stopLoading();
|
||||
});
|
||||
}
|
||||
});
|
46
app/catalog/catalog.config.js
Normal file
@ -0,0 +1,46 @@
|
||||
angular.
|
||||
module('catalog').
|
||||
config(['$locationProvider', '$routeProvider','cfpLoadingBarProvider',
|
||||
function config($locationProvider, $routeProvider,cfpLoadingBarProvider) {
|
||||
cfpLoadingBarProvider.includeSpinner = false;
|
||||
cfpLoadingBarProvider.parentSelector = 'header';
|
||||
$locationProvider.html5Mode(true);
|
||||
//var a = window.location.host.split('.')[0];
|
||||
$routeProvider
|
||||
.when('/',{ template: '<an-home></an-home>'})
|
||||
.when('/catalog2', { redirectTo: '/catalog'})
|
||||
.when('/catalog', {
|
||||
template: '<an-list></an-list>'
|
||||
})
|
||||
.when('/catalog/:slug', {
|
||||
template: '<an-detail></an-detail>'
|
||||
})
|
||||
//.when('/info', {template: '<an-info></an-info>'})
|
||||
.when('/:slug',{template: '<an-content></an-content>'})
|
||||
.otherwise({ redirectTo: '/'});
|
||||
|
||||
}
|
||||
]).
|
||||
run(function($rootScope,$http,$routeParams,gettextCatalog) {
|
||||
$rootScope.$on('$stateChangeStart',
|
||||
function(event,toState,toParams,fromState,fromParams) { console.log('statechangestart'); });
|
||||
$rootScope.lanEs = "";
|
||||
$rootScope.lanEu = "";
|
||||
$rootScope.loading = false;
|
||||
$rootScope.startLoading = function() {
|
||||
console.log('start');
|
||||
}
|
||||
$rootScope.stopLoading = function() {
|
||||
console.log('stop');
|
||||
}
|
||||
//gettextCatalog.setCurrentLanguage('eu_ES');
|
||||
gettextCatalog.debug = true;
|
||||
|
||||
/*$http.get('wp-json/anorgatarrak/v1/link/'+window.location.pathname).then(function(res) {
|
||||
data = res.data;
|
||||
console.log(data);
|
||||
jQuery('#lan_link_eus').attr('href',data[1][1]);
|
||||
jQuery('#lan_link_es').attr('href',data[0][1]);
|
||||
});*/
|
||||
|
||||
});
|
3
app/catalog/catalog.module.js
Normal file
@ -0,0 +1,3 @@
|
||||
angular.module('catalog', [
|
||||
'ngRoute','angular-loading-bar','gettext']);
|
||||
|
26
app/catalog/item.component.js
Normal file
@ -0,0 +1,26 @@
|
||||
angular.
|
||||
module('item').
|
||||
component('anDetail', {
|
||||
templateUrl: localized.partials + '/item-detail.template.html',
|
||||
controller: function($scope, $rootScope, $http, $routeParams, $sce, SubdomainService, gettextCatalog) {
|
||||
//console.log($routeParams.slug);
|
||||
$scope.lang = SubdomainService.subdomain;
|
||||
console.log($scope.lang);
|
||||
if ($scope.lang=='eus') { gettextCatalog.setCurrentLanguage('eu_ES');}
|
||||
//else { gettextCatalog.setCurrentLanguage('es');}
|
||||
$http.get('wp-json/wp/v2/entrevista/?slug='+$routeParams.slug).then(function(res) {
|
||||
console.log(res.data[0]);
|
||||
$scope.post = res.data[0];
|
||||
$rootScope.lanEs = $scope.post.link_es;
|
||||
$rootScope.lanEu = $scope.post.link_eu;
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
// controller: ['$routeParams',
|
||||
// function ItemDetailController($routeParams) {
|
||||
// this.itemId = $routeParams.itemId;
|
||||
// $http.get('wp-json/wp/v2/entrevistas/?slug='+$routeParams.slug).then(function(res) { $scope.post = res.data[0]; $scope.content = $sce.trustAsHtml($scope.post.content.rendered); });
|
||||
// }
|
||||
//]
|
||||
});
|
10
app/catalog/item.module.js
Normal file
@ -0,0 +1,10 @@
|
||||
angular.module('item',['ngRoute']);
|
||||
|
||||
angular.module('item').factory('SubdomainService', [
|
||||
'$location', function($location) {
|
||||
var service = {};
|
||||
service.subdomain = window.location.host.split('.')[0];
|
||||
if (window.location.host.split('.').length != 3) { service.subdomain = 'eus'; }
|
||||
return service;
|
||||
}
|
||||
]);
|
BIN
assets/anorga.jpg
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
assets/anorga1.jpg
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
assets/anorga10.jpg
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
assets/anorga2.jpg
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
assets/anorga3.jpg
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
assets/anorga4.jpg
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
assets/anorga5.jpg
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
assets/anorga6.jpg
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
assets/anorga7.jpg
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
assets/anorga8.jpg
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
assets/anorga9.jpg
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
assets/favicon.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
assets/rsc29_rsc170_33.jpg
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
assets/video.jpg
Normal file
After Width: | Height: | Size: 140 KiB |
144
css/anorgatarrak.css
Normal file
@ -0,0 +1,144 @@
|
||||
/* Colores corporativos */
|
||||
.rezolaOrangeBackground { background-color:rgba(255,153,51,255); }
|
||||
.rezolaOrangeColor {color:rgba(255,153,51,255); }
|
||||
|
||||
|
||||
/* Tipografias */
|
||||
body {font-family:'Montserrat',sans-serif;}
|
||||
h1 {font-family: 'Roboto',sans-serif;}
|
||||
div.post-header h1 { font-size:6em;font-size:15vmin;font-weight:800;}
|
||||
h1,h2,h3,a {color:rgba(255,153,51,255);max-width:80%;}
|
||||
div.content {margin-bottom:3em;}
|
||||
div.content h2 {margin-top:3em; }
|
||||
div.content h3 {margin-top:3em; font-weight:bold; color:#000;}
|
||||
div.row {margin-right:0 !important; margin-left:0 !important;}
|
||||
|
||||
/* Grid */
|
||||
.main {padding:0;}
|
||||
.square {
|
||||
float:left;
|
||||
position:relative;
|
||||
width:20%;
|
||||
padding-bottom:20%;
|
||||
margin:0;
|
||||
background-position:center center;
|
||||
background-repeat: no-repeat;
|
||||
background-size:cover;
|
||||
background-color:rgba(255,153,51,255);
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 768px) {
|
||||
.square {
|
||||
max-width:100%;
|
||||
width:100% !important;
|
||||
padding-bottom:50% !important;
|
||||
}
|
||||
}
|
||||
|
||||
.square:hover {
|
||||
opacity:0.5;
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
/* slider */
|
||||
.slider {background-color:#231f20;}
|
||||
.step {
|
||||
float:left;
|
||||
position:relative;
|
||||
width:100%;
|
||||
margin:0;
|
||||
padding-bottom:40%;
|
||||
background-size:cover;
|
||||
background-repeat: no-repeat;
|
||||
background-position:center center;
|
||||
background-image:url('/assets/anorga3.jpg');
|
||||
/*-webkit-filter: blur(5px);
|
||||
-moz-filter: blur(5px);
|
||||
-o-filter: blur(5px);
|
||||
-ms-filter: blur(5px);
|
||||
filter: blur(5px); */
|
||||
}
|
||||
|
||||
.step .content {
|
||||
position:absolute;
|
||||
height:90%;
|
||||
width:90%;
|
||||
padding:5%;
|
||||
}
|
||||
|
||||
.step .content .table {
|
||||
display:table;
|
||||
width:100%;
|
||||
height:100%;
|
||||
}
|
||||
|
||||
.step .content .table .table-cell {
|
||||
display:table-cell;
|
||||
vertical-align:middle;
|
||||
}
|
||||
|
||||
.step .content .table .table-cell h2 { font-size:5em;}
|
||||
.step .content .table .table-cell p { font-size:3em; color:#fff;}
|
||||
|
||||
/* Redefinir Bootstrap */
|
||||
.an-navbar {
|
||||
padding:5px 0;
|
||||
margin-bottom:0;
|
||||
border-bottom:1px solid rgba(255,153,51,255);
|
||||
}
|
||||
.progress { margin-bottom:0;}
|
||||
.an-progress-bar {background-color:rgba(255,153,51.255); background-color:#ff9933; }
|
||||
|
||||
footer { background:#231f20;padding:30px 0;}
|
||||
h2 {font-weight:bold; color: rgba(255,153,51.255);}
|
||||
.navbar-brand { font-size:32px; margin:5px; color:rgba(255,153,51.255);}
|
||||
.anorgatarrak { font-family: 'Nothing You Could Do', cursive; color:rgba(255,153,51.255) !important; color:#ff9933 !important;}
|
||||
|
||||
.ficha-header { background-color:#231f20;}
|
||||
.ficha {padding:10px;margin-bottom:10px;}
|
||||
|
||||
.breadcrumb { display:none; }
|
||||
|
||||
/* slideshow */
|
||||
|
||||
.slideshow {
|
||||
background:#ff9933;
|
||||
}
|
||||
|
||||
.slideshow li {
|
||||
width:100%;
|
||||
}
|
||||
|
||||
.slideshow img {
|
||||
width:100%;
|
||||
}
|
||||
|
||||
.slideshow img::before {display:none;}
|
||||
|
||||
.navbar-header .navbar-collapse ul li.lang-item { float:left;}
|
||||
.navbar-header .navbar-collapse ul { list-decoration:none;padding:0;}
|
||||
.navbar-header .navbar-collapse ul li a { padding:10px 15px; }
|
||||
|
||||
/* static slider */
|
||||
|
||||
.slideshow-static { padding:0; }
|
||||
.slideshow-static li { list-style:none;}
|
||||
|
||||
#loading-bar .bar {
|
||||
background: #ff9933 !important;
|
||||
}
|
||||
|
||||
div.post-header div.row { background:rgba(0,0,0,0.8);}
|
||||
|
||||
li.anor-list-items { width:100%;float:right;margin-top:1em;margin-bottom:1em;}
|
||||
li.anor-list-items ul {list-style:none;}
|
||||
li.anor-list-items ul li {float:left;margin:2px;}
|
||||
|
||||
.lan_link { cursor:pointer; text-align:center; font-weight:bold; color:#000 !important;}
|
||||
.navbar-language > li .lan_link:hover { background:none;}
|
||||
.navbar-language > li:hover {background:#fff;}
|
||||
|
||||
div.clear { clear:both; height:2em;}
|
||||
|
||||
img.alignleft { float:left; margin:0.5em 1em 0.5em 0;}
|
||||
/*img.alignleft::before { clear:both; height:2em; content : "Nothing";}*/
|
BIN
favicon.ico
Normal file
After Width: | Height: | Size: 8.0 KiB |
29
footer.php
Normal file
@ -0,0 +1,29 @@
|
||||
<footer>
|
||||
<div class="navbar">
|
||||
<?php wp_nav_menu(
|
||||
array(
|
||||
'theme_location' => 'footer-menu-anorgatarrak',
|
||||
'container' => 'div',
|
||||
//'container_class' => 'header-menu-anorgatarrak',
|
||||
'container_class' => 'container',
|
||||
'menu_class' => 'nav nav-pills',
|
||||
) );
|
||||
?>
|
||||
<!--
|
||||
<div class="container">
|
||||
<ul class="nav nav-pills">
|
||||
<li><a href="#">Explora</a></li>
|
||||
<li><a href="#">Contacto</a></li>
|
||||
<li><a href="#">Añorgatarrak</a></li>
|
||||
<li><a href="#">Texto Legal</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
-->
|
||||
</div>
|
||||
<div class="container"><p class="text-muted" style="margin:auto;text-align:center;margin-bottom:20px;"><img style="max-height:100px;max-width:100%;" src="http://anorgatarrak.eus/wp-content/uploads/2017/12/banner_footer.png"/></p></div>
|
||||
<div class="container">
|
||||
<p class="text-muted" style="font-size:0.8em;">Museum Cemento Rezola - Copyright 2017 - www.museumcementorezola.org</p>
|
||||
</div>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
213
functions.php
Normal file
@ -0,0 +1,213 @@
|
||||
<?php
|
||||
function anorgatarrak_scripts() {
|
||||
//CSS
|
||||
wp_enqueue_style( 'style', get_stylesheet_uri() );
|
||||
wp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/node_modules/bootstrap/dist/css/bootstrap.min.css',false,'1.1','all');
|
||||
wp_enqueue_style( 'anorgatarrak', get_template_directory_uri() . '/css/anorgatarrak.css',false,'1.1','all');
|
||||
wp_enqueue_style( 'slideshow', get_template_directory_uri() . '/node_modules/simple-slideshow/src/slideshow.css',false,'1.1','all');
|
||||
wp_enqueue_style( 'google-fonts', 'https://fonts.googleapis.com/css?family=Montserrat|Nothing+You+Could+Do|Roboto',false,'1.1','all');
|
||||
wp_enqueue_style('angular-loading-bar', get_template_directory_uri() . '/node_modules/angular-loading-bar/src/loading-bar.css');
|
||||
wp_enqueue_style('mediaelement', get_template_directory_uri() . '/node_modules/mediaelement/build/mediaelementplayer.min.css');
|
||||
//Scripts
|
||||
wp_enqueue_script('html5shiv', 'https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js');
|
||||
wp_enqueue_script('respond', 'https://oss.maxcdn.com/respond/1.4.2/respond.min.js');
|
||||
wp_enqueue_script('mediaelement', get_template_directory_uri().'/node_modules/mediaelement/build/mediaelement-and-player.min.js');
|
||||
wp_enqueue_script('slideshow', get_template_directory_uri() .'/node_modules/simple-slideshow/src/slideshow.js');
|
||||
wp_enqueue_script('jquery', get_template_directory_uri() .'/node_modules/jquery/dist/jquery.min.js');
|
||||
wp_enqueue_script('bootstrap', get_template_directory_uri() .'/node_modules/bootstrap/dist/js/bootstrap.min.js');
|
||||
wp_enqueue_script('angularjs', get_template_directory_uri() .'/node_modules/angular/angular.js');
|
||||
wp_enqueue_script('angularjs-route', get_template_directory_uri() .'/node_modules/angular-route/angular-route.js');
|
||||
wp_enqueue_script('angularjs-sanitize', get_stylesheet_directory_uri() . '/node_modules/angular-sanitize/angular-sanitize.min.js');
|
||||
wp_enqueue_script('angular-loading-bar', get_stylesheet_directory_uri() . '/node_modules/angular-loading-bar/src/loading-bar.js');
|
||||
wp_enqueue_script('angular-gettext', get_template_directory_uri() . '/node_modules/angular-gettext/dist/angular-gettext.min.js');
|
||||
wp_enqueue_script('angular-translation', get_template_directory_uri() . '/src/js/translations.js');
|
||||
wp_enqueue_script('anorgatarrak', get_template_directory_uri() .'/app/anorgatarrak.js');
|
||||
wp_enqueue_script('catalog-module', get_template_directory_uri() .'/app/catalog/catalog.module.js');
|
||||
wp_enqueue_script('catalog-config', get_template_directory_uri() .'/app/catalog/catalog.config.js');
|
||||
wp_enqueue_script('catalog-component', get_template_directory_uri() .'/app/catalog/catalog.component.js');
|
||||
wp_enqueue_script('item-module', get_template_directory_uri() .'/app/catalog/item.module.js');
|
||||
wp_enqueue_script('item-component', get_template_directory_uri() .'/app/catalog/item.component.js');
|
||||
//TEMPLATES
|
||||
wp_localize_script('anorgatarrak', 'localized', array('partials' => get_template_directory_uri() . '/partials/'));
|
||||
}
|
||||
|
||||
function create_posttype() {
|
||||
//Add Slidehow type
|
||||
register_post_type('slideshow',
|
||||
array(
|
||||
'labels' => array(
|
||||
'name' => __( 'Slides'),
|
||||
'singular_name' => __('Slide')
|
||||
),
|
||||
'supports' => array( 'title', 'excerpt', 'thumbnail' ),
|
||||
'show_in_rest' => true,
|
||||
'public' => true,
|
||||
'has_archive' => true,
|
||||
'rewrite' => array('slug' => 'slideshow'),
|
||||
)
|
||||
);
|
||||
//Add Entrevista type
|
||||
register_post_type('entrevista',
|
||||
array(
|
||||
'labels' => array(
|
||||
'name' => __('Entrevistas'),
|
||||
'singular_name' => __('Entrevista')
|
||||
),
|
||||
'supports' => array('title','thumbnail'),
|
||||
'show_in_rest' => true,
|
||||
'public' => true,
|
||||
'rewrite' => array('slug' => 'catalog'),
|
||||
)
|
||||
);
|
||||
//Add Persona
|
||||
register_post_type('entidad',
|
||||
array(
|
||||
'labels' => array(
|
||||
'name' => __('Personas'),
|
||||
'singular_name' => __('Persona')
|
||||
),
|
||||
'supports' => array('thumbnail','title'),
|
||||
'show_in_rest' => true,
|
||||
'public' => true,
|
||||
'rewrite' => array('slug'=> 'entidad'),
|
||||
)
|
||||
);
|
||||
//ADD EXCERPT TO PAGES
|
||||
add_post_type_support( 'page', 'excerpt' );
|
||||
}
|
||||
|
||||
function my_rest_prepare_slideshow($data,$post,$request) {
|
||||
$_data = $data->data;
|
||||
$thumbnail_id = get_post_thumbnail_id($post->ID);
|
||||
#$thumbnail = wp_get_attachment_image_src ($thumbnail_id);
|
||||
$thumbnail = wp_get_attachment_image_src ($thumbnail_id,'full',false);
|
||||
$_data['featured_image_thumbnail_url'] = $thumbnail[0];
|
||||
$_data['excerpt_clean'] = strip_tags(get_the_excerpt($post->ID));
|
||||
$_data['link_eu'] = str_replace('http://es.','http://',get_permalink(pll_get_post($post->ID,'eu')));
|
||||
$_data['link_es'] = str_replace('http://','http://es.',get_permalink(pll_get_post($post->ID,'es')));
|
||||
//$data = array(array('es',get_permalink(pll_get_post($id,'es'))),array('eus',get_permalink(pll_get_post($id,'eu'))));
|
||||
$data->data = $_data;
|
||||
return $data;
|
||||
}
|
||||
|
||||
function my_rest_prepare_entrevista($data,$post,$request) {
|
||||
$_data = $data->data;
|
||||
//thumbnail
|
||||
$thumbnail_id = get_post_thumbnail_id($post->ID);
|
||||
$thumbnail = wp_get_attachment_image_src ($thumbnail_id);
|
||||
$_data['featured_image_thumbnail_url'] = $thumbnail[0];
|
||||
//category
|
||||
$_data['category'] = wp_get_post_terms($post->ID,'termino');
|
||||
//acf
|
||||
$_data['e_idioma'] = get_field('idioma',$post->ID);
|
||||
$_data['e_informantes'] = get_field('informantes',$post->ID);
|
||||
$_data['e_audiovisual'] = get_field('audiovisual',$post->ID);
|
||||
$_data['e_transcripcion'] = get_field('transcripcion',$post->ID);
|
||||
$_data['e_fecha_de_entrevista'] = get_field('fecha_de_entrevista',$post->ID);
|
||||
$find = array('http://','https://');
|
||||
$_data['link_eu'] = str_replace('http://es.','http://',get_permalink(pll_get_post($post->ID,'eu')));
|
||||
$_data['link_es'] = str_replace($find,'http://es.',get_permalink(pll_get_post($post->ID,'es')));
|
||||
$_data['e_localizacion'] = get_field('lugar',$post->ID);
|
||||
$data->data = $_data;
|
||||
return $data;
|
||||
|
||||
|
||||
}
|
||||
|
||||
function anorgatarrak_metabox() {
|
||||
add_meta_box('entrevista-anorgatarrak-metabox',__('Datos entrevista'),'cd_metabox_entrevista', 'entrevista','normal','high');
|
||||
}
|
||||
|
||||
function cd_metabox_entrevista() {
|
||||
echo '<p>Datos relativos a las entrevistas</p>';
|
||||
}
|
||||
|
||||
function remove_menus(){
|
||||
remove_menu_page( 'edit-comments.php' ); //Comments
|
||||
remove_menu_page( 'edit.php' ); //Posts
|
||||
}
|
||||
|
||||
function anorgatarrak_get_lan_id(WP_REST_Request $request) {
|
||||
$url = $request['url'];
|
||||
$id = url_to_postid($url);
|
||||
$data = array(array('es',get_permalink(pll_get_post($id,'es'))),array('eus',get_permalink(pll_get_post($id,'eu'))));
|
||||
$response = new WP_REST_Response( $data );
|
||||
// $postid = url_to_postid( $url );
|
||||
// https://developer.wordpress.org/reference/functions/register_rest_route/
|
||||
// get_page_by_path()
|
||||
// return new WP_Error( 'no_author', 'Invalid author', array( 'status' => 404 ) );
|
||||
return $response;
|
||||
}
|
||||
|
||||
function create_anorgatarrak_tesaurus() {
|
||||
register_taxonomy(
|
||||
'termino',
|
||||
'entrevista',
|
||||
array(
|
||||
'label' => __('Terminos'),
|
||||
'rewrite' => array('slug'=> 'termino'),
|
||||
'hierarchical' => true,
|
||||
)
|
||||
|
||||
);
|
||||
register_taxonomy('profesion','entidad', array (
|
||||
'label' => __('Profesiones'),
|
||||
'rewrite' => array('slug' => 'profesion'),
|
||||
));
|
||||
register_taxonomy('etapas','entrevista',array(
|
||||
'label' => _('Etapas del proyecto'),
|
||||
'rewrite' => array('slug' => 'etapas'),
|
||||
));
|
||||
}
|
||||
add_action( 'init', 'create_anorgatarrak_tesaurus' );
|
||||
|
||||
add_action( 'admin_menu', 'remove_menus' );
|
||||
|
||||
add_filter('rest_prepare_slideshow','my_rest_prepare_slideshow', 12, 3);
|
||||
add_filter('rest_prepare_entrevista','my_rest_prepare_entrevista', 12, 3);
|
||||
add_filter('rest_prepare_post','my_rest_prepare_slideshow', 12, 3);
|
||||
add_filter('rest_prepare_page','my_rest_prepare_slideshow', 12, 3);
|
||||
add_theme_support( 'post-thumbnails' );
|
||||
|
||||
add_action('init','create_posttype');
|
||||
//add_action('add_meta_boxes','anorgatarrak_metabox');
|
||||
add_action('wp_enqueue_scripts', 'anorgatarrak_scripts');
|
||||
|
||||
add_action( 'widgets_init', 'anorgatarrak_widgets_init' );
|
||||
function anorgatarrak_widgets_init() {
|
||||
register_sidebar( array(
|
||||
'name' => __( 'Main Sidebar', 'anorgatarrak' ),
|
||||
'id' => 'sidebar-anorgatarrak-1',
|
||||
'class' => '',
|
||||
'description' => __( 'Widgets on header', 'anorgatarrak' ),
|
||||
'before_widget' => '<div class="collapse navbar-collapse" id="an-navbar-collapse">',
|
||||
'after_widget' => '</div>',
|
||||
'before_title' => '',
|
||||
'after_title' => '',
|
||||
) );
|
||||
}
|
||||
|
||||
function register_anorgatarrak_menu() {
|
||||
register_nav_menu( 'header-menu-anorgatarrak',__( 'Header Menu Anorgatarrak' ) );
|
||||
register_nav_menu( 'footer-menu-anorgatarrak',__( 'Footer Menu Anorgatarrak' ) );
|
||||
}
|
||||
add_action( 'init', 'register_anorgatarrak_menu' );
|
||||
|
||||
function my_acf_google_map_api( $api ){
|
||||
|
||||
$api['key'] = 'AIzaSyCASefiswqiqrc74Ebs68_HI6vubGJMR9M';
|
||||
|
||||
return $api;
|
||||
|
||||
}
|
||||
|
||||
add_filter('acf/fields/google_map/api', 'my_acf_google_map_api');
|
||||
|
||||
add_action( 'rest_api_init', function () {
|
||||
register_rest_route( 'anorgatarrak/v1', '/link/(?P<url>[a-zA-Z0-9-]+)', array(
|
||||
'methods' => 'GET',
|
||||
'callback' => 'anorgatarrak_get_lan_id',
|
||||
) );
|
||||
} );
|
||||
|
||||
?>
|
19
header.php
Normal file
@ -0,0 +1,19 @@
|
||||
<!DOCTYPE html>
|
||||
<html <?php language_attributes(); ?> ng-app="anApp">
|
||||
<head>
|
||||
<base href="/">
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="shortcut icon" href="http://anorgatarrak.eus/wp-content/themes/anorgatarrak/favicon.ico">
|
||||
<?php wp_head(); ?>
|
||||
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
77
index.php
Normal file
@ -0,0 +1,77 @@
|
||||
<?php get_header(); ?>
|
||||
<!-- Primary navbar -->
|
||||
|
||||
<nav class="an-navbar navbar navbar-inverse">
|
||||
<div class="container-fluid">
|
||||
<div class="navbar-header">
|
||||
<?php //dynamic_sidebar( 'sidebar-anorgatarrak-1' ); ?>
|
||||
<div class="visible-xs-block"> <an-language></an-language> </div>
|
||||
<a class="navbar-brand anorgatarrak" href="/">Añorgatarrak</a>
|
||||
<!--<ul class="nav navbar-nav">
|
||||
<li><a href="#">ES</a></li>
|
||||
<li><a href="#">EU</a></li>
|
||||
</ul>-->
|
||||
</div>
|
||||
<?php wp_nav_menu(
|
||||
array(
|
||||
'theme_location' => 'header-menu-anorgatarrak',
|
||||
'container' => 'div',
|
||||
//'container_class' => 'header-menu-anorgatarrak',
|
||||
'container_class' => 'an-navbar-collapse',
|
||||
'container_id' => 'an-navbar-collapse',
|
||||
'menu_class' => 'nav navbar-nav navbar-right',
|
||||
) );
|
||||
?>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<!-- Content -->
|
||||
<!-- Home -->
|
||||
<div ng-show="loading" style="overflow:hidden;width:100%;height:100%;position:fixed;top:0;left:0;background:rgba(0,0,0,0.8);z-index:300;">
|
||||
<h1 style="position:absolute;top:50%;left:50%;"></h1>
|
||||
</div>
|
||||
<header>
|
||||
<div class="container-fluid main">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="#!/">Inicio</a></li>
|
||||
<li class="breadcrumb-item"><a href="#!/catalog">Entrevistas</a></li>
|
||||
<li class="breadcrumb-item active">Entrevista a Kontxi y María Dolores Elizegi</li>
|
||||
</ol>
|
||||
<div class="hidden-xs" style="float:right;margin-right:30px;position:absolute;z-index:100;right:30px;">
|
||||
<an-language></an-language>
|
||||
</div>
|
||||
<div ng-view style="padding-bottom:0px;"></div>
|
||||
|
||||
<!-- Progressbar content -->
|
||||
<div class="progress" style="">
|
||||
<div class="progress-bar an-progress-bar" role="progressbar" aria-valuenow="10" aria-valuemin="0" aria-valuemax="100" style="width: 100%"></div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<!-- front-page -->
|
||||
<div class="container" style="padding:30px 0;" ng-hide>
|
||||
<div class="row">
|
||||
<?php
|
||||
$args = array (
|
||||
'sort_column' => 'menu_order',
|
||||
'number' => 3,
|
||||
);
|
||||
$pages = get_pages($args);
|
||||
foreach ($pages as $page) :
|
||||
?>
|
||||
<?php //print_r($page); ?>
|
||||
<div class="col-md-4">
|
||||
<a href="<?php echo get_permalink($page->ID);?>">
|
||||
<div class="row" style="margin:0px 2px 20px; background-size:cover;height:200px;background-image:url('<?php echo get_the_post_thumbnail_url($page->ID); ?>');">
|
||||
<div class="col-md-12" style="background-color:rgba(0,0,0,0.8);">
|
||||
<h2><?php echo $page->post_title; ?></h2>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
<?php echo $page->post_excerpt; ?>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div> <!-- row -->
|
||||
</div><!-- container -->
|
||||
<?php //endif; ?>
|
||||
<?php get_footer(); ?>
|
104
index.php.bk
Normal file
@ -0,0 +1,104 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="es" ng-app="anApp">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="shortcut icon" href="assets/favicon.png">
|
||||
<title>Añorgatarrak</title>
|
||||
|
||||
<!-- Bootstrap -->
|
||||
<link href="node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="css/anorgatarrak.css" rel="stylesheet">
|
||||
<!-- slideshow -->
|
||||
<link rel="stylesheet" href="node_modules/simple-slideshow/src/slideshow.css">
|
||||
<script src="node_modules/simple-slideshow/src/slideshow.js"></script>
|
||||
|
||||
<!-- Google fonts-->
|
||||
<link href="https://fonts.googleapis.com/css?family=Montserrat|Nothing+You+Could+Do|Roboto" rel="stylesheet">
|
||||
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
|
||||
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
|
||||
<script src="node_modules/jquery/dist/jquery.min.js"></script>
|
||||
<!-- Include all compiled plugins (below), or include individual files as needed -->
|
||||
<script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
|
||||
|
||||
<script src="node_modules/angular/angular.js"></script>
|
||||
<script src="node_modules/angular-route/angular-route.js"></script>
|
||||
<script src="app/anorgatarrak.js"></script>
|
||||
<script src="app/catalog/catalog.module.js"></script>
|
||||
<script src="app/catalog/catalog.config.js"></script>
|
||||
<script src="app/catalog/catalog.component.js"></script>
|
||||
<script src="app/catalog/item.module.js"></script>
|
||||
<script src="app/catalog/item.component.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Primary navbar -->
|
||||
|
||||
<nav class="an-navbar navbar navbar-inverse">
|
||||
<div class="container-fluid">
|
||||
<div class="navbar-header">
|
||||
<a class="navbar-brand anorgatarrak" href="#">Añorgatarrak</a>
|
||||
<ul class="nav navbar-nav">
|
||||
<li><a href="#">ES</a></li>
|
||||
<li><a href="#">EU</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
<div class="collapse navbar-collapse" id="an-navbar-collapse">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li><a href="#!/info">Proyecto</a></li>
|
||||
<li><a href="#!/catalog">Entrevistas</a></li>
|
||||
<li><a href="#!/contact">Contacto</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<!-- Content -->
|
||||
<!-- Home -->
|
||||
<header>
|
||||
<div class="container-fluid main">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="#!/">Inicio</a></li>
|
||||
<li class="breadcrumb-item"><a href="#!/catalog">Entrevistas</a></li>
|
||||
<li class="breadcrumb-item active">Entrevista a Kontxi y María Dolores Elizegi</li>
|
||||
</ol>
|
||||
<!-- <an-list></an-list> -->
|
||||
<div ng-view></div>
|
||||
|
||||
<!-- Progressbar content -->
|
||||
<div class="progress">
|
||||
<div class="progress-bar an-progress-bar" role="progressbar" aria-valuenow="10" aria-valuemin="0" aria-valuemax="100" style="width: 100%">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<div class="container" style="padding:30px 0;" ng-hide>
|
||||
<div class="row">
|
||||
<div class="col-md-4"><h2>Zer da <span class="anorgatarrak">Añorgatarrak</span>?</h2><p>Añorgatarrak proiektua Museum Cemento Rezolak eta Añorgako auzoak duten gertuko harremana medio sortzen da. Harreman hau proiektuaren ibilbidean zehar indartzen joan da eta museoa elkargune eta bitartekari bilakatu du.</p><p><a class="btn" ng-href="#!/info">Mostrar más</a></p></div>
|
||||
<div class="col-md-4"><h2>Entrevistas del proyecto</h2><p>This example is a quick exercise to illustrate how the default, static and fixed to top navbar work. It includes the responsive CSS and HTML, so it also adapts to your viewport and device. To see the difference between static and fixed top navbars, just scroll.</p><p><a class="btn" ng-href="#!/catalog/">Mostrar más</a></p></div>
|
||||
<div class="col-md-4"><h2>Información relevante</h2><p>This example is a quick exercise to illustrate how the default, static and fixed to top navbar work. It includes the responsive CSS and HTML, so it also adapts to your viewport and device. To see the difference between static and fixed top navbars, just scroll.</p><p><a class="btn" ng-href="#!/contact">Mostrar más</a></p></div>
|
||||
</div>
|
||||
</div>
|
||||
<footer>
|
||||
<div class="navbar">
|
||||
<div class="container">
|
||||
<ul class="nav nav-pills">
|
||||
<li><a href="#">Explora</a></li>
|
||||
<li><a href="#">Contacto</a></li>
|
||||
<li><a href="#">Añorgatarrak</a></li>
|
||||
<li><a href="#">Texto Legal</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container">
|
||||
<p class="text-muted">Museum Cemento Rezola - Copyright 2017</p>
|
||||
</div>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
22
m.pot
Normal file
@ -0,0 +1,22 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2018-02-15 20:19+0100\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"Language: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=CHARSET\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: functions.php:139
|
||||
msgid "Etapas del proyecto"
|
||||
msgstr ""
|
1
node_modules/.bin/babylon
generated
vendored
Symbolic link
@ -0,0 +1 @@
|
||||
../babylon/bin/babylon.js
|
1
node_modules/.bin/cake
generated
vendored
Symbolic link
@ -0,0 +1 @@
|
||||
../coffeescript/bin/cake
|
1
node_modules/.bin/coffee
generated
vendored
Symbolic link
@ -0,0 +1 @@
|
||||
../coffeescript/bin/coffee
|
1
node_modules/.bin/dateformat
generated
vendored
Symbolic link
@ -0,0 +1 @@
|
||||
../dateformat/bin/cli.js
|
1
node_modules/.bin/esparse
generated
vendored
Symbolic link
@ -0,0 +1 @@
|
||||
../esprima/bin/esparse.js
|
1
node_modules/.bin/esvalidate
generated
vendored
Symbolic link
@ -0,0 +1 @@
|
||||
../esprima/bin/esvalidate.js
|
1
node_modules/.bin/grunt
generated
vendored
Symbolic link
@ -0,0 +1 @@
|
||||
../grunt/bin/grunt
|
1
node_modules/.bin/js-yaml
generated
vendored
Symbolic link
@ -0,0 +1 @@
|
||||
../js-yaml/bin/js-yaml.js
|
1
node_modules/.bin/nopt
generated
vendored
Symbolic link
@ -0,0 +1 @@
|
||||
../nopt/bin/nopt.js
|
1
node_modules/.bin/rimraf
generated
vendored
Symbolic link
@ -0,0 +1 @@
|
||||
../rimraf/bin.js
|
1
node_modules/.bin/semver
generated
vendored
Symbolic link
@ -0,0 +1 @@
|
||||
../semver/bin/semver
|
1
node_modules/.bin/strip-indent
generated
vendored
Symbolic link
@ -0,0 +1 @@
|
||||
../strip-indent/cli.js
|
1
node_modules/.bin/tsc
generated
vendored
Symbolic link
@ -0,0 +1 @@
|
||||
../typescript/bin/tsc
|
1
node_modules/.bin/tsserver
generated
vendored
Symbolic link
@ -0,0 +1 @@
|
||||
../typescript/bin/tsserver
|
1
node_modules/.bin/which
generated
vendored
Symbolic link
@ -0,0 +1 @@
|
||||
../which/bin/which
|
46
node_modules/abbrev/LICENSE
generated
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
This software is dual-licensed under the ISC and MIT licenses.
|
||||
You may use this software under EITHER of the following licenses.
|
||||
|
||||
----------
|
||||
|
||||
The ISC License
|
||||
|
||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
----------
|
||||
|
||||
Copyright Isaac Z. Schlueter and Contributors
|
||||
All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
files (the "Software"), to deal in the Software without
|
||||
restriction, including without limitation the rights to use,
|
||||
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
23
node_modules/abbrev/README.md
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
# abbrev-js
|
||||
|
||||
Just like [ruby's Abbrev](http://apidock.com/ruby/Abbrev).
|
||||
|
||||
Usage:
|
||||
|
||||
var abbrev = require("abbrev");
|
||||
abbrev("foo", "fool", "folding", "flop");
|
||||
|
||||
// returns:
|
||||
{ fl: 'flop'
|
||||
, flo: 'flop'
|
||||
, flop: 'flop'
|
||||
, fol: 'folding'
|
||||
, fold: 'folding'
|
||||
, foldi: 'folding'
|
||||
, foldin: 'folding'
|
||||
, folding: 'folding'
|
||||
, foo: 'foo'
|
||||
, fool: 'fool'
|
||||
}
|
||||
|
||||
This is handy for command-line scripts, or other cases where you want to be able to accept shorthands.
|
61
node_modules/abbrev/abbrev.js
generated
vendored
Normal file
@ -0,0 +1,61 @@
|
||||
module.exports = exports = abbrev.abbrev = abbrev
|
||||
|
||||
abbrev.monkeyPatch = monkeyPatch
|
||||
|
||||
function monkeyPatch () {
|
||||
Object.defineProperty(Array.prototype, 'abbrev', {
|
||||
value: function () { return abbrev(this) },
|
||||
enumerable: false, configurable: true, writable: true
|
||||
})
|
||||
|
||||
Object.defineProperty(Object.prototype, 'abbrev', {
|
||||
value: function () { return abbrev(Object.keys(this)) },
|
||||
enumerable: false, configurable: true, writable: true
|
||||
})
|
||||
}
|
||||
|
||||
function abbrev (list) {
|
||||
if (arguments.length !== 1 || !Array.isArray(list)) {
|
||||
list = Array.prototype.slice.call(arguments, 0)
|
||||
}
|
||||
for (var i = 0, l = list.length, args = [] ; i < l ; i ++) {
|
||||
args[i] = typeof list[i] === "string" ? list[i] : String(list[i])
|
||||
}
|
||||
|
||||
// sort them lexicographically, so that they're next to their nearest kin
|
||||
args = args.sort(lexSort)
|
||||
|
||||
// walk through each, seeing how much it has in common with the next and previous
|
||||
var abbrevs = {}
|
||||
, prev = ""
|
||||
for (var i = 0, l = args.length ; i < l ; i ++) {
|
||||
var current = args[i]
|
||||
, next = args[i + 1] || ""
|
||||
, nextMatches = true
|
||||
, prevMatches = true
|
||||
if (current === next) continue
|
||||
for (var j = 0, cl = current.length ; j < cl ; j ++) {
|
||||
var curChar = current.charAt(j)
|
||||
nextMatches = nextMatches && curChar === next.charAt(j)
|
||||
prevMatches = prevMatches && curChar === prev.charAt(j)
|
||||
if (!nextMatches && !prevMatches) {
|
||||
j ++
|
||||
break
|
||||
}
|
||||
}
|
||||
prev = current
|
||||
if (j === cl) {
|
||||
abbrevs[current] = current
|
||||
continue
|
||||
}
|
||||
for (var a = current.substr(0, j) ; j <= cl ; j ++) {
|
||||
abbrevs[a] = current
|
||||
a += current.charAt(j)
|
||||
}
|
||||
}
|
||||
return abbrevs
|
||||
}
|
||||
|
||||
function lexSort (a, b) {
|
||||
return a === b ? 0 : a > b ? 1 : -1
|
||||
}
|
56
node_modules/abbrev/package.json
generated
vendored
Normal file
@ -0,0 +1,56 @@
|
||||
{
|
||||
"_from": "abbrev@1",
|
||||
"_id": "abbrev@1.1.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==",
|
||||
"_location": "/abbrev",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "abbrev@1",
|
||||
"name": "abbrev",
|
||||
"escapedName": "abbrev",
|
||||
"rawSpec": "1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/nopt"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
|
||||
"_shasum": "f8f2c887ad10bf67f634f005b6987fed3179aac8",
|
||||
"_spec": "abbrev@1",
|
||||
"_where": "/home/lrullo/httpdocs/anorgatarrak.eus/wp-content/themes/anorgatarrak/node_modules/nopt",
|
||||
"author": {
|
||||
"name": "Isaac Z. Schlueter",
|
||||
"email": "i@izs.me"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/isaacs/abbrev-js/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "Like ruby's abbrev module, but in js",
|
||||
"devDependencies": {
|
||||
"tap": "^10.1"
|
||||
},
|
||||
"files": [
|
||||
"abbrev.js"
|
||||
],
|
||||
"homepage": "https://github.com/isaacs/abbrev-js#readme",
|
||||
"license": "ISC",
|
||||
"main": "abbrev.js",
|
||||
"name": "abbrev",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+ssh://git@github.com/isaacs/abbrev-js.git"
|
||||
},
|
||||
"scripts": {
|
||||
"postpublish": "git push origin --all; git push origin --tags",
|
||||
"postversion": "npm publish",
|
||||
"preversion": "npm test",
|
||||
"test": "tap test.js --100"
|
||||
},
|
||||
"version": "1.1.1"
|
||||
}
|
36
node_modules/angular-gettext-tools/.jscs.json
generated
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
{
|
||||
"requireCurlyBraces": ["if", "else", "for", "while", "do", "try", "catch"],
|
||||
"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch"],
|
||||
"requireParenthesesAroundIIFE": true,
|
||||
"requireSpacesInFunctionExpression": {
|
||||
"beforeOpeningCurlyBrace": true
|
||||
},
|
||||
"requireSpacesInAnonymousFunctionExpression": {
|
||||
"beforeOpeningRoundBrace": true
|
||||
},
|
||||
"disallowSpacesInNamedFunctionExpression": {
|
||||
"beforeOpeningRoundBrace": true
|
||||
},
|
||||
"disallowSpacesInFunctionDeclaration": {
|
||||
"beforeOpeningRoundBrace": true
|
||||
},
|
||||
"disallowMixedSpacesAndTabs": true,
|
||||
"disallowMultipleVarDecl": true,
|
||||
"requireSpacesInsideObjectBrackets": "all",
|
||||
"disallowDanglingUnderscores": true,
|
||||
"disallowSpaceAfterObjectKeys": true,
|
||||
"requireCommaBeforeLineBreak": true,
|
||||
"disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"],
|
||||
"disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
|
||||
"requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="],
|
||||
"requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="],
|
||||
"requireSpacesInConditionalExpression": true,
|
||||
"validateQuoteMarks": { "mark": true, "escape": true },
|
||||
"validateIndentation": 4,
|
||||
"disallowTrailingWhitespace": true,
|
||||
"disallowKeywordsOnNewLine": ["else"],
|
||||
"requireCapitalizedConstructors": true,
|
||||
"safeContextKeyword": "self",
|
||||
"requireDotNotation": true,
|
||||
"disallowYodaConditions": true
|
||||
}
|
26
node_modules/angular-gettext-tools/.jshintrc
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
{
|
||||
"curly": true,
|
||||
"eqeqeq": true,
|
||||
"immed": true,
|
||||
"latedef": true,
|
||||
"newcap": true,
|
||||
"noarg": true,
|
||||
"sub": true,
|
||||
"undef": true,
|
||||
"boss": true,
|
||||
"eqnull": true,
|
||||
"node": true,
|
||||
"strict": true,
|
||||
"white": true,
|
||||
"indent": 4,
|
||||
"predef": [
|
||||
"$",
|
||||
"angular",
|
||||
"describe",
|
||||
"it",
|
||||
"before",
|
||||
"beforeEach",
|
||||
"after",
|
||||
"afterEach"
|
||||
]
|
||||
}
|
7
node_modules/angular-gettext-tools/.travis.yml
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
sudo: false
|
||||
language: node_js
|
||||
node_js:
|
||||
- "node"
|
||||
|
||||
before_script:
|
||||
- npm install -g grunt-cli
|
59
node_modules/angular-gettext-tools/Gruntfile.js
generated
vendored
Normal file
@ -0,0 +1,59 @@
|
||||
module.exports = function (grunt) {
|
||||
grunt.loadNpmTasks('grunt-contrib-clean');
|
||||
grunt.loadNpmTasks('grunt-contrib-jshint');
|
||||
grunt.loadNpmTasks('grunt-contrib-watch');
|
||||
grunt.loadNpmTasks('grunt-jscs');
|
||||
grunt.loadNpmTasks('grunt-mocha-cli');
|
||||
grunt.loadNpmTasks('grunt-bump');
|
||||
|
||||
grunt.initConfig({
|
||||
jshint: {
|
||||
all: ['{lib,test}/**/*.js', 'index.js', '!test/fixtures/*.js'],
|
||||
options: {
|
||||
jshintrc: '.jshintrc'
|
||||
}
|
||||
},
|
||||
|
||||
jscs: {
|
||||
src: {
|
||||
options: {
|
||||
config: '.jscs.json'
|
||||
},
|
||||
files: {
|
||||
src: ['*.js', '{lib,test}/**/*.js', '!test/fixtures/*.js']
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
clean: {
|
||||
tmp: ['tmp']
|
||||
},
|
||||
|
||||
watch: {
|
||||
test: {
|
||||
files: ['lib/**.js', 'test/**/*.{js,coffee}'],
|
||||
tasks: ['test']
|
||||
}
|
||||
},
|
||||
|
||||
mochacli: {
|
||||
spec: {
|
||||
options: {
|
||||
reporter: 'spec'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
bump: {
|
||||
options: {
|
||||
files: ['package.json'],
|
||||
commitFiles: ['-a'],
|
||||
pushTo: 'origin'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
grunt.registerTask('default', ['test']);
|
||||
grunt.registerTask('build', ['clean', 'jshint', 'jscs']);
|
||||
grunt.registerTask('test', ['build', 'mochacli']);
|
||||
};
|
22
node_modules/angular-gettext-tools/LICENSE
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
Copyright (c) 2013-2015 Ruben Vermeersch
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
files (the "Software"), to deal in the Software without
|
||||
restriction, including without limitation the rights to use,
|
||||
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
63
node_modules/angular-gettext-tools/README.md
generated
vendored
Normal file
@ -0,0 +1,63 @@
|
||||
# angular-gettext-tools
|
||||
|
||||
> Tools for extracting/compiling angular-gettext strings.
|
||||
|
||||
Used to construct build tools for [`angular-gettext`](https://github.com/rubenv/angular-gettext).
|
||||
|
||||
[![Build Status](https://travis-ci.org/rubenv/grunt-angular-gettext.png?branch=master)](https://travis-ci.org/rubenv/angular-gettext-tools)
|
||||
|
||||
Implementations:
|
||||
|
||||
* [Grunt plugin](https://github.com/rubenv/grunt-angular-gettext)
|
||||
* [Gulp plugin](https://github.com/gabegorelick/gulp-angular-gettext)
|
||||
* [CLI utility](https://github.com/huston007/angular-gettext-cli)
|
||||
* [Webpack loader (compilation)](https://github.com/princed/angular-gettext-loader)
|
||||
* [Webpack plugin (compilation and extraction)](https://github.com/augusto-altman/angular-gettext-plugin)
|
||||
|
||||
Check the website for usage instructions: [http://angular-gettext.rocketeer.be/](http://angular-gettext.rocketeer.be/).
|
||||
|
||||
## Options
|
||||
|
||||
All options and defaults are displayed below:
|
||||
|
||||
```JSON
|
||||
{
|
||||
"startDelim": "{{",
|
||||
"endDelim": "}}",
|
||||
"markerName": "gettext",
|
||||
"markerNames": [],
|
||||
"moduleName": "gettextCatalog",
|
||||
"moduleMethodString": "getString",
|
||||
"moduleMethodPlural": "getPlural",
|
||||
"attribute": "translate",
|
||||
"attributes": [],
|
||||
"lineNumbers": true,
|
||||
"format": "javascript",
|
||||
"defaultLanguage": false,
|
||||
"requirejs": false
|
||||
}
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
(The MIT License)
|
||||
|
||||
Copyright (C) 2013-2015 by Ruben Vermeersch <ruben@rocketeer.be>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
4
node_modules/angular-gettext-tools/index.js
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
module.exports = {
|
||||
Compiler: require('./lib/compile'),
|
||||
Extractor: require('./lib/extract')
|
||||
};
|
162
node_modules/angular-gettext-tools/lib/compile.js
generated
vendored
Normal file
@ -0,0 +1,162 @@
|
||||
'use strict';
|
||||
|
||||
var po = require('pofile');
|
||||
var _ = require('lodash');
|
||||
|
||||
var formats = {
|
||||
javascript: {
|
||||
addLocale: function (locale, strings) {
|
||||
return ' gettextCatalog.setStrings(\'' + locale + '\', ' + JSON.stringify(strings) + ');\n';
|
||||
},
|
||||
format: function (locales, options) {
|
||||
var angular = 'angular';
|
||||
if (options.browserify) {
|
||||
angular = 'require(\'angular\')';
|
||||
}
|
||||
var module = angular + '.module(\'' + options.module + '\')' +
|
||||
'.run([\'gettextCatalog\', function (gettextCatalog) {\n' +
|
||||
'/* jshint -W100 */\n' +
|
||||
locales.join('') +
|
||||
'/* jshint +W100 */\n';
|
||||
if (options.defaultLanguage) {
|
||||
module += 'gettextCatalog.currentLanguage = \'' + options.defaultLanguage + '\';\n';
|
||||
}
|
||||
module += '}]);';
|
||||
|
||||
if (options.requirejs) {
|
||||
return 'define([\'angular\', \'' + options.modulePath + '\'], function (angular) {\n' + module + '\n});';
|
||||
}
|
||||
|
||||
return module;
|
||||
}
|
||||
},
|
||||
json: {
|
||||
addLocale: function (locale, strings) {
|
||||
return {
|
||||
name: locale,
|
||||
strings: strings
|
||||
};
|
||||
},
|
||||
format: function (locales, options) {
|
||||
var result = {};
|
||||
locales.forEach(function (locale) {
|
||||
if (!result[locale.name]) {
|
||||
result[locale.name] = {};
|
||||
}
|
||||
_.assign(result[locale.name], locale.strings);
|
||||
});
|
||||
return JSON.stringify(result);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var noContext = '$$noContext';
|
||||
|
||||
var Compiler = (function () {
|
||||
function Compiler(options) {
|
||||
this.options = _.extend({
|
||||
format: 'javascript',
|
||||
module: 'gettext'
|
||||
}, options);
|
||||
}
|
||||
|
||||
Compiler.browserConvertedHTMLEntities = {
|
||||
'hellip': '…',
|
||||
'cent': '¢',
|
||||
'pound': '£',
|
||||
'euro': '€',
|
||||
'laquo': '«',
|
||||
'raquo': '»',
|
||||
'rsaquo': '›',
|
||||
'lsaquo': '‹',
|
||||
'copy': '©',
|
||||
'reg': '®',
|
||||
'trade': '™',
|
||||
'sect': '§',
|
||||
'deg': '°',
|
||||
'plusmn': '±',
|
||||
'para': '¶',
|
||||
'middot': '·',
|
||||
'ndash': '–',
|
||||
'mdash': '—',
|
||||
'lsquo': '‘',
|
||||
'rsquo': '’',
|
||||
'sbquo': '‚',
|
||||
'ldquo': '“',
|
||||
'rdquo': '”',
|
||||
'bdquo': '„',
|
||||
'dagger': '†',
|
||||
'Dagger': '‡',
|
||||
'bull': '•',
|
||||
'prime': '′',
|
||||
'Prime': '″',
|
||||
'asymp': '≈',
|
||||
'ne': '≠',
|
||||
'le': '≤',
|
||||
'ge': '≥',
|
||||
'sup2': '²',
|
||||
'sup3': '³',
|
||||
'frac12': '½',
|
||||
'frac14': '¼',
|
||||
'frac13': '⅓',
|
||||
'frac34': '¾'
|
||||
};
|
||||
|
||||
Compiler.hasFormat = function (format) {
|
||||
return formats.hasOwnProperty(format);
|
||||
};
|
||||
|
||||
Compiler.prototype.convertPo = function (inputs) {
|
||||
var format = formats[this.options.format];
|
||||
var locales = [];
|
||||
|
||||
inputs.forEach(function (input) {
|
||||
var catalog = po.parse(input);
|
||||
|
||||
if (!catalog.headers.Language) {
|
||||
throw new Error('No Language header found!');
|
||||
}
|
||||
|
||||
var strings = {};
|
||||
for (var i = 0; i < catalog.items.length; i++) {
|
||||
var item = catalog.items[i];
|
||||
var ctx = item.msgctxt || noContext;
|
||||
var msgid = item.msgid;
|
||||
|
||||
var convertedEntity;
|
||||
var unconvertedEntity;
|
||||
var unconvertedEntityPattern;
|
||||
|
||||
for ( unconvertedEntity in Compiler.browserConvertedHTMLEntities ) {
|
||||
convertedEntity = Compiler.browserConvertedHTMLEntities[ unconvertedEntity ];
|
||||
unconvertedEntityPattern = new RegExp( '&' + unconvertedEntity + ';?', 'g' );
|
||||
msgid = msgid.replace( unconvertedEntityPattern, convertedEntity );
|
||||
}
|
||||
|
||||
if (item.msgstr[0].length > 0 && !item.flags.fuzzy && !item.obsolete) {
|
||||
if (!strings[msgid]) {
|
||||
strings[msgid] = {};
|
||||
}
|
||||
|
||||
// Add array for plural, single string for signular.
|
||||
strings[msgid][ctx] = item.msgstr.length === 1 ? item.msgstr[0] : item.msgstr;
|
||||
}
|
||||
}
|
||||
|
||||
// Strip context from strings that have no context.
|
||||
for (var key in strings) {
|
||||
if (Object.keys(strings[key]).length === 1 && strings[key][noContext]) {
|
||||
strings[key] = strings[key][noContext];
|
||||
}
|
||||
}
|
||||
|
||||
locales.push(format.addLocale(catalog.headers.Language, strings));
|
||||
});
|
||||
|
||||
return format.format(locales, this.options);
|
||||
};
|
||||
|
||||
return Compiler;
|
||||
})();
|
||||
|
||||
module.exports = Compiler;
|
486
node_modules/angular-gettext-tools/lib/extract.js
generated
vendored
Normal file
@ -0,0 +1,486 @@
|
||||
'use strict';
|
||||
|
||||
var cheerio = require('cheerio');
|
||||
var Po = require('pofile');
|
||||
var babylon = require('babylon');
|
||||
var tsParser = require('typescript-eslint-parser');
|
||||
var search = require('binary-search');
|
||||
var _ = require('lodash');
|
||||
|
||||
var escapeRegex = /[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g;
|
||||
var noContext = '$$noContext';
|
||||
|
||||
function mkAttrRegex(startDelim, endDelim, attribute) {
|
||||
var start = startDelim.replace(escapeRegex, '\\$&');
|
||||
var end = endDelim.replace(escapeRegex, '\\$&');
|
||||
|
||||
if (start === '' && end === '') {
|
||||
start = '^';
|
||||
} else {
|
||||
// match optional :: (Angular 1.3's bind once syntax) without capturing
|
||||
start += '(?:\\s*\\:\\:\\s*)?';
|
||||
}
|
||||
|
||||
if (!_.isString(attribute) || attribute.length === 0) {
|
||||
attribute = 'translate';
|
||||
}
|
||||
|
||||
return new RegExp(start + '\\s*(\'|"|"|')(.*?)\\1\\s*\\|\\s*' + attribute + '\\s*:?\\s?(?:(\'|"|"|')\\s*(.*?)\\3)?\\s*(?:' + end + '|\\|)', 'g');
|
||||
}
|
||||
|
||||
function stringCompare(a, b) {
|
||||
return a === b ? 0 : a > b ? 1 : -1;
|
||||
}
|
||||
|
||||
function contextCompare(a, b) {
|
||||
if (a !== null && b === null) {
|
||||
return -1;
|
||||
} else if (a === null && b !== null) {
|
||||
return 1;
|
||||
}
|
||||
return stringCompare(a, b);
|
||||
}
|
||||
|
||||
function comments2String(comments) {
|
||||
return comments.join(', ');
|
||||
}
|
||||
|
||||
function walkJs(node, fn, parentComment) {
|
||||
fn(node, parentComment);
|
||||
|
||||
// Handle ts comments
|
||||
if (node && node.comments) {
|
||||
parentComment = node;
|
||||
parentComment.comments.reverse();
|
||||
}
|
||||
|
||||
for (var key in node) {
|
||||
var obj = node[key];
|
||||
if (node && node.leadingComments) {
|
||||
parentComment = node;
|
||||
}
|
||||
|
||||
if (typeof obj === 'object') {
|
||||
walkJs(obj, fn, parentComment);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function isStringLiteral(node) {
|
||||
return node.type === 'StringLiteral' || (node.type === 'Literal' && typeof(node.value) === 'string');
|
||||
}
|
||||
|
||||
function getJSExpression(node) {
|
||||
var res = '';
|
||||
if (isStringLiteral(node)) {
|
||||
res = node.value;
|
||||
}
|
||||
|
||||
if (node.type === 'TemplateLiteral') {
|
||||
node.quasis.forEach(function (elem) {
|
||||
res += elem.value.raw;
|
||||
});
|
||||
}
|
||||
|
||||
if (node.type === 'BinaryExpression' && node.operator === '+') {
|
||||
res += getJSExpression(node.left);
|
||||
res += getJSExpression(node.right);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
var Extractor = (function () {
|
||||
function Extractor(options) {
|
||||
this.options = _.extend({
|
||||
startDelim: '{{',
|
||||
endDelim: '}}',
|
||||
markerName: 'gettext',
|
||||
markerNames: [],
|
||||
moduleName: 'gettextCatalog',
|
||||
moduleMethodString: 'getString',
|
||||
moduleMethodPlural: 'getPlural',
|
||||
attribute: 'translate',
|
||||
attributes: [],
|
||||
lineNumbers: true,
|
||||
extensions: {
|
||||
htm: 'html',
|
||||
html: 'html',
|
||||
php: 'html',
|
||||
phtml: 'html',
|
||||
tml: 'html',
|
||||
ejs: 'html',
|
||||
erb: 'html',
|
||||
js: 'js',
|
||||
tag: 'html',
|
||||
jsp: 'html',
|
||||
ts: 'js',
|
||||
tsx: 'js',
|
||||
},
|
||||
postProcess: function (po) {}
|
||||
}, options);
|
||||
this.options.markerNames.unshift(this.options.markerName);
|
||||
this.options.attributes.unshift(this.options.attribute);
|
||||
|
||||
this.strings = {};
|
||||
this.attrRegex = mkAttrRegex(this.options.startDelim, this.options.endDelim, this.options.attribute);
|
||||
this.noDelimRegex = mkAttrRegex('', '', this.options.attribute);
|
||||
}
|
||||
|
||||
Extractor.isValidStrategy = function (strategy) {
|
||||
return strategy === 'html' || strategy === 'js';
|
||||
};
|
||||
|
||||
Extractor.mkAttrRegex = mkAttrRegex;
|
||||
|
||||
Extractor.prototype.addString = function (reference, string, plural, extractedComment, context) {
|
||||
// maintain backwards compatibility
|
||||
if (_.isString(reference)) {
|
||||
reference = { file: reference };
|
||||
}
|
||||
|
||||
string = string.trim();
|
||||
|
||||
if (string.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!context) {
|
||||
context = noContext;
|
||||
}
|
||||
|
||||
if (!this.strings[string]) {
|
||||
this.strings[string] = {};
|
||||
}
|
||||
|
||||
if (!this.strings[string][context]) {
|
||||
this.strings[string][context] = new Po.Item();
|
||||
}
|
||||
|
||||
var item = this.strings[string][context];
|
||||
item.msgid = string;
|
||||
|
||||
var refString = reference.file;
|
||||
if (this.options.lineNumbers && reference.location && reference.location.start) {
|
||||
var line = reference.location.start.line;
|
||||
if (line || line === 0) {
|
||||
refString += ':' + reference.location.start.line;
|
||||
}
|
||||
}
|
||||
var refIndex = search(item.references, refString, stringCompare);
|
||||
if (refIndex < 0) { // don't add duplicate references
|
||||
// when not found, binary-search returns -(index_where_it_should_be + 1)
|
||||
item.references.splice(Math.abs(refIndex + 1), 0, refString);
|
||||
}
|
||||
|
||||
if (context !== noContext) {
|
||||
item.msgctxt = context;
|
||||
}
|
||||
|
||||
if (plural && plural !== '') {
|
||||
if (item.msgid_plural && item.msgid_plural !== plural) {
|
||||
throw new Error('Incompatible plural definitions for ' + string + ': ' + item.msgid_plural + ' / ' + plural + ' (in: ' + (item.references.join(', ')) + ')');
|
||||
}
|
||||
item.msgid_plural = plural;
|
||||
item.msgstr = ['', ''];
|
||||
}
|
||||
if (extractedComment) {
|
||||
var commentIndex = search(item.extractedComments, extractedComment, stringCompare);
|
||||
if (commentIndex < 0) { // don't add duplicate comments
|
||||
item.extractedComments.splice(Math.abs(commentIndex + 1), 0, extractedComment);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Extractor.prototype.extractJs = function (filename, src, lineNumber) {
|
||||
// used for line number of JS in HTML <script> tags
|
||||
lineNumber = lineNumber || 0;
|
||||
var self = this;
|
||||
var syntax;
|
||||
var extension = filename.split('.').pop();
|
||||
try {
|
||||
if (extension === 'ts' || extension === 'tsx') {
|
||||
syntax = tsParser.parse(src, {
|
||||
sourceType: 'module',
|
||||
comment: true,
|
||||
ecmaFeatures: {
|
||||
jsx: true
|
||||
}
|
||||
});
|
||||
} else {
|
||||
syntax = babylon.parse(src, {
|
||||
sourceType: 'module',
|
||||
plugins: [
|
||||
'jsx',
|
||||
'objectRestSpread',
|
||||
'decorators',
|
||||
'classProperties',
|
||||
'exportExtensions',
|
||||
'functionBind'
|
||||
]
|
||||
});
|
||||
}
|
||||
} catch (err) {
|
||||
var errMsg = 'Error parsing';
|
||||
if (filename) {
|
||||
errMsg += ' ' + filename;
|
||||
}
|
||||
if (err.lineNumber) {
|
||||
errMsg += ' at line ' + err.lineNumber;
|
||||
errMsg += ' column ' + err.column;
|
||||
}
|
||||
|
||||
console.warn(errMsg);
|
||||
return;
|
||||
}
|
||||
|
||||
function isGettext(node) {
|
||||
return node !== null &&
|
||||
node.type === 'CallExpression' &&
|
||||
node.callee !== null &&
|
||||
(self.options.markerNames.indexOf(node.callee.name) > -1 || (
|
||||
node.callee.property &&
|
||||
self.options.markerNames.indexOf(node.callee.property.name) > -1
|
||||
)) &&
|
||||
node.arguments !== null &&
|
||||
node.arguments.length;
|
||||
}
|
||||
|
||||
function isGetString(node) {
|
||||
return node !== null &&
|
||||
node.type === 'CallExpression' &&
|
||||
node.callee !== null &&
|
||||
node.callee.type === 'MemberExpression' &&
|
||||
node.callee.object !== null && (
|
||||
node.callee.object.name === self.options.moduleName || (
|
||||
// also allow gettextCatalog calls on objects like this.gettextCatalog.getString()
|
||||
node.callee.object.property &&
|
||||
node.callee.object.property.name === self.options.moduleName)) &&
|
||||
node.callee.property !== null &&
|
||||
node.callee.property.name === self.options.moduleMethodString &&
|
||||
node.arguments !== null &&
|
||||
node.arguments.length;
|
||||
}
|
||||
|
||||
function isGetPlural(node) {
|
||||
return node !== null &&
|
||||
node.type === 'CallExpression' &&
|
||||
node.callee !== null &&
|
||||
node.callee.type === 'MemberExpression' &&
|
||||
node.callee.object !== null && (
|
||||
node.callee.object.name === self.options.moduleName || (
|
||||
// also allow gettextCatalog calls on objects like this.gettextCatalog.getPlural()
|
||||
node.callee.object.property &&
|
||||
node.callee.object.property.name === self.options.moduleName)) &&
|
||||
node.callee.property !== null &&
|
||||
node.callee.property.name === self.options.moduleMethodPlural &&
|
||||
node.arguments !== null &&
|
||||
node.arguments.length;
|
||||
}
|
||||
|
||||
function isTemplateElement(node) {
|
||||
return node !== null &&
|
||||
node.type === 'TemplateElement' &&
|
||||
node.value &&
|
||||
node.value.raw;
|
||||
}
|
||||
|
||||
walkJs(syntax, function (node, parentComment) {
|
||||
var str;
|
||||
var context;
|
||||
var singular;
|
||||
var plural;
|
||||
var extractedComments = [];
|
||||
var reference = {
|
||||
file: filename,
|
||||
location: (function () {
|
||||
if (!node || !node.loc || !node.loc.start) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return {
|
||||
start: {
|
||||
line: node.loc.start.line + lineNumber
|
||||
}
|
||||
};
|
||||
})()
|
||||
};
|
||||
|
||||
if (isGettext(node) || isGetString(node)) {
|
||||
str = getJSExpression(node.arguments[0]);
|
||||
if (node.arguments[2]) {
|
||||
context = getJSExpression(node.arguments[2]);
|
||||
}
|
||||
} else if (isGetPlural(node)) {
|
||||
singular = getJSExpression(node.arguments[1]);
|
||||
plural = getJSExpression(node.arguments[2]);
|
||||
if (node.arguments[4]) {
|
||||
context = getJSExpression(node.arguments[4]);
|
||||
}
|
||||
} else if (isTemplateElement(node)) {
|
||||
var line = reference.location && reference.location.start.line ? reference.location.start.line - 1 : 0;
|
||||
self.extractHtml(reference.file, node.value.raw, line);
|
||||
}
|
||||
if (str || singular) {
|
||||
var leadingComments = node.leadingComments || (parentComment ? parentComment.leadingComments : []);
|
||||
if (leadingComments) {
|
||||
leadingComments.forEach(function (comment) {
|
||||
if (comment.value.match(/^\/ .*/)) {
|
||||
extractedComments.push(comment.value.replace(/^\/ /, ''));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Handle ts comments
|
||||
if (parentComment.comments) {
|
||||
var commentFound = 0;
|
||||
parentComment.comments.forEach(function (comment) {
|
||||
if (comment.type === 'Line' &&
|
||||
comment.loc.start.line === (reference.location.start.line - commentFound - 1) &&
|
||||
comment.value.match(/^\/ .*/)) {
|
||||
commentFound++;
|
||||
extractedComments.push(comment.value.replace(/^\/ /, ''));
|
||||
}
|
||||
});
|
||||
extractedComments.reverse();
|
||||
}
|
||||
|
||||
if (str) {
|
||||
self.addString(reference, str, plural, comments2String(extractedComments), context);
|
||||
} else if (singular) {
|
||||
self.addString(reference, singular, plural, comments2String(extractedComments), context);
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Extractor.prototype.extractHtml = function (filename, src, lineNumber) {
|
||||
var extractHtml = function (src, lineNumber) {
|
||||
var $ = cheerio.load(src, { decodeEntities: false, withStartIndices: true });
|
||||
var self = this;
|
||||
|
||||
var newlines = function (index) {
|
||||
return src.substr(0, index).match(/\n/g) || [];
|
||||
};
|
||||
var reference = function (index) {
|
||||
return {
|
||||
file: filename,
|
||||
location: {
|
||||
start: {
|
||||
line: lineNumber + newlines(index).length + 1
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
$('*').each(function (index, n) {
|
||||
var node = $(n);
|
||||
var getAttr = function (attr) {
|
||||
return node.attr(attr) || node.data(attr);
|
||||
};
|
||||
var str = node.html();
|
||||
var extracted = {};
|
||||
var possibleAttributes = self.options.attributes;
|
||||
|
||||
possibleAttributes.forEach(function (attr) {
|
||||
extracted[attr] = {
|
||||
plural: getAttr(attr + '-plural'),
|
||||
extractedComment: getAttr(attr + '-comment'),
|
||||
context: getAttr(attr + '-context')
|
||||
};
|
||||
});
|
||||
|
||||
if (n.name === 'script') {
|
||||
if (n.attribs.type === 'text/ng-template') {
|
||||
extractHtml(node.text(), newlines(n.startIndex).length);
|
||||
return;
|
||||
}
|
||||
|
||||
// In HTML5, type defaults to text/javascript.
|
||||
// In HTML4, it's required, so if it's not there, just assume it's JS
|
||||
if (!n.attribs.type || n.attribs.type === 'text/javascript') {
|
||||
self.extractJs(filename, node.text(), newlines(n.startIndex).length);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (node.is(self.options.attribute)) {
|
||||
self.addString(reference(n.startIndex), str, extracted[self.options.attribute].plural, extracted[self.options.attribute].extractedComment, extracted[self.options.attribute].context);
|
||||
return;
|
||||
}
|
||||
|
||||
for (var attr in node.attr()) {
|
||||
attr = attr.replace(/^data-/, '');
|
||||
|
||||
if (possibleAttributes.indexOf(attr) > -1) {
|
||||
var attrValue = extracted[attr];
|
||||
str = node.html(); // this shouldn't be necessary, but it is
|
||||
self.addString(reference(n.startIndex), str || getAttr(attr) || '', attrValue.plural, attrValue.extractedComment, attrValue.context);
|
||||
} else if (matches = self.noDelimRegex.exec(getAttr(attr))) {
|
||||
str = matches[2].replace(/\\\'/g, '\'');
|
||||
self.addString(reference(n.startIndex), str);
|
||||
self.noDelimRegex.lastIndex = 0;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var matches;
|
||||
while (matches = this.attrRegex.exec(src)) {
|
||||
var str = matches[2].replace(/\\\'/g, '\'');
|
||||
var context = matches[4] ? matches[4].replace(/\\\'/g, '\'') : null;
|
||||
this.addString(reference(matches.index), str, null, null, context);
|
||||
}
|
||||
}.bind(this);
|
||||
|
||||
extractHtml(src, lineNumber || 0);
|
||||
};
|
||||
|
||||
Extractor.prototype.isSupportedByStrategy = function (strategy, extension) {
|
||||
return (extension in this.options.extensions) && (this.options.extensions[extension] === strategy);
|
||||
};
|
||||
|
||||
Extractor.prototype.parse = function (filename, content) {
|
||||
var extension = filename.split('.').pop();
|
||||
|
||||
if (this.isSupportedByStrategy('html', extension)) {
|
||||
this.extractHtml(filename, content);
|
||||
}
|
||||
if (this.isSupportedByStrategy('js', extension)) {
|
||||
this.extractJs(filename, content);
|
||||
}
|
||||
};
|
||||
|
||||
Extractor.prototype.toString = function () {
|
||||
var catalog = new Po();
|
||||
|
||||
catalog.headers = {
|
||||
'Content-Type': 'text/plain; charset=UTF-8',
|
||||
'Content-Transfer-Encoding': '8bit',
|
||||
'Project-Id-Version': ''
|
||||
};
|
||||
|
||||
var sortedItems = [];
|
||||
for (var msgstr in this.strings) {
|
||||
var msg = this.strings[msgstr];
|
||||
var contexts = Object.keys(msg);
|
||||
for (var i = 0; i < contexts.length; i++) {
|
||||
sortedItems.push([msg[contexts[i]], i]);
|
||||
}
|
||||
}
|
||||
|
||||
sortedItems.sort(function (a, b) {
|
||||
return contextCompare(a[0].msgctxt, b[0].msgctxt) || stringCompare(a[0].msgid, b[0].msgid) || (a[1] - b[1]);
|
||||
});
|
||||
|
||||
for (var j = 0; j < sortedItems.length; j++) {
|
||||
catalog.items.push(sortedItems[j][0]);
|
||||
}
|
||||
|
||||
this.options.postProcess(catalog);
|
||||
|
||||
return catalog.toString();
|
||||
};
|
||||
|
||||
return Extractor;
|
||||
})();
|
||||
|
||||
module.exports = Extractor;
|
74
node_modules/angular-gettext-tools/package.json
generated
vendored
Normal file
@ -0,0 +1,74 @@
|
||||
{
|
||||
"_from": "angular-gettext-tools@~2.3.9",
|
||||
"_id": "angular-gettext-tools@2.3.9",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-5R7guzzRpBvJloFsbDtY16PNA4xxrQvKhnbjpT74zuIXrOEy4sTz/r35BKFofrLEL4iLmVEgaUC7pYhZdW2QyQ==",
|
||||
"_location": "/angular-gettext-tools",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "angular-gettext-tools@~2.3.9",
|
||||
"name": "angular-gettext-tools",
|
||||
"escapedName": "angular-gettext-tools",
|
||||
"rawSpec": "~2.3.9",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "~2.3.9"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/grunt-angular-gettext"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/angular-gettext-tools/-/angular-gettext-tools-2.3.9.tgz",
|
||||
"_shasum": "e8fd6692171b863370b6db031e6cdbf24673f102",
|
||||
"_spec": "angular-gettext-tools@~2.3.9",
|
||||
"_where": "/home/lrullo/httpdocs/anorgatarrak.eus/wp-content/themes/anorgatarrak/node_modules/grunt-angular-gettext",
|
||||
"author": {
|
||||
"name": "Ruben Vermeersch",
|
||||
"email": "ruben@rocketeer.be",
|
||||
"url": "http://rocketeer.be"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/rubenv/angular-gettext-tools/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"babylon": "^6.11.4",
|
||||
"binary-search": "^1.2.0",
|
||||
"cheerio": "~0.19.0",
|
||||
"lodash": "^4.0.0",
|
||||
"pofile": "~1.0.0",
|
||||
"typescript": "~2.3.2",
|
||||
"typescript-eslint-parser": "^3.0.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Tools for extracting/compiling angular-gettext strings.",
|
||||
"devDependencies": {
|
||||
"grunt": "~0.4.4",
|
||||
"grunt-bump": "0.0.13",
|
||||
"grunt-contrib-clean": "~0.6.0",
|
||||
"grunt-contrib-jshint": "~0.11.2",
|
||||
"grunt-contrib-watch": "~0.6.1",
|
||||
"grunt-jscs": "^1.8.0",
|
||||
"grunt-mocha-cli": "^1.13.1",
|
||||
"sinon": "^1.17.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.10.0"
|
||||
},
|
||||
"homepage": "http://angular-gettext.rocketeer.be/",
|
||||
"keywords": [
|
||||
"angular",
|
||||
"gettext"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "angular-gettext-tools",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/rubenv/angular-gettext-tools.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "grunt test"
|
||||
},
|
||||
"version": "2.3.9"
|
||||
}
|
966
node_modules/angular-gettext-tools/yarn.lock
generated
vendored
Normal file
@ -0,0 +1,966 @@
|
||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
abbrev@1:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8"
|
||||
|
||||
ansi-regex@^1.0.0, ansi-regex@^1.1.0:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-1.1.1.tgz#41c847194646375e6a1a5d10c3ca054ef9fc980d"
|
||||
|
||||
ansi-styles@^2.0.1:
|
||||
version "2.2.1"
|
||||
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe"
|
||||
|
||||
"argparse@~ 0.1.11":
|
||||
version "0.1.16"
|
||||
resolved "https://registry.yarnpkg.com/argparse/-/argparse-0.1.16.tgz#cfd01e0fbba3d6caed049fbd758d40f65196f57c"
|
||||
dependencies:
|
||||
underscore "~1.7.0"
|
||||
underscore.string "~2.4.0"
|
||||
|
||||
async@0.2.x, async@~0.2.9:
|
||||
version "0.2.10"
|
||||
resolved "https://registry.yarnpkg.com/async/-/async-0.2.10.tgz#b6bbe0b0674b9d719708ca38de8c237cb526c3d1"
|
||||
|
||||
async@~0.1.22:
|
||||
version "0.1.22"
|
||||
resolved "https://registry.yarnpkg.com/async/-/async-0.1.22.tgz#0fc1aaa088a0e3ef0ebe2d8831bab0dcf8845061"
|
||||
|
||||
babylon@^6.11.4:
|
||||
version "6.18.0"
|
||||
resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3"
|
||||
|
||||
balanced-match@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
|
||||
|
||||
binary-search@^1.2.0:
|
||||
version "1.3.2"
|
||||
resolved "https://registry.yarnpkg.com/binary-search/-/binary-search-1.3.2.tgz#88c9b7bd2b7221d352da78ec887f5af2549e4de2"
|
||||
|
||||
boolbase@~1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e"
|
||||
|
||||
brace-expansion@^1.0.0, brace-expansion@^1.1.7:
|
||||
version "1.1.8"
|
||||
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.8.tgz#c07b211c7c952ec1f8efd51a77ef0d1d3990a292"
|
||||
dependencies:
|
||||
balanced-match "^1.0.0"
|
||||
concat-map "0.0.1"
|
||||
|
||||
chalk@~1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.0.0.tgz#b3cf4ed0ff5397c99c75b8f679db2f52831f96dc"
|
||||
dependencies:
|
||||
ansi-styles "^2.0.1"
|
||||
escape-string-regexp "^1.0.2"
|
||||
has-ansi "^1.0.3"
|
||||
strip-ansi "^2.0.1"
|
||||
supports-color "^1.3.0"
|
||||
|
||||
cheerio@~0.19.0:
|
||||
version "0.19.0"
|
||||
resolved "https://registry.yarnpkg.com/cheerio/-/cheerio-0.19.0.tgz#772e7015f2ee29965096d71ea4175b75ab354925"
|
||||
dependencies:
|
||||
css-select "~1.0.0"
|
||||
dom-serializer "~0.1.0"
|
||||
entities "~1.1.1"
|
||||
htmlparser2 "~3.8.1"
|
||||
lodash "^3.2.0"
|
||||
|
||||
cli-table@~0.3.1:
|
||||
version "0.3.1"
|
||||
resolved "https://registry.yarnpkg.com/cli-table/-/cli-table-0.3.1.tgz#f53b05266a8b1a0b934b3d0821e6e2dc5914ae23"
|
||||
dependencies:
|
||||
colors "1.0.3"
|
||||
|
||||
cli@0.6.x:
|
||||
version "0.6.6"
|
||||
resolved "https://registry.yarnpkg.com/cli/-/cli-0.6.6.tgz#02ad44a380abf27adac5e6f0cdd7b043d74c53e3"
|
||||
dependencies:
|
||||
exit "0.1.2"
|
||||
glob "~ 3.2.1"
|
||||
|
||||
coffee-script@~1.3.3:
|
||||
version "1.3.3"
|
||||
resolved "https://registry.yarnpkg.com/coffee-script/-/coffee-script-1.3.3.tgz#150d6b4cb522894369efed6a2101c20bc7f4a4f4"
|
||||
|
||||
colors@0.6.x, colors@~0.6.2:
|
||||
version "0.6.2"
|
||||
resolved "https://registry.yarnpkg.com/colors/-/colors-0.6.2.tgz#2423fe6678ac0c5dae8852e5d0e5be08c997abcc"
|
||||
|
||||
colors@1.0.3:
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/colors/-/colors-1.0.3.tgz#0433f44d809680fdeb60ed260f1b0c262e82a40b"
|
||||
|
||||
commander@0.6.1:
|
||||
version "0.6.1"
|
||||
resolved "https://registry.yarnpkg.com/commander/-/commander-0.6.1.tgz#fa68a14f6a945d54dbbe50d8cdb3320e9e3b1a06"
|
||||
|
||||
commander@2.3.0:
|
||||
version "2.3.0"
|
||||
resolved "https://registry.yarnpkg.com/commander/-/commander-2.3.0.tgz#fd430e889832ec353b9acd1de217c11cb3eef873"
|
||||
|
||||
commander@~2.6.0:
|
||||
version "2.6.0"
|
||||
resolved "https://registry.yarnpkg.com/commander/-/commander-2.6.0.tgz#9df7e52fb2a0cb0fb89058ee80c3104225f37e1d"
|
||||
|
||||
concat-map@0.0.1:
|
||||
version "0.0.1"
|
||||
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
|
||||
|
||||
console-browserify@1.1.x:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.1.0.tgz#f0241c45730a9fc6323b206dbf38edc741d0bb10"
|
||||
dependencies:
|
||||
date-now "^0.1.4"
|
||||
|
||||
core-util-is@~1.0.0:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
|
||||
|
||||
css-select@~1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/css-select/-/css-select-1.0.0.tgz#b1121ca51848dd264e2244d058cee254deeb44b0"
|
||||
dependencies:
|
||||
boolbase "~1.0.0"
|
||||
css-what "1.0"
|
||||
domutils "1.4"
|
||||
nth-check "~1.0.0"
|
||||
|
||||
css-what@1.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/css-what/-/css-what-1.0.0.tgz#d7cc2df45180666f99d2b14462639469e00f736c"
|
||||
|
||||
cycle@1.0.x:
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/cycle/-/cycle-1.0.3.tgz#21e80b2be8580f98b468f379430662b046c34ad2"
|
||||
|
||||
date-now@^0.1.4:
|
||||
version "0.1.4"
|
||||
resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b"
|
||||
|
||||
dateformat@1.0.2-1.2.3:
|
||||
version "1.0.2-1.2.3"
|
||||
resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-1.0.2-1.2.3.tgz#b0220c02de98617433b72851cf47de3df2cdbee9"
|
||||
|
||||
debug@2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/debug/-/debug-2.0.0.tgz#89bd9df6732b51256bc6705342bba02ed12131ef"
|
||||
dependencies:
|
||||
ms "0.6.2"
|
||||
|
||||
debug@~0.7.0:
|
||||
version "0.7.4"
|
||||
resolved "https://registry.yarnpkg.com/debug/-/debug-0.7.4.tgz#06e1ea8082c2cb14e39806e22e2f6f757f92af39"
|
||||
|
||||
deep-equal@*:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5"
|
||||
|
||||
diff@1.4.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/diff/-/diff-1.4.0.tgz#7f28d2eb9ee7b15a97efd89ce63dcfdaa3ccbabf"
|
||||
|
||||
dom-serializer@0, dom-serializer@~0.1.0:
|
||||
version "0.1.0"
|
||||
resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.1.0.tgz#073c697546ce0780ce23be4a28e293e40bc30c82"
|
||||
dependencies:
|
||||
domelementtype "~1.1.1"
|
||||
entities "~1.1.1"
|
||||
|
||||
domelementtype@1:
|
||||
version "1.3.0"
|
||||
resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.0.tgz#b17aed82e8ab59e52dd9c19b1756e0fc187204c2"
|
||||
|
||||
domelementtype@~1.1.1:
|
||||
version "1.1.3"
|
||||
resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.1.3.tgz#bd28773e2642881aec51544924299c5cd822185b"
|
||||
|
||||
domhandler@2.3:
|
||||
version "2.3.0"
|
||||
resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.3.0.tgz#2de59a0822d5027fabff6f032c2b25a2a8abe738"
|
||||
dependencies:
|
||||
domelementtype "1"
|
||||
|
||||
domutils@1.4:
|
||||
version "1.4.3"
|
||||
resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.4.3.tgz#0865513796c6b306031850e175516baf80b72a6f"
|
||||
dependencies:
|
||||
domelementtype "1"
|
||||
|
||||
domutils@1.5:
|
||||
version "1.5.1"
|
||||
resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.5.1.tgz#dcd8488a26f563d61079e48c9f7b7e32373682cf"
|
||||
dependencies:
|
||||
dom-serializer "0"
|
||||
domelementtype "1"
|
||||
|
||||
entities@1.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/entities/-/entities-1.0.0.tgz#b2987aa3821347fcde642b24fdfc9e4fb712bf26"
|
||||
|
||||
entities@~1.1.1:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.1.tgz#6e5c2d0a5621b5dadaecef80b90edfb5cd7772f0"
|
||||
|
||||
escape-string-regexp@1.0.2:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.2.tgz#4dbc2fe674e71949caf3fb2695ce7f2dc1d9a8d1"
|
||||
|
||||
escape-string-regexp@^1.0.2:
|
||||
version "1.0.5"
|
||||
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
|
||||
|
||||
esprima-harmony-jscs@1.1.0-bin:
|
||||
version "1.1.0-bin"
|
||||
resolved "https://registry.yarnpkg.com/esprima-harmony-jscs/-/esprima-harmony-jscs-1.1.0-bin.tgz#07cb0571d943eed4bc7bfe9e72637c663fe151ed"
|
||||
|
||||
esprima@^1.2.5:
|
||||
version "1.2.5"
|
||||
resolved "https://registry.yarnpkg.com/esprima/-/esprima-1.2.5.tgz#0993502feaf668138325756f30f9a51feeec11e9"
|
||||
|
||||
"esprima@~ 1.0.2":
|
||||
version "1.0.4"
|
||||
resolved "https://registry.yarnpkg.com/esprima/-/esprima-1.0.4.tgz#9f557e08fc3b4d26ece9dd34f8fbf476b62585ad"
|
||||
|
||||
estraverse@^1.9.3:
|
||||
version "1.9.3"
|
||||
resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.9.3.tgz#af67f2dc922582415950926091a4005d29c9bb44"
|
||||
|
||||
eventemitter2@~0.4.13:
|
||||
version "0.4.14"
|
||||
resolved "https://registry.yarnpkg.com/eventemitter2/-/eventemitter2-0.4.14.tgz#8f61b75cde012b2e9eb284d4545583b5643b61ab"
|
||||
|
||||
exit@0.1.2, exit@0.1.x, exit@~0.1.1, exit@~0.1.2:
|
||||
version "0.1.2"
|
||||
resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c"
|
||||
|
||||
eyes@0.1.x:
|
||||
version "0.1.8"
|
||||
resolved "https://registry.yarnpkg.com/eyes/-/eyes-0.1.8.tgz#62cf120234c683785d902348a800ef3e0cc20bc0"
|
||||
|
||||
faye-websocket@~0.4.3:
|
||||
version "0.4.4"
|
||||
resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.4.4.tgz#c14c5b3bf14d7417ffbfd990c0a7495cd9f337bc"
|
||||
|
||||
findup-sync@~0.1.2:
|
||||
version "0.1.3"
|
||||
resolved "https://registry.yarnpkg.com/findup-sync/-/findup-sync-0.1.3.tgz#7f3e7a97b82392c653bf06589bd85190e93c3683"
|
||||
dependencies:
|
||||
glob "~3.2.9"
|
||||
lodash "~2.4.1"
|
||||
|
||||
formatio@1.1.1:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/formatio/-/formatio-1.1.1.tgz#5ed3ccd636551097383465d996199100e86161e9"
|
||||
dependencies:
|
||||
samsam "~1.1"
|
||||
|
||||
fs.realpath@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
|
||||
|
||||
gaze@~0.5.1:
|
||||
version "0.5.2"
|
||||
resolved "https://registry.yarnpkg.com/gaze/-/gaze-0.5.2.tgz#40b709537d24d1d45767db5a908689dfe69ac44f"
|
||||
dependencies:
|
||||
globule "~0.1.0"
|
||||
|
||||
get-stdin@^4.0.1:
|
||||
version "4.0.1"
|
||||
resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe"
|
||||
|
||||
getobject@~0.1.0:
|
||||
version "0.1.0"
|
||||
resolved "https://registry.yarnpkg.com/getobject/-/getobject-0.1.0.tgz#047a449789fa160d018f5486ed91320b6ec7885c"
|
||||
|
||||
glob@3.2.3:
|
||||
version "3.2.3"
|
||||
resolved "https://registry.yarnpkg.com/glob/-/glob-3.2.3.tgz#e313eeb249c7affaa5c475286b0e115b59839467"
|
||||
dependencies:
|
||||
graceful-fs "~2.0.0"
|
||||
inherits "2"
|
||||
minimatch "~0.2.11"
|
||||
|
||||
glob@^5.0.1:
|
||||
version "5.0.15"
|
||||
resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1"
|
||||
dependencies:
|
||||
inflight "^1.0.4"
|
||||
inherits "2"
|
||||
minimatch "2 || 3"
|
||||
once "^1.3.0"
|
||||
path-is-absolute "^1.0.0"
|
||||
|
||||
glob@^7.0.5:
|
||||
version "7.1.2"
|
||||
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15"
|
||||
dependencies:
|
||||
fs.realpath "^1.0.0"
|
||||
inflight "^1.0.4"
|
||||
inherits "2"
|
||||
minimatch "^3.0.4"
|
||||
once "^1.3.0"
|
||||
path-is-absolute "^1.0.0"
|
||||
|
||||
"glob@~ 3.2.1", glob@~3.2.9:
|
||||
version "3.2.11"
|
||||
resolved "https://registry.yarnpkg.com/glob/-/glob-3.2.11.tgz#4a973f635b9190f715d10987d5c00fd2815ebe3d"
|
||||
dependencies:
|
||||
inherits "2"
|
||||
minimatch "0.3"
|
||||
|
||||
glob@~3.1.21:
|
||||
version "3.1.21"
|
||||
resolved "https://registry.yarnpkg.com/glob/-/glob-3.1.21.tgz#d29e0a055dea5138f4d07ed40e8982e83c2066cd"
|
||||
dependencies:
|
||||
graceful-fs "~1.2.0"
|
||||
inherits "1"
|
||||
minimatch "~0.2.11"
|
||||
|
||||
globule@~0.1.0:
|
||||
version "0.1.0"
|
||||
resolved "https://registry.yarnpkg.com/globule/-/globule-0.1.0.tgz#d9c8edde1da79d125a151b79533b978676346ae5"
|
||||
dependencies:
|
||||
glob "~3.1.21"
|
||||
lodash "~1.0.1"
|
||||
minimatch "~0.2.11"
|
||||
|
||||
graceful-fs@~1.2.0:
|
||||
version "1.2.3"
|
||||
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-1.2.3.tgz#15a4806a57547cb2d2dbf27f42e89a8c3451b364"
|
||||
|
||||
graceful-fs@~2.0.0:
|
||||
version "2.0.3"
|
||||
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-2.0.3.tgz#7cd2cdb228a4a3f36e95efa6cc142de7d1a136d0"
|
||||
|
||||
growl@1.8.1:
|
||||
version "1.8.1"
|
||||
resolved "https://registry.yarnpkg.com/growl/-/growl-1.8.1.tgz#4b2dec8d907e93db336624dcec0183502f8c9428"
|
||||
|
||||
grunt-bump@0.0.13:
|
||||
version "0.0.13"
|
||||
resolved "https://registry.yarnpkg.com/grunt-bump/-/grunt-bump-0.0.13.tgz#b133ba5398c55b7fcd02c00445b65adcb81e494b"
|
||||
dependencies:
|
||||
semver "~1.1"
|
||||
|
||||
grunt-contrib-clean@~0.6.0:
|
||||
version "0.6.0"
|
||||
resolved "https://registry.yarnpkg.com/grunt-contrib-clean/-/grunt-contrib-clean-0.6.0.tgz#f532dba4b8212674c7c013e146bda6638b9048f6"
|
||||
dependencies:
|
||||
rimraf "~2.2.1"
|
||||
|
||||
grunt-contrib-jshint@~0.11.2:
|
||||
version "0.11.3"
|
||||
resolved "https://registry.yarnpkg.com/grunt-contrib-jshint/-/grunt-contrib-jshint-0.11.3.tgz#80368181dccd551186e5b8385c011cee24d640a0"
|
||||
dependencies:
|
||||
hooker "^0.2.3"
|
||||
jshint "~2.8.0"
|
||||
|
||||
grunt-contrib-watch@~0.6.1:
|
||||
version "0.6.1"
|
||||
resolved "https://registry.yarnpkg.com/grunt-contrib-watch/-/grunt-contrib-watch-0.6.1.tgz#64fdcba25a635f5b4da1b6ce6f90da0aeb6e3f15"
|
||||
dependencies:
|
||||
async "~0.2.9"
|
||||
gaze "~0.5.1"
|
||||
lodash "~2.4.1"
|
||||
tiny-lr-fork "0.0.5"
|
||||
|
||||
grunt-jscs@^1.8.0:
|
||||
version "1.8.0"
|
||||
resolved "https://registry.yarnpkg.com/grunt-jscs/-/grunt-jscs-1.8.0.tgz#de96df9cdd737ee15c12b31bb46a3bd91d948981"
|
||||
dependencies:
|
||||
hooker "~0.2.3"
|
||||
jscs "~1.13.0"
|
||||
lodash "~2.4.1"
|
||||
vow "~0.4.1"
|
||||
|
||||
grunt-legacy-log-utils@~0.1.1:
|
||||
version "0.1.1"
|
||||
resolved "https://registry.yarnpkg.com/grunt-legacy-log-utils/-/grunt-legacy-log-utils-0.1.1.tgz#c0706b9dd9064e116f36f23fe4e6b048672c0f7e"
|
||||
dependencies:
|
||||
colors "~0.6.2"
|
||||
lodash "~2.4.1"
|
||||
underscore.string "~2.3.3"
|
||||
|
||||
grunt-legacy-log@~0.1.0:
|
||||
version "0.1.3"
|
||||
resolved "https://registry.yarnpkg.com/grunt-legacy-log/-/grunt-legacy-log-0.1.3.tgz#ec29426e803021af59029f87d2f9cd7335a05531"
|
||||
dependencies:
|
||||
colors "~0.6.2"
|
||||
grunt-legacy-log-utils "~0.1.1"
|
||||
hooker "~0.2.3"
|
||||
lodash "~2.4.1"
|
||||
underscore.string "~2.3.3"
|
||||
|
||||
grunt-legacy-util@~0.2.0:
|
||||
version "0.2.0"
|
||||
resolved "https://registry.yarnpkg.com/grunt-legacy-util/-/grunt-legacy-util-0.2.0.tgz#93324884dbf7e37a9ff7c026dff451d94a9e554b"
|
||||
dependencies:
|
||||
async "~0.1.22"
|
||||
exit "~0.1.1"
|
||||
getobject "~0.1.0"
|
||||
hooker "~0.2.3"
|
||||
lodash "~0.9.2"
|
||||
underscore.string "~2.2.1"
|
||||
which "~1.0.5"
|
||||
|
||||
grunt-mocha-cli@^1.13.1:
|
||||
version "1.14.0"
|
||||
resolved "https://registry.yarnpkg.com/grunt-mocha-cli/-/grunt-mocha-cli-1.14.0.tgz#48f657b53347f52dd95cf843270c0cabd92f595a"
|
||||
dependencies:
|
||||
mocha "~2.2.1"
|
||||
|
||||
grunt@~0.4.4:
|
||||
version "0.4.5"
|
||||
resolved "https://registry.yarnpkg.com/grunt/-/grunt-0.4.5.tgz#56937cd5194324adff6d207631832a9d6ba4e7f0"
|
||||
dependencies:
|
||||
async "~0.1.22"
|
||||
coffee-script "~1.3.3"
|
||||
colors "~0.6.2"
|
||||
dateformat "1.0.2-1.2.3"
|
||||
eventemitter2 "~0.4.13"
|
||||
exit "~0.1.1"
|
||||
findup-sync "~0.1.2"
|
||||
getobject "~0.1.0"
|
||||
glob "~3.1.21"
|
||||
grunt-legacy-log "~0.1.0"
|
||||
grunt-legacy-util "~0.2.0"
|
||||
hooker "~0.2.3"
|
||||
iconv-lite "~0.2.11"
|
||||
js-yaml "~2.0.5"
|
||||
lodash "~0.9.2"
|
||||
minimatch "~0.2.12"
|
||||
nopt "~1.0.10"
|
||||
rimraf "~2.2.8"
|
||||
underscore.string "~2.2.1"
|
||||
which "~1.0.5"
|
||||
|
||||
has-ansi@^1.0.3:
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-1.0.3.tgz#c0b5b1615d9e382b0ff67169d967b425e48ca538"
|
||||
dependencies:
|
||||
ansi-regex "^1.1.0"
|
||||
get-stdin "^4.0.1"
|
||||
|
||||
hooker@^0.2.3, hooker@~0.2.3:
|
||||
version "0.2.3"
|
||||
resolved "https://registry.yarnpkg.com/hooker/-/hooker-0.2.3.tgz#b834f723cc4a242aa65963459df6d984c5d3d959"
|
||||
|
||||
htmlparser2@3.8.x, htmlparser2@~3.8.1:
|
||||
version "3.8.3"
|
||||
resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.8.3.tgz#996c28b191516a8be86501a7d79757e5c70c1068"
|
||||
dependencies:
|
||||
domelementtype "1"
|
||||
domhandler "2.3"
|
||||
domutils "1.5"
|
||||
entities "1.0"
|
||||
readable-stream "1.1"
|
||||
|
||||
i@0.3.x:
|
||||
version "0.3.6"
|
||||
resolved "https://registry.yarnpkg.com/i/-/i-0.3.6.tgz#d96c92732076f072711b6b10fd7d4f65ad8ee23d"
|
||||
|
||||
iconv-lite@~0.2.11:
|
||||
version "0.2.11"
|
||||
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.2.11.tgz#1ce60a3a57864a292d1321ff4609ca4bb965adc8"
|
||||
|
||||
inflight@^1.0.4:
|
||||
version "1.0.6"
|
||||
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
|
||||
dependencies:
|
||||
once "^1.3.0"
|
||||
wrappy "1"
|
||||
|
||||
inherits@1:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/inherits/-/inherits-1.0.2.tgz#ca4309dadee6b54cc0b8d247e8d7c7a0975bdc9b"
|
||||
|
||||
inherits@2, inherits@~2.0.1:
|
||||
version "2.0.3"
|
||||
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
|
||||
|
||||
inherits@2.0.1:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1"
|
||||
|
||||
isarray@0.0.1:
|
||||
version "0.0.1"
|
||||
resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf"
|
||||
|
||||
isstream@0.1.x:
|
||||
version "0.1.2"
|
||||
resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a"
|
||||
|
||||
jade@0.26.3:
|
||||
version "0.26.3"
|
||||
resolved "https://registry.yarnpkg.com/jade/-/jade-0.26.3.tgz#8f10d7977d8d79f2f6ff862a81b0513ccb25686c"
|
||||
dependencies:
|
||||
commander "0.6.1"
|
||||
mkdirp "0.3.0"
|
||||
|
||||
js-yaml@~2.0.5:
|
||||
version "2.0.5"
|
||||
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-2.0.5.tgz#a25ae6509999e97df278c6719da11bd0687743a8"
|
||||
dependencies:
|
||||
argparse "~ 0.1.11"
|
||||
esprima "~ 1.0.2"
|
||||
|
||||
jscs@~1.13.0:
|
||||
version "1.13.1"
|
||||
resolved "https://registry.yarnpkg.com/jscs/-/jscs-1.13.1.tgz#7dd46e186f0fce0712cd031eacc0a45ef7dcfeb0"
|
||||
dependencies:
|
||||
chalk "~1.0.0"
|
||||
cli-table "~0.3.1"
|
||||
commander "~2.6.0"
|
||||
esprima "^1.2.5"
|
||||
esprima-harmony-jscs "1.1.0-bin"
|
||||
estraverse "^1.9.3"
|
||||
exit "~0.1.2"
|
||||
glob "^5.0.1"
|
||||
lodash.assign "~3.0.0"
|
||||
minimatch "~2.0.1"
|
||||
pathval "~0.1.1"
|
||||
prompt "~0.2.14"
|
||||
strip-json-comments "~1.0.2"
|
||||
vow "~0.4.8"
|
||||
vow-fs "~0.3.4"
|
||||
xmlbuilder "^2.6.1"
|
||||
|
||||
jshint@~2.8.0:
|
||||
version "2.8.0"
|
||||
resolved "https://registry.yarnpkg.com/jshint/-/jshint-2.8.0.tgz#1d09a3bd913c4cadfa81bf18d582bd85bffe0d44"
|
||||
dependencies:
|
||||
cli "0.6.x"
|
||||
console-browserify "1.1.x"
|
||||
exit "0.1.x"
|
||||
htmlparser2 "3.8.x"
|
||||
lodash "3.7.x"
|
||||
minimatch "2.0.x"
|
||||
shelljs "0.3.x"
|
||||
strip-json-comments "1.0.x"
|
||||
|
||||
lodash._baseassign@^3.0.0:
|
||||
version "3.2.0"
|
||||
resolved "https://registry.yarnpkg.com/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz#8c38a099500f215ad09e59f1722fd0c52bfe0a4e"
|
||||
dependencies:
|
||||
lodash._basecopy "^3.0.0"
|
||||
lodash.keys "^3.0.0"
|
||||
|
||||
lodash._basecopy@^3.0.0:
|
||||
version "3.0.1"
|
||||
resolved "https://registry.yarnpkg.com/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz#8da0e6a876cf344c0ad8a54882111dd3c5c7ca36"
|
||||
|
||||
lodash._bindcallback@^3.0.0:
|
||||
version "3.0.1"
|
||||
resolved "https://registry.yarnpkg.com/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz#e531c27644cf8b57a99e17ed95b35c748789392e"
|
||||
|
||||
lodash._createassigner@^3.0.0:
|
||||
version "3.1.1"
|
||||
resolved "https://registry.yarnpkg.com/lodash._createassigner/-/lodash._createassigner-3.1.1.tgz#838a5bae2fdaca63ac22dee8e19fa4e6d6970b11"
|
||||
dependencies:
|
||||
lodash._bindcallback "^3.0.0"
|
||||
lodash._isiterateecall "^3.0.0"
|
||||
lodash.restparam "^3.0.0"
|
||||
|
||||
lodash._getnative@^3.0.0:
|
||||
version "3.9.1"
|
||||
resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5"
|
||||
|
||||
lodash._isiterateecall@^3.0.0:
|
||||
version "3.0.9"
|
||||
resolved "https://registry.yarnpkg.com/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz#5203ad7ba425fae842460e696db9cf3e6aac057c"
|
||||
|
||||
lodash.assign@~3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/lodash.assign/-/lodash.assign-3.0.0.tgz#f7749d1580a4120273a371f54a66b14c9d7226fa"
|
||||
dependencies:
|
||||
lodash._baseassign "^3.0.0"
|
||||
lodash._createassigner "^3.0.0"
|
||||
|
||||
lodash.isarguments@^3.0.0:
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz#2f573d85c6a24289ff00663b491c1d338ff3458a"
|
||||
|
||||
lodash.isarray@^3.0.0:
|
||||
version "3.0.4"
|
||||
resolved "https://registry.yarnpkg.com/lodash.isarray/-/lodash.isarray-3.0.4.tgz#79e4eb88c36a8122af86f844aa9bcd851b5fbb55"
|
||||
|
||||
lodash.keys@^3.0.0:
|
||||
version "3.1.2"
|
||||
resolved "https://registry.yarnpkg.com/lodash.keys/-/lodash.keys-3.1.2.tgz#4dbc0472b156be50a0b286855d1bd0b0c656098a"
|
||||
dependencies:
|
||||
lodash._getnative "^3.0.0"
|
||||
lodash.isarguments "^3.0.0"
|
||||
lodash.isarray "^3.0.0"
|
||||
|
||||
lodash.restparam@^3.0.0:
|
||||
version "3.6.1"
|
||||
resolved "https://registry.yarnpkg.com/lodash.restparam/-/lodash.restparam-3.6.1.tgz#936a4e309ef330a7645ed4145986c85ae5b20805"
|
||||
|
||||
lodash.unescape@4.0.1:
|
||||
version "4.0.1"
|
||||
resolved "https://registry.yarnpkg.com/lodash.unescape/-/lodash.unescape-4.0.1.tgz#bf2249886ce514cda112fae9218cdc065211fc9c"
|
||||
|
||||
lodash@3.7.x:
|
||||
version "3.7.0"
|
||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.7.0.tgz#3678bd8ab995057c07ade836ed2ef087da811d45"
|
||||
|
||||
lodash@^3.2.0, lodash@^3.5.0:
|
||||
version "3.10.1"
|
||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6"
|
||||
|
||||
lodash@^4.0.0:
|
||||
version "4.17.4"
|
||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"
|
||||
|
||||
lodash@~0.9.2:
|
||||
version "0.9.2"
|
||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-0.9.2.tgz#8f3499c5245d346d682e5b0d3b40767e09f1a92c"
|
||||
|
||||
lodash@~1.0.1:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-1.0.2.tgz#8f57560c83b59fc270bd3d561b690043430e2551"
|
||||
|
||||
lodash@~2.4.1:
|
||||
version "2.4.2"
|
||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-2.4.2.tgz#fadd834b9683073da179b3eae6d9c0d15053f73e"
|
||||
|
||||
lolex@1.3.2:
|
||||
version "1.3.2"
|
||||
resolved "https://registry.yarnpkg.com/lolex/-/lolex-1.3.2.tgz#7c3da62ffcb30f0f5a80a2566ca24e45d8a01f31"
|
||||
|
||||
lru-cache@2:
|
||||
version "2.7.3"
|
||||
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-2.7.3.tgz#6d4524e8b955f95d4f5b58851ce21dd72fb4e952"
|
||||
|
||||
minimatch@0.3:
|
||||
version "0.3.0"
|
||||
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-0.3.0.tgz#275d8edaac4f1bb3326472089e7949c8394699dd"
|
||||
dependencies:
|
||||
lru-cache "2"
|
||||
sigmund "~1.0.0"
|
||||
|
||||
"minimatch@2 || 3", minimatch@^3.0.4:
|
||||
version "3.0.4"
|
||||
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
|
||||
dependencies:
|
||||
brace-expansion "^1.1.7"
|
||||
|
||||
minimatch@2.0.x, minimatch@~2.0.1:
|
||||
version "2.0.10"
|
||||
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-2.0.10.tgz#8d087c39c6b38c001b97fca7ce6d0e1e80afbac7"
|
||||
dependencies:
|
||||
brace-expansion "^1.0.0"
|
||||
|
||||
minimatch@~0.2.11, minimatch@~0.2.12:
|
||||
version "0.2.14"
|
||||
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-0.2.14.tgz#c74e780574f63c6f9a090e90efbe6ef53a6a756a"
|
||||
dependencies:
|
||||
lru-cache "2"
|
||||
sigmund "~1.0.0"
|
||||
|
||||
minimist@0.0.8:
|
||||
version "0.0.8"
|
||||
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
|
||||
|
||||
mkdirp@0.3.0:
|
||||
version "0.3.0"
|
||||
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.3.0.tgz#1bbf5ab1ba827af23575143490426455f481fe1e"
|
||||
|
||||
mkdirp@0.5.0:
|
||||
version "0.5.0"
|
||||
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.0.tgz#1d73076a6df986cd9344e15e71fcc05a4c9abf12"
|
||||
dependencies:
|
||||
minimist "0.0.8"
|
||||
|
||||
mkdirp@0.x.x:
|
||||
version "0.5.1"
|
||||
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903"
|
||||
dependencies:
|
||||
minimist "0.0.8"
|
||||
|
||||
mocha@~2.2.1:
|
||||
version "2.2.5"
|
||||
resolved "https://registry.yarnpkg.com/mocha/-/mocha-2.2.5.tgz#d3b72a4fe49ec9439353f1ac893dbc430d993140"
|
||||
dependencies:
|
||||
commander "2.3.0"
|
||||
debug "2.0.0"
|
||||
diff "1.4.0"
|
||||
escape-string-regexp "1.0.2"
|
||||
glob "3.2.3"
|
||||
growl "1.8.1"
|
||||
jade "0.26.3"
|
||||
mkdirp "0.5.0"
|
||||
supports-color "~1.2.0"
|
||||
|
||||
ms@0.6.2:
|
||||
version "0.6.2"
|
||||
resolved "https://registry.yarnpkg.com/ms/-/ms-0.6.2.tgz#d89c2124c6fdc1353d65a8b77bf1aac4b193708c"
|
||||
|
||||
mute-stream@~0.0.4:
|
||||
version "0.0.7"
|
||||
resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab"
|
||||
|
||||
ncp@0.4.x:
|
||||
version "0.4.2"
|
||||
resolved "https://registry.yarnpkg.com/ncp/-/ncp-0.4.2.tgz#abcc6cbd3ec2ed2a729ff6e7c1fa8f01784a8574"
|
||||
|
||||
nopt@~1.0.10:
|
||||
version "1.0.10"
|
||||
resolved "https://registry.yarnpkg.com/nopt/-/nopt-1.0.10.tgz#6ddd21bd2a31417b92727dd585f8a6f37608ebee"
|
||||
dependencies:
|
||||
abbrev "1"
|
||||
|
||||
nopt@~2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/nopt/-/nopt-2.0.0.tgz#ca7416f20a5e3f9c3b86180f96295fa3d0b52e0d"
|
||||
dependencies:
|
||||
abbrev "1"
|
||||
|
||||
noptify@~0.0.3:
|
||||
version "0.0.3"
|
||||
resolved "https://registry.yarnpkg.com/noptify/-/noptify-0.0.3.tgz#58f654a73d9753df0c51d9686dc92104a67f4bbb"
|
||||
dependencies:
|
||||
nopt "~2.0.0"
|
||||
|
||||
nth-check@~1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-1.0.1.tgz#9929acdf628fc2c41098deab82ac580cf149aae4"
|
||||
dependencies:
|
||||
boolbase "~1.0.0"
|
||||
|
||||
once@^1.3.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
|
||||
dependencies:
|
||||
wrappy "1"
|
||||
|
||||
path-is-absolute@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
|
||||
|
||||
pathval@~0.1.1:
|
||||
version "0.1.1"
|
||||
resolved "https://registry.yarnpkg.com/pathval/-/pathval-0.1.1.tgz#08f911cdca9cce5942880da7817bc0b723b66d82"
|
||||
|
||||
pkginfo@0.3.x:
|
||||
version "0.3.1"
|
||||
resolved "https://registry.yarnpkg.com/pkginfo/-/pkginfo-0.3.1.tgz#5b29f6a81f70717142e09e765bbeab97b4f81e21"
|
||||
|
||||
pkginfo@0.x.x:
|
||||
version "0.4.1"
|
||||
resolved "https://registry.yarnpkg.com/pkginfo/-/pkginfo-0.4.1.tgz#b5418ef0439de5425fc4995042dced14fb2a84ff"
|
||||
|
||||
pofile@~1.0.0:
|
||||
version "1.0.10"
|
||||
resolved "https://registry.yarnpkg.com/pofile/-/pofile-1.0.10.tgz#503dda9499403984e83ff4489ba2d80af276172a"
|
||||
|
||||
prompt@~0.2.14:
|
||||
version "0.2.14"
|
||||
resolved "https://registry.yarnpkg.com/prompt/-/prompt-0.2.14.tgz#57754f64f543fd7b0845707c818ece618f05ffdc"
|
||||
dependencies:
|
||||
pkginfo "0.x.x"
|
||||
read "1.0.x"
|
||||
revalidator "0.1.x"
|
||||
utile "0.2.x"
|
||||
winston "0.8.x"
|
||||
|
||||
qs@~0.5.2:
|
||||
version "0.5.6"
|
||||
resolved "https://registry.yarnpkg.com/qs/-/qs-0.5.6.tgz#31b1ad058567651c526921506b9a8793911a0384"
|
||||
|
||||
read@1.0.x:
|
||||
version "1.0.7"
|
||||
resolved "https://registry.yarnpkg.com/read/-/read-1.0.7.tgz#b3da19bd052431a97671d44a42634adf710b40c4"
|
||||
dependencies:
|
||||
mute-stream "~0.0.4"
|
||||
|
||||
readable-stream@1.1:
|
||||
version "1.1.13"
|
||||
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.13.tgz#f6eef764f514c89e2b9e23146a75ba106756d23e"
|
||||
dependencies:
|
||||
core-util-is "~1.0.0"
|
||||
inherits "~2.0.1"
|
||||
isarray "0.0.1"
|
||||
string_decoder "~0.10.x"
|
||||
|
||||
revalidator@0.1.x:
|
||||
version "0.1.8"
|
||||
resolved "https://registry.yarnpkg.com/revalidator/-/revalidator-0.1.8.tgz#fece61bfa0c1b52a206bd6b18198184bdd523a3b"
|
||||
|
||||
rimraf@2.x.x:
|
||||
version "2.6.2"
|
||||
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36"
|
||||
dependencies:
|
||||
glob "^7.0.5"
|
||||
|
||||
rimraf@~2.2.1, rimraf@~2.2.8:
|
||||
version "2.2.8"
|
||||
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.2.8.tgz#e439be2aaee327321952730f99a8929e4fc50582"
|
||||
|
||||
samsam@1.1.2:
|
||||
version "1.1.2"
|
||||
resolved "https://registry.yarnpkg.com/samsam/-/samsam-1.1.2.tgz#bec11fdc83a9fda063401210e40176c3024d1567"
|
||||
|
||||
samsam@~1.1:
|
||||
version "1.1.3"
|
||||
resolved "https://registry.yarnpkg.com/samsam/-/samsam-1.1.3.tgz#9f5087419b4d091f232571e7fa52e90b0f552621"
|
||||
|
||||
semver@5.3.0:
|
||||
version "5.3.0"
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f"
|
||||
|
||||
semver@~1.1:
|
||||
version "1.1.4"
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-1.1.4.tgz#2e5a4e72bab03472cc97f72753b4508912ef5540"
|
||||
|
||||
shelljs@0.3.x:
|
||||
version "0.3.0"
|
||||
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.3.0.tgz#3596e6307a781544f591f37da618360f31db57b1"
|
||||
|
||||
sigmund@~1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/sigmund/-/sigmund-1.0.1.tgz#3ff21f198cad2175f9f3b781853fd94d0d19b590"
|
||||
|
||||
sinon@^1.17.4:
|
||||
version "1.17.7"
|
||||
resolved "https://registry.yarnpkg.com/sinon/-/sinon-1.17.7.tgz#4542a4f49ba0c45c05eb2e9dd9d203e2b8efe0bf"
|
||||
dependencies:
|
||||
formatio "1.1.1"
|
||||
lolex "1.3.2"
|
||||
samsam "1.1.2"
|
||||
util ">=0.10.3 <1"
|
||||
|
||||
stack-trace@0.0.x:
|
||||
version "0.0.10"
|
||||
resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-0.0.10.tgz#547c70b347e8d32b4e108ea1a2a159e5fdde19c0"
|
||||
|
||||
string_decoder@~0.10.x:
|
||||
version "0.10.31"
|
||||
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94"
|
||||
|
||||
strip-ansi@^2.0.1:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-2.0.1.tgz#df62c1aa94ed2f114e1d0f21fd1d50482b79a60e"
|
||||
dependencies:
|
||||
ansi-regex "^1.0.0"
|
||||
|
||||
strip-json-comments@1.0.x, strip-json-comments@~1.0.2:
|
||||
version "1.0.4"
|
||||
resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-1.0.4.tgz#1e15fbcac97d3ee99bf2d73b4c656b082bbafb91"
|
||||
|
||||
supports-color@^1.3.0:
|
||||
version "1.3.1"
|
||||
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-1.3.1.tgz#15758df09d8ff3b4acc307539fabe27095e1042d"
|
||||
|
||||
supports-color@~1.2.0:
|
||||
version "1.2.1"
|
||||
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-1.2.1.tgz#12ee21507086cd98c1058d9ec0f4ac476b7af3b2"
|
||||
|
||||
tiny-lr-fork@0.0.5:
|
||||
version "0.0.5"
|
||||
resolved "https://registry.yarnpkg.com/tiny-lr-fork/-/tiny-lr-fork-0.0.5.tgz#1e99e1e2a8469b736ab97d97eefa98c71f76ed0a"
|
||||
dependencies:
|
||||
debug "~0.7.0"
|
||||
faye-websocket "~0.4.3"
|
||||
noptify "~0.0.3"
|
||||
qs "~0.5.2"
|
||||
|
||||
typescript-eslint-parser@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/typescript-eslint-parser/-/typescript-eslint-parser-3.0.0.tgz#dd0435b303abc841464c02d00184d7b39bd488b5"
|
||||
dependencies:
|
||||
lodash.unescape "4.0.1"
|
||||
semver "5.3.0"
|
||||
|
||||
typescript@~2.3.2:
|
||||
version "2.3.4"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.3.4.tgz#3d38321828231e434f287514959c37a82b629f42"
|
||||
|
||||
underscore.string@~2.2.1:
|
||||
version "2.2.1"
|
||||
resolved "https://registry.yarnpkg.com/underscore.string/-/underscore.string-2.2.1.tgz#d7c0fa2af5d5a1a67f4253daee98132e733f0f19"
|
||||
|
||||
underscore.string@~2.3.3:
|
||||
version "2.3.3"
|
||||
resolved "https://registry.yarnpkg.com/underscore.string/-/underscore.string-2.3.3.tgz#71c08bf6b428b1133f37e78fa3a21c82f7329b0d"
|
||||
|
||||
underscore.string@~2.4.0:
|
||||
version "2.4.0"
|
||||
resolved "https://registry.yarnpkg.com/underscore.string/-/underscore.string-2.4.0.tgz#8cdd8fbac4e2d2ea1e7e2e8097c42f442280f85b"
|
||||
|
||||
underscore@~1.7.0:
|
||||
version "1.7.0"
|
||||
resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.7.0.tgz#6bbaf0877500d36be34ecaa584e0db9fef035209"
|
||||
|
||||
"util@>=0.10.3 <1":
|
||||
version "0.10.3"
|
||||
resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9"
|
||||
dependencies:
|
||||
inherits "2.0.1"
|
||||
|
||||
utile@0.2.x:
|
||||
version "0.2.1"
|
||||
resolved "https://registry.yarnpkg.com/utile/-/utile-0.2.1.tgz#930c88e99098d6220834c356cbd9a770522d90d7"
|
||||
dependencies:
|
||||
async "~0.2.9"
|
||||
deep-equal "*"
|
||||
i "0.3.x"
|
||||
mkdirp "0.x.x"
|
||||
ncp "0.4.x"
|
||||
rimraf "2.x.x"
|
||||
|
||||
uuid@^2.0.2:
|
||||
version "2.0.3"
|
||||
resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.3.tgz#67e2e863797215530dff318e5bf9dcebfd47b21a"
|
||||
|
||||
vow-fs@~0.3.4:
|
||||
version "0.3.6"
|
||||
resolved "https://registry.yarnpkg.com/vow-fs/-/vow-fs-0.3.6.tgz#2d4c59be22e2bf2618ddf597ab4baa923be7200d"
|
||||
dependencies:
|
||||
glob "^7.0.5"
|
||||
uuid "^2.0.2"
|
||||
vow "^0.4.7"
|
||||
vow-queue "^0.4.1"
|
||||
|
||||
vow-queue@^0.4.1:
|
||||
version "0.4.3"
|
||||
resolved "https://registry.yarnpkg.com/vow-queue/-/vow-queue-0.4.3.tgz#4ba8f64b56e9212c0dbe57f1405aeebd54cce78d"
|
||||
dependencies:
|
||||
vow "^0.4.17"
|
||||
|
||||
vow@^0.4.17, vow@^0.4.7, vow@~0.4.1, vow@~0.4.8:
|
||||
version "0.4.17"
|
||||
resolved "https://registry.yarnpkg.com/vow/-/vow-0.4.17.tgz#b16e08fae58c52f3ebc6875f2441b26a92682904"
|
||||
|
||||
which@~1.0.5:
|
||||
version "1.0.9"
|
||||
resolved "https://registry.yarnpkg.com/which/-/which-1.0.9.tgz#460c1da0f810103d0321a9b633af9e575e64486f"
|
||||
|
||||
winston@0.8.x:
|
||||
version "0.8.3"
|
||||
resolved "https://registry.yarnpkg.com/winston/-/winston-0.8.3.tgz#64b6abf4cd01adcaefd5009393b1d8e8bec19db0"
|
||||
dependencies:
|
||||
async "0.2.x"
|
||||
colors "0.6.x"
|
||||
cycle "1.0.x"
|
||||
eyes "0.1.x"
|
||||
isstream "0.1.x"
|
||||
pkginfo "0.3.x"
|
||||
stack-trace "0.0.x"
|
||||
|
||||
wrappy@1:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
|
||||
|
||||
xmlbuilder@^2.6.1:
|
||||
version "2.6.5"
|
||||
resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-2.6.5.tgz#6ff7ad60fb72d22764f007a164b77f2bf1400526"
|
||||
dependencies:
|
||||
lodash "^3.5.0"
|
35
node_modules/angular-gettext/.jscs.json
generated
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
{
|
||||
"requireCurlyBraces": ["if", "else", "for", "while", "do", "try", "catch"],
|
||||
"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch"],
|
||||
"requireParenthesesAroundIIFE": true,
|
||||
"requireSpacesInFunctionExpression": {
|
||||
"beforeOpeningCurlyBrace": true
|
||||
},
|
||||
"requireSpacesInAnonymousFunctionExpression": {
|
||||
"beforeOpeningRoundBrace": true
|
||||
},
|
||||
"disallowSpacesInNamedFunctionExpression": {
|
||||
"beforeOpeningRoundBrace": true
|
||||
},
|
||||
"disallowSpacesInFunctionDeclaration": {
|
||||
"beforeOpeningRoundBrace": true
|
||||
},
|
||||
"disallowMultipleVarDecl": true,
|
||||
"requireSpacesInsideObjectBrackets": "all",
|
||||
"disallowQuotedKeysInObjects": "allButReserved",
|
||||
"disallowSpaceAfterObjectKeys": true,
|
||||
"requireCommaBeforeLineBreak": true,
|
||||
"disallowSpaceBeforeBinaryOperators": [","],
|
||||
"disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"],
|
||||
"disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
|
||||
"requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="],
|
||||
"requireSpaceAfterBinaryOperators": [",", "+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="],
|
||||
"validateQuoteMarks": { "mark": true, "escape": true },
|
||||
"validateIndentation": 4,
|
||||
"disallowTrailingWhitespace": true,
|
||||
"disallowKeywordsOnNewLine": ["else"],
|
||||
"requireCapitalizedConstructors": true,
|
||||
"safeContextKeyword": "self",
|
||||
"requireDotNotation": true,
|
||||
"disallowYodaConditions": true
|
||||
}
|
32
node_modules/angular-gettext/.jshintrc
generated
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
{
|
||||
"bitwise": true,
|
||||
"curly": true,
|
||||
"eqeqeq": true,
|
||||
"es3": true,
|
||||
"freeze": true,
|
||||
"immed": true,
|
||||
"indent": 4,
|
||||
"latedef": true,
|
||||
"newcap": true,
|
||||
"noarg": true,
|
||||
"node": true,
|
||||
"trailing": true,
|
||||
"undef": true,
|
||||
"unused": true,
|
||||
"predef": [
|
||||
"$",
|
||||
"after",
|
||||
"afterEach",
|
||||
"angular",
|
||||
"assert",
|
||||
"before",
|
||||
"beforeEach",
|
||||
"browser",
|
||||
"by",
|
||||
"describe",
|
||||
"element",
|
||||
"expect",
|
||||
"inject",
|
||||
"it"
|
||||
]
|
||||
}
|
9
node_modules/angular-gettext/.npmignore
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
/Gruntfile.js
|
||||
/.travis.yml
|
||||
/genplurals.py
|
||||
/test
|
||||
/src
|
||||
/node_modules
|
||||
/bower_components
|
||||
/libpeerconnection.log
|
||||
/*-results.xml
|
19
node_modules/angular-gettext/LICENSE
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
Copyright (C) 2013-2017 by Ruben Vermeersch <ruben@rocketeer.be>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
31
node_modules/angular-gettext/README.md
generated
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
# angular-gettext - gettext utilities for angular.js
|
||||
|
||||
> Translate your Angular.JS applications with gettext.
|
||||
|
||||
[![Build Status](https://travis-ci.org/rubenv/angular-gettext.png?branch=master)](https://travis-ci.org/rubenv/angular-gettext)
|
||||
|
||||
Check the website for usage instructions: [http://angular-gettext.rocketeer.be/](http://angular-gettext.rocketeer.be/).
|
||||
|
||||
## License
|
||||
|
||||
(The MIT License)
|
||||
|
||||
Copyright (C) 2013-2017 by Ruben Vermeersch <ruben@rocketeer.be>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
21
node_modules/angular-gettext/bower.json
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "angular-gettext",
|
||||
"version": "2.3.10",
|
||||
"main": "dist/angular-gettext.js",
|
||||
"ignore": [
|
||||
"**/.*",
|
||||
"src",
|
||||
"node_modules",
|
||||
"bower_components",
|
||||
"test",
|
||||
"genplurals.py",
|
||||
"Gruntfile.js"
|
||||
],
|
||||
"dependencies": {
|
||||
"angular": ">=1.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"jquery": ">=1.8.0",
|
||||
"angular-mocks": ">=1.2.0"
|
||||
}
|
||||
}
|
825
node_modules/angular-gettext/dist/angular-gettext.js
generated
vendored
Normal file
@ -0,0 +1,825 @@
|
||||
/**
|
||||
* @ngdoc module
|
||||
* @name gettext
|
||||
* @packageName angular-gettext
|
||||
* @description Super simple Gettext for Angular.JS
|
||||
*
|
||||
* A sample application can be found at https://github.com/rubenv/angular-gettext-example.
|
||||
* This is an adaptation of the [TodoMVC](http://todomvc.com/) example. You can use this as a guideline while adding {@link angular-gettext angular-gettext} to your own application.
|
||||
*/
|
||||
/**
|
||||
* @ngdoc factory
|
||||
* @module gettext
|
||||
* @name gettextPlurals
|
||||
* @param {String} [langCode=en] language code
|
||||
* @param {Number} [n=0] number to calculate form for
|
||||
* @returns {Number} plural form number
|
||||
* @description Provides correct plural form id for the given language
|
||||
*
|
||||
* Example
|
||||
* ```js
|
||||
* gettextPlurals('ru', 10); // 1
|
||||
* gettextPlurals('en', 1); // 0
|
||||
* gettextPlurals(); // 1
|
||||
* ```
|
||||
*/
|
||||
angular.module('gettext', []);
|
||||
/**
|
||||
* @ngdoc object
|
||||
* @module gettext
|
||||
* @name gettext
|
||||
* @kind function
|
||||
* @param {String} str annotation key
|
||||
* @description Gettext constant function for annotating strings
|
||||
*
|
||||
* ```js
|
||||
* angular.module('myApp', ['gettext']).config(function(gettext) {
|
||||
* /// MyApp document title
|
||||
* gettext('my-app.title');
|
||||
* ...
|
||||
* })
|
||||
* ```
|
||||
*/
|
||||
angular.module('gettext').constant('gettext', function (str) {
|
||||
/*
|
||||
* Does nothing, simply returns the input string.
|
||||
*
|
||||
* This function serves as a marker for `grunt-angular-gettext` to know that
|
||||
* this string should be extracted for translations.
|
||||
*/
|
||||
return str;
|
||||
});
|
||||
|
||||
/**
|
||||
* @ngdoc service
|
||||
* @module gettext
|
||||
* @name gettextCatalog
|
||||
* @requires gettextPlurals
|
||||
* @requires gettextFallbackLanguage
|
||||
* @requires https://docs.angularjs.org/api/ng/service/$http $http
|
||||
* @requires https://docs.angularjs.org/api/ng/service/$cacheFactory $cacheFactory
|
||||
* @requires https://docs.angularjs.org/api/ng/service/$interpolate $interpolate
|
||||
* @requires https://docs.angularjs.org/api/ng/service/$rootScope $rootScope
|
||||
* @description Provides set of method to translate stings
|
||||
*/
|
||||
angular.module('gettext').factory('gettextCatalog', ["gettextPlurals", "gettextFallbackLanguage", "$http", "$cacheFactory", "$interpolate", "$rootScope", function (gettextPlurals, gettextFallbackLanguage, $http, $cacheFactory, $interpolate, $rootScope) {
|
||||
var catalog;
|
||||
var noContext = '$$noContext';
|
||||
|
||||
// IE8 returns UPPER CASE tags, even though the source is lower case.
|
||||
// This can causes the (key) string in the DOM to have a different case to
|
||||
// the string in the `po` files.
|
||||
// IE9, IE10 and IE11 reorders the attributes of tags.
|
||||
var test = '<span id="test" title="test" class="tested">test</span>';
|
||||
var isHTMLModified = (angular.element('<span>' + test + '</span>').html() !== test);
|
||||
|
||||
var prefixDebug = function (string) {
|
||||
if (catalog.debug && catalog.currentLanguage !== catalog.baseLanguage) {
|
||||
return catalog.debugPrefix + string;
|
||||
} else {
|
||||
return string;
|
||||
}
|
||||
};
|
||||
|
||||
var addTranslatedMarkers = function (string) {
|
||||
if (catalog.showTranslatedMarkers) {
|
||||
return catalog.translatedMarkerPrefix + string + catalog.translatedMarkerSuffix;
|
||||
} else {
|
||||
return string;
|
||||
}
|
||||
};
|
||||
|
||||
function broadcastUpdated() {
|
||||
/**
|
||||
* @ngdoc event
|
||||
* @name gettextCatalog#gettextLanguageChanged
|
||||
* @eventType broadcast on $rootScope
|
||||
* @description Fires language change notification without any additional parameters.
|
||||
*/
|
||||
$rootScope.$broadcast('gettextLanguageChanged');
|
||||
}
|
||||
|
||||
catalog = {
|
||||
/**
|
||||
* @ngdoc property
|
||||
* @name gettextCatalog#debug
|
||||
* @public
|
||||
* @type {Boolean} false
|
||||
* @see gettextCatalog#debug
|
||||
* @description Whether or not to prefix untranslated strings with `[MISSING]:` or a custom prefix.
|
||||
*/
|
||||
debug: false,
|
||||
/**
|
||||
* @ngdoc property
|
||||
* @name gettextCatalog#debugPrefix
|
||||
* @public
|
||||
* @type {String} [MISSING]:
|
||||
* @description Custom prefix for untranslated strings when {@link gettextCatalog#debug gettextCatalog#debug} set to `true`.
|
||||
*/
|
||||
debugPrefix: '[MISSING]: ',
|
||||
/**
|
||||
* @ngdoc property
|
||||
* @name gettextCatalog#showTranslatedMarkers
|
||||
* @public
|
||||
* @type {Boolean} false
|
||||
* @description Whether or not to wrap all processed text with markers.
|
||||
*
|
||||
* Example output: `[Welcome]`
|
||||
*/
|
||||
showTranslatedMarkers: false,
|
||||
/**
|
||||
* @ngdoc property
|
||||
* @name gettextCatalog#translatedMarkerPrefix
|
||||
* @public
|
||||
* @type {String} [
|
||||
* @description Custom prefix to mark strings that have been run through {@link angular-gettext angular-gettext}.
|
||||
*/
|
||||
translatedMarkerPrefix: '[',
|
||||
/**
|
||||
* @ngdoc property
|
||||
* @name gettextCatalog#translatedMarkerSuffix
|
||||
* @public
|
||||
* @type {String} ]
|
||||
* @description Custom suffix to mark strings that have been run through {@link angular-gettext angular-gettext}.
|
||||
*/
|
||||
translatedMarkerSuffix: ']',
|
||||
/**
|
||||
* @ngdoc property
|
||||
* @name gettextCatalog#strings
|
||||
* @private
|
||||
* @type {Object}
|
||||
* @description An object of loaded translation strings. Shouldn't be used directly.
|
||||
*/
|
||||
strings: {},
|
||||
/**
|
||||
* @ngdoc property
|
||||
* @name gettextCatalog#baseLanguage
|
||||
* @protected
|
||||
* @deprecated
|
||||
* @since 2.0
|
||||
* @type {String} en
|
||||
* @description The default language, in which you're application is written.
|
||||
*
|
||||
* This defaults to English and it's generally a bad idea to use anything else:
|
||||
* if your language has different pluralization rules you'll end up with incorrect translations.
|
||||
*/
|
||||
baseLanguage: 'en',
|
||||
/**
|
||||
* @ngdoc property
|
||||
* @name gettextCatalog#currentLanguage
|
||||
* @public
|
||||
* @type {String}
|
||||
* @description Active language.
|
||||
*/
|
||||
currentLanguage: 'en',
|
||||
/**
|
||||
* @ngdoc property
|
||||
* @name gettextCatalog#cache
|
||||
* @public
|
||||
* @type {String} en
|
||||
* @description Language cache for lazy load
|
||||
*/
|
||||
cache: $cacheFactory('strings'),
|
||||
|
||||
/**
|
||||
* @ngdoc method
|
||||
* @name gettextCatalog#setCurrentLanguage
|
||||
* @public
|
||||
* @param {String} lang language name
|
||||
* @description Sets the current language and makes sure that all translations get updated correctly.
|
||||
*/
|
||||
setCurrentLanguage: function (lang) {
|
||||
this.currentLanguage = lang;
|
||||
broadcastUpdated();
|
||||
},
|
||||
|
||||
/**
|
||||
* @ngdoc method
|
||||
* @name gettextCatalog#getCurrentLanguage
|
||||
* @public
|
||||
* @returns {String} current language
|
||||
* @description Returns the current language.
|
||||
*/
|
||||
getCurrentLanguage: function () {
|
||||
return this.currentLanguage;
|
||||
},
|
||||
|
||||
/**
|
||||
* @ngdoc method
|
||||
* @name gettextCatalog#setStrings
|
||||
* @public
|
||||
* @param {String} language language name
|
||||
* @param {Object.<String>} strings set of strings where the key is the translation `key` and `value` is the translated text
|
||||
* @description Processes an object of string definitions. {@link guide:manual-setstrings More details here}.
|
||||
*/
|
||||
setStrings: function (language, strings) {
|
||||
if (!this.strings[language]) {
|
||||
this.strings[language] = {};
|
||||
}
|
||||
|
||||
var defaultPlural = gettextPlurals(language, 1);
|
||||
for (var key in strings) {
|
||||
var val = strings[key];
|
||||
|
||||
if (isHTMLModified) {
|
||||
// Use the DOM engine to render any HTML in the key (#131).
|
||||
key = angular.element('<span>' + key + '</span>').html();
|
||||
}
|
||||
|
||||
if (angular.isString(val) || angular.isArray(val)) {
|
||||
// No context, wrap it in $$noContext.
|
||||
var obj = {};
|
||||
obj[noContext] = val;
|
||||
val = obj;
|
||||
}
|
||||
|
||||
if (!this.strings[language][key]) {
|
||||
this.strings[language][key] = {};
|
||||
}
|
||||
|
||||
for (var context in val) {
|
||||
var str = val[context];
|
||||
if (!angular.isArray(str)) {
|
||||
// Expand single strings
|
||||
this.strings[language][key][context] = [];
|
||||
this.strings[language][key][context][defaultPlural] = str;
|
||||
} else {
|
||||
this.strings[language][key][context] = str;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
broadcastUpdated();
|
||||
},
|
||||
|
||||
/**
|
||||
* @ngdoc method
|
||||
* @name gettextCatalog#getStringFormFor
|
||||
* @protected
|
||||
* @param {String} language language name
|
||||
* @param {String} string translation key
|
||||
* @param {Number=} n number to build sting form for
|
||||
* @param {String=} context translation key context, e.g. {@link doc:context Verb, Noun}
|
||||
* @returns {String|Null} translated or annotated string or null if language is not set
|
||||
* @description Translate a string with the given language, count and context.
|
||||
*/
|
||||
getStringFormFor: function (language, string, n, context) {
|
||||
if (!language) {
|
||||
return null;
|
||||
}
|
||||
var stringTable = this.strings[language] || {};
|
||||
var contexts = stringTable[string] || {};
|
||||
var plurals = contexts[context || noContext] || [];
|
||||
return plurals[gettextPlurals(language, n)];
|
||||
},
|
||||
|
||||
/**
|
||||
* @ngdoc method
|
||||
* @name gettextCatalog#getString
|
||||
* @public
|
||||
* @param {String} string translation key
|
||||
* @param {$rootScope.Scope=} scope scope to do interpolation against
|
||||
* @param {String=} context translation key context, e.g. {@link doc:context Verb, Noun}
|
||||
* @returns {String} translated or annotated string
|
||||
* @description Translate a string with the given scope and context.
|
||||
*
|
||||
* First it tries {@link gettextCatalog#currentLanguage gettextCatalog#currentLanguage} (e.g. `en-US`) then {@link gettextFallbackLanguage fallback} (e.g. `en`).
|
||||
*
|
||||
* When `scope` is supplied it uses Angular.JS interpolation, so something like this will do what you expect:
|
||||
* ```js
|
||||
* var hello = gettextCatalog.getString("Hello {{name}}!", { name: "Ruben" });
|
||||
* // var hello will be "Hallo Ruben!" in Dutch.
|
||||
* ```
|
||||
* Avoid using scopes - this skips interpolation and is a lot faster.
|
||||
*/
|
||||
getString: function (string, scope, context) {
|
||||
var fallbackLanguage = gettextFallbackLanguage(this.currentLanguage);
|
||||
string = this.getStringFormFor(this.currentLanguage, string, 1, context) ||
|
||||
this.getStringFormFor(fallbackLanguage, string, 1, context) ||
|
||||
prefixDebug(string);
|
||||
string = scope ? $interpolate(string)(scope) : string;
|
||||
return addTranslatedMarkers(string);
|
||||
},
|
||||
|
||||
/**
|
||||
* @ngdoc method
|
||||
* @name gettextCatalog#getPlural
|
||||
* @public
|
||||
* @param {Number} n number to build sting form for
|
||||
* @param {String} string translation key
|
||||
* @param {String} stringPlural plural translation key
|
||||
* @param {$rootScope.Scope=} scope scope to do interpolation against
|
||||
* @param {String=} context translation key context, e.g. {@link doc:context Verb, Noun}
|
||||
* @returns {String} translated or annotated string
|
||||
* @see {@link gettextCatalog#getString gettextCatalog#getString} for details
|
||||
* @description Translate a plural string with the given context.
|
||||
*/
|
||||
getPlural: function (n, string, stringPlural, scope, context) {
|
||||
var fallbackLanguage = gettextFallbackLanguage(this.currentLanguage);
|
||||
string = this.getStringFormFor(this.currentLanguage, string, n, context) ||
|
||||
this.getStringFormFor(fallbackLanguage, string, n, context) ||
|
||||
prefixDebug(n === 1 ? string : stringPlural);
|
||||
if (scope) {
|
||||
scope.$count = n;
|
||||
string = $interpolate(string)(scope);
|
||||
}
|
||||
return addTranslatedMarkers(string);
|
||||
},
|
||||
|
||||
/**
|
||||
* @ngdoc method
|
||||
* @name gettextCatalog#loadRemote
|
||||
* @public
|
||||
* @param {String} url location of the translations
|
||||
* @description Load a set of translation strings from a given URL.
|
||||
*
|
||||
* This should be a JSON catalog generated with [angular-gettext-tools](https://github.com/rubenv/angular-gettext-tools).
|
||||
* {@link guide:lazy-loading More details here}.
|
||||
*/
|
||||
loadRemote: function (url) {
|
||||
return $http({
|
||||
method: 'GET',
|
||||
url: url,
|
||||
cache: catalog.cache
|
||||
}).then(function (response) {
|
||||
var data = response.data;
|
||||
for (var lang in data) {
|
||||
catalog.setStrings(lang, data[lang]);
|
||||
}
|
||||
return response;
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
return catalog;
|
||||
}]);
|
||||
|
||||
/**
|
||||
* @ngdoc directive
|
||||
* @module gettext
|
||||
* @name translate
|
||||
* @requires gettextCatalog
|
||||
* @requires gettextUtil
|
||||
* @requires https://docs.angularjs.org/api/ng/service/$parse $parse
|
||||
* @requires https://docs.angularjs.org/api/ng/service/$animate $animate
|
||||
* @requires https://docs.angularjs.org/api/ng/service/$compile $compile
|
||||
* @requires https://docs.angularjs.org/api/ng/service/$window $window
|
||||
* @restrict AE
|
||||
* @param {String} [translatePlural] plural form
|
||||
* @param {Number} translateN value to watch to substitute correct plural form
|
||||
* @param {String} translateContext context value, e.g. {@link doc:context Verb, Noun}
|
||||
* @description Annotates and translates text inside directive
|
||||
*
|
||||
* Full interpolation support is available in translated strings, so the following will work as expected:
|
||||
* ```js
|
||||
* <div translate>Hello {{name}}!</div>
|
||||
* ```
|
||||
*
|
||||
* You can also use custom context parameters while interpolating. This approach allows usage
|
||||
* of angular filters as well as custom logic inside your translated messages without unnecessary impact on translations.
|
||||
*
|
||||
* So for example when you have message like this:
|
||||
* ```js
|
||||
* <div translate>Last modified {{modificationDate | date:'yyyy-MM-dd HH:mm:ss Z'}} by {{author}}.</div>
|
||||
* ```
|
||||
* you will have it extracted in exact same version so it would look like this:
|
||||
* `Last modified {{modificationDate | date:'yyyy-MM-dd HH:mm:ss Z'}} by {{author}}`.
|
||||
* To start with it might be too complicated to read and handle by non technical translator. It's easy to make mistake
|
||||
* when copying format for example. Secondly if you decide to change format by some point of the project translation will broke
|
||||
* as it won't be the same string anymore.
|
||||
*
|
||||
* Instead your translator should only be concerned to place {{modificationDate}} correctly and you should have a free hand
|
||||
* to modify implementation details on how to present the results. This is how you can achieve the goal:
|
||||
* ```js
|
||||
* <div translate translate-params-modification-date="modificationDate | date:'yyyy-MM-dd HH:mm:ss Z'">Last modified {{modificationDate}} by {{author}}.</div>
|
||||
* ```
|
||||
*
|
||||
* There's a few more things worth to point out:
|
||||
* 1. You can use as many parameters as you want. Each parameter begins with `translate-params-` followed by snake-case parameter name.
|
||||
* Each parameter will be available for interpolation in camelCase manner (just like angular directive works by default).
|
||||
* ```js
|
||||
* <div translate translate-params-my-custom-param="param1" translate-params-name="name">Param {{myCustomParam}} has been changed by {{name}}.</div>
|
||||
* ```
|
||||
* 2. You can rename your variables from current scope to simple ones if you like.
|
||||
* ```js
|
||||
* <div translate translate-params-date="veryUnintuitiveNameForDate">Today's date is: {{date}}.</div>
|
||||
* ```
|
||||
* 3. You can use translate-params only for some interpolations. Rest would be treated as usual.
|
||||
* ```js
|
||||
* <div translate translate-params-cost="cost | currency">This product: {{product}} costs {{cost}}.</div>
|
||||
* ```
|
||||
*/
|
||||
angular.module('gettext').directive('translate', ["gettextCatalog", "$parse", "$animate", "$compile", "$window", "gettextUtil", function (gettextCatalog, $parse, $animate, $compile, $window, gettextUtil) {
|
||||
var msie = parseInt((/msie (\d+)/.exec(angular.lowercase($window.navigator.userAgent)) || [])[1], 10);
|
||||
var PARAMS_PREFIX = 'translateParams';
|
||||
|
||||
function getCtxAttr(key) {
|
||||
return gettextUtil.lcFirst(key.replace(PARAMS_PREFIX, ''));
|
||||
}
|
||||
|
||||
function handleInterpolationContext(scope, attrs, update) {
|
||||
var attributes = Object.keys(attrs).filter(function (key) {
|
||||
return gettextUtil.startsWith(key, PARAMS_PREFIX) && key !== PARAMS_PREFIX;
|
||||
});
|
||||
|
||||
if (!attributes.length) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var interpolationContext = angular.extend({}, scope);
|
||||
var unwatchers = [];
|
||||
attributes.forEach(function (attribute) {
|
||||
var unwatch = scope.$watch(attrs[attribute], function (newVal) {
|
||||
var key = getCtxAttr(attribute);
|
||||
interpolationContext[key] = newVal;
|
||||
update(interpolationContext);
|
||||
});
|
||||
unwatchers.push(unwatch);
|
||||
});
|
||||
scope.$on('$destroy', function () {
|
||||
unwatchers.forEach(function (unwatch) {
|
||||
unwatch();
|
||||
});
|
||||
});
|
||||
return interpolationContext;
|
||||
}
|
||||
|
||||
return {
|
||||
restrict: 'AE',
|
||||
terminal: true,
|
||||
compile: function compile(element, attrs) {
|
||||
// Validate attributes
|
||||
gettextUtil.assert(!attrs.translatePlural || attrs.translateN, 'translate-n', 'translate-plural');
|
||||
gettextUtil.assert(!attrs.translateN || attrs.translatePlural, 'translate-plural', 'translate-n');
|
||||
|
||||
var msgid = gettextUtil.trim(element.html());
|
||||
var translatePlural = attrs.translatePlural;
|
||||
var translateContext = attrs.translateContext;
|
||||
|
||||
if (msie <= 8) {
|
||||
// Workaround fix relating to angular adding a comment node to
|
||||
// anchors. angular/angular.js/#1949 / angular/angular.js/#2013
|
||||
if (msgid.slice(-13) === '<!--IE fix-->') {
|
||||
msgid = msgid.slice(0, -13);
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
post: function (scope, element, attrs) {
|
||||
var countFn = $parse(attrs.translateN);
|
||||
var pluralScope = null;
|
||||
var linking = true;
|
||||
|
||||
function update(interpolationContext) {
|
||||
interpolationContext = interpolationContext || null;
|
||||
|
||||
// Fetch correct translated string.
|
||||
var translated;
|
||||
if (translatePlural) {
|
||||
scope = pluralScope || (pluralScope = scope.$new());
|
||||
scope.$count = countFn(scope);
|
||||
translated = gettextCatalog.getPlural(scope.$count, msgid, translatePlural, interpolationContext, translateContext);
|
||||
} else {
|
||||
translated = gettextCatalog.getString(msgid, interpolationContext, translateContext);
|
||||
}
|
||||
var oldContents = element.contents();
|
||||
|
||||
if (!oldContents && !translated){
|
||||
return;
|
||||
}
|
||||
|
||||
// Avoid redundant swaps
|
||||
if (translated === gettextUtil.trim(oldContents.html())){
|
||||
// Take care of unlinked content
|
||||
if (linking){
|
||||
$compile(oldContents)(scope);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Swap in the translation
|
||||
var newWrapper = angular.element('<span>' + translated + '</span>');
|
||||
$compile(newWrapper.contents())(scope);
|
||||
var newContents = newWrapper.contents();
|
||||
|
||||
$animate.enter(newContents, element);
|
||||
$animate.leave(oldContents);
|
||||
}
|
||||
|
||||
var interpolationContext = handleInterpolationContext(scope, attrs, update);
|
||||
update(interpolationContext);
|
||||
linking = false;
|
||||
|
||||
if (attrs.translateN) {
|
||||
scope.$watch(attrs.translateN, function () {
|
||||
update(interpolationContext);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @ngdoc event
|
||||
* @name translate#gettextLanguageChanged
|
||||
* @eventType listen on scope
|
||||
* @description Listens for language updates and changes translation accordingly
|
||||
*/
|
||||
scope.$on('gettextLanguageChanged', function () {
|
||||
update(interpolationContext);
|
||||
});
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
}]);
|
||||
|
||||
/**
|
||||
* @ngdoc factory
|
||||
* @module gettext
|
||||
* @name gettextFallbackLanguage
|
||||
* @param {String} langCode language code
|
||||
* @returns {String|Null} fallback language
|
||||
* @description Strips regional code and returns language code only
|
||||
*
|
||||
* Example
|
||||
* ```js
|
||||
* gettextFallbackLanguage('ru'); // "null"
|
||||
* gettextFallbackLanguage('en_GB'); // "en"
|
||||
* gettextFallbackLanguage(); // null
|
||||
* ```
|
||||
*/
|
||||
angular.module("gettext").factory("gettextFallbackLanguage", function () {
|
||||
var cache = {};
|
||||
var pattern = /([^_]+)_[^_]+$/;
|
||||
|
||||
return function (langCode) {
|
||||
if (cache[langCode]) {
|
||||
return cache[langCode];
|
||||
}
|
||||
|
||||
var matches = pattern.exec(langCode);
|
||||
if (matches) {
|
||||
cache[langCode] = matches[1];
|
||||
return matches[1];
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
});
|
||||
/**
|
||||
* @ngdoc filter
|
||||
* @module gettext
|
||||
* @name translate
|
||||
* @requires gettextCatalog
|
||||
* @param {String} input translation key
|
||||
* @param {String} context context to evaluate key against
|
||||
* @returns {String} translated string or annotated key
|
||||
* @see {@link doc:context Verb, Noun}
|
||||
* @description Takes key and returns string
|
||||
*
|
||||
* Sometimes it's not an option to use an attribute (e.g. when you want to annotate an attribute value).
|
||||
* There's a `translate` filter available for this purpose.
|
||||
*
|
||||
* ```html
|
||||
* <input type="text" placeholder="{{'Username'|translate}}" />
|
||||
* ```
|
||||
* This filter does not support plural strings.
|
||||
*
|
||||
* You may want to use {@link guide:custom-annotations custom annotations} to avoid using the `translate` filter all the time. * Is
|
||||
*/
|
||||
angular.module('gettext').filter('translate', ["gettextCatalog", function (gettextCatalog) {
|
||||
function filter(input, context) {
|
||||
return gettextCatalog.getString(input, null, context);
|
||||
}
|
||||
filter.$stateful = true;
|
||||
return filter;
|
||||
}]);
|
||||
|
||||
// Do not edit this file, it is autogenerated using genplurals.py!
|
||||
angular.module("gettext").factory("gettextPlurals", function () {
|
||||
var languageCodes = {
|
||||
"pt_BR": "pt_BR",
|
||||
"pt-BR": "pt_BR"
|
||||
};
|
||||
return function (langCode, n) {
|
||||
switch (getLanguageCode(langCode)) {
|
||||
case "ay": // Aymará
|
||||
case "bo": // Tibetan
|
||||
case "cgg": // Chiga
|
||||
case "dz": // Dzongkha
|
||||
case "fa": // Persian
|
||||
case "id": // Indonesian
|
||||
case "ja": // Japanese
|
||||
case "jbo": // Lojban
|
||||
case "ka": // Georgian
|
||||
case "kk": // Kazakh
|
||||
case "km": // Khmer
|
||||
case "ko": // Korean
|
||||
case "ky": // Kyrgyz
|
||||
case "lo": // Lao
|
||||
case "ms": // Malay
|
||||
case "my": // Burmese
|
||||
case "sah": // Yakut
|
||||
case "su": // Sundanese
|
||||
case "th": // Thai
|
||||
case "tt": // Tatar
|
||||
case "ug": // Uyghur
|
||||
case "vi": // Vietnamese
|
||||
case "wo": // Wolof
|
||||
case "zh": // Chinese
|
||||
// 1 form
|
||||
return 0;
|
||||
case "is": // Icelandic
|
||||
// 2 forms
|
||||
return (n%10!=1 || n%100==11) ? 1 : 0;
|
||||
case "jv": // Javanese
|
||||
// 2 forms
|
||||
return n!=0 ? 1 : 0;
|
||||
case "mk": // Macedonian
|
||||
// 2 forms
|
||||
return n==1 || n%10==1 ? 0 : 1;
|
||||
case "ach": // Acholi
|
||||
case "ak": // Akan
|
||||
case "am": // Amharic
|
||||
case "arn": // Mapudungun
|
||||
case "br": // Breton
|
||||
case "fil": // Filipino
|
||||
case "fr": // French
|
||||
case "gun": // Gun
|
||||
case "ln": // Lingala
|
||||
case "mfe": // Mauritian Creole
|
||||
case "mg": // Malagasy
|
||||
case "mi": // Maori
|
||||
case "oc": // Occitan
|
||||
case "pt_BR": // Brazilian Portuguese
|
||||
case "tg": // Tajik
|
||||
case "ti": // Tigrinya
|
||||
case "tr": // Turkish
|
||||
case "uz": // Uzbek
|
||||
case "wa": // Walloon
|
||||
case "zh": // Chinese
|
||||
// 2 forms
|
||||
return n>1 ? 1 : 0;
|
||||
case "lv": // Latvian
|
||||
// 3 forms
|
||||
return (n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2);
|
||||
case "lt": // Lithuanian
|
||||
// 3 forms
|
||||
return (n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2);
|
||||
case "be": // Belarusian
|
||||
case "bs": // Bosnian
|
||||
case "hr": // Croatian
|
||||
case "ru": // Russian
|
||||
case "sr": // Serbian
|
||||
case "uk": // Ukrainian
|
||||
// 3 forms
|
||||
return (n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);
|
||||
case "mnk": // Mandinka
|
||||
// 3 forms
|
||||
return (n==0 ? 0 : n==1 ? 1 : 2);
|
||||
case "ro": // Romanian
|
||||
// 3 forms
|
||||
return (n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < 20)) ? 1 : 2);
|
||||
case "pl": // Polish
|
||||
// 3 forms
|
||||
return (n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);
|
||||
case "cs": // Czech
|
||||
case "sk": // Slovak
|
||||
// 3 forms
|
||||
return (n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;
|
||||
case "sl": // Slovenian
|
||||
// 4 forms
|
||||
return (n%100==1 ? 1 : n%100==2 ? 2 : n%100==3 || n%100==4 ? 3 : 0);
|
||||
case "mt": // Maltese
|
||||
// 4 forms
|
||||
return (n==1 ? 0 : n==0 || ( n%100>1 && n%100<11) ? 1 : (n%100>10 && n%100<20 ) ? 2 : 3);
|
||||
case "gd": // Scottish Gaelic
|
||||
// 4 forms
|
||||
return (n==1 || n==11) ? 0 : (n==2 || n==12) ? 1 : (n > 2 && n < 20) ? 2 : 3;
|
||||
case "cy": // Welsh
|
||||
// 4 forms
|
||||
return (n==1) ? 0 : (n==2) ? 1 : (n != 8 && n != 11) ? 2 : 3;
|
||||
case "kw": // Cornish
|
||||
// 4 forms
|
||||
return (n==1) ? 0 : (n==2) ? 1 : (n == 3) ? 2 : 3;
|
||||
case "ga": // Irish
|
||||
// 5 forms
|
||||
return n==1 ? 0 : n==2 ? 1 : n<7 ? 2 : n<11 ? 3 : 4;
|
||||
case "ar": // Arabic
|
||||
// 6 forms
|
||||
return (n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 ? 4 : 5);
|
||||
default: // Everything else
|
||||
return n != 1 ? 1 : 0;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Method extracts iso639-2 language code from code with locale e.g. pl_PL, en_US, etc.
|
||||
* If it's provided with standalone iso639-2 language code it simply returns it.
|
||||
* @param {String} langCode
|
||||
* @returns {String} iso639-2 language Code
|
||||
*/
|
||||
function getLanguageCode(langCode) {
|
||||
if (!languageCodes[langCode]) {
|
||||
languageCodes[langCode] = langCode.split(/\-|_/).shift();
|
||||
}
|
||||
return languageCodes[langCode];
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* @ngdoc factory
|
||||
* @module gettext
|
||||
* @name gettextUtil
|
||||
* @description Utility service for common operations and polyfills.
|
||||
*/
|
||||
angular.module('gettext').factory('gettextUtil', function gettextUtil() {
|
||||
/**
|
||||
* @ngdoc method
|
||||
* @name gettextUtil#trim
|
||||
* @public
|
||||
* @param {string} value String to be trimmed.
|
||||
* @description Trim polyfill for old browsers (instead of jQuery). Based on AngularJS-v1.2.2 (angular.js#620).
|
||||
*
|
||||
* Example
|
||||
* ```js
|
||||
* gettextUtil.assert(' no blanks '); // "no blanks"
|
||||
* ```
|
||||
*/
|
||||
var trim = (function () {
|
||||
if (!String.prototype.trim) {
|
||||
return function (value) {
|
||||
return (typeof value === 'string') ? value.replace(/^\s*/, '').replace(/\s*$/, '') : value;
|
||||
};
|
||||
}
|
||||
return function (value) {
|
||||
return (typeof value === 'string') ? value.trim() : value;
|
||||
};
|
||||
})();
|
||||
|
||||
/**
|
||||
* @ngdoc method
|
||||
* @name gettextUtil#assert
|
||||
* @public
|
||||
* @param {bool} condition condition to check
|
||||
* @param {String} missing name of the directive missing attribute
|
||||
* @param {String} found name of attribute that has been used with directive
|
||||
* @description Throws error if condition is not met, which means that directive was used with certain parameter
|
||||
* that requires another one (which is missing).
|
||||
*
|
||||
* Example
|
||||
* ```js
|
||||
* gettextUtil.assert(!attrs.translatePlural || attrs.translateN, 'translate-n', 'translate-plural');
|
||||
* //You should add a translate-n attribute whenever you add a translate-plural attribute.
|
||||
* ```
|
||||
*/
|
||||
function assert(condition, missing, found) {
|
||||
if (!condition) {
|
||||
throw new Error('You should add a ' + missing + ' attribute whenever you add a ' + found + ' attribute.');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @ngdoc method
|
||||
* @name gettextUtil#startsWith
|
||||
* @public
|
||||
* @param {string} target String on which checking will occur.
|
||||
* @param {string} query String expected to be at the beginning of target.
|
||||
* @returns {boolean} Returns true if object has no ownProperties. For arrays returns true if length == 0.
|
||||
* @description Checks if string starts with another string.
|
||||
*
|
||||
* Example
|
||||
* ```js
|
||||
* gettextUtil.startsWith('Home sweet home.', 'Home'); //true
|
||||
* gettextUtil.startsWith('Home sweet home.', 'sweet'); //false
|
||||
* ```
|
||||
*/
|
||||
function startsWith(target, query) {
|
||||
return target.indexOf(query) === 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @ngdoc method
|
||||
* @name gettextUtil#lcFirst
|
||||
* @public
|
||||
* @param {string} target String to transform.
|
||||
* @returns {string} Strings beginning with lowercase letter.
|
||||
* @description Makes first letter of the string lower case
|
||||
*
|
||||
* Example
|
||||
* ```js
|
||||
* gettextUtil.lcFirst('Home Sweet Home.'); //'home Sweet Home'
|
||||
* gettextUtil.lcFirst('ShouldBeCamelCase.'); //'shouldBeCamelCase'
|
||||
* ```
|
||||
*/
|
||||
function lcFirst(target) {
|
||||
var first = target.charAt(0).toLowerCase();
|
||||
return first + target.substr(1);
|
||||
}
|
||||
|
||||
return {
|
||||
trim: trim,
|
||||
assert: assert,
|
||||
startsWith: startsWith,
|
||||
lcFirst: lcFirst
|
||||
};
|
||||
});
|
1
node_modules/angular-gettext/dist/angular-gettext.min.js
generated
vendored
Normal file
45
node_modules/angular-gettext/docs/api/index.ngdoc
generated
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
@ngdoc overview
|
||||
@name angular-gettext
|
||||
@area api
|
||||
@id api-index
|
||||
@description Super-simple translation support for Angular.JS
|
||||
|
||||
## Effortless translations
|
||||
Angular-gettext let's you focus on developing your application.
|
||||
Just write everything in English and annotate which parts should be translated. The tools do the rest.
|
||||
|
||||
Marking a string as translatable is as simple as adding an attribute:
|
||||
```html
|
||||
<a href="/" translate>Home</a>
|
||||
```
|
||||
|
||||
No need to maintain translation codes or magic values, that just causes headaches!
|
||||
|
||||
## Seamless Angular.JS integration
|
||||
Translating your application doesn't mean you have to give up any of the good stuff that Angular.JS provides.
|
||||
Interpolation and everything else we love and are used to just keep on working:
|
||||
|
||||
```html
|
||||
<a href="/" translate>Hello {{name}}</a>
|
||||
```
|
||||
|
||||
And with a minified footprint of less than 4kb, you don't have to worry about the size of your application.
|
||||
Add gzip compression and it amounts to less than 1.5kb.
|
||||
|
||||
## Correct plurals in all languages
|
||||
Not every language works like English. Did you know that Polish uses three plural forms? Or that Irish uses five? No worries, `angular-gettext` handles all of this for you. Just provide a plural string where needed.
|
||||
|
||||
```html
|
||||
<span translate translate-n="msgCount" translate-plural="{{$count}} new messages">1 new message</span>
|
||||
```
|
||||
|
||||
The span above will always show a correctly pluralized message, even if the language uses wildly different pluralization rules.
|
||||
|
||||
A full list of supported languages (over 130) can be found [here](http://docs.translatehouse.org/projects/localization-guide/en/latest/l10n/pluralforms.html?id=l10n/pluralforms).
|
||||
|
||||
## Rich tool support
|
||||
The widely used [gettext](http://en.wikipedia.org/wiki/Gettext) format is used in `angular-gettext` (hence the name).
|
||||
This means you can use widely established translation tools like [Poedit](http://www.poedit.net/).
|
||||
Or you can use an online translation platform like [Pootle](http://pootle.translatehouse.org/), [Transifex](https://www.transifex.com/), or [Zanata](http://www.zanata.org/).
|
||||
|
||||
The upside of this? Non-technical users can help out by translating. Or you can use professional translation services. Better results, faster.
|
2
node_modules/angular-gettext/index.js
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
require('./dist/angular-gettext.js');
|
||||
module.exports = 'gettext';
|
83
node_modules/angular-gettext/package.json
generated
vendored
Normal file
@ -0,0 +1,83 @@
|
||||
{
|
||||
"_from": "angular-gettext",
|
||||
"_id": "angular-gettext@2.3.10",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-9xJb8aJ7dnA3wgTeNS87FE25aXw=",
|
||||
"_location": "/angular-gettext",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "tag",
|
||||
"registry": true,
|
||||
"raw": "angular-gettext",
|
||||
"name": "angular-gettext",
|
||||
"escapedName": "angular-gettext",
|
||||
"rawSpec": "",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "latest"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"#USER",
|
||||
"/"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/angular-gettext/-/angular-gettext-2.3.10.tgz",
|
||||
"_shasum": "f7125bf1a27b767037c204de352f3b144db9697c",
|
||||
"_spec": "angular-gettext",
|
||||
"_where": "/home/lrullo/httpdocs/anorgatarrak.eus/wp-content/themes/anorgatarrak",
|
||||
"author": {
|
||||
"name": "Ruben Vermeersch",
|
||||
"email": "ruben@rocketeer.be",
|
||||
"url": "http://rocketeer.be/"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/rubenv/angular-gettext/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "Gettext support for Angular.js",
|
||||
"devDependencies": {
|
||||
"chai": "^3.5.0",
|
||||
"dgeni-alive": "~0.2.1",
|
||||
"grunt": "~1.0.1",
|
||||
"grunt-bump": "0.8.0",
|
||||
"grunt-contrib-clean": "~1.0.0",
|
||||
"grunt-contrib-concat": "~1.0.0",
|
||||
"grunt-contrib-connect": "~1.0.0",
|
||||
"grunt-contrib-jshint": "~1.0.0",
|
||||
"grunt-contrib-uglify": "~1.0.0",
|
||||
"grunt-contrib-watch": "~1.0.0",
|
||||
"grunt-jscs": "^3.0.0",
|
||||
"grunt-karma": "~2.0.0",
|
||||
"grunt-ng-annotate": "^2.0.2",
|
||||
"grunt-protractor-runner": "^4.0.0",
|
||||
"grunt-shell": "^1.3.0",
|
||||
"karma": "~0.13.22",
|
||||
"karma-chai": "~0.1.0",
|
||||
"karma-firefox-launcher": "~1.0.0",
|
||||
"karma-mocha": "~1.0.1",
|
||||
"karma-phantomjs-launcher": "^1.0.0",
|
||||
"mocha": "^2.5.3",
|
||||
"phantomjs-prebuilt": "^2.1.7",
|
||||
"serve-static": "^1.11.1"
|
||||
},
|
||||
"directories": {
|
||||
"test": "test"
|
||||
},
|
||||
"homepage": "http://angular-gettext.rocketeer.be/",
|
||||
"keywords": [
|
||||
"angular",
|
||||
"gettext"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "angular-gettext",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/rubenv/angular-gettext.git"
|
||||
},
|
||||
"scripts": {
|
||||
"prepublish": "grunt build",
|
||||
"test": "grunt ci"
|
||||
},
|
||||
"title": "Angular Gettext",
|
||||
"version": "2.3.10"
|
||||
}
|
21
node_modules/angular-loading-bar/.editorconfig
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
# EditorConfig helps developers define and maintain consistent
|
||||
# coding styles between different editors and IDEs
|
||||
# editorconfig.org
|
||||
|
||||
root = true
|
||||
|
||||
|
||||
[*]
|
||||
|
||||
# Change these settings to your own preference
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
# We recommend you to keep these unchanged
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
93
node_modules/angular-loading-bar/.jshintrc
generated
vendored
Normal file
@ -0,0 +1,93 @@
|
||||
{
|
||||
"globals": {
|
||||
"angular": false
|
||||
},
|
||||
|
||||
"bitwise" : true, // Prohibit bitwise operators (&, |, ^, etc.).
|
||||
"curly" : true, // Require {} for every new block or scope.
|
||||
"eqeqeq" : true, // Require triple equals i.e. `===`.
|
||||
"forin" : true, // Tolerate `for in` loops without `hasOwnPrototype`.
|
||||
"immed" : true, // Require immediate invocations to be wrapped in parens e.g. `( function(){}() );`
|
||||
"latedef" : true, // Prohibit variable use before definition.
|
||||
"newcap" : true, // Require capitalization of all constructor functions e.g. `new F()`.
|
||||
"noarg" : true, // Prohibit use of `arguments.caller` and `arguments.callee`.
|
||||
"noempty" : true, // Prohibit use of empty blocks.
|
||||
"nonew" : true, // Prohibit use of constructors for side-effects.
|
||||
"plusplus" : false, // Prohibit use of `++` & `--`.
|
||||
"regexp" : true, // Prohibit `.` and `[^...]` in regular expressions.
|
||||
"undef" : true, // Require all non-global variables be declared before they are used.
|
||||
"strict" : false, // Require `use strict` pragma in every file.
|
||||
"trailing" : true, // Prohibit trailing whitespaces.
|
||||
|
||||
|
||||
// Relaxing options:
|
||||
"asi" : false, // Tolerate Automatic Semicolon Insertion (no semicolons).
|
||||
"boss" : false, // Tolerate assignments inside if, for & while. Usually conditions & loops are for comparison, not assignments.
|
||||
"debug" : false, // Allow debugger statements e.g. browser breakpoints.
|
||||
"eqnull" : false, // Tolerate use of `== null`.
|
||||
"es5" : false, // Allow EcmaScript 5 syntax.
|
||||
"esnext" : false, // Allow ES.next specific features such as `const` and `let`.
|
||||
"evil" : false, // Tolerate use of `eval`.
|
||||
"expr" : false, // Tolerate `ExpressionStatement` as Programs.
|
||||
"funcscope" : false, // Tolerate declarations of variables inside of control structures while accessing them later from the outside.
|
||||
"globalstrict" : false, // Allow global "use strict" (also enables 'strict').
|
||||
"iterator" : false, // Allow usage of __iterator__ property.
|
||||
"lastsemic" : false, // Tolerat missing semicolons when the it is omitted for the last statement in a one-line block.
|
||||
"laxbreak" : false, // Tolerate unsafe line breaks e.g. `return [\n] x` without semicolons.
|
||||
"laxcomma" : false, // Suppress warnings about comma-first coding style.
|
||||
"loopfunc" : false, // Allow functions to be defined within loops.
|
||||
"multistr" : false, // Tolerate multi-line strings.
|
||||
"onecase" : false, // Tolerate switches with just one case.
|
||||
"proto" : false, // Tolerate __proto__ property. This property is deprecated.
|
||||
"regexdash" : false, // Tolerate unescaped last dash i.e. `[-...]`.
|
||||
"scripturl" : false, // Tolerate script-targeted URLs.
|
||||
"smarttabs" : false, // Tolerate mixed tabs and spaces when the latter are used for alignmnent only.
|
||||
"shadow" : false, // Allows re-define variables later in code e.g. `var x=1; x=2;`.
|
||||
"sub" : false, // Tolerate all forms of subscript notation besides dot notation e.g. `dict['key']` instead of `dict.key`.
|
||||
"supernew" : false, // Tolerate `new function () { ... };` and `new Object;`.
|
||||
"validthis" : false, // Tolerate strict violations when the code is running in strict mode and you use this in a non-constructor function.
|
||||
|
||||
// == Environments ====================================================
|
||||
//
|
||||
// These options pre-define global variables that are exposed by
|
||||
// popular JavaScript libraries and runtime environments—such as
|
||||
// browser or node.js.
|
||||
|
||||
"browser" : true, // Standard browser globals e.g. `window`, `document`.
|
||||
"couch" : false, // Enable globals exposed by CouchDB.
|
||||
"devel" : false, // Allow development statements e.g. `console.log();`.
|
||||
"dojo" : false, // Enable globals exposed by Dojo Toolkit.
|
||||
"jquery" : false, // Enable globals exposed by jQuery JavaScript library.
|
||||
"mootools" : false, // Enable globals exposed by MooTools JavaScript framework.
|
||||
"node" : false, // Enable globals available when code is running inside of the NodeJS runtime environment.
|
||||
"nonstandard" : false, // Define non-standard but widely adopted globals such as escape and unescape.
|
||||
"prototypejs" : false, // Enable globals exposed by Prototype JavaScript framework.
|
||||
"rhino" : false, // Enable globals available when your code is running inside of the Rhino runtime environment.
|
||||
"wsh" : false, // Enable globals available when your code is running as a script for the Windows Script Host.
|
||||
|
||||
// == JSLint Legacy ===================================================
|
||||
//
|
||||
// These options are legacy from JSLint. Aside from bug fixes they will
|
||||
// not be improved in any way and might be removed at any point.
|
||||
|
||||
"nomen" : false, // Prohibit use of initial or trailing underbars in names.
|
||||
"onevar" : false, // Allow only one `var` statement per function.
|
||||
"passfail" : false, // Stop on first error.
|
||||
"white" : false, // Check against strict whitespace and indentation rules.
|
||||
|
||||
// == Undocumented Options ============================================
|
||||
//
|
||||
// While I've found these options in [example1][2] and [example2][3]
|
||||
// they are not described in the [JSHint Options documentation][4].
|
||||
//
|
||||
// [4]: http://www.jshint.com/options/
|
||||
|
||||
"maxerr" : 100, // Maximum errors before stopping.
|
||||
"predef" : [ // Extra globals.
|
||||
//"exampleVar",
|
||||
//"anotherCoolGlobal",
|
||||
//"iLoveDouglas"
|
||||
],
|
||||
"indent" : 2 // Specify indentation spacing
|
||||
|
||||
}
|
3
node_modules/angular-loading-bar/.npmignore
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
node_modules
|
||||
test/coverage
|
||||
bower_components
|
81
node_modules/angular-loading-bar/CHANGELOG.md
generated
vendored
Normal file
@ -0,0 +1,81 @@
|
||||
Changelog
|
||||
==========
|
||||
## 0.9.0
|
||||
- resolved issue with parentSelector when parent has no children
|
||||
([#244](https://github.com/chieffancypants/angular-loading-bar/pull/244))
|
||||
([#251](https://github.com/chieffancypants/angular-loading-bar/issues/251))
|
||||
([#239](https://github.com/chieffancypants/angular-loading-bar/issues/239))
|
||||
([#179](https://github.com/chieffancypants/angular-loading-bar/issues/179))
|
||||
- added style property to package.json
|
||||
([#271](https://github.com/chieffancypants/angular-loading-bar/pull/271))
|
||||
([#231](https://github.com/chieffancypants/angular-loading-bar/pull/231))
|
||||
- Removed duplicated property declaration in CSS
|
||||
([#226](https://github.com/chieffancypants/angular-loading-bar/pull/226))
|
||||
|
||||
|
||||
|
||||
## 0.8.0
|
||||
- auto incrementing is now configurable
|
||||
([#209](https://github.com/chieffancypants/angular-loading-bar/pull/209))
|
||||
- removed `version` from bower.json
|
||||
([#207](https://github.com/chieffancypants/angular-loading-bar/pull/207))
|
||||
- added support for webpack and browserify
|
||||
([#200](https://github.com/chieffancypants/angular-loading-bar/pull/200))
|
||||
- spinner border radius 10px -> 50%
|
||||
([#184](https://github.com/chieffancypants/angular-loading-bar/issues/184))
|
||||
|
||||
|
||||
## 0.7.1
|
||||
- Merge correct PR for broken interceptor detection ([#133](https://github.com/chieffancypants/angular-loading-bar/pull/133), [#50](https://github.com/chieffancypants/angular-loading-bar/pull/50))
|
||||
|
||||
## 0.7.0
|
||||
- Changes for animate.enter compatibility for 1.2 and 1.3 ([#170](https://github.com/chieffancypants/angular-loading-bar/pull/170))
|
||||
- Detect errors with other interceptors ([#133](https://github.com/chieffancypants/angular-loading-bar/pull/133), [#50](https://github.com/chieffancypants/angular-loading-bar/pull/50))
|
||||
- Provide more detail on response/responseError events ([#128](https://github.com/chieffancypants/angular-loading-bar/pull/128))
|
||||
- Change angular dependency in bower ([#126](https://github.com/chieffancypants/angular-loading-bar/issues/126))
|
||||
|
||||
## 0.6.0
|
||||
- Customize progress bar template: ([#111](https://github.com/chieffancypants/angular-loading-bar/pull/111))
|
||||
- Only append bar to first parent found ([#108](https://github.com/chieffancypants/angular-loading-bar/pull/108))
|
||||
|
||||
## 0.5.2:
|
||||
Fixes for Angular 1.3 breaking changes:
|
||||
- Circular dependencies: ([#98](https://github.com/chieffancypants/angular-loading-bar/issues/98)), ([#101](https://github.com/chieffancypants/angular-loading-bar/pull/101))
|
||||
- $animate no longer accepts callbacks: ([#102](https://github.com/chieffancypants/angular-loading-bar/pull/102))
|
||||
|
||||
## 0.5.1
|
||||
- Reworked cache logic to allow cache:true ([#96](https://github.com/chieffancypants/angular-loading-bar/pull/96))
|
||||
|
||||
## 0.5.0
|
||||
- Added spinner template configuration ([#82](https://github.com/chieffancypants/angular-loading-bar/pull/82))
|
||||
- $timeout was not canceled properly ([#79](https://github.com/chieffancypants/angular-loading-bar/pull/79))
|
||||
|
||||
## 0.4.3
|
||||
- update z-index to work with other css frameworks ([#69](https://github.com/chieffancypants/angular-loading-bar/pull/69))
|
||||
- ignoreLoadingBar not ignored when calculating percentage complete ([#70](https://github.com/chieffancypants/angular-loading-bar/pull/70))
|
||||
|
||||
## 0.4.2
|
||||
- Split loading bar into different modules so they can be included separately ([#46](https://github.com/chieffancypants/angular-loading-bar/issues/46))
|
||||
|
||||
## 0.4.1
|
||||
- Fix for route views defined on body where loading bar is also attached ([#56](https://github.com/chieffancypants/angular-loading-bar/issues/56))
|
||||
|
||||
## 0.4.0
|
||||
- Initial load percentage is now configurable ([#47](https://github.com/chieffancypants/angular-loading-bar/issues/47))
|
||||
- Peg graphic reworked so the loadingbar does not require CSS changes when not at the very top of the page ([#42](https://github.com/chieffancypants/angular-loading-bar/issues/42), [#45](https://github.com/chieffancypants/angular-loading-bar/issues/45), [#10](https://github.com/chieffancypants/angular-loading-bar/issues/10))
|
||||
- z-index of spinner increased to work with Bootstrap 3 z-indexes ([#53](https://github.com/chieffancypants/angular-loading-bar/issues/53))
|
||||
|
||||
## 0.3.0
|
||||
- Loading bar only appears on XHR requests with high latency ([#27](https://github.com/chieffancypants/angular-loading-bar/issues/27))
|
||||
|
||||
## 0.2.0
|
||||
- Progression bar not calculated correctly for consecutive calls within the 500ms delay ([#29](https://github.com/chieffancypants/angular-loading-bar/issues/29), [#32](https://github.com/chieffancypants/angular-loading-bar/issues/32))
|
||||
- Event broadcasts when loading (#31)
|
||||
|
||||
## 0.1.1
|
||||
- Alias chieffancypants.loadingbar to angular-loading-bar (#25, #19)
|
||||
|
||||
## 0.1.0
|
||||
- Fixed issues with Angular 1.2-rc3+
|
||||
- Ability to ignore particular XHR requests (#21)
|
||||
- Broadcasting of events (#18)
|
17
node_modules/angular-loading-bar/CONTRIBUTING.md
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
### Submitting a PR
|
||||
Excellent! You've chosen to help advance the project by either fixing a bug, or implementing a new feature. Before you put forth any work on a PR, please follow these steps:
|
||||
|
||||
1. Ensure a similar PR has not already been opened or closed.
|
||||
1. Clearly define the intent of the PR. The more detail, the more likelihood of it getting merged.
|
||||
1. Is this a feature that would benefit the **majority** of users? This is a small library, and it intends to stay that way. If you do not believe most users of the project will benefit from your work, it should probably be added in your own application.
|
||||
1. Be sure to include test cases that cover all newly introduced code. This part is essential, as any PRs without tests will be closed.
|
||||
1. Link any [issues](https://github.com/chieffancypants/angular-loading-bar/issues) that are addressed by the PR.
|
||||
|
||||
### Submitting a bug report
|
||||
If you believe you've found a bug in the source code, and are unable to fix it yourself (by submitting a PR) please follow these steps:
|
||||
|
||||
1. Ensure the bug has not already been reported by searching the [issues](https://github.com/chieffancypants/angular-loading-bar/issues)
|
||||
1. Submit a reduced test case that clearly demonstrates the bug. This means submitting a plunker or jsfiddle with the bare minimum of code necessary to reproduce the bug. Without this, your issue may be closed as invalid.
|
||||
1. Include any relevant browser information
|
||||
1. If you're unable to fix this bug yourself, but can point to why it is occuring, please send that information along (line# or commit)
|
||||
|
102
node_modules/angular-loading-bar/Gruntfile.js
generated
vendored
Normal file
@ -0,0 +1,102 @@
|
||||
/*global module:false*/
|
||||
module.exports = function(grunt) {
|
||||
|
||||
grunt.initConfig({
|
||||
|
||||
// Metadata.
|
||||
pkg: grunt.file.readJSON('package.json'),
|
||||
banner: '/*! \n * <%= pkg.title || pkg.name %> v<%= pkg.version %>\n' +
|
||||
' * <%= pkg.homepage %>\n' +
|
||||
' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' +
|
||||
' * License: <%= pkg.license %>\n' +
|
||||
' */\n',
|
||||
|
||||
// Task configuration.
|
||||
uglify: {
|
||||
options: {
|
||||
banner: '<%= banner %>',
|
||||
report: 'gzip'
|
||||
},
|
||||
build: {
|
||||
src: 'src/loading-bar.js',
|
||||
dest: 'build/loading-bar.min.js'
|
||||
}
|
||||
},
|
||||
|
||||
cssmin: {
|
||||
options: {
|
||||
banner: '<%= banner %>',
|
||||
report: 'gzip'
|
||||
},
|
||||
minify: {
|
||||
src: 'src/loading-bar.css',
|
||||
dest: 'build/loading-bar.min.css'
|
||||
}
|
||||
},
|
||||
|
||||
karma: {
|
||||
unit: {
|
||||
configFile: 'test/karma-angular-1.2.conf.js',
|
||||
singleRun: true,
|
||||
coverageReporter: {
|
||||
type: 'text',
|
||||
dir: 'coverage/'
|
||||
}
|
||||
},
|
||||
unit13: {
|
||||
configFile: 'test/karma-angular-1.3.conf.js',
|
||||
singleRun: true,
|
||||
coverageReporter: {
|
||||
type: 'text',
|
||||
dir: 'coverage/'
|
||||
}
|
||||
},
|
||||
unit14: {
|
||||
configFile: 'test/karma-angular-1.4.conf.js',
|
||||
singleRun: true,
|
||||
coverageReporter: {
|
||||
type: 'text',
|
||||
dir: 'coverage/'
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
configFile: 'test/karma-angular-1.2.conf.js',
|
||||
singleRun: false,
|
||||
reporters: ['progress'] // Don't display coverage
|
||||
}
|
||||
},
|
||||
|
||||
jshint: {
|
||||
jshintrc: '.jshintrc',
|
||||
gruntfile: {
|
||||
src: 'Gruntfile.js'
|
||||
},
|
||||
src: {
|
||||
src: ['src/*.js']
|
||||
}
|
||||
},
|
||||
|
||||
concat: {
|
||||
build: {
|
||||
options: {
|
||||
banner: '<%= banner %>'
|
||||
},
|
||||
files: {
|
||||
'build/loading-bar.css': 'src/loading-bar.css',
|
||||
'build/loading-bar.js': 'src/loading-bar.js',
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
grunt.loadNpmTasks('grunt-contrib-uglify');
|
||||
grunt.loadNpmTasks('grunt-contrib-jshint');
|
||||
grunt.loadNpmTasks('grunt-contrib-cssmin');
|
||||
grunt.loadNpmTasks('grunt-contrib-concat');
|
||||
grunt.loadNpmTasks('grunt-karma');
|
||||
|
||||
grunt.registerTask('default', ['jshint', 'karma:unit', 'karma:unit13', 'karma:unit14', 'uglify', 'cssmin', 'concat:build']);
|
||||
grunt.registerTask('test', ['karma:watch']);
|
||||
grunt.registerTask('build', ['default']);
|
||||
|
||||
};
|
14
node_modules/angular-loading-bar/ISSUE_TEMPLATE.md
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
#### Description of bug:
|
||||
|
||||
|
||||
#### Expected result:
|
||||
|
||||
|
||||
#### Actual result:
|
||||
|
||||
|
||||
#### Browsers affected:
|
||||
|
||||
|
||||
#### URL of reduced test case:
|
||||
|
20
node_modules/angular-loading-bar/LICENSE
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2013-2014 Wes Cruver
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
13
node_modules/angular-loading-bar/PULL_REQUEST_TEMPLATE.md
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
#### Summary:
|
||||
|
||||
Provide a general description of the code changes in your pull
|
||||
request. If bugs were fixed, please document the changes and why
|
||||
they were introduced.
|
||||
|
||||
Please ensure that your PR contains test cases that cover all new
|
||||
code and any changes to existing code. Without tests, your PR is
|
||||
likely to be closed without merging.
|
||||
|
||||
#### Related issues:
|
||||
Please review the [issues](https://github.com/chieffancypants/angular-loading-bar/issues)
|
||||
page, and link any issues that are addressed or related to this PR.
|
190
node_modules/angular-loading-bar/README.md
generated
vendored
Normal file
@ -0,0 +1,190 @@
|
||||
angular-loading-bar
|
||||
===================
|
||||
|
||||
The idea is simple: Add a loading bar / progress bar whenever an XHR request goes out in angular. Multiple requests within the same time period get bundled together such that each response increments the progress bar by the appropriate amount.
|
||||
|
||||
This is mostly cool because you simply include it in your app, and it works. There's no complicated setup, and no need to maintain the state of the loading bar; it's all handled automatically by the interceptor.
|
||||
|
||||
**Requirements:** AngularJS 1.2+
|
||||
|
||||
**File Size:** 2.4Kb minified, 0.5Kb gzipped
|
||||
|
||||
|
||||
## Usage:
|
||||
|
||||
1. include the loading bar as a dependency for your app. If you want animations, include `ngAnimate` as well. *note: ngAnimate is optional*
|
||||
|
||||
```js
|
||||
angular.module('myApp', ['angular-loading-bar', 'ngAnimate'])
|
||||
```
|
||||
|
||||
2. include the supplied JS and CSS file (or create your own CSS to override defaults).
|
||||
|
||||
```html
|
||||
<link rel='stylesheet' href='build/loading-bar.min.css' type='text/css' media='all' />
|
||||
<script type='text/javascript' src='build/loading-bar.min.js'></script>
|
||||
```
|
||||
|
||||
3. That's it -- you're done!
|
||||
|
||||
#### via bower:
|
||||
```
|
||||
$ bower install angular-loading-bar
|
||||
```
|
||||
#### via npm:
|
||||
```
|
||||
$ npm install angular-loading-bar
|
||||
```
|
||||
|
||||
#### via CDN:
|
||||
```html
|
||||
<link rel='stylesheet' href='//cdnjs.cloudflare.com/ajax/libs/angular-loading-bar/0.7.1/loading-bar.min.css' type='text/css' media='all' />
|
||||
<script type='text/javascript' src='//cdnjs.cloudflare.com/ajax/libs/angular-loading-bar/0.7.1/loading-bar.min.js'></script>
|
||||
```
|
||||
|
||||
## Why I created this
|
||||
There are a couple projects similar to this out there, but none were ideal for me. All implementations I've seen require that you maintain state on behalf of the loading bar. In other words, you're setting the value of the loading/progress bar manually from potentially many different locations. This becomes complicated when you have a very large application with several services all making independent XHR requests. It becomes even more complicated if you want these services to be loosly coupled.
|
||||
|
||||
Additionally, Angular was created as a highly testable framework, so it pains me to see Angular modules without tests. That is not the case here as this loading bar ships with 100% code coverage.
|
||||
|
||||
|
||||
**Goals for this project:**
|
||||
|
||||
1. Make it automatic
|
||||
2. Unit tests, 100% coverage
|
||||
3. Must work well with ngAnimate
|
||||
4. Must be styled via external CSS (not inline)
|
||||
5. No jQuery dependencies
|
||||
|
||||
|
||||
## Configuration
|
||||
|
||||
#### Turn the spinner on or off:
|
||||
The insertion of the spinner can be controlled through configuration. It's on by default, but if you'd like to turn it off, simply configure the service:
|
||||
|
||||
```js
|
||||
angular.module('myApp', ['angular-loading-bar'])
|
||||
.config(['cfpLoadingBarProvider', function(cfpLoadingBarProvider) {
|
||||
cfpLoadingBarProvider.includeSpinner = false;
|
||||
}])
|
||||
```
|
||||
|
||||
#### Turn the loading bar on or off:
|
||||
Like the spinner configuration above, the loading bar can also be turned off for cases where you only want the spinner:
|
||||
|
||||
```js
|
||||
angular.module('myApp', ['angular-loading-bar'])
|
||||
.config(['cfpLoadingBarProvider', function(cfpLoadingBarProvider) {
|
||||
cfpLoadingBarProvider.includeBar = false;
|
||||
}])
|
||||
```
|
||||
|
||||
#### Customize the template:
|
||||
If you'd like to replace the default HTML template you can configure it by providing inline HTML as a string:
|
||||
|
||||
```js
|
||||
angular.module('myApp', ['angular-loading-bar'])
|
||||
.config(['cfpLoadingBarProvider', function(cfpLoadingBarProvider) {
|
||||
cfpLoadingBarProvider.spinnerTemplate = '<div><span class="fa fa-spinner">Loading...</div>';
|
||||
}])
|
||||
```
|
||||
|
||||
#### Latency Threshold
|
||||
By default, the loading bar will only display after it has been waiting for a response for over 100ms. This helps keep things feeling snappy, and avoids the annoyingness of showing a loading bar every few seconds on really chatty applications. This threshold is totally configurable:
|
||||
|
||||
```js
|
||||
angular.module('myApp', ['angular-loading-bar'])
|
||||
.config(['cfpLoadingBarProvider', function(cfpLoadingBarProvider) {
|
||||
cfpLoadingBarProvider.latencyThreshold = 500;
|
||||
}])
|
||||
```
|
||||
|
||||
#### Ignoring particular XHR requests:
|
||||
The loading bar can also be forced to ignore certain requests, for example, when long-polling or periodically sending debugging information back to the server.
|
||||
|
||||
```js
|
||||
// ignore a particular $http GET:
|
||||
$http.get('/status', {
|
||||
ignoreLoadingBar: true
|
||||
});
|
||||
|
||||
// ignore a particular $http POST. Note: POST and GET have different
|
||||
// method signatures:
|
||||
$http.post('/save', data, {
|
||||
ignoreLoadingBar: true
|
||||
});
|
||||
|
||||
```
|
||||
|
||||
|
||||
```js
|
||||
// ignore particular $resource requests:
|
||||
.factory('Restaurant', function($resource) {
|
||||
return $resource('/api/restaurant/:id', {id: '@id'}, {
|
||||
query: {
|
||||
method: 'GET',
|
||||
isArray: true,
|
||||
ignoreLoadingBar: true
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
## How it works:
|
||||
This library is split into two modules, an $http `interceptor`, and a `service`:
|
||||
|
||||
**Interceptor**
|
||||
The interceptor simply listens for all outgoing XHR requests, and then instructs the loadingBar service to start, stop, and increment accordingly. There is no public API for the interceptor. It can be used stand-alone by including `cfp.loadingBarInterceptor` as a dependency for your module.
|
||||
|
||||
**Service**
|
||||
The service is responsible for the presentation of the loading bar. It injects the loading bar into the DOM, adjusts the width whenever `set()` is called, and `complete()`s the whole show by removing the loading bar from the DOM.
|
||||
|
||||
## Service API (advanced usage)
|
||||
Under normal circumstances you won't need to use this. However, if you wish to use the loading bar without the interceptor, you can do that as well. Simply include the loading bar service as a dependency instead of the main `angular-loading-bar` module:
|
||||
|
||||
```js
|
||||
angular.module('myApp', ['cfp.loadingBar'])
|
||||
```
|
||||
|
||||
|
||||
```js
|
||||
|
||||
cfpLoadingBar.start();
|
||||
// will insert the loading bar into the DOM, and display its progress at 1%.
|
||||
// It will automatically call `inc()` repeatedly to give the illusion that the page load is progressing.
|
||||
|
||||
cfpLoadingBar.inc();
|
||||
// increments the loading bar by a random amount.
|
||||
// It is important to note that the auto incrementing will begin to slow down as
|
||||
// the progress increases. This is to prevent the loading bar from appearing
|
||||
// completed (or almost complete) before the XHR request has responded.
|
||||
|
||||
cfpLoadingBar.set(0.3) // Set the loading bar to 30%
|
||||
cfpLoadingBar.status() // Returns the loading bar's progress.
|
||||
// -> 0.3
|
||||
|
||||
cfpLoadingBar.complete()
|
||||
// Set the loading bar's progress to 100%, and then remove it from the DOM.
|
||||
|
||||
```
|
||||
|
||||
## Events
|
||||
The loading bar broadcasts the following events over $rootScope allowing further customization:
|
||||
|
||||
**`cfpLoadingBar:loading`** triggered upon each XHR request that is not already cached
|
||||
|
||||
**`cfpLoadingBar:loaded`** triggered each time an XHR request recieves a response (either successful or error)
|
||||
|
||||
**`cfpLoadingBar:started`** triggered once upon the first XHR request. Will trigger again if another request goes out after `cfpLoadingBar:completed` has triggered.
|
||||
|
||||
**`cfpLoadingBar:completed`** triggered once when the all XHR requests have returned (either successfully or not)
|
||||
|
||||
## Credits:
|
||||
Credit goes to [rstacruz](https://github.com/rstacruz) for his excellent [nProgress](https://github.com/rstacruz/nprogress).
|
||||
|
||||
## License:
|
||||
Licensed under the MIT license
|
31
node_modules/angular-loading-bar/bower.json
generated
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
{
|
||||
"name": "angular-loading-bar",
|
||||
"main": [
|
||||
"build/loading-bar.js",
|
||||
"build/loading-bar.css"
|
||||
],
|
||||
"ignore": [
|
||||
"**/.*",
|
||||
"node_modules",
|
||||
"components",
|
||||
"test",
|
||||
"example"
|
||||
],
|
||||
"dependencies": {
|
||||
"angular": "^1.2.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
"angular": "~1.2.23",
|
||||
"angular-1.3": "angular#1.3",
|
||||
"angular-1.4": "angular#1.4",
|
||||
"angular-mocks": "~1.2.9",
|
||||
"angular-mocks-1.3": "angular-mocks#1.3",
|
||||
"angular-mocks-1.4": "angular-mocks#1.4",
|
||||
"angular-animate": "~1.2.9",
|
||||
"angular-animate-1.3": "angular-animate#1.3",
|
||||
"angular-animate-1.4": "angular-animate#1.4"
|
||||
},
|
||||
"resolutions": {
|
||||
"angular": "~1.2.23"
|
||||
}
|
||||
}
|
110
node_modules/angular-loading-bar/build/loading-bar.css
generated
vendored
Normal file
@ -0,0 +1,110 @@
|
||||
/*!
|
||||
* angular-loading-bar v0.9.0
|
||||
* https://chieffancypants.github.io/angular-loading-bar
|
||||
* Copyright (c) 2016 Wes Cruver
|
||||
* License: MIT
|
||||
*/
|
||||
|
||||
/* Make clicks pass-through */
|
||||
#loading-bar,
|
||||
#loading-bar-spinner {
|
||||
pointer-events: none;
|
||||
-webkit-pointer-events: none;
|
||||
-webkit-transition: 350ms linear all;
|
||||
-moz-transition: 350ms linear all;
|
||||
-o-transition: 350ms linear all;
|
||||
transition: 350ms linear all;
|
||||
}
|
||||
|
||||
#loading-bar.ng-enter,
|
||||
#loading-bar.ng-leave.ng-leave-active,
|
||||
#loading-bar-spinner.ng-enter,
|
||||
#loading-bar-spinner.ng-leave.ng-leave-active {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
#loading-bar.ng-enter.ng-enter-active,
|
||||
#loading-bar.ng-leave,
|
||||
#loading-bar-spinner.ng-enter.ng-enter-active,
|
||||
#loading-bar-spinner.ng-leave {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
#loading-bar .bar {
|
||||
-webkit-transition: width 350ms;
|
||||
-moz-transition: width 350ms;
|
||||
-o-transition: width 350ms;
|
||||
transition: width 350ms;
|
||||
|
||||
background: #29d;
|
||||
position: fixed;
|
||||
z-index: 10002;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 2px;
|
||||
border-bottom-right-radius: 1px;
|
||||
border-top-right-radius: 1px;
|
||||
}
|
||||
|
||||
/* Fancy blur effect */
|
||||
#loading-bar .peg {
|
||||
position: absolute;
|
||||
width: 70px;
|
||||
right: 0;
|
||||
top: 0;
|
||||
height: 2px;
|
||||
opacity: .45;
|
||||
-moz-box-shadow: #29d 1px 0 6px 1px;
|
||||
-ms-box-shadow: #29d 1px 0 6px 1px;
|
||||
-webkit-box-shadow: #29d 1px 0 6px 1px;
|
||||
box-shadow: #29d 1px 0 6px 1px;
|
||||
-moz-border-radius: 100%;
|
||||
-webkit-border-radius: 100%;
|
||||
border-radius: 100%;
|
||||
}
|
||||
|
||||
#loading-bar-spinner {
|
||||
display: block;
|
||||
position: fixed;
|
||||
z-index: 10002;
|
||||
top: 10px;
|
||||
left: 10px;
|
||||
}
|
||||
|
||||
#loading-bar-spinner .spinner-icon {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
|
||||
border: solid 2px transparent;
|
||||
border-top-color: #29d;
|
||||
border-left-color: #29d;
|
||||
border-radius: 50%;
|
||||
|
||||
-webkit-animation: loading-bar-spinner 400ms linear infinite;
|
||||
-moz-animation: loading-bar-spinner 400ms linear infinite;
|
||||
-ms-animation: loading-bar-spinner 400ms linear infinite;
|
||||
-o-animation: loading-bar-spinner 400ms linear infinite;
|
||||
animation: loading-bar-spinner 400ms linear infinite;
|
||||
}
|
||||
|
||||
@-webkit-keyframes loading-bar-spinner {
|
||||
0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); }
|
||||
100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
|
||||
}
|
||||
@-moz-keyframes loading-bar-spinner {
|
||||
0% { -moz-transform: rotate(0deg); transform: rotate(0deg); }
|
||||
100% { -moz-transform: rotate(360deg); transform: rotate(360deg); }
|
||||
}
|
||||
@-o-keyframes loading-bar-spinner {
|
||||
0% { -o-transform: rotate(0deg); transform: rotate(0deg); }
|
||||
100% { -o-transform: rotate(360deg); transform: rotate(360deg); }
|
||||
}
|
||||
@-ms-keyframes loading-bar-spinner {
|
||||
0% { -ms-transform: rotate(0deg); transform: rotate(0deg); }
|
||||
100% { -ms-transform: rotate(360deg); transform: rotate(360deg); }
|
||||
}
|
||||
@keyframes loading-bar-spinner {
|
||||
0% { transform: rotate(0deg); }
|
||||
100% { transform: rotate(360deg); }
|
||||
}
|
341
node_modules/angular-loading-bar/build/loading-bar.js
generated
vendored
Normal file
@ -0,0 +1,341 @@
|
||||
/*!
|
||||
* angular-loading-bar v0.9.0
|
||||
* https://chieffancypants.github.io/angular-loading-bar
|
||||
* Copyright (c) 2016 Wes Cruver
|
||||
* License: MIT
|
||||
*/
|
||||
/*
|
||||
* angular-loading-bar
|
||||
*
|
||||
* intercepts XHR requests and creates a loading bar.
|
||||
* Based on the excellent nprogress work by rstacruz (more info in readme)
|
||||
*
|
||||
* (c) 2013 Wes Cruver
|
||||
* License: MIT
|
||||
*/
|
||||
|
||||
|
||||
(function() {
|
||||
|
||||
'use strict';
|
||||
|
||||
// Alias the loading bar for various backwards compatibilities since the project has matured:
|
||||
angular.module('angular-loading-bar', ['cfp.loadingBarInterceptor']);
|
||||
angular.module('chieffancypants.loadingBar', ['cfp.loadingBarInterceptor']);
|
||||
|
||||
|
||||
/**
|
||||
* loadingBarInterceptor service
|
||||
*
|
||||
* Registers itself as an Angular interceptor and listens for XHR requests.
|
||||
*/
|
||||
angular.module('cfp.loadingBarInterceptor', ['cfp.loadingBar'])
|
||||
.config(['$httpProvider', function ($httpProvider) {
|
||||
|
||||
var interceptor = ['$q', '$cacheFactory', '$timeout', '$rootScope', '$log', 'cfpLoadingBar', function ($q, $cacheFactory, $timeout, $rootScope, $log, cfpLoadingBar) {
|
||||
|
||||
/**
|
||||
* The total number of requests made
|
||||
*/
|
||||
var reqsTotal = 0;
|
||||
|
||||
/**
|
||||
* The number of requests completed (either successfully or not)
|
||||
*/
|
||||
var reqsCompleted = 0;
|
||||
|
||||
/**
|
||||
* The amount of time spent fetching before showing the loading bar
|
||||
*/
|
||||
var latencyThreshold = cfpLoadingBar.latencyThreshold;
|
||||
|
||||
/**
|
||||
* $timeout handle for latencyThreshold
|
||||
*/
|
||||
var startTimeout;
|
||||
|
||||
|
||||
/**
|
||||
* calls cfpLoadingBar.complete() which removes the
|
||||
* loading bar from the DOM.
|
||||
*/
|
||||
function setComplete() {
|
||||
$timeout.cancel(startTimeout);
|
||||
cfpLoadingBar.complete();
|
||||
reqsCompleted = 0;
|
||||
reqsTotal = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the response has already been cached
|
||||
* @param {Object} config the config option from the request
|
||||
* @return {Boolean} retrns true if cached, otherwise false
|
||||
*/
|
||||
function isCached(config) {
|
||||
var cache;
|
||||
var defaultCache = $cacheFactory.get('$http');
|
||||
var defaults = $httpProvider.defaults;
|
||||
|
||||
// Choose the proper cache source. Borrowed from angular: $http service
|
||||
if ((config.cache || defaults.cache) && config.cache !== false &&
|
||||
(config.method === 'GET' || config.method === 'JSONP')) {
|
||||
cache = angular.isObject(config.cache) ? config.cache
|
||||
: angular.isObject(defaults.cache) ? defaults.cache
|
||||
: defaultCache;
|
||||
}
|
||||
|
||||
var cached = cache !== undefined ?
|
||||
cache.get(config.url) !== undefined : false;
|
||||
|
||||
if (config.cached !== undefined && cached !== config.cached) {
|
||||
return config.cached;
|
||||
}
|
||||
config.cached = cached;
|
||||
return cached;
|
||||
}
|
||||
|
||||
|
||||
return {
|
||||
'request': function(config) {
|
||||
// Check to make sure this request hasn't already been cached and that
|
||||
// the requester didn't explicitly ask us to ignore this request:
|
||||
if (!config.ignoreLoadingBar && !isCached(config)) {
|
||||
$rootScope.$broadcast('cfpLoadingBar:loading', {url: config.url});
|
||||
if (reqsTotal === 0) {
|
||||
startTimeout = $timeout(function() {
|
||||
cfpLoadingBar.start();
|
||||
}, latencyThreshold);
|
||||
}
|
||||
reqsTotal++;
|
||||
cfpLoadingBar.set(reqsCompleted / reqsTotal);
|
||||
}
|
||||
return config;
|
||||
},
|
||||
|
||||
'response': function(response) {
|
||||
if (!response || !response.config) {
|
||||
$log.error('Broken interceptor detected: Config object not supplied in response:\n https://github.com/chieffancypants/angular-loading-bar/pull/50');
|
||||
return response;
|
||||
}
|
||||
|
||||
if (!response.config.ignoreLoadingBar && !isCached(response.config)) {
|
||||
reqsCompleted++;
|
||||
$rootScope.$broadcast('cfpLoadingBar:loaded', {url: response.config.url, result: response});
|
||||
if (reqsCompleted >= reqsTotal) {
|
||||
setComplete();
|
||||
} else {
|
||||
cfpLoadingBar.set(reqsCompleted / reqsTotal);
|
||||
}
|
||||
}
|
||||
return response;
|
||||
},
|
||||
|
||||
'responseError': function(rejection) {
|
||||
if (!rejection || !rejection.config) {
|
||||
$log.error('Broken interceptor detected: Config object not supplied in rejection:\n https://github.com/chieffancypants/angular-loading-bar/pull/50');
|
||||
return $q.reject(rejection);
|
||||
}
|
||||
|
||||
if (!rejection.config.ignoreLoadingBar && !isCached(rejection.config)) {
|
||||
reqsCompleted++;
|
||||
$rootScope.$broadcast('cfpLoadingBar:loaded', {url: rejection.config.url, result: rejection});
|
||||
if (reqsCompleted >= reqsTotal) {
|
||||
setComplete();
|
||||
} else {
|
||||
cfpLoadingBar.set(reqsCompleted / reqsTotal);
|
||||
}
|
||||
}
|
||||
return $q.reject(rejection);
|
||||
}
|
||||
};
|
||||
}];
|
||||
|
||||
$httpProvider.interceptors.push(interceptor);
|
||||
}]);
|
||||
|
||||
|
||||
/**
|
||||
* Loading Bar
|
||||
*
|
||||
* This service handles adding and removing the actual element in the DOM.
|
||||
* Generally, best practices for DOM manipulation is to take place in a
|
||||
* directive, but because the element itself is injected in the DOM only upon
|
||||
* XHR requests, and it's likely needed on every view, the best option is to
|
||||
* use a service.
|
||||
*/
|
||||
angular.module('cfp.loadingBar', [])
|
||||
.provider('cfpLoadingBar', function() {
|
||||
|
||||
this.autoIncrement = true;
|
||||
this.includeSpinner = true;
|
||||
this.includeBar = true;
|
||||
this.latencyThreshold = 100;
|
||||
this.startSize = 0.02;
|
||||
this.parentSelector = 'body';
|
||||
this.spinnerTemplate = '<div id="loading-bar-spinner"><div class="spinner-icon"></div></div>';
|
||||
this.loadingBarTemplate = '<div id="loading-bar"><div class="bar"><div class="peg"></div></div></div>';
|
||||
|
||||
this.$get = ['$injector', '$document', '$timeout', '$rootScope', function ($injector, $document, $timeout, $rootScope) {
|
||||
var $animate;
|
||||
var $parentSelector = this.parentSelector,
|
||||
loadingBarContainer = angular.element(this.loadingBarTemplate),
|
||||
loadingBar = loadingBarContainer.find('div').eq(0),
|
||||
spinner = angular.element(this.spinnerTemplate);
|
||||
|
||||
var incTimeout,
|
||||
completeTimeout,
|
||||
started = false,
|
||||
status = 0;
|
||||
|
||||
var autoIncrement = this.autoIncrement;
|
||||
var includeSpinner = this.includeSpinner;
|
||||
var includeBar = this.includeBar;
|
||||
var startSize = this.startSize;
|
||||
|
||||
/**
|
||||
* Inserts the loading bar element into the dom, and sets it to 2%
|
||||
*/
|
||||
function _start() {
|
||||
if (!$animate) {
|
||||
$animate = $injector.get('$animate');
|
||||
}
|
||||
|
||||
$timeout.cancel(completeTimeout);
|
||||
|
||||
// do not continually broadcast the started event:
|
||||
if (started) {
|
||||
return;
|
||||
}
|
||||
|
||||
var document = $document[0];
|
||||
var parent = document.querySelector ?
|
||||
document.querySelector($parentSelector)
|
||||
: $document.find($parentSelector)[0]
|
||||
;
|
||||
|
||||
if (! parent) {
|
||||
parent = document.getElementsByTagName('body')[0];
|
||||
}
|
||||
|
||||
var $parent = angular.element(parent);
|
||||
var $after = parent.lastChild && angular.element(parent.lastChild);
|
||||
|
||||
$rootScope.$broadcast('cfpLoadingBar:started');
|
||||
started = true;
|
||||
|
||||
if (includeBar) {
|
||||
$animate.enter(loadingBarContainer, $parent, $after);
|
||||
}
|
||||
|
||||
if (includeSpinner) {
|
||||
$animate.enter(spinner, $parent, loadingBarContainer);
|
||||
}
|
||||
|
||||
_set(startSize);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the loading bar's width to a certain percent.
|
||||
*
|
||||
* @param n any value between 0 and 1
|
||||
*/
|
||||
function _set(n) {
|
||||
if (!started) {
|
||||
return;
|
||||
}
|
||||
var pct = (n * 100) + '%';
|
||||
loadingBar.css('width', pct);
|
||||
status = n;
|
||||
|
||||
// increment loadingbar to give the illusion that there is always
|
||||
// progress but make sure to cancel the previous timeouts so we don't
|
||||
// have multiple incs running at the same time.
|
||||
if (autoIncrement) {
|
||||
$timeout.cancel(incTimeout);
|
||||
incTimeout = $timeout(function() {
|
||||
_inc();
|
||||
}, 250);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Increments the loading bar by a random amount
|
||||
* but slows down as it progresses
|
||||
*/
|
||||
function _inc() {
|
||||
if (_status() >= 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
var rnd = 0;
|
||||
|
||||
// TODO: do this mathmatically instead of through conditions
|
||||
|
||||
var stat = _status();
|
||||
if (stat >= 0 && stat < 0.25) {
|
||||
// Start out between 3 - 6% increments
|
||||
rnd = (Math.random() * (5 - 3 + 1) + 3) / 100;
|
||||
} else if (stat >= 0.25 && stat < 0.65) {
|
||||
// increment between 0 - 3%
|
||||
rnd = (Math.random() * 3) / 100;
|
||||
} else if (stat >= 0.65 && stat < 0.9) {
|
||||
// increment between 0 - 2%
|
||||
rnd = (Math.random() * 2) / 100;
|
||||
} else if (stat >= 0.9 && stat < 0.99) {
|
||||
// finally, increment it .5 %
|
||||
rnd = 0.005;
|
||||
} else {
|
||||
// after 99%, don't increment:
|
||||
rnd = 0;
|
||||
}
|
||||
|
||||
var pct = _status() + rnd;
|
||||
_set(pct);
|
||||
}
|
||||
|
||||
function _status() {
|
||||
return status;
|
||||
}
|
||||
|
||||
function _completeAnimation() {
|
||||
status = 0;
|
||||
started = false;
|
||||
}
|
||||
|
||||
function _complete() {
|
||||
if (!$animate) {
|
||||
$animate = $injector.get('$animate');
|
||||
}
|
||||
|
||||
$rootScope.$broadcast('cfpLoadingBar:completed');
|
||||
_set(1);
|
||||
|
||||
$timeout.cancel(completeTimeout);
|
||||
|
||||
// Attempt to aggregate any start/complete calls within 500ms:
|
||||
completeTimeout = $timeout(function() {
|
||||
var promise = $animate.leave(loadingBarContainer, _completeAnimation);
|
||||
if (promise && promise.then) {
|
||||
promise.then(_completeAnimation);
|
||||
}
|
||||
$animate.leave(spinner);
|
||||
}, 500);
|
||||
}
|
||||
|
||||
return {
|
||||
start : _start,
|
||||
set : _set,
|
||||
status : _status,
|
||||
inc : _inc,
|
||||
complete : _complete,
|
||||
autoIncrement : this.autoIncrement,
|
||||
includeSpinner : this.includeSpinner,
|
||||
latencyThreshold : this.latencyThreshold,
|
||||
parentSelector : this.parentSelector,
|
||||
startSize : this.startSize
|
||||
};
|
||||
|
||||
|
||||
}]; //
|
||||
}); // wtf javascript. srsly
|
||||
})(); //
|
1
node_modules/angular-loading-bar/build/loading-bar.min.css
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
#loading-bar,#loading-bar-spinner{pointer-events:none;-webkit-pointer-events:none;-webkit-transition:350ms linear all;-moz-transition:350ms linear all;-o-transition:350ms linear all;transition:350ms linear all}#loading-bar-spinner.ng-enter,#loading-bar-spinner.ng-leave.ng-leave-active,#loading-bar.ng-enter,#loading-bar.ng-leave.ng-leave-active{opacity:0}#loading-bar-spinner.ng-enter.ng-enter-active,#loading-bar-spinner.ng-leave,#loading-bar.ng-enter.ng-enter-active,#loading-bar.ng-leave{opacity:1}#loading-bar .bar{-webkit-transition:width 350ms;-moz-transition:width 350ms;-o-transition:width 350ms;transition:width 350ms;background:#29d;position:fixed;z-index:10002;top:0;left:0;width:100%;height:2px;border-bottom-right-radius:1px;border-top-right-radius:1px}#loading-bar .peg{position:absolute;width:70px;right:0;top:0;height:2px;opacity:.45;-moz-box-shadow:#29d 1px 0 6px 1px;-ms-box-shadow:#29d 1px 0 6px 1px;-webkit-box-shadow:#29d 1px 0 6px 1px;box-shadow:#29d 1px 0 6px 1px;-moz-border-radius:100%;-webkit-border-radius:100%;border-radius:100%}#loading-bar-spinner{display:block;position:fixed;z-index:10002;top:10px;left:10px}#loading-bar-spinner .spinner-icon{width:14px;height:14px;border:2px solid transparent;border-top-color:#29d;border-left-color:#29d;border-radius:50%;-webkit-animation:loading-bar-spinner 400ms linear infinite;-moz-animation:loading-bar-spinner 400ms linear infinite;-ms-animation:loading-bar-spinner 400ms linear infinite;-o-animation:loading-bar-spinner 400ms linear infinite;animation:loading-bar-spinner 400ms linear infinite}@-webkit-keyframes loading-bar-spinner{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-moz-keyframes loading-bar-spinner{0%{-moz-transform:rotate(0);transform:rotate(0)}100%{-moz-transform:rotate(360deg);transform:rotate(360deg)}}@-o-keyframes loading-bar-spinner{0%{-o-transform:rotate(0);transform:rotate(0)}100%{-o-transform:rotate(360deg);transform:rotate(360deg)}}@-ms-keyframes loading-bar-spinner{0%{-ms-transform:rotate(0);transform:rotate(0)}100%{-ms-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes loading-bar-spinner{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}
|
7
node_modules/angular-loading-bar/build/loading-bar.min.js
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
/*!
|
||||
* angular-loading-bar v0.9.0
|
||||
* https://chieffancypants.github.io/angular-loading-bar
|
||||
* Copyright (c) 2016 Wes Cruver
|
||||
* License: MIT
|
||||
*/
|
||||
!function(){"use strict";angular.module("angular-loading-bar",["cfp.loadingBarInterceptor"]),angular.module("chieffancypants.loadingBar",["cfp.loadingBarInterceptor"]),angular.module("cfp.loadingBarInterceptor",["cfp.loadingBar"]).config(["$httpProvider",function(a){var b=["$q","$cacheFactory","$timeout","$rootScope","$log","cfpLoadingBar",function(b,c,d,e,f,g){function h(){d.cancel(j),g.complete(),l=0,k=0}function i(b){var d,e=c.get("$http"),f=a.defaults;!b.cache&&!f.cache||b.cache===!1||"GET"!==b.method&&"JSONP"!==b.method||(d=angular.isObject(b.cache)?b.cache:angular.isObject(f.cache)?f.cache:e);var g=void 0!==d?void 0!==d.get(b.url):!1;return void 0!==b.cached&&g!==b.cached?b.cached:(b.cached=g,g)}var j,k=0,l=0,m=g.latencyThreshold;return{request:function(a){return a.ignoreLoadingBar||i(a)||(e.$broadcast("cfpLoadingBar:loading",{url:a.url}),0===k&&(j=d(function(){g.start()},m)),k++,g.set(l/k)),a},response:function(a){return a&&a.config?(a.config.ignoreLoadingBar||i(a.config)||(l++,e.$broadcast("cfpLoadingBar:loaded",{url:a.config.url,result:a}),l>=k?h():g.set(l/k)),a):(f.error("Broken interceptor detected: Config object not supplied in response:\n https://github.com/chieffancypants/angular-loading-bar/pull/50"),a)},responseError:function(a){return a&&a.config?(a.config.ignoreLoadingBar||i(a.config)||(l++,e.$broadcast("cfpLoadingBar:loaded",{url:a.config.url,result:a}),l>=k?h():g.set(l/k)),b.reject(a)):(f.error("Broken interceptor detected: Config object not supplied in rejection:\n https://github.com/chieffancypants/angular-loading-bar/pull/50"),b.reject(a))}}}];a.interceptors.push(b)}]),angular.module("cfp.loadingBar",[]).provider("cfpLoadingBar",function(){this.autoIncrement=!0,this.includeSpinner=!0,this.includeBar=!0,this.latencyThreshold=100,this.startSize=.02,this.parentSelector="body",this.spinnerTemplate='<div id="loading-bar-spinner"><div class="spinner-icon"></div></div>',this.loadingBarTemplate='<div id="loading-bar"><div class="bar"><div class="peg"></div></div></div>',this.$get=["$injector","$document","$timeout","$rootScope",function(a,b,c,d){function e(){if(k||(k=a.get("$animate")),c.cancel(m),!r){var e=b[0],g=e.querySelector?e.querySelector(n):b.find(n)[0];g||(g=e.getElementsByTagName("body")[0]);var h=angular.element(g),i=g.lastChild&&angular.element(g.lastChild);d.$broadcast("cfpLoadingBar:started"),r=!0,v&&k.enter(o,h,i),u&&k.enter(q,h,o),f(w)}}function f(a){if(r){var b=100*a+"%";p.css("width",b),s=a,t&&(c.cancel(l),l=c(function(){g()},250))}}function g(){if(!(h()>=1)){var a=0,b=h();a=b>=0&&.25>b?(3*Math.random()+3)/100:b>=.25&&.65>b?3*Math.random()/100:b>=.65&&.9>b?2*Math.random()/100:b>=.9&&.99>b?.005:0;var c=h()+a;f(c)}}function h(){return s}function i(){s=0,r=!1}function j(){k||(k=a.get("$animate")),d.$broadcast("cfpLoadingBar:completed"),f(1),c.cancel(m),m=c(function(){var a=k.leave(o,i);a&&a.then&&a.then(i),k.leave(q)},500)}var k,l,m,n=this.parentSelector,o=angular.element(this.loadingBarTemplate),p=o.find("div").eq(0),q=angular.element(this.spinnerTemplate),r=!1,s=0,t=this.autoIncrement,u=this.includeSpinner,v=this.includeBar,w=this.startSize;return{start:e,set:f,status:h,inc:g,complete:j,autoIncrement:this.autoIncrement,includeSpinner:this.includeSpinner,latencyThreshold:this.latencyThreshold,parentSelector:this.parentSelector,startSize:this.startSize}}]})}();
|
180
node_modules/angular-loading-bar/example/app.css
generated
vendored
Normal file
@ -0,0 +1,180 @@
|
||||
body {
|
||||
background-color: #ecf0f1;
|
||||
/*padding: 25px;*/
|
||||
font-family: 'Oxygen', sans;
|
||||
width: 85%;
|
||||
margin: auto;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
.thumbnail {
|
||||
width: 70px;
|
||||
height: 70px;
|
||||
/*border: 1px solid #F1C6C2;*/
|
||||
border: 1px solid #CE8982
|
||||
}
|
||||
a {
|
||||
font-size:16px;
|
||||
}
|
||||
.badge {
|
||||
background-color: #428bca;
|
||||
}
|
||||
.meta, .meta-comments {
|
||||
font-size:12px;
|
||||
color: #333;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.meta-comments {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
footer.navbar {
|
||||
height: 65px;
|
||||
width: 100%;
|
||||
border-top: 1px solid #ccc;
|
||||
box-shadow: 0 -1px 4px rgba(0,0,0,0.15);
|
||||
margin: 0;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.panel {
|
||||
-webkit-transition: 0.75s ease-in-out all;
|
||||
-moz-transition: 0.75s ease-in-out all;
|
||||
-o-transition: 0.75s ease-in-out all;
|
||||
transition: 0.75s ease-in-out all;
|
||||
background-color: #fff;
|
||||
border: none;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.panel a {
|
||||
color: #e74c3c;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.panel .badge {
|
||||
background-color: #e74c3c;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.panel.ng-enter {
|
||||
opacity: 0;
|
||||
}
|
||||
.panel.ng-enter-active {
|
||||
opacity: 1;
|
||||
transition-delay: 0.5s;
|
||||
}
|
||||
|
||||
.panel-body {
|
||||
border: 1px solid #ccc;
|
||||
/*box-shadow: 0 1px 3px rgba(0,0,0,0.1);*/
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.examples {
|
||||
margin-bottom: 25px;
|
||||
transition-delay: 0.5s;
|
||||
}
|
||||
|
||||
.examples.ng-hide-add,
|
||||
.examples.ng-hide-remove,
|
||||
.loading-text.ng-hide-add,
|
||||
.loading-text.ng-hide-remove {
|
||||
-webkit-transition:all linear 0.5s;
|
||||
-moz-transition:all linear 0.5s;
|
||||
-o-transition:all linear 0.5s;
|
||||
transition:all linear 0.5s;
|
||||
display:block!important;
|
||||
}
|
||||
.examples.ng-hide-add,
|
||||
.examples.ng-hide-remove {
|
||||
transition-delay: 0.5s;
|
||||
}
|
||||
|
||||
.examples.ng-hide-add.ng-hide-add-active,
|
||||
.examples.ng-hide-remove,
|
||||
.loading-text.ng-hide-add.ng-hide-add-active,
|
||||
.loading-text.ng-hide-remove {
|
||||
opacity:0;
|
||||
}
|
||||
|
||||
.examples.ng-hide-add,
|
||||
.examples.ng-hide-remove.ng-hide-remove-active,
|
||||
.loading-text.ng-hide-add,
|
||||
.loading-text.ng-hide-remove.ng-hide-remove-active {
|
||||
opacity:1;
|
||||
}
|
||||
|
||||
.examples .btn i {
|
||||
top: 2px;
|
||||
}
|
||||
|
||||
.examples span {
|
||||
color: #A1FFC9;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background-color: #2ecc71;
|
||||
border: 1px solid #27ae60;
|
||||
}
|
||||
.btn-primary:hover {
|
||||
background-color: #32B96C;
|
||||
border: 1px solid #27ae60;
|
||||
}
|
||||
|
||||
.jumbotron {
|
||||
color: #333;
|
||||
background-color: #fff;
|
||||
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
|
||||
border-radius: 5px;
|
||||
padding-top: 5px;
|
||||
padding-bottom: 10px;
|
||||
margin-top: 15px;
|
||||
border: 1px solid #ccc;
|
||||
-webkit-transition:all linear 0.5s;
|
||||
-moz-transition:all linear 0.5s;
|
||||
-o-transition:all linear 0.5s;
|
||||
transition:all linear 0.5s;
|
||||
}
|
||||
|
||||
.jumbotron h1 {
|
||||
color: #333;
|
||||
letter-spacing: -2px;
|
||||
}
|
||||
|
||||
.jumbotron small {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-family: 'Oxygen', sans;
|
||||
/*padding-bottom: 10px;*/
|
||||
}
|
||||
|
||||
h4 {
|
||||
font-family: 'Oxygen', sans;
|
||||
color: #888;
|
||||
padding-bottom: 5px;
|
||||
padding-top: 10px;
|
||||
}
|
||||
h4 span {
|
||||
color: #e74c3c;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* override the default CSS as an example
|
||||
*/
|
||||
|
||||
#loading-bar .bar {
|
||||
background: #2c3e50;
|
||||
}
|
||||
#loading-bar-spinner .spinner-icon {
|
||||
border-top-color: #2c3e50;
|
||||
border-left-color: #2c3e50;
|
||||
}
|
||||
#loading-bar .peg {
|
||||
-moz-box-shadow: #2c3e50 1px 0 6px 1px;
|
||||
-ms-box-shadow: #2c3e50 1px 0 6px 1px;
|
||||
-webkit-box-shadow: #2c3e50 1px 0 6px 1px;
|
||||
box-shadow: #2c3e50 1px 0 6px 1px;
|
||||
}
|
49
node_modules/angular-loading-bar/example/app.js
generated
vendored
Normal file
@ -0,0 +1,49 @@
|
||||
|
||||
|
||||
angular.module('LoadingBarExample', ['chieffancypants.loadingBar', 'ngAnimate'])
|
||||
.config(function(cfpLoadingBarProvider) {
|
||||
cfpLoadingBarProvider.includeSpinner = true;
|
||||
})
|
||||
|
||||
.controller('ExampleCtrl', function ($scope, $http, $timeout, cfpLoadingBar) {
|
||||
$scope.posts = [];
|
||||
$scope.section = null;
|
||||
$scope.subreddit = null;
|
||||
$scope.subreddits = ['cats', 'pics', 'funny', 'gaming', 'AdviceAnimals', 'aww'];
|
||||
|
||||
var getRandomSubreddit = function() {
|
||||
var sub = $scope.subreddits[Math.floor(Math.random() * $scope.subreddits.length)];
|
||||
|
||||
// ensure we get a new subreddit each time.
|
||||
if (sub == $scope.subreddit) {
|
||||
return getRandomSubreddit();
|
||||
}
|
||||
|
||||
return sub;
|
||||
};
|
||||
|
||||
$scope.fetch = function() {
|
||||
$scope.subreddit = getRandomSubreddit();
|
||||
$http.jsonp('http://www.reddit.com/r/' + $scope.subreddit + '.json?limit=50&jsonp=JSON_CALLBACK').success(function(data) {
|
||||
$scope.posts = data.data.children;
|
||||
});
|
||||
};
|
||||
|
||||
$scope.start = function() {
|
||||
cfpLoadingBar.start();
|
||||
};
|
||||
|
||||
$scope.complete = function () {
|
||||
cfpLoadingBar.complete();
|
||||
}
|
||||
|
||||
|
||||
// fake the initial load so first time users can see it right away:
|
||||
$scope.start();
|
||||
$scope.fakeIntro = true;
|
||||
$timeout(function() {
|
||||
$scope.complete();
|
||||
$scope.fakeIntro = false;
|
||||
}, 750);
|
||||
|
||||
});
|
64
node_modules/angular-loading-bar/example/index.html
generated
vendored
Normal file
@ -0,0 +1,64 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<!-- angular -->
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js"></script>
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular-animate.min.js"></script>
|
||||
|
||||
<!-- loadingbar -->
|
||||
<script src="../src/loading-bar.js"></script>
|
||||
<link href='../src/loading-bar.css' rel='stylesheet' />
|
||||
|
||||
<!-- example app -->
|
||||
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">
|
||||
<script src="app.js"></script>
|
||||
<link href='app.css' rel='stylesheet' />
|
||||
<link href='http://fonts.googleapis.com/css?family=Oxygen:300,400,700' rel='stylesheet' type='text/css'>
|
||||
</head>
|
||||
|
||||
<body ng-app="LoadingBarExample" ng-controller="ExampleCtrl">
|
||||
<div class="jumbotron">
|
||||
<h1>Angular Loading Bar</h1>
|
||||
<p>An automatic loading bar using angular interceptors.<small> It works automatically, so simply include it as a dependency and it will automatically display the progress of your $http requests.</small></p>
|
||||
<p>
|
||||
<a href="https://github.com/chieffancypants/angular-loading-bar" class="btn btn-primary btn-lg">
|
||||
<i class="glyphicon glyphicon-download"></i> Download
|
||||
</a>
|
||||
<a href="https://github.com/chieffancypants/angular-loading-bar" class="btn btn-default btn-lg">
|
||||
<i class="glyphicon glyphicon-random"></i> Fork on GitHub
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="examples" ng-hide="fakeIntro">
|
||||
<!-- <h4>Examples:</h4> -->
|
||||
<div class="btn-group btn-group-justified">
|
||||
<a href="#" class="btn btn-primary btn-lg" ng-click="start()">
|
||||
<i class="glyphicon glyphicon-play-circle"></i> <span>cfpLoadingBar.</span>start()
|
||||
</a>
|
||||
<a href="#" class="btn btn-primary btn-lg" ng-click="complete()">
|
||||
<i class="glyphicon glyphicon-play-circle"></i> <span>cfpLoadingBar.</span>complete()
|
||||
</a>
|
||||
<a href="#" class="btn btn-primary btn-lg" ng-click="fetch()"><i class="glyphicon glyphicon-play-circle"></i> Real Example <span> (from reddit)</span></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h4 class="loading-text" ng-show="subreddit">Showing 100 results for: <span>/r/{{subreddit}}...</span></h4>
|
||||
<div ng-repeat="post in posts" class="panel panel-default">
|
||||
<div class="panel-body media">
|
||||
<span class="badge pull-right">{{post.data.score}}</span>
|
||||
<div class="pull-left" ng-if="post.data.thumbnail">
|
||||
<img class="thumbnail" ng-src="{{post.data.thumbnail}}">
|
||||
</div>
|
||||
<div class="">
|
||||
<div class="">
|
||||
<a href="{{post.data.url}}">{{post.data.title}}</a>
|
||||
<p class="meta">by {{post.data.author}}</p>
|
||||
<p class="meta-comments">{{post.data.num_comments}} comments</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
2
node_modules/angular-loading-bar/index.js
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
require('./build/loading-bar');
|
||||
module.exports = 'angular-loading-bar';
|
70
node_modules/angular-loading-bar/package.json
generated
vendored
Normal file
@ -0,0 +1,70 @@
|
||||
{
|
||||
"_from": "angular-loading-bar",
|
||||
"_id": "angular-loading-bar@0.9.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-N+9Swl8QLCFuezzf0vxaXflijkU=",
|
||||
"_location": "/angular-loading-bar",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "tag",
|
||||
"registry": true,
|
||||
"raw": "angular-loading-bar",
|
||||
"name": "angular-loading-bar",
|
||||
"escapedName": "angular-loading-bar",
|
||||
"rawSpec": "",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "latest"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"#USER",
|
||||
"/"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/angular-loading-bar/-/angular-loading-bar-0.9.0.tgz",
|
||||
"_shasum": "37ef52c25f102c216e7b3cdfd2fc5a5df9628e45",
|
||||
"_spec": "angular-loading-bar",
|
||||
"_where": "/home/lrullo/httpdocs/anorgatarrak.eus/wp-content/themes/anorgatarrak",
|
||||
"author": {
|
||||
"name": "Wes Cruver"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/chieffancypants/angular-loading-bar/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "An automatic loading bar for AngularJS",
|
||||
"devDependencies": {
|
||||
"grunt": "~0.4.1",
|
||||
"grunt-contrib-concat": "^0.5.0",
|
||||
"grunt-contrib-cssmin": "~0.12.0",
|
||||
"grunt-contrib-jshint": "~0.6.4",
|
||||
"grunt-contrib-uglify": "^0.9.1",
|
||||
"grunt-karma": "~0.11.0",
|
||||
"karma": "~0.12.0",
|
||||
"karma-coffee-preprocessor": "^0.2.0",
|
||||
"karma-coverage": "^0.1.0",
|
||||
"karma-jasmine": "^0.1.3",
|
||||
"karma-phantomjs-launcher": "^0.1.0"
|
||||
},
|
||||
"directories": {
|
||||
"example": "example",
|
||||
"test": "test"
|
||||
},
|
||||
"homepage": "https://chieffancypants.github.io/angular-loading-bar",
|
||||
"keywords": [
|
||||
"angular",
|
||||
"angularjs",
|
||||
"loading",
|
||||
"loadingbar",
|
||||
"progress",
|
||||
"progressbar"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "angular-loading-bar",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/chieffancypants/angular-loading-bar.git"
|
||||
},
|
||||
"style": "build/loading-bar.css",
|
||||
"version": "0.9.0"
|
||||
}
|
104
node_modules/angular-loading-bar/src/loading-bar.css
generated
vendored
Normal file
@ -0,0 +1,104 @@
|
||||
|
||||
/* Make clicks pass-through */
|
||||
#loading-bar,
|
||||
#loading-bar-spinner {
|
||||
pointer-events: none;
|
||||
-webkit-pointer-events: none;
|
||||
-webkit-transition: 350ms linear all;
|
||||
-moz-transition: 350ms linear all;
|
||||
-o-transition: 350ms linear all;
|
||||
transition: 350ms linear all;
|
||||
}
|
||||
|
||||
#loading-bar.ng-enter,
|
||||
#loading-bar.ng-leave.ng-leave-active,
|
||||
#loading-bar-spinner.ng-enter,
|
||||
#loading-bar-spinner.ng-leave.ng-leave-active {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
#loading-bar.ng-enter.ng-enter-active,
|
||||
#loading-bar.ng-leave,
|
||||
#loading-bar-spinner.ng-enter.ng-enter-active,
|
||||
#loading-bar-spinner.ng-leave {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
#loading-bar .bar {
|
||||
-webkit-transition: width 350ms;
|
||||
-moz-transition: width 350ms;
|
||||
-o-transition: width 350ms;
|
||||
transition: width 350ms;
|
||||
|
||||
background: #29d;
|
||||
position: fixed;
|
||||
z-index: 10002;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 2px;
|
||||
border-bottom-right-radius: 1px;
|
||||
border-top-right-radius: 1px;
|
||||
}
|
||||
|
||||
/* Fancy blur effect */
|
||||
#loading-bar .peg {
|
||||
position: absolute;
|
||||
width: 70px;
|
||||
right: 0;
|
||||
top: 0;
|
||||
height: 2px;
|
||||
opacity: .45;
|
||||
-moz-box-shadow: #29d 1px 0 6px 1px;
|
||||
-ms-box-shadow: #29d 1px 0 6px 1px;
|
||||
-webkit-box-shadow: #29d 1px 0 6px 1px;
|
||||
box-shadow: #29d 1px 0 6px 1px;
|
||||
-moz-border-radius: 100%;
|
||||
-webkit-border-radius: 100%;
|
||||
border-radius: 100%;
|
||||
}
|
||||
|
||||
#loading-bar-spinner {
|
||||
display: block;
|
||||
position: fixed;
|
||||
z-index: 10002;
|
||||
top: 10px;
|
||||
left: 10px;
|
||||
}
|
||||
|
||||
#loading-bar-spinner .spinner-icon {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
|
||||
border: solid 2px transparent;
|
||||
border-top-color: #29d;
|
||||
border-left-color: #29d;
|
||||
border-radius: 50%;
|
||||
|
||||
-webkit-animation: loading-bar-spinner 400ms linear infinite;
|
||||
-moz-animation: loading-bar-spinner 400ms linear infinite;
|
||||
-ms-animation: loading-bar-spinner 400ms linear infinite;
|
||||
-o-animation: loading-bar-spinner 400ms linear infinite;
|
||||
animation: loading-bar-spinner 400ms linear infinite;
|
||||
}
|
||||
|
||||
@-webkit-keyframes loading-bar-spinner {
|
||||
0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); }
|
||||
100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
|
||||
}
|
||||
@-moz-keyframes loading-bar-spinner {
|
||||
0% { -moz-transform: rotate(0deg); transform: rotate(0deg); }
|
||||
100% { -moz-transform: rotate(360deg); transform: rotate(360deg); }
|
||||
}
|
||||
@-o-keyframes loading-bar-spinner {
|
||||
0% { -o-transform: rotate(0deg); transform: rotate(0deg); }
|
||||
100% { -o-transform: rotate(360deg); transform: rotate(360deg); }
|
||||
}
|
||||
@-ms-keyframes loading-bar-spinner {
|
||||
0% { -ms-transform: rotate(0deg); transform: rotate(0deg); }
|
||||
100% { -ms-transform: rotate(360deg); transform: rotate(360deg); }
|
||||
}
|
||||
@keyframes loading-bar-spinner {
|
||||
0% { transform: rotate(0deg); }
|
||||
100% { transform: rotate(360deg); }
|
||||
}
|
335
node_modules/angular-loading-bar/src/loading-bar.js
generated
vendored
Normal file
@ -0,0 +1,335 @@
|
||||
/*
|
||||
* angular-loading-bar
|
||||
*
|
||||
* intercepts XHR requests and creates a loading bar.
|
||||
* Based on the excellent nprogress work by rstacruz (more info in readme)
|
||||
*
|
||||
* (c) 2013 Wes Cruver
|
||||
* License: MIT
|
||||
*/
|
||||
|
||||
|
||||
(function() {
|
||||
|
||||
'use strict';
|
||||
|
||||
// Alias the loading bar for various backwards compatibilities since the project has matured:
|
||||
angular.module('angular-loading-bar', ['cfp.loadingBarInterceptor']);
|
||||
angular.module('chieffancypants.loadingBar', ['cfp.loadingBarInterceptor']);
|
||||
|
||||
|
||||
/**
|
||||
* loadingBarInterceptor service
|
||||
*
|
||||
* Registers itself as an Angular interceptor and listens for XHR requests.
|
||||
*/
|
||||
angular.module('cfp.loadingBarInterceptor', ['cfp.loadingBar'])
|
||||
.config(['$httpProvider', function ($httpProvider) {
|
||||
|
||||
var interceptor = ['$q', '$cacheFactory', '$timeout', '$rootScope', '$log', 'cfpLoadingBar', function ($q, $cacheFactory, $timeout, $rootScope, $log, cfpLoadingBar) {
|
||||
|
||||
/**
|
||||
* The total number of requests made
|
||||
*/
|
||||
var reqsTotal = 0;
|
||||
|
||||
/**
|
||||
* The number of requests completed (either successfully or not)
|
||||
*/
|
||||
var reqsCompleted = 0;
|
||||
|
||||
/**
|
||||
* The amount of time spent fetching before showing the loading bar
|
||||
*/
|
||||
var latencyThreshold = cfpLoadingBar.latencyThreshold;
|
||||
|
||||
/**
|
||||
* $timeout handle for latencyThreshold
|
||||
*/
|
||||
var startTimeout;
|
||||
|
||||
|
||||
/**
|
||||
* calls cfpLoadingBar.complete() which removes the
|
||||
* loading bar from the DOM.
|
||||
*/
|
||||
function setComplete() {
|
||||
$timeout.cancel(startTimeout);
|
||||
cfpLoadingBar.complete();
|
||||
reqsCompleted = 0;
|
||||
reqsTotal = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the response has already been cached
|
||||
* @param {Object} config the config option from the request
|
||||
* @return {Boolean} retrns true if cached, otherwise false
|
||||
*/
|
||||
function isCached(config) {
|
||||
var cache;
|
||||
var defaultCache = $cacheFactory.get('$http');
|
||||
var defaults = $httpProvider.defaults;
|
||||
|
||||
// Choose the proper cache source. Borrowed from angular: $http service
|
||||
if ((config.cache || defaults.cache) && config.cache !== false &&
|
||||
(config.method === 'GET' || config.method === 'JSONP')) {
|
||||
cache = angular.isObject(config.cache) ? config.cache
|
||||
: angular.isObject(defaults.cache) ? defaults.cache
|
||||
: defaultCache;
|
||||
}
|
||||
|
||||
var cached = cache !== undefined ?
|
||||
cache.get(config.url) !== undefined : false;
|
||||
|
||||
if (config.cached !== undefined && cached !== config.cached) {
|
||||
return config.cached;
|
||||
}
|
||||
config.cached = cached;
|
||||
return cached;
|
||||
}
|
||||
|
||||
|
||||
return {
|
||||
'request': function(config) {
|
||||
// Check to make sure this request hasn't already been cached and that
|
||||
// the requester didn't explicitly ask us to ignore this request:
|
||||
if (!config.ignoreLoadingBar && !isCached(config)) {
|
||||
$rootScope.$broadcast('cfpLoadingBar:loading', {url: config.url});
|
||||
if (reqsTotal === 0) {
|
||||
startTimeout = $timeout(function() {
|
||||
cfpLoadingBar.start();
|
||||
}, latencyThreshold);
|
||||
}
|
||||
reqsTotal++;
|
||||
cfpLoadingBar.set(reqsCompleted / reqsTotal);
|
||||
}
|
||||
return config;
|
||||
},
|
||||
|
||||
'response': function(response) {
|
||||
if (!response || !response.config) {
|
||||
$log.error('Broken interceptor detected: Config object not supplied in response:\n https://github.com/chieffancypants/angular-loading-bar/pull/50');
|
||||
return response;
|
||||
}
|
||||
|
||||
if (!response.config.ignoreLoadingBar && !isCached(response.config)) {
|
||||
reqsCompleted++;
|
||||
$rootScope.$broadcast('cfpLoadingBar:loaded', {url: response.config.url, result: response});
|
||||
if (reqsCompleted >= reqsTotal) {
|
||||
setComplete();
|
||||
} else {
|
||||
cfpLoadingBar.set(reqsCompleted / reqsTotal);
|
||||
}
|
||||
}
|
||||
return response;
|
||||
},
|
||||
|
||||
'responseError': function(rejection) {
|
||||
if (!rejection || !rejection.config) {
|
||||
$log.error('Broken interceptor detected: Config object not supplied in rejection:\n https://github.com/chieffancypants/angular-loading-bar/pull/50');
|
||||
return $q.reject(rejection);
|
||||
}
|
||||
|
||||
if (!rejection.config.ignoreLoadingBar && !isCached(rejection.config)) {
|
||||
reqsCompleted++;
|
||||
$rootScope.$broadcast('cfpLoadingBar:loaded', {url: rejection.config.url, result: rejection});
|
||||
if (reqsCompleted >= reqsTotal) {
|
||||
setComplete();
|
||||
} else {
|
||||
cfpLoadingBar.set(reqsCompleted / reqsTotal);
|
||||
}
|
||||
}
|
||||
return $q.reject(rejection);
|
||||
}
|
||||
};
|
||||
}];
|
||||
|
||||
$httpProvider.interceptors.push(interceptor);
|
||||
}]);
|
||||
|
||||
|
||||
/**
|
||||
* Loading Bar
|
||||
*
|
||||
* This service handles adding and removing the actual element in the DOM.
|
||||
* Generally, best practices for DOM manipulation is to take place in a
|
||||
* directive, but because the element itself is injected in the DOM only upon
|
||||
* XHR requests, and it's likely needed on every view, the best option is to
|
||||
* use a service.
|
||||
*/
|
||||
angular.module('cfp.loadingBar', [])
|
||||
.provider('cfpLoadingBar', function() {
|
||||
|
||||
this.autoIncrement = true;
|
||||
this.includeSpinner = true;
|
||||
this.includeBar = true;
|
||||
this.latencyThreshold = 100;
|
||||
this.startSize = 0.02;
|
||||
this.parentSelector = 'body';
|
||||
this.spinnerTemplate = '<div id="loading-bar-spinner"><div class="spinner-icon"></div></div>';
|
||||
this.loadingBarTemplate = '<div id="loading-bar"><div class="bar"><div class="peg"></div></div></div>';
|
||||
|
||||
this.$get = ['$injector', '$document', '$timeout', '$rootScope', function ($injector, $document, $timeout, $rootScope) {
|
||||
var $animate;
|
||||
var $parentSelector = this.parentSelector,
|
||||
loadingBarContainer = angular.element(this.loadingBarTemplate),
|
||||
loadingBar = loadingBarContainer.find('div').eq(0),
|
||||
spinner = angular.element(this.spinnerTemplate);
|
||||
|
||||
var incTimeout,
|
||||
completeTimeout,
|
||||
started = false,
|
||||
status = 0;
|
||||
|
||||
var autoIncrement = this.autoIncrement;
|
||||
var includeSpinner = this.includeSpinner;
|
||||
var includeBar = this.includeBar;
|
||||
var startSize = this.startSize;
|
||||
|
||||
/**
|
||||
* Inserts the loading bar element into the dom, and sets it to 2%
|
||||
*/
|
||||
function _start() {
|
||||
if (!$animate) {
|
||||
$animate = $injector.get('$animate');
|
||||
}
|
||||
|
||||
$timeout.cancel(completeTimeout);
|
||||
|
||||
// do not continually broadcast the started event:
|
||||
if (started) {
|
||||
return;
|
||||
}
|
||||
|
||||
var document = $document[0];
|
||||
var parent = document.querySelector ?
|
||||
document.querySelector($parentSelector)
|
||||
: $document.find($parentSelector)[0]
|
||||
;
|
||||
|
||||
if (! parent) {
|
||||
parent = document.getElementsByTagName('body')[0];
|
||||
}
|
||||
|
||||
var $parent = angular.element(parent);
|
||||
var $after = parent.lastChild && angular.element(parent.lastChild);
|
||||
|
||||
$rootScope.$broadcast('cfpLoadingBar:started');
|
||||
started = true;
|
||||
|
||||
if (includeBar) {
|
||||
$animate.enter(loadingBarContainer, $parent, $after);
|
||||
}
|
||||
|
||||
if (includeSpinner) {
|
||||
$animate.enter(spinner, $parent, loadingBarContainer);
|
||||
}
|
||||
|
||||
_set(startSize);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the loading bar's width to a certain percent.
|
||||
*
|
||||
* @param n any value between 0 and 1
|
||||
*/
|
||||
function _set(n) {
|
||||
if (!started) {
|
||||
return;
|
||||
}
|
||||
var pct = (n * 100) + '%';
|
||||
loadingBar.css('width', pct);
|
||||
status = n;
|
||||
|
||||
// increment loadingbar to give the illusion that there is always
|
||||
// progress but make sure to cancel the previous timeouts so we don't
|
||||
// have multiple incs running at the same time.
|
||||
if (autoIncrement) {
|
||||
$timeout.cancel(incTimeout);
|
||||
incTimeout = $timeout(function() {
|
||||
_inc();
|
||||
}, 250);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Increments the loading bar by a random amount
|
||||
* but slows down as it progresses
|
||||
*/
|
||||
function _inc() {
|
||||
if (_status() >= 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
var rnd = 0;
|
||||
|
||||
// TODO: do this mathmatically instead of through conditions
|
||||
|
||||
var stat = _status();
|
||||
if (stat >= 0 && stat < 0.25) {
|
||||
// Start out between 3 - 6% increments
|
||||
rnd = (Math.random() * (5 - 3 + 1) + 3) / 100;
|
||||
} else if (stat >= 0.25 && stat < 0.65) {
|
||||
// increment between 0 - 3%
|
||||
rnd = (Math.random() * 3) / 100;
|
||||
} else if (stat >= 0.65 && stat < 0.9) {
|
||||
// increment between 0 - 2%
|
||||
rnd = (Math.random() * 2) / 100;
|
||||
} else if (stat >= 0.9 && stat < 0.99) {
|
||||
// finally, increment it .5 %
|
||||
rnd = 0.005;
|
||||
} else {
|
||||
// after 99%, don't increment:
|
||||
rnd = 0;
|
||||
}
|
||||
|
||||
var pct = _status() + rnd;
|
||||
_set(pct);
|
||||
}
|
||||
|
||||
function _status() {
|
||||
return status;
|
||||
}
|
||||
|
||||
function _completeAnimation() {
|
||||
status = 0;
|
||||
started = false;
|
||||
}
|
||||
|
||||
function _complete() {
|
||||
if (!$animate) {
|
||||
$animate = $injector.get('$animate');
|
||||
}
|
||||
|
||||
$rootScope.$broadcast('cfpLoadingBar:completed');
|
||||
_set(1);
|
||||
|
||||
$timeout.cancel(completeTimeout);
|
||||
|
||||
// Attempt to aggregate any start/complete calls within 500ms:
|
||||
completeTimeout = $timeout(function() {
|
||||
var promise = $animate.leave(loadingBarContainer, _completeAnimation);
|
||||
if (promise && promise.then) {
|
||||
promise.then(_completeAnimation);
|
||||
}
|
||||
$animate.leave(spinner);
|
||||
}, 500);
|
||||
}
|
||||
|
||||
return {
|
||||
start : _start,
|
||||
set : _set,
|
||||
status : _status,
|
||||
inc : _inc,
|
||||
complete : _complete,
|
||||
autoIncrement : this.autoIncrement,
|
||||
includeSpinner : this.includeSpinner,
|
||||
latencyThreshold : this.latencyThreshold,
|
||||
parentSelector : this.parentSelector,
|
||||
startSize : this.startSize
|
||||
};
|
||||
|
||||
|
||||
}]; //
|
||||
}); // wtf javascript. srsly
|
||||
})(); //
|
82
node_modules/angular-loading-bar/test/karma-angular-1.2.conf.js
generated
vendored
Normal file
@ -0,0 +1,82 @@
|
||||
// Karma configuration
|
||||
// Generated on Sun Sep 15 2013 20:18:09 GMT-0400 (EDT)
|
||||
|
||||
module.exports = function(config) {
|
||||
config.set({
|
||||
|
||||
// base path, that will be used to resolve files and exclude
|
||||
basePath: '',
|
||||
|
||||
|
||||
// frameworks to use
|
||||
frameworks: ['jasmine'],
|
||||
|
||||
|
||||
// list of files / patterns to load in the browser
|
||||
files: [
|
||||
'../bower_components/angular/angular.js',
|
||||
'../bower_components/angular-animate/angular-animate.js',
|
||||
'../bower_components/angular-mocks/angular-mocks.js',
|
||||
'../src/*.js',
|
||||
'*.coffee'
|
||||
],
|
||||
|
||||
|
||||
// list of files to exclude
|
||||
exclude: [
|
||||
|
||||
],
|
||||
|
||||
|
||||
// test results reporter to use
|
||||
// possible values: 'dots', 'progress', 'junit', 'growl', 'coverage'
|
||||
reporters: ['progress', 'coverage'],
|
||||
|
||||
|
||||
// web server port
|
||||
port: 9876,
|
||||
|
||||
|
||||
// enable / disable colors in the output (reporters and logs)
|
||||
colors: true,
|
||||
|
||||
|
||||
// level of logging
|
||||
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
|
||||
logLevel: config.LOG_INFO,
|
||||
|
||||
|
||||
// enable / disable watching file and executing tests whenever any file changes
|
||||
autoWatch: true,
|
||||
|
||||
|
||||
// Start these browsers, currently available:
|
||||
// - Chrome
|
||||
// - ChromeCanary
|
||||
// - Firefox
|
||||
// - Opera
|
||||
// - Safari (only Mac)
|
||||
// - PhantomJS
|
||||
// - IE (only Windows)
|
||||
browsers: ['PhantomJS'],
|
||||
|
||||
coverageReporter: {
|
||||
type : 'html',
|
||||
dir : 'coverage/',
|
||||
},
|
||||
|
||||
preprocessors: {
|
||||
'../src/*.js': ['coverage'],
|
||||
'*.coffee': 'coffee'
|
||||
},
|
||||
|
||||
|
||||
// If browser does not capture in given timeout [ms], kill it
|
||||
captureTimeout: 60000,
|
||||
|
||||
|
||||
// Continuous Integration mode
|
||||
// if true, it capture browsers, run tests and exit
|
||||
singleRun: false
|
||||
});
|
||||
};
|
82
node_modules/angular-loading-bar/test/karma-angular-1.3.conf.js
generated
vendored
Normal file
@ -0,0 +1,82 @@
|
||||
// Karma configuration
|
||||
// Generated on Sun Sep 15 2013 20:18:09 GMT-0400 (EDT)
|
||||
|
||||
module.exports = function(config) {
|
||||
config.set({
|
||||
|
||||
// base path, that will be used to resolve files and exclude
|
||||
basePath: '',
|
||||
|
||||
|
||||
// frameworks to use
|
||||
frameworks: ['jasmine'],
|
||||
|
||||
|
||||
// list of files / patterns to load in the browser
|
||||
files: [
|
||||
'../bower_components/angular-1.3/angular.js',
|
||||
'../bower_components/angular-animate-1.3/angular-animate.js',
|
||||
'../bower_components/angular-mocks-1.3/angular-mocks.js',
|
||||
'../src/*.js',
|
||||
'*.coffee'
|
||||
],
|
||||
|
||||
|
||||
// list of files to exclude
|
||||
exclude: [
|
||||
|
||||
],
|
||||
|
||||
|
||||
// test results reporter to use
|
||||
// possible values: 'dots', 'progress', 'junit', 'growl', 'coverage'
|
||||
reporters: ['progress', 'coverage'],
|
||||
|
||||
|
||||
// web server port
|
||||
port: 9876,
|
||||
|
||||
|
||||
// enable / disable colors in the output (reporters and logs)
|
||||
colors: true,
|
||||
|
||||
|
||||
// level of logging
|
||||
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
|
||||
logLevel: config.LOG_INFO,
|
||||
|
||||
|
||||
// enable / disable watching file and executing tests whenever any file changes
|
||||
autoWatch: true,
|
||||
|
||||
|
||||
// Start these browsers, currently available:
|
||||
// - Chrome
|
||||
// - ChromeCanary
|
||||
// - Firefox
|
||||
// - Opera
|
||||
// - Safari (only Mac)
|
||||
// - PhantomJS
|
||||
// - IE (only Windows)
|
||||
browsers: ['PhantomJS'],
|
||||
|
||||
coverageReporter: {
|
||||
type : 'html',
|
||||
dir : 'coverage/',
|
||||
},
|
||||
|
||||
preprocessors: {
|
||||
'../src/*.js': ['coverage'],
|
||||
'*.coffee': 'coffee'
|
||||
},
|
||||
|
||||
|
||||
// If browser does not capture in given timeout [ms], kill it
|
||||
captureTimeout: 60000,
|
||||
|
||||
|
||||
// Continuous Integration mode
|
||||
// if true, it capture browsers, run tests and exit
|
||||
singleRun: false
|
||||
});
|
||||
};
|
82
node_modules/angular-loading-bar/test/karma-angular-1.4.conf.js
generated
vendored
Normal file
@ -0,0 +1,82 @@
|
||||
// Karma configuration
|
||||
// Generated on Sun Sep 15 2013 20:18:09 GMT-0400 (EDT)
|
||||
|
||||
module.exports = function(config) {
|
||||
config.set({
|
||||
|
||||
// base path, that will be used to resolve files and exclude
|
||||
basePath: '',
|
||||
|
||||
|
||||
// frameworks to use
|
||||
frameworks: ['jasmine'],
|
||||
|
||||
|
||||
// list of files / patterns to load in the browser
|
||||
files: [
|
||||
'../bower_components/angular-1.4/angular.js',
|
||||
'../bower_components/angular-animate-1.4/angular-animate.js',
|
||||
'../bower_components/angular-mocks-1.4/angular-mocks.js',
|
||||
'../src/*.js',
|
||||
'*.coffee'
|
||||
],
|
||||
|
||||
|
||||
// list of files to exclude
|
||||
exclude: [
|
||||
|
||||
],
|
||||
|
||||
|
||||
// test results reporter to use
|
||||
// possible values: 'dots', 'progress', 'junit', 'growl', 'coverage'
|
||||
reporters: ['progress', 'coverage'],
|
||||
|
||||
|
||||
// web server port
|
||||
port: 9876,
|
||||
|
||||
|
||||
// enable / disable colors in the output (reporters and logs)
|
||||
colors: true,
|
||||
|
||||
|
||||
// level of logging
|
||||
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
|
||||
logLevel: config.LOG_INFO,
|
||||
|
||||
|
||||
// enable / disable watching file and executing tests whenever any file changes
|
||||
autoWatch: true,
|
||||
|
||||
|
||||
// Start these browsers, currently available:
|
||||
// - Chrome
|
||||
// - ChromeCanary
|
||||
// - Firefox
|
||||
// - Opera
|
||||
// - Safari (only Mac)
|
||||
// - PhantomJS
|
||||
// - IE (only Windows)
|
||||
browsers: ['PhantomJS'],
|
||||
|
||||
coverageReporter: {
|
||||
type : 'html',
|
||||
dir : 'coverage/',
|
||||
},
|
||||
|
||||
preprocessors: {
|
||||
'../src/*.js': ['coverage'],
|
||||
'*.coffee': 'coffee'
|
||||
},
|
||||
|
||||
|
||||
// If browser does not capture in given timeout [ms], kill it
|
||||
captureTimeout: 60000,
|
||||
|
||||
|
||||
// Continuous Integration mode
|
||||
// if true, it capture browsers, run tests and exit
|
||||
singleRun: false
|
||||
});
|
||||
};
|
114
node_modules/angular-loading-bar/test/loading-bar-interceptor-config.coffee
generated
vendored
Normal file
@ -0,0 +1,114 @@
|
||||
describe 'loadingBarInterceptor Service - config options', ->
|
||||
|
||||
it 'should hide the spinner if configured', ->
|
||||
module 'chieffancypants.loadingBar', (cfpLoadingBarProvider) ->
|
||||
cfpLoadingBarProvider.includeSpinner = false
|
||||
return
|
||||
inject ($timeout, cfpLoadingBar) ->
|
||||
cfpLoadingBar.start()
|
||||
spinner = document.getElementById('loading-bar-spinner')
|
||||
expect(spinner).toBeNull
|
||||
cfpLoadingBar.complete()
|
||||
$timeout.flush()
|
||||
|
||||
it 'should show the spinner if configured', ->
|
||||
module 'chieffancypants.loadingBar', (cfpLoadingBarProvider) ->
|
||||
cfpLoadingBarProvider.includeSpinner = true
|
||||
return
|
||||
inject ($timeout, cfpLoadingBar) ->
|
||||
cfpLoadingBar.start()
|
||||
spinner = document.getElementById('loading-bar-spinner')
|
||||
expect(spinner).not.toBeNull
|
||||
cfpLoadingBar.complete()
|
||||
$timeout.flush()
|
||||
|
||||
it 'should hide the loadingBar if configured', ->
|
||||
module 'chieffancypants.loadingBar', (cfpLoadingBarProvider) ->
|
||||
cfpLoadingBarProvider.includeBar = false
|
||||
return
|
||||
inject ($timeout, cfpLoadingBar) ->
|
||||
cfpLoadingBar.start()
|
||||
spinner = document.getElementById('loading-bar-spinner')
|
||||
expect(spinner).toBeNull
|
||||
cfpLoadingBar.complete()
|
||||
$timeout.flush()
|
||||
|
||||
it 'should show the loadingBar if configured', ->
|
||||
module 'chieffancypants.loadingBar', (cfpLoadingBarProvider) ->
|
||||
cfpLoadingBarProvider.includeBar = true
|
||||
return
|
||||
inject ($timeout, cfpLoadingBar) ->
|
||||
cfpLoadingBar.start()
|
||||
spinner = document.getElementById('loading-bar-spinner')
|
||||
expect(spinner).not.toBeNull
|
||||
cfpLoadingBar.complete()
|
||||
$timeout.flush()
|
||||
|
||||
it 'should not auto increment loadingBar if configured', (done) ->
|
||||
module 'chieffancypants.loadingBar', (cfpLoadingBarProvider) ->
|
||||
cfpLoadingBarProvider.autoIncrement = false
|
||||
return
|
||||
inject ($timeout, cfpLoadingBar) ->
|
||||
flag = false
|
||||
cfpLoadingBar.start()
|
||||
cfpLoadingBar.set(.5)
|
||||
runs ->
|
||||
setTimeout ->
|
||||
flag = true
|
||||
, 500
|
||||
|
||||
waitsFor ->
|
||||
return flag
|
||||
, "500ms timeout"
|
||||
, 1000
|
||||
|
||||
runs ->
|
||||
expect(cfpLoadingBar.status()).toBe .5;
|
||||
cfpLoadingBar.complete()
|
||||
$timeout.flush()
|
||||
|
||||
it 'should auto increment loadingBar if configured', ->
|
||||
module 'chieffancypants.loadingBar', (cfpLoadingBarProvider) ->
|
||||
cfpLoadingBarProvider.autoIncrement = true
|
||||
return
|
||||
inject ($timeout, cfpLoadingBar) ->
|
||||
cfpLoadingBar.start()
|
||||
$timeout.flush()
|
||||
cfpLoadingBar.set(.5)
|
||||
$timeout.flush()
|
||||
expect(cfpLoadingBar.status()).toBeGreaterThan .5
|
||||
cfpLoadingBar.complete()
|
||||
$timeout.flush()
|
||||
|
||||
it 'should append the loadingbar as the first child of the parent container if empty', ->
|
||||
emptyEl = angular.element '<div id="empty"></div>'
|
||||
angular.element(document).find('body').eq(0).append emptyEl
|
||||
|
||||
module 'chieffancypants.loadingBar', (cfpLoadingBarProvider) ->
|
||||
cfpLoadingBarProvider.parentSelector = '#empty'
|
||||
return
|
||||
inject ($timeout, $document, cfpLoadingBar) ->
|
||||
cfpLoadingBar.start()
|
||||
parent = $document[0].querySelector(cfpLoadingBar.parentSelector)
|
||||
children = parent.childNodes
|
||||
expect(children.length).toBe 2
|
||||
expect(children[0].id).toBe 'loading-bar'
|
||||
expect(children[1].id).toBe 'loading-bar-spinner'
|
||||
cfpLoadingBar.complete()
|
||||
$timeout.flush()
|
||||
|
||||
it 'should append the loading bar to the body if parentSelector is empty', ->
|
||||
module 'chieffancypants.loadingBar', (cfpLoadingBarProvider) ->
|
||||
cfpLoadingBarProvider.parentSelector = '#doesnotexist'
|
||||
return
|
||||
inject ($timeout, $document, cfpLoadingBar) ->
|
||||
parent = $document[0].querySelector(cfpLoadingBar.parentSelector)
|
||||
expect(parent).toBeFalsy;
|
||||
body = $document[0].querySelector 'body'
|
||||
cfpLoadingBar.start()
|
||||
bar = angular.element(body.querySelector '#loading-bar');
|
||||
spinner = angular.element(body.querySelector '#loading-bar-spinner');
|
||||
expect(bar.length).toBe 1
|
||||
expect(spinner.length).toBe 1
|
||||
cfpLoadingBar.complete()
|
||||
$timeout.flush()
|
554
node_modules/angular-loading-bar/test/loading-bar-interceptor.coffee
generated
vendored
Normal file
@ -0,0 +1,554 @@
|
||||
isLoadingBarInjected = (doc) ->
|
||||
injected = false
|
||||
divs = angular.element(doc).find('div')
|
||||
for i in divs
|
||||
if angular.element(i).attr('id') is 'loading-bar'
|
||||
injected = true
|
||||
break
|
||||
return injected
|
||||
|
||||
flush = null
|
||||
|
||||
describe 'loadingBarInterceptor Service', ->
|
||||
|
||||
$http = $httpBackend = $document = $timeout = result = loadingBar = $animate = null
|
||||
response = {message:'OK'}
|
||||
endpoint = '/service'
|
||||
|
||||
beforeEach ->
|
||||
module 'ngAnimateMock', 'chieffancypants.loadingBar', (cfpLoadingBarProvider) ->
|
||||
loadingBar = cfpLoadingBarProvider
|
||||
return
|
||||
|
||||
result = null
|
||||
inject (_$http_, _$httpBackend_, _$document_, _$timeout_, _$animate_) ->
|
||||
$http = _$http_
|
||||
$httpBackend = _$httpBackend_
|
||||
$document = _$document_
|
||||
$timeout = _$timeout_
|
||||
$animate = _$animate_
|
||||
|
||||
# Angular 1.4 removed triggerCalbacks(), so try them both:
|
||||
flush = () ->
|
||||
$animate.flush && $animate.flush()
|
||||
$animate.triggerCallbacks && $animate.triggerCallbacks()
|
||||
|
||||
beforeEach ->
|
||||
this.addMatchers
|
||||
toBeBetween: (high, low) ->
|
||||
if low > high
|
||||
temp = low
|
||||
low = high
|
||||
high = temp
|
||||
return this.actual > low && this.actual < high
|
||||
|
||||
|
||||
afterEach ->
|
||||
$httpBackend.verifyNoOutstandingRequest()
|
||||
$timeout.verifyNoPendingTasks()
|
||||
|
||||
|
||||
it 'should not increment if the response is cached in a cacheFactory', inject (cfpLoadingBar, $cacheFactory) ->
|
||||
cache = $cacheFactory('loading-bar')
|
||||
$httpBackend.expectGET(endpoint).respond response
|
||||
$http.get(endpoint, cache: cache).then (data) ->
|
||||
result = data
|
||||
|
||||
expect(cfpLoadingBar.status()).toBe 0
|
||||
$timeout.flush()
|
||||
$timeout.flush()
|
||||
$httpBackend.flush(1)
|
||||
expect(cfpLoadingBar.status()).toBe 1
|
||||
cfpLoadingBar.complete() # set as complete
|
||||
$timeout.flush()
|
||||
flush()
|
||||
|
||||
|
||||
$http.get(endpoint, cache: cache).then (data) ->
|
||||
result = data
|
||||
# no need to flush $httpBackend since the response is cached
|
||||
expect(cfpLoadingBar.status()).toBe 0
|
||||
$httpBackend.verifyNoOutstandingRequest()
|
||||
$timeout.flush() # loading bar is animated, so flush timeout
|
||||
|
||||
it 'should not increment if the response is cached using $http.defaults.cache', inject (cfpLoadingBar, $cacheFactory) ->
|
||||
$http.defaults.cache = $cacheFactory('loading-bar')
|
||||
$httpBackend.expectGET(endpoint).respond response
|
||||
$http.get(endpoint).then (data) ->
|
||||
result = data
|
||||
|
||||
expect(cfpLoadingBar.status()).toBe 0
|
||||
$timeout.flush()
|
||||
$timeout.flush()
|
||||
$httpBackend.flush(1)
|
||||
expect(cfpLoadingBar.status()).toBe 1
|
||||
cfpLoadingBar.complete() # set as complete
|
||||
$timeout.flush()
|
||||
flush()
|
||||
|
||||
|
||||
$http.get(endpoint).then (data) ->
|
||||
result = data
|
||||
# no need to flush $httpBackend since the response is cached
|
||||
expect(cfpLoadingBar.status()).toBe 0
|
||||
$httpBackend.verifyNoOutstandingRequest()
|
||||
$timeout.flush() # loading bar is animated, so flush timeout
|
||||
|
||||
it 'should not increment if the response is cached', inject (cfpLoadingBar) ->
|
||||
$httpBackend.expectGET(endpoint).respond response
|
||||
$http.get(endpoint, cache: true).then (data) ->
|
||||
result = data
|
||||
|
||||
expect(cfpLoadingBar.status()).toBe 0
|
||||
$timeout.flush()
|
||||
$timeout.flush()
|
||||
$httpBackend.flush(1)
|
||||
expect(cfpLoadingBar.status()).toBe 1
|
||||
cfpLoadingBar.complete() # set as complete
|
||||
$timeout.flush()
|
||||
flush()
|
||||
|
||||
|
||||
$http.get(endpoint, cache: true).then (data) ->
|
||||
result = data
|
||||
# no need to flush $httpBackend since the response is cached
|
||||
expect(cfpLoadingBar.status()).toBe 0
|
||||
$httpBackend.verifyNoOutstandingRequest()
|
||||
$timeout.flush() # loading bar is animated, so flush timeout
|
||||
|
||||
it 'should use default cache when $http.defaults.cache is true', inject (cfpLoadingBar, $cacheFactory) ->
|
||||
# $http.defaults.cache = $cacheFactory('loading-bar')
|
||||
$http.defaults.cache = true
|
||||
$httpBackend.expectGET(endpoint).respond response
|
||||
$http.get(endpoint).then (data) ->
|
||||
result = data
|
||||
|
||||
expect(cfpLoadingBar.status()).toBe 0
|
||||
$timeout.flush()
|
||||
$timeout.flush()
|
||||
$httpBackend.flush(1)
|
||||
expect(cfpLoadingBar.status()).toBe 1
|
||||
cfpLoadingBar.complete() # set as complete
|
||||
$timeout.flush()
|
||||
flush()
|
||||
|
||||
|
||||
$http.get(endpoint).then (data) ->
|
||||
result = data
|
||||
# no need to flush $httpBackend since the response is cached
|
||||
expect(cfpLoadingBar.status()).toBe 0
|
||||
$httpBackend.verifyNoOutstandingRequest()
|
||||
$timeout.flush() # loading bar is animated, so flush timeout
|
||||
|
||||
it 'should not cache when the request is a POST', inject (cfpLoadingBar) ->
|
||||
$httpBackend.expectPOST(endpoint).respond response
|
||||
$http.post(endpoint, {message: 'post'}).then (data) ->
|
||||
result = data
|
||||
|
||||
expect(cfpLoadingBar.status()).toBe 0
|
||||
$timeout.flush()
|
||||
$timeout.flush()
|
||||
$httpBackend.flush(1)
|
||||
expect(cfpLoadingBar.status()).toBe 1
|
||||
$timeout.flush()
|
||||
flush()
|
||||
|
||||
|
||||
$httpBackend.expectPOST(endpoint).respond response
|
||||
$http.post(endpoint, {message: 'post'}).then (data) ->
|
||||
result = data
|
||||
|
||||
expect(cfpLoadingBar.status()).toBe 0
|
||||
$timeout.flush()
|
||||
$timeout.flush()
|
||||
$httpBackend.flush()
|
||||
expect(cfpLoadingBar.status()).toBe 1
|
||||
$timeout.flush()
|
||||
|
||||
|
||||
it 'should increment the loading bar when not all requests have been recieved', inject (cfpLoadingBar) ->
|
||||
$httpBackend.expectGET(endpoint).respond response
|
||||
$httpBackend.expectGET(endpoint).respond response
|
||||
$http.get(endpoint).then (data) ->
|
||||
result = data
|
||||
$http.get(endpoint).then (data) ->
|
||||
result = data
|
||||
|
||||
expect(cfpLoadingBar.status()).toBe 0
|
||||
$timeout.flush()
|
||||
$timeout.flush()
|
||||
$httpBackend.flush(1)
|
||||
expect(cfpLoadingBar.status()).toBe 0.5
|
||||
|
||||
$httpBackend.flush()
|
||||
expect(cfpLoadingBar.status()).toBe 1
|
||||
$timeout.flush() # loading bar is animated, so flush timeout
|
||||
|
||||
it 'should count http errors as responses so the loading bar can complete', inject (cfpLoadingBar) ->
|
||||
# $httpBackend.expectGET(endpoint).respond response
|
||||
$httpBackend.expectGET(endpoint).respond 401
|
||||
$httpBackend.expectGET(endpoint).respond 401
|
||||
$http.get(endpoint)
|
||||
$http.get(endpoint)
|
||||
|
||||
expect(cfpLoadingBar.status()).toBe 0
|
||||
$timeout.flush()
|
||||
$timeout.flush()
|
||||
$httpBackend.flush(1)
|
||||
expect(cfpLoadingBar.status()).toBe 0.5
|
||||
$httpBackend.flush()
|
||||
expect(cfpLoadingBar.status()).toBe 1
|
||||
|
||||
$timeout.flush()
|
||||
|
||||
it 'should insert the loadingbar into the DOM when a request is sent', inject (cfpLoadingBar) ->
|
||||
$httpBackend.expectGET(endpoint).respond response
|
||||
$httpBackend.expectGET(endpoint).respond response
|
||||
$http.get(endpoint)
|
||||
$http.get(endpoint)
|
||||
|
||||
$httpBackend.flush(1)
|
||||
$timeout.flush() # flush the latencyThreshold timeout
|
||||
|
||||
expect(isLoadingBarInjected($document.find(cfpLoadingBar.parentSelector))).toBe true
|
||||
|
||||
$httpBackend.flush()
|
||||
$timeout.flush()
|
||||
|
||||
it 'should insert the loadingbar as the last children of the parent container', inject (cfpLoadingBar) ->
|
||||
$httpBackend.expectGET(endpoint).respond response
|
||||
$httpBackend.expectGET(endpoint).respond response
|
||||
$http.get(endpoint)
|
||||
$http.get(endpoint)
|
||||
|
||||
$httpBackend.flush(1)
|
||||
$timeout.flush() # flush the latencyThreshold timeout
|
||||
|
||||
parent = $document.find(cfpLoadingBar.parentSelector)[0]
|
||||
children = parent.childNodes
|
||||
expect(children[children.length - 1].id).toBe 'loading-bar-spinner'
|
||||
expect(children[children.length - 2].id).toBe 'loading-bar'
|
||||
|
||||
$httpBackend.flush()
|
||||
$timeout.flush()
|
||||
|
||||
it 'should remove the loading bar when all requests have been received', inject (cfpLoadingBar) ->
|
||||
$httpBackend.expectGET(endpoint).respond response
|
||||
$httpBackend.expectGET(endpoint).respond response
|
||||
$http.get(endpoint)
|
||||
$http.get(endpoint)
|
||||
|
||||
$httpBackend.flush(1)
|
||||
$timeout.flush() # flush the latencyThreshold timeout
|
||||
|
||||
expect(isLoadingBarInjected($document.find(cfpLoadingBar.parentSelector))).toBe true
|
||||
|
||||
$httpBackend.flush()
|
||||
$timeout.flush()
|
||||
|
||||
expect(isLoadingBarInjected($document.find(cfpLoadingBar.parentSelector))).toBe false
|
||||
|
||||
it 'should get and set status', inject (cfpLoadingBar) ->
|
||||
cfpLoadingBar.start()
|
||||
$timeout.flush()
|
||||
|
||||
cfpLoadingBar.set(0.4)
|
||||
expect(cfpLoadingBar.status()).toBe 0.4
|
||||
|
||||
cfpLoadingBar.set(0.9)
|
||||
expect(cfpLoadingBar.status()).toBe 0.9
|
||||
|
||||
|
||||
cfpLoadingBar.complete()
|
||||
$timeout.flush()
|
||||
|
||||
it 'should increment things randomly', inject (cfpLoadingBar) ->
|
||||
cfpLoadingBar.start()
|
||||
$timeout.flush()
|
||||
|
||||
# increments between 3 - 6%
|
||||
cfpLoadingBar.set(0.1)
|
||||
lbar = angular.element(document.getElementById('loading-bar'))
|
||||
width = lbar.children().css('width').slice(0, -1)
|
||||
$timeout.flush()
|
||||
width2 = lbar.children().css('width').slice(0, -1)
|
||||
expect(width2).toBeGreaterThan width
|
||||
expect(width2 - width).toBeBetween(3, 6)
|
||||
|
||||
cfpLoadingBar.set(0.2)
|
||||
lbar = angular.element(document.getElementById('loading-bar'))
|
||||
width = lbar.children().css('width').slice(0, -1)
|
||||
$timeout.flush()
|
||||
width2 = lbar.children().css('width').slice(0, -1)
|
||||
expect(width2).toBeGreaterThan width
|
||||
expect(width2 - width).toBeBetween(3, 6)
|
||||
|
||||
# increments between 0 - 3%
|
||||
cfpLoadingBar.set(0.25)
|
||||
lbar = angular.element(document.getElementById('loading-bar'))
|
||||
width = lbar.children().css('width').slice(0, -1)
|
||||
$timeout.flush()
|
||||
width2 = lbar.children().css('width').slice(0, -1)
|
||||
expect(width2).toBeGreaterThan width
|
||||
expect(width2 - width).toBeBetween(0, 3)
|
||||
|
||||
cfpLoadingBar.set(0.5)
|
||||
lbar = angular.element(document.getElementById('loading-bar'))
|
||||
width = lbar.children().css('width').slice(0, -1)
|
||||
$timeout.flush()
|
||||
width2 = lbar.children().css('width').slice(0, -1)
|
||||
expect(width2).toBeGreaterThan width
|
||||
expect(width2 - width).toBeBetween(0, 3)
|
||||
|
||||
# increments between 0 - 2%
|
||||
cfpLoadingBar.set(0.65)
|
||||
lbar = angular.element(document.getElementById('loading-bar'))
|
||||
width = lbar.children().css('width').slice(0, -1)
|
||||
$timeout.flush()
|
||||
width2 = lbar.children().css('width').slice(0, -1)
|
||||
expect(width2).toBeGreaterThan width
|
||||
expect(width2 - width).toBeBetween(0, 2)
|
||||
|
||||
cfpLoadingBar.set(0.75)
|
||||
lbar = angular.element(document.getElementById('loading-bar'))
|
||||
width = lbar.children().css('width').slice(0, -1)
|
||||
$timeout.flush()
|
||||
width2 = lbar.children().css('width').slice(0, -1)
|
||||
expect(width2).toBeGreaterThan width
|
||||
expect(width2 - width).toBeBetween(0, 2)
|
||||
|
||||
# increments 0.5%
|
||||
cfpLoadingBar.set(0.9)
|
||||
lbar = angular.element(document.getElementById('loading-bar'))
|
||||
width = lbar.children().css('width').slice(0, -1)
|
||||
$timeout.flush()
|
||||
width2 = lbar.children().css('width').slice(0, -1)
|
||||
expect(width2).toBeGreaterThan width
|
||||
expect(width2 - width).toBe 0.5
|
||||
|
||||
cfpLoadingBar.set(0.97)
|
||||
lbar = angular.element(document.getElementById('loading-bar'))
|
||||
width = lbar.children().css('width').slice(0, -1)
|
||||
$timeout.flush()
|
||||
width2 = lbar.children().css('width').slice(0, -1)
|
||||
expect(width2).toBeGreaterThan width
|
||||
expect(width2 - width).toBe 0.5
|
||||
|
||||
# stops incrementing:
|
||||
cfpLoadingBar.set(0.99)
|
||||
lbar = angular.element(document.getElementById('loading-bar'))
|
||||
width = lbar.children().css('width').slice(0, -1)
|
||||
$timeout.flush()
|
||||
width2 = lbar.children().css('width').slice(0, -1)
|
||||
expect(width2).toBe width
|
||||
|
||||
|
||||
cfpLoadingBar.complete()
|
||||
$timeout.flush()
|
||||
|
||||
it 'should not set the status if the loading bar has not yet been started', inject (cfpLoadingBar) ->
|
||||
cfpLoadingBar.set(0.5)
|
||||
expect(cfpLoadingBar.status()).toBe 0
|
||||
cfpLoadingBar.set(0.3)
|
||||
expect(cfpLoadingBar.status()).toBe 0
|
||||
|
||||
cfpLoadingBar.start()
|
||||
cfpLoadingBar.set(0.3)
|
||||
expect(cfpLoadingBar.status()).toBe 0.3
|
||||
|
||||
cfpLoadingBar.complete()
|
||||
$timeout.flush()
|
||||
|
||||
it 'should broadcast started and completed events', inject (cfpLoadingBar, $rootScope) ->
|
||||
startedEventCalled = false
|
||||
completedEventCalled = false
|
||||
|
||||
$rootScope.$on 'cfpLoadingBar:started', (event) ->
|
||||
startedEventCalled = true
|
||||
|
||||
$rootScope.$on 'cfpLoadingBar:completed', (event) ->
|
||||
completedEventCalled = true
|
||||
|
||||
expect(startedEventCalled).toBe false
|
||||
expect(completedEventCalled).toBe false
|
||||
|
||||
cfpLoadingBar.start()
|
||||
expect(startedEventCalled).toBe true
|
||||
|
||||
cfpLoadingBar.complete()
|
||||
expect(completedEventCalled).toBe true
|
||||
$timeout.flush()
|
||||
|
||||
it 'should debounce the calls to start()', inject (cfpLoadingBar, $rootScope) ->
|
||||
startedEventCalled = 0
|
||||
$rootScope.$on 'cfpLoadingBar:started', (event) ->
|
||||
startedEventCalled += 1
|
||||
|
||||
cfpLoadingBar.start()
|
||||
expect(startedEventCalled).toBe 1
|
||||
cfpLoadingBar.start()
|
||||
expect(startedEventCalled).toBe 1 # Should still be one, as complete was never called:
|
||||
cfpLoadingBar.complete()
|
||||
$timeout.flush()
|
||||
flush()
|
||||
|
||||
|
||||
cfpLoadingBar.start()
|
||||
expect(startedEventCalled).toBe 2
|
||||
cfpLoadingBar.complete()
|
||||
$timeout.flush()
|
||||
|
||||
it 'should ignore requests when ignoreLoadingBar is true', inject (cfpLoadingBar) ->
|
||||
$httpBackend.expectGET(endpoint).respond response
|
||||
$http.get(endpoint, {ignoreLoadingBar: true})
|
||||
$httpBackend.flush()
|
||||
|
||||
injected = isLoadingBarInjected $document.find(cfpLoadingBar.parentSelector)
|
||||
expect(injected).toBe false
|
||||
|
||||
$timeout.flush()
|
||||
|
||||
it 'should ignore responses when ignoreLoadingBar is true (#70)', inject (cfpLoadingBar) ->
|
||||
$httpBackend.expectGET(endpoint).respond response
|
||||
$httpBackend.expectGET('/service2').respond response
|
||||
|
||||
$http.get(endpoint, {ignoreLoadingBar: true})
|
||||
$http.get('/service2')
|
||||
|
||||
expect(cfpLoadingBar.status()).toBe 0
|
||||
$httpBackend.flush(1) # flush only the ignored request
|
||||
expect(cfpLoadingBar.status()).toBe 0
|
||||
|
||||
$timeout.flush()
|
||||
$httpBackend.flush()
|
||||
|
||||
expect(cfpLoadingBar.status()).toBe 1
|
||||
$timeout.flush() # loading bar is animated, so flush timeout
|
||||
|
||||
it 'should ignore errors when ignoreLoadingBar is true (#70)', inject (cfpLoadingBar) ->
|
||||
$httpBackend.expectGET(endpoint).respond 400
|
||||
$httpBackend.expectGET('/service2').respond 400
|
||||
|
||||
$http.get(endpoint, {ignoreLoadingBar: true})
|
||||
$http.get('/service2')
|
||||
|
||||
expect(cfpLoadingBar.status()).toBe 0
|
||||
$httpBackend.flush(1) # flush only the ignored request
|
||||
expect(cfpLoadingBar.status()).toBe 0
|
||||
|
||||
$timeout.flush()
|
||||
$httpBackend.flush()
|
||||
|
||||
expect(cfpLoadingBar.status()).toBe 1
|
||||
$timeout.flush() # loading bar is animated, so flush timeout
|
||||
|
||||
|
||||
|
||||
describe 'LoadingBar only', ->
|
||||
cfpLoadingBar = $document = $timeout = $animate = null
|
||||
|
||||
beforeEach ->
|
||||
module 'cfp.loadingBar', 'ngAnimateMock'
|
||||
|
||||
inject (_$http_, _$httpBackend_, _$document_, _$timeout_, _$animate_, _cfpLoadingBar_) ->
|
||||
$timeout = _$timeout_
|
||||
$document = _$document_
|
||||
$animate = _$animate_
|
||||
cfpLoadingBar = _cfpLoadingBar_
|
||||
|
||||
it 'should be capable of being used alone', ->
|
||||
# just a simple quick test to make sure:
|
||||
cfpLoadingBar.start()
|
||||
$timeout.flush()
|
||||
|
||||
# test setting progress
|
||||
cfpLoadingBar.set(0.4)
|
||||
expect(cfpLoadingBar.status()).toBe 0.4
|
||||
|
||||
# make sure it was injected into the DOM:
|
||||
expect(isLoadingBarInjected($document.find(cfpLoadingBar.parentSelector))).toBe true
|
||||
|
||||
cfpLoadingBar.set(0.9)
|
||||
expect(cfpLoadingBar.status()).toBe 0.9
|
||||
|
||||
# test the complete call, which should remove it from the DOM
|
||||
cfpLoadingBar.complete()
|
||||
$timeout.flush()
|
||||
expect(isLoadingBarInjected($document.find(cfpLoadingBar.parentSelector))).toBe false
|
||||
|
||||
it 'should start after multiple calls to complete()', ->
|
||||
cfpLoadingBar.start()
|
||||
$timeout.flush()
|
||||
expect(isLoadingBarInjected($document.find(cfpLoadingBar.parentSelector))).toBe true
|
||||
|
||||
cfpLoadingBar.complete()
|
||||
cfpLoadingBar.complete()
|
||||
cfpLoadingBar.start()
|
||||
$timeout.flush()
|
||||
|
||||
expect(isLoadingBarInjected($document.find(cfpLoadingBar.parentSelector))).toBe true
|
||||
|
||||
cfpLoadingBar.complete()
|
||||
$timeout.flush()
|
||||
flush()
|
||||
|
||||
expect(isLoadingBarInjected($document.find(cfpLoadingBar.parentSelector))).toBe false
|
||||
|
||||
|
||||
describe 'Interceptor tests', ->
|
||||
provider = $http = $httpBackend = $log = null
|
||||
endpoint = '/service'
|
||||
response = {message:'OK'}
|
||||
|
||||
describe 'Success response', ->
|
||||
|
||||
beforeEach ->
|
||||
module 'chieffancypants.loadingBar', ($httpProvider) ->
|
||||
provider = $httpProvider
|
||||
provider.interceptors.push ->
|
||||
response: (resp) ->
|
||||
return null
|
||||
return
|
||||
|
||||
inject (_$http_, _$httpBackend_, _$log_) ->
|
||||
$http = _$http_
|
||||
$httpBackend = _$httpBackend_
|
||||
$log = _$log_
|
||||
|
||||
|
||||
it 'should detect poorly implemented interceptors and warn accordingly', ->
|
||||
expect($log.error.logs.length).toBe 0
|
||||
|
||||
$httpBackend.expectGET(endpoint).respond 204
|
||||
$http.get(endpoint)
|
||||
$httpBackend.flush()
|
||||
|
||||
expect($log.error.logs.length).toBe 1
|
||||
expect($log.error.logs).toContain ['Broken interceptor detected: Config object not supplied in response:\n https://github.com/chieffancypants/angular-loading-bar/pull/50']
|
||||
|
||||
describe 'Error response', ->
|
||||
|
||||
beforeEach ->
|
||||
module 'chieffancypants.loadingBar', ($httpProvider) ->
|
||||
provider = $httpProvider
|
||||
provider.interceptors.push ($q) ->
|
||||
responseError: (resp) ->
|
||||
delete resp.config
|
||||
$q.reject(resp);
|
||||
return
|
||||
|
||||
inject (_$http_, _$httpBackend_, _$log_) ->
|
||||
$http = _$http_
|
||||
$httpBackend = _$httpBackend_
|
||||
$log = _$log_
|
||||
|
||||
|
||||
it 'should detect poorly implemented interceptors and warn accordingly', ->
|
||||
expect($log.error.logs.length).toBe 0
|
||||
|
||||
$httpBackend.expectGET(endpoint).respond 500
|
||||
$http.get(endpoint)
|
||||
$httpBackend.flush()
|
||||
|
||||
expect($log.error.logs.length).toBe 1
|
||||
expect($log.error.logs).toContain ['Broken interceptor detected: Config object not supplied in rejection:\n https://github.com/chieffancypants/angular-loading-bar/pull/50']
|
21
node_modules/angular-route/LICENSE.md
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 Angular
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
68
node_modules/angular-route/README.md
generated
vendored
Normal file
@ -0,0 +1,68 @@
|
||||
# packaged angular-route
|
||||
|
||||
This repo is for distribution on `npm` and `bower`. The source for this module is in the
|
||||
[main AngularJS repo](https://github.com/angular/angular.js/tree/master/src/ngRoute).
|
||||
Please file issues and pull requests against that repo.
|
||||
|
||||
## Install
|
||||
|
||||
You can install this package either with `npm` or with `bower`.
|
||||
|
||||
### npm
|
||||
|
||||
```shell
|
||||
npm install angular-route
|
||||
```
|
||||
|
||||
Then add `ngRoute` as a dependency for your app:
|
||||
|
||||
```javascript
|
||||
angular.module('myApp', [require('angular-route')]);
|
||||
```
|
||||
|
||||
### bower
|
||||
|
||||
```shell
|
||||
bower install angular-route
|
||||
```
|
||||
|
||||
Add a `<script>` to your `index.html`:
|
||||
|
||||
```html
|
||||
<script src="/bower_components/angular-route/angular-route.js"></script>
|
||||
```
|
||||
|
||||
Then add `ngRoute` as a dependency for your app:
|
||||
|
||||
```javascript
|
||||
angular.module('myApp', ['ngRoute']);
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
Documentation is available on the
|
||||
[AngularJS docs site](http://docs.angularjs.org/api/ngRoute).
|
||||
|
||||
## License
|
||||
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2010-2015 Google, Inc. http://angularjs.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|