Rectangle 27 2

Getting textarea's to wrap content the same as e.g. div elements in Fi...

I have recently been doing some researching on the problem described by OP for a similar question on SO. It seems that a bug in Firefox is causing the rendering of this so called "not-padding-but-looks-like-padding" on textarea elements.

Usually this extra padding is not really an issue, but it becomes an issue when you want to keep two elements the same width, and you care about getting its content to wrap the same way in both elements.

It seems to be impossible to get rid of this 1.5px wide padding on the textarea in Firefox, so if you want to ensure that the content wrapping inside a div in Firefox behaves exactly the same as the content wrapping inside a textarea in Firefox, the best approach seems to be to add an additional 1.5px of padding on the right and the left hand side inside the div, but only in Firefox. You can accomplish this by setting the following vendor specific prefixed CSS properties on your div:

-moz-box-sizing: border-box;
-moz-padding-end: 1.5px; 
-moz-padding-start: 1.5px;

The first ensures that the padding set on the div does not increase the width of the div, and the next two ensure that 1.5px of padding will be set on the right and the left hand side of the div.

This approach does not affect the rendering of the div's in any other browsers, it doesn't need to, as textarea's in other browsers don't render any extra padding. But it ensures that there are no content wrapping differences between div's and textarea's inside Firefox as long as they share the same font-family and font-size properties and so on.

Here's a jsFiddle for demonstration purposes.

If you only wanted to ensure that a textarea in Firefox has the same width and wrapping behaviour as a textarea in other browsers, you can set its box-sizing to border-box, add a padding on both sides of 5.5px and set -moz-padding-end and -moz-padding-start to 0px.

