Skip to content

Commit

Permalink
1.0.0
Browse files Browse the repository at this point in the history
Initial release.
  • Loading branch information
takashi-matsuyama committed Jun 2, 2021
0 parents commit 30cca0c
Show file tree
Hide file tree
Showing 15 changed files with 1,278 additions and 0 deletions.
194 changes: 194 additions & 0 deletions assets/deau-api.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
@charset "UTF-8";
@import url('./icomoon/style.css');

#toplevel_page_deau-api .dashicons-admin-generic::before {
content: "\e900";
font-family: 'icomoon-deau_api' !important;
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
/* Better Font Rendering =========== */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

#deau-api {
margin-right: 20px;
}
#deau-api a {
text-decoration: none;
}
#deau-api .ttl-myplugin {
font-size: 2em;
}
#deau-api .ttl-myplugin .icon-deau_api-logo,
#deau-api .ttl-sub-myplugin .icon-deau_api-logo {
font-size: 1.15em;
vertical-align: text-bottom;
margin-right: 0.15em;
}
#deau-api .inner-myplugin {
margin-right: 24vw;
}
#deau-api .main-myplugin {
float: left;
width: 100%;
background: #fafafa;
box-sizing: border-box;
border: 1px solid #ccc;
padding: 10px 20px 20px 20px;
}
#deau-api .sidebar-myplugin {
float: right;
margin-right: -24vw;
width: 22.9vw;
}

#deau-api .author-myplugin {
background: #fafafa;
box-sizing: border-box;
border: 1px solid #ccc;
padding: 10px 20px;
}
#deau-api .author-myplugin i.dashicons {
margin-right: 0.3em;
}
#deau-api .sidebar-myplugin .info-myplugin,
#deau-api .sidebar-myplugin .info-myplugin > dt,
#deau-api .sidebar-myplugin .info-myplugin > dd {
box-sizing: border-box;
}
#deau-api .sidebar-myplugin .info-myplugin {
max-width: 500px;
background: #eee;
border-right: 1px solid #ccc;
border-bottom: 1px solid #ccc;
border-left: 1px solid #ccc;
margin: 20px 0;
}
#deau-api .sidebar-myplugin .info-myplugin > dt,
#deau-api .sidebar-myplugin .info-myplugin > dd {
padding: 10px 10px 0 10px;
border-top: 1px solid #ccc;
margin: 0;
}
#deau-api .sidebar-myplugin .info-myplugin > dt {
width: 45%;
float: left;
}
#deau-api .sidebar-myplugin .info-myplugin > dd {
background: #fff;
margin-left: 45%;
padding-bottom: 10px;
border-left: 1px solid #ccc;
}
#deau-api .sidebar-myplugin .info-myplugin > dd:after {
content: '';
display: block;
clear: both;
}

.deau_api-error {
color: #dc3232;
}
.deau_api-setting-field {
display: table;
width: 100%;
}
.deau_api-setting-field dt {
display: table-cell;
vertical-align: middle;
width: 12em;
text-align: right;
box-sizing: border-box;
}
.deau_api-setting-field dd {
display: table-cell;
vertical-align: middle;
padding-left: 1.3em;
box-sizing: border-box;
}
.deau_api-setting-field .required::before {
content: "*";
color: #dc3232;
margin-right: 0.1em;
}
#deau_api-app_password {
width: 100%;
max-width: 500px;
}

.deau_api-corp_data {
display: table;
width: 100%;
}
.deau_api-corp_data dt {
display: table-cell;
vertical-align: middle;
width: 12em;
text-align: right;
box-sizing: border-box;
}
.deau_api-corp_data dd {
display: table-cell;
vertical-align: middle;
padding-left: 1.5em;
box-sizing: border-box;
}

#deau-api textarea {
width: 100%;
}

