Skip to content

Commit

Permalink
Merge pull request #19 from agoravoting/copyright
Browse files Browse the repository at this point in the history
Release 3.2.0
  • Loading branch information
edulix authored Jun 22, 2016
2 parents 31106a9 + e84c67f commit ba1ac92
Show file tree
Hide file tree
Showing 112 changed files with 1,978 additions and 431 deletions.
3 changes: 2 additions & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Victor Ramírez de la Corte <victor AT agoravoting DOT com>
Eduardo Robles Elvira <edulix AT agoravoting DOT com>
Javier Llorente Isidoro <javier AT agoravoting DOT com>
Daniel García Moreno <danigm AT agoravoting DOT com>
Victor Ramírez de la Corte <victor AT agoravoting DOT com>
Félix Robles Elvira <felix AT agoravoting DOT com>
31 changes: 20 additions & 11 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
/**
* This file is part of agora-gui-booth.
* Copyright (C) 2015-2016 Agora Voting SL <[email protected]>
* agora-gui-booth is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License.
* agora-gui-booth is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
* You should have received a copy of the GNU Affero General Public License
* along with agora-gui-booth. If not, see <http://www.gnu.org/licenses/>.
**/

/*jslint node: true */
'use strict';

var pkg = require('./package.json');
var AV_CONFIG_VERSION = '3.1.0';
var AV_CONFIG_VERSION = '3.2.0';

