亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? javascripttaglib.groovy

?? grails用戶使用指南
?? GROOVY
字號:
/* Copyright 2004-2005 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * *      http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT c;pWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */import org.springframework.validation.Errors;import org.springframework.context.NoSuchMessageException;import org.springframework.web.servlet.support.RequestContextUtils as RCU;import org.codehaus.groovy.grails.commons.GrailsClassUtils as GCU; /** *  A  tag lib that provides tags for developing javascript and ajax applications * * @author Graeme Rocher * @since 17-Jan-2006 */class JavascriptTagLib  {	/**	 * Mappings to the relevant files to be included for each library	 */	static final INCLUDED_LIBRARIES = "org.codehaus.grails.INCLUDED_JS_LIBRARIES"	static final INCLUDED_JS = "org.codehaus.grails.INCLUDED_JS"		static final LIBRARY_MAPPINGS = [										prototype : ['prototype/prototype'],										yahoo : [ 'yahoo/yahoo-min','yahoo/connection-min', 'yahoo/dom-min','yahoo/event-min','yahoo/animation-min'],										dojo : [ 'dojo/dojo']									]											static {		LIBRARY_MAPPINGS.scriptaculous = LIBRARY_MAPPINGS.prototype + ['prototype/scriptaculous','prototype/builder','prototype/controls','prototype/effects','prototype/slider','prototype/dragdrop']				LIBRARY_MAPPINGS.rico = LIBRARY_MAPPINGS.prototype + ['prototype/rico']					}										/**	 * Includes a javascript src file, library or inline script	 * if the tag has no 'src' or 'library' attributes its assumed to be an inline script:	 *	 * <g:javascript>alert('hello')</g:javascript>	 *	 * The 'library' attribute will attempt to use the library mappings defined above to import the 	 * right js files and not duplicate imports eg.	 *	 * <g:javascript library="scripaculous" /> // imports all the necessary js for the scriptaculous library	 *	 * The 'src' attribute will merely import the js file but within the right context (ie inside the /js/ directory of 	 * the Grails application:	 *	 * <g:javascript src="myscript.js" /> // actually imports '/app/js/myscript.js'	 **/	def javascript = { attrs, body ->		if(!request[INCLUDED_JS]) request[INCLUDED_JS] = []		if(!request[INCLUDED_LIBRARIES]) request[INCLUDED_LIBRARIES] = []				if(attrs.src) {			out << '<script type="text/javascript" src="'			out << grailsAttributes.getApplicationUri(request)			out << "/js/${attrs.src}"			out.println '"></script>'				}		else if(attrs.library) {			if(LIBRARY_MAPPINGS.containsKey(attrs.library)) {				if(!request[INCLUDED_LIBRARIES].contains(attrs.library)) {					LIBRARY_MAPPINGS[attrs.library].each {						if(!request[INCLUDED_JS].contains(it)) {								request[INCLUDED_JS] << it								out << '<script type="text/javascript" src="'								out << grailsAttributes.getApplicationUri(request)								out << "/js/${it}.js"															out.println '"></script>'						}										}					request[INCLUDED_LIBRARIES] << attrs.library									}							}			else {				if(!request[INCLUDED_LIBRARIES].contains(attrs.library)) {					out << '<script type="text/javascript" src="'					out << grailsAttributes.getApplicationUri(request)					out << "/js/${attrs.library}.js"											out.println '"></script>'					request[INCLUDED_LIBRARIES] << attrs.library					request[INCLUDED_JS] << attrs.library									}			}		}		else {			out.println '<script type="text/javascript">'				body()			out.println '</script>'		}	}    /**     *  Creates a remote function call using the prototype library     */    def remoteFunction = { attrs  ->    		// before remote function		def after = ''		if(attrs["before"])			out << "${attrs.remove('before')};"		if(attrs["after"])			after = "${attrs.remove('after')};"		def p = getProvider()		p.doRemoteFunction(owner,attrs,out)		attrs.remove('update')		// after remote function		if(after)		   out <<  after			           		       }                                          /**     * Normal map implementation does a shallow clone. This implements a deep clone for maps     * using recursion     */    private deepClone(Map map) {	    def cloned = [:]	    map?.each { k,v ->		    if(v instanceof Map) {			   cloned[k] = deepClone(v)   	        }            else {		     cloned[k] = v  		    		    }		}                		return cloned    }    /**     * A link to a remote uri that used the prototype library to invoke the link via ajax     */    def remoteLink = { attrs, body ->       out << "<a href=\""           def cloned = deepClone(attrs)	   createLink(cloned)               	   out << "\" onclick=\""        // create remote function        remoteFunction(attrs)   		attrs.remove('url')        out << "return false;\" "        // process remaining attributes        attrs.each { k,v ->            out << k << "=\"" << v << "\" "        }        out << ">"        // output the body        body()        // close tag        out << "</a>"    }	/**	 * A field that sends its value to a remote link	 */	def remoteField = { attrs, body ->		def paramName = attrs.paramName ? attrs.remove('paramName') : 'value'		def value = attrs.remove('value') 		if(!value) value = ''				out << "<input type='text' name='${attrs.remove('name')}' value='${value}' onkeyup=\""		if(attrs.params) {			if(attrs instanceof Map) {				attrs.params.put(paramName, 'this.value')			}			else {				attrs.params += "'${paramName}='+this.value"				}		}		else {    		attrs.params = "'${paramName}='+this.value"					}		remoteFunction(attrs)		attrs.remove('params')		out << "\""   		attrs.remove('url')		attrs.each { k,v->			out << " $k=\"$v\""		}		out <<" />"	}    /**     * A form which used prototype to serialize its parameters and submit via an asynchronous ajax call     */    def formRemote = { attrs, body ->        if(!attrs.name) {            throwTagError("Tag [formRemote] is missing required attribute [name]")        }                if(!attrs.url) {            throwTagError("Tag [formRemote] is missing required attribute [url]")        }                        // get javascript provider 		def p = getProvider()						def url = deepClone(attrs.url) 				// prepare form settings		prepareAjaxForm(p,attrs)                def params = [  onsubmit:TagLibUtil.outToString(remoteFunction,attrs) + 'return false',					    method: (attrs.method? attrs.method : 'POST' ),					    action: (attrs.action? attrs.action : TagLibUtil.outToString(createLink,url))		                 		             ]		attrs.remove('url')		             	    params.putAll(attrs)	    withTag(name:'form',attrs:params) {			body()   	    }		    }    /**     *  Creates a form submit button that submits the current form to a remote ajax call     */    def submitToRemote = { attrs, body ->    	// get javascript provider		def p = getProvider()    		// prepare form settings 		attrs.forSubmitTag = ".form"		prepareAjaxForm(p,attrs)            def params = [  onclick:TagLibUtil.outToString(remoteFunction,attrs) + 'return false',					    type: 'button',					    name: attrs.remove('name'),					    value: attrs.remove('value'), 					    id: attrs.remove('id'),					    'class':attrs.remove('class')		             ]		             		withTag(name:'input', attrs:params) {			body()			}    }		 private prepareAjaxForm(provider,attrs) {		if(provider instanceof PrototypeProvider) {			if(!attrs.forSubmitTag) attrs.forSubmitTag = ""		    attrs.params = "Form.serialize(this${attrs.remove('forSubmitTag')})"		}		else if(provider instanceof YahooProvider) {			if(attrs.before) {				attrs.before += ";YAHOO.util.Connect.setForm('${attrs.name}')"			}			else {				attrs.before = "YAHOO.util.Connect.setForm('${attrs.name}')"			}		}		else if(provider instanceof DojoProvider) {			if(attrs.params) attrs.params.formNode = "dojo.byId('${attrs.name}')"			else {				attrs.params = [formNode:"dojo.byId('${attrs.name}')"]			}		}	 }	/**	 * Escapes a javasacript string replacing single/double quotes and new lines	 *	 * <g:escapeJavascript>This is some "text" to be escaped</g:escapeJavascript>	 */	def escapeJavascript = { attrs,body ->		def js = ''		if(body instanceof Closure) {			def tmp = out			def sw = new StringWriter()			out = new PrintWriter(out)			// invoke body			body()			// restore out			out = tmp			js = sw.toString()					}		else if(body instanceof String) {			js = body		}		else if(attrs instanceof String) {			js = attrs			}		out << 	js.replaceAll(/\r\n|\n|\r/, '\\\\n')					.replaceAll('"','\\\\"')					  .replaceAll("'","\\\\'")	}	/**	 * Returns the provider of the necessary function calls to perform Javascript functions	 *	 **/	private JavascriptProvider getProvider() {							if(request[JavascriptTagLib.INCLUDED_LIBRARIES]?.contains('yahoo')) {			return new YahooProvider()		}		else if(request[JavascriptTagLib.INCLUDED_LIBRARIES]?.contains('dojo')) {			return new DojoProvider()		}				else {			return new PrototypeProvider()		}	}}/** * Interface defining methods that a JavaScript provider should implement * * @author Graeme Rocher **/interface JavascriptProvider {	/**	 * Creates a remote function call	 *	 * @param The attributes to use	 * @param The output to write to	 */	def doRemoteFunction(taglib,attrs, out)}/** * Prototype implementation of JavaScript provider * * @author Graeme Rocher */class PrototypeProvider implements JavascriptProvider {	def doRemoteFunction(taglib,attrs, out) {		out << 'new Ajax.'		if(attrs.update) {			out << 'Updater('			if(attrs.update instanceof Map) {				out << "{"				def update = []				if(attrs.update?.success) {					update << "success:'${attrs['update']['success']}'"				}				if(attrs.update?.failure) {					update << "failure:'${attrs['update']['failure']}'"				}				out << update.join(',')				out << "},"			}			else {				out << "'" << attrs.update << "',"			}			attrs.remove("update")		}		else {			out << "Request("		}		out << "'"										def pms = attrs.remove('params')   		if(attrs.url) {			taglib.createLink(attrs.url)					}                              		else {			taglib.createLink(attrs)					}				out << "',"		if(pms)		    attrs.params = pms		// process options		out << getAjaxOptions(attrs)		// close		out << ');'			}	    // helper function to build ajax options    def getAjaxOptions(options) {        def ajaxOptions = []       // necessary defaults       if(options.options?.asynchronous)           ajaxOptions << "asynchronous:${options.options.remove('asynchronous')}"       else           ajaxOptions << "asynchronous:true"                  if(options.options?.evalScripts)           ajaxOptions << "evalScripts:${options.options?.remove('evalScripts')}"       else           ajaxOptions << "evalScripts:true"                    if(options) {            // process callbacks            def callbacks = options.findAll { k,v ->                k ==~ /on(\p{Upper}|\d){1}\w+/            }            callbacks.each { k,v ->                ajaxOptions << "${k}:function(e){${v}}"                options.remove(k)            }            if(options.params) {                ajaxOptions << "parameters:${options.remove('params')}"            }            // remaining options            options.options?.each { k, v ->            	if(k!='url') {	                 switch(v) {	                    case 'true': ajaxOptions << "${k}:${v}"; break;	                    case 'false': ajaxOptions << "${k}:${v}"; break;	                    case ~/\s*function(\w*)\s*/: ajaxOptions << "${k}:${v}"; break;	                    default:ajaxOptions << "${k}:'${v}'"; break;	                 }            	            	}            }        }        return "{${ajaxOptions.join(',')}}"    }	}/** * A implementation for the Yahoo library * * @author Graeme Rocher **/class YahooProvider implements JavascriptProvider {	def doRemoteFunction(taglib,attrs, out)	{		def method = (attrs.method ? attrs.method : 'GET' )		if(attrs.onLoading) {			out << "${attrs.onLoading};"		}		out << "YAHOO.util.Connect.asyncRequest('${method}','"						if(attrs.url) {			taglib.createLink(attrs.url)		}		else {			taglib.createLink(attrs)		}						out << "',"		buildYahooCallback(attrs,out)		out << ',null);'	}			// helper method to create yahoo callback object	def buildYahooCallback(attrs,out) {		out << '{ '			if(attrs.update) {			  out <<'success: function(o) { '			    if(attrs.onLoaded) {					out << "${attrs.onLoaded}";				}				if(attrs.update instanceof Map) {					if(attrs.update.success) {						out << "YAHOO.util.Dom.get('${attrs.update.success}').innerHTML = o.responseText;"														}												}				else {					out <<  "YAHOO.util.Dom.get('${attrs.update}').innerHTML = o.responseText;"				}				if(attrs.onSuccess) {					out << ";${attrs.onSuccess};"				}					if(attrs.onComplete) {					out << ";${attrs.onComplete};"				}		  				out << ' }'				out << 	', failure: function(o) {'													if(attrs.update instanceof Map) {					if(attrs.update.failure) {						out << "YAHOO.util.Dom.get('${attrs.update.failure}').innerHTML = o.statusText;"																									}				}				if(attrs.onFailure) {					out << "${attrs.onFailure};"				}					if(attrs.onComplete) {					out << ";${attrs.onComplete};"				}																	out << '}'							}						out << '}'			}	}/** * An implementation for the Dojo javascript library * * @author Graeme Rocher */class DojoProvider implements JavascriptProvider {	 def doRemoteFunction(taglib,attrs, out) {		if(attrs.onLoading) {			out << "${attrs.onLoading};"		}				 out << 'dojo.io.bind({url:\''		 taglib.createLink(attrs) 		attrs.remove('params')		 out << '\',load:function(type,data,evt) {'	    if(attrs.onLoaded) {			out << "${attrs.onLoaded}";		}				 if(attrs.update) {						out << 'dojo.html.textContent( dojo.byId(\''			out << (attrs.update instanceof Map ? attrs.update.success : attrs.update)			out << '\'),data);'				 }		if(attrs.onSuccess) {			out << ";${attrs.onSuccess};"		}		if(attrs.onComplete) {			out << ";${attrs.onComplete};"		}				out << '}'		out << ',error:function(type,error) { '		if(attrs.update instanceof Map) {			if(attrs.update.failure) {				out << "dojo.html.textContent( dojo.byId('${attrs.update.failure}'),error.message);"												}		}		if(attrs.onFailure) {			out << ";${attrs.onFailure};"		}			if(attrs.onComplete) {			out << ";${attrs.onComplete};"		}					     out << '}'	     attrs.params?.each {k,v ->	     	out << ",$k:$v"	     }		 out << '});'	 }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精彩视频一区二区三区| 经典三级一区二区| xnxx国产精品| 91丨九色丨尤物| 国产一区不卡视频| 亚洲午夜精品在线| 国产精品久久久久久久久免费樱桃| 欧美日韩在线免费视频| 国产成人在线色| 日韩激情一二三区| 亚洲免费三区一区二区| 久久影院午夜片一区| 88在线观看91蜜桃国自产| 99久久精品一区二区| 国产精品一区二区在线看| 首页综合国产亚洲丝袜| 亚洲精品国产无天堂网2021| 亚洲国产电影在线观看| 国产suv一区二区三区88区| 不卡一区中文字幕| 久久av老司机精品网站导航| 亚洲高清不卡在线观看| ●精品国产综合乱码久久久久| 欧美成人vr18sexvr| 在线观看免费成人| 色综合久久88色综合天天免费| 成人性色生活片| 国产精品一卡二| 国精产品一区一区三区mba桃花| 日韩精品欧美精品| 亚洲国产日韩在线一区模特| 一区二区理论电影在线观看| 国产精品护士白丝一区av| 欧美韩国日本不卡| 久久嫩草精品久久久精品| 日韩精品一区二区三区中文精品 | 日韩国产在线观看| 亚洲成人av中文| 亚洲1区2区3区视频| 婷婷综合五月天| 调教+趴+乳夹+国产+精品| 午夜影院久久久| 日韩激情av在线| 久久精品国产一区二区三| 久久国产精品免费| 精品一区二区三区久久| 国产伦精品一区二区三区免费迷| 经典一区二区三区| 国产传媒久久文化传媒| 福利一区福利二区| 不卡欧美aaaaa| 色综合久久久久久久久| 欧美天天综合网| 91精品国产欧美日韩| 日韩欧美一区二区三区在线| 欧美sm美女调教| 久久精品亚洲国产奇米99| 国产精品二区一区二区aⅴ污介绍| 国产精品色哟哟网站| 亚洲精品久久久蜜桃| 亚洲va欧美va天堂v国产综合| 日本不卡一二三| 国产乱码字幕精品高清av| 成人午夜视频在线观看| 在线亚洲+欧美+日本专区| 欧美性xxxxx极品少妇| 欧美一区二区美女| 久久久久九九视频| 中文字幕永久在线不卡| 午夜精品福利一区二区三区蜜桃| 日本不卡一区二区三区| 国产精品白丝av| 一本到不卡免费一区二区| 欧美精品高清视频| 久久精品人人做人人爽人人| 亚洲精品国产无套在线观| 蜜臀91精品一区二区三区| 成人一区二区三区中文字幕| 欧美综合一区二区| 日韩天堂在线观看| 中文字幕一区在线观看视频| 爽爽淫人综合网网站| 成人精品电影在线观看| 欧美专区日韩专区| 亚洲精品在线观| 悠悠色在线精品| 久久精品99国产精品| 日本韩国一区二区三区| 日韩一区二区在线观看视频 | 日本美女一区二区| 99在线精品免费| 日韩欧美国产高清| 一区二区三区四区亚洲| 久久99精品国产.久久久久久| 91免费在线视频观看| 日韩欧美成人一区| 亚洲另类在线视频| 国产福利一区二区三区| 欧美精品久久天天躁| 成人欧美一区二区三区小说| 秋霞午夜av一区二区三区| 99久久综合色| 精品福利一二区| 首页欧美精品中文字幕| 91美女片黄在线观看91美女| 日韩免费观看2025年上映的电影| 亚洲免费观看高清完整版在线观看 | 中文字幕字幕中文在线中不卡视频| 日本视频中文字幕一区二区三区| 97成人超碰视| 久久久九九九九| 日本成人在线网站| 在线观看视频一区二区| 最新不卡av在线| 国产成人丝袜美腿| 日韩精品中文字幕一区| 三级成人在线视频| 在线免费观看日韩欧美| 亚洲天堂av老司机| 国产**成人网毛片九色| 2017欧美狠狠色| 捆绑紧缚一区二区三区视频| 欧美日韩一二三区| 一区二区三区四区蜜桃| 99国产精品一区| 国产精品国产精品国产专区不片 | 久久er99热精品一区二区| 91精品国产综合久久久久久久久久 | 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 国产乱码精品一区二区三区忘忧草 | 国产精品色在线| 本田岬高潮一区二区三区| 欧美国产精品v| 成人一级片网址| 国产精品区一区二区三区| 粉嫩欧美一区二区三区高清影视| 国产日韩欧美精品一区| 成人一级片网址| 中文字幕精品一区二区三区精品 | 亚洲视频一区二区免费在线观看| 一区二区三区国产精华| 色欧美片视频在线观看| 亚洲天堂免费看| 欧美主播一区二区三区| 亚洲成在人线在线播放| 4438x亚洲最大成人网| 亚洲国产中文字幕在线视频综合| 色天天综合久久久久综合片| 亚洲欧洲综合另类| 欧美日韩综合不卡| 午夜婷婷国产麻豆精品| 欧美日韩一区二区在线观看| 亚洲免费看黄网站| 538prom精品视频线放| 日本aⅴ免费视频一区二区三区| 91麻豆精品国产综合久久久久久| 亚洲第一av色| 欧美伊人精品成人久久综合97| 亚洲成精国产精品女| 欧美精品久久一区| 青青草97国产精品免费观看无弹窗版 | 在线观看www91| 亚洲成a人v欧美综合天堂下载| 91久久精品网| 久久国产精品第一页| 2023国产精华国产精品| 国产成人精品在线看| 国产精品福利影院| 欧美浪妇xxxx高跟鞋交| 日韩**一区毛片| 久久久午夜精品理论片中文字幕| 国产九色精品成人porny | 亚洲成人自拍一区| 日韩欧美自拍偷拍| 成人aa视频在线观看| 亚洲国产中文字幕| 久久这里只有精品6| 91亚洲精品一区二区乱码| 亚洲观看高清完整版在线观看| 欧美α欧美αv大片| 成人禁用看黄a在线| 日本不卡视频一二三区| 国产亚洲1区2区3区| 91成人免费在线| 奇米一区二区三区| 亚洲久草在线视频| 日韩一卡二卡三卡国产欧美| 成人黄动漫网站免费app| 蜜臀av性久久久久蜜臀aⅴ四虎 | 国产精品国产三级国产普通话99 | 三级欧美在线一区| 中文字幕在线一区| 欧美日本高清视频在线观看| 精品亚洲porn| 亚洲三级电影全部在线观看高清| 欧美成人官网二区| 91国偷自产一区二区使用方法| 麻豆专区一区二区三区四区五区| 国产欧美一区二区三区在线看蜜臀 | 丰满少妇在线播放bd日韩电影|