tazweb rev 38
Add degault bookmark file with separated CSS file also for doc
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Fri Apr 15 04:45:26 2011 +0200 (2011-04-15) |
parents | 74112b613920 |
children | 96934e036b67 |
files | Makefile README data/page.html data/style.css doc/style.css doc/tazweb.en.html doc/tazweb.fr.html doc/tazweb.pt.html src/main.c |
line diff
1.1 --- a/Makefile Fri Apr 15 01:59:38 2011 +0200 1.2 +++ b/Makefile Fri Apr 15 04:45:26 2011 +0200 1.3 @@ -20,14 +20,14 @@ 1.4 $(DESTDIR)$(PREFIX)/share/pixmaps \ 1.5 $(DESTDIR)$(PREFIX)/share/applications 1.6 install -m 0755 $(PACKAGE) $(DESTDIR)$(PREFIX)/bin 1.7 - cp -d doc/*.html $(DESTDIR)$(DOCDIR)/$(PACKAGE) 1.8 + cp -d doc/* $(DESTDIR)$(DOCDIR)/$(PACKAGE) 1.9 install -m 0644 data/tazweb-icon.png \ 1.10 $(DESTDIR)$(PREFIX)/share/pixmaps/tazweb.png 1.11 install -m 0644 data/tazweb.desktop \ 1.12 $(DESTDIR)$(PREFIX)/share/applications 1.13 - install -m 0644 data/bookmarks.html \ 1.14 + install -m 0644 data/page.html \ 1.15 $(DESTDIR)$(PREFIX)/share/tazweb 1.16 - install -m 0644 data/bookmarks.html \ 1.17 + install -m 0644 data/style.css \ 1.18 $(DESTDIR)$(PREFIX)/share/tazweb 1.19 1.20 clean:
2.1 --- a/README Fri Apr 15 01:59:38 2011 +0200 2.2 +++ b/README Fri Apr 15 04:45:26 2011 +0200 2.3 @@ -8,6 +8,11 @@ 2.4 motivated and want to add some entries to the context menu, please talk 2.5 to the AUTHOR before commiting anything in the repos. 2.6 2.7 +TazWeb use a custom page in user Freedesktop directory to let user add 2.8 +any content in it and get with one click from the toolbar. We may have 2.9 +a external apps/script to handle that file for user who dont manage to 2.10 +edit pure xHTML. 2.11 + 2.12 This application have been created for Tazpanel and future SliTaz integrated 2.13 Web applications. The goal is by far to have a fully-featured web browser. But 2.14 if you find a way to provide a simple plugins mechanism, that would be great.
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 3.2 +++ b/data/page.html Fri Apr 15 04:45:26 2011 +0200 3.3 @@ -0,0 +1,70 @@ 3.4 +<!DOCTYPE html> 3.5 +<html xmlns="http://www.w3.org/1999/xhtml"> 3.6 +<head> 3.7 + <title>My Page</title> 3.8 + <meta charset="utf-8" /> 3.9 + <link rel="stylesheet" type="text/css" href="style.css" /> 3.10 +</head> 3.11 +<body> 3.12 + 3.13 +<div id="header"> 3.14 + <h1>My Page</h1> 3.15 +</div> 3.16 + 3.17 +<!-- Start content --> 3.18 +<div id="content"> 3.19 + 3.20 +<!-- 3.21 + Welcome to your personnal and custom TazWeb page, a pure xHTML 5 file 3.22 + with some CSS for the design, you can customize it as you want. To add 3.23 + a section title you can use <h2></h2> elements and <div></div> to 3.24 + organize content 3.25 + 3.26 + Here is an example of a bookmark entry, copy and past it somewhere 3.27 + between an <ul></ul> element to add a entry in the list. 3.28 + 3.29 + <li> 3.30 + <a href="URL">NAME</a> 3.31 + : DESCRIPTION 3.32 + </li> 3.33 +--> 3.34 + 3.35 +<div id="cloud"> 3.36 + <a class="tag4" href="http://www.slitaz.org/">SliTaz Website</a> 3.37 + <a class="tag6" href="http://scn.slitaz.org/">SCN</a> 3.38 + <a class="tag8" href="http://wikipedia.org/">Wikipedia</a> 3.39 + <a class="tag5" href="http://forum.slitaz.org/">SliTaz Forum</a> 3.40 + <a class="tag4" href="http://www.google.com/">Google</a> 3.41 + <a class="tag6" href="http://doc.slitaz.org/">SliTaz Wiki</a> 3.42 + <a class="tag5" href="http://twitter.comc">Twitter</a> 3.43 + <a class="tag2" href="http://search.yahoo.com/">Yahoo</a> 3.44 + <a class="tag8" href="http://tazpanel:82/">TazPanel</a> 3.45 +</div> 3.46 + 3.47 +<!-- A nice bookmarks list (Uncomment img to have favicons) --> 3.48 +<div id="bookmarks"> 3.49 + <h2>Bookmarks</h2> 3.50 + <ul> 3.51 + <li> 3.52 + <!-- <img src="http://www.slitaz.org/favicon.ico" /> --> 3.53 + <a href="http://www.slitaz.org/">bugs.slitaz.org</a> 3.54 + : SliTaz Bugs tracker 3.55 + </li> 3.56 + <li> 3.57 + <!-- <img src="http://www.gnu.org/favicon.ico" /> --> 3.58 + <a href="http://www.gnu.org/">www.gnu.org</a> 3.59 + : The GNU Website 3.60 + </li> 3.61 + <li> 3.62 + <!-- <img src="http://is.gd/isgd_favicon.ico" /> --> 3.63 + <a href="http://is.gd/">is.gd</a> 3.64 + : URL shortener 3.65 + </li> 3.66 + </ul> 3.67 +</div> 3.68 + 3.69 +<!-- End content --> 3.70 +</div> 3.71 + 3.72 +</body> 3.73 +</html>
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 4.2 +++ b/data/style.css Fri Apr 15 04:45:26 2011 +0200 4.3 @@ -0,0 +1,45 @@ 4.4 +/* CSS style for TazWeb page */ 4.5 + 4.6 +body { 4.7 + font: 88% sans-serif, vernada, arial; 4.8 + margin: 0; 4.9 +} 4.10 + 4.11 +h1 { margin: 0; padding: 8px; color: #fff; font-size: 20px; } 4.12 +h2 { color: #444; } 4.13 +h3 { color: #666; font-size: 140%; } 4.14 +ul { list-style-type: square; line-height: 140%; } 4.15 +img { vertical-align: middle; } 4.16 +a { color: #215090; } 4.17 +a:hover { text-decoration: none; color: blue; } 4.18 + 4.19 +#header { 4.20 + background: #351a0a; 4.21 + height: 40px; 4.22 + border-bottom: 8px solid #d66018; 4.23 +} 4.24 + 4.25 +#content { 4.26 + margin: 80px; 4.27 +} 4.28 + 4.29 +#cloud { 4.30 + padding: 10px; 4.31 + margin: 0 0 40px; 4.32 + line-height: 3em; 4.33 + text-align: center; 4.34 + background: #f8f8f8; 4.35 + border: 1px solid #ddd; 4.36 + border-radius: 8px; 4.37 +} 4.38 + 4.39 +#cloud a { padding: 0 6px; color: #444444; } 4.40 +#cloud a.tag1 { font-size: 0.6em; font-weight: 100; } 4.41 +#cloud a.tag2 { font-size: 0.8em; font-weight: 200; } 4.42 +#cloud a.tag3 { font-size: 1.0em; font-weight: 300; } 4.43 +#cloud a.tag4 { font-size: 1.2em; font-weight: 400; } 4.44 +#cloud a.tag5 { font-size: 1.4em; font-weight: 500; } 4.45 +#cloud a.tag6 { font-size: 1.6em; font-weight: 600; } 4.46 +#cloud a.tag7 { font-size: 1.8em; font-weight: 700; } 4.47 +#cloud a.tag8 { font-size: 2.0em; font-weight: 800; } 4.48 +
5.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 5.2 +++ b/doc/style.css Fri Apr 15 04:45:26 2011 +0200 5.3 @@ -0,0 +1,28 @@ 5.4 +/* CSS style for SliTaz Doc */ 5.5 + 5.6 +body { font: 88% sans-serif, vernada, arial; margin: 0; } 5.7 +h1 { margin: 0; padding: 8px; color: #fff; font-size: 20px; } 5.8 +h2 { color: #444; } h3 { color: #666; font-size: 140%; } 5.9 +pre { 5.10 + background-color: #f8f8f8; 5.11 + border: 1px solid #ddd; 5.12 + padding: 10px; 5.13 + border-radius: 4px; 5.14 +} 5.15 + 5.16 +#header { 5.17 + background: #351a0a; 5.18 + height: 40px; 5.19 + border-bottom: 8px solid #d66018; 5.20 +} 5.21 + 5.22 +#content { 5.23 + margin: 40px 80px; 5.24 + text-align: justify; 5.25 +} 5.26 + 5.27 +#footer { 5.28 + text-align: center; 5.29 + padding: 20px; 5.30 + border-top: 1px solid #ddd; 5.31 +}
6.1 --- a/doc/tazweb.en.html Fri Apr 15 01:59:38 2011 +0200 6.2 +++ b/doc/tazweb.en.html Fri Apr 15 04:45:26 2011 +0200 6.3 @@ -3,16 +3,7 @@ 6.4 <head> 6.5 <title>TazWeb Documentation</title> 6.6 <meta charset="utf-8" /> 6.7 - <style type="text/css"> 6.8 - body { font: 88% sans-serif, vernada, arial; margin: 0; } 6.9 - #header { background: #351a0a; height: 40px; border-bottom: 8px solid #d66018; } 6.10 - #content { margin: 40px 80px; text-align: justify; } 6.11 - #footer { text-align: center; padding: 20px; border-top: 1px solid #ddd; } 6.12 - h1 { margin: 0; padding: 8px; color: #fff; font-size: 20px; } 6.13 - h2 { color: #444; } h3 { color: #666; font-size: 140%; } 6.14 - pre { background-color: #f8f8f8; border: 1px solid #ddd; padding: 10px; 6.15 - -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px;} 6.16 - </style> 6.17 + <link rel="stylesheet" type="text/css" href="style.css" /> 6.18 </head> 6.19 <body> 6.20 6.21 @@ -46,24 +37,30 @@ 6.22 all latest web standards as well as Javascript. 6.23 </p> 6.24 6.25 -<h3>Bookmarks</h3> 6.26 +<h3>My TazWeb Page</h3> 6.27 <p> 6.28 - TazWeb can handle a bookmarks file located in your Freedesktop standard 6.29 - configuration directory, the path is: $HOME/.config/tazweb/bookmarks.html 6.30 + TazWeb handle a personnal page located in your Freedesktop standard 6.31 + configuration directory, the path is: $HOME/.config/tazweb/page.html 6.32 + It let you have a custom page with bookmarks and other content. The 6.33 + CSS style is defined in $HOME/.config/tazweb/style.css 6.34 </p> 6.35 <p> 6.36 - The file is a simple xHTML 5 document with, by default, a list of links. 6.37 - You can edit this file with you favorite editor and add bookmarks entries 6.38 - or change the look and feel as you want. You will find the default 6.39 - bookmarks.html in: /usr/share/tazweb. You can get an original copy 6.40 - with the following commands in a terminal: 6.41 + The file is a simple xHTML 5 document with, by default, a list of 6.42 + links and a box. You can edit this file with you favorite editor 6.43 + and add content such as bookmarks entries or change the look and 6.44 + feel as you want. At first start TazWeb will create and copy your 6.45 + personnal page and style in your config directory. 6.46 +</p> 6.47 +<p> 6.48 +Note: You will find the default page.html in: /usr/share/tazweb and 6.49 +can get an original copy with the following commands in a terminal: 6.50 </p> 6.51 <pre> 6.52 $ mkdir -p $HOME/.config/tazweb 6.53 -$ cp /usr/share/tazweb/bookmarks.html $HOME/.config/tazweb 6.54 +$ cp /usr/share/tazweb/*.html $HOME/.config/tazweb 6.55 +$ cp /usr/share/tazweb/*.css $HOME/.config/tazweb 6.56 </pre> 6.57 6.58 - 6.59 <h3>Home page and url in argument</h3> 6.60 6.61 <p>
7.1 --- a/doc/tazweb.fr.html Fri Apr 15 01:59:38 2011 +0200 7.2 +++ b/doc/tazweb.fr.html Fri Apr 15 04:45:26 2011 +0200 7.3 @@ -3,16 +3,7 @@ 7.4 <head> 7.5 <title>Documentation TazWeb</title> 7.6 <meta charset="utf-8" /> 7.7 - <style type="text/css"> 7.8 - body { font: 88% sans-serif, vernada, arial; margin: 0; } 7.9 - #header { background: #351a0a; height: 40px; border-bottom: 8px solid #d66018; } 7.10 - #content { margin: 40px 80px; text-align: justify; } 7.11 - #footer { text-align: center; padding: 20px; border-top: 1px solid #ddd; } 7.12 - h1 { margin: 0; padding: 8px; color: #fff; font-size: 20px; } 7.13 - h2 { color: #444; } h3 { color: #666; font-size: 140%; } 7.14 - pre { background-color: #f8f8f8; border: 1px solid #ddd; padding: 10px; 7.15 - -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px;} 7.16 - </style> 7.17 + <link rel="stylesheet" type="text/css" href="style.css" /> 7.18 </head> 7.19 <body> 7.20
8.1 --- a/doc/tazweb.pt.html Fri Apr 15 01:59:38 2011 +0200 8.2 +++ b/doc/tazweb.pt.html Fri Apr 15 04:45:26 2011 +0200 8.3 @@ -3,16 +3,7 @@ 8.4 <head> 8.5 <title>DocumentaĆ§Ć£o do TazWeb</title> 8.6 <meta charset="utf-8" /> 8.7 - <style type="text/css"> 8.8 - body { font: 88% sans-serif, vernada, arial; margin: 0; } 8.9 - #header { background: #351a0a; height: 40px; border-bottom: 8px solid #d66018; } 8.10 - #content { margin: 40px 80px; text-align: justify; } 8.11 - #footer { text-align: center; padding: 20px; border-top: 1px solid #ddd; } 8.12 - h1 { margin: 0; padding: 8px; color: #fff; font-size: 20px; } 8.13 - h2 { color: #444; } h3 { color: #666; font-size: 140%; } 8.14 - pre { background-color: #f8f8f8; border: 1px solid #ddd; padding: 10px; 8.15 - -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px;} 8.16 - </style> 8.17 + <link rel="stylesheet" type="text/css" href="style.css" /> 8.18 </head> 8.19 <body> 8.20
9.1 --- a/src/main.c Fri Apr 15 01:59:38 2011 +0200 9.2 +++ b/src/main.c Fri Apr 15 04:45:26 2011 +0200 9.3 @@ -23,7 +23,7 @@ 9.4 update_title (GtkWindow* window) 9.5 { 9.6 GString* string = g_string_new (main_title); 9.7 - g_string_append (string, " - TazWeb"); 9.8 + /* g_string_append (string, " - TazWeb"); */ 9.9 if (load_progress < 100) 9.10 g_string_append_printf (string, " (%f%%)", load_progress); 9.11 gchar* title = g_string_free (string, FALSE); 9.12 @@ -77,7 +77,7 @@ 9.13 static void 9.14 go_home_cb (GtkWidget* widget, gpointer data) 9.15 { 9.16 - const gchar* uri = ("file:///usr/share/webhome/index.html"); 9.17 + const gchar* uri = ("file:///usr/share/webhome/index.html"); 9.18 g_assert (uri); 9.19 webkit_web_view_load_uri (web_view, uri); 9.20 } 9.21 @@ -86,8 +86,8 @@ 9.22 static void 9.23 bookmarks_cb (GtkWidget* widget, gpointer data) 9.24 { 9.25 - const gchar* uri = g_strdup_printf ("file://%s/.config/tazweb/bookmarks.html", 9.26 - g_get_home_dir ()); 9.27 + const gchar* uri = g_strdup_printf ("file://%s/.config/tazweb/page.html", 9.28 + g_get_home_dir ()); 9.29 g_assert (uri); 9.30 webkit_web_view_load_uri (web_view, uri); 9.31 } 9.32 @@ -163,12 +163,11 @@ 9.33 create_toolbar () 9.34 { 9.35 GtkWidget* toolbar = gtk_toolbar_new (); 9.36 + GtkToolItem* item; 9.37 9.38 gtk_toolbar_set_orientation (GTK_TOOLBAR (toolbar), GTK_ORIENTATION_HORIZONTAL); 9.39 gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_BOTH_HORIZ); 9.40 9.41 - GtkToolItem* item; 9.42 - 9.43 /* The back button */ 9.44 item = gtk_tool_button_new_from_stock (GTK_STOCK_GO_BACK); 9.45 g_signal_connect (G_OBJECT (item), "clicked", G_CALLBACK (go_back_cb), NULL); 9.46 @@ -190,7 +189,7 @@ 9.47 uri_entry = gtk_entry_new (); 9.48 gtk_container_add (GTK_CONTAINER (item), uri_entry); 9.49 g_signal_connect (G_OBJECT (uri_entry), "activate", 9.50 - G_CALLBACK (activate_uri_entry_cb), NULL); 9.51 + G_CALLBACK (activate_uri_entry_cb), NULL); 9.52 gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1); 9.53 9.54 /* The Home button */ 9.55 @@ -223,7 +222,7 @@ 9.56 /* Default tazweb window size ratio to 3/4 ?? --> 720, 540*/ 9.57 gtk_window_set_default_size (GTK_WINDOW (window), 800, 600); 9.58 gtk_window_set_icon (GTK_WINDOW (window), 9.59 - create_pixbuf ("/usr/share/pixmaps/tazweb.png")); 9.60 + create_pixbuf ("/usr/share/pixmaps/tazweb.png")); 9.61 gtk_widget_set_name (window, "TazWeb"); 9.62 g_signal_connect (window, "destroy", G_CALLBACK (destroy_cb), NULL); 9.63 9.64 @@ -241,7 +240,8 @@ 9.65 const gchar* config = g_strdup_printf ("%s/.config/tazweb", g_get_home_dir ()); 9.66 if (!g_file_test(config, G_FILE_TEST_EXISTS)) { 9.67 g_mkdir(config, 0700); 9.68 - system("cp /usr/share/tazweb/bookmarks.html $HOME/.config/tazweb"); 9.69 + system("cp /usr/share/tazweb/*.html $HOME/.config/tazweb"); 9.70 + system("cp /usr/share/tazweb/*.css $HOME/.config/tazweb"); 9.71 } 9.72 9.73 GtkWidget* vbox = gtk_vbox_new (FALSE, 2); 9.74 @@ -253,7 +253,7 @@ 9.75 9.76 /* Home page url or file */ 9.77 gchar* uri = (gchar*) (argc > 1 ? argv[1] : 9.78 - "file:///usr/share/webhome/index.html"); 9.79 + "file:///usr/share/webhome/index.html"); 9.80 webkit_web_view_load_uri (web_view, uri); 9.81 9.82 gtk_widget_grab_focus (GTK_WIDGET (web_view));