-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
159 lines (147 loc) · 5.55 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- <title>AronWriter</title> -->
<script src="tinymce/tinymce.js"></script>
<!-- <script src="lib/js/jquery.xdomainajax.js"></script> -->
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<style type="text/css">
html, body, #editor { height: 100%; margin: 0;}
.mce-edit-area {display:flex !important;flex-flow:column;}
.mce-edit-area iframe {flex:1 1 auto;}
.mce-tinymce {height:100%;}
.mce-tinymce.mce-container { width:100%;height:100%;border:0; }
.mce-panel{border:0}
.mce-container-body.mce-stack-layout {display: flex; flex-flow: column;height: 100%;} */
.mce-stack-layout-item{ flex: 0 0 auto;}
.mce-edit-area{flex:1 1 auto;}
#container {
display: grid;
height: 100%;
width: 100%;
grid-gap: 2px;
grid-template-columns: repeat(2, 1fr);
grid-auto-rows: minmax(100px, auto);
}
#container>div{
background-color: rgb(176, 162, 70);
}
#left {
grid-row: 1 / 2;
grid-column: 1;
}
#right{
grid-row: 1 / 2;
grid-column: 2;
}
#right>img{
height: 100%;
width: 100%;
}
</style>
</head>
<body>
<!-- <img src="file:///Users/aron/ITAD/150.jpg" alt=""> -->
<div id="container"> <!-- コンテナ -->
<div id="left"><div class="tinymce-full"> </div></div> <!-- アイテム -->
<div id="right"><img id="image" src="jpg/001.jpg" alt=""> </div> <!-- アイテム -->
</div>
</body>
<script>
var page_num = "001";
var pages=[];
for (i = 0; i< 160; i++)
{
pages.push({text:"page" + (i+1), value:(i+1)})
}
// You can also require other files to run in this process
tinymce.init({
selector:'div.tinymce-full',
height: "100%",
indent: true,
theme_url: './mytheme.js',
toolbar1: 'formatselect | fontselect fontsizeselect | bold italic strikethrough forecolor backcolor | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat',
toolbar2: 'image media link | table save2chul mybutton',
// menubar: false,
content_css : "custom_content.css",
extended_valid_elements : "link[rel|href],a[class|name|href|target|title|onclick|rel],script[type|src],iframe[src|style|width|height|scrolling|marginwidth|marginheight|frameborder],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name]",
plugins: [
'advlist autolink lists link image charmap print hr anchor pagebreak',
'searchreplace wordcount visualblocks visualchars code fullscreen',
'insertdatetime media nonbreaking save table contextmenu directionality',
'emoticons template paste textcolor colorpicker textpattern codesample toc',
'fullpage preview'
],
setup: function (editor) {
editor.addButton('save2chul', {
text: 'save',
icon: false,
onclick: function () {
var content = editor.getContent({format: 'text'});
console.log(content);
page_num = "000" + page_num;
page_num = page_num.slice(-3);
$.ajax({
type: "POST",
url: "https://www.delehi.net/chulapp/post/" + page_num,
data: {
"content": content
// "title":page_num
},
success: function(j_data){
// 処理を記述
// al
console.log(j_data);
// alert("ss");
}
});
}
});
editor.addButton('mybutton', {
type: 'listbox',
text: 'My listbox',
icon: false,
onselect: function (e) {
// editor.insertContent(this.value());
page_num = "000" + this.value();
page_num= page_num.slice(-3);
$.ajax({
type: "GET",
url: "https://www.delehi.net/chulapp/post/" + page_num,
data: null,
success: function(j_data){
// 処理を記述
// al
console.log("=============");
console.log(j_data);
editor.setContent(j_data);
// alert("ddd");
}
});
$("#image").attr("src", "jpg/" + page_num +".jpg");
},
values: pages,
onPostRender: function () {
// Select the second item by default
this.value(' <em>Some italic text!</em>');
}
});
},
font_formats:'ᠮᠣᠩᠭᠤᠯ ᠴᠠᠭᠠᠨ ᠲᠢᠭ᠌=mongolian white,serif;Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats',
file_picker_types: 'image',
// and here's our custom image picker
file_picker_callback: function(cb, value, meta) {
dialog.showOpenDialog({
properties: ["openFile"],
filters: [{name: 'Images', extensions: ['jpg', 'png', 'gif', 'svg']}],
defaultPath: working_directory
}, function(fn) {
var filename = path.basename(fn[0]);
var rel_filename = path.relative(working_directory || "", fn[0]);
cb(rel_filename, { title: filename});
});
}
});
</script>
</html>