Changeset 7175 for extensions/GrumPluginClasses/js
- Timestamp:
- Oct 13, 2010, 5:22:04 PM (14 years ago)
- Location:
- extensions/GrumPluginClasses/js
- Files:
-
- 7 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/GrumPluginClasses/js/criteriaBuilder.js
r7142 r7175 69 69 { 70 70 var itemsId = { 71 group:'iCbGroup', 72 item:'iCbItem', 73 container:container, 74 } 75 76 var counters = { 77 group:0, 78 item:0, 79 } 80 81 var options = { 82 textAND:'AND', 83 textOR:'OR', 84 textHint:'', 85 classGroup:'', 86 classItem:'', 87 classOperator:'', 88 classHelper:'helper', 89 opacity:0.8, 90 onEdit:null, 91 onDelete:null, 92 onRequestSuccess:null, 93 onRequestError:null, 94 onGetPageSuccess:null, 95 onGetPageError:null, 96 imgEditUrl:'', 97 imgDeleteUrl:'', 98 ajaxUrl:'', 99 }; 100 101 var extraData = new Array(); 71 group:'iCbGroup', 72 item:'iCbItem', 73 container:container, 74 }, 75 counters = { 76 group:0, 77 item:0, 78 }, 79 options = { 80 textAND:'AND', 81 textOR:'OR', 82 textHint:'', 83 classGroup:'', 84 classItem:'', 85 classOperator:'', 86 classHelper:'helper', 87 opacity:0.8, 88 onEdit:null, 89 onDelete:null, 90 onRequestSuccess:null, 91 onRequestError:null, 92 onGetPageSuccess:null, 93 onGetPageError:null, 94 imgEditUrl:'', 95 imgDeleteUrl:'', 96 ajaxUrl:'', 97 }, 98 extraData = new Array(); 102 99 103 100 if(arguments.length==2) … … 213 210 break; 214 211 } 215 } 212 }; 216 213 217 214 /** … … 243 240 244 241 applyNested(); 245 } 242 }; 246 243 247 244 /** … … 253 250 { 254 251 $('#'+groupId).remove(); 255 } 252 }; 256 253 257 254 /** … … 292 289 293 290 extraData[counters.item]=data; 294 } 291 }; 295 292 296 293 /** … … 309 306 manage(); 310 307 } 311 } 308 }; 312 309 313 310 /** … … 327 324 extraData[eval(re.exec(itemId)[0])]=data; 328 325 } 329 } 326 }; 330 327 331 328 /** … … 339 336 counters.group=0; 340 337 extraData=new Array(); 341 } 338 }; 342 339 343 340 /** … … 370 367 } 371 368 return(returned); 372 } 369 }; 373 370 374 371 … … 410 407 411 408 return(serialized); 412 } 409 }; 413 410 414 411 … … 423 420 424 421 return(extraData[extraDataNumber]); 425 } 422 }; 426 423 427 424 … … 433 430 { 434 431 options = jQuery.extend(options, optionsToSet); 435 } 432 }; 436 433 437 434 /** … … 465 462 } 466 463 } 467 } 464 }; 468 465 469 466 /** … … 505 502 } 506 503 ); 507 } 504 }; 508 505 509 506 /** … … 531 528 } 532 529 ); 533 } 530 }; 534 531 535 532 /** … … 554 551 $('#'+groupId+'OpOR').css('display', 'none'); 555 552 } 556 } 553 }; 557 554 558 555 /** … … 580 577 ); 581 578 582 } 579 }; 583 580 584 581 /** … … 606 603 ); 607 604 608 } 605 }; 609 606 610 607 applyNested(); -
extensions/GrumPluginClasses/js/pagesNavigator.js
r7142 r7175 56 56 { 57 57 var itemsId = { 58 first:'iNavFirst', 59 last:'iNavLast', 60 previous:'iNavPrevious', 61 next:'iNavNext', 62 pageNumber:'iNavPage', 63 morePrevious:'iNavPrevMore', 64 moreNext:'iNavNextMore', 65 container:container, 66 }; 67 68 var pages = { 69 num:0, 70 current:1, 71 } 72 73 var options = { 74 numberItem:0, 75 itemPerPage:25, 76 defaultPage:0, 77 displayNumPage:7, 78 displayFirst:true, 79 displayLast:true, 80 displayPrevious:true, 81 displayNext:true, 82 hideMode:'1,<', // "1": hide nav if only 1 page to display, "<": hide nav First, Previous, Next & Last if num of page < displayNumPage 83 textFirst:'<<', 84 textLast:'>>', 85 textPrevious:'<', 86 textNext:'>', 87 textMore:'...', 88 onPageChange:null, 89 classActive:'', 90 classInactive:'', 91 classDisabled:'', 92 }; 58 first:'iNavFirst', 59 last:'iNavLast', 60 previous:'iNavPrevious', 61 next:'iNavNext', 62 pageNumber:'iNavPage', 63 morePrevious:'iNavPrevMore', 64 moreNext:'iNavNextMore', 65 container:container, 66 }, 67 pages = { 68 num:0, 69 current:1, 70 }, 71 options = { 72 numberItem:0, 73 itemPerPage:25, 74 defaultPage:0, 75 displayNumPage:7, 76 displayFirst:true, 77 displayLast:true, 78 displayPrevious:true, 79 displayNext:true, 80 hideMode:'1,<', // "1": hide nav if only 1 page to display, "<": hide nav First, Previous, Next & Last if num of page < displayNumPage 81 textFirst:'<<', 82 textLast:'>>', 83 textPrevious:'<', 84 textNext:'>', 85 textMore:'...', 86 onPageChange:null, 87 classActive:'', 88 classInactive:'', 89 classDisabled:'', 90 }; 93 91 94 92 … … 110 108 break; 111 109 } 112 } 110 }; 113 111 114 112 /** … … 122 120 { 123 121 return(Math.ceil(numItems/numPerPage)); 124 } 122 }; 125 123 126 124 /** … … 143 141 build(); 144 142 } 145 } 143 }; 146 144 147 145 /** … … 195 193 196 194 $('#'+itemsId.container).css('visibility', 'visible'); 197 } 195 }; 198 196 199 197 … … 206 204 prev=pages.current-1; 207 205 } 208 next=options.displayNumPage-1-prev 206 next=options.displayNumPage-1-prev; 207 209 208 if(pages.current+next>=pages.num) 210 209 { … … 283 282 ); 284 283 285 } 284 }; 286 285 287 286 … … 325 324 displayNav(); 326 325 if(options.onPageChange!=null && jQuery.isFunction(options.onPageChange)) options.onPageChange(pages.current); 327 } 326 }; 328 327 329 328 if(arguments.length==2) -
extensions/GrumPluginClasses/js/simpleTip.js
r6732 r7175 81 81 function simpleTip() 82 82 { 83 var items = new Array() ;84 var itemIndexInc = 0;85 varoptions={86 name:'',87 }83 var items = new Array(), 84 itemIndexInc = 0, 85 options={ 86 name:'', 87 }; 88 88 89 89 if(arguments.length>=1) … … 134 134 break; 135 135 } 136 } 136 }; 137 137 138 138 var add = function (item, options) … … 169 169 } 170 170 171 } 171 }; 172 172 173 173 … … 191 191 items.splice(index,1); 192 192 } 193 } 193 }; 194 194 195 195 … … 216 216 } 217 217 itemIndexInc=0; 218 } 218 }; 219 219 220 220 … … 228 228 } 229 229 return(-1); 230 } 230 }; 231 231 232 232 /** … … 255 255 display: 'block', 256 256 } 257 ) 257 ); 258 258 259 259 switch(items[itemIndex].options.targetPos) … … 415 415 .addClass(items[itemIndex].options.classes); 416 416 417 } 417 }; 418 418 419 419 var show = function () 420 420 { 421 421 $('#iSimpleTip'+options.name).css('display', 'block'); 422 } 422 }; 423 423 424 424 var hide = function () 425 425 { 426 426 $('#iSimpleTip'+options.name).css('display', 'none'); 427 } 427 }; 428 428 429 429 … … 435 435 $('body').append(text); 436 436 } 437 } 437 }; 438 438 439 439 -
extensions/GrumPluginClasses/js/ui.iconSelector.js
r7146 r7175 128 128 if(opt) $.extend(options, opt); 129 129 130 if(!data) 131 { 132 $this.data('options', options); 133 options.initialized=false; 134 } 130 $this.data('options', options); 135 131 136 132 if(!properties) … … 239 235 { 240 236 // set images list values 241 this.each(function() 242 { 243 var $this=$(this); 244 privateMethods.setImages($this, list); 245 return($this); 237 return this.each(function() 238 { 239 privateMethods.setImages($(this), list); 246 240 } 247 241 ); … … 250 244 { 251 245 // return images list values 252 var data= this.data('options');253 254 if( data)255 { 256 return( data.images);246 var options = this.data('options'); 247 248 if(options) 249 { 250 return(options.images); 257 251 } 258 252 else … … 267 261 { 268 262 // set numCols values 269 this.each(function() 270 { 271 var $this=$(this); 272 privateMethods.setCols($this, value); 273 return($this); 263 return this.each(function() 264 { 265 privateMethods.setCols($(this), value); 274 266 } 275 267 ); … … 278 270 { 279 271 // return images list values 280 var data= this.data('options');281 282 if( data)283 { 284 return( data.numCols);272 var options = this.data('options'); 273 274 if(options) 275 { 276 return(options.numCols); 285 277 } 286 278 else … … 295 287 { 296 288 // set numRows values 297 this.each(function() 298 { 299 var $this=$(this); 300 privateMethods.setRows($this, value); 301 return($this); 289 return this.each(function() 290 { 291 privateMethods.setRows($(this), value); 302 292 } 303 293 ); … … 306 296 { 307 297 // return images list values 308 var data= this.data('options');309 310 if( data)311 { 312 return( data.numRows);298 var options = this.data('options'); 299 300 if(options) 301 { 302 return(options.numRows); 313 303 } 314 304 else … … 323 313 { 324 314 // set cell width values 325 this.each(function() 326 { 327 var $this=$(this); 328 privateMethods.setCellWidth($this, value); 329 return($this); 315 return this.each(function() 316 { 317 privateMethods.setCellWidth($(this), value); 330 318 } 331 319 ); … … 334 322 { 335 323 // return images list values 336 var data= this.data('options');337 338 if( data)339 { 340 return( data.cellWidth);324 var options = this.data('options'); 325 326 if(options) 327 { 328 return(options.cellWidth); 341 329 } 342 330 else … … 351 339 { 352 340 // set cell width values 353 this.each(function() 354 { 355 var $this=$(this); 356 privateMethods.setCellHeight($this, value); 357 return($this); 341 return this.each(function() 342 { 343 privateMethods.setCellHeight($(this), value); 358 344 } 359 345 ); … … 362 348 { 363 349 // return images list values 364 var data= this.data('options');365 366 if( data)367 { 368 return( data.cellHeight);350 var options = this.data('options'); 351 352 if(options) 353 { 354 return(options.cellHeight); 369 355 } 370 356 else … … 379 365 { 380 366 // set selected value 381 this.each(function() 382 { 383 var $this=$(this); 384 privateMethods.setValue($this, value); 385 return($this); 367 return this.each(function() 368 { 369 privateMethods.setValue($(this), value); 386 370 } 387 371 ); … … 390 374 { 391 375 // return the selected value 392 var data=this.data('options'),376 var options=this.data('options'), 393 377 properties=this.data('properties'); 394 378 395 if( data && properties && properties.index>-1)396 { 397 return( data.images[properties.index]);379 if(options && properties && properties.index>-1 && properties.index<options.images.length) 380 { 381 return(options.images[properties.index]); 398 382 } 399 383 else … … 408 392 { 409 393 // set selected value 410 this.each(function() 411 { 412 var $this=$(this); 413 privateMethods.setEventPopup($this, value); 414 return($this); 394 return this.each(function() 395 { 396 privateMethods.setEventPopup($(this), value); 415 397 } 416 398 ); … … 419 401 { 420 402 // return the selected value 421 var data=this.data('options');422 423 if( data)424 { 425 return( data.popup);403 var options=this.data('options'); 404 405 if(options) 406 { 407 return(options.popup); 426 408 } 427 409 else … … 436 418 { 437 419 // set selected value 438 this.each(function() 439 { 440 var $this=$(this); 441 privateMethods.setEventChange($this, value); 442 return($this); 420 return this.each(function() 421 { 422 privateMethods.setEventChange($(this), value); 443 423 } 444 424 ); … … 447 427 { 448 428 // return the selected value 449 var data=this.data('options');450 451 if( data)452 { 453 return( data.change);429 var options=this.data('options'); 430 431 if(options) 432 { 433 return(options.change); 454 434 } 455 435 else … … 458 438 } 459 439 } 460 } ,// popup461 462 } // methods440 } // popup 441 442 }; // methods 463 443 464 444 … … 470 450 updateListArea : function (object) 471 451 { 472 var data=object.data('options'),452 var options=object.data('options'), 473 453 objects=object.data('objects'), 474 454 icon=objects.list.children().first(), 475 width=icon.outerWidth()* data.numCols,476 height=icon.outerHeight()* data.numRows;455 width=icon.outerWidth()*options.numCols, 456 height=icon.outerHeight()*options.numRows; 477 457 478 458 objects.listContainer.css( … … 492 472 setImages : function (object, value) 493 473 { 494 var data=object.data('options'),474 var options=object.data('options'), 495 475 objects=object.data('objects'), 496 476 properties=object.data('properties'); 497 data.images=value;477 options.images=value; 498 478 499 479 objects.list.children().unbind(); 500 480 objects.list.html(''); 501 for(var i=0;i< data.images.length;i++)481 for(var i=0;i<options.images.length;i++) 502 482 { 503 483 liClass=' ui-icon-selector-icon '; … … 507 487 } 508 488 objects.list.append( 509 $('<li indexValue="'+i+'" class="'+liClass+'" style="display:inline-block;width:'+ data.cellWidth+'px;height:'+data.cellHeight+'px;background-image:url('+data.images[i]+');"></li>')489 $('<li indexValue="'+i+'" class="'+liClass+'" style="display:inline-block;width:'+options.cellWidth+'px;height:'+options.cellHeight+'px;background-image:url('+options.images[i]+');"></li>') 510 490 .bind('click', 511 491 {object:object}, … … 519 499 } 520 500 521 return( data.images);501 return(options.images); 522 502 }, 523 503 setNumCols : function (object, value) 524 504 { 525 var data=object.data('options'),505 var options=object.data('options'), 526 506 properties=object.data('properties'); 527 if((!properties.initialized || data.numCols!=value) && value>0)528 { 529 data.numCols=value;530 } 531 return( data.numCols);507 if((!properties.initialized || options.numCols!=value) && value>0) 508 { 509 options.numCols=value; 510 } 511 return(options.numCols); 532 512 }, 533 513 setNumRows : function (object, value) 534 514 { 535 var data=object.data('options'),515 var options=object.data('options'), 536 516 properties=object.data('properties'); 537 if((!properties.initialized || data.numRows!=value) && value>0)538 { 539 data.numRows=value;540 } 541 return( data.numRows);517 if((!properties.initialized || options.numRows!=value) && value>0) 518 { 519 options.numRows=value; 520 } 521 return(options.numRows); 542 522 }, 543 523 setCellWidth : function (object, value) 544 524 { 545 var data=object.data('options'),525 var options=object.data('options'), 546 526 properties=object.data('properties'), 547 527 objects=object.data('objects'); 548 if((!properties.initialized || data.cellWidth!=value) && value>=0)549 { 550 data.cellWidth=value;528 if((!properties.initialized || options.cellWidth!=value) && value>=0) 529 { 530 options.cellWidth=value; 551 531 objects.container.css('width', value+'px'); 552 532 } 553 return( data.cellWidth);533 return(options.cellWidth); 554 534 }, 555 535 setCellHeight : function (object, value) 556 536 { 557 var data=object.data('options'),537 var options=object.data('options'), 558 538 properties=object.data('properties'), 559 539 objects=object.data('objects'); 560 if((!properties.initialized || data.cellHeight!=value) && value>=0)561 { 562 data.cellHeight=value;540 if((!properties.initialized || options.cellHeight!=value) && value>=0) 541 { 542 options.cellHeight=value; 563 543 objects.container.css('height', value+'px'); 564 544 } 565 return( data.cellHeight);545 return(options.cellHeight); 566 546 }, 567 547 setValue : function (object, value) 568 548 { 569 var data=object.data('options'),549 var options=object.data('options'), 570 550 properties=object.data('properties'), 571 551 index=-1; … … 574 554 { 575 555 case ':first': 576 if( data.images.length>0) index=0;556 if(options.images.length>0) index=0; 577 557 break; 578 558 case ':last': 579 index= data.images.length-1;559 index=options.images.length-1; 580 560 break; 581 561 default: 582 index=$.inArray(value, data.images);562 index=$.inArray(value, options.images); 583 563 break; 584 564 } … … 588 568 privateMethods.setValueByIndex(object, index, false); 589 569 } 590 return( data.images[properties.index]);570 return(options.images[properties.index]); 591 571 }, 592 572 setValueByIndex : function (object, value, trigger) 593 573 { 594 var data=object.data('options'),574 var options=object.data('options'), 595 575 properties=object.data('properties'), 596 576 objects=object.data('objects'); 597 if((!properties.initialized || properties.index!=value) && value>-1 && value< data.images.length)577 if((!properties.initialized || properties.index!=value) && value>-1 && value<options.images.length) 598 578 { 599 579 objects.list.children('.ui-icon-selector-selected-icon').removeClass('ui-icon-selector-selected-icon'); 600 580 objects.list.children('[indexValue="'+value+'"]').addClass('ui-icon-selector-selected-icon'); 601 581 properties.index=value; 602 objects.container.css('background-image', 'url('+ data.images[properties.index]+')');603 if(trigger && data.change) object.trigger('iconSelectorChange', [properties.index]);604 } 605 return( data.images[properties.index]);582 objects.container.css('background-image', 'url('+options.images[properties.index]+')'); 583 if(trigger && options.change) object.trigger('iconSelectorChange', [properties.index]); 584 } 585 return(options.images[properties.index]); 606 586 }, 607 587 displaySelector : function (object, value) 608 588 { 609 var data=object.data('options'),589 var options=object.data('options'), 610 590 properties=object.data('properties'), 611 591 objects=object.data('objects'); … … 625 605 objects.listContainer.css('display', 'none'); 626 606 } 627 if( data.popup) object.trigger('iconSelectorPopup', [properties.selectorVisible]);607 if(options.popup) object.trigger('iconSelectorPopup', [properties.selectorVisible]); 628 608 } 629 609 return(properties.selectorVisible); … … 631 611 setEventPopup : function (object, value) 632 612 { 633 var data=object.data('options');634 data.popup=value;613 var options=object.data('options'); 614 options.popup=value; 635 615 object.unbind('iconSelectorPopup'); 636 if(value) object.bind('iconSelectorPopup', data.popup);637 return( data.popup);616 if(value) object.bind('iconSelectorPopup', options.popup); 617 return(options.popup); 638 618 }, 639 619 setEventChange : function (object, value) 640 620 { 641 var data=object.data('options');642 data.change=value;621 var options=object.data('options'); 622 options.change=value; 643 623 object.unbind('iconSelectorChange'); 644 if(value) object.bind('iconSelectorChange', data.change);645 return( data.change);624 if(value) object.bind('iconSelectorChange', options.change); 625 return(options.change); 646 626 } 647 } 627 }; 648 628 649 629
Note: See TracChangeset
for help on using the changeset viewer.