Gallery:Modules:imagenotes:Implementation

来自站长百科
跳转至: 导航、​ 搜索

实现[ ]

客户端[ ]

  • Created utility methods for creating instances of templates. That is, cloning a DOM node and applying IDs to the new node and it's children.
  • Created TemplatedRubberBandRegion which allows a rubber band to be dragged over a specified region of the document and on mouseup a custom event is fired with the selected region
  • Created BoxModelRegionOverlay which extends the YUI Overlay widget and allows placement of an overlay based on the margin, border, padding or content parts of the box model. This is so that image region overlays can be positioned and sized by the content area.
  • Created TemplatedResizeOverlay which extends the BoxModelRegionOverlay widget and adds YUI DragDrop functionailty and the ability to resize the region. The code searches a template passed in client side for certain classes to turn into resize and drag handles. Custom events are fired at the start and end of drag and resize operations.
  • Created an initial image region manager that sets up a TemplatedRubberBandRegion and listens for area selected events, then creates a TemplatedResizeOverlay. Multiple regions can be created, but only a single region can be focused at a time.
  • The image region manager ensures that the image regions fit into the page focus flow.
  • Created utility function for finding an <img> tag in the page with a specific src attribute to allow the image region manager to be attached.

服务器端[ ]

  • Block created for addition to item view page
  • No database structure created yet
  • No server endpoint for AJAX communication created yet


调整或需要改良的区域[ ]

...