Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • User inputs a link,
  • clicks Share button,
  • chooses an application to share it to. 



This is the code, you can copy/paste it for own tests:

Code Block
languagejs
themeMidnight
const share = function(){
  navigator.share({
    title: 'mobsted.com',
    text: 'look at this: ' + MBST.ht("Backendname:text_input_share_link").properties.value,
  })
    .then(() => console.log('Successful share'))
    .catch((error) => console.log('Error sharing', error));
}
if (navigator.share) {
MBST.addActionListener("button_share_link", share)
}
Wiki Markup
const share = function(){
  navigator.share({
    title: 'mobsted.com',
    text: 'look at this: ' + MBST.ht("Backendname:text_input_share_link").properties.value,
  })
    .then(() => console.log('Successful share'))
    .catch((error) => console.log('Error sharing', error));
}
if (navigator.share) {
MBST.addActionListener("button_share_link", share)
}





RULES FOR JS



Referencing data points using Hashtags:

...

A JavaScript object is available for interaction with the Platform:

Code Block
languagejs
themeMidnight
MBST = {

...



platform: (string) 'ios|android',

...



ht: function (path[, value]),

...



watch: function (path, callback),

...



addActionListener: function(name, callback),

...



component: function (name),

...



action: function ([index], [actionsList])

...



}





FULL LIST OF MBST ACCESS FUNCTIONS

...