Log in

hypeLists

hypeLists

Elgg 3.0

A set of tools that improve UX and simplify common list patterns for developers.

Features

  • Seamless integration with core and existing plugins
  • AJAXed list pagination and infinite scroll
  • Lazy loading of preceeding and succeeding list pages
  • Auto refreshing of lists
  • An interface for creating sortable/searchable lists

Server-Side

The following options are accepted by elgg_list_entities(), elgg_view_entity_list(), and by page/components/list and page/components/gallery views. These parameters will only take effect, if you have 'pagination' => true in your options. Additional options, that need to be passed to the jQuery plugin, can be prefixed with data-

  • 'list_id' STRING is an optional parameter, but it is strongly recommended to pass it to your list. List id must be unique to the page.
  • 'pagination_type' STRING default (pagination bar with page number navigation) or infinite (before and after navigation)
  • 'position' STRING can be used to specify the position of pagination items. before, after, both
  • 'num_pages' INT can be used to specify how many page number navigation items to show, use 0 to only show Next and Prev links
  • 'lazy_load' INT can be used to initialize lazy loading of pages
  • 'auto_refresh' INT can be used to specify at which interval in seconds new items should be fetched
  • 'reversed' BOOL can be used to specify reversed lists. If list is reversed, it is assumed that the new items will be located at the end of the list

Client-Side

Lists that have received the necessary parameters server-side will be instantiated automatically. If you need to instantiate a list programmatically, use $.hypeList(options).


// Instantiate a new list $('.elgg-list.my-list').hypeList({ baseUrl: false, // Data source count: 0, // Number of items in the list offset: 0, // Current offset from the beginning of the list offsetKey: 'offset', // Offset key limit: 10, // Number of items per page listId: '', // List identifier unique to the page pagination: 'default', // Pagination type: 'default', 'infinite' paginationPosition: 'after', // Pagination position: 'before', 'after', 'both' paginationNumPages: 10, // Number of page links to display in the pager classActive: 'elgg-state-selected', // CSS class pertinent to active elements classDisabled: 'elgg-state-disabled', // CSS class pertinent to disabled elements classLoading: 'elgg-state-loading', // CSS class pertinent to pending elements textNoResults: '', // Text displayed when no items were found in the list textNext: elgg.echo('next'), // Text for next link textPrev: elgg.echo('previous'), // Text for previous link keyTextBefore: 'lists:add:before', // Language key for before link (will receive limit as parameter) keyTextAfter: 'lists:add:after', // Language key for before link (will receive limit as parameter) lazyLoad: 10, // Number of pages to lazy load autoRefresh: 60, // Fetch new items at this interval (in seconds) reversed: false, // List is reversed that is new items are appended to the end of the list scrollTopOffset: -100, // Additional offset in pixels for when the page is scrolled to the top of the list listTime: 0, // Timestamp at which the list was generated, sent with AJAX requests showEffect: 'highlight', // jQuery UI effect used for toggling item visibility selectorDelete: '.elgg-menu-item-delete > a', // CSS selector of an anchor that will trigger a delete action }); // Public methods // Navigate to a page with a certain index // For default pagination type, page with pageIndex is loaded and displayed // For infinite pagination type, all pages in range from currently visible pages to the page with pageIndex are loaded and displayed $('.elgg-list').trigger('goToPage', [pageIndex]); // Trigger refresh // Reloads the page and appends new items if any // If no pageIndex is provided, it's determined by pagination type // goToPage parameter can be used to navigate to the page once new items have been fetched // goToPage flag is useful when a new post was made and you want to display the post to the user $('.elgg-list').trigger('fetchNewItems', [pageIndex, goToPage]); // Remove items from the list and reindex $('.elgg-list').trigger('removeItems', [$items]); // Add new items to the list $('.elgg-list').trigger('addFetchedItems', [ajaxData]); // Events // Event triggered whenever the list is first rendered // Callback will receive list options as a second parameter $('.elgg-list').on('ready', callback); // Event triggered whenever an item is added, removed or hidden from a list // Callback will receive list options as a second parameter $('.elgg-list').on('change', callback);

Package Releases

