Skip to content
Code-Schnipsel Gruppen Projekte
Commit 41e02cc1 erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen

Merge branch 'dev'

Übergeordnete 0926b559 73a44f9f
Keine zugehörigen Branchen gefunden
Keine zugehörigen Tags gefunden
1 Merge Request!63Update 'next-2.x' with latest changes from 'main'
<html>
<head>
<script>
window.onload = function () {
var i, len, params;
var search = window.location.search;
var id = null;
search = search.replace('\?', '').split('&');
for (i = 0, len = search.length; i < len; i++) {
params = search[i].split('=');
if (params[0] === 'id') {
id = params[1];
break;
}
}
if (!id) {
return;
}
var parentWin = window.parent.window;
var parentDoc = window.parent.document;
var QUI = window.parent.QUI;
var Control = QUI.Controls.getById(id);
Control.$loaded(window.document);
}
</script>
</head>
<body></body>
</html>
\ No newline at end of file
/**
* @module qui/controls/elements/Sandbox
* @author www.pcsg.de (Henning Leutz)
*
* Allows to include completely foreign html
* The html is included via an iframe and cannot destroy the current html
*/
define('qui/controls/elements/Sandbox', [
'qui/QUI',
'qui/controls/Control'
], function (QUI, QUIControl) {
"use strict";
return new Class({
Extends: QUIControl,
Type : 'qui/controls/elements/Sandbox',
options: {
content: false
},
initialize: function (options) {
this.parent(options);
this.$FrameDocument = null;
},
/**
* Create DOMNode Element
*
* @return {Element|null}
*/
create: function () {
this.parent();
var moduleUrl = require.toUrl("qui/controls/elements/Sandbox.html");
this.$Elm = new Element('iframe', {
src : moduleUrl + '&id=' + this.getId(),
'data-quiid': this.getId()
});
if (this.getAttribute('styles')) {
this.$Elm.setStyles(this.getAttribute('styles'));
}
return this.$Elm;
},
/**
*
* @param frameDocument
*/
$loaded: function (frameDocument) {
this.$FrameDocument = frameDocument;
if (this.getAttribute('content')) {
this.setContent(this.getAttribute('content'));
}
this.fireEvent('load', [this]);
},
/**
* Is the frame loaded
*
* @return {boolean}
*/
isLoaded: function () {
return !!this.$FrameDocument;
},
/**
* Set the content to the frame
*/
setContent: function (content) {
if (!this.isLoaded()) {
this.setAttribute('content', content);
return;
}
this.$FrameDocument.body.innerHTML = content;
},
/**
* Return the iframe body
*
* @return {null|HTMLBodyElement}
*/
getBody: function () {
if (!this.isLoaded()) {
return null;
}
return this.$FrameDocument.body;
}
});
});
\ No newline at end of file
0% Lade oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren