User:Robyn Grayson/common.js

// Why do I find myself doing these stuff?? $(function {   // little bit of this, little bit of that haha    var styleElement = document.createElement('style'); styleElement.innerHTML='.speech {\    position: relative;\    width: 200px;\    height: 100px;\    text-align: center;\    line-height: 100px;\    background-color: #fff;\    border: 2px solid #666;\    border-radius: 10px;\ }\ .speech:after {\    content: \' \';\    position: absolute;\    width: 0;\    height: 0;\    left: 28px;\    top: 100px;\    border: 7px solid;\    border-color: #fff transparent transparent #fff;\ }\ .speech:before {\    content: \' \';\    position: absolute;\    width: 0;\    height: 0;\    left: 26px;\    top: 100px;\    border: 10px solid;\    border-color: #666 transparent transparent #666;\ }'; $('head').append(styleElement);    $('').html('Help')        .appendTo('.toolbar .tools')        .click(function { var greetings = [ 'Greetings! How may I help you today?', 'Hiya! What would you like to do today?', 'Heyo! How may I serve you?' ],           greet = greetings[Math.floor(Math.random *greetings.length)]; $.showCustomModal('Help', ' '           + greet +         ' \        \        fill stuff here...', {                width: 600,                id: 'helpModal',                buttons: [{                    id: 'helpClose',                    defaultButton: true,                    message: 'Close',                    handler: function {                        $('#helpModal').closeModal;                    }                }]            }); }); });