SHARE
TWEET

get_config

a guest Apr 18th, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. {var LINKS = <link type="text/css" rel="stylesheet" href="{IMG}style.css" />}
  2.  
  3. <script type="text/javascript">
  4. <!--
  5.     $(document).ready(function() {
  6.         var settings = JSON.parse('{PLUGIN-SETTINGS}' || null);
  7.  
  8.         var handler = function(json) {
  9.             /* response handler here */
  10.             console.log(json);
  11.             }
  12.  
  13.         function register_plugin(collector) {
  14.             var plugin = {
  15.             "name": collector['name'],
  16.             "collector": collector,
  17.             "handler": handler,
  18.             "load": (check_option('{OPTIONS}', 'sync') ? 'sync' : 'async')
  19.             }
  20.  
  21.             register_handler(plugin);
  22.         }
  23.  
  24.         function dbinit() {
  25.             var collector = {
  26.                 "name": "{PLUGIN-NAME}.{ID}",
  27.                 "path": "{PLUGIN-DIR}",
  28.                 "folder": "{FOLDER}",
  29.                 "page": "{PAGE}"
  30.             }
  31.  
  32.             register_plugin(collector);
  33.  
  34.             if (!check_option('{OPTIONS}', 'sync'))
  35.                 $.post('{AJAX}dbinit.php', collector, handler, 'html');
  36.                
  37.             build();
  38.         }
  39.  
  40.         dbinit();
  41.        
  42.         function build() {
  43.             let form = '<label>' +
  44.                 'level' +
  45.                 '<select class="config-select" name="cfg-select">' +
  46.                     '<option value="1">hight</option>' +
  47.                     '<option value="2">low</option>' +
  48.                 '</select>' +
  49.             '</label>';
  50.             let box = $('.{PLUGIN-NAME}-{ID} .out-box');
  51.             box.append(form);
  52.             box.find('.config-select').on("change", function() {
  53.                 let level = $(this).val();
  54.                 export_config(level);
  55.             })
  56.         }
  57.        
  58.         function export_config(level) {
  59.             ssb_fire('edit-config', '{"aa","bb"}');
  60.         }
  61.  
  62.     });
  63. -->
  64. </script>
  65.  
  66. <div class="{PLUGIN-NAME}-{ID}" data-plugin-name="{PLUGIN-NAME}.{ID}">
  67.     <div class="out-box">
  68.  
  69.     </div>    
  70. </div>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top