textarea {
    padding: 0 5.5px 0 5.5px;
    -moz-padding-end: 0px;
    -moz-padding-start: 0px;
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

css - How to force Firefox to render textarea padding the same as in a...

css firefox textarea padding
Rectangle 27 11

OK. found the solution. apparently, the problem appear when the main document height is shorter than the iframe that is scrolled. the parts of the iframe page, that exceed the document height, are not rendered.

So, under my needs, I could solve the problem by adding such a js (with jquery) code:

<script>
$(function() {
     var iframe = $("#myIframe");    
     iframe.load(function() {
         $("body").height(iframe.height());
     });
 });
</script>

Anyone know how todo this with ExtJS or native JS as I don't have jQuery available there?

ios - Iframe Content Not Rendering Under Scroll In iOs5 iPad/iPhone - ...

iphone ios ipad iframe scroll
Rectangle 27 4

I think there is no way to do this kind of dynamic includes in EJS. It might break the separation of business logic and view. The solution can be to rendering the subtemplate in the controller, and passing its content to the layout.

For rendering subtemplate in the controller use something like this:

var ejs = require('ejs'),
, fs = require('fs')
, home = ejs.render(fs.readFileSync("contents/home.ejs", "utf-8"))

Using interpolation within Node.js EJS includes - Stack Overflow

node.js include express ejs
Rectangle 27 2

I found I was also able to solve the problem by making the document as tall as the iframe content. (As suggested Iframe Content Not Rendering Under Scroll In iOs5 iPad/iPhone) But in my case I didn't want the user to be able to scroll down in the now tall app, because its supposed to be a fullscreen application. I used this code to prevent vertical scrolling:

/*
Prevent Scrolling down.
 */
$(document).on("scroll",function(){
    checkForScroll();
});

var checkForScroll = function(e)
{
    var iScroll = $(document).scrollTop();
    if (iScroll > 1){
        // Disable event binding during animation
        $(document).off("scroll");

        // Animate page back to top
        $("body,html").animate({"scrollTop":"0"},500,function(){
            $(document).on("scroll",checkForScroll);
        });
    }
}

Be careful when posting copy and paste boilerplate/verbatim answers to multiple questions, these tend to be flagged as "spammy" by the community. If you're doing this then it usually means the questions are duplicates so flag them as such instead.

javascript - iframe on iOS (iPad) content cropping issue - Stack Overf...

javascript ipad iframe scroll
Rectangle 27 2

I found I was also able to solve the problem by making the document as tall as the iframe content. (As suggested Iframe Content Not Rendering Under Scroll In iOs5 iPad/iPhone) But in my case I didn't want the user to be able to scroll down in the now tall app, because its supposed to be a fullscreen application. I used this code to prevent vertical scrolling:

/*
Prevent Scrolling down.
 */
$(document).on("scroll",function(){
    checkForScroll();
});

var checkForScroll = function(e)
{
    var iScroll = $(document).scrollTop();
    if (iScroll > 1){
        // Disable event binding during animation
        $(document).off("scroll");

        // Animate page back to top
        $("body,html").animate({"scrollTop":"0"},500,function(){
            $(document).on("scroll",checkForScroll);
        });
    }
}

Be careful when posting copy and paste boilerplate/verbatim answers to multiple questions, these tend to be flagged as "spammy" by the community. If you're doing this then it usually means the questions are duplicates so flag them as such instead.

javascript - iframe on iOS (iPad) content cropping issue - Stack Overf...

javascript ipad iframe scroll
Rectangle 27 133

erb stands for "Embedded RuBy". A .html.erb or .erb.html file is HTML with Ruby code embedded in; Rails will evaluate the Ruby to add content to the file dynamically, and will output a "pure" HTML file for rendering.

Do you have a source?

lame, they should remove the html. u don't see html.php

Sign up for our newsletter and get our top new questions delivered to your inbox (see an example).

ruby on rails - What is the meaning of erb? - Stack Overflow

ruby-on-rails ruby erb
Rectangle 27 2

If you have an access to iFrame body, apply some transform3d to its content. In my case adding -webkit-transform: translate3d(0, 0, 0); to main wrapping div did the job.

height: 100%

ios - Iframe Content Not Rendering Under Scroll In iOs5 iPad/iPhone - ...

iphone ios ipad iframe scroll
Rectangle 27 36

You should try Asynchronous Google Analytics. It loads GA in the background, so the rest of the content on the page is not blocked from rendering:

Additionally, since you first asked this question, Google has upgraded their serving infrastructure. It's now faster, and much more reliable than it was in 2008. For most sites, it's better to use Google's CDN instead of hosting ga.js yourself. Since the official ga.js is on so many sites, most users will have it in their browser cache.

performance - Is there a faster alternative to Google Analytics? - Sta...

performance google-analytics analytics
Rectangle 27 1

To speed up the rendering you can use BufferedImage. Render your content once on the image's Graphics and use image instead of rendering all the content.

To render portion of panel use Graphics' setClip()/getClip() check which region has to be refreshed and draw only portion.

TO draw non rectangular object use the same setClip setting necessary Shapes.

Java swing rendering optimizations - Stack Overflow

java swing optimization rendering
Rectangle 27 1

To speed up the rendering you can use BufferedImage. Render your content once on the image's Graphics and use image instead of rendering all the content.

To render portion of panel use Graphics' setClip()/getClip() check which region has to be refreshed and draw only portion.

TO draw non rectangular object use the same setClip setting necessary Shapes.

Java swing rendering optimizations - Stack Overflow

java swing optimization rendering
Rectangle 27 22

To add on to Arun P Johny's solution, if you find that your <br /> tags in the data-content value are rendering as plain text in the popover content on the page, add the additional attribute data-html="true", like so:

<a data-content="Hi,<br />Welcome !<br /><br />Sincerely,<br />programmer"
        data-html="true"
        data-placement="bottom">
    content
</a>

Be aware that using data-html="true" does introduce a potential vulnerability to XSS attacks; don't use it with unsanitized user input.

html - Bootstrap popover hides line breaks - Stack Overflow

html twitter-bootstrap popover
Rectangle 27 3

In your 3D engine, render into a texture and in your QQuickItem use QSGSimpleTextureNode to show the rendering results. QtQuick maintains it's own GL state, which you could otherwise mess up, that's why it is recommended to use only the QSG* classes to show custom content. Basically, plain QtQuick is a tool for rendering rectangles, not 3D content generally.

QScopedPointer<QSGTexture> texture_;

QSGNode* MyItem::updatePaintNode(QSGNode* node, UpdatePaintNodeData*)
{
  if (width() <= 0 || height() <= 0)
  {
    texture_.reset();

    delete node;
    return 0;
  }
  else
  {
    if (!node)
    {
      node = new QSGSimpleTextureNode;

      static_cast<QSGSimpleTextureNode*>(node)
        ->setFiltering(QSGTexture::Nearest);
    }
    // else do nothing

    static_cast<QSGSimpleTextureNode*>(node)->setRect(boundingRect());

    getTheTextureFrom3DEngine(texture_);

    Q_ASSERT(texture_);
    static_cast<QSGSimpleTextureNode*>(node)->setTexture(texture_.data());

    return node;
  }
}

You also need to instantiate a Timer to update the contents. You can do this from within the QQuickItem.

qt - Rendering custom opengl in qt5's qtquick 2.0 - Stack Overflow

qt opengl qt-quick qt5
Rectangle 27 13

Asynchronous postback behaves much as the synchronous postback, All the server page life-cycle events occur. But in rendering phase, in an asynchronous postback only the contents of the update panels are sent back to the browser where as in synchronous postback all the page content is refreshed/sent back to the browser.

An asynchronous postback behaves much like a synchronous postback. All the server page life-cycle events occur, and view state and form data are preserved. However, in the rendering phase, only the contents of the UpdatePanel control are sent to the browser. The rest of the page remains unchanged.

Asynchronous and synchronous postback in ASP.NET - Stack Overflow

asp.net asynchronous postback
Rectangle 27 5

There is no flickering in web browsers! They already use dbl buffering for their rendering. Js engine will make all your rendering before showing it. Also, context save and restore only stack transformational matrix data and such, not the canvas content itself. So, you do not need or want dbl buffering!

@ricksuggs I find not using DB results in bad jerkiness in animations, I havn't tried DB yet

javascript - Does HTML5/Canvas Support Double Buffering? - Stack Overf...

javascript html5 canvas double-buffering
Rectangle 27 4

So usually, static/images/ would perhaps be the place where Thymeleaf should expect the static images which have to be delivered for rendering. But since this place is about static content and since it is in general a bad idea to save uploaded (dynamic) content inside your application I would recommend to DON'T do that. Did you think about what happens if your application is redeployed or moved to another machine? Your would have to backup / move the images in a cumbersome way. There are better solutions, storing the upload content at a separate location outside your app (which could for example be configurable and also reused by multiple instances) or even use a database to store image data. That would also enable handling images in a transactional context (e.g. isolation & rollbacks).

But If you now want to still store it inside your app, your can extend the locations by adding places to search for (actually static content). Although the answer of Ajit and even the documentation still gives the advice to extend your own WebMvcConfigurerAdapter, I personally would tend to implement WebMvcConfigurer instead, because the former is deprecated.

@Configuration
public class AdditionalResourceWebConfiguration implements WebMvcConfigurer {
    @Override
    public void addResourceHandlers(final ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/images/**").addResourceLocations("file:images/");
    }
}

Thanks that solved the problem :D

You are welcome :)

Spring Boot images uploading and serving - Stack Overflow

spring image spring-boot file-upload static-content
Rectangle 27 4

I had the same problem, but I only ever had one jquery-ui script tag in the DOM at a time. I was loading content with Ajax that included the script tag. If I did that twice on one page, it would break the autocomplete dropdown, even though the content of the second request was replacing the content of the first. One workaround is to add this line before rendering content containing the jquery-ui script:

$.ui = null;

It's better to just remove one of the jquery-ui scripts. It acually does'nt make any sense at all to load it twice

@brothers28 I agree. In this case one script tag was essentially replacing another, so there was only one script tag in the DOM but it was loading a second time. I had to use this workaround because I didn't have control over the content that I was fetching.

html - jQuery UI Autocomplete - menu disappears on hover - Stack Overf...

jquery html jquery-ui jquery-ui-autocomplete
Rectangle 27 4

I use JSF and Facelets and hot reload is always a bit problematic for web technologies which has dynamic rendering. So my suggestion apart from spring-boot-devtools will be separating static content development process from rendering related process. If you only need hot reload for css, html, js editing than most of technologies out there will help you but rendering related component editing going to ask you to rebuilt redeploy your app time to time. How frequently they going to ask you that depends on quality of the tool you will be using.

I need hot reload for all files(js, css, jsf) and js/css work, just the jsf files inside of a jar(src/main/resources/META-INF/resources/jsp/* are having problems. If the jsf files would be in the main project(the one I run with spring boot and not in a dependent jar) in the folder WEB-INF, it works, just not from META-INF folder inside of dependent jar.

Yes, devtools do not reload those files either.

thats weird if i understood correctly according to doc it should restart. it seems it is related "resource caching" as @Babi said. but on the other hand cache dont live after restart so idk.

Yeah, I tought it would work aswell, but no luck. Looks like the jsf files in META-INF are ignored for reloading...

java - Tomcat/Spring boot reloading META-INF/resources/ jsp files (liv...

java spring jsp tomcat spring-boot
Rectangle 27 2

In the ASP.NET markup language you can steer the rendering of any arbitrary contents. That is rendering a script tag only under certain conditions should be as simple as:

<% if (shouldRenderScriptTag) { %>
    <script src="..." />
<% } %>

+1. I still can't decide which answer to accept. You answered the actual question, but Adil answered the underlying question. You both deserve the credit. Oh, well, at some point I'll have to decide :) And thanks again.

@ispiro - the literal answer is so straight-forward that I think it will be of marginal use to the community. If Adil's answer helps you design the code a bit better I'd go for his.

c# - How to dynamically not render a script tag? - Stack Overflow

c# javascript html asp.net .net
Rectangle 27 5

The "view engine" handles the rendering of the view to html, xml or whatever content type it is created to emit. Within "MVC", it would be an aspect of the View (V).

Different view engines have different syntaxes, etc. to manage rendering. The decision to use another view engine is most likely very project/programmer specific. In some cases they may see an actual or perceived limitation of the default view engine; in other cases it may simply be a different design goal or focus.

As far as Spark goes, their focus is to be much more terse than the default view engine and to remain in HTML-like syntax as much as possible instead of dropping into ASP.NET script blocks.

As an end user, the only time you would want to create your own view engine is probably never. ;) It's not a task to be taken lightly, and you'll probably end up re-implementing functionality that already exists in an existing view engine.

The MVC pattern tells you that your model, view and controller will be separate "things". In ASP.NET MVC, the default view engine uses the existing ASP.NET framework, which includes master pages, ASPX files, etc. Spark does something similar, but it's a different engine so it doesn't work exactly the same. So in a general sense the view files are not engine-specific, but the specific files, their layout on disk and their contents are view-engine specific.

OK. So are the View.aspx files part of the View Engine, or is the View Engine a set of classes that help choose which View.aspx (or other type of response) that should be rendered? How does it work?

viewengine - What is an ASP.Net MVC View Engine? - Stack Overflow

asp.net-mvc viewengine
Rectangle 27 2

The better way of doing this is rendering content in views. You can have partial templates, you don't need to do string appending in the controller:

$categories = $this->category->get_categories();
$data['menu'] = $this->load->view('menu', array('data'=>$categories), TRUE);
$this->load->view('view', $data);

The TRUE in the call to view tell the function to return the rendered content and not put it into the buffer. You can then pass it to 'view'. You can also get the categories and pass them into the view 'view' and load the partial template from there.

Thanks for the tip about not appending strings in the controller. But, does this still mean I need to do this for each "page". I was kind of hoping there may be a way of automating the populating of a $menu view. Kind of like having $this->category_menu(); directly in the view, so when the view is called, the categories are populated. hope this makes sense

with a bit of experimenting I think I cracked it, thanks.

php - Codeigniter Dynamic Menu/MY_Controller question - Stack Overflow

php codeigniter menu