Project

General

Profile

Часто задаваемые вопросы » sbj_edit.js

Alexander Smolko, 27/11/2015 11:39

 
<script LANGUAGE=JScript>

function GetParentById( from, par_id )
{
var elem = from;
do{
if( elem.id == par_id )
return elem;
elem = elem.parentElement;
}while(elem);
return null;
}
</script>
<script LANGUAGE=JScript event="onload" for="window">
</script>

<script LANGUAGE=JScript event="onresizestart" for="TractAudioItem">
event.returnValue = false;
event.cancelBubble = true;
</script>


<script LANGUAGE=JScript event="onbeforeeditfocus" for="TractAudioItem">
event.returnValue = false;
event.cancelBubble = true;
//alert("sss");
</script>

<script LANGUAGE=JScript event="onactivate" for="TractAudioItem">
event.returnValue = false;
event.cancelBubble = true;
return false;
</script>


<script LANGUAGE=JScript event="onbeforeactivate" for="TractAudioItem">
event.returnValue = false;
event.cancelBubble = true;
return false;
</script>

<script LANGUAGE=JScript event="onlosecapture" for="document">
alert("capture");
</script>


<script LANGUAGE=JScript event="onmouseup" for="TractAudioItem">
return false;
</script>

<script LANGUAGE=JScript event="onmousedown" for="TractAudioItem">

var par = GetParentById( this, "TractTape");
if( !par || par.contentEditable!="true" )
return true;

if( !document.body )
return true;

event.cancelBubble = false;
var same_wnd = false;

// check if it's a click on selected object
if( document.selection.type == "control" ){
var range = document.selection.createRange();
if( range && range.length == 1 ){
var sel_ctrl = range.item( 0 );
if( sel_ctrl && sel_ctrl.uniqueID == par.uniqueID ){
same_wnd = true;
}
}
}
if( !same_wnd ){
var range = document.body.createControlRange();
range.addElement( this );
range.select();
}

if( event.button != 1 )
return true;

if( event.srcElement.id== "TractAudioItem")
this.dragDrop();
else
parentElement.dragDrop();


return true;
</script>




<script LANGUAGE=JScript event="onclick" for="document">
/* if( !event.altKey )
return true;

event.returnValue = false;
event.cancelBubble = true;

var reswnd = window.open();
var res = "PARAMS:" + event.srcElement.tagName + "("+event.srcElement.id + ")<br>";
for( a in event.srcElement ){
if( a=="innerHTML" || a=="outerHTML")
continue;
res += a+ "='"+ event.srcElement[a] + "'<br>";
}
res.replace(">","&gt;");
res.replace("<","&lt;");
reswnd.document.body.innerHTML = res;
return false;*/
</script>



<script LANGUAGE=JScript event="onbeforeprint" for="window">
var nodes = document.body.childNodes;
var num = nodes.length;
var block_num = 0;
var num_in_block = 0;
for( i=0; i<num; i++){
var obj = nodes[i];
if( obj.id == "PBlock" ){
if( block_num>0 )
obj.style.pageBreakBefore = "";
else
obj.style.pageBreakBefore = "";
block_num++;
num_in_block = 0;
}else if( obj.id == "Subject" ){
if(num_in_block > 0)
obj.style.pageBreakBefore = "";
else
obj.style.pageBreakBefore = "";
num_in_block++;
}else
obj.style.pageBreakBefore = "";
}
</script>



(11-11/13)
Add picture from clipboard (Maximum size: 742 MB)