├── .csslint.rc ├── .gitignore ├── .jshintrc ├── .travis.yml ├── CONTRIBUTING.md ├── Gruntfile.js ├── LICENSE.html ├── Procfile ├── README.md ├── addon ├── .gitignore ├── Procfile ├── README.md ├── data │ ├── attachment.js │ ├── button.html │ ├── button.js │ └── startup-help.html ├── lib │ ├── main.js │ └── startup-panel.js └── package.json ├── client ├── devserver.js ├── hub ├── server.js └── websocket-compat.js ├── package-lock.json ├── package.json ├── phantomjs └── bridge.js ├── site ├── base.tmpl ├── bookmarklet.html ├── css │ ├── bootstrap.css │ ├── bootstrap.min.css │ ├── carousel.css │ ├── docco.css │ ├── grid.css │ ├── jumbotron.css │ ├── responsive-video.css │ └── style.css ├── docs-contributing.tmpl ├── docs.tmpl ├── docs │ ├── contributing.md │ ├── faq.md │ └── index.md ├── errors │ ├── 404.html │ └── 500.html ├── examples │ ├── drawing │ │ ├── css │ │ │ └── main.css │ │ ├── index.html │ │ └── js │ │ │ └── sketch.js │ ├── friendlycode │ │ ├── .gitignore │ │ ├── .gitmodules │ │ ├── LICENSE.html │ │ ├── LICENSE_files │ │ │ ├── css.css │ │ │ ├── css_002.css │ │ │ └── css_003.css │ │ ├── README.md │ │ ├── build-require.js │ │ ├── codemirror2 │ │ │ ├── lib │ │ │ │ ├── codemirror.css │ │ │ │ └── codemirror.js │ │ │ └── mode │ │ │ │ ├── css │ │ │ │ └── css.js │ │ │ │ ├── htmlmixed │ │ │ │ └── htmlmixed.js │ │ │ │ ├── javascript │ │ │ │ └── javascript.js │ │ │ │ └── xml │ │ │ │ └── xml.js │ │ ├── css │ │ │ ├── buttons.css │ │ │ ├── editor.css │ │ │ ├── errorhelp.css │ │ │ ├── friendlycode.css │ │ │ ├── jsbin-codemirror-theme.css │ │ │ ├── modals.css │ │ │ ├── modals_full_screen.css │ │ │ ├── opensans │ │ │ │ ├── OpenSans-Regular-webfont.eot │ │ │ │ ├── OpenSans-Regular-webfont.svg │ │ │ │ ├── OpenSans-Regular-webfont.ttf │ │ │ │ ├── OpenSans-Regular-webfont.woff │ │ │ │ ├── OpenSans-Semibold-webfont.eot │ │ │ │ ├── OpenSans-Semibold-webfont.svg │ │ │ │ ├── OpenSans-Semibold-webfont.ttf │ │ │ │ ├── OpenSans-Semibold-webfont.woff │ │ │ │ └── stylesheet.css │ │ │ ├── opensymbolcropped │ │ │ │ ├── opensymbolcropped.eot │ │ │ │ ├── opensymbolcropped.ttf │ │ │ │ ├── opensymbolcropped.woff │ │ │ │ └── stylesheet.css │ │ │ ├── tipsy.css │ │ │ └── ubuntumono │ │ │ │ ├── stylesheet.css │ │ │ │ ├── ubuntumono-b.eot │ │ │ │ ├── ubuntumono-b.ttf │ │ │ │ ├── ubuntumono-b.woff │ │ │ │ ├── ubuntumono-r.eot │ │ │ │ ├── ubuntumono-r.ttf │ │ │ │ └── ubuntumono-r.woff │ │ ├── examples │ │ │ ├── alternate-publisher.html │ │ │ ├── bare-optimized.html │ │ │ ├── bare.html │ │ │ └── editor-only.html │ │ ├── img │ │ │ ├── button-arrow.png │ │ │ ├── checkbox-gradient.png │ │ │ ├── editor-icon.png │ │ │ ├── error.png │ │ │ ├── explanationpt.png │ │ │ ├── help.png │ │ │ ├── hint-down-arrow.png │ │ │ ├── hint-up-arrow.png │ │ │ ├── indicator-arrow.png │ │ │ ├── make_logo.png │ │ │ ├── modal-close-button.png │ │ │ ├── no.png │ │ │ ├── preview-icon.png │ │ │ ├── publish-button-left.png │ │ │ ├── publish-button-right.png │ │ │ ├── questionmark.png │ │ │ ├── redo-blue.png │ │ │ ├── redo-grey.png │ │ │ ├── temp-logo.png │ │ │ ├── text-size-blue.png │ │ │ ├── text-size-large.png │ │ │ ├── text-size-normal.png │ │ │ ├── text-size-small.png │ │ │ ├── text-size.png │ │ │ ├── throbber.gif │ │ │ ├── undo-blue.png │ │ │ ├── undo-grey.png │ │ │ └── yes.png │ │ ├── index.html │ │ ├── js │ │ │ ├── backbone-events.js │ │ │ ├── backbone.min.js │ │ │ ├── fc │ │ │ │ ├── current-page-manager.js │ │ │ │ ├── hacktionary-data.js │ │ │ │ ├── help.js │ │ │ │ ├── parachute.js │ │ │ │ ├── prefs.js │ │ │ │ ├── publisher.js │ │ │ │ └── ui │ │ │ │ │ ├── context-sensitive-help.js │ │ │ │ │ ├── editor-panes.js │ │ │ │ │ ├── editor-toolbar.js │ │ │ │ │ ├── editor.js │ │ │ │ │ ├── error-help.js │ │ │ │ │ ├── gutter-pointer.js │ │ │ │ │ ├── history.js │ │ │ │ │ ├── indexable-codemirror.js │ │ │ │ │ ├── live-preview.js │ │ │ │ │ ├── mark-tracker.js │ │ │ │ │ ├── modals.js │ │ │ │ │ ├── parsing-codemirror.js │ │ │ │ │ ├── preview-to-editor-mapping.js │ │ │ │ │ ├── publish.js │ │ │ │ │ ├── relocator.js │ │ │ │ │ ├── social-media.js │ │ │ │ │ └── text.js │ │ │ ├── friendlycode.js │ │ │ ├── jquery.min.js │ │ │ ├── jquery.no-conflict.js │ │ │ ├── jquery.tipsy.js │ │ │ ├── lscache.js │ │ │ ├── require-config.js │ │ │ ├── require-plugins │ │ │ │ ├── template.js │ │ │ │ └── text.js │ │ │ ├── require.min.js │ │ │ ├── slowparse-errors.js │ │ │ └── underscore.min.js │ │ ├── package.json │ │ ├── slowparse │ │ │ ├── .gitignore │ │ │ ├── LICENSE.html │ │ │ ├── LICENSE_files │ │ │ │ ├── css.css │ │ │ │ ├── css_002.css │ │ │ │ └── css_003.css │ │ │ ├── README.md │ │ │ ├── demo │ │ │ │ ├── hierarchic-source-code.css │ │ │ │ ├── index.html │ │ │ │ ├── jsbin-codemirror-theme.css │ │ │ │ ├── render-dom.js │ │ │ │ ├── tag-colors.js │ │ │ │ └── utils.js │ │ │ ├── index.html │ │ │ ├── slowparse.js │ │ │ ├── spec │ │ │ │ ├── errors.base.html │ │ │ │ ├── errors.forbidjs.html │ │ │ │ ├── errors.jquery.js │ │ │ │ ├── index.html │ │ │ │ └── spec.js │ │ │ ├── test │ │ │ │ ├── index.html │ │ │ │ ├── qunit.css │ │ │ │ ├── qunit.js │ │ │ │ ├── test-errors.jquery.js │ │ │ │ ├── test-slowparse.js │ │ │ │ ├── test-spec.js │ │ │ │ ├── test-tree-inspectors.js │ │ │ │ └── testing-utils.js │ │ │ ├── tree-inspectors.js │ │ │ └── vendor │ │ │ │ ├── brocco.js │ │ │ │ ├── codemirror2 │ │ │ │ ├── lib │ │ │ │ │ ├── codemirror.css │ │ │ │ │ └── codemirror.js │ │ │ │ └── mode │ │ │ │ │ ├── css │ │ │ │ │ └── css.js │ │ │ │ │ ├── htmlmixed │ │ │ │ │ └── htmlmixed.js │ │ │ │ │ ├── javascript │ │ │ │ │ └── javascript.js │ │ │ │ │ └── xml │ │ │ │ │ └── xml.js │ │ │ │ ├── docco.css │ │ │ │ ├── jquery.min.js │ │ │ │ ├── jump-to.js │ │ │ │ └── showdown.js │ │ ├── templates │ │ │ ├── confirm-dialog.html │ │ │ ├── default-content.html │ │ │ ├── error-dialog.html │ │ │ ├── error-msg.html │ │ │ ├── help-msg.html │ │ │ ├── nav-options.html │ │ │ └── publish-dialog.html │ │ └── test │ │ │ ├── all-tests.js │ │ │ ├── codemirror-577 │ │ │ ├── original.html │ │ │ ├── replacer.html │ │ │ └── test-codemirror-577.js │ │ │ ├── define-tests.js │ │ │ ├── index-optimized.html │ │ │ ├── index.html │ │ │ ├── lptest.js │ │ │ ├── preview-to-editor-mapping │ │ │ ├── path-to.html │ │ │ └── test-preview-to-editor-mapping.js │ │ │ ├── publisher │ │ │ ├── post-publish.html │ │ │ ├── pre-publish.html │ │ │ └── test-publisher.js │ │ │ ├── qunit.css │ │ │ ├── qunit.js │ │ │ ├── test-app-optimized.html │ │ │ ├── test-app.html │ │ │ ├── test-app.js │ │ │ ├── test-current-page-manager.js │ │ │ ├── test-editor-toolbar.js │ │ │ ├── test-gutter-pointer.js │ │ │ ├── test-help.js │ │ │ ├── test-indexable-codemirror.js │ │ │ ├── test-live-preview.js │ │ │ ├── test-mark-tracker.js │ │ │ ├── test-parsing-codemirror.js │ │ │ ├── test-prefs.js │ │ │ ├── test-slowparse-errors.js │ │ │ └── test-templates.js │ ├── madlibs │ │ ├── css │ │ │ ├── app.css │ │ │ ├── bootstrap.css │ │ │ └── bootstrap.min.css │ │ ├── index.html │ │ └── js │ │ │ ├── app.js │ │ │ ├── bootstrap.js │ │ │ ├── bootstrap.min.js │ │ │ └── jquery-1.10.2.min.js │ ├── persona │ │ ├── index.html │ │ └── md5.js │ ├── tinymce │ │ ├── css │ │ │ └── application.css │ │ ├── index.html │ │ └── js │ │ │ ├── application.js │ │ │ └── application.js~ │ ├── todo │ │ ├── css │ │ │ ├── bootstrap.css │ │ │ └── bootstrap.min.css │ │ ├── index.html │ │ └── js │ │ │ ├── app.js │ │ │ ├── bootstrap.js │ │ │ ├── bootstrap.min.js │ │ │ └── jquery-1.10.2.min.js │ └── youtube │ │ ├── css │ │ ├── application.css │ │ └── bootstrap.min.css │ │ ├── index.html │ │ └── js │ │ ├── application.js │ │ └── jquery-2.0.3.min.js ├── faq.html ├── generic-markdown.tmpl ├── images │ ├── 404-image.png │ ├── 500-image.png │ ├── bg.png │ ├── bg@2x.png │ ├── fav-icon-bizarro.png │ ├── fav-icon.ico │ ├── favicon-animate.gif │ ├── footer-mozilla-labs.png │ ├── footer-mozilla-labs@2x.png │ ├── site-customers-jsfiddle.png │ ├── site-customers-jsfiddle@2x.png │ ├── site-customers-netfiddle.png │ ├── site-customers-netfiddle@2x.png │ ├── site-customers-popcorn.png │ ├── site-customers-popcorn@2x.png │ ├── site-customers-thimble.png │ ├── site-customers-thimble@2x.png │ ├── site-customers-wordpress.png │ ├── site-customers-wordpress@2x.png │ ├── site-examples-drawing.png │ ├── site-examples-drawing@2x.png │ ├── site-examples-friendlycode.png │ ├── site-examples-friendlycode@2x.png │ ├── site-examples-madlibs.png │ ├── site-examples-madlibs@2x.png │ ├── site-examples-tinymce.png │ ├── site-examples-todo.png │ ├── site-examples-todo@2x.png │ ├── site-examples-youtube.png │ ├── site-examples-youtube@2x.png │ ├── site-features-audiovideo.png │ ├── site-features-audiovideo@2x.png │ ├── site-features-cobrowsing.png │ ├── site-features-cobrowsing@2x.png │ ├── site-features-realtimesync.png │ ├── site-features-realtimesync@2x.png │ ├── site-features-text-chat.png │ ├── site-features-text-chat@2x.png │ ├── site-features-user-focus.png │ ├── site-features-user-focus@2x.png │ ├── site-features-user-presence.png │ ├── site-features-user-presence@2x.png │ ├── site-hero-image-01.png │ ├── site-hero-image-01@2x-overlay.png │ ├── site-hero-image-01@2x-overlay@2x.png │ ├── site-hero-image-01@2x.png │ ├── site-hero-image.png │ ├── site-hero-image@2x.png │ ├── site-tour-why-create.png │ ├── site-tour-why-create@2x.png │ ├── site-tour-why-moz.png │ ├── site-tour-why-moz@2x.png │ ├── site-tour-why-web.png │ ├── site-tour-why-web@2x.png │ ├── start-togetherjs-blue.png │ ├── start-togetherjs-gray.png │ ├── togetherjs-how-01-addit-btn-collaborate.png │ ├── togetherjs-how-01-addit-btn-collaborate@2x.png │ ├── togetherjs-how-01-addit-file-connecthtml.png │ ├── togetherjs-how-01-addit-file-connecthtml@2x.png │ ├── togetherjs-how-01-addit-file-connectjs.png │ ├── togetherjs-how-01-addit-file-connectjs@2x.png │ ├── togetherjs-how-01-addit-noplus.png │ ├── togetherjs-how-01-addit-noplus@2x.png │ ├── togetherjs-how-01-addit.png │ ├── togetherjs-how-01-addit@2x.png │ ├── togetherjs-how-02-dock-btn-collaborate-pressed.png │ ├── togetherjs-how-02-dock-btn-collaborate-pressed@2x.png │ ├── togetherjs-how-02-dock-sm@2x.png │ ├── togetherjs-how-02-dock.png │ ├── togetherjs-how-02-dock@2x.png │ ├── togetherjs-how-02-maindockpiece.png │ ├── togetherjs-how-02-maindockpiece@2x.png │ ├── togetherjs-how-03-collaborate-cursors@2x.png │ ├── togetherjs-how-03-collaborate.png │ ├── togetherjs-how-03-collaborate@2x.png │ ├── togetherjs-how-03-cursor1.png │ ├── togetherjs-how-03-cursor1@2x.png │ ├── togetherjs-how-03-cursor2.png │ ├── togetherjs-how-03-cursor2@2x.png │ ├── togetherjs-logo.png │ └── togetherjs-logo@2x.png ├── index.html ├── js │ ├── bootstrap.js │ ├── bootstrap.min.js │ ├── custom.js │ ├── frontpage.js │ ├── how-animations.js │ ├── imageresizer.js │ ├── jquery-1.10.2.min.js │ ├── parallax.js │ ├── retina.js │ ├── scrollTo.js │ ├── scrollspy.js │ ├── source-code.js │ └── waypoints.min.js ├── less │ ├── alerts.less │ ├── badges.less │ ├── bootstrap.less │ ├── breadcrumbs.less │ ├── button-groups.less │ ├── buttons.less │ ├── carousel.less │ ├── close.less │ ├── code.less │ ├── component-animations.less │ ├── dropdowns.less │ ├── forms.less │ ├── grid.less │ ├── input-groups.less │ ├── jumbotron.less │ ├── labels.less │ ├── list-group.less │ ├── media.less │ ├── mixins.less │ ├── modals.less │ ├── navbar.less │ ├── navs.less │ ├── normalize.less │ ├── pager.less │ ├── pagination.less │ ├── panels.less │ ├── popovers.less │ ├── print.less │ ├── progress-bars.less │ ├── responsive-utilities.less │ ├── retina.less │ ├── scaffolding.less │ ├── tables.less │ ├── thumbnails.less │ ├── tooltip.less │ ├── type.less │ ├── utilities.less │ ├── variables.less │ └── wells.less ├── source-code-index.tmpl ├── source-code.tmpl └── the-developers │ ├── index.html │ ├── the-developers.css │ └── the-developers.js └── togetherjs ├── README.md ├── analytics.js ├── channels.js ├── chat.js ├── console.js ├── cursor.js ├── elementFinder.js ├── eventMaker.js ├── fonts ├── OpenSans-Bold.ttf ├── OpenSans-Light.ttf └── OpenSans-Regular.ttf ├── forms.js ├── functions.less ├── help.txt ├── images ├── btn-menu-change-avatar.png ├── button-chat-active.png ├── button-chat.png ├── button-end-session.png ├── button-mic-active.png ├── button-mic-inactive.png ├── button-mic.png ├── button-pencil.png ├── button-share-active.png ├── button-share-hover.png ├── button-share.png ├── connect-logo@2x.png ├── cursor-white.png ├── cursor.svg ├── default-avatar-waiting.png ├── default-avatar.png ├── icn-arrow-up.png ├── icn-gear.png ├── icn-handle-circle.png ├── icn-handle-circle@2x.png ├── icn-triangle-up.png ├── icn-walkthrough-arrow-l-hover.png ├── icn-walkthrough-arrow-l.png ├── icn-walkthrough-arrow-r-hover.png ├── icn-walkthrough-arrow-r.png ├── icon-close-active.png ├── icon-close-active@2x.png ├── icon-close.png ├── icon-close@2x.png ├── icon-profile-triangle.png ├── notification-btn-close.png ├── notification-btn-close@2x.png ├── notification-togetherjs-logo.png ├── notification.ogg ├── robot-avatar.png ├── togetherjs-logo-close.png ├── togetherjs-logo-open.png ├── walkthrough-images-chat.png ├── walkthrough-images-intro.png ├── walkthrough-images-invite.png ├── walkthrough-images-logo.png ├── walkthrough-images-participant.png ├── walkthrough-images-profile.png └── walkthrough-images-rtc.png ├── interface.html ├── jqueryPlugins.js ├── libs ├── almond.js ├── jquery-1.11.1.min.js ├── require-nomin.js ├── require.js ├── tinycolor.js ├── walkabout │ ├── README.md │ ├── index.html │ ├── lib │ │ ├── esprima.js │ │ └── falafel.js │ ├── node-proxy.js │ ├── test_overlap.html │ ├── test_overlap.js │ ├── test_walkabout.html │ ├── test_walkabout.js │ ├── test_walkabout_nojquery.html │ ├── test_walkabout_nojquery.js │ ├── traverse-rewrite.js │ └── walkabout.js └── whrandom │ ├── README.md │ ├── mersenne.js │ ├── random.js │ ├── test_random.html │ └── test_random.js ├── linkify.js ├── locale ├── de-DE.json ├── en-US.json ├── es-BO.json ├── pl-PL.json └── ru.json ├── mobile.less ├── module-descriptions.json ├── ot.js ├── peers.js ├── playback.js ├── randomutil.js ├── recorder.html ├── recorder.js ├── recorder.less ├── reset.less ├── session.js ├── startup.js ├── storage.js ├── templates-localized.js ├── templates.js ├── templating.js ├── tests ├── ace.js ├── codemirror4.js ├── doctestjs │ ├── .gitignore │ ├── .gitmodules │ ├── .hgignore │ ├── .resources │ │ ├── CNAME │ │ ├── boilerplate │ │ │ ├── 404.html │ │ │ ├── css │ │ │ │ ├── main.css │ │ │ │ ├── normalize.css │ │ │ │ └── normalize.min.css │ │ │ ├── favicon.ico │ │ │ ├── index.html │ │ │ └── js │ │ │ │ ├── main.js │ │ │ │ └── vendor │ │ │ │ ├── jquery-1.8.1.min.js │ │ │ │ └── modernizr-2.6.1.min.js │ │ ├── build │ │ ├── doc.css │ │ ├── example.xml │ │ ├── footer.html │ │ ├── header.html │ │ ├── include-scripts.sh │ │ ├── retemplate.py │ │ ├── template.html │ │ ├── toc.js │ │ └── try.js │ ├── .syncignore │ ├── README.md │ ├── bin │ │ └── doctest │ ├── doctest.css │ ├── doctest.js │ ├── examples │ │ ├── examples-2.html │ │ ├── examples-2.js │ │ ├── examples.html │ │ ├── long-running-tests.html │ │ └── long-running-tests.js │ ├── index.html │ ├── package.json │ ├── reference.html │ ├── try.html │ └── tutorial.html ├── func_ace.js ├── func_codemirror.js ├── func_forms.js ├── func_misc.js ├── func_notifications.js ├── func_peer_status.js ├── func_walkthrough.js ├── index.html ├── interactive.js ├── manual │ ├── index.html │ ├── multi-textarea-focus.html │ └── youtube-video.html ├── mobiletest.html ├── test_console.js ├── test_elementFinder.js ├── test_linkify.js ├── test_misc.js ├── test_ot.js ├── test_ot_text.js ├── test_resolves.js ├── test_storage.js ├── testutils.js └── togetherjs-animations │ ├── css │ └── styles.css │ ├── index.html │ └── js │ ├── animations.js │ ├── jquery-1.8.3.min.js │ └── jquery.transit.min.js ├── togetherjs.js ├── togetherjs.less ├── ui.js ├── util.js ├── videos.js ├── visibilityApi.js ├── walkabout.html ├── walkthrough.html ├── walkthrough.js ├── webrtc.js ├── who.js ├── windowing.js └── youtubeVideos.js /.csslint.rc: -------------------------------------------------------------------------------- 1 | { 2 | "empty-rules": false, 3 | "empty-rules-reason": "LESS creates some empty rules", 4 | 5 | "bulletproof-font-face": false, 6 | "buttetproof-font-face-reason": "This only seems to apply when you provide multiple formats, and we aren't doing that", 7 | 8 | "qualified-headings": false, 9 | "qualified-headings-reason": "This happens as part of the reset, we reset headings inside .towtruck (though technically we aren't using headings so we could remove that reset)", 10 | 11 | "adjoining-classes": false, 12 | "adjoining-classes-reason": ".class1.class2 isn't supported in some older browsers, but we don't support those", 13 | 14 | "vendor-prefix": false, 15 | "vendor-prefix-reason": "We have some vendor prefixes in vendor-prefix-specific selectors, and CSSLint complains about that.", 16 | "compatible-vendor-prefixes": false, 17 | "compatible-vendor-prefixes-reason": "Same as vendor-prefix", 18 | 19 | "duplicate-background-images": false, 20 | "duplicate-background-images-reason": "LESS explodes out some background images, creating duplicates, but they aren't duplicated in the source.", 21 | 22 | "fallback-colors": false, 23 | "fallback-colors-reason": "Some old browsers don't support RGBA, but we don't care about those browsers" 24 | 25 | } 26 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | .env* 4 | addon/Profile 5 | dump.rdb 6 | app/http/public/recorder.css 7 | build 8 | test-build 9 | togetherjs.mozillalabs.com 10 | addon/togetherjs.xpi 11 | togetherjs/togetherjs.css 12 | togetherjs/togetherjsPackage.js 13 | -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | // JSHint configurations for node-jshint. 3 | // install with "npm install -g jshint" 4 | // run with "jshint --config config.json" 5 | 6 | "asi" : false, // Semicolons required! we minify. 7 | "undef" : false, // var early, var often 8 | 9 | // Predefined globals whom JSHint will accept the existence of. 10 | "browser" : true, 11 | 12 | // Require curly braces 13 | "curly": true, 14 | // Require hasOwnProperty check 15 | "forin": true, 16 | "indent": 2, 17 | // No arguments.callee/caller 18 | "noarg": true, 19 | // Warn about unused variables 20 | "unused": true, 21 | // No trailing whitespace 22 | "trailing": true 23 | } -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.10" 4 | before_install: 5 | - npm install -g npm 6 | - npm install -g grunt-cli 7 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Thanks for your interest in contributing to TogetherJS! 2 | 3 | If you found a bug, if at all possible give us a URL where we can try 4 | TogetherJS. Don't worry about tags or milestones or assigning the 5 | ticket. But a URL is extremely helpful! 6 | 7 | ## Contributing 8 | 9 | The [Contributing](https://togetherjs.com/docs/contributing.html) 10 | document on the site gives some more information. Some relevant 11 | points: 12 | 13 | * [Javascript style guide](https://github.com/ianb/javascript) 14 | 15 | * If you want to work on a ticket, please leave a comment to that 16 | effect. It gives us a chance to suggest where you'd look in the 17 | code to implement the feature or fix the bug, and makes it less 18 | likely that people's contributions will conflict. 19 | 20 | * Anything in the 21 | [Blue Sky](https://github.com/mozilla/togetherjs/issues?milestone=23&page=1&state=open) 22 | you are likely to find something that we're interested in having in 23 | TogetherJS, but that we aren't working on. 24 | 25 | * If you have an idea of your own you'd like to implement, please open 26 | a ticket describing it. That will let other people know you are 27 | working on it, and give other people an opportunity to give feedback 28 | or implementation notes. 29 | 30 | ## Where to start? 31 | 32 | You should look at the 33 | [Contribution Wanted](https://github.com/mozilla/togetherjs/issues?labels=contribution-wanted&milestone=&page=1&state=open) 34 | tag to see tickets that fall into two categories: 35 | 36 | 1. A good introductory task to get started on. 37 | 38 | 2. Something that requires particular skills (that the core team does 39 | not have) that would make a contribution particular valuable. 40 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: node hub/server.js 2 | -------------------------------------------------------------------------------- /addon/.gitignore: -------------------------------------------------------------------------------- 1 | Profile* -------------------------------------------------------------------------------- /addon/Procfile: -------------------------------------------------------------------------------- 1 | profilea: cfx run --binary /Applications/FirefoxNightly.app -p ProfileA 2 | profileb: sleep 1; cfx run --binary /Applications/FirefoxNightly.app -p ProfileB 3 | -------------------------------------------------------------------------------- /addon/README.md: -------------------------------------------------------------------------------- 1 | The Firefox Addon simply adds togetherjs.js to a window - when you turn 2 | it on the tab gets togetherjs for that one tab, and when you turn it off 3 | it stops. 4 | -------------------------------------------------------------------------------- /addon/data/attachment.js: -------------------------------------------------------------------------------- 1 | /* This Source Code Form is subject to the terms of the Mozilla Public 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | * You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 | 5 | self.port.on("Config", function (config) { 6 | var doc = unsafeWindow.document; 7 | unsafeWindow._TogetherJSBookmarklet = true; 8 | unsafeWindow.TogetherJSConfig_hubBase = config.hubBase; 9 | if (config.shareId) { 10 | unsafeWindow._TogetherJSShareId = config.shareId; 11 | } 12 | var script = doc.createElement("script"); 13 | script.src = config.url; 14 | console.log("Attaching:", script.outerHTML, "to:", window.location.href); 15 | doc.head.appendChild(script); 16 | }); 17 | 18 | // FIXME: need to bind to session.on("close") and emit this: 19 | // self.port.emit("Close"); 20 | -------------------------------------------------------------------------------- /addon/data/button.html: -------------------------------------------------------------------------------- 1 |
2 | togetherjs 3 |
4 | -------------------------------------------------------------------------------- /addon/data/button.js: -------------------------------------------------------------------------------- 1 | /* This Source Code Form is subject to the terms of the Mozilla Public 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | * You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 | 5 | self.port.on("TogetherJSOn", function () { 6 | document.getElementById("togetherjs-button").innerHTML = "truckin'"; 7 | }); 8 | 9 | self.port.on("TogetherJSOff", function () { 10 | document.getElementById("togetherjs-button").innerHTML = "togetherjs"; 11 | }); 12 | -------------------------------------------------------------------------------- /addon/data/startup-help.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Welcome to TogetherJS 5 | 6 | 7 | 8 |

Thanks for checking out TogetherJS.

9 | 10 |

You should see a link/button at the bottom right of the 11 | browser: togetherjs — if you don't then you need to show the 13 | Add-on Bar:

14 | 15 |

Go to View > Toolbars > Add-on bar to 16 | display the bar 17 | (or read 18 | more here).

19 | 20 |

Once you see the button, click it to start sharing your session. 21 | Once you are sharing you have to tell someone else (more instructions 22 | here)

23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /addon/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "preferences": [ 3 | { 4 | "title": "togetherjs.js location", 5 | "type": "string", 6 | "description": "This is where to find the script to inject", 7 | "value": "https://togetherjs.com/togetherjs.js", 8 | "name": "togetherjsJs" 9 | }, 10 | { 11 | "title": "Hub URL", 12 | "type": "string", 13 | "description": "Override the location of the hub", 14 | "value": "https://hub.togetherjs.com", 15 | "name": "hubBase" 16 | }, 17 | { 18 | "title": "Auto domains", 19 | "type": "string", 20 | "description": "Domains on which to automatically start TogetherJS (comma-separated)", 21 | "value": "", 22 | "name": "autoDomains" 23 | } 24 | ], 25 | "license": "MPL 2.0", 26 | "author": "", 27 | "description": "Runs TogetherJS", 28 | "version": "0.1", 29 | "fullName": "TogetherJS", 30 | "id": "jid1-9cBzV13kcAXp8A", 31 | "name": "togetherjs" 32 | } 33 | -------------------------------------------------------------------------------- /client: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/client -------------------------------------------------------------------------------- /devserver.js: -------------------------------------------------------------------------------- 1 | var 2 | http = require("http"), 3 | url = require("url"), 4 | path = require("path"), 5 | fs = require("fs"), 6 | port = process.argv[2] || process.env['PORT'] || 8080; 7 | 8 | http.createServer(function(request, response) { 9 | 10 | var uri = url.parse(request.url).pathname 11 | var filename = path.join(process.cwd(), 'build', uri); 12 | 13 | fs.exists(filename, function(exists) { 14 | if(!exists) { 15 | response.writeHead(404, {"Content-Type": "text/plain"}); 16 | response.write("404 Not Found\n"); 17 | response.end(); 18 | return; 19 | } 20 | 21 | if (fs.statSync(filename).isDirectory()) filename += '/index.html'; 22 | 23 | fs.readFile(filename, "binary", function(err, file) { 24 | if(err) { 25 | response.writeHead(500, {"Content-Type": "text/plain"}); 26 | response.write(err + "\n"); 27 | response.end(); 28 | return; 29 | } 30 | 31 | response.writeHead(200); 32 | response.write(file, "binary"); 33 | response.end(); 34 | }); 35 | }); 36 | }).listen(parseInt(port, 10)); 37 | 38 | console.log("Static file server running at\n => http://localhost:" + port + "/\nCTRL + C to shutdown"); 39 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "togetherjs", 3 | "version": "0.4.0a", 4 | "main": "hub/server.js", 5 | "description": "Collaborative help system", 6 | "keywords": [], 7 | "repository": { 8 | "type": "git", 9 | "url": "https://github.com/mozilla/togetherjs.git" 10 | }, 11 | "dependencies": { 12 | "ejs": "~2.5.5", 13 | "ejs-locals": "~1.0.2", 14 | "express": "~3.0.6", 15 | "grunt-amd-check": "~0.5.1", 16 | "habitat": "~0.4.0", 17 | "less": "~1.3.1", 18 | "less-middleware": "~0.1.9", 19 | "newrelic": "0.9.20", 20 | "node-static": "~0.6.5", 21 | "optimist": "~0.6.0", 22 | "universal-analytics": "~0.1.3", 23 | "websocket": "~1.0.7", 24 | "websocket-server": "github:miksago/node-websocket-server#master", 25 | "winston": "~0.6.2" 26 | }, 27 | "devDependencies": { 28 | "grunt-contrib-less": "~0.5.1", 29 | "grunt-contrib-csslint": "~0.1.2", 30 | "grunt-contrib-jshint": "~0.4.3", 31 | "grunt-contrib-requirejs": "~0.4.1", 32 | "grunt-contrib-watch": "~0.4.3", 33 | "grunt": "~0.4.1", 34 | "grunt-contrib-copy": "~0.4.1", 35 | "grunt-http-server": "~0.0.5", 36 | "nunjucks": "~0.1.8a", 37 | "marked": "~0.3.4", 38 | "docco": "~0.6.2", 39 | "highlight.js": "~7.3.0", 40 | "optimist": "~0.6.0", 41 | "freeport": "~1.0.3", 42 | "grunt-lib-phantomjs": "~0.6.0" 43 | }, 44 | "engines": { 45 | "node": "~0.12.7", 46 | "npm": "^2.11.3" 47 | }, 48 | "scripts": { 49 | "start": "node hub/server.js", 50 | "test": "grunt test" 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /site/bookmarklet.html: -------------------------------------------------------------------------------- 1 | {% extends "base.tmpl" %} 2 | {% block title %}TogetherJS Bookmarklet{% endblock %} 3 | {% block styles %} 4 | 5 | 22 | 23 | {% endblock %} 24 | 25 | {% block body %} 26 | 27 |
28 | 29 |

TogetherJS Bookmarklet

30 | 31 |

32 | To use this bookmarklet, drag the button below to your bookmark toolbar: 33 |

34 | 35 |

36 | Start TogetherJS 37 |

38 | 39 |
40 | 41 | {% endblock %} 42 | -------------------------------------------------------------------------------- /site/css/grid.css: -------------------------------------------------------------------------------- 1 | /*THESE ARE GUIDELINES*/ 2 | 3 | .container { 4 | /* padding-left: 15px; 5 | padding-right: 15px;*/ 6 | } 7 | 8 | .row { 9 | margin-bottom: 20px; 10 | } 11 | .row .row { 12 | margin-top: 10px; 13 | margin-bottom: 0; 14 | } 15 | [class*="col-"] { 16 | padding-top: 15px; 17 | padding-bottom: 15px; 18 | border: 1px solid #ddd; 19 | /*background-color: rgba(0,0,0,.15);*/ 20 | border: 0px solid rgba(86,61,124,.2); 21 | } 22 | 23 | hr { 24 | margin-top: 40px; 25 | margin-bottom: 40px; 26 | } -------------------------------------------------------------------------------- /site/css/jumbotron.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-bottom: 20px; 3 | } 4 | 5 | /* Wrapping element */ 6 | /* Set some basic padding to keep content from hitting the edges */ 7 | .body-content { 8 | padding-left: 15px; 9 | padding-right: 15px; 10 | } 11 | 12 | /* Responsive: Portrait tablets and up */ 13 | @media screen and (min-width: 768px) { 14 | /* Let the jumbotron breathe */ 15 | .jumbotron { 16 | margin-top: 20px; 17 | } 18 | /* Remove padding from wrapping element since we kick in the grid classes here */ 19 | .body-content { 20 | padding: 0; 21 | } 22 | } -------------------------------------------------------------------------------- /site/css/responsive-video.css: -------------------------------------------------------------------------------- 1 | 2 | /*Courtesy of 3 | https://gist.github.com/jgarber/2302238*/ 4 | 5 | .flex-video { 6 | position: relative; 7 | padding-top: 25px; 8 | padding-bottom: 67.5%; 9 | height: 0; 10 | margin-bottom: 16px; 11 | overflow: hidden; 12 | } 13 | 14 | .flex-video.widescreen { padding-bottom: 57.25%; } 15 | .flex-video.vimeo { padding-top: 0; } 16 | 17 | .flex-video iframe, 18 | .flex-video object, 19 | .flex-video embed { 20 | position: absolute; 21 | top: 0; 22 | left: 0; 23 | width: 100%; 24 | height: 100%; 25 | } 26 | @media only screen and (max-device-width: 800px), only screen and (device-width: 1024px) and (device-height: 600px), only screen and (width: 1280px) and (orientation: landscape), only screen and (device-width: 800px), only screen and (max-width: 767px) { 27 | .flex-video { padding-top: 0; } 28 | } -------------------------------------------------------------------------------- /site/docs-contributing.tmpl: -------------------------------------------------------------------------------- 1 | {% extends "base.tmpl" %} 2 | {# set enableMarkdown true #} 3 | {% block body_tag %}data-spy="scroll" data-target="#markdownpages"{% endblock %} 4 | {% block body %} 5 | 6 |
7 |
8 |
9 | 23 |
24 |
25 |

{{ title }}

26 | {{ markdownBody }} 27 |
28 |
29 | 30 | {% endblock %} 31 | -------------------------------------------------------------------------------- /site/docs/faq.md: -------------------------------------------------------------------------------- 1 | # FAQ 2 | 3 | ## When I add a field dynamically it doesn't appear on the other person's page! 4 | 5 | ## Will I see what the other person is seeing? 6 | 7 | ## Why not synchronize everything? 8 | 9 | ## Should I host my own server? 10 | 11 | ## How stable is TogetherJS? 12 | 13 | ## Does it work on an intranet? 14 | -------------------------------------------------------------------------------- /site/errors/404.html: -------------------------------------------------------------------------------- 1 | {% extends "base.tmpl" %} 2 | {% block title %} Mozilla Labs : 404 error {% endblock %} 3 | {# set enableExample false #} 4 | {# set absoluteLinks true #} 5 | {% block body %} 6 | 7 |
8 |
9 |
10 |
11 |
12 |

13 |

Oops, we can't find the page you're looking for!

14 |

404 error

15 |
16 |
17 |
18 | {% endblock %} 19 | -------------------------------------------------------------------------------- /site/errors/500.html: -------------------------------------------------------------------------------- 1 | {% extends "base.tmpl" %} 2 | {% block title %} Mozilla Labs : 500 error {% endblock %} 3 | {# set enableExample false #} 4 | {# set absoluteLinks true #} 5 | {% block body %} 6 | 7 |
8 |
9 |
10 |
11 |
12 |

13 |

Dang. Something went wrong.

14 |

500 error

15 |
16 |
17 |
18 | 19 | {% endblock %} 20 | -------------------------------------------------------------------------------- /site/examples/drawing/css/main.css: -------------------------------------------------------------------------------- 1 | .upper-button { 2 | border-bottom-left-radius: 0px; 3 | border-bottom-right-radius: 0px; 4 | } 5 | .bottom-button { 6 | border-top-left-radius: 0px; 7 | border-top-right-radius: 0px; 8 | } 9 | .black-pick:hover { 10 | background-color: #000; 11 | border-color: #000; 12 | } 13 | .black-pick { 14 | background-color: #202020; 15 | border-color: #202020; 16 | } 17 | -------------------------------------------------------------------------------- /site/examples/friendlycode/.gitignore: -------------------------------------------------------------------------------- 1 | js/friendlycode-built.js 2 | css/friendlycode-built.css 3 | node_modules/ 4 | -------------------------------------------------------------------------------- /site/examples/friendlycode/.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "slowparse"] 2 | path = slowparse 3 | url = git://github.com/mozilla/slowparse.git 4 | -------------------------------------------------------------------------------- /site/examples/friendlycode/LICENSE_files/css.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'Droid Sans Mono'; 3 | font-style: normal; 4 | font-weight: normal; 5 | src: local('Droid Sans Mono'), local('DroidSansMono'), url('http://themes.googleusercontent.com/static/fonts/droidsansmono/v4/ns-m2xQYezAtqh7ai59hJaH0X__W3S3MJL29bc5CWfs.woff') format('woff'); 6 | } 7 | -------------------------------------------------------------------------------- /site/examples/friendlycode/LICENSE_files/css_002.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'Crimson Text'; 3 | font-style: normal; 4 | font-weight: normal; 5 | src: local('Crimson Text'), local('CrimsonText-Roman'), url('http://themes.googleusercontent.com/static/fonts/crimsontext/v3/3IFMwfRa07i-auYR-B-zNaRDOzjiPcYnFooOUGCOsRk.woff') format('woff'); 6 | } 7 | -------------------------------------------------------------------------------- /site/examples/friendlycode/LICENSE_files/css_003.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'Lora'; 3 | font-style: normal; 4 | font-weight: normal; 5 | src: local('Lora'), url('http://themes.googleusercontent.com/static/fonts/lora/v5/nAKwuw6_dIh5kwvpj3ShNfesZW2xOQ-xsNqO47m55DA.woff') format('woff'); 6 | } 7 | -------------------------------------------------------------------------------- /site/examples/friendlycode/README.md: -------------------------------------------------------------------------------- 1 | This is a friendly HTML editor that uses [slowparse][] and [hacktionary][] 2 | to provide ultra-friendly real-time help to novice webmakers. 3 | 4 | ## Updating CodeMirror 5 | 6 | In the `codemirror2` directory is a mini-distribution of [CodeMirror][] 7 | which contains only the files necessary for HTML editing. It can be updated 8 | with the following Python script, if it is run from the root directory 9 | of the repository and the value of `NEW_CODEMIRROR_PATH` is changed: 10 | 11 | ```python 12 | import os 13 | 14 | NEW_CODEMIRROR_PATH = "/path/to/new/codemirror/version" 15 | OUR_CODEMIRROR_PATH = os.path.abspath("codemirror2") 16 | 17 | for dirpath, dirnames, filenames in os.walk(OUR_CODEMIRROR_PATH): 18 | for filename in filenames: 19 | ourpath = os.path.join(dirpath, filename) 20 | relpath = os.path.relpath(ourpath, OUR_CODEMIRROR_PATH) 21 | newpath = os.path.join(NEW_CODEMIRROR_PATH, relpath) 22 | if os.path.exists(newpath): 23 | print "copying %s" % newpath 24 | open(ourpath, "wb").write(open(newpath, "rb").read()) 25 | ``` 26 | 27 | [slowparse]: https://github.com/toolness/slowparse 28 | [hacktionary]: https://github.com/toolness/hacktionary 29 | [CodeMirror]: http://codemirror.net/ 30 | -------------------------------------------------------------------------------- /site/examples/friendlycode/css/friendlycode.css: -------------------------------------------------------------------------------- 1 | /* 2 | * This stylesheet is only intended for development purposes, 3 | * due to the inefficiency of @import [1]. For production use, this 4 | * file should be a raw concatenation of all the @import rules below. 5 | * 6 | * [1] http://www.stevesouders.com/blog/2009/04/09/dont-use-import/ 7 | */ 8 | 9 | @import url(../codemirror2/lib/codemirror.css); 10 | 11 | @import url(jsbin-codemirror-theme.css); 12 | @import url(tipsy.css); 13 | @import url(ubuntumono/stylesheet.css); 14 | @import url(opensymbolcropped/stylesheet.css); 15 | @import url(opensans/stylesheet.css); 16 | @import url(editor.css); 17 | @import url(errorhelp.css); 18 | @import url(modals.css); 19 | @import url(buttons.css); 20 | 21 | -------------------------------------------------------------------------------- /site/examples/friendlycode/css/opensans/OpenSans-Regular-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/examples/friendlycode/css/opensans/OpenSans-Regular-webfont.eot -------------------------------------------------------------------------------- /site/examples/friendlycode/css/opensans/OpenSans-Regular-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/examples/friendlycode/css/opensans/OpenSans-Regular-webfont.ttf -------------------------------------------------------------------------------- /site/examples/friendlycode/css/opensans/OpenSans-Regular-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/examples/friendlycode/css/opensans/OpenSans-Regular-webfont.woff -------------------------------------------------------------------------------- /site/examples/friendlycode/css/opensans/OpenSans-Semibold-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/examples/friendlycode/css/opensans/OpenSans-Semibold-webfont.eot -------------------------------------------------------------------------------- /site/examples/friendlycode/css/opensans/OpenSans-Semibold-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/examples/friendlycode/css/opensans/OpenSans-Semibold-webfont.ttf -------------------------------------------------------------------------------- /site/examples/friendlycode/css/opensans/OpenSans-Semibold-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/examples/friendlycode/css/opensans/OpenSans-Semibold-webfont.woff -------------------------------------------------------------------------------- /site/examples/friendlycode/css/opensans/stylesheet.css: -------------------------------------------------------------------------------- 1 | /* The font family/weight/style of these rules is taken from Tabzilla's CSS: 2 | https://raw.github.com/mozilla/tabzilla/master/media/css/tabzilla.css 3 | 4 | This is done to ensure that smart browsers won't load two separate 5 | sets of fonts if friendlycode is used on the same page as Tabzilla. */ 6 | 7 | @font-face { 8 | font-family: 'Open Sans'; 9 | src: url('OpenSans-Regular-webfont.eot'); 10 | src: url('OpenSans-Regular-webfont.eot?#iefix') format('embedded-opentype'), 11 | url('OpenSans-Regular-webfont.woff') format('woff'), 12 | url('OpenSans-Regular-webfont.ttf') format('truetype'), 13 | url('OpenSans-Regular-webfont.svg#OpenSansRegular') format('svg'); 14 | font-weight: normal; 15 | font-style: normal; 16 | } 17 | 18 | @font-face { 19 | font-family: 'Open Sans'; 20 | src: url('OpenSans-Semibold-webfont.eot'); 21 | src: url('OpenSans-Semibold-webfont.eot?#iefix') format('embedded-opentype'), 22 | url('OpenSans-Semibold-webfont.woff') format('woff'), 23 | url('OpenSans-Semibold-webfont.ttf') format('truetype'), 24 | url('OpenSans-Semibold-webfont.svg#OpenSansSemibold') format('svg'); 25 | font-weight: bold; 26 | font-style: normal; 27 | } 28 | -------------------------------------------------------------------------------- /site/examples/friendlycode/css/opensymbolcropped/opensymbolcropped.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/examples/friendlycode/css/opensymbolcropped/opensymbolcropped.eot -------------------------------------------------------------------------------- /site/examples/friendlycode/css/opensymbolcropped/opensymbolcropped.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/examples/friendlycode/css/opensymbolcropped/opensymbolcropped.ttf -------------------------------------------------------------------------------- /site/examples/friendlycode/css/opensymbolcropped/opensymbolcropped.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/examples/friendlycode/css/opensymbolcropped/opensymbolcropped.woff -------------------------------------------------------------------------------- /site/examples/friendlycode/css/opensymbolcropped/stylesheet.css: -------------------------------------------------------------------------------- 1 | /* 2 | Crop of the Symbol set of the "OpenSymbol" font, 3 | from the LibreOffice project, which is licensed 4 | under LGPLv3+/GPLv3+/MPL1.1+ 5 | 6 | Consequently, these files are licensed under the 7 | same terms. 8 | 9 | */ 10 | @font-face { 11 | font-family: 'OpenSymbolCropped'; 12 | src: url('opensymbolcropped.eot'); 13 | src: url('opensymbolcropped.eot?#iefix') format('embedded-opentype'), 14 | url('opensymbolcropped.woff') format('woff'), 15 | url('opensymbolcropped.ttf') format('truetype'); 16 | font-weight: normal; 17 | font-style: normal; 18 | } -------------------------------------------------------------------------------- /site/examples/friendlycode/css/ubuntumono/stylesheet.css: -------------------------------------------------------------------------------- 1 | /* 2 | http://font.ubuntu.com 3 | */ 4 | 5 | @font-face { 6 | font-family: 'Ubuntu Mono'; 7 | src: url('ubuntumono-r.eot'); 8 | src: url('ubuntumono-r.eot?#iefix') format('embedded-opentype'), 9 | url('ubuntumono-r.woff') format('woff'), 10 | url('ubuntumono-r.ttf') format('truetype'); 11 | font-weight: normal; 12 | font-style: normal; 13 | } 14 | 15 | @font-face { 16 | font-family: 'Ubuntu Mono'; 17 | src: url('ubuntumono-b.eot'); 18 | src: url('ubuntumono-b.eot?#iefix') format('embedded-opentype'), 19 | url('ubuntumono-b.woff') format('woff'), 20 | url('ubuntumono-b.ttf') format('truetype'); 21 | font-weight: bold; 22 | font-style: normal; 23 | } 24 | -------------------------------------------------------------------------------- /site/examples/friendlycode/css/ubuntumono/ubuntumono-b.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/examples/friendlycode/css/ubuntumono/ubuntumono-b.eot -------------------------------------------------------------------------------- /site/examples/friendlycode/css/ubuntumono/ubuntumono-b.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/examples/friendlycode/css/ubuntumono/ubuntumono-b.ttf -------------------------------------------------------------------------------- /site/examples/friendlycode/css/ubuntumono/ubuntumono-b.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/examples/friendlycode/css/ubuntumono/ubuntumono-b.woff -------------------------------------------------------------------------------- /site/examples/friendlycode/css/ubuntumono/ubuntumono-r.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/examples/friendlycode/css/ubuntumono/ubuntumono-r.eot -------------------------------------------------------------------------------- /site/examples/friendlycode/css/ubuntumono/ubuntumono-r.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/examples/friendlycode/css/ubuntumono/ubuntumono-r.ttf -------------------------------------------------------------------------------- /site/examples/friendlycode/css/ubuntumono/ubuntumono-r.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/examples/friendlycode/css/ubuntumono/ubuntumono-r.woff -------------------------------------------------------------------------------- /site/examples/friendlycode/examples/bare-optimized.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Optimized Barebones Friendlycode Editor 8 | 9 | 10 | 11 |
12 | 13 | 14 | 16 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /site/examples/friendlycode/examples/bare.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Barebones Friendlycode Editor 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /site/examples/friendlycode/examples/editor-only.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Editor Only 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /site/examples/friendlycode/img/button-arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/examples/friendlycode/img/button-arrow.png -------------------------------------------------------------------------------- /site/examples/friendlycode/img/checkbox-gradient.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/examples/friendlycode/img/checkbox-gradient.png -------------------------------------------------------------------------------- /site/examples/friendlycode/img/editor-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/examples/friendlycode/img/editor-icon.png -------------------------------------------------------------------------------- /site/examples/friendlycode/img/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/examples/friendlycode/img/error.png -------------------------------------------------------------------------------- /site/examples/friendlycode/img/explanationpt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/examples/friendlycode/img/explanationpt.png -------------------------------------------------------------------------------- /site/examples/friendlycode/img/help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/examples/friendlycode/img/help.png -------------------------------------------------------------------------------- /site/examples/friendlycode/img/hint-down-arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/examples/friendlycode/img/hint-down-arrow.png -------------------------------------------------------------------------------- /site/examples/friendlycode/img/hint-up-arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/examples/friendlycode/img/hint-up-arrow.png -------------------------------------------------------------------------------- /site/examples/friendlycode/img/indicator-arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/examples/friendlycode/img/indicator-arrow.png -------------------------------------------------------------------------------- /site/examples/friendlycode/img/make_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/examples/friendlycode/img/make_logo.png -------------------------------------------------------------------------------- /site/examples/friendlycode/img/modal-close-button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/examples/friendlycode/img/modal-close-button.png -------------------------------------------------------------------------------- /site/examples/friendlycode/img/no.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/examples/friendlycode/img/no.png -------------------------------------------------------------------------------- /site/examples/friendlycode/img/preview-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/examples/friendlycode/img/preview-icon.png -------------------------------------------------------------------------------- /site/examples/friendlycode/img/publish-button-left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/examples/friendlycode/img/publish-button-left.png -------------------------------------------------------------------------------- /site/examples/friendlycode/img/publish-button-right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/examples/friendlycode/img/publish-button-right.png -------------------------------------------------------------------------------- /site/examples/friendlycode/img/questionmark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/examples/friendlycode/img/questionmark.png -------------------------------------------------------------------------------- /site/examples/friendlycode/img/redo-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/examples/friendlycode/img/redo-blue.png -------------------------------------------------------------------------------- /site/examples/friendlycode/img/redo-grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/examples/friendlycode/img/redo-grey.png -------------------------------------------------------------------------------- /site/examples/friendlycode/img/temp-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/examples/friendlycode/img/temp-logo.png -------------------------------------------------------------------------------- /site/examples/friendlycode/img/text-size-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/examples/friendlycode/img/text-size-blue.png -------------------------------------------------------------------------------- /site/examples/friendlycode/img/text-size-large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/examples/friendlycode/img/text-size-large.png -------------------------------------------------------------------------------- /site/examples/friendlycode/img/text-size-normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/examples/friendlycode/img/text-size-normal.png -------------------------------------------------------------------------------- /site/examples/friendlycode/img/text-size-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/examples/friendlycode/img/text-size-small.png -------------------------------------------------------------------------------- /site/examples/friendlycode/img/text-size.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/examples/friendlycode/img/text-size.png -------------------------------------------------------------------------------- /site/examples/friendlycode/img/throbber.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/examples/friendlycode/img/throbber.gif -------------------------------------------------------------------------------- /site/examples/friendlycode/img/undo-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/examples/friendlycode/img/undo-blue.png -------------------------------------------------------------------------------- /site/examples/friendlycode/img/undo-grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/examples/friendlycode/img/undo-grey.png -------------------------------------------------------------------------------- /site/examples/friendlycode/img/yes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/examples/friendlycode/img/yes.png -------------------------------------------------------------------------------- /site/examples/friendlycode/js/backbone-events.js: -------------------------------------------------------------------------------- 1 | // This simple module is just a helper that allows us to go from this code: 2 | // 3 | // _.extend(object, Backbone.Events) 4 | // 5 | // to this code: 6 | // 7 | // BackboneEvents.mixin(object) 8 | // 9 | // This is useful in two ways: 10 | // 11 | // * A bunch of our modules only import underscore and backbone for 12 | // the sole purpose of using Backbone.Events. Importing one module 13 | // and using a one-argument function call is easier than importing two 14 | // modules and using a two-argument function call. 15 | // 16 | // * If we "standardize" on the Backbone.Events interface and module name, 17 | // it becomes easier for AMD modules from other projects to declare it as 18 | // a dependency. AMD-based projects that use backbone and underscore 19 | // can use a file like this one to provide backbone-events, while 20 | // smaller projects that don't need the full power of underscore and 21 | // backbone can provide a more lightweight alternative. 22 | 23 | define(["underscore", "backbone"], function(_, Backbone) { 24 | return { 25 | mixin: function(target) { 26 | return _.extend(target, Backbone.Events); 27 | } 28 | }; 29 | }); 30 | -------------------------------------------------------------------------------- /site/examples/friendlycode/js/fc/prefs.js: -------------------------------------------------------------------------------- 1 | define(["backbone", "lscache"], function(Backbone, lscache) { 2 | 3 | var Preferences = Backbone.Model.extend({ 4 | // Amount of time, in minutes, to store text size setting. 5 | CACHE_TIME_LIMIT: 9000, 6 | // Key to store our Preferences JSON blob in. 7 | CACHE_KEY: 'FriendlycodePreferences', 8 | // Used so that Model.isNew() is always false. 9 | id: 1, 10 | sync: function(method, model, options) { 11 | var json; 12 | 13 | if (method == "create" || method == "update") { 14 | json = model.toJSON(); 15 | lscache.set(this.CACHE_KEY, json, this.CACHE_TIME_LIMIT); 16 | options.success(json); 17 | } else if (method == "delete") { 18 | lscache.remove(this.CACHE_KEY); 19 | } else if (method == "read") { 20 | json = lscache.get(this.CACHE_KEY); 21 | if (!json || typeof(json) != "object") 22 | json = {}; 23 | options.success(json); 24 | } 25 | } 26 | }); 27 | 28 | return new Preferences(); 29 | }); 30 | -------------------------------------------------------------------------------- /site/examples/friendlycode/js/fc/ui/editor.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "jquery", 3 | "./editor-panes", 4 | "./editor-toolbar" 5 | ], function($, EditorPanes, EditorToolbar) { 6 | return function Editor(options) { 7 | var value = options.value, 8 | container = options.container.empty() 9 | .addClass("friendlycode-base"), 10 | toolbarDiv = $('
') 11 | .appendTo(container), 12 | panesDiv = $('
') 13 | .appendTo(container); 14 | 15 | var panes = EditorPanes({ 16 | container: panesDiv, 17 | value: value, 18 | allowJS: options.allowJS 19 | }); 20 | var toolbar = EditorToolbar({ 21 | container: toolbarDiv, 22 | panes: panes 23 | }); 24 | 25 | container.removeClass("friendlycode-loading"); 26 | panes.codeMirror.refresh(); 27 | 28 | return { 29 | container: container, 30 | panes: panes, 31 | toolbar: toolbar 32 | }; 33 | }; 34 | }); 35 | -------------------------------------------------------------------------------- /site/examples/friendlycode/js/fc/ui/history.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | // This manages the UI for undo/redo. 4 | define(function() { 5 | return function HistoryUI(options) { 6 | var undo = options.undo; 7 | var redo = options.redo; 8 | var codeMirror = options.codeMirror; 9 | 10 | function refreshButtons() { 11 | var history = codeMirror.historySize(); 12 | undo.toggleClass("enabled", history.undo == 0 ? false : true); 13 | redo.toggleClass("enabled", history.redo == 0 ? false : true); 14 | } 15 | 16 | undo.click(function() { 17 | codeMirror.undo(); 18 | codeMirror.reparse(); 19 | refreshButtons(); 20 | }); 21 | redo.click(function() { 22 | codeMirror.redo(); 23 | codeMirror.reparse(); 24 | refreshButtons(); 25 | }); 26 | codeMirror.on("change", refreshButtons); 27 | refreshButtons(); 28 | return {refresh: refreshButtons}; 29 | }; 30 | }); 31 | -------------------------------------------------------------------------------- /site/examples/friendlycode/js/fc/ui/indexable-codemirror.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | // A subclass of CodeMirror which adds a few methods that make it easier 4 | // to work with character indexes rather than {line, ch} objects. 5 | define(["codemirror"], function(CodeMirror) { 6 | return function IndexableCodeMirror(place, givenOptions) { 7 | var codeMirror = CodeMirror(place, givenOptions); 8 | 9 | // Returns the character index of the cursor position. 10 | codeMirror.getCursorIndex = function() { 11 | return codeMirror.indexFromPos(codeMirror.getCursor()); 12 | }; 13 | 14 | return codeMirror; 15 | }; 16 | }); 17 | -------------------------------------------------------------------------------- /site/examples/friendlycode/js/fc/ui/mark-tracker.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | // This helper class keeps track of different kinds of highlighting in 4 | // a CodeMirror instance. 5 | define(["jquery"], function($) { 6 | return function MarkTracker(codeMirror) { 7 | var classNames = {}; 8 | var marks = []; 9 | 10 | return { 11 | // Mark a given start/end interval in the CodeMirror, based on character 12 | // indices (not {line, ch} objects), with the given class name. If 13 | // an element is provided, give it the class name too. 14 | mark: function(start, end, className, element) { 15 | if (!(className in classNames)) 16 | classNames[className] = []; 17 | if (element) { 18 | classNames[className].push(element); 19 | $(element).addClass(className); 20 | } 21 | start = codeMirror.posFromIndex(start); 22 | end = codeMirror.posFromIndex(end); 23 | marks.push(codeMirror.markText(start, end, className)); 24 | }, 25 | // Clear all marks made so far and remove the class from any elements 26 | // it was previously given to. 27 | clear: function() { 28 | marks.forEach(function(mark) { 29 | // Odd, from the CodeMirror docs you'd think this would remove 30 | // the class from the highlighted text, too, but it doesn't. 31 | // I guess we're just garbage collecting here. 32 | mark.clear(); 33 | }); 34 | var wrapper = codeMirror.getWrapperElement(); 35 | for (var className in classNames) { 36 | classNames[className].forEach(function(element) { 37 | $(element).removeClass(className); 38 | }); 39 | $("." + className, wrapper).removeClass(className); 40 | } 41 | 42 | marks = []; 43 | classNames = {}; 44 | } 45 | }; 46 | }; 47 | }); 48 | -------------------------------------------------------------------------------- /site/examples/friendlycode/js/fc/ui/modals.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | define(function (require) { 4 | var $ = require("jquery"), 5 | ErrorDialogTemplate = require("template!error-dialog"); 6 | 7 | return function(options) { 8 | var self = {}, 9 | div = options.container, 10 | errorDialog = $(ErrorDialogTemplate()).appendTo(div); 11 | 12 | var hideModals = function() { 13 | div.find(".modal-overlay").fadeOut(); 14 | } 15 | 16 | /** 17 | * When someone clicks on the darkening-overlay, rather 18 | * than the modal dialog, close the modal dialog again. 19 | */ 20 | div.on("click", ".modal-overlay", function(event) { 21 | if (event.target === this) 22 | $(this).fadeOut(); 23 | }); 24 | 25 | div.on("click", "[data-close-modal]", hideModals); 26 | 27 | /** 28 | * The escape key should univerally close modal dialogs 29 | */ 30 | $(document).keyup(function(event) { 31 | if (event.keyCode == 27) 32 | hideModals(); 33 | }); 34 | 35 | self.add = function() { 36 | for (var i = 0; i < arguments.length; i++) 37 | div.append(arguments[i]); 38 | }; 39 | 40 | self.showErrorDialog = function(options) { 41 | $(".error-text", errorDialog).text(options.text); 42 | errorDialog.show(); 43 | }; 44 | 45 | return self; 46 | }; 47 | }); 48 | -------------------------------------------------------------------------------- /site/examples/friendlycode/js/fc/ui/text.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | define(["jquery", "fc/prefs"], function($, Preferences) { 4 | return function(options) { 5 | var codeMirror = options.codeMirror; 6 | var navItem = options.navItem; 7 | var menu = navItem.find("ul"); 8 | var menuItems = menu.find("li"); 9 | 10 | function menuItem(size) { 11 | var item = $("li[data-size=" + size + "]", menu); 12 | return item.length ? item : null; 13 | } 14 | 15 | Preferences.on("change:textSize", function() { 16 | var size = $("li[data-default-size]", menu).attr("data-size"); 17 | var prefSize = Preferences.get("textSize"); 18 | if (prefSize && typeof(prefSize) == "string" && menuItem(prefSize)) 19 | size = prefSize; 20 | 21 | $(codeMirror.getWrapperElement()).attr("data-size", size); 22 | codeMirror.refresh(); 23 | 24 | // Reparse as well, in case there were any errors. 25 | codeMirror.reparse(); 26 | 27 | // Mark text size in drop-down. 28 | menuItems.removeClass("selected"); 29 | menuItem(size).addClass("selected"); 30 | }); 31 | 32 | /** 33 | * Show or hide the font size drop-down menu 34 | */ 35 | navItem.hover(function() { 36 | var t = $(this), 37 | lp = t.position().left; 38 | menu.css("display","inline") 39 | .css("left", (lp-1) + "px").css("top","7px"); 40 | return false; 41 | }, function() { 42 | menu.hide(); 43 | }); 44 | 45 | /** 46 | * bind the resize behaviour to the various text resize options 47 | */ 48 | menuItems.click(function() { 49 | Preferences.set("textSize", $(this).attr("data-size")); 50 | Preferences.save(); 51 | menu.hide(); 52 | }); 53 | 54 | Preferences.trigger("change:textSize"); 55 | }; 56 | }); 57 | -------------------------------------------------------------------------------- /site/examples/friendlycode/js/jquery.no-conflict.js: -------------------------------------------------------------------------------- 1 | define(["jquery.min"], function(jQuery) { 2 | // Prevent modules from accidentally accessing the $ global rather 3 | // than requesting it as a dependency. 4 | // 5 | // We would call jQuery.noConflict(true) to get rid of the jQuery 6 | // global as well, but tabzilla relies on it in a way that prevents 7 | // us from ever removing it from the global namespace. 8 | jQuery.noConflict(); 9 | return jQuery; 10 | }); 11 | -------------------------------------------------------------------------------- /site/examples/friendlycode/js/require-plugins/template.js: -------------------------------------------------------------------------------- 1 | // This is a simple RequireJS plugin that loads an underscore.js template. 2 | define(["module", "text", "underscore"], function (module, text, _) { 3 | var buildMap = {}, 4 | masterConfig = module.config(); 5 | 6 | return { 7 | load: function(name, req, onLoad, config) { 8 | var url = req.toUrl("templates/" + name).replace(".js", ".html"); 9 | 10 | text.get(url, function (data) { 11 | var template; 12 | if (config.isBuild) { 13 | template = buildMap[name] = "_.template(" + JSON.stringify(data) + 14 | ")"; 15 | } else { 16 | template = _.template(data); 17 | } 18 | 19 | onLoad(template); 20 | }); 21 | }, 22 | write: function (pluginName, moduleName, write) { 23 | if (buildMap[moduleName]) { 24 | var content = buildMap[moduleName]; 25 | write.asModule(pluginName + "!" + moduleName, 26 | "define(['underscore'], function (_) { \n return " + content + 27 | ";});\n"); 28 | } 29 | } 30 | }; 31 | }); -------------------------------------------------------------------------------- /site/examples/friendlycode/js/slowparse-errors.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | define([ 4 | 'jquery-slowparse', 5 | 'text!slowparse/spec/errors.base.html', 6 | 'text!slowparse/spec/errors.forbidjs.html' 7 | ], function($, base, forbidjs) { 8 | [base, forbidjs].forEach(function(html) { 9 | var div = $('
').html(html); 10 | $.errorTemplates = $.errorTemplates.add($(".error-msg", div)); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /site/examples/friendlycode/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "build-require", 3 | "version": "0.0.0", 4 | "private": true, 5 | "description": "requirejs optimization script", 6 | "main": "build-require.js", 7 | "dependencies": { 8 | "requirejs": "~2.x" 9 | }, 10 | "scripts": { 11 | "start": "node build-require.js" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /site/examples/friendlycode/slowparse/.gitignore: -------------------------------------------------------------------------------- 1 | docs 2 | -------------------------------------------------------------------------------- /site/examples/friendlycode/slowparse/LICENSE_files/css.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'Droid Sans Mono'; 3 | font-style: normal; 4 | font-weight: normal; 5 | src: local('Droid Sans Mono'), local('DroidSansMono'), url('http://themes.googleusercontent.com/static/fonts/droidsansmono/v4/ns-m2xQYezAtqh7ai59hJaH0X__W3S3MJL29bc5CWfs.woff') format('woff'); 6 | } 7 | -------------------------------------------------------------------------------- /site/examples/friendlycode/slowparse/LICENSE_files/css_002.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'Crimson Text'; 3 | font-style: normal; 4 | font-weight: normal; 5 | src: local('Crimson Text'), local('CrimsonText-Roman'), url('http://themes.googleusercontent.com/static/fonts/crimsontext/v3/3IFMwfRa07i-auYR-B-zNaRDOzjiPcYnFooOUGCOsRk.woff') format('woff'); 6 | } 7 | -------------------------------------------------------------------------------- /site/examples/friendlycode/slowparse/LICENSE_files/css_003.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'Lora'; 3 | font-style: normal; 4 | font-weight: normal; 5 | src: local('Lora'), url('http://themes.googleusercontent.com/static/fonts/lora/v5/nAKwuw6_dIh5kwvpj3ShNfesZW2xOQ-xsNqO47m55DA.woff') format('woff'); 6 | } 7 | -------------------------------------------------------------------------------- /site/examples/friendlycode/slowparse/demo/jsbin-codemirror-theme.css: -------------------------------------------------------------------------------- 1 | /* jsbin - based on web inspector */ 2 | .cm-s-jsbin span.cm-keyword {color: #AA0D91;} 3 | .cm-s-jsbin span.cm-atom {color: #219;} 4 | .cm-s-jsbin span.cm-number {color: #164;} 5 | .cm-s-jsbin span.cm-def {color: #00f;} 6 | .cm-s-jsbin span.cm-variable {color: black;} 7 | .cm-s-jsbin span.cm-variable-2 {color: #05a;} 8 | .cm-s-jsbin span.cm-variable-3 {color: #0a5;} 9 | .cm-s-jsbin span.cm-property {color: black;} 10 | .cm-s-jsbin span.cm-operator {color: black;} 11 | .cm-s-jsbin span.cm-comment {color: #236E25;} 12 | .cm-s-jsbin span.cm-string {color: #C41A16;} 13 | .cm-s-jsbin span.cm-meta {color: #555;} 14 | .cm-s-jsbin span.cm-error {color: #f00;} 15 | .cm-s-jsbin span.cm-qualifier {color: #555;} 16 | .cm-s-jsbin span.cm-builtin {color: #30a;} 17 | .cm-s-jsbin span.cm-bracket {color: #cc7;} 18 | .cm-s-jsbin span.cm-tag {color: #881280;} 19 | .cm-s-jsbin span.cm-attribute {color: #994500;} 20 | 21 | .CodeMirror { 22 | font-family: Menlo, Monaco, consolas, monospace; 23 | font-size: 12px; 24 | line-height: 1.2em; 25 | } 26 | -------------------------------------------------------------------------------- /site/examples/friendlycode/slowparse/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 |
7 |
8 | Jump To … 9 |
10 | 15 |
16 |
17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /site/examples/friendlycode/slowparse/spec/errors.forbidjs.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |

Sorry, but security restrictions on this site prevent you from 4 | using <script> tags 5 | here. If you really need to 6 | use JavaScript, consider using jsbin 7 | or jsfiddle.

8 |
9 |
10 |

Sorry, but security restrictions on this site prevent you from 11 | using the JavaScript event handler attribute 12 | here. 13 | If you really need to use JavaScript, consider using 14 | jsbin 15 | or jsfiddle.

16 |
17 |
18 |

Sorry, but security restrictions on this site prevent you from 19 | using the javascript: URL 20 | here. 21 | If you really need to use JavaScript, consider using 22 | jsbin 23 | or jsfiddle.

24 |
25 | -------------------------------------------------------------------------------- /site/examples/friendlycode/slowparse/test/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Slowparse Test Suite 6 | 7 | 8 | 9 | 10 |

Slowparse Test Suite

11 |

12 |
13 |

14 |
    15 |
    16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 33 | 34 | -------------------------------------------------------------------------------- /site/examples/friendlycode/slowparse/test/test-errors.jquery.js: -------------------------------------------------------------------------------- 1 | module("errors.jquery.js"); 2 | 3 | test("$.fn.fillError() raises nice err when template not found", function() { 4 | try { 5 | var div = $('
    ').fillError({type: "BLARGY"}); 6 | } catch (e) { 7 | equal(e.message, "Error template not found for BLARGY"); 8 | return; 9 | } 10 | ok(false, "Exception not thrown!"); 11 | }); 12 | 13 | test("$.fn.fillError() works when template is found", function() { 14 | var templates = $('
    ' + 15 | '

    {{foo.bar}}

    '); 16 | var div = $('
    ').fillError({ 17 | type: "BLARGY", 18 | foo: {bar: "hi"} 19 | }, templates); 20 | equal(div.html(), "

    hi

    "); 21 | }); 22 | 23 | test("$.fn.errorHighlightInterval() works", function() { 24 | deepEqual($('
    ').errorHighlightInterval(), 25 | {start: 1, end: undefined}, "works w/ start only"); 26 | deepEqual($('
    ').errorHighlightInterval(), 27 | {start: 1, end: 2}, "works w/ number pair"); 28 | }); 29 | 30 | test("$.fn.eachErrorHighlight() works", function() { 31 | var args = []; 32 | var div = $('
    ' + 33 | '
    '); 34 | div.eachErrorHighlight(function(start, end, i) { 35 | args.push({ 36 | node: this.nodeName, 37 | start: start, 38 | end: end, 39 | i: i 40 | }); 41 | }); 42 | deepEqual(args, [ 43 | { 44 | "end": 2, 45 | "i": 0, 46 | "node": "DIV", 47 | "start": 1 48 | }, 49 | { 50 | "end": undefined, 51 | "i": 1, 52 | "node": "EM", 53 | "start": 3 54 | } 55 | ]); 56 | }); 57 | -------------------------------------------------------------------------------- /site/examples/friendlycode/slowparse/test/test-spec.js: -------------------------------------------------------------------------------- 1 | module("Specification loading"); 2 | 3 | asyncTest("frame loads", function() { 4 | var iframe = document.createElement("iframe"); 5 | iframe.setAttribute("src", "../spec/index.html"); 6 | document.body.appendChild(iframe); 7 | iframe.style.display = "none"; 8 | iframe.addEventListener("load", function() { 9 | ok(true, "load event is triggered"); 10 | iframe.contentWindow.runTests(module, test, ok, deepEqual, start); 11 | }, false); 12 | }); 13 | -------------------------------------------------------------------------------- /site/examples/friendlycode/slowparse/test/test-tree-inspectors.js: -------------------------------------------------------------------------------- 1 | module("TreeInspectors.forbidJS()"); 2 | 3 | test("works on script-less HTML", function() { 4 | var html = '

    hello

    '; 5 | var result = Slowparse.HTML(document, html, [TreeInspectors.forbidJS]); 6 | equal(result.error, null); 7 | equal(documentFragmentHTML(result.document), html); 8 | }); 9 | 10 | (function() { 11 | module("TreeInspectors.findJS()"); 12 | 13 | function findJS(html) { 14 | var doc = Slowparse.HTML(document, html).document; 15 | return TreeInspectors.findJS(doc); 16 | } 17 | 18 | test("works on script-less HTML", function() { 19 | deepEqual(findJS('

    hello

    '), []); 20 | }); 21 | 22 | test("SCRIPT_ELEMENT is reported", function() { 23 | var html = ''; 24 | var js = findJS(html); 25 | equal(js.length, 1); 26 | equal(js[0].type, "SCRIPT_ELEMENT"); 27 | assertParseIntervals(html, js[0].node, "elementNode", { 28 | 'parseInfo.openTag': ' 18 | 19 | 20 | 21 | 23 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /site/examples/friendlycode/test/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Friendlycode Test Suite 6 | 7 | 8 | 9 | 10 |

    Friendlycode Test Suite

    11 |

    12 |
    13 |

    14 |
      15 |
      16 | 17 | 18 | 19 | 20 | 21 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /site/examples/friendlycode/test/lptest.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "jquery", 3 | "backbone-events", 4 | "fc/ui/live-preview", 5 | "slowparse/slowparse" 6 | ], function($, BackboneEvents, LivePreview, Slowparse) { 7 | return function lpTest(name, html, cb) { 8 | if (typeof(html) == 'function') { 9 | cb = html; 10 | html = '

      hi there

      '; 11 | } 12 | test(name, function() { 13 | var div = $('
      ').appendTo('body').css({visibility: "hidden"}); 14 | var cm = BackboneEvents.mixin({}); 15 | var preview = LivePreview({ 16 | codeMirror: cm, 17 | previewArea: div 18 | }); 19 | var result = Slowparse.HTML(document, html); 20 | cm.trigger('reparse', { 21 | error: null, 22 | sourceCode: html, 23 | document: result.document 24 | }); 25 | try { 26 | var iframe = div.find("iframe"); 27 | if (iframe.length != 1) 28 | ok(false, "preview area should contain 1 iframe"); 29 | if (!iframe[0].contentWindow) 30 | ok(false, "iframe contentWindow should be non-null"); 31 | cb(iframe, preview, cm, result.document, html); 32 | } finally { 33 | div.remove(); 34 | } 35 | }); 36 | }; 37 | }); 38 | -------------------------------------------------------------------------------- /site/examples/friendlycode/test/preview-to-editor-mapping/path-to.html: -------------------------------------------------------------------------------- 1 |
      2 |
      3 |
      4 |
      5 |
      6 | 7 |
      8 |
      9 |
      10 |
      11 | 12 | 13 |
      14 |
      15 |
      16 |
      17 | 18 |

      19 | 20 |
      21 |
      22 |
      23 |
      24 | 25 |

      26 | 27 |
      28 |
      29 |
      30 |
      31 | 32 |
      33 | 34 |
      35 |
      36 |
      37 |
      38 | 39 | 40 |
      -------------------------------------------------------------------------------- /site/examples/friendlycode/test/publisher/post-publish.html: -------------------------------------------------------------------------------- 1 | 2 | hello 3 | 8 | 9 | 10 |

      Tinker with me.

      11 | 12 | -------------------------------------------------------------------------------- /site/examples/friendlycode/test/publisher/pre-publish.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | hello 5 | 10 | 11 | 12 |

      Tinker with me.

      13 | 14 | -------------------------------------------------------------------------------- /site/examples/friendlycode/test/publisher/test-publisher.js: -------------------------------------------------------------------------------- 1 | defineTests([ 2 | "fc/publisher", 3 | "text!test/publisher/pre-publish.html", 4 | "text!test/publisher/post-publish.html" 5 | ], function(Publisher, prePublish, postPublish) { 6 | module("Publisher"); 7 | 8 | fixDoctypeHeadBodyMunging = Publisher._fixDoctypeHeadBodyMunging; 9 | 10 | test("fixDoctypeHeadBodyMunging() works", function() { 11 | equal(fixDoctypeHeadBodyMunging(postPublish), prePublish); 12 | }); 13 | 14 | test("fixDoctypeHeadBodyMunging() ignores non-munged strings", function() { 15 | var html = 'hi'; 16 | equal(fixDoctypeHeadBodyMunging(html), html); 17 | }); 18 | }); 19 | -------------------------------------------------------------------------------- /site/examples/friendlycode/test/test-app-optimized.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | App Test Frame - Optimized Build 4 | 5 | 6 |
      7 | 8 | 9 | 21 | -------------------------------------------------------------------------------- /site/examples/friendlycode/test/test-app.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | App Test Frame 4 | 5 | 6 |
      7 | 8 | 9 | 21 | -------------------------------------------------------------------------------- /site/examples/friendlycode/test/test-editor-toolbar.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | defineTests([ 4 | "jquery", 5 | "fc/ui/editor-panes", 6 | "fc/ui/editor-toolbar" 7 | ], function($, EditorPanes, EditorToolbar) { 8 | var parentDiv, panesDiv, toolbarDiv, panes, options; 9 | 10 | module("EditorToolbar", { 11 | setup: function() { 12 | parentDiv = $('
      ').appendTo("#qunit-fixture").hide(); 13 | panesDiv = $('
      ').appendTo(parentDiv); 14 | toolbarDiv = $('
      ').appendTo(parentDiv); 15 | panes = EditorPanes({container: panesDiv}); 16 | options = {panes: panes, container: toolbarDiv}; 17 | }, 18 | teardown: function() { 19 | parentDiv.remove(); 20 | } 21 | }); 22 | 23 | test("shows page title when is present", function() { 24 | var toolbar = EditorToolbar(options); 25 | panes.codeMirror.setValue("<title>supdog"); 26 | panes.codeMirror.reparse(); 27 | parentDiv.show(); 28 | equal($(".preview-title:visible", toolbarDiv).length, 1, 29 | "navbar preview title is not hidden"); 30 | equal($(".preview-title", toolbarDiv).text(), "supdog", 31 | "navbar preview title is 'supdog'"); 32 | }); 33 | 34 | test("doesn't show page title when is absent", function() { 35 | var toolbar = EditorToolbar(options); 36 | panes.codeMirror.setValue("<p>hello</p>"); 37 | panes.codeMirror.reparse(); 38 | parentDiv.show(); 39 | equal($(".preview-title:visible", toolbarDiv).length, 0, 40 | "navbar preview title is hidden"); 41 | }); 42 | }); 43 | -------------------------------------------------------------------------------- /site/examples/friendlycode/test/test-gutter-pointer.js: -------------------------------------------------------------------------------- 1 | defineTests([ 2 | "jquery", 3 | "codemirror", 4 | "fc/ui/gutter-pointer" 5 | ], function($, CodeMirror, gutterPointer) { 6 | module("gutterPointer"); 7 | 8 | test("does not smoke", function() { 9 | var div = $("<div></div>").appendTo("#qunit-fixture"); 10 | var cm = CodeMirror(div[0], { 11 | value: "hello\nthere\ndude", 12 | lineNumbers: true 13 | }); 14 | 15 | cm.setMarker(1, null, "blarg"); 16 | 17 | var gp = gutterPointer(cm, "blarg"); 18 | equal(gp.css('position'), 'absolute', 19 | 'gutterPointer is absolutely positioned'); 20 | equal(gp[0].nodeName, "svg", "gutterPointer is <svg>"); 21 | equal(gp[0].namespaceURI, "http://www.w3.org/2000/svg", 22 | "gutterPointer has SVG namespace"); 23 | equal(gp.attr("class"), "gutter-pointer blarg"); 24 | div.remove(); 25 | }); 26 | }); 27 | -------------------------------------------------------------------------------- /site/examples/friendlycode/test/test-indexable-codemirror.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | defineTests([ 4 | "jquery", 5 | "fc/ui/indexable-codemirror" 6 | ], function($, IndexableCodeMirror) { 7 | module("IndexableCodeMirror"); 8 | 9 | function icmTest(name, cb) { 10 | test(name, function() { 11 | var place = $("<div></div>").appendTo(document.body); 12 | var cm = IndexableCodeMirror(place[0], {mode: "text/plain"}); 13 | var content = "hello\nthere"; 14 | cm.setValue(content); 15 | try { 16 | cb(cm, content); 17 | } finally { 18 | place.remove(); 19 | } 20 | }); 21 | } 22 | 23 | icmTest("indexFromPos() works", function(cm, content) { 24 | equal(cm.indexFromPos({line: 0, ch: 0}), 0, 25 | "index of line 0, char 0 is 0"); 26 | equal(cm.indexFromPos({line: 1, ch: 0}), content.indexOf("there"), 27 | "index of line 1, char 0 works"); 28 | }); 29 | 30 | icmTest("getCursorIndex() works", function(cm, content) { 31 | cm.setCursor({line: 1, ch: 0}); 32 | equal(cm.getCursorIndex(), content.indexOf("there")); 33 | }); 34 | }); 35 | -------------------------------------------------------------------------------- /site/examples/friendlycode/test/test-mark-tracker.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | defineTests([ 4 | "jquery", 5 | "fc/ui/mark-tracker", 6 | "codemirror" 7 | ], function($, MarkTracker, CodeMirror) { 8 | module("MarkTracker"); 9 | 10 | function mtTest(name, cb) { 11 | test(name, function() { 12 | var place = $("<div></div>").appendTo(document.body); 13 | var cm = CodeMirror(place[0], {mode: "text/plain"}); 14 | var mt = MarkTracker(cm); 15 | try { 16 | cb(place, cm, mt); 17 | } finally { 18 | place.remove(); 19 | } 20 | }); 21 | } 22 | 23 | mtTest("codeMirror content mark/clear works", function(place, cm, mt) { 24 | cm.setValue("hello"); 25 | mt.mark(2, 4, "blah"); 26 | equal(place.find(".blah").text(), "ll", "source code is marked w/ class"); 27 | mt.clear(); 28 | equal(place.find(".blah").length, 0, "source code class is cleared"); 29 | }); 30 | 31 | mtTest("related element mark/clear works", function(place, cm, mt) { 32 | var thing = $("<div></div>"); 33 | cm.setValue("hello"); 34 | mt.mark(1, 4, "foo", thing[0]); 35 | ok(thing.hasClass("foo"), "related element is marked w/ class"); 36 | mt.clear(); 37 | ok(!thing.hasClass("foo"), "related element class is cleared"); 38 | }); 39 | }); 40 | -------------------------------------------------------------------------------- /site/examples/friendlycode/test/test-prefs.js: -------------------------------------------------------------------------------- 1 | defineTests(["fc/prefs", "lscache"], function(Preferences, lscache) { 2 | Preferences.CACHE_KEY = "TestPreferences"; 3 | 4 | module("Preferences", { 5 | setup: function() { 6 | Preferences.off(); 7 | Preferences.clear(); 8 | Preferences.save(); 9 | } 10 | }); 11 | 12 | test("is resilient when no stored value is available", function() { 13 | lscache.remove(Preferences.CACHE_KEY); 14 | Preferences.fetch(); 15 | equal(Preferences.get("blah"), undefined); 16 | }); 17 | 18 | test("is resilient with corrupt JSON", function() { 19 | lscache.set(Preferences.CACHE_KEY, "NO U!", 500); 20 | Preferences.fetch(); 21 | equal(Preferences.get("blah"), undefined); 22 | }); 23 | 24 | test("loads stored preferences", function() { 25 | lscache.set(Preferences.CACHE_KEY, { 26 | meh: 1 27 | }, 500); 28 | Preferences.fetch(); 29 | equal(Preferences.get("meh"), 1); 30 | }); 31 | 32 | test("stores preferences", function() { 33 | Preferences.set("blop", 5); 34 | Preferences.save(); 35 | deepEqual(lscache.get(Preferences.CACHE_KEY), { 36 | blop: 5 37 | }); 38 | }); 39 | 40 | test("can be destroyed", function() { 41 | deepEqual(lscache.get(Preferences.CACHE_KEY), {}); 42 | Preferences.destroy(); 43 | equal(lscache.get(Preferences.CACHE_KEY), undefined); 44 | }); 45 | 46 | test("triggers change events", function() { 47 | Preferences.on("change:foo", function() { 48 | ok(true, "change:foo is triggered"); 49 | }); 50 | Preferences.set("foo", 1); 51 | }); 52 | }); 53 | -------------------------------------------------------------------------------- /site/examples/friendlycode/test/test-slowparse-errors.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | defineTests(["jquery", "slowparse-errors"], function($) { 4 | module("slowparse-errors"); 5 | 6 | test("base errors are available", function() { 7 | equal($.errorTemplates.filter(".CLOSE_TAG_FOR_VOID_ELEMENT").length, 1); 8 | }); 9 | 10 | test("forbidjs errors are available", function() { 11 | equal($.errorTemplates.filter(".SCRIPT_ELEMENT_NOT_ALLOWED").length, 1); 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /site/examples/friendlycode/test/test-templates.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | defineTests(["template!error-msg", "template!help-msg"], function(err, help) { 4 | module("templates"); 5 | 6 | function contains(str, terms) { 7 | if (typeof(terms) == "string") 8 | terms = [terms]; 9 | terms.forEach(function(term) { 10 | ok(str.indexOf(term) != -1, "'" + term + "' is in " + 11 | JSON.stringify(str)); 12 | }); 13 | } 14 | 15 | test("error template works", function() { 16 | contains(err({error: "<p>yo</p>"}), "<p>yo</p>") 17 | }); 18 | 19 | test("help template works", function() { 20 | contains(help({ 21 | html: "<i>hi</i>", 22 | type: "nom", 23 | url: "meh<" 24 | }), ["<i>hi</i>", "meh<"]); 25 | 26 | contains(help({ 27 | html: "<i>hi</i>", 28 | type: "cssSelector", 29 | matchCount: 5, 30 | url: "meh<" 31 | }), ["5", "<i>hi</i>", "meh<"]); 32 | }); 33 | }); 34 | -------------------------------------------------------------------------------- /site/examples/madlibs/css/app.css: -------------------------------------------------------------------------------- 1 | .madlib-hidden { 2 | color: transparent; 3 | text-shadow: 0 0 15px rgba(0,0,0,0.5); 4 | } 5 | 6 | .madlib-hidden input { 7 | /*color: #000;*/ 8 | } 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /site/examples/madlibs/js/app.js: -------------------------------------------------------------------------------- 1 | function reveal() { 2 | $(".madlib").removeClass("madlib-hidden"); 3 | $("#reveal").hide(); 4 | $("#hide").show(); 5 | } 6 | 7 | function hide() { 8 | $(".madlib").addClass("madlib-hidden"); 9 | $("#reveal").show(); 10 | $("#hide").hide(); 11 | } 12 | 13 | $("#reveal").click(reveal); 14 | $("#hide").click(hide); 15 | TogetherJS.config("cloneClicks", "#reveal, #hide"); 16 | -------------------------------------------------------------------------------- /site/examples/tinymce/css/application.css: -------------------------------------------------------------------------------- 1 | .tinymce { 2 | margin-top: 40px; 3 | } 4 | 5 | .tjsbutton img { 6 | width: 125px; 7 | } 8 | 9 | .subtitle { 10 | margin-top: -10px; 11 | padding-bottom: 15px; 12 | } 13 | -------------------------------------------------------------------------------- /site/examples/tinymce/index.html: -------------------------------------------------------------------------------- 1 | {% extends "base.tmpl" %} 2 | {% block title %} Mozilla Labs : YouTube example {% endblock %} 3 | {% block configs %} 4 | <script> 5 | var TogetherJSConfig_autoStart = true; 6 | var TogetherJSConfig_dontShowClicks = true; 7 | var TogetherJSConfig_suppressJoinConfirmation = true; 8 | </script> 9 | {% endblock %} 10 | 11 | {% block body %} 12 | {% block styles %} 13 | <link rel="stylesheet" type="text/css" href="css/application.css" /> 14 | {% endblock %} 15 | 16 | <div class="container"> <!-- container --> 17 | <div class="body-content row" id="youtube-example"> 18 | <div class="col-md-6 col-md-offset-3"> 19 | <div id="introduction"> 20 | <h1> 21 | Write Together 22 | <a href="javascript:;" class="pull-right tjsbutton"><img src="https://togetherjs.com/images/start-togetherjs-blue.png"></img></a> 23 | </h1> 24 | <h3 class='subtitle'>TogetherJS supports built-in synchronization for popular web editors like TinyMCE, Ace, CodeMirror, CKEditor.</h3> 25 | </div> 26 | <div class="tinymce"></div> 27 | <form role="form"> 28 | <div class="row"> 29 | <div class="col-xs-12 labelarea"> 30 | <h4>Invite someone to start writing together.</h4> 31 | <p class="youtube-embed-label">Write a blog post with your friend, edit an essay for your student, or even draft a business proposal with your team in real-time. To invite someone, click the invite button on the right blue menu and send the url to the person you want to write together.</p> 32 | </div> 33 | </div> 34 | </form> 35 | </div> <!-- // youtube container --> 36 | </div> <!-- //body-content --> 37 | 38 | <script type="text/javascript" src="/js/jquery-1.10.2.min.js"></script> 39 | <script src="http://tinymce.cachefly.net/4.0/tinymce.min.js"></script> 40 | <script type="text/javascript" src="js/application.js"></script> 41 | 42 | {% endblock %} 43 | -------------------------------------------------------------------------------- /site/examples/tinymce/js/application.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | tinymce.init({ 3 | selector: '.tinymce' 4 | }); 5 | 6 | $('.tjsbutton').click(function () { 7 | $('#togetherjs-dock').toggle(); 8 | }); 9 | }); 10 | -------------------------------------------------------------------------------- /site/examples/tinymce/js/application.js~: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/examples/tinymce/js/application.js~ -------------------------------------------------------------------------------- /site/examples/youtube/css/application.css: -------------------------------------------------------------------------------- 1 | .youtube-container { 2 | margin: 0 auto; 3 | //width: 560px; 4 | } 5 | 6 | .youtube-embed-link { 7 | margin: 0; 8 | } 9 | 10 | .youtube-embed-link { 11 | margin-top: 0px; 12 | } 13 | 14 | .embed-submit-button { 15 | margin-top: 0px; 16 | } 17 | 18 | .youtube-embed-label { 19 | padding-bottom: 0px; 20 | } 21 | 22 | #youtube-example .row { 23 | margin-top: 0px; 24 | margin-bottom: 0px; 25 | } 26 | 27 | #youtube-example .row .labelarea { 28 | padding-bottom: 0px; 29 | padding-top: 0px; 30 | } 31 | 32 | #youtube-example .row .linkarea { 33 | padding-top: 0px 34 | } 35 | 36 | #youtube-example h1 { 37 | margin-bottom: 30px; 38 | } 39 | 40 | #youtube-example h4 { 41 | margin-top: 20px; 42 | font-family: openSansBold,sans-serif; 43 | text-transform: uppercase; 44 | font-size: 12px; 45 | font-weight: 600; 46 | letter-spacing: 1px; 47 | line-height: 16px; 48 | } 49 | 50 | #youtube-example .tjsbutton { 51 | margin-top: 10px; 52 | } 53 | 54 | @media (min-width: 1200px) { 55 | h1 { 56 | font-size: 48px !important; 57 | } 58 | 59 | } 60 | 61 | @media (min-width: 992px) { 62 | h1 { 63 | font-size: 48px !important; 64 | } 65 | } 66 | 67 | @media (min-width: 768px) { 68 | h1 { 69 | font-size: 38px !important; 70 | } 71 | } 72 | 73 | @media (min-width: 480px) { 74 | h1 { 75 | font-size: 38px; 76 | } 77 | } 78 | 79 | @media (max-width: 480px) { 80 | #youtube-example .tjsbutton img { 81 | width: 100px !important; 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /site/examples/youtube/js/application.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | $('.embed-submit-button').click(function() { 3 | // FIXME: uncaught exception: [CannotFind #video-id-input(:nth-child(1)): container only has 0 elements in #video-id-input] 4 | // I am not sure where this exception is generated. Maybe it is caused by togetherJS? 5 | var newVideoId = $('#video-id-input').val(); 6 | var $youTubeIframe = $("iframe[src*='youtube']"); 7 | var player = $youTubeIframe.data('togetherjs-player'); 8 | player.loadVideoById(newVideoId); 9 | 10 | // If the iframe's src is changed, the saved youtube player malfunctions 11 | 12 | // $(youTubeIframe).attr("src", newSrc); 13 | // console.log("gonna run reinitailize now..."); 14 | // //reinitialize to configure youtube players again 15 | // TogetherJS.reinitialize(); 16 | }); 17 | $('video-id-input').keypress(function(event) { 18 | if (event.keyCode == 13) 19 | $('.embed-submit-button').click(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /site/faq.html: -------------------------------------------------------------------------------- 1 | {% extends "base.tmpl" %} 2 | {% block body %} 3 | 4 | <div class="container"> 5 | <section class="body-content" id="main-section" data-speed="4" data-type="background"> 6 | <section class="row" id="tour"> 7 | <div class="col-xs-12"> 8 | <h1>FAQ</h1> 9 | <h3>What is TogetherJS?</h3> 10 | <p>TogetherJS is a JavaScript library that adds collaboration features and tools to your website or app.</p> 11 | <h3>If I'm using TogetherJS with people, can they see the current webpage I'm on?</h3> 12 | <p>Yup! TogetherJS allows another user to see the content on your screen. So just be careful and do not show sensitive information.</p> 13 | <h3>Does TogetherJS work on Internet Explorer?</h3> 14 | <p>Not really, but we really need your help to make it better on IE! Please help us to improve TogetherJS on IE by taking on a bug in GitHub <a href="https://github.com/mozilla/togetherjs/issues?labels=IE&milestone=&page=1&state=open" target="_blank">here</a>.</p> 15 | <!-- <h3>Section header</h3> 16 | <p>text goes here.</p> --> 17 | </div> 18 | </section> 19 | 20 | {% endblock %} 21 | -------------------------------------------------------------------------------- /site/generic-markdown.tmpl: -------------------------------------------------------------------------------- 1 | {% extends "base.tmpl" %} 2 | {# set enableMarkdown true #} 3 | {% block body %} 4 | 5 | <div class="container"> 6 | <section class="row" id="markdownpages"> 7 | <div class="col-md-9"> 8 | <h1>{{ title }}</h1> 9 | {{ markdownBody }} 10 | </div> 11 | </section> 12 | 13 | {% endblock %} 14 | -------------------------------------------------------------------------------- /site/images/404-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/404-image.png -------------------------------------------------------------------------------- /site/images/500-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/500-image.png -------------------------------------------------------------------------------- /site/images/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/bg.png -------------------------------------------------------------------------------- /site/images/bg@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/bg@2x.png -------------------------------------------------------------------------------- /site/images/fav-icon-bizarro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/fav-icon-bizarro.png -------------------------------------------------------------------------------- /site/images/fav-icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/fav-icon.ico -------------------------------------------------------------------------------- /site/images/favicon-animate.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/favicon-animate.gif -------------------------------------------------------------------------------- /site/images/footer-mozilla-labs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/footer-mozilla-labs.png -------------------------------------------------------------------------------- /site/images/footer-mozilla-labs@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/footer-mozilla-labs@2x.png -------------------------------------------------------------------------------- /site/images/site-customers-jsfiddle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/site-customers-jsfiddle.png -------------------------------------------------------------------------------- /site/images/site-customers-jsfiddle@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/site-customers-jsfiddle@2x.png -------------------------------------------------------------------------------- /site/images/site-customers-netfiddle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/site-customers-netfiddle.png -------------------------------------------------------------------------------- /site/images/site-customers-netfiddle@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/site-customers-netfiddle@2x.png -------------------------------------------------------------------------------- /site/images/site-customers-popcorn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/site-customers-popcorn.png -------------------------------------------------------------------------------- /site/images/site-customers-popcorn@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/site-customers-popcorn@2x.png -------------------------------------------------------------------------------- /site/images/site-customers-thimble.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/site-customers-thimble.png -------------------------------------------------------------------------------- /site/images/site-customers-thimble@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/site-customers-thimble@2x.png -------------------------------------------------------------------------------- /site/images/site-customers-wordpress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/site-customers-wordpress.png -------------------------------------------------------------------------------- /site/images/site-customers-wordpress@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/site-customers-wordpress@2x.png -------------------------------------------------------------------------------- /site/images/site-examples-drawing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/site-examples-drawing.png -------------------------------------------------------------------------------- /site/images/site-examples-drawing@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/site-examples-drawing@2x.png -------------------------------------------------------------------------------- /site/images/site-examples-friendlycode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/site-examples-friendlycode.png -------------------------------------------------------------------------------- /site/images/site-examples-friendlycode@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/site-examples-friendlycode@2x.png -------------------------------------------------------------------------------- /site/images/site-examples-madlibs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/site-examples-madlibs.png -------------------------------------------------------------------------------- /site/images/site-examples-madlibs@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/site-examples-madlibs@2x.png -------------------------------------------------------------------------------- /site/images/site-examples-tinymce.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/site-examples-tinymce.png -------------------------------------------------------------------------------- /site/images/site-examples-todo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/site-examples-todo.png -------------------------------------------------------------------------------- /site/images/site-examples-todo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/site-examples-todo@2x.png -------------------------------------------------------------------------------- /site/images/site-examples-youtube.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/site-examples-youtube.png -------------------------------------------------------------------------------- /site/images/site-examples-youtube@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/site-examples-youtube@2x.png -------------------------------------------------------------------------------- /site/images/site-features-audiovideo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/site-features-audiovideo.png -------------------------------------------------------------------------------- /site/images/site-features-audiovideo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/site-features-audiovideo@2x.png -------------------------------------------------------------------------------- /site/images/site-features-cobrowsing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/site-features-cobrowsing.png -------------------------------------------------------------------------------- /site/images/site-features-cobrowsing@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/site-features-cobrowsing@2x.png -------------------------------------------------------------------------------- /site/images/site-features-realtimesync.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/site-features-realtimesync.png -------------------------------------------------------------------------------- /site/images/site-features-realtimesync@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/site-features-realtimesync@2x.png -------------------------------------------------------------------------------- /site/images/site-features-text-chat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/site-features-text-chat.png -------------------------------------------------------------------------------- /site/images/site-features-text-chat@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/site-features-text-chat@2x.png -------------------------------------------------------------------------------- /site/images/site-features-user-focus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/site-features-user-focus.png -------------------------------------------------------------------------------- /site/images/site-features-user-focus@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/site-features-user-focus@2x.png -------------------------------------------------------------------------------- /site/images/site-features-user-presence.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/site-features-user-presence.png -------------------------------------------------------------------------------- /site/images/site-features-user-presence@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/site-features-user-presence@2x.png -------------------------------------------------------------------------------- /site/images/site-hero-image-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/site-hero-image-01.png -------------------------------------------------------------------------------- /site/images/site-hero-image-01@2x-overlay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/site-hero-image-01@2x-overlay.png -------------------------------------------------------------------------------- /site/images/site-hero-image-01@2x-overlay@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/site-hero-image-01@2x-overlay@2x.png -------------------------------------------------------------------------------- /site/images/site-hero-image-01@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/site-hero-image-01@2x.png -------------------------------------------------------------------------------- /site/images/site-hero-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/site-hero-image.png -------------------------------------------------------------------------------- /site/images/site-hero-image@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/site-hero-image@2x.png -------------------------------------------------------------------------------- /site/images/site-tour-why-create.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/site-tour-why-create.png -------------------------------------------------------------------------------- /site/images/site-tour-why-create@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/site-tour-why-create@2x.png -------------------------------------------------------------------------------- /site/images/site-tour-why-moz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/site-tour-why-moz.png -------------------------------------------------------------------------------- /site/images/site-tour-why-moz@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/site-tour-why-moz@2x.png -------------------------------------------------------------------------------- /site/images/site-tour-why-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/site-tour-why-web.png -------------------------------------------------------------------------------- /site/images/site-tour-why-web@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/site-tour-why-web@2x.png -------------------------------------------------------------------------------- /site/images/start-togetherjs-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/start-togetherjs-blue.png -------------------------------------------------------------------------------- /site/images/start-togetherjs-gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/start-togetherjs-gray.png -------------------------------------------------------------------------------- /site/images/togetherjs-how-01-addit-btn-collaborate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/togetherjs-how-01-addit-btn-collaborate.png -------------------------------------------------------------------------------- /site/images/togetherjs-how-01-addit-btn-collaborate@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/togetherjs-how-01-addit-btn-collaborate@2x.png -------------------------------------------------------------------------------- /site/images/togetherjs-how-01-addit-file-connecthtml.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/togetherjs-how-01-addit-file-connecthtml.png -------------------------------------------------------------------------------- /site/images/togetherjs-how-01-addit-file-connecthtml@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/togetherjs-how-01-addit-file-connecthtml@2x.png -------------------------------------------------------------------------------- /site/images/togetherjs-how-01-addit-file-connectjs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/togetherjs-how-01-addit-file-connectjs.png -------------------------------------------------------------------------------- /site/images/togetherjs-how-01-addit-file-connectjs@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/togetherjs-how-01-addit-file-connectjs@2x.png -------------------------------------------------------------------------------- /site/images/togetherjs-how-01-addit-noplus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/togetherjs-how-01-addit-noplus.png -------------------------------------------------------------------------------- /site/images/togetherjs-how-01-addit-noplus@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/togetherjs-how-01-addit-noplus@2x.png -------------------------------------------------------------------------------- /site/images/togetherjs-how-01-addit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/togetherjs-how-01-addit.png -------------------------------------------------------------------------------- /site/images/togetherjs-how-01-addit@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/togetherjs-how-01-addit@2x.png -------------------------------------------------------------------------------- /site/images/togetherjs-how-02-dock-btn-collaborate-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/togetherjs-how-02-dock-btn-collaborate-pressed.png -------------------------------------------------------------------------------- /site/images/togetherjs-how-02-dock-btn-collaborate-pressed@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/togetherjs-how-02-dock-btn-collaborate-pressed@2x.png -------------------------------------------------------------------------------- /site/images/togetherjs-how-02-dock-sm@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/togetherjs-how-02-dock-sm@2x.png -------------------------------------------------------------------------------- /site/images/togetherjs-how-02-dock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/togetherjs-how-02-dock.png -------------------------------------------------------------------------------- /site/images/togetherjs-how-02-dock@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/togetherjs-how-02-dock@2x.png -------------------------------------------------------------------------------- /site/images/togetherjs-how-02-maindockpiece.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/togetherjs-how-02-maindockpiece.png -------------------------------------------------------------------------------- /site/images/togetherjs-how-02-maindockpiece@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/togetherjs-how-02-maindockpiece@2x.png -------------------------------------------------------------------------------- /site/images/togetherjs-how-03-collaborate-cursors@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/togetherjs-how-03-collaborate-cursors@2x.png -------------------------------------------------------------------------------- /site/images/togetherjs-how-03-collaborate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/togetherjs-how-03-collaborate.png -------------------------------------------------------------------------------- /site/images/togetherjs-how-03-collaborate@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/togetherjs-how-03-collaborate@2x.png -------------------------------------------------------------------------------- /site/images/togetherjs-how-03-cursor1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/togetherjs-how-03-cursor1.png -------------------------------------------------------------------------------- /site/images/togetherjs-how-03-cursor1@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/togetherjs-how-03-cursor1@2x.png -------------------------------------------------------------------------------- /site/images/togetherjs-how-03-cursor2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/togetherjs-how-03-cursor2.png -------------------------------------------------------------------------------- /site/images/togetherjs-how-03-cursor2@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/togetherjs-how-03-cursor2@2x.png -------------------------------------------------------------------------------- /site/images/togetherjs-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/togetherjs-logo.png -------------------------------------------------------------------------------- /site/images/togetherjs-logo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/site/images/togetherjs-logo@2x.png -------------------------------------------------------------------------------- /site/js/frontpage.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | $(".modal").on("show.bs.modal", function () { 3 | var iframes = $(this).find(".delay-open"); 4 | iframes.each(function () { 5 | $(this).attr("src", $(this).attr("data-delay-src")); 6 | }); 7 | }); 8 | }); 9 | -------------------------------------------------------------------------------- /site/js/imageresizer.js: -------------------------------------------------------------------------------- 1 | // check for retina - NOT IN USE 2 | // if (window.devicePixelRatio > 1){ 3 | // $("img.retina-ready").each(function(i, img){ 4 | // // images/thing.png -> images/thing-retina.png 5 | // img.src = img.src.split(".").join("-retina."); 6 | // }); 7 | // } -------------------------------------------------------------------------------- /site/js/parallax.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function(){ 2 | 3 | // detect a mobile device 4 | var isMobile = { 5 | Android: function() { 6 | return navigator.userAgent.match(/Android/i); 7 | }, 8 | BlackBerry: function() { 9 | return navigator.userAgent.match(/BlackBerry/i); 10 | }, 11 | iOS: function() { 12 | return navigator.userAgent.match(/iPhone|iPad|iPod/i); 13 | }, 14 | Opera: function() { 15 | return navigator.userAgent.match(/Opera Mini/i); 16 | }, 17 | Windows: function() { 18 | return navigator.userAgent.match(/IEMobile/i); 19 | }, 20 | any: function() { 21 | return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows()); 22 | } 23 | }; 24 | 25 | // Cache the Window object 26 | $window = $(window); 27 | 28 | $('section[data-type="background"]').each(function(){ 29 | var $bgobj = $(this); // assigning the object 30 | 31 | $(window).scroll(function() { 32 | 33 | // Scroll the background at var speed 34 | // the yPos is a negative value because we're scrolling it UP! 35 | var yPos = -($window.scrollTop() / $bgobj.data('speed')); 36 | 37 | // Put together our final background position 38 | var coords = '50% '+ yPos + 'px'; 39 | 40 | if (isMobile.any()) { 41 | //remove parallax 42 | var coords = ''; 43 | } 44 | 45 | 46 | 47 | // Move the background 48 | $bgobj.css({ backgroundPosition: coords }); 49 | 50 | }); // window scroll Ends 51 | 52 | }); 53 | 54 | }); 55 | -------------------------------------------------------------------------------- /site/js/retina.js: -------------------------------------------------------------------------------- 1 | // retina.js, a high-resolution image swapper (http://retinajs.com), v0.0.2 2 | 3 | (function(){function t(e){this.path=e;var t=this.path.split("."),n=t.slice(0,t.length-1).join("."),r=t[t.length-1];this.at_2x_path=n+"@2x."+r}function n(e){this.el=e,this.path=new t(this.el.getAttribute("src"));var n=this;this.path.check_2x_variant(function(e){e&&n.swap()})}var e=typeof exports=="undefined"?window:exports;e.RetinaImagePath=t,t.confirmed_paths=[],t.prototype.is_external=function(){return!!this.path.match(/^https?\:/i)&&!this.path.match("//"+document.domain)},t.prototype.check_2x_variant=function(e){var n,r=this;if(this.is_external())return e(!1);if(this.at_2x_path in t.confirmed_paths)return e(!0);n=new XMLHttpRequest,n.open("HEAD",this.at_2x_path),n.onreadystatechange=function(){return n.readyState!=4?e(!1):n.status>=200&&n.status<=399?(t.confirmed_paths.push(r.at_2x_path),e(!0)):e(!1)},n.send()},e.RetinaImage=n,n.prototype.swap=function(e){function n(){t.el.complete?(t.el.setAttribute("width",t.el.offsetWidth),t.el.setAttribute("height",t.el.offsetHeight),t.el.setAttribute("src",e)):setTimeout(n,5)}typeof e=="undefined"&&(e=this.path.at_2x_path);var t=this;n()},e.devicePixelRatio>1&&(window.onload=function(){var e=document.getElementsByTagName("img"),t=[],r,i;for(r=0;r<e.length;r++)i=e[r],t.push(new n(i))})})(); -------------------------------------------------------------------------------- /site/js/scrollTo.js: -------------------------------------------------------------------------------- 1 | !function ($) { 2 | $(function(){ 3 | 4 | 5 | //var position = p.position(); 6 | //$("#sidenav").position.top; 7 | //alert($("#sidenav").position().left); 8 | 9 | //side nav bar 10 | $('#sidenav').affix({ 11 | offset: { 12 | top: 100 13 | , bottom: 100 14 | } 15 | }) 16 | 17 | 18 | var $root = $('html, body'); 19 | 20 | // unique nav tag here for HOME PAGE 21 | $('a.scrollnav').click(function() { 22 | var href = $.attr(this, 'href'); 23 | $root.animate({ 24 | scrollTop: $(href).offset().top - 50 25 | }, 500, function () { 26 | window.location.hash = href; 27 | }); 28 | return false; 29 | }); 30 | 31 | // unique nav tag here for DOCUMENATION page 32 | $('a.scrollnavdocs').click(function() { 33 | var href = $.attr(this, 'href'); 34 | $root.animate({ 35 | scrollTop: $(href).offset().top - 100 36 | }, 500, function () { 37 | window.location.hash = href; 38 | }); 39 | return false; 40 | }); 41 | 42 | }) 43 | }(window.jQuery) 44 | 45 | -------------------------------------------------------------------------------- /site/js/source-code.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | var dl = $("#source-toc > dl"); 3 | var showButton = $("#source-toc-show"); 4 | var hideButton = $("#source-toc-hide"); 5 | $("#source-toc header").click(function () { 6 | console.log("click"); 7 | if (dl.is(":visible")) { 8 | hideDl(); 9 | } else { 10 | showDl(); 11 | } 12 | }); 13 | function showDl() { 14 | dl.show(); 15 | showButton.hide(); 16 | hideButton.show(); 17 | localStorage.setItem("site.showing", "yes"); 18 | } 19 | function hideDl() { 20 | dl.hide(); 21 | showButton.show(); 22 | hideButton.hide(); 23 | localStorage.removeItem("site.showing"); 24 | } 25 | if (! localStorage.getItem("site.showing")) { 26 | hideDl(); 27 | } else { 28 | showDl(); 29 | } 30 | }); 31 | -------------------------------------------------------------------------------- /site/less/alerts.less: -------------------------------------------------------------------------------- 1 | // 2 | // Alerts 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base styles 7 | // ------------------------- 8 | 9 | .alert { 10 | padding: @alert-padding; 11 | margin-bottom: @line-height-computed; 12 | color: @alert-text; 13 | background-color: @alert-bg; 14 | border: 1px solid @alert-border; 15 | border-radius: @alert-border-radius; 16 | 17 | // Headings for larger alerts 18 | h4 { 19 | margin-top: 0; 20 | // Specified for the h4 to prevent conflicts of changing @headingsColor 21 | color: inherit; 22 | } 23 | // Match the hr to the border of the alert 24 | hr { 25 | border-top-color: darken(@alert-border, 5%); 26 | } 27 | // Provide class for links that match alerts 28 | .alert-link { 29 | font-weight: @alert-link-font-weight; 30 | color: darken(@alert-text, 10%); 31 | } 32 | 33 | // Improve alignment and spacing of inner content 34 | > p, 35 | > ul { 36 | margin-bottom: 0; 37 | } 38 | > p + p { 39 | margin-top: 5px; 40 | } 41 | } 42 | 43 | // Dismissable alerts 44 | // 45 | // Expand the right padding and account for the close button's positioning. 46 | 47 | .alert-dismissable { 48 | padding-right: (@alert-padding + 20); 49 | 50 | // Adjust close link position 51 | .close { 52 | position: relative; 53 | top: -2px; 54 | right: -21px; 55 | color: inherit; 56 | } 57 | } 58 | 59 | // Alternate styles 60 | // 61 | // Generate contextual modifier classes for colorizing the alert. 62 | 63 | .alert-success { 64 | .alert-variant(@alert-success-bg; @alert-success-border; @alert-success-text); 65 | } 66 | .alert-danger { 67 | .alert-variant(@alert-danger-bg; @alert-danger-border; @alert-danger-text); 68 | } 69 | .alert-info { 70 | .alert-variant(@alert-info-bg; @alert-info-border; @alert-info-text); 71 | } 72 | -------------------------------------------------------------------------------- /site/less/badges.less: -------------------------------------------------------------------------------- 1 | // 2 | // Badges 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base classes 7 | .badge { 8 | display: inline-block; 9 | min-width: 10px; 10 | padding: 3px 7px; 11 | font-size: @font-size-small; 12 | font-weight: @badge-font-weight; 13 | color: @badge-color; 14 | line-height: @badge-line-height; 15 | vertical-align: baseline; 16 | white-space: nowrap; 17 | text-align: center; 18 | background-color: @badge-bg; 19 | border-radius: @badge-border-radius; 20 | 21 | // Empty badges collapse automatically (not available in IE8) 22 | &:empty { 23 | display: none; 24 | } 25 | } 26 | 27 | // Hover state, but only for links 28 | a.badge { 29 | &:hover, 30 | &:focus { 31 | color: @badge-link-hover-color; 32 | text-decoration: none; 33 | cursor: pointer; 34 | } 35 | } 36 | 37 | // Quick fix for labels/badges in buttons 38 | .btn .badge { 39 | position: relative; 40 | top: -1px; 41 | } 42 | 43 | // Account for counters in navs 44 | a.list-group-item.active > .badge, 45 | .nav-pills > .active > a > .badge { 46 | color: @badge-active-color; 47 | background-color: @badge-active-bg; 48 | } 49 | .nav-pills > li > a > .badge { 50 | margin-left: 3px; 51 | } 52 | -------------------------------------------------------------------------------- /site/less/bootstrap.less: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v3.0.0 3 | * 4 | * Copyright 2013 Twitter, Inc 5 | * Licensed under the Apache License v2.0 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Designed and built with all the love in the world by @mdo and @fat. 9 | */ 10 | 11 | // Core variables and mixins 12 | @import "variables.less"; 13 | @import "mixins.less"; 14 | 15 | // Reset 16 | @import "normalize.less"; 17 | @import "print.less"; 18 | 19 | // Core CSS 20 | @import "scaffolding.less"; 21 | @import "type.less"; 22 | @import "code.less"; 23 | @import "grid.less"; 24 | 25 | @import "tables.less"; 26 | @import "forms.less"; 27 | @import "buttons.less"; 28 | 29 | // Components: common 30 | @import "component-animations.less"; 31 | @import "input-groups.less"; 32 | @import "dropdowns.less"; 33 | @import "list-group.less"; 34 | @import "panels.less"; 35 | @import "wells.less"; 36 | @import "close.less"; 37 | 38 | // Components: Nav 39 | @import "navs.less"; 40 | @import "navbar.less"; 41 | @import "button-groups.less"; 42 | @import "breadcrumbs.less"; 43 | @import "pagination.less"; 44 | @import "pager.less"; 45 | 46 | // Components: Popovers 47 | @import "modals.less"; 48 | @import "tooltip.less"; 49 | @import "popovers.less"; 50 | 51 | // Components: Misc 52 | @import "alerts.less"; 53 | @import "thumbnails.less"; 54 | @import "media.less"; 55 | @import "labels.less"; 56 | @import "badges.less"; 57 | @import "progress-bars.less"; 58 | @import "carousel.less"; 59 | @import "jumbotron.less"; 60 | 61 | // Utility classes 62 | @import "utilities.less"; // Has to be last to override when necessary 63 | @import "responsive-utilities.less"; 64 | -------------------------------------------------------------------------------- /site/less/breadcrumbs.less: -------------------------------------------------------------------------------- 1 | // 2 | // Breadcrumbs 3 | // -------------------------------------------------- 4 | 5 | 6 | .breadcrumb { 7 | padding: 8px 15px; 8 | margin-bottom: @line-height-computed; 9 | list-style: none; 10 | background-color: @breadcrumb-bg; 11 | border-radius: @border-radius-base; 12 | > li { 13 | display: inline-block; 14 | &+li:before { 15 | content: "/\00a0"; // Unicode space added since inline-block means non-collapsing white-space 16 | padding: 0 5px; 17 | color: @breadcrumb-color; 18 | } 19 | } 20 | > .active { 21 | color: @breadcrumb-active-color; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /site/less/close.less: -------------------------------------------------------------------------------- 1 | // 2 | // Close icons 3 | // -------------------------------------------------- 4 | 5 | 6 | .close { 7 | float: right; 8 | font-size: (@font-size-base * 1.5); 9 | font-weight: @close-font-weight; 10 | line-height: 1; 11 | color: @close-color; 12 | text-shadow: @close-text-shadow; 13 | .opacity(.2); 14 | 15 | &:hover, 16 | &:focus { 17 | color: @close-color; 18 | text-decoration: none; 19 | cursor: pointer; 20 | .opacity(.5); 21 | } 22 | 23 | // Additional properties for button version 24 | // iOS requires the button element instead of an anchor tag. 25 | // If you want the anchor version, it requires `href="#"`. 26 | button& { 27 | padding: 0; 28 | cursor: pointer; 29 | background: transparent; 30 | border: 0; 31 | -webkit-appearance: none; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /site/less/code.less: -------------------------------------------------------------------------------- 1 | // 2 | // Code (inline and blocK) 3 | // -------------------------------------------------- 4 | 5 | 6 | // Inline and block code styles 7 | code, 8 | pre { 9 | font-family: @font-family-monospace; 10 | } 11 | 12 | // Inline code 13 | code { 14 | padding: 2px 4px; 15 | font-size: 90%; 16 | color: @code-color; 17 | background-color: @code-bg; 18 | white-space: nowrap; 19 | border-radius: @border-radius-base; 20 | } 21 | 22 | // Blocks of code 23 | pre { 24 | display: block; 25 | padding: ((@line-height-computed - 1) / 2); 26 | margin: 0 0 (@line-height-computed / 2); 27 | font-size: (@font-size-base - 1); // 14px to 13px 28 | line-height: @line-height-base; 29 | word-break: break-all; 30 | word-wrap: break-word; 31 | color: @pre-color; 32 | background-color: @pre-bg; 33 | border: 1px solid @pre-border-color; 34 | border-radius: @border-radius-base; 35 | 36 | // Make prettyprint styles more spaced out for readability 37 | &.prettyprint { 38 | margin-bottom: @line-height-computed; 39 | } 40 | 41 | // Account for some code outputs that place code tags in pre tags 42 | code { 43 | padding: 0; 44 | font-size: inherit; 45 | color: inherit; 46 | white-space: pre-wrap; 47 | background-color: transparent; 48 | border: 0; 49 | } 50 | } 51 | 52 | // Enable scrollable blocks of code 53 | .pre-scrollable { 54 | max-height: @pre-scrollable-max-height; 55 | overflow-y: scroll; 56 | } 57 | -------------------------------------------------------------------------------- /site/less/component-animations.less: -------------------------------------------------------------------------------- 1 | // 2 | // Component animations 3 | // -------------------------------------------------- 4 | 5 | // Heads up! 6 | // 7 | // We don't use the `.opacity()` mixin here since it causes a bug with text 8 | // fields in IE7-8. Source: https://github.com/twitter/bootstrap/pull/3552. 9 | 10 | .fade { 11 | opacity: 0; 12 | .transition(opacity .15s linear); 13 | &.in { 14 | opacity: 1; 15 | } 16 | } 17 | 18 | .collapse { 19 | display: none; 20 | &.in { 21 | display: block; 22 | } 23 | } 24 | .collapsing { 25 | position: relative; 26 | height: 0; 27 | overflow: hidden; 28 | .transition(height .35s ease); 29 | } 30 | -------------------------------------------------------------------------------- /site/less/jumbotron.less: -------------------------------------------------------------------------------- 1 | // 2 | // Jumbotron 3 | // -------------------------------------------------- 4 | 5 | 6 | .jumbotron { 7 | padding: 30px; 8 | margin-bottom: 30px; 9 | font-size: (@font-size-base * 1.5); 10 | font-weight: 200; 11 | line-height: (@line-height-base * 1.5); 12 | color: @jumbotron-lead-color; 13 | background-color: @jumbotron-bg; 14 | h1 { 15 | line-height: 1; 16 | color: @jumbotron-heading-color; 17 | } 18 | p { 19 | line-height: 1.4; 20 | } 21 | 22 | @media screen and (min-width: @screen-tablet) { 23 | padding: 50px 60px; 24 | border-radius: @border-radius-large; // Only round corners at higher resolutions 25 | h1 { 26 | font-size: (@font-size-base * 4.5); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /site/less/labels.less: -------------------------------------------------------------------------------- 1 | // 2 | // Labels 3 | // -------------------------------------------------- 4 | 5 | .label { 6 | display: inline; 7 | padding: .25em .6em; 8 | font-size: 75%; 9 | font-weight: bold; 10 | line-height: 1; 11 | color: @label-color; 12 | text-align: center; 13 | white-space: nowrap; 14 | vertical-align: baseline; 15 | border-radius: .25em; 16 | 17 | // Add hover effects, but only for links 18 | &[href] { 19 | &:hover, 20 | &:focus { 21 | color: @label-link-hover-color; 22 | text-decoration: none; 23 | cursor: pointer; 24 | } 25 | } 26 | 27 | // Empty labels collapse automatically (not available in IE8) 28 | &:empty { 29 | display: none; 30 | } 31 | } 32 | 33 | // Colors 34 | // Contextual variations (linked labels get darker on :hover) 35 | 36 | .label-default { 37 | .label-variant(@label-default-bg); 38 | } 39 | 40 | .label-primary { 41 | .label-variant(@label-primary-bg); 42 | } 43 | 44 | .label-success { 45 | .label-variant(@label-success-bg); 46 | } 47 | 48 | .label-info { 49 | .label-variant(@label-info-bg); 50 | } 51 | 52 | .label-warning { 53 | .label-variant(@label-warning-bg); 54 | } 55 | 56 | .label-danger { 57 | .label-variant(@label-danger-bg); 58 | } 59 | -------------------------------------------------------------------------------- /site/less/media.less: -------------------------------------------------------------------------------- 1 | // Media objects 2 | // Source: http://stubbornella.org/content/?p=497 3 | // -------------------------------------------------- 4 | 5 | 6 | // Common styles 7 | // ------------------------- 8 | 9 | // Clear the floats 10 | .media, 11 | .media-body { 12 | overflow: hidden; 13 | zoom: 1; 14 | } 15 | 16 | // Proper spacing between instances of .media 17 | .media, 18 | .media .media { 19 | margin-top: 15px; 20 | } 21 | .media:first-child { 22 | margin-top: 0; 23 | } 24 | 25 | // For images and videos, set to block 26 | .media-object { 27 | display: block; 28 | } 29 | 30 | // Reset margins on headings for tighter default spacing 31 | .media-heading { 32 | margin: 0 0 5px; 33 | } 34 | 35 | 36 | // Media image alignment 37 | // ------------------------- 38 | 39 | .media { 40 | > .pull-left { 41 | margin-right: 10px; 42 | } 43 | > .pull-right { 44 | margin-left: 10px; 45 | } 46 | } 47 | 48 | 49 | // Media list variation 50 | // ------------------------- 51 | 52 | // Undo default ul/ol styles 53 | .media-list { 54 | padding-left: 0; 55 | list-style: none; 56 | } 57 | -------------------------------------------------------------------------------- /site/less/pager.less: -------------------------------------------------------------------------------- 1 | // 2 | // Pager pagination 3 | // -------------------------------------------------- 4 | 5 | 6 | .pager { 7 | padding-left: 0; 8 | margin: @line-height-computed 0; 9 | list-style: none; 10 | text-align: center; 11 | .clearfix(); 12 | li { 13 | display: inline; 14 | > a, 15 | > span { 16 | display: inline-block; 17 | padding: 5px 14px; 18 | background-color: @pagination-bg; 19 | border: 1px solid @pagination-border; 20 | border-radius: @pager-border-radius; 21 | } 22 | 23 | > a:hover, 24 | > a:focus { 25 | text-decoration: none; 26 | background-color: @pagination-active-bg; 27 | } 28 | } 29 | 30 | .next { 31 | > a, 32 | > span { 33 | float: right; 34 | } 35 | } 36 | 37 | .previous { 38 | > a, 39 | > span { 40 | float: left; 41 | } 42 | } 43 | 44 | .disabled { 45 | > a, 46 | > a:hover, 47 | > a:focus, 48 | > span { 49 | color: @pager-disabled-color; 50 | background-color: @pagination-bg; 51 | cursor: not-allowed; 52 | } 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /site/less/retina.less: -------------------------------------------------------------------------------- 1 | // retina.less 2 | // A helper mixin for applying high-resolution background images (http://www.retinajs.com) 3 | 4 | .at2x(@path, @w: auto, @h: auto) { 5 | background-image: url(@path); 6 | @at2x_path: ~`"@{path}".split('.').slice(0, "@{path}".split('.').length - 1).join(".") + "@2x" + "." + "@{path}".split('.')["@{path}".split('.').length - 1]`; 7 | 8 | @media all and (-webkit-min-device-pixel-ratio : 1.5) { 9 | background-image: url(@at2x_path); 10 | background-size: @w @h; 11 | } 12 | } -------------------------------------------------------------------------------- /site/less/thumbnails.less: -------------------------------------------------------------------------------- 1 | // 2 | // Thumbnails 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base classes 7 | // For thumbnail block-level composite components and simple image styles 8 | 9 | // The actual thumbnailed element 10 | // Can be `a`, `div`, or `img` 11 | .thumbnail, 12 | .img-thumbnail { 13 | padding: @thumbnail-padding; 14 | line-height: @line-height-base; 15 | background-color: @thumbnail-bg; 16 | border: 1px solid @thumbnail-border; 17 | border-radius: @thumbnail-border-radius; 18 | .transition(all .2s ease-in-out); 19 | } 20 | .thumbnail { 21 | display: block; 22 | } 23 | .thumbnail > img { 24 | .img-responsive(); 25 | } 26 | .img-thumbnail { 27 | .img-responsive(inline-block); 28 | } 29 | 30 | // Add a hover state for linked versions only 31 | a.thumbnail:hover, 32 | a.thumbnail:focus { 33 | border-color: @link-color; 34 | } 35 | 36 | // Images and captions 37 | .thumbnail > img { 38 | margin-left: auto; 39 | margin-right: auto; 40 | } 41 | .thumbnail .caption { 42 | padding: @thumbnail-caption-padding; 43 | color: @thumbnail-caption-color; 44 | } 45 | -------------------------------------------------------------------------------- /site/less/utilities.less: -------------------------------------------------------------------------------- 1 | // 2 | // Utility classes 3 | // -------------------------------------------------- 4 | 5 | 6 | // Floats 7 | // ------------------------- 8 | 9 | .clearfix { 10 | .clearfix(); 11 | } 12 | .pull-right { 13 | float: right !important; 14 | } 15 | .pull-left { 16 | float: left !important; 17 | } 18 | 19 | 20 | // Toggling content 21 | // ------------------------- 22 | 23 | .hide { 24 | display: none !important; 25 | } 26 | .show { 27 | display: block !important; 28 | } 29 | .invisible { 30 | visibility: hidden; 31 | } 32 | .text-hide { 33 | .hide-text(); 34 | } 35 | 36 | 37 | // For Affix plugin 38 | // ------------------------- 39 | 40 | .affix { 41 | position: fixed; 42 | } 43 | -------------------------------------------------------------------------------- /site/less/wells.less: -------------------------------------------------------------------------------- 1 | // 2 | // Wells 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | .well { 8 | min-height: 20px; 9 | padding: 19px; 10 | margin-bottom: 20px; 11 | background-color: @well-bg; 12 | border: 1px solid darken(@well-bg, 7%); 13 | border-radius: @border-radius-base; 14 | .box-shadow(inset 0 1px 1px rgba(0,0,0,.05)); 15 | blockquote { 16 | border-color: #ddd; 17 | border-color: rgba(0,0,0,.15); 18 | } 19 | } 20 | 21 | // Sizes 22 | .well-lg { 23 | padding: 24px; 24 | border-radius: @border-radius-large; 25 | } 26 | .well-sm { 27 | padding: 9px; 28 | border-radius: @border-radius-small; 29 | } 30 | -------------------------------------------------------------------------------- /site/source-code-index.tmpl: -------------------------------------------------------------------------------- 1 | {% extends "base.tmpl" %} 2 | {% block styles %} 3 | <link rel="stylesheet" href="{{ base }}css/docco.css"> 4 | <script src="{{ base }}js/source-code.js"></script> 5 | {% endblock %} 6 | {% block body %} 7 | 8 | <div class="container"> 9 | 10 | <section class="row" id="sourcecode"> 11 | 12 | <div class="col-md-3" id="source-toc"> 13 | <div class="panel" role="complementary" data-spy="affix" data-offset-top="200" id="sidenav"> 14 | <div class="panel-heading">Source Code</div> 15 | <ul class="nav" id="sectionmenu"> 16 | {% for source in sourceList %} 17 | <li><a href="{{ source.link }}">{{ source.name }}</a></li> 18 | {% endfor %} 19 | </ul> 20 | <div class="well"> 21 | <button type="button" class="btn btn-primary btn-lg btn-block"> 22 | Get help 23 | </button> 24 | <div class="small text-center">Get support from the TogetherJS team.</div> 25 | </div> 26 | </div> 27 | </div> 28 | 29 | <div class="col-md-9" id="source-content"> 30 | <h1>TogetherJS Source Code</h1> 31 | 32 | <dl> 33 | {% for source in sourceList %} 34 | <dt><code><a href="{{ source.link }}">{{ source.name }}</a></code></dt> 35 | <dd>{{ source.description }}</dd> 36 | {% endfor %} 37 | </dl> 38 | 39 | <div class="small"><a href="https://github.com/mozilla/togetherjs/">See all files on Github</a></div> 40 | </div> 41 | </section> 42 | 43 | {% endblock %} 44 | -------------------------------------------------------------------------------- /site/source-code.tmpl: -------------------------------------------------------------------------------- 1 | {% extends "base.tmpl" %} 2 | {% block styles %} 3 | <link rel="stylesheet" href="{{ base }}css/docco.css"> 4 | <script src="{{ base }}js/source-code.js"></script> 5 | {% endblock %} 6 | {% block body %} 7 | 8 | <div class="container"> 9 | 10 | <section class="row" id="sourcecode"> 11 | <div class="col-md-3" id="source-toc"> 12 | <div class="panel" role="complementary" data-spy="affix" data-offset-top="200" id="sidenav"> 13 | <div class="panel-heading">Source Code</div> 14 | <ul class="nav" id="sectionmenu"> 15 | {% for source in sourceList %} 16 | <li><a href="{{ source.link }}">{{ source.name }}</a></li> 17 | {% endfor %} 18 | </ul> 19 | </div> 20 | </div> 21 | 22 | <div class="col-md-9" id="source-content"> 23 | <h1>{{ source }}</h1> 24 | {% if sourceDescription %} 25 | <h4>{{ sourceDescription }}</h4> 26 | {% endif %} 27 | 28 | <div class="small"><a href="https://github.com/mozilla/togetherjs/blob/develop/togetherjs/{{ source }}">See this file on Github</a></div> 29 | 30 | <ul class="sections"> 31 | {% for section in sections %} 32 | <li id="section-{{ section.index }}"> 33 | <div class="annotation"> 34 | <div class="pilwrap"> 35 | <a class="pilcrow" href="#section-{{ section.index }}">¶</a> 36 | </div> 37 | {{ section.docsHtml }} 38 | </div> 39 | {% if section.empty %} 40 | {% else %} 41 | <div class="content">{{ section.codeHtml }}</div> 42 | {% endif %} 43 | </li> 44 | {% endfor %} 45 | </ul> 46 | </div> 47 | </section> 48 | 49 | 50 | 51 | {% endblock %} 52 | -------------------------------------------------------------------------------- /site/the-developers/index.html: -------------------------------------------------------------------------------- 1 | <!DOCTYPE html> 2 | <html> 3 | <head> 4 | <meta charset="UTF-8"> 5 | <title>The Developer's hangout 6 | 7 | 8 | 13 | 14 | 15 | 16 | 17 | 18 |

      19 | Now just hang out and wait... 20 | 21 |

      22 | 23 |
      24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /site/the-developers/the-developers.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: sans-serif; 3 | height: 100%; 4 | } 5 | 6 | #chat { 7 | height: 90%; 8 | } 9 | 10 | #input { 11 | width: 100%; 12 | } 13 | -------------------------------------------------------------------------------- /site/the-developers/the-developers.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | 3 | TogetherJS.hub.on("togetherjs.invite", function (msg) { 4 | var div = $("
      "); 5 | div.text("Invite from: " + msg.userInfo.name + " at " + (new Date()) + " "); 6 | div.append($("").attr("href", msg.url).text(msg.url)); 7 | $("#record").append(div); 8 | }); 9 | 10 | }); 11 | -------------------------------------------------------------------------------- /togetherjs/analytics.js: -------------------------------------------------------------------------------- 1 | define(["util"], function (util) { 2 | var analytics = util.Module("analytics"); 3 | 4 | analytics.activate = function () { 5 | var enable = TogetherJS.config.get("enableAnalytics"); 6 | var code = TogetherJS.config.get("analyticsCode"); 7 | TogetherJS.config.close("enableAnalytics"); 8 | TogetherJS.config.close("analyticsCode"); 9 | if (! (enable && code)) { 10 | return; 11 | } 12 | // This is intended to be global: 13 | var gaq = window._gaq || []; 14 | gaq.push(["_setAccount", code]); 15 | gaq.push(['_setDomainName', location.hostname]); 16 | gaq.push(["_trackPageview"]); 17 | window._gaq = gaq; 18 | 19 | (function() { 20 | var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; 21 | ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; 22 | var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); 23 | })(); 24 | }; 25 | 26 | return analytics; 27 | }); 28 | -------------------------------------------------------------------------------- /togetherjs/eventMaker.js: -------------------------------------------------------------------------------- 1 | /* This Source Code Form is subject to the terms of the Mozilla Public 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | * You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 | 5 | define(["jquery", "util"], function ($, util) { 6 | var eventMaker = util.Module("eventMaker"); 7 | 8 | eventMaker.performClick = function (target) { 9 | // FIXME: should accept other parameters, like Ctrl/Alt/etc 10 | var event = document.createEvent("MouseEvents"); 11 | event.initMouseEvent( 12 | "click", // type 13 | true, // canBubble 14 | true, // cancelable 15 | window, // view 16 | 0, // detail 17 | 0, // screenX 18 | 0, // screenY 19 | 0, // clientX 20 | 0, // clientY 21 | false, // ctrlKey 22 | false, // altKey 23 | false, // shiftKey 24 | false, // metaKey 25 | 0, // button 26 | null // relatedTarget 27 | ); 28 | // FIXME: I'm not sure this custom attribute always propagates? 29 | // seems okay in Firefox/Chrome, but I've had problems with 30 | // setting attributes on keyboard events in the past. 31 | event.togetherjsInternal = true; 32 | target = $(target)[0]; 33 | var cancelled = target.dispatchEvent(event); 34 | if (cancelled) { 35 | return; 36 | } 37 | if (target.tagName == "A") { 38 | var href = target.href; 39 | if (href) { 40 | location.href = href; 41 | return; 42 | } 43 | } 44 | // FIXME: should do button clicks (like a form submit) 45 | // FIXME: should run .onclick() as well 46 | }; 47 | 48 | eventMaker.fireChange = function (target) { 49 | target = $(target)[0]; 50 | var event = document.createEvent("HTMLEvents"); 51 | event.initEvent("change", true, true); 52 | target.dispatchEvent(event); 53 | }; 54 | 55 | return eventMaker; 56 | }); 57 | -------------------------------------------------------------------------------- /togetherjs/fonts/OpenSans-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/togetherjs/fonts/OpenSans-Bold.ttf -------------------------------------------------------------------------------- /togetherjs/fonts/OpenSans-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/togetherjs/fonts/OpenSans-Light.ttf -------------------------------------------------------------------------------- /togetherjs/fonts/OpenSans-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/togetherjs/fonts/OpenSans-Regular.ttf -------------------------------------------------------------------------------- /togetherjs/functions.less: -------------------------------------------------------------------------------- 1 | .transition (@val) { 2 | /* Note, you must call this like: 3 | .transition(~"value, value, value")*/ 4 | transition: @val; 5 | -moz-transition: @val; 6 | -webkit-transition: @val; 7 | -o-transition: @val; 8 | } 9 | 10 | .transform-origin (...) { 11 | -moz-transform-origin: @arguments; 12 | -webkit-transform-origin: @arguments; 13 | -ms-transform-origin: @arguments; 14 | -o-transform-origin: @arguments; 15 | transform-origin: @arguments; 16 | } 17 | 18 | .user-select (@value) { 19 | -moz-user-select: @value; 20 | -webkit-user-select: @value; 21 | -ms-user-select: @value; 22 | user-select: @value; 23 | } 24 | 25 | // The CSS reset doesn't reset everything, just resets them to normal. 26 | // This resets buttons back to nothing. 27 | .button-reset () { 28 | background-color: inherit; 29 | border: none; 30 | padding: 0; 31 | margin: 0; 32 | } 33 | 34 | .gradient (@startColor, @endColor) { 35 | background: @startColor; /* Old browsers */ 36 | background: -moz-linear-gradient(top, @startColor 0%, @endColor 100%); /* FF3.6+ */ 37 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, @startColor), color-stop(100%, @endColor)); /* Chrome,Safari4+ */ 38 | background: -webkit-linear-gradient(top, @startColor 0%, @endColor 100%); /* Chrome10+,Safari5.1+ */ 39 | background: -o-linear-gradient(top, @startColor 0%, @endColor 100%); /* Opera 11.10+ */ 40 | background: -ms-linear-gradient(top, @startColor 0%, @endColor 100%); /* IE10+ */ 41 | background: linear-gradient(to bottom, @startColor 0%, @endColor 100%); /* W3C */ 42 | // Not sure we can do this in LESS 43 | // filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='@startColor', endColorstr='@endColor',GradientType=0 ); /* IE6-9 */ 44 | } 45 | -------------------------------------------------------------------------------- /togetherjs/help.txt: -------------------------------------------------------------------------------- 1 | <% /* 2 | This is used to show the help when you type /help. Used in 3 | TogetherJS.localChatMessage(). 4 | 5 | */ %> 6 | /help : this message 7 | /test : run an automated/randomized test (or stop one that is in progress) 8 | /test start N : run N times (instead of default 100) 9 | /test show : show what kind of actions the random test would take (or stop showing) 10 | /test describe : describe the possible actions (instead of showing them) 11 | /clear : clear the chat area 12 | /record : open up a recorder for the session 13 | /playback URL : play back a session that was recorded (it's up to you to figure out how to host it) 14 | /playback local:NAME : play a locally saved log 15 | /savelogs NAME : save the currently recorded logs under NAME (recorder must be open) 16 | /baseurl : set a local baseUrl to load TogetherJS from, for debugging a development version of TogetherJS. 17 | /config : override some TogetherJS configuration parameters 18 | /config VAR VALUE : set TogetherJS.config("VAR", VALUE). VALUE must be a legal Javascript/JSON literal. 19 | /config clear : remove all overridden configuration 20 | -------------------------------------------------------------------------------- /togetherjs/images/btn-menu-change-avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/togetherjs/images/btn-menu-change-avatar.png -------------------------------------------------------------------------------- /togetherjs/images/button-chat-active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/togetherjs/images/button-chat-active.png -------------------------------------------------------------------------------- /togetherjs/images/button-chat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/togetherjs/images/button-chat.png -------------------------------------------------------------------------------- /togetherjs/images/button-end-session.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/togetherjs/images/button-end-session.png -------------------------------------------------------------------------------- /togetherjs/images/button-mic-active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/togetherjs/images/button-mic-active.png -------------------------------------------------------------------------------- /togetherjs/images/button-mic-inactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/togetherjs/images/button-mic-inactive.png -------------------------------------------------------------------------------- /togetherjs/images/button-mic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/togetherjs/images/button-mic.png -------------------------------------------------------------------------------- /togetherjs/images/button-pencil.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/togetherjs/images/button-pencil.png -------------------------------------------------------------------------------- /togetherjs/images/button-share-active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/togetherjs/images/button-share-active.png -------------------------------------------------------------------------------- /togetherjs/images/button-share-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/togetherjs/images/button-share-hover.png -------------------------------------------------------------------------------- /togetherjs/images/button-share.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/togetherjs/images/button-share.png -------------------------------------------------------------------------------- /togetherjs/images/connect-logo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/togetherjs/images/connect-logo@2x.png -------------------------------------------------------------------------------- /togetherjs/images/cursor-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/togetherjs/images/cursor-white.png -------------------------------------------------------------------------------- /togetherjs/images/cursor.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 11 | 12 | -------------------------------------------------------------------------------- /togetherjs/images/default-avatar-waiting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/togetherjs/images/default-avatar-waiting.png -------------------------------------------------------------------------------- /togetherjs/images/default-avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/togetherjs/images/default-avatar.png -------------------------------------------------------------------------------- /togetherjs/images/icn-arrow-up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/togetherjs/images/icn-arrow-up.png -------------------------------------------------------------------------------- /togetherjs/images/icn-gear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/togetherjs/images/icn-gear.png -------------------------------------------------------------------------------- /togetherjs/images/icn-handle-circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/togetherjs/images/icn-handle-circle.png -------------------------------------------------------------------------------- /togetherjs/images/icn-handle-circle@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/togetherjs/images/icn-handle-circle@2x.png -------------------------------------------------------------------------------- /togetherjs/images/icn-triangle-up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/togetherjs/images/icn-triangle-up.png -------------------------------------------------------------------------------- /togetherjs/images/icn-walkthrough-arrow-l-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/togetherjs/images/icn-walkthrough-arrow-l-hover.png -------------------------------------------------------------------------------- /togetherjs/images/icn-walkthrough-arrow-l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/togetherjs/images/icn-walkthrough-arrow-l.png -------------------------------------------------------------------------------- /togetherjs/images/icn-walkthrough-arrow-r-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/togetherjs/images/icn-walkthrough-arrow-r-hover.png -------------------------------------------------------------------------------- /togetherjs/images/icn-walkthrough-arrow-r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/togetherjs/images/icn-walkthrough-arrow-r.png -------------------------------------------------------------------------------- /togetherjs/images/icon-close-active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/togetherjs/images/icon-close-active.png -------------------------------------------------------------------------------- /togetherjs/images/icon-close-active@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/togetherjs/images/icon-close-active@2x.png -------------------------------------------------------------------------------- /togetherjs/images/icon-close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/togetherjs/images/icon-close.png -------------------------------------------------------------------------------- /togetherjs/images/icon-close@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/togetherjs/images/icon-close@2x.png -------------------------------------------------------------------------------- /togetherjs/images/icon-profile-triangle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/togetherjs/images/icon-profile-triangle.png -------------------------------------------------------------------------------- /togetherjs/images/notification-btn-close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/togetherjs/images/notification-btn-close.png -------------------------------------------------------------------------------- /togetherjs/images/notification-btn-close@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/togetherjs/images/notification-btn-close@2x.png -------------------------------------------------------------------------------- /togetherjs/images/notification-togetherjs-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/togetherjs/images/notification-togetherjs-logo.png -------------------------------------------------------------------------------- /togetherjs/images/notification.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/togetherjs/images/notification.ogg -------------------------------------------------------------------------------- /togetherjs/images/robot-avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/togetherjs/images/robot-avatar.png -------------------------------------------------------------------------------- /togetherjs/images/togetherjs-logo-close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/togetherjs/images/togetherjs-logo-close.png -------------------------------------------------------------------------------- /togetherjs/images/togetherjs-logo-open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/togetherjs/images/togetherjs-logo-open.png -------------------------------------------------------------------------------- /togetherjs/images/walkthrough-images-chat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/togetherjs/images/walkthrough-images-chat.png -------------------------------------------------------------------------------- /togetherjs/images/walkthrough-images-intro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/togetherjs/images/walkthrough-images-intro.png -------------------------------------------------------------------------------- /togetherjs/images/walkthrough-images-invite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/togetherjs/images/walkthrough-images-invite.png -------------------------------------------------------------------------------- /togetherjs/images/walkthrough-images-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/togetherjs/images/walkthrough-images-logo.png -------------------------------------------------------------------------------- /togetherjs/images/walkthrough-images-participant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/togetherjs/images/walkthrough-images-participant.png -------------------------------------------------------------------------------- /togetherjs/images/walkthrough-images-profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/togetherjs/images/walkthrough-images-profile.png -------------------------------------------------------------------------------- /togetherjs/images/walkthrough-images-rtc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/togetherjs/images/walkthrough-images-rtc.png -------------------------------------------------------------------------------- /togetherjs/libs/walkabout/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | walkabout.js: automated randomized Javascript frontend testing 5 | 6 | 13 | 27 | 28 | 29 | 30 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /togetherjs/libs/walkabout/test_overlap.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Walkabout tests 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
      14 |
      
      15 |     
      16 | 17 |
      18 | 19 | 20 | 21 |
      goes under
      22 | 23 |
      24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /togetherjs/libs/walkabout/test_overlap.js: -------------------------------------------------------------------------------- 1 | var fixture = document.getElementById("fixture"); 2 | var modal = document.getElementById("modal"); 3 | var underlay = document.getElementById("underlay"); 4 | 5 | Walkabout.addEventListener(underlay, function (event) { 6 | print("clicked"); 7 | }, false); 8 | 9 | function show(el) { 10 | el.style.display = ""; 11 | } 12 | 13 | function hide(el) { 14 | el.style.display = "none"; 15 | } 16 | 17 | print(Walkabout.visible(modal)); 18 | print(Walkabout.visible(underlay)); 19 | print(Walkabout.clickable(underlay)); 20 | hide(modal); 21 | print(Walkabout.visible(modal)); 22 | show(modal); 23 | 24 | /* => 25 | true 26 | true 27 | true 28 | false 29 | */ 30 | 31 | hide(underlay); 32 | print(Walkabout.clickable(underlay)); 33 | show(underlay); 34 | 35 | // => false 36 | 37 | modal.style.position = "absolute"; 38 | modal.style.width = "100px"; 39 | modal.style.height = "100px"; 40 | modal.style.top = "0px"; 41 | modal.style.right = "0px"; 42 | modal.style.zIndex = 10; 43 | underlay.style.position = "absolute"; 44 | underlay.style.width = "90px"; 45 | underlay.style.height = "90px"; 46 | underlay.style.top = "5px"; 47 | underlay.style.right = "5px"; 48 | underlay.style.zIndex = 5; 49 | 50 | print(getComputedStyle(modal).getPropertyValue("position")); 51 | 52 | // => absolute 53 | 54 | var rect = modal.getBoundingClientRect(); 55 | 56 | print(rect.bottom, rect.top, rect.height); 57 | print(rect.left, rect.right, rect.width); 58 | 59 | /* => 60 | 100 0 100 61 | ? ? 100 62 | */ 63 | 64 | print(Walkabout.clickable(underlay)); 65 | 66 | // => false 67 | 68 | underlay.style.zIndex = 15; 69 | print(Walkabout.clickable(underlay)); 70 | 71 | // => true 72 | 73 | underlay.style.zIndex = 5; 74 | underlay.style.right = "20px"; 75 | print(Walkabout.clickable(underlay)); 76 | 77 | // => true 78 | -------------------------------------------------------------------------------- /togetherjs/libs/walkabout/test_walkabout.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Walkabout tests 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
      15 |
      
      16 |     
      17 | 18 |
      19 | 20 | 21 | link 22 |
        23 |
      • an item 1
      • 24 |
      • an item 2
      • 25 |
      26 |
      
      27 |     
      28 | 29 |
      30 | 32 |
      33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /togetherjs/libs/walkabout/test_walkabout_nojquery.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Walkabout tests 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
      16 |
      
      17 |     
      18 | 19 |
      20 | 21 | 22 | link 23 |
        24 |
      • an item 1
      • 25 |
      • an item 2
      • 26 |
      27 |
      
      28 |     
      29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /togetherjs/libs/whrandom/random.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | 3 | function RandomStream(seed) { 4 | if (! seed) { 5 | seed = Date.now(); 6 | } 7 | if (typeof seed != "number") { 8 | seed = parseInt(seed, 10); 9 | } 10 | if ((! seed) || isNaN(seed)) { 11 | throw "Bad seed"; 12 | } 13 | var x = (seed % 30268) + 1; 14 | seed = (seed - (seed % 30268)) / 30268; 15 | var y = (seed % 30306) + 1; 16 | seed = (seed - (seed % 30306)) / 30306; 17 | var z = (seed % 30322) + 1; 18 | seed = (seed - (seed % 30322)) / 30322; 19 | return function random() { 20 | x = (171 * x) % 30269; 21 | y = (172 * y) % 30307; 22 | z = (170 * z) % 30323; 23 | if (random.logState) { 24 | console.log('x', x, 'y', y, 'z', z); 25 | } 26 | return (x / 30269.0 + y / 30307.0 + z / 30323.0) % 1.0; 27 | }; 28 | } 29 | 30 | // Support for AMD/requirejs, CommonJS/Node, and no module system: 31 | if (typeof define != "undefined") { 32 | define([], function () {return RandomStream;}); 33 | } else if (typeof module != "undefined") { 34 | module.exports = RandomStream; 35 | } else { 36 | window.WHRandomStream = RandomStream; 37 | } 38 | 39 | })(); 40 | -------------------------------------------------------------------------------- /togetherjs/libs/whrandom/test_random.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Test RandomStream 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

      Tests will run automatically:

      14 | 15 |
      16 |     
      17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /togetherjs/recorder.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | TogetherJS recorder 6 | 9 | 10 | 25 | 26 | 27 | 28 | 29 | 30 |
      31 | Not Connected 32 | 33 | 34 | 35 | 36 |
      37 | 38 |
      39 | 42 |
      43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /togetherjs/recorder.less: -------------------------------------------------------------------------------- 1 | /* This Source Code Form is subject to the terms of the Mozilla Public 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | * You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 | 5 | body { 6 | font-family: sans-serif; 7 | } 8 | 9 | #record { 10 | width: 100%; 11 | height: 80%; 12 | } 13 | 14 | #connected { 15 | font-weight: bold; 16 | color: #090; 17 | } 18 | 19 | #not-connected { 20 | color: #900; 21 | } 22 | -------------------------------------------------------------------------------- /togetherjs/templates-localized.js: -------------------------------------------------------------------------------- 1 | /* This Source Code Form is subject to the terms of the Mozilla Public 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | * You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 | 5 | define([], function () { 6 | return { 7 | "interface": "__interface_html__", 8 | walkthrough: "__walkthrough_html__", 9 | names: "__names__" 10 | }; 11 | }); 12 | -------------------------------------------------------------------------------- /togetherjs/templates.js: -------------------------------------------------------------------------------- 1 | /* This Source Code Form is subject to the terms of the Mozilla Public 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | * You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 | 5 | // FIXME: maybe it would be better to dynamically assemble the first 6 | // argument to define() here to include the localized module: 7 | define(["util", "require"], function (util, require) { 8 | var assert = util.assert; 9 | 10 | function clean(t) { 11 | // Removes <% /* ... */ %> comments: 12 | t = t.replace(/[<][%]\s*\/\*[\S\s\r\n]*\*\/\s*[%][>]/, ""); 13 | t = util.trim(t); 14 | t = t.replace(/http:\/\/localhost:8080/g, TogetherJS.baseUrl); 15 | t = t.replace(/TOOL_NAME/g, 'TogetherJS'); 16 | t = t.replace(/SITE_NAME/g, '[site name]'); 17 | t = t.replace(/TOOL_SITE_LINK/g, 'TogetherJS'); 18 | return t; 19 | } 20 | 21 | var lang = TogetherJS.getConfig("lang") || "en-US"; 22 | var moduleName = "templates-" + lang; 23 | var templatesLang; 24 | require([moduleName], function (mod) { 25 | templatesLang = mod; 26 | }); 27 | 28 | return function (resourceName) { 29 | // Sometimes require([moduleName]) doesn't return even after the 30 | // module has been loaded, but this sync version of require() will 31 | // pick up the module in that case: 32 | if (! templatesLang) { 33 | try { 34 | templatesLang = require(moduleName); 35 | } catch (e) { 36 | console.warn("Error requiring module:", e); 37 | } 38 | } 39 | assert(templatesLang, "Templates not yet loaded"); 40 | return clean(templatesLang[resourceName]); 41 | }; 42 | 43 | }); 44 | -------------------------------------------------------------------------------- /togetherjs/tests/doctestjs/.gitignore: -------------------------------------------------------------------------------- 1 | .resources/_build 2 | -------------------------------------------------------------------------------- /togetherjs/tests/doctestjs/.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule ".resources/esprima"] 2 | path = .resources/esprima 3 | url = https://github.com/ariya/esprima.git 4 | -------------------------------------------------------------------------------- /togetherjs/tests/doctestjs/.hgignore: -------------------------------------------------------------------------------- 1 | syntax:glob 2 | .svn 3 | .hgsvn 4 | -------------------------------------------------------------------------------- /togetherjs/tests/doctestjs/.resources/CNAME: -------------------------------------------------------------------------------- 1 | doctestjs.org 2 | -------------------------------------------------------------------------------- /togetherjs/tests/doctestjs/.resources/boilerplate/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsfiddle/togetherjs/d0c4254d86a16f84c9a5f8fd29a477e2581e7416/togetherjs/tests/doctestjs/.resources/boilerplate/favicon.ico -------------------------------------------------------------------------------- /togetherjs/tests/doctestjs/.resources/boilerplate/js/main.js: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /togetherjs/tests/doctestjs/.resources/build: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -ex 4 | 5 | mv .resources/CNAME CNAME 6 | mv .resources resources 7 | 8 | echo "Updating files with template..." 9 | 10 | files="index.html tutorial.html reference.html try.html" 11 | 12 | python resources/retemplate.py $files 13 | for file in $files ; do 14 | sed -i '' 's/\.resources/resources/g' $file 15 | done 16 | -------------------------------------------------------------------------------- /togetherjs/tests/doctestjs/.resources/doc.css: -------------------------------------------------------------------------------- 1 | i, em { 2 | font-family: serif; 3 | } 4 | 5 | #contents ul { 6 | margin-bottom: 0; 7 | margin-top: 0; 8 | } 9 | 10 | #contents > ul { 11 | padding-left: 0; 12 | } 13 | 14 | #contents li { 15 | list-style: none; 16 | } 17 | 18 | #contents { 19 | border-bottom: 1px solid #999; 20 | padding-left: 1em; 21 | } 22 | 23 | .header-container header { 24 | width: 98%; 25 | } 26 | 27 | code { 28 | color: #288; 29 | } 30 | 31 | aside code { 32 | color: #9ff; 33 | } 34 | 35 | section:target h1, section:target h2, section:target h3, section:target h4, 36 | section:target h5, section:target h6, h3:target, h4:target { 37 | border-bottom: 3px solid #f90; 38 | } 39 | 40 | footer a:link, footer a:visited, 41 | aside a:link, aside a:visited { 42 | text-decoration: none; 43 | color: #fd1; 44 | } 45 | 46 | section header h1, section header h2, section header h3, section header h4, 47 | section header h5, section header h6 { 48 | margin-left: -1em; 49 | margin-top: 1.75em; 50 | border-bottom: 1px solid #000; 51 | } 52 | 53 | pre { 54 | font-size: 90%; 55 | line-height: 1.3; 56 | border: 1px solid #999; 57 | border-radius: 4px; 58 | } 59 | 60 | @media only screen and (min-width: 768px) { 61 | 62 | .main aside { 63 | position: absolute; 64 | right: 1em; 65 | } 66 | 67 | } 68 | 69 | .header-container header { 70 | margin-left: 1em; 71 | } 72 | 73 | h1.title a:link, h1.title a:visited { 74 | text-decoration: none; 75 | color: #fff; 76 | } 77 | 78 | h1.title a:hover { 79 | text-decoration: underline; 80 | } 81 | 82 | 83 | dd p { 84 | margin-top: 0; 85 | } 86 | 87 | dd p:last-child { 88 | margin-bottom: 0; 89 | } -------------------------------------------------------------------------------- /togetherjs/tests/doctestjs/.resources/example.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Example Feed 5 | A subtitle. 6 | 7 | 8 | urn:uuid:60a76c80-d399-11d9-b91C-0003939e0af6 9 | 2003-12-13T18:30:02Z 10 | 11 | John Doe 12 | johndoe@example.com 13 | 14 | 15 | 16 | Atom-Powered Robots Run Amok 17 | 18 | 19 | 20 | urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a 21 | 2003-12-13T18:30:02Z 22 | Some text. 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /togetherjs/tests/doctestjs/.resources/footer.html: -------------------------------------------------------------------------------- 1 |
      2 | 3 |

      Download

      4 |

      5 | You can download this project in either 6 | zip or 7 | tar formats. 8 |

      9 | 10 |

      You can also clone the project with Git 11 | by running: 12 |

      $ git clone git://github.com/ianb/doctestjs
      13 |

      14 | 15 | 19 | 20 |
      21 | 22 | 26 | 31 | -------------------------------------------------------------------------------- /togetherjs/tests/doctestjs/.resources/include-scripts.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | base="$(python -c 'import sys, os; print os.path.dirname(os.path.dirname(os.path.abspath(sys.argv[1])))' "$BASH_SOURCE")" 6 | 7 | if [ ! -f $base/doctest.js ] ; then 8 | echo "Could not find $base/doctest.js" 9 | exit 1 10 | fi 11 | 12 | if [ ! -d $base/.resources/jshint ] ; then 13 | echo "Could not find $base/.resources/jshint" 14 | echo "Try:" 15 | echo " git clone https://github.com/jshint/jshint.git .resources/jshint" 16 | exit 2 17 | fi 18 | 19 | if [ ! -d $base/.resources/esprima ] ; then 20 | echo "Could not find $base/.resources/esprima" 21 | echo "Try:" 22 | echo " git clone https://github.com/ariya/esprima.git .resources/esprima" 23 | exit 3 24 | fi 25 | 26 | echo "Substituting $base/doctest.js" 27 | 28 | python -c ' 29 | import os, sys, re, subprocess 30 | os.chdir(sys.argv[1]) 31 | with open("doctest.js", "rb") as fp: 32 | content = fp.read() 33 | names = {} 34 | for arg in sys.argv[2:]: 35 | name, rest = arg.split("=", 1) 36 | names[name] = rest 37 | regex = re.compile(r"\/\*\s+INSERT\s+(.*?)\s+\*\/\s*\n(.*?)\/*\s+END\s+INSERT\s+\*\/", re.S) 38 | def repl(match): 39 | print "Replacing %s" % match.group(1) 40 | filename = names.get(match.group(1)) 41 | # I do not understand why --ascii needs an option 42 | output = subprocess.check_output( 43 | ["uglifyjs", "--no-copyright", "--max-line-len", "200", "-b", "max-line-len=200,ascii-only=true,beautify=false", filename]) 44 | return "/* INSERT %s */\n%s\n/* END INSERT */" % ( 45 | match.group(1), output) 46 | new_content = regex.sub(repl, content) 47 | with open("doctest.js", "wb") as fp: 48 | fp.write(new_content) 49 | print "wrote doctest.js" 50 | ' "$base" esprima.js=$base/.resources/esprima/esprima.js jshint.js=$base/.resources/jshint/jshint.js 51 | -------------------------------------------------------------------------------- /togetherjs/tests/doctestjs/.resources/try.js: -------------------------------------------------------------------------------- 1 | window.addEventListener('load', function () { 2 | var innerHTML = $('#display').html(); 3 | if (localStorage.editText) { 4 | $('#editor').val(localStorage.editText); 5 | } 6 | $('#editor').change(function () { 7 | localStorage.editText = $('#editor').val(); 8 | }); 9 | $('#testit').click(function () { 10 | $('#display').html(innerHTML); 11 | $('#editit').click(function () { 12 | $('#edit').show(); 13 | $('#display').hide(); 14 | $('#editor').focus(); 15 | $('#doctest-output').hide(); 16 | }); 17 | $('#test-location').addClass('test').text($('#editor').val()); 18 | console.log($('#test-location').text()); 19 | var runner = new doctest.Runner(); 20 | var parser = new doctest.HTMLParser(runner, $('#display')[0], 'pre#test-location'); 21 | runner.init(); 22 | parser.parse(); 23 | runner.run(); 24 | }); 25 | }, false); 26 | -------------------------------------------------------------------------------- /togetherjs/tests/doctestjs/.syncignore: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /togetherjs/tests/doctestjs/README.md: -------------------------------------------------------------------------------- 1 | ## doctest.js 2 | 3 | For a more complete description please [read the main 4 | page](http://doctestjs.org). 5 | 6 | `doctest.js` is a test runner for Javascript, organized around *examples* and *expected result*. Tests look like this: 7 | 8 | ```javascript 9 | // Simple stuff: 10 | print(3 * 4); 11 | // => 12 12 | 13 | // Or complicated stuff: 14 | var complete = false; 15 | var savedResult = null; 16 | $.ajax({ 17 | url: "/test", 18 | dataType: "json", 19 | success: function (result) { 20 | complete = true; 21 | savedResult = result; 22 | } 23 | }); 24 | wait(function () {return complete;}); 25 | print(savedResult); 26 | // => {value1: "something", value2: true} 27 | ``` 28 | 29 | And a bunch more features: check out the [tutorial](http://doctestjs.org/tutorial.html) to get started, or read the [reference](http://doctestjs.org/reference.html) for more detail. 30 | 31 | ## License 32 | 33 | Doctest.js is released under an MIT-style license. 34 | 35 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 36 | 37 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 38 | 39 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 40 | -------------------------------------------------------------------------------- /togetherjs/tests/doctestjs/bin/doctest: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var path = require('path'); 4 | var fs = require('fs'); 5 | var root = path.join(path.dirname(fs.realpathSync(__filename)), '..'); 6 | 7 | // FIXME: Not sure this is the best way to go about this, or if we should 8 | // just require("doctest")? 9 | var doctest = require(root + '/doctest'); 10 | 11 | function main(filename) { 12 | var runner = new doctest.Runner({Reporter: doctest.ConsoleReporter}); 13 | runner.globs = runner.evalInit(); 14 | var parser = new doctest.TextParser.fromFile(runner, process.argv[2]); 15 | parser.parse(); 16 | runner.run(); 17 | 18 | var reporter = runner.reporter; 19 | return reporter; 20 | } 21 | 22 | function showReport(reporter) { 23 | console.log('Successes:', reporter.successes); 24 | console.log('Failures:', reporter.failures); 25 | if ((! reporter.successes) || reporter.failures) { 26 | // Set exit code to number of failures (if any). It gives a nice failures 27 | // summary when running under make. E.g.: `make: *** [doctest] Error 2` 28 | process.exit(reporter.failures || 1); 29 | } 30 | } 31 | 32 | var filename = process.argv[2]; 33 | if (! filename) { 34 | console.log("Error: you did not give a filename"); 35 | console.log("Usage:", process.argv[1], "FILENAME"); 36 | process.exit(500); 37 | } 38 | showReport(main(filename)); 39 | -------------------------------------------------------------------------------- /togetherjs/tests/doctestjs/examples/examples-2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Example 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
      17 | $ print('hey you')
      18 | hey you
      19 | $ print({'whatever': 'example', something: [1, 2, 3]});
      20 | {something: [1, 2, 3], whatever: "example"}
      21 | $ print(1/0)
      22 | NaN
      23 | $ function foo() {
      24 | >   console.log({hey: 'you'});
      25 | >   throw 'whatever';
      26 | > }
      27 | > foo();
      28 | Error: whatever
      29 | 
      30 | 31 |
      32 | print(1+2)
      33 | /* =>
      34 |    3
      35 | */
      36 | 
      37 | function testme() {
      38 |   setTimeout(function () {
      39 |     print('hey you!');
      40 |   }, 10);
      41 | }
      42 | testme();
      43 | wait(200);
      44 | /* => hey you! */
      45 | 
      46 | 47 |
      
      48 | 
      49 | 
      50 | function stop() {
      51 |   throw Abort();
      52 | }
      53 | 
      54 | print(1+2);
      55 | /* => 3 */
      56 | 
      57 | stop();
      58 | /* => something */
      59 | 
      60 | print(5+5);
      61 | /* => 12 */
      62 | 
      63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /togetherjs/tests/doctestjs/examples/examples-2.js: -------------------------------------------------------------------------------- 1 | function factorial(n) { 2 | if (n == 1) { 3 | return n; 4 | } 5 | return n * factorial(n-1); 6 | } 7 | 8 | print(factorial(4)); 9 | /* => 24 */ 10 | print(factorial(3)); 11 | /* => 12 | 20 13 | */ -------------------------------------------------------------------------------- /togetherjs/tests/doctestjs/examples/long-running-tests.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Example 6 | 7 | 8 | 9 | 10 | 11 | 12 | This is an example of tests that: 13 |
        14 |
      • wait on long running processes
      • 15 |
      • use an external javascript file
      • 16 |
      • sections in the tests that will make them run in sequence
      • 17 |
      18 | 19 |
      
      20 | 
      21 |     
      22 | 
      
      
      --------------------------------------------------------------------------------
      /togetherjs/tests/doctestjs/examples/long-running-tests.js:
      --------------------------------------------------------------------------------
       1 | // = SECTION First
       2 | var done = false;
       3 | function foo() {
       4 |     window.setTimeout(function() {
       5 |         done = true;
       6 |         some_var = true;
       7 |     }, 2000);
       8 |     wait(function(){return done;});
       9 | }
      10 | foo();
      11 | print(done);
      12 | // => false
      13 | 
      14 | // = SECTION check output 1
      15 | print(done);
      16 | // => true
      17 | print(some_var);
      18 | // => true
      19 | 
      20 | // = SECTION Second
      21 | done = false;
      22 | function foo2() {
      23 |     window.setTimeout(function() {
      24 |         done = true;
      25 |         another_var = true;
      26 |     }, 2000);
      27 |     wait(function(){return done;});
      28 | }
      29 | foo2();
      30 | print(done);
      31 | // => false
      32 | 
      33 | // = SECTION check output 2
      34 | print(done);
      35 | // => true
      36 | print(another_var);
      37 | // => true
      38 | print(some_var);
      39 | // => true
      40 | 
      
      
      --------------------------------------------------------------------------------
      /togetherjs/tests/doctestjs/package.json:
      --------------------------------------------------------------------------------
       1 | {
       2 |   "name": "doctestjs",
       3 |   "version": "0.3.0",
       4 |   "main": "doctest",
       5 |   "bin": {
       6 |     "doctest": "./bin/doctest"
       7 |   },
       8 |   "description": "Example-based testing framework",
       9 |   "keywords": [],
      10 |   "author": {
      11 |     "name": "Ian Bicking",
      12 |     "email": "ian@ianbicking.org",
      13 |     "web": "http://ianbicking.org",
      14 |     "twitter": "ianbicking"
      15 |   },
      16 |   "license": "MIT",
      17 |   "repository": {
      18 |     "type": "git",
      19 |     "url": "https://github.com/ianb/doctestjs.git"
      20 |   }
      21 | }
      22 | 
      
      
      --------------------------------------------------------------------------------
      /togetherjs/tests/func_peer_status.js:
      --------------------------------------------------------------------------------
       1 | // =SECTION Setup
       2 | 
       3 | Test.require("peers", "templates-en-US");
       4 | // => Loaded modules: ...
       5 | 
       6 | TogetherJSTestSpy.setIdleTime(100);
       7 | 
       8 | Test.normalStartup();
       9 | 
      10 | // => ...
      11 | 
      12 | Test.newPeer();
      13 | 
      14 | // => ...
      15 | 
      16 | // =SECTION Test
      17 | 
      18 | var peer = peers.getPeer("faker");
      19 | print(peer.status, peer.idle);
      20 | 
      21 | // => live active
      22 | 
      23 | wait(200);
      24 | // =>
      25 | 
      26 | print(peer.status, peer.idle);
      27 | 
      28 | // => live inactive
      29 | 
      30 | // =SECTION Manual test code
      31 | 
      32 | // 3 second idle time:
      33 | TogetherJSTestSpy.setIdleTime(3000);
      34 | 
      35 | Test.addControl('
      Trigger activity states:
      '); 36 | 37 | Test.addControl($('').keyup(function (event) { 38 | var el = $(event.target); 39 | if (event.which == 13) { 40 | var value = parseInt(el.val(), 10); 41 | TogetherJSTestSpy.setIdleTime(value); 42 | el.val(""); 43 | } 44 | })); 45 | 46 | Test.addControl($('').click(function () { 47 | Test.incoming({ 48 | type: "idle-status", 49 | idle: "inactive", 50 | clientId: "faker" 51 | }); 52 | })); 53 | 54 | Test.addControl($('').click(function () { 55 | Test.incoming({ 56 | type: "idle-status", 57 | idle: "active", 58 | clientId: "faker" 59 | }); 60 | })); 61 | -------------------------------------------------------------------------------- /togetherjs/tests/func_walkthrough.js: -------------------------------------------------------------------------------- 1 | // =SECTION Setup 2 | 3 | Test.require("ui", "chat", "util", "session", "jquery", "storage", "peers", "cursor", "windowing", "templates-en-US"); 4 | // => Loaded modules: ... 5 | 6 | TogetherJS.config("siteName", "this site"); 7 | 8 | printChained( 9 | Test.resetSettings, 10 | Test.startTogetherJS); 11 | 12 | // => ... 13 | -------------------------------------------------------------------------------- /togetherjs/tests/manual/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Manual tests 6 | 7 | 8 | 9 |

      Manual tests

      10 | 11 |

      These are test cases that aren't automated, but do have instructions...

      12 | 13 |
        14 |
      1. 15 | #797 multi textarea focus 16 |
      2. 17 |
      3. 18 | YouTube videos 19 |
      4. 20 |
      21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /togetherjs/tests/manual/multi-textarea-focus.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Multi-textarea focus 6 | 9 | 10 | 11 | 12 | 13 |

      Multi-textarea focus

      14 | 15 |

      To run this test, start this session in another tab. Focus 16 | textarea #1 in the first tab, edit textarea #2 in another tab. 17 | #797 18 | identifies a problem where textarea #2 will become focused in 19 | the first tab.

      20 | 21 |
      22 | Textarea #1:
      23 | 24 |
      25 | 26 |
      27 | Textarea #2:
      28 | 29 |
      30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /togetherjs/tests/manual/youtube-video.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | YouTube Video Test 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /togetherjs/tests/test_console.js: -------------------------------------------------------------------------------- 1 | /*global tjconsole */ 2 | var origConsole = window.console; 3 | Test.require({tjconsole: "console"}); 4 | // => Loaded modules: console 5 | 6 | tjconsole.warn("hey", {a: 1, b: 2}); 7 | tjconsole.log(1, 2, 3, {repr: function () {return (null).foo;}}); 8 | tjconsole.trace(); 9 | print(tjconsole.toString()); 10 | 11 | /* => 12 | TogetherJS base URL: ... 13 | User Agent: ... 14 | Page loaded: 20...Z 15 | Age: ... minutes 16 | URL: ... 17 | ------+------+---------------------------------------------- 18 | ... warn hey {"a":1,"b":2} 19 | ... log 1 2 3 {} 20 | ... ... 21 | 22 | */ 23 | -------------------------------------------------------------------------------- /togetherjs/tests/test_elementFinder.js: -------------------------------------------------------------------------------- 1 | Test.require("elementFinder"); 2 | // => Loaded modules: ... 3 | 4 | var els = $(document.body).find("*"); 5 | els.each(function (index, el) { 6 | el = $(el); 7 | var loc; 8 | try { 9 | loc = elementFinder.elementLocation(el); 10 | } catch (e) { 11 | console.trace(); 12 | print("Error: cannot get location for", el, ":", e); 13 | return; 14 | } 15 | var result = elementFinder.findElement(loc); 16 | if (result != el[0]) { 17 | print("Bad element:", loc, el); 18 | print("Resolved to:", result); 19 | } else { 20 | console.log("Resolved element", loc, el); 21 | } 22 | }); 23 | print("done."); 24 | 25 | // => done. 26 | -------------------------------------------------------------------------------- /togetherjs/tests/test_linkify.js: -------------------------------------------------------------------------------- 1 | /*global linkify */ 2 | Test.require("linkify"); 3 | // => Loaded modules: linkify 4 | 5 | print(linkify($("this is a test"))); 6 | // => this is a test 7 | print(linkify($("http://foo.com test"))); 8 | /* => 9 | 10 | http://foo.com 11 | test 12 | */ 13 | 14 | print(linkify($("yahoo (http://yahoo.com)"))); 15 | /* => 16 | yahoo ( 17 | http://yahoo.com 18 | ) 19 | */ 20 | -------------------------------------------------------------------------------- /togetherjs/tests/test_misc.js: -------------------------------------------------------------------------------- 1 | /*global util */ 2 | Test.require("util"); 3 | // => Loaded modules: util 4 | 5 | util.assertValidUrl("http://foo.com"); 6 | // => 7 | util.assertValidUrl("//foobar"); 8 | // => 9 | util.assertValidUrl("data:image/png,asdf"); 10 | // => 11 | util.assertValidUrl("javascript:alert()"); 12 | // => Error: AssertionError: ... 13 | util.assertValidUrl("foobar.com"); 14 | // => Error: AssertionError: ... 15 | util.assertValidUrl("http://test.com); something: foo"); 16 | // => Error: AssertionError: ... 17 | util.assertValidUrl("HTTPS://test.com"); 18 | // => 19 | -------------------------------------------------------------------------------- /togetherjs/tests/test_resolves.js: -------------------------------------------------------------------------------- 1 | Test.require("util"); 2 | // => Loaded modules: util 3 | 4 | var def = util.Deferred(); 5 | 6 | setTimeout(util.resolver(def, function () { 7 | return 'ok'; 8 | })); 9 | 10 | printResolved('item', def); 11 | 12 | // => item ok 13 | 14 | def = util.Deferred(); 15 | var chained = util.Deferred(); 16 | setTimeout(util.resolver(def, function () { 17 | return chained; 18 | })); 19 | setTimeout(function () { 20 | chained.resolve("second"); 21 | }); 22 | 23 | printResolved('item2', def); 24 | 25 | // => item2 second 26 | 27 | var defs = [util.Deferred(), util.Deferred(), util.Deferred()]; 28 | var result = util.resolveMany(defs); 29 | setTimeout(function () { 30 | defs[0].resolve('first'); 31 | defs[1].resolve('second'); 32 | defs[2].resolve('last'); 33 | }); 34 | 35 | printResolved(result); 36 | // => ["first", "second", "last"] 37 | -------------------------------------------------------------------------------- /togetherjs/tests/test_storage.js: -------------------------------------------------------------------------------- 1 | /*global storage */ 2 | Test.require("storage", "util"); 3 | // => Loaded modules: storage util 4 | 5 | print(storage); 6 | // => [storage for localStorage] 7 | 8 | printResolved(storage.clear(), storage.tab.clear()); 9 | // => (resolved) (resolved) 10 | 11 | printResolved(storage.keys(), storage.tab.keys()); 12 | // => [] [] 13 | 14 | printResolved(storage.tab.set("foo", "bar")); 15 | // => (resolved) 16 | 17 | printResolved(storage.tab.keys()); 18 | // => ["foo"] 19 | -------------------------------------------------------------------------------- /togetherjs/visibilityApi.js: -------------------------------------------------------------------------------- 1 | /* This Source Code Form is subject to the terms of the Mozilla Public 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | * You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 | 5 | /* Loading this module will cause, when TogetherJS is active, the 6 | session object to emit visibility-change with a `hidden` argument 7 | whenever the visibility changes, on browsers where we can detect 8 | it. 9 | */ 10 | 11 | define(["util", "session"], function (util, session) { 12 | var visibilityApi = util.Module("visibilityApi"); 13 | var hidden; 14 | var visibilityChange; 15 | if (document.hidden !== undefined) { // Opera 12.10 and Firefox 18 and later support 16 | hidden = "hidden"; 17 | visibilityChange = "visibilitychange"; 18 | } else if (document.mozHidden !== undefined) { 19 | hidden = "mozHidden"; 20 | visibilityChange = "mozvisibilitychange"; 21 | } else if (document.msHidden !== undefined) { 22 | hidden = "msHidden"; 23 | visibilityChange = "msvisibilitychange"; 24 | } else if (document.webkitHidden !== undefined) { 25 | hidden = "webkitHidden"; 26 | visibilityChange = "webkitvisibilitychange"; 27 | } 28 | 29 | session.on("start", function () { 30 | document.addEventListener(visibilityChange, change, false); 31 | }); 32 | 33 | session.on("close", function () { 34 | document.removeEventListener(visibilityChange, change, false); 35 | }); 36 | 37 | function change() { 38 | session.emit("visibility-change", document[hidden]); 39 | } 40 | 41 | visibilityApi.hidden = function () { 42 | return document[hidden]; 43 | }; 44 | 45 | return visibilityApi; 46 | }); 47 | -------------------------------------------------------------------------------- /togetherjs/walkabout.html: -------------------------------------------------------------------------------- 1 |
      2 | 6 | --------------------------------------------------------------------------------