You are not logged in.

#26 2009-04-13 08:44:03

X/ax
Member
From: Oost vlaanderen, Belgium
Registered: 2008-01-13
Posts: 275
Website

Re: ArchLinux Web Browser Start Page

pyther wrote:

First of thanks for this!

Second a Bug!!!

If you search google, then go back in the browser and try to search the forums the search will fail. This is due to the fact the textbox's name is changing. To fix this give the text box an id and change the name accordingly in the javascript.

Thanks to dusty for helping me fix the javascript!

        
</style>
        <script type="text/javascript">
        function OnSubmitForm()
        {
          if(document.sform.sub[0].checked == true)
          {
            document.getElementById('search_box').name = "q";
            document.sform.action ="http://www.google.com/search";
          }
          else if(document.sform.sub[1].checked == true)
          {
            document.getElementById('search_box').name = "keywords";  
            var arch_trickery = document.createElement("input");
            arch_trickery.setAttribute("name", "action");
            arch_trickery.setAttribute("value", "search");
            arch_trickery.setAttribute("type", "hidden");
            document.sform.appendChild(arch_trickery);
            document.sform.action ="http://bbs.archlinux.org/search.php";
          }
          else if(document.sform.sub[2].checked == true){
            document.getElementById('search_box').name = "search";
            document.sform.action ="http://wiki.archlinux.org/index.php/Special:Search"
          }
          else if(document.sform.sub[3].checked == true){
            document.getElementById('search_box').name = "K";
            document.sform.action="http://aur.archlinux.org/packages.php";
          }
          return true;
        }
        function select(){
            document.sform.q.focus();
            document.sform.q.select();
        }
        </script>

<input id="search_box" type="text" size="40" name="q" /><input type="submit" value="Search" />

I modified the page to display the latest 4 news item at the top of the page and the latest packages on the bottom. If anyone wants I can upload the webpy script.

http://arch.pyther.net/static/sn_small.png
(click for bigger screenshot)

http://arch.pyther.net

Nice stuff. However, you might want to look at the javascript from me and square, since there the search box already had an id from the beginning ^^


My coding blog (or an attempt at it)
Archer start page (or an attempt at it)

Offline

#27 2009-04-13 12:30:42

fijam
Member
Registered: 2009-02-03
Posts: 244
Website

Re: ArchLinux Web Browser Start Page

pyther wrote:

[...] If anyone wants I can upload the webpy script.

Yes, please!

Offline

#28 2009-04-14 01:32:05

pyther
Member
Registered: 2008-01-21
Posts: 1,395
Website

Re: ArchLinux Web Browser Start Page

fijam wrote:
pyther wrote:

[...] If anyone wants I can upload the webpy script.

Yes, please!

http://arch.pyther.net/static/arch-home … 0.1.tar.gz

Hopefully I'll release v0.1.1 tomorrow that includes a little bit cleaner javascript.


Website - Blog - arch-home
Arch User since March 2005

Offline

#29 2009-04-14 18:40:56

fijam
Member
Registered: 2009-02-03
Posts: 244
Website

Re: ArchLinux Web Browser Start Page

Webpy looks nice, I need to learn it. BTW would you mind if I put it on appengine? That way you wouldn't have to worry about hosting.

Offline

#30 2009-04-14 20:36:29

pyther
Member
Registered: 2008-01-21
Posts: 1,395
Website

Re: ArchLinux Web Browser Start Page

Sure go for it!


Website - Blog - arch-home
Arch User since March 2005

Offline

#31 2009-04-14 22:19:53

fijam
Member
Registered: 2009-02-03
Posts: 244
Website

Re: ArchLinux Web Browser Start Page

Here it is: http://arch-start.appspot.com/
Should just hang there unless Google makes some radical changes.

Offline

#32 2009-04-14 22:52:34

pyther
Member
Registered: 2008-01-21
Posts: 1,395
Website

Re: ArchLinux Web Browser Start Page

fijam wrote:

Here it is: http://arch-start.appspot.com/
Should just hang there unless Google makes some radical changes.

Cool! Does google support webpy?

Also I used X/ax javascript code with a minor adjustment. http://arch.pyther.net/static/arch-home … 0.2.tar.gz
The only file that changed was templates/index.html


Website - Blog - arch-home
Arch User since March 2005

Offline

#33 2009-04-15 05:54:36

fijam
Member
Registered: 2009-02-03
Posts: 244
Website

Re: ArchLinux Web Browser Start Page

Yes, it lets you use any third party python library as long as it is written in pure python and does not depend on stuff that is disabled (ftp, sockets, threading, filesystem access etc).

Offline

#34 2009-04-15 06:31:31

hatten
Arch Linux f@h Team Member
From: Sweden, Borlange
Registered: 2009-02-23
Posts: 736

Re: ArchLinux Web Browser Start Page

Square wrote:

I took it and played with it for a local homepage. Thought I might share what I've changed with you guys tongue

Just a few tiny tweaks... possibly could have been implemented better... but who cares.

Hope you don't mind!

Screenie
http://omploader.org/tMWk5bw

could you give link? This is the best one for black background.

@fijam/pyther, can you make the background to the picture transparent, instead of white?

Offline

#35 2009-04-15 07:15:29

fijam
Member
Registered: 2009-02-03
Posts: 244
Website

Re: ArchLinux Web Browser Start Page

Sure, I added the alpha channel, interlaced the png and run optipng over it. If, however, there is interest in a dark theme a better solution would be required - probably an alternate CSS file with some JS trickery.

edit: A List Apart delivers again. I will tinker with this in the evening.

Last edited by fijam (2009-04-15 07:19:20)

Offline

#36 2009-04-15 08:36:35

Devastator
Member
From: Poland
Registered: 2008-05-27
Posts: 179

Re: ArchLinux Web Browser Start Page

fijam wrote:

Here it is: http://arch-start.appspot.com/
Should just hang there unless Google makes some radical changes.

Thanks! I've just set it as my start page smile


Some applications are WYSIWYG, and some are WYSIWTF.

Offline

#37 2009-04-15 14:08:26

fijam
Member
Registered: 2009-02-03
Posts: 244
Website

Re: ArchLinux Web Browser Start Page

Split out css and js, updated js and added a very rough dark theme. Need to implement logo switching and correct colours.

Offline

#38 2009-04-15 21:31:01

pyther
Member
Registered: 2008-01-21
Posts: 1,395
Website

Re: ArchLinux Web Browser Start Page

fijam wrote:

Split out css and js, updated js and added a very rough dark theme. Need to implement logo switching and correct colours.

Keep it all together, you'll have better load times. With such small code its easier/faster to download one file than it is to download 3 files (index, css, javascript)


Website - Blog - arch-home
Arch User since March 2005

Offline

#39 2009-04-15 23:09:02

Square
Member
Registered: 2008-06-11
Posts: 435

Re: ArchLinux Web Browser Start Page

hatten wrote:
Square wrote:

I took it and played with it for a local homepage. Thought I might share what I've changed with you guys tongue

Just a few tiny tweaks... possibly could have been implemented better... but who cares.

Hope you don't mind!

Screenie
http://omploader.org/tMWk5bw

could you give link? This is the best one for black background.

@fijam/pyther, can you make the background to the picture transparent, instead of white?

It's not hosted online anymore. I've got it loaded up locally. All of the stuff is there, though.


 

Offline

#40 2009-04-16 21:35:58

X/ax
Member
From: Oost vlaanderen, Belgium
Registered: 2008-01-13
Posts: 275
Website

Re: ArchLinux Web Browser Start Page

Whow, I've been out only a couple of days. Nice stuff getting online.
http://arch-start.appspot.com/ << Doesn't seem to work here, I get an INTERNAL SERVER ERROR line instead of anything usefull...


My coding blog (or an attempt at it)
Archer start page (or an attempt at it)

Offline

#41 2009-04-16 22:23:17

fijam
Member
Registered: 2009-02-03
Posts: 244
Website

Re: ArchLinux Web Browser Start Page

I just noticed that it blew up, trying to fix it.

edit: worked around, I do not really know why it throws list index out of range, Pyther, care to explain?

Last edited by fijam (2009-04-16 22:32:44)

Offline

#42 2009-04-16 22:33:11

pyther
Member
Registered: 2008-01-21
Posts: 1,395
Website

Re: ArchLinux Web Browser Start Page

fijam wrote:

I just noticed that it blew up, trying to fix it.

I'll fix it. There are no i686 packages listed in the rss feed which is causing <type 'exceptions.IndexError'> at /
list index out of range

There are currently only 29 packages for in extra for i686!


Website - Blog - arch-home
Arch User since March 2005

Offline

