Skip to content

Commit

Permalink
Merge branch 'feature/newUI-ruby' of github.com:tabulapdf/tabula into…
Browse files Browse the repository at this point in the history
… feature/newUI-ruby
jeremybmerrill committed Jun 30, 2015
2 parents 2ff2ef7 + 7e00dbe commit 0854f0c
Showing 10 changed files with 152 additions and 1,650 deletions.
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -30,18 +30,16 @@ If you have a problem, check [Known Issues](#knownissues) first, then [report an
* ### Windows
Download `tabula-win.zip` from [the download site][tabula_dl]. Unzip the whole thing
and open the `tabula.exe` file inside. A browser should automatically open
to http://127.0.0.1:8080/ . If not, open your web browser of choice and
to http://127.0.0.1:34555/ . If not, open your web browser of choice and
visit that link.

To close Tabula, just go back to the console window and press "Control-C"
(as if to copy).

If you need Tabula to use a port other than 8080, set the `TABULA_PORT` environment variable.

* ###Mac OS X
Download `tabula-mac.zip` from [the download site][tabula_dl]. Unzip and open
the Tabula app inside. A browser should automatically open
to http://127.0.0.1:8080/ . If not, open your web browser of choice and
to http://127.0.0.1:34555/ . If not, open your web browser of choice and
visit that link.

To close Tabula, find the Tabula icon in your dock, right-click (or
@@ -62,7 +60,7 @@ and then try again.
[jre_download]: https://www.java.com/download/
[tabula_dl]: http://tabula.technology

Tabula binds to port 8080 by default. You can change it with the `jetty.port` property:
Tabula binds to port 34555 by default. You can change it with the `jetty.port` property:

`java -Dfile.encoding=utf-8 -Xms256M -Xmx1024M -Djetty.port=9999 -jar tabula.jar`

@@ -95,7 +93,7 @@ There are some bugs that we're aware of that we haven't managed to fix yet. If t
4. Run Tabula by typing `tabula.exe`

* <a name='portproblems'>**A browser tab opens, but something other than Tabula loads there. Or Tabula doesn't start.**</a>
It's possible another program is using port 8080, whichh Tabula binds to by default. You can try closing the other program, or change the port Tabula uses by running Tabula from the terminal with the `jetty.port` property:
It's possible another program is using port 34555, whichh Tabula binds to by default. You can try closing the other program, or change the port Tabula uses by running Tabula from the terminal with the `jetty.port` property:

`java -Dfile.encoding=utf-8 -Xms256M -Xmx1024M -Djetty.port=9999 -jar tabula.jar`

@@ -165,6 +163,15 @@ To compile the app:
This will result in a portable "tabula_mac.zip" archive (inside the `build` directory)
for Mac OS X users.
A "large" version of Tabula, which includes Java (so that the user's Java version
is irrelevant) can be built by doing:
rake bigmac
This results in a 98MB zip file, versus the 30MB zip file for the normal build,
but allows users to run Tabula without having to worry about occasional [Java
incompatibilities](https://github.com/tabulapdf/tabula/issues/237).
[buildxml_cert]: https://github.com/jazzido/tabula/blob/master/build.xml#L44-53
**Windows**
60 changes: 60 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -151,6 +151,66 @@ task :macosx => [:create_version_file, :war] do |t|
end



task :bigmac => [:create_version_file, :war] do |t|
tabula_dir = File.expand_path(File.dirname(__FILE__))
build_dir = File.join(tabula_dir, "build")
dist_dir = File.join(build_dir, "bigmac", "tabula")

cd File.join(tabula_dir)

if File.exist?(File.join(build_dir, "bigmac"))
FileUtils.rm_rf(File.join(build_dir, "bigmac"))
end

puts "\n======================================================"
puts "Building Mac OS X app..."
puts "======================================================\n\n"

invoke_ant("-Dfull_version=#{build_version}", "-v", "bigmacbundle") { |f|
f.each { |line| puts line }
}


puts "\n======================================================"
puts "Creating zip file bundle..."
puts "======================================================\n\n"

Dir.mkdir(dist_dir)

app_src = File.join(build_dir, "bigmac", "Tabula.app")
app_dst = File.join(dist_dir, "Tabula.app")
FileUtils.mv(app_src, app_dst)

readme_src = File.join(build_dir, "dist-README.txt")
readme_dst = File.join(dist_dir, "README.txt")
FileUtils.cp(readme_src, readme_dst)

lic_src = File.join(build_dir, "dist-LICENSE.txt")
lic_dst = File.join(dist_dir, "LICENSE.txt")
FileUtils.cp(lic_src, lic_dst)

authors_src = File.join(tabula_dir, "AUTHORS.md")
authors_dst = File.join(dist_dir, "AUTHORS.txt")
FileUtils.cp(authors_src, authors_dst)

cd File.join(build_dir, "bigmac")
output = File.join(build_dir, "tabula-bigmac-#{build_version}.zip")
if File.exists?(output)
File.delete(output)
end

IO.popen("zip -r9 #{output} tabula") { |f|
f.each { |line| puts line }
}
FileUtils.rm_rf(dist_dir)
puts "\n======================================================"
puts "Zip file saved to #{output}"
puts "======================================================\n\n"
end



task :windows => [:create_version_file, :war] do |t|
tabula_dir = File.expand_path(File.dirname(__FILE__))
build_dir = File.join(tabula_dir, "build")
88 changes: 72 additions & 16 deletions build.xml
Original file line number Diff line number Diff line change
@@ -4,8 +4,9 @@
<property file="build.properties"/>
<property name="build.dir" value="build"/>
<property name="mac.dir" value="${build.dir}/mac" />
<property name="bigmac.dir" value="${build.dir}/bigmac" />
<property name="windows.dir" value="${build.dir}/windows" />
<property name="full_version" value="0.9.7.0"/>
<property name="full_version" value="1.0.0.0"/>
<property name="launch4j.dir" location="${build.dir}/../launch4j" />
<property name="launch4j.bindir" location="${build.dir}/../launch4j/bin" />

@@ -41,21 +42,76 @@
screenmenu="true">
<jarfilelist dir="${build.dir}" files="tabula.jar" />
</jarbundler>
<!--
To allow OSX to use this, you'll need to code sign.
Generate a self-signed "Code Signing" certificate[1], then enter
it in the -s option here and edit below section. Users can then
right-click or Control-click the app and "Open" and then tell OS X to
open anyway[2].
[1]: http://support.apple.com/kb/PH7173
[2]: http://support.apple.com/kb/HT5290
For production builds, you can get rid of "Unidentified Developer"
warnings by having a Mac Developer Account and a cert from[3]. Then
change -s option to something like 'Developer ID Application: Mike Tigas (68QUP6KP2C)',
based on your Developer Account & cert.
[3]: https://developer.apple.com/account/mac/certificate/certificateList.action
-->
<exec executable="codesign" os="Mac OS X">
<arg line="-f -s 'Tabula' ${build.dir}/bigmac/Tabula.app/Contents/PlugIns/jdk1.8.0_45.jdk" />
</exec>
<exec executable="codesign" os="Mac OS X">
<arg line="-f -s 'Tabula' ${build.dir}/bigmac/Tabula.app" />
</exec>
</target>


<target name="bigmacbundle" depends="check-jar-exists" if="jar.exists">
<mkdir dir="${bigmac.dir}"/>

<!-- this must be a real JDK -->
<property name="java_home" value="/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home"/>

<taskdef
name="bundleapp"
classname="com.oracle.appbundler.AppBundlerTask"
classpath="${build.dir}/appbundler-1.0.jar"
/>

<bundleapp
outputdirectory="${build.dir}/bigmac"
name="Tabula"
displayname="Tabula"
identifier="org.nerdpower.tabula.Tabula"
icon="${build.dir}/icons/tabula.icns"
shortversion="${full_version}"
mainclassname="WarMain"
>
<runtime dir="${java_home}" />
<classpath file="${build.dir}/tabula.jar" />
<option value="-Dapple.laf.useScreenMenuBar=true"/>
<option value="-Djetty.port=34555"/>
</bundleapp>
<!--
To allow OSX to use this, you'll need to code sign.
Generate a self-signed "Code Signing" certificate[1], then enter
it in the -s option here and edit below section. Users can then
right-click or Control-click the app and "Open" and then tell OS X to
open anyway[2].
[1]: http://support.apple.com/kb/PH7173
[2]: http://support.apple.com/kb/HT5290
For production builds, you can get rid of "Unidentified Developer"
warnings by having a Mac Developer Account and a cert from[3]. Then
change -s option to something like 'Developer ID Application: Mike Tigas (68QUP6KP2C)',
based on your Developer Account & cert.
[3]: https://developer.apple.com/account/mac/certificate/certificateList.action
-->
<exec executable="codesign" os="Mac OS X">
<arg line="-f -s 'Tabula' ${build.dir}/bigmac/Tabula.app/Contents/PlugIns/jdk1.8.0_45.jdk" />
</exec>
<exec executable="codesign" os="Mac OS X">
<!--
Generate a self-signed "Code Signing" certificate[1] and give it the
name "Tabula". User can then right-click or Control-click the app
and "Open" and then tell OS X to open anyway[2].
[1]: http://support.apple.com/kb/PH7173
[2]: http://support.apple.com/kb/HT5290
-->
<arg line="-f -s 'Tabula' ${build.dir}/mac/Tabula.app" />
<!--
for production builds, requires Mac Developer Account
and cert from[1] but allows user to open app without warnings
[1]: https://developer.apple.com/account/mac/certificate/certificateList.action
<arg line="-f -s 'Developer ID Application: Mike Tigas (68QUP6KP2C)' ${build.dir}/mac/Tabula.app" />
-->
<arg line="-f -s 'Tabula' ${build.dir}/bigmac/Tabula.app" />
</exec>
</target>

@@ -78,7 +134,7 @@
</classPath>
<jre minVersion="1.6.0" jdkPreference="preferJre" initialHeapSize="256" maxHeapSize="1024">
<opt>-Dfile.encoding=utf-8</opt>
<opt>-Djetty.port=%TABULA_PORT%</opt>
<opt>-Djetty.port=34555</opt>
</jre>
<versionInfo
fileVersion="${full_version}"
Binary file added build/appbundler-1.0.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions build/dist-README.txt
Original file line number Diff line number Diff line change
@@ -22,13 +22,13 @@ a Java Runtime Environment compatible with Java 6 or Java 7.
### Windows (tabula-win.zip)

Open tabula.exe and a browser should automatically open to
http://127.0.0.1:8080/ . If not, open your web browser of choice and visit
http://127.0.0.1:34555/ . If not, open your web browser of choice and visit
that URL.

### Mac OS X (tabula-mac.zip)

Open the Tabula app and a browser should automatically open to
http://127.0.0.1:8080/ . If not, open your web browser of choice and visit
http://127.0.0.1:34555/ . If not, open your web browser of choice and visit
that URL.

### JAR file for Linux/Other (tabula-jar.zip)
2 changes: 1 addition & 1 deletion config.rb
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@
# relative_assets = true

# To disable debugging comments that display the original location of your selectors. Uncomment:
# line_comments = false
line_comments = false


# If you prefer the indented syntax, you might want to regenerate this
4 changes: 2 additions & 2 deletions config.ru
Original file line number Diff line number Diff line change
@@ -8,14 +8,14 @@ run Cuba

if "#{$PROGRAM_NAME}".include?("tabula.jar")
# only do this if running as jar or app. (if "rackup", we don't
# actually use 8080 by default.)
# actually use 34555 by default.)

require 'java'

# don't do "java_import java.net.URI" -- it conflicts with Ruby URI and
# makes Cuba/Rack really really upset. just call "java.*" classes
# directly.
port = java.lang.Integer.getInteger('jetty.port', 8080)
port = java.lang.Integer.getInteger('jetty.port', 34555)
url = "http://127.0.0.1:#{port}"

# Open browser after slight delay. (The server may take a while to actually
25 changes: 0 additions & 25 deletions webapp/static/css/selectors.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* line 1, ../sass/selectors.scss */
.thumbnail-list li div.selection-show {
position: absolute;
border: 1px dashed red;
@@ -7,151 +6,128 @@
}

/* selections */
/* line 9, ../sass/selectors.scss */
.repeat-lassos.btn {
position: absolute;
right: -165px;
bottom: -35px;
}

/* rectangularSelector.js classes */
/* line 16, ../sass/selectors.scss */
.selection-box, .table-region {
position: absolute;
border: 1px dashed rgba(255, 87, 0, 0.8);
background: rgba(255, 87, 0, 0.2);
box-sizing: border-box;
}
/* line 24, ../sass/selectors.scss */
.selection-box:hover, .table-region:hover {
cursor: pointer;
}

/* line 29, ../sass/selectors.scss */
.selection-box {
z-index: 42;
width: 0;
height: 0;
visibility: hidden;
}

/* line 36, ../sass/selectors.scss */
.table-region {
top: 0;
left: 0;
z-index: 21;
}

/* line 43, ../sass/selectors.scss */
div.table-region .resize-handle {
position: absolute;
}

/* line 51, ../sass/selectors.scss */
div.table-region .n-border {
width: calc(100% - 10px);
top: -5px;
left: 5px;
height: 10px;
}

/* line 58, ../sass/selectors.scss */
div.table-region .s-border {
width: calc(100% - 10px);
bottom: -5px;
left: 5px;
height: 10px;
}

/* line 65, ../sass/selectors.scss */
div.table-region .w-border {
height: calc(100% - 10px);
left: -5px;
top: 5px;
width: 10px;
}

/* line 72, ../sass/selectors.scss */
div.table-region .e-border {
height: calc(100% - 10px);
top: 5px;
right: -5px;
width: 10px;
}

/* line 79, ../sass/selectors.scss */
div.table-region .nw-border {
width: 10px;
height: 10px;
top: -5px;
left: -5px;
}

/* line 84, ../sass/selectors.scss */
div.table-region .ne-border {
width: 10px;
height: 10px;
top: -5px;
right: -5px;
}

/* line 89, ../sass/selectors.scss */
div.table-region .sw-border {
width: 10px;
height: 10px;
bottom: -5px;
left: -5px;
}

/* line 94, ../sass/selectors.scss */
div.table-region .se-border {
width: 10px;
height: 10px;
bottom: -5px;
right: -5px;
}

/* line 99, ../sass/selectors.scss */
div.table-region .n-border:hover {
cursor: n-resize;
}

/* line 102, ../sass/selectors.scss */
div.table-region .nw-border:hover {
cursor: nw-resize;
}

/* line 105, ../sass/selectors.scss */
div.table-region .ne-border:hover {
cursor: ne-resize;
}

/* line 108, ../sass/selectors.scss */
div.table-region .s-border:hover {
cursor: s-resize;
}

/* line 111, ../sass/selectors.scss */
div.table-region .sw-border:hover {
cursor: sw-resize;
}

/* line 114, ../sass/selectors.scss */
div.table-region .se-border:hover {
cursor: se-resize;
}

/* line 117, ../sass/selectors.scss */
div.table-region .w-border:hover {
cursor: w-resize;
}

/* line 120, ../sass/selectors.scss */
div.table-region .e-border:hover {
cursor: e-resize;
}

/* line 126, ../sass/selectors.scss */
div.table-region button[name=close] {
font-weight: bold;
border: 0;
@@ -164,7 +140,6 @@ div.table-region button[name=close] {
margin-left: 5px;
}

/* line 138, ../sass/selectors.scss */
div.table-region button[name=close]:hover {
color: red;
}
1,597 changes: 0 additions & 1,597 deletions webapp/static/css/styles.css

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion webapp/static/sass/styles.scss
Original file line number Diff line number Diff line change
@@ -32,6 +32,7 @@ body {
}
}


.navbar-fixed-top .container {
margin: 0 1em;
}
@@ -490,4 +491,4 @@ div.spinner {
top: 6px;
margin-right: 5px;
}
}
}

0 comments on commit 0854f0c

Please sign in to comment.