pull/1/head
Grandschtroumpf 6 years ago
parent e8454407dd
commit c4d99d4775
  1. 2
      src/app.js
  2. 15
      src/app/files/browser-files-tree.js
  3. 5
      src/universal-dapp.js

@ -488,7 +488,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
// The event listener needs to be registered as early as possible, because the
// parent will send the message upon the "load" event.
let filesToLoad = null
const loadFilesCallback = function (files) { filesToLoad = files } // will be replaced later
let loadFilesCallback = function (files) { filesToLoad = files } // will be replaced later
window.addEventListener('message', function (ev) {
if (typeof ev.data === typeof [] && ev.data[0] === 'loadFiles') {

@ -4,13 +4,13 @@ var EventManager = require('../../lib/events')
import { BaseApi } from 'remix-plugin'
class FilesTree extends BaseApi {
class FilesTree extends BaseApi {
constructor (name, storage) {
super({
name: name,
methods: ['get', 'set', 'remove'],
description: 'service - read/write file to the `config` explorer without need of additionnal permission.'
description:
'service - read/write file to the `config` explorer without need of additionnal permission.'
})
this.event = new EventManager()
this.storage = storage
@ -109,7 +109,11 @@ import { BaseApi } from 'remix-plugin'
if (!this.storage.rename(unprefixedoldPath, unprefixednewPath)) {
return false
}
this.event.trigger('fileRenamed', [this.type + '/' + unprefixedoldPath, this.type + '/' + unprefixednewPath, isFolder])
this.event.trigger('fileRenamed', [
this.type + '/' + unprefixedoldPath,
this.type + '/' + unprefixednewPath,
isFolder
])
return true
}
return false
@ -117,7 +121,7 @@ import { BaseApi } from 'remix-plugin'
resolveDirectory (path, callback) {
if (path[0] === '/') path = path.substring(1)
if (!path) return callback(null, { [this.type]: { } })
if (!path) return callback(null, { [this.type]: {} })
var tree = {}
path = this.removePrefix(path)
@ -138,7 +142,6 @@ import { BaseApi } from 'remix-plugin'
if (path[0] === '/') return path.substring(1)
return path
}
}
module.exports = FilesTree

@ -8,18 +8,15 @@ var txHelper = remixLib.execution.txHelper
var EventManager = remixLib.EventManager
var executionContext = remixLib.execution.executionContext
import { UdappApi } from 'remix-plugin'
import { EventEmitter } from 'events';
import { EventEmitter } from 'events'
const profile = {
name: 'udapp',
displayName: 'universal dapp',
events: ['newTransaction'],
methods: ['sendTransaction', 'getAccounts', 'createVMAccount'],
description: 'service - run transaction and access account',
permission: true
}
module.exports = class UniversalDApp extends UdappApi {
constructor (registry) {

Loading…
Cancel
Save