From 22cd1d358d06e3de55a8af259249bb03f99f7b2b Mon Sep 17 00:00:00 2001 From: j Date: Wed, 8 Aug 2018 10:11:53 +0100 Subject: [PATCH 1/3] add optional hook for local overwrites --- static/js/pandora.js | 1 + 1 file changed, 1 insertion(+) diff --git a/static/js/pandora.js b/static/js/pandora.js index c238563f..73a1c4da 100644 --- a/static/js/pandora.js +++ b/static/js/pandora.js @@ -475,6 +475,7 @@ appPanel // allow site scripts to run after pandora is loaded pandora.triggerEvent('loaded'); !pandora.isLicensed() && pandora.openLicenseDialog(); + pandora.localInitInit && pandora.localInitInit(); loadUserScript && pandora.loadUserScript(); document.removeEventListener && document.removeEventListener( 'keydown', onKeydown From d07a60ba5fc8c0db8cfe4ee99118eff678143234 Mon Sep 17 00:00:00 2001 From: j Date: Wed, 8 Aug 2018 10:22:19 +0100 Subject: [PATCH 2/3] add site only javascript files --- pandora/app/config.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/pandora/app/config.py b/pandora/app/config.py index e7b39884..f1946942 100644 --- a/pandora/app/config.py +++ b/pandora/app/config.py @@ -257,14 +257,21 @@ def update_static(): pandora_json = os.path.join(settings.STATIC_ROOT, 'json/pandora.json') for root, folders, files in os.walk(os.path.join(settings.STATIC_ROOT, 'js')): for f in files: - if not f in ( - 'pandora.js', 'pandora.min.js' - ) and f.endswith('.js') and len(f.split('.')) == 2: - f = os.path.join(root, f) - #ignore old embed js file - if 'js/embed/' in f: - continue + f = os.path.join(root, f) + #ignore old embed js file + if 'js/embed/' in f: + continue + if len(f.split('.')) == 2: fsite = f.replace('.js', '.%s.js' % settings.CONFIG['site']['id']) + else: + fsite = f + basefile = f.split('.')[0] + '.js' + if f not in ( + 'pandora.js', 'pandora.min.js' + ) and f.endswith('.js') and ( + len(f.split('.')) == 2 or + not os.path.exists(basefile) and fsite == f + ): if os.path.exists(fsite): f = fsite js.append(f[len(settings.STATIC_ROOT)+1:]) From f818f962bc6a26bdab43d9e35baa401545f3c209 Mon Sep 17 00:00:00 2001 From: j Date: Thu, 9 Aug 2018 10:23:53 +0100 Subject: [PATCH 3/3] return empty query --- pandora/edit/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora/edit/models.py b/pandora/edit/models.py index 69b7bb37..554ae068 100644 --- a/pandora/edit/models.py +++ b/pandora/edit/models.py @@ -251,7 +251,7 @@ class Edit(models.Model): items = [i['id'] for i in self.get_items(user).values('id')] clips = clips.filter(item__in=items) else: - clips = None + clips = clip.models.Clip.objects.filter(id=None) return clips def get_clips_json(self, user=None):