<commit_before><link rel="import" href="bower_components/polymer/polymer.html">
<link rel="import" href="bower_components/paper-styles/color.html">
<link rel="import" href="bower_components/paper-header-panel/paper-header-panel.html">
<link rel="import" href="bower_components/paper-toolbar/paper-toolbar.html">
<link rel="import" href="bower_components/paper-tabs/paper-tabs.html">
<link rel="import" href="bower_components/paper-input/paper-input.html">
<link rel="import" href="bower_components/paper-button/paper-button.html">
<link rel="import" href="bower_components/paper-dialog/paper-dialog.html">
<link rel="import" href="bower_components/iron-flex-layout/iron-flex-layout.html">
<link rel="import" href="bower_components/iron-icon/iron-icon.html">
<link rel="import" href="bower_components/iron-icons/iron-icons.html">
<link rel="import" href="bower_components/paper-icon-button/paper-icon-button.html">
<link rel="import" href="bower_components/paper-menu-button/paper-menu-button.html">
<link rel="import" href="bower_components/paper-menu/paper-menu.html">
<link rel="import" href="bower_components/paper-item/paper-item.html">
<link rel="import" href="bower_components/paper-item/paper-icon-item.html">
<link rel="import" href="bower_components/paper-spinner/paper-spinner.html">
<link rel="import" href="bower_components/neon-animation/neon-animated-pages.html">
<link rel="import" href="bower_components/neon-animation/animations/fade-in-animation.html">
<link rel="import" href="bower_components/neon-animation/animations/fade-out-animation.html">
<link rel="import" href="microformat-editor.html">
<script src="bower_components/microformat-shiv/microformat-shiv.min.js"></script>

