Integrated ButtonHelper for FancyBox2

git-svn-id: https://svn.libreccm.org/ccm/trunk@2665 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2014-06-04 10:49:14 +00:00
parent 1c04f489fe
commit ebede11827
7 changed files with 503 additions and 474 deletions

View File

@ -81,7 +81,8 @@ public final class AssignedTaskSection extends Section {
@Override @Override
public final boolean isVisible(final PageState state) { 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 { private class Listener implements ActionListener {
@ -89,7 +90,9 @@ public final class AssignedTaskSection extends Section {
public final void actionPerformed(final ActionEvent e) { public final void actionPerformed(final ActionEvent e) {
m_facade.restartWorkflow(e.getPageState()); m_facade.restartWorkflow(e.getPageState());
} }
} }
} }
private class LockLink extends ActionLink { private class LockLink extends ActionLink {
@ -102,7 +105,8 @@ public final class AssignedTaskSection extends Section {
@Override @Override
public final boolean isVisible(final PageState state) { 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 { private class Listener implements ActionListener {
@ -110,7 +114,9 @@ public final class AssignedTaskSection extends Section {
public final void actionPerformed(final ActionEvent e) { public final void actionPerformed(final ActionEvent e) {
m_facade.lockTasks(e.getPageState()); m_facade.lockTasks(e.getPageState());
} }
} }
} }
private class UnlockLink extends ActionLink { private class UnlockLink extends ActionLink {
@ -123,7 +129,8 @@ public final class AssignedTaskSection extends Section {
@Override @Override
public final boolean isVisible(final PageState state) { 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 { private class Listener implements ActionListener {
@ -131,7 +138,9 @@ public final class AssignedTaskSection extends Section {
public final void actionPerformed(final ActionEvent e) { public final void actionPerformed(final ActionEvent e) {
m_facade.unlockTasks(e.getPageState()); m_facade.unlockTasks(e.getPageState());
} }
} }
} }
private class WorkflowFacade { private class WorkflowFacade {
@ -156,6 +165,7 @@ public final class AssignedTaskSection extends Section {
final ArrayList getTasks(final PageState state) { final ArrayList getTasks(final PageState state) {
return (ArrayList) get(state); return (ArrayList) get(state);
} }
} }
final void restartWorkflow(final PageState state) { final void restartWorkflow(final PageState state) {
@ -221,6 +231,7 @@ public final class AssignedTaskSection extends Section {
return task.getTaskType().getID().equals(CMSTaskType.AUTHOR) return task.getTaskType().getID().equals(CMSTaskType.AUTHOR)
|| task.getTaskType().getID().equals(CMSTaskType.EDIT); || task.getTaskType().getID().equals(CMSTaskType.EDIT);
} }
} }
protected final static GlobalizedMessage gz(final String key) { 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) { protected final static String lz(final String key) {
return (String) gz(key).localize(); return (String) gz(key).localize();
} }
} }

View File

@ -17,11 +17,9 @@ OpenCCM.prototype.showImageDialog = function(image)
width: "", width: "",
height: "", height: "",
caption: "", caption: "",
alignment: "", alignment: "",
caption : "", caption : "",
fancybox: "", fancybox: "",
aspect: "" aspect: ""
}; };
@ -119,16 +117,28 @@ OpenCCM.prototype.prepareImageDialog = function()
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 // Connect the OK and Cancel buttons
dialog.getElementById("ok").onclick = function() {self.imageApply();} dialog.getElementById("ok").onclick = function() {
dialog.getElementById("remove").onclick = function() { self.imageRemove(); }; self.imageApply();
dialog.getElementById("cancel").onclick = function() { self.dialogs["images"].hide(); }; }
dialog.getElementById("remove").onclick = function() {
self.imageRemove();
};
dialog.getElementById("cancel").onclick = function() {
self.dialogs["images"].hide();
};
// Connect the Select button // 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 // Connect onkeyup event handler with dimension filed to recalculate the size according to aspect ratio
dialog.getElementById("width").onkeyup = function() { self.calcHeight(); }; dialog.getElementById("width").onkeyup = function() {
dialog.getElementById("height").onkeyup = function() { self.calcWidth(); }; self.calcHeight();
};
dialog.getElementById("height").onkeyup = function() {
self.calcWidth();
};
// OnResize // OnResize
this.dialogs["images"].onresize = function() this.dialogs["images"].onresize = function()

View File

@ -9,7 +9,7 @@
name="ScientificCMS" name="ScientificCMS"
prettyName="Scientific CMS" prettyName="Scientific CMS"
version="2.3.0" version="2.3.0"
release="devel-SNAPSHOT-r2620" release="devel-SNAPSHOT-r2664"
webxml="sci-web.xml" webxml="sci-web.xml"
portletxml="sci-portlet.xml" portletxml="sci-portlet.xml"
webapp="libreccm" webapp="libreccm"

View File

@ -73,7 +73,12 @@
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
$("a.imageZoom").fancybox({'type':'image'}); $("a.imageZoom").fancybox({'type':'image'});
$("a.imageGallery").fancybox({'type':'image'}); $("a.imageGallery").fancybox({
'type': 'image',
'helpers': {
buttons: {}
}
});
}); });
</script> </script>
<!-- <!--

View File

@ -29,6 +29,7 @@
<usePageTitle/> <usePageTitle/>
</title> </title>
<useCSSLoader/> <useCSSLoader/>
<useJQuery/>
<useFancybox/> <useFancybox/>
<useMathJax/> <useMathJax/>
</head> </head>

View File

@ -29,6 +29,7 @@
<usePageTitle/> <usePageTitle/>
</title> </title>
<useCSSLoader/> <useCSSLoader/>
<useJQuery/>
<useFancybox/> <useFancybox/>
<useMathJax/> <useMathJax/>
<useJqueryUi/> <useJqueryUi/>

View File

@ -34,7 +34,7 @@
<fileset dir="${ccm.tools.lib.dir}" includes="pluto-util-*.jar"/> <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-*.jar"/>
<fileset dir="${ccm.tools.lib.dir}" includes="pluto-container-api-*.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/commons-logging" includes="**/*.jar"/>
<fileset dir="/path/to/castor" includes="**/*.jar"/> <fileset dir="/path/to/castor" includes="**/*.jar"/>