public
Created

  • Download Gist
gistfile1.js
JavaScript
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 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
require.config({
baseUrl:'/js',
paths: {
jquery: 'libs/jquery/jquery-1.8.2.min',
underscore: 'libs/underscore/amd-js/underscore-min',
backbone: 'libs/backbone/amd-js/backbone-min',
validation: 'libs/backbone/amd-js/backbone-validation-amd-min',
serializeObject: 'serializeObject',
jqueryui: 'libs/jquery/jquery-ui-1.8.22.custom.min',
hbs: 'libs/require/hbs',
handlebars: 'libs/require/Handlebars',
i18nprecompile: 'libs/hbs/i18nprecompile',
json2: 'libs/hbs/json2',
text: 'libs/require/text',
domReady: 'libs/require/domReady',
order: 'libs/require/order',
cs: 'libs/require/cs'
},
hbs : {
templateExtension : 'html',
disableI18n : false
}
});
require(['jquery', 'domReady'], function($ ,domReady) {
domReady(function() {
var returnPage;
$('body *').mouseover(function() {
$(this).addClass('hover');
});
$('body *').mouseout(function() {
$(this).removeClass('hover');
});
$('.tf, .ta').focusin(function() {
var me;
me = this;
$(this).addClass('edit');
setTimeout(function() {
$(me).select();
}, 130);
});
$('.tf, .ta').focusout(function() {
var me;
me = this;
$(this).removeClass('edit');
$(this).addClass('save');
setTimeout(function() {
$(me).removeClass('save');
}, 1000);
});
$('table .tf').focusin(function() {
$(this).css({
width: (parseInt($(this).parent().css('width')) - 35) + 'px'
});
});
$('table .tf').focusout(function() {
$(this).css({
width: '100%'
});
});
$('.listOpener').click(function() {
var list;
list = $(this).parent().find('.clickList');
if (list.hasClass('open')) {
list.removeClass('open').slideUp('fast');
} else {
list.addClass('open').slideDown('fast');
}
});
$('.clickList').parent().mouseleave(function() {
$(this).find('.clickList').removeClass('open').slideUp('fast');
});
 
returnPage = 0;
 
({
editPage: function(edit) {
if (edit) {
returnPage = $('html, body').scrollTop();
return $('.pages').animate({
left: -parseInt($('.page').css('width'))
}, 'fast', function() {
return $('html, body').scrollTop(0);
});
} else {
$('html, body').scrollTop(returnPage);
return $('.pages').animate({
left: 0
}, 'fast');
}
}
});
$('ul.framedList li header h4').click(function() {
console.log(' Click ');
if ($(this).parent().parent().hasClass('open')) {
$(this).parent().parent().removeClass('open').find('.framedListContent').slideUp('fast');
} else {
$(this).parent().parent().addClass('open').find('.framedListContent').slideDown('fast');
}
});
$('table.selectable tr').click(function() {
if ($(this).hasClass('selected')) {
$(this).removeClass('selected');
} else {
$(this).addClass('selected');
}
});
$('ul.framedList li ul li').click(function() {
$('#floorId').text($(this).parent().parent().find('h4').text());
$('#roomId').attr('value', $(this).find('label').text());
editPage(true);
});
$('.resetPage').click(function() {
editPage(false);
});
})
});
require(['cs!app'], function(App) {
console.log('Starting application');
App.initialize();
});

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.