HalosGhost / pbpst

A command-line libcurl C client for pb deployments
GNU General Public License v2.0
44 stars 9 forks source link

Web Gallery #21

Closed meskarune closed 9 years ago

meskarune commented 9 years ago

Prerequisites:

Have an html/css/js web front end that has a gallery of pastes pulled from the json db.

Ideally, this will include the following:

HalosGhost commented 9 years ago

Once the local db is implemented, work on the page can begin. There is, however, one hurdle we will need to overcome: the local database is not guaranteed to be in any specific location.

So, the page will either have to have an input box where the user specifies the db location (with a sane default, perhaps), or it'll need some way of locating it. I greatly prefer the former of those two options. Thoughts?

kyrias commented 9 years ago

Would make more sense to just require the DB to be in the same directory as the front end thing.

HalosGhost commented 9 years ago

That guarantee cannot be made. We could do it the other way around and create the webpage wherever the database is, but since one of the planned features is to allow the user to specify a location to use at-runtime, we would have to be willing/able to create the webpage every time a new database location is specified.

While I like the idea of shipping this web gallery, I do not like the idea of duplicating it for each database.

kyrias commented 9 years ago

Why can't it? The user would just have to copy the embedded web gallery page and the DB to wherever they want to serve it?

HalosGhost commented 9 years ago

First, the notion of this is not to be served. Just to have a simple, fancy way of auditing your own pastes. Second, I'd like to have a solution that JustWorks™, and does so consistently (even if that consistency is that the user has to specify the db location).

The plan is to eventually offer a simple cli option for pbpst that would just launch $BROWSER with the location of the webgallery htm as an argument. if the web gallery does not have a static location, that cli option is much more difficult to implement.

kyrias commented 9 years ago

First, the notion of this is not to be served. Just to have a simple, fancy way of auditing your own pastes. Second, I'd like to have a solution that JustWorks™, and does so consistently (even if that consistency is that the user has to specify the db location).

There's not really any difference.

The plan is to eventually offer a simple cli option for pbpst that would just launch $BROWSER with the location of the webgallery htm as an argument. if the web gallery does not have a static location, that cli option is much more difficult to implement.

So then just have a query string for the DB path.

HalosGhost commented 9 years ago

Can that be done with pure JS/HTML?

kyrias commented 9 years ago

Yes.

HalosGhost commented 9 years ago

Great! in that case, then we can just pass the db locaiton to the page on the cli with no issues. @meskarune, does that sound okay?

HalosGhost commented 9 years ago

At the moment, it seems like this might not be doable with (good) restrictions that browsers place on JS. If, at any time, it seems that this can be implement simply and statically, I will be happy to reopen and revisit.