-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from agoravoting/copyright
Release 3.2.0
- Loading branch information
Showing
112 changed files
with
1,978 additions
and
431 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/**' | ||
|
@@ -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" | ||
|
@@ -284,15 +302,6 @@ module.exports = function (grunt) { | |
} | ||
} | ||
}, | ||
imagemin: { | ||
main:{ | ||
files: [{ | ||
expand: true, cwd:'dist/', | ||
src:['**/{*.png,*.jpg}'], | ||
dest: 'dist/' | ||
}] | ||
} | ||
}, | ||
karma: { | ||
options: { | ||
frameworks: ['jasmine'], | ||
|
@@ -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']); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', | ||
|
@@ -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) { | ||
|
@@ -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, | ||
|
@@ -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') { | ||
|
@@ -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) { | ||
|
@@ -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; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"; | ||
|
@@ -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"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 19 additions & 1 deletion
20
avBooth/2questions-conditional-screen-directive/2questions-conditional-screen-directive.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { | ||
|
17 changes: 17 additions & 0 deletions
17
avBooth/2questions-conditional-screen-directive/2questions-conditional-screen-directive.less
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 53 additions & 1 deletion
54
avBooth/accordion-option-directive/accordion-option-directive.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
|
Oops, something went wrong.