Permalink
Browse files

Updating to latest CoffeeScript, no functional changes (I hope)

  • Loading branch information...
1 parent 65808c0 commit 3de3d1732eeac3c24ab1de49c9e92f192cef7ad2 @StanAngeloff committed Jul 26, 2010
@@ -1,4 +1,4 @@
-(function(){
+(function() {
var _, __, anchor, document, print, scimoz, session, view;
view = ko.views.manager && ko.views.manager.currentView;
document = view && view.document;
@@ -7,8 +7,7 @@
_ = (__ = scimoz && scimoz.selText);
print = function(string) {
scimoz.insertText(scimoz.currentPos, string);
- scimoz.anchor = scimoz.currentPos += string.length;
- return scimoz.anchor;
+ return (scimoz.anchor = scimoz.currentPos += string.length);
};
_ = "contents";
if (__ && _ !== __) {
@@ -1,4 +1,4 @@
-(function(){
+(function() {
var $toolkit, eventsBag, prefsBranch, prefsService, recentKomodoWindow, windowManagerService;
const Cc = Components.classes;
const Ci = Components.interfaces;
@@ -39,22 +39,22 @@
rangeEnd = {};
for (i = 0; (0 <= selectionLength ? i < selectionLength : i > selectionLength); (0 <= selectionLength ? i += 1 : i -= 1)) {
selection.getRangeAt(i, rangeStart, rangeEnd);
- (_a = rangeStart.value); (_b = rangeEnd.value);
+ _a = rangeStart.value; _b = rangeEnd.value;
for (j = _a; (_a <= _b ? j <= _b : j >= _b); (_a <= _b ? j += 1 : j -= 1)) {
if (j >= 0) {
selectedRows.push(j);
}
}
}
groupedState = true;
- (_c = selectedRows.length);
+ _c = selectedRows.length;
for (i = 0; (0 <= _c ? i < _c : i > _c); (0 <= _c ? i += 1 : i -= 1)) {
groupedState = groupedState && tree.view.getCellValue(selectedRows[i], {}) === 'true';
if (!(groupedState)) {
break;
}
}
- (_d = selectedRows.length);
+ _d = selectedRows.length;
for (i = 0; (0 <= _d ? i < _d : i > _d); (0 <= _d ? i += 1 : i -= 1)) {
tree.view.setCellValue(selectedRows[i], {}, groupedState ? 'false' : 'true');
}
@@ -1,4 +1,4 @@
-(function(){
+(function() {
var SUBLANGUAGE_EXTRA_LIST, SUBLANGUAGE_SUPPORTED_LIST, root;
root = (typeof $toolkit !== "undefined" && $toolkit !== null) ? $toolkit : this;
root.include('editor');
@@ -1,4 +1,4 @@
-(function(){
+(function() {
var root;
root = (typeof $toolkit !== "undefined" && $toolkit !== null) ? $toolkit : this;
root.include('command.language');
@@ -1,4 +1,4 @@
-(function(){
+(function() {
var root;
root = (typeof $toolkit !== "undefined" && $toolkit !== null) ? $toolkit : this;
root.include('command.language');
@@ -1,19 +1,17 @@
-(function(){
+(function() {
var root;
+ var __bind = function(func, context) {
+ return function(){ return func.apply(context, arguments); };
+ };
root = (typeof $toolkit !== "undefined" && $toolkit !== null) ? $toolkit : this;
root.include('command.language');
$self.controller = function() {
var canChangeTriggerKeys, command, supportedLanguages, triggerKeys;
root.command.language.controller.apply(this, [(command = 'quickMacro'), (triggerKeys = 'Ctrl+Alt+R'), (supportedLanguages = '*'), (canChangeTriggerKeys = true)]);
this.parts = [];
- $toolkit.events.onUnload((function(__this) {
- var __func = function() {
- return ko.projects.active.manager.removeItems(this.parts);
- };
- return (function() {
- return __func.apply(__this, arguments);
- });
- })(this));
+ $toolkit.events.onUnload(__bind(function() {
+ return ko.projects.active.manager.removeItems(this.parts);
+ }, this));
this.trigger = function(e) {
var _a, result, scimoz, wnd;
(ko.macros == undefined ? undefined : ko.macros.recorder == undefined ? undefined : ko.macros.recorder.mode) === 'recording' ? ko.macros.recorder.undo() : null;
@@ -1,4 +1,4 @@
-(function(){
+(function() {
var $toolkit, compileMacro, languageEl, macroBufferEl, originalIndent, originalTabWidth, originalUseTabs, partService, prefsBranch, prefsService, switchLanguage;
xtk.include('domutils');
$toolkit = window.opener.extensions.htmlToolkit;
@@ -86,13 +86,11 @@
if (language === 'coffeescript') {
macroBufferEl.scimoz.tabWidth = 2;
macroBufferEl.scimoz.indent = 2;
- macroBufferEl.scimoz.useTabs = false;
- return macroBufferEl.scimoz.useTabs;
+ return (macroBufferEl.scimoz.useTabs = false);
} else if (language === 'javascript') {
macroBufferEl.scimoz.tabWidth = originalTabWidth;
macroBufferEl.scimoz.indent = originalIndent;
- macroBufferEl.scimoz.useTabs = originalUseTabs;
- return macroBufferEl.scimoz.useTabs;
+ return (macroBufferEl.scimoz.useTabs = originalUseTabs);
}
};
compileMacro = function(contents, language) {
@@ -1,5 +1,8 @@
(function() {
var TOOL_COMMANDS_GROUP, TOOL_NATIVE_MENU_ID, TOOL_ORDERING, encodingService, root;
+ var __bind = function(func, context) {
+ return function(){ return func.apply(context, arguments); };
+ };
root = (typeof $toolkit !== "undefined" && $toolkit !== null) ? $toolkit : this;
const Cc = Components.classes;
const Ci = Components.interfaces;
@@ -62,8 +65,7 @@
onChange: function(handler) {
var _a;
if (typeof handler !== "undefined" && handler !== null) {
- this.changeHandler = handler;
- return this.changeHandler;
+ return (this.changeHandler = handler);
} else if ((typeof (_a = this.changeHandler) !== "undefined" && _a !== null)) {
return this.changeHandler();
}
@@ -227,38 +229,32 @@
};
this.registerBase = this.register;
this.register = function() {
- $self.manager.onChange((function(__this) {
- return function() {
- return __this.rebuildEditMenu();
- };
- })(this));
- root.events.onLoad((function(__this) {
- return function() {
- var menuEl;
- __this.rebuildEditMenu();
- if (!__this.hasNative) {
- __this.moveBuiltInMenuItems();
- }
- menuEl = document.getElementById('popup_sourcecode');
- menuEl.addEventListener('popupshowing', __this.onMenuShowing, false);
- return window.controllers.appendController(__this);
- };
- })(this));
+ $self.manager.onChange(__bind(function() {
+ return this.rebuildEditMenu();
+ }, this));
+ root.events.onLoad(__bind(function() {
+ var menuEl;
+ this.rebuildEditMenu();
+ if (!this.hasNative) {
+ this.moveBuiltInMenuItems();
+ }
+ menuEl = document.getElementById('popup_sourcecode');
+ menuEl.addEventListener('popupshowing', this.onMenuShowing, false);
+ return window.controllers.appendController(this);
+ }, this));
return this.registerBase();
};
this.unregisterBase = this.unregister;
this.unregister = function() {
- root.events.onUnload((function(__this) {
- return function() {
- var menuEl;
- menuEl = document.getElementById('popup_sourcecode');
- menuEl.removeEventListener('popupshowing', __this.onMenuShowing, false);
- if (!__this.hasNative) {
- __this.restoreBuiltInMenuItems();
- }
- return window.controllers.removeController(__this);
- };
- })(this));
+ root.events.onUnload(__bind(function() {
+ var menuEl;
+ menuEl = document.getElementById('popup_sourcecode');
+ menuEl.removeEventListener('popupshowing', this.onMenuShowing, false);
+ if (!this.hasNative) {
+ this.restoreBuiltInMenuItems();
+ }
+ return window.controllers.removeController(this);
+ }, this));
return this.unregisterBase();
};
this.supportsCommand = function(command) {
@@ -1,4 +1,4 @@
-(function(){
+(function() {
var root;
root = (typeof $toolkit !== "undefined" && $toolkit !== null) ? $toolkit : this;
$self.tool = function() {
@@ -1,4 +1,4 @@
-(function(){
+(function() {
var root;
root = (typeof $toolkit !== "undefined" && $toolkit !== null) ? $toolkit : this;
$self.tool = function() {
@@ -1,4 +1,4 @@
-(function(){
+(function() {
var _a, characterToEntity, entityName, root;
var __hasProp = Object.prototype.hasOwnProperty;
root = (typeof $toolkit !== "undefined" && $toolkit !== null) ? $toolkit : this;
@@ -1,4 +1,4 @@
-(function(){
+(function() {
var root;
root = (typeof $toolkit !== "undefined" && $toolkit !== null) ? $toolkit : this;
$self.tool = function() {
@@ -1,4 +1,4 @@
-(function(){
+(function() {
var $toolkit, _a, clearEncoding, clearEverything, clearIndentation, currentView, encodingSvc, encodingsBuilt, eventHandler, eventName, events, indentationBuilt, indentationsList, lastEncodingLongName, lastEncodingName, lastEncodingPythonName, lastEncodingUseBOM, lastIndentHardTabs, lastIndentLevels, lastIndentTabWidth, lastNewlineEndings, newlineEndings, pollingTimer, restartPolling, root, startPolling, stopPolling, stopPollingAndClear;
var __hasProp = Object.prototype.hasOwnProperty;
root = this;
@@ -30,17 +30,15 @@
lastEncodingLongName = null;
lastEncodingPythonName = null;
lastEncodingUseBOM = null;
- lastNewlineEndings = null;
- return lastNewlineEndings;
+ return (lastNewlineEndings = null);
};
clearIndentation = function() {
var indentationWidget;
indentationWidget = document.getElementById('statusbar-indentation-button');
indentationWidget.removeAttribute('label');
lastIndentHardTabs = null;
lastIndentLevels = null;
- lastIndentTabWidth = null;
- return lastIndentTabWidth;
+ return (lastIndentTabWidth = null);
};
clearEverything = function() {
clearEncoding();
@@ -88,8 +86,7 @@
indentationWidget.setAttribute('label', indentationButtonText);
lastIndentHardTabs = newIndentHardTabs;
lastIndentLevels = newIndentLevels;
- lastIndentTabWidth = newIndentTabWidth;
- return lastIndentTabWidth;
+ return (lastIndentTabWidth = newIndentTabWidth);
}
} else {
return clearIndentation();
@@ -103,16 +100,14 @@
};
block();
pollingTimer = setInterval(block, POLLING_INTERVAL);
- id = pollingTimer;
- return id;
+ return (id = pollingTimer);
};
stopPolling = function() {
if (!(pollingTimer)) {
return null;
}
clearInterval(pollingTimer);
- pollingTimer = null;
- return pollingTimer;
+ return (pollingTimer = null);
};
stopPollingAndClear = function() {
stopPolling();
@@ -170,8 +165,7 @@
if (!(view = currentView())) {
return null;
}
- view.document.existing_line_endings = lastNewlineEndings;
- return view.document.existing_line_endings;
+ return (view.document.existing_line_endings = lastNewlineEndings);
};
$toolkit.statusbar.updateViewEncoding = function(pythonName) {
var applyButton, cancelButton, choice, errorCode, errorMessage, lastErrorSvc, message, newEncoding, question, view, viewEncoding, warning;

0 comments on commit 3de3d17

Please sign in to comment.