var tm = { useAnalytics : false, curView : false, curModal : 0, isApp : false, hiddenHints : {}, isMouseDown : false, traceOn : false, trace : function(strOrObj) { if ( ! tm.traceOn ) { return; } console.log(strOrObj); }, fflog : function(str) { $('#ff-activity .scroller').prepend('
'+str+'
'); $("#ff-activity .scroller .item:nth-child(10)").remove(); tm.friendFinder.cron.showRunningTime(); }, init : function() { tm.trace('Init main app'); $().mousedown(function() { tm.isMouseDown = true; }).mouseup(function() { tm.isMouseDown = false; }); $().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() { tm.tools.closeModal(); 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('Ajax Timeout'); } if ( textStatus == 'error' ) { alert('Ajax Error'); } 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'); }, box : function (html,width) { if ( $('.popup .alert').length <= 0 ) { tm.tools.makeModal(tm.templates.box(html),'callout-bl', (width===undefined?300:width)); } }, alert : function (str,width) { if ( $('.popup .alert').length <= 0 ) { tm.tools.makeModal(tm.templates.alert(str),'callout-bl', (width===undefined?300:width)); } }, prompt : function (str,callback,width) { tm.tools.makeModal(tm.templates.prompt(str,callback),'callout-bl', (width===undefined?300:width)); }, goURL : function(url) { location.href=url; }, lastHintTime : 0, hint : function(hintId,forceOpen) { if ( $('.popup').length > 0 && forceOpen === undefined ) { return; } // 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,isYouTube) { if ( isYouTube === undefined ) { tm.tools.makeModal(tm.templates.howToVideo(video),'callout-bl', 665, undefined, undefined, .4, undefined, function(){tm.closeHowTo()}); } else { tm.tools.makeModal(tm.templates.howToVideoYouTube(video),'callout-bl', 925, undefined, undefined, .4, 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; } }; var _numTrialDays = 14; var _useFreeTrial = false; 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'; } else if ( imgObj.src.indexOf('calender') > -1 ) { imgObj.src = '/template/gfx/calender-hover.png'; } }, hoverOff : function(imgObj) { imgObj.src = imgObj.origSrc; }, loadModules : function() { if ( $('#xjklu').length <= 0 ) { tm.tools.makeModal(tm.templates.setCoreErrorTemplate(),'callout-bl', 500); $('#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()},2000); }, /* * Check if enter key was hit */ isFormTrigger: function (e) { if ( (e.keyCode == 13 && e.shiftKey!= 1 ) || e.type === 'click' || e.type == 'submit' ) { 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'); }, autoFill : function (id, v) { $(id).css({ color: "#999" }).attr({ value: v }).focus(function() { if($(this).val()==v) { $(this).val("").css({ color: "#333" }); } }).blur(function() { if($(this).val()=="") { $(this).css({ color: "#999" }).val(v); } }); }, textFocus : function(selector,forcePos) { var endPos = $(selector).val().length; if ( forcePos !== undefined ) { var endPos = forcePos; } setTimeout(function() { $(selector).selectRange(endPos,endPos); $(selector).focus(); },250); }, stopEvent : function(event) { if ( event !== undefined ) { if ( $.browser.msie ) window.event.cancelBubble = true; else event.stopPropagation(); } }, toggleDiv : function(selector) { if ( $(selector).hasClass('hide') ) { $(selector).removeClass('hide'); } else { $(selector).addClass('hide'); } }, count : function(obj) { var numProps = 0; for ( var i in obj ) { numProps++; } return numProps; } }; tm.nav = { settingView : false, go : function(to,forceReload) { tm.nav.setView(to); if ( tm.accounts.selectedAccount === false ) { tm.accounts.getAccounts(); } $('#feed-content .list').removeClass('dark-background'); 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 'stats' : tm.nav.goStats(); 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; $('#ff-activity').css({marginLeft: -1000}); switch(view) { case 'twitter' : $('#nav-pointer').css({left: 1}); break; case 'friendFinder' : $('#nav-pointer').css({left: 67}); $('#ff-activity').css({marginLeft: 870, marginTop: 132}); break; case 'rss' : $('#nav-pointer').css({left: 102}); break; case 'flagged' :; case 'flaggedText' : $('#nav-pointer').css({left: 171}); break; case 'schedule' : $('#nav-pointer').css({left: 137}); break; case 'stats' : $('#nav-pointer').css({left: 34}); break; case 'settings' : $('#nav-pointer').css({left: 203}); 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(); }, goStats : function() { if ( tm.accounts.selectedAccount === false ) { tm.nav.goTwitter(); return; } $("#feeds .list").sortable('destroy'); tm.nav.hideMulticol(); tm.nav.showAccounts(); tm.nav.showStatsNav(); tm.nav.hideSearch(); tm.stats.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('
Friend Finder
'); $('#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}); }, showStatsNav : function() { $('#feeds .title-bar').html(tm.templates.stats.navTitleBar()); $('#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('Sure you want to delete ' + ' "'+username+'"?','tm.accounts.doDeleteAccount('+id+')'); }, doDeleteAccount : function (id) { tm.tools.closeModal(); alert('Deleting account...
This will take a minute (or two) please be patient'); // 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 { window.location.reload(); /* tm.tools.closeModal(); tm.accounts.selectedAccount = false; tm.accounts.getAccounts(); tm.feeds.getFeeds(); */ } } ); }, addAccount : function(selectedAppId) { if ( tm.accounts.numAccounts > tm.maxTwitterAccs ) { if ( _useFreeTrial ) { alert('If you would like to add more Twitter accounts please signup to our '+_numTrialDays+' day free trial. No payment required. Cancel any time!'); } else { alert('If you would like to add more Twitter accounts please signup and try Pluggio for 60 days risk free! Cancel any time!'); } } else { tm.prompt('You will now be redirected to Twitter to link an account with Pluggio',"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('Sure you want to delete the custom signature'+' "'+tm.accounts.customSig.loadedApps[appId].title+'"?','tm.accounts.customSig.doDeleteApp('+appId+')'); }, doDeleteApp : function(appId) { tm.tools.closeModal(); tm.tools.closeModal(); alert('Deleting...'); 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('Redirecting to Twitter...'); 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 ( '
To add a twitter account click the + sign above
' ); return; } tm.accounts.numAccounts=0; // if there ARE configured twitter accounts for ( i in response.accounts ) { var twitAccId = response.accounts[i]['twit_acc_id']; // Update friend suggestion count for this account tm.friendFinder.cron.suggestionCount[twitAccId] = parseInt(response.accounts[i].friend_suggest_count); // Store loaded acc details for cache use tm.accounts.loadedAccounts[twitAccId] = response.accounts[i]; if ( tm.accounts.selectedAccount === false && i == 0 ) { tm.accounts.selectedAccount = twitAccId; } // 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.init(); } } } ); }, 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; } $('#userList_'+id+' .alert').remove(); // 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; // Add code for compas labs //if ( tm.subsType == 'Basic' ) //{ // ad.renderAd(tm.accounts.curUsername, 'twitter'); //} 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 = ''+ ''+ '
Streams
'; return html; }, scheduleNavTitleBar : function() { var html = ''+ '
Schedule Selection
'; return html; }, stats : { navTitleBar : function() { var html = ''+ '
Stats (Beta work in progress)
'; return html; }, navOptions : function() { var html = ''+ '
'+ ' '+ 'Dashboard'+ '
'+ '
'+ ' '+ 'Twitter Growth'+ '
'+ ''; return html; }, dashboard : function(stats) { var html = ''+ '
'+ '
'+ '
'+stats.followers_count_fmt+'
'+ '
Followers
'+ '
'+stats.followers_count+'
'+ '
'+ '
'+ '
'+stats.friends_count_fmt+'
'+ '
Following
'+ '
'+stats.friends_count+'
'+ '
'+ '
'+ '
'+stats.ff_ratio+'
'+ '
Follower Ratio
'+ '
'+ '
'+ '
'+stats.friend_suggestions_fmt+'
'+ '
Friend
'+ '
Suggestions
'+ '
'+ '
'+ '
'+stats.unfollow_suggestions_fmt+'
'+ '
Unfollow
'+ '
Suggestions
'+ '
'+ '
'+ '
'+stats.followed_me_back_fmt+'
'+ '
New Followers
'+ '
Thx To Pluggio
'+ '
'+ '
'+ '
'+stats.rolling_sent_today+'
'+ '
Rolling
'+ '
Past 24h
'+ '
'+ '
'+ '
'+stats.time_specific_sent_today+'
'+ '
Time Specific
'+ '
Past 24h
'+ '
'+ '
'+ '
'+stats.rss_instant+'
'+ '
RSS Instant
'+ '
Past 24h
'+ '
'+ '
'+ '
'+stats.rolling_unsent+'
'+ '
Rolling
'+ '
Un-sent
'+ '
'+ '
'+ '
'+stats.time_specific+'
'+ '
Time Specific
'+ '
Un-sent
'+ '
'+ '
'+ '
'+stats.statuses_count_fmt+'
'+ '
Total Tweets
'+ '
'+stats.statuses_count+'
'+ '
'+ '
'+ '
'; return html; }, bitly : { links : function(links) { if ( ! links ) { var html = ''+ '
'+ 'Pluggio can display awesome stats about any link you post (see below for an example). To set this up watch this video'+ '
'+ ''+ '
'+ '
'; return html; } var html = ''; return html; }, linkItem : function(data) { var html = ''+ '
'+ '
'+data.title+'
'+ '
'+data.created+'
'+ '
'+ '
'+data.clicks.global+'
'+ '
Global Clicks
'+ '
'+ '
'+ '
'+data.clicks.user+'
'+ '
Clicks
'+ '
'+ '
'+ '
Activity For Past Hour
'+ '
Now
'+ '
'; return html; } }, growth : function(stats) { // If free account if ( stats.stats_acc_id == 0 ) { var html = ''+ '
'+ '
Due to resource limitations we are unable to offer detailed statistics for free plans. For in-depth statistics please upgrade to one of our great value paid plans.
' '
'; return html; } setTimeout(function() { var options = { xaxis: { mode: "time" }, selection: { mode: "x" }, series: { lines: { show: true, lineWidth: 3 }, shadowSize: 0 }, legend: { position: 'se' , backgroundOpacity: 0.25 } }; options.series.label = 'Followers'; options.series.color = '#A5D300'; $.plot($("#followersChart"), [stats.followers], options); options.series.label = 'Following'; options.series.color = '#F0674D'; $.plot($("#followingChart"), [stats.following], options); options.series.label = 'Listed'; options.series.color = '#58B6E8'; $.plot($("#listedChart"), [stats.listed], options); options.series.label = 'Tweets'; options.series.color = '#CCC'; $.plot($("#updatesChart"), [stats.updates], options); },150); var html = ''+ '
'+ ''+ ''+ ( stats.no_data ? '
Congrats! Pluggio is now tracking this account. The graphs below will start to make sense after 4+ days of data gathering.
' : '' )+ '
'+ '
'+ '
'+ '
'+ '
'+ '
'; return html; } }, settingsNavTitleBar : function() { var html = ''+ '
Settings For This Account
'; return html; }, settingsNavOptions : function() { var html = ''+ '
'+ ' '+ 'Info'+ '
'+ '
'+ ' '+ 'Timezone'+ '
'+ '
'+ ' '+ 'Rolling Schedule'+ '
'+ '
'+ ' '+ 'Bit.ly (Short URLs)'+ '
'+ '
'+ ' '+ 'Manage Lists/Groups'+ '
'+ '
'+ ' '+ 'Ping.fm (Post Anywhere)'+ '
'+ '
'+ ' '+ 'New Follower Automation'+ '
'+ '
'+ ' '+ 'Pluggio API Key'+ '
'; return html; }, scheduleNavOptions : function() { var html = ''+ '
'+ ' '+ 'Show All (by first out)'+ '
'+ '
'+ ' '+ 'Show All (by last out)'+ '
'+ '
'+ ' '+ 'Show All (by last added)'+ '
'+ '
'+ ' '+ 'Show Rolling'+ '
'+ '
'+ ' '+ 'Show Time Specific'+ '
'+ '
'+ ' '+ 'Bulk Schedule'+ '
'; return html; }, twitterUserProfile : function(twitterUser) { var html = ''+ '
'+ '
'+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ '
'+twitterUser.screen_name+ '
'+twitterUser.location+'
'+twitterUser.description+'
Real Name'+twitterUser.name+'You Follow?'+(twitterUser.following==true?'Yes':'No')+'
Member Since'+twitterUser.created_at+'Verified?'+(twitterUser.verified==true?'Yes':'No')+'
Followers'+twitterUser.followers_count+'Ratio'+twitterUser.f_ratio+'
Following'+twitterUser.friends_count+'Updates'+twitterUser.statuses_count+'
'+ '
'+ '
'; return html; }, feedsTitleBar : function() { var html = ''+ ''+ '
Feeds
'; 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 thumbHtml = ''; if (/(twitpic.com|moby.to|yfrog.com)/.test(t.tweet)) { var matches = t.tweet.match(/(twitpic.com\/[a-zA-Z0-9]+|moby.to\/[a-zA-Z0-9]+|yfrog.com\/[a-zA-Z0-9]+)/g); var urls = {}; for( var i in matches ) { urls[matches[i]] = matches[i]; } for( var i in urls ) { switch ( urls[i].substr(0,7) ) { case 'twitpic': thumbHtml += ''; break; case 'moby.to': thumbHtml += ''; break; case 'yfrog.c': thumbHtml += ''; break; } } } 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' // ? // '' // : // ' . Giant Tweet ' // )+ '
'+ ( thumbHtml != '' ? '
'+ '
'+ thumbHtml+ '
'+ '
' : '' )+ ( 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.is_posted==0 ? '
'+ '' : '' )+ '
'+ '
'+ (schedule.schedule_type=='rolling'?'':'')+ ( schedule.is_posted==0 ? '' : '' )+ ''+schedule.tweet+''+ '
'+ (schedule.schedule_type=='rolling'?'':'')+ ( schedule.schedule_type!='rolling' ? ( schedule.is_posted==1 ? 'Posted at '+(schedule.post_at)+feed : 'Post at '+(schedule.post_at)+feed ) : '' )+ ( schedule.schedule_type=='rolling' ? ( schedule.is_posted==1 ? 'Posted at '+(schedule.post_at)+feed : 'Post at [Est] '+(schedule.post_at)+feed ) : '' )+ '
'+ '
'+ '
'+ '
'; return html; }, feedListItem : function(type,name,feed_id,url_or_search) { if ( tm.feeds.loadedFeeds[feed_id]['automation_is_on'] == 0 ) { 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'; } } else { var icon_path = '/template/gfx/rss-automation.png'; if ( type == 'news' ) { icon_path = '/template/gfx/news-automation.png'; } else if ( type == 'blog' ) { icon_path = '/template/gfx/blog-automation.png'; } } var html = ''+ '
'+ ' '+ ' '+name+''+ '
'; return html; }, streamListItem : function(item) { var toolTip = item.name; var icon_path = '/template/gfx/twitter-small.png'; if ( item.type == 'folder' ) { if ( tm.tools.count(tm.twitter.getFolderStreamIds(item.stream_id)) == 0 ) { icon_path = '/template/gfx/icons/folder_empty.png'; } else if ( item.is_closed == 0 ) { icon_path = '/template/gfx/icons/folder_open.png'; } else { icon_path = '/template/gfx/icons/folder_closed.png'; } } else 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 == 'search' ) { icon_path = '/template/gfx/search-green.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 = 'Tweets mentioning '+item.name; } if ( item.type == 'retweets-of-me' ) { toolTip = 'ReTweets mentioning '+item.name; } if ( item.type == 'search' ) { toolTip = 'Search: '+item.name.replace(/"/g,'"'); if ( item.geo_distance != 0 ) { toolTip += ' - Location: ' + item.geo_location + ' ' + item.geo_distance + 'mi'; item.name += ' ' + item.geo_location + ''; } } if ( item.type == 'get-user-timeline' ) { item.name = '@'+item.name; toolTip = 'Recent tweets by '+item.name; } if ( item.type == 'group' ) { toolTip = 'List: @'+item.name; item.name = '...'+item.name.substring(item.name.indexOf('/')); } var canEditStream = true; if ( item.type == 'favorites' || item.type == 'dms-and-ats' || item.type == 'new-followers' || item.type == 'new-listings' ) { canEditStream = false; } var html = ( item.type == 'folder' ? '
' : '
' )+ ( canEditStream ? '' : '' )+ ' '+item.name+''+(item.new_msg!=0?item.new_msg:'')+''+ '
'; return html; }, accountListItem : function(a) { var suggestCount = parseInt(a.friend_suggest_count)+parseInt(a.purge_suggest_count); var html = ''+ '
'+ ''+ ''+ 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 = ''+ '
'+ 'FYI - Pluggio does not allow the editing of feed "links" due to Twitter TOS. More info »'+ ''+ '
'+ ''+ ' '+ ''+ ' '+ ' '+ ''+ // ''+ // ' '+ // ''+ '
'+ // '
'+ // '
Tweet
'+ // '
Link
'+ // '
'+ '
'; return html; }, addFeed : function(title,button,feedId) { var html = ''+ '
'+ // Main feed input '
'+ ( feedId !== undefined ? ' ' : '' )+ ''+title+''+ '
'+ '
'+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ '
'+ 'Name:'+ ''+ ''+ '
'+ ''+ 'Type: '+ ''+ ''+ '
'+ 'Location:'+ ''+ ''+ '
'+ ''+ ''+ ''+ ''+ '
'+ '
'+ // Automation area '
'+ '
'+ 'Automate This Feed.. (beta)'+ '
'+ '
'+ '
'+ ''+ 'Watch This Video!'+ '
'+ '
Automation:
'+ '
Check for new posts every hours
'+ '
Post a max of new stories per poll
'+ '
Post to rolling schedule? (not to live)
'+ '
'+ '
'+ '
Send automated posts to:
'+ '
'+ tm.templates.pingFm.tweetCheckBoxes()+ '
'+ '
'+ ''+ '
'+ // Alter Tweet Text area ''+ '
'+ '
'+ ''+ 'Watch This Video!'+ '
'+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ '
'+ 'Prepend:'+ ''+ ' (32 max)'+ '
'+ 'Postpend:'+ ''+ ' (32 max)'+ '
'+ ''+ 'Postpend after link '+ '
'+ ''+ 'Find & Replace  (Read this!)'+ '
'+ ''+ ''+ '
'+ ''+ ''+ '
'+ '
'+ // Buttons '
'+ '
'+ ' '+ ( feedId !== undefined ? ' ' : '' )+ ''+ '
'+ '
'; return html; }, setCoreErrorTemplate : function() { var html = ''+ '
'+ ( _useFreeTrial ? '
To experience the true power of Pluggio signup to our '+_numTrialDays+' day free trial. No payment required. Cancel any time!
'+ '
No Thanks   '+_numTrialDays+' Free Trial »
' : '
To experience the true power of Pluggio signup and try Pluggio for 60 days risk free! Cancel any time!
'+ '
No Thanks   Sign Up! »
' )+ '
'; 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 'new-followers':; case 'new-listings':; 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 ? ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ '' : '' )+ ( tm.hasLocalSearch ? ''+ ''+ ''+ '' : ''+ ''+ ''+ '' )+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ '
'+ ''+ 'Type: '+ ''+ ''+ '
'+ ''+ ''+ ''+ ''+ '
'+ '@user'+ ''+ ''+ '
'+ 'Location:'+ ''+ tm.templates.friendFinder.autoAddRange()+ ' within '+ ''+ '
'+ 'Location:'+ ''+ 'Please upgrade to get access to location based searches'+ '
'+ 'Check for'+ ''+ 'messages'+ 'every '+ ' '+ 'minutes'+ '
'+ ''+ ' '+ ( streamId !== undefined && ! autoPollOnly ? ' ' : '' )+ ''+ '
'+ '
'+ '
'; return html; }, box : function(html) { var html = ''+ '
'+ html+ '
'; return html; }, alert : function(str) { var html = ''+ '
'+ str+ '
'+ ' '+ '
'+ '
'; return html; }, prompt : function(str,callback) { var html = ''+ '
'+ str+ '
'+ ' '+ ' '+ '
'+ '
'; return html; }, emptyFeed : function() { var html = ''+ '
There were no results. Empty feed.'+ '
'; return html; }, nothingFlagged : function() { var html = ''+ '
Nothing Flagged'+ '
'; return html; }, nothingScheduled : function() { var html = ''+ '
Nothing Scheduled'+ '
'; return html; }, flaggedIconPath : function(isFlagged) { return '/template/gfx/star-'+(isFlagged==1?'grey':'tick')+'.png'; }, userDropDown : { 'folks-i-follow' : function(tweetId) { var html = ''+ '
'+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ '
'; return html; }, 'them-and-me' : function(tweetId) { return tm.templates.userDropDown['folks-i-follow'](tweetId); }, 'tweets-at-me' : function(tweetId) { return tm.templates.userDropDown['folks-i-follow'](tweetId); }, 'new-followers' : function(tweetId) { return tm.templates.userDropDown['folks-i-follow'](tweetId); }, 'new-listings' : 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 = ''+ '
'+ 'Day: '+ '   Time: '+ ''+ ''+ '
'+ ' '+ ( storyId !== undefined ? ' ' : ' ' )+ '
'+ '
'; return html; }, reScheduleByTime : function(storyId, hours, minutes, month, day, $year) { // I am just duplicating the function above "scheduleByTime" just to save time and move forward. var d = new Date(); var h = hours; var m = minutes; 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 = ''+ '
'+ 'Day: '+ '   Time: '+ ''+ ''+ '
'+ ' '+ ( storyId !== undefined ? ' ' : ' ' )+ '
'+ '
'; return html; }, settings : { home : function() { var html = ''+ '
'+ '
'+ '
'+ '
'; return html; }, listInfo : function(listInfo) { var html = ''+ '
'+ '
List/Group Info
'+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ '
Name:'+listInfo.full_name+'
Mode:'+listInfo.mode+'
Members:'+listInfo.member_count+' View »
Subscribers:'+listInfo.subscriber_count+' View »
URL:http://twitter.com'+listInfo.uri+'
Description:'+(listInfo.description==''?'...':listInfo.description)+'
'+ '
Hint: Hover over left hand column names for a tool tip explaining each item.
'+ '
'; return html; }, editList : function(listInfo) { var html = ''+ '
'+ '
Edit List/Group
'+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ '
Name:
Mode:'+ ' '+ '
Description:'+ ''+ '
'+ ''+ '
'+ '
'; return html; }, newList : function() { var html = ''+ '
'+ '
Create New List/Group
'+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ '
Name:
Mode:'+ ' '+ '
Description:'+ ''+ '
'+ ''+ '
'+ '
'; 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 = ''+ '
'+ '
My Lists/Groups
'+ '
Click a list to view info.
'+ ' '+ '
'+ '
'+ myListsHtml+ '
'+ '
'+ '
'+ '
'+ '
'; return html; }, info : function() { var set = tm.settings.loadedSettings; var html = ''+ '
Settings are unique to each Twitter account. The current settings apply to @'+tm.accounts.loadedAccounts[tm.accounts.selectedAccount].login+'. Please select a setting on the left to edit.
'+ '
'; return html; }, timezone : function() { var set = tm.settings.loadedSettings; var html = ''+ '
'+ 'Timezone '+unescape(set.tz_dropdown)+' '+ ' '+ '
'; return html; }, pingFm : function() { var set = tm.accounts.loadedAccounts[tm.accounts.selectedAccount].pingFm; var html = ''+ '
'+ ( set.api_key == '' ? '
'+ '
Ping.fm
'+ '
'+ ''+ ''+ ''+ ''+ '
API Key
Get Your API Key From Here »
'+ '
'+ '
'+ '
'+ '
Important! Please watch the following 2 short videos...
Post To ANY Social Network » (1 min 41 sec)
'+ '
Ping.fm & Pluggio » (2 min 50 sec)
'+ '
'+ '
'+ '
'+ ' '+ '
' : // Configured '
'+ '
Ping.fm
'+ '
'+ ''+ ''+ ''+ ''+ '
API Key*******************************************'+set.api_key.substr(set.api_key.length-4,set.api_key.length-1)+'
'+ '
'+ '
'+ '
'+ '
Places You Can Post To
'+ tm.templates.pingFm.checkBoxes()+ '
'+ '
'+ '
Important! Please watch the following 2 short videos...
Post To ANY Social Network » (1 min 41 sec)
'+ '
Ping.fm & Pluggio » (2 min 50 sec)
'+ '
'+ '
Important! By selecting the above checkboxes you are NOT turning on/off which service you post to. You ARE selecting which checkboxes will be selected by default when you open a new Tweet dialog.
'+ '
Important! You will be able to post to one (or more) of the above services with each Tweet. You can select where to post on a Tweet by Tweet basis. The above list is for information only and to allow you to specify defaults.
'+ '
'+ '
'+ ' '+ ' '+ '
' )+ '
'; return html; }, bitly : function() { var set = tm.settings.loadedSettings; var html = ''+ '
'+ '
Bit.ly (Short URLs)
'+ '
'+ ' '+ ' '+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ '
Bit.ly login
Bit.ly API Key
'+ '
'+ '
'+ ' '+ '
'+ '
'; return html; }, newFollowers : function() { var set = tm.settings.loadedSettings; if ( set.auto_dm_message == null ) { set.auto_dm_message = 'Thanks for the follow'; } var html = ''+ '
'+ '
New Follower Automation
'+ '
'+ ' '+ ' '+ '
'+ '
'+ ' '+ ' '+ '
'+ '
'+ ''+ '
'+ '
Dynamic Fields
'+ '
'+ 'You can use the following dynamic fields in your message:'+ ''+ '
'+ '
'+ ' '+ '
'+ '
'; return html; }, rollingSchedule : function() { var set = tm.settings.loadedSettings; var html = ''+ '
'+ '
Rolling Schedule
'+ '
'+ 'Post Tweets every minutes'+ '
'+ '
'+ ' '+ ' to minutes'+ '
'+ '
'+ '
Post Tweets on the following days:
'+ '
'+ ' '+ ' '+ ' '+ ' '+ ' '+ ' '+ ' '+ '
'+ '
'+ '
'+ ' '+ '
'+ '
'+ 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 = ''+ ''+ ''+ ' '+ '