Fix a bug in the getCookie function

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8526 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
taggon 2011-06-21 12:53:10 +00:00
parent 4c9ce4db07
commit b215fb8e85
3 changed files with 6 additions and 6 deletions

View file

@ -903,7 +903,7 @@ function setCookie(name, value, expire, path) {
}
function getCookie(name) {
var match = document.cookie.match(new RegExp(name+'=(.*?);'));
var match = document.cookie.match(new RegExp(name+'=(.*?)(?:;|$)'));
if(match) return unescape(match[1]);
}
@ -979,7 +979,7 @@ jQuery(function($){
if(!name) name = '_xe_popup_'+Math.floor(Math.random()*1000);
win = window.open(href, name, 'left=10,top=10,width=10,hegiht=10,resizable=no,scrollbars=no,toolbars=no');
win = window.open(href, name, 'left=10,top=10,width=10,height=10,resizable=no,scrollbars=no,toolbars=no');
if(win) win.focus();
// cancel default action

View file

@ -1187,7 +1187,7 @@ function setCookie(name, value, expire, path) {
}
function getCookie(name) {
var match = document.cookie.match(new RegExp(name+'=(.*?);'));
var match = document.cookie.match(new RegExp(name+'=(.*?)(?:;|$)'));
if(match) return unescape(match[1]);
}
@ -1263,7 +1263,7 @@ jQuery(function($){
if(!name) name = '_xe_popup_'+Math.floor(Math.random()*1000);
win = window.open(href, name, 'left=10,top=10,width=10,hegiht=10,resizable=no,scrollbars=no,toolbars=no');
win = window.open(href, name, 'left=10,top=10,width=10,height=10,resizable=no,scrollbars=no,toolbars=no');
if(win) win.focus();
// cancel default action

4
common/js/xe.min.js vendored
View file

@ -42,10 +42,10 @@ a.length;)d=this._keyStr.indexOf(a.charAt(j++)),c=this._keyStr.indexOf(a.charAt(
if(typeof resizeImageContents=="undefined")var resizeImageContents=function(){};if(typeof activateOptionDisabled=="undefined")var activateOptionDisabled=function(){};objectExtend=jQuery.extend;function toggleDisplay(a){jQuery("#"+a).toggle()}function checkboxSelectAll(a,b,d){var c={};if(typeof a!="undefined")c.wrap=a;if(typeof d!="undefined")c.checked=d;XE.checkboxToggleAll(b,c)}function clickCheckBoxAll(a,b){var d={doClick:!0};if(typeof a!="undefined")d.wrap=a;XE.checkboxToggleAll(b,d)}
function svc_folder_open(a){jQuery("#_folder_open_"+a).hide();jQuery("#_folder_close_"+a).show();jQuery("#_folder_"+a).show()}function svc_folder_close(a){jQuery("#_folder_open_"+a).show();jQuery("#_folder_close_"+a).hide();jQuery("#_folder_"+a).hide()}function open_calendar(a,b,d){typeof b=="undefined"&&(b="");var c="./common/tpl/calendar.php?";a&&(c+="fo_id="+a);b&&(c+="&day_str="+b);d&&(c+="&callback_func="+d);popopen(c,"Calendar")}var loaded_popup_menus=XE.loaded_popup_menus;
function createPopupMenu(){}function chkPopupMenu(){}function displayPopupMenu(a,b,d){XE.displayPopupMenu(a,b,d)}function GetObjLeft(a){return jQuery(a).offset().left}function GetObjTop(a){return jQuery(a).offset().top}function replaceOuterHTML(a,b){jQuery(a).replaceWith(b)}function getOuterHTML(a){return jQuery(a).html().trim()}function setCookie(a,b,d,c){a=a+"="+escape(b)+(!d?"":"; expires="+d.toGMTString())+"; path="+(!c?"/":c);document.cookie=a}
function getCookie(a){if(a=document.cookie.match(RegExp(a+"=(.*?);")))return unescape(a[1])}function is_def(a){return typeof a!="undefined"}function ucfirst(a){return a.charAt(0).toUpperCase()+a.slice(1)}function get_by_id(a){return document.getElementById(a)}
function getCookie(a){if(a=document.cookie.match(RegExp(a+"=(.*?)(?:;|$)")))return unescape(a[1])}function is_def(a){return typeof a!="undefined"}function ucfirst(a){return a.charAt(0).toUpperCase()+a.slice(1)}function get_by_id(a){return document.getElementById(a)}
jQuery(function(a){a(".lang_code").each(function(){var b=a(this),d=b.attr("id");typeof d=="undefined"&&(d=b.attr("name"));typeof d!="undefined"&&b.after("<a href='"+request_uri.setQuery("module","module").setQuery("act","dispModuleAdminLangcode").setQuery("target",d)+"' class='buttonSet buttonSetting' onclick='popopen(this.href);return false;'><span>find_langcode</span></a>")});a(document).click(function(b){var d=a("#popup_menu_area");d.length||(d=a('<div id="popup_menu_area" style="display:none;z-index:9999" />').appendTo(document.body));
d.hide();d=a(b.target).filter("a,div,span");d.length||(d=d.parents("a,div,span").eq(0));if(d.length){var d=d.attr("class"),c;d&&(c=d.match(/(?:^| )((document|comment|member)_([1-9]\d*))(?: |$)/));if(c){d="get"+ucfirst(c[2])+"Menu";b={mid:current_mid,cur_mid:current_mid,menu_id:c[1],target_srl:c[3],cur_act:current_url.getQuery("act"),page_x:b.pageX,page_y:b.pageY};c="error message menus".split(" ");if(is_def(window.xeVid))b.vid=xeVid;if(is_def(XE.loaded_popup_menus[b.menu_id]))return XE.displayPopupMenu(b,
c,b)&&!1;show_waiting_message=!1;exec_xml("member",d,b,XE.displayPopupMenu,c,b);show_waiting_message=!0;return!1}}});a("a._xe_popup").click(function(){var b=a(this),d=b.attr("name"),b=b.attr("href");d||(d="_xe_popup_"+Math.floor(Math.random()*1E3));(d=window.open(b,d,"left=10,top=10,width=10,hegiht=10,resizable=no,scrollbars=no,toolbars=no"))&&d.focus();return!1})});var show_waiting_message=!0;
c,b)&&!1;show_waiting_message=!1;exec_xml("member",d,b,XE.displayPopupMenu,c,b);show_waiting_message=!0;return!1}}});a("a._xe_popup").click(function(){var b=a(this),d=b.attr("name"),b=b.attr("href");d||(d="_xe_popup_"+Math.floor(Math.random()*1E3));(d=window.open(b,d,"left=10,top=10,width=10,height=10,resizable=no,scrollbars=no,toolbars=no"))&&d.focus();return!1})});var show_waiting_message=!0;
function xml2json(a,b,d){var c={toObj:function(a){var b={};if(a.nodeType==1){if(d&&a.attributes.length)for(var g=0;g<a.attributes.length;g++)b["@"+a.attributes[g].nodeName]=(a.attributes[g].nodeValue||"").toString();if(a.firstChild){for(var l=g=0,m=!1,h=a.firstChild;h;h=h.nextSibling)h.nodeType==1?m=!0:h.nodeType==3&&h.nodeValue.match(/[^ \f\n\r\t\v]/)?g++:h.nodeType==4&&l++;if(m)if(g<2&&l<2){c.removeWhite(a);for(h=a.firstChild;h;h=h.nextSibling)h.nodeType==3?b=c.escape(h.nodeValue):h.nodeType==4?
b=c.escape(h.nodeValue):b[h.nodeName]?b[h.nodeName]instanceof Array?b[h.nodeName][b[h.nodeName].length]=c.toObj(h):b[h.nodeName]=[b[h.nodeName],c.toObj(h)]:b[h.nodeName]=c.toObj(h)}else a.attributes.length?b["#text"]=c.escape(c.innerXml(a)):b=c.escape(c.innerXml(a));else if(g)a.attributes.length?b["#text"]=c.escape(c.innerXml(a)):b=c.escape(c.innerXml(a));else if(l)if(l>1)b=c.escape(c.innerXml(a));else for(h=a.firstChild;h;h=h.nextSibling)b=c.escape(h.nodeValue)}!a.attributes.length&&!a.firstChild&&
(b=null)}else a.nodeType==9?b=c.toObj(a.documentElement):alert("unhandled node type: "+a.nodeType);return b},toJson:function(a,b,d){var g=b?'"'+b+'"':"";if(a instanceof Array){for(var m=0,h=a.length;m<h;m++)a[m]=c.toJson(a[m],"",d+"\t");g+=(b?":[":"[")+(a.length>1?"\n"+d+"\t"+a.join(",\n"+d+"\t")+"\n"+d:a.join(""))+"]"}else if(a==null)g+=(b&&":")+"null";else if(typeof a=="object"){m=[];for(h in a)m[m.length]=c.toJson(a[h],h,d+"\t");g+=(b?":{":"{")+(m.length>1?"\n"+d+"\t"+m.join(",\n"+d+"\t")+"\n"+