Version 2.2.2
This commit is contained in:
1 parent
22f1b963ee
commit
a3bb603c96
858 files changed
+479463
-188140
No files matched your search
@@ -1,9 +1,10 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Insert Custom BBCode</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=windows-1251" />
|
||||
<title>Äîáàâëåíèå BB-êîäà</title>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// Attempt to get editor ID
|
||||
//-----------------------------------------
|
||||
@@ -15,11 +16,11 @@
|
||||
var allow_advanced = null;
|
||||
var current_selection = null;
|
||||
var bbcode = parent.ips_bbcode_items[ bbcode_id ];
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// INIT
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
function Init()
|
||||
{
|
||||
var allow_advanced = parent.IPS_editor[ editor_id ].allow_advanced;
|
||||
@@ -28,96 +29,96 @@
|
||||
//-----------------------------------------
|
||||
// Set up main close button
|
||||
//-----------------------------------------
|
||||
|
||||
|
||||
parent.document.getElementById( editor_id + '_cb-close-window' ).onclick = do_cancel;
|
||||
parent.document.getElementById( editor_id + '_cb-close-window' ).style.cursor = 'pointer';
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// Resize window
|
||||
//-----------------------------------------
|
||||
|
||||
|
||||
parent.document.getElementById( editor_id + '_htmlblock_' + this_module + '_menu' ).style.height = this_height + 'px';
|
||||
parent.document.getElementById( editor_id + '_iframeblock_' + this_module + '_menu' ).style.height = ( this_height - 10 ) + 'px';
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// Module specific stuff
|
||||
//-----------------------------------------
|
||||
|
||||
|
||||
document.getElementById("f_content_text").focus();
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up initial text value
|
||||
//-----------------------------------------
|
||||
|
||||
|
||||
document.getElementById("f_content_text").value = current_selection;
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// Add in data
|
||||
//-----------------------------------------
|
||||
|
||||
document.getElementById("_title").innerHTML += ' ' + bbcode['title'];
|
||||
|
||||
document.getElementById("_title").innerHTML += ' «' + bbcode['title'] + '»';
|
||||
document.getElementById("_example").innerHTML += ' ' + bbcode['example'];
|
||||
document.getElementById("_option").innerHTML += ' ' + bbcode['text_option'];
|
||||
document.getElementById("_content").innerHTML += ' ' + bbcode['text_content'];
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// Using option?
|
||||
//-----------------------------------------
|
||||
|
||||
|
||||
if ( parseInt( bbcode['use_option'] ) == 1 )
|
||||
{
|
||||
document.getElementById( 'use-option' ).style.display = '';
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up initial text value
|
||||
//-----------------------------------------
|
||||
|
||||
|
||||
document.getElementById("f_content_text").value = parent.IPS_editor[ editor_id ].strip_empty_html( current_selection );
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Do cancel
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
function do_cancel()
|
||||
{
|
||||
parent.IPS_editor[ editor_id ].module_remove_control_bar();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Do submit (low tech)
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
function do_submit()
|
||||
{
|
||||
var fields = [ "f_option_text", "f_content_text" ];
|
||||
|
||||
|
||||
var param = new Object();
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// Compile data
|
||||
//-----------------------------------------
|
||||
|
||||
|
||||
for ( var i in fields )
|
||||
{
|
||||
param[ fields[i] ] = document.getElementById( fields[i] ).value;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up required fields
|
||||
//-----------------------------------------
|
||||
|
||||
|
||||
var required = {
|
||||
"f_option_text" : "You must enter option text",
|
||||
"f_content_text": "You must enter content text"
|
||||
"f_option_text" : "Âû äîëæíû ââåñòè îïöèè òåãà",
|
||||
"f_content_text": "Âû äîëæíû ââåñòè ñîäåðæèìîå äëÿ òåãà"
|
||||
};
|
||||
|
||||
|
||||
for (var i in required)
|
||||
{
|
||||
var el = document.getElementById(i);
|
||||
|
||||
|
||||
if ( i == 'f_option_text' )
|
||||
{
|
||||
if ( parseInt( bbcode['use_option'] ) != 1 )
|
||||
@@ -125,7 +126,7 @@
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( ! el.value )
|
||||
{
|
||||
alert( required[i] );
|
||||
@@ -133,15 +134,15 @@
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// Now prep the table
|
||||
//-----------------------------------------
|
||||
|
||||
|
||||
var _html = '';
|
||||
var _content = document.getElementById( 'f_content_text' ).value;
|
||||
var _option = document.getElementById( 'f_option_text' ).value;
|
||||
|
||||
|
||||
if ( parseInt( bbcode['use_option'] ) == 1 )
|
||||
{
|
||||
if ( parseInt( bbcode['switch_option'] ) == 1 )
|
||||
@@ -156,22 +157,31 @@
|
||||
else
|
||||
{
|
||||
_html = '[' + bbcode['tag'] + ']' + _content + '[/' + bbcode['tag'] + ']';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Is this RTE?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( parent.IPS_editor[ editor_id ].is_rte )
|
||||
{
|
||||
_html = _html.replace( /(\n|\r|<br>|<br \/>)/g, "<br />" );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Return..
|
||||
//-----------------------------------------
|
||||
|
||||
parent.IPS_editor[ editor_id].editor_check_focus();
|
||||
|
||||
|
||||
parent.IPS_editor[ editor_id ].insert_text( _html );
|
||||
|
||||
//-----------------------------------------
|
||||
// Kill Window
|
||||
//-----------------------------------------
|
||||
|
||||
|
||||
do_cancel();
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
//-->
|
||||
@@ -184,10 +194,10 @@
|
||||
|
||||
<body onload="Init()">
|
||||
|
||||
<div class="title" id="_title">Insert</div>
|
||||
<div class="title" id="_title">Òåã</div>
|
||||
|
||||
<fieldset style="margin-left: 5px;">
|
||||
<legend><strong>Example</strong></legend>
|
||||
<legend><strong>Ïðèìåð</strong></legend>
|
||||
<div id="_example" style='font-family:"Courier New", Monaco, Courier;font-size:12px'></div>
|
||||
</fieldset>
|
||||
|
||||
@@ -197,7 +207,7 @@
|
||||
|
||||
<div id='use-option' style='display:none'>
|
||||
<fieldset style="margin-left: 5px;">
|
||||
<legend><strong>Option Text</strong></legend>
|
||||
<legend><strong>Îïöèè òåãà</strong></legend>
|
||||
<div id='_option' style='padding:2px;color:#555;'></div>
|
||||
<table border="0" width='100%' style="padding: 0px; margin: 0px">
|
||||
<tbody>
|
||||
@@ -211,7 +221,7 @@
|
||||
</div>
|
||||
|
||||
<fieldset style="margin-left: 5px;">
|
||||
<legend><strong>Content Text</trong></legend>
|
||||
<legend><strong>Ñîäåðæèìîå òåãà</trong></legend>
|
||||
<div id='_content' style='padding:2px;color:#555;'></div>
|
||||
<table border="0" width='100%' style="padding: 0px; margin: 0px">
|
||||
<tbody>
|
||||
@@ -227,8 +237,8 @@
|
||||
|
||||
<div style="text-align: center;">
|
||||
<hr />
|
||||
<button type="button" class='tblbutton' name="ok" onclick="return do_submit();">OK</button>
|
||||
<button type="button" class='tblbutton' name="cancel" onclick="return do_cancel();">Cancel</button>
|
||||
<button type="button" class='tblbutton' name="ok" onclick="return do_submit();">Äîáàâèòü</button>
|
||||
<button type="button" class='tblbutton' name="cancel" onclick="return do_cancel();">Îòìåíà</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
Reference in new issue
Block a user