Last active
October 20, 2018 05:14
-
-
Save shimajima-eiji/5d0f80af354f315c5e2670c2d2ce676d to your computer and use it in GitHub Desktop.
他のサイトから直接飛べない細工をしています。
||script var referrer = ["https://nomuraya.work/trpg/", "https://nomuraya.work/trpg/04"]; fromgo(referrer , "");
display_word("ゲームパラメータを初期化しました"); display_button("https://nomuraya.work/trpg/stage01/start", "進む"); ||<
- github page
- description
- demo site
- back
/**
* need: https://github.com/shimajima-eiji/mylib/blob/master/adiary/bookmark.js
* need: https://cdnjs.cloudflare.com/ajax/libs/js-yaml/3.4.2/js-yaml.min.js
*/
/**
* リンク・ページング
*/
function fromgo(froms, url){
froms[froms.length] = location.href;
if(froms.indexOf(document.referrer) == -1){
url = "/trpg/";
}
if(!url == ""){
location.replace(url);
}
}
/**
* メモに書いたゲームパラメーターを取り出す
*/
function get_memo(){
return $('#side-serika-memo textarea').val();
}
/**
* yaml形式のファイルを扱えるようにする
*/
function get_yaml(){
// var doc = get_memo();
var doc = "greeting: hello\nname: world";
return JSON.parse(JSON.stringify(jsyaml.load(doc)));
}
/**
* 変数のkey,valueをyaml形式で書き出す
*/
function set_yaml(key, value){
$("#side-serika-memo textarea").trigger("bookmark", ["key", "value"]);
}
/**
* バグ発生時にユーザーにおしてもらうことで、タイムスタンプやブラウザ・スクショやパラメーターなどをシステムに送信する
*/
function send_bug(){
alert('OK');
}
/**
* 書き出し処理・テキスト
*/
function display_word(value){
p = document.createElement("p");
var text = document.createTextNode(value);
p.appendChild(text);
document.getElementById("contents").appendChild(p);
}
/**
* 書き出し処理・リンクボタン
*/
function display_button(url, value){
button = document.createElement("button");
button.onclick= function() {
fromgo(referrer , url);
};
var text = document.createTextNode(value);
button.appendChild(text);
document.getElementById("contents").appendChild(button);
}
/* 実行 */
params = get_yaml();
set_yaml("name", params.name);
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
/** | |
* need: https://github.com/shimajima-eiji/mylib/blob/master/adiary/bookmark.js | |
* need: https://cdnjs.cloudflare.com/ajax/libs/js-yaml/3.4.2/js-yaml.min.js | |
*/ | |
/** | |
* リンク・ページング | |
*/ | |
function fromgo(froms, url){ | |
froms[froms.length] = location.href; | |
if(froms.indexOf(document.referrer) == -1){ | |
url = "/trpg/"; | |
} | |
if(!url == ""){ | |
location.replace(url); | |
} | |
} | |
/** | |
* メモに書いたゲームパラメーターを取り出す | |
*/ | |
function get_memo(){ | |
return $('#side-serika-memo textarea').val(); | |
} | |
/** | |
* yaml形式のファイルを扱えるようにする | |
*/ | |
function get_yaml(){ | |
// var doc = get_memo(); | |
var doc = "greeting: hello\nname: world"; | |
return JSON.parse(JSON.stringify(jsyaml.load(doc))); | |
} | |
/** | |
* 変数のkey,valueをyaml形式で書き出す | |
*/ | |
function set_yaml(key, value){ | |
$("#side-serika-memo textarea").trigger("bookmark", ["key", "value"]); | |
} | |
/** | |
* バグ発生時にユーザーにおしてもらうことで、タイムスタンプやブラウザ・スクショやパラメーターなどをシステムに送信する | |
*/ | |
function send_bug(){ | |
alert('OK'); | |
} | |
/** | |
* 書き出し処理・テキスト | |
*/ | |
function display_word(value){ | |
p = document.createElement("p"); | |
var text = document.createTextNode(value); | |
p.appendChild(text); | |
document.getElementById("contents").appendChild(p); | |
} | |
/** | |
* 書き出し処理・リンクボタン | |
*/ | |
function display_button(url, value){ | |
button = document.createElement("button"); | |
button.onclick= function() { | |
fromgo(referrer , url); | |
}; | |
var text = document.createTextNode(value); | |
button.appendChild(text); | |
document.getElementById("contents").appendChild(button); | |
} | |
/* 実行 */ | |
params = get_yaml(); | |
set_yaml("name", params.name); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment