This commit is contained in:
Fabian Jakobs 2012-04-12 13:00:29 +02:00
commit f78d711099
7 changed files with 163 additions and 154 deletions

View file

@ -507,6 +507,7 @@ var showGutterEl = document.getElementById("show_gutter");
var showPrintMarginEl = document.getElementById("show_print_margin");
var highlightSelectedWordE = document.getElementById("highlight_selected_word");
var showHScrollEl = document.getElementById("show_hscroll");
var animateScrollEl = document.getElementById("animate_scroll");
var softTabEl = document.getElementById("soft_tab");
var behavioursEl = document.getElementById("enable_behaviours");
@ -563,6 +564,7 @@ function updateUIEditorOptions() {
showPrintMarginEl.checked = editor.renderer.getShowPrintMargin();
highlightSelectedWordE.checked = editor.getHighlightSelectedWord();
showHScrollEl.checked = editor.renderer.getHScrollBarAlwaysVisible();
animateScrollEl.checked = editor.getAnimatedScroll();
softTabEl.checked = session.getUseSoftTabs();
behavioursEl.checked = editor.getBehavioursEnabled();
}
@ -646,6 +648,10 @@ bindCheckbox("show_hscroll", function(checked) {
env.editor.renderer.setHScrollBarAlwaysVisible(checked);
});
bindCheckbox("animate_scroll", function(checked) {
env.editor.setAnimatedScroll(checked);
});
bindCheckbox("soft_tab", function(checked) {
env.editor.getSession().setUseSoftTabs(checked);
});
@ -11883,11 +11889,11 @@ var Editor = function(renderer, session) {
this.setAnimatedScroll = function(shouldAnimate){
this.renderer.setAnimatedScroll(shouldAnimate);
}
};
this.getAnimatedScroll = function(){
this.rendered.getAnimatedScroll();
}
this.renderer.getAnimatedScroll();
};
this.setShowInvisibles = function(showInvisibles) {
if (this.getShowInvisibles() == showInvisibles)
@ -14956,11 +14962,11 @@ var VirtualRenderer = function(container, theme) {
this.setAnimatedScroll = function(shouldAnimate){
this.$animatedScroll = shouldAnimate;
}
};
this.getAnimatedscroll = function(){
return this.$animatedScroll
}
this.getAnimatedScroll = function(){
return this.$animatedScroll;
};
this.setShowInvisibles = function(showInvisibles) {
if (this.$textLayer.setShowInvisibles(showInvisibles))
@ -15418,15 +15424,14 @@ var VirtualRenderer = function(container, theme) {
offset -= this.$size.scrollerHeight / 2;
if (this.$animatedScroll && Math.abs(offset - this.scrollTop) < 10000) {
var i = 0;
var _self = this;
var steps = _self.$calcSteps(this.scrollTop, offset);
clearInterval(_self.$timer);
clearInterval(this.$timer);
this.$timer = setInterval(function() {
_self.session.setScrollTop(steps[i]);
_self.session.setScrollTop(steps.shift());
if (++i == this.STEPS + 1)
if (!steps.length)
clearInterval(_self.$timer);
}, 10);
}

View file

@ -11,7 +11,7 @@
Ace
version 0.2.0
commit 101644923eb6b967e51599a659f521e0e3465cf3
commit bdb05e8c07e8545e0d4d8064e77db62cb1135dd0
-->
@ -133,6 +133,13 @@
<input type="checkbox" name="show_hscroll" id="show_hscroll">
</td>
</tr>
<tr>
<td >
<label for="animate_scroll">Animate scrolling</label>
</td><td>
<input type="checkbox" name="animate_scroll" id="animate_scroll">
</td>
</tr>
<tr>
<td >
<label for="keybinding">Key Binding</label>

File diff suppressed because one or more lines are too long

View file

@ -2993,11 +2993,11 @@ var Editor = function(renderer, session) {
this.setAnimatedScroll = function(shouldAnimate){
this.renderer.setAnimatedScroll(shouldAnimate);
}
};
this.getAnimatedScroll = function(){
this.rendered.getAnimatedScroll();
}
this.renderer.getAnimatedScroll();
};
this.setShowInvisibles = function(showInvisibles) {
if (this.getShowInvisibles() == showInvisibles)
@ -12147,11 +12147,11 @@ var VirtualRenderer = function(container, theme) {
this.setAnimatedScroll = function(shouldAnimate){
this.$animatedScroll = shouldAnimate;
}
};
this.getAnimatedscroll = function(){
return this.$animatedScroll
}
this.getAnimatedScroll = function(){
return this.$animatedScroll;
};
this.setShowInvisibles = function(showInvisibles) {
if (this.$textLayer.setShowInvisibles(showInvisibles))
@ -12609,15 +12609,14 @@ var VirtualRenderer = function(container, theme) {
offset -= this.$size.scrollerHeight / 2;
if (this.$animatedScroll && Math.abs(offset - this.scrollTop) < 10000) {
var i = 0;
var _self = this;
var steps = _self.$calcSteps(this.scrollTop, offset);
clearInterval(_self.$timer);
clearInterval(this.$timer);
this.$timer = setInterval(function() {
_self.session.setScrollTop(steps[i]);
_self.session.setScrollTop(steps.shift());
if (++i == this.STEPS + 1)
if (!steps.length)
clearInterval(_self.$timer);
}, 10);
}

View file

@ -2993,11 +2993,11 @@ var Editor = function(renderer, session) {
this.setAnimatedScroll = function(shouldAnimate){
this.renderer.setAnimatedScroll(shouldAnimate);
}
};
this.getAnimatedScroll = function(){
this.rendered.getAnimatedScroll();
}
this.renderer.getAnimatedScroll();
};
this.setShowInvisibles = function(showInvisibles) {
if (this.getShowInvisibles() == showInvisibles)
@ -12147,11 +12147,11 @@ var VirtualRenderer = function(container, theme) {
this.setAnimatedScroll = function(shouldAnimate){
this.$animatedScroll = shouldAnimate;
}
};
this.getAnimatedscroll = function(){
return this.$animatedScroll
}
this.getAnimatedScroll = function(){
return this.$animatedScroll;
};
this.setShowInvisibles = function(showInvisibles) {
if (this.$textLayer.setShowInvisibles(showInvisibles))
@ -12609,15 +12609,14 @@ var VirtualRenderer = function(container, theme) {
offset -= this.$size.scrollerHeight / 2;
if (this.$animatedScroll && Math.abs(offset - this.scrollTop) < 10000) {
var i = 0;
var _self = this;
var steps = _self.$calcSteps(this.scrollTop, offset);
clearInterval(_self.$timer);
clearInterval(this.$timer);
this.$timer = setInterval(function() {
_self.session.setScrollTop(steps[i]);
_self.session.setScrollTop(steps.shift());
if (++i == this.STEPS + 1)
if (!steps.length)
clearInterval(_self.$timer);
}, 10);
}

File diff suppressed because one or more lines are too long

View file

@ -3560,11 +3560,11 @@ var Editor = function(renderer, session) {
this.setAnimatedScroll = function(shouldAnimate){
this.renderer.setAnimatedScroll(shouldAnimate);
}
};
this.getAnimatedScroll = function(){
this.rendered.getAnimatedScroll();
}
this.renderer.getAnimatedScroll();
};
this.setShowInvisibles = function(showInvisibles) {
if (this.getShowInvisibles() == showInvisibles)
@ -12653,11 +12653,11 @@ var VirtualRenderer = function(container, theme) {
this.setAnimatedScroll = function(shouldAnimate){
this.$animatedScroll = shouldAnimate;
}
};
this.getAnimatedscroll = function(){
return this.$animatedScroll
}
this.getAnimatedScroll = function(){
return this.$animatedScroll;
};
this.setShowInvisibles = function(showInvisibles) {
if (this.$textLayer.setShowInvisibles(showInvisibles))
@ -13115,15 +13115,14 @@ var VirtualRenderer = function(container, theme) {
offset -= this.$size.scrollerHeight / 2;
if (this.$animatedScroll && Math.abs(offset - this.scrollTop) < 10000) {
var i = 0;
var _self = this;
var steps = _self.$calcSteps(this.scrollTop, offset);
clearInterval(_self.$timer);
clearInterval(this.$timer);
this.$timer = setInterval(function() {
_self.session.setScrollTop(steps[i]);
_self.session.setScrollTop(steps.shift());
if (++i == this.STEPS + 1)
if (!steps.length)
clearInterval(_self.$timer);
}, 10);
}