Apps Home
|
Create an App
link in panel app
Author:
valleriestarr
Description
Source Code
Launch App
Current Users
Created by:
Valleriestarr
// vars var total_tipped = 0; var high_tip_username = null; var high_tip_amount = 0; var last_tip_username = null; var last_tip_amount = 0; var tippers = []; cb.settings_choices = [ ]; // handlers function inArray(needle,haystack) { var count=haystack.length; for(var i=0;i<count;i++) { if(haystack[i]===needle){return true;} } return false; } cb.onTip(function(tip) { total_tipped += tip['amount'] last_tip_amount = tip['amount'] last_tip_username = tip['from_user'] if (tip['amount'] > high_tip_amount) { high_tip_amount = tip['amount'] high_tip_username = tip['from_user'] } if (inArray(tip['from_user'], tippers) == false){ tippers.push(tip['from_user']) } cb.drawPanel(); }); cb.onDrawPanel(function(user) { return { 'template': '3_rows_12_22_31', 'row1_label': 'Total Tippers:', 'row1_value': '' + tippers.length, 'row2_label': 'Highest Tipper:', 'row2_value': format_username(high_tip_username) + ' (' + high_tip_amount + ')', 'row3_value': 'My Links @ beacons.ai/valleriestarr' }; }); function format_username(val) { if (val === null) { return "--"; } else { return val.substring(0, 12); } }
© Copyright Sisiva.Com 2011- 2024. All Rights Reserved.