Notepad++ - Remove lines containing duplicate URL in a dynamic class - url

this is a pretty specific question regarding Notepad++, or any other way you think I can separate these, frankly. I'll give you a quick example:
<div class="image" style="position: absolute; left: 260px; top: 0px;"><img src="http://www.Imagelink1.com/1"></div>
<div class="image" style="position: absolute; left: 520px; top: 0px;"><img src="http://www.Imagelink1.com/1"></div>
<div class="image" style="position: absolute; left: 180px; top: 0px;"><img src="http://www.Imagelink1.com/1"></div>
<div class="image" style="position: absolute; left: 210px; top: 0px;"><img src="http://www.Imagelink1.com/1"></div>
Despite their styling and positions, how would I delete all of these lines while maintaining the first of the duplicate lines (due to the ImageLink URLs being the same). It would be easy to just 'Search and Replace', if it weren't for the positions and some of them having the same link.
It's much more complicated than that, but how would you go about deleting this?

If I understand correctly, the URL is the part that should be unique?
My way to do that would be to seperate the url's from the rest of the HTML, for example by using a regex and replacing everything that's not the URL, or by using block-select in Notepad++ and select all the URL's.
Then I'd paste the URL's in one column in Excel and paste the complete line (including the HTML) in the second column.
Then simply filter the first column by uniqueness:
Select the first column containing the URL's
Click the data-tab
There's a button "Remove duplicates". Click that.
It will ask if you want to expand the selection or use the selected column only. Tell Excel to expand the selection (because we want to filter all columns)
Then a window will popup asking which column contains the duplicate values. Select only column A because that's the column containing the URL's.
If you then click OK (or whatever the button is named) it will remove the duplicates like it should.
Then copy the second column back to Notepad++ and you'd have the unique lines.

Related

How can I customize mat-selection-list as mat-grid-list?

I want to customize mat-selection-list with specific columns. It's easy to specify it using mat-grid-list, but in my case i should to use mat-selection-list or other list-selection type.
But I'm not sure it's possible to divide a mat-selection-list in two columns for example.
I developed some code here better to explain my attempt
https://stackblitz.com/edit/angular-paezwe
i'm using angular 8 for information
MatListItems have display: block and width: 100% styling so they appear as rows in the list. You can override that to get them to display however you want. For example:
<mat-list-option *ngFor="let item of dataOption"
style="display:inline-block; width:50%; text-align:center;">
{{item.label}}
</mat-list-option>

struts 2 jquery grid plugin change only one column header style

Is it possible to change the style of only one column heard in grid ?!
The sjg:gridColumn has a cssClass property, but setting this css will only be applied to rows under the column, not the column header.
At JQGRID - Is it possible to change the background color of HTML header text in JavaScript? I got the code as:
in your HTML page. If you want make the changes for one column only
you can use setLabel method:
$("#myGrid").jqGrid('setLabel','Price', '', {'background':'red'});
or
$("#myGrid").jqGrid('setLabel','Price', '', 'myColorClass');
But I could not make it work.
Finally, as the columns headers will have unique Id, I could use below:
document.getElementById("gridtable_sampleColumn").style.backgroundColor = "#FF0000";
Well do you think there is a better way. I was looking for some thing like this:
<sjg:gridColumn name="sampleColumn"
cssClass="makeThisSmall" />
And in my css
.makeThisSmall{
font-size : smaller;
}
Which did not work and only change the rows css not column header.
Also I find that the gridColumn has a formatoptions could this do what I am looking for ?!
There are no declarative way to set style/class of the column header for specific column (I exclude definition of the CSS rule where the id or the column name are set explicitly). So you should use setLabel to set it.
If you need to change background color then you should take in consideration that background-image have to be set to none too. Additionally you should don't forget that other CSS rules will be applied too and the rule with more specific CSS selector will win. For example the font-size in the column header will be applied because of the following rule from ui.jqgrid.css:
.ui-jqgrid .ui-jqgrid-view {
font-size: 11px
}
which have two classes in the rule. If you want to change the value for columns having makeThisSmall class then you should define CSS rule like
.ui-jqgrid .ui-jqgrid-view .makeThisSmall {
font-size: 8px
}
or
.ui-jqgrid-view .makeThisSmall {
font-size: 8px
}
In any way it should be at least so complex or more complex as the CSS rule which you want to overwrite.
In the same way the background will be applied because of CSS rule which contains two classes too
.ui-widget-content .ui-state-default {
background: ...
}
So you need define the corresponding deep (or deeper) CSS role too to be able to ovewrite it via class attribute.

how to create two columns with div and CSS

