diff --git a/Client/httpInterface.js b/Client/httpInterface.js index 2d2cd3bc6..ae7630235 100644 --- a/Client/httpInterface.js +++ b/Client/httpInterface.js @@ -522,9 +522,9 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE } break - case 'Git': { + case 'App': { switch (requestParameters[2]) { // switch by command - case 'Commit': { + case 'Contribute': { const simpleGit = require('simple-git'); const options = { baseDir: process.cwd(), @@ -532,9 +532,13 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE maxConcurrentProcesses: 6, } const git = simpleGit(options) - console.log('baseDir = ' + process.cwd()) + const commitMessage = unescape(requestParameters[3]) + console.log('baseDir = ' + process.cwd(), commitMessage) + respondWithContent(JSON.stringify(global.DEFAULT_OK_RESPONSE), httpResponse) + break } } + break } case 'LegacyPlotter.js': { diff --git a/Projects/Superalgos/Schemas/Docs-Topics/app-commands-errors-001-app-error-contribution-not-sent.json b/Projects/Superalgos/Schemas/Docs-Topics/app-commands-errors-001-app-error-contribution-not-sent.json new file mode 100644 index 000000000..757986382 --- /dev/null +++ b/Projects/Superalgos/Schemas/Docs-Topics/app-commands-errors-001-app-error-contribution-not-sent.json @@ -0,0 +1,14 @@ +{ + "topic": "App Commands Errors", + "pageNumber": "1", + "type": "App Error Contribution Not Sent", + "definition": { + "text": "Write here a summary for this topic page." + }, + "paragraphs": [ + { + "style": "Text", + "text": "Left click and Edit to enter edit mode and change this text. ENTER to write new paragraphs. ESC to exit edit mode." + } + ] +} \ No newline at end of file diff --git a/Projects/Superalgos/Schemas/Docs-Topics/app-commands-messages-001-app-message-contribution-succeed.json b/Projects/Superalgos/Schemas/Docs-Topics/app-commands-messages-001-app-message-contribution-succeed.json new file mode 100644 index 000000000..136031d48 --- /dev/null +++ b/Projects/Superalgos/Schemas/Docs-Topics/app-commands-messages-001-app-message-contribution-succeed.json @@ -0,0 +1,14 @@ +{ + "topic": "App Commands Messages", + "pageNumber": "1", + "type": "App Message Contribution Succeed", + "definition": { + "text": "Write here a summary for this topic page." + }, + "paragraphs": [ + { + "style": "Text", + "text": "Left click and Edit to enter edit mode and change this text. ENTER to write new paragraphs. ESC to exit edit mode." + } + ] +} \ No newline at end of file diff --git a/Projects/Superalgos/Schemas/Docs-Topics/docs-languages-002-docs-in-spanish.json b/Projects/Superalgos/Schemas/Docs-Topics/docs-languages-002-docs-in-spanish.json index 594b290a4..93fecacac 100644 --- a/Projects/Superalgos/Schemas/Docs-Topics/docs-languages-002-docs-in-spanish.json +++ b/Projects/Superalgos/Schemas/Docs-Topics/docs-languages-002-docs-in-spanish.json @@ -9,7 +9,8 @@ { "language": "ES", "text": "Si bien la documentación esta originalmente escrita en Inglés, el sistema permite a cualquier usuario buscar contenido en su idioma nativo, siempre y cuando otros usuarios hayan contribuído traducciones de los artículos existentes escritos en el idioma por defecto que es el idioma Inglés.", - "updated": 1609831843644 + "updated": 1609831843644, + "style": "Definition" } ] }, @@ -22,7 +23,8 @@ { "language": "ES", "text": "Es importante notar que por mas que uno seleccione un idioma, el contenido se mostrará en ingles en cada sitio donde todavía no ha sido traducido. El sistema permite a cualquier usuario contribuir traducciones con una granularidad a nivel de párrafos. Esto significa que si una página cualquiera pudiera tener todos, algunos o nigún párrafo traducido. Esto solo depende de cuales hayan sido traducidos previamente por miembros de la comunidad.", - "updated": 1609831884941 + "updated": 1609831884941, + "style": "Text" } ] }, @@ -34,7 +36,8 @@ { "language": "ES", "text": "Para cambiar de un idioma a otro se debe usar los links en el pie de cada página.", - "updated": 1609831898619 + "updated": 1609831898619, + "style": "Success" } ] } diff --git a/Projects/Superalgos/UI/Spaces/Docs-Space/CommandInterface.js b/Projects/Superalgos/UI/Spaces/Docs-Space/CommandInterface.js index e30da8291..751908f1c 100644 --- a/Projects/Superalgos/UI/Spaces/Docs-Space/CommandInterface.js +++ b/Projects/Superalgos/UI/Spaces/Docs-Space/CommandInterface.js @@ -17,36 +17,35 @@ function newSuperalgosDocsCommmandInterface() { } function detectCommands() { - detectAppCommands() + if (detectAppCommands() === true) {return} detectDocsCommands() } function detectAppCommands() { - if (checkContributeCommand() === undefined) { return } + if (checkContributeCommand() === undefined) { return } else { return true } function checkContributeCommand() { if (UI.projects.superalgos.spaces.docsSpace.commandInterface.command.toLowerCase() === 'app.help app.contribute') { UI.projects.superalgos.spaces.docsSpace.navigateTo('Superalgos', 'Topic', 'App Contribute Command') return } - if (UI.projects.superalgos.spaces.docsSpace.commandInterface.command.indexOf('App.Contribute') !== 0 && UI.projects.superalgos.spaces.docsSpace.commandInterface.command.indexOf('app.contribute') !== 0) { return 'Not Save Command' } + if (UI.projects.superalgos.spaces.docsSpace.commandInterface.command.indexOf('App.Contribute') !== 0 && UI.projects.superalgos.spaces.docsSpace.commandInterface.command.indexOf('app.contribute') !== 0) { return } - httpRequest(JSON.stringify(docsSchema), 'App/Contribute/' + message, onResponse) + let message = UI.projects.superalgos.spaces.docsSpace.commandInterface.command.trim().substring(UI.projects.superalgos.spaces.docsSpace.commandInterface.command.indexOf(' ') + 1, UI.projects.superalgos.spaces.docsSpace.commandInterface.command.length) + if (message.toLowerCase() === 'app.contribute') { + message = 'This is my contribution to Superalgos' + } + + httpRequest(undefined, 'App/Contribute/' + message, onResponse) + return true function onResponse(err, data) { /* Lets check the result of the call through the http interface */ data = JSON.parse(data) if (err.result === GLOBAL.DEFAULT_OK_RESPONSE.result && data.result === GLOBAL.DEFAULT_OK_RESPONSE.result) { - okResponses++ - } - responseCount++ - - if (responseCount === requestsSent) { - if (responseCount === okResponses) { - UI.projects.superalgos.spaces.docsSpace.navigateTo('Superalgos', 'Topic', 'Docs Message Saving Succeed') - } else { - UI.projects.superalgos.spaces.docsSpace.navigateTo('Superalgos', 'Topic', 'Docs Error Changes Not Saved', 'Anchor Changes Not Saved') - } + UI.projects.superalgos.spaces.docsSpace.navigateTo('Superalgos', 'Topic', 'App Error Contribution Not Sent', 'Anchor Contribution Not Sent') + } else { + UI.projects.superalgos.spaces.docsSpace.navigateTo('Superalgos', 'Topic', 'App Message Contribution Succeed') } } }