<dom-module id="micro-panel">
	<template strip-whitespace>
		<style>
			:host {
				--primary-color: var(--paper-teal-600);
				--paper-toolbar-content: { padding: 0; };
				--paper-toolbar-height: 56px;
				--paper-spinner-layer-1-color: #fcfcfc;
				--paper-spinner-layer-2-color: #d8d8d8;
				--paper-spinner-layer-3-color: #fcfcfc;
				--paper-spinner-layer-4-color: #d8d8d8;
			}
			.content-wrapper { overflow: hidden; height: 100%; }
			neon-animatable, neon-animatable > *, .content-wrapper ::content iframe { width: 100%; height: 100%; border: 0; background: #fff; }
			paper-icon-button { margin-right: 0 !important; }
			paper-tabs { flex: 1 1 auto; height: var(--paper-toolbar-height); }
			.ui-tab-content { overflow-y: auto; -webkit-overflow-scrolling: touch; }
			.toolbar-wrapper { @apply(--layout-vertical); }
			.toolbar-wrapper .ui-tab-content { @apply(--layout-flex); }
			.editor-bottom-bar { --paper-toolbar-content: { justify-content: flex-end; }; }

			@media screen and (min-width: 450px) {
				#open-url-input, #auth-url-input { min-width: 70vw; }
			}

			@media screen and (max-width: 600px) {
				.editor-bottom-bar { padding-left: 10vw; padding-right: 10vw; }
			}

			@media screen and (min-width: 800px) {
				#open-url-input, #auth-url-input { min-width: 55vw; }
			}
		</style>

		<paper-header-panel>
			<paper-toolbar>
				<paper-menu-button id="menu-button"
						 open-animation-config='[{"name": "fade-in-animation", "timing": {"duration": 200}}]'
						close-animation-config='[{"name": "fade-out-animation", "timing": {"duration": 200}}]'>
					<paper-icon-button icon="more-vert" class="dropdown-trigger"></paper-icon-button>
					<paper-menu class="dropdown-content">
						<paper-icon-item role="menuitem" on-tap="openNewEntry"><iron-icon icon="create" item-icon></iron-icon>New post</paper-icon-item>
						<paper-icon-item role="menuitem" on-tap="showOpenUrl"><iron-icon icon="input" item-icon></iron-icon>Open URL</paper-icon-item>
						<paper-icon-item role="menuitem" on-tap="showAbout"><iron-icon icon="info" item-icon></iron-icon>About...</paper-icon-item>
					</paper-menu>
				</paper-menu-button>
				<paper-tabs id="tabs" scrollable hide-scroll-buttons selected="{{selected}}" on-tap="closeMenu">
					<paper-tab>Website</paper-tab>
					<paper-tab>Drafts</paper-tab>
					<template is="dom-repeat" items="{{editing}}">
						<paper-tab>Entry</paper-tab>
					</template>
				</paper-tabs>
			</paper-toolbar>

			<neon-animated-pages id="pages" entry-animation="fade-in-animation" exit-animation="fade-out-animation"
					selected="[[selected]]" class="content-wrapper content fit" on-tap="closeMenu">
				<neon-animatable>
					<content></content>
				</neon-animatable>
				<neon-animatable class="ui-tab-content">
					TODO
				</neon-animatable>
				<template id="editing-repeat" is="dom-repeat" items="{{editing}}">
					<neon-animatable>
						<div class="toolbar-wrapper">
							<microformat-editor class="ui-tab-content" item="{{item}}"></microformat-editor>
							<paper-toolbar class="editor-bottom-bar">
								<paper-spinner active="{{requestInProgress}}"></paper-spinner>
								<template is="dom-if" if="{{item.x-micro-panel-new}}">
									<paper-button on-tap="createEntry" hidden="{{requestInProgress}}">Create</paper-button>
								</template>
								<template is="dom-if" if="{{!item.x-micro-panel-new}}">
									<paper-button on-tap="deleteEntry" hidden="{{requestInProgress}}">Delete</paper-button>
									<paper-button on-tap="saveEntry" hidden="{{requestInProgress}}">Save</paper-button>
								</template>
							</paper-toolbar>
						</div>
					</neon-animatable>
				</template>
			</neon-animated-pages>
		</paper-header-panel>

		<paper-dialog id="auth-dialog" on-iron-overlay-closed="authDialogClosed"
				modal entry-animation="fade-in-animation" exit-animation="fade-out-animation">
			<h2>Sign in</h2>
			<p>
				<small>(manually adding <code>access_token</code> and <code>micropub_link</code> to <code>localStorage</code> in browser devtools and refreshing the page also works)</small>
			</p>
			<paper-input id="auth-url-input" label="Your domain" type="url"></paper-input>
			<div class="buttons">
				<paper-button on-tap="authStart">Sign in</paper-button>
			</div>
		</paper-dialog>

		<paper-dialog id="open-url-dialog" on-iron-overlay-closed="openUrlClosed"
				modal entry-animation="fade-in-animation" exit-animation="fade-out-animation">
			<h2>Open URL</h2>
			<paper-input id="open-url-input" label="URL" type="url"></paper-input>
			<div class="buttons">
				<paper-button dialog-dismiss>Cancel</paper-button>
				<paper-button dialog-confirm>Go</paper-button>
			</div>
		</paper-dialog>

		<paper-dialog id="about-dialog" modal entry-animation="fade-in-animation" exit-animation="fade-out-animation">
			<h2>About</h2>
			<p>
				micro-panel is an admin panel for websites that support <a href="http://micropub.net/draft/">micropub</a> and <a href="http://microformats.org/wiki/microformats2">microformats2</a>.
			</p>
			<p>
				Check the <a href="https://github.com/myfreeweb/micro-panel">project's GitHub page</a> for updates, and <a href="https://unrelenting.technology">the author's website</a> just because :)
			</p>
			<div class="buttons">
				<paper-button dialog-dismiss>Close</paper-button>
			</div>
		</paper-dialog>

	</template>

	<script src="micro-panel.js"></script>