#deau_api-shortcodes .deau_api-shortcode-one input[type="text"] {
display: inline-block;
vertical-align: top;
}
#new-deau_api_shortcode {
display: inline-block;
vertical-align: top;
cursor: pointer;
margin: 2em 0;
}

.deau_api-corp_data-branch-value {
margin-left: 1.5em;
}
.deau_api-external-web_app {
margin: 2em 0;
}
.deau_api-external-web_app .button {
padding-top: 0.25em;
padding-bottom: 0.25em;
}
.deau_api-external-web_app .dashicons {
margin-left: 0.3em;
line-height: 1.25;
}

.deau_api-key-copy {
cursor: copy !important;
position: relative;
color: #0071a1;
}
/* Tooltip */
.deau_api-key-copy:active::after {
content: 'Copied!';
background: #555;
display: inline-block;
vertical-align: middle;
width: max-content;
line-height: 1;
color: #fff;
border-radius: 5px;
position: absolute;
z-index: 99999;
left: 50%;
top: -2em;
transform: translate(-50%, 0);
font-size: 0.75em;
padding: 8px 10px 6px 10px;
}
31 changes: 31 additions & 0 deletions assets/deau-api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
(function($) {
var new_deau_api_shortcode = '#new-deau_api_shortcode';
var deau_api_shortcode_one = 'deau_api-shortcode-one';
$(document).on('click', new_deau_api_shortcode, function() {
var code_count = Number( $(this).attr('data-deau_api_shortcodes-count') ); /* 動的に取得するため data() ではなく attr() が必要 */
var placeholder_slug = "name";
var placeholder_code = "<dl><dt>法人名</dt><dd>[\'法人名\']</dd><dt>法人番号</dt><dd>[\'法人番号\']</dd><dt>本店所在地</dt><dd>[\'本店所在地\']</dd></dl>";
var code_delete_text = $(this).data('deau_api_shortcode-delete_button_text');
$("#deau_api-shortcodes").append('<div class="'+deau_api_shortcode_one+'"><input type="text" id="deau_api-shortcode-slug-'+code_count+'" name="deau_api_shortcodes['+code_count+'][slug]" placeholder="'+placeholder_slug+'"><textarea id="deau_api-shortcode-code-'+code_count+'" name="deau_api_shortcodes['+code_count+'][code]" cols="100" rows="10" placeholder="'+placeholder_code+'"></textarea><span class="deau_api-shortcode-delete button">'+code_delete_text+'</span></div>');
$(this).attr('data-deau_api_shortcodes-count', Number( code_count + 1 ) ); /* 動的に変更するため data() ではなく attr() が必要 */
});
$(document).on('click', '.deau_api-shortcode-delete', function() {
var code_delete_confirm = $(new_deau_api_shortcode).data('deau_api_shortcode-delete_confirm');
var code_slug = $(this).closest('.'+deau_api_shortcode_one).find('input').val();
var result = window.confirm( code_slug + code_delete_confirm );
if(result){
$(this).closest('.'+deau_api_shortcode_one).remove();
}
});
$(document).on('click', '.deau_api-key-copy', function() {
$(this).addClass('deau-copied');
var clipboard = $('<textarea></textarea>');
clipboard.addClass('clipboard');
clipboard.html( $(this).text() );
$(this).append(clipboard);
clipboard.select();
document.execCommand('copy');
clipboard.remove();
$(this).removeClass('deau-copied');
});
})(jQuery);
Binary file added assets/icomoon/fonts/icomoon-deau_api.eot
Binary file not shown.
11 changes: 11 additions & 0 deletions assets/icomoon/fonts/icomoon-deau_api.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icomoon/fonts/icomoon-deau_api.ttf
Binary file not shown.
Binary file added assets/icomoon/fonts/icomoon-deau_api.woff
Binary file not shown.
30 changes: 30 additions & 0 deletions assets/icomoon/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
@font-face {
font-family: 'icomoon-deau_api';
src: url('fonts/icomoon-deau_api.eot?11opn');
src: url('fonts/icomoon-deau_api.eot?11opn#iefix') format('embedded-opentype'),
url('fonts/icomoon-deau_api.ttf?11opn') format('truetype'),
url('fonts/icomoon-deau_api.woff?11opn') format('woff'),
url('fonts/icomoon-deau_api.svg?11opn#icomoon-deau_api') format('svg');
font-weight: normal;
font-style: normal;
font-display: block;
}

