Update

Update is for when the project need an automated internal update. For update html, css and js codes in user's device we can use it.

app.update.onStarted()

When an automated internal update occurred, app.update.onStarted() event is called and you can handle the update codes. It has no entry argument.

  • Type: Function

    app.update.onStarted = function () {};

  • Example
    Performing an onStarted function configuration inside the app.js:
    // on update started
    app.update.onStarted = function () {
        // body...
    };

app.update.onProgressChanged()

When an automated internal update downloading progress being changed, this event is called.

  • Type: Function

    app.update.onProgressChanged = function (percentage) {};

  • Detail

    You can create an update page for handling update progress. The codes will comes inside the app.update.onProgressChanged to handle the percentage of completed updates.

    Parameters Type Description
    percentage String The callback percentage of changing update process.
  • Example
    Performing an onProgressChanged function configuration inside the app.js:
    // on update progress changed
    app.update.onProgressChanged = function (percentage) {
        if (app.page.name === 'update')
            $('.page.update > .progress > div').css('width', percentage + '%');
    };

app.update.onCompleted()

When the update operation is completed, app.update.onCompleted event is called. It means, for handling what happens after completing the update, this section can handle codes.

  • Type: Function

    app.update.onCompleted = function () {};

  • Example
    Performing an onCompleted function configuration inside the app.js:
    // on update completed
    app.update.onCompleted = function () {
        if (app.page.name === 'update')
            alert('Your update is completed!');
    };