Announcement

Collapse
No announcement yet.

Color value in html-modulles for any style

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Dmitrij
    started a topic Color value in html-modulles for any style

    Color value in html-modulles for any style

    In SMS (v.5.5.0) I have а number of widgets (html-modules) with a certain color value for the text and background. But the are many styles in SMS and these colors don't approach to all the styles.
    How can I change the html code of my html-module once to make the color of text and background change according to any chosen style? I mean a unique variable.

    Here is an example of a html-module:

    HTML Code:
    <! - start sw-rss-feed code->
    <script type = "text/javascript">
    <!-
    rssfeed_url = new Array ();
    rssfeed_url [0] = "https://news.yandex.ru/science.rss";
    rssfeed_frame_width = "100 %";
    rssfeed_frame_height = "400";
    rssfeed_scroll = "on";
    rssfeed_scroll_step = "4";
    rssfeed_scroll_bar = "off";
    rssfeed_target = "_ blank";
    rssfeed_font_size = "13";
    rssfeed_font_face = "";
    rssfeed_border = "off";
    rssfeed_css_url = "";
    rssfeed_title = "off";
    rssfeed_title_name = "<center> of News of a science </center>";
    rssfeed_title_bgcolor = "transparent";
    rssfeed_title_color = "#505659";
    rssfeed_title_bgimage = "";
    rssfeed_footer = "on";
    rssfeed_footer_name = "";
    rssfeed_footer_bgcolor = "transparent";
    rssfeed_footer_color = "#333";
    rssfeed_footer_bgimage = "";
    rssfeed_item_title_length = "200";
    rssfeed_item_title_color = "#2e7ec8";
    rssfeed_item_bgcolor = "transparent";
    rssfeed_item_bgimage = "";
    rssfeed_item_border_bottom = "off";
    rssfeed_item_source_icon = "off";
    rssfeed_item_date = "off";
    rssfeed_item_description = "on";
    rssfeed_item_description_length = "250";
    rssfeed_item_description_color = "#505659";
    rssfeed_item_description_link_color = "#333";
    rssfeed_item_description_tag = "on";
    rssfeed_no_items = "0";
    rssfeed_cache = "xxxxxxxx";
    //->
    </script>
    <script type = "text/javascript" src = "//feed.surfing-waves.com/js/rss-feed.js"> </script>
    <! - end sw-rss-feed code->
    What do I need to write instead of a line rssfeed_item_description_color = "#505659"; ?
    How can I set the value of "body_text_color" variable in html-modul to look text legible.in any style?

    Or may be change othe lines too?...
    Last edited by Dmitrij; Mon 4th Feb '19, 11:53am.

  • Glenn Vergara
    replied
    Glad to help!

    Leave a comment:


  • Dmitrij
    replied
    Originally posted by Glenn Vergara View Post
    Dmitrij try adding this code in every static html file that will be loaded in the iframe. Insert the code inside the <head> tag.

    Code:
    <style>
    body { background: transparent !important; }
    </style>
    <script>
    (function() {
    if (parent !== window) {
    var stylesheets = Array.prototype.slice.call(parent.document.querySelectorAll('link[rel="stylesheet"]'));
    var head = document.head;
    stylesheets.forEach(function(stylesheet) {
    var s = stylesheet.cloneNode();
    s.href = s.href; //this is needed to make the url absolute not relative
    head.appendChild(s);
    });
    }
    })();
    </script>
    Yes! It works perfectly!

    Leave a comment:


  • Dmitrij
    replied
    Originally posted by Glenn Vergara View Post
    Dmitrij try adding this code in every static html file that will be loaded in the iframe. Insert the code inside the <head> tag.
    Thank you! Will try


    Leave a comment:


  • Glenn Vergara
    replied
    Dmitrij try adding this code in every static html file that will be loaded in the iframe. Insert the code inside the <head> tag.

    Code:
    <style>
    body { background: transparent !important; }
    </style>
    <script>
    (function() {
        if (parent !== window) {
            var stylesheets = Array.prototype.slice.call(parent.document.querySelectorAll('link[rel="stylesheet"]'));
            var head = document.head;
            stylesheets.forEach(function(stylesheet) {
                var s = stylesheet.cloneNode();
                s.href = s.href; //this is needed to make the url absolute not relative
                head.appendChild(s);
            });
        }
    })();
    </script>
    Btw, you don't have to use stylevars in the vB HTML module as it already inherits the theme style. Stylevars don't work in HTML module anyway.

    Leave a comment:


  • Dmitrij
    replied
    Originally posted by In Omnibus View Post

    No. You cannot edit the coding for a static web page unless you are the owner of the page and you cannot edit any page, including pages you own, from an iframe.

    There is no way to edit a page enclosed within an iframe, or at least there shouldn't be one. As Wayne Luke already stated if you can edit a page within an iframe there is a major security issue.
    You didn`t understand.
    I`m the owner of all the pages I was talking about. So security is nothing to do with it...
    And I`am talking not about the code of module with <iframe> code, but about the code of html page, that opens in module.

    I'm not sure how many different people you need to tell you that you can't do what you are trying to do before you believe it.
    I kwon that some parts of style can be changed EVEN in iframe with the help of JS. Programmers write about it in Internet so you can find it by yourself..

    Leave a comment:


  • Dmitrij
    replied
    Originally posted by Glenn Vergara View Post
    What don't you use HTML module instead?
    You mean why?
    Because I have a module with a menu (list of urls) and beside a module with a window where these links open.
    So the content of urls opens within vbulletin, not as a separate page or external url...

    Last edited by Dmitrij; Tue 5th Mar '19, 9:41pm.

    Leave a comment:


  • Glenn Vergara
    replied
    What don't you use HTML module instead?

    Leave a comment:


  • In Omnibus
    replied
    Originally posted by Dmitrij View Post
    Can it be done in iframe using JS in document code?
    No. You cannot edit the coding for a static web page unless you are the owner of the page and you cannot edit any page, including pages you own, from an iframe.

    There is no way to edit a page enclosed within an iframe, or at least there shouldn't be one. As Wayne Luke already stated if you can edit a page within an iframe there is a major security issue.

    I'm not sure how many different people you need to tell you that you can't do what you are trying to do before you believe it.

    Leave a comment:


  • Dmitrij
    replied
    Yes because you are loading a static HTML file in the iframe.
    Can it be done in iframe using JS in document code?

    Leave a comment:


  • Glenn Vergara
    commented on 's reply
    Yes because you are loading a static HTML file in the iframe.

  • Dmitrij
    replied
    Originally posted by Glenn Vergara View Post
    You can't do that in iframe.

    You mean that the document does not see the DB?

    Leave a comment:


  • Glenn Vergara
    replied
    You can't do that in iframe.

    Leave a comment:


  • Dmitrij
    replied
    How can I set a vbulletin color style variable in the html document that opens in vbulletin module by <iframe>?

    For example I have such code in the document:

    HTML Code:
    <head>
    <style>
        body {
         font-family: Arial, sans-serif;
        }
        .Vbulletin {
         position: justify !important;
         color: {vb:stylevar module_content_background};
         font-family: serif;
        }
      </style>
    </head>
    HTML Code:
    <body>
    <p class="Vbulletin"><span class="Vbulletin">TEXT</span></p>
    </body>
    When I put this code in html-module it works fine (color is taken from DB). But when I use the same code in the html document that I open in vbulletin module by using <iframe> - the color is wrong (not taken from vbulletin DB for the chosen style)

    Leave a comment:


  • Wayne Luke
    replied
    You can't. At least you shouldn't be able to. IFRAMES are a completely different document and if you could, then that document isn't secure and shouldn't be placed on your site.

    Leave a comment:

Related Topics

Collapse

Working...
X