Skip to content
Benedikt Schulze Baek edited this page Mar 23, 2017 · 11 revisions

This is a collection of media features. I.e. you can show image galleries with a lightbox function or you can make use of an image upload function.

Table of Contents

  1. Gallery
  2. Images
  3. Miscellaneous

Gallery

Creates and manages a gallery from image urls.

Supported Platforms

  • Android
  • iOS
  • ChaynsWeb

Table of Contents


Creates a gallery with the provided urls.

Parameter

  • id : string - The unique id of the gallery.
  • urls : string[] - The image urls.
document.getElementById('#identifier').appendChild(
  chayns.ui.gallery.create('MyGallery', ['myImage.jpg'])
);

This method replaces the gallerys urls by the urls in this array and returns true on success.

Parameter

  • identifier : string - The id of the gallery.
  • urls : string[] - The image urls that will be set for the gallery.
chayns.ui.gallery.setUrls('MyGallery', ['myImage.jpg']);

This method returns an array containing all urls of the gallery (only works if the gallery was created using JavaScript).

Parameter

  • id : string - Id of the specific galelry.

Result

  • urls : string[] - An array containg all image urls set for the gallery.
chayns.dialog.alert('', 
  JSON.stringify(chayns.ui.gallery.getUrls('MyGallery'))
);

chayns.ui.gallery.addurl(id, url) This method adds an image url to the gallery and returns true on success.

Parameter

  • id : string - Id of the gallery.
  • url : string - The image url.
chayns.ui.gallery.addUrl('MyGallery', 'myImage.jpg');