Dialog for images plugin
git-svn-id: https://svn.libreccm.org/ccm/trunk@6144 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
ebf8a944b3
commit
3392086eca
|
|
@ -30,13 +30,83 @@ const ImageDialog = function (editor) {
|
||||||
title: "Insert/edit images",
|
title: "Insert/edit images",
|
||||||
body: {
|
body: {
|
||||||
type: "panel",
|
type: "panel",
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
type: "bar",
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
type: "input",
|
type: "input",
|
||||||
name: "file",
|
name: "file",
|
||||||
label: "File",
|
label: "File",
|
||||||
disabled: true
|
disabled: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "button",
|
||||||
|
name: "browse_images",
|
||||||
|
text: "Browse images",
|
||||||
|
onAction: function() {
|
||||||
|
let baseUrl = window.location.href;
|
||||||
|
let offset = baseUrl.lastIndexOf("/");
|
||||||
|
let destUrl = baseUrl.slice(0, offset + 1) + "image_select.jsp";
|
||||||
|
let selectWindow = window.open(
|
||||||
|
destUrl,
|
||||||
|
"_blank",
|
||||||
|
"scrollbars=yes,directories=no,toolbar=no,width=800,height=600,status=no,menubar=no"
|
||||||
|
);
|
||||||
|
window.openCcm = new Object();
|
||||||
|
window.openCcm.imageSet = (selectedImage) => {
|
||||||
|
win
|
||||||
|
.find("#file")
|
||||||
|
.value(selectedImage.src)
|
||||||
|
.fire("change");
|
||||||
|
win
|
||||||
|
.find("#width")
|
||||||
|
.value(selectedImage.width)
|
||||||
|
.fire("change");
|
||||||
|
win
|
||||||
|
.find("#height")
|
||||||
|
.value(selectedImage.height)
|
||||||
|
.fire("change");
|
||||||
|
image_name = selectedImage.name;
|
||||||
|
return true;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "input",
|
||||||
|
name: "alternate",
|
||||||
|
label: "Alternate"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "input",
|
||||||
|
name: "title",
|
||||||
|
label: "Title"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "selectbox",
|
||||||
|
name: "alignment",
|
||||||
|
label: "Alignment",
|
||||||
|
size: 1,
|
||||||
|
items: [
|
||||||
|
{ text: "Not set", value: "" },
|
||||||
|
{ text: "Left", value: "left" },
|
||||||
|
{ text: "Center", value: "center" },
|
||||||
|
{ text: "Right", value: "right" }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "selectbox",
|
||||||
|
name: "fancybox",
|
||||||
|
label: "Fancybox",
|
||||||
|
size: 1,
|
||||||
|
items: [
|
||||||
|
{ text: "None", value: "" },
|
||||||
|
{ text: "Zoom", value: "imageZoom" },
|
||||||
|
{ text: "Gallery", value: "imageGallery" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
buttons: []
|
buttons: []
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue