function checkRecordingState(status)
    {
        if (status.stream) 
        {
            // Record currently recorded tab ID
            currentRecordedTabID = status.tabID;

            // Disable buttons
            $('#gifButton, #videoButton').prop('disabled', true);

            // Check if it's this tab or another tab
            if (currentTabID == status.tabID) 
            {
                // Note that a recording is already underway
                $('#recordingStatus').text('(currently recording this tab [<a href="#" id="stopRecordingLink" title="Stop current recording">stop recording</a>])');
                $('#stopRecordingLink').click(function (event) {
                    backgroundConnection.postMessage({
                        request: "stopVideoRecording",
                        tabID: status.tabID,
                    });
                });
            }
            else    // Another tab
            {
                // Note that a recording is already underway
                $('#recordingStatus').html('(already recording <a href="#" id="recordedTabLink" title="Jump to current tab being recorded">another tab</a>)');
                $('#recordedTabLink').click(function (event) {
                    chrome.tabs.update(currentRecordedTabID, {
                        selected: true, 
                    });
                });
            }
        }
    }
// Check recording state and update UI as necessary
Check recording state and update UI as necessary
Check recording state and update UI as necessary
function checkRecordingState(status)
    {
        if (status.stream) 
        {
            currentRecordedTabID = status.tabID;
            $('#gifButton, #videoButton').prop('disabled', true);
            if (currentTabID == status.tabID) 
            {
                $('#recordingStatus').text('(currently recording this tab [<a href="#" id="stopRecordingLink" title="Stop current recording">stop recording</a>])');
                $('#stopRecordingLink').click(function (event) {
                    backgroundConnection.postMessage({
                        request: "stopVideoRecording",
                        tabID: status.tabID,
                    });
                });
            }
            else    
            {
                $('#recordingStatus').html('(already recording <a href="#" id="recordedTabLink" title="Jump to current tab being recorded">another tab</a>)');
                $('#recordedTabLink').click(function (event) {
                    chrome.tabs.update(currentRecordedTabID, {
                        selected: true, 
                    });
                });
            }
        }
    }
function checkRecordingState ( status ) { if ( status . stream ) { currentRecordedTabID = status . tabID ; $ ( '#gifButton, #videoButton' ) . prop ( 'disabled' , true ) ; if ( currentTabID == status . tabID ) { $ ( '#recordingStatus' ) . text ( '(currently recording this tab [<a href="#" id="stopRecordingLink" title="Stop current recording">stop recording</a>])' ) ; $ ( '#stopRecordingLink' ) . click ( function ( event ) { backgroundConnection . postMessage ( { request : "stopVideoRecording" , tabID : status . tabID , } ) ; } ) ; } else { $ ( '#recordingStatus' ) . html ( '(already recording <a href="#" id="recordedTabLink" title="Jump to current tab being recorded">another tab</a>)' ) ; $ ( '#recordedTabLink' ) . click ( function ( event ) { chrome . tabs . update ( currentRecordedTabID , { selected : true , } ) ; } ) ; } } }
Check recording state and update UI as necessary
Check recording state and update UI as necessary
// Record currently recorded tab ID // Disable buttons // Check if it's this tab or another tab // Note that a recording is already underway // Another tab // Note that a recording is already underway