-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinit.js
More file actions
62 lines (56 loc) · 1.98 KB
/
init.js
File metadata and controls
62 lines (56 loc) · 1.98 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
SyntaxHighlighter.config.clipboardSwf = 'http://o2v.net/wp-content/plugins/syntax-highlighter-and-code-prettifier/scripts/clipboard.swf';
SyntaxHighlighter.all();
jQuery(function ($) {
"use strict";
var activeForm = null,
handleTabSwitch = function (active) {
// destroy instance of formLabel if it's not null
if (activeForm !== null) {
activeForm.destroy();
}
if (active === 0) {
activeForm = $("#form1").formLabels();
} else if (active === 1) {
activeForm = $("#form2").formLabels({
excludeElts: 'input[name=secretWord]'
});
} else if (active === 2) {
activeForm = $("#form3").formLabels({
labelParent: 'body',
refreshOnResize: true
});
} else if (active === 3) {
activeForm = $("#form4").formLabels({
safemode: true
});
} else if (active === 4) {
activeForm = $("#form5").formLabels({
labelParent: '#labels'
});
} else if (active === 5) {
activeForm = $("#form6").formLabels({
semantic : false
});
} else if (active === 6) {
activeForm = $("#form7").formLabels({
labelParent : 'body'
});
}
};
$("#tabs").tabs({
activate: function (event, ui) {
handleTabSwitch(ui.newTab.index());
}
});
$("#refreshB").on("click", function () {
activeForm.refreshLabels();
$("#status-message").html("Labels refreshed...");
});
$("form").submit(function (e) {
var formVal = $(this).serialize();
$(".group:visible div.results").html(formVal);
e.preventDefault();
});
// mark first tab as active
handleTabSwitch(0);
});