Changeset 1237087
- Timestamp:
- 09/03/2015 10:35:26 AM (11 years ago)
- Location:
- eve-shipinfo/trunk
- Files:
-
- 4 added
- 7 edited
-
assets/theme-Dark.jpg (added)
-
assets/theme-Light.jpg (added)
-
classes/EVEShipInfo.php (modified) (5 diffs)
-
classes/EVEShipInfo/Admin/Page/Main.php (modified) (1 diff)
-
classes/EVEShipInfo/Admin/Page/Main/Themes.php (added)
-
classes/EVEShipInfo/Admin/UI/Form/Element/RadioGroup.php (modified) (2 diffs)
-
classes/EVEShipInfo/Admin/UI/Icon.php (modified) (2 diffs)
-
css/ThemeDark.css (added)
-
css/ThemeLight.css (modified) (4 diffs)
-
css/admin.css (modified) (1 diff)
-
js/EVEShipInfo/Fitting.js (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
eve-shipinfo/trunk/classes/EVEShipInfo.php
r1236586 r1237087 342 342 $this->handle_initRewriteRules(); 343 343 $this->handle_initShortcodes(); 344 $this->handle_initThemes(); 344 345 $this->handle_initScripts(); 346 } 347 348 public function getThemeID() 349 { 350 return $this->getOption('theme', 'Light'); 351 } 352 353 public function setThemeID($id) 354 { 355 $this->setOption('theme', $id); 356 } 357 358 public function getThemeLabel() 359 { 360 $id = $this->getThemeID(); 361 return $this->themes[$id]['label']; 362 } 363 364 /** 365 * Initializes the plugin's themes. A theme is only a single CSS file, 366 * (for ex. ThemeLight.css) which extends the base CSS file, 367 * EVEShipInfo.css, which handles the base elements structure. 368 */ 369 protected function handle_initThemes() 370 { 371 $this->registerTheme( 372 'Light', 373 __('Light', 'EVEShipInfo'), 374 __('A theme for light themed blogs.', 'EVEShipInfo') 375 ); 376 377 $this->registerTheme( 378 'Dark', 379 __('Dark', 'EVEShipInfo'), 380 __('A theme for dark themed blogs.', 'EVEShipInfo') 381 ); 382 } 383 384 protected $themes = array(); 385 386 /** 387 * Registers a frontend theme CSS. 388 * 389 * @param string $id 390 * @param string $label 391 * @param string $description 392 */ 393 protected function registerTheme($id, $label, $description) 394 { 395 $this->themes[$id] = array( 396 'label' => $label, 397 'description' => $description 398 ); 345 399 } 346 400 … … 363 417 add_shortcode($instance->getTagName(), array($instance, 'handle_call')); 364 418 } 419 } 420 421 /** 422 * Retrieves the definitions for all available themes. 423 * @return array 424 */ 425 public function getThemes() 426 { 427 return $this->themes; 365 428 } 366 429 … … 469 532 470 533 wp_register_style('eveshipinfo', $this->getScriptURL('EVEShipInfo.css')); 471 wp_register_style('eveshipinfo_light', $this->getScriptURL('ThemeLight.css'), array('eveshipinfo'));472 473 534 wp_enqueue_style('eveshipinfo'); 474 wp_enqueue_style('eveshipinfo_light'); 535 536 wp_register_style('eveshipinfo_theme', $this->getScriptURL('Theme'.$this->getThemeID().'.css'), array('eveshipinfo')); 537 wp_enqueue_style('eveshipinfo_theme'); 475 538 } 476 539 … … 612 675 ); 613 676 614 add_submenu_page( 615 'eveshipinfo', 616 __('Dashboard', 'EVEShipInfo'), 617 __('Dashboard', 'EVEShipInfo'), 618 'edit_posts', 619 'eveshipinfo', 620 array($this, 'handle_displayMainPage') 677 $submenuPages = array( 678 array( 679 'navTitle' => __('Dashboard', 'EVEShipInfo'), 680 'name' => 'eveshipinfo', 681 'callback' => array($this, 'handle_displayMainPage') 682 ), 683 array( 684 'navTitle' => __('Themes', 'EVEShipInfo'), 685 'name' => 'eveshipinfo_themes', 686 'callback' => array($this, 'handle_displayThemesPage') 687 ), 688 array( 689 'navTitle' => __('Shortcodes', 'EVEShipInfo'), 690 'name' => 'eveshipinfo_shortcodes', 691 'callback' => array($this, 'handle_displayShortcodesPage') 692 ), 693 array( 694 'navTitle' => __('EFT import', 'EVEShipInfo'), 695 'name' => 'eveshipinfo_eftimport', 696 'callback' => array($this, 'handle_displayEFTImportPage') 697 ), 698 array( 699 'navTitle' => __('EFT fittings', 'EVEShipInfo'), 700 'name' => 'eveshipinfo_eftfittings', 701 'callback' => array($this, 'handle_displayEFTFittingsPage') 702 ), 703 array( 704 'navTitle' => __('Database', 'EVEShipInfo'), 705 'name' => 'eveshipinfo_database', 706 'callback' => array($this, 'handle_displayDatabasePage') 707 ), 708 /*array( 709 'navTitle' => __('Help', 'EVEShipInfo'), 710 'name' => 'eveshipinfo_help', 711 'callback' => array($this, 'handle_displayHelpPage') 712 ),*/ 621 713 ); 622 623 add_submenu_page( 624 'eveshipinfo', 625 __('Help and Documentation', 'EVEShipInfo'), 626 __('Help', 'EVEShipInfo'), 627 'edit_posts', 628 'eveshipinfo_help', 629 array($this, 'handle_displayHelpPage') 630 ); 631 632 add_submenu_page( 633 'eveshipinfo', 634 __('Database reference', 'EVEShipInfo'), 635 __('Database', 'EVEShipInfo'), 636 'edit_posts', 637 'eveshipinfo_database', 638 array($this, 'handle_displayDatabasePage') 639 ); 640 641 add_submenu_page( 642 'eveshipinfo', 643 __('Shortcodes reference', 'EVEShipInfo'), 644 __('Shortcodes', 'EVEShipInfo'), 645 'edit_posts', 646 'eveshipinfo_shortcodes', 647 array($this, 'handle_displayShortcodesPage') 648 ); 649 650 add_submenu_page( 651 'eveshipinfo', 652 __('EFT import', 'EVEShipInfo'), 653 __('EFT import', 'EVEShipInfo'), 654 'edit_posts', 655 'eveshipinfo_eftimport', 656 array($this, 'handle_displayEFTImportPage') 657 ); 658 659 $eft = $this->createEFTManager(); 660 add_submenu_page( 661 'eveshipinfo', 662 __('EFT fittings', 'EVEShipInfo'), 663 __('EFT fittings', 'EVEShipInfo'), 664 'edit_posts', 665 'eveshipinfo_eftfittings', 666 array($this, 'handle_displayEFTFittingsPage') 667 ); 714 715 foreach($submenuPages as $page) { 716 add_submenu_page( 717 'eveshipinfo', 718 $page['navTitle'], 719 $page['navTitle'], 720 'edit_posts', 721 $page['name'], 722 $page['callback'] 723 ); 724 } 668 725 } 669 726 … … 675 732 } 676 733 734 public function handle_displayThemesPage() 735 { 736 $this->handle_displayMainPage('Themes'); 737 } 738 677 739 public function handle_displayShortcodesPage() 678 740 { -
eve-shipinfo/trunk/classes/EVEShipInfo/Admin/Page/Main.php
r1236586 r1237087 7 7 $tabs = array( 8 8 'Dashboard' => __('Dashboard', 'EVEShipInfo'), 9 'Help' => __('Help', 'EVEShipInfo'), 10 'Database' => __('Database reference', 'EVEShipInfo'), 9 'Themes' => __('Themes', 'EVEShipInfo'), 11 10 'Shortcodes' => __('Shortcordes reference', 'EVEShipInfo'), 12 11 'EFTImport' => __('EFT import', 'EVEShipInfo'), 13 'EFTFittings' => __('EFT fittings', 'EVEShipInfo') 14 ); 12 'EFTFittings' => __('EFT fittings', 'EVEShipInfo'), 13 'Database' => __('Database reference', 'EVEShipInfo'), 14 //'Help' => __('Help', 'EVEhipInfo') 15 ); 15 16 16 17 return $tabs; -
eve-shipinfo/trunk/classes/EVEShipInfo/Admin/UI/Form/Element/RadioGroup.php
r1236586 r1237087 25 25 } 26 26 27 return implode(' <br/>', $items);27 return implode('', $items); 28 28 } 29 29 } … … 60 60 61 61 return 62 '<label >'.62 '<label class="radio-group-item">'. 63 63 '<input'.$this->element->getPlugin()->compileAttributes($atts).'/> '. 64 64 $this->label. -
eve-shipinfo/trunk/classes/EVEShipInfo/Admin/UI/Icon.php
r1236586 r1237087 23 23 'PROTECT' => 'lock', 24 24 'UNPROTECT' => 'unlock', 25 'LIST_VIEW' => 'list-view' 25 'LIST_VIEW' => 'list-view', 26 'THEME' => 'admin-appearance' 26 27 ); 27 28 … … 43 44 } 44 45 46 public function theme() { return $this->setType('THEME'); } 45 47 public function listView() { return $this->setType('LIST_VIEW'); } 46 48 public function add() { return $this->setType('ADD'); } -
eve-shipinfo/trunk/css/ThemeLight.css
r1081848 r1237087 96 96 97 97 .shipinfo-fittingbox{ 98 font-family:'Rajdhani', sans-serif; 98 99 position:relative; 99 100 margin:6px 0 28px 0; … … 101 102 padding:6px; 102 103 border:solid 1px #ccc; 103 b order-radius:4px;104 background:#fff; 104 105 } 105 106 106 107 .shipinfo-fittingbox-header{ 107 font-size:16px;108 108 line-height:20px; 109 109 margin-bottom:6px; 110 padding:4px 0; 110 111 } 111 112 … … 116 117 } 117 118 119 .shipinfo-fittingbox-fitname{ 120 font-size:22px; 121 font-weight:600; 122 } 123 124 .shipinfo-fittingbox .shipinfo-dismiss{ 125 margin-top:-7px; 126 } 127 118 128 .shipinfo-fittingbox-shipname{ 119 129 float:right; 120 130 font-style:italic; 121 131 margin-right:4px; 132 font-size:16px; 122 133 } 123 134 … … 125 136 margin:6px 0 0 0; 126 137 } 127 128 .shipinfo-fittingbox-closer{129 position:absolute;130 top:-10px;131 right:-10px;132 border-radius:16px;133 background:#ccc;134 color:#fff;135 border:solid 2px #aaa;136 font-family:monospace;137 font-size:14px;138 overflow:hidden;139 line-height:14px;140 padding:0 2px;141 cursor:pointer;142 }143 144 .shipinfo-fittingbox-closer:hover{145 color:#666;146 background:#fafafa;147 } -
eve-shipinfo/trunk/css/admin.css
r1236586 r1237087 115 115 margin-right:10px; 116 116 } 117 118 .radio-group-item{ 119 display:block; 120 margin-bottom:8px; 121 } -
eve-shipinfo/trunk/js/EVEShipInfo/Fitting.js
r1236586 r1237087 27 27 this.rendered = false; 28 28 29 this.ElementID = function(part) 30 { 31 return this.jsID+'_'+part; 32 }; 33 34 this.Element = function(part) 35 { 36 return jQuery('#'+this.ElementID(part)); 37 }; 38 29 39 this.Show = function() 30 40 { … … 44 54 '<div class="shipinfo-fittingbox-wrap">'+ 45 55 '<div class="shipinfo-fittingbox-header">'+ 46 this.name+' '+ 56 '<span class="shipinfo-fittingbox-fitname">'+ 57 this.name+' '+ 58 '</span>'+ 59 ' '+ 47 60 '<span class="shipinfo-fittingbox-shipname">'+ 48 61 '<a href="javascript:void(0)" class="shipinfo-shiplink" onclick="EVEShipInfo.InfoPopup(\''+this.ship.id+'\')">'+ … … 50 63 '</a>'+ 51 64 '</span>'+ 52 '<span class="shipinfo-fittingbox-closer" onclick="fobj'+this.linkID+'.Hide()">x</span>'+53 65 '</div>'+ 54 66 '<div class="shipinfo-fittingbox-content">'+ … … 56 68 '</div>'+ 57 69 '<div class="shipinfo-fittingbox-toolbar">'+ 58 '<a href="javascript:void(0)" onclick="jQuery(\'#'+this.jsID+'-praisalform\').submit()">EVEPraisal</a>'+ 70 '<div class="shipinfo-dismiss" id="'+this.ElementID('dismiss')+'">×</div>'+ 71 '<a href="javascript:void(0)" onclick="jQuery(\'#'+this.ElementID('praisalform')+'\').submit()">EVEPraisal</a>'+ 59 72 '</div>'+ 60 73 '<div style="display:none">'+ 61 '<form action="http://evepraisal.com/estimate" method="post" target="_blank" id="'+this. jsID+'-praisalform">'+74 '<form action="http://evepraisal.com/estimate" method="post" target="_blank" id="'+this.ElementID('praisalform')+'">'+ 62 75 '<input type="hidden" name="raw_paste" value="'+this.ExportTextonly()+'"/>'+ 63 76 '<input type="hidden" name="hide_buttons" value="false"/>'+ … … 72 85 link.after(html); 73 86 this.rendered = true; 87 88 var fit = this; 89 this.Element('dismiss').on('click', function() { 90 fit.Hide(); 91 }); 74 92 } else { 75 93 jQuery('#'+this.jsID).show();
Note: See TracChangeset
for help on using the changeset viewer.