//Using exclusion patterns slows down Grunt significantly
//instead of creating a set of patterns like '**/*.js' and '!**/node_modules/**'
Expand Down Expand Up @@ -262,6 +279,7 @@ module.exports = function (grunt) {
'dist/libcompat-v3.0.1.min.js': 'temp/libcompat.js',
'dist/avWidgets.min.js': 'avWidgets.js',

"dist/locales/moment/en.js": "bower_components/moment/lang/en-gb.js",
"dist/locales/moment/es.js": "bower_components/moment/lang/es.js",
"dist/locales/moment/gl.js": "bower_components/moment/lang/gl.js",
"dist/locales/moment/ca.js": "bower_components/moment/lang/ca.js"
Expand All @@ -284,15 +302,6 @@ module.exports = function (grunt) {
}
}
},
imagemin: {
main:{
files: [{
expand: true, cwd:'dist/',
src:['**/{*.png,*.jpg}'],
dest: 'dist/'
}]
}
},
karma: {
options: {
frameworks: ['jasmine'],
Expand Down Expand Up @@ -339,7 +348,7 @@ module.exports = function (grunt) {

});

grunt.registerTask('build',['check_config', 'jshint','clean:before','less','autoprefixer','dom_munger','ngtemplates','cssmin','concat','merge-json','ngAnnotate','uglify','copy','htmlmin','imagemin','clean:after']);
grunt.registerTask('build',['check_config', 'jshint','clean:before','less','autoprefixer','dom_munger','ngtemplates','cssmin','concat','merge-json','ngAnnotate','uglify','copy','htmlmin','clean:after']);
grunt.registerTask('serve', ['dom_munger:read','jshint','connect', 'watch']);
grunt.registerTask('test',['dom_munger:read','karma:all_tests']);

Expand Down
19 changes: 0 additions & 19 deletions Makefile

This file was deleted.

37 changes: 31 additions & 6 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
/**
* This file is part of agora-gui-booth.
* Copyright (C) 2015-2016 Agora Voting SL <[email protected]>
* agora-gui-booth is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License.
* agora-gui-booth is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
* You should have received a copy of the GNU Affero General Public License
* along with agora-gui-booth. If not, see <http://www.gnu.org/licenses/>.
**/

window.avConfigData.base = '/booth';

angular.module(
'agora-core-view',
'agora-gui-booth',
['ui.bootstrap',
'ui.utils',
'ui.router',
Expand All @@ -20,7 +39,8 @@ angular.module(
'dndLists',
'angularLoad',
'angular-date-picker-polyfill',
'ng-autofocus'
'ng-autofocus',
'agora-gui-common'
]);

angular.module('jm.i18next').config(function ($i18nextProvider, ConfigServiceProvider) {
Expand All @@ -42,7 +62,11 @@ angular.module('jm.i18next').config(function ($i18nextProvider, ConfigServicePro
ConfigServiceProvider.i18nextInitOptions);
});

angular.module('agora-core-view').config(
angular.module('agora-gui-booth').config(function($sceDelegateProvider, ConfigServiceProvider) {
$sceDelegateProvider.resourceUrlWhitelist(ConfigServiceProvider.resourceUrlWhitelist);
});

angular.module('agora-gui-booth').config(
function(
$stateProvider,
$urlRouterProvider,
Expand Down Expand Up @@ -103,8 +127,9 @@ angular.module('agora-core-view').config(
});
});

angular.module('agora-core-view').run(function($http, $rootScope) {
angular.module('agora-gui-booth').run(function($http, $rootScope, ConfigService) {

$rootScope.boothTitle = ConfigService.webTitle;
$rootScope.safeApply = function(fn) {
var phase = $rootScope.$$phase;
if (phase === '$apply' || phase === '$digest') {
Expand Down Expand Up @@ -132,7 +157,7 @@ angular.module('agora-core-view').run(function($http, $rootScope) {
/*
This directive allows us to pass a function in on an enter key to do what we want.
*/
angular.module('agora-core-view').directive('ngEnter', function () {
angular.module('agora-gui-booth').directive('ngEnter', function () {
return function (scope, element, attrs) {
element.bind("keydown keypress", function (event) {
if(event.which === 13) {
Expand All @@ -153,7 +178,7 @@ angular.module('agora-core-view').directive('ngEnter', function () {
* @Param end, default is "..."
* @return string
*/
angular.module('agora-core-view').filter('truncate', function () {
angular.module('agora-gui-booth').filter('truncate', function () {
return function (text, length, end) {
if (isNaN(length)) {
length = 10;
Expand Down
19 changes: 18 additions & 1 deletion app.less
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
/**
* This file is part of agora-gui-booth.
* Copyright (C) 2015-2016 Agora Voting SL <[email protected]>
* agora-gui-booth is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License.
* agora-gui-booth is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
* You should have received a copy of the GNU Affero General Public License
* along with agora-gui-booth. If not, see <http://www.gnu.org/licenses/>.
**/

/* avBooth */
@import "avBooth/2questions-conditional-screen-directive/2questions-conditional-screen-directive.less";
@import "avBooth/accordion-option-directive/accordion-option-directive.less";
@import "avBooth/accordion-options-directive/accordion-options-directive.less";
@import "avBooth/conditional-accordion-screen-directive/conditional-accordion-screen-directive.less";
@import "avBooth/available-options-directive/available-options-directive.less";
@import "avBooth/audit-ballot-screen-directive/audit-ballot-screen-directive.less";
@import "avBooth/ballot-locator-screen-directive/ballot-locator-screen-directive.less";
@import "avBooth/booth-directive/booth-directive.less";
@import "avBooth/busy-directive/busy-directive.less";
@import "avBooth/casting-ballot-screen-directive/casting-ballot-screen-directive.less";
Expand All @@ -21,6 +37,7 @@
@import "avBooth/pairwise-beta-directive/pairwise-beta-directive.less";
@import "avBooth/multi-question-directive/multi-question-directive.less";
@import "avBooth/selected-options-directive/selected-options-directive.less";
@import "avBooth/simultaneous-questions-screen-directive/simultaneous-questions-screen-directive.less";
@import "avBooth/start-screen-directive/start-screen-directive.less";
@import "avBooth/circle-option-directive/circle-option-directive.less";
@import "avBooth/success-screen-directive/success-screen-directive.less";
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="container">
<div class="row avb-top-navbar">
<div class="pull-left"
ng-i18next="[html:i18next]({sprintf:['1','3']})avBooth.stepNumber">
ng-i18next="[html:i18next]({num:'1', total: '3', url: organization.orgUrl, name: organization.orgName})avBooth.stepNumber">
</div>
<div class="pull-right">
<span
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,31 @@
/**
* This file is part of agora-gui-booth.
* Copyright (C) 2015-2016 Agora Voting SL <[email protected]>
* agora-gui-booth is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License.
* agora-gui-booth is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
* You should have received a copy of the GNU Affero General Public License
* along with agora-gui-booth. If not, see <http://www.gnu.org/licenses/>.
**/

/*
* Drafts election screen directive.
*
* This is a multiple question view, crafted for a specific election that has
* some unique details.
*/
angular.module('avBooth')
.directive('avb2questionsConditionalScreen', function($i18next, $filter, $interpolate, $timeout, $window) {
.directive('avb2questionsConditionalScreen', function($i18next, $filter, $interpolate, $timeout, $window, ConfigService) {

var link = function(scope, element, attrs) {
scope.organization = ConfigService.organization;
_.each(scope.election.questions, function(question) {
_.each(question.answers, function (answer) {
if (answer.selected === undefined) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/**
* This file is part of agora-gui-booth.
* Copyright (C) 2015-2016 Agora Voting SL <[email protected]>
* agora-gui-booth is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License.
* agora-gui-booth is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
* You should have received a copy of the GNU Affero General Public License
* along with agora-gui-booth. If not, see <http://www.gnu.org/licenses/>.
**/

[avb-2questions-conditional-screen] {
.opt {
font-size: 20px;
Expand Down
19 changes: 12 additions & 7 deletions avBooth/accordion-option-directive/accordion-option-directive.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,22 @@
{{option.category}}
</span>

<div
ng-if="!!isYoutube(option)"
class="videoWrapper">
<iframe
width="560"
height="315"
src="{{isYoutube(option)}}"
frameborder="0"
allowfullscreen>
</iframe>
</div>
<div class="vertilize">
<div class="vertilize-col vert-align-top">
<img
av-auto-height
additional-height="-5"
parent-selector=".vertilize"
sibling-selector=".text-sibling"

parent
ng-if="!!urls['Image URL']"
ng-if="!isYoutube(option) && !!urls['Image URL']"
ng-src="{{urls['Image URL']}}"
alt="{{option.text}}" />
</div>
Expand All @@ -31,7 +37,6 @@
<span ng-if="ordered && showSelectedPos && option.selected > -1">
{{option.selected + 1}}.
</span>
<span ng-if="option.tag">{{option.tag}}:</span>
<span>{{option.text}}</span>
</strong>
<p class="details" ng-if="option.details && option.details.length > 1" ng-bind-html="option.details">
Expand Down
54 changes: 53 additions & 1 deletion avBooth/accordion-option-directive/accordion-option-directive.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,66 @@
/**
* This file is part of agora-gui-booth.
* Copyright (C) 2015-2016 Agora Voting SL <[email protected]>
* agora-gui-booth is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License.
* agora-gui-booth is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
* You should have received a copy of the GNU Affero General Public License
* along with agora-gui-booth. If not, see <http://www.gnu.org/licenses/>.
**/

/*
* Directive that shows an accordion option.
*/
angular.module('avBooth')
.directive('avbAccordionOption', function() {
.directive('avbAccordionOption', function($sce) {

var link = function(scope, element, attrs) {
scope.urls = _.object(_.map(scope.option.urls, function(url) {
return [url.title, url.url];
}));

/**
* Returns the answer's urls as an associative array
*/
scope.getUrls = function (answer) {
return _.object(_.map(answer.urls, function(url) {
return [url.title, url.url];
}));
};

// check is youtube
scope.isYoutube = function (answer) {
var url = scope.getUrls(answer)['Image URL'];
if (!url) {
return false;
}

if (url.indexOf("https://youtube.com/embed/") === 0) {
return $sce.trustAsResourceUrl(url);
}

if (url.indexOf("https://www.youtube.com/watch?v=") === 0) {
return $sce.trustAsResourceUrl(url
.replace("/watch?v=", "/embed/")
.replace("&feature=youtu.be", ""));
}

if (url.indexOf("https://youtu.be/") === 0) {
return $sce.trustAsResourceUrl(url
.replace("https://youtu.be/", "https://youtube.com/embed/")
.replace("&feature=youtu.be", ""));
}

return false;
};

scope.showCategory = false;
if (!!attrs.showCategory) {
scope.showCategory = true;
Expand Down
Loading

0 comments on commit ba1ac92

Please sign in to comment.