import ipc from 'ipc'
import Rx from 'rx'
import Renderer from './renderer'
import ActionDispatcher from './dispatcher/action-dispatcher'
import ViewDispatcher from './dispatcher/view-dispatcher'
import TwitterHomeTimelineStore from './stores/home-timeline-store'
import TweetListStatusStore from './stores/tweet-list-status-store'
import MentionsStore from './stores/mentions-store'
import EditorStore from './stores/editor-store'
import DirectMessageStore from './stores/direct-message-store'
import TwitterClientAction from './actions/twitter-client-action'
import TweetListSwitchAction from './actions/tweet-list-switch-action'
import EditorAction from './actions/editor-action'

export default class ApplicationInitializer {
    constructor() {
    }


    run(twitterClient) {
        // initialize stores.
        let stores = {
            homeTimelineStore: new TwitterHomeTimelineStore(),
            tweetListStatusStore: new TweetListStatusStore(),
            mentionsStore: new MentionsStore(),
            directMessageStore: new DirectMessageStore(),
            editorStore: new EditorStore()
        };

        // initialize actions.
        let twitterClientAction = new TwitterClientAction(twitterClient);
        new TweetListSwitchAction();
        new EditorAction();

        // start application.


        setTimeout(() => {
            let preLoad = document.getElementById("preLoad");
            document.body.removeChild(preLoad);
            Renderer.render(stores);
            twitterClientAction.start();
        }, 1000);
    }
}

@@ -1,12 +1,40 @@
+import remote from 'remote'%0A
 import ipc f
@@ -1314,16 +1314,298 @@
 ion();%0A%0A
+        // initialize context menu.%0A        let Menu = remote.require('menu');%0A        let MenuItem = remote.require('menu-item');%0A%0A        let menu = new Menu();%0A        window.addEventListener('contextmenu', (e) =%3E %7B%0A            // TODO: e.target%E3%81%AE%E5%86%85%E5%AE%B9%E3%82%92%E8%A6%8B%E3%81%A6menuItem%E3%82%92%E5%87%BA%E3%81%97%E5%88%86%E3%81%91%E3%82%8B%0A        %7D);%0A%0A
         
@@ -1626,18 +1626,16 @@
 cation.%0A
-%0A%0A
         

add context menu event listener.