2018-07-13 18:39:55 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (c) Codiad & Kent Safranski (codiad.com), distributed
|
|
|
|
* as-is and without warranty under the MIT License. See
|
|
|
|
* [root]/license.txt for more. This information must remain intact.
|
|
|
|
*/
|
|
|
|
|
|
|
|
require_once('../../common.php');
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////
|
|
|
|
// Verify Session or Key
|
|
|
|
//////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
checkSession();
|
|
|
|
|
|
|
|
?>
|
|
|
|
<form onsubmit="return false;">
|
|
|
|
<?php
|
|
|
|
|
|
|
|
switch($_GET['action']){
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////
|
|
|
|
// Find & Replace
|
|
|
|
//////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
case 'search':
|
|
|
|
$type = $_GET['type'];
|
|
|
|
?>
|
|
|
|
<label><?php i18n("Find:"); ?></label>
|
2018-11-19 19:30:49 +01:00
|
|
|
<textarea name="find" autofocus="autofocus" autocomplete="off"></textarea>
|
2018-07-13 18:39:55 +02:00
|
|
|
|
|
|
|
<?php if($type=='replace'){ ?>
|
|
|
|
|
|
|
|
<label><?php i18n("Replace:"); ?></label>
|
2018-11-19 19:30:49 +01:00
|
|
|
<textarea name="replace"></textarea>
|
2018-07-13 18:39:55 +02:00
|
|
|
|
|
|
|
<?php } ?>
|
|
|
|
|
|
|
|
<button class="btn-left" onclick="codiad.editor.search('find');return false;"><?php i18n("Find"); ?></button>
|
|
|
|
<?php if($type=='replace'){ ?>
|
|
|
|
<button class="btn-mid" onclick="codiad.editor.search('replace');return false;"><?php i18n("Replace"); ?></button>
|
|
|
|
<button class="btn-mid" onclick="codiad.editor.search('replaceAll');return false;"><?php i18n("Replace ALL"); ?></button>
|
|
|
|
<?php } ?>
|
|
|
|
<button class="btn-right" onclick="codiad.modal.unload(); return false;"><?php i18n("Cancel"); ?></button>
|
|
|
|
<?php
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
|
|
|
</form>
|
|
|
|
<script>
|
|
|
|
$(function(){
|
|
|
|
<?php if($_GET['action']=='search'){ ?>
|
2018-11-19 19:30:49 +01:00
|
|
|
$('textarea[name="find"]').val(codiad.active.getSelectedText());
|
2018-07-13 18:39:55 +02:00
|
|
|
<?php } ?>
|
|
|
|
});
|
|
|
|
|
|
|
|
</script>
|