[class^="icon-deau_api-"], [class*=" icon-deau_api-"] {
/* use !important to prevent issues with browser extensions that change fonts */
font-family: 'icomoon-deau_api' !important;
speak: never;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;

/* Better Font Rendering =========== */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

.icon-deau_api-logo:before {
content: "\e900";
}
28 changes: 28 additions & 0 deletions assets/sidebar.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
} //endif
?>
<div class="sidebar-myplugin">
<div class="author-myplugin">
<h3 class="ttl-sub-myplugin"><i class="icon-deau_api-logo"></i><?php echo DEAU_API_PLUGIN_NAME; ?></h3><!-- /.ttl-sub-myplugin -->
<p><?php _e('開発者', DEAU_API_TEXT_DOMAIN); ?>: <?php _e('株式会社カロニマ', DEAU_API_TEXT_DOMAIN); ?></p>
<ul>
<li><a href="https://www.youtube.com/channel/UCte2Fu9FT6fSNQ6JhcWPPHA" target="_blank"><i aria-hidden="true" class="dashicons dashicons-video-alt3"></i><?php _e('WebアプリのYouTube', DEAU_API_TEXT_DOMAIN); ?></a></li>
<li><a href="https://www.facebook.com/deau.jp" target="_blank"><i aria-hidden="true" class="dashicons dashicons-facebook"></i><?php _e('WebアプリのFacebook', DEAU_API_TEXT_DOMAIN); ?></a></li>
<li><a href="https://twitter.com/deau_jp" target="_blank"><i aria-hidden="true" class="dashicons dashicons-twitter"></i><?php _e('WebアプリのTwitter', DEAU_API_TEXT_DOMAIN); ?></a></li>
<li><a href="https://deau.app" target="_blank"><i aria-hidden="true" class="dashicons dashicons-external"></i><?php _e('Webアプリ', DEAU_API_TEXT_DOMAIN); ?></a></li>
<li><a href="https://deau.app/legal/terms/" target="_blank"><i aria-hidden="true" class="dashicons dashicons-external"></i><?php _e('Webアプリの利用規約', DEAU_API_TEXT_DOMAIN); ?></a></li>
<li><a href="https://deau.app/legal/privacy/" target="_blank"><i aria-hidden="true" class="dashicons dashicons-external"></i><?php _e('Webアプリのプライバシーポリシー', DEAU_API_TEXT_DOMAIN); ?></a></li>
<li><a href="https://caronima.com" target="_blank"><i aria-hidden="true" class="dashicons dashicons-external"></i><?php _e('開発者のWebサイト', DEAU_API_TEXT_DOMAIN); ?></a></li>
</ul>
</div><!-- /.author-myplugin -->
<dl class="info-myplugin">
<dt><?php _e('プラグイン名', DEAU_API_TEXT_DOMAIN); ?>:</dt>
<dd><?php echo DEAU_API_PLUGIN_NAME; ?></dd>
<dt><?php _e('プラグインバージョン', DEAU_API_TEXT_DOMAIN); ?>:</dt>
<dd><?php echo DEAU_API_PLUGIN_VERSION; ?></dd>
<dt><?php _e('Webアプリ名', DEAU_API_TEXT_DOMAIN); ?>:</dt>
<dd>deAU クラウド法人情報</dd>
</dl><!-- /.info-myplugin -->
</div><!-- /.sidebar-myplugin -->
14 changes: 14 additions & 0 deletions assets/uninstall.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
} //endif
if( ! class_exists( 'deAU_API_Uninstall' ) ) {
class deAU_API_Uninstall {
public static function delete_options() {
delete_option('deau_api');
delete_option('deau_api_shortcodes');
delete_option('deau_api_shortcode_history');
delete_option('deau_api_localhost');
} //endfunction
} //endclass
} //endif
71 changes: 71 additions & 0 deletions deau-api.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?php
/**
* Plugin Name: deAU クラウド法人情報 API
* Plugin URI: https://deau.app/
* Description: deAU クラウド法人情報のAPIで法人データを取得。
* Version: 1.0.0
* Requires at least: 4.8
* Requires PHP: 5.4.0
* Author: Caronima Inc.
* Author URI: https://caronima.com
* Text Domain: deau-api
*/

