⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 resourcepopup2.js

📁 Hippo CMS是一个以信息为中心的开源内容管理系统。Hippo CMS目标是供中,大型企业来管理其发布在互连网
💻 JS
字号:
// CONSTRUCTOR for the CalendarPopup Object
function ResourcePopup2(url) {
	var c;	
 c = new PopupWindow();

/*	c.agt = navigator.userAgent.toLowerCase();
	c.is_ie	   = ((HTMLArea.agt.indexOf("msie") != -1) && (HTMLArea.agt.indexOf("opera") == -1));
	c.is_opera  = (HTMLArea.agt.indexOf("opera") != -1);
	c.is_mac	   = (HTMLArea.agt.indexOf("mac") != -1);
	c.is_mac_ie = (HTMLArea.is_ie && HTMLArea.is_mac);
	c.is_win_ie = (HTMLArea.is_ie && !HTMLArea.is_mac);
	c.is_gecko  = (navigator.product == "Gecko");
	*/
	c.getXYPosition=RP_getXYPosition;
 c.setUrl('/editing/cf2/picker-wrapper.html?pickerUrl='+escape(url));
  
 c.offsetX = -152;
	c.offsetY = 25;
	c.setSize(300,300);
	c.autoHide();
	c.select = RP_select;
	c.dialogArguments=new Array();
	c.ancestorShowPopup=PopupWindow_showPopup;
	c.showPopup=RP_showPopup;
	c.hidePopup=PopupWindow_hidePopup;
	c.cssPrefix="";
	c.choose=RP_choose;
	c.initWndLoopCount=0;
	c.initPopupWindow = RP_InitPopupWindow;
 c.myCallBackFunction= function (){ c.choose(arguments); }
  
 c.callbackFunction = function (){ alert("Default callback function"); }
  
	return c;
}


function RP_GlobalInitWindow_callback(wnd){
	 return function(){	 	  
	 	  wnd.initPopupWindow();	
	 }
}

function RP_InitPopupWindow(){		
  var inited=(this.popupWindow.document != null);  
  if (inited) inited = (this.popupWindow.document.getElementsByTagName('body').length > 0);  
  if (inited) inited = (this.popupWindow.document.getElementsByTagName('body').item(0) != null);
  if (inited) { 
  	var htmlBody = this.popupWindow.document.getElementsByTagName('body').item(0).getAttribute('innerHTML');
  	inited =  (htmlBody != '');
  }
  if (!inited)  {  	  
  	  if (this.initWndLoopCount < 10){
  	  	  this.initWndLoopCount++;	 
  	  	  var fnc = RP_GlobalInitWindow_callback(this);
			     window.setTimeout(fnc,1);
  	  }
  }
  else{
				 this.popupWindow.opener._return=this.myCallBackFunction;					
				 this.popupWindow.choose=this.myCallBackFunction;					
					this.popupWindow.forms_getLink=this.myCallBackFunction;
					this.popupWindow.chooseFile=this.myCallBackFunction;
					this.popupWindow.pickItem=this.myCallBackFunction;
  }
}

function RP_showPopup(){
	if (pickerWrapper != null) pickerWrapper.reference=this;
	this.ancestorShowPopup();	
	if (pickerWrapper == null){ 
		 this.initWndLoopCount=0;
	  this.initPopupWindow();
	}
/*	this.popupWindow.choose=this.myCallBackFunction;	
	this.popupWindow.forms_getLink=this.myCallBackFunction;	
	this.popupWindow.chooseFile=this.myCallBackFunction;	
	this.popupWindow.pickItem=this.myCallBackFunction;	*/
}

function RP_initTargets(element,sourceProps,targetProps){	
	this.targets=this.loadElements(element,targetProps);
	this.sourceElements=this.loadElements(element,sourceProps);
	if (this.sourceElements.length <= 0 || this.targets.length <= 0){ alert('No target fields defined'); return null;}
	if (this.sourceElements[0].obj.value != '' && this.sourceElements[0].obj.value != null){
  	this.assignTargets(this.sourceElements[0].obj.value);	
	}
}


function RP_choose(){
  if (arguments[0].length > 0){
  	 this.callbackFunction(arguments[0][0]);
 		 this.hidePopup(); 
	 }
}

function RP_getXYPosition(){
	 var coords=new Object();
	 coords.x=100; 
	 coords.y=100;
}
// Set the prefix to be added to all CSS classes when writing output
function RP_setCssPrefix(val) { 
	this.cssPrefix = val; 
	}


// Simple method to interface popup calendar with a text-entry box
function RP_select() {	
  window.Dialog = new Object();	// prevent JS error from popup.js
  window.Dialog._arguments = {};
  window.Dialog._return = function(arg){};

	this.callbackFunction = arguments[0];
	this.showPopup();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -