-
Notifications
You must be signed in to change notification settings - Fork 413
Expand file tree
/
Copy pathindex.html
More file actions
220 lines (197 loc) · 9.35 KB
/
index.html
File metadata and controls
220 lines (197 loc) · 9.35 KB
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
<!DOCTYPE html>
<html lang="en">
<head>
<title>Blockbench</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#121418">
<meta name="color-scheme" content="dark">
<meta name="robots" content="noindex">
<link rel="manifest" href="manifest.webmanifest">
<link rel="shortcut icon" href="favicon.png" type="image/x-icon" />
<link rel="apple-touch-icon" href="icon_full.png">
<link rel="stylesheet" href="css/w3.css">
<link rel="stylesheet" href="css/jquery-ui.min.css">
<link rel="stylesheet" href="css/fontawesome.css">
<link rel="stylesheet" href="css/spectrum.css">
<link rel="stylesheet" href="css/prism.css">
<link rel="stylesheet" href="css/setup.css" id="setup_stylesheet">
<link rel="stylesheet" href="css/general.css">
<link rel="stylesheet" href="css/window.css">
<link rel="stylesheet" href="css/start_screen.css">
<link rel="stylesheet" href="css/panels.css">
<link rel="stylesheet" href="css/dialogs.css">
<style type="text/css" id="theme_css"></style>
<style type="text/css" id="theme_thumbnail_css"></style>
</head>
<body spellcheck="false" class="maximized">
<script>
if (typeof module === 'object') {window.module = module; module = undefined;}//jQuery Fix
if (localStorage.getItem('theme')) {
try {
stored_theme = JSON.parse(localStorage.getItem('theme'));
let dark_color = stored_theme.colors.dark;
if (dark_color) {
document.getElementById('theme_css').textContent = `@layer theme {body {--color-dark: ${dark_color};}};`
}
} catch (err) {}
}
window.ErrorLog = [];
window.onerror = (message, file, line) => {
if (message.includes('ResizeObserver loop completed with undelivered notifications')) return;
window.ErrorLog.push({message, file, line})
if (typeof Blockbench != 'undefined' && Blockbench.setup_successful) return;
let error_element = document.querySelector('#loading_error_detail');
if (error_element && !error_element.innerText) {
error_element.innerText = `${message}\nIn .${file.split(location.origin).join('')}:${line}`
}
}
window.factoryResetAndReload = function() {
let lang_key = 'menu.help.developer.reset_storage.confirm';
let result = window.confirm((window.tl && tl(lang_key) != lang_key) ? tl(lang_key) : 'Are you sure you want to reset Blockbench to factory settings? This will delete all custom settings, keybindings and installed plugins.');
if (result) {
localStorage.clear();
if ('Blockbench' in window) Blockbench.addFlag('no_localstorage_saving');
console.log('Cleared Local Storage');
window.location.reload(true);
}
}
</script>
<div id="loading_error_message" style="display: none;">
<div>An error occurred while loading Blockbench</div>
<div id="loading_error_detail" style="color: var(--color-subtle_text);"></div>
<button onclick="window.Blockbench ? window.Blockbench.reload() : window.location.reload(true)" class="large" style="margin-right: auto; margin-left: auto;">Reload</button>
<button onclick="factoryResetAndReload()" class="large" style="margin-right: auto; margin-left: auto;">Factory Reset</button>
<button onclick="window.close()" class="large" style="margin-right: auto; margin-left: auto;">Quit</button>
</div>
<script type="module" src="dist/bundle.js"></script>
<div style="display: none;"></div>
<div id="dialog_wrapper"></div>
<header>
<ul id="mac_window_menu" hidden></ul>
<div id="corner_logo" class="app-drag-region">
<img class="blockbench_logo" src="assets/logo_text_white.svg" alt="Blockbench" />
</div>
<ul id="menu_bar" class="scroll_horizontal"></ul>
<div id="title_bar_home_button" class="tool hidden" onclick="Interface.tab_bar.openNewTab()"><i class="material-icons icon">home</i></div>
<div class="app-drag-region" id="header_free_bar"></div>
<div id="update_menu"></div>
<div id="settings_profiles_header_menu" class="hidden tool">
<i class="material-icons icon">manage_accounts</i>
</div>
<ul id="windows_window_menu" hidden>
<li id="window_controls_button_minimize">
<svg width="18" height="18" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="M14 8v1H3V8h11z"/></svg>
</li>
<li id="window_controls_button_maximize">
<svg class="restore" width="18" height="18" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="M3 5v9h9V5H3zm8 8H4V6h7v7z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M5 5h1V4h7v7h-1v1h2V3H5v2z"/></svg>
<svg class="maximize" width="18" height="18" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="M3 3v10h10V3H3zm9 9H4V4h8v8z"/></svg>
</li>
<li class="wwm_r" id="window_controls_button_close">
<svg width="18" height="18" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.116 8l-4.558 4.558.884.884L8 8.884l4.558 4.558.884-.884L8.884 8l4.558-4.558-.884-.884L8 7.116 3.442 2.558l-.884.884L7.116 8z"/></svg>
</li>
</ul>
<button id="web_download_button" hidden><a href="https://blockbench.net/downloads">
<span class="tl">web.download_app</span>
<i class="material-icons icon">system_update</i>
</a></button>
</header>
<div id="page_wrapper" class="invisible start_screen">
<div id="blackout" class="darken"></div>
<div id="tab_bar" :class="{drag_mode: drag_target_index !== null}">
<div id="tab_bar_list" @wheel="mousewheelBar($event)" ref="tab_bar_list">
<div
class="project_tab"
v-for="(project, index) in tabs" :key="project.uuid"
:class="{
selected: project.selected,
new_tab: project.is_new_tab,
dragging: index == drag_target_index,
move_back: (drag_position_index !== null && index > drag_target_index && drag_position_index >= index),
move_forth: (drag_position_index !== null && index < drag_target_index && drag_position_index <= index)
}"
:title="project.name || project.geometry_name || ''"
@dblclick="project.openSettings()"
@contextmenu="project.showContextMenu($event)"
@mousedown="mouseDown(project, $event)"
@mouseup="mouseUp(project, $event)"
@mouseenter="mouseEnter(project, $event)"
@mouseleave="mouseLeave(project, $event)"
>
<dynamic-icon :icon="project.format ? project.format.icon : 'home'"></dynamic-icon>
<label class="project_tab_session_badge" v-if="project.EditSession"><i class="material-icons">group</i>{{ project.EditSession.client_count }}</label>
<label>{{ project.getDisplayName(false) }}<span v-if="project.getFileExtension?.()">.{{ project.getFileExtension() }}</span></label>
<div class="project_tab_close_button" :class="{unsaved: !project.saved}" :title="close_tab_label" @click="project.close()">
<i class="material-icons close_icon">clear</i>
<i class="material-icons unsaved_icon" v-if="!project.saved">fiber_manual_record</i>
</div>
</div>
<div id="new_tab_button" v-if="!new_tab.visible" @click="openNewTab()" :title="new_tab.name">
<i class="material-icons">add</i>
</div>
</div>
<div id="search_tab_button" v-if="projects.length > 1" @click="tabOverview()" :title="search_tabs_label">
<i class="material-icons">view_module</i>
</div>
</div>
<dialog id="action_selector"></dialog>
<div id="start_screen"></div>
<div id="work_screen" hidden>
<div id="main_toolbar">
<div class="toolbar_wrapper narrow tools"></div>
<div class="toolbar_wrapper narrow tool_options"></div>
<ul id="mode_selector" v-if="showModes()">
<li
v-for="mode in options"
v-if="Condition(mode.condition)"
v-bind:class="{selected: mode.selected}"
v-on:mousedown="mode.select()"
>
<dynamic-icon :icon="mode.icon"></dynamic-icon>
{{ mode.name }}
</li>
</ul>
</div>
<div id="left_bar" class="sidebar"></div>
<div id="right_bar" class="sidebar"></div>
<div id="center">
<ul id="toast_notification_list"></ul>
<div id="top_slot"></div>
<div id="preview">
<div class="clamped_reference_images"></div>
</div>
<div id="bottom_slot"></div>
<div id="mobile_panel_overlay" hidden></div>
</div>
<div id="status_bar"></div>
<div id="panel_selector_bar"></div>
</div>
</div>
<script type="module">
let browser_check_passed = false;
// Browser compatibility check
try {
eval('[1].at(0)');
let stylesheet = document.getElementById('setup_stylesheet');
if (!stylesheet || !stylesheet.sheet?.cssRules?.length) {
throw 'Stylesheet not loaded';
}
browser_check_passed = true;
} catch (err) {
console.error(err);
let error_element = document.querySelector('#loading_error_detail')
error_element.innerHTML = `Incompatible browser version. Please update your web browser.`;
}
if (!window.Blockbench?.setup_successful || !browser_check_passed) {
document.getElementById('loading_error_message').style.display = 'block'
if (window.require) {
require('@electron/remote').getCurrentWindow().webContents.openDevTools();
} else if (window.openDevTools) {
window.openDevTools();
}
} else {
document.getElementById('loading_error_message').innerHTML = 'No loading errors...'
}
</script>
</body>
</html>