• If you need help or want to discuss things, you now can also join us on our Discord Server!
  • A first preview of the unlimited version of SinusBot can be found in the Upcoming Changes thread. A version for Windows will follow, but we don't have a release date, yet.

Feature New type 'checkbox', Fix for settings, Pattern for input

Status
Not open for further replies.

VJean

Member
1. Need type: 'checkbox' for settings. Types
This setting it's bad usabelity:
PHP:
vars: {
  selectOne: {
    title: 'check it',
    type: 'select',
    options: ['yes','no']
  }
},


2. Fix for Script page. Add <label for="id" />
Current view:
HTML:
<h4 class="ng-binding ng-scope" ng-if="!script.enableWeb" style="margin-bottom: 3px;">
<input class="ng-pristine ng-untouched ng-valid" ng-model="settings[scriptName].enabled" value="1" style="margin-right: 6px;" ng-hide="script.autorun" type="checkbox">
Advertising (Text)
<small class="ng-binding">2.0 by Michael Friese &lt;[email protected]&gt;, Raphael Touet &lt;[email protected]&gt; (advertising)</small>
</h4>
Change to:
HTML:
<h4 class="ng-binding ng-scope" ng-if="!script.enableWeb" style="margin-bottom: 3px;">
<input id="advertising" class="ng-pristine ng-untouched ng-valid" ng-model="settings[scriptName].enabled" value="1" style="margin-right: 6px;" ng-hide="script.autorun" type="checkbox">
<label for="advertising"> Advertising (Text)</label>
<small class="ng-binding">2.0 by Michael Friese &lt;[email protected]&gt;, Raphael Touet &lt;[email protected]&gt; (advertising)</small>
</h4>


3. Add var and value "patern" for input tag. http://www.w3schools.com/tags/att_input_pattern.asp
PHP:
vars: {
  stringPatern: {
    title: 'sample string patern',
    type: 'string',
    pattern: '[A-Za-z]{3}'
  }
},
generated to setting:
HTML:
<input ng-if="var.type == 'string'" ng-model="settings[var.name]" class="form-control ng-pristine ng-untouched ng-valid ng-scope" id="f__adminUids" placeholder="" type="text" pattern="[A-Za-z]{3}>
 

flyth

is reticulating splines
Staff member
Developer
Contributor
Ack^^ Will work on that.

However, the pattern thing will require more love: it'd require server side checking as well and thus compatibility between front- and backend. Will think about that :)
 

VJean

Member
@flyth, Then can not ask about global variables/functions, import modules, FileIO, Sockets and plugin2plugin interaction? )
Already required wrapper for frequently used functions: the "right" to ask the author and titles, time conversion, etc.
 

flyth

is reticulating splines
Staff member
Developer
Contributor
Imports are planned, however "shared" resources are not. Scripts run in loosely isolated environments as otherwise they would be prone to conflicts that may cause unwanted side effects.

However, you can pass data from script to script using
Code:
sinusbot.broadcast('foobar', { a: 1 });
and receive via
Code:
sinusbot.on('broadcast:foobar', function(data) { ... });
 
Status
Not open for further replies.
Top