Feature Suggestions

by RubenK, Friday, March 15, 2013, 08:35 (3996 days ago)

I've got some suggestions which would make Selfoss even better.

  • Mark as read on clicking/opening item (already mentioned in another topic)
  • Ability to set an option that images will automatically load on opening a message in mobile view
  • Showing the unread message count behind each tag
  • Being abled to run the web app full screen via the web-app-capable meta (will run some tests on this later today)

I'll be trying to 'hack' these options in by myself in the coming days, but in the end - native support would be better ;-)


So far - great web app! Runs great on my little Raspberry Pi here :-)

iOS Fullscreen Webapp Capability

by RubenK, Friday, March 15, 2013, 10:26 (3996 days ago) @ RubenK

Alright - first step in 'hacking' iOS fullscreen capability into Selfoss are underway ;-) It's still very experimental work, since opening a entry_source-link will open that link inside the webapp, which will in essence disables control of the app. So read-entries-only at this point.

---

Added the following line at the bottom of /selfoss/config.ini

  • fullscreen_webapp=1

If set to 1, the webapp will be capable of running in standalone fullscreen, if set to 0 the app will run in Safari

---

Added the following line to /selfoss/helpers/View.php on line 35, before $lastSlash = strrpos($_SERVER['SCRIPT_NAME'], '/');

  • $this->fullscreenwebapp = \F3::get('fullscreen_webapp');

---

Added the following lines to /selfoss/templates/home.phtml before the </head>-tag

  • <?PHP if($this->fullscreenwebapp=='1'){ ?><!-- MOD iOS webapp -->
  • <meta name="apple-mobile-web-app-capable" content="yes">
  • <link rel="apple-touch-startup-image" href="public/images/ios-splash-320x460.png" media="screen and (max-device-width: 320px)">
  • <link rel="apple-touch-startup-image" href="public/images/ios-splash-640x920.png" media="(max-device-width: 480px) and (-webkit-min-device-pixel-ratio: 2)">
  • <? } ?>

The two images I used for the splash-screen can be found here: 320x640 and 640x920

iOS Fullscreen Webapp Capability

by nosbig, Friday, March 15, 2013, 13:27 (3996 days ago) @ RubenK

Have you thought about posting your code changes on the Github repo? These seem like some simple but effective changes to the code.

iOS Fullscreen Webapp Capability

by RubenK, Friday, March 15, 2013, 13:36 (3996 days ago) @ nosbig
edited by RubenK, Friday, March 15, 2013, 13:41

Didn't think of Github .. :-D ... thanks for the headsup. Now all that's left is figuring out how Github works ;-)

Mark as Read on Click/Expand

by RubenK, Friday, March 15, 2013, 11:27 (3996 days ago) @ RubenK

Another 'hacky' solution - but it works like a charm.


- STEP 1 ----

Added the following line to /selfoss/config.ini. Setting it to 1 will mark items as read on opening/expanding. Setting to 0 will retain the original functionality.

  • markasread_openentry=1


- STEP 2 ----

Added the following line to /selfoss/helpers/View.php on line 35, right before $lastSlash = strrpos($_SERVER['SCRIPT_NAME'], '/');. Exactely the same spot as with the fullscreen-hack.

  • $this->markasreadopenentry = \F3::get('markasread_openentry');


- STEP 3 ----

Changed the following code in /selfoss/template/home.phtml - replace the following code

  • <body class="<?PHP if($this->publicMode===true) : ?>publicmode<?PHP endif; ?> <?PHP echo $this->loggedin ? "loggedin" : "notloggedin"; ?> <?PHP if(\F3::get('initial_open')==1) : ?>initial_open<?PHP endif; ?>">

with this code

  • <body class="<?PHP if($this->publicMode===true) : ?>publicmode<?PHP endif; ?> <?PHP echo $this->loggedin ? "loggedin" : "notloggedin"; ?> <?PHP if(\F3::get('initial_open')==1) : ?>initial_open<?PHP endif; ?>" <?PHP if ($this->markasreadopenentry=='1'){ echo 'data-markasreadonopenentry="1"'; } ?>>


- STEP 4 ----

Added the following code to /selfoss/public/js/selfoss-events.js on line 317, right before if(selfoss.isSmartphone()==false) {.

  • /* MOD --- mark as read hack */
    var markOnOpen = $('body').attr('data-markasreadonopenentry');
    var entryID = parent.attr('id');
    if (markOnOpen == '1') { markAsRead(entryID); }


- STEP 5 ----

Added the following code to /selfoss/public/js/selfoss-events.js on line 391, right before // no source click. (after adding the previous code, otherwise the line-numbers won't match).

  • /* MOD --- mark as read hack */
    function markAsRead(entryid) {
    var ids = new Array();
    ids.push( entryid.substr(5) );

    $.ajax({
    url: $('base').attr('href') + 'mark',
    type: 'POST',
    data: {
    ids: ids
    },
    success: function() {
    $('#'+entryid).removeClass('unread');

    var unreadstats = parseInt($('.nav-filter-unread span').html());
    $('.nav-filter-unread span').html( (unreadstats - ids.length) );

    if(selfoss.isSmartphone())
    $('#nav-mobile-settings').click();
    },
    error: function(jqXHR, textStatus, errorThrown) {
    alert('Can not mark visible item: ' + errorThrown);
    }
    });
    }


    - STEP 6 ----

    Delete the following file: /selfoss/public/all.js - this will be regenerated the next time you visit your selfoss webapp (might take a while on slower servers)

Mark as Read on Click/Expand

by baz4096, Friday, March 15, 2013, 13:27 (3996 days ago) @ RubenK

Hi

I think you missed this around Step 2:

public $markasreadopenentry = 0;

Around line 20 in helpers/View.php


Thanks by the way, I've implemented this and will see how I get on with it :)

Baz

Mark as Read on Click/Expand

by RubenK, Friday, March 15, 2013, 13:38 (3996 days ago) @ baz4096

Was that necessary? Probably you're quite right, but it still works without that ;-) ... I'm moving code-suggestions to Github from now on!

Mark as Read on Click/Expand

by baz4096, Friday, March 15, 2013, 13:55 (3996 days ago) @ RubenK

Actually it didn't work for me, I got:

Internal Server Error

Undefined property: helpers\View::$markasreadopenentry


Ubuntu 12.04 LTS with PHP 5.3.10 with Suhosin-Patch / Apache FastCGI

Baz

Mark as Read on Click/Expand

by RubenK, Friday, March 15, 2013, 14:01 (3996 days ago) @ baz4096

Interesting - worked for me. But thanks for the addition. I'll add that to the code!

Raspberry Pi running Rasbian (debian) with Apache 2.2.22 with PHP 5.4.4-14

Mark as Read on Click/Expand

by sanchomuzax ⌂, Budapest, Wednesday, April 10, 2013, 22:08 (3970 days ago) @ RubenK
edited by sanchomuzax, Wednesday, April 10, 2013, 22:20

Internal Server Error
Fatal error: Maximum execution time of 30 seconds exceeded

I use Lighttpd.

I restored the all.js, then after no has error messages. But the auto read doesn't working. I tried it with empty all.js, but no changes.

--
Sancho

RSS Feed of thread
powered by my little forum