1240: рэндеринг рекламы

custom event on dom insert
remotes/origin/top_year_choice
Alexander Burdeiny 10 years ago
parent 4b4b5afdc7
commit 07944f2d3f
  1. 17
      static/client/js/rejs/tops.js
  2. 10
      templates/client/accounts/feed.html
  3. 10
      templates/client/accounts/user_events.html
  4. 10
      templates/client/city/city.html
  5. 10
      templates/client/country/country.html
  6. 10
      templates/client/exposition/catalog.html
  7. 11
      templates/client/exposition/catalog_theme.html
  8. 14
      templates/client/includes/banners/tops.html

@ -51,9 +51,12 @@
if (event.target.readyState === 4) {
if (event.target.status === 200) {
console.info(document.readyState);
if (document.readyState === "loading") {
console.info('setting DOMContentLoaded event listener');
document.addEventListener("DOMContentLoaded", function() {
if (document.readyState === "loading" && !window.marker_DOMtopjsElementInserted) {
// console.info('setting DOMContentLoaded event listener');
console.info('setting DOMtopjsElementInserted event listener');
// document.addEventListener("DOMContentLoaded", function() {
document.addEventListener("DOMtopjsElementInserted", function() {
runCallback(callback, event.target.responseText);
});
} else {
@ -80,6 +83,14 @@
// main();
// window.addEventListener("load", main);
// document.addEventListener("DOMContentLoaded", main);
var DOMtopjsElementInserted = new Event('DOMtopjsElementInserted');
window.marker_DOMtopjsElementInserted = window.marker_DOMtopjsElementInserted || false;
document.addEventListener("DOMtopjsElementInserted", function() {
console.info("DOMtopjsElementInserted fired");
window.marker_DOMtopjsElementInserted = true
});
// Listen for the event.
main();
// function ready() {

@ -15,6 +15,16 @@
{% endblock %}
{% if object_list %}
{% block head_scripts %}
<script>
(function() {
var DOMtopjsElementInserted = new Event('DOMtopjsElementInserted');
window.marker_DOMtopjsElementInserted = window.marker_DOMtopjsElementInserted || false;
document.addEventListener("DOMtopjsElementInserted", function() {
console.info("DOMtopjsElementInserted fired");
window.marker_DOMtopjsElementInserted = true
});
})();
</script>
<script type="text/javascript" src="{% static 'client/js/rejs/tops.js' %}" async></script>
{% endblock head_scripts %}
{% endif %}

@ -19,6 +19,16 @@
{% if object_list %}
{% block head_scripts %}
<script>
(function() {
var DOMtopjsElementInserted = new Event('DOMtopjsElementInserted');
window.marker_DOMtopjsElementInserted = window.marker_DOMtopjsElementInserted || false;
document.addEventListener("DOMtopjsElementInserted", function() {
console.info("DOMtopjsElementInserted fired");
window.marker_DOMtopjsElementInserted = true
});
})();
</script>
<script type="text/javascript" src="{% static 'client/js/rejs/tops.js' %}" async></script>
{% endblock head_scripts %}
{% endif %}

@ -14,6 +14,16 @@
{% if object.get_events %}
{% block head_scripts %}
<script>
(function() {
var DOMtopjsElementInserted = new Event('DOMtopjsElementInserted');
window.marker_DOMtopjsElementInserted = window.marker_DOMtopjsElementInserted || false;
document.addEventListener("DOMtopjsElementInserted", function() {
console.info("DOMtopjsElementInserted fired");
window.marker_DOMtopjsElementInserted = true
});
})();
</script>
<script type="text/javascript" src="{% static 'client/js/rejs/tops.js' %}" async></script>
{% endblock head_scripts %}
{% endif %}

@ -14,6 +14,16 @@
{% if object.get_events %}
{% block head_scripts %}
<script>
(function() {
var DOMtopjsElementInserted = new Event('DOMtopjsElementInserted');
window.marker_DOMtopjsElementInserted = window.marker_DOMtopjsElementInserted || false;
document.addEventListener("DOMtopjsElementInserted", function() {
console.info("DOMtopjsElementInserted fired");
window.marker_DOMtopjsElementInserted = true
});
})();
</script>
<script type="text/javascript" src="{% static 'client/js/rejs/tops.js' %}" async></script>
{% endblock head_scripts %}
{% endif %}

@ -23,6 +23,16 @@
{% if object_list %}
{% block head_scripts %}
<script>
(function() {
var DOMtopjsElementInserted = new Event('DOMtopjsElementInserted');
window.marker_DOMtopjsElementInserted = window.marker_DOMtopjsElementInserted || false;
document.addEventListener("DOMtopjsElementInserted", function() {
console.info("DOMtopjsElementInserted fired");
window.marker_DOMtopjsElementInserted = true
});
})();
</script>
<script type="text/javascript" src="{% static 'client/js/rejs/tops.js' %}" async></script>
{% endblock head_scripts %}
{% endif %}

@ -5,6 +5,17 @@
{% if object_list %}
{% block head_scripts %}
<script>
(function() {
var DOMtopjsElementInserted = new Event('DOMtopjsElementInserted');
window.DOMtopjsElementInserted = DOMtopjsElementInserted;
window.marker_DOMtopjsElementInserted = window.marker_DOMtopjsElementInserted || false;
document.addEventListener("DOMtopjsElementInserted", function() {
console.info("DOMtopjsElementInserted fired");
window.marker_DOMtopjsElementInserted = true
});
})();
</script>
<script type="text/javascript" src="{% static 'client/js/rejs/tops.js' %}" async></script>
{% endblock head_scripts %}
{% endif %}

@ -1 +1,15 @@
<div id="expo_top_events"></div>
<script>
(function() {
try {
console.info("DOMtopjsElementInserted fire trying");
document.dispatchEvent(window.DOMtopjsElementInserted);
console.info("in DOM!");
}
catch (error) {
console.info(error);
// do nothing
}
})();
</script>

Loading…
Cancel
Save