├── README.md ├── index.html ├── matrix-blog.js ├── LICENSE └── lib └── browser-matrix-0.5.2.min.js /README.md: -------------------------------------------------------------------------------- 1 | # Matrix Blog 2 | A js-script for matrix js api that will make a simple blog view of a matrix room. 3 | It logs into the room as a guest so the room needs to be publicly viewable. 4 | 5 | ## Prerequisites 6 | * Join/create the room you want to show in the blog with this user. 7 | * Set it publicly viewable. "Who can read history?" -> Anyone 8 | * Update index.html with the info. 9 | 10 | ## Setup 11 | ``` 12 | var blog = new MatrixBlog({ 13 | selector: '#chat', 14 | room: '#blog:my.host.com', 15 | homeServer: 'https://my.host.com:8448' 16 | }); 17 | ``` 18 | 19 | ## Matrix 20 | An [open standard](http://matrix.org/docs/spec/) open standard for decentralised persistent communication. 21 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Matrix blog v.2 4 | 5 | 6 | 7 | 8 | 9 | 77 | 78 | 79 |
Loading...
80 | Matrix Blog - a test app by @simeng:matrix.org for using Matrix as a Blog-like system. 81 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /matrix-blog.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var MatrixBlog = function(settings) { 4 | var self = this; 5 | 6 | this.last = null; 7 | this.settings = settings; 8 | this.settings.locale = this.settings.locale || 'nb-NO'; 9 | this.settings.groupPostDuration = this.settings.groupPostDuration || 600; 10 | this.client = matrixcs.createClient({ 11 | baseUrl: settings.homeServer 12 | }); 13 | 14 | this.roomId = null; 15 | this.endKey = null; 16 | this.$posts = $('