I realize that this topic was discussed many many times. However, none seem to apply to me. I am generating HTML page using ASP.NET MVC construct HTML.DisplayFor() which generates <div class="display-label">Label</div> <div class="display-field">Value</div> pair for every property. I am trying to display them as a column - each line would have a label and a value. I tried various combinations, the best I came is the following:
.display-label {
font-weight: bold;
float: left;
width: 25%;
}
.display-field {
margin-left: 25%;
width: 75%;
}
Looks close to what I want; however, some fields have NULL value, in which case generated HTML is <div class="display-field"></div> In this situation next label is shown on the same line (where value would otherwise be).
I tried clear and display in various combinations - but none of them shows a label, a value and an empty block if the value is missing (for example, clear shifts all values up).
I am sure I am not the first one trying to solve this problem. But I couldn't find anything relevant; and my CSS skills are clearly insufficient. And yes, I know that I can write a custom DisplayFor template; but I was hoping that it wouldn't be necessary!
<div class="display-label">Label</div> <div class="display-field"></div>
<div style="clear:both"></div>
<div class="display-label">Label</div> <div class="display-field">Value</div>
Worked for me.
I think I got something that makes it work:
.display-field::after {
content: ".";
visibility: hidden;
}
Intuitively, I don't like it; so if somebody has a better solution, I'd love to use that one. But it works, and I don't have to mess with the template for a huge class

mottie tablesorter destroy, destroys look and feel of table

I've been using phantomjs and wkhtmltopdf to generate PDF reports of large 7000 row bootstrapped themed tables with color. Both run out of memory when trying to do so. Both uses nearly 1GB of memory to try to generate the PDF of the table. So I've been trying to figure out why. I want to first try to unlink tablesorter and clear it's cache when I'm printing a PDF report because it doesn't need any user interaction (no sorting or filtering needed). But everytime I use destroy, it destroys the look and feel of the table. I want to retain the look and feel but only destory tablesorter stuff like widgets and cache so that it doesn't consume so much memory. Is there a way to clear tablesorter but retain the look and feel of my table?
Update:
Thanx for replying Mottie!
I actually tried that and debugged and found that this is how the DOM looks like with tablesorter enabled with bootstrap theme:
<table data-bind="if: details" id="ColorTable-sticky" class="tablesorter tablesorter-bootstrap table table-bordered hasFilters containsStickyHeaders tablesorter-sticky-hidden" style="position: fixed; margin: 0px; top: 40px; visibility: hidden; z-index: 2; height: 0px; width: 1190px; padding: 0px; border: 0px; left: 36px;">
But once I destroy(false), I get this:
<table data-bind="if: details" id="ColorTable-sticky" class="tablesorter">
I would have thought that "tablesorter-bootstrap" class would be retained in the class but it appears that all classes were removed except for "tablesorter" class.
How do I get it to retain the tablesorter-bootstrap class?
The destroy method does have parameters:
// Remove tablesorter and all classes but the "tablesorter" class on the table
// callback is a function
$("table").trigger("destroy", [false, callback]);
If you pass false as the first parameter, everything is still destroyed, but the "tablesorter" class, including the theme name (e.g. "tablesorter-blue"), is retained.
The sort arrows are removed as well.
Update: Oh, I guess the "tablesorter-bootstrap" class is removed because it is part of the "uitheme" widget. I'll look into that. In the mean time, use the destroy callback function to restore the class name:
$("table").trigger("destroy", [false, function(table){
$(table).addClass('tablesorter-bootstrap');
}]);
Update 2: Ok, that didn't work as expected, you'll need to reapply the "uitheme" widget, but since the destroy method removes the API, I'll update the destroy method in the repository and have it working in the next udpate.

How to display will_paginate in the same line in Rails? and How to Style will_paginate?

1) I am trying to get the Paginate to display in same line instead of new line. Currently I have
<< Previous
1
2
Next >>
My CSS is defined as follows:
.pagination{CSS Style code}
.pagination a {CSS Style code}
.pagination a.current{CSS Style code}
2) How to turn off << Previous and Next >>?
3) What is the a.(class) called for currently selected paginate?
Currently I have .pagination a.current{CSS Style} but it does not work
I am using https://github.com/mislav/will_paginate
I am a complete Newbie in Rails;
Thanks in advance! :)
In case, any body still needs help with this... because there are many things with the class .pagination all as part of the <%=will_paginate %>. You may want to refer to the parent element.
div.pagination {
max-width: 100%;
min-width: 100%;
width: 100%;
}
and any other styling you may want.
Also, ensure that the parent element to that div does allow it to be spread out..
in case it happens to be in an or which have a width of 10px and you have 3000pages or that kind of thing.
you may want to remove it from it's parent element.

Resources