/**
* application.js - superglue at its finest
* Setting up the interface, binding toolbars, loading everything else up.
* Everything but the kitchen sink.
*/
var applicationNS = odkmaker.namespace.load('odkmaker.application');
applicationNS.newForm = function()
{
$('.workspace:visible').empty().append();
releaseDirtyFlag();
$('.formBuilder .header h1').text(msg_untitled_form);
$('.formBuilder .header h1').attr('title', msg_untitled_form);
$('.formBuilder .header #renameFormField').val(msg_untitled_form);
$('.formBuilder .header #formType').text('Draft');
$('.propertiesPane:visible h3')
.empty();
$('.ctrlDescription').addClass(CONST_CSS_CLASS_HIDE_SESSION);
$('.ctrlDescription .propertiesCtrlName')
.empty();
$('.ctrlDescription .propertiesCtrlExplain')
.empty();
$('.propertiesPane:visible .propertyList')
.empty()
.append('
' + lbl_to_get_start + '- ' + lbl_drag_ques_from_toolbar + '
- ' + lbl_click_to_select + '
');
odkmaker.data.currentForm = null;
//odkmaker.data.formSettings = {};
initFormSettingDefaultValue();
odkmaker.data.currentFormHasExpCode = null;
isFormOpenSpecial = false;
lookupdatainf.PublicLookupTables = undefined;
openSpecialControlDisable(false);
disableMenuSaveAs(false);
disableMenuInsertForm(false);
utils.seq.resetUniqueId(0);
releaseDirtyFlag();
};
var initMenu = function()
{
// Wire up menu
$('.header .menu li').dropdownMenu();
// Wire up menu actions
$.live('.header .menu .displayLanguages a', 'click', function(event)
{
odkmaker.i18n.displayLanguage($(this).attr('rel'));
$('.workspace:visible .control').trigger('odkControl-propertiesUpdated');
});
// External links should open in a new window
$("a[rel$='external']").click(function()
{
this.target = "_blank";
});
// Update loading screen status
setTimeout(function()
{
$('.loadingScreen .status').text(lbl_chk_wh_are_you);
}, 0);
};
$(function()
{
initMenu();
});