if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
} //endif

$this_plugin_info = get_file_data( __FILE__, array(
'name' => 'Plugin Name',
'version' => 'Version',
'text_domain' => 'Text Domain',
'minimum_php' => 'Requires PHP',
));

define( 'DEAU_API_PLUGIN_PATH', rtrim( plugin_dir_path( __FILE__ ), '/') );
define( 'DEAU_API_PLUGIN_URL', rtrim( plugin_dir_url( __FILE__ ), '/') );
define( 'DEAU_API_PLUGIN_SLUG', trim( dirname( plugin_basename( __FILE__ ) ), '/' ) );
define( 'DEAU_API_PLUGIN_NAME', $this_plugin_info['name'] );
define( 'DEAU_API_PLUGIN_VERSION', $this_plugin_info['version'] );
define( 'DEAU_API_TEXT_DOMAIN', $this_plugin_info['text_domain'] );

load_plugin_textdomain( DEAU_API_TEXT_DOMAIN, false, basename( dirname( __FILE__ ) ) . '/languages' );

/*** Require PHP Version Check ***/
if ( version_compare(phpversion(), $this_plugin_info['minimum_php'], '<') ) {
$plugin_notice = sprintf( __('このプラグインは、PHP %s 以上が必要になります。', DEAU_API_TEXT_DOMAIN), $this_plugin_info['minimum_php'] );
register_activation_hook(__FILE__, create_function('', "deactivate_plugins('".plugin_basename( __FILE__ )."'); wp_die('{$plugin_notice}');"));
} //endif

if( ! class_exists( 'deAU_API' ) ) {
define( 'DEAU_APP_URL', rtrim( 'https://deau.app', '/') );
define( 'DEAU_APP_URL_WEBAPI', rtrim( DEAU_APP_URL.'/web-api/json/v1', '/') );
define( 'DEAU_APP_URL_CORP_SINGLE', rtrim( DEAU_APP_URL.'/corporations/single', '/') );
require( DEAU_API_PLUGIN_PATH.'/function.php' );
/****** deAU_API Initialize ******/
function deau_api_initialize() {
global $deau_api;
/* Instantiate only once. */
if( ! isset($deau_api) ) {
$deau_api = new deAU_API();
}
return $deau_api;
} //endfunction
/*** Instantiate ****/
deau_api_initialize();

/*** How to use this Shortcode ***/
/*
* [deau slug="string"]
* [deau_history]
* [deau_seo_schema]
*/

/****** Uninstall ******/
require( DEAU_API_PLUGIN_PATH .'/assets/uninstall.php' );
register_uninstall_hook( __FILE__, array('deAU_API_Uninstall', 'delete_options') ); // plugin uninstallation
//register_deactivation_hook( __FILE__, array('deAU_API_Uninstall', 'delete_options') ); // plugin deactivation
} else {
$plugin_notice = __('PHPのクラス名が競合しています。', DEAU_API_TEXT_DOMAIN);
wp_die($plugin_notice);
} //endif
Loading

0 comments on commit 30cca0c

Please sign in to comment.