diff --git a/README b/README index b5902b5..2530317 100644 --- a/README +++ b/README @@ -1,26 +1,25 @@ -pdfvideo - share pdfs with video overlays +videopdf - share pdfs with video overlays Get: cd /srv - bzr branch http://code.0x2620.org/pdfvideo - cd pdfvideo + bzr branch http://code.0x2620.org/videopdf + cd videopdf virtualenv --system-site-packages . . bin/activate pip install -r requirements.txt Develop: - cd /srv/pdfvideo - create pdfvideo/local_settings.py + cd /srv/videopdf ./manage.py runserver Deploy: - cd /srv/pdfvideo - create pdfvideo/local_settings.py + cd /srv/videopdf - create /etc/apache2/sites-availavle/sitename.conf - create /etc/init/pdfvideo.conf + # create videopdf/local_settings.py with your database settings + # create /etc/apache2/sites-availavle/sitename.conf (use etc/apache2/videopdf.conf as template) + #create /etc/init/videopdf.conf (ues etc/init/videopdf.conf as template) - service pdfvideo start + service videopdf start diff --git a/etc/apache2/pdfview.conf b/etc/apache2/videopdf.conf similarity index 57% rename from etc/apache2/pdfview.conf rename to etc/apache2/videopdf.conf index d2f8fbb..87cb68a 100644 --- a/etc/apache2/pdfview.conf +++ b/etc/apache2/videopdf.conf @@ -2,13 +2,13 @@ ServerName pdf.0x2620.org LogLevel warn - ErrorLog /var/log/apache2/pdfvideo.org_error.log - CustomLog /var/log/apache2/pdfvideo.org_access.log combined + ErrorLog /var/log/apache2/videopdf.org_error.log + CustomLog /var/log/apache2/videopdf.org_access.log combined Options -Indexes - + Order deny,allow Allow from all @@ -18,13 +18,13 @@ XSendFileAllowAbove on - Alias /.bzr /srv/pdfvideo/.bzr - Alias /static/admin /srv/pdfvideo/src/django/django/contrib/admin/static/admin - Alias /static /srv/pdfvideo/static - Alias /robots.txt /srv/pdfvideo/pdfvideo/static/robots.txt - Alias /favicon.ico /srv/pdfvideo/pdfvideo/static/favicon.ico - Alias /data /srv/pdfvideo/data - Alias /admin/media /srv/pdfvideo/src/django/django/contrib/admin/media + Alias /.bzr /srv/videopdf/.bzr + Alias /static/admin /srv/videopdf/src/django/django/contrib/admin/static/admin + Alias /static /srv/videopdf/static + Alias /robots.txt /srv/videopdf/videopdf/static/robots.txt + Alias /favicon.ico /srv/videopdf/videopdf/static/favicon.ico + Alias /data /srv/videopdf/data + Alias /admin/media /srv/videopdf/src/django/django/contrib/admin/media ProxyPass /static ! ProxyPass /favicon.ico ! diff --git a/etc/init/pdfvideo.conf b/etc/init/videopdf.conf similarity index 63% rename from etc/init/pdfvideo.conf rename to etc/init/videopdf.conf index 4e5a16f..377a41f 100644 --- a/etc/init/pdfvideo.conf +++ b/etc/init/videopdf.conf @@ -1,21 +1,21 @@ -# pdfvideo gunicorn daemon +# videopdf gunicorn daemon # -description "pdfvideo daemon" +description "videopdf daemon" start on runlevel [2345] stop on runlevel [!2345] kill timeout 5 respawn -env NAME=pdfvideo -env VENV=/srv/pdfvideo -env DAEMON_USER=pdfvideo -env HOME=/home/pdfvideo +env NAME=videopdf +env VENV=/srv/videopdf +env DAEMON_USER=videopdf +env HOME=/home/videopdf script -test -e /var/log/$NAME || (mkdir -p /var/log/pdfvideo && chown $DAEMON_USER:$DAEMON_USER /var/log/$NAME) -cd $VENV/pdfvideo +test -e /var/log/$NAME || (mkdir -p /var/log/videopdf && chown $DAEMON_USER:$DAEMON_USER /var/log/$NAME) +cd $VENV/videopdf exec /usr/bin/sudo -u $DAEMON_USER $VENV/bin/gunicorn_django \ --bind 127.0.0.1:2688 \ --timeout 90 \ diff --git a/manage.py b/manage.py index cdde221..1b697a0 100755 --- a/manage.py +++ b/manage.py @@ -3,7 +3,7 @@ import os import sys if __name__ == "__main__": - os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pdfvideo.settings") + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "videopdf.settings") from django.core.management import execute_from_command_line diff --git a/static/viewer.js b/static/viewer.js index a8837da..b37f369 100644 --- a/static/viewer.js +++ b/static/viewer.js @@ -1232,7 +1232,9 @@ var PDFView = { var zoom = store.get('zoom', PDFView.currentScale); var left = store.get('scrollLeft', '0'); var top = store.get('scrollTop', '0'); - + if(document.location.hash) { + page = document.location.hash.substring(1); + } storedHash = 'page=' + page + '&zoom=' + zoom + ',' + left + ',' + top; } diff --git a/pdfvideo/__init__.py b/videopdf/__init__.py similarity index 100% rename from pdfvideo/__init__.py rename to videopdf/__init__.py diff --git a/pdfvideo/settings.py b/videopdf/settings.py similarity index 97% rename from pdfvideo/settings.py rename to videopdf/settings.py index 2130ede..390f5a7 100644 --- a/pdfvideo/settings.py +++ b/videopdf/settings.py @@ -1,4 +1,4 @@ -# Django settings for pdfvideo project. +# Django settings for videopdf project. import os from os.path import join,dirname,normpath @@ -101,10 +101,10 @@ MIDDLEWARE_CLASSES = ( # 'django.middleware.clickjacking.XFrameOptionsMiddleware', ) -ROOT_URLCONF = 'pdfvideo.urls' +ROOT_URLCONF = 'videopdf.urls' # Python dotted path to the WSGI application used by Django's runserver. -WSGI_APPLICATION = 'pdfvideo.wsgi.application' +WSGI_APPLICATION = 'videopdf.wsgi.application' TEMPLATE_DIRS = ( join(PROJECT_ROOT, 'templates') diff --git a/pdfvideo/urls.py b/videopdf/urls.py similarity index 91% rename from pdfvideo/urls.py rename to videopdf/urls.py index 0b2d639..6365f06 100644 --- a/pdfvideo/urls.py +++ b/videopdf/urls.py @@ -10,8 +10,8 @@ admin.autodiscover() urlpatterns = patterns('', # Examples: - # url(r'^$', 'pdfvideo.views.home', name='home'), - # url(r'^pdfvideo/', include('pdfvideo.foo.urls')), + # url(r'^$', 'videopdf.views.home', name='home'), + # url(r'^videopdf/', include('videopdf.foo.urls')), # Uncomment the admin/doc line below to enable admin documentation: url(r'^admin/doc/', include('django.contrib.admindocs.urls')), diff --git a/pdfvideo/wsgi.py b/videopdf/wsgi.py similarity index 91% rename from pdfvideo/wsgi.py rename to videopdf/wsgi.py index 864385d..6a5f80a 100644 --- a/pdfvideo/wsgi.py +++ b/videopdf/wsgi.py @@ -1,5 +1,5 @@ """ -WSGI config for pdfvideo project. +WSGI config for videopdf project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable @@ -15,7 +15,7 @@ framework. """ import os -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pdfvideo.settings") +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "videopdf.settings") # This application object is used by any WSGI server configured to use this # file. This includes Django's development server, if the WSGI_APPLICATION