Skip to content

Instantly share code, notes, and snippets.

@maxpeterson
Last active January 27, 2017 12:54
Show Gist options
  • Save maxpeterson/f744b7c60b6c17bc3199e4cab0ad2482 to your computer and use it in GitHub Desktop.
Save maxpeterson/f744b7c60b6c17bc3199e4cab0ad2482 to your computer and use it in GitHub Desktop.
Make a Agnitio iPlaner edetail from Viseven to be compatible with the Incuna eDetailing
# Point =/ag.openPDF to eDetailing.openPDF if available.
sed -i '' -e "s/ag.openPDF=/ag.openPDF=window.eDetailing\&\&function(p){var l=window.parent.document.createElement('a');l.href=p;window.eDetailing.openPDF(l.href)}||/g" core.js spa.js
# Add logevent.js top index.html
grep logevent.js index.html -q
if [ $? == 1 ]; then
sed -i '' -e 's|</body>| <script src="../../support/logevent.js"></script>\
&|' index.html
fi
# Add edetailing.js to all slides index.html
while read file; do
grep edetailing.js index.html -q
if [ $? == 1 ]; then
sed -i '' -e 's|\(.*\)<script src="../../core.js"></script>|\1<script src="../../edetailing.js"></script>\
&|' $file
fi
done < <(find slides -name index.html)
# Zip up the files to send to http://edetailing.incuna.com/admin/edetailing/presentation/128/
zip -r ../gastroenterology.zip . -x .git/\* -x media/videos/\* -x support/\*
@maxpeterson
Copy link
Author

sed -i '' -e 's|\(.*\)<script src="../../core.js"></script>|\1<script src="../../support/logevent.js"></script>\
&|' index.html
find slides -name index.html | xargs sed -i '' -e 's|\(.*\)<script src="../../core.js"></script>|\1<script src="../../edetailing.js"></script>\
&|'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment