~ubuntu-branches/ubuntu/vivid/samba/vivid

« back to all changes in this revision

Viewing changes to swat2/style/qooxdoo/widgets/managers/QxDragAndDropManager.js

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2011-12-21 13:18:04 UTC
  • mfrom: (0.39.21 sid)
  • Revision ID: package-import@ubuntu.com-20111221131804-xtlr39wx6njehxxr
Tags: 2:3.6.1-3ubuntu1
* Merge from Debian testing.  Remaining changes:
  + debian/patches/VERSION.patch:
    - set SAMBA_VERSION_SUFFIX to Ubuntu.
  + debian/patches/error-trans.fix-276472:
    - Add the translation of Unix Error code -ENOTSUP to NT Error Code
    - NT_STATUS_NOT_SUPPORTED to prevent the Permission denied error.
  + debian/smb.conf:
    - add "(Samba, Ubuntu)" to server string.
    - comment out the default [homes] share, and add a comment about
      "valid users = %S" to show users how to restrict access to
      \\server\username to only username.
    - Set 'usershare allow guests', so that usershare admins are 
      allowed to create public shares in addition to authenticated
      ones.
    - add map to guest = Bad user, maps bad username to guest access.
  + debian/samba-common.config:
    - Do not change priority to high if dhclient3 is installed.
    - Use priority medium instead of high for the workgroup question.
  + debian/control:
    - Don't build against or suggest ctdb.
    - Add dependency on samba-common-bin to samba.
  + Add ufw integration:
    - Created debian/samba.ufw.profile
    - debian/rules, debian/samba.dirs, debian/samba.files: install
      profile
    - debian/control: have samba suggest ufw
  + Add apport hook:
    - Created debian/source_samba.py.
    - debian/rules, debian/samba.dirs, debian/samba-common-bin.files: install
  + Switch to upstart:
    - Add debian/samba.{nmbd,smbd}.upstart.
  + debian/samba.logrotate, debian/samba-common.dhcp, debian/samba.if-up:
    - Make them upstart compatible
  + debian/samba.postinst: 
    - Avoid scary pdbedit warnings on first import.
  + debian/samba-common.postinst: Add more informative error message for
    the case where smb.conf was manually deleted
  + debian/patches/fix-debuglevel-name-conflict.patch: don't use 'debug_level'
    as a global variable name in an NSS module 
  + Dropped:
    - debian/patches/error-trans.fix-276472
    - debian/patches/fix-debuglevel-name-conflict.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (c): 2002-2005 (Germany): United Internet, 1&1, GMX, Schlund+Partner, Alturo */
2
 
function QxDragAndDropManager(){if(QxDragAndDropManager._instance){return QxDragAndDropManager._instance;};QxTarget.call(this);this._k1={};this._k2={};this._k3={};var d=window.application.getClientWindow().getClientDocument();var a=["move","copy","alias","nodrop"];var c;for(var i=0;i<a.length;i++){c = this._k3[a[i]] = new QxImage("widgets/cursors/" + a[i] + ".gif");c.setTimerCreate(false);c.setStyleProperty("top","-1000px");c.setZIndex(10000);c.setParent(d);};QxDragAndDropManager._instance=this;};QxDragAndDropManager.extend(QxManager,"QxDragAndDropManager");QxDragAndDropManager.addProperty({name:"sourceWidget",type:Object});QxDragAndDropManager.addProperty({name:"destinationWidget",type:Object});QxDragAndDropManager.addProperty({name:"cursor",type:Object});QxDragAndDropManager.addProperty({name:"currentAction",type:String});proto._k5=null;proto._modifyDestinationWidget=function(_b1,_b2,_b3,_b4){if(_b1){_b1.dispatchEvent(new QxDragEvent("dragdrop",this._k5));this._k5=null;};return true;};proto.addData=function(vMimeType,vData){this._k1[vMimeType]=vData;};proto.getData=function(vMimeType){return this._k1[vMimeType];};proto.clearData=function(){this._k1={};};proto.getDropDataTypes=function(){var dw=this.getDestinationWidget();var st=[];if(!dw){return st;};var ddt=dw.getDropDataTypes();var ddtl=ddt.length;for(var i=0;i<ddtl;i++){if(ddt[i]in this._k1){st.push(ddt[i]);};};return st;};proto.startDrag=function(){if(!this._k6){throw new Error("Invalid usage of startDrag. Missing dragInfo!");};this._k6.dragHandlerActive=true;this.setSourceWidget(this._k6.sourceWidget);};proto._fireUserEvents=function(fromWidget,toWidget,e){if(fromWidget&&fromWidget!=toWidget){var outEvent=new QxDragEvent("dragout",e);outEvent._relatedTarget=toWidget;fromWidget.dispatchEvent(outEvent,true);outEvent=null;};if(toWidget){if(fromWidget!=toWidget){var overEvent=new QxDragEvent("dragover",e);overEvent._relatedTarget=fromWidget;toWidget.dispatchEvent(overEvent,true);overEvent=null;};var moveEvent=new QxDragEvent("dragmove",e);toWidget.dispatchEvent(moveEvent,true);moveEvent=null;};};proto.handleMouseEvent=function(e){switch(e.getType()){case "mousedown":return this._handleMouseDown(e);case "mouseup":return this._handleMouseUp(e);case "mousemove":return this._handleMouseMove(e);};};proto._handleMouseDown=function(e){if(e.getDefaultPrevented()){return;};this._k6={startScreenX:e.getScreenX(),startScreenY:e.getScreenY(),pageX:e.getPageX(),pageY:e.getPageY(),sourceWidget:e.getTarget(),dragHandlerActive:false,hasFiredDragStart:false
3
 
};this._k6.sourceTopLevel=this._k6.sourceWidget.getTopLevelWidget();};proto._handleMouseMove=function(e){if(!this._k6){return;};if(this._k6.dragHandlerActive){this._k6.pageX=e.getPageX();this._k6.pageY=e.getPageY();var currentDropTarget=this.getDropTarget(e);this.setCurrentAction(currentDropTarget?this._evalNewAction(e.getShiftKey(),e.getCtrlKey(),e.getAltKey()):null);this._fireUserEvents(this._k6.currentDropWidget,currentDropTarget,e);this._k6.currentDropWidget=currentDropTarget;this._renderCursor();}else if(!this._k6.hasFiredDragStart){if(Math.abs(e.getScreenX()-this._k6.startScreenX)>5||Math.abs(e.getScreenY()-this._k6.startScreenY)>5){this._k6.sourceWidget.dispatchEvent(new QxDragEvent("dragstart",e));this._k6.hasFiredDragStart=true;if(this._k6.dragHandlerActive){this._fireUserEvents(this._k6.currentDropWidget,this._k6.sourceWidget,e);this._k6.currentDropWidget=this._k6.sourceWidget;var clientDocument=window.application.getClientWindow().getClientDocument();clientDocument.setCapture(true);clientDocument.addEventListener("losecapture",this.cancelDrag,this);};};};};proto._handleMouseUp=function(e){if(!this._k6){return;};if(this._k6.dragHandlerActive){this._endDrag(this.getDropTarget(e),e);}else {this._k6=null;};};proto.handleKeyEvent=function(e){if(!this._k6){return;};switch(e.getType()){case "keydown":this._handleKeyDown(e);return;case "keyup":this._handleKeyUp(e);return;};};proto._handleKeyDown=function(e){if(e.getKeyCode()==QxKeyEvent.keys.esc){this.cancelDrag();}else if(this.getCurrentAction()!=null){switch(e.getKeyCode()){case QxKeyEvent.keys.shift:case QxKeyEvent.keys.ctrl:case QxKeyEvent.keys.alt:this.setAction(this._evalNewAction(e.getShiftKey(),e.getCtrlKey(),e.getAltKey()));this._renderCursor();};};};proto._handleKeyUp=function(e){var bShiftPressed=e.getKeyCode()==QxKeyEvent.keys.shift;var bCtrlPressed=e.getKeyCode()==QxKeyEvent.keys.strl;var bAltPressed=e.getKeyCode()==QxKeyEvent.keys.alt;if(bShiftPressed||bCtrlPressed||bAltPressed){if(this.getCurrentAction()!=null){this.setAction(this._evalNewAction(!bShiftPressed&&e.getShiftKey(),! bCtrlPressed&&e.getCtrlKey(),!bAltPressed&&e.getAltKey()));this._renderCursor();};};e.preventDefault();};proto.cancelDrag=function(e){this._endDrag(null,e);};proto.globalCancelDrag=function(){if(this._k6&&this._k6.dragHandlerActive){this._endDragCore();};};proto._endDrag=function(currentDestinationWidget,e){if(currentDestinationWidget){this._k5=e;this.setDestinationWidget(currentDestinationWidget);};this.getSourceWidget().dispatchEvent(new QxDragEvent("dragend",e));this._fireUserEvents(this._k6&&this._k6.currentDropWidget,null,e);this._endDragCore();};proto._endDragCore=function(){this.setCursor(null);var d=window.application.getClientWindow().getClientDocument();d.removeEventListener("losecapture",this.cancelDrag,this);d.setCapture(false);if(this._k6){this._k6.currentDropWidget=null;this._k6=null;};this.clearData();this.clearActions();this.setSourceWidget(null);this.setDestinationWidget(null);};proto._renderCursor=function(){var newCursor;switch(this.getCurrentAction()){case "move":newCursor=this._k3.move;break;case "copy":newCursor=this._k3.copy;break;case "alias":newCursor=this._k3.alias;break;default:newCursor=this._k3.nodrop;};newCursor._d3Horizontal(this._k6.pageX+5);newCursor._d3Vertical(this._k6.pageY+15);this.setCursor(newCursor);};proto._modifyCursor=function(_b1,_b2,_b3,_b4){if(_b2){_b2.setStyleProperty("display","none");};if(_b1){_b1.removeStyleProperty("display");};return true;};proto.supportsDrop=function(vWidget){var types=vWidget.getDropDataTypes();if(!types){return false;};for(var i=0;i<types.length;i++){if(types[i]in this._k1){return true;};};return false;};if((new QxClient).isGecko()){proto.getDropTarget=function(e){var currentWidget=e.getTarget();if(currentWidget==this._k6.sourceWidget){currentWidget=this._k6.sourceTopLevel.getWidgetFromPoint(e.getPageX(),e.getPageY());}else {currentWidget=QxEventManager.getActiveTargetObject(null,currentWidget);};while(currentWidget!=null){if(this.supportsDrop(currentWidget)){return currentWidget;};currentWidget=currentWidget.getParent();};return null;};}else {proto.getDropTarget=function(e){var currentWidget=e.getActiveTarget();while(currentWidget!=null){if(this.supportsDrop(currentWidget)){return currentWidget;};currentWidget=currentWidget.getParent();};return null;};};proto.addAction=function(vAction,vForce){this._k2[vAction]=true;if(vForce||this.getCurrentAction()==null){this.setCurrentAction(vAction);};};proto.clearActions=function(){this._k2={};this.setCurrentAction(null);};proto.removeAction=function(sAction){delete this._k2[sAction];if(this.getCurrentAction()==sAction){this.setCurrentAction(null);};};proto.setAction=function(s){if(s!=null&&!(s in this._k2)){this.addAction(s,true);}else {this.setCurrentAction(s);};};proto._evalNewAction=function(kShift,kCtrl,kAlt){if(kShift&&kCtrl&&this._k4("alias")){return "alias";}else if(kShift&&kAlt&&this._k4("copy")){return "copy";}else if(kShift&&this._k4("move")){return "move";}else if(kAlt&&this._k4("alias")){return "alias";}else if(kCtrl&&this._k4("copy")){return "copy";}else {for(var action in this._k2){return action;};};return null;};proto._k4=function(vAction){return vAction in this._k2;};proto.dispose=function(){if(this.getDisposed()){return;};this._k1=null;this._k2=null;this.setSourceWidget(null);this.setDestinationWidget(null);this._lastdestinationWidgetEvent=null;this._k6=null;if(QxDragAndDropManager._k3){if(QxDragAndDropManager._k3.move){QxDragAndDropManager._k3.move.dispose();QxDragAndDropManager._k3.move=null;};if(QxDragAndDropManager._k3.copy){QxDragAndDropManager._k3.copy.dispose();QxDragAndDropManager._k3.copy=null;};if(QxDragAndDropManager._k3.alias){QxDragAndDropManager._k3.alias.dispose();QxDragAndDropManager._k3.alias=null;};if(QxDragAndDropManager._k3.nodrop){QxDragAndDropManager._k3.nodrop.dispose();QxDragAndDropManager._k3.nodrop=null;};QxDragAndDropManager._k3=null;};QxManager.prototype.dispose.call(this);};
 
 
b'\\ No newline at end of file'