On Sat, Aug 07, 2010 at 09:04:36PM +0300, Timo Juhani Lindfors wrote:
> Here too, you should use git so that people don't need to download 7
> megabytes to see your changes :-)
---end quoted text---

-- 
 ‎أحمد المحمودي (Ahmed El-Mahmoudy)
  Digital design engineer
 GPG KeyID: 0xEDDDA1B7
 GPG Fingerprint: 8206 A196 2084 7E6D 0DF8  B176 BC19 6A94 EDDD A1B7
Description: Make use of the HTML5 media elements
 A link is inserted, that, when activated (via enter key or mouse click), gives
 you a choice between downloading the file to disk or viewing it in your
 favorite media player (probably with AAlib output enabled)
Origin: http://blog.dieweltistgarnichtso.net/html5-media-elements-in-elinks
Forwarded: yes
Author: Nils Dagsson Moskopp <n...@dieweltistgarnichtso.net>
--- a/src/document/html/parser/link.c
+++ b/src/document/html/parser/link.c
@@ -407,6 +407,27 @@
 	mem_free(code);
 }
 
+void
+html_audio(struct html_context *html_context, unsigned char *a,
+            unsigned char *xxx3, unsigned char *xxx4, unsigned char **xxx5)
+{
+	unsigned char *url;
+
+	/* This just places a link where a audio element would be. */
+
+	url = get_url_val(a, "src", html_context->doc_cp);
+	if (!url) return;
+
+	html_focusable(html_context, a);
+
+	put_link_line("Audio: ", basename(url), url,
+              html_context->options->framename, html_context);
+
+	html_skip(html_context, a);
+
+	mem_free(url);
+}
+
 static void
 html_iframe_do(unsigned char *a, unsigned char *object_src,
                struct html_context *html_context)
@@ -530,7 +551,26 @@
 	mem_free_set(&object_src, NULL);
 }
 
+void
+html_video(struct html_context *html_context, unsigned char *a,
+            unsigned char *xxx3, unsigned char *xxx4, unsigned char **xxx5)
+{
+	unsigned char *url;
+
+	/* This just places a link where a video element would be. */
+
+	url = get_url_val(a, "src", html_context->doc_cp);
+	if (!url) return;
 
+	html_focusable(html_context, a);
+
+	put_link_line("Video: ", basename(url), url,
+              html_context->options->framename, html_context);
+
+	html_skip(html_context, a);
+
+	mem_free(url);
+}
 
 /* Link types:
 
--- a/src/document/html/parser/link.h
+++ b/src/document/html/parser/link.h
@@ -14,6 +14,8 @@
 element_handler_T html_img;
 element_handler_T html_link;
 element_handler_T html_object;
+element_handler_T html_audio;
+element_handler_T html_video;
 element_handler_T html_embed;
 
 #endif
--- a/src/document/html/parser/parse.c
+++ b/src/document/html/parser/parse.c
@@ -429,6 +429,7 @@
  {"ABBR",        html_italic,      NULL,                 0, ET_NESTABLE    },
  {"ADDRESS",     html_address,     NULL,                 2, ET_NESTABLE    },
  {"APPLET",      html_applet,      NULL,                 1, ET_NON_PAIRABLE},
+ {"AUDIO",       html_audio,       NULL,                 1, ET_NON_PAIRABLE},
  {"B",           html_bold,        NULL,                 0, ET_NESTABLE    },
  {"BASE",        html_base,        NULL,                 0, ET_NON_PAIRABLE},
  {"BASEFONT",    html_font,        NULL,                 0, ET_NON_PAIRABLE},
@@ -496,6 +497,7 @@
  {"TT",          html_tt,          NULL,                 0, ET_NON_NESTABLE},
  {"U",           html_underline,   NULL,                 0, ET_NESTABLE    },
  {"UL",          html_ul,          NULL,                 2, ET_NESTABLE    },
+ {"VIDEO",       html_video,       NULL,                 1, ET_NON_PAIRABLE},
  {"XMP",         html_xmp,         html_xmp_close,       2, ET_NESTABLE    },
  {NULL,          NULL,             NULL,                 0, ET_NESTABLE    },
 };

Attachment: signature.asc
Description: Digital signature

_______________________________________________
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev

Reply via email to