diff --git a/CMakeLists.txt b/CMakeLists.txt index 580d4c17..cbefe9ae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,10 +25,22 @@ endif (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) # Tools must be obtained to work with: include (ExternalProject) +# allow specification of a directory with pre-downloaded +# requirements by evaluating environment variable +# $WEBODF_DOWNLOAD_DIR +# defaults to ./downloads in the build directory. +if ( IS_DIRECTORY $ENV{WEBODF_DOWNLOAD_DIR} ) + SET ( EXTERNALS_DOWNLOAD_DIR $ENV{WEBODF_DOWNLOAD_DIR} ) +else ( IS_DIRECTORY $ENV{WEBODF_DOWNLOAD_DIR} ) + SET ( EXTERNALS_DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/downloads ) +endif ( IS_DIRECTORY $ENV{WEBODF_DOWNLOAD_DIR} ) +MESSAGE ( STATUS "external downloads will be stored/expected in: ${EXTERNALS_DOWNLOAD_DIR}" ) + if(Java_JAVA_EXECUTABLE) # Closure Compiler ExternalProject_Add( ClosureCompiler + DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR} URL "http://closure-compiler.googlecode.com/files/compiler-20120710.tar.gz" URL_MD5 66b6b942439119813b73103fd0086d9e CONFIGURE_COMMAND "" @@ -42,6 +54,7 @@ endif(Java_JAVA_EXECUTABLE) if(Java_JAVA_EXECUTABLE) ExternalProject_Add( Rhino + DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR} URL "http://ftp.mozilla.org/pub/js/rhino1_7R3.zip" URL_MD5 99d94103662a8d0b571e247a77432ac5 CONFIGURE_COMMAND "" @@ -54,6 +67,7 @@ endif(Java_JAVA_EXECUTABLE) # JSDoc ExternalProject_Add( JsDoc + DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR} URL "http://jsdoc-toolkit.googlecode.com/files/jsdoc_toolkit-2.4.0.zip" URL_MD5 a8f78f5ecd24b54501147b2af341a231 CONFIGURE_COMMAND "" @@ -65,6 +79,7 @@ set(JSDOCDIR ${CMAKE_BINARY_DIR}/JsDoc-prefix/src/JsDoc/jsdoc-toolkit) # Node.JS ExternalProject_Add( NodeJS + DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR} URL "http://nodejs.org/dist/v0.8.8/node-v0.8.8.tar.gz" URL_MD5 f4dae84e96a94b768404c14633bccd49 CONFIGURE_COMMAND "./configure" @@ -76,6 +91,7 @@ set(NODE ${CMAKE_BINARY_DIR}/NodeJS-prefix/src/NodeJS/out/Release/node) # JSCoverage ExternalProject_Add( JSCoverage + DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR} URL "http://siliconforks.com/jscoverage/download/jscoverage-0.5.1.tar.bz2" URL_MD5 a70d79a6759367fbcc0bcc18d6866ff3 PATCH_COMMAND patch -p0 < ${CMAKE_CURRENT_SOURCE_DIR}/JSCoverage.patch diff --git a/programs/viewer/images/texture.png b/programs/viewer/images/texture.png new file mode 100644 index 00000000..df008649 Binary files /dev/null and b/programs/viewer/images/texture.png differ diff --git a/programs/viewer/images/toolbarButton-download.png b/programs/viewer/images/toolbarButton-download.png new file mode 100644 index 00000000..8676d8e2 Binary files /dev/null and b/programs/viewer/images/toolbarButton-download.png differ diff --git a/programs/viewer/images/toolbarButton-fullscreen.png b/programs/viewer/images/toolbarButton-fullscreen.png new file mode 100644 index 00000000..fa730955 Binary files /dev/null and b/programs/viewer/images/toolbarButton-fullscreen.png differ diff --git a/programs/viewer/images/toolbarButton-menuArrows.png b/programs/viewer/images/toolbarButton-menuArrows.png new file mode 100644 index 00000000..31b06b5a Binary files /dev/null and b/programs/viewer/images/toolbarButton-menuArrows.png differ diff --git a/programs/viewer/images/toolbarButton-pageDown.png b/programs/viewer/images/toolbarButton-pageDown.png new file mode 100644 index 00000000..762ac43e Binary files /dev/null and b/programs/viewer/images/toolbarButton-pageDown.png differ diff --git a/programs/viewer/images/toolbarButton-pageUp.png b/programs/viewer/images/toolbarButton-pageUp.png new file mode 100644 index 00000000..3155b8bd Binary files /dev/null and b/programs/viewer/images/toolbarButton-pageUp.png differ diff --git a/programs/viewer/images/toolbarButton-zoomIn.png b/programs/viewer/images/toolbarButton-zoomIn.png new file mode 100644 index 00000000..670acd93 Binary files /dev/null and b/programs/viewer/images/toolbarButton-zoomIn.png differ diff --git a/programs/viewer/images/toolbarButton-zoomOut.png b/programs/viewer/images/toolbarButton-zoomOut.png new file mode 100644 index 00000000..810fbf98 Binary files /dev/null and b/programs/viewer/images/toolbarButton-zoomOut.png differ diff --git a/programs/viewer/index.html b/programs/viewer/index.html new file mode 100644 index 00000000..c55b3015 --- /dev/null +++ b/programs/viewer/index.html @@ -0,0 +1,62 @@ + + + + + + + + +
+
+
+
+
+
+
+ + + + +
+
+
+
+ +
+ +
+ + + +
+
+
+
+
+
+ + +
+
+
+
+
+
+
+ + \ No newline at end of file diff --git a/programs/viewer/viewer.css b/programs/viewer/viewer.css new file mode 100644 index 00000000..0fe318bf --- /dev/null +++ b/programs/viewer/viewer.css @@ -0,0 +1,544 @@ +* { + padding: 0; + margin: 0; +} + +body { + font-family: sans-serif; +} + +.titlebar > span, +.toolbarLabel, +input, +button, +select { + font: message-box; +} + +#titlebar { + position: absolute; + z-index: 2; + top: 0px; + left: 0px; + height: 32px; + width: 100%; + overflow: hidden; + + -webkit-box-shadow: 0px 1px 3px rgba(50, 50, 50, 0.75); + -moz-box-shadow: 0px 1px 3px rgba(50, 50, 50, 0.75); + box-shadow: 0px 1px 3px rgba(50, 50, 50, 0.75); + + background-image: url(images/texture.png), linear-gradient(rgba(69, 69, 69, .95), rgba(82, 82, 82, .99)); + background-image: url(images/texture.png), -webkit-linear-gradient(rgba(69, 69, 69, .95), rgba(82, 82, 82, .99)); + background-image: url(images/texture.png), -moz-linear-gradient(rgba(69, 69, 69, .95), rgba(82, 82, 82, .99)); + background-image: url(images/texture.png), -ms-linear-gradient(rgba(69, 69, 69, .95), rgba(82, 82, 82, .99)); + background-image: url(images/texture.png), -o-linear-gradient(rgba(69, 69, 69, .95), rgba(82, 82, 82, .99)); +} + +#documentName { + margin-left: 10px; + margin-top: 8px; + color: #F2F2F2; + font-size: 14px; + line-height: 14px; + font-family: sans-serif; +} + +#toolbarContainer { + position: absolute; + z-index: 2; + bottom: 0px; + left: 0px; + height: 32px; + width: 100%; + overflow: hidden; + + -webkit-box-shadow: 0px -1px 3px rgba(50, 50, 50, 0.75); + -moz-box-shadow: 0px -1px 3px rgba(50, 50, 50, 0.75); + box-shadow: 0px -1px 3px rgba(50, 50, 50, 0.75); + + background-image: url(images/texture.png), linear-gradient(rgba(82, 82, 82, .99), rgba(69, 69, 69, .95)); + background-image: url(images/texture.png), -webkit-linear-gradient(rgba(82, 82, 82, .99), rgba(69, 69, 69, .95)); + background-image: url(images/texture.png), -moz-linear-gradient(rgba(82, 82, 82, .99), rgba(69, 69, 69, .95)); + background-image: url(images/texture.png), -ms-linear-gradient(rgba(82, 82, 82, .99), rgba(69, 69, 69, .95)); + background-image: url(images/texture.png), -o-linear-gradient(rgba(82, 82, 82, .99), rgba(69, 69, 69, .95)); +} + +#toolbar { + position: relative; +} + +html[dir='ltr'] #toolbarLeft { + margin-left: -1px; +} +html[dir='rtl'] #toolbarRight { + margin-left: -1px; +} +html[dir='ltr'] #toolbarLeft, +html[dir='rtl'] #toolbarRight { + position: absolute; + top: 0; + left: 0; +} +html[dir='ltr'] #toolbarRight, +html[dir='rtl'] #toolbarLeft { + position: absolute; + top: 0; + right: 0; +} +html[dir='ltr'] #toolbarLeft > *, +html[dir='ltr'] #toolbarMiddle > *, +html[dir='ltr'] #toolbarRight > * { + float: left; +} +html[dir='rtl'] #toolbarLeft > *, +html[dir='rtl'] #toolbarMiddle > *, +html[dir='rtl'] #toolbarRight > * { + float: right; +} + +/* outer/inner center provides horizontal center */ +html[dir='ltr'] .outerCenter { + float: right; + position: relative; + right: 50%; +} +html[dir='rtl'] .outerCenter { + float: left; + position: relative; + left: 50%; +} +html[dir='ltr'] .innerCenter { + float: right; + position: relative; + right: -50%; +} +html[dir='rtl'] .innerCenter { + float: left; + position: relative; + left: -50%; +} + +html[dir='ltr'] .splitToolbarButton { + margin: 3px 2px 4px 0; + display: inline-block; +} +html[dir='rtl'] .splitToolbarButton { + margin: 3px 0 4px 2px; + display: inline-block; +} +html[dir='ltr'] .splitToolbarButton > .toolbarButton { + border-radius: 0; + float: left; +} +html[dir='rtl'] .splitToolbarButton > .toolbarButton { + border-radius: 0; + float: right; +} + +.splitToolbarButton.toggled .toolbarButton { + margin: 0; +} + +.toolbarButton { + border: 0 none; + background-color: rgba(0, 0, 0, 0); + width: 32px; + height: 25px; + border-radius: 2px; +} + +html[dir='ltr'] .toolbarButton, +html[dir='ltr'] .dropdownToolbarButton { + margin: 3px 2px 4px 0; +} +html[dir='rtl'] .toolbarButton, +html[dir='rtl'] .dropdownToolbarButton { + margin: 3px 0 4px 2px; +} + +.toolbarButton:hover, +.toolbarButton:focus, +.dropdownToolbarButton { + background-color: hsla(0,0%,0%,.12); + background-image: linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); + background-image: -webkit-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); + background-image: -moz-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); + background-image: -ms-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); + background-image: -o-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); + background-clip: padding-box; + border: 1px solid hsla(0,0%,0%,.35); + border-color: hsla(0,0%,0%,.32) hsla(0,0%,0%,.38) hsla(0,0%,0%,.42); + box-shadow: 0 1px 0 hsla(0,0%,100%,.05) inset, + 0 0 1px hsla(0,0%,100%,.15) inset, + 0 1px 0 hsla(0,0%,100%,.05); +} + +.toolbarButton:hover:active, +.dropdownToolbarButton:hover:active { + background-color: hsla(0,0%,0%,.2); + background-image: linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); + background-image: -webkit-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); + background-image: -moz-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); + background-image: -ms-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); + background-image: -o-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); + border-color: hsla(0,0%,0%,.35) hsla(0,0%,0%,.4) hsla(0,0%,0%,.45); + box-shadow: 0 1px 1px hsla(0,0%,0%,.1) inset, + 0 0 1px hsla(0,0%,0%,.2) inset, + 0 1px 0 hsla(0,0%,100%,.05); +} + +.splitToolbarButton:hover > .toolbarButton, +.splitToolbarButton:focus > .toolbarButton, +.splitToolbarButton.toggled > .toolbarButton, +.toolbarButton.textButton { + background-color: hsla(0,0%,0%,.12); + background-image: -webkit-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); + background-image: -moz-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); + background-image: -ms-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); + background-image: -o-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); + background-image: linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); + background-clip: padding-box; + border: 1px solid hsla(0,0%,0%,.35); + border-color: hsla(0,0%,0%,.32) hsla(0,0%,0%,.38) hsla(0,0%,0%,.42); + box-shadow: 0 1px 0 hsla(0,0%,100%,.05) inset, + 0 0 1px hsla(0,0%,100%,.15) inset, + 0 1px 0 hsla(0,0%,100%,.05); + -webkit-transition-property: background-color, border-color, box-shadow; + -webkit-transition-duration: 150ms; + -webkit-transition-timing-function: ease; + -moz-transition-property: background-color, border-color, box-shadow; + -moz-transition-duration: 150ms; + -moz-transition-timing-function: ease; + -ms-transition-property: background-color, border-color, box-shadow; + -ms-transition-duration: 150ms; + -ms-transition-timing-function: ease; + -o-transition-property: background-color, border-color, box-shadow; + -o-transition-duration: 150ms; + -o-transition-timing-function: ease; + transition-property: background-color, border-color, box-shadow; + transition-duration: 150ms; + transition-timing-function: ease; + +} +.splitToolbarButton > .toolbarButton:hover, +.splitToolbarButton > .toolbarButton:focus, +.dropdownToolbarButton:hover, +.toolbarButton.textButton:hover, +.toolbarButton.textButton:focus { + background-color: hsla(0,0%,0%,.2); + box-shadow: 0 1px 0 hsla(0,0%,100%,.05) inset, + 0 0 1px hsla(0,0%,100%,.15) inset, + 0 0 1px hsla(0,0%,0%,.05); + z-index: 199; +} + + +.splitToolbarButton:hover > .toolbarButton, +.splitToolbarButton:focus > .toolbarButton, +.splitToolbarButton.toggled > .toolbarButton, +.toolbarButton.textButton { + background-color: hsla(0,0%,0%,.12); + background-image: -webkit-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); + background-image: -moz-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); + background-image: -ms-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); + background-image: -o-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); + background-image: linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); + background-clip: padding-box; + border: 1px solid hsla(0,0%,0%,.35); + border-color: hsla(0,0%,0%,.32) hsla(0,0%,0%,.38) hsla(0,0%,0%,.42); + box-shadow: 0 1px 0 hsla(0,0%,100%,.05) inset, + 0 0 1px hsla(0,0%,100%,.15) inset, + 0 1px 0 hsla(0,0%,100%,.05); + -webkit-transition-property: background-color, border-color, box-shadow; + -webkit-transition-duration: 150ms; + -webkit-transition-timing-function: ease; + -moz-transition-property: background-color, border-color, box-shadow; + -moz-transition-duration: 150ms; + -moz-transition-timing-function: ease; + -ms-transition-property: background-color, border-color, box-shadow; + -ms-transition-duration: 150ms; + -ms-transition-timing-function: ease; + -o-transition-property: background-color, border-color, box-shadow; + -o-transition-duration: 150ms; + -o-transition-timing-function: ease; + transition-property: background-color, border-color, box-shadow; + transition-duration: 150ms; + transition-timing-function: ease; + +} +.splitToolbarButton > .toolbarButton:hover, +.splitToolbarButton > .toolbarButton:focus, +.dropdownToolbarButton:hover, +.toolbarButton.textButton:hover, +.toolbarButton.textButton:focus { + background-color: hsla(0,0%,0%,.2); + box-shadow: 0 1px 0 hsla(0,0%,100%,.05) inset, + 0 0 1px hsla(0,0%,100%,.15) inset, + 0 0 1px hsla(0,0%,0%,.05); + z-index: 199; +} + +.dropdownToolbarButton { + border: 1px solid #333 !important; +} + +.toolbarButton, +.dropdownToolbarButton { + min-width: 16px; + padding: 2px 6px 2px; + border: 1px solid transparent; + border-radius: 2px; + color: hsl(0,0%,95%); + font-size: 12px; + line-height: 14px; + -webkit-user-select:none; + -moz-user-select:none; + -ms-user-select:none; + /* Opera does not support user-select, use <... unselectable="on"> instead */ + cursor: default; + -webkit-transition-property: background-color, border-color, box-shadow; + -webkit-transition-duration: 150ms; + -webkit-transition-timing-function: ease; + -moz-transition-property: background-color, border-color, box-shadow; + -moz-transition-duration: 150ms; + -moz-transition-timing-function: ease; + -ms-transition-property: background-color, border-color, box-shadow; + -ms-transition-duration: 150ms; + -ms-transition-timing-function: ease; + -o-transition-property: background-color, border-color, box-shadow; + -o-transition-duration: 150ms; + -o-transition-timing-function: ease; + transition-property: background-color, border-color, box-shadow; + transition-duration: 150ms; + transition-timing-function: ease; +} + +html[dir='ltr'] .toolbarButton, +html[dir='ltr'] .dropdownToolbarButton { + margin: 3px 2px 4px 0; +} +html[dir='rtl'] .toolbarButton, +html[dir='rtl'] .dropdownToolbarButton { + margin: 3px 0 4px 2px; +} + +.splitToolbarButton:hover > .splitToolbarButtonSeparator, +.splitToolbarButton.toggled > .splitToolbarButtonSeparator { + padding: 12px 0; + margin: 0; + box-shadow: 0 0 0 1px hsla(0,0%,100%,.03); + -webkit-transition-property: padding; + -webkit-transition-duration: 10ms; + -webkit-transition-timing-function: ease; + -moz-transition-property: padding; + -moz-transition-duration: 10ms; + -moz-transition-timing-function: ease; + -ms-transition-property: padding; + -ms-transition-duration: 10ms; + -ms-transition-timing-function: ease; + -o-transition-property: padding; + -o-transition-duration: 10ms; + -o-transition-timing-function: ease; + transition-property: padding; + transition-duration: 10ms; + transition-timing-function: ease; +} + +.toolbarButton.toggled:hover:active, +.splitToolbarButton > .toolbarButton:hover:active { + background-color: hsla(0,0%,0%,.4); + border-color: hsla(0,0%,0%,.4) hsla(0,0%,0%,.5) hsla(0,0%,0%,.55); + box-shadow: 0 1px 1px hsla(0,0%,0%,.2) inset, + 0 0 1px hsla(0,0%,0%,.3) inset, + 0 1px 0 hsla(0,0%,100%,.05); +} + +html[dir='ltr'] .splitToolbarButton > .toolbarButton:first-child, +html[dir='rtl'] .splitToolbarButton > .toolbarButton:last-child { + position: relative; + margin: 0; + margin-left: 4px; + margin-right: -1px; + border-top-left-radius: 2px; + border-bottom-left-radius: 2px; + border-right-color: transparent; +} +html[dir='ltr'] .splitToolbarButton > .toolbarButton:last-child, +html[dir='rtl'] .splitToolbarButton > .toolbarButton:first-child { + position: relative; + margin: 0; + margin-left: -1px; + border-top-right-radius: 2px; + border-bottom-right-radius: 2px; + border-left-color: transparent; +} +.splitToolbarButtonSeparator { + padding: 8px 0; + width: 1px; + background-color: hsla(0,0%,00%,.5); + z-index: 99; + box-shadow: 0 0 0 1px hsla(0,0%,100%,.08); + display: inline-block; + margin: 5px 0; +} +html[dir='ltr'] .splitToolbarButtonSeparator { + float:left; +} +html[dir='rtl'] .splitToolbarButtonSeparator { + float:right; +} + +.dropdownToolbarButton { + min-width: 120px; + max-width: 120px; + padding: 4px 2px 4px; + overflow: hidden; + background: url(images/toolbarButton-menuArrows.png) no-repeat; +} + +.dropdownToolbarButton > select { + -webkit-appearance: none; + -moz-appearance: none; /* in the future this might matter, see bugzilla bug #649849 */ + min-width: 140px; + font-size: 12px; + color: hsl(0,0%,95%); + margin:0; + padding:0; + border:none; + background: rgba(0,0,0,0); /* Opera does not support 'transparent'