Integrated ButtonHelper for FancyBox2
git-svn-id: https://svn.libreccm.org/ccm/trunk@2665 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
1c04f489fe
commit
ebede11827
|
|
@ -81,7 +81,8 @@ public final class AssignedTaskSection extends Section {
|
|||
|
||||
@Override
|
||||
public final boolean isVisible(final PageState state) {
|
||||
return m_facade.workflowState(state, Workflow.INIT) || m_facade.workflowState(state, Workflow.STOPPED);
|
||||
return m_facade.workflowState(state, Workflow.INIT) || m_facade.workflowState(state,
|
||||
Workflow.STOPPED);
|
||||
}
|
||||
|
||||
private class Listener implements ActionListener {
|
||||
|
|
@ -89,7 +90,9 @@ public final class AssignedTaskSection extends Section {
|
|||
public final void actionPerformed(final ActionEvent e) {
|
||||
m_facade.restartWorkflow(e.getPageState());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private class LockLink extends ActionLink {
|
||||
|
|
@ -102,7 +105,8 @@ public final class AssignedTaskSection extends Section {
|
|||
|
||||
@Override
|
||||
public final boolean isVisible(final PageState state) {
|
||||
return m_facade.workflowState(state, Workflow.STARTED) && m_facade.tasksExist(state) && !m_facade.tasksLocked(state);
|
||||
return m_facade.workflowState(state, Workflow.STARTED) && m_facade.tasksExist(state)
|
||||
&& !m_facade.tasksLocked(state);
|
||||
}
|
||||
|
||||
private class Listener implements ActionListener {
|
||||
|
|
@ -110,7 +114,9 @@ public final class AssignedTaskSection extends Section {
|
|||
public final void actionPerformed(final ActionEvent e) {
|
||||
m_facade.lockTasks(e.getPageState());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private class UnlockLink extends ActionLink {
|
||||
|
|
@ -123,7 +129,8 @@ public final class AssignedTaskSection extends Section {
|
|||
|
||||
@Override
|
||||
public final boolean isVisible(final PageState state) {
|
||||
return m_facade.workflowState(state, Workflow.STARTED) && m_facade.tasksExist(state) && m_facade.tasksLocked(state);
|
||||
return m_facade.workflowState(state, Workflow.STARTED) && m_facade.tasksExist(state)
|
||||
&& m_facade.tasksLocked(state);
|
||||
}
|
||||
|
||||
private class Listener implements ActionListener {
|
||||
|
|
@ -131,7 +138,9 @@ public final class AssignedTaskSection extends Section {
|
|||
public final void actionPerformed(final ActionEvent e) {
|
||||
m_facade.unlockTasks(e.getPageState());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private class WorkflowFacade {
|
||||
|
|
@ -156,6 +165,7 @@ public final class AssignedTaskSection extends Section {
|
|||
final ArrayList getTasks(final PageState state) {
|
||||
return (ArrayList) get(state);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
final void restartWorkflow(final PageState state) {
|
||||
|
|
@ -221,6 +231,7 @@ public final class AssignedTaskSection extends Section {
|
|||
return task.getTaskType().getID().equals(CMSTaskType.AUTHOR)
|
||||
|| task.getTaskType().getID().equals(CMSTaskType.EDIT);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected final static GlobalizedMessage gz(final String key) {
|
||||
|
|
@ -230,4 +241,5 @@ public final class AssignedTaskSection extends Section {
|
|||
protected final static String lz(final String key) {
|
||||
return (String) gz(key).localize();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,25 +10,23 @@ OpenCCM.prototype.showImageDialog = function(image)
|
|||
|
||||
var data =
|
||||
{
|
||||
src : "",
|
||||
name : "",
|
||||
alt : "",
|
||||
title : "",
|
||||
width : "",
|
||||
height : "",
|
||||
src: "",
|
||||
name: "",
|
||||
alt: "",
|
||||
title: "",
|
||||
width: "",
|
||||
height: "",
|
||||
caption: "",
|
||||
alignment: "",
|
||||
caption : "",
|
||||
|
||||
alignment : "",
|
||||
caption : "",
|
||||
fancybox : "",
|
||||
|
||||
aspect : ""
|
||||
fancybox: "",
|
||||
aspect: ""
|
||||
};
|
||||
|
||||
if (typeof image == "undefined" )
|
||||
if (typeof image == "undefined")
|
||||
{
|
||||
image = editor.getParentElement();
|
||||
if ( image && image.tagName.toLowerCase() != "img" )
|
||||
if (image && image.tagName.toLowerCase() != "img")
|
||||
{
|
||||
image = null;
|
||||
}
|
||||
|
|
@ -72,7 +70,7 @@ OpenCCM.prototype.showImageDialog = function(image)
|
|||
}
|
||||
else
|
||||
{
|
||||
data.alignment="none";
|
||||
data.alignment = "none";
|
||||
}
|
||||
|
||||
data.fancybox = image.parentNode.getAttribute("class");
|
||||
|
|
@ -96,7 +94,7 @@ OpenCCM.prototype.showImageDialog = function(image)
|
|||
this.dialogs["images"].show(data);
|
||||
|
||||
// If image set, show preview
|
||||
if(data.src != "")
|
||||
if (data.src != "")
|
||||
{
|
||||
this.dialogs["images"].getElementById(this.dialogs["images"].id["ipreview"]).src = data.src;
|
||||
this.resizePreview(this.dialogs["images"]);
|
||||
|
|
@ -116,22 +114,34 @@ OpenCCM.prototype.prepareImageDialog = function()
|
|||
var self = this;
|
||||
var editor = this.editor;
|
||||
|
||||
var dialog = this.dialogs["images"] = new Xinha.Dialog(editor, OpenCCM.imagesHtml, 'Xinha',{width:410})
|
||||
var dialog = this.dialogs["images"] = new Xinha.Dialog(editor, OpenCCM.imagesHtml, 'Xinha', {width: 410})
|
||||
|
||||
// Connect the OK and Cancel buttons
|
||||
dialog.getElementById("ok").onclick = function() {self.imageApply();}
|
||||
dialog.getElementById("remove").onclick = function() { self.imageRemove(); };
|
||||
dialog.getElementById("cancel").onclick = function() { self.dialogs["images"].hide(); };
|
||||
dialog.getElementById("ok").onclick = function() {
|
||||
self.imageApply();
|
||||
}
|
||||
dialog.getElementById("remove").onclick = function() {
|
||||
self.imageRemove();
|
||||
};
|
||||
dialog.getElementById("cancel").onclick = function() {
|
||||
self.dialogs["images"].hide();
|
||||
};
|
||||
|
||||
// Connect the Select button
|
||||
dialog.getElementById("browse").onclick = function() { self.imageBrowse(window); };
|
||||
dialog.getElementById("browse").onclick = function() {
|
||||
self.imageBrowse(window);
|
||||
};
|
||||
|
||||
// Connect onkeyup event handler with dimension filed to recalculate the size according to aspect ratio
|
||||
dialog.getElementById("width").onkeyup = function() { self.calcHeight(); };
|
||||
dialog.getElementById("height").onkeyup = function() { self.calcWidth(); };
|
||||
dialog.getElementById("width").onkeyup = function() {
|
||||
self.calcHeight();
|
||||
};
|
||||
dialog.getElementById("height").onkeyup = function() {
|
||||
self.calcWidth();
|
||||
};
|
||||
|
||||
// OnResize
|
||||
this.dialogs["images"].onresize = function ()
|
||||
this.dialogs["images"].onresize = function()
|
||||
{
|
||||
self.resizeDialog(this);
|
||||
};
|
||||
|
|
@ -150,31 +160,31 @@ OpenCCM.prototype.imageApply = function()
|
|||
|
||||
var imgAttr =
|
||||
{
|
||||
src : "",
|
||||
alt : "",
|
||||
title : "",
|
||||
name : "",
|
||||
width : "",
|
||||
height : ""
|
||||
src: "",
|
||||
alt: "",
|
||||
title: "",
|
||||
name: "",
|
||||
width: "",
|
||||
height: ""
|
||||
};
|
||||
|
||||
var spanAttr =
|
||||
{
|
||||
class : "caption",
|
||||
style : "",
|
||||
class: "caption",
|
||||
style: "",
|
||||
}
|
||||
|
||||
var linkAttr =
|
||||
{
|
||||
href : "",
|
||||
title : "",
|
||||
rel : "",
|
||||
class : ""
|
||||
href: "",
|
||||
title: "",
|
||||
rel: "",
|
||||
class: ""
|
||||
};
|
||||
|
||||
var divAttr =
|
||||
{
|
||||
class : "image"
|
||||
class: "image"
|
||||
};
|
||||
|
||||
// If not all mandatory informations are set
|
||||
|
|
@ -193,13 +203,13 @@ OpenCCM.prototype.imageApply = function()
|
|||
imgAttr.height = values.height;
|
||||
|
||||
// Read form values for caption
|
||||
if(values.caption)
|
||||
if (values.caption)
|
||||
{
|
||||
spanAttr.style = "width:" + imgAttr.width + "px";
|
||||
}
|
||||
|
||||
// Read form values for link
|
||||
if(values.fancybox.value == "imageZoom")
|
||||
if (values.fancybox.value == "imageZoom")
|
||||
{
|
||||
linkAttr.href = values.src;
|
||||
linkAttr.title = values.title;
|
||||
|
|
@ -207,7 +217,7 @@ OpenCCM.prototype.imageApply = function()
|
|||
linkAttr.class = "imageZoom";
|
||||
}
|
||||
|
||||
else if(values.fancybox.value == "imageGallery")
|
||||
else if (values.fancybox.value == "imageGallery")
|
||||
{
|
||||
linkAttr.href = values.src;
|
||||
linkAttr.title = values.title;
|
||||
|
|
@ -216,7 +226,7 @@ OpenCCM.prototype.imageApply = function()
|
|||
}
|
||||
|
||||
// Read form values for div
|
||||
if(values.alignment.value != "")
|
||||
if (values.alignment.value != "")
|
||||
{
|
||||
divAttr.class += " " + values.alignment.value;
|
||||
}
|
||||
|
|
@ -224,13 +234,13 @@ OpenCCM.prototype.imageApply = function()
|
|||
var div;
|
||||
|
||||
// Modify Image
|
||||
if(modifyImage)
|
||||
if (modifyImage)
|
||||
{
|
||||
// Get the parent for img node
|
||||
div = image.parentNode;
|
||||
|
||||
// if the tagname of div is "a"
|
||||
if(div.tagName.toLowerCase() == "a")
|
||||
if (div.tagName.toLowerCase() == "a")
|
||||
{
|
||||
// go up one level to find the real div
|
||||
div = div.parentNode;
|
||||
|
|
@ -251,17 +261,17 @@ OpenCCM.prototype.imageApply = function()
|
|||
}
|
||||
|
||||
// set attributes for div
|
||||
for(var attr in divAttr)
|
||||
for (var attr in divAttr)
|
||||
{
|
||||
div.setAttribute(attr, divAttr[attr]);
|
||||
}
|
||||
|
||||
// the folling has to be done for both cases
|
||||
// insert link, if fancybox features are activated
|
||||
if(values.fancybox.value != "none")
|
||||
if (values.fancybox.value != "none")
|
||||
{
|
||||
link = document.createElement("a");
|
||||
for(var attr in linkAttr)
|
||||
for (var attr in linkAttr)
|
||||
{
|
||||
link.setAttribute(attr, linkAttr[attr]);
|
||||
}
|
||||
|
|
@ -270,11 +280,11 @@ OpenCCM.prototype.imageApply = function()
|
|||
|
||||
// insert the image, obviously
|
||||
var img = document.createElement("img");
|
||||
for(var attr in imgAttr)
|
||||
for (var attr in imgAttr)
|
||||
{
|
||||
img.setAttribute(attr, imgAttr[attr]);
|
||||
}
|
||||
if(values.fancybox.value != "none")
|
||||
if (values.fancybox.value != "none")
|
||||
{
|
||||
link.appendChild(img);
|
||||
}
|
||||
|
|
@ -284,10 +294,10 @@ OpenCCM.prototype.imageApply = function()
|
|||
}
|
||||
|
||||
// insert caption if selected
|
||||
if(values.caption)
|
||||
if (values.caption)
|
||||
{
|
||||
var span = document.createElement("span");
|
||||
for(var attr in spanAttr)
|
||||
for (var attr in spanAttr)
|
||||
{
|
||||
span.setAttribute(attr, spanAttr[attr]);
|
||||
}
|
||||
|
|
@ -297,7 +307,7 @@ OpenCCM.prototype.imageApply = function()
|
|||
}
|
||||
|
||||
// insert new div only if we not modifying an image
|
||||
if(!modifyImage) {
|
||||
if (!modifyImage) {
|
||||
editor.insertNodeAtSelection(div);
|
||||
}
|
||||
|
||||
|
|
@ -315,7 +325,7 @@ OpenCCM.prototype.imageRemove = function()
|
|||
var div = this.image.parentNode;
|
||||
|
||||
// if the tagname of div is "a"
|
||||
if(div.tagName.toLowerCase() == "a")
|
||||
if (div.tagName.toLowerCase() == "a")
|
||||
{
|
||||
// go up one level to find the real div
|
||||
div = div.parentNode;
|
||||
|
|
@ -331,7 +341,7 @@ OpenCCM.prototype.imageBrowse = function(window)
|
|||
{
|
||||
var baseURL = window.location.href;
|
||||
var offset = baseURL.lastIndexOf("/");
|
||||
var destURL = baseURL.slice(0, offset+1) + "image_select.jsp";
|
||||
var destURL = baseURL.slice(0, offset + 1) + "image_select.jsp";
|
||||
|
||||
// var searchDialog = new Xinha.Dialog(this.editor, destURL, '');//,{width:800, height:600}, {'closable':true});
|
||||
// searchDialog.show();
|
||||
|
|
@ -350,7 +360,7 @@ OpenCCM.prototype.imageSet = function(imageData)
|
|||
dialog.getElementById(dialog.id["name"]).value = imageData.name;
|
||||
dialog.getElementById(dialog.id["aspect"]).value = imageData.width / imageData.height;
|
||||
|
||||
if(imageData.src != "")
|
||||
if (imageData.src != "")
|
||||
{
|
||||
// this.resizePreview(dialog);
|
||||
dialog.getElementById(dialog.id["preview"]).style.display = "block";
|
||||
|
|
@ -368,13 +378,13 @@ OpenCCM.prototype._getCombinedComponentHeight = function()
|
|||
dialog.getElementById(dialog.id["layout"]).offsetHeight +
|
||||
dialog.getElementById(dialog.id["dimensions"]).offsetHeight +
|
||||
dialog.getElementById(dialog.id["buttons"]).offsetHeight +
|
||||
parseInt(dialog.rootElem.style.paddingBottom,10) +
|
||||
parseInt(dialog.rootElem.style.paddingBottom, 10) +
|
||||
10;
|
||||
};
|
||||
|
||||
OpenCCM.prototype.resizeDialog = function(dialog)
|
||||
{
|
||||
if(dialog.getElementById(dialog.id["preview"]).style.display == "block")
|
||||
if (dialog.getElementById(dialog.id["preview"]).style.display == "block")
|
||||
{
|
||||
|
||||
|
||||
|
|
@ -400,8 +410,8 @@ OpenCCM.prototype.resizePreview = function(dialog)
|
|||
dialog.getElementById(dialog.id["ipreview"]).style.width = "auto";
|
||||
dialog.getElementById(dialog.id["ipreview"]).style.height = "auto";
|
||||
|
||||
var width = parseInt(dialog.getElementById(dialog.id["ipreview"]).width,10);
|
||||
var height = parseInt(dialog.getElementById(dialog.id["ipreview"]).height,10);
|
||||
var width = parseInt(dialog.getElementById(dialog.id["ipreview"]).width, 10);
|
||||
var height = parseInt(dialog.getElementById(dialog.id["ipreview"]).height, 10);
|
||||
|
||||
// alert("W: " + maxWidth +" "+ width + "H: " + maxHeight +" "+ height);
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
name="ScientificCMS"
|
||||
prettyName="Scientific CMS"
|
||||
version="2.3.0"
|
||||
release="devel-SNAPSHOT-r2620"
|
||||
release="devel-SNAPSHOT-r2664"
|
||||
webxml="sci-web.xml"
|
||||
portletxml="sci-portlet.xml"
|
||||
webapp="libreccm"
|
||||
|
|
|
|||
|
|
@ -73,7 +73,12 @@
|
|||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$("a.imageZoom").fancybox({'type':'image'});
|
||||
$("a.imageGallery").fancybox({'type':'image'});
|
||||
$("a.imageGallery").fancybox({
|
||||
'type': 'image',
|
||||
'helpers': {
|
||||
buttons: {}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<!--
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
<usePageTitle/>
|
||||
</title>
|
||||
<useCSSLoader/>
|
||||
<useJQuery/>
|
||||
<useFancybox/>
|
||||
<useMathJax/>
|
||||
</head>
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
<usePageTitle/>
|
||||
</title>
|
||||
<useCSSLoader/>
|
||||
<useJQuery/>
|
||||
<useFancybox/>
|
||||
<useMathJax/>
|
||||
<useJqueryUi/>
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
<fileset dir="${ccm.tools.lib.dir}" includes="pluto-util-*.jar"/>
|
||||
<fileset dir="${ccm.tools.lib.dir}" includes="pluto-container-*.jar"/>
|
||||
<fileset dir="${ccm.tools.lib.dir}" includes="pluto-container-api-*.jar"/>
|
||||
<fileset dir="${app.server.webapp.dir}/pluto/WEB-INF/lib" includes="**/*.jar"/>
|
||||
<!--<fileset dir="${app.server.webapp.dir}/pluto/WEB-INF/lib" includes="**/*.jar"/>-->
|
||||
<!--
|
||||
<fileset dir="/path/to/commons-logging" includes="**/*.jar"/>
|
||||
<fileset dir="/path/to/castor" includes="**/*.jar"/>
|
||||
|
|
|
|||
Loading…
Reference in New Issue