diff options
author | Matthias Bartelmeß <mba@fourplusone.de> | 2012-04-15 19:25:23 +0200 |
---|---|---|
committer | Matthias Bartelmeß <mba@fourplusone.de> | 2012-04-15 19:25:23 +0200 |
commit | e664320b8ceb734a333c1877a3f358975e55cf33 (patch) | |
tree | fe4c2845345f3d4c02bad7b82dc51366af1a5012 | |
parent | f4fe98265f7dd9c58de1107331ea1e21151cc309 (diff) | |
download | etherpad-lite-e664320b8ceb734a333c1877a3f358975e55cf33.zip |
removed sliderEnabled, supportsSlider clientVars, as they were not used anywhere
-rw-r--r-- | src/node/handler/TimesliderMessageHandler.js | 2 | ||||
-rw-r--r-- | src/static/js/broadcast_slider.js | 123 |
2 files changed, 48 insertions, 77 deletions
diff --git a/src/node/handler/TimesliderMessageHandler.js b/src/node/handler/TimesliderMessageHandler.js index a6cf8f4d..5556efa1 100644 --- a/src/node/handler/TimesliderMessageHandler.js +++ b/src/node/handler/TimesliderMessageHandler.js @@ -155,8 +155,6 @@ function createTimesliderClientVars (padId, callback) var clientVars = { viewId: padId, colorPalette: ["#ffc7c7", "#fff1c7", "#e3ffc7", "#c7ffd5", "#c7ffff", "#c7d5ff", "#e3c7ff", "#ffc7f1", "#ff8f8f", "#ffe38f", "#c7ff8f", "#8fffab", "#8fffff", "#8fabff", "#c78fff", "#ff8fe3", "#d97979", "#d9c179", "#a9d979", "#79d991", "#79d9d9", "#7991d9", "#a979d9", "#d979c1", "#d9a9a9", "#d9cda9", "#c1d9a9", "#a9d9b5", "#a9d9d9", "#a9b5d9", "#c1a9d9", "#d9a9cd"], - sliderEnabled : true, - supportsSlider: true, savedRevisions: [], padIdForUrl: padId, fullWidth: false, diff --git a/src/static/js/broadcast_slider.js b/src/static/js/broadcast_slider.js index a2a15773..1d1f279c 100644 --- a/src/static/js/broadcast_slider.js +++ b/src/static/js/broadcast_slider.js @@ -162,11 +162,8 @@ function loadBroadcastSliderJS(fireWhenAllScriptsAreLoaded) function showReconnectUI() { - if (!clientVars.sliderEnabled || !clientVars.supportsSlider) - { - $("#padmain, #rightbars").css('top', "130px"); - $("#timeslider").show(); - } + $("#padmain, #rightbars").css('top', "130px"); + $("#timeslider").show(); $('#error').show(); } @@ -287,55 +284,52 @@ function loadBroadcastSliderJS(fireWhenAllScriptsAreLoaded) { disableSelection($("#playpause_button")[0]); disableSelection($("#timeslider")[0]); - - if (clientVars.sliderEnabled && clientVars.supportsSlider) + + $(document).keyup(function(e) { - $(document).keyup(function(e) - { - var code = -1; - if (!e) var e = window.event; - if (e.keyCode) code = e.keyCode; - else if (e.which) code = e.which; - - if (code == 37) - { // left - if (!e.shiftKey) - { - setSliderPosition(getSliderPosition() - 1); - } - else - { - var nextStar = 0; // default to first revision in document - for (var i = 0; i < savedRevisions.length; i++) - { - var pos = parseInt(savedRevisions[i].attr('pos')); - if (pos < getSliderPosition() && nextStar < pos) nextStar = pos; - } - setSliderPosition(nextStar); - } + var code = -1; + if (!e) var e = window.event; + if (e.keyCode) code = e.keyCode; + else if (e.which) code = e.which; + + if (code == 37) + { // left + if (!e.shiftKey) + { + setSliderPosition(getSliderPosition() - 1); } - else if (code == 39) + else { - if (!e.shiftKey) + var nextStar = 0; // default to first revision in document + for (var i = 0; i < savedRevisions.length; i++) { - setSliderPosition(getSliderPosition() + 1); + var pos = parseInt(savedRevisions[i].attr('pos')); + if (pos < getSliderPosition() && nextStar < pos) nextStar = pos; } - else + setSliderPosition(nextStar); + } + } + else if (code == 39) + { + if (!e.shiftKey) + { + setSliderPosition(getSliderPosition() + 1); + } + else + { + var nextStar = sliderLength; // default to last revision in document + for (var i = 0; i < savedRevisions.length; i++) { - var nextStar = sliderLength; // default to last revision in document - for (var i = 0; i < savedRevisions.length; i++) - { - var pos = parseInt(savedRevisions[i].attr('pos')); - if (pos > getSliderPosition() && nextStar > pos) nextStar = pos; - } - setSliderPosition(nextStar); + var pos = parseInt(savedRevisions[i].attr('pos')); + if (pos > getSliderPosition() && nextStar > pos) nextStar = pos; } + setSliderPosition(nextStar); } - else if (code == 32) playpause(); - - }); - } + } + else if (code == 32) playpause(); + }); + $(window).resize(function() { updateSliderElements(); @@ -485,37 +479,16 @@ function loadBroadcastSliderJS(fireWhenAllScriptsAreLoaded) $("#revision").css('right', "20px"); $("#revision").css('top', "20px"); } - - - if (clientVars.sliderEnabled) - { - if (clientVars.supportsSlider) - { - $("#timeslider").show(); - setSliderLength(clientVars.totalRevs); - setSliderPosition(clientVars.revNum); - _.each(clientVars.savedRevisions, function(revision) - { - addSavedRevision(revision.revNum, revision); - }) - } - else - { - // slider is not supported - $("#padmain, #rightbars").css('top', "130px"); - $("#timeslider").show(); - $("#error").html("The timeslider feature is not supported on this pad. <a href=\"/ep/about/faq#disabledslider\">Why not?</a>"); - $("#error").show(); - } - } - else + + $("#timeslider").show(); + setSliderLength(clientVars.totalRevs); + setSliderPosition(clientVars.revNum); + + _.each(clientVars.savedRevisions, function(revision) { - if (clientVars.supportsSlider) - { - setSliderLength(clientVars.totalRevs); - setSliderPosition(clientVars.revNum); - } - } + addSavedRevision(revision.revNum, revision); + }) + } }); })(); |