Skip to content
This repository has been archived by the owner on Nov 7, 2019. It is now read-only.

Commit

Permalink
Merge f2f7f13 into b9b178d
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzzylogic2000 committed May 27, 2019
2 parents b9b178d + f2f7f13 commit 4fd46bd
Show file tree
Hide file tree
Showing 33 changed files with 112 additions and 3 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ liqd_product/static/
# Media
media/

# Static
static/

# setuptools
/build
/dist
Expand Down
1 change: 1 addition & 0 deletions apps/contrib/static/category_icons/icons/default_icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions apps/contrib/static/category_icons/icons/diamant_icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions apps/contrib/static/category_icons/icons/ellipse_icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions apps/contrib/static/category_icons/icons/hexagon_icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions apps/contrib/static/category_icons/icons/quadrat_icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions apps/contrib/static/category_icons/icons/raute_icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions apps/contrib/static/category_icons/icons/ring_icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions apps/contrib/static/category_icons/icons/zickzack_icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions apps/contrib/static/category_icons/pins/default_pin.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions apps/contrib/static/category_icons/pins/diamant_pin.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions apps/contrib/static/category_icons/pins/ellipse_pin.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions apps/contrib/static/category_icons/pins/halbkreis_pin.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions apps/contrib/static/category_icons/pins/hexagon_pin.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions apps/contrib/static/category_icons/pins/pentagramm_pin.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions apps/contrib/static/category_icons/pins/quadrat_pin.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions apps/contrib/static/category_icons/pins/raute_pin.svg
1 change: 1 addition & 0 deletions apps/contrib/static/category_icons/pins/rechtecke_pin.svg
1 change: 1 addition & 0 deletions apps/contrib/static/category_icons/pins/ring_pin.svg
1 change: 1 addition & 0 deletions apps/contrib/static/category_icons/pins/rw_dreieck_pin.svg
1 change: 1 addition & 0 deletions apps/contrib/static/category_icons/pins/zickzack_pin.svg
54 changes: 54 additions & 0 deletions apps/contrib/static/js/ajax_modal.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/* globals $ django */
$(function () {
var modalHTML = (
'<div class="modal" tabindex="-1" role="dialog">' +
'<div class="modal-dialog modal-lg" role="document">' +
'<div class="modal-content">' +
'<div class="modal-header"><h2 class="modal-title u-first-heading"></h2>' +
'<button type="button" class="close" data-dismiss="modal" aria-label="' + django.gettext('Close') + '"><span aria-hidden="true">&times;</span></button>' +
'</div>' +
'<div class="modal-body"></div>' +
' </div>' +
'</div>' +
'</div>'
)

var extractScripts = function ($root, selector, attr) {
var $existingValues = $('head').find(selector).map(function (i, e) {
return $(e).attr(attr)
})

$root.find(selector).each(function (i, script) {
var $script = $(script)
var $matches = $existingValues.filter(function (i, v) {
return v === $script.attr(attr)
})
if ($matches.length === 0) {
$('head').append($script)
}
})
}

$(document).on('click', '[data-toggle="ajax-modal"]', function (e) {
e.preventDefault()
var target = this.href + ' ' + this.dataset.targetSelector
var $newModal = $(modalHTML)
var _this = this

$newModal.on('hidden.bs.modal', function () {
$newModal.remove()
})

$newModal.find('.modal-body').load(target, function (html) {
var $root = $('<div>').html(html)
var title = $root.find('h1').text()
$newModal.find('.modal-title').text(title)
$newModal.attr('aria-label', title)
extractScripts($root, 'script[src]', 'src')
extractScripts($root, 'link[rel="stylesheet"]', 'href')

$newModal.insertAfter(_this)
$newModal.modal()
})
})
})
28 changes: 28 additions & 0 deletions apps/contrib/static/js/unload_warning.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/* global $ CKEDITOR django */

$(function () {
var submitted = false
var changeHandler = function () {
$(window).on('beforeunload', function (e) {
if (!submitted) {
var string = django.gettext('If you leave this page changes you made will not be saved.')
e.returnValue = string
return string
}
})
}

if (window.CKEDITOR) {
CKEDITOR.on('instanceReady', function (e) {
e.editor.on('change', changeHandler)
})
}

$(document).one('change', changeHandler)
.on('submit', function (e) {
if ($(e.target).data('ignore-submit') === true) {
return true
}
submitted = true
})
})

0 comments on commit 4fd46bd

Please sign in to comment.