From a14c0f42afef5fe14126bc9b3a2bde8ede4d65cd Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Mon, 5 Nov 2018 22:39:49 -0700 Subject: [PATCH] Onelinerz standardization work and docs --- core/onelinerz.js | 6 +++++- docs/_includes/nav.md | 1 + docs/modding/onelinerz.md | 18 ++++++++++++++++++ docs/modding/user-list.md | 3 --- 4 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 docs/modding/onelinerz.md diff --git a/core/onelinerz.js b/core/onelinerz.js index 19b9ce44..d840f731 100644 --- a/core/onelinerz.js +++ b/core/onelinerz.js @@ -153,10 +153,14 @@ exports.getModule = class OnelinerzModule extends MenuModule { ); }, function populateEntries(entriesView, entries, callback) { - const tsFormat = self.menuConfig.config.timestampFormat || self.client.currentTheme.helpers.getDateFormat('short'); + const tsFormat = + self.menuConfig.config.dateTimeFormat || + self.menuConfig.config.timestampFormat || // deprecated + self.client.currentTheme.helpers.getDateFormat('short'); entriesView.setItems(entries.map( e => { return { + text : e.oneliner, // standard userId : e.user_id, userName : e.user_name, oneliner : e.oneliner, diff --git a/docs/_includes/nav.md b/docs/_includes/nav.md index 15641234..c8cb67c9 100644 --- a/docs/_includes/nav.md +++ b/docs/_includes/nav.md @@ -72,6 +72,7 @@ - [BBS List]({{ site.baseurl }}{% link modding/bbs-list.md %}) - [Rumorz]({{ site.baseurl }}{% link modding/rumorz.md %}) - [File Transfer Protocol Select]({{ site.baseurl }}{% link modding/file-transfer-protocol-select.md %}) + - [Onelinerz]({{ site.baseurl }}{% link modding/onelinerz.md %}) - Administration - [oputil]({{ site.baseurl }}{% link admin/oputil.md %}) diff --git a/docs/modding/onelinerz.md b/docs/modding/onelinerz.md new file mode 100644 index 00000000..92515617 --- /dev/null +++ b/docs/modding/onelinerz.md @@ -0,0 +1,18 @@ +--- +layout: page +title: Onelinerz +--- +## The Onelinerz Module +The built in `onelinerz` module provides a retro onelinerz system. + +## Configuration +### Config Block +Available `config` block entries: +* `dateTimeFormat`: [moment.js](https://momentjs.com) style format. Defaults to current theme → system `short` date format. + +### Theming +The following `itemFormat` object is provided to MCI 1 (ie: `%VM1`): +* `userId`: User ID of the onliner entry. +* `userName`: Login username of the onliner entry. +* `oneliner`: The oneliner text. Note that the standard `{text}` field also contains this value. +* `ts`: Timestamp of the entry formatted with `dateTimeFormat` format described above. diff --git a/docs/modding/user-list.md b/docs/modding/user-list.md index 9aae4750..37eb2e97 100644 --- a/docs/modding/user-list.md +++ b/docs/modding/user-list.md @@ -19,6 +19,3 @@ The following `itemFormat` object is provided to MCI 1 (ie: `%VM1`): * `lastLoginTs`: Last login timestamp formatted with `dateTimeFormat` style. * `location`: User's location. * `affiliation` or `affils`: Users affiliations. - - -