tungnt128888 / LMS.SearchStudent

// ==UserScript==
// @name       LMS.SearchStudent
// @match      http://lms.apaxenglish.com/*

// @license MIT
// @icon http://pics.smotri.com/cskins/blue/smiles/bt.gif
// @require http://code.jquery.com/jquery-latest.js
// ==/UserScript==

var checkExist2 = setInterval(function() {
    if ($('#side-menu').length) {

        var url_full = "http://" + document.domain + "/#/counseling/student";
        //alert(url_full);
        var win = window.open(url_full, '_self');

        if (win) {
            //Browser has allowed it to be opened
            win.focus();
        } else {
            //Browser has blocked it
            alert('Please allow popups for this website');
        }

        clearInterval(checkExist2);
    }
}, 200); // check every 100ms



var checkExist3 = setInterval(function() {
    if ($('#stussearch').length) {

        //<select class="input-sm form-control input-s-sm inline ng-valid ng-dirty" id="CounType" ng-options="b.code_id as b.code_value for b in countype" ng-model="ngCounType">
        //<option value="" class="">Select Type</option><option value="0">Name</option><option value="1">Nickname</option>
        //<option value="2">Student ID</option><option value="3">Login ID</option><option value="4">Home Phone</option></select>

        //$("div.col-sm-2 select").removeClass().addClass('input-sm form-control input-s-sm inline ng-valid ng-dirty');
        //$("div.col-sm-2 select").attr("class","input-sm form-control input-s-sm inline ng-valid ng-dirty6555");
        //$('input[name="P290"]').attr("maxlength","10");
        //$("div.col-sm-2 select").val("2");
        //input-sm form-control input-s-sm inline ng-valid ng-dirty
        //input-sm form-control input-s-sm inline ng-valid ng-dirty
        //input-sm form-control input-s-sm inline ng-pristine ng-valid
        //input-sm form-control input-s-sm inline ng-valid ng-dirty
//$(document).ready(function() {
   // $("#CounType").prop('selected', true);
    // you need to specify id of combo to set right combo, if more than one combo
//});
        //$("#CounType option[value='2']").attr("selected", true);
        //$('#semester').val("3").prop('selected', true);
        //$('#stussearch').val("139200");

        //$('#logo-pad').hide();
        //$("#footer").delay(5000).show(1);

        //$("button:contains(Save and Apply)").attr("id","continue");
        //document.getElementById('searchsubmit').click();

        clearInterval(checkExist3);
    }
}, 200); // check every 100ms