liquid_feedback_frontend

changeset 949:e616d8f16f14

Force JavaScript test before voting; Removed unneccessary "preview2" mechanism in voting script
author jbe
date Thu Nov 08 20:55:54 2012 +0100 (2012-11-08)
parents bb8b21241dab
children 37e31dd73e45
files app/main/vote/_action/update.lua static/js/voting.js
line diff
     1.1 --- a/app/main/vote/_action/update.lua	Thu Nov 08 15:32:57 2012 +0100
     1.2 +++ b/app/main/vote/_action/update.lua	Thu Nov 08 20:55:54 2012 +0100
     1.3 @@ -3,7 +3,7 @@
     1.4  
     1.5  local issue = Issue:new_selector():add_where{ "id = ?", param.get("issue_id", atom.integer) }:for_share():single_object_mode():exec()
     1.6  
     1.7 -local preview = param.get("preview") or param.get("preview2") == "1" and true or false
     1.8 +local preview = param.get("preview") and true or false
     1.9  
    1.10  if not app.session.member:has_voting_right_for_unit_id(issue.area.unit_id) then
    1.11    error("access denied")
     2.1 --- a/static/js/voting.js	Thu Nov 08 15:32:57 2012 +0100
     2.2 +++ b/static/js/voting.js	Thu Nov 08 20:55:54 2012 +0100
     2.3 @@ -338,18 +338,7 @@
     2.4    window.addEventListener("load", function(event) {
     2.5      jsProtect(function() {
     2.6        voting_setCategoryHeadings();
     2.7 -      // TODO: replace the following code by non-JavaScript HTML attributes
     2.8 -      var elements = document.getElementsByTagName("input");
     2.9 -      for (var i=0; i<elements.length; i++) {
    2.10 -        var element = elements[i];
    2.11 -        if (element.name == "preview") {
    2.12 -          element.addEventListener("click", function(event) {
    2.13 -            jsProtect(function() {
    2.14 -              document.getElementById("preview2").value = "1";
    2.15 -            });
    2.16 -          }, false);
    2.17 -        }
    2.18 -      }
    2.19 +      voting_calculateScoring();  // checks if script works fine
    2.20      });
    2.21    }, false);
    2.22    window.voting_moveUp = function(element) {

Impressum / About Us