Initial commit

This commit is contained in:
2023-04-15 10:14:26 +02:00
commit ca4cc6ec1b
21 changed files with 816 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
class ManifestController < ApplicationController
unloadable
skip_before_action :check_if_login_required
def index
render :layout => false, :action => 'index'
end
end

View File

@@ -0,0 +1,2 @@
module ManifestHelper
end

View File

@@ -0,0 +1,21 @@
<%= javascript_include_tag "jquery-fab.min.js", :plugin => 'baupm_core' %>
<%= javascript_include_tag "baupm.js", :plugin => 'baupm_core' %>
<%= stylesheet_link_tag 'jquery-fab.css', :plugin => 'baupm_core', :media => "screen" %>
<%= stylesheet_link_tag 'baupm.css', :plugin => 'baupm_core', :media => "screen" %>
<link href="/themes/<%= Setting.ui_theme %>/images/icons/apple-touch-icon.png" rel="apple-touch-icon" type="image/png" sizes="180x180">
<link href="/themes/<%= Setting.ui_theme %>/images/icons/favicon-32x32.png" sizes="32x32" rel="shortcut icon">
<link href="/themes/<%= Setting.ui_theme %>/images/icons/favicon-16x16.png" rel="icon" type="image/png" sizes="16x16">
<link href="/themes/<%= Setting.ui_theme %>/images/icons/favicon-32x32.png" rel="icon" type="image/png" sizes="32x32">
<link href="/themes/<%= Setting.ui_theme %>/images/icons/safari-pinned-tab.svg" rel="mask-icon" size="any" color="<%= Setting.plugin_baupm_core['baupm_theme_color'] %>">
<link href="/themes/<%= Setting.ui_theme %>/images/icons/android-chrome-192x192.png" rel="icon" sizes="192x192">
<link href="/themes/<%= Setting.ui_theme %>/images/icons/android-chrome-256x256.png" rel="icon" sizes="256x256">
<link href="/manifest.json" rel="manifest">
<% if Setting.plugin_baupm_core['baupm_theme_color'].present? %>
<meta name="theme-color" content="<%= Setting.plugin_baupm_core['baupm_theme_color'] %>">
<% end %>
<% if Setting.plugin_baupm_core['baupm_manifest_orientation'].present? %>
<meta name="screen-orientation" content="<%= Setting.plugin_baupm_core['baupm_manifest_orientation'] %>">
<% end %>
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">

View File

@@ -0,0 +1,41 @@
{
"name": "<%= Setting.plugin_baupm_core['baupm_application_title'] %>",
<% if Setting.plugin_baupm_core['baupm_application_short_title'].present? %>
"short_name": "<%= Setting.plugin_baupm_core['baupm_application_short_title'] %>",
<% end %>
<% if Setting.plugin_baupm_core['baupm_application_description'].present? %>
"description": "<%= Setting.plugin_baupm_core['baupm_application_description'] %>",
<% end %>
<% if Setting.plugin_baupm_core['baupm_manifest_display'].present? %>
"display": "<%= Setting.plugin_baupm_core['baupm_manifest_display'] %>",
<% end %>
<% if Setting.plugin_baupm_core['baupm_manifest_orientation'].present? %>
"orientation": "<%= Setting.plugin_baupm_core['baupm_manifest_orientation'] %>",
<% end %>
<% if Setting.plugin_baupm_core['baupm_manifest_start_url'].present? %>
"start_url": "<%= Setting.plugin_baupm_core['baupm_manifest_start_url'] %>",
<% end %>
<% if Setting.plugin_baupm_core['baupm_theme_color'].present? %>
"theme_color": "<%= Setting.plugin_baupm_core['baupm_theme_color'] %>",
<% end %>
<% if Setting.plugin_baupm_core['baupm_background_color'].present? %>
"background_color": "<%= Setting.plugin_baupm_core['baupm_background_color'] %>",
<% end %>
"icons": [
{
"src": "/themes/<%= Setting.ui_theme %>/images/icons/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/themes/<%= Setting.ui_theme %>/images/icons/android-chrome-256x256.png",
"sizes": "256x256",
"type": "image/png"
},
{
"src": "/themes/<%= Setting.ui_theme %>/images/icons/apple-touch-icon.png",
"sizes": "180x180",
"type": "image/png"
}
]
}

View File

@@ -0,0 +1,95 @@
<fieldset class="baupm-settings">
<legend><%= l(:baupm_manifest_settings) %></legend>
<table>
<tbody>
<tr>
<th><%= l(:baupm_application_title) %></th>
<td>
<input type="text" id="baupm_application_title" size="80"
value="<%= settings['baupm_application_title'] %>"
name="settings[baupm_application_title]" required>
</td>
</tr>
<tr>
<th><%= l(:baupm_application_short_title) %></th>
<td>
<input type="text" id="baupm_application_short_title" size="20"
value="<%= settings['baupm_application_short_title'] %>"
name="settings[baupm_application_short_title]" >
</td>
</tr>
<tr>
<th><%= l(:baupm_application_description) %></th>
<td>
<input type="text" id="baupm_application_description" size="80"
value="<%= settings['baupm_application_description'] %>"
name="settings[baupm_application_description]" >
</td>
</tr>
<tr>
<th><%= l(:baupm_manifest_orientation) %></th>
<td>
<select id="baupm_manifest_orientation"
name="settings[baupm_manifest_orientation]">
<option value="portrait"
<% if settings['baupm_manifest_orientation'] == 'portrait' %> selected<% end %>>
<%= l(:baupm_orientation_portrait) %>
</option>
<option value="landscape"
<% if settings['baupm_manifest_orientation'] == 'landscape' %> selected<% end %>>
<%= l(:baupm_orientation_landscape) %>
</option>
</select>
</td>
</tr>
<tr>
<th><%= l(:baupm_manifest_display) %></th>
<td>
<select id="baupm_manifest_display"
name="settings[baupm_manifest_display]">
<option value="standalone"
<% if settings['baupm_manifest_display'] == 'standalone' %> selected<% end %>>
<%= l(:baupm_display_standalone) %>
</option>
<option value="fullscreen"
<% if settings['baupm_manifest_display'] == 'fullscreen' %> selected<% end %>>
<%= l(:baupm_display_fullscreen) %>
</option>
<option value="minimal-ui"
<% if settings['baupm_manifest_display'] == 'minimal-ui' %> selected<% end %>>
<%= l(:baupm_display_minimal_ui) %>
</option>
<option value="browser"
<% if settings['baupm_manifest_display'] == 'browser' %> selected<% end %>>
<%= l(:baupm_display_browser) %>
</option>
</select>
</td>
</tr>
<tr>
<th><%= l(:baupm_manifest_start_url) %></th>
<td>
<input type="text" id="baupm_manifest_start_url" size="50"
value="<%= settings['baupm_manifest_start_url'] %>"
name="settings[baupm_manifest_start_url]" >
</td>
</tr>
<tr>
<th><%= l(:baupm_theme_color) %></th>
<td>
<input type="color" id="settings_theme_color"
value="<%= settings['baupm_theme_color'] %>"
name="settings[baupm_theme_color]" >
</td>
</tr>
<tr>
<th><%= l(:baupm_background_color) %></th>
<td>
<input type="color" id="settings_background_color"
value="<%= settings['baupm_background_color'] %>"
name="settings[baupm_background_color]" >
</td>
</tr>
</tbody>
</table>
</fieldset>