Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 92444e3
Showing
51 changed files
with
5,242 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
./midorator.so | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
LGPL-2 or later | ||
(see ./LGPL-2) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
1) Required: | ||
Install Midori. This extension is tested with midori-0.2.6. | ||
|
||
2) Required: | ||
Install devel-packages of gtk+2, webkit-gtk. | ||
|
||
3) Optional, recomended: | ||
Remove midori-headers from ./include, put headers of your version there. | ||
|
||
4) Required: | ||
$ make | ||
(as current user) | ||
|
||
5) Required: | ||
Copy (as root) "midorator.so" to midori extensions dir | ||
(usually /usr/lib/midori/) | ||
|
||
6) Required: | ||
Run Midori, enable extension "Midorator". | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
all: midorator.so | ||
|
||
midorator.so: midorator.c midorator.h uzbl-follow.h go-next.h | ||
$(CC) midorator.c -Iincludes -o midorator.so -shared $(shell pkg-config gtk+-2.0 webkit-1.0 --cflags --libs) $(CFLAGS) $(LDFLAGS) | ||
|
||
uzbl-follow.h: uzbl-follow.js | ||
sed 's/"/\\"/g;s/%[^s]/%&/g;s/.*/"&\\n"/' uzbl-follow.h > uzbl-follow.js | ||
|
||
go-next.h: go-next.js | ||
sed 's/"/\\"/g;s/%[^s]/%&/g;s/.*/"&\\n"/' go-next.h > go-next.js | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
"\n" | ||
"function html_decode (s) {\n" | ||
" var from = new Array(/>/g, /</g);\n" | ||
" var to = new Array(\">\", \"<\");\n" | ||
" for (var i = 0; i < from.length; i++) {\n" | ||
" s = s.replace(from[i], to[i]);\n" | ||
" }\n" | ||
" from = s.match(/&#[0-9]{1,5};/g);\n" | ||
" if (from)\n" | ||
" for (var i = 0; i < from.length; i++) {\n" | ||
" var n = parseInt(from[i].substr(2, from[i].length - 3));\n" | ||
" if (n)\n" | ||
" s = s.replace(new RegExp(from[i], 'g'), String.fromCharCode(n));\n" | ||
" }\n" | ||
" return s;\n" | ||
"}\n" | ||
"\n" | ||
"\n" | ||
"\n" | ||
"//Make onlick-links \"clickable\"\n" | ||
"HTMLElement.prototype.click = function() {\n" | ||
" try {\n" | ||
" if (typeof this.onclick == 'function') {\n" | ||
" return this.onclick({\n" | ||
" type: 'click'\n" | ||
" });\n" | ||
" } else\n" | ||
" return true;\n" | ||
" } catch(e) {\n" | ||
" return true;\n" | ||
" }\n" | ||
"};\n" | ||
"\n" | ||
"var direction = '%s';\n" | ||
"var links = document.links;\n" | ||
"\n" | ||
"var re = new Array();\n" | ||
"\n" | ||
"if (direction == 'next')\n" | ||
" re = new Array(/>/, />>/, />>>/, /^next$/i, /next *[>»]/i, /^далее/i, /^след[.у]/i, /next/i);\n" | ||
"else if (direction == 'prev')\n" | ||
" re = new Array(/</, /<</, /<<</, /^prev$/i, /^previous/i, /prev[.]? *[>»]/i, /previous *[>»]/i, /^назад/i, /^пред[.ы]/i, /previous/i);\n" | ||
"\n" | ||
"function go() {\n" | ||
" for (var r = 0; r < re.length; r++) {\n" | ||
" var ri = re[r];\n" | ||
" for (var l = 0; l < links.length; l++) {\n" | ||
" var li = links[l];\n" | ||
" if (html_decode(li.innerHTML.replace(/<[^>]*>/g, '')).match(ri) != null) {\n" | ||
" li.focus();\n" | ||
" if (li.click() != false)\n" | ||
" document.location = li.href;\n" | ||
" return;\n" | ||
" }\n" | ||
" }\n" | ||
" }\n" | ||
"}\n" | ||
"\n" | ||
"go();\n" | ||
"\n" | ||
"\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
|
||
function html_decode (s) { | ||
var from = new Array(/>/g, /</g); | ||
var to = new Array(">", "<"); | ||
for (var i = 0; i < from.length; i++) { | ||
s = s.replace(from[i], to[i]); | ||
} | ||
from = s.match(/&#[0-9]{1,5};/g); | ||
if (from) | ||
for (var i = 0; i < from.length; i++) { | ||
var n = parseInt(from[i].substr(2, from[i].length - 3)); | ||
if (n) | ||
s = s.replace(new RegExp(from[i], 'g'), String.fromCharCode(n)); | ||
} | ||
return s; | ||
} | ||
|
||
|
||
|
||
//Make onlick-links "clickable" | ||
HTMLElement.prototype.click = function() { | ||
try { | ||
if (typeof this.onclick == 'function') { | ||
return this.onclick({ | ||
type: 'click' | ||
}); | ||
} else | ||
return true; | ||
} catch(e) { | ||
return true; | ||
} | ||
}; | ||
|
||
var direction = '%s'; | ||
var links = document.links; | ||
|
||
var re = new Array(); | ||
|
||
if (direction == 'next') | ||
re = new Array(/>/, />>/, />>>/, /^next$/i, /next *[>»]/i, /^далее/i, /^след[.у]/i, /next/i); | ||
else if (direction == 'prev') | ||
re = new Array(/</, /<</, /<<</, /^prev$/i, /^previous/i, /prev[.]? *[>»]/i, /previous *[>»]/i, /^назад/i, /^пред[.ы]/i, /previous/i); | ||
|
||
function go() { | ||
for (var r = 0; r < re.length; r++) { | ||
var ri = re[r]; | ||
for (var l = 0; l < links.length; l++) { | ||
var li = links[l]; | ||
if (html_decode(li.innerHTML.replace(/<[^>]*>/g, '')).match(ri) != null) { | ||
li.focus(); | ||
if (li.click() != false) | ||
document.location = li.href; | ||
return; | ||
} | ||
} | ||
} | ||
} | ||
|
||
go(); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
Copyright (C) 2009 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de> | ||
This library is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU Lesser General Public | ||
License as published by the Free Software Foundation; either | ||
version 2.1 of the License, or (at your option) any later version. | ||
See the file COPYING for the full license text. | ||
*/ | ||
|
||
#ifndef __COOKIE_MANAGER_PAGE_H__ | ||
#define __COOKIE_MANAGER_PAGE_H__ | ||
|
||
G_BEGIN_DECLS | ||
|
||
#define COOKIE_MANAGER_PAGE_TYPE (cookie_manager_page_get_type()) | ||
#define COOKIE_MANAGER_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),\ | ||
COOKIE_MANAGER_PAGE_TYPE, CookieManagerPage)) | ||
#define COOKIE_MANAGER_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),\ | ||
COOKIE_MANAGER_PAGE_TYPE, CookieManagerPageClass)) | ||
#define IS_COOKIE_MANAGER_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),\ | ||
COOKIE_MANAGER_PAGE_TYPE)) | ||
#define IS_COOKIE_MANAGER_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),\ | ||
COOKIE_MANAGER_PAGE_TYPE)) | ||
|
||
typedef struct _CookieManagerPage CookieManagerPage; | ||
typedef struct _CookieManagerPageClass CookieManagerPageClass; | ||
|
||
struct _CookieManagerPage | ||
{ | ||
GtkVBox parent; | ||
}; | ||
|
||
struct _CookieManagerPageClass | ||
{ | ||
GtkVBoxClass parent_class; | ||
}; | ||
|
||
GType cookie_manager_page_get_type (void); | ||
GtkWidget* cookie_manager_page_new (CookieManager *parent, | ||
GtkTreeStore *store, | ||
const gchar *filter_text); | ||
|
||
G_END_DECLS | ||
|
||
#endif /* __COOKIE_MANAGER_PAGE_H__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
Copyright (C) 2009 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de> | ||
This library is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU Lesser General Public | ||
License as published by the Free Software Foundation; either | ||
version 2.1 of the License, or (at your option) any later version. | ||
See the file COPYING for the full license text. | ||
*/ | ||
|
||
|
||
#ifndef __COOKIE_MANAGER_H__ | ||
#define __COOKIE_MANAGER_H__ | ||
|
||
G_BEGIN_DECLS | ||
|
||
#define STOCK_COOKIE_MANAGER "cookie-manager" | ||
|
||
enum | ||
{ | ||
COOKIE_MANAGER_COL_NAME, | ||
COOKIE_MANAGER_COL_COOKIE, | ||
COOKIE_MANAGER_COL_VISIBLE, | ||
COOKIE_MANAGER_N_COLUMNS | ||
}; | ||
|
||
|
||
#define COOKIE_MANAGER_TYPE (cookie_manager_get_type()) | ||
#define COOKIE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),\ | ||
COOKIE_MANAGER_TYPE, CookieManager)) | ||
#define COOKIE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),\ | ||
COOKIE_MANAGER_TYPE, CookieManagerClass)) | ||
#define IS_COOKIE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),\ | ||
COOKIE_MANAGER_TYPE)) | ||
#define IS_COOKIE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),\ | ||
COOKIE_MANAGER_TYPE)) | ||
|
||
typedef struct _CookieManager CookieManager; | ||
typedef struct _CookieManagerClass CookieManagerClass; | ||
|
||
GType cookie_manager_get_type (void); | ||
CookieManager* cookie_manager_new (MidoriExtension *extension, MidoriApp *app); | ||
|
||
void cookie_manager_delete_cookie(CookieManager *cm, SoupCookie *cookie); | ||
void cookie_manager_update_filter(CookieManager *cm, const gchar *text); | ||
|
||
G_END_DECLS | ||
|
||
#endif /* __COOKIE-MANAGER_H__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
Copyright (C) 2009 Dale Whittaker <dayul@users.sf.net> | ||
This library is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU Lesser General Public | ||
License as published by the Free Software Foundation; either | ||
version 2.1 of the License, or (at your option) any later version. | ||
See the file COPYING for the full license text. | ||
*/ | ||
|
||
#ifndef __FEED_ATOM_H__ | ||
#define __FEED_ATOM_H__ | ||
|
||
#include "feed-parse.h" | ||
|
||
G_BEGIN_DECLS | ||
|
||
FeedParser* | ||
atom_init_parser (void); | ||
|
||
G_END_DECLS | ||
|
||
#endif /* __FEED_ATOM_H__ */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
Copyright (C) 2009 Dale Whittaker <dayul@users.sf.net> | ||
This library is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU Lesser General Public | ||
License as published by the Free Software Foundation; either | ||
version 2.1 of the License, or (at your option) any later version. | ||
See the file COPYING for the full license text. | ||
*/ | ||
|
||
#ifndef __FEED_PANEL_H__ | ||
#define __FEED_PANEL_H__ | ||
|
||
#include <midori/midori.h> | ||
|
||
G_BEGIN_DECLS | ||
|
||
#define FEED_TYPE_PANEL \ | ||
(feed_panel_get_type ()) | ||
#define FEED_PANEL(obj) \ | ||
(G_TYPE_CHECK_INSTANCE_CAST ((obj), FEED_TYPE_PANEL, FeedPanel)) | ||
#define FEED_PANEL_CLASS(klass) \ | ||
(G_TYPE_CHECK_CLASS_CAST ((klass), FEED_TYPE_PANEL, FeedPanelClass)) | ||
#define FEED_IS_PANEL(obj) \ | ||
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), FEED_TYPE_PANEL)) | ||
#define FEED_IS_PANEL_CLASS(klass) \ | ||
(G_TYPE_CHECK_CLASS_TYPE ((klass), FEED_TYPE_PANEL)) | ||
#define FEED_PANEL_GET_CLASS(obj) \ | ||
(G_TYPE_INSTANCE_GET_CLASS ((obj), FEED_TYPE_PANEL, FeedPanelClass)) | ||
|
||
typedef struct _FeedPanel FeedPanel; | ||
typedef struct _FeedPanelClass FeedPanelClass; | ||
|
||
void | ||
feed_panel_add_feeds (FeedPanel* panel, | ||
KatzeItem* feed); | ||
|
||
void | ||
feed_panel_set_editable (FeedPanel* panel, | ||
gboolean editable); | ||
|
||
GType | ||
feed_panel_get_type (void); | ||
|
||
GtkWidget* | ||
feed_panel_new (void); | ||
|
||
G_END_DECLS | ||
|
||
#endif /* __FEED_PANEL_H__ */ |
Oops, something went wrong.