User:Ultimate Dark Carnage/sandbox2.js

(function($,mw){   importArticles({ type: 'script', articles: [ 'User:Ultimate_Dark_Carnage/keycode.js' ]   }, {        type: 'style', articles: [ 'User:Ultimate_Dark_Carnage/test4.css' ]   });    if (mw.config.get('wgCanonicalSpecialPageName') == 'Chat'){        $('.ChatWindow').find('.Rail').append( $(' ', {               "class": "button-container",                "id": "button-container",                css: {                    "text-align": "center"                },                html: $('', { "class": "wikia-button", text: "Click Here", "data-modal": "Action", on: { "click": function(event){ var chatUsers = mainRoom.models.users._byCid; var users = []; var test_html = ' \ \                                   \                                ';                            var config = { width: 650, id: "TestModal", buttons: [ {                                           id: "cancel", message: "Cancel", handler: function{ $('#TestModal').closeModal; }                                       },                                        {                                            id: "submit", defaultButton: true, message: "Submit", handler: function{ $('#TestModal').closeModal; for (var i = 0; i < document.getElementsByClassName('user-selected').length; i++){ users.push(document.getElementsByClassName('user-selected')[i].getElementsByClassName('user-name')[0].text); }                                               mainRoom.openPrivateRoom(users); }                                       }                                    ]                                };                            for (var i in chatUsers){ test_html += ''                               ;                            }                            $.openCustomModal(event.target.getAttribute('data-modal'), test_html, config); }                   }                })            })        );        console.log(mainRoom.models.users._byCid);    } })(jQuery, mediaWiki);