修訂 | b813e83f6546057a17ba8b7d8ae55235a1376593 (tree) |
---|---|
時間 | 2015-07-10 21:46:37 |
作者 | masakih <masakih@user...> |
Commiter | masakih |
処理を変更
@@ -17,7 +17,6 @@ class KCBFOMainWindowController: NSWindowController { | ||
17 | 17 | var flashTopLeft: NSPoint = NSMakePoint(2600, 145); |
18 | 18 | |
19 | 19 | let gamePageURL = "http://www.dmm.com/netgame/social/-/gadgets/=/app_id=854854/" |
20 | - let loginPageURLPrefix = "https://www.dmm.com/my/-/login/=/" | |
21 | 20 | |
22 | 21 | override class func new() -> KCBFOMainWindowController { |
23 | 22 | return KCBFOMainWindowController(windowNibName: "KCBFOMainWindowController") |
@@ -111,22 +110,21 @@ class KCBFOMainWindowController: NSWindowController { | ||
111 | 110 | } |
112 | 111 | |
113 | 112 | // MARK: - WebUIDelegate |
113 | + let ignoreTags = [WebMenuItemTagOpenLinkInNewWindow, | |
114 | + WebMenuItemTagDownloadLinkToDisk, | |
115 | + WebMenuItemTagOpenImageInNewWindow, | |
116 | + WebMenuItemTagOpenFrameInNewWindow, | |
117 | + WebMenuItemTagGoBack, | |
118 | + WebMenuItemTagGoForward, | |
119 | + WebMenuItemTagStop, | |
120 | + WebMenuItemTagReload] | |
121 | + | |
114 | 122 | override func webView(sender: WebView!, contextMenuItemsForElement element: [NSObject : AnyObject]!, defaultMenuItems: [AnyObject]!) -> [AnyObject]! { |
115 | - return defaultMenuItems.flatMap(){ | |
116 | - item in | |
117 | - switch item.tag() { | |
118 | - case WebMenuItemTagOpenLinkInNewWindow, | |
119 | - WebMenuItemTagDownloadLinkToDisk, | |
120 | - WebMenuItemTagOpenImageInNewWindow, | |
121 | - WebMenuItemTagOpenFrameInNewWindow, | |
122 | - WebMenuItemTagGoBack, | |
123 | - WebMenuItemTagGoForward, | |
124 | - WebMenuItemTagStop, | |
125 | - WebMenuItemTagReload: | |
123 | + return defaultMenuItems.flatMap() { | |
124 | + if contains(ignoreTags, $0.tag()) { | |
126 | 125 | return [] |
127 | - default: | |
128 | - return [item] | |
129 | 126 | } |
127 | + return [$0] | |
130 | 128 | } |
131 | 129 | } |
132 | 130 | } |