Ticket #3343: 3343c.diff
| File 3343c.diff, 14.0 KB (added by mdawaffe, 5 years ago) |
|---|
-
wp-includes/js/crop/cropper.js
109 109 this.handleW=Builder.node("div",{"class":_f+"handle "+_f+"handleW"}); 110 110 this.handleNW=Builder.node("div",{"class":_f+"handle "+_f+"handleNW"}); 111 111 this.selArea=Builder.node("div",{"class":_f+"selArea"},[Builder.node("div",{"class":_f+"marqueeHoriz "+_f+"marqueeNorth"},[Builder.node("span")]),Builder.node("div",{"class":_f+"marqueeVert "+_f+"marqueeEast"},[Builder.node("span")]),Builder.node("div",{"class":_f+"marqueeHoriz "+_f+"marqueeSouth"},[Builder.node("span")]),Builder.node("div",{"class":_f+"marqueeVert "+_f+"marqueeWest"},[Builder.node("span")]),this.handleN,this.handleNE,this.handleE,this.handleSE,this.handleS,this.handleSW,this.handleW,this.handleNW,Builder.node("div",{"class":_f+"clickArea"})]); 112 $(this.selArea).setStyle({backgroundColor:"transparent",backgroundRepeat:"no-repeat",backgroundPosition:"0 0"});112 Element.setStyle($(this.selArea),{backgroundColor:"transparent",backgroundRepeat:"no-repeat",backgroundPosition:"0 0"}); 113 113 this.imgWrap.appendChild(this.img); 114 114 this.imgWrap.appendChild(this.dragArea); 115 115 this.dragArea.appendChild(this.selArea); … … 131 131 this.imgW=this.img.width; 132 132 this.imgH=this.img.height; 133 133 if(!this.isIE){ 134 $(this.overlay).setStyle({width:this.imgW+"px",height:this.imgH+"px"});135 $(this.overlay).hide();136 $(this.selArea).setStyle({backgroundImage:"url("+this.img.src+")"});134 Element.setStyle($(this.overlay),{width:this.imgW+"px",height:this.imgH+"px"}); 135 Element.hide($(this.overlay)); 136 Element.setStyle($(this.selArea),{backgroundImage:"url("+this.img.src+")"}); 137 137 }else{ 138 $(this.north).setStyle({height:0});139 $(this.east).setStyle({width:0,height:0});140 $(this.south).setStyle({height:0});141 $(this.west).setStyle({width:0,height:0});138 Element.setStyle($(this.north),{height:0}); 139 Element.setStyle($(this.east),{width:0,height:0}); 140 Element.setStyle($(this.south),{height:0}); 141 Element.setStyle($(this.west),{width:0,height:0}); 142 142 } 143 $(this.imgWrap).setStyle({"width":this.imgW+"px","height":this.imgH+"px"});144 $(this.selArea).hide();143 Element.setStyle($(this.imgWrap),{"width":this.imgW+"px","height":this.imgH+"px"}); 144 Element.hide($(this.selArea)); 145 145 var _15=Position.positionedOffset(this.imgWrap); 146 146 this.wrapOffsets={"top":_15[1],"left":_15[0]}; 147 147 var _16={x1:0,y1:0,x2:0,y2:0}; … … 151 151 _16.y1=Math.ceil((this.imgH-this.options.ratioDim.y)/2); 152 152 _16.x2=_16.x1+this.options.ratioDim.x; 153 153 _16.y2=_16.y1+this.options.ratioDim.y; 154 this.selArea.show();154 Element.show(this.selArea); 155 155 this.drawArea(); 156 156 this.endCrop(); 157 157 } … … 339 339 return _37; 340 340 },drawArea:function(){ 341 341 if(!this.isIE){ 342 $(this.overlay).show();342 Element.show($(this.overlay)); 343 343 } 344 344 var _3e=this.calcW(); 345 345 var _3f=this.calcH(); … … 402 402 },startResize:function(e){ 403 403 this.startCoords=this.cloneCoords(this.areaCoords); 404 404 this.resizing=true; 405 this.resizeHandle=E vent.element(e).classNames().toString().replace(/([^N|NE|E|SE|S|SW|W|NW])+/,"");405 this.resizeHandle=Element.classNames(Event.element(e)).toString().replace(/([^N|NE|E|SE|S|SW|W|NW])+/,""); 406 406 Event.stop(e); 407 407 },startDrag:function(e){ 408 this.selArea.show();408 Element.show(this.selArea); 409 409 this.clickCoords=this.getCurPos(e); 410 410 this.setAreaCoords({x1:this.clickCoords.x,y1:this.clickCoords.y,x2:this.clickCoords.x,y2:this.clickCoords.y}); 411 411 this.dragging=true; … … 496 496 this.previewImg=this.img.cloneNode(false); 497 497 this.options.displayOnInit=true; 498 498 this.hasPreviewImg=true; 499 this.previewWrap.addClassName("imgCrop_previewWrap");500 this.previewWrap.setStyle({width:this.options.minWidth+"px",height:this.options.minHeight+"px"});499 Element.addClassName(this.previewWrap,"imgCrop_previewWrap"); 500 Element.setStyle(this.previewWrap,{width:this.options.minWidth+"px",height:this.options.minHeight+"px"}); 501 501 this.previewWrap.appendChild(this.previewImg); 502 502 } 503 503 },subDrawArea:function(){ … … 513 513 _5d.left=_5c.x; 514 514 _5d.top=_5c.y; 515 515 } 516 }}); 517 No newline at end of file 516 }}); -
wp-includes/js/wp-ajax-js.php
38 38 this.myResponseElement = p; 39 39 }, 40 40 parseAjaxResponse: function() { // 1 = good, 0 = strange (bad data?), -1 = you lack permission 41 if ( this.transport.responseXML && typeof this.transport.responseXML == 'object' ) {41 if ( this.transport.responseXML && typeof this.transport.responseXML == 'object' && ( this.transport.responseXML.xml || 'undefined' == typeof this.transport.responseXML.xml ) ) { 42 42 var err = this.transport.responseXML.getElementsByTagName('wp_error'); 43 43 if ( err[0] ) { 44 44 var msg = $A(err).inject( '', function(a, b) { return a + '<p>' + b.firstChild.nodeValue + '</p>'; } ); 45 this.myResponseElement.update('<div class="error">' + msg + '</div>');45 Element.update(this.myResponseElement,'<div class="error">' + msg + '</div>'); 46 46 return false; 47 47 } 48 48 return true; 49 49 } 50 50 var r = this.transport.responseText; 51 51 if ( isNaN(r) ) { 52 this.myResponseElement.update('<div class="error"><p>' + r + '</p></div>');52 Element.update(this.myResponseElement,'<div class="error"><p>' + r + '</p></div>'); 53 53 return false; 54 54 } 55 55 var r = parseInt(r,10); 56 56 if ( -1 == r ) { 57 this.myResponseElement.update("<div class='error'><p><?php _e("You don't have permission to do that."); ?></p></div>");57 Element.update(this.myResponseElement,"<div class='error'><p><?php _e("You don't have permission to do that."); ?></p></div>"); 58 58 return false; 59 59 } else if ( 0 == r ) { 60 this.myResponseElement.update("<div class='error'><p><?php _e("Something strange happened. Try refreshing the page."); ?></p></div>");60 Element.update(this.myResponseElement,"<div class='error'><p><?php _e("Something strange happened. Try refreshing the page."); ?></p></div>"); 61 61 return false; 62 62 } 63 63 return true; -
wp-includes/js/list-manipulation-js.php
23 23 this.theList = $(theListId ? theListId : 'the-list'); 24 24 if ( !this.theList ) 25 25 return false; 26 this.theList.cleanWhitespace();26 Element.cleanWhitespace(this.theList); 27 27 }, 28 28 29 29 // sends add-what and fields contained in where … … 54 54 showLinkMessage += "<a href='#" + what + '-' + id + "'><?php echo js_escape(__('Jump to new item')); ?>"; 55 55 }); 56 56 if ( tempObj.showLink && showLinkMessage ) 57 ajaxAdd.myResponseElement.update("<div id='jumplink' class='updated fade'><p>" + showLinkMessage + "</p></div>");57 Element.update(ajaxAdd.myResponseElement,"<div id='jumplink' class='updated fade'><p>" + showLinkMessage + "</p></div>"); 58 58 } 59 59 if ( tempObj.addComplete && typeof tempObj.addComplete == 'function' ) 60 60 tempObj.addComplete( what, where, update, transport ); … … 82 82 var action = 'delete-' + what + '&id=' + id; 83 83 var idName = what.replace('-as-spam','') + '-' + id; 84 84 ajaxDel.addOnComplete( function(transport) { 85 ajaxDel.myResponseElement.update('');85 Element.update(ajaxDel.myResponseElement,''); 86 86 tempObj.destore(action); 87 87 if( tempObj.delComplete && typeof tempObj.delComplete == 'function' ) 88 88 tempObj.delComplete( what, id, transport ); … … 105 105 var action = 'dim-' + what + '&id=' + id; 106 106 var idName = what + '-' + id; 107 107 ajaxDim.addOnComplete( function(transport) { 108 ajaxDim.myResponseElement.update('');108 Element.update(ajaxDim.myResponseElement,''); 109 109 tempObj.destore(action); 110 110 if ( tempObj.dimComplete && typeof tempObj.dimComplete == 'function' ) 111 111 tempObj.dimComplete( what, id, dimClass, transport ); … … 120 120 121 121 addListItem: function( h ) { 122 122 new Insertion[this.topAdder ? 'Top' : 'Bottom'](this.theList,h); 123 this.theList.cleanWhitespace();123 Element.cleanWhitespace(this.theList); 124 124 var id = this.topAdder ? this.theList.firstChild.id : this.theList.lastChild.id; 125 125 if ( this.alt ) 126 126 if ( this.theList.childNodes.length % 2 ) 127 $(id).addClassName(this.alt);127 Element.addClassName($(id),this.alt); 128 128 Fat.fade_element(id); 129 129 }, 130 130 … … 145 145 replaceListItem: function( id, h, update ) { 146 146 id = $(id); 147 147 if ( !update ) { 148 id.remove();148 Element.remove(id); 149 149 this.addListItem( h ); 150 150 return; 151 151 } … … 156 156 // toggles class 157 157 dimItem: function( id, dimClass, noFade ) { 158 158 id = $(id); 159 if ( id.hasClassName(dimClass) ) {159 if ( Element.hasClassName(id,dimClass) ) { 160 160 if ( !noFade ) 161 161 Fat.fade_element(id.id,null,700,null); 162 id.removeClassName(dimClass);162 Element.removeClassName(id,dimClass); 163 163 } else { 164 164 if ( !noFade ) 165 165 Fat.fade_element(id.id,null,700,'#FF3333'); 166 id.addClassName(dimClass);166 Element.addClassName(id,dimClass); 167 167 } 168 168 }, 169 169 … … 183 183 this.theList.replaceChild(this.dataStore[action], $(id)); 184 184 delete(this.dataStore[action]); 185 185 if ( error ) { 186 func = function() { $(id).setStyle( { 'background-color': '#FF3333' }); }186 func = function() { Element.setStyle($(id),{backgroundColor:'#FF3333'}); } 187 187 func(); setTimeout(func, 705); // Hit it twice in case it's still fading. 188 188 } 189 189 }, … … 246 246 return; 247 247 var alt = this.alt; 248 248 var offset = this.altOffset; 249 var listItems = $A(this.theList.childNodes).findAll( function(i) { return i.visible() } );249 var listItems = $A(this.theList.childNodes).findAll( function(i) { return Element.visible(i) } ); 250 250 listItems.each( function(i,n) { 251 251 if ( ( n + offset ) % 2 ) 252 i.removeClassName(alt);252 Element.removeClassName(i,alt); 253 253 else 254 i.addClassName(alt);254 Element.addClassName(i,alt); 255 255 }); 256 256 } 257 257 }); -
wp-includes/script-loader.php
20 20 $this->add( 'wp_tiny_mce', $mce_config, array('tiny_mce'), '20061113' ); 21 21 $this->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.5.0'); 22 22 $this->add( 'autosave', '/wp-includes/js/autosave-js.php', array('prototype', 'sack'), '20070116'); 23 $this->add( 'wp-ajax', '/wp-includes/js/wp-ajax-js.php', array('prototype'), ' 4459');24 $this->add( 'listman', '/wp-includes/js/list-manipulation-js.php', array('wp-ajax', 'fat'), ' 4583');23 $this->add( 'wp-ajax', '/wp-includes/js/wp-ajax-js.php', array('prototype'), '20070118'); 24 $this->add( 'listman', '/wp-includes/js/list-manipulation-js.php', array('wp-ajax', 'fat'), '20070118'); 25 25 $this->add( 'scriptaculous-root', '/wp-includes/js/scriptaculous/wp-scriptaculous.js', array('prototype'), '1.6.1'); 26 26 $this->add( 'scriptaculous-builder', '/wp-includes/js/scriptaculous/builder.js', array('scriptaculous-root'), '1.6.1'); 27 27 $this->add( 'scriptaculous-dragdrop', '/wp-includes/js/scriptaculous/dragdrop.js', array('scriptaculous-builder'), '1.6.1'); … … 29 29 $this->add( 'scriptaculous-slider', '/wp-includes/js/scriptaculous/slider.js', array('scriptaculous-effects'), '1.6.1'); 30 30 $this->add( 'scriptaculous-controls', '/wp-includes/js/scriptaculous/controls.js', array('scriptaculous-root'), '1.6.1'); 31 31 $this->add( 'scriptaculous', '', array('scriptaculous-dragdrop', 'scriptaculous-slider', 'scriptaculous-controls'), '1.6.1'); 32 $this->add( 'cropper', '/wp-includes/js/crop/cropper.js', array('scriptaculous-dragdrop'), ' 1');32 $this->add( 'cropper', '/wp-includes/js/crop/cropper.js', array('scriptaculous-dragdrop'), '20070118'); 33 33 if ( is_admin() ) { 34 34 $this->add( 'dbx-admin-key', '/wp-admin/dbx-admin-key-js.php', array('dbx'), '3651' ); 35 $this->add( 'ajaxcat', '/wp-admin/cat-js.php', array('listman'), ' 3684' );35 $this->add( 'ajaxcat', '/wp-admin/cat-js.php', array('listman'), '20070118' ); 36 36 $this->add( 'admin-categories', '/wp-admin/categories.js', array('listman'), '3684' ); 37 37 $this->add( 'admin-custom-fields', '/wp-admin/custom-fields.js', array('listman'), '3733' ); 38 38 $this->add( 'admin-comments', '/wp-admin/edit-comments.js', array('listman'), '3847' ); 39 39 $this->add( 'admin-users', '/wp-admin/users.js', array('listman'), '4583' ); 40 40 $this->add( 'xfn', '/wp-admin/xfn.js', false, '3517' ); 41 $this->add( 'upload', '/wp-admin/upload-js.php', array('prototype'), '2007011 6' );41 $this->add( 'upload', '/wp-admin/upload-js.php', array('prototype'), '20070118' ); 42 42 } 43 43 } 44 44 -
wp-admin/upload-js.php
207 207 if ( !prep ) { 208 208 var filesEl = $('upload-files'); 209 209 if ( filesEl ) 210 filesEl.show();210 Element.show(filesEl); 211 211 var navEl = $('current-tab-nav'); 212 212 if ( navEl ) 213 navEl.show();213 Element.show(navEl); 214 214 } 215 215 if ( !this.ID ) 216 216 this.grabImageData(0); 217 217 var div = $('upload-file'); 218 218 if ( div ) 219 div.remove();219 Element.remove(div); 220 220 return false; 221 221 }, 222 222 -
wp-admin/cat-js.php
8 8 var jaxcat = $('jaxcat'); 9 9 if ( !jaxcat ) 10 10 return false; 11 jaxcat.update('<span id="ajaxcat"><input type="text" name="newcat" id="newcat" size="16" autocomplete="off"/><input type="button" name="Button" id="catadd" value="<?php echo js_escape(__('Add')); ?>"/><span id="howto"><?php echo js_escape(__('Separate multiple categories with commas.')); ?></span></span>');11 Element.update(jaxcat,'<span id="ajaxcat"><input type="text" name="newcat" id="newcat" size="16" autocomplete="off"/><input type="button" name="Button" id="catadd" value="<?php echo js_escape(__('Add')); ?>"/><span id="howto"><?php echo js_escape(__('Separate multiple categories with commas.')); ?></span></span>'); 12 12 $('newcat').onkeypress = function(e) { return killSubmit("catList.ajaxAdder('category','jaxcat');", e); }; 13 13 $('catadd').onclick = function() { catList.ajaxAdder('category', 'jaxcat'); }; 14 14 }