</dom-module>
<commit_msg>use flex fit (fix chrome zero height)<commit_after><link rel="import" href="bower_components/polymer/polymer.html">
<link rel="import" href="bower_components/paper-styles/color.html">
<link rel="import" href="bower_components/paper-header-panel/paper-header-panel.html">
<link rel="import" href="bower_components/paper-toolbar/paper-toolbar.html">
<link rel="import" href="bower_components/paper-tabs/paper-tabs.html">
<link rel="import" href="bower_components/paper-input/paper-input.html">
<link rel="import" href="bower_components/paper-button/paper-button.html">
<link rel="import" href="bower_components/paper-dialog/paper-dialog.html">
<link rel="import" href="bower_components/iron-flex-layout/iron-flex-layout.html">
<link rel="import" href="bower_components/iron-flex-layout/classes/iron-flex-layout.html">
<link rel="import" href="bower_components/iron-icon/iron-icon.html">
<link rel="import" href="bower_components/iron-icons/iron-icons.html">
<link rel="import" href="bower_components/paper-icon-button/paper-icon-button.html">
<link rel="import" href="bower_components/paper-menu-button/paper-menu-button.html">
<link rel="import" href="bower_components/paper-menu/paper-menu.html">
<link rel="import" href="bower_components/paper-item/paper-item.html">
<link rel="import" href="bower_components/paper-item/paper-icon-item.html">
<link rel="import" href="bower_components/paper-spinner/paper-spinner.html">
<link rel="import" href="bower_components/neon-animation/neon-animated-pages.html">
<link rel="import" href="bower_components/neon-animation/animations/fade-in-animation.html">
<link rel="import" href="bower_components/neon-animation/animations/fade-out-animation.html">
<link rel="import" href="microformat-editor.html">
<script src="bower_components/microformat-shiv/microformat-shiv.min.js"></script>

