Lines Matching refs:file

25 			var file = this.getCurrentFile();
27 if (file != null && file.isModified())
29 var evt = {category: 'DISCARD-FILE-' + file.getHash(),
30 action: ((file.savingFile) ? 'saving' : '') +
31 ((file.savingFile && file.savingFileTime != null) ? '_' +
32 Math.round((Date.now() - file.savingFileTime.getTime()) / 1000) : '') +
33 ((file.saveLevel != null) ? ('-sl_' + file.saveLevel) : '') +
34 …'-age_' + ((file.ageStart != null) ? Math.round((Date.now() - file.ageStart.getTime()) / 1000) : '…
36 ((file.isAutosave()) ? '' : '-noauto') +
37 …'-open_' + ((file.opened != null) ? Math.round((Date.now() - file.opened.getTime()) / 1000) : 'x')…
38 …'-save_' + ((file.lastSaved != null) ? Math.round((Date.now() - file.lastSaved.getTime()) / 1000) …
39 …'-change_' + ((file.lastChanged != null) ? Math.round((Date.now() - file.lastChanged.getTime()) / …
41 label: (file.sync != null) ? ('client_' + file.sync.clientId) : 'nosync'};
43 if (file.constructor == DriveFile && file.desc != null && this.drive != null)
46 file.desc.headRevisionId + '-mod_' + file.desc.modifiedDate + '-size_' + file.getSize() +
47 '-mime_' + file.desc.mimeType;
58 var file = this.getCurrentFile();
60 if (file != null)
63 '-AUTOSAVE-FILE-' + file.getHash(), action: 'changed',
1689 var file = this.getCurrentFile();
1690 var mode = (file != null) ? file.getMode() : null;
1719 var file = this.getCurrentFile();
1721 if (file != null && file.sync != null)
1723 file.sync.destroy();
1724 file.sync = null;
1821 var file = this.getCurrentFile();
1823 if (file != null && file.isModified() && file.isAutosave() && file.isOverdue())
1825 var evt = {category: 'WARN-FILE-' + file.getHash(),
1826 action: ((file.savingFile) ? 'saving' : '') +
1827 ((file.savingFile && file.savingFileTime != null) ? '_' +
1828 Math.round((Date.now() - file.savingFileTime.getTime()) / 1000) : '') +
1829 ((file.saveLevel != null) ? ('-sl_' + file.saveLevel) : '') +
1830 …'-age_' + ((file.ageStart != null) ? Math.round((Date.now() - file.ageStart.getTime()) / 1000) : '…
1832 ((file.isAutosave()) ? '' : '-noauto') +
1833 …'-open_' + ((file.opened != null) ? Math.round((Date.now() - file.opened.getTime()) / 1000) : 'x')…
1834 …'-save_' + ((file.lastSaved != null) ? Math.round((Date.now() - file.lastSaved.getTime()) / 1000) …
1835 …'-change_' + ((file.lastChanged != null) ? Math.round((Date.now() - file.lastChanged.getTime()) / …
1837 label: (file.sync != null) ? ('client_' + file.sync.clientId) : 'nosync'};
1839 if (file.constructor == DriveFile && file.desc != null && this.drive != null)
1842 file.desc.headRevisionId + '-mod_' + file.desc.modifiedDate + '-size_' + file.getSize() +
1843 '-mime_' + file.desc.mimeType;
1850 if (file.lastSaved != null)
1852 var str = this.timeSince(file.lastSaved);
1872 this.actions.get((this.mode == null || !file.isEditable()) ?
2147 var file = this.getCurrentFile();
2149 if (file != null && this.editor.isChromelessView() && this.editor.graph.isLightboxView())
2151 return file.getData();
2256 var file = this.getCurrentFile();
2258 if (file != null)
2261 if (file.constructor == LocalFile && file.getHash() == '' && !file.isModified() &&
2263 !this.editor.isChromelessView() && file.fileHandle == null)
2267 else if (file.isModified())
2273 file.close(true);
2290 var file = this.getCurrentFile();
2297 if (file != null)
2299 var filename = (file.getTitle() != null) ? file.getTitle() : this.defaultFilename;
2592 var file = this.getCurrentFile();
2593 mode = (file != null) ? file.getMode() : mode;
2653 var file = this.getCurrentFile();
2654 var mode = (file != null) ? file.getMode() : null;
2658 if (file != null && file.desc != null && file.desc.parents != null &&
2659 file.desc.parents.length > 0 && !mxEvent.isShiftDown(evt))
2662 this.openLink('https://drive.google.com/drive/folders/' + file.desc.parents[0].id);
2664 else if (file != null && file.getId() != null)
2666 this.openLink('https://drive.google.com/open?id=' + file.getId());
2675 if (file != null && file.meta != null && file.meta.webUrl != null)
2677 var url = file.meta.webUrl;
2678 var name = encodeURIComponent(file.meta.name);
2694 if (file != null && file.stat != null && file.stat.path_display != null)
2696 var url = 'https://www.dropbox.com/home/Apps/drawio' + file.stat.path_display;
2700 url = url.substring(0, url.length - file.stat.name.length);
2720 if (file != null && file.constructor == GitHubFile)
2722 this.openLink(file.meta.html_url);
2731 if (file != null && file.constructor == GitLabFile)
2733 this.openLink(file.meta.html_url);
2959 var file = this.getCurrentFile();
2961 if (file != null)
2963 file.setModified(false);
3095 var file = this.getCurrentFile();
3096 EditorUi.debug('storage event', evt, file);
3098 …if (file != null && evt.key == '.draft-alive-check' && evt.newValue != null && file.draftId != nul…
3101 file.saveDraft();
3124 var file = this.getCurrentFile();
3126 if (file == null || file.getHash() != id)
3138 var file = this.getCurrentFile();
3139 window.location.hash = (file != null) ? file.getHash() : '';
3194 var file = new LocalFile(this, xml, title, true);
3198 file.getHash = function()
3204 this.fileLoaded(file);
3498 var file = this.getCurrentFile();
3500 if (file != null)
3502 file.fileChanged();
3773 fileHandle.getFile().then(mxUtils.bind(this, function(file) argument
3785 if (file.type == 'image/png')
3790 success(new LocalFile(this, data, file.name, null, fileHandle, file));
3794 this.openFileHandle(e.target.result, file.name, file, false, fileHandle);
3805 if ((file.type.substring(0, 5) === 'image' ||
3806 file.type === 'application/pdf') &&
3807 file.type.substring(0, 9) !== 'image/svg')
3809 reader.readAsDataURL(file);
3813 reader.readAsText(file);
4093 peer.getLibrary(id, mxUtils.bind(this, function(file) argument
4099 this.loadLibrary(file);
4127 (mxUtils.bind(this, function(file) argument
4135 this.loadLibrary(new LocalLibrary(this, e.target.result, file.name));
4143 reader.readAsText(file);
4219 App.prototype.saveLibrary = function(name, images, file, mode, noSpin, noReload, fn) argument
4241 if (file == null && mode == App.MODE_DEVICE)
4243 file = new LocalLibrary(this, xml, name);
4246 if (file == null)
4317 var file = new StorageLibrary(this, xml, name);
4320 file.saveFile(name, false, mxUtils.bind(this, function()
4323 this.libraryLoaded(file, images);
4344 file.setData(xml);
4348 file.save(true, mxUtils.bind(this, function(resp)
4355 this.libraryLoaded(file, images);
4365 if (name != file.getTitle())
4367 var oldHash = file.getHash();
4369 file.rename(name, mxUtils.bind(this, function(resp)
4372 if (file.constructor != LocalLibrary && oldHash != file.getHash())
4375 mxSettings.addCustomLibrary(file.getHash());
4403 var file = this.getCurrentFile();
4405 if (file != null)
4412 file.removeDraft();
4415 if (this.getCurrentFile() != file && !file.isModified())
4419 if (file.getMode() != App.MODE_DEVICE)
4435 …if (!forceDialog && file.getTitle() != null && file.invalidFileHandle == null && this.mode != null)
4437 this.save(file.getTitle(), done);
4439 else if (file != null && file.constructor == LocalFile && file.fileHandle != null)
4443 file.invalidFileHandle = null;
4444 file.fileHandle = fileHandle;
4445 file.title = desc.name;
4446 file.desc = desc;
4448 }), null, this.createFileSystemOptions(file.getTitle()));
4452 var filename = (file.getTitle() != null) ? file.getTitle() : this.defaultFilename;
4496 if (file != null && EditorUi.nativeFileSupport)
4500 file.fileHandle = fileHandle;
4501 file.mode = App.MODE_DEVICE;
4502 file.title = desc.name;
4503 file.desc = desc;
4738 this.drive.insertFile(title, data, folderId, mxUtils.bind(this, function(file) argument
4741 this.fileCreated(file, libs, replace, done, clibs);
4746 this.gitHub.insertFile(title, data, mxUtils.bind(this, function(file) argument
4749 this.fileCreated(file, libs, replace, done, clibs);
4754 this.gitLab.insertFile(title, data, mxUtils.bind(this, function(file) argument
4757 this.fileCreated(file, libs, replace, done, clibs);
4762 this.notion.insertFile(title, data, mxUtils.bind(this, function(file) argument
4765 this.fileCreated(file, libs, replace, done, clibs);
4770 this.trello.insertFile(title, data, mxUtils.bind(this, function(file) argument
4773 this.fileCreated(file, libs, replace, done, clibs);
4778 this.dropbox.insertFile(title, data, mxUtils.bind(this, function(file) argument
4781 this.fileCreated(file, libs, replace, done, clibs);
4786 this.oneDrive.insertFile(title, data, mxUtils.bind(this, function(file) argument
4789 this.fileCreated(file, libs, replace, done, clibs);
4794 StorageFile.insertFile(this, title, data, mxUtils.bind(this, function(file) argument
4797 this.fileCreated(file, libs, replace, done, clibs);
4806 var file = new LocalFile(this, data, desc.name, null, fileHandle, desc);
4808 file.saveFile(desc.name, false, mxUtils.bind(this, function()
4810 this.fileCreated(file, libs, replace, done, clibs);
4840 App.prototype.fileCreated = function(file, libs, replace, done, clibs) argument
4857 if (file.getMode() != App.MODE_DEVICE)
4859 url += '#' + file.getHash();
4866 var data = file.getData();
4874 if (dataNode != null && /\.svg$/i.test(file.getTitle()))
4881 file.setData(this.createFileData(dataNode, graph, file, redirect));
4907 this.fileLoaded(file);
4911 file.addAllSavedStatus();
4955 if (file.constructor == LocalFile)
4962 window.openFile.setData(file.getData(), file.getTitle(), file.getMode() == null);
4979 if (file.constructor == LocalFile)
4985 file.saveFile(file.getTitle(), false, mxUtils.bind(this, function()
5003 App.prototype.loadFile = function(id, sameWindow, file, success, force) argument
5065 else if (file != null)
5069 this.fileLoaded(file);
5313 peer.getFile(id, mxUtils.bind(this, function(file) argument
5316 this.fileLoaded(file);
5334 else if (file == currentFile && file.getMode() == null)
5416 App.prototype.getLibraryStorageHint = function(file) argument
5418 var tip = file.getTitle();
5420 if (file.constructor != LocalLibrary)
5422 tip += '\n' + file.getHash();
5425 if (file.constructor == DriveLibrary)
5429 else if (file.constructor == GitHubLibrary)
5433 else if (file.constructor == TrelloLibrary)
5437 else if (file.constructor == DropboxLibrary)
5441 else if (file.constructor == OneDriveLibrary)
5445 else if (file.constructor == StorageLibrary)
5449 else if (file.constructor == LocalLibrary)
5531 var onload = mxUtils.bind(this, function(file) argument
5534 files[index] = file;
5696 peer.getLibrary(decodeURIComponent(id.substring(1)), mxUtils.bind(this, function(file) argument
5700 onload(file);
5739 var file = this.getCurrentFile();
5811 if (file != null)
6149 var file = this.getCurrentFile();
6151 if (file != null && this.spinner.spin(document.body, mxResources.get('saving')))
6162 file.handleFileSuccess(true);
6172 if (file.isModified())
6180 file.handleFileError(err, true);
6185 if (name == file.getTitle())
6187 file.save(true, success, error);
6191 file.saveAs(name, success, error)
6429 var file = this.getCurrentFile();
6431 if (file != null)
6437 var filename = (file.getTitle() != null) ? file.getTitle() : this.defaultFilename;
6443 var editable = file.isEditable() && !file.invalidChecksum;
6456 var newHash = file.getHash();
6472 if (this.format != null && (file == null ||
6473 this.fileEditable != file.isEditable()) &&
6477 this.fileEditable = (file != null) ? file.isEditable() : null;
6480 this.fireEvent(new mxEventObject('fileDescriptorChanged', 'file', file));
6571 var file = JSON.parse(req.responseText);
6572 blob = this.base64ToBlob(file.content, 'application/octet-stream');
6666 var file = JSON.parse(req.getText());
6667 var data = file.content;
6669 if (file.encoding === 'base64')
6761 var file = this.getCurrentFile();
6763 if (file != null)
6765 var mode = file.getMode();
6843 var file = this.getCurrentFile();
6845 if (file != null && file.isRenamable())
7182 var file = this.getCurrentFile();
7184 if (file != null && file.constructor == DriveFile)
7443 var file = this.getCurrentFile();
7445 if (file != null && file.constructor == DropboxFile)
7453 if (!file.isModified())
7474 var file = this.getCurrentFile();
7476 if (file != null && file.constructor == OneDriveFile)
7484 if (!file.isModified())
7505 var file = this.getCurrentFile();
7507 if (file != null && file.constructor == GitHubFile)
7515 if (!file.isModified())
7536 var file = this.getCurrentFile();
7538 if (file != null && file.constructor == GitLabFile)
7546 if (!file.isModified())
7567 var file = this.getCurrentFile();
7569 if (file != null && file.constructor == NotionFile)
7577 if (!file.isModified())
7599 var file = this.getCurrentFile();
7601 if (file != null && file.constructor == TrelloFile)
7609 if (!file.isModified())