Browse Source

Merge pull request #17 from blink1073/cleanup

Cleanup
Afshin Darian 8 years ago
parent
commit
3576563bfa

+ 1 - 0
examples/filebrowser/src/index.ts

@@ -219,6 +219,7 @@ function createApp(manager: IServiceManager): void {
   menu.addItem({ command: 'file-rename' });
   menu.addItem({ command: 'file-remove' });
   menu.addItem({ command: 'file-duplicate' });
+  menu.addItem({ command: 'file-delete' });
   menu.addItem({ command: 'file-cut' });
   menu.addItem({ command: 'file-copy' });
   menu.addItem({ command: 'file-paste' });

+ 40 - 37
src/default-theme/commandpalette.css

@@ -11,86 +11,89 @@
 
 
 .p-CommandPalette-search {
-  margin-bottom: 4px;
+  padding: 8px;
 }
 
 
 .p-CommandPalette-wrapper {
   padding: 4px 6px;
-  margin: 4px;
   background: white;
   border: 1px solid #E0E0E0;
-  border-radius: 1px;
 }
 
 
 .p-CommandPalette-input {
   width: 100%;
-  outline: none;
   border: none;
-  font-size: 13px;
+  outline: none;
+  font-size: 16px;
 }
 
 
 .p-CommandPalette-header {
-  margin: 4px 0px;
-  padding: 4px 12px;
-  font-size: 11px;
+  padding: 4px;
+  color: #757575;
+  font-size: 12px;
   font-weight: 600;
-  text-transform: uppercase;
-  border-bottom: 1px solid #E0E0E0;
-  letter-spacing: 2px;
+  background: #E1E1E1;
+  cursor: pointer;
 }
 
 
-.p-CommandPalette-item {
-  padding: 4px 12px;
-  font-size: 13px;
-  font-weight: 500;
-  color: #757575;
+.p-CommandPalette-header.p-mod-active {
+  background: #7FDBFF;
 }
 
 
-.p-CommandPalette-commandCaption {
-  display: none;
+.p-CommandPalette-header:hover::before {
+  content: '\2026'; /* ellipsis */
+  float: right;
+  margin-right: 4px;
 }
 
 
-.p-CommandPalette-header:hover:not(.p-mod-active),
-.p-CommandPalette-item:hover:not(.p-mod-active) {
-  background: #EEEEEE;
+.p-CommandPalette-header > mark {
+  background-color: transparent;
+  font-weight: bold;
 }
 
 
-.p-CommandPalette-header mark {
-  color: #424242;
-  background: inherit;
+.p-CommandPalette-item {
+  padding: 4px 8px;
+  color: #757575;
+  font-size: 13px;
+  font-weight: 500;
+}
+
+
+.p-CommandPalette-item.p-mod-disabled {
+  color: rgba(0, 0, 0, 0.25);
 }
 
 
 .p-CommandPalette-item.p-mod-active {
-  color: rgba(255,255,255,0.7);
-  background: #2196F3;
+  background: #7FDBFF;
 }
 
-.p-CommandPalette-header.p-mod-active {
-  color: rgba(255,255,255,0.7);
-  background: #2196F3;
+
+.p-CommandPalette-item:hover:not(.p-mod-active):not(.p-mod-disabled) {
+  background: #E5E5E5;
 }
 
 
-.p-CommandPalette-item.p-mod-active .p-CommandPalette-itemCaption {
-  color: inherit;
+.p-CommandPalette-itemLabel > mark {
+  background-color: transparent;
+  font-weight: bold;
 }
 
 
-.p-CommandPalette-item.p-mod-active mark {
-    background: inherit;
-    color: white;
+.p-CommandPalette-item.p-mod-disabled mark {
+  color: rgba(0, 0, 0, 0.4);
 }
 
 
-.p-CommandPalette-item mark {
-    background: inherit;
-    color: #757575;
+.p-CommandPalette-itemCaption {
+  color: #9E9E9E;
+  font-size: 11px;
+  font-weight: 400;
 }

+ 1 - 1
src/docregistry/registry.ts

@@ -534,7 +534,7 @@ class DocumentRegistry implements IDocumentRegistry {
     name = name.toLowerCase();
     for (let i = 0; i < this._fileTypes.length; i++) {
       let fileType = this._fileTypes[i];
-      if (fileType.name === name) {
+      if (fileType.name.toLowerCase() === name) {
         return fileType;
       }
     }

+ 1 - 2
src/filebrowser/buttons.ts

@@ -464,7 +464,7 @@ namespace Private {
     for (let creator of creators) {
       let fileType = registry.getFileType(creator.fileType);
 
-      command = `${prefix}:new-${fileType}`;
+      command = `${prefix}:new-${creator.name}`;
       disposables.add(commands.addCommand(command, {
         execute: () => {
           let widgetName = creator.widgetName || 'default';
@@ -475,7 +475,6 @@ namespace Private {
       }));
       menu.addItem({ command });
     }
-
     return menu;
   }
 

+ 3 - 1
src/landing/plugin.ts

@@ -32,7 +32,8 @@ export
 const landingExtension: JupyterLabPlugin<void> = {
   id: 'jupyter.extensions.landing',
   requires: [IServiceManager, IPathTracker, ICommandPalette],
-  activate: activateLanding
+  activate: activateLanding,
+  autoStart: true
 };
 
 
@@ -138,6 +139,7 @@ function activateLanding(app: JupyterLab, services: IServiceManager, pathTracker
   dialog.appendChild(cwd);
 
   app.commands.addCommand('jupyterlab-launcher:show', {
+    label: 'Show Launcher',
     execute: () => {
       if (!widget.isAttached) {
         app.shell.addToMainArea(widget);

+ 1 - 1
src/notebook/output-area/model.ts

@@ -124,7 +124,7 @@ class OutputAreaModel implements IDisposable {
       // This also replaces the metadata of the last item.
       let text = value.text as string;
       value.text = lastOutput.text as string + text;
-      this._list.set(index, output);
+      this._list.set(index, value);
       return index;
     } else {
       switch (value.output_type) {