<dom-module id="micro-panel">
	<template strip-whitespace>
		<style>
			:host {
				--primary-color: var(--paper-teal-600);
				--paper-toolbar-content: { padding: 0; };
				--paper-toolbar-height: 56px;
				--paper-spinner-layer-1-color: #fcfcfc;
				--paper-spinner-layer-2-color: #d8d8d8;
				--paper-spinner-layer-3-color: #fcfcfc;
				--paper-spinner-layer-4-color: #d8d8d8;
			}
			.content-wrapper { overflow: hidden; }
			neon-animatable, neon-animatable > *, .content-wrapper ::content iframe { width: 100%; height: 100%; border: 0; background: #fff; }
			paper-icon-button { margin-right: 0 !important; }
			paper-tabs { @apply(--layout-flex); height: var(--paper-toolbar-height); }
			.ui-tab-content { overflow-y: auto; -webkit-overflow-scrolling: touch; }
			.toolbar-wrapper { @apply(--layout-vertical); }
			.toolbar-wrapper .ui-tab-content { @apply(--layout-flex); }
			.editor-bottom-bar { --paper-toolbar-content: { justify-content: flex-end; }; }

			@media screen and (min-width: 450px) {
				#open-url-input, #auth-url-input { min-width: 70vw; }
			}

			@media screen and (max-width: 600px) {
				.editor-bottom-bar { padding-left: 10vw; padding-right: 10vw; }
			}

			@media screen and (min-width: 800px) {
				#open-url-input, #auth-url-input { min-width: 55vw; }
			}
		</style>

		<paper-header-panel>
			<paper-toolbar>
				<paper-menu-button id="menu-button"
						 open-animation-config='[{"name": "fade-in-animation", "timing": {"duration": 200}}]'
						close-animation-config='[{"name": "fade-out-animation", "timing": {"duration": 200}}]'>
					<paper-icon-button icon="more-vert" class="dropdown-trigger"></paper-icon-button>
					<paper-menu class="dropdown-content">
						<paper-icon-item role="menuitem" on-tap="openNewEntry"><iron-icon icon="create" item-icon></iron-icon>New post</paper-icon-item>
						<paper-icon-item role="menuitem" on-tap="showOpenUrl"><iron-icon icon="input" item-icon></iron-icon>Open URL</paper-icon-item>
						<paper-icon-item role="menuitem" on-tap="showAbout"><iron-icon icon="info" item-icon></iron-icon>About...</paper-icon-item>
					</paper-menu>
				</paper-menu-button>
				<paper-tabs id="tabs" scrollable hide-scroll-buttons selected="{{selected}}" on-tap="closeMenu">
					<paper-tab>Website</paper-tab>
					<paper-tab>Drafts</paper-tab>
					<template is="dom-repeat" items="{{editing}}">
						<paper-tab>Entry</paper-tab>
					</template>
				</paper-tabs>
			</paper-toolbar>

			<neon-animated-pages id="pages" entry-animation="fade-in-animation" exit-animation="fade-out-animation"
					selected="[[selected]]" class="content-wrapper content fit" on-tap="closeMenu">
				<neon-animatable>
					<content></content>
				</neon-animatable>
				<neon-animatable class="ui-tab-content">
					TODO
				</neon-animatable>
				<template id="editing-repeat" is="dom-repeat" items="{{editing}}">
					<neon-animatable>
						<div class="toolbar-wrapper">
							<microformat-editor class="ui-tab-content" item="{{item}}"></microformat-editor>
							<paper-toolbar class="editor-bottom-bar">
								<paper-spinner active="{{requestInProgress}}"></paper-spinner>
								<template is="dom-if" if="{{item.x-micro-panel-new}}">
									<paper-button on-tap="createEntry" hidden="{{requestInProgress}}">Create</paper-button>
								</template>
								<template is="dom-if" if="{{!item.x-micro-panel-new}}">
									<paper-button on-tap="deleteEntry" hidden="{{requestInProgress}}">Delete</paper-button>
									<paper-button on-tap="saveEntry" hidden="{{requestInProgress}}">Save</paper-button>
								</template>
							</paper-toolbar>
						</div>
					</neon-animatable>
				</template>
			</neon-animated-pages>
		</paper-header-panel>

		<paper-dialog id="auth-dialog" on-iron-overlay-closed="authDialogClosed"
				modal entry-animation="fade-in-animation" exit-animation="fade-out-animation">
			<h2>Sign in</h2>
			<p>
				<small>(manually adding <code>access_token</code> and <code>micropub_link</code> to <code>localStorage</code> in browser devtools and refreshing the page also works)</small>
			</p>
			<paper-input id="auth-url-input" label="Your domain" type="url"></paper-input>
			<div class="buttons">
				<paper-button on-tap="authStart">Sign in</paper-button>
			</div>
		</paper-dialog>

		<paper-dialog id="open-url-dialog" on-iron-overlay-closed="openUrlClosed"
				modal entry-animation="fade-in-animation" exit-animation="fade-out-animation">
			<h2>Open URL</h2>
			<paper-input id="open-url-input" label="URL" type="url"></paper-input>
			<div class="buttons">
				<paper-button dialog-dismiss>Cancel</paper-button>
				<paper-button dialog-confirm>Go</paper-button>
			</div>
		</paper-dialog>

		<paper-dialog id="about-dialog" modal entry-animation="fade-in-animation" exit-animation="fade-out-animation">
			<h2>About</h2>
			<p>
				micro-panel is an admin panel for websites that support <a href="http://micropub.net/draft/">micropub</a> and <a href="http://microformats.org/wiki/microformats2">microformats2</a>.
			</p>
			<p>
				Check the <a href="https://github.com/myfreeweb/micro-panel">project's GitHub page</a> for updates, and <a href="https://unrelenting.technology">the author's website</a> just because :)
			</p>
			<div class="buttons">
				<paper-button dialog-dismiss>Close</paper-button>
			</div>
		</paper-dialog>

	</template>

	<script src="micro-panel.js"></script>
</dom-module>

{'fraction_non_alphanumeric': 0.18797829414220119, 'fraction_numerical': 0.00800055656045638, 'mean_word_length': 4.304428044280443, 'pattern_counts': {'":': 12, '<': 294, '<?xml version=': 0, '>': 296, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3344278', 'n_tokens_mistral': 5685, 'n_tokens_neox': 4817, 'n_words': 746}