Anonymous avatar Anonymous committed fda9e98

dnd mostly work.

Comments (0)

Files changed (4)

friendpaste/settings.py

 
 if DEBUG:
     SITE_URI = 'http://localhost:5000'
-    ORBITED_HOST = 'localhost'
+    ORBITED_HOST = '192.168.1.2'
     ORBITED_PORT = 9000
  
 

static/css/src/colors.css

     border-color: #899834;
     color: #fff;
     background-color: #e5f1f4;
-    opacity: 0.9;
 }
 
 #reviews-list li {

static/css/src/layout.css

 }
 
 /* comment box */
+#overlay {
+    position: fixed; 
+    width: 100%;
+    height: 100%;
+    top: 0;
+    left: 0;
+}
+
+
+
 #commentsOverlay {
     background-color: #000;
 }
 .comment-box {
     display: block;
     position: absolute;
-    z-index: 10000;
+    z-index: 99999;
     width: 700px;
     border: 1px solid;
     height: 350px;
 
 #freview textarea#new_review {
     height: 120px;
-    position: relative;
+    /*position: relative;*/
 }
 
 .reviewflag {

static/js/src/review.js

         this.overlay = document.createElement("div");
         this.overlay.id = "overlay";
         this.overlay.setStyle({
-                "display": "block",
-                "position": "fixed",
-                "top": "0",
-                "left": "0",
-                "z-index": "1001", 
-                "height": "100%",
-                "width": "100%"
+                "z-index": "9999" 
         });
-        this.overlay.setOpacity("0.5"); 
+        this.overlay.setOpacity("0");
 
         var div = document.createElement("div");
         div.classList.add("comment-box");
+        div.setStyle("z-index: 10000");
         div.setOpacity("0.9");
 
         this.divComment = this.rootLayers = div;
         bclose.value = 'close';
         p.appendChild(bclose);
         form.appendChild(p);
-        var q = document.createElement('input');
-        q.type = 'hidden';
-        q.id = "Q";
-        form.appendChild(q);
         div.appendChild(form);
         var comments_title = document.createElement('h3');
         comments_title.appendChild(document.createTextNode('All comments for this line'));
         }
 
          // handle drag and drop
-        this.divComment.removeEventListener('mousedown', this.beginDragCB.bind(this), false);
-        this.divComment.removeEventListener('mousemove', this.dragCB.bind(this), false);
-        this.divComment.removeEventListener('mouseup', this.endDragCB.bind(this), false);
+        this.isDragging = false;
+        this.divComment.removeEventListener('mousedown', this.beginDragCB, false);
+        this.divComment.removeEventListener('mousemove', this.dragCB, false);
+        this.divComment.removeEventListener('mouseup', this.endDragCB, false);
     },
 
     setCommentBoxPosition: function() {
             this.ieframe.height = this.divComment.outerHeight();
         }
         window.scrollTo(document.body.scrollLeft, offset.y - 64);
+        resizeBottom();
     },
 
     insideCommentBox: function(e) {
 
     beginDragCB: function(e) {
         var self = this;
+        if (this.isDragging)
+            return false;
 
         if ((tag_name = e.target.tagName.toUpperCase()) && (
             tag_name=='INPUT' ||
             tag_name=='TEXTAREA')) return;
         
         this.isDragging = true;
+        e.target.focus();
 
         this.divComment.style.cursor = "move";
-
         var point = pointer(e);
         var pos = this.divComment.cumulativeOffset();
        
         this.offset = [point.x - pos.x, point.y - pos.y];
+        this.pointer = point;
 
-        var d = this.divComment.ownerDocument;
-
-        d.body.onselectstart = function(e) {
-            e.preventDefault();
-            e.stopPropagation();
-            return false;
-        }
-
-        d.ondragstart = function(e) {
-            e.preventDefault();
-            e.stopPropagation();
-            return false;
-        }
-
+        // remove text selection
+        document.body.focus();
+               
+        // prevent text selection for ie
+        if (base2.detect('MSIE'))
+            this.old_onselectstart = document.onselectstart;
+            document.onselectstart = function (e) {
+                return false;
+            }
+        
+        e.preventDefault();
         e.stopPropagation(); 
         return false;
     },
         if (!this.isDragging) 
             return;
        
-        e.preventDefault(); 
+         
         var point = pointer(e);
+        var pos = this.divComment.cumulativeOffset();
 
-        var pos = this.divComment.cumulativeOffset();
+        var diffX = Math.abs(point.x - this.pointer.x);
+        var diffY = Math.abs(point.y -this.pointer.y);
+
+        if (diffX < 3 || diffY < 3)
+            return;
 
         var d = this.currentDelta();
         pos.x -= d[0];
         this.divComment.style.left = p[0] + "px";
         this.divComment.style.top = p[1] + "px";
 
+
+
         if (base2.detect('webkit'))
              window.scrollBy(0,0);
 
+        this.pointer = pointer(e);
+        e.preventDefault();
         e.stopPropagation();
-    },
+     },
 
-
+    
     endDragCB: function(e) {
         this.isDragging = false;
+        
+        if (this.old_onselectstart) {
+            document.onselectstart = this.old_onselectstart;
+            this.old_onsselectstart = null;
+        }
 
         this.divComment.style.cursor = "default";
-        document.body.onselectstart = null;
-
-        document.ondragstart = null;
     },
 
     showCommentBox: function() {
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.