VersionRelease Date
hypeLists 5.1.35.1.3
hypeLists 5.1.05.1.0
hypeLists 5.0.105.0.10
hypeLists 5.0.95.0.9
hypeLists 5.0.85.0.8
hypeLists 5.0.75.0.7
hypeLists 5.0.65.0.6
hypeLists 5.0.55.0.5
hypeLists 5.0.45.0.4
hypeLists 5.0.35.0.3
hypeLists 5.0.25.0.2
hypeLists 5.0.15.0.1
hypeLists 5.0.05.0.0

Changelog

5.1.0 (2018-06-29)

Bug Fixes

  • css: improve search form appearance (58dc114)
  • css: search form no longer overflows sidebar (f9dd1e6)
  • css: sidebar search form no longer overflows (b37bd67)
  • data: data export endpoints now work as expected (4f3096c)
  • js: correctly scroll to top of the list on pagination (710bb02)
  • js: use elgg/Ajax module for ajax calls (c1ca719)
  • search: use core styles for the search form (262bbb9)
  • sidebar: only show comments block if entities use comments (be9e946)
  • sorter: sorting by member count now works as expected (88f1aee)
  • sorts: correctly validate type (52ccd52)
  • sorts: simplify sorting registration (e00d199)

Features

  • core: updates and fixes (fe5d772)
  • filters: add option to search by post owner (b3e231f)

5.0.10 (2018-05-07)

Bug Fixes

  • sorts: correctly validate type (52ccd52)
  • sorts: simplify sorting registration (e00d199)

Features

  • filters: add option to search by post owner (b3e231f)

5.0.9 (2018-04-27)

Bug Fixes

  • js: correctly scroll to top of the list on pagination (710bb02)

5.0.8 (2018-04-26)

Bug Fixes

  • js: use elgg/Ajax module for ajax calls (c1ca719)

5.0.7 (2018-04-19)

Bug Fixes

  • css: improve search form appearance (58dc114)

5.0.6 (2018-04-06)

Bug Fixes

  • search: use core styles for the search form (262bbb9)

5.0.5 (2018-04-03)

Bug Fixes

  • css: sidebar search form no longer overflows (b37bd67)

5.0.4 (2018-04-03)

Bug Fixes

  • css: search form no longer overflows sidebar (f9dd1e6)

5.0.3 (2018-03-23)

Bug Fixes

  • sidebar: only show comments block if entities use comments (be9e946)

5.0.2 (2018-03-22)

Bug Fixes

  • data: data export endpoints now work as expected (4f3096c)

5.0.1 (2018-03-22)

Bug Fixes

  • sorter: sorting by member count now works as expected (88f1aee)

5.0.0 (2018-03-19)

Features

  • releases: upgrade for Elgg 3 (f777e54)

4.1.6 (2017-04-21)

Bug Fixes

  • ajax: throttle simulatenous ajax requests (3eea0fe)

4.1.5 (2017-02-27)

Bug Fixes

  • lists: do not wrap lists that set pagination to false explicitly (a874cde)

4.1.4 (2016-10-16)

Bug Fixes

  • lists: only display pager navigation if explicitly set (1d39775)
  • lists: wrap all lists that specify pagination type even if pagination is not required (aec6d2b)
  • views: no longer WSODs in script mode (496df99)
  • views: script tag should go outside of the list wrapper (5cae885)

4.1.3 (2016-09-21)

Bug Fixes

  • bc: honor legacy "rel" parameter in lists (85dc5ba)
  • forms: hide field containing hidden submit button (d74a950)
  • forms: override bottom margins on the sort fieldset (f46284f)
  • js: on ajax response only replace the list view instead of the entire container (d367b17)
  • lists: filter target should be passed explicitly (e5c8c82)

Features

  • users: add a filter to get users by online status (c409170)

4.1.2 (2016-09-15)

Bug Fixes

  • js: list events should not bubble up the DOM tree (217cbe0)

4.1.1 (2016-09-12)

Bug Fixes

  • js: correctly toggle form after sort/search action (2ea177c)
  • ui: expand search form by default (ce47684)

4.1.0 (2016-09-11)

