OpenCCM PlugIn für Xinha
Vorschau funktioniert nun auch. (#1206) git-svn-id: https://svn.libreccm.org/ccm/trunk@1816 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
c25dc4fb59
commit
b5a3906a11
|
|
@ -111,7 +111,7 @@
|
|||
-->
|
||||
<input type="hidden" name="[src]" id="[src]"/>
|
||||
|
||||
<fieldset>
|
||||
<fieldset id="[layout]">
|
||||
<legend>
|
||||
<l10n>Layout</l10n>
|
||||
</legend>
|
||||
|
|
@ -146,7 +146,7 @@
|
|||
</div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<fieldset id="[dimensions]">
|
||||
<legend>
|
||||
<l10n>Dimension</l10n>
|
||||
</legend>
|
||||
|
|
|
|||
|
|
@ -87,14 +87,7 @@ OpenCCM.prototype.prepareImageDialog = function()
|
|||
// OnResize
|
||||
this.dialogs["images"].onresize = function ()
|
||||
{
|
||||
var newHeightForPreview =
|
||||
parseInt(this.height, 10)
|
||||
// - this.getElementById("h1").offsetHeight
|
||||
// - this.getElementById("buttons").offsetHeight
|
||||
// - this.getElementById("inputs").offsetHeight
|
||||
- parseInt(this.rootElem.style.paddingBottom, 10);
|
||||
this.getElementById("preview").style.height = ((newHeightForPreview > 0) ? newHeightForPreview : 0) + "px";
|
||||
this.getElementById("preview").style.width = "98%";
|
||||
self.resizePreview(this);
|
||||
};
|
||||
|
||||
this.imageDialogReady = true;
|
||||
|
|
@ -299,19 +292,32 @@ OpenCCM.prototype.imageBrowse = function(window)
|
|||
|
||||
OpenCCM.prototype.imageSet = function(imageData)
|
||||
{
|
||||
var dialog = this.dialogs["images"];
|
||||
var dialog = this.dialogs["images"]
|
||||
dialog.getElementById(dialog.id["src"]).value = imageData.src;
|
||||
dialog.getElementById(dialog.id["ipreview"]).src = imageData.src;
|
||||
dialog.getElementById(dialog.id["width"]).value = imageData.width;
|
||||
dialog.getElementById(dialog.id["height"]).value = imageData.height;
|
||||
dialog.getElementById(dialog.id["name"]).value = imageData.name;
|
||||
dialog.getElementById(dialog.id["aspect"]).value = dialog.getElementById(dialog.id["width"]).value / dialog.getElementById(dialog.id["height"]).value;
|
||||
|
||||
this.resizePreview(dialog);
|
||||
|
||||
if(imageData.src != "")
|
||||
{
|
||||
dialog.getElementById(dialog.id["preview"]).style.display = "block";
|
||||
} else {
|
||||
dialog.getElementById(dialog.id["preview"]).style.display = "none";
|
||||
}
|
||||
};
|
||||
|
||||
OpenCCM.prototype.resizePreview = function(dialog) {
|
||||
var aspect = dialog.getElementById(dialog.id["aspect"]).value;
|
||||
var previewWidth = dialog.width - 22;
|
||||
|
||||
dialog.getElementById(dialog.id["ipreview"]).style.height = Math.round(previewWidth / aspect) + "px";
|
||||
dialog.getElementById(dialog.id["ipreview"]).style.width = previewWidth + "px";
|
||||
};
|
||||
|
||||
OpenCCM.prototype.calcWidth = function()
|
||||
{
|
||||
var dialog = this.dialogs["images"];
|
||||
|
|
|
|||
Loading…
Reference in New Issue