From 02c5fd688fa20af749653fc36ecbea1d1929327c Mon Sep 17 00:00:00 2001 From: vitorsemeano Date: Mon, 25 Mar 2019 23:08:04 +0000 Subject: [PATCH] removed old duplicate files for viewmanager --- src/components/viewmanager/package.json | 3 - src/components/viewmanager/viewContainer.css | 69 ------- src/components/viewmanager/viewManager.js | 183 ------------------- src/controllers/librarysettings.js | 2 +- 4 files changed, 1 insertion(+), 256 deletions(-) delete mode 100644 src/components/viewmanager/package.json delete mode 100644 src/components/viewmanager/viewContainer.css delete mode 100644 src/components/viewmanager/viewManager.js diff --git a/src/components/viewmanager/package.json b/src/components/viewmanager/package.json deleted file mode 100644 index 819371af71..0000000000 --- a/src/components/viewmanager/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "viewManager.js" -} \ No newline at end of file diff --git a/src/components/viewmanager/viewContainer.css b/src/components/viewmanager/viewContainer.css deleted file mode 100644 index edfa101976..0000000000 --- a/src/components/viewmanager/viewContainer.css +++ /dev/null @@ -1,69 +0,0 @@ -.mainAnimatedPage { - position: absolute; - top: 0; - left: 0; - right: 0; - bottom: 0; - contain: layout style size; - /* Can't use will-change because it causes the alpha picker to move when the page scrolls*/ - /*will-change: transform;*/ -} - -@keyframes view-fadeout { - from { - opacity: 1; - } - - to { - opacity: 0; - } -} -@keyframes view-fadein { - from { - opacity: 0; - } - - to { - opacity: 1; - } -} - -@keyframes view-slideleft { - from { - transform: translate3d(100%, 0, 0); - } - - to { - transform: none; - } -} - -@keyframes view-slideleft-r { - from { - transform: none; - } - - to { - transform: translate3d(-100%, 0, 0); - } -} - -@keyframes view-slideright { - from { - transform: translate3d(-100%, 0, 0); - } - - to { - transform: none; - } -} - -@keyframes view-slideright-r { - from { - transform: none; - } - - to { - transform: translate3d(100%, 0, 0); - } -} \ No newline at end of file diff --git a/src/components/viewmanager/viewManager.js b/src/components/viewmanager/viewManager.js deleted file mode 100644 index 606c7e98c1..0000000000 --- a/src/components/viewmanager/viewManager.js +++ /dev/null @@ -1,183 +0,0 @@ -define(['viewcontainer', 'focusManager', 'queryString', 'layoutManager'], function (viewcontainer, focusManager, queryString, layoutManager) { - 'use strict'; - - var currentView; - var dispatchPageEvents; - - viewcontainer.setOnBeforeChange(function (newView, isRestored, options) { - - var lastView = currentView; - if (lastView) { - - var beforeHideResult = dispatchViewEvent(lastView, null, 'viewbeforehide', true); - - if (!beforeHideResult) { - // todo: cancel - } - } - - var eventDetail = getViewEventDetail(newView, options, isRestored); - - if (!newView.initComplete) { - newView.initComplete = true; - - if (options.controllerFactory) { - - // Use controller method - var controller = new options.controllerFactory(newView, eventDetail.detail.params); - } - - if (!options.controllerFactory || dispatchPageEvents) { - dispatchViewEvent(newView, eventDetail, 'viewinit'); - } - } - - dispatchViewEvent(newView, eventDetail, 'viewbeforeshow'); - }); - - function onViewChange(view, options, isRestore) { - - var lastView = currentView; - if (lastView) { - dispatchViewEvent(lastView, null, 'viewhide'); - } - - currentView = view; - - var eventDetail = getViewEventDetail(view, options, isRestore); - - if (!isRestore) { - if (options.autoFocus !== false) { - focusManager.autoFocus(view); - } - } - else if (!layoutManager.mobile) { - if (view.activeElement && document.body.contains(view.activeElement) && focusManager.isCurrentlyFocusable(view.activeElement)) { - focusManager.focus(view.activeElement); - } else { - focusManager.autoFocus(view); - } - } - - view.dispatchEvent(new CustomEvent('viewshow', eventDetail)); - - if (dispatchPageEvents) { - view.dispatchEvent(new CustomEvent('pageshow', eventDetail)); - } - } - - function getProperties(view) { - var props = view.getAttribute('data-properties'); - - if (props) { - return props.split(','); - } - - return []; - } - - function dispatchViewEvent(view, eventInfo, eventName, isCancellable) { - - if (!eventInfo) { - eventInfo = { - detail: { - type: view.getAttribute('data-type'), - properties: getProperties(view) - }, - bubbles: true, - cancelable: isCancellable - }; - } - - eventInfo.cancelable = isCancellable || false; - - var eventResult = view.dispatchEvent(new CustomEvent(eventName, eventInfo)); - - if (dispatchPageEvents) { - eventInfo.cancelable = false; - view.dispatchEvent(new CustomEvent(eventName.replace('view', 'page'), eventInfo)); - } - - return eventResult; - } - - function getViewEventDetail(view, options, isRestore) { - - var url = options.url; - var index = url.indexOf('?'); - var params = index === -1 ? {} : queryString.parse(url.substring(index + 1)); - - return { - detail: { - type: view.getAttribute('data-type'), - properties: getProperties(view), - params: params, - isRestored: isRestore, - state: options.state, - - // The route options - options: options.options || {} - }, - bubbles: true, - cancelable: false - }; - } - - function resetCachedViews() { - // Reset all cached views whenever the skin changes - viewcontainer.reset(); - } - - document.addEventListener('skinunload', resetCachedViews); - - function ViewManager() { - } - - ViewManager.prototype.loadView = function (options) { - - var lastView = currentView; - - // Record the element that has focus - if (lastView) { - lastView.activeElement = document.activeElement; - } - - if (options.cancel) { - return; - } - - viewcontainer.loadView(options).then(function (view) { - - onViewChange(view, options); - }); - }; - - ViewManager.prototype.tryRestoreView = function (options, onViewChanging) { - - if (options.cancel) { - return Promise.reject({ cancelled: true }); - } - - // Record the element that has focus - if (currentView) { - currentView.activeElement = document.activeElement; - } - - return viewcontainer.tryRestoreView(options).then(function (view) { - - onViewChanging(); - onViewChange(view, options, true); - - }); - }; - - ViewManager.prototype.currentView = function () { - return currentView; - }; - - ViewManager.prototype.dispatchPageEvents = function (value) { - dispatchPageEvents = value; - }; - - return new ViewManager(); -}); diff --git a/src/controllers/librarysettings.js b/src/controllers/librarysettings.js index 997ccdfd4d..3fc9c40d98 100644 --- a/src/controllers/librarysettings.js +++ b/src/controllers/librarysettings.js @@ -88,4 +88,4 @@ define(["jQuery", "loading", "libraryMenu", "fnchecked", "emby-checkbox", "emby- }); }); } -}); +}); \ No newline at end of file