From f185ffa2574e7687620e0cdeb8449d480504d0fa Mon Sep 17 00:00:00 2001 From: Steve Fryatt Date: Sat, 15 Dec 2012 16:59:00 +0000 Subject: [PATCH] Add Enable Javascript configuration to RO GUI. --- riscos/configure/con_content.c | 9 +++++++++ riscos/templates/de | 30 ++++++++++++++++++++---------- riscos/templates/en | 30 ++++++++++++++++++++---------- riscos/templates/fr | 30 ++++++++++++++++++++---------- riscos/templates/nl | 30 ++++++++++++++++++++---------- 5 files changed, 89 insertions(+), 40 deletions(-) diff --git a/riscos/configure/con_content.c b/riscos/configure/con_content.c index a8e9f78b4..81537bcef 100644 --- a/riscos/configure/con_content.c +++ b/riscos/configure/con_content.c @@ -35,6 +35,7 @@ #define CONTENT_DEFAULT_BUTTON 8 #define CONTENT_CANCEL_BUTTON 9 #define CONTENT_OK_BUTTON 10 +#define CONTENT_NO_JAVASCRIPT 11 static void ro_gui_options_content_default(wimp_pointer *pointer); static bool ro_gui_options_content_ok(wimp_w w); @@ -50,12 +51,15 @@ bool ro_gui_options_content_initialise(wimp_w w) nsoption_bool(no_plugins)); ro_gui_set_icon_selected_state(w, CONTENT_TARGET_BLANK, nsoption_bool(target_blank)); + ro_gui_set_icon_selected_state(w, CONTENT_NO_JAVASCRIPT, + !nsoption_bool(enable_javascript)); /* initialise all functions for a newly created window */ ro_gui_wimp_event_register_checkbox(w, CONTENT_BLOCK_ADVERTISEMENTS); ro_gui_wimp_event_register_checkbox(w, CONTENT_BLOCK_POPUPS); ro_gui_wimp_event_register_checkbox(w, CONTENT_NO_PLUGINS); ro_gui_wimp_event_register_checkbox(w, CONTENT_TARGET_BLANK); + ro_gui_wimp_event_register_checkbox(w, CONTENT_NO_JAVASCRIPT); ro_gui_wimp_event_register_button(w, CONTENT_DEFAULT_BUTTON, ro_gui_options_content_default); ro_gui_wimp_event_register_cancel(w, CONTENT_CANCEL_BUTTON); @@ -78,6 +82,8 @@ void ro_gui_options_content_default(wimp_pointer *pointer) false); ro_gui_set_icon_selected_state(pointer->w, CONTENT_TARGET_BLANK, true); + ro_gui_set_icon_selected_state(pointer->w, CONTENT_NO_JAVASCRIPT, + false); } bool ro_gui_options_content_ok(wimp_w w) @@ -93,6 +99,9 @@ bool ro_gui_options_content_ok(wimp_w w) nsoption_set_bool(target_blank, ro_gui_get_icon_selected_state(w, CONTENT_TARGET_BLANK)); + nsoption_set_bool(enable_javascript, + !ro_gui_get_icon_selected_state(w, CONTENT_NO_JAVASCRIPT)); + ro_gui_save_options(); return true; } diff --git a/riscos/templates/de b/riscos/templates/de index ed26c7d6b..ce028ca49 100644 --- a/riscos/templates/de +++ b/riscos/templates/de @@ -3794,7 +3794,7 @@ wimp_window { wimp_window { template_name:"con_content" - visible:236,800,876,1252 + visible:1404,424,2044,924 xscroll:0 yscroll:0 next:wimp_TOP @@ -3807,7 +3807,7 @@ wimp_window { scroll_inner:wimp_COLOUR_VERY_LIGHT_GREY highlight_bg:wimp_COLOUR_CREAM extra_flags: - extent:0,-452,640,0 + extent:0,-500,640,0 title_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | 0x27000000 work_flags: sprite_area:&1 @@ -3815,7 +3815,7 @@ wimp_window { ymin:452 text_only:"Content" wimp_icon { - extent:16,-220,624,-24 + extent:16,-272,624,-24 icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED icon_esg:0 icon_fg:wimp_COLOUR_BLACK @@ -3855,7 +3855,7 @@ wimp_window { text_and_sprite.validation:"Soptoff,opton" } wimp_icon { - extent:32,-204,496,-160 + extent:32,-256,496,-212 #ifdef WITH_PLUGIN icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_RADIO #else @@ -3869,7 +3869,7 @@ wimp_window { text_and_sprite.validation:"Soptoff,opton" } wimp_icon { - extent:16,-340,624,-248 + extent:16,-384,624,-292 icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED icon_esg:0 icon_fg:wimp_COLOUR_BLACK @@ -3879,7 +3879,7 @@ wimp_window { text.validation:"R4" } wimp_icon { - extent:32,-276,492,-232 + extent:32,-320,492,-276 icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED icon_esg:0 icon_fg:wimp_COLOUR_BLACK @@ -3889,7 +3889,7 @@ wimp_window { text_and_sprite.validation:"" } wimp_icon { - extent:32,-324,612,-280 + extent:32,-368,612,-324 icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_RADIO icon_esg:0 icon_fg:wimp_COLOUR_BLACK @@ -3899,7 +3899,7 @@ wimp_window { text_and_sprite.validation:"Soptoff,opton" } wimp_icon { - extent:24,-424,188,-372 + extent:24,-468,188,-416 icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK icon_esg:0 icon_fg:wimp_COLOUR_BLACK @@ -3909,7 +3909,7 @@ wimp_window { text.validation:"R5,3" } wimp_icon { - extent:256,-424,420,-372 + extent:256,-468,420,-416 icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK icon_esg:0 icon_fg:wimp_COLOUR_BLACK @@ -3919,7 +3919,7 @@ wimp_window { text.validation:"R5,3" } wimp_icon { - extent:436,-432,620,-364 + extent:436,-476,620,-408 icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK icon_esg:0 icon_fg:wimp_COLOUR_BLACK @@ -3928,4 +3928,14 @@ wimp_window { text.size:4 text.validation:"R6,3" } + wimp_icon { + extent:32,-204,376,-160 + icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_RADIO + icon_esg:0 + icon_fg:wimp_COLOUR_BLACK + icon_bg:wimp_COLOUR_VERY_LIGHT_GREY + text_and_sprite.text:"Disable Javascript" + text_and_sprite.size:19 + text_and_sprite.validation:"Soptoff,opton" + } } diff --git a/riscos/templates/en b/riscos/templates/en index 2b91764f9..afcfe5697 100644 --- a/riscos/templates/en +++ b/riscos/templates/en @@ -3386,7 +3386,7 @@ wimp_window { wimp_window { template_name:"con_content" - visible:1248,902,1912,1354 + visible:1248,854,1912,1354 xscroll:0 yscroll:0 next:wimp_TOP @@ -3399,7 +3399,7 @@ wimp_window { scroll_inner:wimp_COLOUR_VERY_LIGHT_GREY highlight_bg:wimp_COLOUR_CREAM extra_flags: - extent:0,-452,664,0 + extent:0,-500,664,0 title_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | 0x27000000 work_flags: sprite_area:&1 @@ -3407,7 +3407,7 @@ wimp_window { ymin:452 text_only:"Content" wimp_icon { - extent:16,-220,644,-24 + extent:16,-272,644,-24 icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED icon_esg:0 icon_fg:wimp_COLOUR_BLACK @@ -3447,7 +3447,7 @@ wimp_window { text_and_sprite.validation:"Soptoff,opton" } wimp_icon { - extent:32,-204,344,-160 + extent:32,-256,344,-212 #ifdef WITH_PLUGIN icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_RADIO #else @@ -3461,7 +3461,7 @@ wimp_window { text_and_sprite.validation:"Soptoff,opton" } wimp_icon { - extent:16,-340,644,-248 + extent:16,-384,644,-292 icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED icon_esg:0 icon_fg:wimp_COLOUR_BLACK @@ -3471,7 +3471,7 @@ wimp_window { text.validation:"R4" } wimp_icon { - extent:32,-276,492,-232 + extent:32,-320,492,-276 icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED icon_esg:0 icon_fg:wimp_COLOUR_BLACK @@ -3481,7 +3481,7 @@ wimp_window { text_and_sprite.validation:"" } wimp_icon { - extent:32,-324,632,-280 + extent:32,-368,632,-324 icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_RADIO icon_esg:0 icon_fg:wimp_COLOUR_BLACK @@ -3491,7 +3491,7 @@ wimp_window { text_and_sprite.validation:"Soptoff,opton" } wimp_icon { - extent:24,-424,188,-372 + extent:24,-468,188,-416 icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK icon_esg:0 icon_fg:wimp_COLOUR_BLACK @@ -3501,7 +3501,7 @@ wimp_window { text.validation:"R5,3" } wimp_icon { - extent:280,-424,444,-372 + extent:280,-468,444,-416 icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK icon_esg:0 icon_fg:wimp_COLOUR_BLACK @@ -3511,7 +3511,7 @@ wimp_window { text.validation:"R5,3" } wimp_icon { - extent:460,-432,644,-364 + extent:460,-476,644,-408 icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK icon_esg:0 icon_fg:wimp_COLOUR_BLACK @@ -3520,6 +3520,16 @@ wimp_window { text.size:* text.validation:"R6,3" } + wimp_icon { + extent:32,-204,376,-160 + icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_RADIO + icon_esg:0 + icon_fg:wimp_COLOUR_BLACK + icon_bg:wimp_COLOUR_VERY_LIGHT_GREY + text_and_sprite.text:"Disable Javascript" + text_and_sprite.size:19 + text_and_sprite.validation:"Soptoff,opton" + } } wimp_window { diff --git a/riscos/templates/fr b/riscos/templates/fr index 4a8cce4c8..464cf6bea 100644 --- a/riscos/templates/fr +++ b/riscos/templates/fr @@ -3020,7 +3020,7 @@ wimp_window { wimp_window { template_name:"con_content" - visible:598,888,1338,1336 + visible:598,836,1350,1336 xscroll:0 yscroll:0 next: @@ -3033,7 +3033,7 @@ wimp_window { scroll_inner:wimp_COLOUR_VERY_LIGHT_GREY highlight_bg:wimp_COLOUR_CREAM extra_flags: - extent:0,-452,752,0 + extent:0,-500,752,0 title_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | 0x27000000 work_flags: sprite_area:&1 @@ -3041,7 +3041,7 @@ wimp_window { ymin:448 text_only:"Contenu" wimp_icon { - extent:16,-220,724,-24 + extent:16,-272,732,-24 icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED icon_esg:0 icon_fg:wimp_COLOUR_BLACK @@ -3081,7 +3081,7 @@ wimp_window { text_and_sprite.validation:"Soptoff,opton" } wimp_icon { - extent:32,-204,404,-160 + extent:32,-256,404,-212 #ifdef WITH_PLUGIN icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_RADIO #else @@ -3095,7 +3095,7 @@ wimp_window { text_and_sprite.validation:"Soptoff,opton" } wimp_icon { - extent:16,-340,724,-248 + extent:16,-384,732,-292 icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED icon_esg:0 icon_fg:wimp_COLOUR_BLACK @@ -3105,7 +3105,7 @@ wimp_window { text.validation:"R4" } wimp_icon { - extent:32,-276,492,-232 + extent:32,-320,492,-276 icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED icon_esg:0 icon_fg:wimp_COLOUR_BLACK @@ -3115,7 +3115,7 @@ wimp_window { text_and_sprite.validation:"" } wimp_icon { - extent:32,-328,716,-280 + extent:32,-372,716,-324 icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_RADIO icon_esg:0 icon_fg:wimp_COLOUR_BLACK @@ -3125,7 +3125,7 @@ wimp_window { text_and_sprite.validation:"Soptoff,opton" } wimp_icon { - extent:24,-424,188,-372 + extent:24,-468,188,-416 icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK icon_esg:0 icon_fg:wimp_COLOUR_BLACK @@ -3135,7 +3135,7 @@ wimp_window { text.validation:"R5,3" } wimp_icon { - extent:368,-424,532,-372 + extent:372,-468,536,-416 icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK icon_esg:0 icon_fg:wimp_COLOUR_BLACK @@ -3145,7 +3145,7 @@ wimp_window { text.validation:"R5,3" } wimp_icon { - extent:540,-432,724,-364 + extent:544,-476,728,-408 icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK icon_esg:0 icon_fg:wimp_COLOUR_BLACK @@ -3154,6 +3154,16 @@ wimp_window { text.size:* text.validation:"R6,3" } + wimp_icon { + extent:32,-204,376,-160 + icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_RADIO + icon_esg:0 + icon_fg:wimp_COLOUR_BLACK + icon_bg:wimp_COLOUR_VERY_LIGHT_GREY + text_and_sprite.text:"Disable Javascript" + text_and_sprite.size:19 + text_and_sprite.validation:"Soptoff,opton" + } } wimp_window { diff --git a/riscos/templates/nl b/riscos/templates/nl index 19dd8430b..da34e44cf 100644 --- a/riscos/templates/nl +++ b/riscos/templates/nl @@ -3394,7 +3394,7 @@ wimp_window { wimp_window { template_name:"con_content" - visible:272,306,912,758 + visible:1632,750,2272,1250 xscroll:0 yscroll:0 next:wimp_TOP @@ -3407,7 +3407,7 @@ wimp_window { scroll_inner:wimp_COLOUR_VERY_LIGHT_GREY highlight_bg:wimp_COLOUR_CREAM extra_flags: - extent:0,-452,640,0 + extent:0,-500,640,0 title_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | 0x27000000 work_flags: sprite_area:&1 @@ -3415,7 +3415,7 @@ wimp_window { ymin:452 text_only:"Inhoud" wimp_icon { - extent:16,-220,624,-24 + extent:16,-272,624,-24 icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED icon_esg:0 icon_fg:wimp_COLOUR_BLACK @@ -3455,7 +3455,7 @@ wimp_window { text_and_sprite.validation:"Soptoff,opton" } wimp_icon { - extent:32,-204,344,-160 + extent:32,-256,344,-212 #ifdef WITH_PLUGIN icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_RADIO #else @@ -3469,7 +3469,7 @@ wimp_window { text_and_sprite.validation:"Soptoff,opton" } wimp_icon { - extent:16,-340,624,-248 + extent:16,-380,624,-288 icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED icon_esg:0 icon_fg:wimp_COLOUR_BLACK @@ -3479,7 +3479,7 @@ wimp_window { text.validation:"R4" } wimp_icon { - extent:32,-276,492,-232 + extent:32,-316,492,-272 icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED icon_esg:0 icon_fg:wimp_COLOUR_BLACK @@ -3489,7 +3489,7 @@ wimp_window { text_and_sprite.validation:"" } wimp_icon { - extent:32,-324,636,-280 + extent:32,-364,636,-320 icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_RADIO icon_esg:0 icon_fg:wimp_COLOUR_BLACK @@ -3499,7 +3499,7 @@ wimp_window { text_and_sprite.validation:"Soptoff,opton" } wimp_icon { - extent:24,-424,188,-372 + extent:24,-464,188,-412 icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK icon_esg:0 icon_fg:wimp_COLOUR_BLACK @@ -3509,7 +3509,7 @@ wimp_window { text.validation:"R5,3" } wimp_icon { - extent:256,-424,420,-372 + extent:256,-464,420,-412 icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK icon_esg:0 icon_fg:wimp_COLOUR_BLACK @@ -3519,7 +3519,7 @@ wimp_window { text.validation:"R5,3" } wimp_icon { - extent:436,-432,620,-364 + extent:436,-472,620,-404 icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK icon_esg:0 icon_fg:wimp_COLOUR_BLACK @@ -3528,6 +3528,16 @@ wimp_window { text.size:* text.validation:"R6,3" } + wimp_icon { + extent:32,-204,376,-160 + icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_RADIO + icon_esg:0 + icon_fg:wimp_COLOUR_BLACK + icon_bg:wimp_COLOUR_VERY_LIGHT_GREY + text_and_sprite.text:"Disable Javascript" + text_and_sprite.size:19 + text_and_sprite.validation:"Soptoff,opton" + } } wimp_window {