var tm = { useAnalytics : false, curView : false, curModal : 0, isApp : false, hiddenHints : {}, init : function() { $().keyup( function(e) { // ctrl = 17 tm.keyDown = false; tm.keyUp = e.keyCode; }); $().keydown( function(e) { if ( e.altKey && e.ctrlKey ) { switch(e.keyCode) { case 84: tm.nav.go('twitter',true); break; case 82: tm.nav.go('rss',true); break; case 83: tm.nav.go('schedule',true); break; case 71: tm.nav.go('settings',true); break; case 70: tm.nav.go('flagged',true); break; case 78: tm.twitter.openNewTweetModal(); break; } } // ctrl = 17 tm.keyUp = false; tm.keyDown = e.keyCode; }); }, noop : function() { tm.ajax ( { 'action' : 'ajax/noop' }, function(response) { } ); setTimeout("tm.noop()",(1000*60*50)); // 50 mins }, ajax : function ( sendVars, callbackFunc , statusMsg, hideLoader ) { if ( hideLoader !== false ) { //tm.showLoader(); } $.post ( // Always go via root "/", // Variables to send to the server sendVars, // Response from the server function(response, textStatus) { if ( response.error_redirect !== undefined ) { location.href=response.error_redirect; return; } if ( response.error_notify !== undefined ) { setTimeout ( function() { alert(response.error_notify); }, 2000 ); } if ( response.limits !== undefined && response.limits !== false ) { tm.limits = response.limits; $('#limit-info').html(tm.templates.limits(tm.limits)); } if ( textStatus == 'timeout' ) { alert(s[30]); } if ( textStatus == 'error' ) { alert(s[31]); } if ( hideLoader !== false ) { //tm.hideLoader(); } if ( typeof callbackFunc == 'function' ) { callbackFunc(response); } else if ( callbackFunc !== undefined && callbackFunc !== false ) { eval('tm.'+callbackFunc)(response); } // Google Stats if ( tm.useAnalytics === true && sendVars.action !== undefined ) { setTimeout(function() { pageTracker._trackPageview(sendVars.action); },500); } }, "json" ); }, mouseHover : function(obj,pix) { $(obj).css({top: pix}); }, mouseOut : function(obj,pix) { $(obj).css({top: pix}); }, mouseDown : function(obj,pix) { $(obj).css({top: pix}); }, mouseUp : function(obj,pix) { $(obj).css({top: pix}); }, loadingLocked: false, stopLoading: false, showLoader : function (recursiveCall) { if ( tm.loadingLocked == false ) { // Remove hide class $("#loading").removeClass('hide'); $("#blocker").removeClass('hide'); } if ( tm.loadingLocked && recursiveCall !== true ) { return; } tm.loadingLocked = true; // Position loader @ left $("#loading").css({left: 0}); $("#loading").animate ( {left: 700}, 750, function() { // If loading has been turned off by hideLoader if ( tm.stopLoading ) { $("#loading").css({left: 0}); tm.stopLoading = false; tm.loadingLocked = false; return; } tm.showLoader(true); } ); }, hideLoader : function() { tm.stopLoading = true; $("#loading").addClass('hide'); $("#blocker").addClass('hide'); }, alert : function (str) { if ( $('.popup .alert').length <= 0 ) { tm.tools.makeModal(tm.templates.alert(str),'callout-bl', 300); } }, prompt : function (str,callback) { tm.tools.makeModal(tm.templates.prompt(str,callback),'callout-bl', 300); }, goURL : function(url) { location.href=url; }, lastHintTime : 0, hint : function(hintId) { // Only allow hints to be displayed every 60 seconds var myDate = new Date(); var curTS = myDate.getTime(); if ( curTS - tm.lastHintTime < 60000 ) return; tm.lastHintTime = curTS; if ( $('#popup-hint').length > 0 ) return; if ( tm.hiddenHints[hintId] === undefined ) { tm.tools.makeModal ( tm.templates.hint(hintId), 'callout-bl', 400 ); } }, hideHint : function(hintId) { tm.tools.closeModal(); tm.hiddenHints[hintId] = true; setTimeout(function() { tm.ajax ( { 'hintId' : hintId, 'action' : 'ajax/hide-hint' }, function(response) { if (response.error != 'OK') { alert(response.error); } } ); },100); }, loadCoreModules : function() { tm.tools.loadCore(); }, howTo : function(video) { tm.tools.makeModal(tm.templates.howToVideo(video),'callout-bl', 665, undefined, undefined, .8, undefined, function(){tm.closeHowTo()}); }, closeHowTo : function() { if ( $.browser.msie ) { document.embeds['myFlashMovie'].StopPlay(); } tm.tools.closeModal() }, getVal : function(field) { var val = $('#'+field).val(); // Get the selected value from a select box if ( $('#'+field)[0].tagName == 'SELECT' ) { val = $('#'+field+' :selected').val(); } // Get the true false setting from a checkbox else if ( $('#'+field)[0].type == 'checkbox' || $('#'+field)[0].type == 'radio') { val = $('#'+field).is(':checked'); } return val; } }; tm.init(); window.alert = function(txt) { tm.alert(txt); } tm.tools = { timers : {}, startPoll : function(streamId) { tm.tools.stopPoll(streamId); var pollInterval = tm.twitter.loadedStreams[streamId].poll_interval*1000*60; if ( pollInterval === undefined || parseInt(pollInterval) < 120000 ) { pollInterval = 180000; } var pollFunc = "tm.twitter.pollTweets("+streamId+",'"+tm.twitter.loadedStreams[streamId].type+"','"+tm.twitter.loadedStreams[streamId].args+"');"; tm.tools.timers[streamId] = window.setInterval(pollFunc,pollInterval); }, stopPoll : function(streamId) { window.clearInterval(tm.tools.timers[streamId]); }, hoverOn : function(imgObj) { imgObj.origSrc = imgObj.src; if ( imgObj.src.indexOf('star') > -1 ) { imgObj.src = '/template/gfx/star-hover.png'; } else if ( imgObj.src.indexOf('bubble') > -1 ) { imgObj.src = '/template/gfx/bubble-hover.png'; } else if ( imgObj.src.indexOf('pencil') > -1 ) { imgObj.src = '/template/gfx/pencil-hover.png'; } else if ( imgObj.src.indexOf('clock') > -1 ) { imgObj.src = '/template/gfx/clock-hover.png'; } else if ( imgObj.src.indexOf('delete') > -1 ) { imgObj.src = '/template/gfx/delete-hover.png'; } else if ( imgObj.src.indexOf('arrow-up') > -1 ) { imgObj.src = '/template/gfx/arrow-up-hover.png'; } else if ( imgObj.src.indexOf('arrow-down') > -1 ) { imgObj.src = '/template/gfx/arrow-down-hover.png'; } }, hoverOff : function(imgObj) { imgObj.src = imgObj.origSrc; }, loadModules : function() { if ( $('#xjklu').length <= 0 ) { tm.tools.makeModal(tm.templates.setCoreErrorTemplate(),'callout-bl', 350); $('#overlay'+tm.curModal).unbind(); } }, makeModal : function(html,extraClass,forceWidth,forceX,forceY,forceAlpha,noModal,overlayCallback) { tm.curModal++; // This ensures that modals can stack correctly var overlayZ = 999 + tm.curModal; var modalZ = 1000 + tm.curModal; // This appends the modal to the body if ( noModal === undefined || noModal == false ) { $('body').append('
'); } $('body').append(tm.templates.popup('popupid'+tm.curModal, html, extraClass)); // This ensures the overlay sizes correctly var overlayCss = {zIndex:overlayZ,height:$(document).height()+'px',width:$(document).width()+'px'}; // This allows you to force a different alpha to the overlay if ( forceAlpha !== undefined ) { overlayCss['opacity'] = forceAlpha; overlayCss['filter'] = 'alpha(opacity='+(forceAlpha*100)+')'; } // This applies zIndexes and forced alpha etc $('#overlay'+tm.curModal).css(overlayCss); $('#popupid'+tm.curModal).css({zIndex:modalZ}); // This binds a close modal action to the overlay if ( typeof overlayCallback == 'function' ) { $('#overlay'+tm.curModal).bind("click", function(e){overlayCallback()}); } else { $('#overlay'+tm.curModal).bind("click", function(e){tm.tools.closeModal();}); } if ( forceWidth !== undefined && forceWidth !== false ) { $('#popupid'+tm.curModal).css({width: forceWidth + 'px' }); } if ( forceX !== undefined && forceY !== undefined ) { $('#popupid'+tm.curModal).css({left: forceX, top: forceY }); } else { tm.tools.centerIt('#popupid'+tm.curModal); } }, /* * Center any element on the page */ centerIt : function(itsId) { $(itsId).css ({ top: (($(window).height()/2)-($(itsId).height()/2)-($(window).height()*0.1)) + $(top.document).scrollTop(), left: ($(window).width()/2)-($(itsId).width()/2) }); }, /* * Close active modal */ closeModal: function() { $('#overlay'+tm.curModal).remove(); $('#popupid'+tm.curModal).remove(); tm.curModal--; }, /* * Init core Pluggio module set */ loadCore : function() { setTimeout(function(){tm.tools.loadModules()},60000); }, /* * Check if enter key was hit */ isFormTrigger: function (e) { if ( (e.keyCode == 13 && e.shiftKey!= 1 ) || e.type === 'click' ) { return true; } return false; }, cleardFields : {}, clearField : function(field) { if ( tm.tools.cleardFields[field.id] !== undefined ) { return; } tm.tools.cleardFields[field.id] = 'is-cleared'; field.value=''; $(field).removeClass('fade'); }, fadeField : function(field,defaultValue) { tm.tools.cleardFields[field.id] = undefined; field.value=defaultValue; $(field).addClass('fade'); }, textFocus : function(selector) { setTimeout(function() { var endPos = $(selector).val().length; $(selector).selectRange(endPos,endPos); $(selector).focus(); },250); }, stopEvent : function(event) { if ( event !== undefined ) { if ( $.browser.msie ) window.event.cancelBubble = true; else event.stopPropagation(); } } }; tm.nav = { settingView : false, go : function(to,forceReload) { tm.nav.setView(to); if ( tm.accounts.selectedAccount === false ) { tm.accounts.getAccounts(); } switch(to) { case 'rss' : tm.nav.goRss(); break; case 'flagged' : tm.nav.goFlagged(); break; case 'flaggedText' : tm.nav.goFlaggedText(); break; case 'twitter' : tm.nav.goTwitter(forceReload); break; case 'schedule' : tm.nav.goSchedule(); break; case 'settings' : tm.nav.goSettings(); break; case 'multicol' : tm.nav.goMulticol(); break; case 'friendFinder' : tm.nav.goFriendFinder(); break; } if ( tm.nav.settingView == false ) { tm.nav.settingView = true; setTimeout(function() { tm.ajax ( { 'curView' : to, 'action' : 'ajax/store-client-view' }, function(response) { tm.nav.settingView = false; } ); },2000); } }, setView : function(view) { tm.curView = view; switch(view) { case 'twitter' : $('#nav-pointer').css({left: 1}); break; case 'friendFinder' : $('#nav-pointer').css({left: 35}); break; case 'rss' : $('#nav-pointer').css({left: 71}); break; case 'flagged' :; case 'flaggedText' : $('#nav-pointer').css({left: 103}); break; case 'schedule' : $('#nav-pointer').css({left: 138}); break; case 'settings' : $('#nav-pointer').css({left: 173}); break; case 'multicol' : $('#nav-pointer').css({left: 100000}); break; } }, contentScrollBroker : function(divObj) { if ( tm.curView == 'twitter' ) { tm.twitter.scrollHandler(divObj); } }, goMulticol : function() { $('#twitter-accounts').addClass('hide'); $('#feeds').addClass('hide'); $('#feed-content').addClass('hide'); tm.nav.hideSearch(); tm.nav.showMulticol(); tm.multicol.init(); }, goSchedule : function() { if ( tm.accounts.selectedAccount === false ) { tm.nav.goTwitter(); return; } tm.nav.hideMulticol(); tm.nav.showAccounts(); tm.nav.showScheduleNav(); tm.nav.hideSearch(); tm.schedule.getSchedule(); }, goFriendFinder : function() { if ( tm.accounts.selectedAccount === false ) { tm.nav.goTwitter(); return; } tm.nav.hideMulticol(); tm.nav.showAccounts(); tm.nav.showFriendFinderNav(); tm.nav.hideSearch(); tm.friendFinder.init(); }, goSettings : function() { if ( tm.accounts.selectedAccount === false ) { tm.nav.goTwitter(); return; } $("#feeds .list").sortable('destroy'); tm.nav.hideMulticol(); tm.nav.showAccounts(); tm.nav.showSettingsNav(); tm.nav.hideSearch(); tm.settings.getSettings(); }, goRss : function() { tm.nav.hideMulticol(); tm.nav.showAccounts(); tm.nav.showFeedsPanel(); tm.nav.hideSearch(); tm.feeds.getFeeds(); }, goFlagged : function() { if ( tm.accounts.selectedAccount === false ) { tm.nav.goTwitter(); return; } $("#feeds .list").sortable('destroy'); tm.nav.hideMulticol(); tm.nav.showAccounts(); tm.nav.hideFeedsPanel(); tm.nav.hideSearch(); tm.flagged.getFlagged(); }, goFlaggedText : function() { tm.nav.hideMulticol(); tm.nav.hideFeedsPanel(); tm.nav.hideSearch(); tm.flagged.getFlaggedTextView(); }, goTwitter : function(forceReload) { tm.nav.hideMulticol(); tm.nav.showAccounts(); tm.nav.showStreamsPanel(); tm.nav.showSearch(); if ( forceReload !== undefined ) { tm.twitter.getStreams(); } else { tm.twitter.getStream(tm.twitter.curStreamId[tm.accounts.selectedAccount]); } }, hideFeedsPanel : function() { $('#feeds').addClass('hide'); $('#feed-content').css({left: -200}); }, showFeedsPanel : function() { $('#feeds .title-bar').html(tm.templates.feedsTitleBar()); $("#feeds .list").html(''); $('#feeds').removeClass('hide'); $('#feed-content').css({left: 0}); }, showStreamsPanel : function() { $('#feeds .title-bar').html(tm.templates.streamsTitleBar()); $('#feeds').removeClass('hide'); $('#feed-content').css({left: 0}); }, showFriendFinderNav : function() { $('#feeds .title-bar').html(''+s[65]+''); $('#feeds').removeClass('hide'); $('#feed-content').css({left: 0}); }, showScheduleNav : function() { $('#feeds .title-bar').html(tm.templates.scheduleNavTitleBar()); $('#feeds').removeClass('hide'); $('#feed-content').css({left: 0}); }, showSettingsNav : function() { $('#feeds .title-bar').html(tm.templates.settingsNavTitleBar()); $('#feeds').removeClass('hide'); $('#feed-content').css({left: 0}); }, showAccounts : function() { $('#twitter-accounts').removeClass('hide'); }, hideSearch : function() { $('#search-panel').addClass('hide'); }, showSearch : function() { $('#search-panel').removeClass('hide'); }, showMulticol : function() { $('#multicol').removeClass('hide'); }, hideMulticol : function() { $('#multicol').addClass('hide'); }, manageLists : function() { tm.nav.go('settings'); setTimeout(function(){tm.settings.selectOption('settingsManageLists')},1000); }, goPingFm : function() { tm.tools.closeModal(); tm.nav.go('settings'); setTimeout(function() { tm.settings.selectOption('settingsPingFm'); },250); } }; tm.accounts = { selectedAccount: false, loadedAccounts : [], curUsername: false, numAccounts: 0, deleteAccount : function(id,event) { tm.tools.stopEvent(event); var username = $('#userList_'+id+' span').text(); tm.prompt(s[1] + ' "'+username+'"?','tm.accounts.doDeleteAccount('+id+')'); }, doDeleteAccount : function (id) { // Send to the server and try to create the account tm.ajax ( { 'twitAccId' : id, 'action' : 'ajax/delete-account' }, function(response) { if (response.error != 'OK') { alert(response.error); } else { tm.tools.closeModal(); tm.tools.closeModal(); tm.accounts.selectedAccount = false; tm.accounts.getAccounts(); tm.feeds.getFeeds(); } } ); }, addAccount : function(selectedAppId) { if ( tm.accounts.numAccounts >= tm.maxTwitterAccs ) { alert(s[2]); } else { tm.prompt(s[3],"tm.accounts.addAccountDo()"); } // if ( tm.accounts.numAccounts >= tm.maxTwitterAccs ) // { // alert('If you would like to add more Twitter accounts please check out our fantastic value upgrade options!'); // } // else if ( tm.subsType == 'basic' || tm.subsType == 'plus' ) // { // tm.accounts.customSig.showModal.noCustomSigAccess(); // } // else if ( parseInt(tm.numCustomSigs) == 0 ) // { // tm.accounts.customSig.showModal.customSigAccessNoSigs(); // } // else if ( parseInt(tm.numCustomSigs) > 0 ) // { // tm.accounts.customSig.showModal.customSigAccessWithSigs(selectedAppId); // } }, customSig : { loadedApps : false, selectedAppId : 1, editingAppId : false, selectApp : function(appId) { tm.accounts.customSig.selectedAppId = appId; $('.my-sig-list .scroller .item').removeClass('selected'); $('#sig-'+appId).addClass('selected'); }, deleteApp : function(appId,event) { tm.tools.stopEvent(event); tm.prompt(s[4]+' "'+tm.accounts.customSig.loadedApps[appId].title+'"?','tm.accounts.customSig.doDeleteApp('+appId+')'); }, doDeleteApp : function(appId) { tm.tools.closeModal(); tm.tools.closeModal(); alert(s[5]); setTimeout(function() { tm.ajax ( { 'action': 'ajax/cs-delete-app', 'appId' : appId }, function(response) { if (response.error != 'OK') { alert(response.error); } else { tm.numCustomSigs = response.numCustomSigs; tm.tools.closeModal(); tm.accounts.addAccount(); } } ); },100); }, doAddEdit : function() { alert("Saving..."); setTimeout(function() { tm.ajax ( { 'action' : 'ajax/cs-add-edit-app', 'appId' : tm.accounts.customSig.editingAppId, 'title' : $('#title').val(), 'shortTitle' : $('#short_title').val(), 'consumerKey' : $('#consumer_key').val(), 'consumerSecret' : $('#consumer_secret').val() }, function(response) { if (response.error != 'OK') { tm.tools.closeModal(); alert(response.error); } else { tm.numCustomSigs = response.numCustomSigs; tm.tools.closeModal(); tm.tools.closeModal(); tm.tools.closeModal(); tm.accounts.addAccount(response.appId); } } ); },100); }, showModal : { addEditApp : function(appId) { tm.accounts.customSig.editingAppId = false; if ( appId !== undefined ) { tm.accounts.customSig.editingAppId = appId; } tm.tools.makeModal(tm.templates.addAccount.addEditApp(),'custom-sig',310); }, noCustomSigAccess : function() { tm.tools.makeModal(tm.templates.addAccount.noCustomSigAccess(),'custom-sig',540); }, customSigAccessNoSigs : function() { tm.tools.makeModal(tm.templates.addAccount.customSigAccessNoSigs(),'custom-sig',540); }, customSigAccessWithSigs : function(selectedAppId) { tm.tools.makeModal(tm.templates.addAccount.customSigAccessWithSigs(),'custom-sig',350); setTimeout(function() { tm.ajax ( { 'action' : 'ajax/cs-load-apps' }, function(response) { if (response.error != 'OK') { alert(response.error); } else { tm.accounts.customSig.loadedApps = response.twitterApps; $('.my-sig-list .scroller').html ( tm.templates.addAccount.customSigList(response.twitterApps) ); tm.accounts.customSig.selectApp(selectedAppId===undefined?1:selectedAppId); } } ); },100); } } }, addAccountDo : function() { tm.tools.closeModal(); alert(s[6]); setTimeout(function() { tm.ajax ( { 'action' : 'ajax/add-account', 'appId' : tm.accounts.customSig.selectedAppId }, function(response) { if (response.error != 'OK') { alert(response.error); } else { location.href = response.twitterAuthURL; } } ); },100); }, getAccounts : function() { // Send to the server and try to create the account tm.ajax ( { 'action' : 'ajax/get-accounts' }, function(response) { if (response.error != 'OK') { alert(response.error); } else { // Reset the list $("#twitter-accounts .list").html(''); // If there are no configured twitter accounts if ( response.accounts == false ) { $("#twitter-accounts .list").html ( '
'+s[7]+'
' ); return; } tm.accounts.numAccounts=0; // if there ARE configured twitter accounts for ( i in response.accounts ) { // Store loaded acc details for cache use tm.accounts.loadedAccounts[response.accounts[i]['twit_acc_id']] = response.accounts[i]; if ( tm.accounts.selectedAccount === false && i == 0 ) { tm.accounts.selectedAccount = response.accounts[i]['twit_acc_id']; } // Insert item into the list $("#twitter-accounts .list").html ( $("#twitter-accounts .list").html() + tm.templates.accountListItem ( response.accounts[i] ) ); tm.accounts.numAccounts++; } $("#twitter-accounts .list").sortable ({ stop: function(event, ui) { // This gets userList[]=1&userList[]=2&userList[]=3 ready to send to server tm.accounts.saveOrder($("#twitter-accounts .list").sortable('serialize')); } }); tm.accounts.selectAccount(tm.accounts.selectedAccount); tm.friendFinder.followCount(0); if ( ! tm.friendFinder.cron.isRunning ) { tm.friendFinder.cron.start(); } } } ); }, savingOrder : false, saveOrder : function(accountIds) { tm.accounts.savingOrder = true; tm.ajax ( { 'accountIds' : accountIds, 'action' : 'ajax/save-order-accounts' }, function(response) { tm.accounts.savingOrder = false; if (response.error != 'OK') { alert(response.error); } } ); }, selectAccount : function(id) { if ( tm.accounts.savingOrder ) { return; } // Stop all polling before going any further for ( i in tm.tools.timers ) { tm.tools.stopPoll(tm.tools.timers[i]); } tm.accounts.selectedAccount = id; tm.accounts.curUsername = tm.accounts.loadedAccounts[id].login; tm.friendFinder.followCount(0); $("#twitter-accounts .list .list-item").removeClass('selected'); $('#userList_'+id).addClass('selected'); tm.accounts.getOtherSettings(); if ( tm.curView !== false ) { tm.nav.go(tm.curView,true); } }, getOtherSettings : function() { setTimeout(function() { tm.ajax ( { 'twitAccId' : tm.accounts.selectedAccount, 'action' : 'ajax/get-other-settings' }, function(response) { if (response.error != 'OK') { alert(response.error); } else { if ( response.myLists[0] === undefined ) { tm.twitter.myLists = false; } else { tm.twitter.myLists = response.myLists; } if ( response.autoSuggest != '' ) { tm.twitter.autoSuggest = response.autoSuggest; } tm.accounts.loadedAccounts[tm.accounts.selectedAccount].pingFm = response.pingFm; $('#post-to-panel .scroller').html(tm.templates.pingFm.tweetCheckBoxes()); // Bookmarklet stuff if ( tm.bookmarklet !== undefined ) { tm.twitter.curTweet = unescape(tm.bookmarklet.title)+' '+unescape(tm.bookmarklet.url); tm.twitter.openNewTweetModal(); tm.bookmarklet = undefined; } } } ); },100); } }; tm.templates = { streamsTitleBar : function() { var html = ''+ ''+ '
'+s[93]+'
'; return html; }, scheduleNavTitleBar : function() { var html = ''+ '
'+s[94]+'
'; return html; }, settingsNavTitleBar : function() { var html = ''+ '
'+s[95]+'
'; return html; }, settingsNavOptions : function() { var html = ''+ '
'+ ' '+ ''+s[96]+''+ '
'+ '
'+ ' '+ ''+s[97]+''+ '
'+ '
'+ ' '+ ''+s[98]+''+ '
'+ '
'+ ' '+ ''+s[99]+''+ '
'+ '
'+ ' '+ ''+s[100]+''+ '
'+ '
'+ ' '+ ''+s[101]+''+ '
'; return html; }, scheduleNavOptions : function() { var html = ''+ '
'+ ' '+ ''+s[102]+''+ '
'+ '
'+ ' '+ ''+s[103]+''+ '
'+ '
'+ ' '+ ''+s[104]+''+ '
'+ '
'+ ' '+ ''+s[105]+''+ '
'; return html; }, twitterUserProfile : function(twitterUser) { var html = ''+ '
'+ '
'+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ '
'+twitterUser.screen_name+ '
'+twitterUser.location+'
'+twitterUser.description+'
'+s[108]+''+twitterUser.name+''+s[112]+''+(twitterUser.following==true?'Yes':'No')+'
'+s[109]+''+twitterUser.created_at+''+s[113]+''+(twitterUser.verified==true?'Yes':'No')+'
'+s[110]+''+twitterUser.followers_count+''+s[114]+''+twitterUser.f_ratio+'
'+s[111]+''+twitterUser.friends_count+''+s[115]+''+twitterUser.statuses_count+'
'+ '
'+ '
'; return html; }, feedsTitleBar : function() { var html = ''+ ''+ '
'+s[119]+'
'; return html; }, /* [date] => 1251608680 [tweet_id] => 3639946679 [tweet] => RT @Flipbooks: #100 Ways To Live A Better Life http://bit.ly/zW4IM *** #Live #LOVE #Laugh *** [source] => Seesmic Desktop [user_id] => 15726358 [username] => dpbkmb [realname] => FunDave [thumb] => http://a3.twimg.com/profile_images/264899847/twitter5_normal.jpg [followers] => 13116 [in_reply_to_status_id] => [in_reply_to_user_id] => */ twitterContentItem : function(t) { var username = t.tweet_type == 'dm-from-me' ? t.to_username : t.username; var html = ''+ '
'+ '
'+ '
'+ ( t.tweet_type == 'dm-from-me' ? 'To: ':'')+ ''+username+' '+ t.tweet+ // ''+ '
'+t.date+ ( t.f_ratio !== false ? ' . F: ' + t.followers : '' )+ ( t.f_ratio !== false ? ' . Ratio: '+t.f_ratio : '' )+ ' . '+t.source+ ( t.tweet_type == 'dm-to-me' || t.tweet_type == 'dm-from-me' ? '' : ' . '+s[121]+' ' )+ '
'+ ( t.stream_md5 == 'retweets-of-me' ? '' : '' )+ ( t.in_reply_to_status_id != 0 && t.stream_md5 != 'retweets-of-me' ? '' : '' )+ '
'+ '
'+ '
'; return html; }, popup : function(id,contents,extraClass) { var html = ''+ ''; return html; }, feedContentItem : function(story) { var html = ''+ '
'+ '
'+ ''+ ''+ ''+ ''+ '
'+ '
'+ ''+unescape(story.title)+''+ '
'+ '
'+story.date+'
'+ '
'+ '
'; return html; }, scheduleContentItem : function(schedule) { var feed = schedule.feed_name !== null ? ' - from ' + schedule.feed_name + '' : ''; var html = ''+ '
'+ '
'+ ( schedule.is_posted==1 ? '' : '' )+ ( schedule.schedule_type=='rolling' ? ''+ '' : '' )+ '
'+ '
'+ (schedule.schedule_type=='rolling'?'':'')+ ( schedule.is_posted==0 ? '' : '' )+ ''+schedule.tweet+''+ '
'+ (schedule.schedule_type=='rolling'?'':'')+ ( schedule.schedule_type!='rolling' ? ( schedule.is_posted==1 ? s[131]+' '+(schedule.post_at)+feed : s[132]+' '+(schedule.post_at)+feed ) : '' )+ ( schedule.schedule_type=='rolling' ? ( schedule.is_posted==1 ? s[131]+' '+(schedule.post_at)+feed : s[132]+' '+(schedule.post_at)+feed ) : '' )+ '
'+ '
'+ '
'+ '
'; return html; }, feedListItem : function(type,name,feed_id,url_or_search) { var icon_path = '/template/gfx/rss.png'; if ( type == 'news' ) { icon_path = '/template/gfx/news.png'; } else if ( type == 'blog' ) { icon_path = '/template/gfx/blog.png'; } var html = ''+ '
'+ ' '+ ' '+name+''+ '
'; return html; }, streamListItem : function(item) { var toolTip = item.name; var icon_path = '/template/gfx/twitter-small.png'; if ( item.type == 'dms-sent-to-me' || item.type == 'dms-sent-by-me' ) { icon_path = '/template/gfx/icons/mail.gif'; } else if ( item.type == 'favorites' ) { icon_path = '/template/gfx/favorites.png'; } else if ( item.type == 'dms-and-ats' ) { // Leave as twitter-small.png } else if ( item.args != '' ) { icon_path = item.type == 'search' ? '/template/gfx/search-green.png' : ( item.type == 'group' ? '/template/gfx/list.png' : '/template/gfx/user-green.png' ); } if ( item.type == 'tweets-at-me' ) { toolTip = s[134]+' '+item.name; } if ( item.type == 'retweets-of-me' ) { toolTip = s[135]+' '+item.name; } if ( item.type == 'search' ) { toolTip = s[136]+' '+item.name; } if ( item.type == 'get-user-timeline' ) { item.name = '@'+item.name; toolTip = s[137]+' '+item.name; } if ( item.type == 'group' ) { toolTip = s[138]+' @'+item.name; item.name = '...'+item.name.substring(item.name.indexOf('/')); } var canEditStream = true; if ( item.type == 'favorites' || item.type == 'dms-and-ats' ) { canEditStream = false; } var html = ''+ '
'+ ( canEditStream ? '' : '' )+ ' '+item.name+' '+(item.new_msg!=0?'('+item.new_msg+')':'')+''+ '
'; return html; }, accountListItem : function(a) { var html = ''+ '
'+ ''+ // ''+a.login+' ('+a.short_title+')'+ ''+a.login+''+ '
'; return html; }, tweetDialog : function(title) { // var usernames = ''; var buttonText = tm.twitter.directMessageTo === false ? 'Tweet' : 'Send Message'; var html = ''+ '
'+ ''+ '
'+title+'
'+ ''+ ( tm.twitter.directMessageTo === false ? tm.templates.pingFm.tweetCheckBoxes() : '' )+ '
'+ ' '+ ''+ ' '+ ' '+ ''+ '
'+ ''+ ''+ '
'+ '
'+ '
'; return html; }, feedsTweetDialog : function(storyId) { var html = ''+ '
'+ ''+s[147]+' '+s[148]+' »'+ ''+ '
'+ ''+ ' '+ ''+ ' '+ ' '+ ''+ // ''+ // ' '+ // ''+ '
'+ // '
'+ // '
Tweet
'+ // '
Link
'+ // '
'+ '
'; return html; }, addFeed : function(title,button,feedId) { var html = ''+ '
'+ '
'+ ( feedId !== undefined ? ' ' : '' )+ ''+title+'
'+ '
'+ ''+ ''+ ''+ ' '+ ' '+ ' '+ ' '+ ' '+ ' '+ ' '+ ' '+ ' '+ ' '+ ' '+ ' '+ ' '+ ' '+ '
'+ s[149]+ ''+ ' '+ '
'+ ' '+ ' Type: '+ ' '+ ' '+ '
'+ ' '+s[153]+''+ ' '+ ' '+ '
'+ ' '+ ' '+ ( feedId !== undefined ? ' ' : '' )+ ' '+ '
'+ '
'+ '
'; return html; }, setCoreErrorTemplate : function() { var html = ''+ ''+'T'+'h'+'a'+'n'+'k y'+'o'+'u f'+'o'+'r s'+'p'+'e'+'n'+'d'+'i'+'n'+'g t'+'h'+'e l'+'a'+'st '+tm.buildPhase+' d'+'a'+'y'+'s t'+'r'+'y'+'i'+'n'+'g o'+'u'+'t T'+'w'+'e'+'e'+'t'+'M'+'i'+'n'+'e'+'r'+ 'W'+'e h'+'o'+'p'+'e y'+'o'+'u w'+'i'+'l'+'l l'+'i'+'k'+'e i'+'t e'+'n'+'o'+'u'+'g'+'h t'+'o c'+'o'+'n'+'s'+'i'+'d'+'e'+'r s'+'w'+'i'+'t'+'c'+'h'+'i'+'n'+'g t'+'o o'+'n'+'e o'+'f o'+'u'+'r p'+'a'+'i'+'d v'+'e'+'r'+'s'+'i'+'o'+'n'+'s'+ '<'+'a h'+'ref'+'="jav'+'as'+'cr'+'ipt:t'+'m.t'+'oo'+'ls'+'.cl'+'os'+'eM'+'od'+'al'+'('+')">'+'Cl'+'o'+'se<'+'/u'+'> '+'-'+' <'+'u>View '+'P'+'la'+'ns '+'& P'+'ri'+'cing'+'<'+'/a'+'>'+''+ ''; return html; }, addTwitterStream : function(title,button,streamId) { var icon = ''; var autoPollOnly = false; var sel = 'selected'; var auto_poll = ''; var pi = 2; if ( streamId !== undefined ) { auto_poll = tm.twitter.loadedStreams[streamId].auto_poll==1?'checked':''; pi = tm.twitter.loadedStreams[streamId].poll_interval; switch(tm.twitter.loadedStreams[streamId].type) { case 'folks-i-follow':; case 'tweets-at-me':; case 'retweets-of-me':; case 'dms-and-ats':; case 'my-tweets':; icon = ' '; autoPollOnly = true; break; case 'dms-sent-to-me':; case 'dms-sent-by-me':; icon = ' '; autoPollOnly = true; break; default:; title = 'Edit Twitter Stream'; icon = ' '; break; } } var myListsHtml = ''; if ( tm.twitter.myLists !== false ) { myListsHtml += ''; for ( i in tm.twitter.myLists ) { myListsHtml += ''; } } var html = ''+ '
'+ '
'+ icon+ ''+title+''+ '
'+ ( autoPollOnly ? '' : '
' )+ '
'+ ''+ ( ! autoPollOnly ? ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ '' : '' )+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ '
'+ ''+ 'Type: '+ ''+ ''+ '
'+ ''+ ''+ ''+ ''+ '
'+ ''+s[160]+''+ ''+ ''+ '
'+ ''+s[161]+''+ ''+ ''+s[162]+''+ ''+s[163]+' '+ ' '+ ''+s[164]+''+ '
'+ ''+ ' '+ ( streamId !== undefined && ! autoPollOnly ? ' ' : '' )+ ''+ '
'+ '
'+ '
'; return html; }, alert : function(str) { var html = ''+ '
'+ str+ '
'+ ' '+ '
'+ '
'; return html; }, prompt : function(str,callback) { var html = ''+ '
'+ str+ '
'+ ' '+ ' '+ '
'+ '
'; return html; }, emptyFeed : function() { var html = ''+ '
'+ s[165]+ '
    '+ '
  • '+s[166]+'
  • '+ '
  • '+s[167]+'
  • '+ '
  • '+s[168]+'
  • '+ '
  • '+s[169]+'
  • '+ '
  • '+s[170]+'
  • '+ '
'+ '
'; return html; }, nothingFlagged : function() { var html = ''+ '
'+ s[171]+ '
    '+ '
  • '+s[172]+'
  • '+ '
  • '+s[173]+'
  • '+ '
'+ '
'; return html; }, nothingScheduled : function() { var html = ''+ '
'+ s[174]+ '
    '+ '
  • '+s[175]+'
  • '+ '
  • '+s[176]+'
  • '+ '
'+ '
'; return html; }, flaggedIconPath : function(isFlagged) { return '/template/gfx/star-'+(isFlagged==1?'grey':'tick')+'.png'; }, userDropDown : { 'folks-i-follow' : function(tweetId) { var html = ''+ '
'+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ '
'; return html; }, 'tweets-at-me' : function(tweetId) { return tm.templates.userDropDown['folks-i-follow'](tweetId); }, 'retweets-of-me' : function(tweetId) { return tm.templates.userDropDown['folks-i-follow'](tweetId); }, 'dms-and-ats' : function(tweetId) { return tm.templates.userDropDown['folks-i-follow'](tweetId); }, 'my-tweets' : function(tweetId) { var html = ''+ '
'+ ''+ ''+ ''+ ''+ '
'; return html; }, 'dms-sent-to-me' : function(tweetId) { var html = ''+ '
'+ ''+ ''+ ''+ ''+ ''+ '
'; return html; }, 'dms-sent-by-me' : function(tweetId) { var html = ''+ '
'+ ''+ ''+ '
'; return html; }, 'search' : function(tweetId) { return tm.templates.userDropDown['folks-i-follow'](tweetId); }, 'get-user-timeline' : function(tweetId) { return tm.templates.userDropDown['folks-i-follow'](tweetId); }, 'favorites' : function(tweetId) { var html = ''+ '
'+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ '
'; return html; }, 'group' : function(tweetId) { var html = ''+ '
'+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ '
'; return html; } }, makeFeedScheduleDropDown : function(storyId) { var html = ''+ '
'+ ''+ ''+ '
'; return html; }, scheduleByTime : function(storyId) { var d = new Date(); var h = d.getHours(); var m = d.getMinutes(); var p = 'pm'; var sel = 'selected'; if ( h < 12 ) p = 'am'; // Makes sure hour is 0 padded & string if ( h == 0 ) h = 12; else if ( h > 12 ) h = h - 12; // Rounds minutes to nearest 5 (and pads) m = Math.round(parseInt(m)/5)*5 var html = ''+ '
'+ ''+s[195]+' '+ '   '+s[196]+' '+ ''+ ''+ '
'+ ' '+ ( storyId !== undefined ? ' ' : ' ' )+ '
'+ '
'; return html; }, settings : { home : function() { var html = ''+ '
'+ '
'+ '
'+ '
'; return html; }, listInfo : function(listInfo) { var html = ''+ '
'+ '
'+s[197]+'
'+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ '
'+s[199]+''+listInfo.full_name+'
'+s[205]+''+listInfo.mode+'
'+s[206]+''+listInfo.member_count+' '+s[210]+' »
'+s[207]+''+listInfo.subscriber_count+' '+s[210]+' »
'+s[208]+'http://twitter.com'+listInfo.uri+'
'+s[209]+''+(listInfo.description==''?'...':listInfo.description)+'
'+ '
'+s[211]+'
'+ '
'; return html; }, editList : function(listInfo) { var html = ''+ '
'+ '
'+s[212]+'
'+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ '
'+s[199]+'
'+s[205]+''+ ' '+ '
'+s[214]+''+ ''+ '
'+ ''+ '
'+ '
'; return html; }, newList : function() { var html = ''+ '
'+ '
'+s[215]+'
'+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ '
'+s[199]+'
'+s[205]+''+ ' '+ '
'+s[209]+''+ ''+ '
'+ ''+ '
'+ '
'; return html; }, manageLists : function() { // tm.twitter.myLists = // [ // '@justinvincent/buds', // '@justinvincent/tweetminers', // ]; var myListsHtml = ''; if ( tm.twitter.myLists !== false ) { for ( i in tm.twitter.myLists ) { myListsHtml += '
'+tm.twitter.myLists[i]+'
'; } } var html = ''+ '
'+ '
'+s[217]+'
'+ '
'+s[218]+'
'+ ' '+ '
'+ '
'+ myListsHtml+ '
'+ '
'+ '
'+ '
'+ '
'; return html; }, info : function() { var set = tm.settings.loadedSettings; var html = ''+ '
'+s[220]+' @'+tm.accounts.loadedAccounts[tm.accounts.selectedAccount].login+'. '+s[221]+'
'+ '
'+ '
'+s[222]+'
'+ '
'+ ( set.next_rolling !== false ? set.next_rolling+ '

'+ s[223] : s[224] ) '
'+ '
'; return html; }, timezone : function() { var set = tm.settings.loadedSettings; var html = ''+ '
'+ ''+s[225]+' '+unescape(set.tz_dropdown)+' '+ ' '+ '
'; return html; }, pingFm : function() { var set = tm.accounts.loadedAccounts[tm.accounts.selectedAccount].pingFm; var html = ''+ '
'+ ( set.api_key == '' ? '
'+ '
Ping.fm
'+ '
'+ ''+ ''+ ''+ ''+ '
'+s[226]+'
'+s[227]+' »
'+ '
'+ '
'+ ''+ '
'+ ' '+ '
' : // Configured '
'+ '
Ping.fm
'+ '
'+ ''+ ''+ ''+ ''+ '
API Key*******************************************'+s.api_key.substr(s.api_key.length-4,s.api_key.length-1)+'
'+ '
'+ '
'+ '
'+ '
'+s[231]+'
'+ tm.templates.pingFm.checkBoxes()+ '
'+ '
'+ ''+ '
'+ s[232]+ '
'+ '
'+ s[233]+ '
'+ '
'+ '
'+ ' '+ ' '+ '
' )+ '
'; return html; }, bitly : function() { var set = tm.settings.loadedSettings; var html = ''+ '
'+ '
'+s[236]+'
'+ '
'+ ' '+ ' '+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ '
'+s[238]+'
'+s[239]+'
'+ '
'+ '
'+ ' '+ '
'+ '
'; return html; }, rollingSchedule : function() { var set = tm.settings.loadedSettings; var html = ''+ '
'+ '
'+s[240]+'
'+ '
'+ s[241]+' '+s[242]+ '
'+ '
'+ '
'+s[243]+'
'+ '
'+ ' '+ ' '+ ' '+ ' '+ ' '+ ' '+ ' '+ '
'+ '
'+ '
'+ ' '+ '
'+ '
'+ tm.templates.settings.timeWindowFineTune()+ '
'+ '
'+ ' '+ '
'+ '
'+ ' '+ '
'+ '
' return html; }, timeWindowFineTune : function() { var s = tm.settings.loadedSettings; // Need to translate this!! var days = ['mon','tue','wed','thu','fri','sat','sun']; var html = ''; for ( i in days ) { html += tm.templates.settings.hoursLine ( days[i], 'tw_'+days[i]+'_on', s['tw_'+days[i]+'_on'], 'tw_'+days[i]+'_from', s['tw_'+days[i]+'_from'], 'tw_'+days[i]+'_from_ampm', s['tw_'+days[i]+'_from_ampm'], 'tw_'+days[i]+'_to', s['tw_'+days[i]+'_to'], 'tw_'+days[i]+'_to_ampm', s['tw_'+days[i]+'_to_ampm'] ); } html += '
'; return html; }, hoursLine : function(day,cbId,cbState,fromId,fromVal,fromAmpmId,fromAmpmVal,toId,toVal,toAmpmId,toAmpmVal) { var html = ''+ ''+ ''+ ' '+ '