This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($){ | |
// 記事編集画面のカスタマイズ | |
if (mtappVars.screen_id == 'edit-entry') { | |
if (mtappVars.site.customfields.blog_is_jpen) { | |
// 英文タイトルのスタイルを設定 | |
$('#customfield_entry_title_en').addClass('title').attr('placeholder', '英文タイトル'); | |
// フィールドの表示/非表示を切り替えられなくする | |
$(('#entry_fields-field')).hide(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($){ | |
// $.MTAppCategorySwitch({ | |
// selector: { | |
// 'init': '#title-field', | |
// 'hide': | |
// '#text-field,#excerpt-field,#customfield_entryogimage-field,#customfield_entryeyecatch-field,#customfield_entryappendix-field,#customfield_entrycontact-field,#customfield_entrylinkurl-field', | |
// 'cat49': | |
// '#title-field,#text-field,#excerpt-field,#customfield_entryogimage-field,#customfield_entryeyecatch-field,#customfield_entryappendix-field,#customfield_entrycontact-field', | |
// 'cat50': |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($){ | |
// 特定のコンテンツタイプだけにカスタマイズを適用する | |
if (mtappVars.type.indexOf('content_data') !== -1 && mtappVars.content_type_id == 5) { | |
// コンテンツフィールドのIDを指定します。 | |
// ブラウザの開発者ツールで入力欄(今回は「オススメ書籍一覧」」フィールドのテキストエリア)を確認し、 | |
// <input type="text" name="content-field-47" となっている 47 部分が該当します。 | |
const contentFieldId = '47'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mtappVars.DataAPI.getContentData(31, 3, 3, function (res) { | |
const cd = jQuery.extend({}, res); | |
for (let i = 0; i < cd.data.length; i++) { | |
if (cd.data[i].label === "取扱店舗") { | |
cd.data[i].data = null; | |
} | |
} | |
mtappVars.DataAPI.updateContentData(31, 3, 3, cd, function (newCd) { | |
console.log(newCd); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($){ | |
// MTAppjQuery v1.9.0 以前のバージョンの場合は下記が必要 | |
$.extend({ | |
objectSort: function(array, key, order, type) { | |
order = (order === 'ascend') ? -1 : 1; | |
array.sort(function(obj1, obj2){ | |
var v1 = obj1[key]; | |
var v2 = obj2[key]; | |
if (type === 'numeric') { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($){ | |
// 元記事:http://bit-part.net/blog/2015/01/mtapplisting.html | |
$('#customfield_bpentrylist').MTAppListing({ | |
url: '<mt:Var name="config.CGIPath"><mt:Var name="config.DataAPIScript">/v1/sites/<mt:BlogID>/entries', | |
data: { | |
limit: 9999999, | |
// categories を追加します | |
fields: 'id,title,categories' | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($){ | |
// --------------------------------------------------------------------- | |
// $(foo).MTAppAssetFields(); | |
// --------------------------------------------------------------------- | |
// Latest update: 2016/07/01 | |
// | |
// input:text で MT 標準の「アイテム」ダイアログを利用できるようにします。 | |
// id, filename, url, thumnail(imageのみ)の値を JSON で保存します。 | |
// --------------------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($){ | |
// --------------------------------------------------------------------- | |
// $.MTAppTemplateSelectorWidget(); | |
// --------------------------------------------------------------------- | |
// Latest update: 2016/06/24 | |
// | |
// テンプレートの編集画面に、テンプレート一覧のドロップダウンリストウィジェットを追加し、 | |
// 選択したテンプレートの編集画面にジャンプします。 | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<mt:EntryJSONTableItems> | |
<mt:IfEntryJSONTableItem key=“foo"> | |
<mt:EntryJSONTableItem key=“foo”> | |
</mt:IfEntryJSONTableItem> | |
<mt:Else> | |
do something when items is empty | |
</mt:EntryJSONTableItems> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
NewerOlder