diff options
author | Iván Eixarch <miao.org@gmail.com> | 2012-12-03 01:39:59 +0100 |
---|---|---|
committer | Iván Eixarch <miao.org@gmail.com> | 2012-12-03 01:39:59 +0100 |
commit | 657322db91a38067a5ecc375e01d4886844abec6 (patch) | |
tree | f8417a1564484ae7b931897cd6c91657835af327 /src/static/js | |
parent | 97d77ea089c75fc64fef94b9259674d738a930cb (diff) | |
parent | 8a9045b3358ea6b60cdb7d9d8e19ed0cb545d950 (diff) | |
download | etherpad-lite-657322db91a38067a5ecc375e01d4886844abec6.zip |
fixed git merge confict
Diffstat (limited to 'src/static/js')
-rw-r--r-- | src/static/js/ace2_inner.js | 18 | ||||
-rw-r--r-- | src/static/js/broadcast.js | 28 | ||||
-rw-r--r-- | src/static/js/broadcast_slider.js | 6 |
3 files changed, 36 insertions, 16 deletions
diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index 661ea011..87132603 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -333,14 +333,6 @@ function Ace2Inner(){ return colorutils.triple2css(color); } - function doAlert(str) - { - scheduler.setTimeout(function() - { - alert(str); - }, 0); - } - editorInfo.ace_getRep = function() { return rep; @@ -1624,7 +1616,7 @@ function Ace2Inner(){ if (linesWrapped > 0) { - doAlert("Editor warning: " + linesWrapped + " long line" + (linesWrapped == 1 ? " was" : "s were") + " hard-wrapped into " + ccData.numLinesAfter + " lines."); + // console.log("Editor warning: " + linesWrapped + " long line" + (linesWrapped == 1 ? " was" : "s were") + " hard-wrapped into " + ccData.numLinesAfter + " lines."); } if (ss[0] >= 0) selStart = [ss[0] + a + netNumLinesChangeSoFar, ss[1]]; @@ -3569,7 +3561,6 @@ function Ace2Inner(){ inCallStackIfNecessary("handleKeyEvent", function() { - if (type == "keypress" || (isTypeForSpecialKey && keyCode == 13 /*return*/ )) { // in IE, special keys don't send keypress, the keydown does the action @@ -3583,7 +3574,6 @@ function Ace2Inner(){ { outsideKeyDown(evt); } - if (!stopped) { var specialHandledInHook = hooks.callAll('aceKeyEvent', { @@ -3622,6 +3612,12 @@ function Ace2Inner(){ }, 0); specialHandled = true; } + if ((!specialHandled) && isTypeForCmdKey && String.fromCharCode(which).toLowerCase() == "s" && (evt.metaKey || evt.ctrlKey)) /* Do a saved revision on ctrl S */ + { + evt.preventDefault(); + parent.parent.pad.collabClient.sendMessage({"type":"SAVE_REVISION"}); /* The parent.parent part of this is BAD and I feel bad.. It may break something */ + specialHandled = true; + } if ((!specialHandled) && isTypeForSpecialKey && keyCode == 9 && !(evt.metaKey || evt.ctrlKey)) { // tab diff --git a/src/static/js/broadcast.js b/src/static/js/broadcast.js index 86e63f93..d67398fb 100644 --- a/src/static/js/broadcast.js +++ b/src/static/js/broadcast.js @@ -304,7 +304,14 @@ function loadBroadcastJS(socket, sendSocketMsg, fireWhenAllScriptsAreLoaded, Bro var hours = zpad(date.getHours(), 2); var minutes = zpad(date.getMinutes(), 2); var seconds = zpad(date.getSeconds(), 2); - return ([month, '/', day, '/', year, ' ', hours, ':', minutes, ':', seconds].join("")); + return (document.webL10n.get("timeslider.dateformat", { + "day": day, + "month": month, + "year": year, + "hours": hours, + "minutes": minutes, + "seconds": seconds + })); } @@ -313,7 +320,24 @@ function loadBroadcastJS(socket, sendSocketMsg, fireWhenAllScriptsAreLoaded, Bro $('#timer').html(dateFormat()); - var revisionDate = ["Saved", ["Jan", "Feb", "March", "April", "May", "June", "July", "Aug", "Sept", "Oct", "Nov", "Dec"][date.getMonth()], date.getDate() + ",", date.getFullYear()].join(" ") + var revisionDate = document.webL10n.get("timeslider.saved", { + "day": date.getDate(), + "month": [ + document.webL10n.get("timeslider.month.january"), + document.webL10n.get("timeslider.month.february"), + document.webL10n.get("timeslider.month.march"), + document.webL10n.get("timeslider.month.april"), + document.webL10n.get("timeslider.month.may"), + document.webL10n.get("timeslider.month.june"), + document.webL10n.get("timeslider.month.july"), + document.webL10n.get("timeslider.month.august"), + document.webL10n.get("timeslider.month.september"), + document.webL10n.get("timeslider.month.october"), + document.webL10n.get("timeslider.month.november"), + document.webL10n.get("timeslider.month.december") + ][date.getMonth()], + "year": date.getFullYear() + }); $('#revision_date').html(revisionDate) } diff --git a/src/static/js/broadcast_slider.js b/src/static/js/broadcast_slider.js index fed9f2e7..a597c926 100644 --- a/src/static/js/broadcast_slider.js +++ b/src/static/js/broadcast_slider.js @@ -112,7 +112,7 @@ function loadBroadcastSliderJS(fireWhenAllScriptsAreLoaded) { $(this).attr('href', $(this).attr('thref').replace("%revision%", newpos)); }); - $("#revision_label").html("Version " + newpos); + $("#revision_label").html(document.webL10n.get("timeslider.version", { "version": newpos})); if (newpos == 0) { @@ -215,7 +215,7 @@ function loadBroadcastSliderJS(fireWhenAllScriptsAreLoaded) } if (authors.length == 0) { - authorsList.append("No Authors"); + authorsList.append(document.webL10n.get("timeslider.toolbar.authorsList")); } fixPadHeight(); @@ -346,7 +346,7 @@ function loadBroadcastSliderJS(fireWhenAllScriptsAreLoaded) var newloc = self.currentLoc + (evt2.clientX - self.startLoc); if (newloc < 0) newloc = 0; if (newloc > ($("#ui-slider-bar").width() - 2)) newloc = ($("#ui-slider-bar").width() - 2); - $("#revision_label").html("Version " + Math.floor(newloc * sliderLength / ($("#ui-slider-bar").width() - 2))); + $("#revision_label").html(document.webL10n.get("timeslider.version", { "version": Math.floor(newloc * sliderLength / ($("#ui-slider-bar").width() - 2))})); $(self).css('left', newloc); if (getSliderPosition() != Math.floor(newloc * sliderLength / ($("#ui-slider-bar").width() - 2))) _callSliderCallbacks(Math.floor(newloc * sliderLength / ($("#ui-slider-bar").width() - 2))) }); |