变更集1524886
时间戳: 2016年10月30日下午04:48:01 ( 8年 (之前) 位置: eve-shipinfo/trunk 文件夹: -
添加了8个 11已编辑
-
类/EVEShipInfo.php (已修改) ( 6个差异 ) -
classes/EVEShipInfo/Admin/Page.php类 (已修改) ( 1个差异 ) -
classes/EVEShipInfo/Admin/Page/Main/EFT安装.php (已修改) ( 1个差异 ) -
classes/EVEShipInfo/Admin/UI.php类 (已修改) ( 1个差异 ) -
classes/EVEShipInfo/Admin/UI/Icon.php类 (已修改) ( 3个差异 ) -
classes/EVEShipInfo/AjaxHandler.php类 (新增) -
classes/EVEShipInfo/AjaxMethod类 (新增) -
classes/EVEShipInfo/AjaxMethod.php类 (新增) -
classes/EVEShipInfo/AjaxMethod/CheckForUpdate.php类 (新增) -
classes/EVEShipInfo/AjaxMethod/FittingSetVisibility.php类 (新增) -
classes/EVEShipInfo/EFTManager.php (已修改) ( 1个差异 ) -
css/管理员.css (已修改) ( 1个差异 ) -
错误代码.txt (已修改) ( 1个差异 ) -
图像 (新增) -
图像/微调器.gif (新增) -
js/admin/admin.js (新增) -
js/admin/仪表盘.js (已修改) ( 1个差异 ) -
js/admin/FittingsList.js (已修改) ( 1个差异 ) -
自述.txt (已修改) ( 1个差异 )
图例:
未修改 补充 远离的
-
eve-shipinfo/trunk/classes/EVEShipInfo.php 1515401兰特 1524886卢比 42 42 const ERROR_COULD_NOT_CREATE_SQL_STRUCTURE=1303; 43 43 44 常量ERROR_CANNOT_FIND_CLASS_FILE=1304; 45 44 46 /** 45 47 *用于 … … 97 99 98 100 add_action('init',数组($this,'handle_init'); 99 add_action('wp_ajax_eveshipinfo_checkforupdate',数组($this,'ajax_checkforupdate'); 101 102 $this->handle_initAJAX方法(); 103 100 104 add_action('admin_init',数组($this,'handle_initPluginSettings'); 101 105 add_action('admin_menu',数组($this,'handle_initAdminMenu')); … … 106 110 107 111 /** 108 *用于从项目主页获取数据库版本的Ajax处理程序。 109 */ 110 公共函数ajax_checkForUpdate() 111 { 112 $url=$this->getHomepageURL()。'/ api/getDataVersion.php'; 113 114 $result=wp_remote_get($url); 115 116 $state=“成功”; 117 if(iswp_error($result)){ 118 $state=“错误”; 119 $data=$result->get_error_message(); 120 }其他{ 121 $code=wp_remote_retrieve_response_code($result); 122 if($code!=200){ 123 $state=“错误”; 124 $数据=wp_remote_retrieve_response_message($result); 125 }其他{ 126 $infoRemote=EVEShipInfo::parseVersion(trim($result['body'])); 127 $infoLocal=EVEShipInfo::parseVersion($this->getDataVersion()); 128 $update=false; 129 if($infoRemote['date']>$infoLocal['date']){ 130 $update=true; 131 } 132 133 $data=数组( 134 “remoteVersion”=>$infoRemote[“版本”], 135 “updateAvailable”=>$update, 136 ); 137 } 138 } 139 140 $response=数组( 141 “url”=>$url, 142 “state”=>$state, 143 “data”=>$data 144 ); 145 146 echo json_encode($response); 147 wp_die(); 112 *设置插件可用的所有AJAX方法, 113 *通过检查AjaxMethod中可用的选项 114 *classes文件夹。 将每个添加为特定插件 115 *AJAX方法。 116 */ 117 受保护的函数handle_initAJAX方法() 118 { 119 $this->loadClass(“EVEShipInfo_AjaxHandler”); 120 121 $names=$this->getClassNamesFromFolder($this->getClassesFolder)。”/ EVEShipInfo/AjaxMethod); 122 123 foreach($names作为$name){ 124 //为了避免在每个请求上为每个方法加载整个ajax类, 125 //我们使用轻量级处理程序,它根据需要加载类。 126 $handler=新的EVEShipInfo_AjaxHandler($this,$name); 127 add_action(“wp_ajax_eveshipinfo_”.strtolower($name),数组($handler,“execute”); 128 } 148 129 } 149 130 … … 582 563 $this->shortcodeIDs=array(); 583 564 584 $folder=$this->get 目录()。'/ 类 /EVEShipInfo/短代码'; 565 $folder=$this->get ClassesFolder()。' /EVEShipInfo/短代码'; 585 566 if(!file_exists($folder)){ 586 567 return$this->shortcodeID; 587 568 } 588 569 570 $this->shortcodeIDs=$this->获取ClassNamesFromFolder($folder); 571 572 return$this->shortcodeID; 573 } 574 575 /** 576 *检索指定文件夹中的所有PHP文件名, 577 *无扩展。 578 * 579 *@param string$文件夹 580 *@返回字符串[] 581 */ 582 公共函数getClassNamesFromFolder($folder) 583 { 584 $names=数组(); 589 585 $d=新的DirectoryTerator($folder); 590 586 foreach($d作为$item){ 591 $file=$item->getFilename(); 592 $ext=路径信息($文件,pathinfo_EXTENSION); 593 if($ext!='php'){ 594 继续; 595 } 596 597 $此->短代码ID s[]=str_replace('.php','',$文件); 598 } 599 600 返回$ 这个->shortcodeID s; 587 $file=$item->getFilename(); 588 $ext=路径信息($文件,pathinfo_EXTENSION); 589 if($ext!='php'){ 590 继续; 591 } 592 593 $名称 s[]=str_replace('.php','',$文件); 594 } 595 596 返回$ 名称 s; 601 597 } 602 598 … … 667 663 { 668 664 if(is_admin()){ 669 $this->addScript('admin/FittingsList.js',数组('jquery')); 665 $this->addScript('admin/admin.js',数组('jquery')); 666 $this->addScript('admin/FittingsList.js',数组('jquery')); 670 667 $this->addScript('admin/Themes.js',数组('jquery')); 671 668 $this->addStyle('admin.css'); … … 1015 1012 } 1016 1013 1017 $file=$this->dir.'/classes/'.str_replace('_','/',$className)。'。 php'; 1014 $file=$this->getClassesFolder().'/'。 str_replace('_','/',$className)。'。 php'; 1015 if(!file_exists($file)){ 1016 抛出新的EVEShipInfo_Exception( 1017 '找不到类文件', 1018 冲刺( 1019 '尝试从文件[%s]加载类[%s]。', 1020 $className, 1021 $文件 1022 ), 1023 自身::ERROR_CANNOT_FIND_CLASS_FILE 1024 ); 1025 } 1026 1018 1027 require_onex$文件; 1028 } 1029 1030 /** 1031 *检索插件“classes”文件夹的完整路径。 1032 *@返回字符串 1033 */ 1034 公共函数getClassesFolder() 1035 { 1036 return$this->dir.'/classes'; 1019 1037 } 1020 1038 -
eve-shipinfo/trunk/classes/EVEShipInfo/Admin/Page.php 1296177卢比 1524886卢比 195 195 $内容。 196 196 “</div>”。 197 “</div>”; 198 197 '</div>'。 198 $this->ui->renderJS(); 199 199 200 返回$html; 200 201 } -
eve-shipinfo/trunk/classes/EVEShipInfo/Admin/Page/Main/EFT安装.php 1512895元 1524886卢比 139 139 “</tr>”; 140 140 }其他{ 141 foreach($fits as$fit){ 142 $public=$this->ui->icon()->visibilityPrivate()->makeDangerous().''__ (“Private”,“eve-shipinfo”); 143 if($fit->isPublic()){ 144 $public=$this->ui->icon()->visibilityPublic()->makeSuccess().''__ (“Public”,“eve-shipinfo”); 145 } 141 foreach($fits as$fit) 142 { 143 $jsID=EVEShipInfo::nextJSID(); 144 $displayPrivate=“无”; 145 $displayPublic='none'; 146 147 $this->ui->addJSOnload(sprintf( 148 “jQuery('#%s-private,#%s-public').dblclick(function(){FittingsList.ToggleVisibility('%s','%s');}).addClass('shipinfo-clickable')”, 149 $jsID, 150 $jsID, 151 $fit->getID(), 152 $jsID 153 )); 154 155 if($fit->isPublic()){$displayPublic='block';} 156 if($fit->isPrivate()){$displayPrivate='block';} 157 158 $公共= 159 '<div id=“'.$jsID.'-private”class=“适合可见性切换”style=“display:'.$displayPrivate.'”title=“'.__('双击切换.','eve shipinfo').'”>'。 160 $this->ui->icon()->visibilityPrivate() 161 ->生成危险()。 162 ' '. 163 __(“私人”,“eve-shipinfo”)。 164 '</div>'。 165 '<div id=“'.$jsID.'-public”class=“fit-visibility-toggle”style=“display:'.$displayPublic.'”title=“'.__('双击切换','eve-shipinfo').'”>'。 166 $this->ui->icon()->可见性Public() 167 ->makeSuccess()。 168 ' '. 169 __(“公共”,“eve-shipinfo”)。 170 '</div>'。 171 '<div id=“'.$jsID.'-loading”style=“display:none”>'。 172 $this->ui->icon()->微调器() 173 ->addClass('spinner-datagrid')。 174 ' '. 175 __(“正在更新…”,“eve-shipinfo”)。 176 “</div>”; 146 177 147 178 $invalid=“”; -
eve-shipinfo/trunk/classes/EVEShipInfo/Admin/UI.php 123586卢比 1524886卢比 97 97 return new EVEShipInfo_Admin_UI_Icon(); 98 98 } 99 100 受保护的$jsOnload=array(); 101 受保护的$jsHead=array(); 102 103 /** 104 *添加要在页面加载时执行的javascript语句。 105 * 106 *@param string$语句 107 *@return EVEShipInfo_Admin_UI 108 */ 109 公共函数addJSOnload($语句) 110 { 111 $this->jsOnload[]=rtrim(trim($statement),';'); 112 返回$this; 113 } 114 115 /** 116 *添加要在页面加载之前执行的javascript语句。 117 * 118 *@param string$语句 119 *@return EVEShipInfo_Admin_UI 120 */ 121 公共函数addJSHead($statement) 122 { 123 $this->jsHead[]=rtrim(trim($statement),';'); 124 返回$this; 125 } 126 127 公共函数renderJS() 128 { 129 if(空($this->jsOnload)&&empty($this->jsHead)){ 130 返回“”; 131 } 132 133 $head=$this->jsHead; 134 if(!空($this->jsOnload)){ 135 $head[]=“jQuery(document).ready(function(){'.interbulde(';',$this->jsOnload).';})”; 136 } 137 138 return“<script>”.implode(“;”,$head)。“</ 脚本>'; 139 } 99 140 } -
eve-shipinfo/trunk/classes/EVEShipInfo/Admin/UI/Icon.php 1417468兰特 1524886卢比 25 25 'LIST_VIEW'=>'LIST-VIEW', 26 26 “主题”=>“管理外观”, 27 “UPDATE”=>“UPDATE” 27 'UPDATE'=>'UPDATE', 28 'SPINNER'=>'_SPINNER' 28 29 ); 29 30 … … 59 60 公共函数visibilityPublic(){return$this->setType('VISIBILITY_public');} 60 61 公共函数visibilityPrivate(){return$this->setType('VISIBILITY_PRIVATE');} 62 公共函数spinner(){return$this->setType('spinner');} 61 63 62 64 /** … … 138 140 公共函数render() 139 141 { 140 $this->setAttribute('class','dashicons-dashicons-'.self::$types[$this->type].''.improde('',$this-->类)); 142 if($this->type==“旋转器”){ 143 $this->setAttribute('class','shipinfo-spinner'); 144 }其他{ 145 $this->setAttribute('class','dashicons-dashicons-'.self::$types[$this->type].''.improde('',$this-->类)); 146 } 141 147 142 148 if(!空($this->styles)){ -
eve-shipinfo/trunk/classes/EVEShipInfo/EFTManager.php 1411207元 1524886卢比 276 276 $label=修剪($result[2][0]); 277 277 278 $this->加载 模块 (); 278 $this->加载 (); 279 279 280 280 $modules=数组(); -
eve-shipinfo/ttrunk/css/admin.css 1417468兰特 1524886卢比 196 196 光标:缩小; 197 197 } 198 199 .shipinfo-旋转器{ 200 显示:内联块; 201 背景:url(../images/spinner.gif)无重复中心; 202 最小宽度:20px; 203 最小高度:20px; 204 线高:1; 205 垂直对齐:顶部; 206 } 207 208 .shipinfo-单击{ 209 光标:指针; 210 } 211 212 .fit-visibility-toggle.shipinfo-clickable:悬停{ 213 颜色:#0073A; 214 } -
eve-shipinfo/trunk/errorcodes.txt 1417468兰特 1524886卢比 1 1 8 001 1 1 9 001 -
eve-shipinfo/ttrunk/js/admin/Dashboard.js 1515401兰特 1524886卢比 9 9 jQuery('#updatecheck-available').hide(); 10 10 11 jQuery.ajax({ 12 “url”:ajaxurl, 13 “数据”:{ 14 “操作”:“veshipinfo_checkforupdate” 15 }, 16 “成功”:函数(数据){ 11 EVEShipInfo_管理。 AJAX公司( 12 '检查更新', 13 空, 14 功能(数据){ 17 15 EVEShipInfo_Dashboard。 Handle_UpdateCheckSuccess(数据); 18 16 }, 19 “error”:函数(jqXHR,textStatus,errorThrown){ 20 EVEShipInfo_Dashboard。 Handle_UpdateCheckFailure(errorThrown); 21 }, 22 “dataType”:“json” 23 }); 17 函数(errorMessage){ 18 EVEShipInfo_Dashboard。 Handle_UpdateCheckFailure(错误消息); 19 } 20 ); 24 21 }, 25 22 -
eve-shipinfo/ttrunk/js/admin/FittingsList.js 1112684兰特 1524886卢比 15 15 jQuery('.fit-checkbox').prop('checked',true); 16 16 this.allSelected=true; 17 }, 18 19 切换可见性:函数(fitID,jsID) 20 { 21 //避免双击后选择文本 22 var sel=window.getSelection(); 23 if(sel){sel.removeAllRanges();} 24 25 var elPublic=jQuery('#'+jsID+'-public'); 26 var elPrivate=jQuery('#'+jsID+'-private'); 27 var elLoader=jQuery('#'+jsID+'-loading'); 28 29 var有效载荷={ 30 “fitID”:fitID, 31 “changeTo”:“私人” 32 }; 33 34 if(elPrivate.is(':visible')){ 35 payload.changeTo=“公共”; 36 } 37 38 elPublic.hide(); 39 elPrivate.hide(); 40 elLoader.show(); 41 42 EVEShipInfo_管理。 AJAX公司( 43 “FittingSetVisibility”, 44 有效载荷, 45 功能(数据){ 46 配件列表。 Handle_ToggleVisibilitySuccess(数据,jsID); 47 }, 48 函数(errorMessage){ 49 配件列表。 Handle_ToggleVisibilityFailure(错误消息,有效负载,jsID); 50 } 51 ); 52 }, 53 54 Handle_ToggleVisibilityFailure:函数(errorMessage,有效负载,jsID) 55 { 56 console.log('ERROR|无法更新可见性|'+errorMessage); 57 58 jQuery('#'+jsID+'-loading').hide(); 59 60 if(payload.changeTo==“公共”){ 61 jQuery('#'+jsID+'-private').show(); 62 }其他{ 63 jQuery('#'+jsID+'-public').show(); 64 } 65 }, 66 67 Handle_ToggleVisibilitySuccess:函数(响应,jsID) 68 { 69 jQuery('#'+jsID+'-loading').hide(); 70 71 if(response.visibility==“私有”){ 72 jQuery('#'+jsID+'-private').show(); 73 }其他{ 74 jQuery('#'+jsID+'-public').show(); 75 } 17 76 } 18 77 }; -
eve-shipinfo/trunk/readme.txt版本 1515807兰特 1524886卢比 54 54 55 55 = 2.1 = 56 *将“质量”过滤器添加到列表短代码中,以按船舶质量限制列表 56 57 *将“船舶”过滤器添加到列表快捷代码中,以按名称或id显示特定船舶 57 *将“质量”过滤器添加到列表短代码中,以按船舶质量限制列表 58 *修复了导入EFT XML文件时的错误 59 *双击图标,可在列表中切换EFT配件的可见性 60 *改进了Ajax调用对未来功能的内部处理 58 61 59 62 = 2.0 =