diff --git a/components/tools/OmeroWeb/omeroweb/webclient/controller/container.py b/components/tools/OmeroWeb/omeroweb/webclient/controller/container.py
index 585e2c0515c..8a53ead99f7 100755
--- a/components/tools/OmeroWeb/omeroweb/webclient/controller/container.py
+++ b/components/tools/OmeroWeb/omeroweb/webclient/controller/container.py
@@ -177,6 +177,29 @@ def getPlateId(self):
elif self.acquisition:
return self.acquisition._obj.plate.id.val
+
+ def listFigureScripts(self, objDict=None):
+ """
+ This configures all the Figure Scripts, setting their enabled status given the
+ currently selected object (self.image etc) or batch objects (uses objDict).
+ """
+ figureScripts = []
+ # id is used in url and is mapped to full script path by views.figure_script()
+ splitView = {'id': 'SplitView', 'name':'Split View Figure', 'enabled': False,
+ 'tooltip': "Create a figure of images, splitting their channels into separate views"}
+ # Split View Figure is enabled if we have at least one image with SizeC > 1
+ if self.image:
+ splitView['enabled'] = (self.image.getSizeC() > 1)
+ elif objDict is not None:
+ if 'image' in objDict:
+ for i in objDict['image']:
+ if i.getSizeC() > 1:
+ splitView['enabled'] = True
+ break
+ figureScripts.append(splitView)
+ return figureScripts
+
+
def openAstexViewerCompatible(self):
"""
Is the image suitable to be viewed with the Volume viewer 'Open Astex Viewer' applet?
diff --git a/components/tools/OmeroWeb/omeroweb/webclient/static/webclient/css/dusty.css b/components/tools/OmeroWeb/omeroweb/webclient/static/webclient/css/dusty.css
index 74e7619c6fa..e02393d1538 100755
--- a/components/tools/OmeroWeb/omeroweb/webclient/static/webclient/css/dusty.css
+++ b/components/tools/OmeroWeb/omeroweb/webclient/static/webclient/css/dusty.css
@@ -136,6 +136,7 @@ button::-moz-focus-inner {
.btn_group {background: url(../../webgateway/img/icon_add_group.png )center center no-repeat;}
.btn_delete {background: url(../../webgateway/img/icon_delete.png )center center no-repeat;}
.btn_edit {background: url(../../webgateway/img/icon_edit.png )center center no-repeat;}
+ .btn_figscripts {background: url(../../webgateway/img/icon_figure_scripts.png) center center no-repeat;}
.btn_fspath {background: url(../../webgateway/img/icon_fs_path.png )center center no-repeat;}
.btn_link {background: url(../../webgateway/img/icon_link.png )center center no-repeat;}
@@ -163,7 +164,7 @@ button::-moz-focus-inner {
display:block;
}
- #general_tab .btn_download span {
+ .toolbar_dropdown .btn span {
width:20px;
height:18px;
display:block;
@@ -173,6 +174,7 @@ button::-moz-focus-inner {
background: url(../../webgateway/img/icon_download2.png) center center no-repeat;
}
+/*<<<<<<< HEAD
#download_dropdown .dropdown {
right: 0px;
left: auto;
@@ -182,9 +184,20 @@ button::-moz-focus-inner {
margin-left: 5px;
}
#download_dropdown .dropdown:before {
+=======*/
+ .toolbar_dropdown {
+ float:right;
+ margin: 0px 5px 0px 0px;
+ position: relative;
+ }
+ .toolbar_dropdown .dropdown {
+ right: -35px;
+ left: auto;
+ }
+ .toolbar_dropdown .dropdown:before {
left: 68% !important;
}
- #download_dropdown ul a {
+ .toolbar_dropdown ul a {
background: none;
font-size: 80%;
}
@@ -406,7 +419,7 @@ button::-moz-focus-inner {
}
.btn_text span {
- padding:6px 10px !important;
+ padding:3px 7px !important;
}
@@ -487,7 +500,7 @@ button::-moz-focus-inner {
width:12px;
height:12px;
position:absolute;
- z-index:99;
+ z-index:90;
right:5px;
top:5px;
-webkit-border-radius:20px;
diff --git a/components/tools/OmeroWeb/omeroweb/webclient/static/webclient/css/layout.css b/components/tools/OmeroWeb/omeroweb/webclient/static/webclient/css/layout.css
index 653fae84879..04301d7877d 100755
--- a/components/tools/OmeroWeb/omeroweb/webclient/static/webclient/css/layout.css
+++ b/components/tools/OmeroWeb/omeroweb/webclient/static/webclient/css/layout.css
@@ -534,7 +534,7 @@
/* Right Inner Content */
.right_tab_inner {
- padding:15px;
+ padding:10px 15px;
overflow: auto;
top:6px ;bottom:0px; left:0px; right:0px;
position: absolute;
@@ -549,7 +549,7 @@
/* Seperator */
hr {
- margin:15px 0;
+ margin:10px 0;
display:block;
border:none;
border-bottom: solid 1px rgba(255,255,255,.8);
@@ -588,7 +588,7 @@
.data_heading {
- margin-bottom:20px;
+ margin-bottom:15px;
border-bottom:solid 1px hsl(210,10%,90%);
overflow:hidden;
-webkit-box-shadow:0 1px 0 rgba(255,255,255,.5);
@@ -597,7 +597,7 @@
-moz-box-shadow:0 1px 0 rgba(255,255,255,.5); /* FF3.5+ */
box-shadow:0 1px 0 rgba(255,255,255,.5); /* Opera 10.5, IE 9.0 */
- padding:10px 0;
+ padding:10px 0 5px 0;
}
diff --git a/components/tools/OmeroWeb/omeroweb/webclient/static/webclient/javascript/ome.split_view_figure.js b/components/tools/OmeroWeb/omeroweb/webclient/static/webclient/javascript/ome.split_view_figure.js
new file mode 100644
index 00000000000..ab93c82c2cb
--- /dev/null
+++ b/components/tools/OmeroWeb/omeroweb/webclient/static/webclient/javascript/ome.split_view_figure.js
@@ -0,0 +1,271 @@
+//
+// Copyright (C) 2013 University of Dundee & Open Microscopy Environment.
+// All rights reserved.
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Affero General Public License as
+// published by the Free Software Foundation, either version 3 of the
+// License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Affero General Public License for more details.
+//
+// You should have received a copy of the GNU Affero General Public License
+// along with this program. If not, see .
+//
+
+$(document).ready(function() {
+ OME.setupAjaxError("{% url fsend %}"); // just in case!
+
+ $('#script_form').ajaxForm({
+ success: function(data) {
+ window.opener.OME.showActivities();
+ self.close();
+ }
+ });
+
+
+ // Basically what we're doing here is supplementing the form fields
+ // generated from the script itself to make a nier UI.
+ // We use these controls to update the paramter fields themselves,
+ // as well as updating the Figure preview.
+
+ $("#enableScalebar").click(function(){
+ var enabled = $(this).is(":checked");
+ if (enabled) {
+ $("input[name=Scalebar]").removeAttr("disabled").focus();
+ } else {
+ $("input[name=Scalebar]").attr("disabled", "disabled");
+ }
+ });
+
+ var $channelNamesMap = $("#channelNamesMap"),
+ $figure_table = $("#figure_table"),
+ $columnNames = $(".split_column .channel_name", $figure_table),
+ $mergedNames = $("div.merged_name", $figure_table),
+ $splitIndexes = $("input[name='Split_Indexes']");
+
+ var updateChannelNames = function() {
+ // Update Channel-Names map index:Name
+ var activeCs = [],
+ cNames = [];
+ $("#split_channels input[type=checkbox]").each(function(i) {
+ var cName = $('input[type=text]', $(this).parent()).val(),
+ idx = parseInt( $(this).attr('name'), 10 );
+ cNames.push(cName);
+ if ($(this).is(":checked")) {
+ activeCs.push(idx);
+ }
+ });
+ $('input[name*=Channel_Names_value]', $channelNamesMap).each(function(c){
+ $(this).val( cNames[c] );
+ });
+ // Update Split Indexes
+ $splitIndexes.val(activeCs.join(","));
+ // Update Figure - channels on/off
+ $figure_table.find('tr').each(function(){
+ $(this).find('td.split_column').each(function(c) {
+ if (activeCs.indexOf(c) > -1) {
+ $(this).show();
+ } else {
+ $(this).hide();
+ }
+ });
+ });
+ // Update Figure - channel Names
+ $columnNames.each(function(i){ // Column names
+ $(this).text(cNames[i]);
+ });
+ $mergedNames.each(function(i){ // Merged names
+ $(this).text(cNames[i]);
+ });
+
+ };
+ // Add / Remove Channels
+ $("#split_channels input[type=checkbox]").click(updateChannelNames);
+ // Renaming Channels
+ $("#split_channels input[type=text]").keyup(updateChannelNames);
+
+ var $mergecColoursMap = $("#mergedColoursMap");
+ var updateMergedChannels = function() {
+ // Update Merged-Colours map index:colourInt
+ $mergecColoursMap.empty();
+ var mergedCs = [],
+ mergedColurs = [];
+ $("#merged_channels input[type=checkbox]:checked").each(function(i){
+ var colourInt = $(this).attr('value'),
+ idx = parseInt( $(this).attr('name'), 10 ),
+ html = "" +
+ "";
+ mergedCs.push(idx+1); // Use 1-based Channel idx for rendering
+ $(html).appendTo($mergecColoursMap);
+ });
+ // Update url of merged panels in Figure
+ $(".merged_column img").each(function(){
+ // remember original src
+ var $this = $(this);
+ if (typeof $this.data('src') === 'undefined') {
+ $this.data('src', $this.attr('src'));
+ }
+ var newSrc = $this.data('src') + "?c=" + mergedCs.join(",");
+ $this.attr('src', newSrc);
+ });
+ // Merged Channel names
+ $mergedNames.each(function(i) {
+ if (mergedCs.indexOf(i+1) > -1) {
+ $(this).show();
+ } else {
+ $(this).hide();
+ }
+ });
+
+ };
+ // When merged channels are toggled
+ $("#merged_channels input[type=checkbox]").click(function() {
+ updateMergedChannels();
+ updateGrey();
+ });
+
+ var $splitPanelsGrey = $("input[name=Split_Panels_Grey]");
+ var updateGrey = function() {
+ // Split Channels grey if 'splitPanelsGrey' OR channel is not merged
+ var grey = $splitPanelsGrey.is(":checked"),
+ mergedCs = [];
+ $("#merged_channels input[type=checkbox]:checked").each(function(i){
+ mergedCs.push( parseInt( $(this).attr('name'), 10 ));
+ });
+ $columnNames.each(function(i){
+ var $this = $(this);
+ // Note the original color if we haven't done so already
+ if (typeof $this.data('color') === 'undefined') {
+ $this.data('color', $this.css('color'));
+ }
+ // Apply color or black to column Names
+ if (grey && mergedCs.indexOf(i) > -1) {
+ $this.css('color', $this.data('color'));
+ } else {
+ $this.css('color', 'rgb(0,0,0)');
+ }
+ });
+ // Update url of split panels in Figure
+ $(".split_column img").each(function(){
+ // remember original src
+ var $this = $(this),
+ colIdx = parseInt($this.attr("colIdx"), 10),
+ chGrey = (grey || (mergedCs.indexOf(colIdx) === -1)),
+ flag = chGrey ? "g" : "c";
+ if (typeof $this.data('src') === 'undefined') {
+ $this.data('src', $this.attr('src'));
+ }
+ var newSrc = $this.data('src') + "&m=" + flag;
+ $this.attr('src', newSrc);
+ });
+ };
+ // Update grey on checkbox click
+ $splitPanelsGrey.click(updateGrey);
+
+ // Merged names
+ $("input[name=Merged_Names]").click(function(){
+ if ( $(this).is(":checked") ) {
+ $("#merged_label").hide();
+ $("#merged_names").show();
+ } else {
+ $("#merged_label").show();
+ $("#merged_names").hide();
+ }
+ });
+
+
+ // Z selection.
+ // NB: We disable Z-projection by clearing the zStart and zEnd fields.
+ var $zRangeSlider = $("#zRangeSlider"),
+ $zProjectionControls = $("#zProjectionControls"),
+ $zStart = $("input[name=Z_Start]"),
+ $zEnd = $("input[name=Z_End]"),
+ zMin = parseInt($zStart.val(), 10),
+ zMax = parseInt($zEnd.val(), 10),
+ $algorithm = $("select[name=Algorithm]"),
+ $stepping = $("input[name=Stepping]");
+ $zRangeSlider.slider({
+ range: true,
+ min: zMin,
+ max: zMax,
+ values: [ zMin, zMax ],
+ slide: function( event, ui ) {
+ $zStart.val(ui.values[ 0 ]);
+ $zEnd.val(ui.values[ 1 ]);
+ }
+ }).slider( "disable" ); // enable if user chooses zProjection
+ $("input[name=zProjection]").click(function(){
+ if($(this).attr('value') === "z_projection"){
+ $zRangeSlider.slider( "enable" );
+ $zProjectionControls.show();
+ $zStart.removeAttr("disabled");
+ $zEnd.removeAttr("disabled");
+ $algorithm.removeAttr("disabled");
+ $stepping.removeAttr("disabled");
+ } else {
+ $zProjectionControls.hide();
+ $zRangeSlider.slider( "disable" );
+ $zStart.attr("disabled", "disabled");
+ $zEnd.attr("disabled", "disabled");
+ $algorithm.attr("disabled", "disabled");
+ $stepping.attr("disabled", "disabled");
+ }
+ });
+ // Don't allow users to type values here
+ $zStart.keydown(function(){ return false; });
+ $zEnd.keydown(function(){ return false; });
+
+
+ // Image Labels
+ var $Image_Labels = $("select[name=Image_Labels]"),
+ $rowLabels = $(".rowLabel>div"),
+ $imgName = $("div.imgName"),
+ $imgTags = $("div.imgTags"),
+ $imgDatasets = $("div.imgDatasets");
+ $Image_Labels.change(function(){
+ var labels = $(this).val();
+ $rowLabels.hide(); // hide all then show one...
+ if (labels == "Image Name") {
+ $imgName.show();
+ } else if (labels == "Datasets") {
+ $imgDatasets.show();
+ } else if (labels == "Tags") {
+ $imgTags.show();
+ }
+ });
+
+ // Lets sync everything to start with:
+ updateChannelNames();
+ updateMergedChannels();
+ updateGrey();
+
+
+ // Bonus feature - Zoom the preview thumbs with slider
+ // Make a list of styles (for quick access on zoom)
+ var img_panel_styles = [];
+ $(".img_panel").each(function(){
+ img_panel_styles.push(this.style);
+ });
+ var setImgSize = function(size) {
+ var i, l = img_panel_styles.length;
+ for (i=0; i.
+//
+
/*global OME:true */
if (typeof OME === "undefined") {
OME = {};
@@ -283,6 +301,36 @@ OME.deleteItem = function(event, domClass, url) {
return false;
};
+// More code that is shared between metadata_general and batch_annotate panels
+// Called when panel loaded. Does exactly what it says on the tin.
+OME.initToolbarDropdowns = function() {
+ // -- Toolbar buttons - show/hide dropdown options --
+ $(".toolbar_dropdown ul").css('visibility', 'hidden');
+ // show on click
+ var $toolbar_dropdownlists = $(".toolbar_dropdown ul");
+ $(".toolbar_dropdown button").click(function(e) {
+ // hide any other lists that might be showing...
+ $toolbar_dropdownlists.css('visibility', 'hidden');
+ // then show this one...
+ $("ul", $(this).parent()).css('visibility', 'visible');
+ e.preventDefault();
+ return false;
+ });
+ // on hover-out, hide drop-down menus
+ $toolbar_dropdownlists.hover(function(){}, function(){
+ $(this).css('visibility', 'hidden');
+ });
+
+ // For Figure scripts, we need a popup:
+ $("#figScriptList li a").click(function(event){
+ if (!$(this).parent().hasClass("disabled")) {
+ OME.openScriptWindow(event, 800, 600);
+ }
+ event.preventDefault();
+ return false;
+ });
+};
+
jQuery.fn.tooltip_init = function() {
$(this).tooltip({
bodyHandler: function() {
diff --git a/components/tools/OmeroWeb/omeroweb/webclient/templates/webclient/annotations/batch_annotate.html b/components/tools/OmeroWeb/omeroweb/webclient/templates/webclient/annotations/batch_annotate.html
index ead6c1872c1..5c4abe9fadd 100644
--- a/components/tools/OmeroWeb/omeroweb/webclient/templates/webclient/annotations/batch_annotate.html
+++ b/components/tools/OmeroWeb/omeroweb/webclient/templates/webclient/annotations/batch_annotate.html
@@ -242,6 +242,9 @@
var url = $(this).attr('href');
OME.deleteItem(event, "file_ann_wrapper", url);
});
+
+
+ OME.initToolbarDropdowns();
});
@@ -261,7 +264,7 @@
-
+
Annotate
{{ obj_labels|length }} objects:
@@ -278,16 +281,28 @@
{% endfor %}
+
+
+
-
+
+ {% include "webclient/annotations/includes/figure_scripts_menu.html" %}
+
+
+
+
diff --git a/components/tools/OmeroWeb/omeroweb/webclient/templates/webclient/annotations/includes/figure_scripts_menu.html b/components/tools/OmeroWeb/omeroweb/webclient/templates/webclient/annotations/includes/figure_scripts_menu.html
new file mode 100644
index 00000000000..728670631fa
--- /dev/null
+++ b/components/tools/OmeroWeb/omeroweb/webclient/templates/webclient/annotations/includes/figure_scripts_menu.html
@@ -0,0 +1,36 @@
+{% comment %}
+
+{% endcomment %}
+
+
+
\ No newline at end of file
diff --git a/components/tools/OmeroWeb/omeroweb/webclient/templates/webclient/annotations/includes/toolbar.html b/components/tools/OmeroWeb/omeroweb/webclient/templates/webclient/annotations/includes/toolbar.html
new file mode 100644
index 00000000000..a026f278b2a
--- /dev/null
+++ b/components/tools/OmeroWeb/omeroweb/webclient/templates/webclient/annotations/includes/toolbar.html
@@ -0,0 +1,62 @@
+{% comment %}
+
+{% endcomment %}
+
+
+
+
+
+
+
+
+
+ {% if manager.image %}
+
+
+ {% endif %}
+
+
+
+ {% include "webclient/annotations/includes/figure_scripts_menu.html" %}
+
+
+
\ No newline at end of file
diff --git a/components/tools/OmeroWeb/omeroweb/webclient/templates/webclient/annotations/metadata_general.html b/components/tools/OmeroWeb/omeroweb/webclient/templates/webclient/annotations/metadata_general.html
index 877128ff962..a0eb83a8b1a 100644
--- a/components/tools/OmeroWeb/omeroweb/webclient/templates/webclient/annotations/metadata_general.html
+++ b/components/tools/OmeroWeb/omeroweb/webclient/templates/webclient/annotations/metadata_general.html
@@ -285,18 +285,8 @@
});
- // -- Download options --
- $("#download_dropdown ul").css('visibility', 'hidden');
- // show on click
- $("#show_download_dropdown").click(function(e) {
- $("ul", $(this).parent()).css('visibility', 'visible');
- e.preventDefault();
- return false;
- });
- // on hover-out, hide drop-down menus
- $("#download_dropdown ul").hover(function(){}, function(){
- $(this).css('visibility', 'hidden');
- });
+ // We do this here and in batch_annotate panel
+ OME.initToolbarDropdowns();
// Handle Download actions
$("#create-ometiff").click(function(e){
@@ -448,20 +438,26 @@
{% if manager.image %}
+ {% include "webclient/annotations/includes/toolbar.html" %}
+
{% with obj=manager.image nameText=manager.image.name %}
{% include "webclient/annotations/includes/name.html" %}
{% endwith %}
-
-
-
- Image ID: {{ manager.image.id }}
+
+
+
+
+ {{ manager.obj_type }} ID: {{ manager.obj_id }}
-
-