2016-06-08 14:31:15
2016-05-26 14:56:49
2016-05-26 14:55:45
5546
Frio theme
@UX Watchdogs@Friendica Theme Developer@Friendica Support@Friendica Developers
In the last week there was some discussion about my experimental frio theme.
I decided to summerize some of my thoughts (some have been already highlighted in a german talk) about this theme and friendica. Also with regard to possible committers.
Some perspectives/direction I have thought about in case of the frio theme (which also would affect friendica core).
1.) The private messages page
The list of all messages could be displayed at the left aside. Similar like it's done now when the user has opened a message (in the present state a message-preview is in left aside). But it should be extended as full message list navigation. A list which is scrollable with the last 20-50 messages/conversations and when a user scrolls down to the end of the list next 20-50 messages will appended through ajax. This would need a endpoint where we can get message json data. Additionally there should a filter field in the left aside which filters the messages by recipient or topic. For this the new js textcomplete function can be used (like I did it to make contact filtering possible at the contact page)
Should the aside message list be extended as full message list navigation it's maybe worth to think about to have a own page template for messages which would give the aside area a little bit more width and does make the main area a little bit smaller.
2.) The photo page
I have thought (but don't have any experience if it's realizable) about to have a facebook like photo page. This would mean that if a user opens a photo some kind of overlay would open with the photo at the left side and the comments in a row at the right side. The right comments row could have a tab where the user can switch (if he/she should have the permissions) between comments and editing the photo.
3.) json endpoints
We had some questions from a motivated theme developer 2 months ago. He wanted to do a theme and wanted to overwrite friendica core functions to get json data.
While I was working at the frio theme I realized that is very helpful to have data as json because you can load them through ajax and don't need to reload the page. This does make the use of friendica very fluently and enjoyable. In frio I extended the acl endpoint (to make contact filtering possible with textcomplete) and the frio_hovercard addon gives another endpoint for contact data which is needed for the hovercard (+ it's can provide the tpl data for jSmart - but to this I come later). If the message-list aside full navigation idea (point 1 above) would be realized another endpoint for json message list data would be needed). This would mean another addon. But it is no real good solution to extend the theme with 100 addons. Instead we should think about how could friendica provide important data next to html also in json. (An interesting/helpful thing would be to request pconfig data in json)
4.) jSmart
The quantity of html inside php and javascript files should be limited as much as possible. For this we have templates and Smarty/jSmart. In some cases we need the same templates for php as for js. Luckily I found jSmart. With jSmart the smarty templates can be used for js. But since js can't get access to server files the template needs to be accessible somehow. For the frio hovercard the template is provided through an endpoint which outputs the raw content of a template file.
In this case it would be a benefit to have an general endpoint to provide the raw content of the requested templates (for the frio contact page the contact template containing in the present state the content for the php and the content for jSmart - to have this twice seems to be no good solution to me).
5.) Content type of an item
We have different content types in the network stream. E.g. normal posts, comments, pokes, likes, shares, photos, events and so on. Every content type contains different data. In Friendica should provide the content type to the theme (with it's different data) to the theme so that in dependence of the content type the posts can be styled. To explain this the event is very suitable. Does a event have to look like a normal post, while it isn't really a normal post. So the theme needs to know that it isn't a normal post, so we can use an event template. An event containing a subject, a summery, a location, a starting and a ending time. At the present time all this data isn't accessible for the theme developer. It's all content body and so it's only possible to take it as it is
6.) Remote Nav
Since I started to uses friendica I often had the feeling (when leaving my node) rather of jumping between webpages than to have a social network feeling. To limit this impression I inserted some code so that nodes of friendica contacts will be opened in the the same tab and not in a new one. In addition the top nav will be nearly the same like the user had before in his/her local account (for this the remote user needs to have enabled also the frio theme). At the remote page will be a nav bar which includes also a symbol for e.g. the network stream, the private mail, the contact page and nearly the whole user menu. This links will link back to the local pages of the users. E.g. if the user presses at the contact symbol he/she will get to his/her own contact page. This should strengthen the feeling of a real network. Some menu point could not included because the remote server doesn't now the user settings of the remote user (for this access for pconfig data via json could be helpful - have a look some points above). Some links e.g. the search, apps, help & documentation linking to the remote node. E.g. if I'm on a remote node I want to search something at this node and not at my own.
This may a little bit confusing for the user but I think we should working on making this better visible than to remove this. This part needs some more input.
7.)
Have in mind that I had to extend the filebrowser.js to make it work with frio.
In the last week there was some discussion about my experimental frio theme.
I decided to summerize some of my thoughts (some have been already highlighted in a german talk) about this theme and friendica. Also with regard to possible committers.
Some perspectives/direction I have thought about in case of the frio theme (which also would affect friendica core).
1.) The private messages page
The list of all messages could be displayed at the left aside. Similar like it's done now when the user has opened a message (in the present state a message-preview is in left aside). But it should be extended as full message list navigation. A list which is scrollable with the last 20-50 messages/conversations and when a user scrolls down to the end of the list next 20-50 messages will appended through ajax. This would need a endpoint where we can get message json data. Additionally there should a filter field in the left aside which filters the messages by recipient or topic. For this the new js textcomplete function can be used (like I did it to make contact filtering possible at the contact page)
Should the aside message list be extended as full message list navigation it's maybe worth to think about to have a own page template for messages which would give the aside area a little bit more width and does make the main area a little bit smaller.
2.) The photo page
I have thought (but don't have any experience if it's realizable) about to have a facebook like photo page. This would mean that if a user opens a photo some kind of overlay would open with the photo at the left side and the comments in a row at the right side. The right comments row could have a tab where the user can switch (if he/she should have the permissions) between comments and editing the photo.
3.) json endpoints
We had some questions from a motivated theme developer 2 months ago. He wanted to do a theme and wanted to overwrite friendica core functions to get json data.
While I was working at the frio theme I realized that is very helpful to have data as json because you can load them through ajax and don't need to reload the page. This does make the use of friendica very fluently and enjoyable. In frio I extended the acl endpoint (to make contact filtering possible with textcomplete) and the frio_hovercard addon gives another endpoint for contact data which is needed for the hovercard (+ it's can provide the tpl data for jSmart - but to this I come later). If the message-list aside full navigation idea (point 1 above) would be realized another endpoint for json message list data would be needed). This would mean another addon. But it is no real good solution to extend the theme with 100 addons. Instead we should think about how could friendica provide important data next to html also in json. (An interesting/helpful thing would be to request pconfig data in json)
4.) jSmart
The quantity of html inside php and javascript files should be limited as much as possible. For this we have templates and Smarty/jSmart. In some cases we need the same templates for php as for js. Luckily I found jSmart. With jSmart the smarty templates can be used for js. But since js can't get access to server files the template needs to be accessible somehow. For the frio hovercard the template is provided through an endpoint which outputs the raw content of a template file.
In this case it would be a benefit to have an general endpoint to provide the raw content of the requested templates (for the frio contact page the contact template containing in the present state the content for the php and the content for jSmart - to have this twice seems to be no good solution to me).
5.) Content type of an item
We have different content types in the network stream. E.g. normal posts, comments, pokes, likes, shares, photos, events and so on. Every content type contains different data. In Friendica should provide the content type to the theme (with it's different data) to the theme so that in dependence of the content type the posts can be styled. To explain this the event is very suitable. Does a event have to look like a normal post, while it isn't really a normal post. So the theme needs to know that it isn't a normal post, so we can use an event template. An event containing a subject, a summery, a location, a starting and a ending time. At the present time all this data isn't accessible for the theme developer. It's all content body and so it's only possible to take it as it is
6.) Remote Nav
Since I started to uses friendica I often had the feeling (when leaving my node) rather of jumping between webpages than to have a social network feeling. To limit this impression I inserted some code so that nodes of friendica contacts will be opened in the the same tab and not in a new one. In addition the top nav will be nearly the same like the user had before in his/her local account (for this the remote user needs to have enabled also the frio theme). At the remote page will be a nav bar which includes also a symbol for e.g. the network stream, the private mail, the contact page and nearly the whole user menu. This links will link back to the local pages of the users. E.g. if the user presses at the contact symbol he/she will get to his/her own contact page. This should strengthen the feeling of a real network. Some menu point could not included because the remote server doesn't now the user settings of the remote user (for this access for pconfig data via json could be helpful - have a look some points above). Some links e.g. the search, apps, help & documentation linking to the remote node. E.g. if I'm on a remote node I want to search something at this node and not at my own.
This may a little bit confusing for the user but I think we should working on making this better visible than to remove this. This part needs some more input.
7.)
Have in mind that I had to extend the filebrowser.js to make it work with frio.
7 Personen mögen das
Steffen K9 🐰, https://toktan.org/profile/oha, Fabio, https://f.diekershoff.de/profile/tobias, https://snarl.de/profile/z428, Rebeka Catalina und Montag mögen das.
https://toktan.org/profile/oha
Michael Vogel
https://snarl.de/profile/z428
Rabuzarus
It is in some kind already mobile ready. You don't need a special mobile theme.
https://snarl.de/profile/z428
Michael Vogel
Michael Vogel
Rabuzarus
input is the nurl. If the contact is authenticated then we have to convert the redir address in to the nurl first.
You can have a short look at frio_hovercard.php. It's not very big well documented. From my understanding noscrape.php works differently
Rabuzarus
If an other user e.g. has vier as his/her theme you will get the standard vier topnav if you visit his/her profile page. The remote stuff is here https://github.com/friendica/friendica/blob/develop/view/theme/frio/theme.php#L177
Michael Vogel
Rabuzarus
This should be optional. And I'm not sure if it's a really good idea. Think about a very special blog theme which user b has installed. If user a is visiting user b profile page it could be that the theme of user a don't show the data as it should displayed.
There are 3 possibilities which come to my mind.
a cookie would contain this data
the url would contain this data (but this would very limited)
a callback to the users node which gets this data with json/xml
https://f.diekershoff.de/profile/tobias
Michael Vogel
https://f.diekershoff.de/profile/tobias