Anorgatarrak - Theme for wordpress 4.8

This commit is contained in:
Luca 2017-11-09 19:40:49 +01:00
parent 4b6fda3622
commit e8bde10663
26 changed files with 10760 additions and 43 deletions

View File

@ -1,11 +1,14 @@
//var anApp = angular.module('anApp',[]);
angular.module('anApp',[
'catalog',
'item'
'item',
'ngRoute',
'ngSanitize'
]);
$(document).ready(function() {
jQuery(document).ready(function() {
//console.log('ready');
var slsh;
//var slsh = new SlideShow('.slideshow', {timeout: 5000});
});

View File

@ -1,8 +1,16 @@
angular.
module('catalog').
component('anList',{
template : '<a ng-repeat="item in $ctrl.catalog" class="square" style="background-image:url(\'{{item.img}}\');" ng-href="#!/catalog/{{item.id}}"></a>',
controller : function anListController() {
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) {
$http.get('wp-json/wp/v2/entrevista').then(function(res) {
console.log(res.data);
$scope.entrevistas = res.data;
});
}
/*function anListController() {
this.catalog = [
{ id: '1', title: 'Item 1', description: 'Description 1', img: 'assets/anorga1.jpg'},
{ id: '2',title: 'Item 2', description: 'Description 2', img: 'assets/anorga2.jpg'},
@ -20,24 +28,42 @@ angular.
{ id: '9', title: 'Item 2', description: 'Description 2', img: 'assets/anorga2.jpg'},
{ id: '10', title: 'Item 2', description: 'Description 2', img: 'assets/anorga10.jpg'}
]
}
}*/
});
angular.
module('catalog').
component('anHome',{
templateUrl: 'app/catalog/home.template.html'
templateUrl: localized.partials + 'home.template.html',
controller: function($scope, $http, $routeParams) {
$http.get('wp-json/wp/v2/slideshow').then(function(res) {
$scope.slides = res.data;
//slsh = new SlideShow('.slideshow', {timeout: 4000});
//console.log('content');
});
//$http.get('wp-json/wp/v2/posts').then(function(res) { $scope.posts = res.data; });
}
});
angular.
module('catalog').
component('anContact',{
templateUrl: 'app/catalog/contact.template.html'
templateUrl: localized.partials + 'contact.template.html'
});
angular.
module('catalog').
component('anInfo',{
templateUrl: 'app/catalog/info.template.html'
templateUrl: localized.partials + 'info.template.html'
});
angular
.module('catalog')
.component('anContent',{
templateUrl: localized.partials + 'content.template.html',
controller: function($scope, $http, $routeParams, $sce) {
console.log($routeParams.slug);
$http.get('wp-json/wp/v2/pages/?slug='+$routeParams.slug).then(function(res) { $scope.post = res.data[0]; $scope.content = $sce.trustAsHtml($scope.post.content.rendered); });
}
});

View File

@ -2,17 +2,19 @@ angular.
module('catalog').
config(['$locationProvider', '$routeProvider',
function config($locationProvider, $routeProvider) {
$locationProvider.hashPrefix('!');
$routeProvider.
when('/catalog', {
//$locationProvider.hashPrefix('!');
$locationProvider.html5Mode(true);
$routeProvider
.when('/',{ template: '<an-home></an-home>'})
.when('/catalog', {
template: '<an-list></an-list>'
}).
when('/catalog/:itemId', {
})
.when('/catalog/:itemId', {
template: '<an-detail></an-detail>'
}).
when('/info', {template: '<an-info></an-info>'}).
when('/contact', {template: '<an-contact></an-contact>'}).
when('/',{ template: '<an-home></an-home>' });
})
.when('/info', {template: '<an-info></an-info>'})
.when('/contact', {template: '<an-contact></an-contact>'})
.when('/:slug',{template: '<an-content></an-content>'})
.otherwise({ redirectTo: '/'});
}
]);

View File

@ -1,23 +0,0 @@
<!--
<div class="container-fluid slider" style="padding:0;">
<div class="step">
<div class="content">
<div class="table">
<div class="table-cell">
<h2 class="anorgatarrak">Añorgatarrak</h2>
<p>Relatos desde la memoria y la memoria del trabajo </p>
</div>
</div>
</div>
</div>
</div>
-->
<ul class="slideshow">
<li>
<img class="step" style="background-image:url('assets/anorga3.jpg');" title="A" alt="A"></img></li>
<li><img class="step" style="background-image:url('assets/anorga8.jpg');" title="B" alt="B"></img></li>
<li><img class="step" style="background-image:url('assets/anorga6.jpg');" title="C" alt="C"></img></li>
</ul>
<script>
var slsh = new SlideShow('.slideshow', {timeout: 4000});
</script>

View File

@ -1,7 +1,7 @@
angular.
module('item').
component('anDetail', {
templateUrl: 'app/catalog/item-detail.template.html',
templateUrl: localized.partials + '/item-detail.template.html',
controller: ['$routeParams',
function ItemDetailController($routeParams) {
this.itemId = $routeParams.itemId;

28
footer.php Normal file
View File

@ -0,0 +1,28 @@
<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">Museum Cemento Rezola - Copyright 2017</p>
</div>
</footer>
</body>
</html>

155
functions.php Normal file
View File

@ -0,0 +1,155 @@
<?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');
//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('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('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' => 'entrevista'),
)
);
//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,array(100,100),true);
$_data['featured_image_thumbnail_url'] = $thumbnail[0];
$_data['excerpt_clean'] = strip_tags(get_the_excerpt($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 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'),
));
}
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_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');
?>

19
header.php Normal file
View 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="assets/favicon.png">
<?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>

70
index.php Normal file
View File

@ -0,0 +1,70 @@
<?php get_header(); ?>
<!-- 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>
<?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 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>
</header>
<!-- <an-list></an-list> -->
<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>
<?php //if (is_front_page() ) :?>
<!-- front-page -->
<div class="container" style="padding:30px 0;" ng-hide>
<div class="row">
<?php
$pages = get_pages();
foreach ($pages as $page) :
?>
<div class="col-md-4"><h2><?php echo $page->post_title; ?></h2><?php echo $page->post_excerpt; ?></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>-->
<?php endforeach; ?>
</div> <!-- row -->
</div><!-- container -->
<?php //endif; ?>
<?php get_footer(); ?>

21
node_modules/angular-sanitize/LICENSE.md generated vendored Normal file
View 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-sanitize/README.md generated vendored Normal file
View File

@ -0,0 +1,68 @@
# packaged angular-sanitize
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/ngSanitize).
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-sanitize
```
Then add `ngSanitize` as a dependency for your app:
```javascript
angular.module('myApp', [require('angular-sanitize')]);
```
### bower
```shell
bower install angular-sanitize
```
Add a `<script>` to your `index.html`:
```html
<script src="/bower_components/angular-sanitize/angular-sanitize.js"></script>
```
Then add `ngSanitize` as a dependency for your app:
```javascript
angular.module('myApp', ['ngSanitize']);
```
## Documentation
Documentation is available on the
[AngularJS docs site](http://docs.angularjs.org/api/ngSanitize).
## 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.

806
node_modules/angular-sanitize/angular-sanitize.js generated vendored Normal file
View File

@ -0,0 +1,806 @@
/**
* @license AngularJS v1.6.6
* (c) 2010-2017 Google, Inc. http://angularjs.org
* License: MIT
*/
(function(window, angular) {'use strict';
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Any commits to this file should be reviewed with security in mind. *
* Changes to this file can potentially create security vulnerabilities. *
* An approval from 2 Core members with history of modifying *
* this file is required. *
* *
* Does the change somehow allow for arbitrary javascript to be executed? *
* Or allows for someone to change the prototype of built-in objects? *
* Or gives undesired access to variables likes document or window? *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
var $sanitizeMinErr = angular.$$minErr('$sanitize');
var bind;
var extend;
var forEach;
var isDefined;
var lowercase;
var noop;
var nodeContains;
var htmlParser;
var htmlSanitizeWriter;
/**
* @ngdoc module
* @name ngSanitize
* @description
*
* # ngSanitize
*
* The `ngSanitize` module provides functionality to sanitize HTML.
*
*
* <div doc-module-components="ngSanitize"></div>
*
* See {@link ngSanitize.$sanitize `$sanitize`} for usage.
*/
/**
* @ngdoc service
* @name $sanitize
* @kind function
*
* @description
* Sanitizes an html string by stripping all potentially dangerous tokens.
*
* The input is sanitized by parsing the HTML into tokens. All safe tokens (from a whitelist) are
* then serialized back to properly escaped html string. This means that no unsafe input can make
* it into the returned string.
*
* The whitelist for URL sanitization of attribute values is configured using the functions
* `aHrefSanitizationWhitelist` and `imgSrcSanitizationWhitelist` of {@link ng.$compileProvider
* `$compileProvider`}.
*
* The input may also contain SVG markup if this is enabled via {@link $sanitizeProvider}.
*
* @param {string} html HTML input.
* @returns {string} Sanitized HTML.
*
* @example
<example module="sanitizeExample" deps="angular-sanitize.js" name="sanitize-service">
<file name="index.html">
<script>
angular.module('sanitizeExample', ['ngSanitize'])
.controller('ExampleController', ['$scope', '$sce', function($scope, $sce) {
$scope.snippet =
'<p style="color:blue">an html\n' +
'<em onmouseover="this.textContent=\'PWN3D!\'">click here</em>\n' +
'snippet</p>';
$scope.deliberatelyTrustDangerousSnippet = function() {
return $sce.trustAsHtml($scope.snippet);
};
}]);
</script>
<div ng-controller="ExampleController">
Snippet: <textarea ng-model="snippet" cols="60" rows="3"></textarea>
<table>
<tr>
<td>Directive</td>
<td>How</td>
<td>Source</td>
<td>Rendered</td>
</tr>
<tr id="bind-html-with-sanitize">
<td>ng-bind-html</td>
<td>Automatically uses $sanitize</td>
<td><pre>&lt;div ng-bind-html="snippet"&gt;<br/>&lt;/div&gt;</pre></td>
<td><div ng-bind-html="snippet"></div></td>
</tr>
<tr id="bind-html-with-trust">
<td>ng-bind-html</td>
<td>Bypass $sanitize by explicitly trusting the dangerous value</td>
<td>
<pre>&lt;div ng-bind-html="deliberatelyTrustDangerousSnippet()"&gt;
&lt;/div&gt;</pre>
</td>
<td><div ng-bind-html="deliberatelyTrustDangerousSnippet()"></div></td>
</tr>
<tr id="bind-default">
<td>ng-bind</td>
<td>Automatically escapes</td>
<td><pre>&lt;div ng-bind="snippet"&gt;<br/>&lt;/div&gt;</pre></td>
<td><div ng-bind="snippet"></div></td>
</tr>
</table>
</div>
</file>
<file name="protractor.js" type="protractor">
it('should sanitize the html snippet by default', function() {
expect(element(by.css('#bind-html-with-sanitize div')).getAttribute('innerHTML')).
toBe('<p>an html\n<em>click here</em>\nsnippet</p>');
});
it('should inline raw snippet if bound to a trusted value', function() {
expect(element(by.css('#bind-html-with-trust div')).getAttribute('innerHTML')).
toBe("<p style=\"color:blue\">an html\n" +
"<em onmouseover=\"this.textContent='PWN3D!'\">click here</em>\n" +
"snippet</p>");
});
it('should escape snippet without any filter', function() {
expect(element(by.css('#bind-default div')).getAttribute('innerHTML')).
toBe("&lt;p style=\"color:blue\"&gt;an html\n" +
"&lt;em onmouseover=\"this.textContent='PWN3D!'\"&gt;click here&lt;/em&gt;\n" +
"snippet&lt;/p&gt;");
});
it('should update', function() {
element(by.model('snippet')).clear();
element(by.model('snippet')).sendKeys('new <b onclick="alert(1)">text</b>');
expect(element(by.css('#bind-html-with-sanitize div')).getAttribute('innerHTML')).
toBe('new <b>text</b>');
expect(element(by.css('#bind-html-with-trust div')).getAttribute('innerHTML')).toBe(
'new <b onclick="alert(1)">text</b>');
expect(element(by.css('#bind-default div')).getAttribute('innerHTML')).toBe(
"new &lt;b onclick=\"alert(1)\"&gt;text&lt;/b&gt;");
});
</file>
</example>
*/
/**
* @ngdoc provider
* @name $sanitizeProvider
* @this
*
* @description
* Creates and configures {@link $sanitize} instance.
*/
function $SanitizeProvider() {
var svgEnabled = false;
this.$get = ['$$sanitizeUri', function($$sanitizeUri) {
if (svgEnabled) {
extend(validElements, svgElements);
}
return function(html) {
var buf = [];
htmlParser(html, htmlSanitizeWriter(buf, function(uri, isImage) {
return !/^unsafe:/.test($$sanitizeUri(uri, isImage));
}));
return buf.join('');
};
}];
/**
* @ngdoc method
* @name $sanitizeProvider#enableSvg
* @kind function
*
* @description
* Enables a subset of svg to be supported by the sanitizer.
*
* <div class="alert alert-warning">
* <p>By enabling this setting without taking other precautions, you might expose your
* application to click-hijacking attacks. In these attacks, sanitized svg elements could be positioned
* outside of the containing element and be rendered over other elements on the page (e.g. a login
* link). Such behavior can then result in phishing incidents.</p>
*
* <p>To protect against these, explicitly setup `overflow: hidden` css rule for all potential svg
* tags within the sanitized content:</p>
*
* <br>
*
* <pre><code>
* .rootOfTheIncludedContent svg {
* overflow: hidden !important;
* }
* </code></pre>
* </div>
*
* @param {boolean=} flag Enable or disable SVG support in the sanitizer.
* @returns {boolean|ng.$sanitizeProvider} Returns the currently configured value if called
* without an argument or self for chaining otherwise.
*/
this.enableSvg = function(enableSvg) {
if (isDefined(enableSvg)) {
svgEnabled = enableSvg;
return this;
} else {
return svgEnabled;
}
};
//////////////////////////////////////////////////////////////////////////////////////////////////
// Private stuff
//////////////////////////////////////////////////////////////////////////////////////////////////
bind = angular.bind;
extend = angular.extend;
forEach = angular.forEach;
isDefined = angular.isDefined;
lowercase = angular.lowercase;
noop = angular.noop;
htmlParser = htmlParserImpl;
htmlSanitizeWriter = htmlSanitizeWriterImpl;
nodeContains = window.Node.prototype.contains || /** @this */ function(arg) {
// eslint-disable-next-line no-bitwise
return !!(this.compareDocumentPosition(arg) & 16);
};
// Regular Expressions for parsing tags and attributes
var SURROGATE_PAIR_REGEXP = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g,
// Match everything outside of normal chars and " (quote character)
NON_ALPHANUMERIC_REGEXP = /([^#-~ |!])/g;
// Good source of info about elements and attributes
// http://dev.w3.org/html5/spec/Overview.html#semantics
// http://simon.html5.org/html-elements
// Safe Void Elements - HTML5
// http://dev.w3.org/html5/spec/Overview.html#void-elements
var voidElements = toMap('area,br,col,hr,img,wbr');
// Elements that you can, intentionally, leave open (and which close themselves)
// http://dev.w3.org/html5/spec/Overview.html#optional-tags
var optionalEndTagBlockElements = toMap('colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr'),
optionalEndTagInlineElements = toMap('rp,rt'),
optionalEndTagElements = extend({},
optionalEndTagInlineElements,
optionalEndTagBlockElements);
// Safe Block Elements - HTML5
var blockElements = extend({}, optionalEndTagBlockElements, toMap('address,article,' +
'aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,' +
'h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,section,table,ul'));
// Inline Elements - HTML5
var inlineElements = extend({}, optionalEndTagInlineElements, toMap('a,abbr,acronym,b,' +
'bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,' +
'samp,small,span,strike,strong,sub,sup,time,tt,u,var'));
// SVG Elements
// https://wiki.whatwg.org/wiki/Sanitization_rules#svg_Elements
// Note: the elements animate,animateColor,animateMotion,animateTransform,set are intentionally omitted.
// They can potentially allow for arbitrary javascript to be executed. See #11290
var svgElements = toMap('circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,' +
'hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,' +
'radialGradient,rect,stop,svg,switch,text,title,tspan');
// Blocked Elements (will be stripped)
var blockedElements = toMap('script,style');
var validElements = extend({},
voidElements,
blockElements,
inlineElements,
optionalEndTagElements);
//Attributes that have href and hence need to be sanitized
var uriAttrs = toMap('background,cite,href,longdesc,src,xlink:href');
var htmlAttrs = toMap('abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,' +
'color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,' +
'ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,' +
'scope,scrolling,shape,size,span,start,summary,tabindex,target,title,type,' +
'valign,value,vspace,width');
// SVG attributes (without "id" and "name" attributes)
// https://wiki.whatwg.org/wiki/Sanitization_rules#svg_Attributes
var svgAttrs = toMap('accent-height,accumulate,additive,alphabetic,arabic-form,ascent,' +
'baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,' +
'cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,' +
'font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,' +
'height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,keySplines,keyTimes,lang,' +
'marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mathematical,' +
'max,min,offset,opacity,orient,origin,overline-position,overline-thickness,panose-1,' +
'path,pathLength,points,preserveAspectRatio,r,refX,refY,repeatCount,repeatDur,' +
'requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,stemv,stop-color,' +
'stop-opacity,strikethrough-position,strikethrough-thickness,stroke,stroke-dasharray,' +
'stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,' +
'stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,underline-position,' +
'underline-thickness,unicode,unicode-range,units-per-em,values,version,viewBox,visibility,' +
'width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,xlink:show,xlink:title,' +
'xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,zoomAndPan', true);
var validAttrs = extend({},
uriAttrs,
svgAttrs,
htmlAttrs);
function toMap(str, lowercaseKeys) {
var obj = {}, items = str.split(','), i;
for (i = 0; i < items.length; i++) {
obj[lowercaseKeys ? lowercase(items[i]) : items[i]] = true;
}
return obj;
}
/**
* Create an inert document that contains the dirty HTML that needs sanitizing
* Depending upon browser support we use one of three strategies for doing this.
* Support: Safari 10.x -> XHR strategy
* Support: Firefox -> DomParser strategy
*/
var getInertBodyElement /* function(html: string): HTMLBodyElement */ = (function(window, document) {
var inertDocument;
if (document && document.implementation) {
inertDocument = document.implementation.createHTMLDocument('inert');
} else {
throw $sanitizeMinErr('noinert', 'Can\'t create an inert html document');
}
var inertBodyElement = (inertDocument.documentElement || inertDocument.getDocumentElement()).querySelector('body');
// Check for the Safari 10.1 bug - which allows JS to run inside the SVG G element
inertBodyElement.innerHTML = '<svg><g onload="this.parentNode.remove()"></g></svg>';
if (!inertBodyElement.querySelector('svg')) {
return getInertBodyElement_XHR;
} else {
// Check for the Firefox bug - which prevents the inner img JS from being sanitized
inertBodyElement.innerHTML = '<svg><p><style><img src="</style><img src=x onerror=alert(1)//">';
if (inertBodyElement.querySelector('svg img')) {
return getInertBodyElement_DOMParser;
} else {
return getInertBodyElement_InertDocument;
}
}
function getInertBodyElement_XHR(html) {
// We add this dummy element to ensure that the rest of the content is parsed as expected
// e.g. leading whitespace is maintained and tags like `<meta>` do not get hoisted to the `<head>` tag.
html = '<remove></remove>' + html;
try {
html = encodeURI(html);
} catch (e) {
return undefined;
}
var xhr = new window.XMLHttpRequest();
xhr.responseType = 'document';
xhr.open('GET', 'data:text/html;charset=utf-8,' + html, false);
xhr.send(null);
var body = xhr.response.body;
body.firstChild.remove();
return body;
}
function getInertBodyElement_DOMParser(html) {
// We add this dummy element to ensure that the rest of the content is parsed as expected
// e.g. leading whitespace is maintained and tags like `<meta>` do not get hoisted to the `<head>` tag.
html = '<remove></remove>' + html;
try {
var body = new window.DOMParser().parseFromString(html, 'text/html').body;
body.firstChild.remove();
return body;
} catch (e) {
return undefined;
}
}
function getInertBodyElement_InertDocument(html) {
inertBodyElement.innerHTML = html;
// Support: IE 9-11 only
// strip custom-namespaced attributes on IE<=11
if (document.documentMode) {
stripCustomNsAttrs(inertBodyElement);
}
return inertBodyElement;
}
})(window, window.document);
/**
* @example
* htmlParser(htmlString, {
* start: function(tag, attrs) {},
* end: function(tag) {},
* chars: function(text) {},
* comment: function(text) {}
* });
*
* @param {string} html string
* @param {object} handler
*/
function htmlParserImpl(html, handler) {
if (html === null || html === undefined) {
html = '';
} else if (typeof html !== 'string') {
html = '' + html;
}
var inertBodyElement = getInertBodyElement(html);
if (!inertBodyElement) return '';
//mXSS protection
var mXSSAttempts = 5;
do {
if (mXSSAttempts === 0) {
throw $sanitizeMinErr('uinput', 'Failed to sanitize html because the input is unstable');
}
mXSSAttempts--;
// trigger mXSS if it is going to happen by reading and writing the innerHTML
html = inertBodyElement.innerHTML;
inertBodyElement = getInertBodyElement(html);
} while (html !== inertBodyElement.innerHTML);
var node = inertBodyElement.firstChild;
while (node) {
switch (node.nodeType) {
case 1: // ELEMENT_NODE
handler.start(node.nodeName.toLowerCase(), attrToMap(node.attributes));
break;
case 3: // TEXT NODE
handler.chars(node.textContent);
break;
}
var nextNode;
if (!(nextNode = node.firstChild)) {
if (node.nodeType === 1) {
handler.end(node.nodeName.toLowerCase());
}
nextNode = getNonDescendant('nextSibling', node);
if (!nextNode) {
while (nextNode == null) {
node = getNonDescendant('parentNode', node);
if (node === inertBodyElement) break;
nextNode = getNonDescendant('nextSibling', node);
if (node.nodeType === 1) {
handler.end(node.nodeName.toLowerCase());
}
}
}
}
node = nextNode;
}
while ((node = inertBodyElement.firstChild)) {
inertBodyElement.removeChild(node);
}
}
function attrToMap(attrs) {
var map = {};
for (var i = 0, ii = attrs.length; i < ii; i++) {
var attr = attrs[i];
map[attr.name] = attr.value;
}
return map;
}
/**
* Escapes all potentially dangerous characters, so that the
* resulting string can be safely inserted into attribute or
* element text.
* @param value
* @returns {string} escaped text
*/
function encodeEntities(value) {
return value.
replace(/&/g, '&amp;').
replace(SURROGATE_PAIR_REGEXP, function(value) {
var hi = value.charCodeAt(0);
var low = value.charCodeAt(1);
return '&#' + (((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000) + ';';
}).
replace(NON_ALPHANUMERIC_REGEXP, function(value) {
return '&#' + value.charCodeAt(0) + ';';
}).
replace(/</g, '&lt;').
replace(/>/g, '&gt;');
}
/**
* create an HTML/XML writer which writes to buffer
* @param {Array} buf use buf.join('') to get out sanitized html string
* @returns {object} in the form of {
* start: function(tag, attrs) {},
* end: function(tag) {},
* chars: function(text) {},
* comment: function(text) {}
* }
*/
function htmlSanitizeWriterImpl(buf, uriValidator) {
var ignoreCurrentElement = false;
var out = bind(buf, buf.push);
return {
start: function(tag, attrs) {
tag = lowercase(tag);
if (!ignoreCurrentElement && blockedElements[tag]) {
ignoreCurrentElement = tag;
}
if (!ignoreCurrentElement && validElements[tag] === true) {
out('<');
out(tag);
forEach(attrs, function(value, key) {
var lkey = lowercase(key);
var isImage = (tag === 'img' && lkey === 'src') || (lkey === 'background');
if (validAttrs[lkey] === true &&
(uriAttrs[lkey] !== true || uriValidator(value, isImage))) {
out(' ');
out(key);
out('="');
out(encodeEntities(value));
out('"');
}
});
out('>');
}
},
end: function(tag) {
tag = lowercase(tag);
if (!ignoreCurrentElement && validElements[tag] === true && voidElements[tag] !== true) {
out('</');
out(tag);
out('>');
}
// eslint-disable-next-line eqeqeq
if (tag == ignoreCurrentElement) {
ignoreCurrentElement = false;
}
},
chars: function(chars) {
if (!ignoreCurrentElement) {
out(encodeEntities(chars));
}
}
};
}
/**
* When IE9-11 comes across an unknown namespaced attribute e.g. 'xlink:foo' it adds 'xmlns:ns1' attribute to declare
* ns1 namespace and prefixes the attribute with 'ns1' (e.g. 'ns1:xlink:foo'). This is undesirable since we don't want
* to allow any of these custom attributes. This method strips them all.
*
* @param node Root element to process
*/
function stripCustomNsAttrs(node) {
while (node) {
if (node.nodeType === window.Node.ELEMENT_NODE) {
var attrs = node.attributes;
for (var i = 0, l = attrs.length; i < l; i++) {
var attrNode = attrs[i];
var attrName = attrNode.name.toLowerCase();
if (attrName === 'xmlns:ns1' || attrName.lastIndexOf('ns1:', 0) === 0) {
node.removeAttributeNode(attrNode);
i--;
l--;
}
}
}
var nextNode = node.firstChild;
if (nextNode) {
stripCustomNsAttrs(nextNode);
}
node = getNonDescendant('nextSibling', node);
}
}
function getNonDescendant(propName, node) {
// An element is clobbered if its `propName` property points to one of its descendants
var nextNode = node[propName];
if (nextNode && nodeContains.call(node, nextNode)) {
throw $sanitizeMinErr('elclob', 'Failed to sanitize html because the element is clobbered: {0}', node.outerHTML || node.outerText);
}
return nextNode;
}
}
function sanitizeText(chars) {
var buf = [];
var writer = htmlSanitizeWriter(buf, noop);
writer.chars(chars);
return buf.join('');
}
// define ngSanitize module and register $sanitize service
angular.module('ngSanitize', [])
.provider('$sanitize', $SanitizeProvider)
.info({ angularVersion: '1.6.6' });
/**
* @ngdoc filter
* @name linky
* @kind function
*
* @description
* Finds links in text input and turns them into html links. Supports `http/https/ftp/mailto` and
* plain email address links.
*
* Requires the {@link ngSanitize `ngSanitize`} module to be installed.
*
* @param {string} text Input text.
* @param {string} target Window (`_blank|_self|_parent|_top`) or named frame to open links in.
* @param {object|function(url)} [attributes] Add custom attributes to the link element.
*
* Can be one of:
*
* - `object`: A map of attributes
* - `function`: Takes the url as a parameter and returns a map of attributes
*
* If the map of attributes contains a value for `target`, it overrides the value of
* the target parameter.
*
*
* @returns {string} Html-linkified and {@link $sanitize sanitized} text.
*
* @usage
<span ng-bind-html="linky_expression | linky"></span>
*
* @example
<example module="linkyExample" deps="angular-sanitize.js" name="linky-filter">
<file name="index.html">
<div ng-controller="ExampleController">
Snippet: <textarea ng-model="snippet" cols="60" rows="3"></textarea>
<table>
<tr>
<th>Filter</th>
<th>Source</th>
<th>Rendered</th>
</tr>
<tr id="linky-filter">
<td>linky filter</td>
<td>
<pre>&lt;div ng-bind-html="snippet | linky"&gt;<br>&lt;/div&gt;</pre>
</td>
<td>
<div ng-bind-html="snippet | linky"></div>
</td>
</tr>
<tr id="linky-target">
<td>linky target</td>
<td>
<pre>&lt;div ng-bind-html="snippetWithSingleURL | linky:'_blank'"&gt;<br>&lt;/div&gt;</pre>
</td>
<td>
<div ng-bind-html="snippetWithSingleURL | linky:'_blank'"></div>
</td>
</tr>
<tr id="linky-custom-attributes">
<td>linky custom attributes</td>
<td>
<pre>&lt;div ng-bind-html="snippetWithSingleURL | linky:'_self':{rel: 'nofollow'}"&gt;<br>&lt;/div&gt;</pre>
</td>
<td>
<div ng-bind-html="snippetWithSingleURL | linky:'_self':{rel: 'nofollow'}"></div>
</td>
</tr>
<tr id="escaped-html">
<td>no filter</td>
<td><pre>&lt;div ng-bind="snippet"&gt;<br>&lt;/div&gt;</pre></td>
<td><div ng-bind="snippet"></div></td>
</tr>
</table>
</file>
<file name="script.js">
angular.module('linkyExample', ['ngSanitize'])
.controller('ExampleController', ['$scope', function($scope) {
$scope.snippet =
'Pretty text with some links:\n' +
'http://angularjs.org/,\n' +
'mailto:us@somewhere.org,\n' +
'another@somewhere.org,\n' +
'and one more: ftp://127.0.0.1/.';
$scope.snippetWithSingleURL = 'http://angularjs.org/';
}]);
</file>
<file name="protractor.js" type="protractor">
it('should linkify the snippet with urls', function() {
expect(element(by.id('linky-filter')).element(by.binding('snippet | linky')).getText()).
toBe('Pretty text with some links: http://angularjs.org/, us@somewhere.org, ' +
'another@somewhere.org, and one more: ftp://127.0.0.1/.');
expect(element.all(by.css('#linky-filter a')).count()).toEqual(4);
});
it('should not linkify snippet without the linky filter', function() {
expect(element(by.id('escaped-html')).element(by.binding('snippet')).getText()).
toBe('Pretty text with some links: http://angularjs.org/, mailto:us@somewhere.org, ' +
'another@somewhere.org, and one more: ftp://127.0.0.1/.');
expect(element.all(by.css('#escaped-html a')).count()).toEqual(0);
});
it('should update', function() {
element(by.model('snippet')).clear();
element(by.model('snippet')).sendKeys('new http://link.');
expect(element(by.id('linky-filter')).element(by.binding('snippet | linky')).getText()).
toBe('new http://link.');
expect(element.all(by.css('#linky-filter a')).count()).toEqual(1);
expect(element(by.id('escaped-html')).element(by.binding('snippet')).getText())
.toBe('new http://link.');
});
it('should work with the target property', function() {
expect(element(by.id('linky-target')).
element(by.binding("snippetWithSingleURL | linky:'_blank'")).getText()).
toBe('http://angularjs.org/');
expect(element(by.css('#linky-target a')).getAttribute('target')).toEqual('_blank');
});
it('should optionally add custom attributes', function() {
expect(element(by.id('linky-custom-attributes')).
element(by.binding("snippetWithSingleURL | linky:'_self':{rel: 'nofollow'}")).getText()).
toBe('http://angularjs.org/');
expect(element(by.css('#linky-custom-attributes a')).getAttribute('rel')).toEqual('nofollow');
});
</file>
</example>
*/
angular.module('ngSanitize').filter('linky', ['$sanitize', function($sanitize) {
var LINKY_URL_REGEXP =
/((ftp|https?):\/\/|(www\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"\u201d\u2019]/i,
MAILTO_REGEXP = /^mailto:/i;
var linkyMinErr = angular.$$minErr('linky');
var isDefined = angular.isDefined;
var isFunction = angular.isFunction;
var isObject = angular.isObject;
var isString = angular.isString;
return function(text, target, attributes) {
if (text == null || text === '') return text;
if (!isString(text)) throw linkyMinErr('notstring', 'Expected string but received: {0}', text);
var attributesFn =
isFunction(attributes) ? attributes :
isObject(attributes) ? function getAttributesObject() {return attributes;} :
function getEmptyAttributesObject() {return {};};
var match;
var raw = text;
var html = [];
var url;
var i;
while ((match = raw.match(LINKY_URL_REGEXP))) {
// We can not end in these as they are sometimes found at the end of the sentence
url = match[0];
// if we did not match ftp/http/www/mailto then assume mailto
if (!match[2] && !match[4]) {
url = (match[3] ? 'http://' : 'mailto:') + url;
}
i = match.index;
addText(raw.substr(0, i));
addLink(url, match[0].replace(MAILTO_REGEXP, ''));
raw = raw.substring(i + match[0].length);
}
addText(raw);
return $sanitize(html.join(''));
function addText(text) {
if (!text) {
return;
}
html.push(sanitizeText(text));
}
function addLink(url, text) {
var key, linkAttributes = attributesFn(url);
html.push('<a ');
for (key in linkAttributes) {
html.push(key + '="' + linkAttributes[key] + '" ');
}
if (isDefined(target) && !('target' in linkAttributes)) {
html.push('target="',
target,
'" ');
}
html.push('href="',
url.replace(/"/g, '&quot;'),
'">');
addText(text);
html.push('</a>');
}
};
}]);
})(window, window.angular);

17
node_modules/angular-sanitize/angular-sanitize.min.js generated vendored Normal file
View File

@ -0,0 +1,17 @@
/*
AngularJS v1.6.6
(c) 2010-2017 Google, Inc. http://angularjs.org
License: MIT
*/
(function(s,d){'use strict';function J(d){var k=[];w(k,B).chars(d);return k.join("")}var x=d.$$minErr("$sanitize"),C,k,D,E,p,B,F,G,w;d.module("ngSanitize",[]).provider("$sanitize",function(){function g(a,e){var c={},b=a.split(","),f;for(f=0;f<b.length;f++)c[e?p(b[f]):b[f]]=!0;return c}function K(a){for(var e={},c=0,b=a.length;c<b;c++){var f=a[c];e[f.name]=f.value}return e}function H(a){return a.replace(/&/g,"&amp;").replace(L,function(a){var c=a.charCodeAt(0);a=a.charCodeAt(1);return"&#"+(1024*(c-
55296)+(a-56320)+65536)+";"}).replace(M,function(a){return"&#"+a.charCodeAt(0)+";"}).replace(/</g,"&lt;").replace(/>/g,"&gt;")}function I(a){for(;a;){if(a.nodeType===s.Node.ELEMENT_NODE)for(var e=a.attributes,c=0,b=e.length;c<b;c++){var f=e[c],h=f.name.toLowerCase();if("xmlns:ns1"===h||0===h.lastIndexOf("ns1:",0))a.removeAttributeNode(f),c--,b--}(e=a.firstChild)&&I(e);a=t("nextSibling",a)}}function t(a,e){var c=e[a];if(c&&F.call(e,c))throw x("elclob",e.outerHTML||e.outerText);return c}var y=!1;this.$get=
["$$sanitizeUri",function(a){y&&k(n,z);return function(e){var c=[];G(e,w(c,function(b,c){return!/^unsafe:/.test(a(b,c))}));return c.join("")}}];this.enableSvg=function(a){return E(a)?(y=a,this):y};C=d.bind;k=d.extend;D=d.forEach;E=d.isDefined;p=d.lowercase;B=d.noop;G=function(a,e){null===a||void 0===a?a="":"string"!==typeof a&&(a=""+a);var c=u(a);if(!c)return"";var b=5;do{if(0===b)throw x("uinput");b--;a=c.innerHTML;c=u(a)}while(a!==c.innerHTML);for(b=c.firstChild;b;){switch(b.nodeType){case 1:e.start(b.nodeName.toLowerCase(),
K(b.attributes));break;case 3:e.chars(b.textContent)}var f;if(!(f=b.firstChild)&&(1===b.nodeType&&e.end(b.nodeName.toLowerCase()),f=t("nextSibling",b),!f))for(;null==f;){b=t("parentNode",b);if(b===c)break;f=t("nextSibling",b);1===b.nodeType&&e.end(b.nodeName.toLowerCase())}b=f}for(;b=c.firstChild;)c.removeChild(b)};w=function(a,e){var c=!1,b=C(a,a.push);return{start:function(a,h){a=p(a);!c&&A[a]&&(c=a);c||!0!==n[a]||(b("<"),b(a),D(h,function(c,h){var d=p(h),g="img"===a&&"src"===d||"background"===
d;!0!==v[d]||!0===m[d]&&!e(c,g)||(b(" "),b(h),b('="'),b(H(c)),b('"'))}),b(">"))},end:function(a){a=p(a);c||!0!==n[a]||!0===h[a]||(b("</"),b(a),b(">"));a==c&&(c=!1)},chars:function(a){c||b(H(a))}}};F=s.Node.prototype.contains||function(a){return!!(this.compareDocumentPosition(a)&16)};var L=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,M=/([^#-~ |!])/g,h=g("area,br,col,hr,img,wbr"),q=g("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),l=g("rp,rt"),r=k({},l,q),q=k({},q,g("address,article,aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,section,table,ul")),
l=k({},l,g("a,abbr,acronym,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,samp,small,span,strike,strong,sub,sup,time,tt,u,var")),z=g("circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,radialGradient,rect,stop,svg,switch,text,title,tspan"),A=g("script,style"),n=k({},h,q,l,r),m=g("background,cite,href,longdesc,src,xlink:href"),r=g("abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,scope,scrolling,shape,size,span,start,summary,tabindex,target,title,type,valign,value,vspace,width"),
l=g("accent-height,accumulate,additive,alphabetic,arabic-form,ascent,baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,keySplines,keyTimes,lang,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mathematical,max,min,offset,opacity,orient,origin,overline-position,overline-thickness,panose-1,path,pathLength,points,preserveAspectRatio,r,refX,refY,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,stemv,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,underline-position,underline-thickness,unicode,unicode-range,units-per-em,values,version,viewBox,visibility,width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,zoomAndPan",
!0),v=k({},m,l,r),u=function(a,e){function c(b){b="<remove></remove>"+b;try{var c=(new a.DOMParser).parseFromString(b,"text/html").body;c.firstChild.remove();return c}catch(e){}}function b(a){d.innerHTML=a;e.documentMode&&I(d);return d}var h;if(e&&e.implementation)h=e.implementation.createHTMLDocument("inert");else throw x("noinert");var d=(h.documentElement||h.getDocumentElement()).querySelector("body");d.innerHTML='<svg><g onload="this.parentNode.remove()"></g></svg>';return d.querySelector("svg")?
(d.innerHTML='<svg><p><style><img src="</style><img src=x onerror=alert(1)//">',d.querySelector("svg img")?c:b):function(b){b="<remove></remove>"+b;try{b=encodeURI(b)}catch(c){return}var e=new a.XMLHttpRequest;e.responseType="document";e.open("GET","data:text/html;charset=utf-8,"+b,!1);e.send(null);b=e.response.body;b.firstChild.remove();return b}}(s,s.document)}).info({angularVersion:"1.6.6"});d.module("ngSanitize").filter("linky",["$sanitize",function(g){var k=/((ftp|https?):\/\/|(www\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"\u201d\u2019]/i,
p=/^mailto:/i,s=d.$$minErr("linky"),t=d.isDefined,y=d.isFunction,w=d.isObject,x=d.isString;return function(d,q,l){function r(a){a&&m.push(J(a))}function z(a,d){var c,b=A(a);m.push("<a ");for(c in b)m.push(c+'="'+b[c]+'" ');!t(q)||"target"in b||m.push('target="',q,'" ');m.push('href="',a.replace(/"/g,"&quot;"),'">');r(d);m.push("</a>")}if(null==d||""===d)return d;if(!x(d))throw s("notstring",d);for(var A=y(l)?l:w(l)?function(){return l}:function(){return{}},n=d,m=[],v,u;d=n.match(k);)v=d[0],d[2]||
d[4]||(v=(d[3]?"http://":"mailto:")+v),u=d.index,r(n.substr(0,u)),z(v,d[0].replace(p,"")),n=n.substring(u+d[0].length);r(n);return g(m.join(""))}}])})(window,window.angular);
//# sourceMappingURL=angular-sanitize.min.js.map

File diff suppressed because one or more lines are too long

10
node_modules/angular-sanitize/bower.json generated vendored Normal file
View File

@ -0,0 +1,10 @@
{
"name": "angular-sanitize",
"version": "1.6.6",
"license": "MIT",
"main": "./angular-sanitize.js",
"ignore": [],
"dependencies": {
"angular": "1.6.6"
}
}

2
node_modules/angular-sanitize/index.js generated vendored Normal file
View File

@ -0,0 +1,2 @@
require('./angular-sanitize');
module.exports = 'ngSanitize';

64
node_modules/angular-sanitize/package.json generated vendored Normal file
View File

@ -0,0 +1,64 @@
{
"_from": "angular-sanitize",
"_id": "angular-sanitize@1.6.6",
"_inBundle": false,
"_integrity": "sha1-D9BloZkxUX++zmZZbTJdcrbgYEE=",
"_location": "/angular-sanitize",
"_phantomChildren": {},
"_requested": {
"type": "tag",
"registry": true,
"raw": "angular-sanitize",
"name": "angular-sanitize",
"escapedName": "angular-sanitize",
"rawSpec": "",
"saveSpec": null,
"fetchSpec": "latest"
},
"_requiredBy": [
"#USER",
"/"
],
"_resolved": "https://registry.npmjs.org/angular-sanitize/-/angular-sanitize-1.6.6.tgz",
"_shasum": "0fd065a19931517fbece66596d325d72b6e06041",
"_spec": "angular-sanitize",
"_where": "/home/lrullo/httpdocs/anorgatarrak.eus/wp-content/themes/anorgatarrak",
"author": {
"name": "Angular Core Team",
"email": "angular-core+npm@google.com"
},
"bugs": {
"url": "https://github.com/angular/angular.js/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "AngularJS module for sanitizing HTML",
"homepage": "http://angularjs.org",
"jspm": {
"shim": {
"angular-sanitize": {
"deps": [
"angular"
]
}
}
},
"keywords": [
"angular",
"framework",
"browser",
"html",
"client-side"
],
"license": "MIT",
"main": "index.js",
"name": "angular-sanitize",
"repository": {
"type": "git",
"url": "git+https://github.com/angular/angular.js.git"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"version": "1.6.6"
}

9412
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,5 @@
<!-- load entrevistas -->
<div class="slideshow">
<a ng-repeat="e in entrevistas" class="square" style="background-image:url('{{e.featured_image_thumbnail_url}}');" ng-href="/catalog/{{e.id}}"></a>
</div>

View File

@ -0,0 +1,6 @@
<div class="row">
<div class="col-md-offset-1 col-md-10">
<h1>{{post.title.rendered}}</h1>
<div style="padding-bottom:30px;" ng-bind-html="content"></div>
</div>
</div>

View File

@ -0,0 +1,10 @@
<!-- load type slider -->
<ul class="slideshow">
<!--<li><img class="step" style="background-image:url('http://anorgatarrak.eus/wp-content/uploads/2017/11/anorga0.jpg');" title="Añorgatarrak" alt=""></img></li>-->
<li ng-repeat="slide in slides">
<img class="step" style="background-image:url('{{slide.featured_image_thumbnail_url}}');" title="{{slide.title.rendered}}" alt="{{slide.excerpt_clean}}"></img>
</li>
</ul>
<script>
slsh = new SlideShow('.slideshow', {timeout: 4000});
</script>

8
style.css Normal file
View File

@ -0,0 +1,8 @@
/*
Theme Name: Anorgatarrak Worpress
Author: Luca Rullo
Description: Anorgatarrak Wordpress theme for Museum Cemento Rezola
Version: 0.0.1
Tags: archive, repositori
*/