diff --git a/images/extended-toolbar/11971143101886773363mozart_ar_wind_rose_compas.svg b/images/extended-toolbar/11971143101886773363mozart_ar_wind_rose_compas.svg new file mode 100644 index 0000000..086b865 --- /dev/null +++ b/images/extended-toolbar/11971143101886773363mozart_ar_wind_rose_compas.svg @@ -0,0 +1,248 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/images/extended-toolbar/Inkscape/Inkscape_icons_draw_rectangle.svg b/images/extended-toolbar/Inkscape/Inkscape_icons_draw_rectangle.svg new file mode 100644 index 0000000..7504d56 --- /dev/null +++ b/images/extended-toolbar/Inkscape/Inkscape_icons_draw_rectangle.svg @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/images/extended-toolbar/Inkscape/Inkscape_icons_object_hidden.svg b/images/extended-toolbar/Inkscape/Inkscape_icons_object_hidden.svg new file mode 100644 index 0000000..c544532 --- /dev/null +++ b/images/extended-toolbar/Inkscape/Inkscape_icons_object_hidden.svg @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/images/extended-toolbar/Inkscape/Inkscape_icons_object_rotate_left.svg b/images/extended-toolbar/Inkscape/Inkscape_icons_object_rotate_left.svg new file mode 100644 index 0000000..201eb7e --- /dev/null +++ b/images/extended-toolbar/Inkscape/Inkscape_icons_object_rotate_left.svg @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/images/extended-toolbar/Inkscape/Inkscape_icons_object_rotate_right.svg b/images/extended-toolbar/Inkscape/Inkscape_icons_object_rotate_right.svg new file mode 100644 index 0000000..53d8e23 --- /dev/null +++ b/images/extended-toolbar/Inkscape/Inkscape_icons_object_rotate_right.svg @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/images/extended-toolbar/Inkscape/Inkscape_icons_object_visible.svg b/images/extended-toolbar/Inkscape/Inkscape_icons_object_visible.svg new file mode 100644 index 0000000..c666d11 --- /dev/null +++ b/images/extended-toolbar/Inkscape/Inkscape_icons_object_visible.svg @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/images/extended-toolbar/Inkscape/Inkscape_icons_selection_make_bitmap_copy.svg b/images/extended-toolbar/Inkscape/Inkscape_icons_selection_make_bitmap_copy.svg new file mode 100644 index 0000000..baa8847 --- /dev/null +++ b/images/extended-toolbar/Inkscape/Inkscape_icons_selection_make_bitmap_copy.svg @@ -0,0 +1,1229 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/images/extended-toolbar/Inkscape/Inkscape_icons_view_fullscreen.svg b/images/extended-toolbar/Inkscape/Inkscape_icons_view_fullscreen.svg new file mode 100644 index 0000000..f6a2f96 --- /dev/null +++ b/images/extended-toolbar/Inkscape/Inkscape_icons_view_fullscreen.svg @@ -0,0 +1,548 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/images/extended-toolbar/Inkscape/Inkscape_icons_zoom_in.svg b/images/extended-toolbar/Inkscape/Inkscape_icons_zoom_in.svg new file mode 100644 index 0000000..c7b9bc2 --- /dev/null +++ b/images/extended-toolbar/Inkscape/Inkscape_icons_zoom_in.svg @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/images/extended-toolbar/Inkscape/Inkscape_icons_zoom_out.svg b/images/extended-toolbar/Inkscape/Inkscape_icons_zoom_out.svg new file mode 100644 index 0000000..e5ce11b --- /dev/null +++ b/images/extended-toolbar/Inkscape/Inkscape_icons_zoom_out.svg @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/index-extended-toolbar-demo.html b/index-extended-toolbar-demo.html new file mode 100644 index 0000000..4bf8b02 --- /dev/null +++ b/index-extended-toolbar-demo.html @@ -0,0 +1,202 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + IIPMooViewer 2.0 :: HTML5 High Resolution Image Viewer + + + + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/src/extended-toolbar.js b/src/extended-toolbar.js new file mode 100644 index 0000000..fa067fa --- /dev/null +++ b/src/extended-toolbar.js @@ -0,0 +1,226 @@ +/* + IIPMooViewer 2.0 - Extended Toolbar Extension + IIPImage Javascript Viewer + + Copyright (c) 2013 Massimo Brero + + --------------------------------------------------------------------------- + This file is part of IIPMooViewer 2.0 (hereinafter referred to as 'this program'). + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see + --------------------------------------------------------------------------- + +*/ + +/** Extends IIPMooViewer with a modular toolbar to provide user-friendly access to most options. +* @param {String} toolbarId : id of the HTML 'div' of the toolbar. +* @param {String} position : choice is 'inside' or 'outside'. Default is 'inside'. +* Specifies if the toolbar appears +* inside the viewer (= on top of it), or +* outside the viewer (=next/above of it, depending on the orientation). +* @param {String} orientation : choice is 'vertical' or 'horizontal'. +* @param {String[]} buttons : Array of strings +*/ +IIPMooViewer.implement({ + createExtendedToolbar: function(toolbarId, position, orientation, buttons){ + var _thisIIP = this; // local reference to 'this' + // Get a reference to the original toolbar - an HTML div must exists + var toolbar = document.getElementById(toolbarId); + + if ( (typeof(toolbar)==='undefined') || (toolbar == null) ) { + var msg = "IIPMooViewer Extended Toolbar creation error :\nNo element ID given to IIPMooViewer createExtendedToolbar\(\) or\nInvalide id.\nThe toolbar will not be available."; + alert( msg ); + return; + } + + position = position || 'inside'; + if (typeof(orientation)==='undefined') orientation = 'horizontal'; + if (typeof(buttons)==='undefined') buttons = ['rotateanticlockwise', 'rotateclockwise', 'toggleNavigationWindow', 'getRegionalURL', 'zoomIn', 'zoomOut', 'reset', 'toggleFullscreen']; + + // To suppress duplicate entries, keeping only the first occurence. + buttons = buttons.filter(function(elem, pos) { + return buttons.indexOf(elem) == pos; + }) + + /* Create the extended toolbar buttons for every valid array entry. + * Non existing options (malformed array entries) or meaningless buttons + * (i.e. toggleAnnotations if the annotation extension is not loaded) + * are ignored and therefor not created. + */ + for (var i=0;i