|  | @@ -17,11 +17,13 @@ import eu.kanade.tachiyomi.data.database.models.Manga
 | 
											
												
													
														|  |  import eu.kanade.tachiyomi.data.preference.PreferencesHelper
 |  |  import eu.kanade.tachiyomi.data.preference.PreferencesHelper
 | 
											
												
													
														|  |  import eu.kanade.tachiyomi.source.CatalogueSource
 |  |  import eu.kanade.tachiyomi.source.CatalogueSource
 | 
											
												
													
														|  |  import eu.kanade.tachiyomi.source.model.FilterList
 |  |  import eu.kanade.tachiyomi.source.model.FilterList
 | 
											
												
													
														|  | 
 |  | +import eu.kanade.tachiyomi.source.online.HttpSource
 | 
											
												
													
														|  |  import eu.kanade.tachiyomi.ui.base.controller.NucleusController
 |  |  import eu.kanade.tachiyomi.ui.base.controller.NucleusController
 | 
											
												
													
														|  |  import eu.kanade.tachiyomi.ui.base.controller.SecondaryDrawerController
 |  |  import eu.kanade.tachiyomi.ui.base.controller.SecondaryDrawerController
 | 
											
												
													
														|  |  import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction
 |  |  import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction
 | 
											
												
													
														|  |  import eu.kanade.tachiyomi.ui.library.ChangeMangaCategoriesDialog
 |  |  import eu.kanade.tachiyomi.ui.library.ChangeMangaCategoriesDialog
 | 
											
												
													
														|  |  import eu.kanade.tachiyomi.ui.manga.MangaController
 |  |  import eu.kanade.tachiyomi.ui.manga.MangaController
 | 
											
												
													
														|  | 
 |  | +import eu.kanade.tachiyomi.ui.manga.info.MangaWebViewController
 | 
											
												
													
														|  |  import eu.kanade.tachiyomi.util.*
 |  |  import eu.kanade.tachiyomi.util.*
 | 
											
												
													
														|  |  import eu.kanade.tachiyomi.widget.AutofitRecyclerView
 |  |  import eu.kanade.tachiyomi.widget.AutofitRecyclerView
 | 
											
												
													
														|  |  import kotlinx.android.synthetic.main.catalogue_controller.*
 |  |  import kotlinx.android.synthetic.main.catalogue_controller.*
 | 
											
										
											
												
													
														|  | @@ -259,15 +261,38 @@ open class BrowseCatalogueController(bundle: Bundle) :
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | 
 |  | +    override fun onPrepareOptionsMenu(menu: Menu) {
 | 
											
												
													
														|  | 
 |  | +        super.onPrepareOptionsMenu(menu)
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +        val isHttpSource = presenter.source is HttpSource
 | 
											
												
													
														|  | 
 |  | +        menu.findItem(R.id.action_open_in_browser).isVisible = isHttpSource
 | 
											
												
													
														|  | 
 |  | +        menu.findItem(R.id.action_open_in_web_view).isVisible = isHttpSource
 | 
											
												
													
														|  | 
 |  | +    }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |      override fun onOptionsItemSelected(item: MenuItem): Boolean {
 |  |      override fun onOptionsItemSelected(item: MenuItem): Boolean {
 | 
											
												
													
														|  |          when (item.itemId) {
 |  |          when (item.itemId) {
 | 
											
												
													
														|  |              R.id.action_display_mode -> swapDisplayMode()
 |  |              R.id.action_display_mode -> swapDisplayMode()
 | 
											
												
													
														|  |              R.id.action_set_filter -> navView?.let { activity?.drawer?.openDrawer(Gravity.END) }
 |  |              R.id.action_set_filter -> navView?.let { activity?.drawer?.openDrawer(Gravity.END) }
 | 
											
												
													
														|  | 
 |  | +            R.id.action_open_in_browser -> openInBrowser()
 | 
											
												
													
														|  | 
 |  | +            R.id.action_open_in_web_view -> openInWebView()
 | 
											
												
													
														|  |              else -> return super.onOptionsItemSelected(item)
 |  |              else -> return super.onOptionsItemSelected(item)
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |          return true
 |  |          return true
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | 
 |  | +    private fun openInBrowser() {
 | 
											
												
													
														|  | 
 |  | +        val source = presenter.source as? HttpSource ?: return
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +        activity?.openInBrowser(source.baseUrl)
 | 
											
												
													
														|  | 
 |  | +    }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +    private fun openInWebView() {
 | 
											
												
													
														|  | 
 |  | +        val source = presenter.source as? HttpSource ?: return
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +        router.pushController(MangaWebViewController(source.id, source.baseUrl)
 | 
											
												
													
														|  | 
 |  | +                .withFadeTransaction())
 | 
											
												
													
														|  | 
 |  | +    }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |      /**
 |  |      /**
 | 
											
												
													
														|  |       * Restarts the request with a new query.
 |  |       * Restarts the request with a new query.
 | 
											
												
													
														|  |       *
 |  |       *
 |