Google Blogoscoped

Forum

Re: A Local + Server Text Editor Using Chrome  (View post)

David Mulder [PersonRank 10]

Monday, October 19, 2009
14 years ago4,681 views

After trying for about an hour I give up on getting it correctly to work :/ For now I will assume it has to do with an old version of xampp or that mac is slightly handling something differently, rather then a bug. Oh, and to use the clipboard you would need to use flash like http://bravo9.com/journal/copying-text-into-the-clipboard-with-javascript-in-firefox-safari-ie-opera-292559a2-cc6c-4ebf-9724-d23e8bc5ad8a/ or in firefox you can also somehow add a site to an array with allowed sites, but wasn't able to find a site explaining it.

Philipp Lenssen [PersonRank 10]

14 years ago #

David what kind of problems do you run into?
Does the PHP5 run? If so, what type of JavaScript errors are there in e.g. Firefox? What part doesn't work? Perhaps I can help.

Ethan Van den Berg [PersonRank 0]

14 years ago #

Cool. I think you may be duplicating.

https://bespin.mozilla.com/

Philipp Lenssen [PersonRank 10]

14 years ago #

Thanks Ethan, I will download that one to have a look (a crucial feature of Netpadd B is editing local files, so just their online version won't suffice for my purpose). Maybe it inspires some features or maybe I can learn some approaches from their project, though I also plan to keep Netpadd B rather simple in functionality and maintenance, and plain looking.

David Mulder [PersonRank 10]

14 years ago #

Got it finally working:
   – A, the .php5 extension should in generally not be used, except if you are running php4 and php5 along side eachother. (And in this case it gave me quite some trouble, at the end of this comment I added the .htaccess file you need to add to the root in case your server isn't configured to run .php5 files, while having php5 installed as default (which is by my knowledge how e.g. xampp does it))
   – B, All $basepath . $filename should be replaced with $basepath . "/" . $filename in api/api.php(5) (PS. Philipp, how did you ever get it working while having that bug...)
   – C, You will have to give the script root access probably, but I still have to figure out how... or degrade the premission of all other files (a no go in most cases). Hopefully I will be able to create an interface where it asks for a password of an account with sufficient priviliges, but that will take some time (if I ever get it to work). (I seriously love these premissions, without them it would scare me out of my mind if a single bug in any of my projects would mean all my files could be accessed)

The .htaccess file:
AddHandler application/x-httpd-php .php5 .php4 .php .php3 .php2 .phtml
AddType application/x-httpd-php .php5 .php4 .php .php3 .php2 .phtml
DirectoryIndex index.php5

Philipp Lenssen [PersonRank 10]

14 years ago #

> A, the .php5 extension should in generally not be used,
> except if you are running php4 and php5 along side eachother.

I realized just today, talking to someone else who tried installing this, that this could cause problems with default WAMP installations! I originally did this because my 1&1 server once required this (to differentiate between PHP5 and PHP[4]), but I will check if this is still needed, and if not, amend the file extensions (and if needed, include your htaccess suggestion in the tools folder or so).

[Update: Hrm, 1&1 still defaults to PHP4 for the php extension. I will include a variant of your suggested htacces in the tools folder, or perhaps at a later point in the root folder though it might be suboptimal there as it could risk overwriting an existing security relevant htaccess file during upload...]

> B, All $basepath . $filename should be replaced with $basepath . "/" . $filename in api/api.php(5)

Thanks, will check that, it works here so that's probably why I didn't notice anything (or maybe it's only wrong in certain system contexts, well, I will check).

Philipp Lenssen [PersonRank 10]

14 years ago #

PS: Included you in the credits at http://www.netpadd.com/b now, thanks!

David Mulder [PersonRank 10]

14 years ago #

Have been trying to get the bespin embedded version (see my last post in the previous thread) working for a few hours, instead of a (dull) textarea. Got to the point where saving and opening was working, but next realized that most of the other features wouldn't work without additional changes, so I guess I am giving up. Although I might consider now creating a bespin based editor with only opening, saving, horizontal opened file list and maybe searching, without the other features. Should be quite easy (except for the searching), although its a pity I was unable to get bespin working inside this editor.

Secondly (I might consider doing this, if I haven't suddenly lost interest in this project by tomorrow) it might be interesting to create a single proxy file on the server, it would do most of what api.php is doing right now. In other words it would work like this:
   1. User puts netpadd_proxy.php on server
   2. Opens netpadd_proxy.php and is asked to define password (which is then written INTO – to keep it in one file – netpadd_proxy.php)
   3. User opens netpadd locally, selects "Connect to server", gives netpadd_proxy.php url and password and is able to open/save files on server. (The proxy and pass should probably be saved locally, and the UI should make it exactly as easy to open local as server side files from that point on.)
This approach would make it far more likely for somebody to actually use this on a server side project, as people aren't likely to install a whole application for every project they work on.

James Xuan [PersonRank 10]

14 years ago #

This thing blows my mind. Like seriously. Incredible blurring of the lines.

Philipp Lenssen [PersonRank 10]

14 years ago #

> This approach would make it far more likely for somebody
> to actually use this on a server side project, as people aren't
> likely to install a whole application for every project they work on.

I think it's great you think in terms of adjusting this project to exactly your needs. Like I did too... one of my needs was particularly to be able to edit files from an internet cafe, where I may not have the luxury to install any local stuff. So if you have say 1 server with 20 sites, you could edit those 20 sites via password-protected https from the net cafe, without further installation of anything – you'd just open the thing in Chrome (or if not available, Firefox).

Would be nice if you keep us updated on your changes, maybe it will inspire more changes in the Netpadd B project, too. Today I plan to change the file extensions from php5 to php to make it easier to get this thing set up.

By the way, for security you can look into the function "usesCorrectAuthentication" in the file site.php(5), which is used by both the root index as well as the API index file. One thing that is not included, but could be included for your needs (if your server setup supports this), is the extra check "!isset($_SERVER['PHP_AUTH_USER'])".

[put at-character here]James, glad you like it :)

Ianf [PersonRank 10]

14 years ago #

FWITBW (an abbreviation for "for what it may be worth" just in case [JIC]) the font demo in your post (not in Netpadd B), i.e.
http://blogoscoped.com/files/netpadd-b-screens/doid.png

"loaded via a CSS bit, which only works when starting Chrome with the -enable-remote-fonts switch (due to intentionally unspecified security concerns by Google engineers)" – ALSO works in vanilla Safari 4.0.3 on OSX 10.5.8. Nice, and badly needed hack akin to an on-demand animated GIF.... now add more frames capability to it, and a cumulative steps counter, and we can kiss animated gifs forever goodbye.

Forum home

Advertisement

 
Blog  |  Forum     more >> Archive | Feed | Google's blogs | About
Advertisement

 

This site unofficially covers Google™ and more with some rights reserved. Join our forum!