base-layout.js
2.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
var myLayout;
var change = false;
var notesNotSaved = false;
var lemmaExNotSaved = false;
var frames_operations = [];
$(window).bind('beforeunload', function() {
warnings = ""
if(change)
warnings = warnings + " - Nie zapisano zmian w schematach składniowych.\n";
if(typeof semanticsChanged != "undefined" && semanticsChanged())
warnings = warnings + " - Nie zapisano zmian w ramach semantycznych.\n";
if(notesNotSaved)
warnings = warnings + " - Nie zapisano notatki.\n";
if(lemmaExNotSaved)
warnings = warnings + " - Nie zapisano przykładu niedowiązangeo.\n";
if(warnings)
return "Uwaga:\n" + warnings
});
$(function() {
$('#content').height($(window).height() - $('#main_menu').height() - 20);
$(window).resize(function() {
$('#content').height($(window).height() - $('#main_menu').height() - 20);
$('.lemma-notes-form #id_message_text').width($(window).width() - $('#left').width() - 50);
if ($.fn.jqGrid) {
jQuery('#scroll').jqGrid('setGridHeight', $('#left').height() - 25 - $('#search-panel').height());
}
resize_splitters();
});
if ($.fn.splitter) {
$('#left').bind('resize', function(e) {
jQuery("#scroll").jqGrid('setGridWidth', $('#left').width() - 2, true);
jQuery('#scroll').jqGrid('setGridHeight', $('#left').height() - 25 - $('#search-panel').height());
$('.lemma-notes-form #id_message_text').width($(window).width() - $('#left').width() - 50);
resize_splitters();
e.stopPropagation();
});
$('#right').bind('resize', function(e) {
e.stopPropagation();
});
$('#content').splitter({
type: "v",
minLeft: 50,
sizeLeft: 420,
resizeToWidth: true,
outline: true
});
}
createWaitDialog();
});
function ShowProgressAnimation()
{
$("#wait-dialog").dialog('open');
}
function HideProgressAnimation()
{
$("#wait-dialog").dialog('close');
}
function resize_splitters() {
// schematy
$('#framesSplit').trigger('resize');
// podglad hasla
$('#prevFramesSplit').trigger('resize');
// semantyka
$('#semantics-hsplit').trigger('resize');
}
function createWaitDialog()
{
$("#wait-dialog").dialog({ autoOpen: false,
modal : 'true',
closeOnEscape: 'false',
closeText: '',
bgiframe: 'true',
resizable: 'false',
open: function (event, ui) {
$('#wait-dialog').css('overflow', 'hidden');
}});
$(".ui-dialog-titlebar").hide();
}