From bc540eefb649143db1ab04ee9f8abfb284c3bcb2 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Tue, 7 May 2019 15:47:33 +0100 Subject: [PATCH] Namespace projects CSS --- .../@node-red/editor-client/src/js/red.js | 2 +- .../src/js/ui/projects/projectSettings.js | 66 ++-- .../src/js/ui/projects/projectUserSettings.js | 32 +- .../src/js/ui/projects/projects.js | 360 +++++++++--------- .../src/js/ui/projects/tab-versionControl.js | 204 +++++----- .../editor-client/src/js/ui/utils.js | 4 +- .../editor-client/src/sass/base.scss | 46 +++ .../editor-client/src/sass/projects.scss | 219 +++++------ 8 files changed, 467 insertions(+), 466 deletions(-) diff --git a/packages/node_modules/@node-red/editor-client/src/js/red.js b/packages/node_modules/@node-red/editor-client/src/js/red.js index 80527e063..a060e13d6 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/red.js +++ b/packages/node_modules/@node-red/editor-client/src/js/red.js @@ -42,7 +42,7 @@ var RED = (function() { done() } } - $('body').append(newScript); + $("#red-ui-editor-node-configs").append(newScript); newScript.src = RED.settings.apiRootUrl+srcUrl; hasDeferred = true; } else { diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/projects/projectSettings.js b/packages/node_modules/@node-red/editor-client/src/js/ui/projects/projectSettings.js index e48293391..b4707e97b 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/projects/projectSettings.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/projects/projectSettings.js @@ -87,14 +87,14 @@ RED.projects.settings = (function() { panes.forEach(function(pane) { settingsTabs.addTab({ - id: "project-settings-tab-"+pane.id, + id: "red-ui-project-settings-tab-"+pane.id, label: pane.title, pane: pane }); pane.get(project).hide().appendTo(tabContents); }); settingsContent.i18n(); - settingsTabs.activateTab("project-settings-tab-"+(initialTab||'main')) + settingsTabs.activateTab("red-ui-project-settings-tab-"+(initialTab||'main')) $("#red-ui-sidebar-shade").show(); }, close: function() { @@ -228,7 +228,7 @@ RED.projects.settings = (function() { function createMainPane(activeProject) { - var pane = $('
'); + var pane = $('
'); $('

').text(activeProject.name).appendTo(pane); var summary = $('
').appendTo(pane); var summaryContent = $('
',{style:"color: #999"}).appendTo(summary); @@ -322,7 +322,7 @@ RED.projects.settings = (function() { function saveDependencies(depsList,container,dependencies,complete) { var activeProject = RED.projects.getActiveProject(); - var spinner = utils.addSpinnerOverlay(container).addClass('projects-dialog-spinner-contain'); + var spinner = utils.addSpinnerOverlay(container).addClass('red-ui-component-spinner-contain'); var done = function(err,res) { spinner.remove(); if (err) { @@ -378,7 +378,7 @@ RED.projects.settings = (function() { } function createDependenciesPane(activeProject) { - var pane = $('
'); + var pane = $('
'); if (RED.user.hasPermission("projects.write")) { $('') .appendTo(pane) @@ -530,7 +530,7 @@ RED.projects.settings = (function() { var dialogBody; var filesList; var selected; - var container = $('
',{style:"position: relative; min-height: 175px; height: 175px;"}).hide().appendTo(row); + var container = $('
',{style:"position: relative; min-height: 175px; height: 175px;"}).hide().appendTo(row); var spinner = utils.addSpinnerOverlay(container); $.getJSON("projects/"+activeProject.name+"/files",function(result) { var fileNames = Object.keys(result); @@ -578,13 +578,13 @@ RED.projects.settings = (function() { function createFileSubList(container, files, current, selectFilter, onselect, style) { style = style || ""; - var list = $('
    ',{class:"projects-dialog-file-list", style:style}).appendTo(container).editableList({ + var list = $('
      ',{class:"red-ui-projects-dialog-file-list", style:style}).appendTo(container).editableList({ addButton: false, scrollOnAdd: false, addItem: function(row,index,entry) { - var header = $('
      ',{class:"projects-dialog-file-list-entry"}).appendTo(row); + var header = $('
      ',{class:"red-ui-projects-dialog-file-list-entry"}).appendTo(row); if (entry.children) { - $(' ').appendTo(header); + $(' ').appendTo(header); if (entry.children.length > 0) { var children = $('
      ',{style:"padding-left: 20px;"}).appendTo(row); if (current.indexOf(entry.path+"/") === 0) { @@ -615,16 +615,16 @@ RED.projects.settings = (function() { fileIcon = "fa-book"; } else if (/^\.git/i.test(entry.name)) { fileIcon = "fa-code-fork"; - header.addClass("projects-dialog-file-list-entry-file-type-git"); + header.addClass("red-ui-projects-dialog-file-list-entry-file-type-git"); } - $(' ').appendTo(header); + $(' ').appendTo(header); if (selectFilter(entry)) { header.addClass("selectable"); if (entry.path === current) { header.addClass("selected"); } header.on("click", function(e) { - $(".projects-dialog-file-list-entry.selected").removeClass("selected"); + $(".red-ui-projects-dialog-file-list-entry.selected").removeClass("selected"); $(this).addClass("selected"); onselect(entry.path,true); }) @@ -636,7 +636,7 @@ RED.projects.settings = (function() { header.addClass("unselectable"); } } - $('').text(entry.name).appendTo(header); + $('').text(entry.name).appendTo(header); } }); if (!style) { @@ -730,7 +730,7 @@ RED.projects.settings = (function() { var title = $('

      ').text(RED._("sidebar.project.projectSettings.files")).appendTo(pane); var filesContainer = $('
      ').appendTo(pane); if (RED.user.hasPermission("projects.write")) { - var editFilesButton = $('') + var editFilesButton = $('') .appendTo(title) .on("click", function(evt) { evt.preventDefault(); @@ -739,7 +739,7 @@ RED.projects.settings = (function() { // packageFileLabelText.hide(); if (!activeProject.files.package) { - packageFileSubLabel.find(".projects-edit-form-sublabel-text").text(RED._("sidebar.project.projectSettings.packageCreate")); + packageFileSubLabel.find(".red-ui-projects-edit-form-sublabel-text").text(RED._("sidebar.project.projectSettings.packageCreate")); packageFileSubLabel.show(); } @@ -774,7 +774,7 @@ RED.projects.settings = (function() { .on("click", function(e) { if ($(this).hasClass('selected')) { $(this).removeClass('selected'); - packageFileLabel.find('.project-file-listing-container').slideUp(200,function() { + packageFileLabel.find('.red-ui-projects-file-listing-container').slideUp(200,function() { $(this).remove(); packageFileLabel.css('height',''); }); @@ -807,9 +807,9 @@ RED.projects.settings = (function() { } }) RED.popover.tooltip(packageFileInputSearch,RED._("sidebar.project.projectSettings.selectFile")); - var packageFileSubLabel = $('').appendTo(row).hide(); + var packageFileSubLabel = $('').appendTo(row).hide(); if (!activeProject.files.package) { - packageFileSubLabel.find(".projects-edit-form-sublabel-text").text(RED._("sidebar.project.projectSettings.fileNotExist")); + packageFileSubLabel.find(".red-ui-projects-edit-form-sublabel-text").text(RED._("sidebar.project.projectSettings.fileNotExist")); packageFileSubLabel.show(); } @@ -843,7 +843,7 @@ RED.projects.settings = (function() { .on("click", function(e) { if ($(this).hasClass('selected')) { $(this).removeClass('selected'); - flowFileLabel.find('.project-file-listing-container').slideUp(200,function() { + flowFileLabel.find('.red-ui-projects-file-listing-container').slideUp(200,function() { $(this).remove(); flowFileLabel.css('height',''); }); @@ -1050,7 +1050,7 @@ RED.projects.settings = (function() { credentialStateLabel.css('height',''); flowFileInputSearch.removeClass('selected'); - flowFileLabel.find('.project-file-listing-container').remove(); + flowFileLabel.find('.red-ui-projects-file-listing-container').remove(); flowFileLabel.css('height',''); flowFileLabel.css('color',''); @@ -1074,7 +1074,7 @@ RED.projects.settings = (function() { credFileLabelPrefixText.text(projectRoot); packageFileLabelText.text(activeProject.files.package||"package.json"); if (!activeProject.files.package) { - packageFileSubLabel.find(".projects-edit-form-sublabel-text").text(RED._("sidebar.project.projectSettings.fileNotExist")); + packageFileSubLabel.find(".red-ui-projects-edit-form-sublabel-text").text(RED._("sidebar.project.projectSettings.fileNotExist")); packageFileSubLabel.show(); } else { packageFileSubLabel.hide(); @@ -1181,7 +1181,7 @@ RED.projects.settings = (function() { var localBranchContainer = $('
      ').appendTo(pane); $('

      ').text(RED._("sidebar.project.projectSettings.branches")).appendTo(localBranchContainer); - var row = $('
      ').appendTo(localBranchContainer); + var row = $('
      ').appendTo(localBranchContainer); var branchList = $('
        ').appendTo(row).editableList({ @@ -1189,7 +1189,7 @@ RED.projects.settings = (function() { addButton: false, scrollOnAdd: false, addItem: function(row,index,entry) { - var container = $('
        ').appendTo(row); + var container = $('
        ').appendTo(row); if (entry.empty) { container.addClass('red-ui-search-empty'); container.text(RED._("sidebar.project.projectSettings.noBranches")); @@ -1223,7 +1223,7 @@ RED.projects.settings = (function() { .appendTo(tools) .on("click", function(e) { e.preventDefault(); - var spinner = utils.addSpinnerOverlay(row).addClass('projects-dialog-spinner-contain'); + var spinner = utils.addSpinnerOverlay(row).addClass('red-ui-component-spinner-contain'); var notification = RED.notify(RED._("sidebar.project.projectSettings.deleteConfirm", { name: entry.name }), { type: "warning", modal: true, @@ -1339,15 +1339,15 @@ RED.projects.settings = (function() { var emptyItem = { empty: true }; var isEmpty = true; var row = $('
        ').appendTo(repoContainer); - var addRemoteDialog = $('
        ').hide().appendTo(row); - row = $('
        ').appendTo(repoContainer); + var addRemoteDialog = $('
        ').hide().appendTo(row); + row = $('
        ').appendTo(repoContainer); var remotesList = $('
          ').appendTo(row); remotesList.editableList({ addButton: false, height: 'auto', addItem: function(row,index,entry) { - var container = $('
          ').appendTo(row); + var container = $('
          ').appendTo(row); if (entry.empty) { container.addClass('red-ui-search-empty'); container.text(RED._("sidebar.project.projectSettings.noRemotes")); @@ -1368,7 +1368,7 @@ RED.projects.settings = (function() { .appendTo(tools) .on("click", function(e) { e.preventDefault(); - var spinner = utils.addSpinnerOverlay(row).addClass('projects-dialog-spinner-contain'); + var spinner = utils.addSpinnerOverlay(row).addClass('red-ui-component-spinner-contain'); var notification = RED.notify(RED._("sidebar.project.projectSettings.deleteRemoteConfrim", { name: entry.name }), { type: "warning", modal: true, @@ -1461,7 +1461,7 @@ RED.projects.settings = (function() { var remoteNameInputChanged = false; var remoteURLInputChanged = false; - $('
          ').text(RED._('sidebar.project.projectSettings.addRemote2')).appendTo(addRemoteDialog); + $('
          ').text(RED._('sidebar.project.projectSettings.addRemote2')).appendTo(addRemoteDialog); row = $('
          ').appendTo(addRemoteDialog); $('').text(RED._("sidebar.project.projectSettings.remoteName")).appendTo(row); @@ -1469,14 +1469,14 @@ RED.projects.settings = (function() { remoteNameInputChanged = true; validateForm(); }); - $('').appendTo(row).find("small"); + $('').appendTo(row).find("small"); row = $('
          ').appendTo(addRemoteDialog); $('').text(RED._("sidebar.project.projectSettings.url")).appendTo(row); var remoteURLInput = $('').appendTo(row).on("change keyup paste",function() { remoteURLInputChanged = true; validateForm() }); - var remoteURLLabel = $('').appendTo(row).find("small"); + var remoteURLLabel = $('').appendTo(row).find("small"); var hideEditForm = function() { editRepoButton.attr('disabled',false); @@ -1500,7 +1500,7 @@ RED.projects.settings = (function() { .appendTo(formButtons) .on("click", function(evt) { evt.preventDefault(); - var spinner = utils.addSpinnerOverlay(addRemoteDialog).addClass('projects-dialog-spinner-contain'); + var spinner = utils.addSpinnerOverlay(addRemoteDialog).addClass('red-ui-component-spinner-contain'); var payload = { name: remoteNameInput.val(), @@ -1576,7 +1576,7 @@ RED.projects.settings = (function() { function createSettingsPane(activeProject) { - var pane = $('
          '); + var pane = $('
          '); createFilesSection(activeProject,pane); // createLocalRepositorySection(activeProject,pane); createRemoteRepositorySection(activeProject,pane); diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/projects/projectUserSettings.js b/packages/node_modules/@node-red/editor-client/src/js/ui/projects/projectUserSettings.js index ae224de88..f3533a19b 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/projects/projectUserSettings.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/projects/projectUserSettings.js @@ -90,8 +90,8 @@ RED.projects.userSettings = (function() { }; var row = $('
          ').appendTo(container); - var addKeyDialog = $('
          ').hide().appendTo(row); - $('
          ').text(RED._("editor:sidebar.project.userSettings.addSshKey")).appendTo(addKeyDialog); + var addKeyDialog = $('
          ').hide().appendTo(row); + $('
          ').text(RED._("editor:sidebar.project.userSettings.addSshKey")).appendTo(addKeyDialog); var addKeyDialogBody = $('
          ').appendTo(addKeyDialog); row = $('
          ').appendTo(addKeyDialogBody); @@ -131,33 +131,33 @@ RED.projects.userSettings = (function() { keyNameInputChanged = true; validateForm(); }); - $('').appendTo(row).find("small"); + $('').appendTo(row).find("small"); var generateKeyPane = $('
          ').appendTo(addKeyDialogBody); row = $('
          ').appendTo(generateKeyPane); $('').text(RED._("editor:sidebar.project.userSettings.passphrase")).appendTo(row); var passphraseInput = $('').appendTo(row).on("change keyup paste",validateForm); - var passphraseInputSubLabel = $('').appendTo(row).find("small"); + var passphraseInputSubLabel = $('').appendTo(row).find("small"); // var addLocalKeyPane = $('
          ').hide().appendTo(addKeyDialogBody); // row = $('
          ').appendTo(addLocalKeyPane); // $('').text('Public key').appendTo(row); // var localPublicKeyPathInput = $('').appendTo(row).on("change keyup paste",validateForm); - // $('').appendTo(row).find("small"); + // $('').appendTo(row).find("small"); // row = $('
          ').appendTo(addLocalKeyPane); // $('').text('Private key').appendTo(row); // var localPrivateKeyPathInput = $('').appendTo(row).on("change keyup paste",validateForm); - // $('').appendTo(row).find("small"); + // $('').appendTo(row).find("small"); // // var uploadKeyPane = $('
          ').hide().appendTo(addKeyDialogBody); // row = $('
          ').appendTo(uploadKeyPane); // $('').text('Public key').appendTo(row); // var publicKeyInput = $('') .appendTo(commitBox) .on("change keyup paste",function() { submitCommitButton.prop('disabled',$(this).val().trim()===""); }); - var commitToolbar = $('