started making pdf viewer conditional - work in progress

This commit is contained in:
Brian Gough 2014-11-28 16:59:39 +00:00
parent 57f4177f30
commit 57b09e1d60
4 changed files with 10 additions and 6 deletions

View file

@ -46,10 +46,10 @@ TpdsWorker.js
BackgroundJobsWorker.js BackgroundJobsWorker.js
public/js/history/versiondetail.js public/js/history/versiondetail.js
!public/js/libs/* !public/js/libs/
public/js/* public/js/*
!public/js/ace/* !public/js/ace/*
!public/js/libs/* !public/js/libs/
public/js/editor.js public/js/editor.js
public/js/home.js public/js/home.js
public/js/forms.js public/js/forms.js

View file

@ -35,7 +35,9 @@ UserSchema = new Schema
compileTimeout: { type:Number, default: Settings.defaultFeatures.compileTimeout } compileTimeout: { type:Number, default: Settings.defaultFeatures.compileTimeout }
compileGroup: { type:String, default: Settings.defaultFeatures.compileGroup } compileGroup: { type:String, default: Settings.defaultFeatures.compileGroup }
} }
featureSwitches : {} featureSwitches : {
pdfng: { type: Boolean }
}
referal_id : {type:String, default:() -> uuid.v4().split("-")[0]} referal_id : {type:String, default:() -> uuid.v4().split("-")[0]}
refered_users: [ type:ObjectId, ref:'User' ] refered_users: [ type:ObjectId, ref:'User' ]
refered_user_count: { type:Number, default: 0 } refered_user_count: { type:Number, default: 0 }

View file

@ -112,8 +112,10 @@ block content
- locals.suppressDefaultJs = true - locals.suppressDefaultJs = true
- var fingerprintedPath = fingerprint(jsPath+'libs/pdf.worker.js') - var pdfPath = 'libs/pdf.worker.js'
- var pdfJsWorkerPath = jsPath+'libs/pdf.worker.js?fingerprint='+fingerprintedPath - if (user.featureSwitches && user.featureSwitches.pdfng) { pdfPath = 'libs/pdfjs-1.0.712/pdf.worker.js'; }
- var fingerprintedPath = fingerprint(jsPath+pdfPath)
- var pdfJsWorkerPath = jsPath+pdfPath+'?fingerprint='+fingerprintedPath
script(type='text/javascript'). script(type='text/javascript').
window.pdfJsWorkerPath = "#{pdfJsWorkerPath}"; window.pdfJsWorkerPath = "#{pdfJsWorkerPath}";

View file

@ -6,7 +6,7 @@ define [
"ide/pdfng/directives/pdfRenderer" "ide/pdfng/directives/pdfRenderer"
"ide/pdfng/directives/pdfPage" "ide/pdfng/directives/pdfPage"
"ide/pdfng/directives/pdfViewer" "ide/pdfng/directives/pdfViewer"
"libs/pdf" "libs/pdfjs-1.0.712/pdf"
"text!libs/pdfListView/TextLayer.css" "text!libs/pdfListView/TextLayer.css"
"text!libs/pdfListView/AnnotationsLayer.css" "text!libs/pdfListView/AnnotationsLayer.css"
"text!libs/pdfListView/HighlightsLayer.css" "text!libs/pdfListView/HighlightsLayer.css"