Window jqwidgets

Window project with attached libraries

by Alexey Sharifullin

HTML

<script src="http://jqwidgets.com/public/jqwidgets/jqx-all.js"></script>
<link rel="stylesheet" href="http://jqwidgets.com/public/jqwidgets/styles/jqx.base.css">
<link rel="stylesheet" href="http://jqwidgets.com/public/jqwidgets/styles/jqx.energyblue.css">
<input type="button" value="Show" id="showWindowButton" />

JavaScript

function initWindow(windowId, selector, okText, cancelText) {
    var c = $('<div style="visibility: hidden;"/>');
    var w = $('<div/>', {"id":windowId});
    w.append($('<div/>', {"class": "sa-window-title"}));
    var content = '<div><div class="sa-window-text"></div><div><div id="buttons_' + windowId + '" style="position: relative; margin-top: 15px; text-align: center"><input type="button" id="ok_' + windowId + '" value="' + okText + '" style="margin-right: 10px" /><input type="button" id="cancel_' + windowId + '" value="' + cancelText + '" /></div></div></div>';
    w.append($(content));
    c.append(w);
    if(selector)
        $(selector).append(c);
    else
        $("body").append(c);
}

        function showMessage(winId, title, text, functionOk, functionCancel, settings) {
            var width = 270;
            var height = 145;
            var minWidth = 250;
            var minHeight = 100;
            var maxHeight = height;
            var maxWidth = width;
            var theme = "classic";
            var resizable = false;
            var isModal = true;
            if(settings!==undefined) {
                try { width = (settings.width)?settings.width:width; maxWidth = width; } catch(e) {}
                try { height = (settings.height)?settings.height:height; maxHeight = height;} catch(e) {}
                try { minWidth = (settings.minWidth)?settings.minWidth:minWidth} catch(e) {}
                try { minHeight = (settings.minHeight)?settings.minHeight:minHeight} catch(e) {}
                try { maxHeight = (settings.maxHeight)?settings.maxHeight:maxHeight} catch(e) {}
                try { maxWidth = (settings.maxWidth)?settings.maxWidth:maxWidth} catch(e) {}
                try { theme = (settings.theme)?settings.theme:theme} catch(e) {}
                try { resizable = (settings.resizable)?settings.resizable:resizable} catch(e) {}
                try { isModal = (settings.isModal!==undefined)?settings.isModal:isModal} catch(e) {}
...