Changeset 37555 for gs3-extensions
- Timestamp:
- 2023-03-23T13:28:55+13:00 (13 months ago)
- Location:
- gs3-extensions/tabletop-dl/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
gs3-extensions/tabletop-dl/trunk/RSYNC-INSTALL-TABLETOP-DL.sh
r37536 r37555 1 1 #!/bin/bash 2 2 3 if [ ! -d ../../web/tabletop-dl ] ; then 4 echo "Making directory ../../web/tabletop-dl" 5 mkdir ../../web/tabletop-dl 3 dst_dir=../../web/ext/tabletop-dl 4 5 if [ ! -d $dst_dir ] ; then 6 echo "Making directory $dst_dir" 7 mkdir $dst_dir 6 8 fi 7 9 8 cd .. && rsync -pav \ 9 tabletop-dl/tableletop*.* \ 10 tabletop-dl/backgrounds \ 11 ../web/tabletop-dl/. 10 rsync -pav \ 11 tabletop*.* \ 12 backgrounds \ 13 interactjs-dist \ 14 winbox-with-interactjs-dist \ 15 $dst_dir/. -
gs3-extensions/tabletop-dl/trunk/tabletop-interact.js
r37538 r37555 40 40 } 41 41 42 // http://localhost:8383/greenstone3/library 43 42 44 function getCoreResizableOptions() 43 45 { … … 47 49 48 50 listeners: { 51 52 moveNEWER: function (event) { 53 let { x, y } = event.target.dataset 54 55 x = (parseFloat(x) || 0) + event.deltaRect.left 56 y = (parseFloat(y) || 0) + event.deltaRect.top 57 58 Object.assign(event.target.style, { 59 width: `${event.rect.width}px`, 60 height: `${event.rect.height}px`, 61 transform: `translate(${x}px, ${y}px)` 62 }) 63 64 Object.assign(event.target.dataset, { x, y }) 65 }, 66 49 67 move (event) { 50 68 var target = event.target 51 69 var x = (parseFloat(target.getAttribute('data-x')) || 0) 52 70 var y = (parseFloat(target.getAttribute('data-y')) || 0) 71 //var x = (parseFloat(target.getAttribute('data-x')) || target.style.clientLeft) 72 //var y = (parseFloat(target.getAttribute('data-y')) || target.style.clientTop) 53 73 54 74 // update the element's style … … 62 82 target.style.transform = 'translate(' + x + 'px,' + y + 'px)' 63 83 84 //var target_new_x_org = target.clientLeft + event.deltaRect.left; 85 //var target_new_y_org = target.clientTop + event.deltaRect.top; 86 87 //target.style.left = target_new_x_org + 'px'; 88 //target.style.top = target_new_y_org + 'px'; 89 90 //target.style.left = x + 'px'; 91 //target.style.top = y + 'px'; 92 64 93 target.setAttribute('data-x', x) 65 94 target.setAttribute('data-y', y) … … 82 111 ], 83 112 84 85 inertia: { 113 inertia: false 114 115 /*inertia: { 86 116 resistance: 6, 87 117 //minSpeed: 20, … … 89 119 smoothEndDuration: 500, 90 120 allowResume: true 91 } 121 }*/ 92 122 }; 93 123 … … 109 139 let currentScale = event.scale * angleScale.scale; 110 140 111 let scale_elem = $(elem).find('.scale-element')[0]; 112 113 scale_elem.style.transform = 114 'rotate(' + currentAngle + 'deg)' + 'scale(' + currentScale + ')'; 141 //let scale_elem = $(elem).find('.scale-element')[0]; 142 143 //scale_elem.style.transform = 144 // 'rotate(' + currentAngle + 'deg)' + 'scale(' + currentScale + ')'; 145 146 let $scale_elem = $(elem).find('.scale-element'); 147 148 $scale_elem.css( 149 'transform', 150 'rotate(' + currentAngle + 'deg)' + 'scale(' + currentScale + ')' 151 ); 152 115 153 116 154 dragMoveListener(event); … … 204 242 205 243 $(document).ready(function() { 206 207 const win1 = new WinBox({ 208 id: "my-winbox1", 209 title: 'Winbox + Interact Example 1', 210 x: 200, 211 y: 200, 212 width: '400px', 213 height: '400px', 214 border: "0.3em", 215 background: "#29e", 216 html: "<p style=\"padding: 8px; color: #000;\">This window can be dragged around and resized</p>" 217 }); 218 219 let draggable_options = getCoreDraggableOptions(); 220 let resizable_options = getCoreResizableOptions(); 221 222 draggable_options.autoScroll = true; 223 224 interact('#my-winbox1') 225 .draggable(draggable_options) 226 .resizable(resizable_options); 244 245 $.ajax({ 246 url: "http://localhost:8383/greenstone3/library?excerptid=collectionAndGroupLinks" 247 }) 248 .done(function(data) { 249 const winbox1 = new WinBox({ 250 id: "my-winbox1", 251 title: 'Winbox + Interact Example 1', 252 x: 200, 253 y: 200, 254 width: '900px', 255 height: '400px', 256 border: "0.3em", 257 background: "#29e", 258 html: data 259 260 }); 261 262 $('#my-winbox1 .wb-header').css("user-select", "none"); 263 $('#my-winbox1 .wb-header').css("touch-action","none"); 264 265 let draggable_options = getCoreDraggableOptions(); 266 let resizable_options = getCoreResizableOptions(); 267 268 draggable_options.autoScroll = true; 269 270 interact('#my-winbox1') 271 .draggable(draggable_options) 272 .resizable(resizable_options); 273 }); 227 274 228 275 … … 237 284 border: "0.3em", 238 285 background: "#29e", 239 html: "<p class =\"scale-element\" style=\"padding: 8px; color: #000;\">This window can be dragged around, rotated and zoomed in and out</p>"286 html: "<p classXXX=\"scale-element\" style=\"padding: 8px; color: #000;\">This window can be dragged around, rotated and zoomed in and out</p>" 240 287 }); 241 288 289 // user-select: none; 290 // touch-action: none; 291 292 let $win2 = $('#my-winbox2'); 293 let $scale_element_div = $('<div>').attr("class","scale-element"); 294 $scale_element_div.append($win2.children()).clone(); 295 296 $win2.empty().append($scale_element_div); 297 298 299 242 300 /* 243 301 interact('#my-winbox2') -
gs3-extensions/tabletop-dl/trunk/tabletop.css
r37529 r37555 22 22 font-family: Helvetica, Arial, "Open Sans", OpenSans, sans-serif; 23 23 color: var(--gs-fg-primary-col); 24 background-color: transparent; 24 25 } 25 26
Note:
See TracChangeset
for help on using the changeset viewer.