Fix gitignore
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
parent
fa20cda748
commit
558c78f9f4
39
.gitignore
vendored
39
.gitignore
vendored
|
@ -1,23 +1,26 @@
|
||||||
.DS_Store
|
.DS_Store
|
||||||
.sass-cache/
|
|
||||||
.project/
|
|
||||||
.idea/
|
|
||||||
build/
|
|
||||||
css/*.map
|
|
||||||
js/*forms.*
|
|
||||||
js/chunks/
|
|
||||||
js/*.svg
|
|
||||||
nbproject/
|
|
||||||
node_modules/
|
node_modules/
|
||||||
npm-debug.log
|
vendor/
|
||||||
Thumbs.db
|
npm-debug.log*
|
||||||
yarn-error.log
|
yarn-debug.log*
|
||||||
*.cmd
|
yarn-error.log*
|
||||||
*.lock
|
composer.lock
|
||||||
*.iml
|
|
||||||
|
# Editor directories and files
|
||||||
|
.idea
|
||||||
|
.vscode
|
||||||
|
*.suo
|
||||||
*.ntvs*
|
*.ntvs*
|
||||||
*.njsproj
|
*.njsproj
|
||||||
*.sln
|
*.sln
|
||||||
*.suo
|
|
||||||
.svn
|
.marginalia
|
||||||
vendor/
|
|
||||||
|
build/
|
||||||
|
coverage/
|
||||||
|
|
||||||
|
cypress/screenshots
|
||||||
|
cypress/snapshots
|
||||||
|
|
||||||
|
# Compiled files
|
||||||
|
js/
|
||||||
|
|
46
js/.jshintrc
46
js/.jshintrc
|
@ -1,46 +0,0 @@
|
||||||
{
|
|
||||||
"curly": true,
|
|
||||||
"eqeqeq": true,
|
|
||||||
"immed": true,
|
|
||||||
"indent": 4,
|
|
||||||
"latedef": true,
|
|
||||||
"noarg": true,
|
|
||||||
"noempty": true,
|
|
||||||
"nonew": true,
|
|
||||||
"plusplus": false,
|
|
||||||
"node": true,
|
|
||||||
"undef": true,
|
|
||||||
"unused": false,
|
|
||||||
"strict": false,
|
|
||||||
"maxparams": false,
|
|
||||||
"maxdepth": 4,
|
|
||||||
"esversion": 6,
|
|
||||||
"browser": true,
|
|
||||||
"devel": true,
|
|
||||||
"jquery": true,
|
|
||||||
"jasmine": true,
|
|
||||||
"laxbreak": true,
|
|
||||||
"globals": {
|
|
||||||
"jQuery": true,
|
|
||||||
"ICAL": true,
|
|
||||||
"jstz": true,
|
|
||||||
"moment": true,
|
|
||||||
"angular": true,
|
|
||||||
"app": true,
|
|
||||||
"OC": true,
|
|
||||||
"oc_current_user":true,
|
|
||||||
"oc_requesttoken": true,
|
|
||||||
"requestToken": true,
|
|
||||||
"inject": true,
|
|
||||||
"module": true,
|
|
||||||
"t": true,
|
|
||||||
"it": true,
|
|
||||||
"exports": true,
|
|
||||||
"escapeHTML": true,
|
|
||||||
"possible": true,
|
|
||||||
"dav": true,
|
|
||||||
"hslToRgb": true,
|
|
||||||
"autosize": true,
|
|
||||||
"_": true
|
|
||||||
}
|
|
||||||
}
|
|
14
js/app.js
14
js/app.js
|
@ -1,14 +0,0 @@
|
||||||
function deleteForm($formEl) {
|
|
||||||
var str = t('forms', 'Do you really want to delete this new form?') + '\n\n' + $($formEl).attr('data-value');
|
|
||||||
if (confirm(str)) {
|
|
||||||
var form = document.form_delete_form;
|
|
||||||
var hiddenId = document.createElement("input");
|
|
||||||
hiddenId.setAttribute("name", "formId");
|
|
||||||
hiddenId.setAttribute("type", "hidden");
|
|
||||||
form.appendChild(hiddenId);
|
|
||||||
form.elements.formId.value = $formEl.id.split('_')[2];
|
|
||||||
form.submit();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
11
js/survey.jquery.min.js
vendored
11
js/survey.jquery.min.js
vendored
File diff suppressed because one or more lines are too long
60
js/vote.js
60
js/vote.js
|
@ -1,60 +0,0 @@
|
||||||
var form = []
|
|
||||||
var questions = []
|
|
||||||
|
|
||||||
function sendDataToServer(survey) {
|
|
||||||
form.answers = survey.data;
|
|
||||||
form.userId = OC.getCurrentUser().uid;
|
|
||||||
if(form.userId == ''){
|
|
||||||
form.userId = 'anon_' + Date.now() + '_' + Math.floor(Math.random() * 10000)
|
|
||||||
}
|
|
||||||
form.questions = questions;
|
|
||||||
$.post(OC.generateUrl('apps/forms/insert/vote'), form)
|
|
||||||
.then((response) => {
|
|
||||||
}, (error) => {
|
|
||||||
/* eslint-disable-next-line no-console */
|
|
||||||
console.log(error.response)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function cssUpdate(survey, options){
|
|
||||||
console.log(options.cssClasses)
|
|
||||||
var classes = options.cssClasses
|
|
||||||
classes.root = 'sq-root'
|
|
||||||
classes.title = 'sq-title'
|
|
||||||
classes.item = 'sq-item'
|
|
||||||
classes.label = 'sq-label'
|
|
||||||
classes.description = 'sv-q-description'
|
|
||||||
|
|
||||||
if (options.question.isRequired) {
|
|
||||||
classes.title = 'sq-title sq-title-required'
|
|
||||||
classes.root = 'sq-root sq-root-required'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$(document).ready(function () {
|
|
||||||
var formJSON = $('#surveyContainer').attr('form')
|
|
||||||
var questionJSON = $('#surveyContainer').attr('questions')
|
|
||||||
|
|
||||||
form = JSON.parse(formJSON)
|
|
||||||
questions = JSON.parse(questionJSON)
|
|
||||||
|
|
||||||
var surveyJSON = {
|
|
||||||
title: form.title,
|
|
||||||
description: form.description,
|
|
||||||
questions: []
|
|
||||||
};
|
|
||||||
|
|
||||||
questions.forEach(q => {
|
|
||||||
var ans = []
|
|
||||||
q.answers.forEach(a => {
|
|
||||||
ans.push(a.text);
|
|
||||||
});
|
|
||||||
surveyJSON.questions.push({type: q.type, name: q.text, choices: ans, isRequired: 'true'});
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#surveyContainer').Survey({
|
|
||||||
model: new Survey.Model(surveyJSON),
|
|
||||||
onUpdateQuestionCssClasses: cssUpdate,
|
|
||||||
onComplete: sendDataToServer,
|
|
||||||
});
|
|
||||||
});
|
|
Loading…
Reference in a new issue