diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..a34509cd --- /dev/null +++ b/Dockerfile @@ -0,0 +1,28 @@ +FROM ruby:1.9.3 + +# Use a directory called /code in which to store +# this application's files. (The directory name +# is arbitrary and could have been anything.) +WORKDIR /code + +# Copy all the application's files into the /code +# directory. +COPY . /code + +# Run bundle install to install the Ruby dependencies. +RUN bundle install + +RUN git clone https://github.com/BenGardiner/static.mindmup.com +RUN ln -nsf $(which sed) /usr/local/bin/gsed +RUN cd static.mindmup.com && sh pack.sh +RUN cp -Lpr static.mindmup.com/content/img public +RUN cp -Lpr static.mindmup.com/content/font public +RUN cp -Lpr static.mindmup.com/content/pack_latest public + +ENV PUBLIC_HOST="http://localhost:5000" +RUN sed -i "s/20161111155712/pack_latest/g" web.rb + +RUN gem install foreman +EXPOSE 5000 +CMD ["foreman", "start"] + diff --git a/README.md b/README.md index acbaac59..2e5fe13e 100644 --- a/README.md +++ b/README.md @@ -1,78 +1,13 @@ -MindMup - Zero Friction Mind Map Canvas -======================================= +This is a fork of the old and awesome mindmup (mindmup-legacy). -[![Build Status](https://api.travis-ci.org/mindmup/mindmup.png)](http://travis-ci.org/mindmup/mindmup) +See https://github.com/davedf/mindmup for the real deal. -MindMup is a zero-friction mind map canvas. Our aim is to create the most productive mind mapping environment out there, removing -all the distractions and providing powerful editing shortcuts. +This repo is _only_ for running mindmup-legacy offline: -This git project is the server-side portion of MindMup. It provides a web interface that serves maps, allows users to edit and save them, -provides menus and feedback forms and links to analytics. You can see an example of this live on http://www.mindmup.com. +```sh +docker build -t ogmindmup . +docker run -p 5000:5000 ogmindmup +``` -Dependencies -------------- - -- This app is designed to run in the Heroku cloud or as a standalone [Sinatra application](https://github.com/sinatra/sinatra/). -- It depends on the [MapJS](http://github.com/mindmup/mapjs) javascript canvas for client side rendering, and imports a compiled -single-file version of that project as /public/mapjs-compiled.js -- It uses Google Drive and Amazon S3 AWS service to store maps -- It uses Google analytics to track feature votes, usage patterns and report error rates -- It uses Google URL shortener to produce short links for sharing - -Configuration -------------- - -The server depends on the following environment variables: -- GOOGLE_SHORTENER_API_KEY _Google shortener API key_ -- GOOGLE_CLIENT_ID _Google Drive Client Id_ -- GOOGLE_ANALYTICS_ACCOUNT _Google analytics ID to use for tracking. Don't use the production IDs in staging. Not used in dev and testing_ -- S3_BUCKET_NAME _Only the name of S3 Bucket where files are located (eg mindmup)_ -- S3_KEY_ID _AWS Access key ID that has write access for the bucket_ -- S3_SECRET_KEY _AWS Secret key corresponding to the ID above_ -- S3_UPLOAD_FOLDER _folder within the bucket where user maps are stored. (eg map). Avoid using the same folder for production and testing_ -- S3_WEBSITE _website domain name where user files are publicly accessible. Don't specify protocol or slashes (eg mindmup.s3.amazonaws.com)_ -- SITE_URL _public URL for the web site instance, used to get S3 to redirect back to us. Include protocol and slashes (eg http://localhost:5000/)_ -- DEFAULT_MAP _name or key of the map to be shown on homepage (eg default)_ -- RACK_SESSION_SECRET _hashing key for rack sessions (should be relatively random, alphanumeric)_ -- MAX_UPLOAD_SIZE _in KB, maximum size allowed for the users to upload. If not defined, 100 is the default value_ -- NETWORK_TIMEOUT_MILLIS _number of milliseconds before we start reporting to users that there is a problem, in case of a timeout. Default is 10000._ -- CURRENT_MAP_DATA_VERSION _prefix for files signaling the data format. For now, we use a1. This is to help in the future with format versioning_ - -Running standalone ------------------- - -To run the application in standalone mode (without Heroku), create a .env configuration file (_don't commit this to git_) and put your S3 account info -and other stuff mentioned above into that. You don't need a JotForm account to run the site (but sharing and feedback won't work without it). Then -execute: - - - gem install foreman - bundle install - foreman start - -See [Heroku Configiration Local Setup](https://devcenter.heroku.com/articles/config-vars#local-setup) for more information. - -Note: Unless RACK_ENV is production, Google analytics is not used, the analytics information is instead logged to the JavaScript console. - -Executing tests ---------------- - -We do a bunch of exploratory tests and some manual sanity tests before each release, -and use this [ACC Matrix](https://github.com/mindmup/mindmup/wiki/Attribute%2C-Component%2C-Capability-matrix) to guide testing. Most client tests -are in the MapJS project, so see that as well. This server does very little apart from some basic routing, so there are not many automated tests -in this project. For server testing, there are a few RSpec tests that should run before commiting. Execute them with: - - rspec test/*.rb - -The tests don't depend on the .env file intentionally. Supply your own config as part of the test if needed. - -All JavaScript widgets are tested using Jasmine, here are two ways of running tests: - -- Visual: Open SpecRunner.html in a browser, this will run all Jasmine tests - -- Automated: Using [PhantomJs](phantomjs.org), in the test folder, run - - sh runtests.sh - -Please note that the CI server uses phantomjs, so make sure that tests run with phantom before committing. +That's it. That's the README. diff --git a/public/e/dropbox.css b/public/e/dropbox.css index 2f6fc291..a4f92ef4 100644 --- a/public/e/dropbox.css +++ b/public/e/dropbox.css @@ -1,5 +1,5 @@ .repo-d { - background-image: url('//static.mindmup.com/img/dropbox-16.png'); + background-image: url('img/dropbox-16.png'); padding-left: 16px; } diff --git a/public/e/github.css b/public/e/github.css index 3e0cdadb..45c3aafc 100644 --- a/public/e/github.css +++ b/public/e/github.css @@ -1,5 +1,5 @@ .repo-h { - background-image: url('//static.mindmup.com/img/github-16.png'); + background-image: url('img/github-16.png'); padding-left: 16px; } #modalGithubOpen td a { diff --git a/public/e/google-collaboration.css b/public/e/google-collaboration.css index d98a09eb..96335ad4 100644 --- a/public/e/google-collaboration.css +++ b/public/e/google-collaboration.css @@ -1,5 +1,5 @@ .repo-c { - background-image: url('//static.mindmup.com/img/repo-c.png'); + background-image: url('img/repo-c.png'); background-repeat: no-repeat; background-position:left center; } diff --git a/public/ios/3/mindmap-ios.css b/public/ios/3/mindmap-ios.css index d9aec578..394c25cd 100644 --- a/public/ios/3/mindmap-ios.css +++ b/public/ios/3/mindmap-ios.css @@ -12,28 +12,28 @@ body.ios-wkwebview { padding: 0; } .repo-a { - background-image: url('//static.mindmup.com/img/logo_16.png'); + background-image: url('img/logo_16.png'); } .repo-b { - background-image: url('//static.mindmup.com/img/logo_gold_16.png'); + background-image: url('img/logo_gold_16.png'); } .repo-p { - background-image: url('//static.mindmup.com/img/logo_gold_private_16.png'); + background-image: url('img/logo_gold_private_16.png'); } .repo-g { - background-image: url('//static.mindmup.com/img/google_drive.png'); + background-image: url('img/google_drive.png'); } .repo-o { - background-image: url('//static.mindmup.com/img/offline.png'); + background-image: url('img/offline.png'); } .chrome .repo-o { - background-image: url('//static.mindmup.com/img/offline-chrome.png'); + background-image: url('img/offline-chrome.png'); } .safari .repo-o { - background-image: url('//static.mindmup.com/img/offline-safari.png'); + background-image: url('img/offline-safari.png'); } .gecko .repo-o { - background-image: url('//static.mindmup.com/img/offline-firefox.png'); + background-image: url('img/offline-firefox.png'); } a.repo, a.repo, a.repo { diff --git a/public/ios/4/mindmap-ios.css b/public/ios/4/mindmap-ios.css index 7b32a232..59a01718 100644 --- a/public/ios/4/mindmap-ios.css +++ b/public/ios/4/mindmap-ios.css @@ -13,28 +13,28 @@ body.ios-wkwebview { padding: 0; } .repo-a { - background-image: url('//static.mindmup.com/img/logo_16.png'); + background-image: url('img/logo_16.png'); } .repo-b { - background-image: url('//static.mindmup.com/img/logo_gold_16.png'); + background-image: url('img/logo_gold_16.png'); } .repo-p { - background-image: url('//static.mindmup.com/img/logo_gold_private_16.png'); + background-image: url('img/logo_gold_private_16.png'); } .repo-g { - background-image: url('//static.mindmup.com/img/google_drive.png'); + background-image: url('img/google_drive.png'); } .repo-o { - background-image: url('//static.mindmup.com/img/offline.png'); + background-image: url('img/offline.png'); } .chrome .repo-o { - background-image: url('//static.mindmup.com/img/offline-chrome.png'); + background-image: url('img/offline-chrome.png'); } .safari .repo-o { - background-image: url('//static.mindmup.com/img/offline-safari.png'); + background-image: url('img/offline-safari.png'); } .gecko .repo-o { - background-image: url('//static.mindmup.com/img/offline-firefox.png'); + background-image: url('img/offline-firefox.png'); } a.repo, a.repo, a.repo { diff --git a/public/manifest.appcache b/public/manifest.appcache new file mode 100644 index 00000000..993ff1ef --- /dev/null +++ b/public/manifest.appcache @@ -0,0 +1,282 @@ +CACHE MANIFEST + +# Learn more: +# https://developer.mozilla.org/en-US/docs/Web/HTML/Using_the_application_cache + +# ----------------------------------------------------------------------------- + +# It's necessary to tell web browsers to reconsider this manifest any time the +# website is updated, and you do so by changing *anything* inside the manifest. +# A common way to do this is by simply updating a commented-out string, like a +# date or a version number, or both: + +# 2016-12-07 + +# ----------------------------------------------------------------------------- + +# This is where you define all of the resources to be cached. Add new and/or +# remove old resourses as needed, keeping each one on its own line. Learn more: +# https://developer.mozilla.org/en-US/docs/Web/HTML/Using_the_application_cache#Explicit_entr + +./20161111155712/embedded_external.js +./20161111155712/external-ios.js +./20161111155712/external.css +./20161111155712/external.js +./e/dropbox.css +./e/dropbox.html +./e/dropbox.js +./e/github.css +./e/github.html +./e/github.js +./e/google-collaboration.css +./e/google-collaboration.html +./e/google-collaboration.js +./e/progress-tasks-with-3d-icons.json +./e/progress-tasks-with-flat-icons.json +./e/progress-testing-with-3d-icons.json +./e/progress-testing-with-flat-icons.json +./e/progress.css +./e/progress.html +./e/progress.js +./e/straight-lines.js +./external-embed.js +./favicon.ico +./font/3.2.1/fontawesome-webfont.eot +./font/3.2.1/fontawesome-webfont.svg +./font/3.2.1/fontawesome-webfont.ttf +./font/3.2.1/fontawesome-webfont.woff +./font/3.2.1/FontAwesome.otf +./font/3.2.1b/fontawesome-webfont.eot +./font/3.2.1b/fontawesome-webfont.svg +./font/3.2.1b/fontawesome-webfont.ttf +./font/3.2.1b/fontawesome-webfont.woff +./font/3.2.1b/FontAwesome.otf +./font/fontawesome-webfont.eot +./font/fontawesome-webfont.svg +./font/fontawesome-webfont.ttf +./font/fontawesome-webfont.ttf.1 +./font/fontawesome-webfont.woff +./font/FontAwesome.otf +./google5063874fc2a540cf.html +./img/apple-touch-icon.png +./img/dropbox-16.png +./img/email_32.png +./img/embed_buttons.png +./img/facebook_32.png +./img/favicon.ico +./img/favicon.ico.1 +./img/FB-f-Logo__blue_50.png +./img/github-16.png +./img/glyphicons-halflings-white.png +./img/glyphicons-halflings.png +./img/gold_128.png +./img/gold_400.png +./img/google_drive.png +./img/ios_icon_add_child.svg +./img/ios_icon_add_node.svg +./img/ios_icon_add_parent.svg +./img/ios_icon_add_sibling.svg +./img/ios_icon_clipboard.svg +./img/ios_icon_clipboard_cut.svg +./img/ios_icon_clipboard_paste.svg +./img/ios_icon_close.svg +./img/ios_icon_cloud.svg +./img/ios_icon_collapse.svg +./img/ios_icon_confirm.svg +./img/ios_icon_connect.svg +./img/ios_icon_edit.svg +./img/ios_icon_edit_node.svg +./img/ios_icon_edit_nodes.svg +./img/ios_icon_email.svg +./img/ios_icon_exit.svg +./img/ios_icon_node_color.svg +./img/ios_icon_node_image.svg +./img/ios_icon_redo.svg +./img/ios_icon_remove.svg +./img/ios_icon_remove_node.svg +./img/ios_icon_select_branch.svg +./img/ios_icon_select_children.svg +./img/ios_icon_select_nodes.svg +./img/ios_icon_select_siblings.svg +./img/ios_icon_transparent_color.svg +./img/ios_icon_twitter.svg +./img/ios_icon_undo.svg +./img/ios_link_arrow.svg +./img/ios_link_dashed.svg +./img/ios_link_no_arrow.svg +./img/ios_link_solid.svg +./img/ios_toolbar_pointer.svg +./img/ios_toolbar_pointer_bottom.svg +./img/keyboard_20px.png +./img/logo_16.png +./img/logo_256.png +./img/logo_32.png +./img/logo_96.png +./img/logo_gold_16.png +./img/logo_gold_private_16.png +./img/Mindwap.logo.squ.spider.120x60.png +./img/Mindwap.logo.squ.svg +./img/offline-chrome.png +./img/offline-firefox.png +./img/offline-safari.png +./img/offline.png +./img/portrait.png +./img/portrait.png.1 +./img/repo-c.png +./img/safari_page_source.png +./img/safari_plain_text.png +./img/safari_save_as.png +./img/twitter_32.png +./ios/3/main-ios.js +./ios/3/mapjs-compiled.js +./ios/3/mapjs.css +./ios/3/mindmap-ios.css +./ios/3/mm-compiled-ios.js +./ios/4/color-picker-ios.css +./ios/4/main-ios.js +./ios/4/mapjs.css +./ios/4/mindmap-ios.css +./ios/4/mm-compiled-ios.js +./ios/4/modal-ios.css +./lib/active-content-listener.js +./lib/active-content-resource-manager.js +./lib/activity-log.js +./lib/ajax-blob-fetch.js +./lib/alert.js +./lib/anon-save-alert-widget.js +./lib/atlas-prepopulate-widget.js +./lib/attachment-editor-widget.js +./lib/auto-save-widget.js +./lib/auto-save.js +./lib/bookmark.js +./lib/bootstrap-wysiwyg.js +./lib/class-caching-widget.js +./lib/collaboration-model.js +./lib/collaborator-list-widget.js +./lib/collaborator-photo-widget.js +./lib/collaborator-speech-bubble-widget.js +./lib/command-line-widget.js +./lib/context-menu-widget.js +./lib/custom-style.js +./lib/embedded-map-url-generator.js +./lib/extensions.js +./lib/file-reader-upload-widget.js +./lib/file-system-map-source.js +./lib/floating-toolbar.js +./lib/freemind-import.js +./lib/gold-api.js +./lib/gold-funnel-model.js +./lib/gold-license-entry-widget.js +./lib/gold-license-manager.js +./lib/gold-storage-open-widget.js +./lib/gold-storage.js +./lib/google-drive-adapter.js +./lib/google-drive-open-widget.js +./lib/google-share-widget.js +./lib/grid.js +./lib/icon-editor-widget.js +./lib/image-alert-widget.js +./lib/import-widget.js +./lib/json-storage.js +./lib/key-actions-widget.js +./lib/layout-export.js +./lib/legacy-alert-widget.js +./lib/local-storage-clipboard.js +./lib/local-storage-open-widget.js +./lib/map-controller.js +./lib/map-status-widget.js +./lib/maps.js +./lib/measures-model.js +./lib/measures-sheet-widget.js +./lib/mindmup-editabletable.js +./lib/modal-confirmation-widget.js +./lib/modal-launcher-widget.js +./lib/navigation.js +./lib/new_map_widget.js +./lib/optional-content-widget.js +./lib/remote-export-widget.js +./lib/resource-compressor.js +./lib/retriable-map-source-decorator.js +./lib/s3-api.js +./lib/s3-file-system.js +./lib/save-widget.js +./lib/scalable-modal-widget.js +./lib/search-widget.js +./lib/selectable-readonly-input-widget.js +./lib/send-to-google-widget.js +./lib/split-flip-widget.js +./lib/splittable-controller.js +./lib/storyboard-controller.js +./lib/storyboard-dimension-provider.js +./lib/storyboard-model.js +./lib/storyboard-widget.js +./lib/tabular-export.js +./lib/title-update-widget.js +./lib/toggle-class-widget.js +./lib/welcome-message.js +./lib-ios/3/ios-alert.js +./lib-ios/3/ios-auto-save.js +./lib-ios/3/ios-confirmation-proxy.js +./lib-ios/3/ios-context-menu-widget.js +./lib-ios/3/ios-link-edit-widget.js +./lib-ios/3/ios-map-load-handler.js +./lib-ios/3/ios-map-source.js +./lib-ios/3/ios-mapmodel-proxy.js +./lib-ios/3/ios-menu-widget.js +./lib-ios/3/ios-modal-widget.js +./lib-ios/3/ios-mode-indicator-widget.js +./lib-ios/3/ios-node-background-color-widget.js +./lib-ios/3/ios-popover-menu-widget.js +./lib-ios/3/ios-stage-api.js +./lib-ios/3/ios-window-proxy.js +./lib-ios/3/wkwebview-proxy.js +./lib-ios/4/ios-alert.js +./lib-ios/4/ios-auto-save.js +./lib-ios/4/ios-confirmation-proxy.js +./lib-ios/4/ios-context-menu-widget.js +./lib-ios/4/ios-export-request-handler.js +./lib-ios/4/ios-license-handler.js +./lib-ios/4/ios-link-edit-widget.js +./lib-ios/4/ios-map-load-handler.js +./lib-ios/4/ios-map-source.js +./lib-ios/4/ios-mapmodel-proxy.js +./lib-ios/4/ios-menu-widget.js +./lib-ios/4/ios-modal-export-widget.js +./lib-ios/4/ios-modal-request-handler.js +./lib-ios/4/ios-modal-widget.js +./lib-ios/4/ios-mode-indicator-widget.js +./lib-ios/4/ios-node-background-color-widget.js +./lib-ios/4/ios-popover-menu-widget.js +./lib-ios/4/ios-server-config.js +./lib-ios/4/ios-server-connector.js +./lib-ios/4/ios-stage-api.js +./lib-ios/4/ios-window-proxy.js +./lib-ios/4/wkwebview-proxy.js +./main.js +./manifest.appcache +./mapjs-compiled.js +./mapjs.css +./mindmap.css +./mm-ios.js +./mm.js + +# ----------------------------------------------------------------------------- + +# Resources that must be retrieved from the network. The wild card ensures any +# resource not listed in the cache above will instead be downloaded from the +# network. Learn more: +# https://developer.mozilla.org/en-US/docs/Web/HTML/Using_the_application_cache#Network_entries + +NETWORK: +* + +# ----------------------------------------------------------------------------- + +# Fallbacks. In each row, if the first resource isn't available, the second +# resource is requested. Uncomment and update as needed. Learn more: +# https://developer.mozilla.org/en-US/docs/Web/HTML/Using_the_application_cache#Fallback_entries + +FALLBACK: +# / offline.html +# /desired.html /fallback.html +# /images/desired.jpg /images/fallback.jpg diff --git a/public/mindmap.css b/public/mindmap.css index 89bf2c9e..3bd089b9 100644 --- a/public/mindmap.css +++ b/public/mindmap.css @@ -12,7 +12,7 @@ html, body { margin-right: 20px; } .logo { - background-image:url('//static.mindmup.com/img/logo_32.png'); + background-image:url('img/logo_32.png'); background-position:left center; background-repeat:no-repeat; width: 0px; @@ -22,7 +22,7 @@ html, body { padding-bottom: 5px; } #logo-img { - background-image:url('//static.mindmup.com/img/logo_32.png'); + background-image:url('img/logo_32.png'); background-position:left center; background-repeat:no-repeat; width: 40px; @@ -192,19 +192,19 @@ div.colorPicker-picker { display: inline; float: left; background: none } .repo { background-repeat: no-repeat; background-position:left center; - background-image: url('//static.mindmup.com/img/logo_16.png'); + background-image: url('img/logo_16.png'); } .repo-a { - background-image: url('//static.mindmup.com/img/logo_16.png'); + background-image: url('img/logo_16.png'); } .repo-b { - background-image: url('//static.mindmup.com/img/logo_gold_16.png'); + background-image: url('img/logo_gold_16.png'); } .repo-p { - background-image: url('//static.mindmup.com/img/logo_gold_private_16.png'); + background-image: url('img/logo_gold_private_16.png'); } .repo-g { - background-image: url('//static.mindmup.com/img/google_drive.png'); + background-image: url('img/google_drive.png'); } .repo-menuitem { background-position: 14px center; diff --git a/views/atlas_terms.erb b/views/atlas_terms.erb index 777366da..5d5e4571 100644 --- a/views/atlas_terms.erb +++ b/views/atlas_terms.erb @@ -15,7 +15,7 @@ _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; - ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; + ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.localhost/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); diff --git a/views/editor.erb b/views/editor.erb index 7dd57180..5fd68ed6 100644 --- a/views/editor.erb +++ b/views/editor.erb @@ -1,4 +1,5 @@ +