3

UPDATE : Here is an example of the CSS I think is having a problem:

.ui-widget-content { border: 1px solid #aaaaaa/*{borderColorContent}*/; background: #ffffff/*{bgColorContent}*/ url(images/ui-bg_flat_75_ffffff_40x100.png)/*{bgImgUrlContent}*/ 50%/*{bgContentXPos}*/ 50%/*{bgContentYPos}*/ repeat-x/*{bgContentRepeat}*/; color: #222222/*{fcContent}*/; }

UPDATE - Created a workitem in issue tracker for combres on codeplex.

UPDATE : I looked at the logs and I found what is going on -

2011-10-24 16:32:20,490 [15] WARN  Combres.Filters.FixUrlsInCssFilter - Cannot fix url url(images/ui-icons_454545_256x240.png)
System.ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length
   at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
   at System.String.Substring(Int32 startIndex, Int32 length)
   at Combres.Filters.FixUrlsInCssFilter.FixUrl(Resource resource, Match match)

So, can I get the source code and look at it or do I need to maybe put it on the combres issue tracker ?

I am using the filter -

 <filter type="Combres.Filters.FixUrlsInCssFilter, Combres" />

which is supposed to fix the relative urls issue mentioned here. But the urls (css background images) are still using the wrong path and do something like

http://somedomain.com/combres.axd/pics/pic.png

instead of using

http://somedomain.com/pics/pic.png

I also tried applying explicitly using -

<filter type="Combres.Filters.FixUrlsInCssFilter, Combres" acceptedResourceSets="myCss"  />

Can anyone give my any suggestions? I found something similar, but its solution does not work for me.

UPDATE : Here's my combres.xml just in case -

<?xml version="1.0" encoding="utf-8" ?>
<!--
  This file contains basic settings needed for most web apps.
  For full Combres settings (with explanation), refer to the sample definition file: combres_full_with_annotation.xml
  Also, refer to Combres' documentation: http://combres.codeplex.com/documentation  
-->
<combres xmlns='urn:combres'>
  <filters>
    <filter type="Combres.Filters.FixUrlsInCssFilter, Combres" acceptedResourceSets="LogCreateCss"  />
    <filter type="Combres.Filters.DotLessCssFilter, Combres"  acceptedResourceSets="LogCreateCss"  />
  </filters>
  <cssMinifiers>
    <minifier name="yui" type="Combres.Minifiers.YuiCssMinifier, Combres">
      <param name="CssCompressionType" type="string" value="StockYuiCompressor" />
      <param name="ColumnWidth" type="int" value="-1" />
    </minifier>
  </cssMinifiers>
  <jsMinifiers>
    <minifier name="msajax" type="Combres.Minifiers.MSAjaxJSMinifier, Combres" binderType="Combres.Binders.SimpleObjectBinder, Combres">
      <param name="CollapseToLiteral" type="bool" value="true" />
      <param name="EvalsAreSafe" type="bool" value="true" />
      <param name="MacSafariQuirks" type="bool" value="true" />
      <param name="CatchAsLocal" type="bool" value="true" />
      <param name="LocalRenaming" type="string" value="CrunchAll" />
      <param name="OutputMode" type="string" value="SingleLine" />
      <param name="RemoveUnneededCode" type="bool" value="true" />
      <param name="StripDebugStatements" type="bool" value="true" />
    </minifier>
    <minifier name="yui" type="Combres.Minifiers.YuiJSMinifier, Combres">
      <param name="IsVerboseLogging" type="bool" value="false" />
      <param name="IsObfuscateJavascript" type="bool" value="true" />
      <param name="PreserveAllSemicolons" type="bool" value="false" />
      <param name="DisableOptimizations" type="bool" value="true" />
      <param name="LineBreakPosition" type="int" value="-1" />
    </minifier>
  </jsMinifiers>
  <resourceSets url="~/combres.axd" defaultDuration="30"
                                defaultVersion="auto"
                                defaultDebugEnabled="false"
                                defaultJSMinifierRef="msajax"
                                defaultCssMinifierRef="yui">
    <resourceSet name="siteCss" type="css" minifierRef="yui">
      <resource path="\Content\StyleSheets\reset.css" />
      <resource path="\Content\StyleSheets\960.css" />
      <resource path="\Content\StyleSheets\Site960.css" />
      <resource path="\Content\StyleSheets\Site.css" />
    </resourceSet>
    <resourceSet name="siteJs" type="js" minifierRef="msajax">
      <resource path="\Scripts\jquery-1.5.1.min.js" />
      <resource path="\Content\Scripts\blockUI.js"  />
    </resourceSet>
    <resourceSet name="overviewCss" type="css" minifierRef="yui">
      <resource path="\Content\Plugins\fancybox\css\jquery.fancybox-1.3.4.css" />
      <resource path="\Content\StyleSheets\overview_kam.css" />
    </resourceSet>
    <resourceSet name="overviewJs" type="js" minifierRef="msajax">
      <resource path="\Content\Plugins\fancybox\scripts\jquery.fancybox-1.3.4.pack.js" />
    </resourceSet>
    <resourceSet name="LogCreateCss" type="css" minifierRef="yui">
      <resource path="\Content\Plugins\fancybox\css\jquery.fancybox-1.3.4.css" />
    </resourceSet>
    <resourceSet name="activityLogCloseCreateJs" type="js" minifierRef="msajax">
      <resource path="\Content\Plugins\fancybox\scripts\jquery.fancybox-1.3.4.pack.js" />
      <resource path="\Content\Plugins\fancybox\scripts\jquery.fancybox-1.3.4.js" />
    </resourceSet>
    <resourceSet name="LogCreateCss" type="css" minifierRef="yui">
      <resource path="\Content\StyleSheets\Site.css" />
      <resource path="\Content\Plugins\jquerySpinner\themes\base\jquery.ui.all.css" />
      <resource path="\Content\Plugins\jquerySpinner\themes\base\jquery-ui.css" />
      <resource path="\Content\Plugins\jquerySpinner\themes\base\jquery.ui.accordion.css" />
      <resource path="\Content\Plugins\jquerySpinner\themes\base\jquery.ui.autocomplete.css" />
      <resource path="\Content\Plugins\jquerySpinner\themes\base\jquery.ui.button.css" />
      <resource path="\Content\Plugins\jquerySpinner\themes\base\jquery.ui.core.css" />
      <resource path="\Content\Plugins\jquerySpinner\themes\base\jquery.ui.datepicker.css" />
      <resource path="\Content\Plugins\jquerySpinner\themes\base\jquery.ui.dialog.css" />
      <resource path="\Content\Plugins\jquerySpinner\themes\base\jquery.ui.menu.css" />
      <resource path="\Content\Plugins\jquerySpinner\themes\base\jquery.ui.progressbar.css" />
      <resource path="\Content\Plugins\jquerySpinner\themes\base\jquery.ui.resizable.css" />
      <resource path="\Content\Plugins\jquerySpinner\themes\base\jquery.ui.selectable.css" />
      <resource path="\Content\Plugins\jquerySpinner\themes\base\jquery.ui.slider.css" />
      <resource path="\Content\Plugins\jquerySpinner\themes\base\jquery.ui.spinner.css" />
      <resource path="\Content\Plugins\jquerySpinner\themes\base\jquery.ui.tabs.css" />
      <resource path="\Content\Plugins\jquerySpinner\themes\base\jquery.ui.theme.css" />
      <resource path="\Content\Plugins\jquerySpinner\themes\base\jquery.ui.tooltip.css" />
      <resource path="\Content\Plugins\jquerySpinner\demos\demos.css" />
    </resourceSet>
    <resourceSet name="LogCreateJs" type="js" minifierRef="msajax"  >
      <resource path="\Content\Plugins\jquerySpinner\jquery-1.4.3.js" />
      <resource path="\Content\Scripts\ActivityLog\Create.js" />
      <resource path="\Content\Plugins\fancybox\scripts\jquery.fancybox-1.3.4.pack.js" />
      <resource path="\Content\Plugins\jquerySpinner\external\jquery.mousewheel-3.0.4.js" />
      <resource path="\Content\Plugins\jquerySpinner\external\glob.js" />
      <resource path="\Content\Plugins\jquerySpinner\external\glob.de-DE.js" />
      <resource path="\Content\Plugins\jquerySpinner\external\glob.ja-JP.js" />
      <resource path="\Content\Plugins\jquerySpinner\ui\jquery.ui.core.js" />
      <resource path="\Content\Plugins\jquerySpinner\ui\jquery.ui.widget.js" />
      <resource path="\Content\Plugins\jquerySpinner\ui\jquery.ui.button.js" />
      <resource path="\Content\Plugins\jquerySpinner\ui\jquery.ui.spinner.js" />

    </resourceSet>
  </resourceSets>
</combres>
Community
  • 1
  • 1
Vishal
  • 12,133
  • 17
  • 82
  • 128

1 Answers1

2

I think the image portion of your css is malformed; try this instead:

url('images/ui-bg_flat_75_ffffff_40x100.png') /*{bgImgUrlContent}*/

Note the addition of single quotes and the space between the closing ")" and the comment block

From experience, I can recommend using the application root relative syntax to keep things cleaner, for example, I would change what you have to:

url('~/images/ui-bg_flat_75_ffffff_40x100.png') /*{bgImgUrlContent}*/

Update:

Another option would be to write your own ISingleContentFilter implementation that was more tolerant of the sort of syntax that appears in your css files. You can have a look at the combres FixUrlsInCssFilter one for a good starting point.

Update:

If you've created your own improved version of the filter, simply compile it as part of your web project and reference it in combres.xml as such:

<filters>
      <filter type="YourProject.MyBetterFilter, YourProject" />
</filters>

There is no need to completely recompile (and mantain) a custom version of Combres to extend it this way.

DanP
  • 6,310
  • 4
  • 40
  • 68
  • Yea..well we are using plugins and other add ons so if this is the solution it means that I would need to change urls all over the place. Also `~` is a asp.net specific thing so I am not sure if we don't use combres in the future for some reason I am not sure it will work. I do appreciate your help and let's see if there are any other ways to go about this. – Vishal Oct 25 '11 at 18:48
  • You could always write your own ISingleContentFilter implementation that is more tolerant of such syntax, I've done that before to handle a few special cases. – DanP Oct 25 '11 at 18:50
  • Hmm..is there an example..or could you tell me the steps to go about doing that ? Thanks! – Vishal Oct 25 '11 at 18:54
  • So, I downloaded source code and modified it , but I guess I can't really use the merged the combres.dll directly in my project since I have installed combres using NuGet and it currently uses different dlls and not one. Is there any way that I can just have the combres.dll replaced with the new changed source code dll. If not do I just remove all the previous references and then need to reference the merged combres.dll to get everything to work ? – Vishal Oct 26 '11 at 17:45
  • Just compile the new filter in your web project and reference it accordingly in your combres.xml file, there's no reason to use a custom version of combres itself just for this. – DanP Oct 26 '11 at 18:40
  • So, I tried to follow your advice and added just the filer to my project and then added required files by it and referenced combres.dll to get just the filer to work..I am getting currently ' Could not load type 'Combres.Loggers.Log4NetLogger'' although I think I have configured it right..have you done something similar to this before if there is any advice you can give me on getting just the filter to work with my project.. – Vishal Oct 27 '11 at 15:41
  • Perhaps take the logging out of your filter so you're not referencing that? I never used the combres loggers in any of my custom filter implementations. – DanP Oct 27 '11 at 16:16