From: joey Date: Wed, 7 Mar 2007 07:41:07 +0000 (+0000) Subject: support previewing of sparklines: embed in data uris for preview X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/commitdiff_plain/4cbb1095d62b9b2ded9546040e4bc5f5b0faef67 support previewing of sparklines: embed in data uris for preview --- diff --git a/IkiWiki/Plugin/sparkline.pm b/IkiWiki/Plugin/sparkline.pm index a44e06252..63c2cf943 100644 --- a/IkiWiki/Plugin/sparkline.pm +++ b/IkiWiki/Plugin/sparkline.pm @@ -108,10 +108,6 @@ sub preprocess (@) { #{{{ $php.=qq{\$sparkline->RenderResampled($width, $height);\n}; } - if ($params{preview}) { - return "[[".gettext("sparkline previewing not implemented")."]]"; - } - $php.=qq{\$sparkline->Output();\n?>\n}; # Use the sha1 of the php code that generates the sparkline as @@ -148,7 +144,16 @@ sub preprocess (@) { #{{{ return "[[".gettext("sparkline failed to run php")."]]"; } - writefile($fn, $config{destdir}, $png, 1); + if (! $params{preview}) { + writefile($fn, $config{destdir}, $png, 1); + } + else { + # can't write the file, so embed it in a data uri + eval q{use MIME::Base64}; + error($@) if $@; + return ""; + } } return '\n" "Language-Team: Bulgarian \n" @@ -343,12 +343,7 @@ msgstr "липсващ параметър „id” на шаблона" msgid "sparkline bad width value" msgstr "приставката „linkmap”: грешка при изпълнение на „dot”" -#: ../IkiWiki/Plugin/sparkline.pm:112 -#, fuzzy -msgid "sparkline previewing not implemented" -msgstr "функцията „getctime” не е реализирана" - -#: ../IkiWiki/Plugin/sparkline.pm:148 +#: ../IkiWiki/Plugin/sparkline.pm:144 #, fuzzy msgid "sparkline failed to run php" msgstr "приставката „linkmap”: грешка при изпълнение на „dot”" @@ -509,3 +504,7 @@ msgstr "Грешка" #, perl-format msgid "%s preprocessing loop detected on %s at depth %i" msgstr "открита е циклична завидимост при %s на „%s” на дълбочина %i" + +#, fuzzy +#~ msgid "sparkline previewing not implemented" +#~ msgstr "функцията „getctime” не е реализирана" diff --git a/po/cs.po b/po/cs.po index 70c90d7df..3197174cf 100644 --- a/po/cs.po +++ b/po/cs.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ikiwiki\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2007-03-07 01:22-0500\n" +"POT-Creation-Date: 2007-03-07 02:29-0500\n" "PO-Revision-Date: 2007-02-17 12:07+0100\n" "Last-Translator: Miroslav Kure \n" "Language-Team: Czech \n" @@ -339,12 +339,7 @@ msgstr "šabloně chybí parametr id" msgid "sparkline bad width value" msgstr "linkmapu se nepodařilo spustit dot" -#: ../IkiWiki/Plugin/sparkline.pm:112 -#, fuzzy -msgid "sparkline previewing not implemented" -msgstr "getctime není implementováno" - -#: ../IkiWiki/Plugin/sparkline.pm:148 +#: ../IkiWiki/Plugin/sparkline.pm:144 #, fuzzy msgid "sparkline failed to run php" msgstr "linkmapu se nepodařilo spustit dot" @@ -503,5 +498,9 @@ msgstr "Chyba" msgid "%s preprocessing loop detected on %s at depth %i" msgstr "Byla rozpoznána smyčka direktivy %s na %s v hloubce %i" +#, fuzzy +#~ msgid "sparkline previewing not implemented" +#~ msgstr "getctime není implementováno" + #~ msgid "in late morning %A" #~ msgstr "%A pozdě dopoledne" diff --git a/po/es.po b/po/es.po index 14ebddccb..73cd380db 100644 --- a/po/es.po +++ b/po/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: es\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2007-03-07 01:22-0500\n" +"POT-Creation-Date: 2007-03-07 02:29-0500\n" "PO-Revision-Date: 2007-02-12 10:31+0100\n" "Last-Translator: Víctor Moral \n" "Language-Team: spanish \n" @@ -345,12 +345,7 @@ msgstr "A el complemento template le falta el parámetro id" msgid "sparkline bad width value" msgstr "El complemento linkmap no ha podido ejecutar el programa dot" -#: ../IkiWiki/Plugin/sparkline.pm:112 -#, fuzzy -msgid "sparkline previewing not implemented" -msgstr "la funcionalidad getctime no está incluida" - -#: ../IkiWiki/Plugin/sparkline.pm:148 +#: ../IkiWiki/Plugin/sparkline.pm:144 #, fuzzy msgid "sparkline failed to run php" msgstr "El complemento linkmap no ha podido ejecutar el programa dot" @@ -516,3 +511,7 @@ msgid "%s preprocessing loop detected on %s at depth %i" msgstr "" "se ha detectado un bucle de preprocesado %s en la página %s en la vuelta " "número %i" + +#, fuzzy +#~ msgid "sparkline previewing not implemented" +#~ msgstr "la funcionalidad getctime no está incluida" diff --git a/po/fr.po b/po/fr.po index 5d61d5779..2a61182ab 100644 --- a/po/fr.po +++ b/po/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ikiwiki\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2007-03-07 01:22-0500\n" +"POT-Creation-Date: 2007-03-07 02:29-0500\n" "PO-Revision-Date: 2007-02-13 13:02+0100\n" "Last-Translator: Jean-Luc Coulon (f5ibh) \n" "Language-Team: French \n" @@ -344,12 +344,7 @@ msgstr "Paramètre d'identification manquant dans le modèle" msgid "sparkline bad width value" msgstr "Échec de lancement de dot par linkmap" -#: ../IkiWiki/Plugin/sparkline.pm:112 -#, fuzzy -msgid "sparkline previewing not implemented" -msgstr "getctime n'est pas implémenté" - -#: ../IkiWiki/Plugin/sparkline.pm:148 +#: ../IkiWiki/Plugin/sparkline.pm:144 #, fuzzy msgid "sparkline failed to run php" msgstr "Échec de lancement de dot par linkmap" @@ -514,3 +509,7 @@ msgid "%s preprocessing loop detected on %s at depth %i" msgstr "" "%s une boucle a été détectée dans le prétraitement de %s, à la profondeur de " "%i" + +#, fuzzy +#~ msgid "sparkline previewing not implemented" +#~ msgstr "getctime n'est pas implémenté" diff --git a/po/gu.po b/po/gu.po index bcec055fa..53914d1b1 100644 --- a/po/gu.po +++ b/po/gu.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ikiwiki-gu\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2007-03-07 01:22-0500\n" +"POT-Creation-Date: 2007-03-07 02:29-0500\n" "PO-Revision-Date: 2007-01-11 16:05+0530\n" "Last-Translator: Kartik Mistry \n" "Language-Team: Gujarati \n" @@ -337,12 +337,7 @@ msgstr "ટેમ્પલેટને આઇડી વિકલ્પ મળત msgid "sparkline bad width value" msgstr "લીંકમેપ ડોટ ચલાવવામાં નિષ્ફળ" -#: ../IkiWiki/Plugin/sparkline.pm:112 -#, fuzzy -msgid "sparkline previewing not implemented" -msgstr "getctime અમલમાં મૂકાયેલ નથી" - -#: ../IkiWiki/Plugin/sparkline.pm:148 +#: ../IkiWiki/Plugin/sparkline.pm:144 #, fuzzy msgid "sparkline failed to run php" msgstr "લીંકમેપ ડોટ ચલાવવામાં નિષ્ફળ" @@ -499,3 +494,7 @@ msgstr "ક્ષતિ" #, perl-format msgid "%s preprocessing loop detected on %s at depth %i" msgstr "%s પર શોધાયેલ લુપ %s પર ચલાવે છે %i ઉંડાણ પર" + +#, fuzzy +#~ msgid "sparkline previewing not implemented" +#~ msgstr "getctime અમલમાં મૂકાયેલ નથી" diff --git a/po/ikiwiki.pot b/po/ikiwiki.pot index 6fb6a901a..f53c6bd4e 100644 --- a/po/ikiwiki.pot +++ b/po/ikiwiki.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2007-03-07 01:22-0500\n" +"POT-Creation-Date: 2007-03-07 02:29-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -334,11 +334,7 @@ msgstr "" msgid "sparkline bad width value" msgstr "" -#: ../IkiWiki/Plugin/sparkline.pm:112 -msgid "sparkline previewing not implemented" -msgstr "" - -#: ../IkiWiki/Plugin/sparkline.pm:148 +#: ../IkiWiki/Plugin/sparkline.pm:144 msgid "sparkline failed to run php" msgstr "" diff --git a/po/pl.po b/po/pl.po index d22f5ee1c..ffbb4b586 100644 --- a/po/pl.po +++ b/po/pl.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: ikiwiki 1.37\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2007-03-07 01:22-0500\n" +"POT-Creation-Date: 2007-03-07 02:29-0500\n" "PO-Revision-Date: 2007-01-05 16:33+100\n" "Last-Translator: Paweł Tęcza \n" "Language-Team: Debian L10n Polish \n" @@ -347,12 +347,7 @@ msgstr "brakujący parametr id we wtyczce template" msgid "sparkline bad width value" msgstr "awaria wtyczki linkmap" -#: ../IkiWiki/Plugin/sparkline.pm:112 -#, fuzzy -msgid "sparkline previewing not implemented" -msgstr "niedostępna funkcja getctime" - -#: ../IkiWiki/Plugin/sparkline.pm:148 +#: ../IkiWiki/Plugin/sparkline.pm:144 #, fuzzy msgid "sparkline failed to run php" msgstr "awaria wtyczki linkmap" @@ -513,3 +508,7 @@ msgstr "Błąd" #, perl-format msgid "%s preprocessing loop detected on %s at depth %i" msgstr "polecenie preprocesora %s wykryte w %s na głębokości %i" + +#, fuzzy +#~ msgid "sparkline previewing not implemented" +#~ msgstr "niedostępna funkcja getctime" diff --git a/po/sv.po b/po/sv.po index e99d17358..8800177f2 100644 --- a/po/sv.po +++ b/po/sv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ikiwiki\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2007-03-07 01:22-0500\n" +"POT-Creation-Date: 2007-03-07 02:29-0500\n" "PO-Revision-Date: 2007-01-10 23:47+0100\n" "Last-Translator: Daniel Nylander \n" "Language-Team: Swedish \n" @@ -339,12 +339,7 @@ msgstr "mall saknar id-parameter" msgid "sparkline bad width value" msgstr "linkmap misslyckades att köra dot" -#: ../IkiWiki/Plugin/sparkline.pm:112 -#, fuzzy -msgid "sparkline previewing not implemented" -msgstr "getctime inte implementerad" - -#: ../IkiWiki/Plugin/sparkline.pm:148 +#: ../IkiWiki/Plugin/sparkline.pm:144 #, fuzzy msgid "sparkline failed to run php" msgstr "linkmap misslyckades att köra dot" @@ -503,3 +498,7 @@ msgstr "Fel" #, perl-format msgid "%s preprocessing loop detected on %s at depth %i" msgstr "%s förbehandlingsslinga detekterades på %s, djup %i" + +#, fuzzy +#~ msgid "sparkline previewing not implemented" +#~ msgstr "getctime inte implementerad" diff --git a/po/vi.po b/po/vi.po index 93527efaf..ea96c3d88 100644 --- a/po/vi.po +++ b/po/vi.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: ikiwiki\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2007-03-07 01:22-0500\n" +"POT-Creation-Date: 2007-03-07 02:29-0500\n" "PO-Revision-Date: 2007-01-13 15:31+1030\n" "Last-Translator: Clytie Siddall \n" "Language-Team: Vietnamese \n" @@ -340,12 +340,7 @@ msgstr "mẫu thiếu tham số id" msgid "sparkline bad width value" msgstr "linkmap không chạy dot được" -#: ../IkiWiki/Plugin/sparkline.pm:112 -#, fuzzy -msgid "sparkline previewing not implemented" -msgstr "chưa thực hiện getctime" - -#: ../IkiWiki/Plugin/sparkline.pm:148 +#: ../IkiWiki/Plugin/sparkline.pm:144 #, fuzzy msgid "sparkline failed to run php" msgstr "linkmap không chạy dot được" @@ -504,3 +499,7 @@ msgstr "Lỗi" #, perl-format msgid "%s preprocessing loop detected on %s at depth %i" msgstr "vòng lặp tiền xử lý %s được phát hiện trên %s ở độ sâu %i" + +#, fuzzy +#~ msgid "sparkline previewing not implemented" +#~ msgstr "chưa thực hiện getctime"