Ticket #8211: 0001-visual-indicator-that-fp-is-active-when-opting-in.patch

File 0001-visual-indicator-that-fp-is-active-when-opting-in.patch, 2.2 KB (added by arlolra, 7 years ago)
  • proxy/options.html

    From bf9ee70c77f1e731468a568dc40d353cc88157e8 Mon Sep 17 00:00:00 2001
    From: Arlo Breault <arlolra@gmail.com>
    Date: Fri, 1 Mar 2013 21:33:58 -0800
    Subject: [PATCH] visual indicator that fp is active when opting in
    
    implements part A of #8211
    ---
     proxy/options.html | 28 ++++++++++++++++++++++++++--
     1 file changed, 26 insertions(+), 2 deletions(-)
    
    diff --git a/proxy/options.html b/proxy/options.html
    index 9caa9e3..98545c1 100644
    a b p { 
    3232button {
    3333        margin: 0px 7px 7px;
    3434}
     35#fp_active {
     36  font-size: 36px;
     37  text-align: center;
     38  padding: 10px 0;
     39  margin: 0;
     40}
     41#fp_active p { display: none; }
     42#fp_active .active { color: green; }
     43#fp_active .inactive { color: red; }
    3544</style>
    3645</head>
    3746<body>
    JavaScript to change your options. 
    5766<div id="setting">
    5867</div>
    5968<div onclick="update_setting_text()" id="buttons" style="display: none;">
    60 <button onclick="set_cookie_allowed()">Yes</button>
    61 <button onclick="set_cookie_disallowed()">No</button>
     69  <button onclick="set_cookie_allowed()">Yes</button>
     70  <button onclick="set_cookie_disallowed()">No</button>
     71  <div id="fp_active">
     72    <!-- order is important here. see show_inactive() -->
     73    <p class="inactive">Flashproxy inactive</p>
     74    <p class="active">Flashproxy active</p>
     75  </div>
    6276</div>
    6377<div id="cookies_disabled" style="display: none;">
    6478<p>
    function read_cookie() { 
    115129    return cookies[COOKIE_NAME];
    116130}
    117131
     132/* Displays large in/active banner */
     133function show_inactive(value) {
     134  var ps = document.getElementById("fp_active").getElementsByTagName("p");
     135  for (var i = 0; i < 2; i++) {
     136    ps[i].style.display = typeof value !== undefined && value === i.toString() ? "block" : "none";
     137  }
     138}
     139
    118140/* Updates the text telling the user what his current setting is.*/
    119141function update_setting_text() {
    120142    var setting = document.getElementById("setting");
    function update_setting_text() { 
    134156                                     "Click yes below to change your setting.</p>";
    135157    }
    136158    setting.innerHTML += "<p>Do you want your browser to act as a proxy?</p>";
     159
     160    show_inactive(value);
    137161}
    138162
    139163window.onload = function () {