To create a new idea, you need to login or register
@@ -138,182 +157,187 @@ function show(ll) {
`;
- if(ulogin == "false") {SidePanel.show(htmlNotLoggedIn);}
- else {SidePanel.show(htmlIdea);
- M.updateTextFields();
-
-
- document.getElementById('tag_adder_collection').addEventListener('click', () => {
- let stringT = {id:""};
- stringT.id = document.getElementById("categoriesText").value;
- //Capitalize and remove Whitespaces in topics
- stringT.id = stringT.id.replace(/(^\w{1})|(\s+\w{1})/g, letter => letter.toUpperCase()).replace(/\s+/g, '');
-
- //generate chipt and display it
- const chip = generateChip(stringT);
- chip.appendChild(generateTagsIcon(stringT));
- document.getElementById('tag_adder_chips').appendChild(chip);
- document.getElementById('tag_adder').add(generateOption(stringT));
- tagsArray.push(stringT.id);
- console.log("topics to add to new idea: " + tagsArray);
-
- document.getElementById('categoriesText').value = '';
- document.getElementById('tag_adder_collection').classList.add('hide');
- });
-
-const generateTagsIcon = _ => {
- const i = document.createElement('i');
- i.addEventListener('click', () => {
- Array.from(document.getElementById('tag_adder').options).forEach(option => {
- if (option.dataset.id === _.id) {
- //remove tag from filterstring
- tagsArray = tagsArray.filter(item => item !== _.id);
- console.log("topics to add to new idea: " + tagsArray);
- option.remove();
- document.querySelector(`.chipTagAdder-${_.id}`).remove();
- }
- });
- });
- i.classList.add('close');
- i.classList.add('material-icons');
- i.innerText = 'close';
- return i;
-};
-
-new autoComplete({
- noResults: (dataFeedback, generateList) => {
- document.getElementById('tag_adder_collection').classList.remove('hide');
- },
- data: {
- src: async () => search(document.getElementById('categoriesText').value),
- key: ['id'],
- cache: false,
- },
- query: {
- manipulate: (query) => {
- document.getElementById('tag_adder_collection').classList.add('hide');
-
- return query;
- }
- },
- onSelection: feedback => {
- let stringT = feedback.selection.value;
- //Capitalize and remove Whitespaces in topics
- stringT.id = stringT.id.replace(/(^\w{1})|(\s+\w{1})/g, letter => letter.toUpperCase()).replace(/\s+/g, '');
-
- //generate chipt and display it
- const chip = generateTagAdderChip(stringT);
- chip.appendChild(generateTagsIcon(stringT));
- document.getElementById('tag_adder_chips').appendChild(chip);
- document.getElementById('tag_adder').add(generateOption(stringT));
- tagsArray.push(stringT.id);
- console.log("topics to add to new idea: " + tagsArray);
-
- document.getElementById('categoriesText').value = '';
- },
- resultsList: {
- render: true,
- container: source => {
- source.classList.add('tag-collection-wrapper');
- },
- destination: "#tag_adder_collection-wrapper",
- position: "beforeend",
- element: "ul"
- },
- highlight: true,
- trigger: query => query.length > 0,
- maxResults: 5,
- threshold: 1,
- debounce: 500,
- selector: "#categoriesText",
-});
-
-//autocomplete skills
- document.getElementById('skill_adder_collection').addEventListener('click', () => {
- let stringT = {id:""};
- stringT.id = document.getElementById("skillsText").value;
- //Capitalize and remove Whitespaces in topics
- stringT.id = stringT.id.replace(/(^\w{1})|(\s+\w{1})/g, letter => letter.toUpperCase()).replace(/\s+/g, '');
-
- //generate chipt and display it
- const chip = generateSkillAdderChip(stringT);
- chip.appendChild(generateSkillIcon(stringT));
- document.getElementById('skill_adder_chips').appendChild(chip);
- document.getElementById('skill_adder').add(generateOption(stringT));
- skillsArray.push(stringT.id);
- console.log("needed skill to add to new idea: " + skillsArray);
-
- document.getElementById('skillsText').value = '';
- document.getElementById('skill_adder_collection').classList.add('hide');
- });
-
-const generateSkillIcon = _ => {
- const i = document.createElement('i');
- i.addEventListener('click', () => {
- Array.from(document.getElementById('skill_adder').options).forEach(option => {
- if (option.dataset.id === _.id) {
- //remove tag from filterstring
- skillsArray = skillsArray.filter(item => item !== _.id);
- console.log("needed skills to add to new idea: " + skillsArray);
- option.remove();
- document.querySelector(`.chipSkillAdder-${_.id}`).remove();
- }
- });
- });
- i.classList.add('close');
- i.classList.add('material-icons');
- i.innerText = 'close';
- return i;
-};
-
-new autoComplete({
- noResults: (dataFeedback, generateList) => {
- document.getElementById('skill_adder_collection').classList.remove('hide');
- },
- data: {
- src: async () => searchSkills(document.getElementById('skillsText').value),
- key: ['id'],
- cache: false,
- },
- query: {
- manipulate: (query) => {
- document.getElementById('skill_adder_collection').classList.add('hide');
-
- return query;
+ if (ulogin == "false") {
+ SidePanel.show(htmlNotLoggedIn);
+ } else {
+ SidePanel.show(htmlIdea);
+ M.updateTextFields();
+
+
+ document.getElementById('tag_adder_collection').addEventListener('click', () => {
+ let stringT = {
+ id: ""
+ };
+ stringT.id = document.getElementById("categoriesText").value;
+ //Capitalize and remove Whitespaces in topics
+ stringT.id = stringT.id.replace(/(^\w{1})|(\s+\w{1})/g, letter => letter.toUpperCase()).replace(/\s+/g, '');
+
+ //generate chipt and display it
+ const chip = generateChip(stringT);
+ chip.appendChild(generateTagsIcon(stringT));
+ document.getElementById('tag_adder_chips').appendChild(chip);
+ document.getElementById('tag_adder').add(generateOption(stringT));
+ tagsArray.push(stringT.id);
+ console.log("topics to add to new idea: " + tagsArray);
+
+ document.getElementById('categoriesText').value = '';
+ document.getElementById('tag_adder_collection').classList.add('hide');
+ });
+
+ const generateTagsIcon = _ => {
+ const i = document.createElement('i');
+ i.addEventListener('click', () => {
+ Array.from(document.getElementById('tag_adder').options).forEach(option => {
+ if (option.dataset.id === _.id) {
+ //remove tag from filterstring
+ tagsArray = tagsArray.filter(item => item !== _.id);
+ console.log("topics to add to new idea: " + tagsArray);
+ option.remove();
+ document.querySelector(`.chipTagAdder-${_.id}`).remove();
+ }
+ });
+ });
+ i.classList.add('close');
+ i.classList.add('material-icons');
+ i.innerText = 'close';
+ return i;
+ };
+
+ new autoComplete({
+ noResults: (dataFeedback, generateList) => {
+ document.getElementById('tag_adder_collection').classList.remove('hide');
+ },
+ data: {
+ src: async () => search(document.getElementById('categoriesText').value),
+ key: ['id'],
+ cache: false,
+ },
+ query: {
+ manipulate: (query) => {
+ document.getElementById('tag_adder_collection').classList.add('hide');
+
+ return query;
+ }
+ },
+ onSelection: feedback => {
+ let stringT = feedback.selection.value;
+ //Capitalize and remove Whitespaces in topics
+ stringT.id = stringT.id.replace(/(^\w{1})|(\s+\w{1})/g, letter => letter.toUpperCase()).replace(/\s+/g, '');
+
+ //generate chipt and display it
+ const chip = generateTagAdderChip(stringT);
+ chip.appendChild(generateTagsIcon(stringT));
+ document.getElementById('tag_adder_chips').appendChild(chip);
+ document.getElementById('tag_adder').add(generateOption(stringT));
+ tagsArray.push(stringT.id);
+ console.log("topics to add to new idea: " + tagsArray);
+
+ document.getElementById('categoriesText').value = '';
+ },
+ resultsList: {
+ render: true,
+ container: source => {
+ source.classList.add('tag-collection-wrapper');
+ },
+ destination: "#tag_adder_collection-wrapper",
+ position: "beforeend",
+ element: "ul"
+ },
+ highlight: true,
+ trigger: query => query.length > 0,
+ maxResults: 5,
+ threshold: 1,
+ debounce: 500,
+ selector: "#categoriesText",
+ });
+
+ //autocomplete skills
+ document.getElementById('skill_adder_collection').addEventListener('click', () => {
+ let stringT = {
+ id: ""
+ };
+ stringT.id = document.getElementById("skillsText").value;
+ //Capitalize and remove Whitespaces in topics
+ stringT.id = stringT.id.replace(/(^\w{1})|(\s+\w{1})/g, letter => letter.toUpperCase()).replace(/\s+/g, '');
+
+ //generate chipt and display it
+ const chip = generateSkillAdderChip(stringT);
+ chip.appendChild(generateSkillIcon(stringT));
+ document.getElementById('skill_adder_chips').appendChild(chip);
+ document.getElementById('skill_adder').add(generateOption(stringT));
+ skillsArray.push(stringT.id);
+ console.log("needed skill to add to new idea: " + skillsArray);
+
+ document.getElementById('skillsText').value = '';
+ document.getElementById('skill_adder_collection').classList.add('hide');
+ });
+
+ const generateSkillIcon = _ => {
+ const i = document.createElement('i');
+ i.addEventListener('click', () => {
+ Array.from(document.getElementById('skill_adder').options).forEach(option => {
+ if (option.dataset.id === _.id) {
+ //remove tag from filterstring
+ skillsArray = skillsArray.filter(item => item !== _.id);
+ console.log("needed skills to add to new idea: " + skillsArray);
+ option.remove();
+ document.querySelector(`.chipSkillAdder-${_.id}`).remove();
+ }
+ });
+ });
+ i.classList.add('close');
+ i.classList.add('material-icons');
+ i.innerText = 'close';
+ return i;
+ };
+
+ new autoComplete({
+ noResults: (dataFeedback, generateList) => {
+ document.getElementById('skill_adder_collection').classList.remove('hide');
+ },
+ data: {
+ src: async () => searchSkills(document.getElementById('skillsText').value),
+ key: ['id'],
+ cache: false,
+ },
+ query: {
+ manipulate: (query) => {
+ document.getElementById('skill_adder_collection').classList.add('hide');
+
+ return query;
+ }
+ },
+ onSelection: feedback => {
+ let stringT = feedback.selection.value;
+ //Capitalize and remove Whitespaces in topics
+ stringT.id = stringT.id.replace(/(^\w{1})|(\s+\w{1})/g, letter => letter.toUpperCase()).replace(/\s+/g, '');
+
+ //generate chipt and display it
+ const chip = generateChip(stringT);
+ chip.appendChild(generateSkillIcon(stringT));
+ document.getElementById('skill_adder_chips').appendChild(chip);
+ document.getElementById('skill_adder').add(generateOption(stringT));
+ skillsArray.push(stringT.id);
+ console.log("needed skill to add to new idea: " + skillsArray);
+
+ document.getElementById('skillsText').value = '';
+ },
+ resultsList: {
+ render: true,
+ container: source => {
+ source.classList.add('skill-collection-wrapper');
+ },
+ destination: "#skill_adder_collection-wrapper",
+ position: "beforeend",
+ element: "ul"
+ },
+ highlight: true,
+ trigger: query => query.length > 0,
+ maxResults: 5,
+ threshold: 1,
+ debounce: 500,
+ selector: "#skillsText",
+ });
}
- },
- onSelection: feedback => {
- let stringT = feedback.selection.value;
- //Capitalize and remove Whitespaces in topics
- stringT.id = stringT.id.replace(/(^\w{1})|(\s+\w{1})/g, letter => letter.toUpperCase()).replace(/\s+/g, '');
-
- //generate chipt and display it
- const chip = generateChip(stringT);
- chip.appendChild(generateSkillIcon(stringT));
- document.getElementById('skill_adder_chips').appendChild(chip);
- document.getElementById('skill_adder').add(generateOption(stringT));
- skillsArray.push(stringT.id);
- console.log("needed skill to add to new idea: " + skillsArray);
-
- document.getElementById('skillsText').value = '';
- },
- resultsList: {
- render: true,
- container: source => {
- source.classList.add('skill-collection-wrapper');
- },
- destination: "#skill_adder_collection-wrapper",
- position: "beforeend",
- element: "ul"
- },
- highlight: true,
- trigger: query => query.length > 0,
- maxResults: 5,
- threshold: 1,
- debounce: 500,
- selector: "#skillsText",
-});
-}
};
-
-export { show };
+export {show};
diff --git a/src/oi/SideLoginRegister.js b/src/oi/SideLoginRegister.js
index 52ab426ece..7fe69bc75b 100644
--- a/src/oi/SideLoginRegister.js
+++ b/src/oi/SideLoginRegister.js
@@ -1,34 +1,49 @@
+/**
+ * @fileOverview this file provides function to display a login or register panel
+ * inside the side panel
+ * @name SideLoginRegister.js
+ * @author Jannis Dohm
+ * @license MIT
+ */
'use strict';
+/**
+ * function to send login information to the server
+ * also displays errors and handles login on client side plus hides the panel on succes
+ * information will be read from login form
+ */
function sendLogin() {
- if(!document.forms.login_form.email.checkValidity()) {
- document.getElementById("email").className += " invalid";
- return false;
+ if (!document.forms.login_form.email.checkValidity()) {
+ document.getElementById("email").className += " invalid";
+ return false;
+ }
+ if (!document.forms.login_form.password.checkValidity()) {
+ document.getElementById("password").className += " invalid";
+ return false;
+ }
+ let xhttp = new XMLHttpRequest();
+ xhttp.onreadystatechange = function() {
+ if (this.readyState == 4 && this.status == 200) {
+ let obj = JSON.parse(this.responseText);
+ if (obj.hasOwnProperty("message")) {
+ document.getElementById("error_server").innerHTML = obj.message;
+ } else {
+ myLogin(obj);
+ SidePanel.hide();
}
- if(!document.forms.login_form.password.checkValidity()) {
- document.getElementById("password").className += " invalid";
- return false;
- }
- var xhttp = new XMLHttpRequest();
- xhttp.onreadystatechange = function() {
- if (this.readyState == 4 && this.status == 200) {
- var obj = JSON.parse(this.responseText);
- if(obj.hasOwnProperty("message")) {
- document.getElementById("error_server").innerHTML = obj.message;
- }
- else {
- myLogin(obj);
- SidePanel.hide();
- }
- }};
- xhttp.open("POST", "submitLogin", true);
- xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
- xhttp.send("email="+document.getElementById("email").value+"&password="+document.getElementById("password").value);
+ }
+ };
+ xhttp.open("POST", "submitLogin", true);
+ xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
+ xhttp.send("email=" + document.getElementById("email").value + "&password=" + document.getElementById("password").value);
};
-export { sendLogin };
+export {sendLogin};
+/**
+ * function to show login form in side panel
+ */
function showLogin() {
- var html = `
+ let html = `
`
SidePanel.show(html);
- document.getElementById("password").addEventListener('keypress', function (e) {
+ document.getElementById("password").addEventListener('keypress', function(e) {
if (e.key === 'Enter') {
SideLoginRegister.sendLogin();
}
});
M.updateTextFields();
};
-export { showLogin };
-
+export {showLogin};
+/**
+ * function to send register information to the server
+ * also displays errors and hides the panel on succes
+ * information will be read from register form
+ */
function sendRegister() {
- if(!document.forms.register_form.email.checkValidity()) {
- document.getElementById("email").className += " invalid";
- return false;
- }
- if(!document.forms.register_form.name.checkValidity()) {
+ if (!document.forms.register_form.email.checkValidity()) {
+ document.getElementById("email").className += " invalid";
+ return false;
+ }
+ if (!document.forms.register_form.name.checkValidity()) {
+ document.getElementById("name").className += " invalid";
+ return false;
+ }
+ if (!document.forms.register_form.password.checkValidity()) {
+ document.getElementById("password").className += " invalid";
+ return false;
+ }
+ let xhttp = new XMLHttpRequest();
+ xhttp.onreadystatechange = function() {
+ if (this.readyState == 4 && this.status == 200) {
+ let obj = JSON.parse(this.responseText);
+ if (obj.hasOwnProperty("message")) {
+ if (obj.message.search("name") >= 1) {
+ document.getElementById("error_name").innerHTML = "Username already in use.";
document.getElementById("name").className += " invalid";
- return false;
- }
- if(!document.forms.register_form.password.checkValidity()) {
- document.getElementById("password").className += " invalid";
- return false;
- }
- var xhttp = new XMLHttpRequest();
- xhttp.onreadystatechange = function() {
- if (this.readyState == 4 && this.status == 200) {
- var obj = JSON.parse(this.responseText);
- if(obj.hasOwnProperty("message")) {
- if(obj.message.search("name") >= 1) {
- document.getElementById("error_name").innerHTML = "Username already in use.";
- document.getElementById("name").className += " invalid";
- }
- else if(obj.message.search("email") >= 1){
- document.getElementById("error_mail").innerHTML = "Email already in use.";
- document.getElementById("email").className += " invalid";
- }
- else alert(obj.message);
- }
- else {
- SidePanel.hide();
- }
- }};
- xhttp.open("POST", "submitRegister", true);
- xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
- xhttp.send("name="+document.getElementById("name").value+"&email="+document.getElementById("email").value+"&password="+document.getElementById("password").value);
+ } else if (obj.message.search("email") >= 1) {
+ document.getElementById("error_mail").innerHTML = "Email already in use.";
+ document.getElementById("email").className += " invalid";
+ } else alert(obj.message);
+ } else {
+ SidePanel.hide();
+ }
+ }
+ };
+ xhttp.open("POST", "submitRegister", true);
+ xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
+ xhttp.send("name=" + document.getElementById("name").value + "&email=" + document.getElementById("email").value + "&password=" + document.getElementById("password").value);
};
-export { sendRegister };
+export {sendRegister};
+/**
+ * function to show register form in side panel
+ */
function showRegister() {
- var html =
- `
+ let html =
+ `
`;
SidePanel.show(html);
- document.getElementById("password").addEventListener('keypress', function (e) {
+ document.getElementById("password").addEventListener('keypress', function(e) {
if (e.key === 'Enter') {
SideLoginRegister.sendRegister();
}
});
M.updateTextFields();
};
-
-export { showRegister };
+export {showRegister};
diff --git a/src/oi/SidePanel.js b/src/oi/SidePanel.js
index 79a0be51fb..c68668345e 100644
--- a/src/oi/SidePanel.js
+++ b/src/oi/SidePanel.js
@@ -1,22 +1,32 @@
+/**
+ * @fileOverview this file provides functions to open a side panel,
+ * which can be used to display idea informations, login, register...
+ * @name SidePanel.js
+ * @author Jannis Dohm
+ * @license MIT
+ */
'use strict';
-var first = '
';
-
-
-var last = '
';
+let first = '
';
+let last = '
';
+/**
+ * function to show side panel, this can be used to
+ * display informations about an idea, a login screen ...
+ * this side panel will check the screen width and proportions to determine
+ * if the side panel will be 30% or 50% of the screen, or even the whole screen
+ * @param {string} html - content which will be displayed inside the side panel
+ */
function show(html) {
- if(document.documentElement.clientWidth > document.documentElement.clientHeight && document.documentElement.clientWidth > 800) {
- if(document.documentElement.clientWidth > document.documentElement.clientHeight && document.documentElement.clientWidth > 1400) {
+ if (document.documentElement.clientWidth > document.documentElement.clientHeight && document.documentElement.clientWidth > 800) {
+ if (document.documentElement.clientWidth > document.documentElement.clientHeight && document.documentElement.clientWidth > 1400) {
document.getElementById("earth").style["width"] = "70%";
document.getElementById("idea").style["width"] = "30%";
+ } else {
+ document.getElementById("earth").style["width"] = "50%";
+ document.getElementById("idea").style["width"] = "50%";
}
- else {
- document.getElementById("earth").style["width"] = "50%";
- document.getElementById("idea").style["width"] = "50%";
- }
- }
- else {
+ } else {
document.getElementById("earth").style["width"] = "0%";
document.getElementById("idea").style["width"] = "100%";
}
@@ -24,7 +34,10 @@ function show(html) {
};
-function hide(){
+/**
+ * function to hide the side panel
+ */
+function hide() {
document.getElementById("earth").style["width"] = "100%";
document.getElementById("idea").style["width"] = "0%";
document.getElementById("idea").innerHTML = "";
diff --git a/src/oi/SideShowIdea.js b/src/oi/SideShowIdea.js
index 92c1766f39..190f88dff6 100644
--- a/src/oi/SideShowIdea.js
+++ b/src/oi/SideShowIdea.js
@@ -1,58 +1,82 @@
-'use strict';
-function show(IdeaID) {
- /*---------------------------------|
- | get Infos for Idea from server |
- |---------------------------------*/
- var xhttp = new XMLHttpRequest();
- var self = this;
- xhttp.onreadystatechange = function() {
- if (this.readyState == 4 && this.status == 200) {
- var obj = JSON.parse(this.responseText);
-
+/**
+ * @fileOverview this file provides functions to display ideas in side panel
+ * @name SideShowIdea.js
+ * @author Jannis Dohm
+ * @license MIT
+ */
- var ulogin = this.getResponseHeader("login");
- if (ulogin == "false") {
- document.getElementById("id_vote").innerHTML = LoginRegister;
- document.getElementById("up-btn").style.opacity = "0.4";
- document.getElementById("up-btn").onclick = function () {SideLoginRegister.showLogin();};
- document.getElementById("down-btn").style.opacity = "0.4";
- document.getElementById("down-btn").onclick = function () {SideLoginRegister.showLogin();};
- document.getElementById("commentForm").textContent = "Comments:";
- document.getElementById("commentForm").classList.add("cactus-comment");
- }
+'use strict';
- //cactus chat
- initComments({
- node: document.getElementById("comment-section"),
- defaultHomeserverUrl: "https://matrix.cactus.chat:8448",
- serverName: "cactus.chat",
- siteName: "openidea.io",
- commentSectionId: "Idea#" + IdeaID
- });
- //cactus chat end
- document.getElementById("id_title").innerHTML = obj.title;
- document.getElementById("id_title").addEventListener('click', () => {
- document.getElementById("id_title").classList.add('hide');
- document.getElementById("id_title2").classList.remove('hide');
- });
- document.getElementById("id_title2").innerHTML = obj.title;
- document.getElementById("id_description").innerHTML = obj.description;
- document.getElementById("id_tags").innerHTML = "
Topics: ";
- obj.tags.forEach((dat) => {document.getElementById("id_tags").innerHTML += '
' + dat + '
';});
- document.getElementById("id_skills").innerHTML = "
Needed skills: ";
- obj.skills.forEach((dat) => {document.getElementById("id_skills").innerHTML += '
' + dat + '
';});
- document.getElementById("id_user").innerHTML = "
Idea by: ";
- obj.user.forEach((dat) => {document.getElementById("id_user").innerHTML += '
' + dat + '
';});
+/**
+ * function to open Idea in side panel
+ * If users isn't logged in, this function will blur out the vote buttons and the comment editor.
+ * Instead the user get the possibility to go to login/register
+ * @param {number} IdeaID - number of idea which will be displayed
+ */
+function show(IdeaID) {
+ /*---------------------------------|
+ | get Infos for Idea from server |
+ |---------------------------------*/
+ let xhttp = new XMLHttpRequest();
+ let self = this;
+ xhttp.onreadystatechange = function() {
+ if (this.readyState == 4 && this.status == 200) {
+ let obj = JSON.parse(this.responseText);
+
+
+ let ulogin = this.getResponseHeader("login");
+ if (ulogin == "false") {
+ document.getElementById("id_vote").innerHTML = LoginRegister;
+ document.getElementById("up-btn").style.opacity = "0.4";
+ document.getElementById("up-btn").onclick = function() {
+ SideLoginRegister.showLogin();
+ };
+ document.getElementById("down-btn").style.opacity = "0.4";
+ document.getElementById("down-btn").onclick = function() {
+ SideLoginRegister.showLogin();
+ };
+ document.getElementById("commentForm").textContent = "Comments:";
+ document.getElementById("commentForm").classList.add("cactus-comment");
}
- };
- xhttp.open("POST", "getIdea", true);
- xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
- xhttp.send("IdeaID="+IdeaID);
- /*---------------------------------|
- | get Infos for Idea from server |
- |---------------------------------*/
- var html =
- `
+
+ //cactus chat
+ initComments({
+ node: document.getElementById("comment-section"),
+ defaultHomeserverUrl: "https://matrix.cactus.chat:8448",
+ serverName: "cactus.chat",
+ siteName: "openidea.io",
+ commentSectionId: "Idea#" + IdeaID
+ });
+ //cactus chat end
+ document.getElementById("id_title").innerHTML = obj.title;
+ document.getElementById("id_title").addEventListener('click', () => {
+ document.getElementById("id_title").classList.add('hide');
+ document.getElementById("id_title2").classList.remove('hide');
+ });
+ document.getElementById("id_title2").innerHTML = obj.title;
+ document.getElementById("id_description").innerHTML = obj.description;
+ document.getElementById("id_tags").innerHTML = "
Topics: ";
+ obj.tags.forEach((dat) => {
+ document.getElementById("id_tags").innerHTML += '
' + dat + '
';
+ });
+ document.getElementById("id_skills").innerHTML = "
Needed skills: ";
+ obj.skills.forEach((dat) => {
+ document.getElementById("id_skills").innerHTML += '
' + dat + '
';
+ });
+ document.getElementById("id_user").innerHTML = "
Idea by: ";
+ obj.user.forEach((dat) => {
+ document.getElementById("id_user").innerHTML += '
' + dat + '
';
+ });
+ }
+ };
+ xhttp.open("POST", "getIdea", true);
+ xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
+ xhttp.send("IdeaID=" + IdeaID);
+ /*---------------------------------|
+ | get Infos for Idea from server |
+ |---------------------------------*/
+ let html =
+ `
Vote Up
thumb_up