During the project, in order to make a unified management for the image URL , at present we make use of the LESSCSS method, set the image URL as independent variable, then all images use the image URL variable, it’s convenient for future maintenance. To make sure the LESS CSS work normal, we need to make some configuration for web.config , please refer to the http://www.dotlesscss.org/, the steps as follows:

Configure web.config

1.   Download the latest dotless package

You can find the latest source & downloads for dotless at GitHub, extract file ,then you can get file named “dotless.Core.dll”

2.   Include our reference to your web project

Add the dotless.Core.dll file to our references file

3.   Add a new HttpHandler to your Web.Config

Let’s make the dotless processor handle our .LESS files.Add this entry to the HttpHandlers section of your Web.Config:

<add name="LessCssHttpHandler" verb="*" path="*.LESS" preCondition="integratedMode" type="dotless.Core.LessCssHttpHandler,dotless.Core"/>

4.   Add a few configuration sections (optional)

First add our config handler in the "configSections" node of your web.config

<section name="dotless" type="dotless.Core.configuration.DotlessConfigurationSectionHandler,dotless.Core" />

Now you can configure caching and minifying of the Css output

<dotless minifyCss="true" cache="true" />

Note: when we work on the project , we need to use  <dotless minifyCss="false" cache="false" /> on our web.config, because when we make some change for any file, we need to see the change at once without cache. of course, when project finish and release , we need to use <dotless minifyCss="true" cache="true" />

5.   Get started

Reference your LESS files the same way as you would any other CSS file, just ensure that you use the .LESS extention.

Modify the image URL for project

 

  1. Take our project file as example, Find the image url less file named

truck\WebCenter\CommonModule\UI\CSS\imgurlConfig.less, you will see the image url variables on the top of page

@base-url-secure: "https://secure.officescape.com/shared/images";
@base-url-web: "/WebCenter/CommonModule/UI/images/";

You only need to modify the image url value of variables named @base-url-secure and @base-url-web when you want to change all images url address on project.

Config The Image URL Solution的更多相关文章

  1. 修改Git远程地址 git config remote.origin.url "https://..."

    仓库管理: 添加或指定远程仓库地址 git remote set-url origin "https://..." git config remote.origin.url &qu ...

  2. Spring MVC 的 Java Config ( 非 XML ) 配置方式

    索引: 开源Spring解决方案--lm.solution 参看代码 GitHub: solution/pom.xml web/pom.xml web.xml WebInitializer.java ...

  3. ASP.NET 自定义URL重写 分类: ASP.NET 2014-10-31 16:05 175人阅读 评论(0) 收藏

    一.功能说明: 可以解决类似 http://****/news 情形,Url路径支持正则匹配. 二.操作步骤: 1.增加URL重写模块: using System; using System.IO; ...

  4. ASP.NET 自定义URL重写 分类: ASP.NET 2014-10-31 16:05 174人阅读 评论(0) 收藏

    一.功能说明: 可以解决类似 http://****/news 情形,Url路径支持正则匹配. 二.操作步骤: 1.增加URL重写模块: using System; using System.IO; ...

  5. thinkphp隐藏中url的index.php

    在本地进行测试 1.修改apache配置文件将如下代码#去掉 #LoadModule rewrite_module modules/mod_rewrite.so   在index.php 目录下新建文 ...

  6. git config(转载)

    From:http://www.g2w.me/2013/10/cache-github-credential-for-https-repository/ http://openwares.net/li ...

  7. URL重写案例

    实现url重写的基本方法:  将下载的URLRewriter.dll,放到你的web程序的bin下 然后在web.config里配置如下: <?xml version="1.0&quo ...

  8. 对 Sea.js 进行配置(一) seajs.config

    可以对 Sea.js 进行配置,让模块编写.开发调试更方便. seajs.config seajs.config(options) 用来进行配置的方法. seajs.config({ // 别名配置 ...

  9. 使用自定义 URL 实现控制器之间的跳转-b

    一个app往往有很多界面,而界面之间的跳转也就是对应控制器的跳转,控制器的跳转一般有两种情况 push 或者 modal,push 和 modal 的默认效果是系统提供的 文章配图 1. 概述 系统提 ...

随机推荐

  1. 微软职位内部推荐-SW Engineer II for Skype

    微软近期Open的职位: We are the Skype Beijing team. Skype division drives the communications strategy for Mi ...

  2. Discuz 取各排行榜数据

    取论坛指定版块帖子或回复(first=1 就是帖子的1楼, 如果=0 就是调用回复,fid=62 是论坛版块号): SELECT * FROM discuzx.pre_forum_post where ...

  3. ZooKeeper学习第六期---ZooKeeper机制架构

    一.ZooKeeper权限管理机制 1.1 权限管理ACL(Access Control List) ZooKeeper 的权限管理亦即ACL 控制功能,使用ACL来对Znode进行访问控制.ACL的 ...

  4. Java6 String.substring()方法的内存泄露

    substring(start,end)在Java编程里面经常使用,没想到如果使用不当,会出现内存泄露. 要了解substring(),最好的方法便是查看源码(jdk6): /** * <blo ...

  5. Chrome调试工具简单介绍

    作为前端开发者都知道,快捷键F12可以打开chrome调试工具.firefox可以打开firebug工具.“工欲善其事,必先利其器”,对调试工具的掌握,能大大提高我们调试代码的效率.因为我平常chro ...

  6. Java环境解析apk文件信息

    概述:Java解析apk文件,获取apk文件里的包名,版本号,图标文件等; 功能:可以提供给windows和linux平台使用; 原理:利用aapt.exe或者aapt这些anroid平台解析apk文 ...

  7. MPMoviePlayerViewController的使用 (不直接将播放器放到主视图控制器,而是放到一个内部模态视图控制器中)

    其实MPMoviePlayerController如果不作为嵌入视频来播放(例如在新闻中嵌入一个视频),通常在播放时都是占满一个屏幕的,特别是在 iPhone.iTouch上.因此从iOS3.2以后苹 ...

  8. Ajax基础之封装3

    今天接着我们上篇博文的栗子,现在我来扩大一下需求,之前是点击按钮取出新闻,现在要实现每隔一段事件进行新闻的更新.这个时候,肯定是加一个定时器,然后每隔一段事件,再进行一次Ajax请求,既然要经常用到A ...

  9. “耐撕”团队2016.03.28 站立会议

    1. 时间:20:30--20:50 2. 成员: Z 郑蕊 * 组长 (博客:http://www.cnblogs.com/zhengrui0452/), P 濮成林(博客:http://www.c ...

  10. 关于opacity透明度子元素继承现象的若干研究以及hack方法

    [感想]信息时代的信息是有时效性的,今天是确确实实感受到了.互联网资料虽然丰富,但是质量不一,还有大量的跟风雷同,很多人都是随手拷贝过来,根本没有实践.以前端为例,这两年浏览器的迅猛发展,造成很多原有 ...