[polari] cleanup: Stop using export lists
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari] cleanup: Stop using export lists
- Date: Wed, 4 Aug 2021 16:38:01 +0000 (UTC)
commit 8885815f039a49872b8c7e8838dd3c28bbfb6322
Author: Florian Müllner <fmuellner gnome org>
Date: Wed Aug 4 16:52:09 2021 +0200
cleanup: Stop using export lists
Listing all exports in a single place has some value, but mostly
for truly public API. Plus we generally export either a single
symbol, or (almost) all.
https://gitlab.gnome.org/GNOME/polari/-/merge_requests/208
src/accountsMonitor.js | 4 +---
src/appNotifications.js | 24 +++++++--------------
src/application.js | 4 +---
src/chatView.js | 4 +---
src/connections.js | 12 +++--------
src/entryArea.js | 12 +++--------
src/initialSetup.js | 4 +---
src/ircParser.js | 4 +---
src/joinDialog.js | 4 +---
src/mainWindow.js | 9 ++------
src/networksManager.js | 4 +---
src/pasteManager.js | 9 ++------
src/roomList.js | 4 +---
src/roomManager.js | 4 +---
src/roomStack.js | 4 +---
src/serverRoomManager.js | 9 ++------
src/tabCompletion.js | 4 +---
src/telepathyClient.js | 4 +---
src/urlPreview.js | 4 +---
src/userList.js | 13 +++---------
src/userTracker.js | 4 +---
src/utils.js | 54 +++++++++++++++---------------------------------
22 files changed, 53 insertions(+), 145 deletions(-)
---
diff --git a/src/accountsMonitor.js b/src/accountsMonitor.js
index 16c56cef..a4be8180 100644
--- a/src/accountsMonitor.js
+++ b/src/accountsMonitor.js
@@ -1,5 +1,3 @@
-export { AccountsMonitor };
-
import Gio from 'gi://Gio';
import GObject from 'gi://GObject';
import Polari from 'gi://Polari';
@@ -13,7 +11,7 @@ Gio._promisify(Tp.AccountManager.prototype, 'prepare_async', 'prepare_finish');
Gio._promisify(Tp.Account.prototype,
'request_presence_async', 'request_presence_finish');
-const AccountsMonitor = class {
+export const AccountsMonitor = class {
static getDefault() {
if (!this._singleton)
this._singleton = new AccountsMonitor();
diff --git a/src/appNotifications.js b/src/appNotifications.js
index cbc893a7..7c8cd760 100644
--- a/src/appNotifications.js
+++ b/src/appNotifications.js
@@ -1,13 +1,3 @@
-export {
- MessageNotification,
- UndoNotification,
- NotificationQueue,
- SimpleOutput,
- GridOutput,
- CommandOutputQueue,
- MessageInfoBar
-};
-
import GLib from 'gi://GLib';
import GObject from 'gi://GObject';
import Gtk from 'gi://Gtk';
@@ -38,7 +28,7 @@ const AppNotification = GObject.registerClass({
}
});
-const MessageNotification = GObject.registerClass(
+export const MessageNotification = GObject.registerClass(
class MessageNotification extends AppNotification {
_init(label, iconName) {
super._init();
@@ -78,7 +68,7 @@ class MessageNotification extends AppNotification {
}
});
-const UndoNotification = GObject.registerClass({
+export const UndoNotification = GObject.registerClass({
Signals: {
closed: {},
undo: {},
@@ -119,7 +109,7 @@ const CommandOutputNotification = GObject.registerClass({
}
});
-const SimpleOutput = GObject.registerClass(
+export const SimpleOutput = GObject.registerClass(
class SimpleOutput extends CommandOutputNotification {
_init(text) {
super._init();
@@ -135,7 +125,7 @@ class SimpleOutput extends CommandOutputNotification {
}
});
-const GridOutput = GObject.registerClass(
+export const GridOutput = GObject.registerClass(
class GridOutput extends CommandOutputNotification {
_init(header, items) {
super._init();
@@ -167,7 +157,7 @@ class GridOutput extends CommandOutputNotification {
}
});
-const NotificationQueue = GObject.registerClass(
+export const NotificationQueue = GObject.registerClass(
class NotificationQueue extends Gtk.Frame {
_init() {
super._init({
@@ -198,7 +188,7 @@ class NotificationQueue extends Gtk.Frame {
}
});
-const CommandOutputQueue = GObject.registerClass(
+export const CommandOutputQueue = GObject.registerClass(
class CommandOutputQueue extends NotificationQueue {
_init() {
super._init();
@@ -208,7 +198,7 @@ class CommandOutputQueue extends NotificationQueue {
}
});
-const MessageInfoBar = GObject.registerClass({
+export const MessageInfoBar = GObject.registerClass({
Properties: {
'title': GObject.ParamSpec.string(
'title', 'title', 'title',
diff --git a/src/application.js b/src/application.js
index 46d6a078..20d09d75 100644
--- a/src/application.js
+++ b/src/application.js
@@ -1,5 +1,3 @@
-export { Application };
-
import Gdk from 'gi://Gdk?version=3.0';
import Gio from 'gi://Gio';
import GLib from 'gi://GLib';
@@ -37,7 +35,7 @@ const MAX_RETRIES = 3;
const IRC_SCHEMA_REGEX = /^(irc?:\/\/)([\da-z.-]+):?(\d+)?\/(?:%23)?([\w.+-]+)/i;
-const Application = GObject.registerClass({
+export const Application = GObject.registerClass({
Signals: {
'prepare-shutdown': {},
'room-focus-changed': {},
diff --git a/src/chatView.js b/src/chatView.js
index 9ef5851d..26dd7daa 100644
--- a/src/chatView.js
+++ b/src/chatView.js
@@ -1,5 +1,3 @@
-export { ChatView };
-
import Gdk from 'gi://Gdk';
import Gio from 'gi://Gio';
import GLib from 'gi://GLib';
@@ -282,7 +280,7 @@ const HoverFilterTag = GObject.registerClass({
}
});
-const ChatView = GObject.registerClass({
+export const ChatView = GObject.registerClass({
Implements: [DropTargetIface],
Properties: {
'can-drop': GObject.ParamSpec.override('can-drop', DropTargetIface),
diff --git a/src/connections.js b/src/connections.js
index e00a89b8..00e5f512 100644
--- a/src/connections.js
+++ b/src/connections.js
@@ -1,9 +1,3 @@
-export {
- ConnectionProperties,
- ConnectionDetails,
- ConnectionsList
-};
-
import Gio from 'gi://Gio';
import GLib from 'gi://GLib';
import GObject from 'gi://GObject';
@@ -80,7 +74,7 @@ class ConnectionRow extends Gtk.ListBoxRow {
}
});
-const ConnectionsList = GObject.registerClass({
+export const ConnectionsList = GObject.registerClass({
Properties: {
'favorites-only': GObject.ParamSpec.boolean(
'favorites-only', 'favorites-only', 'favorites-only',
@@ -267,7 +261,7 @@ const ConnectionsList = GObject.registerClass({
}
});
-const ConnectionDetails = GObject.registerClass({
+export const ConnectionDetails = GObject.registerClass({
Template: 'resource:///org/gnome/Polari/ui/connection-details.ui',
InternalChildren: [
'nameEntry',
@@ -508,7 +502,7 @@ const ConnectionDetails = GObject.registerClass({
});
-const ConnectionProperties = GObject.registerClass({
+export const ConnectionProperties = GObject.registerClass({
Template: 'resource:///org/gnome/Polari/ui/connection-properties.ui',
InternalChildren: [
'details',
diff --git a/src/entryArea.js b/src/entryArea.js
index 2360ddcd..55642e66 100644
--- a/src/entryArea.js
+++ b/src/entryArea.js
@@ -1,9 +1,3 @@
-export {
- ChatEntry,
- EntryArea,
- NickPopover
-};
-
import Gdk from 'gi://Gdk';
import GdkPixbuf from 'gi://GdkPixbuf';
import Gio from 'gi://Gio';
@@ -24,7 +18,7 @@ const MAX_LINES = 5;
Gio._promisify(Gio._LocalFilePrototype,
'query_info_async', 'query_info_finish');
-const ChatEntry = GObject.registerClass({
+export const ChatEntry = GObject.registerClass({
Implements: [DropTargetIface],
Properties: {
'can-drop': GObject.ParamSpec.override('can-drop', DropTargetIface),
@@ -115,7 +109,7 @@ const ChatEntry = GObject.registerClass({
}
});
-const NickPopover = GObject.registerClass({
+export const NickPopover = GObject.registerClass({
Template: 'resource:///org/gnome/Polari/ui/nick-popover.ui',
InternalChildren: [
'nickEntry',
@@ -163,7 +157,7 @@ const NickPopover = GObject.registerClass({
}
});
-const EntryArea = GObject.registerClass({
+export const EntryArea = GObject.registerClass({
Template: 'resource:///org/gnome/Polari/ui/entry-area.ui',
InternalChildren: [
'chatEntry',
diff --git a/src/initialSetup.js b/src/initialSetup.js
index 06160d1c..3c8c32d3 100644
--- a/src/initialSetup.js
+++ b/src/initialSetup.js
@@ -1,5 +1,3 @@
-export { InitialSetupWindow };
-
import Gio from 'gi://Gio';
import GLib from 'gi://GLib';
import GObject from 'gi://GObject';
@@ -16,7 +14,7 @@ const SetupPage = {
OFFLINE: 2,
};
-const InitialSetupWindow = GObject.registerClass({
+export const InitialSetupWindow = GObject.registerClass({
Template: 'resource:///org/gnome/Polari/ui/initial-setup-window.ui',
InternalChildren: [
'contentStack',
diff --git a/src/ircParser.js b/src/ircParser.js
index 5de8d74c..3ada6b5e 100644
--- a/src/ircParser.js
+++ b/src/ircParser.js
@@ -1,5 +1,3 @@
-export { IrcParser };
-
import Gio from 'gi://Gio';
import GLib from 'gi://GLib';
import Tp from 'gi://TelepathyGLib';
@@ -50,7 +48,7 @@ const UNKNOWN_COMMAND_MESSAGE =
const ROOM_PREFIXES = ['#', '&', '+', '!'];
-const IrcParser = class IrcParser {
+export const IrcParser = class IrcParser {
constructor(room) {
this._app = Gio.Application.get_default();
this._roomManager = RoomManager.getDefault();
diff --git a/src/joinDialog.js b/src/joinDialog.js
index 2cad5dba..38c53529 100644
--- a/src/joinDialog.js
+++ b/src/joinDialog.js
@@ -1,5 +1,3 @@
-export { JoinDialog };
-
import Gdk from 'gi://Gdk';
import Gio from 'gi://Gio';
import GLib from 'gi://GLib';
@@ -14,7 +12,7 @@ const DialogPage = {
CONNECTION: 1,
};
-const JoinDialog = GObject.registerClass({
+export const JoinDialog = GObject.registerClass({
Template: 'resource:///org/gnome/Polari/ui/join-room-dialog.ui',
InternalChildren: [
'cancelButton',
diff --git a/src/mainWindow.js b/src/mainWindow.js
index f60bc2d6..76db2019 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -1,8 +1,3 @@
-export {
- MainWindow,
- FixedSizeFrame
-};
-
import Gdk from 'gi://Gdk';
import Gio from 'gi://Gio';
import GLib from 'gi://GLib';
@@ -19,7 +14,7 @@ import * as RoomStack_ from './roomStack.js'; // used in template
import * as UserList_ from './userList.js'; // used in template
import * as Utils from './utils.js';
-const FixedSizeFrame = GObject.registerClass({
+export const FixedSizeFrame = GObject.registerClass({
Properties: {
height: GObject.ParamSpec.int(
'height', 'height', 'height',
@@ -82,7 +77,7 @@ const FixedSizeFrame = GObject.registerClass({
}
});
-const MainWindow = GObject.registerClass({
+export const MainWindow = GObject.registerClass({
Template: 'resource:///org/gnome/Polari/ui/main-window.ui',
InternalChildren: [
'titlebarRight',
diff --git a/src/networksManager.js b/src/networksManager.js
index 7d54c125..6b5807fa 100644
--- a/src/networksManager.js
+++ b/src/networksManager.js
@@ -1,12 +1,10 @@
-export { NetworksManager };
-
import Gio from 'gi://Gio';
import GLib from 'gi://GLib';
const ByteArray = imports.byteArray;
const Signals = imports.signals;
-const NetworksManager = class {
+export const NetworksManager = class {
static getDefault() {
if (!this._singleton)
this._singleton = new NetworksManager();
diff --git a/src/pasteManager.js b/src/pasteManager.js
index 06b91ef8..ec2ce1b2 100644
--- a/src/pasteManager.js
+++ b/src/pasteManager.js
@@ -1,8 +1,3 @@
-export {
- PasteManager,
- DropTargetIface
-};
-
import Gdk from 'gi://Gdk';
import GdkPixbuf from 'gi://GdkPixbuf';
import Gio from 'gi://Gio';
@@ -38,7 +33,7 @@ function _getTargetForContentType(contentType) {
}
-const PasteManager = class {
+export const PasteManager = class {
pasteContent(content, title) {
if (typeof content === 'string')
return Utils.gpaste(content, title);
@@ -73,7 +68,7 @@ const PasteManager = class {
}
};
-const DropTargetIface = GObject.registerClass({
+export const DropTargetIface = GObject.registerClass({
Requires: [GObject.Object],
Properties: {
'can-drop': GObject.ParamSpec.boolean(
diff --git a/src/roomList.js b/src/roomList.js
index 685f65d0..8c3b2755 100644
--- a/src/roomList.js
+++ b/src/roomList.js
@@ -1,5 +1,3 @@
-export { RoomList };
-
import Gdk from 'gi://Gdk';
import Gio from 'gi://Gio';
import GLib from 'gi://GLib';
@@ -514,7 +512,7 @@ const RoomListHeader = GObject.registerClass({
}
});
-const RoomList = GObject.registerClass(
+export const RoomList = GObject.registerClass(
class RoomList extends Gtk.ListBox {
_init(params) {
super._init(params);
diff --git a/src/roomManager.js b/src/roomManager.js
index f07e959f..c4565d68 100644
--- a/src/roomManager.js
+++ b/src/roomManager.js
@@ -1,5 +1,3 @@
-export { RoomManager };
-
import Gio from 'gi://Gio';
import GLib from 'gi://GLib';
import Polari from 'gi://Polari';
@@ -9,7 +7,7 @@ const Signals = imports.signals;
import { AccountsMonitor } from './accountsMonitor.js';
-const RoomManager = class {
+export const RoomManager = class {
static getDefault() {
if (!this._singleton)
this._singleton = new RoomManager();
diff --git a/src/roomStack.js b/src/roomStack.js
index 0ec32092..08c83178 100644
--- a/src/roomStack.js
+++ b/src/roomStack.js
@@ -1,5 +1,3 @@
-export { RoomStack };
-
import Gio from 'gi://Gio';
import GLib from 'gi://GLib';
import GObject from 'gi://GObject';
@@ -12,7 +10,7 @@ import { EntryArea } from './entryArea.js';
import { MessageInfoBar } from './appNotifications.js';
import { RoomManager } from './roomManager.js';
-const RoomStack = GObject.registerClass({
+export const RoomStack = GObject.registerClass({
Properties: {
'entry-area-height': GObject.ParamSpec.uint(
'entry-area-height', 'entry-area-height', 'entry-area-height',
diff --git a/src/serverRoomManager.js b/src/serverRoomManager.js
index 698889a2..dcb6f57b 100644
--- a/src/serverRoomManager.js
+++ b/src/serverRoomManager.js
@@ -1,8 +1,3 @@
-export {
- ServerRoomManager,
- ServerRoomList
-};
-
import Gdk from 'gi://Gdk';
import Gio from 'gi://Gio';
import GLib from 'gi://GLib';
@@ -21,7 +16,7 @@ Gio._promisify(Tp.RoomList.prototype, 'init_async', 'init_finish');
const MS_PER_IDLE = 10; // max time spend in idle
const MS_PER_FILTER_IDLE = 5; // max time spend in idle while filtering
-const ServerRoomManager = class {
+export const ServerRoomManager = class {
static getDefault() {
if (!this._singleton)
this._singleton = new ServerRoomManager();
@@ -114,7 +109,7 @@ function _strBaseEqual(str1, str2) {
return str1.localeCompare(str2, {}, { sensitivity: 'base' }) === 0;
}
-const ServerRoomList = GObject.registerClass({
+export const ServerRoomList = GObject.registerClass({
Template: 'resource:///org/gnome/Polari/ui/server-room-list.ui',
InternalChildren: [
'filterEntry',
diff --git a/src/tabCompletion.js b/src/tabCompletion.js
index 6bb48518..b44608fb 100644
--- a/src/tabCompletion.js
+++ b/src/tabCompletion.js
@@ -1,12 +1,10 @@
-export { TabCompletion };
-
import Gdk from 'gi://Gdk';
import Gtk from 'gi://Gtk';
import Pango from 'gi://Pango';
import * as IrcParser from './ircParser.js';
-const TabCompletion = class {
+export const TabCompletion = class {
constructor(entry) {
this._entry = entry;
this._canComplete = false;
diff --git a/src/telepathyClient.js b/src/telepathyClient.js
index 3e2f00b9..9dd648ad 100644
--- a/src/telepathyClient.js
+++ b/src/telepathyClient.js
@@ -1,5 +1,3 @@
-export { TelepathyClient };
-
import Gio from 'gi://Gio';
import GLib from 'gi://GLib';
import GObject from 'gi://GObject';
@@ -125,7 +123,7 @@ class SASLAuthHandler {
}
}
-const TelepathyClient = GObject.registerClass(
+export const TelepathyClient = GObject.registerClass(
class TelepathyClient extends Tp.BaseClient {
_init(params) {
this._app = Gio.Application.get_default();
diff --git a/src/urlPreview.js b/src/urlPreview.js
index 4de26fe6..c1316888 100644
--- a/src/urlPreview.js
+++ b/src/urlPreview.js
@@ -1,5 +1,3 @@
-export { URLPreview };
-
import Gio from 'gi://Gio';
import GLib from 'gi://GLib';
import GObject from 'gi://GObject';
@@ -100,7 +98,7 @@ class Thumbnailer {
}
}
-const URLPreview = GObject.registerClass({
+export const URLPreview = GObject.registerClass({
Properties: {
'uri': GObject.ParamSpec.string(
'uri', 'uri', 'uri',
diff --git a/src/userList.js b/src/userList.js
index 698a1bd8..56dab649 100644
--- a/src/userList.js
+++ b/src/userList.js
@@ -1,10 +1,3 @@
-export {
- UserList,
- UserListPopover,
- UserDetails,
- UserPopover
-};
-
import Gio from 'gi://Gio';
import GLib from 'gi://GLib';
import GObject from 'gi://GObject';
@@ -18,7 +11,7 @@ import * as Utils from './utils.js';
const FILTER_ENTRY_THRESHOLD = 8;
const MAX_USERS_WIDTH_CHARS = 17;
-const UserListPopover = GObject.registerClass(
+export const UserListPopover = GObject.registerClass(
class UserListPopover extends Gtk.Popover {
_init(params) {
super._init(params);
@@ -121,7 +114,7 @@ class UserListPopover extends Gtk.Popover {
}
});
-const UserDetails = GObject.registerClass({
+export const UserDetails = GObject.registerClass({
Template: 'resource:///org/gnome/Polari/ui/user-details.ui',
InternalChildren: [
'spinnerBox',
@@ -322,7 +315,7 @@ const UserDetails = GObject.registerClass({
}
});
-const UserPopover = GObject.registerClass({
+export const UserPopover = GObject.registerClass({
Template: 'resource:///org/gnome/Polari/ui/user-popover.ui',
InternalChildren: [
'nickLabel',
diff --git a/src/userTracker.js b/src/userTracker.js
index d8a9ea00..478f4982 100644
--- a/src/userTracker.js
+++ b/src/userTracker.js
@@ -1,5 +1,3 @@
-export { UserStatusMonitor };
-
import Gio from 'gi://Gio';
import GLib from 'gi://GLib';
import GObject from 'gi://GObject';
@@ -10,7 +8,7 @@ import { AccountsMonitor } from './accountsMonitor.js';
import { RoomManager } from './roomManager.js';
import * as Utils from './utils.js';
-const UserStatusMonitor = class {
+export const UserStatusMonitor = class {
static getDefault() {
if (!this._singleton)
this._singleton = new UserStatusMonitor();
diff --git a/src/utils.js b/src/utils.js
index 1b96384f..2706ba70 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -20,26 +20,6 @@
*
*/
-export {
- isFlatpakSandbox,
- touchFile,
- needsOnetimeAction,
- getTpEventTime,
- findUrls,
- findChannels,
- openURL,
- updateTerms,
- gpaste,
- imgurPaste,
- storeAccountPassword,
- storeIdentifyPassword,
- lookupAccountPassword,
- lookupIdentifyPassword,
- clearAccountPassword,
- clearIdentifyPassword,
- formatTimePassed
-};
-
import Gio from 'gi://Gio';
import GLib from 'gi://GLib';
import Gtk from 'gi://Gtk';
@@ -112,13 +92,13 @@ let _gpasteExpire;
let _inFlatpakSandbox;
-function isFlatpakSandbox() {
+export function isFlatpakSandbox() {
if (_inFlatpakSandbox === undefined)
_inFlatpakSandbox = GLib.file_test('/.flatpak-info', GLib.FileTest.EXISTS);
return _inFlatpakSandbox;
}
-function touchFile(file) {
+export function touchFile(file) {
try {
file.get_parent().make_directory_with_parents(null);
} catch (e) {
@@ -131,7 +111,7 @@ function touchFile(file) {
stream.close(null);
}
-function needsOnetimeAction(name) {
+export function needsOnetimeAction(name) {
let path = GLib.build_filenamev([
GLib.get_user_data_dir(),
'polari',
@@ -148,19 +128,19 @@ function needsOnetimeAction(name) {
return true;
}
-function getTpEventTime() {
+export function getTpEventTime() {
let time = Gtk.get_current_event_time();
if (time === 0)
return GLib.MAXUINT32;
return Tp.user_action_time_from_x11(time);
}
-function storeAccountPassword(account, password) {
+export function storeAccountPassword(account, password) {
let label = _('Polari server password for %s').format(account.display_name);
_storePassword(SECRET_SCHEMA_ACCOUNT, label, account, password);
}
-function storeIdentifyPassword(account, password) {
+export function storeIdentifyPassword(account, password) {
let label = _('Polari NickServ password for %s').format(account.display_name);
_storePassword(SECRET_SCHEMA_IDENTIFY, label, account, password);
}
@@ -177,11 +157,11 @@ async function _storePassword(schema, label, account, password) {
}
}
-function lookupAccountPassword(account) {
+export function lookupAccountPassword(account) {
return _lookupPassword(SECRET_SCHEMA_ACCOUNT, account);
}
-function lookupIdentifyPassword(account) {
+export function lookupIdentifyPassword(account) {
return _lookupPassword(SECRET_SCHEMA_IDENTIFY, account);
}
@@ -199,11 +179,11 @@ async function _lookupPassword(schema, account) {
return password;
}
-function clearAccountPassword(account) {
+export function clearAccountPassword(account) {
_clearPassword(SECRET_SCHEMA_ACCOUNT, account);
}
-function clearIdentifyPassword(account) {
+export function clearIdentifyPassword(account) {
_clearPassword(SECRET_SCHEMA_IDENTIFY, account);
}
@@ -226,7 +206,7 @@ async function _clearPassword(schema, account) {
// the position within @str where the URL was found.
//
// Return value: the list of match objects, as described above
-function findUrls(str) {
+export function findUrls(str) {
let res = [], match;
while ((match = _urlRegexp.exec(str))) {
let name = match[2];
@@ -236,7 +216,7 @@ function findUrls(str) {
return res;
}
-function findChannels(str, server) {
+export function findChannels(str, server) {
let res = [], match;
while ((match = _channelRegexp.exec(str))) {
res.push({
@@ -248,7 +228,7 @@ function findChannels(str, server) {
return res;
}
-function openURL(url, timestamp) {
+export function openURL(url, timestamp) {
let app = Gio.Application.get_default();
try {
Gtk.show_uri_on_window(app.active_window, url, timestamp);
@@ -259,7 +239,7 @@ function openURL(url, timestamp) {
}
}
-function updateTerms(terms, str) {
+export function updateTerms(terms, str) {
let normalized = str.trim().toLowerCase().replace(/\s+/g, ' ');
let newTerms = normalized ? normalized.split(' ') : [];
@@ -303,7 +283,7 @@ async function _getGpasteExpire() {
}, 0).toString();
}
-async function gpaste(text, title) {
+export async function gpaste(text, title) {
if (_gpasteExpire === undefined)
_gpasteExpire = await _getGpasteExpire();
@@ -329,7 +309,7 @@ async function gpaste(text, title) {
return `${GPASTE_BASEURL}${info.result.id}`;
}
-async function imgurPaste(pixbuf, title) {
+export async function imgurPaste(pixbuf, title) {
let [success, buffer] = pixbuf.save_to_bufferv('png', [], []);
if (!success)
throw new Error('Failed to create image buffer');
@@ -355,7 +335,7 @@ async function imgurPaste(pixbuf, title) {
return info.data.link;
}
-function formatTimePassed(seconds) {
+export function formatTimePassed(seconds) {
if (seconds === 0)
return _('Now');
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]