| 776 |
lars |
1 |
var UIAlertsApi = function () {
|
|
|
2 |
|
|
|
3 |
var handleDemo = function() {
|
|
|
4 |
$('#alert_show').click(function(){
|
|
|
5 |
App.alert({
|
|
|
6 |
container: $('#alert_container').val(), // alerts parent container(by default placed after the page breadcrumbs)
|
|
|
7 |
place: $('#alert_place').val(), // append or prepent in container
|
|
|
8 |
type: $('#alert_type').val(), // alert's type
|
|
|
9 |
message: $('#alert_message').val(), // alert's message
|
|
|
10 |
close: $('#alert_close').is(":checked"), // make alert closable
|
|
|
11 |
reset: $('#alert_reset').is(":checked"), // close all previouse alerts first
|
|
|
12 |
focus: $('#alert_focus').is(":checked"), // auto scroll to the alert after shown
|
|
|
13 |
closeInSeconds: $('#alert_close_in_seconds').val(), // auto close after defined seconds
|
|
|
14 |
icon: $('#alert_icon').val() // put icon before the message
|
|
|
15 |
});
|
|
|
16 |
});
|
|
|
17 |
}
|
|
|
18 |
|
|
|
19 |
var handleCode = function() {
|
|
|
20 |
var myTextArea = document.getElementById('code_editor_demo');
|
|
|
21 |
var myCodeMirror = CodeMirror.fromTextArea(myTextArea, {
|
|
|
22 |
lineNumbers: true,
|
|
|
23 |
matchBrackets: true,
|
|
|
24 |
styleActiveLine: true,
|
|
|
25 |
mode: 'javascript',
|
|
|
26 |
smartIndent: true,
|
|
|
27 |
indentWithTabs: true,
|
|
|
28 |
readOnly: true,
|
|
|
29 |
inputStyle: 'textarea',
|
|
|
30 |
theme: 'neo'
|
|
|
31 |
});
|
|
|
32 |
}
|
|
|
33 |
|
|
|
34 |
return {
|
|
|
35 |
|
|
|
36 |
//main function to initiate the module
|
|
|
37 |
init: function () {
|
|
|
38 |
handleDemo();
|
|
|
39 |
handleCode();
|
|
|
40 |
}
|
|
|
41 |
};
|
|
|
42 |
|
|
|
43 |
}();
|
|
|
44 |
|
|
|
45 |
jQuery(document).ready(function() {
|
|
|
46 |
UIAlertsApi.init();
|
|
|
47 |
});
|