Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Fix Diaporama Left / Right arrows and disabled buttons state.
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Oct 29, 2014
1 parent a1b03a4 commit 6eb2c48
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 21 deletions.
49 changes: 31 additions & 18 deletions core/src/plugins/editor.diaporama/class.Diaporama.js
Expand Up @@ -167,24 +167,36 @@ Class.create("Diaporama", AbstractEditor, {
var text = getBaseName(this.currentFile);// + ' ('+this.sizes.get(this.currentFile).width+' X '+this.sizes.get(this.currentFile).height+')';
this.updateTitle(text);
}.bind(this);
Event.observe(this.zoomInput, "keypress", function(e){
if(e == null) e = window.event;
if(e.keyCode == Event.KEY_RETURN || e.keyCode == Event.KEY_UP || e.keyCode == Event.KEY_DOWN){
if(e.keyCode == Event.KEY_UP || e.keyCode == Event.KEY_DOWN)
{
var crtValue = parseInt(this.zoomInput.value);
var value = (e.keyCode == Event.KEY_UP?(e.shiftKey?crtValue+10:crtValue+1):(e.shiftKey?crtValue-10:crtValue-1));
this.zoomInput.value = value + ' %';
}
var newValue = parseInt(this.zoomInput.value);
newValue = Math.max(this._minZoom, newValue);
newValue = Math.min(this._maxZoom, newValue);
this.setZoomValue(newValue);
this.resizeImage(false);
Event.stop(e);
}
return true;
}.bind(this));
this.zInputObserver = function(e){
if(e == null) e = window.event;
if(e.keyCode == Event.KEY_RETURN || e.keyCode == Event.KEY_UP || e.keyCode == Event.KEY_DOWN){
if(e.keyCode == Event.KEY_UP || e.keyCode == Event.KEY_DOWN)
{
var crtValue = parseInt(this.zoomInput.value);
var value = (e.keyCode == Event.KEY_UP?(e.shiftKey?crtValue+10:crtValue+1):(e.shiftKey?crtValue-10:crtValue-1));
this.zoomInput.value = value + ' %';
}
var newValue = parseInt(this.zoomInput.value);
newValue = Math.max(this._minZoom, newValue);
newValue = Math.min(this._maxZoom, newValue);
this.setZoomValue(newValue);
this.resizeImage(false);
Event.stop(e);
}
return true;
}.bind(this);
Event.observe(this.zoomInput, "keypress", this.zInputObserver);
this.arrowsObserver = function(e){
if(!this.element.visible()) return;
if(e.keyCode == Event.KEY_RIGHT) {
this.next();
this.updateButtons();
} else if(e.keyCode == Event.KEY_LEFT) {
this.previous();
this.updateButtons();
}
}.bind(this);
Event.observe(document, "keydown", this.arrowsObserver);
this.timeInput.observe('change', function(e){
if(this.slideShowPlaying && this.pe){
this.stop();
Expand All @@ -205,6 +217,7 @@ Class.create("Diaporama", AbstractEditor, {
Event.observe(document, "keydown", this.zoomObs);
this.element.observe("editor:close", function(){
Event.stopObserving(document, "keydown", this.zoomObs);
Event.stopObserving(document, "keydown", this.arrowsObserver);
}.bind(this));

this.autoFit = true;
Expand Down
4 changes: 2 additions & 2 deletions core/src/plugins/editor.diaporama/manifest.xml
Expand Up @@ -25,11 +25,11 @@
<input id="zoomValue" type="text" style="text-align: center;width: 40px;height: 16px;padding: 2px;border: 1px solid #222;padding-right: 1px;background-color: #666;color: #fff;margin-top: -2px;"/>
<a href="#" class="icon-screenshot" id="actualSizeButton" style="float: none;padding: 0 !important;margin-top: 0;font-size: 14px;" onclick="return false;"><img width="22" height="22" src="AJXP_THEME_FOLDER/images/actions/22/zoom-original.png" alt="" border="0"><br><span message_id="327">AJXP_MESSAGE[327]</span></a>
</div>
<a href="#" class="icon-arrow-left" access_key="KEY_LEFT" id="prevButton" onclick="return false;"><img width="22" height="22" src="AJXP_THEME_FOLDER/images/actions/22/back_22.png" alt="" border="0"><br><span message_id="178">AJXP_MESSAGE[178]</span></a>
<a href="#" class="icon-arrow-left" id="prevButton" onclick="return false;"><img width="22" height="22" src="AJXP_THEME_FOLDER/images/actions/22/back_22.png" alt="" border="0"><br><span message_id="178">AJXP_MESSAGE[178]</span></a>
<a href="#" class="icon-stop" access_key="s" id="stopButton" onclick="return false;"><img width="22" height="22" src="AJXP_THEME_FOLDER/images/actions/22/player_stop.png" alt="AJXP_MESSAGE[233]" border="0"><br><span message_id="232">AJXP_MESSAGE[232]</span></a>
<input id="time" type="text" value="3 s" style="text-align: center;width: 26px;height: 17px;padding: 0px 2px 2px 2px;background-color: #666;color: #fff;margin: 6px 1px;float: left;border: 1px solid #222;border-radius: 2px;"/>
<a href="#" class="icon-play" access_key="p" id="playButton" onclick="return false;"><img width="22" height="22" src="AJXP_THEME_FOLDER/images/actions/22/player_play.png" alt="AJXP_MESSAGE[231]" border="0"><br><span message_id="230">AJXP_MESSAGE[230]</span></a>
<a href="#" class="icon-arrow-right" access_key="KEY_RIGHT" id="nextButton" onclick="return false;"><img width="22" height="22" src="AJXP_THEME_FOLDER/images/actions/22/forward_22.png" alt="" border="0"><br><span message_id="179">AJXP_MESSAGE[179]</span></a>
<a href="#" class="icon-arrow-right" id="nextButton" onclick="return false;"><img width="22" height="22" src="AJXP_THEME_FOLDER/images/actions/22/forward_22.png" alt="" border="0"><br><span message_id="179">AJXP_MESSAGE[179]</span></a>
</div>
<div style="text-align:center; vertical-align:center;overflow:auto; background-color:rgb(85,85,85);" id="imageContainer">
<div id="imageBorder" style="background-color:transparent;-webkit-box-shadow:rgb(51, 51, 51) 2px 2px 6px;-moz-box-shadow:rgb(51, 51, 51) 2px 2px 6px;box-shadow:rgb(51, 51, 51) 2px 2px 6px;"><img id="mainImage" src=""></div>
Expand Down
3 changes: 3 additions & 0 deletions core/src/plugins/gui.ajax/res/themes/orbit/css/ajaxplorer.css
Expand Up @@ -1642,6 +1642,9 @@ div.editor_header > span.header_label{
.action_bar.floatingBar.icons_only a {
color: white;
}
.action_bar.floatingBar.icons_only a.disabled {
opacity: 0.5;
}

.action_bar span.actionbar_button_label {
cursor: pointer;
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/gui.ajax/res/themes/orbit/css/allz.css

Large diffs are not rendered by default.

0 comments on commit 6eb2c48

Please sign in to comment.