Merge pull request #1351 from jsbin/fix/1350-remove-togetherjs

#1350: Removed togetherjs
This commit is contained in:
Remy Sharp 2014-04-03 11:39:43 +01:00
commit 91d2a257e4
5 changed files with 0 additions and 64 deletions

View File

@ -94,10 +94,6 @@ var flags = {
return alpha(req);
},
togetherjs: function (req) {
return alpha(req);
},
stripe: function (req) {
return team(req);
}

View File

@ -260,11 +260,6 @@ $('#createnew').click(function (event) {
}
}
if (jsbin.collaborating && TogetherJS) {
// this ends the session (but can also start it, so we check jsbin.collaborating)
TogetherJS();
}
// clear out the write checksum too
sessionStorage.removeItem('checksum');

View File

@ -37,14 +37,10 @@ $('a.save').click(function (event) {
analytics.milestone();
// if save is disabled, hitting save will trigger a reload
// if it's connecting to a togetherjs session, save will not trigger a reload
var ajax = true;
if (jsbin.saveDisabled === true) {
ajax = false;
}
if (jsbin.togetherjs === true) {
ajax = true;
}
saveCode('save', ajax);
return false;

View File

@ -1,44 +0,0 @@
(function () {
/*globals jsbin, $*/
'use strict';
if (window.location.hash.indexOf('togetherjs=') !== -1) {
jsbin.saveDisabled = true;
jsbin.sandbox = true;
jsbin.togetherjs = true;
}
var name = jsbin.user ? jsbin.user.name : null;
var avatar = jsbin.user ? jsbin.user.avatar : null;
var panelBindDone = false;
window.TogetherJSConfig_getUserName = function () { return name; };
window.TogetherJSConfig_getUserAvatar = function () { return avatar; };
window.TogetherJSConfig_on_ready = function() {
var $b = $('#togetherjs-jsbin-button');
$b.html( $b.attr('data-end-togetherjs-html') );
jsbin.collaborating = true;
var restore = {};
if (!panelBindDone) {
jsbin.panels.allEditors(function (panel) {
panel.editor.on('beforeChange', function codeChange(cm, changeObj) {
if (changeObj.origin === 'setValue') {
restore = cm.getCursor();
}
});
panel.editor.on('change', function codeChange(cm, changeObj) {
if (changeObj.origin === 'setValue') {
cm.setCursor(restore);
}
});
});
panelBindDone = true;
}
};
window.TogetherJSConfig_on_close = function () {
window.location.reload();
};
})();

View File

@ -41,9 +41,6 @@
{{#if home}}
<a href="#" data-desc="Browse your previous created bins" data-shortcut="ctrl+o" class="button group homebtn" data-label="open">My Bins{{#if bincount}} <span class="meta">({{bincount}})</span>{{/if}}</a>
{{/if}}
{{#feature request "togetherjs"}}
<a href="#" class="button group" onclick="TogetherJS(this); return false" data-end-togetherjs-html="End Collaboration" id="togetherjs-jsbin-button">Start Collaboration</a>
{{/feature}}
<hr data-desc="">
<a id="addmeta" data-desc="Insert a description shown in My Bins" title="Add meta data to bin" class="button group" href="#add-description">Add description</a>
<a title="Create milestone" data-desc="Save current work, and begin new revision on next change" data-shortcut="ctrl+s" class="button save group" data-label="save" href="{{root}}/save">Create milestone</a>
@ -537,10 +534,6 @@ Include alerts, prompts &amp; confirm boxes">Run with JS</button>
var template = {{{json_template}}};
var jsbin = {{{jsbin}}}; tips = {{tips}};
</script>
{{#feature request "togetherjs"}}
<script src="{{static}}/js/chrome/togetherjs.js{{cacheBust}}"></script>
<script src="https://togetherjs.com/togetherjs-min.js"></script>
{{/feature}}
{{#if isProduction}}
<script src="{{static}}/js/prod/jsbin-{{version}}.min.js"></script>
{{else}}