aboutsummaryrefslogtreecommitdiffstats
path: root/trunk/etherpad/src/static/js/pad_editbar.js
diff options
context:
space:
mode:
authorElliot Kroo <kroo@appjet.com>2010-03-11 15:21:30 -0800
committerElliot Kroo <kroo@appjet.com>2010-03-11 15:21:30 -0800
commit98e2821b38a775737e42a2479a6bc65107210859 (patch)
tree55939a8ba1dce4f4e48ebb13b658061d62bf1b9a /trunk/etherpad/src/static/js/pad_editbar.js
parentc1894c8e0a52f4e3d2f89fa92f0066bbf0fcf1b1 (diff)
downloadetherpad-98e2821b38a775737e42a2479a6bc65107210859.tar.gz
etherpad-98e2821b38a775737e42a2479a6bc65107210859.tar.xz
etherpad-98e2821b38a775737e42a2479a6bc65107210859.zip
reorganizing the first level of folders (trunk/branch folders are not the git way :)
Diffstat (limited to 'trunk/etherpad/src/static/js/pad_editbar.js')
-rw-r--r--trunk/etherpad/src/static/js/pad_editbar.js107
1 files changed, 0 insertions, 107 deletions
diff --git a/trunk/etherpad/src/static/js/pad_editbar.js b/trunk/etherpad/src/static/js/pad_editbar.js
deleted file mode 100644
index 34b774a..0000000
--- a/trunk/etherpad/src/static/js/pad_editbar.js
+++ /dev/null
@@ -1,107 +0,0 @@
-/**
- * Copyright 2009 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS-IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-var padeditbar = (function(){
-
- var syncAnimation = (function() {
- var SYNCING = -100;
- var DONE = 100;
- var state = DONE;
- var fps = 25;
- var step = 1/fps;
- var T_START = -0.5;
- var T_FADE = 1.0;
- var T_GONE = 1.5;
- var animator = padutils.makeAnimationScheduler(function() {
- if (state == SYNCING || state == DONE) {
- return false;
- }
- else if (state >= T_GONE) {
- state = DONE;
- $("#syncstatussyncing").css('display', 'none');
- $("#syncstatusdone").css('display', 'none');
- return false;
- }
- else if (state < 0) {
- state += step;
- if (state >= 0) {
- $("#syncstatussyncing").css('display', 'none');
- $("#syncstatusdone").css('display', 'block').css('opacity', 1);
- }
- return true;
- }
- else {
- state += step;
- if (state >= T_FADE) {
- $("#syncstatusdone").css('opacity', (T_GONE - state) / (T_GONE - T_FADE));
- }
- return true;
- }
- }, step*1000);
- return {
- syncing: function() {
- state = SYNCING;
- $("#syncstatussyncing").css('display', 'block');
- $("#syncstatusdone").css('display', 'none');
- },
- done: function() {
- state = T_START;
- animator.scheduleAnimation();
- }
- };
- }());
-
- var self = {
- init: function() {
- $("#editbar .editbarbutton").attr("unselectable", "on"); // for IE
- $("#editbar").removeClass("disabledtoolbar").addClass("enabledtoolbar");
- },
- isEnabled: function() {
- return ! $("#editbar").hasClass('disabledtoolbar');
- },
- disable: function() {
- $("#editbar").addClass('disabledtoolbar').removeClass("enabledtoolbar");
- },
- toolbarClick: function(cmd) {
- if (self.isEnabled()) {
- if (cmd == 'save') {
- padsavedrevs.saveNow();
- }
- else if (cmd == 'clearauthorship') {
- padeditor.ace.execCommand('clearauthorship', function() {
- if (window.confirm("Clear authorship colors on entire document?")) {
- padeditor.ace.execCommand('clearauthorship');
- }
- });
- }
- else {
- padeditor.ace.execCommand(cmd);
- }
- }
- padeditor.ace.focus();
- },
- setSyncStatus: function(status) {
- if (status == "syncing") {
- syncAnimation.syncing();
- }
- else if (status == "done") {
- syncAnimation.done();
- }
- }
- };
- return self;
-}()); \ No newline at end of file