Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

atom-web-ui

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

atom-web-ui - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

src/static/ace.js

2

dist/core/atomWrapperWeb.d.ts

@@ -120,2 +120,4 @@ /// <reference path="../../typings/main.d.ts" />

constructor(editorPath: string, id?: string);
doAceSetup(ace: any): void;
setAceEditor(aceEditor: any): void;
getTitle(): string;

@@ -122,0 +124,0 @@ onDidChangeCursorPosition(callback: any): {

@@ -7,3 +7,3 @@ "use strict";

var html = require("../../src/static/workspace.html");
var global = getGlobal();
require("../../src/static/ace");
var isMutationSupport;

@@ -496,4 +496,4 @@ var Workspace = (function () {

this.id = editorPath;
var _this = this;
_this['soft-tabs'] = {};
var self = this;
self['soft-tabs'] = {};
this.textElement.className = 'editor';

@@ -514,3 +514,67 @@ this.textElement.style.position = 'relative';

var textEditor = this;
this.element.addEventListener('DOMNodeInserted', function (event) {
if (textEditor.ace) {
return;
}
textEditor.doAceSetup(window.ace);
});
}
TextEditor.prototype.doAceSetup = function (ace) {
this.ace = ace;
if (!ace) {
return;
}
var aceEditor = ace.edit(this.textElement.id);
// var langTools: any = ace.require('ace/ext/language_tools');
//
// aceEditor.setTheme('ace/theme/tomorrow_night');
//langTools.setCompleters([]);
//aceEditor.getSession().setMode(this.getMode());
//aceEditor.getSession().off("change", aceEditor.renderer.$gutterLayer.$updateAnnotations);
aceEditor.setOptions({
enableBasicAutocompletion: true,
enableLiveAutocompletion: true
});
this.setAceEditor(aceEditor);
// if(this.extension === '.raml') {
// var AceCompleter = getLazy('aceStuff').AceCompleter;
//
// langTools.addCompleter(new AceCompleter(this));
// }
};
TextEditor.prototype.setAceEditor = function (aceEditor) {
var _this = this;
this.aceEditor = aceEditor;
var textBuffer = this.getBuffer();
textBuffer.characterIndexForPosition = function (position) {
var result = aceEditor.getSession().getDocument().positionToIndex({ row: position.row, column: position.column }, 0);
return result;
};
textBuffer.positionForCharacterIndex = function (index) {
var result = aceEditor.getSession().getDocument().indexToPosition(index, 0);
return result;
};
textBuffer.setTextInRange = function (range, value) {
var AceRange = _this.ace.require("ace/range").Range;
var preparedRange = getRange(range.start.row, range.start.column, range.end.row, range.end.column);
var aceRange = new AceRange(preparedRange.start.row, preparedRange.start.column, preparedRange.end.row, preparedRange.end.column);
aceEditor.getSession().replace(aceRange, value);
};
textBuffer.setText = function (text) {
var top = _this.aceEditor.session.getScrollTop();
_this.aceEditor.setValue(text, 100);
_this.aceEditor.resize(true);
_this.aceEditor.session.setScrollTop(top);
};
this.aceEditor.session.setValue(textBuffer.getText());
var textEditor = this;
var extension = this.extension;
this.aceEditor.session.selection.on("changeCursor", function (event) {
textEditor.getLastCursor().doChangePosition();
});
this.aceEditor.on('change', function (arg) {
textBuffer.text = aceEditor.getValue();
textBuffer.doChange(arg);
});
};
TextEditor.prototype.getTitle = function () {

@@ -517,0 +581,0 @@ return path.basename(this.editorPath) + path.extname(this.editorPath);

2

package.json
{
"name": "atom-web-ui",
"version": "0.0.4",
"version": "0.0.5",
"main": "dist/index.js",

@@ -5,0 +5,0 @@ "scripts": {

@@ -7,3 +7,3 @@ "use strict";

var html = require("../../src/static/workspace.html");
var global = getGlobal();
require("../../src/static/ace");
var isMutationSupport;

@@ -496,4 +496,4 @@ var Workspace = (function () {

this.id = editorPath;
var _this = this;
_this['soft-tabs'] = {};
var self = this;
self['soft-tabs'] = {};
this.textElement.className = 'editor';

@@ -514,3 +514,67 @@ this.textElement.style.position = 'relative';

var textEditor = this;
this.element.addEventListener('DOMNodeInserted', function (event) {
if (textEditor.ace) {
return;
}
textEditor.doAceSetup(window.ace);
});
}
TextEditor.prototype.doAceSetup = function (ace) {
this.ace = ace;
if (!ace) {
return;
}
var aceEditor = ace.edit(this.textElement.id);
// var langTools: any = ace.require('ace/ext/language_tools');
//
// aceEditor.setTheme('ace/theme/tomorrow_night');
//langTools.setCompleters([]);
//aceEditor.getSession().setMode(this.getMode());
//aceEditor.getSession().off("change", aceEditor.renderer.$gutterLayer.$updateAnnotations);
aceEditor.setOptions({
enableBasicAutocompletion: true,
enableLiveAutocompletion: true
});
this.setAceEditor(aceEditor);
// if(this.extension === '.raml') {
// var AceCompleter = getLazy('aceStuff').AceCompleter;
//
// langTools.addCompleter(new AceCompleter(this));
// }
};
TextEditor.prototype.setAceEditor = function (aceEditor) {
var _this = this;
this.aceEditor = aceEditor;
var textBuffer = this.getBuffer();
textBuffer.characterIndexForPosition = function (position) {
var result = aceEditor.getSession().getDocument().positionToIndex({ row: position.row, column: position.column }, 0);
return result;
};
textBuffer.positionForCharacterIndex = function (index) {
var result = aceEditor.getSession().getDocument().indexToPosition(index, 0);
return result;
};
textBuffer.setTextInRange = function (range, value) {
var AceRange = _this.ace.require("ace/range").Range;
var preparedRange = getRange(range.start.row, range.start.column, range.end.row, range.end.column);
var aceRange = new AceRange(preparedRange.start.row, preparedRange.start.column, preparedRange.end.row, preparedRange.end.column);
aceEditor.getSession().replace(aceRange, value);
};
textBuffer.setText = function (text) {
var top = _this.aceEditor.session.getScrollTop();
_this.aceEditor.setValue(text, 100);
_this.aceEditor.resize(true);
_this.aceEditor.session.setScrollTop(top);
};
this.aceEditor.session.setValue(textBuffer.getText());
var textEditor = this;
var extension = this.extension;
this.aceEditor.session.selection.on("changeCursor", function (event) {
textEditor.getLastCursor().doChangePosition();
});
this.aceEditor.on('change', function (arg) {
textBuffer.text = aceEditor.getValue();
textBuffer.doChange(arg);
});
};
TextEditor.prototype.getTitle = function () {

@@ -517,0 +581,0 @@ return path.basename(this.editorPath) + path.extname(this.editorPath);

@@ -8,3 +8,3 @@ /// <reference path="../../typings/main.d.ts" />

var global = getGlobal();
require("../../src/static/ace");

@@ -735,5 +735,5 @@ var isMutationSupport: boolean;

var _this: any = <any>this;
var self: any = <any>this;
_this['soft-tabs'] = {};
self['soft-tabs'] = {};

@@ -764,3 +764,100 @@ this.textElement.className = 'editor';

var textEditor = this;
this.element.addEventListener('DOMNodeInserted', event => {
if(textEditor.ace) {
return;
}
textEditor.doAceSetup((<any>window).ace);
})
}
doAceSetup(ace: any) {
this.ace = ace;
if(!ace) {
return;
}
var aceEditor: any = ace.edit(this.textElement.id);
// var langTools: any = ace.require('ace/ext/language_tools');
//
// aceEditor.setTheme('ace/theme/tomorrow_night');
//langTools.setCompleters([]);
//aceEditor.getSession().setMode(this.getMode());
//aceEditor.getSession().off("change", aceEditor.renderer.$gutterLayer.$updateAnnotations);
aceEditor.setOptions({
enableBasicAutocompletion: true,
enableLiveAutocompletion: true
});
this.setAceEditor(aceEditor);
// if(this.extension === '.raml') {
// var AceCompleter = getLazy('aceStuff').AceCompleter;
//
// langTools.addCompleter(new AceCompleter(this));
// }
}
setAceEditor(aceEditor: any) {
this.aceEditor = aceEditor;
var textBuffer = this.getBuffer();
textBuffer.characterIndexForPosition = function (position:Point) {
var result = aceEditor.getSession().getDocument().positionToIndex({row: position.row, column: position.column}, 0);
return result;
}
textBuffer.positionForCharacterIndex = function (index:number) {
var result = aceEditor.getSession().getDocument().indexToPosition(index, 0);
return result;
}
textBuffer.setTextInRange = (range:Range, value:string) => {
var AceRange = this.ace.require("ace/range").Range;
var preparedRange: Range = getRange(range.start.row, range.start.column, range.end.row, range.end.column);
var aceRange = new AceRange(preparedRange.start.row, preparedRange.start.column, preparedRange.end.row, preparedRange.end.column);
aceEditor.getSession().replace(aceRange, value);
}
textBuffer.setText = (text: string) => {
var top = this.aceEditor.session.getScrollTop();
this.aceEditor.setValue(text, 100);
this.aceEditor.resize(true);
this.aceEditor.session.setScrollTop(top);
}
this.aceEditor.session.setValue(textBuffer.getText());
var textEditor = this;
var extension = this.extension;
this.aceEditor.session.selection.on("changeCursor", function (event: any) {
textEditor.getLastCursor().doChangePosition();
})
this.aceEditor.on('change', (arg: any) => {
textBuffer.text = aceEditor.getValue();
textBuffer.doChange(arg);
});
}

@@ -767,0 +864,0 @@ getTitle(): string {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc