| 18 | |
| 19 | A good first step would be to create tests that use all methods from the existing viewport API, and then to switch the test to using the new jQuery plugin, testing all the same methods. |
| 20 | |
| 21 | Let's start by jotting down the existing API. |
| 22 | |
| 23 | viewportImage |
| 24 | {{{ |
| 25 | showOverlay(url, cb, error_cb) |
| 26 | hideOverlay() |
| 27 | overlayVisible() |
| 28 | doMove(deltax, deltay, smooth, auto_move_cb) |
| 29 | getOrigWidth() |
| 30 | getOrigHeight() |
| 31 | |
| 32 | getXOffset() |
| 33 | setXOffset(xoffset) |
| 34 | getYOffset() |
| 35 | setYOffset(yoffset) |
| 36 | |
| 37 | getZoom() |
| 38 | setZoom (val, width, height) |
| 39 | setZoomToFit(only_shrink, width, height) |
| 40 | doZoom(increment, justDirection) |
| 41 | |
| 42 | getBigImageContainer() |
| 43 | setUpTiles(imagewidth, imageheight, xtilesize, ytilesize, init_zoom, levels, href, thref, init_cx, init_cy) |
| 44 | destroyTiles() |
| 45 | |
| 46 | refresh() |
| 47 | }}} |
| 48 | |
| 49 | viewport.js |
| 50 | |
| 51 | {{{ |
| 52 | setZPos(pos) |
| 53 | setTPos(pos) |
| 54 | load(iid, dsid, query) |
| 55 | hasLinePlot() |
| 56 | getLinePlot() |
| 57 | prepareLinePlot() |
| 58 | startPickPos() |
| 59 | stopPickPos() |
| 60 | loadPlot(pos) |
| 61 | loadRowPlot(y) |
| 62 | hidePlot() |
| 63 | refreshPlot(cb) |
| 64 | refresh(allow_resize) |
| 65 | getAuthor() |
| 66 | getChannels() |
| 67 | toggleChannel(idx) |
| 68 | getCCount() |
| 69 | setChannelActive(idx, act, noreload) |
| 70 | setChannelColor(idx, color, noreload) |
| 71 | setChannelLabel(idx, color, noreload) |
| 72 | setChannelWindow(idx, start, end, noreload) |
| 73 | getMetadata() |
| 74 | getProjection() |
| 75 | setProjection(p, noreload) |
| 76 | setInvertedAxis(p, noreload) |
| 77 | setModel(m, noreload) |
| 78 | getModel() |
| 79 | isGreyModel() |
| 80 | getPixelSizes() |
| 81 | setQuality(q, noreload) |
| 82 | getQuality() |
| 83 | setServer() |
| 84 | getSizes() |
| 85 | getTCount() |
| 86 | getPos() |
| 87 | getTPos() |
| 88 | getZCount() |
| 89 | getZPos() |
| 90 | setZoom(z) |
| 91 | getZoom() |
| 92 | setZoomToFit(only_shrink) |
| 93 | save_channels() |
| 94 | undo_channels() |
| 95 | has_channels_undo() |
| 96 | redo_channels() |
| 97 | has_channels_redo() |
| 98 | reset_channels() |
| 99 | bookmark_channels() |
| 100 | back_to_bookmarked_channels() |
| 101 | forget_bookmark_channels() |
| 102 | getQuery() |
| 103 | setQuery(query) |
| 104 | getRelUrl(append) |
| 105 | getUrl(base) |
| 106 | getCurrentImgUrlPath() |
| 107 | hasSettingsChanges() |
| 108 | bind(event, callback) |
| 109 | }}} |