Features

  • lists: adds an interface for building sortable and searchable lists (ae3fce9)

4.0.4 (2016-07-08)

Bug Fixes

  • lists: more reliable base_url normalization (87608a8), closes #22
  • lists: spinner is again shown when loading infinite lists (71c30f7)

4.0.3 (2016-07-08)

4.0.2 (2016-04-14)

Bug Fixes

  • lists: do not lazy load pages by default (0883468)
  • lists: strip limit and offset from base_url (de63df4)

4.0.1 (2016-04-14)

Bug Fixes

  • views: make sure all lists have a base_url (3977132)

4.0.0 (2016-02-23)

Features

  • compat: drop support for earlier Elgg versions (c76903d)
  • js: rewrite JS to AMD modules (90149db)
  • pagination: always add first and last page with ellipsis to the pagination (86226c0)
  • spinner: use core spinner (65e8f3e)
  • usability: move list classes into a standlone library (58e804b)
  • usability: rearrange handlers (3ddbf01)

BREAKING CHANGES

  • spinner: showLoader and hideLoader events are no longer triggered. Core elgg/spinner is used instead.
  • usability: List classes are no longer included in the plugin. Use hypejunction/api-lists in your project if you are using those classes
  • usability: hypeJunction\Lists namespace has been dropped, and handlers have been prefixed with hypelists_ instead. lib/hooks.php has been merged with start.php
  • compat: The plugin now requires at least Elgg 2.0

3.5.6 (2016-02-15)

Bug Fixes

  • js: make sure $items are set (2357bf9)
  • lists: improve delete logic (84ea62d)

3.5.5 (2016-01-25)

Bug Fixes

  • js: fix how ajax list data is stored (8064b74)

3.5.4 (2016-01-25)

Bug Fixes

Features

  • js: store list data on init and ajax load (208563b)
  • js: store list data on init and ajax load (438cced)

3.5.3 (2016-01-24)

Bug Fixes

3.5.2 (2016-01-24)

Features

  • js: trigger ready event when list is rendered (cb472b6)

3.5.1 (2016-01-24)

Bug Fixes

  • js: run initialization script only once (ee5736e)

3.5.0 (2016-01-23)

Features

  • js: adds more public event triggers (79dd720)
  • lists: better handling of empty lists (cb44929)

3.4.1 (2015-12-28)

Bug Fixes

  • js: always trigger initialize event after AMD module is loaded (8397e61)
  • js: correctly parse loader CSS class when spinner is not loaded (5d21c65), closes #16

3.4.0 (2015-12-27)

Bug Fixes

  • api: fix default list id (00e2add)
  • css: clean up CSS and get rid of SASS (012cd43)
  • css: css makes no sense, get rid of it (4793c25)
  • delete: ajax delete now respects confirmations response (1d20ce3), closes #12
  • deps: hypeApps is not really required, get rid of it (1463bef)
  • js: clean AMD module structure (08adf28)
  • lists: lists now do not break in non-default viewtypews (79039e8), closes #14
  • lists: properly handle no results (9e811df), closes #8

Features

  • events: trigger a change event whenever items visibility is toggled (1834a89), closes #13
  • spinner: use Elgg spinner module if available (0bb2f6f)

3.3.2 (2015-12-27)

3.3.2 (2015-10-20)

Bug Fixes

  • manifest: grunt needs type attribute (993097d)

3.3.1 (2015-10-20)

Bug Fixes

  • js: use inline require to load amd modules on ajax (5af7386)

3.3.0 (2015-08-22)

3.2.0 (2015-07-30)

Bug Fixes

  • amd: requirejs does not like jquery plugin served from simplecache (b7672e2)
  • js: kill event with die (c6c8d3a)
  • js: remove duplicate confirmation dialogs (7324368)
  • js: remove duplicate confirmation dialogs (ba51db4)
  • lists: treat elgg-gallery as elgg-list (bd81d7d)

3.1.1 (2015-07-28)

Bug Fixes

3.1.0 (2015-07-28)

3.0.0 (2015-01-12)

About

Dependencies

Requires
Elgg version >= 3.0
Plugin: hypeCapabilities Any
Plugin: hypeStash Any