mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-23 13:19:56 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@537 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
cc0b017bcc
commit
5d59f2b8f9
13 changed files with 197 additions and 153 deletions
|
|
@ -4,103 +4,111 @@
|
|||
|
||||
// string prototype으로 trim 함수 추가
|
||||
String.prototype.trim = function() {
|
||||
return this.replace(/(^\s*)|(\s*$)/g, "");
|
||||
return this.replace(/(^\s*)|(\s*$)/g, "");
|
||||
}
|
||||
|
||||
// 주어진 인자가 하나라도 defined되어 있지 않으면 false return
|
||||
function isDef() {
|
||||
for(var i=0; i<arguments.length; ++i) {
|
||||
if(typeof(arguments[i])=="undefined") return false;
|
||||
}
|
||||
return true;
|
||||
for(var i=0; i<arguments.length; ++i) {
|
||||
if(typeof(arguments[i])=="undefined") return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// 윈도우 오픈
|
||||
function winopen(url, target, attribute) {
|
||||
if(typeof(target)=='undefined') target = '_blank';
|
||||
if(typeof(attribute)=='undefined') attribute = '';
|
||||
var win = window.open(url, target, attribute);
|
||||
win.focus();
|
||||
if(typeof(target)=='undefined') target = '_blank';
|
||||
if(typeof(attribute)=='undefined') attribute = '';
|
||||
var win = window.open(url, target, attribute);
|
||||
win.focus();
|
||||
}
|
||||
|
||||
// 특정 div(or span...)의 display옵션 토글
|
||||
function toggleDisplay(obj, opt) {
|
||||
obj = xGetElementById(obj);
|
||||
if(typeof(opt)=="undefined") opt = "inline";
|
||||
if(obj.style.display == "none") obj.style.display = opt;
|
||||
else obj.style.display = "none";
|
||||
obj = xGetElementById(obj);
|
||||
if(typeof(opt)=="undefined") opt = "inline";
|
||||
if(obj.style.display == "none") obj.style.display = opt;
|
||||
else obj.style.display = "none";
|
||||
}
|
||||
|
||||
// 멀티미디어 출력용 (IE에서 플래쉬/동영상 주변에 점선 생김 방지용)
|
||||
function displayMultimedia(type, src, style) {
|
||||
var clsid = "";
|
||||
var codebase = "";
|
||||
var html = "";
|
||||
switch(type) {
|
||||
case "flv" :
|
||||
case "swf" :
|
||||
clsid = "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";
|
||||
codebase = "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.c-ab#version=6,0,29,0";
|
||||
html = ""+
|
||||
"<object classid=\""+clsid+"\" codebase=\""+codebase+"\" "+style+">"+
|
||||
"<param name=\"movie\" value=\""+src+"\" />"+
|
||||
"<param name=\"quality\" value=\"high\" />"+
|
||||
"<embed src=\""+src+"\" autostart=\"0\" "+style+"></embed>"+
|
||||
"<\/object>";
|
||||
break;
|
||||
default :
|
||||
html = ""+
|
||||
"<embed src=\""+src+"\" autostart=\"0\" "+style+"></embed>";
|
||||
break;
|
||||
}
|
||||
function displayMultimedia(src, width, height, auto_start) {
|
||||
var ext = src.split(".");
|
||||
var type = ext[ext.length-1];
|
||||
|
||||
document.writeln(html);
|
||||
if(auto_start) auto_start = 1;
|
||||
else auto_start = 0;
|
||||
|
||||
var clsid = "";
|
||||
var codebase = "";
|
||||
var html = "";
|
||||
switch(type) {
|
||||
case "flv" :
|
||||
html = "<embed src=\"./common/tpl/images/flvplayer.swf?autoStart="+auto_start+"&file="+src+"\" width=\""+width+"\" height=\""+height+"\" type=\"application/x-shockwave-flash\"></embed>";
|
||||
break;
|
||||
case "swf" :
|
||||
clsid = "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";
|
||||
codebase = "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.c-ab#version=6,0,29,0";
|
||||
html = ""+
|
||||
"<object classid=\""+clsid+"\" codebase=\""+codebase+"\" width=\""+width+"\" hegiht=\""+height+"\" >"+
|
||||
"<param name=\"movie\" value=\""+src+"\" />"+
|
||||
"<param name=\"quality\" value=\"high\" />"+
|
||||
"<embed src=\""+src+"\" autostart=\""+auto_start+"\" "+style+"></embed>"+
|
||||
"<\/object>";
|
||||
break;
|
||||
default :
|
||||
html = ""+
|
||||
"<embed src=\""+src+"\" autostart=\""+auto_start+"\" width=\""+width+"\" hegiht=\""+height+"\"></embed>";
|
||||
break;
|
||||
}
|
||||
|
||||
document.writeln(html);
|
||||
}
|
||||
|
||||
// 화면내에서 이미지 리사이즈 및 클릭할 수 있도록
|
||||
function resizeImageContents() {
|
||||
var objs = xGetElementsByTagName("img");
|
||||
for(var i in objs) {
|
||||
var obj = objs[i];
|
||||
var parent = xParent(obj);
|
||||
if(!obj||!parent) continue;
|
||||
var objs = xGetElementsByTagName("img");
|
||||
for(var i in objs) {
|
||||
var obj = objs[i];
|
||||
var parent = xParent(obj);
|
||||
if(!obj||!parent) continue;
|
||||
|
||||
var parent_width = xWidth(parent);
|
||||
var obj_width = xWidth(obj);
|
||||
if(parent_width>=obj_width) continue;
|
||||
var parent_width = xWidth(parent);
|
||||
var obj_width = xWidth(obj);
|
||||
if(parent_width>=obj_width) continue;
|
||||
|
||||
obj.style.cursor = "pointer";
|
||||
obj.source_width = obj_width;
|
||||
obj.source_height = xHeight(obj);
|
||||
xWidth(obj, xWidth(parent)-1);
|
||||
obj.style.cursor = "pointer";
|
||||
obj.source_width = obj_width;
|
||||
obj.source_height = xHeight(obj);
|
||||
xWidth(obj, xWidth(parent)-1);
|
||||
|
||||
xAddEventListener(obj,"click", resizeImagePopup);
|
||||
}
|
||||
xAddEventListener(obj,"click", resizeImagePopup);
|
||||
}
|
||||
}
|
||||
xAddEventListener(window, "load", resizeImageContents);
|
||||
|
||||
// 컨텐츠에서 컨텐츠 영역보다 큰 이미지 리사이징후 팝업 클릭시 사용되는 함수
|
||||
function resizeImagePopup(evt) {
|
||||
var e = new xEvent(evt);
|
||||
if(!e.target.src) return;
|
||||
var obj = e.target;
|
||||
var scrollbars = "no";
|
||||
var resizable = "no";
|
||||
var e = new xEvent(evt);
|
||||
if(!e.target.src) return;
|
||||
var obj = e.target;
|
||||
var scrollbars = "no";
|
||||
var resizable = "no";
|
||||
|
||||
var width = obj.source_width;
|
||||
if(width>screen.availWidth) {
|
||||
width = screen.availWidth-50;
|
||||
scrollbars = "yes";
|
||||
resizable = "yes";
|
||||
}
|
||||
var height = obj.source_height;
|
||||
if(height>screen.availHeight) {
|
||||
height = screen.availHeight-50;
|
||||
scrollbars = "yes";
|
||||
resizable = "yes";
|
||||
}
|
||||
var popup = window.open(e.target.src,"_imagePopup","width="+width+",height="+height+",top=1,left=1,resizable="+resizable+",toolbars=no,scrollbars="+resizable);
|
||||
if(popup) popup.focus();
|
||||
var width = obj.source_width;
|
||||
if(width>screen.availWidth) {
|
||||
width = screen.availWidth-50;
|
||||
scrollbars = "yes";
|
||||
resizable = "yes";
|
||||
}
|
||||
var height = obj.source_height;
|
||||
if(height>screen.availHeight) {
|
||||
height = screen.availHeight-50;
|
||||
scrollbars = "yes";
|
||||
resizable = "yes";
|
||||
}
|
||||
var popup = window.open(e.target.src,"_imagePopup","width="+width+",height="+height+",top=1,left=1,resizable="+resizable+",toolbars=no,scrollbars="+resizable);
|
||||
if(popup) popup.focus();
|
||||
}
|
||||
|
||||
// 에디터에서 사용하는 내용 여닫는 코드 (고정)
|
||||
|
|
|
|||
BIN
common/tpl/images/flvplayer.swf
Normal file
BIN
common/tpl/images/flvplayer.swf
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue