Changeset 6488
- Timestamp:
- 09/08/06 16:50:30 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Wsp_Modeling/spaces/gen/modelBuilder/bs.doss/_common/sm/webSiteGenerator/scDragMgr.js
r6481 r6488 90 90 // vContainer.labelsToAdd = [{label:vLabel1}, {label:vLabel2, x:23, y:65}] - "x:23, y:65" issu de saveLabelPos((pLabel)) 91 91 repopulateContainers : function (pKey) { 92 //TODO92 this.dragdrop.repopulateContainers(pKey); return this 93 93 }, 94 94 … … 110 110 // Fix a constraint box in which the label can be dragged 111 111 setConstraintBox : function (pLabel, pNode) { 112 // FIXME: Disable on Konqueror type browsers as th is they cannot support this for the moment112 // FIXME: Disable on Konqueror type browsers as they cannot support this for the moment 113 113 if (navigator.userAgent.toLowerCase().indexOf("khtml") != -1) return 114 114 this.dragdrop.setConstraintBox(pLabel, pNode); return this … … 117 117 // Returns a string rep of the label's position 118 118 saveLabelPos : function (pLabel) { 119 //TODO 120 return "" 119 return this.dragdrop.saveLabelPos(pLabel) 121 120 } 122 121 } … … 181 180 fUndef : "undefined", 182 181 183 serializeList : function(list) {184 var items = list.getElementsByTagName("li")185 var array = new Array()186 for (var i = 0, n = items.length; i < n; i++) {187 var item = items[i]188 189 array.push(scDragMgr.utilities._identifier(item))190 }191 return array.join('|')192 },193 194 inspectListOrder : function(id) {195 alert(scDragMgr.utilities.serializeList(document.getElementById(id)))196 },197 198 getDropContainers : function (pRootNode, pKey) {199 var vContainers = new Array()200 vContainers = scDragMgr.dragdrop.getZones(pRootNode, pKey)201 vContainers.concat(scDragMgr.dragsort.getContainers(pRootNode, pKey))202 return vContainers203 },204 205 182 logError : function(pLog) { 206 183 if(window.console) { … … 210 187 } 211 188 }, 212 213 214 189 215 190 restoreListOrder : function(listID) { … … 428 403 toString : function() { 429 404 return "(" + this.x + "," + this.y + ")" 405 }, 406 407 toHash : function() { 408 return {"x":this.x,"y":this.y} 430 409 }, 431 410 … … 860 839 }, 861 840 841 // EXTERNAL - CONTAINER - Resets the content of all containers with the labels contained in 842 // vContainer.labelsToAdd = [{label:vLabel1}, {label:vLabel2, x:23, y:65}] - "x:23, y:65" issu de saveLabelPos((pLabel)) 843 repopulateContainers : function (pKey) { 844 try { 845 var vCatchment = scDragMgr.dragdrop.fFirstCatchments[pKey] 846 while (vCatchment != null) { 847 this._emptyLabels(vCatchment.fContainer) 848 vCatchment = vCatchment.fNextCatchment 849 } 850 vCatchment = scDragMgr.dragdrop.fFirstCatchments[pKey] 851 while (vCatchment != null) { 852 this._populate(vCatchment.fContainer) 853 vCatchment = vCatchment.fNextCatchment 854 } 855 } catch (vError) { 856 scDragMgr.utilities.logError("dragdrop.repopulateContainers: "+vError) 857 } 858 }, 859 862 860 // EXTERNAL - LABEL - Make a dragdrop label 863 861 makeDraggableLabel : function(pKey, pLabel, pHandle) { … … 924 922 } 925 923 }, 924 925 // EXTERNAL - LABEL - Returns a string rep of the label's position 926 saveLabelPos : function (pLabel) { 927 try { 928 var vPos = scDragMgr.coordinates.topLeftOffset(pLabel) 929 var vRetVal = 'x:'+vPos.x 930 vRetVal += ',y:'+vPos.y 931 return vRetVal 932 } catch (vError) { 933 scDragMgr.utilities.logError("dragdrop.saveLabelPos: "+vError) 934 } 935 }, 936 937 // INTERNAL functions ======================================================== 938 // INTERNAL - CONTAINER - Empty all draggable labels contained in pContainer 939 _emptyLabels : function(pContainer) { 940 if (typeof pContainer != scDragMgr.utilities.fUndef) { 941 var vChild = pContainer.firstChild 942 while (vChild != null) { 943 if (vChild.fIsDraggable) { 944 var vNextChild = vChild.nextSibling 945 pContainer.removeChild(vChild) 946 vChild = vNextChild 947 } else vChild = vChild.nextSibling 948 } 949 } 950 }, 951 // INTERNAL - CONTAINER - Populate pContainer with all draggable labels found in pContainer.labelsToAdd 952 _populate : function(pContainer) { 953 if (typeof pContainer != scDragMgr.utilities.fUndef && pContainer.labelsToAdd) { 954 for (var i = 0, n = pContainer.labelsToAdd.length; i < n; i++) { 955 if (pContainer.labelsToAdd[i] && pContainer.labelsToAdd[i].label) { 956 var vLabel = pContainer.labelsToAdd[i].label 957 pContainer.appendChild(vLabel) 958 if (pContainer.fCatchment.fDropMode == 'inBulk') { 959 // FIXME : inBulk repositionning 960 scDragMgr.coordinates.create(0, 0).reposition(vLabel) 961 } else scDragMgr.coordinates.create(0, 0).reposition(vLabel) 962 } 963 } 964 pContainer.fCatchment.xUpdateGui() 965 pContainer.labelsToAdd = null 966 } 967 }, 926 968 927 // INTERNAL functions ========================================================928 969 // INTERNAL update acontainer GUI (show/hide ifEmpty etc) 929 970 _UpdateGui : function() { … … 1007 1048 var vCoordinates = scDragMgr.coordinates 1008 1049 var vXmouse = pDragEvent.transformedMouseOffset 1009 1010 1050 var vPrevious = vHelpers.previousItem(vItem, vItem.nodeName) 1011 1051 while (vPrevious != null) { … … 1021 1061 return 1022 1062 } 1023 1024 1063 var vNext = vHelpers.nextItem(vItem, vItem.nodeName) 1025 1064 while (vNext != null) {
Note: See TracChangeset
for help on using the changeset viewer.