#43 2009-04-16 22:38:07

fijam
Member
Registered: 2009-02-03
Posts: 244
Website

Re: ArchLinux Web Browser Start Page

Talk about timing, just figured that out and wanted to post my revelations smile

edit: I fixed it a little better now, it simply counts packages on both lists and displays min() of those two.

Last edited by fijam (2009-04-16 23:13:30)

Offline

#44 2009-04-16 23:46:23

pyther
Member
Registered: 2008-01-21
Posts: 1,395
Website

Re: ArchLinux Web Browser Start Page

I took a different approach. Once five packages are added to each list it stops adding packages. Then the template prints all items in the list on the page.

http://arch.pyther.net/static/arch-home … 0.3.tar.gz

You can also change the number of packages changing 5 to whatever you want:

if len(i686) < 5:

Website - Blog - arch-home
Arch User since March 2005

Offline

#45 2009-04-17 00:06:05

fijam
Member
Registered: 2009-02-03
Posts: 244
Website

Re: ArchLinux Web Browser Start Page

Yeah, that sounds like a more sensible approach, I will look into it tomorrow (it's 2am local time). I just pushed out a slightly updated version with better dark colour theme and minor corrections.

Regarding splitting out css and js I just prefer to keep things separated, and I think the performance penalty is negligible. I may be wrong though, I might use libwebkit's inspector to back it up with some numbers. Also, keeping css in two files lets me switch them easily with js.

Last edited by fijam (2009-04-17 00:08:31)

Offline

#46 2009-04-20 13:05:25

muunleit
Member
From: Germany
Registered: 2008-02-23
Posts: 234

Re: ArchLinux Web Browser Start Page

Can you change the width of the "Recent Updates"-section(?), some of the last updates don't seem to fit in.

2009-04-20_15-01-04.jpg


"The mind can make a heaven out of hell or a hell out of heaven" -- John Milton

Offline

#47 2009-04-20 23:25:49

fijam
Member
Registered: 2009-02-03
Posts: 244
Website

Re: ArchLinux Web Browser Start Page

I will fiddle with the dimensions tomorrow, it's hard to get it right because sometimes there are only updates with short names and a lot of space is wasted. Perhaps I will be able to come up with something smart in CSS.

Also, I plan on adding something like "aur spotlight" below the recent updates. The basic premise is to pick a random package from the recent updates RSS and use Aurjson to get the description / votes / what-not.

Once I clean up the code a little I will push everything to git-hub, too.

Last edited by fijam (2009-04-20 23:30:01)

Offline

#48 2009-04-21 01:11:46

pyther
Member
Registered: 2008-01-21
Posts: 1,395
Website

Re: ArchLinux Web Browser Start Page

I'll be interested to see what you come up with. I really don't see an easy way to work with the problem of packages being a different length.

I patched the problem by cutting the string off after 23 characters:

def cut(x):
    if len(x) > 23:
        x=x[:23]
    return x

i686.append(cut(x.strip(' i686')))

x86_64.append(cut(x.strip(' x86_64')))

Last edited by pyther (2009-04-21 01:13:34)


Website - Blog - arch-home
Arch User since March 2005

Offline

#49 2009-04-21 23:35:54

fijam
Member
Registered: 2009-02-03
Posts: 244
Website

Re: ArchLinux Web Browser Start Page

Well, real life plus a sudden narcolepsy strike prevented me from doing any work on this today. Also noticed that there is a tiny bug where .strip x86_64 also strips the x if the package name starts with one. .rstrip should take care of this.

Offline

#50 2009-04-22 19:39:59

fijam
Member
Registered: 2009-02-03
Posts: 244
Website

Re: ArchLinux Web Browser Start Page

I pushed a small update. Of course, the AUR feed has package descriptions as well, dunno why I convinced myself that it does not. Anyway, no need for json. I made some changes to how the width of boxes is handled but I am still not entirely happy with the solution. Perhaps I will run some statistics on the distribution of package name lengths and adjust Pyther's script accordingly.

In a long run (weeks?) I plan to add google accounts integration (that should cover archlinux.us as well) and some customization options.

I set up a git-hub for the project at http://github.com/fijam/arch-start . Pardon uninformative commit messages, these are my first steps with git. As I am still learning python my modifications to pyther's excellent code are often sub-optimal. I am looking forward to your feedback smile.

Offline

Board footer

Powered by FluxBB