MCPcopy Index your code
hub / github.com/CodeboxIDE/codebox / openFileWith

Function openFileWith

client/core/files.js:160–174  ·  view source on GitHub ↗
(file, fileOptions)

Source from the content-addressed store, hash-verified

158
159 // Select to open a file with any handler
160 var openFileWith = function(file, fileOptions) {
161 var choices = {};
162 _.each(handlers, function(handler) {
163 choices[handler.id] = handler.name;
164 });
165
166 if (_.size(choices) == 0) {
167 return Q.reject(new Error("No handlers for this file"));
168 }
169
170 return dialogs.select("Can't open this file", "Sorry, No handler has been found to open this file. Try to find and install an add-on to manage this file or select one of the following handlers:", choices).then(function(value) {
171 var handler = handlers[value];
172 return Q(openFileHandler(handler, file, fileOptions));
173 });
174 };
175
176 // Open a file
177 var openFile = function(file, options) {

Callers 1

openFileFunction · 0.85

Calls 2

QFunction · 0.85
openFileHandlerFunction · 0.85

Tested by

no test coverage detected