Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
PyBusMap
Manage
Activity
Members
Labels
Plan
Issues
10
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anton Sarukhanov
PyBusMap
Commits
6f1a05be
Commit
6f1a05be
authored
9 years ago
by
Anton Sarukhanov
Browse files
Options
Downloads
Patches
Plain Diff
Cleanup embed UI
parent
ad4f7c22
No related branches found
Branches containing commit
No related tags found
1 merge request
!1
Implemented Embed-code generator interface
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
static/css/map.css
+44
-4
44 additions, 4 deletions
static/css/map.css
static/js/embed.js
+1
-1
1 addition, 1 deletion
static/js/embed.js
templates/modal-embed.html
+42
-19
42 additions, 19 deletions
templates/modal-embed.html
with
87 additions
and
24 deletions
static/css/map.css
+
44
−
4
View file @
6f1a05be
...
...
@@ -8,6 +8,24 @@ html, body {
font-family
:
sans-serif
;
font-size
:
14px
;
}
input
,
textarea
,
select
,
button
{
max-width
:
100%
;
}
fieldset
{
margin
:
0
;
border
:
none
;
padding
:
.25em
1em
;
}
legend
{
padding
:
0
;
margin-left
:
-1em
;
}
fieldset
legend
~
label
{
font-size
:
.9em
;
}
#map
{
height
:
100%
;
width
:
100%
;
...
...
@@ -136,15 +154,15 @@ html, body {
}
.modal
{
display
:
none
;
background-color
:
#
444
;
color
:
#
eee
;
background-color
:
#
fff
;
color
:
#
333
;
border-radius
:
1em
;
box-sizing
:
border-box
;
border
:
2px
solid
#888
;
position
:
absolute
;
width
:
80%
;
left
:
10%
;
top
:
20
%
;
top
:
7.5
%
;
padding
:
1em
;
max-height
:
80%
;
overflow
:
auto
;
...
...
@@ -154,15 +172,30 @@ html, body {
float
:
right
;
cursor
:
pointer
;
}
.modal
hr
{
display
:
block
;
height
:
1px
;
border
:
0
;
border-top
:
1px
solid
#ccc
;
margin
:
1em
0
;
padding
:
0
;
}
.modal
h1
,
.modal
h2
{
text-align
:
center
;
}
.modal
.close
+
h1
,
.modal
.close
+
h2
{
margin-top
:
.5em
;
}
.modal
h3
{
margin-bottom
:
.5em
;
}
.modal
a
,
.modal
a
:hover
,
.modal
a
:visited
,
.modal
a
:active
{
color
:
#
fff
;
color
:
#
000
;
font-weight
:
bold
;
text-decoration
:
none
;
}
...
...
@@ -170,6 +203,13 @@ html, body {
.modal
h2
a
{
text-decoration
:
underline
;
}
#embed-form
input
{
width
:
5em
;
}
#embed-form
label
span
{
display
:
inline-block
;
width
:
8em
;
}
@media
all
and
(
max-width
:
600px
)
{
.modal
{
...
...
This diff is collapsed.
Click to expand it.
static/js/embed.js
+
1
−
1
View file @
6f1a05be
...
...
@@ -2,7 +2,7 @@
var
updateCode
=
function
()
{
var
code
=
$
(
"
#embed-preview
"
).
html
();
$
(
"
#embed-code
"
).
html
(
code
);
$
(
"
#embed-code
"
).
html
(
code
.
trim
()
);
}
$
(
"
#embed-height
"
).
change
(
function
()
{
...
...
This diff is collapsed.
Click to expand it.
templates/modal-embed.html
+
42
−
19
View file @
6f1a05be
<h2>
Embed This Map
</h2>
<p>
Use PyBusMap in your own website or display!
This map can be used in websites, displays, or digital signage solutions.
</p>
<p>
Tweak the options to your liking, then copy the code.
</p>
<form
id=
"form"
>
<label
for=
"embed-height"
>
Height
</label>
<input
id=
"embed-height"
type=
"number"
min=
50
step=
50
value=
250
>
<br>
<label
for=
"embed-width"
>
Width
</label>
<input
id=
"embed-width"
type=
"number"
min=
50
step=
50
value=
400
>
<br>
<label
for=
"embed-mode"
>
Mode
</label>
<select
id=
"embed-mode"
>
<option
value=
"map"
>
Map
</option>
<option
value=
"predictions"
>
Predictions
</option>
<option
value=
"split"
>
Combined
</option>
</select>
</form>
<h3>
Embed Code
</h3>
<textarea
id=
"embed-code"
cols=
100
rows=
3
readonly=
true
></textarea>
<h3>
Preview
</h3>
<div
id=
"embed-preview"
>
<iframe
src=
"{{ url_for('map_embed', _external=True, _scheme='') }}"
width=
"400px"
height=
"250px"
frameborder=
0
></iframe>
</div>
<textarea
id=
"embed-code"
cols=
100
rows=
5
readonly=
true
></textarea>
<h3>
Options
</h3>
<form
id=
"embed-form"
>
<p>
<label
for=
"embed-mode"
>
<span>
Mode:
</span>
<select
id=
"embed-mode"
>
<option
value=
"map"
>
Map
</option>
<option
value=
"predictions"
>
Predictions
</option>
<option
value=
"split"
>
Combined
</option>
</select>
</label>
</p>
<p>
<fieldset>
<legend>
Size
</legend>
<label
for=
"embed-width"
>
<span>
Width:
</span>
<input
id=
"embed-width"
type=
"number"
min=
50
step=
50
value=
400
>
px
</label>
<br>
<label
for=
"embed-height"
>
<span>
Height:
</span>
<input
id=
"embed-height"
type=
"number"
min=
50
step=
50
value=
250
>
px
</label>
</fieldset>
</p>
<p>
<label
for=
"embed-responsive"
>
<span>
Responsive:
</span>
<input
id=
"embed-responsive"
type=
"checkbox"
checked
>
<small>
Map will resize automatically to fit a smaller window or device.
</small>
</label>
</p>
</form>
<hr>
<p
class=
"legalese"
>
Data not guaranteed to be correct.
Refer to your transit agency for official schedules and/or predictions.
</p>
<p
class=
"legalese"
>
No guarantees are made about availability, performance, or suitability of this service for any purpose.
</p>
<script
src=
"static/js/embed.js"
></script>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment