Extension:Teahouse/Development: Difference between revisions
Appearance
Content deleted Content added
No edit summary |
|||
| Line 39: | Line 39: | ||
** Info: Is user anon? --> display "IP will be saved"-Hint |
** Info: Is user anon? --> display "IP will be saved"-Hint |
||
** "The Board": callback for save process OR <code>OO.EventEmitter</code> capabilities of <code>OO.ui.ProcessDialog</code>? |
** "The Board": callback for save process OR <code>OO.EventEmitter</code> capabilities of <code>OO.ui.ProcessDialog</code>? |
||
==Issues== |
|||
* Dialog window is created at the foot of the page. On long pages this is bad. |
|||
* API edit returns "DB error" when appending signature (<nowiki>--~~~~</nowiki>) to question text |
|||
Revision as of 12:19, 17 October 2014
This page serves as a public notebook for any kind of information (concepts, ideas, discussions,...) related to the further development.
Resourceloader Module dependencies
- at init time
mediawiki.cookie,mediawiki.user(formw.user.isAnon())
- for the dialog
oojs-ui
- for API calls of dialog
mediawiki.Title
Persistence Layer aka "The Board"
OOJS Class "Board":
publishQuestion( { title: "Why is ...", text: "I have ..." } )- API Call to create subpage of
config.basePage, e.g. "Wikipedia:Teahouse/Board" - API Call to append/prepend config.basePage with
config.template.wrapper - API Call to add subpage to watchlist (if registered user) or add title and publish timestamp to cookie (anon user)
- returns jQuery Promise --> Dialog can loadmask itself, user can be notified on success/error
- API Call to create subpage of
getPublishedQuestionsOfCurrentUser()(Bad function name! Find better!) - This is for the planned notification interface- Read-in cookie with list of questions / or find contributions of logged in user
- API Call for each question (or as bulk) to determine current state (pending|answered)
- returns array of questions (title, href) and their respective state
getSimilarQuestions- This is for the planned "similar questions" feature- API Call to search (fulltext)
- Filtering by
config.basePage-prefix - returns array of hits
Notifications
- Stores a list of titles and timestamps
- Checks the list entries timestamp against the current edit timestamp of the title (API Calls)
- Notifies user if newer change
- Resets the timestamp on visit
register( title, timestamp )getNotificationList()markAsRead( title )
Dialog
- Subclass of
OO.ui.ProcessDialog - Injection of
dataobject inwindowManager.openWindow- Info: Is user anon? --> display "IP will be saved"-Hint
- "The Board": callback for save process OR
OO.EventEmittercapabilities ofOO.ui.ProcessDialog?
Issues
- Dialog window is created at the foot of the page. On long pages this is bad.
- API edit returns "DB error" when appending signature (--~~~~) to question text