Merge v2 into master #18

Merged
andydixon merged 4 commits from v2-dev into master 2024-09-18 23:05:57 +02:00
222 changed files with 7716 additions and 21791 deletions
-1
View File
@@ -1 +0,0 @@
/cms/.idea/
+16
View File
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PublishConfigData" deleteMissingItems="true" createEmptyFolders="true" remoteFilesAllowedToDisappearOnAutoupload="false" confirmBeforeUploading="false" confirmBeforeDeletion="false">
<option name="confirmBeforeDeletion" value="false" />
<option name="confirmBeforeUploading" value="false" />
<serverData>
<paths name="Hostinger">
<serverdata>
<mappings>
<mapping deploy="/" local="$PROJECT_DIR$" web="/" />
</mappings>
</serverdata>
</paths>
</serverData>
</component>
</project>
Generated
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>
+23
View File
@@ -0,0 +1,23 @@
# NeoCMS
## Version 2.0
Version 2.0 is a complete rewrite to ensure we support the latest jQuery and TinyMCE GPL version.
To install:
* Drop in the CMS folder into a static website
* Drop in the uploads folder into the static website
* Edit credentials in /cms/init.php for any users that are required
* Update editable divs to contain the class 'editable'
* It _should_ then just work by visiting /cms/ and logging in
## Requirements
* PHP 8 on Linux. None of that Windows Server crap
## Known Bugs
* Templating (New Page) not yet implemented
* File (not images) uploads need to be implemented
* Not completely tested
If any issues arise, raise it as a bug in the issues page on GitHub
View File
-15
View File
@@ -1,15 +0,0 @@
<?php
/**
* User accounts
*/
$_users = [
"admin" => ["password" => "password", "isAdmin" => 1],
"user" => ["password" => "password", "isAdmin" => 0],
];
$companyName = "CHANGEME IN CONFIG";
$versionInfo = "1.0.0";
+14
View File
@@ -0,0 +1,14 @@
<?php
require_once "../neoCMSCore.php";
require_once "../init.php";
switch ($_REQUEST["action"]) {
case "save":
if (!empty($_POST['uri']) && !empty($_POST['content'])) {
$_SESSION['core']->saveContent($_POST['uri'], $_POST['content']);
die("Page Updated.");
} else {
die('Unable to save page');
}
break;
}
-64
View File
@@ -1,64 +0,0 @@
<?php
include_once('geturi.php');
$pageurl = $_SERVER['HTTP_REFERER']; //incoming page url
$scripturl = $_SERVER['HTTP_HOST'] . uri();
function rewriteurl($pageurl)
{
$rwurl = false;
$rewrites = array('/\/$/', '/.$/');
$exts = array("$0.php", "$0.html", "$0.htm", "$0.cfm", "$0.phtml", "$0.asp");
foreach ($rewrites as $rw) {
if (preg_match($rw, $pageurl)) {
foreach ($exts as $ext) {
if (@file_exists(preg_replace($rw, $ext, $pageurl))) {
$rwurl = preg_replace($rw, $ext, $pageurl);
break 2;
}
}
}
}
return $rwurl;
}
if (stristr($pageurl, $_SERVER['HTTP_HOST'])) {
$path = $_SESSION['neoCMSPath'];
$scripturl = explode("/$path/", $scripturl);
$pageurl = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? dirname(__FILE__) . str_replace("https://$scripturl[0]/", '/../../', $pageurl) : dirname(__FILE__) . str_replace("http://$scripturl[0]/", '/../../', $pageurl); // check for https protocol
$pagepath = explode('/', $pageurl);
array_pop($pagepath);
$pagepath = implode('/', $pagepath);
if (!@file_exists("$pageurl") && !is_dir($pageurl)) $pageurl = rewriteurl($pageurl);
elseif (is_dir($pageurl)) {
$fileendings = array("index.html", "index.shtml", "index.htm", "index.php", "index.cfm", "index.phtml", "index.asp", "default.html", "default.shtml", "default.htm", "default.php", "default.cfm", "default.phtml", "default.asp"); // edit this if you have a custom default page
foreach ($fileendings as $value) {
if (@file_exists("$pageurl$value")) {
$pageurl = "$pageurl$value";
break;
}
}
}
}
-112
View File
@@ -1,112 +0,0 @@
<?php
function thecleaner($stuff)
{
global $message, $encode, $doctype;
$code = array();
$phpreg = '/<\?(.|\n|\r)+?\?>/';
$aspreg = '/<%(.|\n|\r)+?\%>/';
$jsreg = '/<script\s[^>]*>\s*[^<](.|\n)*?<\/\s*script>/';
$prereg = '/<pre[^>]*>(.|\n)*?<\/\s*pre>/';
$codereg = '/<code[^>]*>(.|\n)*?<\/\s*code>/';
$cssreg = '/<style[^>]*>(.|\n)*?<\/\s*style>/';
$stufflen = strlen($stuff);
try {
//grab php
preg_match_all($phpreg, $stuff, $code['PHP']);
$stuff = preg_replace($phpreg, '----||PHPGO3SHERE||----', $stuff);
//grab asp
preg_match_all($aspreg, $stuff, $code['ASP']);
$stuff = preg_replace($aspreg, '----||ASPGO3SHERE||----', $stuff);
//grab on-page js
preg_match_all($jsreg, $stuff, $code['JS']);
$stuff = preg_replace($jsreg, '----||JSGO3SHERE||----', $stuff);
//grab on-page CSS
preg_match_all($cssreg, $stuff, $code['CSS']);
$stuff = preg_replace($cssreg, '----||CSSGO3SHERE||----', $stuff);
} catch (Exception $e) {
$message = '<strong>Error:</strong> There may be too much on page Javascript or CSS. Please try moving them to external files and/or validating your HTML.';
output();
}
$stuff = stripslashes($stuff);
$stuff = trim($stuff);
//grab pre
preg_match_all($prereg, $stuff, $code['PRE']);
$stuff = preg_replace($prereg, '----||PREGO3SHERE||----', $stuff);
//grab code
preg_match_all($codereg, $stuff, $code['CODE']);
$stuff = preg_replace($codereg, '----||CODEGO3SHERE||----', $stuff);
function lower($matches)
{
}
//fix uppercase tags
$stuff = preg_replace_callback('/<(\/|)[A-Z]+[A-Z0-9]*\b/', function ($matches) {
return strtolower($matches[0]);
}, $stuff);
//fix attribute quotes
$stuff = preg_replace('/(<(?!meta)[^>]*\s[A-Za-z]+=)([^>\'\"\s]+)(\s*[^>]*)/', '$1"$2"$3', $stuff);
// fix self-closing tags
if (preg_match('/XHTML/', $doctype)) {
$stuff = preg_replace("/(<img[^>%]*[^\/%])(>)/i", "$1/>", $stuff);
$stuff = preg_replace("/<br\s*>/", "<br />", $stuff);
}
$nstuff = htmlentities($stuff, ENT_QUOTES, $encode);
if ($nstuff == '') $nstuff = htmlentities($stuff, ENT_QUOTES, 'ISO-8859-15');
$stuff = $nstuff;
$stuff = str_replace("&lt;", "<", $stuff);
$stuff = str_replace("&gt;", ">", $stuff);
$stuff = str_replace("&amp;", '&', $stuff);
$stuff = str_replace("&#039;", "'", $stuff);
$stuff = str_replace("&quot;", '"', $stuff);
// remove TinyMCE stuff
preg_match_all('/(?:<[^>]*)(_mce_[^=]+=(?:\"|\'|)[^\"]*(?:\"|\'|)\s*)/', $stuff, $mces);
foreach ($mces[1] as $mce) {
$stuff = str_replace($mce, "", $stuff);
}
// add back original code
$replace = array('CODE', 'PRE', 'CSS', 'JS', 'ASP', 'PHP');
foreach ($replace as $r) {
$rreg = '/\-\-\-\-\|\|' . $r . 'GO3SHERE\|\|\-\-\-\-/';
$c = 0;
preg_match_all($rreg, $stuff, $newcode);
foreach ($newcode[0] as $ncode) {
$stuff = preg_replace($rreg, $code[$r][0][$c], $stuff, 1);
$c++;
}
$c = 0;
}
// remove extra line breaks
$stuff = preg_replace("/\r\n/", "\n", $stuff);
if ($stuff != '' || $stufflen == 0) return $stuff;
else $message = '<strong>Error:</strong> Some characters couldn&rsquo;t be recognised. Try switching to UTF-8 encoding and be sure all special characters are properly encoded.';
}
-29
View File
@@ -1,29 +0,0 @@
<?php
error_reporting(E_ALL & ~E_NOTICE);
$ssp = ini_get("session.save_path");
try {
if ($ssp != '') @ini_set("session.save_path", $ssp);
else @ini_set("session.save_path", '/');
} catch (Exception $e) {
@ini_set("session.save_path", '/');
}
@ini_set("session.auto_start", 0);
@ini_set("register_long_arrays", 0);
@ini_set("session.cache_limiter", "private");
@ini_set("open_basedir", dirname(__FILE__) . '/../../');
@ini_set('memory_limit', '256M');
$sessname = '';
if (!isset($_SESSION['neoCMSSess'])) {
$sessname = "neoCMSsession" . uniqid('');
$_SESSION['neoCMSSess'] = $sessname;
} else $sessname = $_SESSION['neoCMSSess'];
@session_start();
-178
View File
@@ -1,178 +0,0 @@
<?php
error_reporting(E_ALL & ~E_NOTICE);
@session_start();
if (isset($_SESSION['neoCMSSess']) && strstr($_SESSION['neoCMSSess'], 'neoCMSsession')) {
include_once('createsession.php');
if (isset($_SESSION['neoCMSUserid'])) {
$pageurl = $_SERVER['HTTP_REFERER']; //incoming page url
if (stristr($pageurl, $_SERVER['HTTP_HOST'])) {
$type = $_GET['type'];
if ($type == 'img') $files = 'bmp,gif,jpeg,jpg,png,svg,svgx,webp';
elseif ($type == 'pages') $files = 'html,htm,php,cfm,phtml,shtml';
else $files = 'psd,pdf,swf,sit,tar,tgz,zip,gzip,bmp,gif,jpeg,jpg,jpe,png,txt,doc,docx,xl,xls,flv,mov,qt,mpg,mpeg,mp3,aiff,aif,aac,wav,ppt,rtf,html,shtml,htm,php,cfm,phtml,asp';
$files = explode(',', $files);
$pattern = '/(';
foreach ($files as $file) {
$pattern .= '\.' . $file . '|';
}
$matches = array();
$includes = array();
$pattern = trim($pattern, '|') . ')/i';
$matches = findfiles('../../', $pattern);
print_r($matches);
sort($matches);
$includes = array_unique($includes);
$pathreg = "/\/$pathdefault\//";
$imghtml = '';
$filehtml = '';
$pagehtml = '';
if (sizeof($matches) > 0) {
foreach ($matches as $match) {
$fname = str_replace('../../', '', $match);
$flink = siteURL() . $fname;
if (preg_match('/\.bmp|\.gif|\.jpeg|\.jpg|\.png/i', $fname)) {
if (!strstr($imghtml, 'neoCMSImgUL')) $imghtml = '<ul id="neoCMSImgUL" class="clearfix"></ul>';
if (($_SESSION['neoCMSImagePath'] == null || $_SESSION['neoCMSImagePath'] == '') || strstr($fname, $_SESSION['neoCMSImagePath'])) $imghtml = str_replace('</ul>', '<li><div class="mask"><img src="' . $flink . '" alt="' . $fname . ' Thumbnail"/></div><p>' . $fname . '</p></li></ul>', $imghtml);
} elseif (preg_match('/\.html|\.htm|\.php|\.phtml|\.cfm|\.shtml|\.asp/i', $fname)) {
if (!strstr($pagehtml, 'neoCMSPagesUL')) $pagehtml = '<ul id="neoCMSPagesUL" class="clearfix"></ul>';
$pagehtml = str_replace('</ul>', '<li href="' . $flink . '">' . $fname . '</li></ul>', $pagehtml);
} else {
if (!strstr($filehtml, 'neoCMSFileUL')) $filehtml = '<ul id="neoCMSFileUL" class="clearfix"></ul>';
if (($_SESSION['neoCMSFilePath'] == null || $_SESSION['neoCMSFilePath'] == '') || strstr($fname, $_SESSION['neoCMSFilePath'])) $filehtml = str_replace('</ul>', '<li href="' . $flink . '">' . $fname . '</li></ul>', $filehtml);
}
}
$matches = $imghtml . $pagehtml . $filehtml;
$script = "<script language='javascript' type='text/javascript'>window.top.window.fileOption('" . addslashes($matches) . "');</script>";
echo $script;
} else {
$script = '<script language="javascript" type="text/javascript">window.top.window.fileOption(\'<ul class="clearfix"><li>No Results Found</li></ul>\');</script>';
echo $script;
}
$endscript = "<script language='javascript' type='text/javascript'>window.top.window.destroyFileLoader('$type');</script>";
echo $endscript;
}
}
}
function findfiles($path, $pattern)
{
$matches = [];
$path = rtrim(str_replace("\\", "/", $path), '/') . '/';
$entries = array();
$dir = dir($path);
$neocmspath = "/\/" . $_SESSION['neoCMSPath'] . "\//";
while (false !== ($entry = $dir->read())) {
if (!preg_match($neocmspath, $path)) $entries[] = $entry;
}
$dir->close();
foreach ($entries as $entry) {
$fullname = $path . $entry;
$pathname = str_replace('../..', '', $path);
$exFolders = preg_replace('/,\s*/', '/|', $_SESSION['neoCMSExFolders']);
$exFolders = str_replace('-', '\-', $exFolders);
$exFolders = str_replace('.', '\.', $exFolders);
$exFolders = '/' . str_replace('/', '\/', $exFolders) . '\//';
if ($entry != '.' && $entry != '..' && is_dir($fullname) && is_readable($fullname) && (!preg_match($exFolders, $fullname) || $_SESSION['neoCMSExFolders'] == '')) findfiles($fullname, $pattern);
elseif ($entry != '.' && $entry != '..' && is_file($fullname) && preg_match($pattern, $entry)) {
if (!in_array($pathname, $matches)) {
if (preg_match('/\.html|\.htm|\.php|\.cfm|\.phtml|\.shtml|\.asp/', $fullname)) {
$content = file_get_contents($fullname);
if (checkContent($content)) {
$matches[] = $fullname;
}
} else $matches[] = $fullname;
}
}
}
return $matches;
}
function checkContent($content)
{
global $type;
if (stristr($content, '<?php') || stristr($content, '<%')) {
if (((!stristr($content, '<?php') && !strstr($content, '<%')) || (preg_match('/>[^<]+</', $content) || (preg_match('/<html/', $content))) || $type == 'pages')) {
if (strstr($content, 'neocms')) return true;
else return false;
} else return false;
} elseif (preg_match('/<html/', $content) || $type == 'pages') {
if (strstr($content, 'neocms')) return true;
}
}
function siteURL()
{
$purl = 'http';
$req = explode('/' . $_SESSION['neoCMSPath'] . '/', $_SERVER["REQUEST_URI"]);
$req = $req[0];
if ($_SERVER["HTTPS"] == "on") $purl .= "s";
$purl .= "://";
if ($_SERVER["SERVER_PORT"] != "80") $purl .= $_SERVER["SERVER_NAME"] . ":" . $_SERVER["SERVER_PORT"] . "$req/";
else $purl .= $_SERVER["SERVER_NAME"] . "$req/";
return strtolower($purl);
}
-111
View File
@@ -1,111 +0,0 @@
<?php
error_reporting(E_ALL & ~E_NOTICE);
@session_start();
if (isset($_SESSION['neoCMSSess']) && strstr($_SESSION['neoCMSSess'], 'neoCMSsession') && $_GET['type'] != '') {
include_once('createsession.php');
if (isset($_SESSION['neoCMSUserid'])) {
$type = $_GET['type'];
$pageurl = $_SERVER['HTTP_REFERER']; //incoming page url
if (stristr($pageurl, $_SERVER['HTTP_HOST'])) {
$allfiles = 'psd,pdf,swf,sit,tar,tgz,zip,gzip,bmp,gif,jpeg,jpg,jpe,png,txt,doc,docx,xl,xls,flv,mov,qt,mpg,mpeg,mp3,aiff,aif,aac,wav,ppt';
$imgfiles = 'png,jpg,gif,jpeg,tiff,bmp,svg,svgx,webp';
$pathpatt = ($type == 'img') ? '/image|img/i' : '/upload|files/i';
$pathdefault = ($type == 'img') ? $_SESSION['neoCMSImagePath'] : $_SESSION['neoCMSFilePath'];
$files = ($type == 'img') ? $imgfiles : $allfiles;
$files = explode(',', $files);
$pattern = '/(';
foreach ($files as $file) {
$pattern .= '\.' . $file . '|';
}
$pattern = trim($pattern, '|') . ')/i';
$matches = array();
function findfiles($path, $pattern, $pathpatt)
{
global $matches;
$path = rtrim(str_replace("\\", "/", $path), '/') . '/';
$entries = array();
$dir = dir($path);
while (false !== ($entry = $dir->read())) {
if (!preg_match('/(\/neocms\-js\/|\/neocms\-images\/)/', $path)) $entries[] = $entry;
}
$dir->close();
foreach ($entries as $entry) {
$fullname = $path . $entry;
$pathname = str_replace('../..', '', $path);
$exFolders = preg_replace('/,\s*/', '|', $_SESSION['neoCMSExFolders']);
$exFolders = str_replace('-', '\-', $exFolders);
$exFolders = str_replace('.', '\.', $exFolders);
$exFolders = '/' . str_replace('/', '\/', $exFolders) . '/';
if ($entry != '.' && $entry != '..' && is_dir($fullname)) {
if (preg_match($pathpatt, $path) && !in_array($pathname, $matches) && is_writable($path)) $matches[] = $pathname;
if (!preg_match($exFolders, $fullname) || $_SESSION['neoCMSExFolders'] == '') findfiles($fullname, $pattern, $pathpatt);
} elseif (($entry == '.' || $entry == '..') && is_dir($fullname)) {
if (preg_match($pathpatt, $path) && !in_array($pathname, $matches) && is_writable($path)) $matches[] = $pathname;
} elseif (is_file($fullname) && preg_match($pattern, $entry)) {
if (!in_array($pathname, $matches) && is_writable($path)) $matches[] = $pathname;
}
}
}
findfiles("../../$pathdefault", $pattern, $pathpatt);
if (sizeof($matches) > 0) {
foreach ($matches as $match) {
$script = '<script language="javascript" type="text/javascript">window.top.window.folderOption("' . $match . '", "' . $type . '");</script>';
echo $script;
}
} else {
$script = '<script language="javascript" type="text/javascript">window.top.window.folderOption("/", "' . $type . '");</script>';
echo $script;
}
$endscript = '<script language="javascript" type="text/javascript">window.top.window.destroyFolderLoader();</script>';
echo $endscript;
}
}
}
?>
-11
View File
@@ -1,11 +0,0 @@
<?php
error_reporting(E_ALL & ~E_NOTICE);
@session_start();
if (isset($_SESSION['neoCMSSess']) && strstr($_SESSION['neoCMSSess'], 'neoCMSsession')) {
include_once('createsession.php');
if ($_POST['page']) $_SESSION['neoCMSCurpage'] = $_POST['page'];
}
-14
View File
@@ -1,14 +0,0 @@
<?php
function uri()
{
if (!empty($_SERVER['REQUEST_URI'])) return $_SERVER['REQUEST_URI'];
else $uri = $_SERVER['SCRIPT_NAME'];
if (!empty($_SERVER['QUERY_STRING'])) $uri .= '?' . $_SERVER['QUERY_STRING'];
$_SERVER['REQUEST_URI'] = $uri;
return $uri;
}
-37
View File
@@ -1,37 +0,0 @@
<?php
$_users = [];
error_reporting(E_ALL & ~E_NOTICE);
@session_start();
if (isset($_SESSION['neoCMSSess']) && strstr($_SESSION['neoCMSSess'], 'neoCMSsession')) {
include_once('createsession.php');
if ($_POST) {
include_once('../config.php');
if (@$_users[$_POST['neoCMSUsername']]["password"] == $_POST['neoCMSPassword']) {
$_SESSION['neoCMSUserid'] = $_POST['neoCMSUsername'];
$_SESSION['neoCMSUserurl'] = $_SERVER['HTTP_HOST'];
$_SESSION['neoCMSIsadmin'] = $_users[$_POST['neoCMSUsername']]["isAdmin"];
}
include_once('sessionConfiguration.php');
if (isset($_SESSION['neoCMSUserid']) && $_SESSION['neoCMSUserid'] != '') {
$script = '<script type="text/javascript">window.top.window.location="../";</script>';
echo $script;
} else {
$script = '<script type="text/javascript">window.top.window.loginIncorr("Incorrect Username or Password.");</script>';
echo $script;
}
}
} else {
$script = '<script type="text/javascript">window.top.window.loginIncorr("There was an error creating a session.");</script>';
echo $script;
}
-12
View File
@@ -1,12 +0,0 @@
<?php
error_reporting(E_ALL & ~E_NOTICE);
@session_start();
session_unset($_SESSION);
$_SESSION = array();
session_destroy();
@session_write_close();
exit;
-132
View File
@@ -1,132 +0,0 @@
<?php
error_reporting(E_ALL & ~E_NOTICE);
@session_start();
if (isset($_SESSION['neoCMSSess']) && strstr($_SESSION['neoCMSSess'], 'neoCMSsession')) {
include_once('createsession.php');
if (isset($_SESSION['neoCMSUserid'])) {
include_once('urldissect.php');
include_once('checkpath.php');
$message = '<strong>Error:</strong> There was an error restoring your page. Please try again.';
if (@file_exists($pageurl)) {
function loadfile($url, $incpath, $inc)
{
global $message, $pagepath;
// read the file
$doc = fopen($url, "r");
$content = stream_get_contents($doc);
fclose($doc);
$reginclude = '/(?:include\b|include_once\b|require\b|require_once\b)(?:\s*\(*[^;\?>]*)(?:\"|\')([^\"\'<>]*)(?:(\"|\')\)*(;|[\s\t\r\n]*\?>))/i'; // php include regexp
if (!preg_match($reginclude, $content)) $reginclude = '/(?:<!--#include\s(?:virtual|file)\=)(?:\"|\')([^\"\'<>]*)(?:\"|\')(?:\s*-->)/i'; // SSI regexp
// read the backup
$pagename = (strstr($url, $_SERVER['DOCUMENT_ROOT'])) ? explode($_SERVER['DOCUMENT_ROOT'], $url) : explode('../../', $url);
$pagename = trim($pagename[1], '/');
$pagename = str_ireplace('/', '-', $pagename);
$pageext = explode('.', $pagename);
$pagename = preg_replace('/(\.php|\.asp|\.html|\.htm|\.phtml|\.shtml|\.cfm)/', '', $pagename);
$backup = dirname(__FILE__) . '/../backups/' . $pagename . '_Bak.' . $pageext[1];
if (@file_exists($backup)) {
$backdoc = fopen($backup, "r");
$backcontent = stream_get_contents($backdoc);
fclose($backdoc);
echo "File Found: $backup\n\n";
editfile($content, $backcontent, $url, $incpath, $inc);
}
if (preg_match($reginclude, $content)) {
preg_match_all($reginclude, $content, $includes);
foreach ($includes[1] as &$value) {
if (@file_exists($_SERVER['DOCUMENT_ROOT'] . $value) && $value != '') {
$incfile = $_SERVER['DOCUMENT_ROOT'] . $value;
$incpath = false;
} elseif (!stristr($value, 'http://')) {
$incfile = "$pagepath/$value";
if ($incpath) {
$incpathreg = preg_replace('/\//', '\/', $incpath);
$incpathreg = '/(^' . $incpathreg . '\/|\/' . $incpathreg . '\/)/';
$incorigpath = preg_replace($incpathreg, '', $value, 1);
$newinc = "$pagepath/$incpath/$incorigpath";
$incfile = (@file_exists($newinc)) ? $newinc : $incfile;
$incpatharr = explode('/', $incorigpath);
array_pop($incpatharr);
$incpath = (sizeof($incpatharr) > 0) ? $incpath . implode('/', $incpatharr) : false;
} else {
$incpatharr = explode('/', $value);
array_pop($incpatharr);
$incpath = (sizeof($incpatharr) > 0) ? $incpath . implode('/', $incpatharr) : false;
}
} else $incpath = false;
if (!preg_match('/\/$/', $incfile)) loadfile($incfile, $incpath, true);
}
}
}
function editfile($content, $backcontent, $url, $incpath, $inc)
{
if ($content != $backcontent && ((!stristr($content, '<?php') && !strstr($content, '<%')) || (preg_match('/>[^<]+</', $backcontent) || preg_match('/<html/', $backcontent)) && strstr($backcontent, 'neocms'))) {
if (is_writable($url)) {
//restores file
$restdoc = fopen($url, "w");
fputs($restdoc, $backcontent);
fclose($restdoc);
} else $message = "<strong>Error:</strong> You do not have permission to edit this page.";
}
}
loadfile($pageurl, false, false);
$message = 'Your page was successfully restored.';
$script = '<script language="javascript" type="text/javascript">window.top.window.ifrReload();window.top.window.saveFeedback("' . $message . '");</script>';
echo $script;
} else {
$message = '<strong>Error:</strong> neocms could not find this page: <em>' . $url . '</em>';
$script = '<script language="javascript" type="text/javascript">window.top.window.saveFeedback("' . $message . '");</script>';
echo $script;
}
}
}
-455
View File
@@ -1,455 +0,0 @@
<?php
error_reporting(E_ALL & ~E_NOTICE);
@session_start();
include_once('createsession.php');
if (isset($_SESSION['neoCMSSess']) && strstr($_SESSION['neoCMSSess'], 'neoCMSsession')) {
if (isset($_SESSION['neoCMSUserid'])) {
include_once('urldissect.php');
include_once('checkpath.php');
$message = 'Your page was successfully published.';
$encode = 'utf-8';
$doctype = 'xhtml';
$includes = $conArr = $filecon = array();
$edit = array();
$eles = array();
$inc = 0;
$count = 0;
if ($_POST) {
// begin core
include_once('cleaner.php');
function cleanpost()
{
global $edit;
foreach ($_POST as $key => $post) {
$post = thecleaner($post);
if (preg_match("/^edit/", $key)) $edit[$key] = $post;
}
}
function loadfile($url, $incpath, $f)
{
global $message, $includes, $pagepath, $doctype, $encode, $edit;
$ssi = false;
$pagename = (strstr($url, $_SERVER['DOCUMENT_ROOT'])) ? explode($_SERVER['DOCUMENT_ROOT'], $url) : explode('../../', $url);
$pagename = trim($pagename[1], '/');
$pagename = str_ireplace('/', '-', $pagename);
$pagefile = $pagename;
if (@file_exists($url)) {
// read the file
$doc = fopen($url, "r");
$content = stream_get_contents($doc);
fclose($doc);
if ((!stristr($content, '<?php') && !strstr($content, '<%')) || ((preg_match('/>[^<]+</', $content) || preg_match('/<html/', $content)) && strstr($content, 'neocms'))) {
if (preg_match('/<!DOCTYPE[^>]*>/', $content)) {
preg_match_all('/<!DOCTYPE[^>]*>/', $content, $dtarr);
$doctype = $dtarr[0][0];
}
if (preg_match('/(?:<meta[^>]*charset=\"*)([^\"<]+)/', $stuff)) {
preg_match_all($charreg, $stuff, $enc);
$encode = $enc[1][0];
}
if ($f) cleanpost();
$elereg = '/<[^>]*class=(?:\"|\'|)[^>]*(\bneocms\b|\bneocmsRepeatArea\b)[^>]*?(?:\"|\'|)[^>]*>/';
$reginclude = '/(?:include\b|include_once\b|require\b|require_once\b)(?:\s*\(*[^;\?>]*)(?:\"|\')([^\"\'<>]*)(?:(\"|\')\)*(;|[\s\t\r\n]*\?>))/i'; // php include regexp
if (!preg_match($reginclude, $content)) $reginclude = '/(?:<!--#include\s(?:virtual|file)\=)(?:\"|\')([^\"\'<>]*)(?:\"|\')(?:\s*-->)/i'; // SSI regexp
// create a backup
$pageext = explode('.', $pagename);
$pagename = preg_replace('/(\.php|\.asp|\.html|\.htm|\.phtml|\.shtml|\.cfm)/', '', $pagename);
$backup = dirname(__FILE__) . '/../backups/' . $pagename . '_Bak.' . $pageext[1];
if (is_writable($url)) {
$backdoc = fopen($backup, "w+");
fwrite($backdoc, $content);
fclose($backdoc);
} else $message = '<strong>Error:</strong> You do not have permission to edit this page: <em>' . $pagefile . "</em>.";
// clean up content
if (preg_match($reginclude, $content)) {
preg_match_all($reginclude, $content, $includes[$url]);
$incArr = preg_split($reginclude, $content);
$incfiles = $includes[$url][1];
$neoCon = array();
foreach ($incArr as $k => $v) {
$docroot = $_SERVER['DOCUMENT_ROOT'];
if (@file_exists($docroot . $incfiles[$k]) && $incfiles[$k] != '') {
$neoCon[$k] = $v;
$incfile = $docroot . $incfiles[$k];
$incpath = false;
} elseif (!stristr($incfiles[$k], 'http://')) {
$neoCon[$k] = $v;
$incfile = "$pagepath/$incfiles[$k]";
if ($incpath) {
$incpathreg = str_replace('/', '\/', $incpath);
$incpathreg = '/(^' . $incpathreg . '\/|\/' . $incpathreg . '\/)/';
$incorigpath = preg_replace($incpathreg, '', $incfiles[$k], 1);
$newinc = "$pagepath/$incpath/$incorigpath";
$incfile = (@file_exists($newinc)) ? $newinc : $incfile;
$incpatharr = explode('/', $incorigpath);
array_pop($incpatharr);
$incpath = (sizeof($incpatharr) > 0) ? $incpath . implode('/', $incpatharr) : false;
} else {
$incpatharr = explode('/', $incfiles[$k]);
array_pop($incpatharr);
$incpath = (sizeof($incpatharr) > 0) ? $incpath . implode('/', $incpatharr) : false;
}
} else $incpath = false;
if (!preg_match('/\/$/', $incfile)) $neoCon[$incfile] = loadfile($incfile, $incpath, false);
}
return $neoCon;
} else return $content;
}
} else return false;
}
function output()
{
global $message;
$script = '<script language="javascript" type="text/javascript">window.top.window.saveFeedback("' . $message . '");</script>';
echo $script;
}
function conArray($content)
{
$conArray = false;
foreach ($content as $con) {
if (is_array($con)) $conArray = true;
}
return conArray;
}
function makeEdits($conpost)
{
global $edit, $eles, $inc, $count;
$commreg = '/<!--(.|\n|\r)*?-->/';
preg_match_all($commreg, $conpost, $comments);
$conpost = preg_replace($commreg, '<!--!COMMENT!-->', $conpost);
$elereg = '/<[^>]*class\s*=\s*(?:\"|\'|)[^\"|\']*(\bneocms\b|\bneocmsRepeatArea\b)[^\"|\'|=]*?(?:\"|\'|)[^>]*>/';
preg_match_all($elereg, $conpost, $neocmseles);
if ($neocmseles[0]) {
$newsplice = '';
foreach ($neocmseles[0] as $neocmsele) {
$splice = explode($neocmsele, $conpost, 2);
$newsplice = $splice[0];
$post = $splice[1];
$rest = '';
preg_match_all("/^<([^>\s]*)\b/i", $neocmsele, $eleTag);
$eleTag = $eleTag[1][0];
if (stristr($eleTag, 'img')) {
if (isset($edit["editImg$count"])) {
$editStr = array();
$editIncom = $edit["editImg$count"];
$editIncom = explode(',', $editIncom);
foreach ($editIncom as $eikey => $eipost) {
$eipost = explode('::', $eipost);
$editStr[$eipost[0]] = $eipost[1];
}
$editContent = '';
if (isset($editStr['link']) && $editStr['link'] != '') {
if (preg_match('/(<a[^>]*>)$/', $newsplice)) {
preg_match_all('/(<a[^>]*href=(?:\"|\'))([^\"\s]*)((?:\"|\')[^>]*>)$/', $newsplice, $lastlink);
$newlink = $lastlink[1][0] . $editStr['link'];
if ($editStr['rel'] != '') $newlink .= '" rel="' . $editStr['rel'];
$newlink .= $lastlink[3][0];
$newsplice = preg_replace('/(<a[^>]*>)$/', "$newlink", $newsplice);
} else {
$newsplice .= '<a href="' . $editStr['link'] . '"';
if ($editStr['rel'] != '') $newsplice .= ' rel="' . $editStr['rel'] . '"';
$newsplice .= '>';
$post = '</a>' . $post;
}
} else {
if (preg_match('/(<a[^>]*>)$/', $newsplice)) $newsplice = preg_replace('/(<a[^>]*>)$/', '', $newsplice);
if (preg_match('/^(<\/a>)/', $post)) $post = preg_replace('/^(<\/a>)/', '', $post);
}
$editContent .= '<img src="' . $editStr['src'] . '" alt="' . $editStr['alt'] . '"';
if ($editStr['class'] != '') $editContent .= ' class="' . $editStr['class'] . '"';
if ($editStr['width'] != '') $editContent .= ' width="' . $editStr['width'] . '"';
if ($editStr['height'] != '') $editContent .= ' height="' . $editStr['height'] . '"';
$editContent .= '/>';
} else $editContent = '';
$post = $editContent . $post;
} else {
$eleTagReg = '/<\/*' . $eleTag . '[^>]*>/i';
preg_match_all($eleTagReg, $post, $tags);
$contents = preg_split($eleTagReg, $post);
$track = 1;
foreach ($tags[0] as $tag) {
if (strpos($tag, '</') === 0) $track--;
else $track++;
array_shift($contents);
if ($track == 0) break;
else array_shift($tags[0]);
}
if (sizeof($tags[0]) > 1) {
foreach ($tags[0] as $tag) {
if (isset($edit["editVid$count"])) $rest .= $contents[0];
else $rest .= $tag . $contents[0];
array_shift($contents);
}
} else {
if (isset($edit["editVid$count"])) $rest = $contents[0];
else $rest = $tags[0][0] . $contents[0];
}
}
$neocmsele = preg_replace('/neocms\b|neocmsRepeatArea\b/', '$0--D0n3--', $neocmsele);
if (isset($edit["edit$count"])) $newsplice .= $neocmsele . "\n" . $edit["edit$count"] . "\n" . $rest;
elseif (isset($edit["editImg$count"]) && stristr($eleTag, 'img')) $newsplice .= $post;
elseif (isset($edit["editVid$count"]) && (stristr($eleTag, 'embed') || stristr($eleTag, 'object'))) $newsplice .= "\n" . $edit["editVid$count"] . "\n" . $rest;
elseif (sizeof($splice) <= 1) $newsplice .= $post;
else $newsplice .= $neocmsele . $post;
$conpost = $newsplice;
$count++;
$rest = '';
}
$newsplice = preg_replace('/--D0n3--/', '', $newsplice);
} else $newsplice = $conpost;
foreach ($comments[0] as $com) {
$newsplice = preg_replace('/<!--!COMMENT!-->/', $com, $newsplice, 1);
}
return $newsplice;
}
function editFile($content, $url)
{
global $message, $includes, $edit, $inc;
$fileedits = array();
if (is_array($content)) {
foreach ($content as $conkey => $conpost) {
if (is_array($conpost)) $content[$conkey] = editFile($conpost, $conkey);
else $content[$conkey] = makeEdits($conpost);
}
foreach ($content as $ckey => $cpost) {
if (preg_match('/^(\d+)$/', $ckey)) {
if (isset($includes[$url][0][$inc])) $fileedits[$url] .= $cpost . $includes[$url][0][$inc];
else $fileedits[$url] .= $cpost;
$inc++;
} else $fileedits["$ckey"] = $cpost;
}
} else $fileedits[$url] = makeEdits($content);
$inc = 0;
return $fileedits;
}
function cleanFilecon($files)
{
global $filecon;
foreach ($files as $fkey => $fpost) {
if (is_array($fpost)) cleanFilecon($fpost);
else {
if (!$filecon[$fkey]) $filecon[$fkey] = $fpost;
}
}
}
function flatten($ar)
{
$toflat = array($ar);
$res = array();
while (($r = array_shift($toflat)) !== NULL) {
foreach ($r as $v) {
if (is_array($v)) {
$toflat[] = $v;
} else {
$res[] = $v;
}
}
}
return $res;
}
$conArr = loadfile($pageurl, false, true);
if (is_array($conArr)) {
$missing = array_search(false, $conArr);
if ($conArr[$missing] == '') $missing = false;
} elseif ($conArr) $missing = false;
if ($missing === false) {
cleanFilecon(editFile($conArr, $pageurl));
if (preg_match('/successfully/', $message)) {
foreach ($filecon as $fkey => $fpost) {
if ($fpost != '') {
if (@file_exists($fkey)) {
if (is_writable($fkey)) {
$doc = fopen($fkey, "w");
fwrite($doc, $fpost);
fclose($doc);
} else $message = "<strong>Error:</strong> You do not have permission to edit this page.";
} else $message = '<strong>Error:</strong> neocms is unable find this page.';
}
}
}
} else $message = '<strong>Error:</strong> neocms is unable find this page: <em>' . $missing . '</em>';
output();
} else output();
}
} else {
$message = '<strong>Error:</strong> neocms is unable find your session.';
output();
}
?>
-25
View File
@@ -1,25 +0,0 @@
<?php
error_reporting(E_ALL & ~E_NOTICE);
@session_start();
if (isset($_SESSION['neoCMSSess']) && strstr($_SESSION['neoCMSSess'], 'neoCMSsession')) {
include_once('createsession.php');
if (isset($_SESSION['neoCMSUserid'])) {
$_SESSION['neoCMSHTML'] = $gethtml = "Y";
$_SESSION['neoCMSPath'] = $getpath = "cms";
$_SESSION['neoCMSFiles'] = $getfile = "Y";
$_SESSION['neoCMSFilePath'] = $getfilepath = "files";
$_SESSION['neoCMSImagePath'] = $getimagepath = "images";
$_SESSION['neoCMSExFolders'] = $getexfolders = "ext";
$_SESSION['neoCMSLatest'] = $_GET['neoCMSLatest'];
$script = '<script type="text/javascript">window.top.window.getGlobals("' . $getpath . '", "' . $gethtml . '", "' . $getfile . '", "' . $getfilepath . '", "' . $getexfolders . '", "' . $getimagepath . '");</script>';
echo $script;
}
}
-90
View File
@@ -1,90 +0,0 @@
<?php
//error_reporting (E_ALL & ~E_NOTICE);
@session_start();
if (isset($_SESSION['neoCMSSess']) && strstr($_SESSION['neoCMSSess'], 'neoCMSsession')) {
include_once('urldissect.php');
include_once('createsession.php');
if (!empty($_POST) && isset($_SESSION['neoCMSUserid'])) {
if ($_GET['type'] == 'img') {
$file = $_FILES['neoCMSImgUpload'];
$uploaddir = ($_POST['neoCMSImgFolder']) ? '../..' . $_POST['neoCMSImgFolder'] : '../../';
$uploaddir = ($_SESSION['neoCMSImagePath']) ? '../../' . $_SESSION['neoCMSImagePath'] : $uploaddir;
$uploadfile = $uploaddir . basename($file['name']);
if (!@file_exists($uploadfile) || $_GET['over']) {
$fileName = $file['name'];
$fileSize = $file['size'];
$alert = "<strong>Error:</strong> There was an error uploading your image. Please try again.";
list($fileWidth, $fileHeight) = getimagesize($file['tmp_name']);
if (preg_match('/(.jpg|.png|.gif)$/i', $fileName) && $fileSize < 5000000) {
if (move_uploaded_file($file['tmp_name'], $uploadfile)) {
$alert = "Your file was successfully uploaded.";
}
} else {
$alert = "<strong>Error:</strong> You may only upload <strong>.jpg</strong>, <strong>.gif</strong>, or <strong>.png</strong> image files, under <strong>5.0 MB</strong> in size.";
$fileName = "";
}
$script = '<script language="javascript" type="text/javascript">window.top.window.imageInfo("' . $fileSize . '", "' . $fileWidth . '", "' . $fileHeight . '", "' . $alert . '", "' . $fileName . '", "' . str_replace('../../', '', $uploaddir) . '" );</script>';
echo $script;
} else {
$script = '<script language="javascript" type="text/javascript">window.top.window.imageOverwritePrompt();</script>';
echo $script;
}
} else {
$file = $_FILES['neoCMSUpload'];
$uploaddir = ($_POST['neoCMSFolder']) ? '../..' . $_POST['neoCMSFolder'] : '../../';
$uploaddir = ($_SESSION['neoCMSFilePath']) ? '../../' . $_SESSION['neoCMSFilePath'] : $uploaddir;
$uploadfile = $uploaddir . basename($file['name']);
if (!@file_exists($uploadfile) || $_GET['over']) {
$fileName = $file['name'];
$fileSize = $file['size'];
$alert = "<strong>Error:</strong> There was an error uploading your image. Please try again.";
if (!preg_match('/(\.html|\.php|\.js|\.css|\.htm|\.shtml|\.asp|\.cfm|\.phtml)$/i', $fileName) && $fileSize < 100000000) {
if (move_uploaded_file($file['tmp_name'], $uploadfile)) {
$alert = "Your file was successfully uploaded.";
} else {
$alert = "<strong>Error:</strong> You do not have permission to upload files to this folder.";
$fileName = "";
}
} else {
$alert = "<strong>Error:</strong> You may not upload <strong>.html</strong>, <strong>.htm</strong>, <strong>.php</strong>, <strong>.js</strong>, or <strong>.css</strong> files, under <strong>100 MB</strong> in size.";
$fileName = "";
}
$script = '<script language="javascript" type="text/javascript">window.top.window.fileInfo("' . $fileSize . '", "' . $alert . '", "' . $fileName . '", "' . str_replace('../../', '', $uploaddir) . '" );</script>';
echo $script;
} else {
$script = '<script language="javascript" type="text/javascript">window.top.window.filePrompt();</script>';
echo $script;
}
}
}
}
-19
View File
@@ -1,19 +0,0 @@
<?php
function urldissect($url, $file, $negoff)
{
$scr = $_SERVER['SCRIPT_NAME'];
$url = explode('/', $url);
if ($file) return array_pop($url);
elseif ($negoff) {
$i = 0;
while ($i < $negoff) {
array_pop($url);
$i++;
}
}
return implode('/', $url) . '/';
}
+102
View File
@@ -0,0 +1,102 @@
html,
body {
height: 100%;
margin: 0;
}
.pageContainer {
display: flex;
flex-flow: column;
height: 100%;
}
.pageContainer .controls {
flex: 0 1 auto;
height: 70px;
background-color: #666666;
border-bottom: 1px solid #1a1a1a;
-webkit-box-shadow: 0px 10px 13px -7px #000000, -1px -1px 15px 5px rgba(0, 0, 0, 0);
box-shadow: 0px 10px 13px -7px #000000, -1px -1px 15px 5px rgba(0, 0, 0, 0);
}
.pageContainer .frame {
flex: 1 1 auto;
border: 0;
}
.controls .logo {
background-image: url("/cms/img/logo.png");
width: 128px;
height: 70px;
display: block;
position: absolute;
}
.controls .buttonContainer {
width: 400px;
margin: 18px auto;
}
.controls .loggedInDetails {
position: absolute;
top: 25px;
right: 10px;
}
.controls .buttonContainer ul {
list-style-type: none;
margin: 0;
padding: 0;
}
.controls .buttonContainer li {
display: inline;
margin-right: 10px;
}
.blueButton {
box-shadow: inset 0px 0px 15px 3px #23395e;
background: linear-gradient(to bottom, #2e466e 5%, #415989 100%);
background-color: #2e466e;
border-radius: 17px;
border: 1px solid #1f2f47;
display: inline-block;
cursor: pointer;
color: #ffffff;
font-family: Arial;
font-size: 15px;
padding: 6px 13px;
text-decoration: none;
text-shadow: 0px 1px 0px #263666;
}
.blueButton:hover {
background: linear-gradient(to bottom, #415989 5%, #2e466e 100%);
background-color: #415989;
}
.greenButton {
box-shadow: inset 0px 0px 15px 3px #3e7327;
background: linear-gradient(to bottom, #77b55a 5%, #72b352 100%);
background-color: #77b55a;
border-radius: 17px;
border: 1px solid #4b8f29;
display: inline-block;
cursor: pointer;
color: #ffffff;
font-family: Arial;
font-size: 15px;
padding: 6px 13px;
text-decoration: none;
text-shadow: 0px 1px 0px #5b8a3c;
}
.greenButton:hover {
background: linear-gradient(to bottom, #72b352 5%, #77b55a 100%);
background-color: #72b352;
}
.greenButton:active {
position: relative;
top: 1px;
}
-588
View File
@@ -1,588 +0,0 @@
/* NORMALIZATION STYLES --------------------------------------------- */
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-size: 100%;
vertical-align: baseline;
background: transparent;
text-align: left;
}
body {
line-height: 1;
font-size: 62.5%;
text-align: center;
color: #333;
font-family: Arial, Helvetica, sans-serif;
}
h1, h2, h3, h4, h5, h6 {
font-weight: normal;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
abbr, acronym {
border-bottom: 1px dashed #999;
cursor: help;
}
:focus {
outline: 0;
}
ins {
text-decoration: none;
}
del {
text-decoration: line-through;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
html, body {
height: 100%;
width: 100%;
overflow: hidden;
}
/* LOGIN STYLES --------------------------------------------- */
#neoCMSPromptWrap {
position: absolute;
height: 100%;
width: 100%;
top: 0;
left: 0;
z-index: 350;
display: block;
background: none;
}
.neoCMSLoginWrap {
position: relative;
border: 1px solid;
border-color: #666 #000 #000 #000;
margin: 7% auto 0;
padding: 20px 20px 40px;
width: 542px;
z-index: 10000;
display: none;
-moz-box-shadow: 0 0 10px #666;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
overflow: hidden;
background: #000;
}
.neoCMSLoginWrap h1.logo {
height: 73px;
background: #000 url(../images/neocms_sprite1.png) no-repeat -813px -47px;
margin: 0 auto 19px;
width: 537px;
text-indent: -5000px;
display: block;
overflow: hidden;
}
.neoCMSLoginWrap h2 {
color: #fff;
margin-bottom: 20px;
font-size: 14px;
}
.neoCMSLoginConfig {
margin: 0 auto 20px;
text-align: left;
width: 535px;
display: inline;
}
.neoCMSLoginConfig li {
margin: 0;
display: block;
padding: 0 0 2px;
}
.neoCMSLoginConfig li a {
background: url(../images/prompt.gif) repeat-x left bottom #666;
height: 28px;
display: block;
padding: 12px 0 0 20px;
font-size: 1.4em;
color: #ccc;
text-decoration: none;
position: relative;
}
.neoCMSLoginConfig li a strong {
color: #fff;
}
.neoCMSLoginConfig li a span {
background: url(../images/neocms_sprite1.png) no-repeat;
background-position: -689px 0;
height: 22px;
width: 90px;
overflow: hidden;
display: block;
position: absolute;
right: 10px;
text-indent: -5000px;
top: 9px;
}
.neoCMSLoginConfig li a:hover {
background: #fff;
color: #666;
}
.neoCMSLoginConfig li a:hover strong {
color: #82ac3f;
}
.neoCMSAppInfo {
margin: 0;
padding: 0;
float: left;
background: transparent;
text-align: left;
width: 252px;
display: inline;
}
.neoCMSAppInfo p {
padding: 0;
margin: 0;
font-size: 11px;
text-align: left;
color: #ccc;
line-height: 1.3em;
}
.neoCMSAppInfo p a:link, .neoCMSAppInfo p a:visited {
color: #82ac3f;
text-decoration: none;
}
.neoCMSAppInfo p a:hover {
color: #fff;
text-decoration: underline;
}
p.neoCMSTopBorder {
margin-top: 15px;
padding-top: 15px;
padding-bottom: 15px;
border-top: 1px solid #333;
}
.neoCMSLoginCont {
float: left;
margin: 0 0 0 21px;
padding: 0;
width: 260px;
height: 135px;
display: inline;
position: relative;
}
.neoCMSLoginCont form {
margin: 0;
padding: 0;
width: 260px;
}
.neoCMSLoginCont fieldset {
margin: 0;
padding: 0;
border: none;
}
.neoCMSLoginCont legend, .neoCMSLogin h1 {
margin: 0;
padding: 0 0 5px;
color: #fff;
font-size: 15px;
font-weight: bold;
width: 257px;
}
.neoCMSLogin h1 {
padding: 0 0 5px;
margin: 0 auto 10px;
width: auto;
display: block;
width: 535px;
}
.neoCMSLoginCont ol {
margin: 0;
padding: 10px 0 0;
list-style: none;
border-top: 1px solid #333;
}
.neoCMSLoginCont li {
margin: 0;
padding: 0;
color: #fff;
}
li#neoCMSEnter {
padding-top: 13px;
font-size: 11px;
display: block;
}
li#neoCMSEnter p {
float: left;
width: auto;
line-height: 22px;
}
li p.error {
display: none;
color: #f00;
font-style: italic;
margin-left: 10px;
}
li#neoCMSEnter p.invalid {
clear: both;
margin: 5px 0 0 0;
width: 257px;
}
li#neoCMSEnter a:link, li#neoCMSEnter a:visited {
color: #82ac3f;
text-decoration: none;
margin-left: 20px;
display: inline;
line-height: 22px;
}
li#neoCMSEnter p.invalid a {
margin-left: 0;
}
li#neoCMSEnter a:hover {
color: #fff;
text-decoration: underline;
}
.neoCMSLoginCont label {
font-size: 12px;
line-height: 18px;
}
input.neoCMSInput {
width: 183px;
padding: 2px;
background: #fff;
border: none;
}
#neoCMSPromptBtn, #neoCMSSubmitBtn, #neoCMSLoginBtn, #neoCMSPrefBtn, #neoCMSAutoUpdate, .userSave, #neoCMSFTPBtn, #neoCMSConfigRetry {
float: left;
padding: 0;
width: 57px;
height: 22px;
line-height: 22px;
display: block;
background: url(../images/neocms_sprite1.png) no-repeat -1221px 0;
text-indent: 0;
text-align: center;
border: 0;
margin: 0;
font-size: 12px;
cursor: pointer;
color: #fff !important;
text-decoration: none !important;
}
.userSave {
float: none;
margin: 10px 0 0 113px;
}
#neoCMSAutoUpdate {
background-position: -1149px -22px;
width: 71px;
margin: 0 10px 0 0 !important;
position: relative;
top: -5px;
color: #333 !important;
}
#neoCMSSubmitBtn, #neoCMSLoginBtn {
margin-top: 0;
padding-bottom: 3px;
}
#neoCMSLoginWrap #neoCMSSubmitBtn {
margin-top: 5px;
}
#neoCMSPromptBtn:hover, #neoCMSSubmitBtn:hover, #neoCMSLoginBtn:hover, #neoCMSAutoUpdate:hover, .userSave:hover, #neoCMSConfigRetry:hover {
background-position: -1221px -22px;
color: #000 !important;
text-decoration: none !important;
}
#neoCMSAutoUpdate:hover {
background-position: -1279px -22px;
}
#neoCMSPrefBtn:hover, #neoCMSFTPBtn:hover {
background-position: -1164px 0;
color: #000 !important;
text-decoration: none;
}
div.forgotLogin {
background: #000;
padding: 4px 0 10px;
*padding: 7px 0 10px;
position: absolute;
top: 69px;
*top: 75px;
left: 0;
width: 257px;
display: none;
}
div.forgotLogin p {
color: #ccc;
margin: 0 0 10px;
font-size: 11px;
line-height: 14px;
}
div.forgotLogin p a {
color: #82ac3f;
float: left;
margin: 5px 0 0 20px;
text-decoration: none;
line-height: 22px;
}
div.forgotLogin p a:hover {
color: #82ac3f;
text-decoration: underline;
}
div.forgotLogin p.message {
color: #82ac3f;
display: none;
clear: both;
width: auto;
margin: 10px 0 0 0;
}
#neoCMSPageSrc {
width: 100%;
height: 100%;
z-index: 0;
position: relative;
top: 0 !important;
left: 0;
margin: 0 !important;
padding: 0;
overflow: visible;
border: none !important;
display: block;
*zoom: 1; /* ie7 */
}
div#overlay, div#overlayEditWrap {
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
display: none;
z-index: 100;
}
div#overlay {
background: #eee;
}
div#overlayEditWrap {
display: block;
}
/* FILE BROWSER STYLES --------------------------------------------- */
#neoCMSFilesWrap {
position: absolute;
height: 100%;
width: 100%;
top: 0;
left: 0;
z-index: 351;
display: block;
background: none;
overflow: auto;
}
#neoCMSFiles {
border: 1px solid;
border-color: #eee #ddd #bbb #ddd;
*border-color: #eee #ccc #999 #ccc;
position: relative;
display: block;
margin: 0 auto;
background: #ddd;
padding: 10px 20px 20px;
width: 314px;
top: 100px;
font-size: 1.2em;
z-index: 10;
-moz-border-radius: 14px;
-webkit-border-radius: 14px;
-moz-box-shadow: 0 0 10px #666;
}
.clear {
clear: left;
}
div.neoCMSFiles h2 {
color: #666;
padding: 10px 0 0;
margin: 0 0 15px;
font-size: 1.1em;
}
#neoCMSFClose {
float: right;
padding: 10px 0 0;
color: #82ac3f;
}
#filesTab {
display: none;
overflow: hidden;
margin: 0 0 -1px 1px;
position: relative;
z-index: 10;
}
#filesTab li {
display: block;
float: left;
margin-right: 3px;
}
#filesTab li a {
display: block;
color: #000;
padding: 7px 10px 3px;
font-size: 12px;
text-decoration: none;
background: #bbb;
-moz-border-radius-topleft: 10px;
-moz-border-radius-topright: 10px;
-webkit-border-top-left-radius: 10px;
-webkit-border-top-right-radius: 10px;
}
#filesTab li.on a {
background: #fff;
color: #888;
}
#neoCMSFileULs {
height: 300px;
padding: 0;
overflow: auto;
background: #fff;
border: 1px solid;
border-color: #ccc #ddd #eee #ddd;
display: block;
position: relative;
}
#neoCMSFileULs ul {
margin: 0;
padding-top: 15px;
position: relative;
}
#neoCMSFileULs li {
padding: 7px 10px;
cursor: pointer;
line-height: 1.2em;
overflow: hidden;
position: relative;
}
#neoCMSFileULs li div.mask {
height: 15px;
width: 20px;
float: left;
margin: 0 10px 0 0;
overflow: hidden;
display: block;
position: relative;
text-align: center;
}
#neoCMSFileULs li img {
height: 100%;
width: auto;
border: 1px solid #ddd;
margin: 0 auto;
position: relative;
}
#neoCMSFileULs li p {
display: block;
float: left;
width: 245px;
}
#neoCMSFileULs li:hover {
background: #82ac3f;
color: #fff;
}
div.disabled {
opacity: 0.3 !important;
}
/* FLOAT CLEARING STYLES
------------------------------------------------------------------------ */
.clearfix:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
.clearfix {
display: inline-block;
}
/* Hide from IE Mac \*/
.clearfix {
display: block;
}
/* End hide from IE Mac */
-2735
View File
File diff suppressed because it is too large Load Diff
+65
View File
@@ -0,0 +1,65 @@
/* General Styles */
body {
margin: 0;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: #f9f9f9;
color: #333;
}
/* Header Styles */
header {
background-color: #1b6ac9;
padding: 20px;
text-align: center;
}
.logo {
height: 80px;
}
/* Main Content Styles */
main {
text-align: center;
padding: 60px 20px;
}
h1 {
font-size: 2.5em;
color: #1b6ac9;
margin-bottom: 20px;
}
p {
font-size: 1.1em;
line-height: 1.6;
max-width: 700px;
margin: 10px auto;
}
/* Button Styles */
.button {
display: inline-block;
margin-top: 30px;
padding: 15px 30px;
background-color: #1b6ac9;
color: #fff;
text-decoration: none;
font-size: 1em;
border-radius: 5px;
transition: background-color 0.3s ease;
}
.button:hover {
background-color: #155a9c;
}
/* Footer Styles */
footer {
background-color: #333;
color: #fff;
padding: 15px 0;
text-align: center;
position: fixed;
width: 100%;
bottom: 0;
}
+49
View File
@@ -0,0 +1,49 @@
<?php
// Allowed MIME types
$allowed_types = ['image/jpeg', 'image/png', 'image/gif'];
// Check if a file has been uploaded
if (isset($_FILES['file'])) {
$file = $_FILES['file'];
// Validate the file type
$finfo = finfo_open(FILEINFO_MIME_TYPE);
$mime_type = finfo_file($finfo, $file['tmp_name']);
finfo_close($finfo);
if (!in_array($mime_type, $allowed_types)) {
http_response_code(400);
echo json_encode(['error' => 'Invalid file type.']);
exit;
}
// Set the upload directory
$upload_dir = '../uploads/';
// Ensure the upload directory exists
if (!is_dir($upload_dir)) {
mkdir($upload_dir, 0777, true);
}
// Generate a unique name for the image
$extension = pathinfo($file['name'], PATHINFO_EXTENSION);
$filename = uniqid() . '.' . $extension;
// Set the target file path
$target_file = $upload_dir . $filename;
// Move the uploaded file to the target directory
if (move_uploaded_file($file['tmp_name'], $target_file)) {
// Return a JSON response with the image location
$location = $target_file;
echo json_encode(['location' => $location]);
} else {
// Return an error response
http_response_code(500);
echo json_encode(['error' => 'Failed to move uploaded file.']);
}
} else {
// No file was uploaded
http_response_code(400);
echo json_encode(['error' => 'No file uploaded.']);
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 676 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 651 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

+48 -61
View File
@@ -1,77 +1,64 @@
<?php <?php
@session_start(); require_once "neoCMSCore.php";
require_once "init.php";
if (isset($_SESSION['neoCMSSess'])) {
@session_name($_SESSION['neoCMSSess']);
@session_start();
if (isset($_SESSION['neoCMSUserid'])) {
$user = &$_SESSION['neoCMSUserid'];
$admin = &$_SESSION['neoCMSIsadmin'];
$sess = &$_SESSION['neoCMSSess'];
} else header("Location:./login.php");
} else header("Location:./login.php");
$page = (isset($_SESSION['neoCMSCurpage'])) ? $_SESSION['neoCMSCurpage'] : "../";
?> ?>
<!DOCTYPE html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>NeoCMS</title>
<meta name="robots" content="noindex"/> <!-- Include jQuery -->
<link rel="shortcut icon" href="images/icon.png"/> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<link rel="apple-touch-icon-precomposed" href="images/apple-touch-icon-precomposed.png"/> <!-- Include TinyMCE -->
<title>neoCMS</title> <script src="/cms/tinymce/tinymce.min.js"></script>
<!-- Include Bootstrap for modal -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<script type="text/javascript" src="js/lib/jquery.js"></script> <!-- Include editor styles -->
<script type="text/javascript" src="js/lib/jquery-ui.js"></script> <link rel="stylesheet" href="/cms/css/editor.css">
<script type="text/javascript" src="js/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript" src="js/codemirror/js/codemirror.js"></script>
<script type="text/javascript" src="js/main.js"></script>
<script type="text/javascript" src="js/ui.js"></script>
<link href="css/main.css" rel="stylesheet" type="text/css"/>
<link href="css/ui.css" rel="stylesheet" type="text/css"/>
<!-- Include Bootstrap JS -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
</head> </head>
<body> <body>
<div id="neoCMSFrameShim"></div> <div class="pageContainer">
<div class="controls">
<div id="neoCMSTopBanner" class="neoCMSTopBanner"> <div class="logo"></div>
<div class="neoCMSHeader"> <div class="buttonContainer">
<ul class="neoCMSTopNav"> <ul>
<li id="neoCMSUndo"><a title="Cannot Undo at this time" href="javascript:">Undo</a></li> <li><a href="#" id="selectPage" class="blueButton">Select Page</a></li>
<li id="neoCMSRedo"><a title="Cannot Redo at this time" href="javascript:">Redo</a></li> <li><a href="#" id="newPage" class="blueButton">New Page</a></li>
<li id="neoCMSCxl"><a title="Cannot Cancel All at this time" href="javascript:">Cancel All</a></li> <li><a href="#" id="savePage" class="greenButton">Save Changes</a></li>
<li id="neoCMSRestore"><a title="Restore to the last published version" href="javascript:">Restore</a>&middot;
</li>
<li id="neoCMSPublish"><a title="You must make edits before publishing" href="javascript:">Publish</a></li>
</ul> </ul>
</div>
<div class="loggedInDetails">
Logged in as: <?php echo $_SESSION["core"]->getLoggedinUser(); ?>
</div>
</div>
<iframe id="frameContainer" src="welcome.html" class="frame"></iframe>
</div>
<!-- Modal -->
<div id="editModal" class="modal fade" role="dialog">
<div class="modal-dialog modal-lg">
<h1><a id="neoCMSHome" href="javascript:" title="Go to your homepage">neocms</a></h1> <!-- Modal content-->
<div class="modal-content">
<ul class="neoCMSInfo"> <div class="modal-header">
<li id="neoCMSLogout"><a title="Logout of neocms" href="javascript:">logout</a>&middot;</li> <h4 class="modal-title">Edit Content</h4>
<?php if ($admin == 'Y') : ?> </div>
<li id="neoCMSDashboard"><a title="Change your preferences, edit users, or enter your FTP info" <div class="modal-body">
href="javascript:">settings</a>&middot; <textarea id="editor"></textarea>
</li><?php endif; ?> </div>
<li><a class="neoCMSFBrowse" rel="#neoCMSPages" title="Choose a page to edit" href="javascript:">pages</a> <div class="modal-footer">
</li> <button id="saveBtn" class="btn btn-primary">Save</button>
</ul> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div> </div>
</div> </div>
<iframe id="neoCMSPageSrc" name="neoCMSPageSrc" marginheight="0" align="top" frameborder="0" src="<?php echo $page; ?>" </div>
application="yes"></iframe> </div>
<script src="/cms/js/cms.js"></script>
</body> </body>
</html> </html>
+56
View File
@@ -0,0 +1,56 @@
<?php
/*
* Authentication stores the usernames and passwords for people to be able to use the CMS.
* This will be used as well to write to the audit log once it has been implemented in code.
*/
$authentication = [
"admin" => "password",
"editor" => "password",
];
/**
* DO NOT CHANGE ANYTHING BENEATH THIS LINE - IT WILL BUGGER STUFF UP
*/
session_start();
require_once "neoCMSCore.php";
if (empty($_SESSION["core"])) {
$_SESSION["core"] = new neoCMSCore();
$_SESSION["core"]->users = $authentication;
}
if (!$_SESSION["core"]->isLoggedIn() && stripos($_SERVER['REQUEST_URI'], "/login") === FALSE) {
header('Location: /cms/login');
die("Redirecting to login..");
}
// str_starts_with compatibility for php 7
if (!function_exists('str_starts_with')) {
function str_starts_with($haystack, $needle)
{
//str_starts_with(string $haystack, string $needle): bool
$strlen_needle = mb_strlen($needle);
if (mb_substr($haystack, 0, $strlen_needle) == $needle) {
return true;
}
return false;
}
}
//str_ends_with compatibility for php 7
if (!function_exists('str_ends_with')) {
function str_ends_with($haystack, $needle)
{
//str_starts_with(string $haystack, string $needle): bool
$strlen_needle = mb_strlen($needle);
if (mb_substr($haystack, -$strlen_needle, $strlen_needle) == $needle) {
return true;
}
return false;
}
}
$_SESSION["core"]->version = '2.00';
+81
View File
@@ -0,0 +1,81 @@
$(document).ready(function () {
var currentDiv;
var iframeDoc;
$('#frameContainer').on('load', function () {
// Get the iframe document
var iframe = document.getElementById('frameContainer');
iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
// Set up click handler on divs with class 'editable' in the iframe
$(iframeDoc).find('.editable').css('cursor', 'pointer').click(function (event) {
event.preventDefault();
currentDiv = $(this);
// Get the content of the div
var content = currentDiv.html();
// Set the content in TinyMCE
$('#editor').val(content);
// Open the modal
$('#editModal').modal('show');
// Initialize TinyMCE when the modal is shown
$('#editModal').on('shown.bs.modal', function () {
tinymce.init({
promotion: false,
branding: false,
selector: '#editor',
height: 300,
plugins: 'print preview paste importcss searchreplace autolink autosave save directionality code visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists wordcount textpattern noneditable help charmap quickbars emoticons',
toolbar: 'undo redo | bold italic underline strikethrough | fontselect fontsizeselect formatselect | alignleft aligncenter alignright alignjustify | outdent indent | numlist bullist | forecolor backcolor removeformat | pagebreak | charmap emoticons | fullscreen preview save print | insertfile image media template link anchor codesample | ltr rtl',
images_upload_url: '/cms/image_upload.php', // URL of your server-side script
automatic_uploads: true,
images_reuse_filename: false,
images_upload_credentials: true,
force_br_newlines: false,
force_p_newlines: false,
forced_root_block: '',
setup: function (editor) {
editor.on('init', function (e) {
editor.setContent(content);
});
}
});
});
});
});
$('#saveBtn').click(function () {
// Get the data from TinyMCE
var data = tinymce.get('editor').getContent();
// Set the data back to the div in the iframe
$(currentDiv).html(data);
// Close the modal
$('#editModal').modal('hide');
});
// Clean up TinyMCE when modal is closed
$('#editModal').on('hidden.bs.modal', function () {
if (tinymce.get('editor')) {
tinymce.get('editor').remove();
}
});
$('#savePage').click(() => {
$.post("./controller/", {
action: "save",
uri: $('#frameContainer').contents().get(0).location.pathname,
content: new XMLSerializer().serializeToString($('#frameContainer').contents().get(0))
}, function (data) {
alert(data)
});
});
});
-47
View File
@@ -1,47 +0,0 @@
.editbox {
margin: .4em;
padding: 0;
font-family: monospace;
font-size: 10pt;
color: black;
}
pre.code, .editbox {
color: #666666;
}
.editbox p {
margin: 0;
}
span.css-at {
color: #770088;
}
span.css-unit {
color: #228811;
}
span.css-value {
color: #770088;
}
span.css-identifier {
color: black;
}
span.css-important {
color: #0000FF;
}
span.css-colorcode {
color: #004499;
}
span.css-comment {
color: #AA7700;
}
span.css-string {
color: #AA2222;
}
-55
View File
@@ -1,55 +0,0 @@
.editbox {
margin: .4em;
padding: 0;
font-family: monospace;
font-size: 10pt;
color: black;
}
pre.code, .editbox {
color: #666666;
}
.editbox p {
margin: 0;
}
span.js-punctuation {
color: #666666;
}
span.js-operator {
color: #666666;
}
span.js-keyword {
color: #770088;
}
span.js-atom {
color: #228811;
}
span.js-variable {
color: black;
}
span.js-variabledef {
color: #0000FF;
}
span.js-localvariable {
color: #004499;
}
span.js-property {
color: black;
}
span.js-comment {
color: #AA7700;
}
span.js-string {
color: #AA2222;
}
-51
View File
@@ -1,51 +0,0 @@
.editbox {
margin: .4em;
padding: 0;
font-family: monospace;
font-size: 10pt;
color: black;
}
.editbox p {
margin: 0;
}
span.xml-tagname {
color: #A0B;
}
span.xml-attribute {
color: #281;
}
span.xml-punctuation {
color: black;
}
span.xml-attname {
color: #00F;
}
span.xml-comment {
color: #A70;
}
span.xml-cdata {
color: #48A;
}
span.xml-processing {
color: #999;
}
span.xml-entity {
color: #A22;
}
span.xml-error {
color: #F00;
}
span.xml-text {
color: black;
}
-474
View File
@@ -1,474 +0,0 @@
/* CodeMirror main module
*
* Implements the CodeMirror constructor and prototype, which take care
* of initializing the editor frame, and providing the outside interface.
*/
// The CodeMirrorConfig object is used to specify a default
// configuration. If you specify such an object before loading this
// file, the values you put into it will override the defaults given
// below. You can also assign to it after loading.
var CodeMirrorConfig = window.CodeMirrorConfig || {};
var CodeMirror = (function () {
function setDefaults(object, defaults) {
for (var option in defaults) {
if (!object.hasOwnProperty(option))
object[option] = defaults[option];
}
}
function forEach(array, action) {
for (var i = 0; i < array.length; i++)
action(array[i]);
}
// These default options can be overridden by passing a set of
// options to a specific CodeMirror constructor. See manual.html for
// their meaning.
setDefaults(CodeMirrorConfig, {
stylesheet: "",
path: "",
parserfile: [],
basefiles: ["util.js", "stringstream.js", "select.js", "undo.js", "editor.js", "tokenize.js"],
iframeClass: null,
passDelay: 200,
passTime: 50,
lineNumberDelay: 200,
lineNumberTime: 50,
continuousScanning: false,
saveFunction: null,
onChange: null,
undoDepth: 50,
undoDelay: 800,
disableSpellcheck: true,
textWrapping: true,
readOnly: false,
width: "",
height: "300px",
autoMatchParens: false,
parserConfig: null,
tabMode: "indent", // or "spaces", "default", "shift"
reindentOnLoad: false,
activeTokens: null,
cursorActivity: null,
lineNumbers: false,
indentUnit: 2
});
function addLineNumberDiv(container) {
var nums = document.createElement("DIV"),
scroller = document.createElement("DIV");
nums.style.position = "absolute";
nums.style.height = "100%";
if (nums.style.setExpression) {
try {
nums.style.setExpression("height", "this.previousSibling.offsetHeight + 'px'");
} catch (e) {
} // Seems to throw 'Not Implemented' on some IE8 versions
}
nums.style.top = "0px";
nums.style.overflow = "hidden";
container.appendChild(nums);
scroller.className = "CodeMirror-line-numbers";
nums.appendChild(scroller);
return nums;
}
function CodeMirror(place, options) {
// Backward compatibility for deprecated options.
if (options.dumbTabs) options.tabMode = "spaces";
else if (options.normalTab) options.tabMode = "default";
// Use passed options, if any, to override defaults.
this.options = options = options || {};
setDefaults(options, CodeMirrorConfig);
var frame = this.frame = document.createElement("IFRAME");
if (options.iframeClass) frame.className = options.iframeClass;
frame.frameBorder = 0;
frame.src = "javascript:false;";
frame.style.border = "0";
frame.style.width = '100%';
frame.style.height = '100%';
// display: block occasionally suppresses some Firefox bugs, so we
// always add it, redundant as it sounds.
frame.style.display = "block";
var div = this.wrapping = document.createElement("DIV");
div.style.position = "relative";
div.className = "CodeMirror-wrapping";
div.style.width = options.width;
div.style.height = options.height;
if (place.appendChild) place.appendChild(div);
else place(div);
div.appendChild(frame);
if (options.lineNumbers) this.lineNumbers = addLineNumberDiv(div);
// Link back to this object, so that the editor can fetch options
// and add a reference to itself.
frame.CodeMirror = this;
this.win = frame.contentWindow;
if (typeof options.parserfile == "string")
options.parserfile = [options.parserfile];
if (typeof options.stylesheet == "string")
options.stylesheet = [options.stylesheet];
var html = ["<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\"><html><head>"];
// Hack to work around a bunch of IE8-specific problems.
html.push("<meta http-equiv=\"X-UA-Compatible\" content=\"IE=EmulateIE7\"/>");
forEach(options.stylesheet, function (file) {
html.push("<link rel=\"stylesheet\" type=\"text/css\" href=\"" + file + "\"/>");
});
forEach(options.basefiles.concat(options.parserfile), function (file) {
html.push("<script type=\"text/javascript\" src=\"" + options.path + file + "\"><" + "/script>");
});
html.push("</head><body style=\"border-width: 0;\" class=\"editbox\" spellcheck=\"" +
(options.disableSpellcheck ? "false" : "true") + "\"></body></html>");
var doc = this.win.document;
doc.open();
doc.write(html.join(""));
doc.close();
}
CodeMirror.prototype = {
init: function () {
if (this.options.initCallback) this.options.initCallback(this);
if (this.options.lineNumbers) this.activateLineNumbers();
if (this.options.reindentOnLoad) this.reindent();
},
getCode: function () {
return this.editor.getCode();
},
setCode: function (code) {
this.editor.importCode(code);
},
selection: function () {
this.focusIfIE();
return this.editor.selectedText();
},
reindent: function () {
this.editor.reindent();
},
reindentSelection: function () {
this.focusIfIE();
this.editor.reindentSelection(null);
},
focusIfIE: function () {
// in IE, a lot of selection-related functionality only works when the frame is focused
if (this.win.select.ie_selection) this.focus();
},
focus: function () {
this.win.focus();
if (this.editor.selectionSnapshot) // IE hack
this.win.select.setBookmark(this.win.document.body, this.editor.selectionSnapshot);
},
replaceSelection: function (text) {
this.focus();
this.editor.replaceSelection(text);
return true;
},
replaceChars: function (text, start, end) {
this.editor.replaceChars(text, start, end);
},
getSearchCursor: function (string, fromCursor, caseFold) {
return this.editor.getSearchCursor(string, fromCursor, caseFold);
},
undo: function () {
this.editor.history.undo();
},
redo: function () {
this.editor.history.redo();
},
historySize: function () {
return this.editor.history.historySize();
},
clearHistory: function () {
this.editor.history.clear();
},
grabKeys: function (callback, filter) {
this.editor.grabKeys(callback, filter);
},
ungrabKeys: function () {
this.editor.ungrabKeys();
},
setParser: function (name) {
this.editor.setParser(name);
},
setSpellcheck: function (on) {
this.win.document.body.spellcheck = on;
},
setTextWrapping: function (on) {
if (on == this.options.textWrapping) return;
this.win.document.body.style.whiteSpace = on ? "" : "nowrap";
this.options.textWrapping = on;
if (this.lineNumbers) {
this.setLineNumbers(false);
this.setLineNumbers(true);
}
},
setIndentUnit: function (unit) {
this.win.indentUnit = unit;
},
setUndoDepth: function (depth) {
this.editor.history.maxDepth = depth;
},
setTabMode: function (mode) {
this.options.tabMode = mode;
},
setLineNumbers: function (on) {
if (on && !this.lineNumbers) {
this.lineNumbers = addLineNumberDiv(this.wrapping);
this.activateLineNumbers();
} else if (!on && this.lineNumbers) {
this.wrapping.removeChild(this.lineNumbers);
this.wrapping.style.marginLeft = "";
this.lineNumbers = null;
}
},
cursorPosition: function (start) {
this.focusIfIE();
return this.editor.cursorPosition(start);
},
firstLine: function () {
return this.editor.firstLine();
},
lastLine: function () {
return this.editor.lastLine();
},
nextLine: function (line) {
return this.editor.nextLine(line);
},
prevLine: function (line) {
return this.editor.prevLine(line);
},
lineContent: function (line) {
return this.editor.lineContent(line);
},
setLineContent: function (line, content) {
this.editor.setLineContent(line, content);
},
insertIntoLine: function (line, position, content) {
this.editor.insertIntoLine(line, position, content);
},
selectLines: function (startLine, startOffset, endLine, endOffset) {
this.win.focus();
this.editor.selectLines(startLine, startOffset, endLine, endOffset);
},
nthLine: function (n) {
var line = this.firstLine();
for (; n > 1 && line !== false; n--)
line = this.nextLine(line);
return line;
},
lineNumber: function (line) {
var num = 0;
while (line !== false) {
num++;
line = this.prevLine(line);
}
return num;
},
// Old number-based line interface
jumpToLine: function (n) {
this.selectLines(this.nthLine(n), 0);
this.win.focus();
},
currentLine: function () {
return this.lineNumber(this.cursorPosition().line);
},
activateLineNumbers: function () {
var frame = this.frame, win = frame.contentWindow, doc = win.document, body = doc.body,
nums = this.lineNumbers, scroller = nums.firstChild, self = this;
var barWidth = null;
function sizeBar() {
for (var root = frame; root.parentNode; root = root.parentNode) ;
if (!nums.parentNode || root != document || !win.Editor) {
// Clear event handlers (their nodes might already be collected, so try/catch)
try {
clear();
} catch (e) {
}
clearInterval(sizeInterval);
return;
}
if (nums.offsetWidth != barWidth) {
barWidth = nums.offsetWidth;
nums.style.left = "-" + (frame.parentNode.style.marginLeft = barWidth + "px");
}
}
function doScroll() {
nums.scrollTop = body.scrollTop || doc.documentElement.scrollTop || 0;
}
// Cleanup function, registered by nonWrapping and wrapping.
var clear = function () {
};
sizeBar();
sizeInterval = setInterval(sizeBar, 500);
function nonWrapping() {
var nextNum = 1;
function update() {
var target = 50 + Math.max(body.offsetHeight, frame.offsetHeight);
while (scroller.offsetHeight < target) {
scroller.appendChild(document.createElement("DIV"));
scroller.lastChild.innerHTML = nextNum++;
}
doScroll();
}
var onScroll = win.addEventHandler(win, "scroll", update, true),
onResize = win.addEventHandler(win, "resize", update, true);
clear = function () {
onScroll();
onResize();
};
}
function wrapping() {
var node, lineNum, next, pos;
function addNum(n) {
if (!lineNum) lineNum = scroller.appendChild(document.createElement("DIV"));
lineNum.innerHTML = n;
pos = lineNum.offsetHeight + lineNum.offsetTop;
lineNum = lineNum.nextSibling;
}
function work() {
if (!scroller.parentNode || scroller.parentNode != self.lineNumbers) return;
var endTime = new Date().getTime() + self.options.lineNumberTime;
while (node) {
addNum(next++);
for (; node && !win.isBR(node); node = node.nextSibling) {
var bott = node.offsetTop + node.offsetHeight;
while (bott - 3 > pos) addNum("&nbsp;");
}
if (node) node = node.nextSibling;
if (new Date().getTime() > endTime) {
pending = setTimeout(work, self.options.lineNumberDelay);
return;
}
}
// While there are un-processed number DIVs, or the scroller is smaller than the frame...
var target = 50 + Math.max(body.offsetHeight, frame.offsetHeight);
while (lineNum || scroller.offsetHeight < target) addNum(next++);
doScroll();
}
function start() {
doScroll();
node = body.firstChild;
lineNum = scroller.firstChild;
pos = 0;
next = 1;
work();
}
start();
var pending = null;
function update() {
if (pending) clearTimeout(pending);
start();
}
self.updateNumbers = update;
var onScroll = win.addEventHandler(win, "scroll", doScroll, true),
onResize = win.addEventHandler(win, "resize", update, true);
clear = function () {
if (pending) clearTimeout(pending);
if (self.updateNumbers == update) self.updateNumbers = null;
onScroll();
onResize();
};
}
(this.options.textWrapping ? wrapping : nonWrapping)();
}
};
CodeMirror.InvalidLineHandle = {
toString: function () {
return "CodeMirror.InvalidLineHandle";
}
};
CodeMirror.replace = function (element) {
if (typeof element == "string")
element = document.getElementById(element);
return function (newElement) {
element.parentNode.replaceChild(newElement, element);
};
};
CodeMirror.fromTextArea = function (area, options) {
if (typeof area == "string")
area = document.getElementById(area);
options = options || {};
if (area.style.width && options.width == null)
options.width = area.style.width;
if (area.style.height && options.height == null)
options.height = area.style.height;
if (options.content == null) options.content = area.value;
if (area.form) {
function updateField() {
area.value = mirror.getCode();
}
if (typeof area.form.addEventListener == "function")
area.form.addEventListener("submit", updateField, false);
else
area.form.attachEvent("onsubmit", updateField);
}
function insert(frame) {
if (area.nextSibling)
area.parentNode.insertBefore(frame, area.nextSibling);
else
area.parentNode.appendChild(frame);
}
area.style.display = "none";
var mirror = new CodeMirror(insert, options);
return mirror;
};
CodeMirror.isProbablySupported = function () {
// This is rather awful, but can be useful.
var match;
if (window.opera)
return Number(window.opera.version()) >= 9.52;
else if (/Apple Computers, Inc/.test(navigator.vendor) && (match = navigator.userAgent.match(/Version\/(\d+(?:\.\d+)?)\./)))
return Number(match[1]) >= 3;
else if (document.selection && window.ActiveXObject && (match = navigator.userAgent.match(/MSIE (\d+(?:\.\d*)?)\b/)))
return Number(match[1]) >= 6;
else if (match = navigator.userAgent.match(/gecko\/(\d{8})/i))
return Number(match[1]) >= 20050901;
else if (match = navigator.userAgent.match(/AppleWebKit\/(\d+)/))
return Number(match[1]) >= 525;
else
return null;
};
return CodeMirror;
})();
File diff suppressed because it is too large Load Diff
-70
View File
@@ -1,70 +0,0 @@
// Minimal framing needed to use CodeMirror-style parsers to highlight
// code. Load this along with tokenize.js, stringstream.js, and your
// parser. Then call highlightText, passing a string as the first
// argument, and as the second argument either a callback function
// that will be called with an array of SPAN nodes for every line in
// the code, or a DOM node to which to append these spans, and
// optionally (not needed if you only loaded one parser) a parser
// object.
// Stuff from util.js that the parsers are using.
var StopIteration = {
toString: function () {
return "StopIteration"
}
};
var Editor = {};
var indentUnit = 2;
(function () {
function normaliseString(string) {
var tab = "";
for (var i = 0; i < indentUnit; i++) tab += " ";
string = string.replace(/\t/g, tab).replace(/\u00a0/g, " ").replace(/\r\n?/g, "\n");
var pos = 0, parts = [], lines = string.split("\n");
for (var line = 0; line < lines.length; line++) {
if (line != 0) parts.push("\n");
parts.push(lines[line]);
}
return {
next: function () {
if (pos < parts.length) return parts[pos++];
else throw StopIteration;
}
};
}
window.highlightText = function (string, callback, parser) {
var parser = (parser || Editor.Parser).make(stringStream(normaliseString(string)));
var line = [];
if (callback.nodeType == 1) {
var node = callback;
callback = function (line) {
for (var i = 0; i < line.length; i++)
node.appendChild(line[i]);
node.appendChild(document.createElement("BR"));
};
}
try {
while (true) {
var token = parser.next();
if (token.value == "\n") {
callback(line);
line = [];
} else {
var span = document.createElement("SPAN");
span.className = token.style;
span.appendChild(document.createTextNode(token.value));
line.push(span);
}
}
} catch (e) {
if (e != StopIteration) throw e;
}
if (line.length) callback(line);
}
})();
-84
View File
@@ -1,84 +0,0 @@
/* Demonstration of embedding CodeMirror in a bigger application. The
* interface defined here is a mess of prompts and confirms, and
* should probably not be used in a real project.
*/
function MirrorFrame(place, options) {
this.home = document.createElement("DIV");
if (place.appendChild)
place.appendChild(this.home);
else
place(this.home);
var self = this;
function makeButton(name, action) {
var button = document.createElement("INPUT");
button.type = "button";
button.value = name;
self.home.appendChild(button);
button.onclick = function () {
self[action].call(self);
};
}
makeButton("Search", "search");
makeButton("Replace", "replace");
makeButton("Current line", "line");
makeButton("Jump to line", "jump");
makeButton("Insert constructor", "macro");
makeButton("Indent all", "reindent");
this.mirror = new CodeMirror(this.home, options);
}
MirrorFrame.prototype = {
search: function () {
var text = prompt("Enter search term:", "");
if (!text) return;
var first = true;
do {
var cursor = this.mirror.getSearchCursor(text, first, true);
first = false;
while (cursor.findNext()) {
cursor.select();
if (!confirm("Search again?"))
return;
}
} while (confirm("End of document reached. Start over?"));
},
replace: function () {
// This is a replace-all, but it is possible to implement a
// prompting replace.
var from = prompt("Enter search string:", ""), to;
if (from) to = prompt("What should it be replaced with?", "");
if (to == null) return;
var cursor = this.mirror.getSearchCursor(from, false);
while (cursor.findNext())
cursor.replace(to);
},
jump: function () {
var line = prompt("Jump to line:", "");
if (line && !isNaN(Number(line)))
this.mirror.jumpToLine(Number(line));
},
line: function () {
alert("The cursor is currently at line " + this.mirror.currentLine());
this.mirror.focus();
},
macro: function () {
var name = prompt("Name your constructor:", "");
if (name)
this.mirror.replaceSelection("function " + name + "() {\n \n}\n\n" + name + ".prototype = {\n \n};\n");
},
reindent: function () {
this.mirror.reindent();
}
};
-144
View File
@@ -1,144 +0,0 @@
/* Simple parser for CSS */
var CSSParser = Editor.Parser = (function () {
var tokenizeCSS = (function () {
function normal(source, setState) {
var ch = source.next();
if (ch == "@") {
source.nextWhileMatches(/\w/);
return "css-at";
} else if (ch == "/" && source.equals("*")) {
setState(inCComment);
return null;
} else if (ch == "<" && source.equals("!")) {
setState(inSGMLComment);
return null;
} else if (ch == "=") {
return "css-compare";
} else if (source.equals("=") && (ch == "~" || ch == "|")) {
source.next();
return "css-compare";
} else if (ch == "\"" || ch == "'") {
setState(inString(ch));
return null;
} else if (ch == "#") {
source.nextWhileMatches(/\w/);
return "css-hash";
} else if (ch == "!") {
source.nextWhileMatches(/[ \t]/);
source.nextWhileMatches(/\w/);
return "css-important";
} else if (/\d/.test(ch)) {
source.nextWhileMatches(/[\w.%]/);
return "css-unit";
} else if (/[,.+>*\/]/.test(ch)) {
return "css-select-op";
} else if (/[;{}:\[\]]/.test(ch)) {
return "css-punctuation";
} else {
source.nextWhileMatches(/[\w\\\-_]/);
return "css-identifier";
}
}
function inCComment(source, setState) {
var maybeEnd = false;
while (!source.endOfLine()) {
var ch = source.next();
if (maybeEnd && ch == "/") {
setState(normal);
break;
}
maybeEnd = (ch == "*");
}
return "css-comment";
}
function inSGMLComment(source, setState) {
var dashes = 0;
while (!source.endOfLine()) {
var ch = source.next();
if (dashes >= 2 && ch == ">") {
setState(normal);
break;
}
dashes = (ch == "-") ? dashes + 1 : 0;
}
return "css-comment";
}
function inString(quote) {
return function (source, setState) {
var escaped = false;
while (!source.endOfLine()) {
var ch = source.next();
if (ch == quote && !escaped)
break;
escaped = !escaped && ch == "\\";
}
if (!escaped)
setState(normal);
return "css-string";
};
}
return function (source, startState) {
return tokenizer(source, startState || normal);
};
})();
function indentCSS(inBraces, inRule, base) {
return function (nextChars) {
if (!inBraces || /^\}/.test(nextChars)) return base;
else if (inRule) return base + indentUnit * 2;
else return base + indentUnit;
};
}
// This is a very simplistic parser -- since CSS does not really
// nest, it works acceptably well, but some nicer colouroing could
// be provided with a more complicated parser.
function parseCSS(source, basecolumn) {
basecolumn = basecolumn || 0;
var tokens = tokenizeCSS(source);
var inBraces = false, inRule = false;
var iter = {
next: function () {
var token = tokens.next(), style = token.style, content = token.content;
if (style == "css-identifier" && inRule)
token.style = "css-value";
if (style == "css-hash")
token.style = inRule ? "css-colorcode" : "css-identifier";
if (content == "\n")
token.indentation = indentCSS(inBraces, inRule, basecolumn);
if (content == "{")
inBraces = true;
else if (content == "}")
inBraces = inRule = false;
else if (inBraces && content == ";")
inRule = false;
else if (inBraces && style != "css-comment" && style != "whitespace")
inRule = true;
return token;
},
copy: function () {
var _inBraces = inBraces, _inRule = inRule, _tokenState = tokens.state;
return function (source) {
tokens = tokenizeCSS(source, _tokenState);
inBraces = _inBraces;
inRule = _inRule;
return iter;
};
}
};
return iter;
}
return {make: parseCSS, electricChars: "}"};
})();
-39
View File
@@ -1,39 +0,0 @@
var DummyParser = Editor.Parser = (function () {
function tokenizeDummy(source) {
while (!source.endOfLine()) source.next();
return "text";
}
function parseDummy(source) {
function indentTo(n) {
return function () {
return n;
}
}
source = tokenizer(source, tokenizeDummy);
var space = 0;
var iter = {
next: function () {
var tok = source.next();
if (tok.type == "whitespace") {
if (tok.value == "\n") tok.indentation = indentTo(space);
else space = tok.value.length;
}
return tok;
},
copy: function () {
var _space = space;
return function (_source) {
space = _space;
source = tokenizer(_source, tokenizeDummy);
return iter;
};
}
};
return iter;
}
return {make: parseDummy};
})();
-76
View File
@@ -1,76 +0,0 @@
var HTMLMixedParser = Editor.Parser = (function () {
if (!(CSSParser && JSParser && XMLParser))
throw new Error("CSS, JS, and XML parsers must be loaded for HTML mixed mode to work.");
XMLParser.configure({useHTMLKludges: true});
function parseMixed(stream) {
var htmlParser = XMLParser.make(stream), localParser = null, inTag = false;
var iter = {next: top, copy: copy};
function top() {
var token = htmlParser.next();
if (token.content == "<")
inTag = true;
else if (token.style == "xml-tagname" && inTag === true)
inTag = token.content.toLowerCase();
else if (token.content == ">") {
if (inTag == "script")
iter.next = local(JSParser, "</script");
else if (inTag == "style")
iter.next = local(CSSParser, "</style");
inTag = false;
}
return token;
}
function local(parser, tag) {
var baseIndent = htmlParser.indentation();
localParser = parser.make(stream, baseIndent + indentUnit);
return function () {
if (stream.lookAhead(tag, false, false, true)) {
localParser = null;
iter.next = top;
return top();
}
var token = localParser.next();
var lt = token.value.lastIndexOf("<"), sz = Math.min(token.value.length - lt, tag.length);
if (lt != -1 && token.value.slice(lt, lt + sz).toLowerCase() == tag.slice(0, sz) &&
stream.lookAhead(tag.slice(sz), false, false, true)) {
stream.push(token.value.slice(lt));
token.value = token.value.slice(0, lt);
}
if (token.indentation) {
var oldIndent = token.indentation;
token.indentation = function (chars) {
if (chars == "</")
return baseIndent;
else
return oldIndent(chars);
}
}
return token;
};
}
function copy() {
var _html = htmlParser.copy(), _local = localParser && localParser.copy(),
_next = iter.next, _inTag = inTag;
return function (_stream) {
stream = _stream;
htmlParser = _html(_stream);
localParser = _local && _local(_stream);
iter.next = _next;
inTag = _inTag;
return iter;
};
}
return iter;
}
return {make: parseMixed, electricChars: "{}/:"};
})();
-385
View File
@@ -1,385 +0,0 @@
/* Parse function for JavaScript. Makes use of the tokenizer from
* tokenizejavascript.js. Note that your parsers do not have to be
* this complicated -- if you don't want to recognise local variables,
* in many languages it is enough to just look for braces, semicolons,
* parentheses, etc, and know when you are inside a string or comment.
*
* See manual.html for more info about the parser interface.
*/
var JSParser = Editor.Parser = (function () {
// Token types that can be considered to be atoms.
var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true};
// Setting that can be used to have JSON data indent properly.
var json = false;
// Constructor for the lexical context objects.
function JSLexical(indented, column, type, align, prev, info) {
// indentation at start of this line
this.indented = indented;
// column at which this scope was opened
this.column = column;
// type of scope ('vardef', 'stat' (statement), 'form' (special form), '[', '{', or '(')
this.type = type;
// '[', '{', or '(' blocks that have any text after their opening
// character are said to be 'aligned' -- any lines below are
// indented all the way to the opening character.
if (align != null)
this.align = align;
// Parent scope, if any.
this.prev = prev;
this.info = info;
}
// My favourite JavaScript indentation rules.
function indentJS(lexical) {
return function (firstChars) {
var firstChar = firstChars && firstChars.charAt(0), type = lexical.type;
var closing = firstChar == type;
if (type == "vardef")
return lexical.indented + 4;
else if (type == "form" && firstChar == "{")
return lexical.indented;
else if (type == "stat" || type == "form")
return lexical.indented + indentUnit;
else if (lexical.info == "switch" && !closing)
return lexical.indented + (/^(?:case|default)\b/.test(firstChars) ? indentUnit : 2 * indentUnit);
else if (lexical.align)
return lexical.column - (closing ? 1 : 0);
else
return lexical.indented + (closing ? 0 : indentUnit);
};
}
// The parser-iterator-producing function itself.
function parseJS(input, basecolumn) {
// Wrap the input in a token stream
var tokens = tokenizeJavaScript(input);
// The parser state. cc is a stack of actions that have to be
// performed to finish the current statement. For example we might
// know that we still need to find a closing parenthesis and a
// semicolon. Actions at the end of the stack go first. It is
// initialized with an infinitely looping action that consumes
// whole statements.
var cc = [statements];
// Context contains information about the current local scope, the
// variables defined in that, and the scopes above it.
var context = null;
// The lexical scope, used mostly for indentation.
var lexical = new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false);
// Current column, and the indentation at the start of the current
// line. Used to create lexical scope objects.
var column = 0;
var indented = 0;
// Variables which are used by the mark, cont, and pass core
// below to communicate with the driver loop in the 'next'
// function.
var consume, marked;
// The iterator object.
var parser = {next: next, copy: copy};
function next() {
// Start by performing any 'lexical' actions (adjusting the
// lexical variable), or the operations below will be working
// with the wrong lexical state.
while (cc[cc.length - 1].lex)
cc.pop()();
// Fetch a token.
var token = tokens.next();
// Adjust column and indented.
if (token.type == "whitespace" && column == 0)
indented = token.value.length;
column += token.value.length;
if (token.content == "\n") {
indented = column = 0;
// If the lexical scope's align property is still undefined at
// the end of the line, it is an un-aligned scope.
if (!("align" in lexical))
lexical.align = false;
// Newline tokens get an indentation function associated with
// them.
token.indentation = indentJS(lexical);
}
// No more processing for meaningless tokens.
if (token.type == "whitespace" || token.type == "comment")
return token;
// When a meaningful token is found and the lexical scope's
// align is undefined, it is an aligned scope.
if (!("align" in lexical))
lexical.align = true;
// Execute actions until one 'consumes' the token and we can
// return it.
while (true) {
consume = marked = false;
// Take and execute the topmost action.
cc.pop()(token.type, token.content);
if (consume) {
// Marked is used to change the style of the current token.
if (marked)
token.style = marked;
// Here we differentiate between local and global variables.
else if (token.type == "variable" && inScope(token.content))
token.style = "js-localvariable";
return token;
}
}
}
// This makes a copy of the parser state. It stores all the
// stateful variables in a closure, and returns a function that
// will restore them when called with a new input stream. Note
// that the cc array has to be copied, because it is contantly
// being modified. Lexical objects are not mutated, and context
// objects are not mutated in a harmful way, so they can be shared
// between runs of the parser.
function copy() {
var _context = context, _lexical = lexical, _cc = cc.concat([]), _tokenState = tokens.state;
return function copyParser(input) {
context = _context;
lexical = _lexical;
cc = _cc.concat([]); // copies the array
column = indented = 0;
tokens = tokenizeJavaScript(input, _tokenState);
return parser;
};
}
// Helper function for pushing a number of actions onto the cc
// stack in reverse order.
function push(fs) {
for (var i = fs.length - 1; i >= 0; i--)
cc.push(fs[i]);
}
// cont and pass are used by the action core to add other
// actions to the stack. cont will cause the current token to be
// consumed, pass will leave it for the next action.
function cont() {
push(arguments);
consume = true;
}
function pass() {
push(arguments);
consume = false;
}
// Used to change the style of the current token.
function mark(style) {
marked = style;
}
// Push a new scope. Will automatically link the current scope.
function pushcontext() {
context = {prev: context, vars: {"this": true, "arguments": true}};
}
// Pop off the current scope.
function popcontext() {
context = context.prev;
}
// Register a variable in the current scope.
function register(varname) {
if (context) {
mark("js-variabledef");
context.vars[varname] = true;
}
}
// Check whether a variable is defined in the current scope.
function inScope(varname) {
var cursor = context;
while (cursor) {
if (cursor.vars[varname])
return true;
cursor = cursor.prev;
}
return false;
}
// Push a new lexical context of the given type.
function pushlex(type, info) {
var result = function () {
lexical = new JSLexical(indented, column, type, null, lexical, info)
};
result.lex = true;
return result;
}
// Pop off the current lexical context.
function poplex() {
lexical = lexical.prev;
}
poplex.lex = true;
// The 'lex' flag on these actions is used by the 'next' function
// to know they can (and have to) be ran before moving on to the
// next token.
// Creates an action that discards tokens until it finds one of
// the given type.
function expect(wanted) {
return function expecting(type) {
if (type == wanted) cont();
else cont(arguments.callee);
};
}
// Looks for a statement, and then calls itself.
function statements(type) {
return pass(statement, statements);
}
// Dispatches various types of statements based on the type of the
// current token.
function statement(type) {
if (type == "var") cont(pushlex("vardef"), vardef1, expect(";"), poplex);
else if (type == "keyword a") cont(pushlex("form"), expression, statement, poplex);
else if (type == "keyword b") cont(pushlex("form"), statement, poplex);
else if (type == "{" && json) cont(pushlex("}"), commasep(objprop, "}"), poplex);
else if (type == "{") cont(pushlex("}"), block, poplex);
else if (type == "function") cont(functiondef);
else if (type == "for") cont(pushlex("form"), expect("("), pushlex(")"), forspec1, expect(")"), poplex, statement, poplex);
else if (type == "variable") cont(pushlex("stat"), maybelabel);
else if (type == "switch") cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"), block, poplex, poplex);
else if (type == "case") cont(expression, expect(":"));
else if (type == "default") cont(expect(":"));
else if (type == "catch") cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"), statement, poplex, popcontext);
else pass(pushlex("stat"), expression, expect(";"), poplex);
}
// Dispatch expression types.
function expression(type) {
if (atomicTypes.hasOwnProperty(type)) cont(maybeoperator);
else if (type == "function") cont(functiondef);
else if (type == "keyword c") cont(expression);
else if (type == "(") cont(pushlex(")"), expression, expect(")"), poplex, maybeoperator);
else if (type == "operator") cont(expression);
else if (type == "[") cont(pushlex("]"), commasep(expression, "]"), poplex, maybeoperator);
else if (type == "{") cont(pushlex("}"), commasep(objprop, "}"), poplex, maybeoperator);
}
// Called for places where operators, function calls, or
// subscripts are valid. Will skip on to the next action if none
// is found.
function maybeoperator(type) {
if (type == "operator") cont(expression);
else if (type == "(") cont(pushlex(")"), expression, commasep(expression, ")"), poplex, maybeoperator);
else if (type == ".") cont(property, maybeoperator);
else if (type == "[") cont(pushlex("]"), expression, expect("]"), poplex, maybeoperator);
}
// When a statement starts with a variable name, it might be a
// label. If no colon follows, it's a regular statement.
function maybelabel(type) {
if (type == ":") cont(poplex, statement);
else pass(maybeoperator, expect(";"), poplex);
}
// Property names need to have their style adjusted -- the
// tokenizer thinks they are variables.
function property(type) {
if (type == "variable") {
mark("js-property");
cont();
}
}
// This parses a property and its value in an object literal.
function objprop(type) {
if (type == "variable") mark("js-property");
if (atomicTypes.hasOwnProperty(type)) cont(expect(":"), expression);
}
// Parses a comma-separated list of the things that are recognised
// by the 'what' argument.
function commasep(what, end) {
function proceed(type) {
if (type == ",") cont(what, proceed);
else if (type == end) cont();
else cont(expect(end));
};
return function commaSeparated(type) {
if (type == end) cont();
else pass(what, proceed);
};
}
// Look for statements until a closing brace is found.
function block(type) {
if (type == "}") cont();
else pass(statement, block);
}
// Variable definitions are split into two actions -- 1 looks for
// a name or the end of the definition, 2 looks for an '=' sign or
// a comma.
function vardef1(type, value) {
if (type == "variable") {
register(value);
cont(vardef2);
} else cont();
}
function vardef2(type, value) {
if (value == "=") cont(expression, vardef2);
else if (type == ",") cont(vardef1);
}
// For loops.
function forspec1(type) {
if (type == "var") cont(vardef1, forspec2);
else if (type == ";") pass(forspec2);
else if (type == "variable") cont(formaybein);
else pass(forspec2);
}
function formaybein(type, value) {
if (value == "in") cont(expression);
else cont(maybeoperator, forspec2);
}
function forspec2(type, value) {
if (type == ";") cont(forspec3);
else if (value == "in") cont(expression);
else cont(expression, expect(";"), forspec3);
}
function forspec3(type) {
if (type == ")") pass();
else cont(expression);
}
// A function definition creates a new context, and the variables
// in its argument list have to be added to this context.
function functiondef(type, value) {
if (type == "variable") {
register(value);
cont(functiondef);
} else if (type == "(") cont(pushcontext, commasep(funarg, ")"), statement, popcontext);
}
function funarg(type, value) {
if (type == "variable") {
register(value);
cont();
}
}
return parser;
}
return {
make: parseJS,
electricChars: "{}:",
configure: function (obj) {
if (obj.json != null) json = obj.json;
}
};
})();
-153
View File
@@ -1,153 +0,0 @@
var SparqlParser = Editor.Parser = (function () {
function wordRegexp(words) {
return new RegExp("^(?:" + words.join("|") + ")$", "i");
}
var ops = wordRegexp(["str", "lang", "langmatches", "datatype", "bound", "sameterm", "isiri", "isuri",
"isblank", "isliteral", "union", "a"]);
var keywords = wordRegexp(["base", "prefix", "select", "distinct", "reduced", "construct", "describe",
"ask", "from", "named", "where", "order", "limit", "offset", "filter", "optional",
"graph", "by", "asc", "desc",]);
var operatorChars = /[*+\-<>=&|]/;
var tokenizeSparql = (function () {
function normal(source, setState) {
var ch = source.next();
if (ch == "$" || ch == "?") {
source.nextWhileMatches(/[\w\d]/);
return "sp-var";
} else if (ch == "<" && !source.matches(/[\s\u00a0=]/)) {
source.nextWhileMatches(/[^\s\u00a0>]/);
if (source.equals(">")) source.next();
return "sp-uri";
} else if (ch == "\"" || ch == "'") {
setState(inLiteral(ch));
return null;
} else if (/[{}\(\),\.;\[\]]/.test(ch)) {
return "sp-punc";
} else if (ch == "#") {
while (!source.endOfLine()) source.next();
return "sp-comment";
} else if (operatorChars.test(ch)) {
source.nextWhileMatches(operatorChars);
return "sp-operator";
} else if (ch == ":") {
source.nextWhileMatches(/[\w\d\._\-]/);
return "sp-prefixed";
} else {
source.nextWhileMatches(/[_\w\d]/);
if (source.equals(":")) {
source.next();
source.nextWhileMatches(/[\w\d_\-]/);
return "sp-prefixed";
}
var word = source.get(), type;
if (ops.test(word))
type = "sp-operator";
else if (keywords.test(word))
type = "sp-keyword";
else
type = "sp-word";
return {style: type, content: word};
}
}
function inLiteral(quote) {
return function (source, setState) {
var escaped = false;
while (!source.endOfLine()) {
var ch = source.next();
if (ch == quote && !escaped) {
setState(normal);
break;
}
escaped = !escaped && ch == "\\";
}
return "sp-literal";
};
}
return function (source, startState) {
return tokenizer(source, startState || normal);
};
})();
function indentSparql(context) {
return function (nextChars) {
var firstChar = nextChars && nextChars.charAt(0);
if (/[\]\}]/.test(firstChar))
while (context && context.type == "pattern") context = context.prev;
var closing = context && firstChar == matching[context.type];
if (!context)
return 0;
else if (context.type == "pattern")
return context.col;
else if (context.align)
return context.col - (closing ? context.width : 0);
else
return context.indent + (closing ? 0 : indentUnit);
}
}
function parseSparql(source) {
var tokens = tokenizeSparql(source);
var context = null, indent = 0, col = 0;
function pushContext(type, width) {
context = {prev: context, indent: indent, col: col, type: type, width: width};
}
function popContext() {
context = context.prev;
}
var iter = {
next: function () {
var token = tokens.next(), type = token.style, content = token.content, width = token.value.length;
if (content == "\n") {
token.indentation = indentSparql(context);
indent = col = 0;
if (context && context.align == null) context.align = false;
} else if (type == "whitespace" && col == 0) {
indent = width;
} else if (type != "sp-comment" && context && context.align == null) {
context.align = true;
}
if (content != "\n") col += width;
if (/[\[\{\(]/.test(content)) {
pushContext(content, width);
} else if (/[\]\}\)]/.test(content)) {
while (context && context.type == "pattern")
popContext();
if (context && content == matching[context.type])
popContext();
} else if (content == "." && context && context.type == "pattern") {
popContext();
} else if ((type == "sp-word" || type == "sp-prefixed" || type == "sp-uri" || type == "sp-var" || type == "sp-literal") &&
context && /[\{\[]/.test(context.type)) {
pushContext("pattern", width);
}
return token;
},
copy: function () {
var _context = context, _indent = indent, _col = col, _tokenState = tokens.state;
return function (source) {
tokens = tokenizeSparql(source, _tokenState);
context = _context;
indent = _indent;
col = _col;
return iter;
};
}
};
return iter;
}
return {make: parseSparql, electricChars: "}]"};
})();
-295
View File
@@ -1,295 +0,0 @@
/* This file defines an XML parser, with a few kludges to make it
* useable for HTML. autoSelfClosers defines a set of tag names that
* are expected to not have a closing tag, and doNotIndent specifies
* the tags inside of which no indentation should happen (see Config
* object). These can be disabled by passing the editor an object like
* {useHTMLKludges: false} as parserConfig option.
*/
var XMLParser = Editor.Parser = (function () {
var Kludges = {
autoSelfClosers: {
"br": true, "img": true, "hr": true, "link": true, "input": true,
"meta": true, "col": true, "frame": true, "base": true, "area": true
},
doNotIndent: {"pre": true, "!cdata": true}
};
var NoKludges = {autoSelfClosers: {}, doNotIndent: {"!cdata": true}};
var UseKludges = Kludges;
var alignCDATA = false;
// Simple stateful tokenizer for XML documents. Returns a
// MochiKit-style iterator, with a state property that contains a
// function encapsulating the current state. See tokenize.js.
var tokenizeXML = (function () {
function inText(source, setState) {
var ch = source.next();
if (ch == "<") {
if (source.equals("!")) {
source.next();
if (source.equals("[")) {
if (source.lookAhead("[CDATA[", true)) {
setState(inBlock("xml-cdata", "]]>"));
return null;
} else {
return "xml-text";
}
} else if (source.lookAhead("--", true)) {
setState(inBlock("xml-comment", "-->"));
return null;
} else {
return "xml-text";
}
} else if (source.equals("?")) {
source.next();
source.nextWhileMatches(/[\w\._\-]/);
setState(inBlock("xml-processing", "?>"));
return "xml-processing";
} else {
if (source.equals("/")) source.next();
setState(inTag);
return "xml-punctuation";
}
} else if (ch == "&") {
while (!source.endOfLine()) {
if (source.next() == ";")
break;
}
return "xml-entity";
} else {
source.nextWhileMatches(/[^&<\n]/);
return "xml-text";
}
}
function inTag(source, setState) {
var ch = source.next();
if (ch == ">") {
setState(inText);
return "xml-punctuation";
} else if (/[?\/]/.test(ch) && source.equals(">")) {
source.next();
setState(inText);
return "xml-punctuation";
} else if (ch == "=") {
return "xml-punctuation";
} else if (/[\'\"]/.test(ch)) {
setState(inAttribute(ch));
return null;
} else {
source.nextWhileMatches(/[^\s\u00a0=<>\"\'\/?]/);
return "xml-name";
}
}
function inAttribute(quote) {
return function (source, setState) {
while (!source.endOfLine()) {
if (source.next() == quote) {
setState(inTag);
break;
}
}
return "xml-attribute";
};
}
function inBlock(style, terminator) {
return function (source, setState) {
while (!source.endOfLine()) {
if (source.lookAhead(terminator, true)) {
setState(inText);
break;
}
source.next();
}
return style;
};
}
return function (source, startState) {
return tokenizer(source, startState || inText);
};
})();
// The parser. The structure of this function largely follows that of
// parseJavaScript in parsejavascript.js (there is actually a bit more
// shared code than I'd like), but it is quite a bit simpler.
function parseXML(source) {
var tokens = tokenizeXML(source);
var cc = [base];
var tokenNr = 0, indented = 0;
var currentTag = null, context = null;
var consume, marked;
function push(fs) {
for (var i = fs.length - 1; i >= 0; i--)
cc.push(fs[i]);
}
function cont() {
push(arguments);
consume = true;
}
function pass() {
push(arguments);
consume = false;
}
function mark(style) {
marked = style;
}
function expect(text) {
return function (style, content) {
if (content == text) cont();
else mark("xml-error") || cont(arguments.callee);
};
}
function pushContext(tagname, startOfLine) {
var noIndent = UseKludges.doNotIndent.hasOwnProperty(tagname) || (context && context.noIndent);
context = {prev: context, name: tagname, indent: indented, startOfLine: startOfLine, noIndent: noIndent};
}
function popContext() {
context = context.prev;
}
function computeIndentation(baseContext) {
return function (nextChars, current) {
var context = baseContext;
if (context && context.noIndent)
return current;
if (alignCDATA && /<!\[CDATA\[/.test(nextChars))
return 0;
if (context && /^<\//.test(nextChars))
context = context.prev;
while (context && !context.startOfLine)
context = context.prev;
if (context)
return context.indent + indentUnit;
else
return 0;
};
}
function base() {
return pass(element, base);
}
var harmlessTokens = {"xml-text": true, "xml-entity": true, "xml-comment": true, "xml-processing": true};
function element(style, content) {
if (content == "<") cont(tagname, attributes, endtag(tokenNr == 1));
else if (content == "</") cont(closetagname, expect(">"));
else if (style == "xml-cdata") {
if (!context || context.name != "!cdata") pushContext("!cdata");
if (/\]\]>$/.test(content)) popContext();
cont();
} else if (harmlessTokens.hasOwnProperty(style)) cont();
else mark("xml-error") || cont();
}
function tagname(style, content) {
if (style == "xml-name") {
currentTag = content.toLowerCase();
mark("xml-tagname");
cont();
} else {
currentTag = null;
pass();
}
}
function closetagname(style, content) {
if (style == "xml-name" && context && content.toLowerCase() == context.name) {
popContext();
mark("xml-tagname");
} else {
mark("xml-error");
}
cont();
}
function endtag(startOfLine) {
return function (style, content) {
if (content == "/>" || (content == ">" && UseKludges.autoSelfClosers.hasOwnProperty(currentTag))) cont();
else if (content == ">") pushContext(currentTag, startOfLine) || cont();
else mark("xml-error") || cont(arguments.callee);
};
}
function attributes(style) {
if (style == "xml-name") mark("xml-attname") || cont(attribute, attributes);
else pass();
}
function attribute(style, content) {
if (content == "=") cont(value);
else if (content == ">" || content == "/>") pass(endtag);
else pass();
}
function value(style) {
if (style == "xml-attribute") cont(value);
else pass();
}
return {
indentation: function () {
return indented;
},
next: function () {
var token = tokens.next();
if (token.style == "whitespace" && tokenNr == 0)
indented = token.value.length;
else
tokenNr++;
if (token.content == "\n") {
indented = tokenNr = 0;
token.indentation = computeIndentation(context);
}
if (token.style == "whitespace" || token.type == "xml-comment")
return token;
while (true) {
consume = marked = false;
cc.pop()(token.style, token.content);
if (consume) {
if (marked)
token.style = marked;
return token;
}
}
},
copy: function () {
var _cc = cc.concat([]), _tokenState = tokens.state, _context = context;
var parser = this;
return function (input) {
cc = _cc.concat([]);
tokenNr = indented = 0;
context = _context;
tokens = tokenizeXML(input, _tokenState);
return parser;
};
}
};
}
return {
make: parseXML,
electricChars: "/",
configure: function (config) {
if (config.useHTMLKludges != null)
UseKludges = config.useHTMLKludges ? Kludges : NoKludges;
if (config.alignCDATA)
alignCDATA = config.alignCDATA;
}
};
})();
-612
View File
@@ -1,612 +0,0 @@
/* Functionality for finding, storing, and restoring selections
*
* This does not provide a generic API, just the minimal functionality
* required by the CodeMirror system.
*/
// Namespace object.
var select = {};
(function () {
select.ie_selection = document.selection && document.selection.createRangeCollection;
// Find the 'top-level' (defined as 'a direct child of the node
// passed as the top argument') node that the given node is
// contained in. Return null if the given node is not inside the top
// node.
function topLevelNodeAt(node, top) {
while (node && node.parentNode != top)
node = node.parentNode;
return node;
}
// Find the top-level node that contains the node before this one.
function topLevelNodeBefore(node, top) {
while (!node.previousSibling && node.parentNode != top)
node = node.parentNode;
return topLevelNodeAt(node.previousSibling, top);
}
var fourSpaces = "\u00a0\u00a0\u00a0\u00a0";
select.scrollToNode = function (element) {
if (!element) return;
var doc = element.ownerDocument, body = doc.body,
win = (doc.defaultView || doc.parentWindow),
html = doc.documentElement,
atEnd = !element.nextSibling || !element.nextSibling.nextSibling
|| !element.nextSibling.nextSibling.nextSibling;
// In Opera (and recent Webkit versions), BR elements *always*
// have a offsetTop property of zero.
var compensateHack = 0;
while (element && !element.offsetTop) {
compensateHack++;
element = element.previousSibling;
}
// atEnd is another kludge for these browsers -- if the cursor is
// at the end of the document, and the node doesn't have an
// offset, just scroll to the end.
if (compensateHack == 0) atEnd = false;
var y = compensateHack * (element ? element.offsetHeight : 0), x = 0, pos = element;
while (pos && pos.offsetParent) {
y += pos.offsetTop;
// Don't count X offset for <br> nodes
if (!isBR(pos))
x += pos.offsetLeft;
pos = pos.offsetParent;
}
var scroll_x = body.scrollLeft || html.scrollLeft || 0,
scroll_y = body.scrollTop || html.scrollTop || 0,
screen_x = x - scroll_x, screen_y = y - scroll_y, scroll = false;
if (screen_x < 0 || screen_x > (win.innerWidth || html.clientWidth || 0)) {
scroll_x = x;
scroll = true;
}
if (screen_y < 0 || atEnd || screen_y > (win.innerHeight || html.clientHeight || 0) - 50) {
scroll_y = atEnd ? 1e6 : y;
scroll = true;
}
if (scroll) win.scrollTo(scroll_x, scroll_y);
};
select.scrollToCursor = function (container) {
select.scrollToNode(select.selectionTopNode(container, true) || container.firstChild);
};
// Used to prevent restoring a selection when we do not need to.
var currentSelection = null;
select.snapshotChanged = function () {
if (currentSelection) currentSelection.changed = true;
};
// This is called by the code in editor.js whenever it is replacing
// a text node. The function sees whether the given oldNode is part
// of the current selection, and updates this selection if it is.
// Because nodes are often only partially replaced, the length of
// the part that gets replaced has to be taken into account -- the
// selection might stay in the oldNode if the newNode is smaller
// than the selection's offset. The offset argument is needed in
// case the selection does move to the new object, and the given
// length is not the whole length of the new node (part of it might
// have been used to replace another node).
select.snapshotReplaceNode = function (from, to, length, offset) {
if (!currentSelection) return;
function replace(point) {
if (from == point.node) {
currentSelection.changed = true;
if (length && point.offset > length) {
point.offset -= length;
} else {
point.node = to;
point.offset += (offset || 0);
}
}
}
replace(currentSelection.start);
replace(currentSelection.end);
};
select.snapshotMove = function (from, to, distance, relative, ifAtStart) {
if (!currentSelection) return;
function move(point) {
if (from == point.node && (!ifAtStart || point.offset == 0)) {
currentSelection.changed = true;
point.node = to;
if (relative) point.offset = Math.max(0, point.offset + distance);
else point.offset = distance;
}
}
move(currentSelection.start);
move(currentSelection.end);
};
// Most core are defined in two ways, one for the IE selection
// model, one for the W3C one.
if (select.ie_selection) {
function selectionNode(win, start) {
var range = win.document.selection.createRange();
range.collapse(start);
function nodeAfter(node) {
var found = null;
while (!found && node) {
found = node.nextSibling;
node = node.parentNode;
}
return nodeAtStartOf(found);
}
function nodeAtStartOf(node) {
while (node && node.firstChild) node = node.firstChild;
return {node: node, offset: 0};
}
var containing = range.parentElement();
if (!isAncestor(win.document.body, containing)) return null;
if (!containing.firstChild) return nodeAtStartOf(containing);
var working = range.duplicate();
working.moveToElementText(containing);
working.collapse(true);
for (var cur = containing.firstChild; cur; cur = cur.nextSibling) {
if (cur.nodeType == 3) {
var size = cur.nodeValue.length;
working.move("character", size);
} else {
working.moveToElementText(cur);
working.collapse(false);
}
var dir = range.compareEndPoints("StartToStart", working);
if (dir == 0) return nodeAfter(cur);
if (dir == 1) continue;
if (cur.nodeType != 3) return nodeAtStartOf(cur);
working.setEndPoint("StartToEnd", range);
return {node: cur, offset: size - working.text.length};
}
return nodeAfter(containing);
}
select.markSelection = function (win) {
currentSelection = null;
var sel = win.document.selection;
if (!sel) return;
var start = selectionNode(win, true),
end = selectionNode(win, false);
if (!start || !end) return;
currentSelection = {start: start, end: end, window: win, changed: false};
};
select.selectMarked = function () {
if (!currentSelection || !currentSelection.changed) return;
var win = currentSelection.window, doc = win.document;
function makeRange(point) {
var range = doc.body.createTextRange(),
node = point.node;
if (!node) {
range.moveToElementText(currentSelection.window.document.body);
range.collapse(false);
} else if (node.nodeType == 3) {
range.moveToElementText(node.parentNode);
var offset = point.offset;
while (node.previousSibling) {
node = node.previousSibling;
offset += (node.innerText || "").length;
}
range.move("character", offset);
} else {
range.moveToElementText(node);
range.collapse(true);
}
return range;
}
var start = makeRange(currentSelection.start), end = makeRange(currentSelection.end);
start.setEndPoint("StartToEnd", end);
start.select();
};
// Get the top-level node that one end of the cursor is inside or
// after. Note that this returns false for 'no cursor', and null
// for 'start of document'.
select.selectionTopNode = function (container, start) {
var selection = container.ownerDocument.selection;
if (!selection) return false;
var range = selection.createRange(), range2 = range.duplicate();
range.collapse(start);
var around = range.parentElement();
if (around && isAncestor(container, around)) {
// Only use this node if the selection is not at its start.
range2.moveToElementText(around);
if (range.compareEndPoints("StartToStart", range2) == 1)
return topLevelNodeAt(around, container);
}
// Move the start of a range to the start of a node,
// compensating for the fact that you can't call
// moveToElementText with text nodes.
function moveToNodeStart(range, node) {
if (node.nodeType == 3) {
var count = 0, cur = node.previousSibling;
while (cur && cur.nodeType == 3) {
count += cur.nodeValue.length;
cur = cur.previousSibling;
}
if (cur) {
try {
range.moveToElementText(cur);
} catch (e) {
return false;
}
range.collapse(false);
} else range.moveToElementText(node.parentNode);
if (count) range.move("character", count);
} else {
try {
range.moveToElementText(node);
} catch (e) {
return false;
}
}
return true;
}
// Do a binary search through the container object, comparing
// the start of each node to the selection
var start = 0, end = container.childNodes.length - 1;
while (start < end) {
var middle = Math.ceil((end + start) / 2), node = container.childNodes[middle];
if (!node) return false; // Don't ask. IE6 manages this sometimes.
if (!moveToNodeStart(range2, node)) return false;
if (range.compareEndPoints("StartToStart", range2) == 1)
start = middle;
else
end = middle - 1;
}
return container.childNodes[start] || null;
};
// Place the cursor after this.start. This is only useful when
// manually moving the cursor instead of restoring it to its old
// position.
select.focusAfterNode = function (node, container) {
var range = container.ownerDocument.body.createTextRange();
range.moveToElementText(node || container);
range.collapse(!node);
range.select();
};
select.somethingSelected = function (win) {
var sel = win.document.selection;
return sel && (sel.createRange().text != "");
};
function insertAtCursor(window, html) {
var selection = window.document.selection;
if (selection) {
var range = selection.createRange();
range.pasteHTML(html);
range.collapse(false);
range.select();
}
}
// Used to normalise the effect of the enter key, since browsers
// do widely different things when pressing enter in designMode.
select.insertNewlineAtCursor = function (window) {
insertAtCursor(window, "<br>");
};
select.insertTabAtCursor = function (window) {
insertAtCursor(window, fourSpaces);
};
// Get the BR node at the start of the line on which the cursor
// currently is, and the offset into the line. Returns null as
// node if cursor is on first line.
select.cursorPos = function (container, start) {
var selection = container.ownerDocument.selection;
if (!selection) return null;
var topNode = select.selectionTopNode(container, start);
while (topNode && !isBR(topNode))
topNode = topNode.previousSibling;
var range = selection.createRange(), range2 = range.duplicate();
range.collapse(start);
if (topNode) {
range2.moveToElementText(topNode);
range2.collapse(false);
} else {
// When nothing is selected, we can get all kinds of funky errors here.
try {
range2.moveToElementText(container);
} catch (e) {
return null;
}
range2.collapse(true);
}
range.setEndPoint("StartToStart", range2);
return {node: topNode, offset: range.text.length};
};
select.setCursorPos = function (container, from, to) {
function rangeAt(pos) {
var range = container.ownerDocument.body.createTextRange();
if (!pos.node) {
range.moveToElementText(container);
range.collapse(true);
} else {
range.moveToElementText(pos.node);
range.collapse(false);
}
range.move("character", pos.offset);
return range;
}
var range = rangeAt(from);
if (to && to != from)
range.setEndPoint("EndToEnd", rangeAt(to));
range.select();
}
// Some hacks for storing and re-storing the selection when the editor loses and regains focus.
select.getBookmark = function (container) {
var from = select.cursorPos(container, true), to = select.cursorPos(container, false);
if (from && to) return {from: from, to: to};
};
// Restore a stored selection.
select.setBookmark = function (container, mark) {
if (!mark) return;
select.setCursorPos(container, mark.from, mark.to);
};
}
// W3C model
else {
// Store start and end nodes, and offsets within these, and refer
// back to the selection object from those nodes, so that this
// object can be updated when the nodes are replaced before the
// selection is restored.
select.markSelection = function (win) {
var selection = win.getSelection();
if (!selection || selection.rangeCount == 0)
return (currentSelection = null);
var range = selection.getRangeAt(0);
currentSelection = {
start: {node: range.startContainer, offset: range.startOffset},
end: {node: range.endContainer, offset: range.endOffset},
window: win,
changed: false
};
// We want the nodes right at the cursor, not one of their
// ancestors with a suitable offset. This goes down the DOM tree
// until a 'leaf' is reached (or is it *up* the DOM tree?).
function normalise(point) {
while (point.node.nodeType != 3 && !isBR(point.node)) {
var newNode = point.node.childNodes[point.offset] || point.node.nextSibling;
point.offset = 0;
while (!newNode && point.node.parentNode) {
point.node = point.node.parentNode;
newNode = point.node.nextSibling;
}
point.node = newNode;
if (!newNode)
break;
}
}
normalise(currentSelection.start);
normalise(currentSelection.end);
};
select.selectMarked = function () {
var cs = currentSelection;
if (!(cs && (cs.changed || (webkit && cs.start.node == cs.end.node)))) return;
var win = cs.window, range = win.document.createRange();
function setPoint(point, which) {
if (point.node) {
// Some magic to generalize the setting of the start and end
// of a range.
if (point.offset == 0)
range["set" + which + "Before"](point.node);
else
range["set" + which](point.node, point.offset);
} else {
range.setStartAfter(win.document.body.lastChild || win.document.body);
}
}
setPoint(cs.end, "End");
setPoint(cs.start, "Start");
selectRange(range, win);
};
// Helper for selecting a range object.
function selectRange(range, window) {
var selection = window.getSelection();
selection.removeAllRanges();
selection.addRange(range);
};
function selectionRange(window) {
var selection = window.getSelection();
if (!selection || selection.rangeCount == 0)
return false;
else
return selection.getRangeAt(0);
}
// Finding the top-level node at the cursor in the W3C is, as you
// can see, quite an involved process.
select.selectionTopNode = function (container, start) {
var range = selectionRange(container.ownerDocument.defaultView);
if (!range) return false;
var node = start ? range.startContainer : range.endContainer;
var offset = start ? range.startOffset : range.endOffset;
// Work around (yet another) bug in Opera's selection model.
if (window.opera && !start && range.endContainer == container && range.endOffset == range.startOffset + 1 &&
container.childNodes[range.startOffset] && isBR(container.childNodes[range.startOffset]))
offset--;
// For text nodes, we look at the node itself if the cursor is
// inside, or at the node before it if the cursor is at the
// start.
if (node.nodeType == 3) {
if (offset > 0)
return topLevelNodeAt(node, container);
else
return topLevelNodeBefore(node, container);
}
// Occasionally, browsers will return the HTML node as
// selection. If the offset is 0, we take the start of the frame
// ('after null'), otherwise, we take the last node.
else if (node.nodeName.toUpperCase() == "HTML") {
return (offset == 1 ? null : container.lastChild);
}
// If the given node is our 'container', we just look up the
// correct node by using the offset.
else if (node == container) {
return (offset == 0) ? null : node.childNodes[offset - 1];
}
// In any other case, we have a regular node. If the cursor is
// at the end of the node, we use the node itself, if it is at
// the start, we use the node before it, and in any other
// case, we look up the child before the cursor and use that.
else {
if (offset == node.childNodes.length)
return topLevelNodeAt(node, container);
else if (offset == 0)
return topLevelNodeBefore(node, container);
else
return topLevelNodeAt(node.childNodes[offset - 1], container);
}
};
select.focusAfterNode = function (node, container) {
var win = container.ownerDocument.defaultView,
range = win.document.createRange();
range.setStartBefore(container.firstChild || container);
// In Opera, setting the end of a range at the end of a line
// (before a BR) will cause the cursor to appear on the next
// line, so we set the end inside of the start node when
// possible.
if (node && !node.firstChild)
range.setEndAfter(node);
else if (node)
range.setEnd(node, node.childNodes.length);
else
range.setEndBefore(container.firstChild || container);
range.collapse(false);
selectRange(range, win);
};
select.somethingSelected = function (win) {
var range = selectionRange(win);
return range && !range.collapsed;
};
function insertNodeAtCursor(window, node) {
var range = selectionRange(window);
if (!range) return;
range.deleteContents();
range.insertNode(node);
webkitLastLineHack(window.document.body);
range = window.document.createRange();
range.selectNode(node);
range.collapse(false);
selectRange(range, window);
}
select.insertNewlineAtCursor = function (window) {
insertNodeAtCursor(window, window.document.createElement("BR"));
};
select.insertTabAtCursor = function (window) {
insertNodeAtCursor(window, window.document.createTextNode(fourSpaces));
};
select.cursorPos = function (container, start) {
var range = selectionRange(window);
if (!range) return;
var topNode = select.selectionTopNode(container, start);
while (topNode && !isBR(topNode))
topNode = topNode.previousSibling;
range = range.cloneRange();
range.collapse(start);
if (topNode)
range.setStartAfter(topNode);
else
range.setStartBefore(container);
return {node: topNode, offset: range.toString().length};
};
select.setCursorPos = function (container, from, to) {
var win = container.ownerDocument.defaultView,
range = win.document.createRange();
function setPoint(node, offset, side) {
if (!node)
node = container.firstChild;
else
node = node.nextSibling;
if (!node)
return;
if (offset == 0) {
range["set" + side + "Before"](node);
return true;
}
var backlog = []
function decompose(node) {
if (node.nodeType == 3)
backlog.push(node);
else
forEach(node.childNodes, decompose);
}
while (true) {
while (node && !backlog.length) {
decompose(node);
node = node.nextSibling;
}
var cur = backlog.shift();
if (!cur) return false;
var length = cur.nodeValue.length;
if (length >= offset) {
range["set" + side](cur, offset);
return true;
}
offset -= length;
}
}
to = to || from;
if (setPoint(to.node, to.offset, "End") && setPoint(from.node, from.offset, "Start"))
selectRange(range, win);
};
}
})();
-146
View File
@@ -1,146 +0,0 @@
/* String streams are the things fed to parsers (which can feed them
* to a tokenizer if they want). They provide peek and next methods
* for looking at the current character (next 'consumes' this
* character, peek does not), and a get method for retrieving all the
* text that was consumed since the last time get was called.
*
* An easy mistake to make is to let a StopIteration exception finish
* the token stream while there are still characters pending in the
* string stream (hitting the end of the buffer while parsing a
* token). To make it easier to detect such errors, the stringstreams
* throw an exception when this happens.
*/
// Make a stringstream stream out of an iterator that returns strings.
// This is applied to the result of traverseDOM (see codemirror.js),
// and the resulting stream is fed to the parser.
window.stringStream = function (source) {
// String that's currently being iterated over.
var current = "";
// Position in that string.
var pos = 0;
// Accumulator for strings that have been iterated over but not
// get()-ed yet.
var accum = "";
// Make sure there are more characters ready, or throw
// StopIteration.
function ensureChars() {
while (pos == current.length) {
accum += current;
current = ""; // In case source.next() throws
pos = 0;
try {
current = source.next();
} catch (e) {
if (e != StopIteration) throw e;
else return false;
}
}
return true;
}
return {
// Return the next character in the stream.
peek: function () {
if (!ensureChars()) return null;
return current.charAt(pos);
},
// Get the next character, throw StopIteration if at end, check
// for unused content.
next: function () {
if (!ensureChars()) {
if (accum.length > 0)
throw "End of stringstream reached without emptying buffer ('" + accum + "').";
else
throw StopIteration;
}
return current.charAt(pos++);
},
// Return the characters iterated over since the last call to
// .get().
get: function () {
var temp = accum;
accum = "";
if (pos > 0) {
temp += current.slice(0, pos);
current = current.slice(pos);
pos = 0;
}
return temp;
},
// Push a string back into the stream.
push: function (str) {
current = current.slice(0, pos) + str + current.slice(pos);
},
lookAhead: function (str, consume, skipSpaces, caseInsensitive) {
function cased(str) {
return caseInsensitive ? str.toLowerCase() : str;
}
str = cased(str);
var found = false;
var _accum = accum, _pos = pos;
if (skipSpaces) this.nextWhileMatches(/[\s\u00a0]/);
while (true) {
var end = pos + str.length, left = current.length - pos;
if (end <= current.length) {
found = str == cased(current.slice(pos, end));
pos = end;
break;
} else if (str.slice(0, left) == cased(current.slice(pos))) {
accum += current;
current = "";
try {
current = source.next();
} catch (e) {
break;
}
pos = 0;
str = str.slice(left);
} else {
break;
}
}
if (!(found && consume)) {
current = accum.slice(_accum.length) + current;
pos = _pos;
accum = _accum;
}
return found;
},
// Utils built on top of the above
more: function () {
return this.peek() !== null;
},
applies: function (test) {
var next = this.peek();
return (next !== null && test(next));
},
nextWhile: function (test) {
var next;
while ((next = this.peek()) !== null && test(next))
this.next();
},
matches: function (re) {
var next = this.peek();
return (next !== null && re.test(next));
},
nextWhileMatches: function (re) {
var next;
while ((next = this.peek()) !== null && re.test(next))
this.next();
},
equals: function (ch) {
return ch === this.peek();
},
endOfLine: function () {
var next = this.peek();
return next == null || next == "\n";
}
};
};
-59
View File
@@ -1,59 +0,0 @@
// A framework for simple tokenizers. Takes care of newlines and
// white-space, and of getting the text from the source stream into
// the token object. A state is a function of two arguments -- a
// string stream and a setState function. The second can be used to
// change the tokenizer's state, and can be ignored for stateless
// tokenizers. This function should advance the stream over a token
// and return a string or object containing information about the next
// token, or null to pass and have the (new) state be called to finish
// the token. When a string is given, it is wrapped in a {style, type}
// object. In the resulting object, the characters consumed are stored
// under the content property. Any whitespace following them is also
// automatically consumed, and added to the value property. (Thus,
// content is the actual meaningful part of the token, while value
// contains all the text it spans.)
function tokenizer(source, state) {
// Newlines are always a separate token.
function isWhiteSpace(ch) {
// The messy regexp is because IE's regexp matcher is of the
// opinion that non-breaking spaces are no whitespace.
return ch != "\n" && /^[\s\u00a0]*$/.test(ch);
}
var tokenizer = {
state: state,
take: function (type) {
if (typeof (type) == "string")
type = {style: type, type: type};
type.content = (type.content || "") + source.get();
if (!/\n$/.test(type.content))
source.nextWhile(isWhiteSpace);
type.value = type.content + source.get();
return type;
},
next: function () {
if (!source.more()) throw StopIteration;
var type;
if (source.equals("\n")) {
source.next();
return this.take("whitespace");
}
if (source.applies(isWhiteSpace))
type = "whitespace";
else
while (!type)
type = this.state(source, function (s) {
tokenizer.state = s;
});
return this.take(type);
}
};
return tokenizer;
}
-205
View File
@@ -1,205 +0,0 @@
/* Tokenizer for JavaScript code */
var tokenizeJavaScript = (function () {
// Advance the stream until the given character (not preceded by a
// backslash) is encountered, or the end of the line is reached.
function nextUntilUnescaped(source, end) {
var escaped = false;
var next;
while (!source.endOfLine()) {
var next = source.next();
if (next == end && !escaped)
return false;
escaped = !escaped && next == "\\";
}
return escaped;
}
// A map of JavaScript's keywords. The a/b/c keyword distinction is
// very rough, but it gives the parser enough information to parse
// correct code correctly (we don't care that much how we parse
// incorrect code). The style information included in these objects
// is used by the highlighter to pick the correct CSS style for a
// token.
var keywords = function () {
function result(type, style) {
return {type: type, style: "js-" + style};
}
// keywords that take a parenthised expression, and then a
// statement (if)
var keywordA = result("keyword a", "keyword");
// keywords that take just a statement (else)
var keywordB = result("keyword b", "keyword");
// keywords that optionally take an expression, and form a
// statement (return)
var keywordC = result("keyword c", "keyword");
var operator = result("operator", "keyword");
var atom = result("atom", "atom");
return {
"if": keywordA,
"while": keywordA,
"with": keywordA,
"else": keywordB,
"do": keywordB,
"try": keywordB,
"finally": keywordB,
"return": keywordC,
"break": keywordC,
"continue": keywordC,
"new": keywordC,
"delete": keywordC,
"throw": keywordC,
"in": operator,
"typeof": operator,
"instanceof": operator,
"var": result("var", "keyword"),
"function": result("function", "keyword"),
"catch": result("catch", "keyword"),
"for": result("for", "keyword"),
"switch": result("switch", "keyword"),
"case": result("case", "keyword"),
"default": result("default", "keyword"),
"true": atom,
"false": atom,
"null": atom,
"undefined": atom,
"NaN": atom,
"Infinity": atom
};
}();
// Some helper regexps
var isOperatorChar = /[+\-*&%=<>!?|]/;
var isHexDigit = /[0-9A-Fa-f]/;
var isWordChar = /[\w\$_]/;
// Wrapper around jsToken that helps maintain parser state (whether
// we are inside of a multi-line comment and whether the next token
// could be a regular expression).
function jsTokenState(inside, regexp) {
return function (source, setState) {
var newInside = inside;
var type = jsToken(inside, regexp, source, function (c) {
newInside = c;
});
var newRegexp = type.type == "operator" || type.type == "keyword c" || type.type.match(/^[\[{}\(,;:]$/);
if (newRegexp != regexp || newInside != inside)
setState(jsTokenState(newInside, newRegexp));
return type;
};
}
// The token reader, inteded to be used by the tokenizer from
// tokenize.js (through jsTokenState). Advances the source stream
// over a token, and returns an object containing the type and style
// of that token.
function jsToken(inside, regexp, source, setInside) {
function readHexNumber() {
source.next(); // skip the 'x'
source.nextWhileMatches(isHexDigit);
return {type: "number", style: "js-atom"};
}
function readNumber() {
source.nextWhileMatches(/[0-9]/);
if (source.equals(".")) {
source.next();
source.nextWhileMatches(/[0-9]/);
}
if (source.equals("e") || source.equals("E")) {
source.next();
if (source.equals("-"))
source.next();
source.nextWhileMatches(/[0-9]/);
}
return {type: "number", style: "js-atom"};
}
// Read a word, look it up in keywords. If not found, it is a
// variable, otherwise it is a keyword of the type found.
function readWord() {
source.nextWhileMatches(isWordChar);
var word = source.get();
var known = keywords.hasOwnProperty(word) && keywords.propertyIsEnumerable(word) && keywords[word];
return known ? {type: known.type, style: known.style, content: word} :
{type: "variable", style: "js-variable", content: word};
}
function readRegexp() {
nextUntilUnescaped(source, "/");
source.nextWhileMatches(/[gi]/);
return {type: "regexp", style: "js-string"};
}
// Mutli-line comments are tricky. We want to return the newlines
// embedded in them as regular newline tokens, and then continue
// returning a comment token for every line of the comment. So
// some state has to be saved (inside) to indicate whether we are
// inside a /* */ sequence.
function readMultilineComment(start) {
var newInside = "/*";
var maybeEnd = (start == "*");
while (true) {
if (source.endOfLine())
break;
var next = source.next();
if (next == "/" && maybeEnd) {
newInside = null;
break;
}
maybeEnd = (next == "*");
}
setInside(newInside);
return {type: "comment", style: "js-comment"};
}
function readOperator() {
source.nextWhileMatches(isOperatorChar);
return {type: "operator", style: "js-operator"};
}
function readString(quote) {
var endBackSlash = nextUntilUnescaped(source, quote);
setInside(endBackSlash ? quote : null);
return {type: "string", style: "js-string"};
}
// Fetch the next token. Dispatches on first character in the
// stream, or first two characters when the first is a slash.
if (inside == "\"" || inside == "'")
return readString(inside);
var ch = source.next();
if (inside == "/*")
return readMultilineComment(ch);
else if (ch == "\"" || ch == "'")
return readString(ch);
// with punctuation, the type of the token is the symbol itself
else if (/[\[\]{}\(\),;\:\.]/.test(ch))
return {type: ch, style: "js-punctuation"};
else if (ch == "0" && (source.equals("x") || source.equals("X")))
return readHexNumber();
else if (/[0-9]/.test(ch))
return readNumber();
else if (ch == "/") {
if (source.equals("*")) {
source.next();
return readMultilineComment(ch);
} else if (source.equals("/")) {
nextUntilUnescaped(source, null);
return {type: "comment", style: "js-comment"};
} else if (regexp)
return readRegexp();
else
return readOperator();
} else if (isOperatorChar.test(ch))
return readOperator();
else
return readWord();
}
// The external interface to the tokenizer.
return function (source, startState) {
return tokenizer(source, startState || jsTokenState(false, true));
};
})();
-423
View File
@@ -1,423 +0,0 @@
/**
* Storage and control for undo information within a CodeMirror
* editor. 'Why on earth is such a complicated mess required for
* that?', I hear you ask. The goal, in implementing this, was to make
* the complexity of storing and reverting undo information depend
* only on the size of the edited or restored content, not on the size
* of the whole document. This makes it necessary to use a kind of
* 'diff' system, which, when applied to a DOM tree, causes some
* complexity and hackery.
*
* In short, the editor 'touches' BR elements as it parses them, and
* the History stores these. When nothing is touched in commitDelay
* milliseconds, the changes are committed: It goes over all touched
* nodes, throws out the ones that did not change since last commit or
* are no longer in the document, and assembles the rest into zero or
* more 'chains' -- arrays of adjacent lines. Links back to these
* chains are added to the BR nodes, while the chain that previously
* spanned these nodes is added to the undo history. Undoing a change
* means taking such a chain off the undo history, restoring its
* content (text is saved per line) and linking it back into the
* document.
*/
// A history object needs to know about the DOM container holding the
// document, the maximum amount of undo levels it should store, the
// delay (of no input) after which it commits a set of changes, and,
// unfortunately, the 'parent' window -- a window that is not in
// designMode, and on which setTimeout works in every browser.
function History(container, maxDepth, commitDelay, editor) {
this.container = container;
this.maxDepth = maxDepth;
this.commitDelay = commitDelay;
this.editor = editor;
this.parent = editor.parent;
// This line object represents the initial, empty editor.
var initial = {text: "", from: null, to: null};
// As the borders between lines are represented by BR elements, the
// start of the first line and the end of the last one are
// represented by null. Since you can not store any properties
// (links to line objects) in null, these properties are used in
// those cases.
this.first = initial;
this.last = initial;
// Similarly, a 'historyTouched' property is added to the BR in
// front of lines that have already been touched, and 'firstTouched'
// is used for the first line.
this.firstTouched = false;
// History is the set of committed changes, touched is the set of
// nodes touched since the last commit.
this.history = [];
this.redoHistory = [];
this.touched = [];
}
History.prototype = {
// Schedule a commit (if no other touches come in for commitDelay
// milliseconds).
scheduleCommit: function () {
var self = this;
this.parent.clearTimeout(this.commitTimeout);
this.commitTimeout = this.parent.setTimeout(function () {
self.tryCommit();
}, this.commitDelay);
},
// Mark a node as touched. Null is a valid argument.
touch: function (node) {
this.setTouched(node);
this.scheduleCommit();
},
// Undo the last change.
undo: function () {
// Make sure pending changes have been committed.
this.commit();
if (this.history.length) {
// Take the top diff from the history, apply it, and store its
// shadow in the redo history.
var item = this.history.pop();
this.redoHistory.push(this.updateTo(item, "applyChain"));
this.notifyEnvironment();
return this.chainNode(item);
}
},
// Redo the last undone change.
redo: function () {
this.commit();
if (this.redoHistory.length) {
// The inverse of undo, basically.
var item = this.redoHistory.pop();
this.addUndoLevel(this.updateTo(item, "applyChain"));
this.notifyEnvironment();
return this.chainNode(item);
}
},
clear: function () {
this.history = [];
this.redoHistory = [];
},
// Ask for the size of the un/redo histories.
historySize: function () {
return {undo: this.history.length, redo: this.redoHistory.length};
},
// Push a changeset into the document.
push: function (from, to, lines) {
var chain = [];
for (var i = 0; i < lines.length; i++) {
var end = (i == lines.length - 1) ? to : this.container.ownerDocument.createElement("BR");
chain.push({from: from, to: end, text: cleanText(lines[i])});
from = end;
}
this.pushChains([chain], from == null && to == null);
this.notifyEnvironment();
},
pushChains: function (chains, doNotHighlight) {
this.commit(doNotHighlight);
this.addUndoLevel(this.updateTo(chains, "applyChain"));
this.redoHistory = [];
},
// Retrieve a DOM node from a chain (for scrolling to it after undo/redo).
chainNode: function (chains) {
for (var i = 0; i < chains.length; i++) {
var start = chains[i][0], node = start && (start.from || start.to);
if (node) return node;
}
},
// Clear the undo history, make the current document the start
// position.
reset: function () {
this.history = [];
this.redoHistory = [];
},
textAfter: function (br) {
return this.after(br).text;
},
nodeAfter: function (br) {
return this.after(br).to;
},
nodeBefore: function (br) {
return this.before(br).from;
},
// Commit unless there are pending dirty nodes.
tryCommit: function () {
if (!window.History) return; // Stop when frame has been unloaded
if (this.editor.highlightDirty()) this.commit(true);
else this.scheduleCommit();
},
// Check whether the touched nodes hold any changes, if so, commit
// them.
commit: function (doNotHighlight) {
this.parent.clearTimeout(this.commitTimeout);
// Make sure there are no pending dirty nodes.
if (!doNotHighlight) this.editor.highlightDirty(true);
// Build set of chains.
var chains = this.touchedChains(), self = this;
if (chains.length) {
this.addUndoLevel(this.updateTo(chains, "linkChain"));
this.redoHistory = [];
this.notifyEnvironment();
}
},
// [ end of public interface ]
// Update the document with a given set of chains, return its
// shadow. updateFunc should be "applyChain" or "linkChain". In the
// second case, the chains are taken to correspond the the current
// document, and only the state of the line data is updated. In the
// first case, the content of the chains is also pushed iinto the
// document.
updateTo: function (chains, updateFunc) {
var shadows = [], dirty = [];
for (var i = 0; i < chains.length; i++) {
shadows.push(this.shadowChain(chains[i]));
dirty.push(this[updateFunc](chains[i]));
}
if (updateFunc == "applyChain")
this.notifyDirty(dirty);
return shadows;
},
// Notify the editor that some nodes have changed.
notifyDirty: function (nodes) {
forEach(nodes, method(this.editor, "addDirtyNode"))
this.editor.scheduleHighlight();
},
notifyEnvironment: function () {
// Used by the line-wrapping line-numbering code.
if (window.frameElement && window.frameElement.CodeMirror.updateNumbers)
window.frameElement.CodeMirror.updateNumbers();
if (this.onChange) this.onChange();
},
// Link a chain into the DOM nodes (or the first/last links for null
// nodes).
linkChain: function (chain) {
for (var i = 0; i < chain.length; i++) {
var line = chain[i];
if (line.from) line.from.historyAfter = line;
else this.first = line;
if (line.to) line.to.historyBefore = line;
else this.last = line;
}
},
// Get the line object after/before a given node.
after: function (node) {
return node ? node.historyAfter : this.first;
},
before: function (node) {
return node ? node.historyBefore : this.last;
},
// Mark a node as touched if it has not already been marked.
setTouched: function (node) {
if (node) {
if (!node.historyTouched) {
this.touched.push(node);
node.historyTouched = true;
}
} else {
this.firstTouched = true;
}
},
// Store a new set of undo info, throw away info if there is more of
// it than allowed.
addUndoLevel: function (diffs) {
this.history.push(diffs);
if (this.history.length > this.maxDepth)
this.history.shift();
},
// Build chains from a set of touched nodes.
touchedChains: function () {
var self = this;
// The temp system is a crummy hack to speed up determining
// whether a (currently touched) node has a line object associated
// with it. nullTemp is used to store the object for the first
// line, other nodes get it stored in their historyTemp property.
var nullTemp = null;
function temp(node) {
return node ? node.historyTemp : nullTemp;
}
function setTemp(node, line) {
if (node) node.historyTemp = line;
else nullTemp = line;
}
function buildLine(node) {
var text = [];
for (var cur = node ? node.nextSibling : self.container.firstChild;
cur && !isBR(cur); cur = cur.nextSibling)
if (cur.currentText) text.push(cur.currentText);
return {from: node, to: cur, text: cleanText(text.join(""))};
}
// Filter out unchanged lines and nodes that are no longer in the
// document. Build up line objects for remaining nodes.
var lines = [];
if (self.firstTouched) self.touched.push(null);
forEach(self.touched, function (node) {
if (node && node.parentNode != self.container) return;
if (node) node.historyTouched = false;
else self.firstTouched = false;
var line = buildLine(node), shadow = self.after(node);
if (!shadow || shadow.text != line.text || shadow.to != line.to) {
lines.push(line);
setTemp(node, line);
}
});
// Get the BR element after/before the given node.
function nextBR(node, dir) {
var link = dir + "Sibling", search = node[link];
while (search && !isBR(search))
search = search[link];
return search;
}
// Assemble line objects into chains by scanning the DOM tree
// around them.
var chains = [];
self.touched = [];
forEach(lines, function (line) {
// Note that this makes the loop skip line objects that have
// been pulled into chains by lines before them.
if (!temp(line.from)) return;
var chain = [], curNode = line.from, safe = true;
// Put any line objects (referred to by temp info) before this
// one on the front of the array.
while (true) {
var curLine = temp(curNode);
if (!curLine) {
if (safe) break;
else curLine = buildLine(curNode);
}
chain.unshift(curLine);
setTemp(curNode, null);
if (!curNode) break;
safe = self.after(curNode);
curNode = nextBR(curNode, "previous");
}
curNode = line.to;
safe = self.before(line.from);
// Add lines after this one at end of array.
while (true) {
if (!curNode) break;
var curLine = temp(curNode);
if (!curLine) {
if (safe) break;
else curLine = buildLine(curNode);
}
chain.push(curLine);
setTemp(curNode, null);
safe = self.before(curNode);
curNode = nextBR(curNode, "next");
}
chains.push(chain);
});
return chains;
},
// Find the 'shadow' of a given chain by following the links in the
// DOM nodes at its start and end.
shadowChain: function (chain) {
var shadows = [], next = this.after(chain[0].from), end = chain[chain.length - 1].to;
while (true) {
shadows.push(next);
var nextNode = next.to;
if (!nextNode || nextNode == end)
break;
else
next = nextNode.historyAfter || this.before(end);
// (The this.before(end) is a hack -- FF sometimes removes
// properties from BR nodes, in which case the best we can hope
// for is to not break.)
}
return shadows;
},
// Update the DOM tree to contain the lines specified in a given
// chain, link this chain into the DOM nodes.
applyChain: function (chain) {
// Some attempt is made to prevent the cursor from jumping
// randomly when an undo or redo happens. It still behaves a bit
// strange sometimes.
var cursor = select.cursorPos(this.container, false), self = this;
// Remove all nodes in the DOM tree between from and to (null for
// start/end of container).
function removeRange(from, to) {
var pos = from ? from.nextSibling : self.container.firstChild;
while (pos != to) {
var temp = pos.nextSibling;
removeElement(pos);
pos = temp;
}
}
var start = chain[0].from, end = chain[chain.length - 1].to;
// Clear the space where this change has to be made.
removeRange(start, end);
// Insert the content specified by the chain into the DOM tree.
for (var i = 0; i < chain.length; i++) {
var line = chain[i];
// The start and end of the space are already correct, but BR
// tags inside it have to be put back.
if (i > 0)
self.container.insertBefore(line.from, end);
// Add the text.
var node = makePartSpan(fixSpaces(line.text), this.container.ownerDocument);
self.container.insertBefore(node, end);
// See if the cursor was on this line. Put it back, adjusting
// for changed line length, if it was.
if (cursor && cursor.node == line.from) {
var cursordiff = 0;
var prev = this.after(line.from);
if (prev && i == chain.length - 1) {
// Only adjust if the cursor is after the unchanged part of
// the line.
for (var match = 0; match < cursor.offset &&
line.text.charAt(match) == prev.text.charAt(match); match++) ;
if (cursor.offset > match)
cursordiff = line.text.length - prev.text.length;
}
select.setCursorPos(this.container, {node: line.from, offset: Math.max(0, cursor.offset + cursordiff)});
}
// Cursor was in removed line, this is last new line.
else if (cursor && (i == chain.length - 1) && cursor.node && cursor.node.parentNode != this.container) {
select.setCursorPos(this.container, {node: line.from, offset: line.text.length});
}
}
// Anchor the chain in the DOM tree.
this.linkChain(chain);
return start;
}
};
-157
View File
@@ -1,157 +0,0 @@
/* A few useful utility core. */
var internetExplorer = document.selection && window.ActiveXObject && /MSIE/.test(navigator.userAgent);
var webkit = /AppleWebKit/.test(navigator.userAgent);
var safari = /Apple Computers, Inc/.test(navigator.vendor);
// Capture a method on an object.
function method(obj, name) {
return function () {
obj[name].apply(obj, arguments);
};
}
// The value used to signal the end of a sequence in iterators.
var StopIteration = {
toString: function () {
return "StopIteration"
}
};
// Apply a function to each element in a sequence.
function forEach(iter, f) {
if (iter.next) {
try {
while (true) f(iter.next());
} catch (e) {
if (e != StopIteration) throw e;
}
} else {
for (var i = 0; i < iter.length; i++)
f(iter[i]);
}
}
// Map a function over a sequence, producing an array of results.
function map(iter, f) {
var accum = [];
forEach(iter, function (val) {
accum.push(f(val));
});
return accum;
}
// Create a predicate function that tests a string againsts a given
// regular expression. No longer used but might be used by 3rd party
// parsers.
function matcher(regexp) {
return function (value) {
return regexp.test(value);
};
}
// Test whether a DOM node has a certain CSS class. Much faster than
// the MochiKit equivalent, for some reason.
function hasClass(element, className) {
var classes = element.className;
return classes && new RegExp("(^| )" + className + "($| )").test(classes);
}
// Insert a DOM node after another node.
function insertAfter(newNode, oldNode) {
var parent = oldNode.parentNode;
parent.insertBefore(newNode, oldNode.nextSibling);
return newNode;
}
function removeElement(node) {
if (node.parentNode)
node.parentNode.removeChild(node);
}
function clearElement(node) {
while (node.firstChild)
node.removeChild(node.firstChild);
}
// Check whether a node is contained in another one.
function isAncestor(node, child) {
while (child = child.parentNode) {
if (node == child)
return true;
}
return false;
}
// The non-breaking space character.
var nbsp = "\u00a0";
var matching = {
"{": "}", "[": "]", "(": ")",
"}": "{", "]": "[", ")": "("
};
// Standardize a few unportable event properties.
function normaliseEvent(event) {
if (!event.stopPropagation) {
event.stopPropagation = function () {
this.cancelBubble = true;
};
event.preventDefault = function () {
this.returnValue = false;
};
}
if (!event.stop) {
event.stop = function () {
this.stopPropagation();
this.preventDefault();
};
}
if (event.type == "keypress") {
event.code = (event.charCode == null) ? event.keyCode : event.charCode;
event.character = String.fromCharCode(event.code);
}
return event;
}
// Portably register event handlers.
function addEventHandler(node, type, handler, removeFunc) {
function wrapHandler(event) {
handler(normaliseEvent(event || window.event));
}
if (typeof node.addEventListener == "function") {
node.addEventListener(type, wrapHandler, false);
if (removeFunc) return function () {
node.removeEventListener(type, wrapHandler, false);
};
} else {
node.attachEvent("on" + type, wrapHandler);
if (removeFunc) return function () {
node.detachEvent("on" + type, wrapHandler);
};
}
}
function nodeText(node) {
return node.textContent || node.innerText || node.nodeValue || "";
}
function nodeTop(node) {
var top = 0;
while (node.offsetParent) {
top += node.offsetTop;
node = node.offsetParent;
}
return top;
}
function isBR(node) {
var nn = node.nodeName;
return nn == "BR" || nn == "br";
}
function isSpan(node) {
var nn = node.nodeName;
return nn == "SPAN" || nn == "span";
}
-204
View File
@@ -1,204 +0,0 @@
var neoCMSGlobalPath = null, neoCMSPath = null, neoCMSHTMLEdit = null, neoCMSFiles = null, neoCMSFilePath = null,
neoCMSImagePath = null;
$(function () {
neocmsSetup();
$(window).bind('resize', windowResize);
$('#logout a').bind('click', logout);
$('#neoCMSPrefBtn').bind('click', savePrefs);
$('#neoCMSFTPBtn').bind('click', saveFTP);
$('#neoCMSFTPClearBtn').bind('click', clearFTPPrompt);
$('#neoCMSNewUserLink').bind('click', newUser);
$('#neoCMSNewUserCancel').bind('click', newUserCancel);
$('#neoCMSDashScrollWrap').height($(window).height() - 60);
$('#neoCMSAutoUpdate').bind('click', autoUpdatePrompt);
$('#neoCMSMessage').bind('keyup', function () {
if (getNoLines(this) > parseInt(this.rows)) this.rows = '' + Math.round((parseInt(this.rows) * 1.2))
})
});
neocmsSetup = function () {
$('#neoCMSTopBanner').css('background', 'url(../images/loading.gif) repeat-x bottom');
var prefsIframe;
try {
prefsIframe = document.createElement('<iframe name="neoCMSPrefsFrame" >')
} catch (ex) {
prefsIframe = document.createElement('iframe')
}
$(prefsIframe).attr({
id: 'neoCMSPrefsFrame',
name: 'neoCMSPrefsFrame',
src: '../core/sessionConfiguration.php',
application: 'yes'
}).css('display', 'none');
$('body').append(prefsIframe)
};
getGlobals = function (path, html, files, filePath, exFolders, imagePath) {
var absPath = window.location.href.split('/' + path + '/');
neoCMSGlobalPath = absPath[0] + '/' + path;
neoCMSPath = path;
neoCMSHTMLEdit = html;
neoCMSFiles = files;
neoCMSFilePath = filePath;
neoCMSImagePath = imagePath;
neoCMSExFolders = exFolders;
changePrefs()
};
savePrefs = function () {
var html = $('input[name=htmltoggle]:checked').val();
$('#neoCMSTopBanner').css('background', 'url(../images/loading.gif) repeat-x bottom');
var savePrefsIframe;
try {
savePrefsIframe = document.createElement('<iframe name="neoCMSSavePrefsFrame" >')
} catch (ex) {
savePrefsIframe = document.createElement('iframe')
}
$(savePrefsIframe).attr({
id: 'neoCMSSavePrefsFrame',
name: 'neoCMSSavePrefsFrame',
application: 'yes'
}).css('display', 'none');
$('body').append(savePrefsIframe);
$('#neoCMSPrefsForm')[0].submit()
};
changePrefs = function () {
var winHref = winHref = window.location.href;
var urlName = winHref.split('//');
urlName = urlName[1];
$('#neoCMSPath').empty();
var linkHref = winHref.split('settings/');
linkHref = linkHref[0];
$('#neoCMSPath').html(linkHref);
if (neoCMSHTMLEdit == 'Y') {
$('#htmltoggleon').attr({checked: 'checked'});
$('#htmltoggleoff').removeAttr('checked')
} else {
$('#htmltoggleoff').attr({checked: 'checked'});
$('#htmltoggleon').removeAttr('checked')
}
if (neoCMSFiles == 'Y') {
$('#filetoggleon').attr({checked: 'checked'});
$('#filetoggleoff').removeAttr('checked')
} else {
$('#filetoggleoff').attr({checked: 'checked'});
$('#filetoggleon').removeAttr('checked')
}
if (neoCMSFilePath != '') $('#neoCMSFilePath').val(neoCMSFilePath);
if (neoCMSImagePath != '') $('#neoCMSImagePath').val(neoCMSImagePath);
if (neoCMSExFolders != '') $('#neoCMSExFolders').val(neoCMSExFolders);
$('#neoCMSPrefsFrame, #neoCMSSavePrefsFrame').remove();
if ($('#neoCMSAcctFormSuperAdmin').length) neocmsUsers(); else $('#neoCMSTopBanner').css('background', 'none');
twitterFeed()
};
logout = function () {
$.ajax({
type: "POST", url: "../core/logout.php", success: function () {
window.location = '../../'
}
})
};
showPrompt = function () {
$('#neoCMSPrompt:hidden').css({display: "block", opacity: "0"}).fadeTo(300, 1.0, function () {
if ($.browser.msie) $(this)[0].style.removeAttribute('filter')
})
};
neocmsPromptTop = function () {
$('<div/>').attr('id', 'neoCMSPromptTop').appendTo('#neoCMSPrompt').append($('<img/>').attr({
src: '../images/img_upload_select_top.png',
height: '10',
width: '353',
alt: 'top'
}))
};
neocmsPromptBot = function () {
$('<div/>').attr('id', 'neoCMSPromptBot').appendTo('#neoCMSPrompt').append($('<img/>').attr({
src: '../images/img_upload_select_bottom.png',
height: '10',
width: '353',
alt: 'top'
}))
};
cancel = function () {
if ($('#neoCMSPromptWrap').length > 0) $('#neoCMSPromptWrap').remove();
$("#overlay").fadeTo(300, 0, function () {
$('#overlay').remove()
})
};
windowResize = function () {
if ($('#overlay').length) $('#overlay').css({width: $(window).width(), height: $(window).height()})
};
overlay = function (ele) {
$('<div/>').attr('id', 'overlay').height($(document).height()).width($(document).width()).appendTo('body').css({
display: "block",
opacity: "0"
}).fadeTo(300, 0.55)
};
userBar = function (message) {
if ($('#neoCMSPrompt').length) cancel();
$('#neoCMSTopBanner').css('background', 'none');
if (!$('#neoCMSUserBar').length) {
$('<div/>').addClass('neoCMSUserBar').attr('id', 'neoCMSUserBar').insertAfter('#neoCMSTopBanner').append($('<div/>').addClass('neoCMSUserBarIn').attr('id', 'neoCMSUserBarIn').append($('<a/>').attr('href', 'javascript:').html('Hide This Bar').bind('click', hideUserBar)).append($('<p/>')));
if (message.match(/successfully/gi)) {
$('#neoCMSUserBar').find('p').html('<strong>' + message + '</strong>').end().css('opacity', '0.4').animate({opacity: '1'}, 800);
var userBarFade = setTimeout(function () {
$('#neoCMSUserBar').animate({opacity: '0'}, 300, function () {
$('#neoCMSUserBar').remove()
})
}, 3500)
} else {
$('#neoCMSUserBar').find('p').html(message).end().hide().css({
opacity: '1.0',
backgroundColor: '#c6242b',
position: 'relative',
top: '0',
left: '0'
}).slideDown(300)
}
} else {
$('#neoCMSUserBar').remove();
window.clearTimeout(userBarFade);
userBar(message)
}
if ($('#neoCMSNewUser').css('display') == 'block') $('#neoCMSNewUser').find('input').val('').end().find('input:first').focus()
};
hideUserBar = function () {
if ($('#neoCMSUserBar').css('position') == 'relative') $('#neoCMSUserBar').animate({marginTop: '-26px'}, 300, function () {
$('#neoCMSUserBar').remove()
}); else $('#neoCMSUserBar').animate({opacity: '0'}, 200, function () {
$('#neoCMSUserBar').remove()
})
};
var v = 0;
removeFrames = function () {
$('#neoCMSUsersFrame, #neoCMSSaveUserFrame, #neoCMSDelUserFrame, #neoCMSSaveFTPFrame, #neoCMSClearFTPFrame').remove();
$('#neoCMSTopBanner').css('background', 'none');
cancel()
};
getNoLines = function (ele) {
var hardlines = ele.value.split('\n');
var total = hardlines.length;
for (var i = 0, len = hardlines.length; i < len; i++) {
total += Math.max(Math.round(hardlines[i].length / ele.cols), 1) - 1
}
return total
};
String.prototype.strReverse = function () {
var newstring = "";
for (var s = 0; s < this.length; s++) {
newstring = this.charAt(s) + newstring
}
return newstring
};
countContain = function (strPassword, strCheck) {
var nCount = 0;
for (i = 0; i < strPassword.length; i++) {
if (strCheck.indexOf(strPassword.charAt(i)) > -1) nCount++
}
return nCount
};
reloadPage = function () {
window.location.reload(true);
window.location.reload(true)
};
-2564
View File
File diff suppressed because it is too large Load Diff
-4367
View File
File diff suppressed because it is too large Load Diff
-271
View File
@@ -1,271 +0,0 @@
var ifrDoc;
$(function () {
if (!$('#neoCMSDashScrollWrap').length) tempCache();
$('#neoCMSConfigRetry').bind('click', function () {
window.location.reload(true)
});
$('#neoCMSLoginWrap').css({display: "block", opacity: "0"}).fadeTo(600, 1.0, function () {
if ($.browser.msie) $(this, ifrDoc)[0].style.removeAttribute('filter');
overlay()
});
$(window).bind('resize', windowResize);
$('#neoCMSLoginForm').bind('submit', loginSubmit);
$('#neoCMSUsername input').focus();
$('#neoCMSHome').bind('click', function () {
checkURL(fpath())
});
fBrowseBind()
});
tempCache = function () {
$.ajax({url: "templates/editor.html", cache: true, dataType: "html"});
$.ajax({url: "templates/image-editor.html", cache: true, dataType: "html"});
$.ajax({url: "templates/video-editor.html", cache: true, dataType: "html"});
$.ajax({url: "templates/html-editor.html", cache: true, dataType: "html"});
$.ajax({url: "templates/link-editor.html", cache: true, dataType: "html"});
$.ajax({url: "templates/table-editor.html", cache: true, dataType: "html"});
$.ajax({url: "templates/prompt.html", cache: true, dataType: "html"});
$.ajax({url: "templates/upload.html", cache: true, dataType: "html"})
};
fBrowseBind = function () {
$('.neoCMSFBrowse').unbind('click').bind('click', function () {
linkFiles($(this).attr('rel'))
})
};
getIfrDoc = function () {
ifrDoc = $('#neoCMSPageSrc')[0];
ifrDoc = (ifrDoc.contentDocument) ? ifrDoc.contentDocument : ifrDoc.contentWindow.document
};
loginSubmit = function () {
if (loginValid()) {
var loginIframe;
try {
loginIframe = document.createElement('<iframe name="neoCMSLoginIframe" >')
} catch (ex) {
loginIframe = document.createElement('iframe')
}
$(loginIframe).attr({
id: 'neoCMSLoginIframe',
name: 'neoCMSLoginIframe',
application: 'yes'
}).css('display', 'none');
$('body').append(loginIframe);
$('#neoCMSLoginForm')[0].submit()
} else return false
};
loginValid = function () {
var user = $('#neoCMSUsername input').val(), ret = false;
if (user == '') $('#neoCMSUsername p').css('display', 'inline'); else $('#neoCMSUsername p').css('display', 'none');
if ($('#neoCMSPassword input').length) {
var pass = $('#neoCMSPassword input').val();
if (pass == '') $('#neoCMSPassword p').css('display', 'inline'); else $('#neoCMSPassword p').css('display', 'none');
if (user != '' && pass != '') ret = true;
return ret
} else {
if (user != '') ret = true;
return ret
}
};
loginIncorr = function (message) {
$('#neoCMSEnter p.error').html(message).css('display', 'block');
$('#neoCMSLoginIframe').remove()
};
windowResize = function () {
if ($('.neoCMSIcon, .neoCMSRepIcon', ifrDoc).length) destroyIcons();
if ($('#overlay').length) $('#overlay').css({width: $(window).width(), height: $(window).height()});
if ($('.neoCMSEle', ifrDoc).length) {
if ($('#neoCMSEditWrap').length) {
$('#neoCMSEditWrap').css('opacity', '0');
if (typeof (windowOrient == 'function')) windowOrient()
}
}
if (!$('#neoCMSLoginWrap, #neoCMSEditWrap, #neoCMSPrompt').length) {
if (!$('.neoCMSIcon, .neoCMSRepIcon', ifrDoc).length && $('[neocmsid]', ifrDoc).length) createIcons(true);
$('#neoCMSPageSrc').height($(window).height() - 60)
}
};
overlay = function (ele) {
if (!$('#overlay').length) {
$('<div/>').attr('id', 'overlay').height($(document).height()).width($(document).width()).appendTo('body').css({
display: 'block',
opacity: '0'
}).fadeTo(300, 0.55, function () {
if (ifrDoc) {
if ($('.neoCMSIcon, .neoCMSRepIcon', ifrDoc).length) destroyIcons();
if (ele) {
if (ele.tagName == 'IMG') imageEditBuilder(ele); else if (ele.tagName == 'OBJECT' || ele.tagName == 'EMBED') videoPrompt(ele); else createTextArea(ele)
}
}
})
} else if ($('#neoCMSEditWrap').length) $('#neoCMSEditWrap').addClass('disabled').prepend($('<div id="overlayEditWrap"></div>'))
};
promptOverlay = function () {
if ($('#neoCMSPrompt').length) $('#neoCMSPrompt').addClass('disabled').prepend($('<div id="overlayEditWrap"></div>'))
};
removeOverlay = function () {
$('#overlay').remove();
$('.neoCMSEle', ifrDoc).css('visibility', 'visible').removeClass('neoCMSEle');
$('.neoCMSEle').css('visibility', 'visible').removeClass('neoCMSEle')
};
cancel = function () {
var tinyDoc = getTinyDoc();
if ($('#neoCMSEditWrap').length && !$('#neoCMSPromptWrap').length) {
$('object, embed', tinyDoc).remove();
tinyMCE.execCommand('mceRemoveControl', false, 'neoCMSEditContent');
$(tinyDoc).remove();
$('#neoCMSEditWrap').remove();
$(window).unbind('keypress, keydown');
if ($('.neocmsRepeatArea', ifrDoc).length) neocmsRepBind();
removeOverlay();
$('object, embed', ifrDoc).removeClass('neoCMSFlash');
createIcons(true)
} else if ($('#neoCMSEditWrap').length && $('#neoCMSPromptWrap').length) {
$('#neoCMSPromptWrap, #neoCMSFilesWrap, #overlayEditWrap').remove();
keyHandler(false);
$('#neoCMSEditWrap').removeClass('disabled');
$('object, embed', tinyDoc).removeClass('neoCMSFlash')
} else {
$('#neoCMSPromptWrap, #neoCMSFilesWrap, #overlayEditWrap').remove();
$(window).unbind('keypress, keydown');
if (!$('.neoCMSIcon, .neoCMSRepIcon', ifrDoc).length && $('[neocmsid]', ifrDoc).length) createIcons(true);
removeOverlay();
$('object, embed', ifrDoc).removeClass('neoCMSFlash')
}
$('#neoCMSUploadImgClone, #neoCMSVidClone', ifrDoc).remove();
$(window).bind('resize', windowResize)
};
fpath = function () {
var preg = new RegExp('(\/' + neoCMSPath + '(\/[^\/]*|))$'), p = neoCMSGlobalPath.replace(preg, '/');
return p
};
linkBind = function () {
$('a', ifrDoc).not('.neoCMSIcon, .neoCMSRepIcon, [href="javascript:"], [href="javascript:void(0);"], [href="#"]').each(function () {
if (!$(this, ifrDoc).attr('rel').match(/lightbox/)) {
$(this, ifrDoc).unbind('click').bind('click', function () {
checkURL($(this, ifrDoc)[0].href);
return false
})
}
})
};
checkURL = function (linky) {
var linkHref = (linky.match('://')) ? linky.split('://') : linky;
$('#neoCMSFilesWrap').remove();
if ((linkHref[0] == 'http' || linkHref[0] == 'https') && linkHref[1]) {
if (linkHref[1].match('/')) linkHref = linkHref[1].split('/');
linkHref = linkHref[0].split(':');
linkHref = linkHref[0];
var neoCMSLoc = window.location.href.split('//');
neoCMSLoc = neoCMSLoc[1].split('/');
neoCMSLoc = neoCMSLoc[0];
if (linkHref == neoCMSLoc || linkHref == 'www.' + neoCMSLoc) {
if ($('#neoCMSPageEdits .edit', ifrDoc).length) {
console.log(linkHref);
navAwayPrompt(linky, 'loc')
} else {
console.log($('#neoCMSPageSrc').length);
if ($('#neoCMSPageSrc').length) {
$.ajax({
type: "POST", url: "core/getpage.php", data: "page=" + linky, success: function () {
if (frames['neoCMSPageSrc'].contentWindow) frames['neoCMSPageSrc'].contentWindow.location.href = linky; else frames['neoCMSPageSrc'].location.href = linky
}
})
} else {
$.ajax({
type: "POST", url: "../core/getpage.php", data: "page=" + linky, success: function () {
window.location = '../'
}
})
}
}
} else navAwayPrompt(linky)
}
};
navAwayPrompt = function (lnk, loc) {
overlay();
if (!$('#neoCMSPrompt').length) {
$('body').append($('<div/>').attr('id', 'neoCMSPromptWrap').load('templates/prompt.html', function () {
var navTitle = (loc) ? 'You Have Unpublished Changes On This Page' : 'You Are Leaving neocms',
navTitle = (loc) ? 'Continue' : 'Leave neocms', navBtn = (loc) ? 'continue' : 'leave';
$('#neoCMSPrompt h4.neoCMSPromptTitle').html(navTitle);
$('#neoCMSPrompt p').html('Are you sure you want proceed? You will lose all your unpublished changes.');
$('#neoCMSPromptBtn').attr('title', navTitle).html(navBtn).bind('click', function () {
navAwaySubmit(lnk, loc)
});
$('#neoCMSCancelBtn').bind('click', cancel);
showPrompt('nodrag')
}))
}
};
navAwaySubmit = function (lnk, loc) {
if (loc) {
if (lnk == 'settings/') {
window.location = lnk
} else {
if (frames['neoCMSPageSrc'].contentWindow) frames['neoCMSPageSrc'].contentWindow.location.href = lnk; else frames['neoCMSPageSrc'].location.href = lnk
}
cancel()
} else window.location = lnk
};
linkFiles = function (target) {
$('body').prepend($('<div/>').attr('id', 'neoCMSFilesWrap').load(fpath() + neoCMSPath + '/templates/file-browser.html', function () {
overlay();
$('#neoCMSFilesWrap').css('display', 'block');
fileTarget = target;
fileBrowser(target);
promptOverlay()
}))
};
fileBrowser = function (target) {
var fileIframe,
type = (target.match(/#neoCMSImgAddress/)) ? 'img' : (target.match(/#neoCMSPages/)) ? 'pages' : 'all';
try {
fileIframe = document.createElement('<iframe name="neoCMSFileFrame" >')
} catch (ex) {
fileIframe = document.createElement('iframe')
}
$(fileIframe).attr({
id: 'neoCMSFileFrame',
name: 'neoCMSFileFrame',
src: fpath() + neoCMSPath + '/core/fileload.php?type=' + type,
application: 'yes'
}).css('display', 'none').appendTo('body')
};
fileOption = function (matches) {
$('#neoCMSFileULs').append(matches)
};
destroyFileLoader = function (type) {
$('#neoCMSFileLoading').remove();
if (type == 'img') $('#neoCMSFiles h2').html('Select the image you are looking for:'); else if (type == 'pages') $('#neoCMSFiles h2').html('Select the page you are looking for:'); else $('#neoCMSFiles h2').html('Select the file you are looking for:');
$('#neoCMSFClose').bind('click', linkClose);
if (type == 'pages') $('#neoCMSPagesUL li').unbind('click').bind('click', function () {
checkURL($(this).attr('href'));
return false
}); else if (type != 'none') $('#neoCMSFileULs li').unbind('click').bind('click', function () {
linkSel(this)
});
if (type == 'all') {
$('#filesTab').css('display', 'block');
$('#neoCMSFileULs ul').css('display', 'none');
$('#neoCMSPagesUL').css('display', 'block');
$('#pages').addClass('on');
$('#filesTab a').unbind('click').bind('click', function () {
$('#filesTab li.on').removeClass('on');
$(this).parent().addClass('on');
$('#neoCMSFileULs ul').css('display', 'none');
$($(this).attr('rel')).css('display', 'block')
})
} else $('#filesTab').css('display', 'none');
$('#neoCMSFileFrame').remove()
};
linkSel = function (t) {
var v = ($(t).find('p').length) ? $(t).find('p').html() : $(t).html();
$(fileTarget).val(v);
if (fileTarget == '#neoCMSImgAddress') imageSrc();
linkClose()
};
linkClose = function () {
$('#neoCMSFilesWrap, #neoCMSPrompt #overlayEditWrap').remove();
if (!$('#neoCMSEditWrap, #neoCMSPrompt').length) $('#overlay').remove();
$('#neoCMSPrompt').removeClass('disabled');
if ($('[neocmsid]', ifrDoc).length) createIcons(true)
};
-173
View File
@@ -1,173 +0,0 @@
tinyMCE.addI18n({
en: {
common: {
edit_confirm: "Do you want to use the WYSIWYG mode for this textarea?",
apply: "Apply",
insert: "Insert",
update: "Update",
cancel: "Cancel",
close: "Close",
browse: "Browse",
class_name: "Class",
not_set: "-- Not set --",
clipboard_msg: "Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?",
clipboard_no_support: "Currently not supported by your browser, use keyboard shortcuts instead.",
popup_blocked: "Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.",
invalid_data: "Error: Invalid values entered, these are marked in red.",
more_colors: "More colors"
},
contextmenu: {
align: "Alignment",
left: "Left",
center: "Center",
right: "Right",
full: "Full"
},
insertdatetime: {
date_fmt: "%Y-%m-%d",
time_fmt: "%H:%M:%S",
insertdate_desc: "Insert date",
inserttime_desc: "Insert time",
months_long: "January,February,March,April,May,June,July,August,September,October,November,December",
months_short: "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec",
day_long: "Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday",
day_short: "Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun"
},
print: {
print_desc: "Print"
},
preview: {
preview_desc: "Preview"
},
directionality: {
ltr_desc: "Direction left to right",
rtl_desc: "Direction right to left"
},
layer: {
insertlayer_desc: "Insert new layer",
forward_desc: "Move forward",
backward_desc: "Move backward",
absolute_desc: "Toggle absolute positioning",
content: "New layer..."
},
save: {
save_desc: "Save",
cancel_desc: "Cancel all changes"
},
nonbreaking: {
nonbreaking_desc: "Insert non-breaking space character"
},
iespell: {
iespell_desc: "Run spell checking",
download: "ieSpell not detected. Do you want to install it now?"
},
advhr: {
advhr_desc: "Horizontal rule"
},
emotions: {
emotions_desc: "Emotions"
},
searchreplace: {
search_desc: "Find",
replace_desc: "Find/Replace"
},
advimage: {
image_desc: "Insert/edit image"
},
advlink: {
link_desc: "Insert/edit link"
},
xhtmlxtras: {
cite_desc: "Citation",
abbr_desc: "Abbreviation",
acronym_desc: "Acronym",
del_desc: "Deletion",
ins_desc: "Insertion",
attribs_desc: "Insert/Edit Attributes"
},
style: {
desc: "Edit CSS Style"
},
paste: {
paste_text_desc: "Paste as Plain Text",
paste_word_desc: "Paste from Word",
selectall_desc: "Select All",
plaintext_mode_sticky: "Paste is now in plain text mode. Click again to toggle back to regular paste mode. After you paste something you will be returned to regular paste mode.",
plaintext_mode: "Paste is now in plain text mode. Click again to toggle back to regular paste mode."
},
paste_dlg: {
text_title: "Use CTRL+V on your keyboard to paste the text into the window.",
text_linebreaks: "Keep linebreaks",
word_title: "Use CTRL+V on your keyboard to paste the text into the window."
},
table: {
desc: "Inserts a new table",
row_before_desc: "Insert row before",
row_after_desc: "Insert row after",
delete_row_desc: "Delete row",
col_before_desc: "Insert column before",
col_after_desc: "Insert column after",
delete_col_desc: "Remove column",
split_cells_desc: "Split merged table cells",
merge_cells_desc: "Merge table cells",
row_desc: "Table row properties",
cell_desc: "Table cell properties",
props_desc: "Table properties",
paste_row_before_desc: "Paste table row before",
paste_row_after_desc: "Paste table row after",
cut_row_desc: "Cut table row",
copy_row_desc: "Copy table row",
del: "Delete table",
row: "Row",
col: "Column",
cell: "Cell"
},
autosave: {
unload_msg: "The changes you made will be lost if you navigate away from this page.",
restore_content: "Restore auto-saved content.",
warning_message: "If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?."
},
fullscreen: {
desc: "Toggle fullscreen mode"
},
media: {
desc: "Insert / edit embedded media",
edit: "Edit embedded media"
},
fullpage: {
desc: "Document properties"
},
template: {
desc: "Insert predefined template content"
},
visualchars: {
desc: "Visual control characters on/off."
},
spellchecker: {
desc: "Toggle spellchecker",
menu: "Spellchecker settings",
ignore_word: "Ignore word",
ignore_words: "Ignore all",
langs: "Languages",
wait: "Please wait...",
sug: "Suggestions",
no_sug: "No suggestions",
no_mpell: "No misspellings found."
},
pagebreak: {
desc: "Insert page break."
},
advlist: {
types: "Types",
def: "Default",
lower_alpha: "Lower alpha",
lower_greek: "Lower greek",
lower_roman: "Lower roman",
upper_alpha: "Upper alpha",
upper_roman: "Upper roman",
circle: "Circle",
disc: "Disc",
square: "Square"
}
}
});
-38
View File
@@ -1,38 +0,0 @@
(function () {
tinymce.create('tinymce.plugins.deflist', {
init: function (ed, url) {
ed.addCommand('mceDeflist', function () {
defListBuilder();
});
ed.addButton('deflist', {
title: 'Definition List',
cmd: 'mceDeflist'
});
ed.onNodeChange.add(function (ed, cm, n) {
cm.setActive('deflist', n.nodeName == 'DT' || n.nodeName == 'DD');
});
},
createControl: function (n, cm) {
return null;
},
getInfo: function () {
return {
longname: 'Definition List',
author: '',
authorurl: '',
infourl: '',
version: "1.0"
};
}
});
tinymce.PluginManager.add('deflist', tinymce.plugins.deflist);
})();
-38
View File
@@ -1,38 +0,0 @@
(function () {
tinymce.create('tinymce.plugins.file', {
init: function (ed, url) {
ed.addCommand('mceFile', function () {
uploadPrompt();
});
ed.addButton('file', {
title: 'Upload a File',
cmd: 'mceFile'
});
//
// ed.onNodeChange.add(function(ed, cm, n) {
// cm.setActive('deflist', n.nodeName == 'DT' || n.nodeName == 'DD');
// });
},
createControl: function (n, cm) {
return null;
},
getInfo: function () {
return {
longname: 'File Upload Interface',
author: '',
authorurl: '',
infourl: '',
version: "1.0"
};
}
});
tinymce.PluginManager.add('file', tinymce.plugins.file);
})();
-38
View File
@@ -1,38 +0,0 @@
(function () {
tinymce.create('tinymce.plugins.images', {
init: function (ed, url) {
ed.addCommand('mceImages', function () {
imageEditBuilder(false);
});
ed.addButton('image', {
title: 'Add or Edit an Image',
cmd: 'mceImages'
});
ed.onNodeChange.add(function (ed, cm, n) {
cm.setActive('image', n.nodeName == 'IMG');
});
},
createControl: function (n, cm) {
return null;
},
getInfo: function () {
return {
longname: 'neocms Image Editor',
author: '',
authorurl: '',
infourl: '',
version: "1.0"
};
}
});
tinymce.PluginManager.add('images', tinymce.plugins.images);
})();
-37
View File
@@ -1,37 +0,0 @@
(function () {
tinymce.create('tinymce.plugins.links', {
init: function (ed, url) {
ed.addCommand('mceLinks', function () {
makeLink();
});
ed.addButton('link', {
title: 'Add or Edit a Link',
cmd: 'mceLinks'
});
ed.onNodeChange.add(function (ed, cm, n) {
cm.setActive('link', n.nodeName == 'A');
});
},
createControl: function (n, cm) {
return null;
},
getInfo: function () {
return {
longname: 'neocms Link Editor',
author: '',
authorurl: '',
infourl: '',
version: "1.0"
};
}
});
tinymce.PluginManager.add('links', tinymce.plugins.links);
})();
File diff suppressed because one or more lines are too long
-36
View File
@@ -1,36 +0,0 @@
tinyMCEPopup.requireLangPack();
var PasteTextDialog = {
init: function () {
this.resize();
},
insert: function () {
var h = tinyMCEPopup.dom.encode(document.getElementById('content').value), lines;
// Convert linebreaks into paragraphs
if (document.getElementById('linebreaks').checked) {
lines = h.split(/\r?\n/);
if (lines.length > 1) {
h = '';
tinymce.each(lines, function (row) {
h += '<p>' + row + '</p>';
});
}
}
tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content: h});
tinyMCEPopup.close();
},
resize: function () {
var vp = tinyMCEPopup.dom.getViewPort(window), el;
el = document.getElementById('content');
el.style.width = (vp.w - 20) + 'px';
el.style.height = (vp.h - 90) + 'px';
}
};
tinyMCEPopup.onInit.add(PasteTextDialog.init, PasteTextDialog);
-51
View File
@@ -1,51 +0,0 @@
tinyMCEPopup.requireLangPack();
var PasteWordDialog = {
init: function () {
var ed = tinyMCEPopup.editor, el = document.getElementById('iframecontainer'), ifr, doc, css, cssHTML = '';
// Create iframe
el.innerHTML = '<iframe id="iframe" src="javascript:\'\';" frameBorder="0" style="border: 1px solid gray"></iframe>';
ifr = document.getElementById('iframe');
doc = ifr.contentWindow.document;
// Force absolute CSS urls
css = [ed.baseURI.toAbsolute("themes/" + ed.settings.theme + "/skins/" + ed.settings.skin + "/content.css")];
css = css.concat(tinymce.explode(ed.settings.content_css) || []);
tinymce.each(css, function (u) {
cssHTML += '<link href="' + ed.documentBaseURI.toAbsolute('' + u) + '" rel="stylesheet" type="text/css" />';
});
// Write content into iframe
doc.open();
doc.write('<html><head>' + cssHTML + '</head><body class="mceContentBody" spellcheck="false"></body></html>');
doc.close();
doc.designMode = 'on';
this.resize();
window.setTimeout(function () {
ifr.contentWindow.focus();
}, 10);
},
insert: function () {
var h = document.getElementById('iframe').contentWindow.document.body.innerHTML;
tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content: h, wordContent: true});
tinyMCEPopup.close();
},
resize: function () {
var vp = tinyMCEPopup.dom.getViewPort(window), el;
el = document.getElementById('iframe');
if (el) {
el.style.width = (vp.w - 20) + 'px';
el.style.height = (vp.h - 90) + 'px';
}
}
};
tinyMCEPopup.onInit.add(PasteWordDialog.init, PasteWordDialog);
-5
View File
@@ -1,5 +0,0 @@
tinyMCE.addI18n('en.paste_dlg', {
text_title: "Use CTRL+V on your keyboard to paste the text into the window.",
text_linebreaks: "Keep linebreaks",
word_title: "Use CTRL+V on your keyboard to paste the text into the window."
});
-38
View File
@@ -1,38 +0,0 @@
(function () {
tinymce.create('tinymce.plugins.tables', {
init: function (ed, url) {
ed.addCommand('mceTables', function () {
makeTable();
});
ed.addButton('table', {
title: 'Add a Table',
cmd: 'mceTables'
});
//
// ed.onNodeChange.add(function(ed, cm, n) {
// cm.setActive('link', n.nodeName == 'A');
// });
},
createControl: function (n, cm) {
return null;
},
getInfo: function () {
return {
longname: 'neocms Table Creator',
author: '',
authorurl: '',
infourl: '',
version: "1.0"
};
}
});
tinymce.PluginManager.add('tables', tinymce.plugins.tables);
})();
-38
View File
@@ -1,38 +0,0 @@
(function () {
tinymce.create('tinymce.plugins.video', {
init: function (ed, url) {
ed.addCommand('mceVideo', function () {
videoPrompt();
});
ed.addButton('video', {
title: 'Embed Video',
cmd: 'mceVideo'
});
ed.onNodeChange.add(function (ed, cm, n) {
cm.setActive('video', n.nodeName == 'EMBED' || n.nodeName == 'OBJECT');
});
},
createControl: function (n, cm) {
return null;
},
getInfo: function () {
return {
longname: 'Video Embed',
author: '',
authorurl: '',
infourl: '',
version: "1.0"
};
}
});
tinymce.PluginManager.add('video', tinymce.plugins.video);
})();
File diff suppressed because one or more lines are too long
-62
View File
@@ -1,62 +0,0 @@
tinyMCE.addI18n('en.advanced', {
style_select: "Styles",
font_size: "Font size",
fontdefault: "Font family",
block: "Format",
paragraph: "Paragraph",
div: "Div",
address: "Address",
pre: "Preformatted",
h1: "Heading 1",
h2: "Heading 2",
h3: "Heading 3",
h4: "Heading 4",
h5: "Heading 5",
h6: "Heading 6",
blockquote: "Blockquote",
code: "Code",
samp: "Code sample",
dt: "Definition term ",
dd: "Definition description",
bold_desc: "Bold (Ctrl+B)",
italic_desc: "Italic (Ctrl+I)",
underline_desc: "Underline (Ctrl+U)",
striketrough_desc: "Strikethrough",
justifyleft_desc: "Align left",
justifycenter_desc: "Align center",
justifyright_desc: "Align right",
justifyfull_desc: "Align full",
bullist_desc: "Unordered list",
numlist_desc: "Ordered list",
outdent_desc: "Outdent",
indent_desc: "Indent",
undo_desc: "Undo (Ctrl+Z)",
redo_desc: "Redo (Ctrl+Y)",
link_desc: "Insert/edit link",
unlink_desc: "Unlink",
image_desc: "Insert/edit image",
cleanup_desc: "Cleanup messy code",
code_desc: "Edit HTML Source",
sub_desc: "Subscript",
sup_desc: "Superscript",
hr_desc: "Insert horizontal ruler",
removeformat_desc: "Remove formatting",
custom1_desc: "Your custom description here",
forecolor_desc: "Select text color",
backcolor_desc: "Select background color",
charmap_desc: "Insert custom character",
visualaid_desc: "Toggle guidelines/invisible elements",
anchor_desc: "Insert/edit anchor",
cut_desc: "Cut",
copy_desc: "Copy",
paste_desc: "Paste",
image_props_desc: "Image properties",
newdocument_desc: "New document",
help_desc: "Help",
blockquote_desc: "Blockquote",
clipboard_msg: "Copy/Cut/Paste is not available in Mozilla and Firefox.\r\nDo you want more information about this issue?",
path: "Path",
newdocument: "Are you sure you want clear all contents?",
toolbar_focus: "Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X",
more_colors: "More colors"
});
-51
View File
@@ -1,51 +0,0 @@
tinyMCE.addI18n('en.advanced_dlg', {
about_title: "About TinyMCE",
about_general: "About",
about_help: "Help",
about_license: "License",
about_plugins: "Plugins",
about_plugin: "Plugin",
about_author: "Author",
about_version: "Version",
about_loaded: "Loaded plugins",
anchor_title: "Insert/edit anchor",
anchor_name: "Anchor name",
code_title: "HTML Source Editor",
code_wordwrap: "Word wrap",
colorpicker_title: "Select a color",
colorpicker_picker_tab: "Picker",
colorpicker_picker_title: "Color picker",
colorpicker_palette_tab: "Palette",
colorpicker_palette_title: "Palette colors",
colorpicker_named_tab: "Named",
colorpicker_named_title: "Named colors",
colorpicker_color: "Color:",
colorpicker_name: "Name:",
charmap_title: "Select custom character",
image_title: "Insert/edit image",
image_src: "Image URL",
image_alt: "Image description",
image_list: "Image list",
image_border: "Border",
image_dimensions: "Dimensions",
image_vspace: "Vertical space",
image_hspace: "Horizontal space",
image_align: "Alignment",
image_align_baseline: "Baseline",
image_align_top: "Top",
image_align_middle: "Middle",
image_align_bottom: "Bottom",
image_align_texttop: "Text top",
image_align_textbottom: "Text bottom",
image_align_left: "Left",
image_align_right: "Right",
link_title: "Insert/edit link",
link_url: "Link URL",
link_target: "Target",
link_target_same: "Open link in the same window",
link_target_blank: "Open link in a new window",
link_titlefield: "Title",
link_is_email: "The URL you entered seems to be an email address, do you want to add the required mailto: prefix?",
link_is_external: "The URL you entered seems to external link, do you want to add the required http:// prefix?",
link_list: "Link list"
});
@@ -1,80 +0,0 @@
/* body element reset */
html, body {
background: transparent !important;
color: none;
border: none;
height: auto;
width: auto;
margin: 0 !important;
padding: 0 !important;
overflow: auto;
}
body {
overflow: visible !important;
}
body, html {
*overflow: auto !important;
}
* {
outline: invert none medium !important;
}
td {
border: 1px dashed #999;
}
object, embed {
display: block !important;
background: url(../../../../../../images/embed.png) no-repeat center #eee !important;
border: 1px dashed #ccc !important;
}
object embed {
display: inherit !important;
background: none !important;
border: 0 !important;
}
embed.neoCMSFlash, object.neoCMSFlash {
*position: absolute;
*left: -5000px;
visibility: hidden !important;
z-index: 0 !important;
}
/* IE */
* html body {
scrollbar-3dlight-color: #F0F0EE;
scrollbar-arrow-color: #676662;
scrollbar-base-color: #F0F0EE;
scrollbar-darkshadow-color: #DDD;
scrollbar-face-color: #E0E0DD;
scrollbar-highlight-color: #F0F0EE;
scrollbar-shadow-color: #F0F0EE;
scrollbar-track-color: #F5F5F5;
}
/* FLOAT CLEARING STYLES
------------------------------------------------------------------------ */
.clearfix:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
.clearfix {
display: inline-block;
}
/* Hide from IE Mac \*/
.clearfix {
display: block;
}
/* End hide from IE Mac */
-414
View File
@@ -1,414 +0,0 @@
/* Generic */
body {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
scrollbar-3dlight-color: #F0F0EE;
scrollbar-arrow-color: #676662;
scrollbar-base-color: #F0F0EE;
scrollbar-darkshadow-color: #DDDDDD;
scrollbar-face-color: #E0E0DD;
scrollbar-highlight-color: #F0F0EE;
scrollbar-shadow-color: #F0F0EE;
scrollbar-track-color: #F5F5F5;
background: #F0F0EE;
padding: 0;
margin: 8px 8px 0 8px;
}
html {
background: #F0F0EE;
}
td {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
}
textarea {
resize: none;
outline: none;
}
a:link, a:visited {
color: black;
}
a:hover {
color: #2B6FB6;
}
/* Forms */
fieldset {
margin: 0;
padding: 4px;
border: 1px solid #919B9C;
font-family: Verdana, Arial;
font-size: 10px;
}
legend {
color: #2B6FB6;
font-weight: bold;
}
label.msg {
display: none;
}
label.invalid {
color: #EE0000;
display: inline;
}
input.invalid {
border: 1px solid #EE0000;
}
input {
background: #FFF;
border: 1px solid #CCC;
}
input, select, textarea {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
}
input, select, textarea {
border: 1px solid #808080;
}
input.radio {
border: 1px none #000000;
background: transparent;
vertical-align: middle;
}
input.checkbox {
border: 1px none #000000;
background: transparent;
vertical-align: middle;
}
.input_noborder {
border: 0;
}
/* Buttons */
#insert, #cancel, input.button, .updateButton {
border: 0;
margin: 0;
padding: 0;
font-weight: bold;
width: 94px;
height: 26px;
background: url(img/buttons.png) 0 -26px;
cursor: pointer;
padding-bottom: 2px;
}
#insert {
background: url(img/buttons.png) 0 -52px;
}
#cancel {
background: url(img/buttons.png) 0 0;
}
/* Browse */
a.browse span {
display: block;
width: 20px;
height: 18px;
background: url(../../img/icons.gif) -860px 0;
border: 1px solid #FFF;
margin-left: 1px;
}
.mceOldBoxModel a.browse span {
width: 22px;
height: 20px;
}
a.browse:hover span {
border: 1px solid #0A246A;
background-color: #B2BBD0;
}
a.browse span.disabled {
border: 1px solid white;
opacity: 0.3;
-ms-filter: 'alpha(opacity=30)';
filter: alpha(opacity=30)
}
a.browse:hover span.disabled {
border: 1px solid white;
background-color: transparent;
}
a.pickcolor span {
display: block;
width: 20px;
height: 16px;
background: url(../../img/icons.gif) -840px 0;
margin-left: 2px;
}
.mceOldBoxModel a.pickcolor span {
width: 21px;
height: 17px;
}
a.pickcolor:hover span {
background-color: #B2BBD0;
}
a.pickcolor:hover span.disabled {
}
/* Charmap */
table.charmap {
border: 1px solid #AAA;
text-align: center
}
td.charmap, #charmap a {
width: 18px;
height: 18px;
color: #000;
border: 1px solid #AAA;
text-align: center;
font-size: 12px;
vertical-align: middle;
line-height: 18px;
}
#charmap a {
display: block;
color: #000;
text-decoration: none;
border: 0
}
#charmap a:hover {
background: #CCC;
color: #2B6FB6
}
#charmap #codeN {
font-size: 10px;
font-family: Arial, Helvetica, sans-serif;
text-align: center
}
#charmap #codeV {
font-size: 40px;
height: 80px;
border: 1px solid #AAA;
text-align: center
}
/* Source */
.wordWrapCode {
vertical-align: middle;
border: 1px none #000000;
background: transparent;
}
.mceActionPanel {
margin-top: 5px;
}
/* Tabs classes */
.tabs {
width: 100%;
height: 18px;
line-height: normal;
background: url(img/tabs.gif) repeat-x 0 -72px;
}
.tabs ul {
margin: 0;
padding: 0;
list-style: none;
}
.tabs li {
float: left;
background: url(img/tabs.gif) no-repeat 0 0;
margin: 0 2px 0 0;
padding: 0 0 0 10px;
line-height: 17px;
height: 18px;
display: block;
}
.tabs li.current {
background: url(img/tabs.gif) no-repeat 0 -18px;
margin-right: 2px;
}
.tabs span {
float: left;
display: block;
background: url(img/tabs.gif) no-repeat right -36px;
padding: 0px 10px 0 0;
}
.tabs .current span {
background: url(img/tabs.gif) no-repeat right -54px;
}
.tabs a {
text-decoration: none;
font-family: Verdana, Arial;
font-size: 10px;
}
.tabs a:link, .tabs a:visited, .tabs a:hover {
color: black;
}
/* Panels */
.panel_wrapper div.panel {
display: none;
}
.panel_wrapper div.current {
display: block;
width: 100%;
height: 300px;
overflow: visible;
}
.panel_wrapper {
border: 1px solid #919B9C;
border-top: 0px;
padding: 10px;
padding-top: 5px;
clear: both;
background: white;
}
/* Columns */
.column {
float: left;
}
.properties {
width: 100%;
}
.properties .column1 {
}
.properties .column2 {
text-align: left;
}
/* Titles */
h1, h2, h3, h4 {
color: #2B6FB6;
margin: 0;
padding: 0;
padding-top: 5px;
}
h3 {
font-size: 14px;
}
.title {
font-size: 12px;
font-weight: bold;
color: #2B6FB6;
}
/* Dialog specific */
#link .panel_wrapper, #link div.current {
height: 125px;
}
#image .panel_wrapper, #image div.current {
height: 200px;
}
#plugintable thead {
font-weight: bold;
background: #DDD;
}
#plugintable, #about #plugintable td {
border: 1px solid #919B9C;
}
#plugintable {
width: 96%;
margin-top: 10px;
}
#pluginscontainer {
height: 290px;
overflow: auto;
}
#colorpicker #preview {
float: right;
width: 50px;
height: 14px;
line-height: 1px;
border: 1px solid black;
margin-left: 5px;
}
#colorpicker #colors {
float: left;
border: 1px solid gray;
cursor: crosshair;
}
#colorpicker #light {
border: 1px solid gray;
margin-left: 5px;
float: left;
width: 15px;
height: 150px;
cursor: crosshair;
}
#colorpicker #light div {
overflow: hidden;
}
#colorpicker #previewblock {
float: right;
padding-left: 10px;
height: 20px;
}
#colorpicker .panel_wrapper div.current {
height: 175px;
}
#colorpicker #namedcolors {
width: 150px;
}
#colorpicker #namedcolors a {
display: block;
float: left;
width: 10px;
height: 10px;
margin: 1px 1px 0 0;
overflow: hidden;
}
#colorpicker #colornamecontainer {
margin-top: 5px;
}
#colorpicker #picker_panel fieldset {
margin: auto;
width: 325px;
}
-876
View File
@@ -1,876 +0,0 @@
/* Reset */
.defaultSkin table, .defaultSkin tbody, .defaultSkin a, .defaultSkin img, .defaultSkin tr, .defaultSkin div, .defaultSkin td, .defaultSkin iframe, .defaultSkin span, .defaultSkin .mceText {
border: 0;
margin: 0;
padding: 0;
background: transparent;
white-space: nowrap;
text-decoration: none;
font-weight: normal;
cursor: default;
color: #000;
vertical-align: baseline;
width: auto;
border-collapse: separate;
text-align: left
}
.defaultSkin #neoCMSEditContent_toolbar1 a:hover, .defaultSkin #neoCMSEditContent_toolbar1 a:link, .defaultSkin #neoCMSEditContent_toolbar1 a:visited, .defaultSkin #neoCMSEditContent_toolbar1 a:active {
font-size: 10px;
color: #fff;
text-decoration: none;
margin: 0;
padding: 5px 10px;
cursor: pointer;
}
.defaultSkin #neoCMSEditContent_toolbar1 a#neoCMSEditContent_bullist:link, .defaultSkin #neoCMSEditContent_toolbar1 a#neoCMSEditContent_bullist:visited, .defaultSkin #neoCMSEditContent_toolbar1 a#neoCMSEditContent_numlist:link, .defaultSkin #neoCMSEditContent_toolbar1 a#neoCMSEditContent_numlist:visited, .defaultSkin #neoCMSEditContent_toolbar1 a#neoCMSEditContent_deflist:link, .defaultSkin #neoCMSEditContent_toolbar1 a#neoCMSEditContent_deflist:visited {
padding: 4px 7px;
width: 20px;
height: 16px;
display: block;
text-indent: -5000px;
line-height: 22px;
}
.defaultSkin #neoCMSEditContent_toolbar1 a#neoCMSEditContent_bullist:hover, .defaultSkin #neoCMSEditContent_toolbar1 a#neoCMSEditContent_numlist:hover, .defaultSkin #neoCMSEditContent_toolbar1 a#neoCMSEditContent_deflist:hover {
background-color: #666;
}
.defaultSkin table td {
vertical-align: middle
}
/* Containers */
.defaultSkin iframe {
display: block;
background: transparent !important;
}
.defaultSkin .mceLeft {
text-align: left
}
.defaultSkin .mceRight {
text-align: right
}
/* External */
.defaultSkin .mceExternalToolbar {
position: absolute;
border-bottom: 0;
display: none;
}
.defaultSkin .mceExternalToolbar td.mceToolbar {
padding-right: 13px;
}
.defaultSkin .mceExternalClose {
position: absolute;
top: 3px;
right: 3px;
width: 7px;
height: 7px;
background: url(../../img/icons.gif) -820px 0
}
/* Layout */
.defaultSkin table.mceLayout {
border: 0;
}
.defaultSkin table.mceLayout tr.mceFirst td {
margin: 0 3px;
padding: 5px 4px 5px 0;
border-top: 1px solid #666;
font-size: 11px;
color: #fff;
height: 22px;
}
.defaultSkin table.mceToolbar, .defaultSkin tr.mceFirst .mceToolbar tr td, .defaultSkin tr.mceLast .mceToolbar tr td {
border: 0;
margin: 0;
padding: 0;
}
.defaultSkin tr.mceFirst .mceToolbar tr td a {
border-left: 1px solid #666;
}
.defaultSkin tr.mceFirst .mceToolbar tr td a.mce_bold {
border-left: none;
}
.defaultSkin tr.mceFirst .mceToolbar tr td.mceFirst, .defaultSkin tr.mceFirst .mceToolbar tr td.mceLast, .defaultSkin tr.mceFirst .mceToolbar tr td.mceToolbarStart {
display: none;
}
.defaultSkin td.mceToolbar {
background: #000;
vertical-align: top
}
.defaultSkin .mceIframeContainer {
margin: 0;
border-right: 3px solid #000;
border-bottom: 3px solid #000;
border-left: 3px solid #000;
overflow-y: auto;
overflow-x: none !important;
vertical-align: top;
}
.defaultSkin .mceIframeRight {
float: right;
clear: both;
}
.defaultSkin #neoCMSEditContent_ifr {
background: transparent !important;
.padding:
5px;
overflow: visible; /* EXTRA WIDTH FOR IE */
height: 100% !important;
border-left: 1px solid #ddd;
border-right: 1px solid #ddd;
}
.defaultSkin .mceStatusbar {
font-family: 'MS Sans Serif', sans-serif, Verdana, Arial;
font-size: 9pt;
line-height: 16px;
overflow: visible;
color: #000;
display: block;
height: 20px
}
.defaultSkin .mceStatusbar div {
float: left;
margin: 2px
}
.defaultSkin .mceStatusbar a.mceResize {
display: block;
float: right;
background: url(../../img/icons.gif) -800px 0;
width: 20px;
height: 20px;
cursor: se-resize
}
.defaultSkin .mceStatusbar a:hover {
text-decoration: underline
}
.defaultSkin table.mceToolbar {
margin-left: 3px
}
.defaultSkin span.mceIcon, .defaultSkin img.mceIcon {
display: block;
width: auto;
font-size: 11px;
line-height: 12px;
color: #fff;
cursor: pointer;
}
.defaultSkin .mceIcon {
background: none !important;
}
.defaultSkin td.mceCenter {
text-align: center;
}
.defaultSkin td.mceCenter table {
margin: 0 auto;
text-align: left;
}
.defaultSkin td.mceRight table {
margin: 0 0 0 auto;
}
/* Button */
.defaultSkin .mceButton {
display: block;
}
.defaultSkin a.mceButtonEnabled:hover, .defaultSkin a.mceButtonActive, .defaultSkin a.mceButtonSelected {
background-color: #666 !important;
}
.defaultSkin .mceButtonDisabled span.mceIcon {
color: #666 !important;
}
.defaultSkin .mceButtonLabeled {
width: auto
}
.defaultSkin .mceButtonLabeled span.mceIcon {
float: left
}
.defaultSkin span.mceButtonLabel {
display: block;
font-size: 10px;
padding: 4px 6px 0 22px;
font-family: Tahoma, Verdana, Arial, Helvetica
}
.defaultSkin .mceButtonDisabled .mceButtonLabel {
color: #888
}
/* Separator */
.defaultSkin .mceSeparator {
display: block;
background: url(../../img/icons.gif) -180px 0;
width: 2px;
height: 20px;
margin: 2px 2px 0 4px
}
/* SplitButton */
.defaultSkin .mceSplitButton {
width: 32px;
height: 20px;
direction: ltr
}
.defaultSkin .mceSplitButton a, .defaultSkin .mceSplitButton span {
height: 20px;
display: block
}
.defaultSkin .mceSplitButton a.mceAction {
width: 20px;
border: 1px solid #F0F0EE;
border-right: 0;
}
.defaultSkin .mceSplitButton span.mceAction {
width: 20px;
background: url(../../img/icons.gif) 20px 20px;
}
.defaultSkin .mceSplitButton a.mceOpen {
width: 9px;
background: url(../../img/icons.gif) -741px 0;
border: 1px solid #F0F0EE;
}
.defaultSkin .mceSplitButton span.mceOpen {
display: none
}
.defaultSkin table.mceSplitButtonEnabled:hover a.mceAction, .defaultSkin .mceSplitButtonHover a.mceAction, .defaultSkin .mceSplitButtonSelected a.mceAction {
border: 1px solid #0A246A;
border-right: 0;
background-color: #B2BBD0
}
.defaultSkin table.mceSplitButtonEnabled:hover a.mceOpen, .defaultSkin .mceSplitButtonHover a.mceOpen, .defaultSkin .mceSplitButtonSelected a.mceOpen {
background-color: #B2BBD0;
border: 1px solid #0A246A;
}
.defaultSkin .mceSplitButtonDisabled .mceAction, .defaultSkin .mceSplitButtonDisabled a.mceOpen {
opacity: 0.3;
-ms-filter: 'alpha(opacity=30)';
filter: alpha(opacity=30)
}
.defaultSkin .mceSplitButtonActive a.mceAction {
border: 1px solid #0A246A;
background-color: #C2CBE0
}
.defaultSkin .mceSplitButtonActive a.mceOpen {
border-left: 0;
}
/* ColorSplitButton */
.defaultSkin div.mceColorSplitMenu table {
background: #FFF;
border: 1px solid gray
}
.defaultSkin .mceColorSplitMenu td {
padding: 2px
}
.defaultSkin .mceColorSplitMenu a {
display: block;
width: 9px;
height: 9px;
overflow: hidden;
border: 1px solid #808080
}
.defaultSkin .mceColorSplitMenu td.mceMoreColors {
padding: 1px 3px 1px 1px
}
.defaultSkin .mceColorSplitMenu a.mceMoreColors {
width: 100%;
height: auto;
text-align: center;
font-family: Tahoma, Verdana, Arial, Helvetica;
font-size: 11px;
line-height: 20px;
border: 1px solid #FFF
}
.defaultSkin .mceColorSplitMenu a.mceMoreColors:hover {
border: 1px solid #0A246A;
background-color: #B6BDD2
}
.defaultSkin a.mceMoreColors:hover {
border: 1px solid #0A246A
}
.defaultSkin .mceColorPreview {
margin-left: 2px;
width: 16px;
height: 4px;
overflow: hidden;
background: #9a9b9a
}
.defaultSkin .mce_forecolor span.mceAction, .defaultSkin .mce_backcolor span.mceAction {
overflow: hidden;
height: 16px
}
/* Menu */
.defaultSkin .mceMenu {
position: absolute;
left: 0;
top: 0;
z-index: 1000;
border: 1px solid #D4D0C8
}
.defaultSkin .mceNoIcons span.mceIcon {
width: 0;
}
.defaultSkin .mceNoIcons a .mceText {
padding-left: 10px
}
.defaultSkin .mceMenu table {
background: #FFF
}
.defaultSkin .mceMenu a, .defaultSkin .mceMenu span, .defaultSkin .mceMenu {
display: block
}
.defaultSkin .mceMenu td {
height: 20px
}
.defaultSkin .mceMenu a {
position: relative;
padding: 3px 0 4px 0
}
.defaultSkin .mceMenu .mceText {
position: relative;
display: block;
font-family: Tahoma, Verdana, Arial, Helvetica;
color: #000;
cursor: default;
margin: 0;
padding: 0 25px 0 25px;
display: block
}
.defaultSkin .mceMenu span.mceText, .defaultSkin .mceMenu .mcePreview {
font-size: 11px
}
.defaultSkin .mceMenu pre.mceText {
font-family: Monospace
}
.defaultSkin .mceMenu .mceIcon {
position: absolute;
top: 0;
left: 0;
width: 22px;
}
.defaultSkin .mceMenu .mceMenuItemEnabled a:hover, .defaultSkin .mceMenu .mceMenuItemActive {
background-color: #dbecf3
}
.defaultSkin td.mceMenuItemSeparator {
background: #DDD;
height: 1px
}
.defaultSkin .mceMenuItemTitle a {
border: 0;
background: #EEE;
border-bottom: 1px solid #DDD
}
.defaultSkin .mceMenuItemTitle span.mceText {
color: #000;
font-weight: bold;
padding-left: 4px
}
.defaultSkin .mceMenuItemDisabled .mceText {
color: #888
}
.defaultSkin .mceMenuItemSelected .mceIcon {
background: url(img/menu_check.gif)
}
.defaultSkin .mceNoIcons .mceMenuItemSelected a {
background: url(img/menu_arrow.gif) no-repeat -6px center
}
.defaultSkin .mceMenu span.mceMenuLine {
display: none
}
.defaultSkin .mceMenuItemSub a {
background: url(img/menu_arrow.gif) no-repeat top right;
}
/* Progress,Resize */
.defaultSkin .mceBlocker {
position: absolute;
left: 0;
top: 0;
z-index: 1000;
opacity: 0.5;
-ms-filter: 'alpha(opacity=50)';
filter: alpha(opacity=50);
background: #FFF
}
.defaultSkin .mceProgress {
position: absolute;
left: 0;
top: 0;
z-index: 1001;
background: url(img/progress.gif) no-repeat;
width: 32px;
height: 32px;
margin: -16px 0 0 -16px
}
.defaultSkin .mcePlaceHolder {
border: 1px dotted gray
}
/* Formats */
.defaultSkin .mce_formatPreview a {
font-size: 10px
}
.defaultSkin .mce_p span.mceText {
}
.defaultSkin .mce_address span.mceText {
font-style: italic
}
.defaultSkin .mce_pre span.mceText {
font-family: monospace
}
.defaultSkin .mce_h1 span.mceText {
font-weight: bolder;
font-size: 2em
}
.defaultSkin .mce_h2 span.mceText {
font-weight: bolder;
font-size: 1.5em
}
.defaultSkin .mce_h3 span.mceText {
font-weight: bolder;
font-size: 1.17em
}
.defaultSkin .mce_h4 span.mceText {
font-weight: bolder;
font-size: 1em
}
.defaultSkin .mce_h5 span.mceText {
font-weight: bolder;
font-size: .83em
}
.defaultSkin .mce_h6 span.mceText {
font-weight: bolder;
font-size: .75em
}
/* Theme */
.defaultSkin span.mce_bold {
background-position: 0 0
}
.defaultSkin span.mce_italic {
background-position: -60px 0
}
.defaultSkin span.mce_underline {
background-position: -140px 0
}
.defaultSkin span.mce_strikethrough {
background-position: -120px 0
}
.defaultSkin span.mce_undo {
background-position: -160px 0
}
.defaultSkin span.mce_redo {
background-position: -100px 0
}
.defaultSkin span.mce_cleanup {
background-position: -40px 0
}
.defaultSkin span.mce_bullist {
background-position: -20px 0
}
.defaultSkin span.mce_numlist {
background-position: -80px 0
}
.defaultSkin span.mce_justifyleft {
background-position: -460px 0
}
.defaultSkin span.mce_justifyright {
background-position: -480px 0
}
.defaultSkin span.mce_justifycenter {
background-position: -420px 0
}
.defaultSkin span.mce_justifyfull {
background-position: -440px 0
}
.defaultSkin span.mce_anchor {
background-position: -200px 0
}
.defaultSkin span.mce_indent {
background-position: -400px 0
}
.defaultSkin span.mce_outdent {
background-position: -540px 0
}
.defaultSkin span.mce_link {
background-position: -500px 0
}
.defaultSkin span.mce_unlink {
background-position: -640px 0
}
.defaultSkin span.mce_sub {
background-position: -600px 0
}
.defaultSkin span.mce_sup {
background-position: -620px 0
}
.defaultSkin span.mce_removeformat {
background-position: -580px 0
}
.defaultSkin span.mce_newdocument {
background-position: -520px 0
}
.defaultSkin span.mce_image {
background-position: -380px 0
}
.defaultSkin span.mce_help {
background-position: -340px 0
}
.defaultSkin span.mce_code {
background-position: -260px 0
}
.defaultSkin span.mce_hr {
background-position: -360px 0
}
.defaultSkin span.mce_visualaid {
background-position: -660px 0
}
.defaultSkin span.mce_charmap {
background-position: -240px 0
}
.defaultSkin span.mce_paste {
background-position: -560px 0
}
.defaultSkin span.mce_copy {
background-position: -700px 0
}
.defaultSkin span.mce_cut {
background-position: -680px 0
}
.defaultSkin span.mce_blockquote {
background-position: -220px 0
}
.defaultSkin .mce_forecolor span.mceAction {
background-position: -720px 0
}
.defaultSkin .mce_backcolor span.mceAction {
background-position: -760px 0
}
.defaultSkin span.mce_forecolorpicker {
background-position: -720px 0
}
.defaultSkin span.mce_backcolorpicker {
background-position: -760px 0
}
/* Plugins */
.defaultSkin span.mce_advhr {
background-position: -0px -20px
}
.defaultSkin span.mce_ltr {
background-position: -20px -20px
}
.defaultSkin span.mce_rtl {
background-position: -40px -20px
}
.defaultSkin span.mce_emotions {
background-position: -60px -20px
}
.defaultSkin span.mce_fullpage {
background-position: -80px -20px
}
.defaultSkin span.mce_fullscreen {
background-position: -100px -20px
}
.defaultSkin span.mce_iespell {
background-position: -120px -20px
}
.defaultSkin span.mce_insertdate {
background-position: -140px -20px
}
.defaultSkin span.mce_inserttime {
background-position: -160px -20px
}
.defaultSkin span.mce_absolute {
background-position: -180px -20px
}
.defaultSkin span.mce_backward {
background-position: -200px -20px
}
.defaultSkin span.mce_forward {
background-position: -220px -20px
}
.defaultSkin span.mce_insert_layer {
background-position: -240px -20px
}
.defaultSkin span.mce_insertlayer {
background-position: -260px -20px
}
.defaultSkin span.mce_movebackward {
background-position: -280px -20px
}
.defaultSkin span.mce_moveforward {
background-position: -300px -20px
}
.defaultSkin span.mce_media {
background-position: -320px -20px
}
.defaultSkin span.mce_nonbreaking {
background-position: -340px -20px
}
.defaultSkin span.mce_pastetext {
background-position: -360px -20px
}
.defaultSkin span.mce_pasteword {
background-position: -380px -20px
}
.defaultSkin span.mce_selectall {
background-position: -400px -20px
}
.defaultSkin span.mce_preview {
background-position: -420px -20px
}
.defaultSkin span.mce_print {
background-position: -440px -20px
}
.defaultSkin span.mce_cancel {
background-position: -460px -20px
}
.defaultSkin span.mce_save {
background-position: -480px -20px
}
.defaultSkin span.mce_replace {
background-position: -500px -20px
}
.defaultSkin span.mce_search {
background-position: -520px -20px
}
.defaultSkin span.mce_styleprops {
background-position: -560px -20px
}
.defaultSkin span.mce_table {
background-position: -580px -20px
}
.defaultSkin span.mce_cell_props {
background-position: -600px -20px
}
.defaultSkin span.mce_delete_table {
background-position: -620px -20px
}
.defaultSkin span.mce_delete_col {
background-position: -640px -20px
}
.defaultSkin span.mce_delete_row {
background-position: -660px -20px
}
.defaultSkin span.mce_col_after {
background-position: -680px -20px
}
.defaultSkin span.mce_col_before {
background-position: -700px -20px
}
.defaultSkin span.mce_row_after {
background-position: -720px -20px
}
.defaultSkin span.mce_row_before {
background-position: -740px -20px
}
.defaultSkin span.mce_merge_cells {
background-position: -760px -20px
}
.defaultSkin span.mce_table_props {
background-position: -980px -20px
}
.defaultSkin span.mce_row_props {
background-position: -780px -20px
}
.defaultSkin span.mce_split_cells {
background-position: -800px -20px
}
.defaultSkin span.mce_template {
background-position: -820px -20px
}
.defaultSkin span.mce_visualchars {
background-position: -840px -20px
}
.defaultSkin span.mce_abbr {
background-position: -860px -20px
}
.defaultSkin span.mce_acronym {
background-position: -880px -20px
}
.defaultSkin span.mce_attribs {
background-position: -900px -20px
}
.defaultSkin span.mce_cite {
background-position: -920px -20px
}
.defaultSkin span.mce_del {
background-position: -940px -20px
}
.defaultSkin span.mce_ins {
background-position: -960px -20px
}
.defaultSkin span.mce_pagebreak {
background-position: 0 -40px
}
.defaultSkin .mce_spellchecker span.mceAction {
background-position: -540px -20px
}
-1
View File
File diff suppressed because one or more lines are too long
-220
View File
@@ -1,220 +0,0 @@
/**
* validate.js
*
* Copyright 2009, Moxiecode Systems AB
* Released under LGPL License.
*
* License: http://tinymce.moxiecode.com/license
* Contributing: http://tinymce.moxiecode.com/contributing
*/
/**
// String validation:
if (!Validator.isEmail('myemail'))
alert('Invalid email.');
// Form validation:
var f = document.forms['myform'];
if (!Validator.isEmail(f.myemail))
alert('Invalid email.');
*/
var Validator = {
isEmail: function (s) {
return this.test(s, '^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+@[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$');
},
isAbsUrl: function (s) {
return this.test(s, '^(news|telnet|nttp|file|http|ftp|https)://[-A-Za-z0-9\\.]+\\/?.*$');
},
isSize: function (s) {
return this.test(s, '^[0-9]+(%|in|cm|mm|em|ex|pt|pc|px)?$');
},
isId: function (s) {
return this.test(s, '^[A-Za-z_]([A-Za-z0-9_])*$');
},
isEmpty: function (s) {
var nl, i;
if (s.nodeName == 'SELECT' && s.selectedIndex < 1)
return true;
if (s.type == 'checkbox' && !s.checked)
return true;
if (s.type == 'radio') {
for (i = 0, nl = s.form.elements; i < nl.length; i++) {
if (nl[i].type == "radio" && nl[i].name == s.name && nl[i].checked)
return false;
}
return true;
}
return new RegExp('^\\s*$').test(s.nodeType == 1 ? s.value : s);
},
isNumber: function (s, d) {
return !isNaN(s.nodeType == 1 ? s.value : s) && (!d || !this.test(s, '^-?[0-9]*\\.[0-9]*$'));
},
test: function (s, p) {
s = s.nodeType == 1 ? s.value : s;
return s == '' || new RegExp(p).test(s);
}
};
var AutoValidator = {
settings: {
id_cls: 'id',
int_cls: 'int',
url_cls: 'url',
number_cls: 'number',
email_cls: 'email',
size_cls: 'size',
required_cls: 'required',
invalid_cls: 'invalid',
min_cls: 'min',
max_cls: 'max'
},
init: function (s) {
var n;
for (n in s)
this.settings[n] = s[n];
},
validate: function (f) {
var i, nl, s = this.settings, c = 0;
nl = this.tags(f, 'label');
for (i = 0; i < nl.length; i++)
this.removeClass(nl[i], s.invalid_cls);
c += this.validateElms(f, 'input');
c += this.validateElms(f, 'select');
c += this.validateElms(f, 'textarea');
return c == 3;
},
invalidate: function (n) {
this.mark(n.form, n);
},
reset: function (e) {
var t = ['label', 'input', 'select', 'textarea'];
var i, j, nl, s = this.settings;
if (e == null)
return;
for (i = 0; i < t.length; i++) {
nl = this.tags(e.form ? e.form : e, t[i]);
for (j = 0; j < nl.length; j++)
this.removeClass(nl[j], s.invalid_cls);
}
},
validateElms: function (f, e) {
var nl, i, n, s = this.settings, st = true, va = Validator, v;
nl = this.tags(f, e);
for (i = 0; i < nl.length; i++) {
n = nl[i];
this.removeClass(n, s.invalid_cls);
if (this.hasClass(n, s.required_cls) && va.isEmpty(n))
st = this.mark(f, n);
if (this.hasClass(n, s.number_cls) && !va.isNumber(n))
st = this.mark(f, n);
if (this.hasClass(n, s.int_cls) && !va.isNumber(n, true))
st = this.mark(f, n);
if (this.hasClass(n, s.url_cls) && !va.isAbsUrl(n))
st = this.mark(f, n);
if (this.hasClass(n, s.email_cls) && !va.isEmail(n))
st = this.mark(f, n);
if (this.hasClass(n, s.size_cls) && !va.isSize(n))
st = this.mark(f, n);
if (this.hasClass(n, s.id_cls) && !va.isId(n))
st = this.mark(f, n);
if (this.hasClass(n, s.min_cls, true)) {
v = this.getNum(n, s.min_cls);
if (isNaN(v) || parseInt(n.value) < parseInt(v))
st = this.mark(f, n);
}
if (this.hasClass(n, s.max_cls, true)) {
v = this.getNum(n, s.max_cls);
if (isNaN(v) || parseInt(n.value) > parseInt(v))
st = this.mark(f, n);
}
}
return st;
},
hasClass: function (n, c, d) {
return new RegExp('\\b' + c + (d ? '[0-9]+' : '') + '\\b', 'g').test(n.className);
},
getNum: function (n, c) {
c = n.className.match(new RegExp('\\b' + c + '([0-9]+)\\b', 'g'))[0];
c = c.replace(/[^0-9]/g, '');
return c;
},
addClass: function (n, c, b) {
var o = this.removeClass(n, c);
n.className = b ? c + (o != '' ? (' ' + o) : '') : (o != '' ? (o + ' ') : '') + c;
},
removeClass: function (n, c) {
c = n.className.replace(new RegExp("(^|\\s+)" + c + "(\\s+|$)"), ' ');
return n.className = c != ' ' ? c : '';
},
tags: function (f, s) {
return f.getElementsByTagName(s);
},
mark: function (f, n) {
var s = this.settings;
this.addClass(n, s.invalid_cls);
this.markLabels(f, n, s.invalid_cls);
return false;
},
markLabels: function (f, n, ic) {
var nl, i;
nl = this.tags(f, "label");
for (i = 0; i < nl.length; i++) {
if (nl[i].getAttribute("for") == n.id || nl[i].htmlFor == n.id)
this.addClass(nl[i], ic);
}
return null;
}
};
-2041
View File
File diff suppressed because it is too large Load Diff
-84
View File
@@ -1,84 +0,0 @@
<?php
@session_start();
include_once("config.php");
if (session_id() != "") {
if (isset($_SESSION['neoCMSSess']) && isset($_SESSION['neoCMSUserid'])) {
header("Location:./");
} else {
include_once('core/createsession.php');
}
} else {
$nosess = true;
}
@session_write_close();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="robots" content="noindex"/>
<link rel="shortcut icon" href="images/icon.png"/>
<link rel="apple-touch-icon-precomposed" href="images/apple-touch-icon-precomposed.png"/>
<title>neoCMS</title>
<script type="text/javascript" src="js/lib/jquery.js"></script>
<script type="text/javascript" src="js/main.js"></script>
<link href="css/main.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="neoCMSPromptWrap">
<div id="neoCMSLoginWrap" class="neoCMSLoginWrap">
<h1 class="logo">neoCMS</h1>
<div id="neoCMSAppInfo" class="neoCMSAppInfo">
<p><?php echo $versionInfo; ?>><br/>
Copyright <?php echo @date('Y'); ?> <?php echo $companyName; ?>><br/></p>
<p class="neoCMSTopBorder">neoCMS is developed by Neogate Technologies.</p>
</div>
<div id="neoCMSLoginCont" class="neoCMSLoginCont">
<form id="neoCMSLoginForm" method="post" action="core/login.php" target="neoCMSLoginIframe">
<fieldset>
<legend>Login</legend>
<ol>
<li id="neoCMSUsername"><label>Username</label><br/>
<input class="neoCMSInput" name="neoCMSUsername" type="text" tabindex="1"/>
<p class="error">Required</p></li>
<li id="neoCMSPassword"><label>Password</label><br/>
<input class="neoCMSInput" name="neoCMSPassword" type="password" tabindex="2"/>
<p class="error">Required</p></li>
<li id="neoCMSEnter" class="clearfix">
<button id="neoCMSLoginBtn" type="submit" class="neoCMSLoginBtn" tabindex="3">login
</button>
<p><a id="forgotPass" href="javascript:">Forgot your password?</a></p>
<p class="error invalid"></p></li>
</ol>
<div id="forgot" class="forgotLogin clearfix">
<p>Submit your username to receive an<br/>email with your new password.</p>
<button id="neoCMSSubmitBtn" type="submit" class="neoCMSSubmitBtn" tabindex="3">submit
</button>
<p class="clearfix"><a id="forgotCancel" href="javascript:">Back to login</a></p>
<p class="message"></p>
</div>
</fieldset>
</form>
</div>
</div>
</div>
<iframe id="neoCMSPageSrc" name="neoCMSPageSrc" marginheight="0" align="top" frameborder="0" src="../"
application="yes"></iframe>
</body>
</html>
+93
View File
@@ -0,0 +1,93 @@
<?php
require_once "../neoCMSCore.php";
require_once "../init.php";
// Initialize error message variable
$error = '';
if(isset($_POST['username']) && isset($_POST['password'])){
if(!$_SESSION['core']->login($_POST['username'],$_POST['password'])) {
$error = "Invalid username or password";
} else {
header("Location:/cms/");
die("Well done, champ! You got this!! <3");
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Login</title>
<style>
/* Basic styling for the login form */
body {
font-family: Arial, sans-serif;
background-color: #eef1f5;
}
.login-container {
width: 350px;
margin: 100px auto;
padding: 40px;
background-color: #ffffff;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.login-container h2 {
text-align: center;
margin-bottom: 30px;
color: #333333;
}
.login-container label {
display: block;
margin-bottom: 8px;
color: #555555;
}
.login-container input[type="text"],
.login-container input[type="password"] {
width: 100%;
padding: 12px;
margin-bottom: 20px;
border: 1px solid #cccccc;
border-radius: 4px;
box-sizing: border-box;
}
.login-container button {
width: 100%;
padding: 12px;
background-color: #0066cc;
border: none;
border-radius: 4px;
color: #ffffff;
font-size: 16px;
cursor: pointer;
}
.login-container button:hover {
background-color: #005bb5;
}
.error-message {
color: #ff4d4d;
margin-bottom: 20px;
text-align: center;
}
</style>
</head>
<body>
<div class="login-container">
<h2>NeoCMS Login</h2>
<?php if (!empty($error)): ?>
<div class="error-message"><?php echo htmlspecialchars($error); ?></div>
<?php endif; ?>
<form method="post">
<label for="username">Username</label>
<input type="text" id="username" name="username" required autofocus>
<label for="password">Password</label>
<input type="password" id="password" name="password" required>
<button type="submit">Log In</button>
</form>
</div>
</body>
</html>
+2
View File
@@ -0,0 +1,2 @@
<?php
header("Location: /cms/");
+63
View File
@@ -0,0 +1,63 @@
<?php
class neoCMSCore
{
public $auditEnabled = true;
public $users = [];
public $loggedIn = false;
public $version = '2.0';
private $loggedInUser = '';
public function __construct()
{
}
public function login($username, $password)
{
$this->loggedIn = (!empty($this->users[$username]) && $this->users[$username] == $password);
if ($this->loggedIn) $this->loggedInUser = $username;
$this->writeAudit("User login for " . $username . " was " . ($this->loggedIn ? "successful" : "denied due to incorrect credentials") . " from " . $_SERVER['REMOTE_ADDR']);
return $this->loggedIn;
}
/**
* Write an entry into the audit log
* @param $value
* @return void
*/
public function writeAudit($value)
{
if ($this->auditEnabled)
file_put_contents(__DIR__ . "/" . date('y-m-d-') . "audit.txt", date('Y-m-d H:i:s') . "\t" . $this->loggedInUser . "\t" . trim($value) . "\n", FILE_APPEND);
}
public function isLoggedIn()
{
return $this->loggedIn;
}
public function getLoggedinUser()
{
return $this->loggedInUser;
}
public function saveContent($uri, $content)
{
$this->writeAudit("Content for " . $uri . " was saved.");
$uri = str_replace("../", "./", $uri);
//check to see if we're dealing with a default (index.htm{l}) page
if (str_ends_with($uri, "/") || $uri == '/') {
if (file_exists($_SERVER['DOCUMENT_ROOT'] . $uri . 'index.htm')) {
$uri = $uri . '/index.htm';
} elseif (file_exists($_SERVER['DOCUMENT_ROOT'] . $uri . 'index.html')) {
$uri = $uri . '/index.html';
} else {
die('Unknown default file:' . $uri);
}
}
file_put_contents($_SERVER['DOCUMENT_ROOT'] . $uri, $content);
}
}
-26
View File
@@ -1,26 +0,0 @@
<div class="neoCMSDefPrompt neoCMSPrompt clearfix" id="neoCMSPrompt">
<div id="neoCMSPromptTop">
<div class="neoCMSPromptTopL">
<div class="neoCMSPromptTopR"></div>
</div>
</div>
<div class="neoCMSDefContent neoCMSPromptContent" id="neoCMSPromptContent">
<h4 class="neoCMSPromptTitle" id="neoCMSPromptTitle"></h4>
<div class="neoCMSDefAlert">
<p><em>A "definition list" is a series of terms and definitions. More than one definition may be associated
with a single term.</em></p>
</div>
<form action="javascript:return false;" class="neoCMSDlGenerator" id="neoCMSDlGenerator" method="post"
name="neoCMSDlGenerator">
</form>
<div class="neoCMSDefInsert neoCMSPromptInsert">
<a class="neoCMSInsertBtnDone" href="javascript:" id="neoCMSPromptBtn" title="Apply these changes">done</a>
<a href="javascript:" id="neoCMSCancelBtn" title="cancel">cancel</a>
</div>
</div>
<div id="neoCMSPromptBot">
<div class="neoCMSPromptBotL">
<div class="neoCMSPromptBotR"></div>
</div>
</div>
</div>
-10
View File
@@ -1,10 +0,0 @@
<div class="neoCMSEditWrap" id="neoCMSEditWrap">
<ul id="neoCMSEditTopUl">
<li id="neoCMSEditDone"><a href="javascript:" title="Apply these changes">done</a></li>
<li id="neoCMSEditCancel"><a href="javascript:" title="Do not apply these changes">cancel</a></li>
<li id="neoCMSFullscreen"><a class="fullscreen" href="javascript:" rel="#neoCMSEditWrap"
title="Maximize this window">Maximize this window</a></li>
<li id="neoCMSContrast"><a href="javascript:" id="neoCMSEditorContrast"
title="Scroll here to change editor contrast"></a></li>
</ul>
</div>
-10
View File
@@ -1,10 +0,0 @@
<div class="neoCMSFiles clearfix" id="neoCMSFiles">
<a href="javascript:" id="neoCMSFClose">cancel</a>
<h2>Loading&hellip;</h2>
<ul id="filesTab">
<li class="on" id="pages"><a href="javascript:" rel="#neoCMSPagesUL">Pages</a></li>
<li id="images"><a href="javascript:" rel="#neoCMSImgUL">Images</a></li>
<li id="files"><a href="javascript:" rel="#neoCMSFileUL">Files</a></li>
</ul>
<div id="neoCMSFileULs"></div>
</div>
-12
View File
@@ -1,12 +0,0 @@
<div class="neoCMSHtmlPrompt neoCMSPrompt clearfix" id="neoCMSPrompt">
<h4 class="neoCMSPromptTitle"><a class="fullscreen" href="javascript:" rel=".neoCMSHtmlPrompt"
title="Maximize this window">Maximize this window</a>Edit HTML</h4>
<div class="neoCMSHtmlInsert neoCMSPromptInsert">
<a href="javascript:" id="neoCMSPromptBtn" title="Update HTML">done</a>
<a href="javascript:" id="neoCMSCancelBtn" title="cancel">cancel</a>
</div>
<form action="javascript:return false;" class="neoCMSHtmlEditForm" method="post">
<textarea class="codepress html linenumbers-off" class="neoCMSHtmlEditArea" cols="1" id="neoCMSHtmlEditAreaTA"
name="neoCMSHtmlEditAreaTA" rows="1"></textarea>
</form>
</div>
-38
View File
@@ -1,38 +0,0 @@
<div class="neoCMSImgSelect neoCMSPrompt clearfix" id="neoCMSPrompt">
<h4 class="neoCMSPromptTitle" id="neoCMSPromptTitle">Edit Image</h4>
<div class="neoCMSImgChoose neoCMSImgChooseInline clearfix" id="neoCMSImgChoose">
<h4>Upload A New Image</h4>
<p>First select the folder you want to upload to:</p>
<form action="core/upload.php?type=img" class="neoCMSImgLoc" enctype="multipart/form-data" id="neoCMSImgLoc"
method="POST" target="neoCMSImgUploadIframe">
<select id="neoCMSImgFolder" name="neoCMSImgFolder">
<option class="defaultFolder" id="neoCMSImgFolderDefault" selected="selected" value="">Loading&hellip;
</option>
</select>
<p>Then, upload an image from your computer:</p>
<input class="neoCMSImgUpload" id="neoCMSImgUpload" name="neoCMSImgUpload" type="file">
</form>
<form action="javascript:" class="neoCMSImgLoc" enctype="multipart/form-data" method="POST" name="neoCMSImgSrc">
<h4 class="neoCMSImgURLTitle">Or Choose An Existing Image</h4>
<p>To use an image that already exists on the web, enter the URL of the image below:</p>
<div><input class="neoCMSImgAddress" id="neoCMSImgAddress" name="neoCMSImgAddress" type="text"
value="http://"/><a class="neoCMSFBrowse" href="javascript:" rel="#neoCMSImgAddress"
title="Link to a file on the server">browse</a></div>
<p><a class="neoCMSApplyBtn" href="javascript:" id="neoCMSApplyBtn">&laquo; apply</a></p>
</form>
</div>
<ul class="neoCMSImgProperties">
<li class="neoCMSImgAltText clearfix"><label>Alt Text</label><input id="neoCMSImgAltTxt" name="neoCMSImgAltTxt"
type="text"></li>
<li class="clearfix"><label>Class</label><input id="neoCMSImgClass" name="neoCMSImgClass" type="text"></li>
<li class="clearfix"><label>Link URL</label><input id="neoCMSImgLink" name="neoCMSImgLink" type="text"><a
class="neoCMSFBrowse" href="javascript:" rel="#neoCMSImgLink" title="Link to an image on the server">browse</a>
</li>
<li class="neoCMSImgRel disabled clearfix"><label>Link Rel</label><input disabled="disabled" id="neoCMSImgRel"
name="neoCMSImgRel" type="text"></li>
</ul>
<div class="neoCMSImgInsert neoCMSPromptInsert">
<a href="javascript:" id="neoCMSPromptBtn" title="Apply these changes">done</a>
<a href="javascript:" id="neoCMSPromptCancel" title="cancel">cancel</a>
</div>
</div>
-18
View File
@@ -1,18 +0,0 @@
<div class="neoCMSLinkPrompt neoCMSPrompt clearfix" id="neoCMSPrompt">
<h4 class="neoCMSPromptTitle" id="neoCMSPromptTitle">Edit Link</h4>
<form action="#" class="neoCMSLinkProperties" id="neoCMSLinkProperties" method="post" name="neoCMSLinkProperties">
<ul>
<li><label>Link URL</label><input id="neoCMSLinkURL" name="neoCMSLinkURL" type="text">
<a class="neoCMSFBrowse" href="javascript:" rel="#neoCMSLinkURL" title="Link to a file on the server">browse</a>
</li>
<li class="neoCMSLinkID"><label>ID</label><input id="neoCMSLinkID" name="neoCMSLinkID" type="text"></li>
<li><label>Class</label><input id="neoCMSLinkClass" name="neoCMSLinkClass" type="text"></li>
<li><label>Title</label><input id="neoCMSLinkTitle" name="neoCMSLinkTitle" type="text"></li>
<li><label>Rel</label><input id="neoCMSLinkRel" name="neoCMSLinkRel" type="text"></li>
<li class="neoCMSLinkInsert neoCMSPromptInsert">
<a href="javascript:" id="neoCMSPromptBtn" title="Create a link from the selection">done</a>
<a href="javascript:" id="neoCMSCancelBtn" title="cancel">cancel</a>
</li>
</ul>
</form>
</div>
-8
View File
@@ -1,8 +0,0 @@
<div class="neoCMSPrompt neoCMSSimplePrompt clearfix" id="neoCMSPrompt">
<h4 class="neoCMSPromptTitle"></h4>
<p></p>
<div class="neoCMSPromptInsert clearfix" id="neoCMSPromptInsert">
<a href="javascript:" id="neoCMSPromptBtn" title=""></a>
<a href="javascript:" id="neoCMSCancelBtn" title="cancel">cancel</a>
</div>
</div>
-44
View File
@@ -1,44 +0,0 @@
<div class="neoCMSTables neoCMSPrompt clearfix" id="neoCMSPrompt">
<h4 class="neoCMSPromptTitle" id="neoCMSPromptTitle">Insert Table</h4>
<div id="neoCMSTablePrev">
<table>
<tbody>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
</div>
<div id="neoCMSTableOptions">
<h4>Table Options</h4>
<form action="javascript:" method="post">
<ul id="tableRowsCols">
<li class="clearfix"><label>Rows</label><input id="neoCMSTableRows" name="neoCMSTableID" tabindex="1"
type="text" value="2"/></li>
<li class="clearfix"><label>Columns</label><input id="neoCMSTableCols" name="neoCMSTableCols"
tabindex="2" type="text" value="2"/></li>
</ul>
<ul id="tableHeadFoot">
<li class="clearfix"><input id="neoCMSTableThead" name="neoCMSTableThead" tabindex="3" type="checkbox"
value="Y"/><label>Add Header</label></li>
<li class="clearfix"><input id="neoCMSTableTfoot" name="neoCMSTableTfoot" tabindex="4" type="checkbox"
value="Y"/><label>Add Footer</label></li>
</ul>
<ul id="tableAttrs">
<li class="clearfix"><label>Table ID</label><input id="neoCMSTableID" name="neoCMSTableID" tabindex="5"
type="text"/></li>
<li class="clearfix"><label>Class</label><input id="neoCMSTableClass" name="neoCMSTableClass"
tabindex="6" type="text"/></li>
</ul>
</form>
</div>
<div class="neoCMSVidInsert neoCMSPromptInsert">
<a href="javascript:" id="neoCMSPromptBtn" title="Insert this table">insert</a>
<a href="javascript:" id="neoCMSPromptCancel" title="cancel">cancel</a>
</div>
</div>
-24
View File
@@ -1,24 +0,0 @@
<div class="neoCMSUploadContent neoCMSPrompt clearfix" id="neoCMSPrompt">
<h4 class="neoCMSPromptTitle" id="neoCMSPromptTitle">Upload A File</h4>
<p id="neoCMSUploadTxt">To upload a file, first select the folder you want to upload to:</p>
<form action="core/upload.php" class="neoCMSUploadForm neoCMSImgChooseInline" enctype="multipart/form-data" id="neoCMSUploadForm"
method="POST" name="neoCMSUploadForm" target="neoCMSUploadIframe">
<ul>
<li>
<select id="neoCMSFolder" name="neoCMSFolder">
<option class="defaultFolder" id="neoCMSFolderDefault" selected="selected" value="">
Loading&hellip;
</option>
</select>
</li>
<li>
<p>Then, select the file from your computer:</p>
<input class="neoCMSUpload" id="neoCMSUpload" name="neoCMSUpload" type="file"/>
</li>
<li class="neoCMSPromptInsert">
<a href="javascript:" id="neoCMSPromptBtn" title="Finish Uploading">done</a>
<a href="javascript:" id="neoCMSCancelBtn" title="cancel">cancel</a>
</li>
</ul>
</form>
</div>
-15
View File
@@ -1,15 +0,0 @@
<div class="neoCMSVidSelect neoCMSPrompt clearfix" id="neoCMSPrompt">
<h4 class="neoCMSPromptTitle" id="neoCMSPromptTitle">Insert Video</h4>
<div class="neoCMSVidChoose neoCMSVidChooseInline clearfix" id="neoCMSVidChoose">
<h4 id="neoCMSVidSub">Video Embed</h4>
<p>Edit the embed code, or paste here to replace with a new video.</p>
<form action="javascript:" class="neoCMSVidLoc" enctype="multipart/form-data" id="neoCMSVidLoc" method="POST">
<textarea class="neoCMSVidEmbed" id="neoCMSVidEmbed" name="neoCMSVidEmbed" rows="12"></textarea>
<a class="neoCMSApplyBtn" href="javascript:" id="neoCMSApplyBtn">&laquo; apply</a>
</form>
</div>
<div class="neoCMSVidInsert neoCMSPromptInsert">
<a href="javascript:" id="neoCMSPromptBtn" title="Apply these changes">done</a>
<a href="javascript:" id="neoCMSPromptCancel" title="cancel">cancel</a>
</div>
</div>
File diff suppressed because one or more lines are too long
+3
View File
@@ -0,0 +1,3 @@
This is where language files should be placed.
Please DO NOT translate these directly, use this service instead: https://crowdin.com/project/tinymce
+6
View File
@@ -0,0 +1,6 @@
# Software License Agreement
**TinyMCE** – [<https://github.com/tinymce/tinymce>](https://github.com/tinymce/tinymce)
Copyright (c) 2024, Ephox Corporation DBA Tiny Technologies, Inc.
Licensed under the terms of [GNU General Public License Version 2 or later](http://www.gnu.org/licenses/gpl.html).
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More