diff options
author | David Barksdale <amatus@amatus.name> | 2013-11-30 16:49:24 -0600 |
---|---|---|
committer | David Barksdale <amatus@amatus.name> | 2013-11-30 16:49:24 -0600 |
commit | 8f842f378aa5d9c9e84b2fb2ccf8294e4f854beb (patch) | |
tree | c79bc698807768cbb63057ecc3a34852da168051 /src | |
parent | 74e875d7e8d30d59f872b4cfcd1702143f56b915 (diff) |
Let's do peerinfo in js.
It's going to have to call back to the main window to access
localStorage.
Diffstat (limited to 'src')
-rw-r--r-- | src/js/configuration.js | 17 | ||||
-rw-r--r-- | src/js/peerinfo.js | 24 |
2 files changed, 37 insertions, 4 deletions
diff --git a/src/js/configuration.js b/src/js/configuration.js index 502eb52..92914cd 100644 --- a/src/js/configuration.js +++ b/src/js/configuration.js @@ -16,15 +16,15 @@ mergeInto(LibraryManager.library, { $CONFIG: { - 'peerinfo': { - 'HOSTS': '/hosts', + 'PEER': { + 'PRIVATE_KEY' : '/private_key', }, }, GNUNET_CONFIGURATION_get_value__deps: ['$CONFIG'], GNUNET_CONFIGURATION_get_value: function(section, option) { var section = Pointer_stringify(section); var option = Pointer_stringify(option); - Module.print('GNUNET_CONFIGURATION_get_value_yesno(' + section + ',' + option + ')'); + Module.print('GNUNET_CONFIGURATION_get_value(' + section + ',' + option + ')'); if (!(section in CONFIG)) { Module.print(section + ' not in CONFIG'); return undefined; @@ -61,7 +61,16 @@ mergeInto(LibraryManager.library, { if (undefined === tmp) return -1; return tmp; - } + }, + GNUNET_CONFIGURATION_get_value_time__deps: + ['GNUNET_CONFIGURATION_get_value'], + GNUNET_CONFIGURATION_get_value_time: function(cfg, section, option, time) { + var tmp = _GNUNET_CONFIGURATION_get_value(section, option); + if (undefined === tmp) + return -1; + return ccall('GNUNET_STRINGS_fancy_time_to_relative', 'number', + ['string', 'number'], [tmp, time]); + }, }); // vim: set expandtab ts=2 sw=2: diff --git a/src/js/peerinfo.js b/src/js/peerinfo.js new file mode 100644 index 0000000..7a4b4de --- /dev/null +++ b/src/js/peerinfo.js @@ -0,0 +1,24 @@ +// peerinfo.js - peerinfo service for gnunet-web +// Copyright (C) 2013 David Barksdale <amatus@amatus.name> +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see <http://www.gnu.org/licenses/>. + +mergeInto(LibraryManager.library, { + GNUNET_PEERINFO_connect: function(cfg) { + Module.print('GNUNET_PEERINFO_connect'); + return 1; // Opaque non-null pointer + }, +}); + +// vim: set expandtab ts=2 sw=2: |