{
Roo.onReady(function () {
- MTrack.footerSetAndWait();
+ //MTrack.footerSetAndWait();
if (authUser) {
- setTimeout(MTrack.keepLoggedIn, 30000);
+ window.setTimeout(MTrack.keepLoggedIn, 30000);
}
});
},
+
addHandlers : function (toWhat)
{
// forEach? - no IE support?
toWhat = toWhat || document.body; //
// run the main registry
- MTrack.registry.forEach(function(cfg) {
+ Roo.each(MTrack.registry, function(cfg) {
+ //Roo.log("Add select:" + cfg.selector);
try {
var el = Roo.get(toWhat).select(cfg.selector,true)
el[cfg.method].apply(el, cfg.event ? [ cfg.event, cfg.args ] : [ cfg.args ] );
ajaxLoad : function(url,slideleft)
{
+ Roo.get(document.body).scrollTo('top',0,true);
this.currentURL = url;
var target = Roo.get("ajaxbody");
var content = Roo.get("content");
MTrack.missingHashes(target, url);
MTrack.addHandlers(target);
+ // scroll up...
+
},
'easeOut', 'motion'
);
missingHashRequest : false,
missingHashes: function(el,url) {
- //console.log('finding missing hashes?');
+ console.log('finding missing hashes?');
var hashes = [];
el.select('.browse-missing-hash').each(function() {
hashes.push(this.dom.id);
});
+
if (!hashes.length) {
+ Roo.log("no missing hashes");
return;
}
- if (MTrack.missingHashRequest) {
- MTrack.missingHashRequest.abort();
- }
- MTrack.missingHashRequest = Roo.Ajax.request({
+ Roo.Ajax.abort();
+ Roo.Ajax.request({
method : 'POST',
url : baseURL + url,
params : { hashes : hashes.join(',') },
- success : function(data) {
+ success : function(res) {
+ var data = Roo.decode(res.responseText);
+
//console.log(data.data);
if (data.data) {
for(var hash in data.data) {
last_wh : false,
footerPosition : function (force) {
+ return;
var ele = Roo.get('footer');
if (!force &&
(MTrack.last_dh != Roo.lib.Dom.getDocumentHeight() || MTrack.last_wh != Roo.lib.Dom.getViewHeight())) {
MTrack.last_wh = Roo.lib.Dom.getViewHeight();
},
+
+ keepLoggedIn: function()
+ {
+ Roo.Ajax.request({
+ url : baseURL + '/Login.html',
+ method: 'POST',
+ data : { refresh : 1 },
+ success : function() {
+
+ window.setTimeout(MTrack.keepLoggedIn, 30000);
+ // what if it's false..currentURL = false;
+
+
+ }
+
+ })
+
+
+
+ },
/*
$(window)
*/
footerSetAndWait : function () {
- this.footerPosition();
- setTimeout(function () {
+ return;
+ /*this.footerPosition();
+ window.setTimeout(function () {
MTrack.footerSetAndWait();
}, 1500);
+ */
}
// ajax change project, and refresh body..
Roo.Ajax.request({
method: 'GET',
- url : baseURL + '/Project.html',
+ url : baseURL + '/core_project',
params : { active_project_id : this.value },
success : function() {
// what if it's false..currentURL = false;
var href= this.dom.getAttribute('href').substring(baseURL.length);
try {
- window.history.pushState( { url: href }, "Browse : " + href , this.href );
+ window.history.pushState( { url: href }, "Browse : " + href , this.dom.href );
+ Roo.log("history push state");
} catch (e) {
Roo.log(e);
{separator:'---------------' },
{name:'Quotes', openWith:'(!(> |!|>)!)'},
{name:'Code', openWith:'{{{\\n', closeWith:'\\n}}}'},
- {separator:'---------------' },
+ {separator:'---------------' },1
{name:'Preview', call:'preview', className:'preview'}
]
});