Points - danopia/deviantart-difi GitHub Wiki

This class is used to provide Modals for points and interact with points (e.g. transferring points)

More information about this class can be acquired by studying the points.js file.

modal

Loads the modal to give points to someone

Params

  • username: string

Usage

Unknown

Response

Dialog-like object.

morePointsModal

Provides a modal to buy more points when you are low on points

Params

None

Usage

Unknown

Response

Dialog-like object.

dd2Modal

REMOVED more research needed

tos

Returns terms of service for points

Usage

  • When clicking on Terms and Conditions for Points in the points page

Params

None

Response

  • status: SUCCESS
  • content: <div id="policy-points" class="policy-page"> . . . </div>

transferModal

This method is used to transfer points to another user

NOTE: Request includes the user's password!

Usage

Unknown

Params

  • toName: string (i.e. the recipient)
  • numPoints: string (i.e. the amount of points to transfer)
  • memo: string (i.e. a message for transfer description)
  • userpass: string (i.e. current user password)
  • tos: uint (e.g. 0 for decline and 1 for agree)

Response

  • On success, Dialog-like object

    • html with the following content:
    <div class="modal-dialog pointsModal" id="pointsModalReceipt" style="display:none;">
        <div class="modal-dialog-header">
            <h2><img class="pointsheart" src="https://st.deviantart.net/minish/points/point_hearts.gif?2"/> Points Transferred</h2>
        </div>
        <div id="receiptBody">You have given [amount] points to [Username]</div>
        <div class="modal-dialog-footer c">
            <a class="smbutton smbutton-green pointModalOK" href="#" onclick="Modals.pop('OK'); return false;"><span>OK</span></a>
        </div>
    </div>
  • On argument validation error:

    • code e.g. ERR_VALIDATION
    • human e.g. Invalid amount of Points or Invalid Password
  • On amount error error:

    • code e.g. ERR_INVALID_DEBIT_AMOUNT
    • human e.g. You may transfer a maximum of 3,500 Points per transaction
  • Sometimes an account might be banned from the shop (not from the actual website itself), in this case you will get the following error message:

    • code e.g. ERR_VALIDATION
    • human e.g. Sender's account is banned from shop, and cannot transfer Points
⚠️ **GitHub.com Fallback** ⚠️