diff --git a/swad_changelog.h b/swad_changelog.h index f3b629e0b..aa5e7d952 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -103,11 +103,12 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 14.110.2 (2015/04/09)" +#define Log_PLATFORM_VERSION "SWAD 14.110.3 (2015/04/09)" // Number of lines (includes comments but not blank lines) has been got with the following command: // nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1 /* + Version 14.110.3: Apr 09, 2015 Changes in conversion from Markdown to HTML5 using pandoc. (184599 lines) Version 14.110.2: Apr 09, 2015 Changes in CSS and scripts. MathJax installed in local by default. (184555 lines) 1 change in installation: diff --git a/swad_info.c b/swad_info.c index 705abd0b2..f0cae8fc1 100644 --- a/swad_info.c +++ b/swad_info.c @@ -1015,13 +1015,13 @@ void Inf_FormToEnterIntegratedEditor (Inf_InfoSrc_t InfoSrc,Inf_InfoType_t InfoT void Inf_FormToEnterPlainTextEditor (Inf_InfoSrc_t InfoSrc,Inf_InfoType_t InfoType) { - extern const char *Txt_Edit_text; + extern const char *Txt_Edit_plain_text; /***** Start form *****/ Act_FormStart (Inf_ActionsInfo[InfoSrc][InfoType]); /***** Send button *****/ - Lay_PutConfirmButton (Txt_Edit_text); + Lay_PutConfirmButton (Txt_Edit_plain_text); /***** End form *****/ Act_FormEnd (); @@ -1033,13 +1033,13 @@ void Inf_FormToEnterPlainTextEditor (Inf_InfoSrc_t InfoSrc,Inf_InfoType_t InfoTy void Inf_FormToEnterRichTextEditor (Inf_InfoSrc_t InfoSrc,Inf_InfoType_t InfoType) { - extern const char *Txt_Edit_text; + extern const char *Txt_Edit_rich_text; /***** Start form *****/ Act_FormStart (Inf_ActionsInfo[InfoSrc][InfoType]); /***** Send button *****/ - Lay_PutConfirmButton (Txt_Edit_text); + Lay_PutConfirmButton (Txt_Edit_rich_text); /***** End form *****/ Act_FormEnd (); @@ -1632,7 +1632,8 @@ static void Inf_ShowRichTxtInfo (Inf_InfoType_t InfoType) char PathFileHTML[PATH_MAX+1]; FILE *FileMD; // Temporary Markdown file FILE *FileHTML; // Temporary HTML file - char Command[512+PATH_MAX*2]; // Command to call the program of preprocessing of photos + char MathJaxURL[PATH_MAX]; + char Command[512+PATH_MAX*3]; // Command to call the program of preprocessing of photos int ReturnCode; /***** Get info text from database *****/ @@ -1673,11 +1674,25 @@ static void Inf_ShowRichTxtInfo (Inf_InfoType_t InfoType) fclose (FileMD); /***** Convert from Markdown to HTML *****/ - sprintf (Command,"iconv -f ISO-8859-1 -t UTF-8 %s" - " | pandoc --mathjax -f markdown -t html" - " | iconv -f UTF-8 -t ISO-8859-1 -o %s", - PathFileMD, - PathFileHTML); +#ifdef Cfg_MATHJAX_LOCAL + // Use the local copy of MathJax + sprintf (MathJaxURL,"=%s/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML", + Cfg_HTTPS_URL_SWAD_PUBLIC); +#else + // Use the MathJax Content Delivery Network (CDN) + MathJaxURL[0] = '\0'; +#endif + // --ascii uses only ascii characters in output + // (uses numerical entities instead of UTF-8) + // is mandatory in order to convert (with iconv) the UTF-8 output of pandoc to WINDOWS-1252 + sprintf (Command,"iconv -f WINDOWS-1252 -t UTF-8 %s" + " | " + "pandoc --ascii --mathjax%s -f markdown -t html5" + " | " + "iconv -f UTF-8 -t WINDOWS-1252 -o %s", + PathFileMD, + MathJaxURL, + PathFileHTML); ReturnCode = system (Command); if (ReturnCode == -1) Lay_ShowErrorAndExit ("Error when running command to convert from Markdown to HTML."); @@ -1688,7 +1703,7 @@ static void Inf_ShowRichTxtInfo (Inf_InfoType_t InfoType) /***** Copy HTML file just created to HTML output *****/ /* Open temporary HTML file for reading */ if ((FileHTML = fopen (PathFileHTML,"rb")) == NULL) - Lay_ShowErrorAndExit ("Can not open temporary Markdown file."); + Lay_ShowErrorAndExit ("Can not open temporary HTML file."); /* Copy from temporary HTML file to output file */ Fil_FastCopyOfOpenFiles (FileHTML,Gbl.F.Out); @@ -1826,7 +1841,7 @@ void Inf_EditPlainTxtInfo (void) /***** Edition area *****/ fprintf (Gbl.F.Out,"" "" - "" "" @@ -1847,24 +1862,15 @@ void Inf_EditPlainTxtInfo (void) void Inf_EditRichTxtInfo (void) { - extern const char *Txt_The_rich_text_editor_is_not_yet_available; + extern const char *Txt_INFO_TITLE[Inf_NUM_INFO_TYPES]; + extern const char *Txt_RICH_TEXT_EDITOR_HELP; extern const char *Txt_Save; Inf_InfoType_t InfoType = Inf_AsignInfoType (); char TxtHTML[Cns_MAX_BYTES_LONG_TEXT+1]; - /***** Under test... *****/ - if (Gbl.Usrs.Me.LoggedRole != Rol_SYS_ADM) // TODO: Remove this when rich text editor is available - { - Lay_ShowAlert (Lay_WARNING,Txt_The_rich_text_editor_is_not_yet_available); - - /***** Show again the form to select and send course info *****/ - Inf_FormsToSelSendInfo (); - return; - } - /***** Start table *****/ Act_FormStart (Inf_ActionsRcvRchTxtInfo[InfoType]); - Lay_StartRoundFrameTable10 (NULL,0,NULL); + Lay_StartRoundFrameTable10 (NULL,0,Txt_INFO_TITLE[InfoType]); if (InfoType == Inf_INTRODUCTION || InfoType == Inf_TEACHING_GUIDE) @@ -1875,8 +1881,9 @@ void Inf_EditRichTxtInfo (void) /***** Edition area *****/ fprintf (Gbl.F.Out,"" - "" - "" "" diff --git a/swad_text.c b/swad_text.c index 9b79a7f37..7bdc45811 100644 --- a/swad_text.c +++ b/swad_text.c @@ -9288,25 +9288,46 @@ const char *Txt_Edit_survey = "Editar inquérito"; #endif -const char *Txt_Edit_text = +const char *Txt_Edit_plain_text = #if L==0 - "Editar text"; + "Editar text sense format"; #elif L==1 - "Text bearbeiten"; + "Plain Text bearbeiten"; #elif L==2 - "Edit text"; + "Edit plain text"; #elif L==3 - "Editar texto"; + "Editar texto sin formato"; #elif L==4 - "Éditer texte"; + "Éditer texte simple"; #elif L==5 - "Editar texto"; // Okoteve traducción + "Editar texto sin formato"; // Okoteve traducción #elif L==6 - "Editare testo"; + "Editare testo normale"; #elif L==7 - "Edycja tekstu"; + "Edycja tekstu zwykły"; #elif L==8 - "Editar texto"; + "Editar texto simples"; +#endif + +const char *Txt_Edit_rich_text = +#if L==0 + "Editar text enriquit"; +#elif L==1 + "Rich Text bearbeiten"; +#elif L==2 + "Edit rich text"; +#elif L==3 + "Editar texto enriquecido"; +#elif L==4 + "Éditer texte enrichi"; +#elif L==5 + "Editar texto enriquecido"; // Okoteve traducción +#elif L==6 + "Editare testo formattato"; +#elif L==7 + "Edycja tekstu sformatowany"; +#elif L==8 + "Editar texto rico"; #endif const char *Txt_eg_A_B = @@ -14039,21 +14060,21 @@ const char *Txt_INFO_SRC_HELP[Inf_NUM_INFO_SOURCES] = #endif , #if L==0 - "editor de texto plano" // Necessita traduccio + "editor de text sense format" #elif L==1 "Plain Text Editor" #elif L==2 "plain text editor" #elif L==3 - "editor de texto plano" + "editor de texto sin formato" #elif L==4 "éditeur de texte simple" #elif L==5 - "editor de texto plano" // Okoteve traducción + "editor de texto sin formato" // Okoteve traducción #elif L==6 "editor di testo normale" #elif L==7 - "edytor tekstu" + "edytor tekstu zwykły" #elif L==8 "editor de texto simples" #endif @@ -14073,9 +14094,9 @@ const char *Txt_INFO_SRC_HELP[Inf_NUM_INFO_SOURCES] = #elif L==6 "editor di testo formattato" #elif L==7 - "rich text editor" // Potrzebujesz tlumaczenie + "edytor tekstu sformatowany" #elif L==8 - "rich text editor" // Necessita de tradução + "editor de texto rico" #endif , #if L==0 @@ -27664,28 +27685,7 @@ const char *Txt_Quota_exceeded = #elif L==8 "Quota excedida!"; #endif -/* -const char *Txt_Ranking = -#if L==0 - "Rànquing"; -#elif L==1 - "Rang"; -#elif L==2 - "Ranking"; -#elif L==3 - "Ranking"; -#elif L==4 - "Classement"; -#elif L==5 - "Ranking"; // Okoteve traducción -#elif L==6 - "Posto"; -#elif L==7 - "Ranking"; -#elif L==8 - "Posição"; -#endif -*/ + const char *Txt_ReaBRders = #if L==0 "Lec-
tores"; // Necessita traduccio @@ -29693,6 +29693,63 @@ const char *Txt_Retype_password = "Redigite a senha"; #endif +const char *Txt_RICH_TEXT_EDITOR_HELP = +#if L==0 + "Pot formatar el text usant" + " Markdown." + " A més pot escriure fórmules en" + " LaTeX" + " entre dues $ o dues $$."; +#elif L==1 + "Sie können den Text zu formatieren mit" + " Markdown." + " Sie können" + " LaTeX" + " Formeln auch zwischen zwei $ oder zwei $$."; +#elif L==2 + "You can format the text using" + " Markdown." + " You can also type" + " LaTeX" + " formulas between two $ or two $$."; +#elif L==3 + "Puede formatear el texto usando" + " Markdown." + " Además puede escribir fórmulas en" + " LaTeX" + " entre dos $ o dos $$."; +#elif L==4 + "Vous pouvez formater le texte en utilisant" + " Markdown." + " Vous pouvez également taper des formules" + " LaTeX" + " entre deux $ ou deux $$."; +#elif L==5 + "Puede formatear el texto usando" + " Markdown." + " Además puede escribir fórmulas en" + " LaTeX" + " entre dos $ o dos $$."; // Okoteve traducción +#elif L==6 + "È possibile formattare il testo con" + " Markdown." + " È inoltre possibile digitare formule" + " LaTeX" + " tra due $ o due $$."; +#elif L==7 + "Możesz formatować tekst za pomocą" + " Markdown." + " Możesz również wpisać formuły" + " LaTeX" + " między dwoma $ lub dwóch $$."; +#elif L==8 + "Você pode formatar o texto usando" + " Markdown." + " Você também pode digitar fórmulas" + " LaTeX" + " entre duas $ ou duas $$."; +#endif + const char *Txt_Role = #if L==0 "Rol"; @@ -41893,27 +41950,6 @@ const char *Txt_The_requested_group_changes_were_successful = "The requested group changes were successful."; // Necessita de tradução #endif -const char *Txt_The_rich_text_editor_is_not_yet_available = -#if L==0 - "L'editor de text enriquit encara no està disponible."; -#elif L==1 - "Der Rich Text Editor ist noch nicht verfügbar."; -#elif L==2 - "The rich text editor is not yet available."; -#elif L==3 - "El editor de texto enriquecido aún no está disponible."; -#elif L==4 - "L'éditeur de texte riche n'est pas encore disponible."; -#elif L==5 - "El editor de texto enriquecido aún no está disponible."; // Okoteve traducción -#elif L==6 - "Il rich text editor non è ancora disponibile."; -#elif L==7 - "Edytor tekstu nie jest jeszcze dostępna."; -#elif L==8 - "O editor de texto rico ainda não está disponível."; -#endif - const char *Txt_The_role_of_THE_USER_X_in_the_course_Y_has_changed_from_A_to_B = // Warning: it is very important to include four %s in the following sentences #if L==0 "El rol de %s"