Git Branches Management
This commit is contained in:
1 parent
8a9a4336a7
commit
29fe73b3c8
9 files changed
+134
-17
No files matched your search
@@ -56,8 +56,8 @@
|
||||
onresize="onResize()">
|
||||
<div id="contributors" class="credits">
|
||||
<p id="credits-page-status-paragraph" class="credits-yellow">The UI is loading...</p>
|
||||
<p><span class="credits-red">Superalgos is free, open-source, and is
|
||||
constantly improving thanks to the involvement of contributors!</span></p>
|
||||
<p>Superalgos is <span class="credits-red">free</span>, <span class="credits-red">open-source</span>, and is
|
||||
<span class="credits-red">constantly improving</span> thanks to the involvement of contributors:</p>
|
||||
<p>Luis Fernando Molina, Julian Molina, Andreja Cobeljic, Matías Benitez, Ira Miller, Eduardo Remis,
|
||||
Jeff Braun, rico4dev, 9808us, Barry Low, Nikola Bjelogrlic, Hirajin Koizuko, Francisco J. Santillán, Norman,
|
||||
Viktoria B., Guillermo V., Daniel J.,
|
||||
|
||||
@@ -208,6 +208,11 @@
|
||||
"propertyName": "languages",
|
||||
"functionName": "newSuperalgosUtilitiesLanguages"
|
||||
},
|
||||
{
|
||||
"name": "Git Branches",
|
||||
"propertyName": "gitBranches",
|
||||
"functionName": "newSuperalgosUtilitiesGitBranches"
|
||||
},
|
||||
{
|
||||
"name": "Docs",
|
||||
"propertyName": "docs",
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"topic": "Branches Management Messages",
|
||||
"pageNumber": "1",
|
||||
"type": "Switching Branches - Changing Active Branch",
|
||||
"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."
|
||||
}
|
||||
]
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"topic": "Branches Management Messages",
|
||||
"pageNumber": "2",
|
||||
"type": "Switching Branches - Active Branch Changed",
|
||||
"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."
|
||||
}
|
||||
]
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"topic": "Branches Management Messages",
|
||||
"pageNumber": "3",
|
||||
"type": "Switching Branches - Contributions Branch Changed",
|
||||
"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."
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -2,6 +2,8 @@ function newSuperalgosGlobalsDocs() {
|
||||
thisObject = {
|
||||
NEW_PARAGRAPH_TEXT: "Left click and Edit to enter edit mode and change this text. ENTER to write new paragraphs. ESC to exit edit mode.",
|
||||
DEFAULT_LANGUAGE: 'EN',
|
||||
DEFAULT_ACTIVE_BRANCH: 'master',
|
||||
DEFAULT_CONTRIBUTIONS_BRANCH: 'develop',
|
||||
DOCS_SPACE_WIDTH: 900
|
||||
}
|
||||
return thisObject
|
||||
|
||||
@@ -12,6 +12,8 @@ function newSuperalgosDocSpace() {
|
||||
commandInterface: undefined,
|
||||
contextMenu: undefined,
|
||||
language: undefined,
|
||||
activeBranch: undefined,
|
||||
contributionsBranch: undefined,
|
||||
menuLabelsMap: undefined,
|
||||
currentDocumentBeingRendered: undefined,
|
||||
previousDocumentBeingRendered: undefined,
|
||||
@@ -20,6 +22,8 @@ function newSuperalgosDocSpace() {
|
||||
textArea: undefined,
|
||||
setUpWorkspaceSchemas: setUpWorkspaceSchemas,
|
||||
changeLanguage: changeLanguage,
|
||||
changeActiveBranch: changeActiveBranch,
|
||||
changeContributionsBranch: changeContributionsBranch,
|
||||
enterEditMode: enterEditMode,
|
||||
exitEditMode: exitEditMode,
|
||||
openSpaceAreaAndNavigateTo: openSpaceAreaAndNavigateTo,
|
||||
@@ -57,6 +61,8 @@ function newSuperalgosDocSpace() {
|
||||
setupSidePanelTab()
|
||||
setUpMenuItemsMap()
|
||||
setupUserLanguage()
|
||||
setupActiveBranch()
|
||||
setupContributionsBranch()
|
||||
|
||||
thisObject.searchEngine = newSuperalgosDocsSearchEngine()
|
||||
thisObject.mainSearchPage = newSuperalgosDocsMainSearchPage()
|
||||
@@ -76,6 +82,30 @@ function newSuperalgosDocSpace() {
|
||||
|
||||
isInitialized = true
|
||||
|
||||
function setupActiveBranch() {
|
||||
/*
|
||||
Getting the used preferred languague
|
||||
*/
|
||||
if (window.localStorage.getItem('Active Branch') !== null && window.localStorage.getItem('Active Branch') !== undefined && window.localStorage.getItem('Active Branch') !== 'undefined') {
|
||||
UI.projects.superalgos.spaces.docsSpace.activeBranch = window.localStorage.getItem('Active Branch')
|
||||
} else {
|
||||
window.localStorage.setItem('Active Branch', UI.projects.superalgos.globals.docs.DEFAULT_ACTIVE_BRANCH)
|
||||
UI.projects.superalgos.spaces.docsSpace.activeBranch = UI.projects.superalgos.globals.docs.DEFAULT_ACTIVE_BRANCH
|
||||
}
|
||||
}
|
||||
|
||||
function setupContributionsBranch() {
|
||||
/*
|
||||
Getting the used preferred languague
|
||||
*/
|
||||
if (window.localStorage.getItem('Contributions Branch') !== null && window.localStorage.getItem('Contributions Branch') !== undefined && window.localStorage.getItem('Contributions Branch') !== 'undefined') {
|
||||
UI.projects.superalgos.spaces.docsSpace.contributionsBranch = window.localStorage.getItem('Contributions Branch')
|
||||
} else {
|
||||
window.localStorage.setItem('Contributions Branch', UI.projects.superalgos.globals.docs.DEFAULT_CONTRIBUTIONS_BRANCH)
|
||||
UI.projects.superalgos.spaces.docsSpace.contributionsBranch = UI.projects.superalgos.globals.docs.DEFAULT_CONTRIBUTIONS_BRANCH
|
||||
}
|
||||
}
|
||||
|
||||
function setupUserLanguage() {
|
||||
/*
|
||||
Getting the used preferred languague
|
||||
@@ -86,7 +116,6 @@ function newSuperalgosDocSpace() {
|
||||
window.localStorage.setItem('Docs Language', UI.projects.superalgos.globals.docs.DEFAULT_LANGUAGE)
|
||||
UI.projects.superalgos.spaces.docsSpace.language = UI.projects.superalgos.globals.docs.DEFAULT_LANGUAGE
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function setupSidePanelTab() {
|
||||
@@ -155,6 +184,18 @@ function newSuperalgosDocSpace() {
|
||||
initialize()
|
||||
}
|
||||
|
||||
function changeActiveBranch(branch) {
|
||||
UI.projects.superalgos.spaces.docsSpace.activeBranch = branch
|
||||
window.localStorage.setItem('Active Branch', UI.projects.superalgos.spaces.docsSpace.activeBranch)
|
||||
UI.projects.superalgos.spaces.docsSpace.navigateTo('Superalgos', 'Topic', 'Switching Branches - Changing Active Branch')
|
||||
}
|
||||
|
||||
function changeContributionsBranch(branch) {
|
||||
UI.projects.superalgos.spaces.docsSpace.contributionsBranch = branch
|
||||
window.localStorage.setItem('Contributions Branch', UI.projects.superalgos.spaces.docsSpace.contributionsBranch)
|
||||
UI.projects.superalgos.spaces.docsSpace.navigateTo('Superalgos', 'Topic', 'Switching Branches - Contributions Branch Changed')
|
||||
}
|
||||
|
||||
function changeLanguage(pLanguage) {
|
||||
UI.projects.superalgos.spaces.docsSpace.language = pLanguage
|
||||
window.localStorage.setItem('Docs Language', UI.projects.superalgos.spaces.docsSpace.language)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
function newSuperalgosDocsFooter() {
|
||||
let thisObject = {
|
||||
addFooter: addFooter,
|
||||
addFooter: addFooter,
|
||||
initialize: initialize,
|
||||
finalize: finalize
|
||||
}
|
||||
@@ -16,7 +16,6 @@ function newSuperalgosDocsFooter() {
|
||||
}
|
||||
|
||||
function addFooter() {
|
||||
let languageLabel = UI.projects.superalgos.utilities.languages.getLaguageLabel(UI.projects.superalgos.spaces.docsSpace.language)
|
||||
|
||||
let HTML = ''
|
||||
|
||||
@@ -33,11 +32,11 @@ function newSuperalgosDocsFooter() {
|
||||
|
||||
HTML = HTML + '<div class="docs-footer-cell style="white-space: nowrap; overflow-x: auto;" >' // white-space: nowrap; overflow-x: auto; prevents line breaks when combined with display: inline-block;" in the child elements
|
||||
HTML = HTML + '<span style="float: right; display: inline-block;" onClick="UI.projects.superalgos.spaces.docsSpace.scrollToElement(\'docs-space-div\')"><button>TO TOP</button></span>'
|
||||
if (UI.projects.superalgos.spaces.docsSpace.previousDocumentBeingRendered !== undefined ) {
|
||||
HTML = HTML + '<span style="float: right; display: inline-block;" onClick="UI.projects.superalgos.spaces.docsSpace.navigateTo(\'' + UI.projects.superalgos.spaces.docsSpace.previousDocumentBeingRendered.project + '\', \'' + UI.projects.superalgos.spaces.docsSpace.previousDocumentBeingRendered.category + '\', \'' + UI.projects.superalgos.spaces.docsSpace.previousDocumentBeingRendered.type + '\')"><button>BACK</button></span>'
|
||||
if (UI.projects.superalgos.spaces.docsSpace.previousDocumentBeingRendered !== undefined) {
|
||||
HTML = HTML + '<span style="float: right; display: inline-block;" onClick="UI.projects.superalgos.spaces.docsSpace.navigateTo(\'' + UI.projects.superalgos.spaces.docsSpace.previousDocumentBeingRendered.project + '\', \'' + UI.projects.superalgos.spaces.docsSpace.previousDocumentBeingRendered.category + '\', \'' + UI.projects.superalgos.spaces.docsSpace.previousDocumentBeingRendered.type + '\')"><button>BACK</button></span>'
|
||||
}
|
||||
if (UI.projects.superalgos.spaces.docsSpace.currentBookBeingRendered !== undefined ) {
|
||||
HTML = HTML + '<span style="float: right; display: inline-block;" onClick="UI.projects.superalgos.spaces.docsSpace.navigateTo(\'' + UI.projects.superalgos.spaces.docsSpace.currentBookBeingRendered.project + '\', \'' + UI.projects.superalgos.spaces.docsSpace.currentBookBeingRendered.category + '\', \'' + UI.projects.superalgos.spaces.docsSpace.currentBookBeingRendered.type + '\')"><button>TO BOOK</button></span>'
|
||||
if (UI.projects.superalgos.spaces.docsSpace.currentBookBeingRendered !== undefined) {
|
||||
HTML = HTML + '<span style="float: right; display: inline-block;" onClick="UI.projects.superalgos.spaces.docsSpace.navigateTo(\'' + UI.projects.superalgos.spaces.docsSpace.currentBookBeingRendered.project + '\', \'' + UI.projects.superalgos.spaces.docsSpace.currentBookBeingRendered.category + '\', \'' + UI.projects.superalgos.spaces.docsSpace.currentBookBeingRendered.type + '\')"><button>TO BOOK</button></span>'
|
||||
}
|
||||
HTML = HTML + '</div>'
|
||||
|
||||
@@ -54,7 +53,7 @@ function newSuperalgosDocsFooter() {
|
||||
|
||||
HTML = HTML + '<div class="docs-footer-cell">'
|
||||
HTML = HTML + '<h4>Choose Your Language</h4>'
|
||||
HTML = HTML + 'The current preferred language is <strong>' + languageLabel + '</strong>. Switch to:'
|
||||
HTML = HTML + 'The current preferred language is <strong>' + UI.projects.superalgos.utilities.languages.getLaguageLabel(UI.projects.superalgos.spaces.docsSpace.language) + '</strong>. Switch to:'
|
||||
HTML = HTML + '<ul>'
|
||||
HTML = HTML + '<li><a href="#" onClick="UI.projects.superalgos.spaces.docsSpace.changeLanguage(\'EN\')">English</a></li>'
|
||||
HTML = HTML + '<li><a href="#" onClick="UI.projects.superalgos.spaces.docsSpace.changeLanguage(\'ES\')">Spanish</a></li>'
|
||||
@@ -91,24 +90,26 @@ function newSuperalgosDocsFooter() {
|
||||
HTML = HTML + '<div class="docs-footer-row">'
|
||||
HTML = HTML + '<div class="docs-footer-cell">'
|
||||
HTML = HTML + '<h4>About Your Deployment</h4>'
|
||||
HTML = HTML + 'Superalgos may run from different branches in the repository. The <code class="docs-footer-code">master</code> branch features the stable version, and the <code class="docs-footer-code">develop</code> branch the version in development.'
|
||||
HTML = HTML + 'Superalgos may run from different branches in the repository. The <code class="docs-footer-code">Master</code> branch features the stable version, and the <code class="docs-footer-code">Develop</code> branch the version in development anyone can test. <code class="docs-footer-code">Bug Fixes</code> is where we fix bugs.'
|
||||
HTML = HTML + '</div>'
|
||||
|
||||
HTML = HTML + '<div class="docs-footer-cell">'
|
||||
HTML = HTML + '<h4>Choose the Active Branch</h4>'
|
||||
HTML = HTML + 'You are currently running on the <code class="docs-footer-code">' + languageLabel + '</code> branch. Switch to:'
|
||||
HTML = HTML + 'You are currently running on the <code class="docs-footer-code">' + UI.projects.superalgos.utilities.gitBranches.getBranchLabel(UI.projects.superalgos.spaces.docsSpace.activeBranch) + '</code> branch. Switch to:'
|
||||
HTML = HTML + '<ul>'
|
||||
HTML = HTML + '<li><a href="#" onClick="UI.projects.superalgos.spaces.docsSpace.changeLanguage(\'EN\')"><code class="docs-footer-code">English</code></a></li>'
|
||||
HTML = HTML + '<li><a href="#" onClick="UI.projects.superalgos.spaces.docsSpace.changeLanguage(\'ES\')"><code class="docs-footer-code">Spanish</a></code></li>'
|
||||
HTML = HTML + '<li><a href="#" onClick="UI.projects.superalgos.spaces.docsSpace.changeActiveBranch(\'master\')">Master</a></li>'
|
||||
HTML = HTML + '<li><a href="#" onClick="UI.projects.superalgos.spaces.docsSpace.changeActiveBranch(\'develop\')">Develop</a></li>'
|
||||
HTML = HTML + '<li><a href="#" onClick="UI.projects.superalgos.spaces.docsSpace.changeActiveBranch(\'bug-fixes\')">Bug Fixes</a></li>'
|
||||
HTML = HTML + '</ul>'
|
||||
HTML = HTML + '</div>'
|
||||
|
||||
HTML = HTML + '<div class="docs-footer-cell">'
|
||||
HTML = HTML + '<h4>Contributions Branch</h4>'
|
||||
HTML = HTML + 'You are currently contributing to the <code class="docs-footer-code">' + languageLabel + '</code> branch. Switch to:'
|
||||
HTML = HTML + 'You are currently contributing to the <code class="docs-footer-code">' + UI.projects.superalgos.utilities.gitBranches.getBranchLabel(UI.projects.superalgos.spaces.docsSpace.contributionsBranch) + '</code> branch. Switch to:'
|
||||
HTML = HTML + '<ul>'
|
||||
HTML = HTML + '<li><a href="#" onClick="UI.projects.superalgos.spaces.docsSpace.changeLanguage(\'EN\')"><code class="docs-footer-code">English</code></a></li>'
|
||||
HTML = HTML + '<li><a href="#" onClick="UI.projects.superalgos.spaces.docsSpace.changeLanguage(\'ES\')"><code class="docs-footer-code">Spanish</a></code></li>'
|
||||
HTML = HTML + '<li><a href="#" onClick="UI.projects.superalgos.spaces.docsSpace.changeContributionsBranch(\'master\')">Master</code></li>'
|
||||
HTML = HTML + '<li><a href="#" onClick="UI.projects.superalgos.spaces.docsSpace.changeContributionsBranch(\'develop\')">Develop</a></li>'
|
||||
HTML = HTML + '<li><a href="#" onClick="UI.projects.superalgos.spaces.docsSpace.changeContributionsBranch(\'bug-fixes\')">Bug Fixes</a></li>'
|
||||
HTML = HTML + '</ul>'
|
||||
HTML = HTML + '</ul>'
|
||||
HTML = HTML + '</div>'
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
function newSuperalgosUtilitiesGitBranches() {
|
||||
thisObject = {
|
||||
getBranchLabel: getBranchLabel
|
||||
}
|
||||
|
||||
return thisObject
|
||||
|
||||
function getBranchLabel(branch) {
|
||||
let branchLabel
|
||||
switch (branch) {
|
||||
case 'master': {
|
||||
branchLabel = 'Master'
|
||||
break
|
||||
}
|
||||
case 'develop': {
|
||||
branchLabel = 'Develop'
|
||||
break
|
||||
}
|
||||
case 'bug-fixes': {
|
||||
branchLabel = 'Bug Fixes'
|
||||
break
|
||||
}
|
||||
}
|
||||
return branchLabel
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user