Skip to content

Instantly share code, notes, and snippets.

View steelydylan's full-sized avatar
🎯
Focusing

Hori Godai steelydylan

🎯
Focusing
View GitHub Profile
@steelydylan
steelydylan / text-unit.js
Created May 10, 2018 06:39
テキストユニット拡張サンプル
ACMS.Ready(function(){
ACMS.Config.mediaLibrary = 'off';
ACMS.Config.LiteEditorUseEmojiPicker = false;
ACMS.Config.offcanvas.breakpoint = 1023;
ACMS.Config.LiteEditorConf.btnOptions = [
{
label: '<i class="lite-editor-font-back"></i>',
action: 'undo',
group: 'action'
},
@steelydylan
steelydylan / AAPP_Sample_GET_Sample
Last active November 18, 2017 02:28
拡張アプリサンプル
<?php
/**
* Class AAPP_Sample_GET_Sample
*
* /php/AC
*/
class AAPP_Sample_GET_Sample extends ACMS_GET
{
public function get()
@steelydylan
steelydylan / pin-maker.js
Created July 24, 2017 01:06
Google Mapのピン生成に便利なクラス
const GoogleMapsLoader = require('google-maps');
export default class GooglePinMaker {
constructor({id, key, zoom, lat, lng, draggable, dragend, added, removed, markers, input, mode = 'view'}) {
this.markers = [];
this.tmp = markers;
const element = document.querySelector(`#${id}`);
if (element && element.getAttribute('data-lat')) {
lat = element.getAttribute('data-lat');
lng = element.getAttribute('data-lng');
@steelydylan
steelydylan / get_pocket_count.js
Last active June 21, 2017 17:35
Pocket数を取得するためのJavaScript
async function get_pocket_count(url) {
const pocketUrl = encodeURIComponent(`https://widgets.getpocket.com/v1/button?v=1&count=horizontal&url=${url}&src=${url}`);
const response = await fetch(`http://query.yahooapis.com/v1/public/yql?q=select * from%20xml%20where%20url%3D%22${pocketUrl}%22&format=xml`)
const str = await response.text();
const doc = await new window.DOMParser().parseFromString(str, "text/xml")
return doc.querySelector('#cnt').innerHTML;
}
@steelydylan
steelydylan / field.html
Created April 11, 2017 05:49
tableのUIをカスタムフィールドで使うためのカスタマイズ
<div class="js-field">
<div class="js-editable-table">
<!-- BEGIN_IF [{table}[delnl]/nem] -->
{table}[raw]
<!-- ELSE -->
<table>
<tr>
<th>hogehoge</th>
<th>hogehoge</th>
</tr>
@steelydylan
steelydylan / App.jsx
Created February 13, 2017 14:26
React Redux連携サンプル
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import React from 'react';
import * as Actions from '../actions';
import Hoge from '../components/hoge';
class App extends React.Component {
render() {
const props = this.props;
return (<div>
@steelydylan
steelydylan / touch_module.html
Created October 3, 2016 05:25
a-blog cms Touchモジュールは普通のモジュールよりも実行順序が早い
<!-- BEGIN_MODULE Touch_Top -->
<!-- BEGIN_MODULE Entry_Body -->
<!--#include file="/include/unit.html"-->
<!-- END_MODULE Entry_Body -->
<!-- END_MODULE Touch_Top -->
@steelydylan
steelydylan / field.html
Created October 3, 2016 05:08
ユニットをGET_Renderedを使って配置してみる
<table class="acms-admin-table-admin-edit">
<tr>
<th>エントリーの表示位置</th>
<td>
<label class="acms-admin-form-radio"><input type="radio" name="display" value="right"{display:checked#right} /><i class="acms-admin-ico-radio"></i>右</label>
<label class="acms-admin-form-radio"><input type="radio" name="display" value="left"{display:checked#left} /><i class="acms-admin-ico-radio"></i>左</label>
<input type="hidden" name="field[]" value="display" />
</td>
</tr>
<tr>
@steelydylan
steelydylan / if.html
Created October 3, 2016 04:39
a-blog cms IF ブロックの応用的使い方
<!-- BEGIN_IF [%{CID}/re/^11$|^12$|^13$] -->
<p>カテゴリーIDが11,12,13のときに表示されます。</p>
<!-- END_IF -->
@steelydylan
steelydylan / countries.json
Created October 3, 2016 03:24
a-blog cms カスタムフィールドメーカー(国コード選択を追加)
[
{
"label": "Afghanistan",
"value": "AF"
},
{
"label": "Åland Islands",
"value": "AX"
},
{