diff --git a/cms/core/checkbrand.php b/cms/core/checkbrand.php deleted file mode 100644 index 65a30da..0000000 --- a/cms/core/checkbrand.php +++ /dev/null @@ -1,8 +0,0 @@ -window.top.window.forgotReset("' . $getmessage . '");'; - echo $script; - - } -} - -?> \ No newline at end of file diff --git a/cms/core/ftpclear.php b/cms/core/ftpclear.php deleted file mode 100644 index 52a830e..0000000 --- a/cms/core/ftpclear.php +++ /dev/null @@ -1,67 +0,0 @@ -'; - - $fftp = ''; - - include_once('ftpvars.php'); - include_once('ftpconnect.php'); - - ftpconnect(); - - if ($ftpconn) { - - $ftpdoc = tmpfile(); - if (!$ftpdoc) { - $ftpdocp = tempnam(dirname(__FILE__) . '/../settings/tmp', 'Ftpdoc'); - chmod($ftpdocp, 0777); - $ftpdoc = fopen($ftpdocp, 'w+'); - } - - fwrite($ftpdoc, $ftpvars); - rewind($ftpdoc); - - $path = urldissect($_SERVER['SCRIPT_NAME'], false, 1); - - $remotefile = $ftpwd . $path . 'ftpvars.php'; - - if (ftp_fput($ftpconn, $remotefile, $ftpdoc, FTP_BINARY)) { - - $getmessage = "Your FTP information has been successfully cleared."; - $savescript = ''; - echo $savescript; - - } else { - $getmessage = 'Error: neocms could not find this page: ' . $remotefile . ''; - $savescript = ''; - echo $savescript; - } - - fclose($ftpdoc); - if (isset($ftpdocp)) unlink($ftpdocp); - } - - echo ''; - - } - -} - -?> \ No newline at end of file diff --git a/cms/core/ftpconnect.php b/cms/core/ftpconnect.php deleted file mode 100644 index 9c9c30d..0000000 --- a/cms/core/ftpconnect.php +++ /dev/null @@ -1,34 +0,0 @@ -Error: FTP is not enabled for your install of PHP. More info here."; - $savescript = ''; - echo $savescript; - - } - - } - -} - -?> \ No newline at end of file diff --git a/cms/core/ftpcreate.php b/cms/core/ftpcreate.php deleted file mode 100644 index 6240809..0000000 --- a/cms/core/ftpcreate.php +++ /dev/null @@ -1,82 +0,0 @@ -'; - - include_once('ftpconnect.php'); - ftpconnect(); - - if ($ftpconn) { - - $ftpdoc = tmpfile(); - if (!$ftpdoc) { - $ftpdocp = tempnam(dirname(__FILE__) . '/../settings/tmp', 'Ftpdoc'); - chmod($ftpdocp, 0777); - $ftpdoc = fopen($ftpdocp, 'w+'); - } - - fwrite($ftpdoc, $ftpvars); - rewind($ftpdoc); - - $path = urldissect($_SERVER['SCRIPT_NAME'], false, 1); - - $remotefile = $ftpwd . $path . 'ftpvars.php'; - - if (ftp_fput($ftpconn, $remotefile, $ftpdoc, FTP_BINARY)) { - - $getmessage = "Your FTP information was successfully saved."; - $savescript = ''; - echo $savescript; - - } else { - $getmessage = "Error: There is an error in your FTP credentials. Please try entering them again."; - $savescript = ''; - echo $savescript; - } - - fclose($ftpdoc); - if (isset($ftpdocp)) unlink($ftpdocp); - } - - echo ''; - - } else { - - $getmessage = 'Error: All fields are required.'; - $savescript = ''; - echo $savescript; - - echo ''; - - } - - } - -} - -?> \ No newline at end of file diff --git a/cms/core/ftpstart.php b/cms/core/ftpstart.php deleted file mode 100644 index 61acbcb..0000000 --- a/cms/core/ftpstart.php +++ /dev/null @@ -1,10 +0,0 @@ - \ No newline at end of file diff --git a/cms/core/ftpvars.php b/cms/core/ftpvars.php deleted file mode 100644 index f7af05b..0000000 --- a/cms/core/ftpvars.php +++ /dev/null @@ -1,8 +0,0 @@ - \ No newline at end of file diff --git a/cms/core/getpath.php b/cms/core/getpath.php deleted file mode 100644 index 1fc7c7b..0000000 --- a/cms/core/getpath.php +++ /dev/null @@ -1,25 +0,0 @@ - $val) { - - if (strstr($key, '-A')) $admin[str_replace('-A', '', $key)] = $val; - elseif (!strstr($key, 'neoCMSSess') && !strstr($key, 'neoCMSUserMessage')) { - - $num = explode('-', $key); - $users[$num[1]][$num[0]] = $val; - - } - - } - - $adminscript = ''; - echo $adminscript; - - foreach ($users as $user) { - - $userscript = ''; - echo $userscript; - - } - - if ($_GET['neoCMSUserMessage'] != '0') { - - $m = $_GET['neoCMSUserMessage']; - - if ($m == '1') $getmessage = "Your account settings were successfully saved."; - elseif ($m == '2') $getmessage = "Your new account has been successfully created."; - elseif ($m == '3') $getmessage = "Error: This account has already been created."; - elseif ($m == '4') $getmessage = "Account successfully deleted."; - elseif ($m == '5') $getmessage = "Error: There was an error deleting this account."; - else $getmessage = "Error: There was an error saving."; - - $savescript = ''; - echo $savescript; - - $_SESSION['neoCMSUserid'] = $admin['neoCMSUsername']; - } - - echo ''; - } - } -} - -?> \ No newline at end of file diff --git a/cms/core/login.php b/cms/core/login.php index 1058a35..8aea073 100644 --- a/cms/core/login.php +++ b/cms/core/login.php @@ -10,10 +10,6 @@ if (isset($_SESSION['neoCMSSess']) && strstr($_SESSION['neoCMSSess'], 'neoCMSses if ($_POST) { - include_once('getpath.php'); - - $logingets = 'neoCMSUsername=' . urlencode($_POST['neoCMSUsername']) . '&neoCMSPassword=' . urlencode($_POST['neoCMSPassword']) . '&neoCMSSess=' . urlencode($_SESSION['neoCMSSess']) . '&neoCMSPath=' . urlencode($path); - include_once('../config.php'); if (@$_users[$_POST['neoCMSUsername']]["password"] == $_POST['neoCMSPassword']) { diff --git a/cms/core/logout.php b/cms/core/logout.php index a4f9618..77b90ef 100644 --- a/cms/core/logout.php +++ b/cms/core/logout.php @@ -10,5 +10,3 @@ session_destroy(); @session_write_close(); exit; - -?> \ No newline at end of file diff --git a/cms/core/restore.php b/cms/core/restore.php index f8709fb..d0dc532 100644 --- a/cms/core/restore.php +++ b/cms/core/restore.php @@ -10,7 +10,6 @@ if (isset($_SESSION['neoCMSSess']) && strstr($_SESSION['neoCMSSess'], 'neoCMSses if (isset($_SESSION['neoCMSUserid'])) { include_once('urldissect.php'); - include_once('ftpstart.php'); include_once('checkpath.php'); $message = 'Error: There was an error restoring your page. Please try again.'; @@ -103,58 +102,15 @@ if (isset($_SESSION['neoCMSSess']) && strstr($_SESSION['neoCMSSess'], 'neoCMSses function editfile($content, $backcontent, $url, $incpath, $inc) { - global $ftpconn, $ftpwd; if ($content != $backcontent && ((!stristr($content, '[^<]+', $backcontent) || preg_match('/Error: neocms could not find this page: ' . $remotefile . ''; - - fclose($restdoc); - if (isset($restdocp)) unlink($restdocp); - - } elseif (is_writable($url)) { + if (is_writable($url)) { //restores file $restdoc = fopen($url, "w"); fputs($restdoc, $backcontent); fclose($restdoc); - } else $message = "Error: You do not have permission to edit this page. Try saving your FTP info here."; + } else $message = "Error: You do not have permission to edit this page."; } @@ -172,9 +128,5 @@ if (isset($_SESSION['neoCMSSess']) && strstr($_SESSION['neoCMSSess'], 'neoCMSses echo $script; } - if ($ftpconn) ftp_close($ftpconn); - } } - -?> \ No newline at end of file diff --git a/cms/core/save.php b/cms/core/save.php index 5e7676a..eb2f9e0 100644 --- a/cms/core/save.php +++ b/cms/core/save.php @@ -10,7 +10,6 @@ if (isset($_SESSION['neoCMSSess']) && strstr($_SESSION['neoCMSSess'], 'neoCMSses if (isset($_SESSION['neoCMSUserid'])) { include_once('urldissect.php'); - include_once('ftpstart.php'); include_once('checkpath.php'); $message = 'Your page was successfully published.'; @@ -47,7 +46,7 @@ if (isset($_SESSION['neoCMSSess']) && strstr($_SESSION['neoCMSSess'], 'neoCMSses function loadfile($url, $incpath, $f) { - global $message, $includes, $pagepath, $ftpconn, $ftpwd, $doctype, $encode, $edit; + global $message, $includes, $pagepath, $doctype, $encode, $edit; $ssi = false; @@ -85,37 +84,13 @@ if (isset($_SESSION['neoCMSSess']) && strstr($_SESSION['neoCMSSess'], 'neoCMSses $pagename = preg_replace('/(\.php|\.asp|\.html|\.htm|\.phtml|\.shtml|\.cfm)/', '', $pagename); $backup = dirname(__FILE__) . '/../backups/' . $pagename . '_Bak.' . $pageext[1]; - if ($ftpconn) { - - $backdoc = tmpfile(); - if (!$backdoc) { - $backdocp = tempnam(dirname(__FILE__) . '/../settings/tmp', 'Back'); - chmod($backdocp, 0777); - $backdoc = fopen($backdocp, 'w+'); - } - - fwrite($backdoc, $content); - rewind($backdoc); - - $path = urldissect($_SERVER['SCRIPT_NAME'], false, 2); - - $remotefile = $ftpwd . $path . 'backups/' . $pagename . '_Bak.' . $pageext[1]; - - echo "Backup File: $remotefile\n\n"; - - if (ftp_fput($ftpconn, $remotefile, $backdoc, FTP_BINARY)) echo "Uploaded Backup: $remotefile!\n\n"; - else $message = 'Error: neocms failed creating backup for: ' . $remotefile . ''; - - fclose($backdoc); - if (isset($backdocp)) unlink($backdocp); - - } elseif (is_writable($url)) { + if (is_writable($url)) { $backdoc = fopen($backup, "w+"); fwrite($backdoc, $content); fclose($backdoc); - } else $message = 'Error: You do not have permission to edit this page: ' . $pagefile . ". Try saving your FTP info here."; + } else $message = 'Error: You do not have permission to edit this page: ' . $pagefile . "."; // clean up content @@ -500,7 +475,7 @@ if (isset($_SESSION['neoCMSSess']) && strstr($_SESSION['neoCMSSess'], 'neoCMSses fwrite($doc, $fpost); fclose($doc); - } else $message = "Error: You do not have permission to edit this page. Try saving your FTP info here."; + } else $message = "Error: You do not have permission to edit this page."; } else $message = 'Error: neocms is unable find this page.'; diff --git a/cms/core/sessionConfiguration.php b/cms/core/sessionConfiguration.php index 80b7932..d754623 100644 --- a/cms/core/sessionConfiguration.php +++ b/cms/core/sessionConfiguration.php @@ -9,9 +9,9 @@ if (isset($_SESSION['neoCMSSess']) && strstr($_SESSION['neoCMSSess'], 'neoCMSses if (isset($_SESSION['neoCMSUserid'])) { - $_SESSION['neoCMSHTML'] = $gethtml = ""; + $_SESSION['neoCMSHTML'] = $gethtml = "Y"; $_SESSION['neoCMSPath'] = $getpath = "cms"; - $_SESSION['neoCMSFiles'] = $getfile = 1; + $_SESSION['neoCMSFiles'] = $getfile = "Y"; $_SESSION['neoCMSFilePath'] = $getfilepath = "files"; $_SESSION['neoCMSImagePath'] = $getimagepath = "images"; $_SESSION['neoCMSExFolders'] = $getexfolders = "ext"; diff --git a/cms/core/upload.php b/cms/core/upload.php index 79dd51a..320af0a 100644 --- a/cms/core/upload.php +++ b/cms/core/upload.php @@ -6,7 +6,6 @@ if (isset($_SESSION['neoCMSSess']) && strstr($_SESSION['neoCMSSess'], 'neoCMSsession')) { include_once('urldissect.php'); - include_once('ftpstart.php'); include_once('createsession.php'); if (!empty($_POST) && isset($_SESSION['neoCMSUserid'])) { @@ -30,16 +29,6 @@ if (isset($_SESSION['neoCMSSess']) && strstr($_SESSION['neoCMSSess'], 'neoCMSses if (move_uploaded_file($file['tmp_name'], $uploadfile)) { $alert = "Your file was successfully uploaded."; - } elseif ($ftpconn) { - - $path = urldissect($_SERVER['SCRIPT_NAME'], false, 3); - $uploadfile = str_ireplace('../../', '', $uploadfile); - - $remotefile = $ftpwd . $path . $uploadfile; - $tempfile = fopen($file['tmp_name'], 'r'); - - if (ftp_fput($ftpconn, $remotefile, $tempfile, FTP_BINARY)) $alert = "Your file was successfully uploaded."; - } } else { @@ -73,22 +62,7 @@ if (isset($_SESSION['neoCMSSess']) && strstr($_SESSION['neoCMSSess'], 'neoCMSses if (!preg_match('/(\.html|\.php|\.js|\.css|\.htm|\.shtml|\.asp|\.cfm|\.phtml)$/i', $fileName) && $fileSize < 100000000) { - if ($ftpconn) { - - $path = urldissect($_SERVER['SCRIPT_NAME'], false, 3); - $uploadfile = str_ireplace('../../', '', $uploadfile); - - $remotefile = $ftpwd . $path . $uploadfile; - $tempfile = fopen($file['tmp_name'], 'r'); - - if (ftp_fput($ftpconn, $remotefile, $tempfile, FTP_BINARY)) $alert = "Your file was successfully uploaded."; - else { - $alert = "Error: You do not have permission to upload files to this folder."; - $script = ''; - echo $script; - } - - } elseif (move_uploaded_file($file['tmp_name'], $uploadfile)) { + if (move_uploaded_file($file['tmp_name'], $uploadfile)) { $alert = "Your file was successfully uploaded."; } else { $alert = "Error: You do not have permission to upload files to this folder."; @@ -111,10 +85,6 @@ if (isset($_SESSION['neoCMSSess']) && strstr($_SESSION['neoCMSSess'], 'neoCMSses } - if ($ftpconn) ftp_close($ftpconn); - } } - -?> \ No newline at end of file diff --git a/cms/css/neocms-main.css b/cms/css/neocms-main.css deleted file mode 100644 index 63d1856..0000000 --- a/cms/css/neocms-main.css +++ /dev/null @@ -1,589 +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(../neocms-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(../neocms-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(../neocms-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(../neocms-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; - *filter: alpha(opacity=30) !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 */ \ No newline at end of file diff --git a/cms/css/neocms-ui.css b/cms/css/neocms-ui.css deleted file mode 100644 index 7f84123..0000000 --- a/cms/css/neocms-ui.css +++ /dev/null @@ -1,2751 +0,0 @@ -/* HEADER STYLES --------------------------------------------- */ - -body { - background: url(../neocms-images/prompt.gif) repeat-x top; -} - -.neoCMSTopBanner { - margin: 0; - padding: 0; - clear: both; - width: 100%; - height: 60px; - display: block; - font-family: Arial, Helvetica, sans-serif; - position: relative; - z-index: 10; - border-bottom: 1px solid #999; -} - -body.neoCMSAcct .neoCMSTopBanner, body.neoCMSPref .neoCMSTopBanner { - margin-top: 0px; -} - -.neoCMSHeader { - margin: 0 auto; - padding: 0; - width: 960px; - height: 60px; - display: block; - text-align: left; -} - -.neoCMSHeader h1 { - margin: 0; - padding: 0 60px 0 0; - float: left; - display: block; -} - -.neoCMSHeader h1 a { - font-size: 10px; - color: #fff; - width: 60px; - height: 57px; - display: block; - background: url(../neocms-images/neocms_sprite1.png) no-repeat 0 0; - text-indent: -5000px; -} - -.neoCMSHeader h1 a:hover { - background: url(../neocms-images/neocms_sprite1.png) no-repeat 0 0; -} - -ul.neoCMSInfo { - margin: 0; - padding: 0; - list-style: none; - display: block; - color: #fff; -} - -.neoCMSInfo li { - float: left; - display: inline; - margin: 0; - padding: 0 15px 0 0; - line-height: 60px; - color: #555; -} - -.neoCMSInfo li a:link, .neoCMSInfo li a:visited { - font-size: 11px; - color: #82ac3f; - text-decoration: none; - padding: 0 15px 0 0; -} - -.neoCMSInfo li a:hover { - color: #fff; - text-decoration: underline; -} - -ul.neoCMSTopNav { - margin: 0; - padding: 0; - float: right; - height: 30px; - display: inline; - list-style: none; - text-align: left; - font-size: 10px; - color: #fff; - overflow: hidden; - padding-top: 15px; -} - -.neoCMSTopNav li { - margin: 0; - padding: 0; - float: left; - line-height: 30px; - padding: 0 15px 0 0; -} - -#neoCMSPublish { - padding: 0; -} - -li#neoCMSRestore { - padding-right: 0; - margin-right: 19px; - color: #222; - font-size: 30px; - text-shadow: 0 1px 1px #555; -} - -.neoCMSTopNav li a { - margin: 0; - padding: 0; - color: #fff; - height: 57px; - top: -15px; - position: relative; - display: block; - overflow: hidden; - text-indent: -5000px; - background: url(../neocms-images/neocms_sprite1.png) no-repeat; - text-decoration: none; -} - -li#neoCMSUndo a:link, li#neoCMSUndo a:visited { - width: 72px; - background-position: -62px 0; -} - -li#neoCMSRedo a:link, li#neoCMSRedo a:visited { - width: 72px; - background-position: -134px 0; -} - -li#neoCMSCxl a:link, li#neoCMSCxl a:visited { - width: 87px; - background-position: -206px 0; -} - -li#neoCMSPublish a:link, li#neoCMSPublish a:visited { - width: 84px; - background-position: -385px 0; -} - -li#neoCMSRestore a:link, li#neoCMSRestore a:visited { - width: 80px; - background-position: -294px 0; - margin-right: 20px; - float: left; -} - -li#neoCMSUndo a:hover { - background-position: -62px -60px; -} - -li#neoCMSRedo a:hover { - background-position: -134px -60px; -} - -li#neoCMSCxl a:hover { - background-position: -206px -60px; -} - -li#neoCMSPublish a:hover { - background-position: -385px -60px; -} - -li#neoCMSRestore a:hover { - background-position: -294px -60px; -} - -/* neocms FEEDBACK BAR --------------------------------------------- */ - -div.neoCMSUserBar { - width: 100%; - padding: 5px 0; - height: 15px; - border-bottom: 1px solid #eee; - margin: 0; -} - -#neoCMSUserBar { - background-color: #82ac3f; - position: absolute; - top: 61px; - display: block; - z-index: 250; - left: 0; -} - -div.neoCMSUserBarIn { - width: 960px; - position: relative; - margin: auto; -} - -div.neoCMSUserBar p { - color: #fff; - font-size: 1.1em; -} - -div.neoCMSUserBar p strong { - color: #eee; -} - -div.neoCMSUserBar a:link, div.neoCMSUserBar a:visited { - float: right; - display: block; - margin-right: 20px; - color: #fff; - text-decoration: none; -} - -div.neoCMSUserBar a:hover { - text-decoration: underline; -} - -div.neoCMSUserBar p a { - float: none !important; - display: inline !important; - margin: 0 !important; - text-decoration: underline !important; -} - -/* EDIT INTERFACE STYLES --------------------------------------------- */ - -.neoCMSEditWrap { - margin: 0; - padding: 0; - background: transparent; - font-family: Arial, Helvetica, sans-serif; - z-index: 110; - position: absolute !important; - display: block; - height: auto; -} - -.neoCMSEditWrap #highlight { - position: absolute; - top: 0; - left: 0; - height: 100%; - width: 100%; - background: #fff; - display: block; -} - -/*.neoCMSEditTopBar { - background: url(../neocms-images/neocms_sprite1.png) no-repeat -516px -50px; - display: block; - position: relative; - height: 40px; - width: 100%; -}*/ - -.neoCMSEditWrap #neoCMSEditContent_parent, .neoCMSEditWrap #neoCMSEditContent_ifr, .neoCMSEditWrap #neoCMSEditContent_tbl { - clear: both; - float: left; - display: block; - height: auto; -} - -/*.neoCMSEditTop { - display: block; - margin: 0 0 0 10px; - padding: 0 10px 0 0; - position: relative; - background: url(../neocms-images/edit_corner_right.png) no-repeat right top; - height: 40px; - width: auto; - text-align: left; -}*/ - -#neoCMSEditTopUl { - margin: 0; - padding: 0 10px; - height: 40px; - list-style: none; - display: block; - text-align: left; - clear: both; - background: #000; - -moz-border-radius-topleft: 14px; - -moz-border-radius-topright: 14px; - -webkit-border-top-left-radius: 14px; - -webkit-border-top-right-radius: 14px; - overflow: hidden; -} - -#neoCMSEditTopUl li { - margin: 0; - padding: 0; - float: left; - line-height: 40px; - margin-right: 20px; -} - -a#neoCMSEditHTML, #neoCMSEditTopUl li#neoCMSFullscreen, a.fullscreen, #neoCMSEditTopUl li#neoCMSContrast { - float: right; - margin: 0; -} - -li#neoCMSFullscreen a.fullscreen { - float: none; - margin: 10px 0 0 0; -} - -#neoCMSEditTopUl li a:link, #neoCMSEditTopUl li a:visited { - color: #fff; - text-decoration: none; - font-size: 11px; -} - -#neoCMSEditTopUl li a:hover { - color: #82ac3f; - text-decoration: underline; -} - -li#neoCMSEditDone a { - margin-top: 9px; - width: 56px; - height: 22px; - line-height: 22px; - font-size: 12px !important; - display: block; - text-decoration: none; - color: #fff; - background: url(../neocms-images/neocms_sprite1.png) no-repeat -1221px 0; - border: none; - text-align: center; - cursor: pointer; -} - -li#neoCMSEditDone a:hover { - text-decoration: none; - color: #000; - background-position: -1221px -22px; -} - -a#neoCMSEditHTML:link, a#neoCMSEditHTML:visited { - margin: 1px 0 0 20px; - background: url(../neocms-images/neocms_sprite1.png) no-repeat -578px -76px; - width: 56px; - height: 22px; - display: block; - overflow: hidden; - text-indent: -5000px; - cursor: pointer; -} - -a#neoCMSEditHTML:hover { - background-position: -578px -98px; -} - -a.fullscreen:link, a.fullscreen:visited { - margin: 0; - display: block; - background: url(../neocms-images/neocms_sprite1.png) no-repeat; - background-position: -576px 0; - height: 22px; - width: 31px; - overflow: hidden; - text-indent: -5000px; -} - -a.fullscreen:hover { - background-position: -576px -22px; -} - -a.neoCMSMinimize:link, a.neoCMSMinimize:visited { - background-position: -607px 0; -} - -a.neoCMSMinimize:hover { - background-position: -607px -22px; -} - -a#neoCMSEditorContrast:link, a#neoCMSEditorContrast:visited { - margin: 10px 20px 0 0; - display: block; - background: url(../neocms-images/neocms_sprite1.png) no-repeat; - background-position: -576px -50px; - height: 20px; - width: 20px; - border: 1px solid #777; - overflow: hidden; -} - -a#neoCMSEditorContrast:hover { - border: 1px solid #ccc; -} - -.neoCMSEditTools { - clear: both; - float: left; - background: #000; - text-align: left; -} - -ul.neoCMSEditLinks { - float: left; - clear: left; - list-style: none; - display: inline; - margin: 0 3px; - padding: 5px 0; - border-top: 1px solid #666; - font-size: 11px; - color: #fff; - height: 22px; - overflow: visible; - background: #000; -} - -.neoCMSEditLinks li { - float: left; - margin: 0; - padding: 0; - line-height: 22px; - border-right: 1px solid #666; -} - -.neoCMSEditLinks li a:link, .neoCMSEditLinks li a:visited { - color: #fff; - text-decoration: none; - margin: 0 3px; - padding: 5px 4px; -} - -.neoCMSEditLinks li a:hover { - color: #fff; - text-decoration: none; - background: #666; -} - -a#neoCMSEditContent_bullist:link, a#neoCMSEditContent_bullist:visited { - background: url(../neocms-images/neocms_sprite1.png) no-repeat -1013px 5px; - padding-right: 7px; -} - -a#neoCMSEditContent_numlist:link, a#neoCMSEditContent_numlist:visited { - background: url(../neocms-images/neocms_sprite1.png) no-repeat -1045px 3px; - padding-right: 7px; -} - -a#neoCMSEditContent_deflist:link, a#neoCMSEditContent_deflist:visited { - background: url(../neocms-images/neocms_sprite1.png) no-repeat -1013px -24px; - padding-right: 7px; -} - -.neoCMSEditContent { - clear: both; - float: left; - display: block; - margin: 0; - padding: 4px; - - .padding: - - 5px; - border-right: 3px solid #000; - border-bottom: 3px solid #000; - border-left: 3px solid #000; - background: #fff; - height: auto !important; - overflow-x: none; - overflow-y: auto; -} - -a img.neoCMSCloseAlert { - border: none; - float: right; -} - -.neoCMSDefAlert p { - margin: 0 30px 0 0; - padding: 0; - font-size: 12px; - line-height: 1.4em; - color: #fff !important; -} - -.neoCMSDefAlert a.neoCMSDefAlertLink:link, .neoCMSDefAlert a.neoCMSDefAlertLink:link { - margin: 0; - padding: 0; - font-size: 11px; - line-height: 1em; - float: right; - clear: left; - text-align: left; - text-decoration: none; - color: #999; -} - -.neoCMSDefAlert a.neoCMSDefAlertLabel:hover { - text-decoration: underline; -} - -form.neoCMSDlGenerator { - margin: 0; - padding: 0; -} - -.neoCMSDlBox { - clear: both; - display: block; - margin: 0 0 2px 0; - padding: 5px 10px; - background: #f0f0f0; - overflow: visible; - position: relative; -} - -p.neoCMSDlDel { - position: absolute; - top: 5px; - right: 10px; - margin: 0; - padding: 0; - display: none; - z-index: 100; - cursor: pointer; -} - -p.neoCMSDlDel a:link, p.neoCMSDlDel a:visited { - text-decoration: none; - width: 17px; - height: 15px; - display: block; - background: url(../neocms-images/neocms_sprite1.png) no-repeat -1084px 0; - text-indent: -5000px; - overflow: hidden; -} - -p.neoCMSDlDel a:hover { - text-decoration: none; - background: url(../neocms-images/neocms_sprite1.png) no-repeat -1084px -16px; -} - -.neoCMSDlBox ol { - margin: 0; - padding: 0; - list-style: none; - font-size: 12px; - color: #333; -} - -.neoCMSDlBox li { - padding: 3px 0; - position: relative; -} - -.neoCMSDlGenerator label { - padding: 0 !important; - color: #333 !important; -} - -input.neoCMSDlTerm, textarea.neoCMSDlDefinition { - font-family: Arial, Helvetica, sans-serif; - border: 1px dashed #999; - font-size: 12px; - height: auto; - background: #f0f0f0; - padding: 2px; - width: 268px; - margin: 0 0 0 22px; -} - -input.neoCMSDlTerm { - width: 260px; - margin: 0; -} - -textarea.neoCMSDlDefinition { - height: 35px; -} - -.neoCMSDlBox input:focus, .neoCMSDlBox textarea:focus { - border: 1px solid #82ac3f !important; - background: #fff !important; -} - -a.neoCMSAddDef, a.neoCMSDeleteDef { - margin: 0 4px 0 0; - padding: 0; - width: 18px; - height: 18px; - display: block; - position: absolute; - top: 10; - left: 0; - overflow: hidden; - text-indent: -5000px; - background: url(../neocms-images/neocms_sprite1.png) no-repeat -1104px 0; -} - -a.neoCMSDeleteDef { - margin: 0; - background: url(../neocms-images/neocms_sprite1.png) no-repeat -1125px 0; - top: 38px; - display: none; -} - -p.neoCMSAddTerm { - clear: both; - display: block; - margin: 0 0 10px 0; - padding: 4px 0 4px 10px !important; - background: #999; -} - -p.neoCMSAddTerm a:link, p.neoCMSAddTerm a:visited { - clear: both; - width: 85px; - height: 21px; - display: block; - text-decoration: none; - background: url(../neocms-images/neocms_sprite1.png) no-repeat -576px 0; - text-indent: -5000px; -} - -p.neoCMSAddTerm a:hover { - text-decoration: none; - background: url(../neocms-images/neocms_sprite1.png) no-repeat -576px -22px; -} - -/* ARE YOU SURE BOX STYLES --------------------------------------------- */ - -.neoCMSSureBox1 { - margin: 0 auto; - padding: 0; - width: 353px; - height: 135px; - display: block; - background: transparent url(../neocms-images/areyousure_bg.png) no-repeat top center; - font-family: Arial, Helvetica, sans-serif; -} - -.neoCMSSureBox1 p { - margin: 0; - padding: 20px 20px 20px 100px; - font-size: 14px; - font-weight: bold; - color: #000; - line-height: 1.4em; -} - -.neoCMSSureBox1 ul { - margin: 0; - padding: 0; - list-style: none; - display: inline; -} - -.neoCMSSureBox1 li { - float: left; - margin: 0; - padding: 0; -} - -li.neoCMSYesCxl a:link, li.neoCMSYesCxl a:visited { - margin: 0; - text-decoration: none; - width: 114px; - height: 22px; - display: block; - text-indent: -5000px; - background: url(../neocms-images/neocms_sprite1.png) no-repeat -663px 0; - overflow: hidden; -} - -li.neoCMSYesCxl a:hover { - text-decoration: none; - background: url(../neocms-images/neocms_sprite1.png) no-repeat -663px -22px; -} - -li.neoCMSNoGoback a:link, li.neoCMSNoGoback a:visited { - margin: 0 15px 0 110px; - text-decoration: none; - width: 97px; - height: 22px; - display: block; - text-indent: -5000px; - background: url(../neocms-images/neocms_sprite1.png) no-repeat -780px 0; - overflow: hidden; -} - -li.neoCMSNoGoback a:hover { - text-decoration: none; - background: url(../neocms-images/neocms_sprite1.png) no-repeat -780px -22px; -} - -/* IMAGE UPLOAD SELECT & LINK PROMPT BOX STYLES --------------------------------------------- */ - -#neoCMSPrompt { - border: 1px solid; - border-color: #888 #666 #444 #666; - position: relative; - top: 10%; - margin: 0 auto; - padding: 20px; - display: none; - font-family: Arial, Helvetica, sans-serif; - text-align: left; - overflow: hidden; - background: url(../neocms-images/prompt.gif) repeat-x left bottom #666; - -moz-border-radius: 10px; - -webkit-border-radius: 10px; - -moz-box-shadow: 0 0 10px #666; -} - -.neoCMSPrompt { - width: 314px; -} - -.neoCMSImgVidSelect, .neoCMSTables { - width: 650px; -} - -.neoCMSHtmlPrompt { - top: 20px; - width: 800px; -} - -.neoCMSPrompt p.neoCMSPromptAlert { - padding: 3px 10px 3px 8px; - margin-bottom: 10px; - filter: alpha(opacity=0); - -moz-opacity: 0; - opacity: 0; - color: #fff; - line-height: 1.2em; -} - -.neoCMSPrompt p.neoCMSPromptAlert a { - color: #82ac3f; - text-decoration: none; - margin: 0 10px; -} - -.neoCMSPrompt p.neoCMSPromptAlert a:hover { - text-decoration: underline; -} - -.neoCMSPrompt img { - margin: 0; - padding: 0; - display: block; -} - -#neoCMSPrompt h4.neoCMSPromptTitle { - cursor: move; -} - -.neoCMSHtmlPrompt textarea { - display: block; -} - -#neoCMSPrompt h4.neoCMSPromptTitle, div.neoCMSImgChooseInline h4, div.neoCMSVidChooseInline h4, #neoCMSTableOptions h4 { - margin: 0 0 10px 0; - width: auto; - padding: 0 0 10px 0; - font: normal normal 15px/18px Arial, Helvetica, sans-serif; - display: block; - color: #bbb; - text-align: left; - letter-spacing: 0; - text-transform: none; - background: none; - border-bottom: 1px solid #444; -} - -#neoCMSPrompt h4.neoCMSImageTitle, #neoCMSPrompt h4.neoCMSVidTitle, .neoCMSFileInfo h4 { - margin: 0 0 10px 0; - width: auto; - padding: 0; - font: normal normal 14px/18px Arial, Helvetica, sans-serif; - display: block; - color: #fff; - text-align: left; - letter-spacing: 0; - text-transform: none; - background: none; -} - -#neoCMSPrompt h4.neoCMSImageTitle span, #neoCMSPrompt h4.neoCMSVidTitle span, .neoCMSFileInfo h4 span { - margin: 5px 0 0 0; - padding: 5px 0 5px 0; - border-top: 1px solid #666; - font: normal normal 11px/14px Arial, Helvetica, sans-serif; - display: block; - text-align: left; - letter-spacing: 0; - text-transform: none; - color: #ccc; -} - -.neoCMSPrompt p { - margin: 0 0 10px 0; - padding: 0; - font-size: 11px; - color: #ddd; - text-align: left; -} - -.neoCMSSimplePrompt p { - padding: 0 0 10px 0; - font-size: 12px; - line-height: 16px; -} - -#neoCMSPrompt div.neoCMSImgChooseInline, #neoCMSPrompt div.neoCMSVidChooseInline, #neoCMSTableOptions { - padding: 0; - margin: 0; - display: block; - width: 314px; - float: right; -} - -div.neoCMSImgChooseInline h4, div.neoCMSVidChooseInline h4, #neoCMSTableOptions h4 { - border: 0; - padding: 12px 0 0; - font-size: 13px; -} - -div.neoCMSImgChooseInline h4.neoCMSImgURLTitle { - border-top: 1px solid #555; - padding-top: 10px; -} - -#neoCMSImgFolder, #neoCMSFolder { - padding: 4px 3px 0; - line-height: 1.0em; - font-size: 11px; - margin-bottom: 20px; - width: 253px; -} - -#neoCMSImgFolder option, #neoCMSFolder option { - padding: 3px; -} - -option.defaultFolder { - color: #999; -} - -input.neoCMSImgUpload, input.neoCMSUpload { - font-size: 11px; - cursor: pointer; - height: 22px; - margin: 0 0 20px 0; -} - -form.neoCMSImgLoc, form.neoCMSVidLoc { - float: left; - clear: both; - margin: 0; - padding: 5px 0 0; - text-align: left; - display: inline; - width: 314px; -} - -div.neoCMSImgChooseInline form.neoCMSImgLoc, div.neoCMSVidChooseInline form.neoCMSVidLoc { - margin: 0; -} - -.neoCMSPrompt label { - margin: 0; - padding: 5px 0 10px; - font-size: 11px; - color: #ccc; - display: block; - text-align: left; -} - -.neoCMSImgChooseInline label, .neoCMSVidChooseInline label { - padding: 5px 0; -} - -input.neoCMSImgAddress, textarea.neoCMSVidEmbed { - margin: 0 0 10px 0; - padding: 2px; - background: #fff; - font-size: 11px; - border: none; - float: left; - clear: left; - display: block; -} - -input.neoCMSImgAddress { - margin-right: 1px; - width: 221px !important; -} - -textarea.neoCMSVidEmbed { - width: 314px; -} - -#neoCMSImgChoose form div { - display: block; - overflow: hidden; - width: 253px; -} - -.neoCMSApplyBtn { - float: left; -} - -#neoCMSImgStatArea, #neoCMSVidStatArea, div.neoCMSFileInfo, #neoCMSTablePrev { - width: 294px; - float: left; - display: inline; - background: #444; - padding: 10px; -} - -div.neoCMSFileInfo { - margin-bottom: 20px; -} - -div.neoCMSFileInfo p { - color: #888; -} - -#neoCMSPrompt h6 { - text-align: center; - margin: 0 auto; - padding: 0 0 26px; - font-size: 11px; - color: #ccc; - font-weight: normal; -} - -img.neoCMSImgPreview, div#neoCMSEmbedWrap { - float: right; - margin: 0; - width: 145px; - height: auto; - padding: 0; - border: 1px solid #999; - background: #fff url('../neocms-images/neocms_sprite1.png') repeat-y -1350px 0; -} - -form.neoCMSImgStats, form.neoCMSVidStats { - margin: 0 0 10px 0; - padding: 0; - line-height: 20px; -} - -form.neoCMSImgStats label, form.neoCMSVidStats label { - display: block; - width: 147px; - margin: 0 0 5px 0; - padding: 0; -} - -form.neoCMSImgStats label input, form.neoCMSVidStats label input { - float: right; - padding: 2px; - background: #fff; - font-size: 11px; - border: none; - width: 95px; - margin-right: 10px; - display: inline; -} - -form.neoCMSImgStats label input.neoCMSOrigSize, form.neoCMSImgStats label input.neoCMSConstrain, form.neoCMSVidStats label input.neoCMSOrigSize, form.neoCMSVidStats label input.neoCMSConstrain { - float: left; - display: block; - padding: 0; - margin: 2px 5px 0 0; - width: 10px; - height: 10px; -} - -form.neoCMSImgStats label input.neoCMSConstrain, form.neoCMSVidStats label input.neoCMSConstrain { - margin: 0 5px 15px 0; -} - -form.neoCMSImgStats label.neoCMSConstrainLabel, form.neoCMSVidStats label.neoCMSConstrainLabel { - padding-left: 36px; - line-height: 1.1em; - clear: left; - width: 111px; -} - -form.neoCMSImgStats label span, form.neoCMSVidStats label span { - float: right; - font-size: 11px; - width: 84px; - display: inline; -} - -div.neoCMSFileInfo label span { - margin-left: 10px; -} - -form.neoCMSLinkProperties, form.neoCMSDlGenerator { - margin: 10px 0 0 0; - padding: 15px 0 0; - - .padding: - - 5px; - border-top: 1px solid #444; - clear: both; -} - -form.neoCMSLinkProperties, form.neoCMSDlGenerator { - padding: 0; - border-top: none; -} - -ul.neoCMSImgProperties, .neoCMSLinkProperties ul { - margin: 0; - padding: 0; - list-style: none; - display: block; - clear: left; - font-size: 12px; -} - -ul.neoCMSImgProperties { - float: left; - display: none; - padding: 1px 0 0 0; - width: 314px; -} - -.neoCMSImgSelect li, .neoCMSLinkPrompt li { - margin: 0; - padding: 0; - display: block; - overflow: hidden; - clear: both; -} - -ul.neoCMSImgProperties li { - background: #444; - padding: 0 10px; - display: inline; - position: relative; - height: 22px; - float: left; - clear: both; - overflow: hidden; - width: 294px; -} - -.neoCMSImgProperties label, .neoCMSLinkPrompt label { - margin: 0 10px 0 0; - padding: 0; - width: 60px; - float: left; - line-height: 22px; - display: block; - clear: none; -} - -.neoCMSImgProperties input, .neoCMSLinkPrompt input, #neoCMSTableOptions input { - width: 217px; - padding: 2px; - height: 14px; - margin: 0 0 5px; - background: #fff; - font-size: 11px; - border: none; - float: left; - clear: none; -} - -.neoCMSImgProperties label, #neoCMSTableOptions label { - margin: 0; - padding: 0; - width: 60px; - float: left; - clear: none; - line-height: 22px; - display: block; -} - -.neoCMSImgSelect input { - width: 207px; -} - -#neoCMSImgLink { - margin-right: 1px; -} - -li.neoCMSLinkInsert, div.neoCMSDefInsert { - padding: 5px 0 0 70px; -} - -ul.neoCMSImgProperties li.neoCMSImgAltText { - padding-top: 10px; -} - -ul.neoCMSImgProperties li.neoCMSImgRel { - padding-bottom: 10px; -} - -ul.neoCMSImgProperties li.disabled input { - background: #bbb; - color: #666; -} - -ul.neoCMSImgProperties li.disabled label { - color: #666; -} - -div.neoCMSImgInsert, div.neoCMSVidInsert { - margin: 10px 0 0 0; - padding: 10px 0 0 0; - border-top: 1px solid #555; - background: none; - clear: both; - float: left; - display: block; - width: 100%; - *zoom: 1; -} - -div.neoCMSDefInsert { - margin: 5px 0 0 0; -} - -div.neoCMSHtmlInsert { - margin: 0 0 10px 0; -} - -.neoCMSPromptInsert a:link, .neoCMSPromptInsert a:visited, p.neoCMSLinkRemove a:link, p.neoCMSLinkRemove a:visited, a.neoCMSApplyBtn:link, a.neoCMSApplyBtn:visited { - line-height: 22px; - font-size: 11px; - margin: 0 0 0 20px; - color: #fff; - text-decoration: none; - background: none; -} - -p.neoCMSLinkRemove a:link, p.neoCMSLinkRemove a:visited, a.neoCMSApplyBtn:link, a.neoCMSApplyBtn:visited { - margin: 0; - padding: 0 0 10px; - display: block; -} - -#neoCMSLinkURL { - width: 217px; - margin-right: 1px; -} - -li.neoCMSLinkID { - padding-bottom: 5px; - border-bottom: 1px solid #444; - margin-bottom: 10px; -} - -#neoCMSPrompt .neoCMSFBrowse { - display: block; - clear: none; - float: left; - height: 18px; - width: 22px; - background: url(../neocms-images/neocms_sprite1.png) no-repeat -660px 0; - text-indent: -5000px; -} - -#neoCMSPrompt .neoCMSFBrowse:hover { - background-position: -660px -19px; -} - -p.neoCMSLinkRemove { - display: block; - padding: 0; - margin: 0 0 0 70px; -} - -.neoCMSPromptInsert a:hover, p.neoCMSLinkRemove a:hover, a.neoCMSApplyBtn:hover { - color: #fff; - text-decoration: underline; -} - -#neoCMSTablePrev { - margin-bottom: 20px; -} - -#neoCMSTablePrev table { - height: 200px; - width: 200px; - margin: 30px auto; - border: 1px solid #eee; - display: table; - table-layout: fixed; - border-collapse: collapse; -} - -#neoCMSTablePrev table tbody { - display: table-row-group; - height: auto; -} - -#neoCMSTablePrev table tr { - display: table-row; - height: auto; -} - -#neoCMSTablePrev table td, #neoCMSTablePrev table th { - border: 1px solid #eee; - display: table-cell; - height: auto; - width: auto; -} - -#neoCMSTablePrev table th, #neoCMSTablePrev table tfoot td { - border: 1px solid #eee; - background: #666; -} - -#neoCMSTableOptions ul { - padding: 10px 0; - border-top: 1px solid #555555; - overflow: hidden; -} - -#tableRowsCols input { - width: 85px; -} - -#neoCMSTableOptions ul#tableHeadFoot { - border-top: 0; - padding: 0 0 10px 60px; -} - -#tableHeadFoot input { - width: 10px; - height: 10px; - margin: 3px 10px 0 0; -} - -/* STYLES REQUIRED FOR EFFECTS --------------------------------------------- */ - -div.neoCMSUploadingImg { - height: 120px; - background: url(../neocms-images/uploading.gif) no-repeat center #505050 !important; -} - - -/* HIDDEN ELEMENTS --------------------------------------------- */ - -form#neoCMSPageEdits textarea { - padding: 10px; - background: none; - border: none; - border-bottom: 1px solid #666; - width: 800px; - height: 50px; - margin: 0 auto; -} - -#neoCMSImgUploadIframe { - border: 0; - background: none; - display: none; -} - -#neoCMSGlobalUndo, #neoCMSGlobalRedo { - display: none; -} - -/* DASHBOARD STYLES ---------------------------------------------------- */ - -li#neoCMSGoUpdate a:link, li#neoCMSGoUpdate a:visited { - margin: 0 244px 0 0; - padding: 0; - color: #fff; - text-decoration: none; - width: 106px; - height: 57px; - display: block; - overflow: hidden; - background: url(../neocms-images/neocms_sprite1.png) no-repeat -470px 0; - text-indent: -5000px; -} - -li#neoCMSGoUpdate a:hover { - background-position: -470px -60px; -} - -.neoCMSTopBuffer { - clear: both; - width: 100%; - height: 50px; - background: #e1e1e1; - display: block; - text-align: center; - display: block; -} - -.neoCMSTabNav { - margin: 0 auto; - width: 960px; - text-align: left; - display: block; -} - -.neoCMSTabNav ul { - margin: 0; - padding: 0 0 0 20px; - height: 60px; - display: block; - list-style: none; - text-align: left; - font-size: 10px; - color: #fff; -} - -.neoCMSTabNav li { - margin: 0; - padding: 0; - float: left; - padding: 0 10px 0 0; - display: inline; - padding-top: 20px; -} - -.neoCMSTabNav li a:link, .neoCMSTabNav li a:visited { - margin: 0; - padding: 3px 7px 0; - font-size: 13px; - color: #000; - background: #ccc; - text-decoration: none; - width: 120px; - font-weight: bold; - display: block; - line-height: 27px; - text-align: center; - -moz-border-radius-topleft: 7px; - -moz-border-radius-topright: 7px; - -webkit-border-top-left-radius: 7px; - -webkit-border-top-right-radius: 7px; -} - -.neoCMSTabNav li a:hover { - background: #333; - color: #fff; -} - -.neoCMSPref li#neoCMSTabPreferences a, .neoCMSAcct li#neoCMSTabMyAccount a, .neoCMSFTP li#neoCMSTabFTPInfo a { - background: #fff; - color: #000; -} - -.neoCMSDashboardWrap { - margin: 0 auto; - width: 960px; - text-align: left; -} - -#neoCMSDashScrollWrap { - overflow: auto; - position: relative; - display: block; -} - -.neoCMSDashTop { - clear: both; - margin: 0 auto; - width: 960px; - padding: 30px 0 20px; - border-bottom: 1px solid #ccc; -} - -.neoCMSDashTop p { - line-height: 1.4em; - width: 580px; - display: block; - font-size: 12px; -} - -#neoCMSUpdates { - float: right; - width: 360px; - display: inline; - background: #333; - padding: 10px 0; - -moz-border-radius: 10px; - -webkit-border-radius: 10px; -} - -#neoCMSUpdates h3 { - font-size: 14px; - color: #fff; - font-weight: bold; - padding: 0 10px 5px; -} - -#neoCMSUpdates h3 span { - color: #fff; - font-weight: normal; - font-size: 0.9em; - display: block; - margin-top: 7px; -} - -#neoCMSUpdates p { - padding: 9px 10px 0; - font-size: 12px; - color: #aaa; - width: auto; -} - -#neoCMSUpdates p a:link, #neoCMSUpdates p a:visited { - color: #82ac3f; - text-decoration: none; - margin: 0 10px; -} - -#neoCMSUpdates p a:first-child, #neoCMSUpdates p a.second { - margin: 0 10px 0 0; -} - -#neoCMSUpdates p a:hover { - color: #fff; - text-decoration: underline; -} - -#neoCMSUpdates p a.updateLink { - margin: 0 0 0 10px; -} - -#neoCMSUpdates p a.autoUpdate { - margin: 0; -} - -.neoCMSDashContent { - clear: both; - width: 960px; - padding: 40px 0 10px; - border-bottom: 5px solid #e1e1e1; -} - -.neoCMSDashContent h2 { - margin: 20px 0 0; -} - -#neoCMSFTPClearBtn { - background: none; - text-indent: 0; - display: inline; - width: auto; - margin: 0 0 0 20px; - font-size: 12px; - line-height: 22px; -} - -.neoCMSDashLeft { - float: left; - margin: 0 20px 0 0; - width: 580px; - padding-bottom: 30px; -} - -.neoCMSDashLeft a:link, .neoCMSDashLeft a:visited { - color: #82ac3f; - text-decoration: none; -} - -.neoCMSDashLeft a:hover { - color: #000; - text-decoration: underline; -} - -.neoCMSDashLeft h4 { - font-size: 16px; - font-weight: normal; - color: #000; - margin: 18px 0; -} - -.neoCMSDashLeft h4 span { - font-size: 12px; - font-weight: normal; - margin-left: 20px; - color: #999; - font-style: italic; -} - -.neoCMSDashElement, .neoCMSNewUserElement { - clear: both; - margin: 0 0 10px; - padding: 10px; - background: #e1e1e1; - position: relative; -} - -.neoCMSDashElement h3, .neoCMSNewUserElement h3 { - font-size: 15px; - height: 1.0em; - font-weight: bold; - color: #000; - margin: 0; - padding: 0 0 5px; - border-bottom: 1px solid #ccc; - display: block; -} - -.neoCMSDashElement h3 strong, .neoCMSNewUserElement h3 strong { - color: #999; - font-size: 0.8em; - margin-left: 10px; -} - -.neoCMSDashElement h3 span, .neoCMSNewUserElement h3 span { - font-size: 12px; - font-weight: bold; - float: right; - color: #aaa; -} - -.neoCMSDashElement p, .neoCMSNewUserElement p { - font-size: 11px; - color: #666; - line-height: 1.3em; - margin: 0; - padding: 10px 0 0; -} - -p.FTPtext { - margin: 0 0 30px; - padding: 10px 0 0; - border-bottom: 1px solid #ccc; - font-size: 12px; - line-height: 18px; - height: 80px; -} - -.neoCMSDashElement ul, .neoCMSNewUserElement ul { - display: block; -} - -.neoCMSDashElement li, .neoCMSNewUserElement li { - font-size: 11px; - color: #666; - line-height: 1.3em; - margin: 0; - padding: 10px 0 0; -} - -li.neoCMSPath { - font-size: 12px; - padding-bottom: 8px; - height: 1.3em; - font-weight: bold; -} - -#neoCMSNewUser { - display: none; -} - -span.neoCMSPathDeclar { - width: 200px; - display: inline-block; - background: #ccc; - padding: 7px 5px 4px; - margin: 0 10px 0 5px; - font-weight: normal; - - .position: relative -; - - .top: - - 4px; -} - -.neoCMSDashSidebar { - float: left; - width: 360px; - min-height: 288px; - margin-top: 30px; -} - -.neoCMSDashSidebar h3 { - font-size: 16px; - font-weight: bold; - color: #999; - padding: 0 0 5px; - border-bottom: 1px solid #ccc; -} - -.neoCMSDashSidebar p, .neoCMSDashSidebar li { - font-size: 11px; - line-height: 1.4em; - padding: 10px 0; - border-bottom: 1px solid #ccc; -} - -.neoCMSDashSidebar p.follow { - border-top: 1px solid #ccc; - text-align: right; -} - -.neoCMSDashSidebar p a:link, .neoCMSDashSidebar p a:visited, .neoCMSDashSidebar li a:link, .neoCMSDashSidebar li a:visited { - color: #82ac3f; - text-decoration: none; -} - -.neoCMSDashSidebar p a:hover, .neoCMSDashSidebar li a:hover { - color: #000; - text-decoration: underline; -} - -.neoCMSDashSidebar p span { - font-style: italic; - color: #999; -} - -/* DASHBOARD PREFERENCES FORM STYLES ---------------------------------------------------- */ - -form.neoCMSPrefForm { - font-size: 12px; -} - -label.neoCMSPrefHtmlOn { - position: absolute; - left: 180px; - top: 8px; -} - -label.neoCMSPrefHtmlOff { - position: absolute; - left: 255px; - top: 8px; -} - -label.neoCMSDashPath { - font-weight: bold; - font-size: 12px; -} - -input.filepath { - border: 1px solid #ccc; - background: #fff; - padding: 5px 5px 2px; - margin: 0 10px 0 5px; - width: 200px; - height: 16px; - display: inline; - position: relative; - - .top: - - 4px; -} - -li.shady, iframe#neoCMSFormFrame { - display: none; - position: absolute; - left: -5000px; -} - -/* DASHBOARD ACCOUNT STYLES ---------------------------------------------------- */ - -form.neoCMSAcctForm { - display: block; -} - -.neoCMSAcctForm label, .neoCMSDashElement ul label { - width: 102px; - display: inline-block; - padding: 0 10px 0 0; - text-align: right; - font-size: 11px; -} - -.neoCMSDashElement ul label a { - margin-left: 10px; -} - -input.neoCMSLocked { - padding: 2px; - font-size: 12px; - height: 18px; - width: 260px; - border: 1px solid #ccc; - background: #ccc !important; -} - -.neoCMSAcctPassLi input.neoCMSLocked { - color: #999; -} - -span a.neoCMSAcctModify { - margin: 0 10px 0 0; -} - -#neoCMSAcctFormSuperAdmin a.neoCMSAcctModify { - margin: 0; -} - -span a.neoCMSAcctDelete { - margin: 0 0 0 10px; -} - -input.neoCMSUnlocked { - padding: 2px; - font-size: 12px; - height: 18px; - width: 260px; - border: 1px solid #ccc; - background: #fff !important; -} - -li.neoCMSFormSave { - position: relative; - margin-top: 0; - padding: 0; -} - -li.neoCMSFilePath { - border-top: 1px solid #ccc; - margin-top: 10px; -} - -li.neoCMSFilePath p { - margin-bottom: 10px; - padding: 0; -} - -li.neoCMSFormSave span { - position: absolute; - top: 4px; - left: 178px; -} - -li.neoCMSFormSave span a:link, li.neoCMSFormSave span a:visited { - margin: 0 0 0 5px; - width: 80px; - background-image: none; - color: #000; - text-decoration: none; - text-indent: 0; - display: inline; -} - -li.neoCMSFormSave span a:hover { - background-image: none; - color: #999; - text-decoration: underline; -} - -li.neoCMSAcctPassInfo { - padding: 0 0 5px 102px; -} - -li#pwStrength, li#pwStrengthNew { - clear: both; - display: block; - width: 125px; - padding: 4px 0; - color: #999; - line-height: 20px; - font-size: 13px; - color: #ccc; - background: #efefef; - text-transform: uppercase; - font-weight: bold; - text-align: center; - position: relative; - margin: 10px 0 0 113px; -} - -li#pwStrength.weak, li#pwStrengthNew.weak { - color: #fc0 !important; - background: #ff9 !important; -} - -li#pwStrength.medium, li#pwStrengthNew.medium { - color: #e5eed4 !important; - background: #690 !important; -} - -li#pwStrength.strong, li#pwStrengthNew.strong { - color: #e5eed4 !important; - background: #690 !important; -} - -li#pwStrength span, li#pwStrengthNew span { - display: inline !important; - width: 280px; - text-align: left; - line-height: 13px; - color: #666; - font-size: 11px; - position: absolute; - top: 0; - left: 125px; - overflow: visible; - text-transform: none; - font-weight: normal; - font-style: normal; -} - -li#pwStrength.strong span, li#pwStrengthNew.strong span, li#pwStrength.medium span, li#pwStrengthNew.medium span { - top: 8px; -} - -span.neoCMSInstructions { - font-style: italic; - color: #999; -} - -form.neoCMSAcctEditing li span, form.neoCMSNewAcctEditing li span { - color: #999; - margin: 0 0 0 7px; - font-style: italic; - display: none; -} - -form.neoCMSAcctEditing li.error span, form.neoCMSNewAcctEditing li.error span { - display: inline; -} - -form.neoCMSAcctEditing span.neoCMSCancel, form.neoCMSNewAcctEditing span.neoCMSCancel { - display: inline; - margin: 0; - font-style: normal; -} - -/* DASHBOARD FOOTER STYLES ---------------------------------------------------- */ - -.neoCMSDashFooter { - clear: both; - width: 960px; - margin: 20px 0; - padding: 26px 0; - background: #e1e1e1; -} - -.neoCMSDashFooter p { - font-size: 12px; - line-height: 1.8em; - padding: 0 20px; -} - -.neoCMSDashFooter p a:link, .neoCMSDashFooter p a:visited { - color: #666; - text-decoration: none; - border-bottom: 1px dotted #82ac3f; -} - -.neoCMSDashFooter p a:hover { - color: #000; - text-decoration: underline; - border: none; -} - -.neoCMSDashFooter p span { - padding: 0 20px; -} - -#neoCMSFrameShim { - display: none; - position: absolute; - top: 0; - left: 0; - filter: alpha(opacity=0); - -moz-opacity: 0; - opacity: 0; - z-index: 10000; -} - -.CodeMirror-wrapping { - background: #fff; - padding: 10px; - border: #ccc; - width: 740px; -} - -/* -* jQuery UI CSS Framework -* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) -* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. -*/ - -/* Layout helpers -----------------------------------*/ -.ui-helper-hidden { - display: none; -} - -.ui-helper-hidden-accessible { - position: absolute; - left: -99999999px; -} - -.ui-helper-reset { - margin: 0; - padding: 0; - border: 0; - outline: 0; - line-height: 1.3; - text-decoration: none; - font-size: 100%; - list-style: none; -} - -.ui-helper-clearfix:after { - content: "."; - display: block; - height: 0; - clear: both; - visibility: hidden; -} - -.ui-helper-clearfix { - display: inline-block; -} - -/* required comment for clearfix to work in Opera \*/ -* html .ui-helper-clearfix { - height: 1%; -} - -.ui-helper-clearfix { - display: block; -} - -/* end clearfix */ -.ui-helper-zfix { - width: 100%; - height: 100%; - top: 0; - left: 0; - position: absolute; - opacity: 0; - filter: Alpha(Opacity=0); -} - - -/* Interaction Cues -----------------------------------*/ -.ui-state-disabled { - cursor: default !important; -} - - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { - display: block; - text-indent: -99999px; - overflow: hidden; - background-repeat: no-repeat; -} - - -/* Misc visuals -----------------------------------*/ - -/* Overlays */ -.ui-widget-overlay { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; -} - -/* -* jQuery UI CSS Framework -* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) -* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. -* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana,Arial,sans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px -*/ - - -/* Component containers -----------------------------------*/ -.ui-widget { - font-family: Verdana, Arial, sans-serif; - font-size: 1.1em; -} - -.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { - font-family: Verdana, Arial, sans-serif; - font-size: 1em; -} - -.ui-widget-content { - border: 1px solid #aaaaaa; - background: #ffffff 50% 50% repeat-x; - color: #222222; -} - -.ui-widget-content a { - color: #222222; -} - -.ui-widget-header { - border: 1px solid #aaaaaa; - background: #cccccc 50% 50% repeat-x; - color: #222222; - font-weight: bold; -} - -.ui-widget-header a { - color: #222222; -} - -/* Interaction states -----------------------------------*/ -.ui-state-default, .ui-widget-content .ui-state-default { - border: 1px solid #d3d3d3; - background: #e6e6e6 50% 50% repeat-x; - font-weight: normal; - color: #555555; - outline: none; -} - -.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { - color: #555555; - text-decoration: none; - outline: none; -} - -.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus { - border: 1px solid #999999; - background: #dadada 50% 50% repeat-x; - font-weight: normal; - color: #212121; - outline: none; -} - -.ui-state-hover a, .ui-state-hover a:hover { - color: #212121; - text-decoration: none; - outline: none; -} - -.ui-state-active, .ui-widget-content .ui-state-active { - border: 1px solid #aaaaaa; - background: #ffffff 50% 50% repeat-x; - font-weight: normal; - color: #212121; - outline: none; -} - -.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { - color: #212121; - outline: none; - text-decoration: none; -} - -/* Interaction Cues -----------------------------------*/ -.ui-state-highlight, .ui-widget-content .ui-state-highlight { - border: 1px solid #fcefa1; - background: #fbf9ee 50% 50% repeat-x; - color: #363636; -} - -.ui-state-highlight a, .ui-widget-content .ui-state-highlight a { - color: #363636; -} - -.ui-state-error, .ui-widget-content .ui-state-error { - border: 1px solid #cd0a0a; - background: #fef1ec 50% 50% repeat-x; - color: #cd0a0a; -} - -.ui-state-error a, .ui-widget-content .ui-state-error a { - color: #cd0a0a; -} - -.ui-state-error-text, .ui-widget-content .ui-state-error-text { - color: #cd0a0a; -} - -.ui-state-disabled, .ui-widget-content .ui-state-disabled { - opacity: .35; - filter: Alpha(Opacity=35); - background-image: none; -} - -.ui-priority-primary, .ui-widget-content .ui-priority-primary { - font-weight: bold; -} - -.ui-priority-secondary, .ui-widget-content .ui-priority-secondary { - opacity: .7; - filter: Alpha(Opacity=70); - font-weight: normal; -} - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { - width: 16px; - height: 16px; -} - - -/* Misc visuals -----------------------------------*/ - -/* Corner radius */ -.ui-corner-tl { - -moz-border-radius-topleft: 4px; - -webkit-border-top-left-radius: 4px; -} - -.ui-corner-tr { - -moz-border-radius-topright: 4px; - -webkit-border-top-right-radius: 4px; -} - -.ui-corner-bl { - -moz-border-radius-bottomleft: 4px; - -webkit-border-bottom-left-radius: 4px; -} - -.ui-corner-br { - -moz-border-radius-bottomright: 4px; - -webkit-border-bottom-right-radius: 4px; -} - -.ui-corner-top { - -moz-border-radius-topleft: 4px; - -webkit-border-top-left-radius: 4px; - -moz-border-radius-topright: 4px; - -webkit-border-top-right-radius: 4px; -} - -.ui-corner-bottom { - -moz-border-radius-bottomleft: 4px; - -webkit-border-bottom-left-radius: 4px; - -moz-border-radius-bottomright: 4px; - -webkit-border-bottom-right-radius: 4px; -} - -.ui-corner-right { - -moz-border-radius-topright: 4px; - -webkit-border-top-right-radius: 4px; - -moz-border-radius-bottomright: 4px; - -webkit-border-bottom-right-radius: 4px; -} - -.ui-corner-left { - -moz-border-radius-topleft: 4px; - -webkit-border-top-left-radius: 4px; - -moz-border-radius-bottomleft: 4px; - -webkit-border-bottom-left-radius: 4px; -} - -.ui-corner-all { - -moz-border-radius: 4px; - -webkit-border-radius: 4px; -} - -/* Overlays */ -.ui-widget-overlay { - background: #aaaaaa 50% 50% repeat-x; - opacity: .30; - filter: Alpha(Opacity=30); -} - -.ui-widget-shadow { - margin: -8px 0 0 -8px; - padding: 8px; - background: #aaaaa 50% 50% repeat-x; - opacity: .30; - filter: Alpha(Opacity=30); - -moz-border-radius: 8px; - -webkit-border-radius: 8px; -} - -/* Accordion -----------------------------------*/ -.ui-accordion .ui-accordion-header { - cursor: pointer; - position: relative; - margin-top: 1px; - zoom: 1; -} - -.ui-accordion .ui-accordion-li-fix { - display: inline; -} - -.ui-accordion .ui-accordion-header-active { - border-bottom: 0 !important; -} - -.ui-accordion .ui-accordion-header a { - display: block; - font-size: 1em; - padding: .5em .5em .5em 2.2em; -} - -.ui-accordion .ui-accordion-header .ui-icon { - position: absolute; - left: .5em; - top: 50%; - margin-top: -8px; -} - -.ui-accordion .ui-accordion-content { - padding: 1em 2.2em; - border-top: 0; - margin-top: -2px; - position: relative; - top: 1px; - margin-bottom: 2px; - overflow: auto; - display: none; -} - -.ui-accordion .ui-accordion-content-active { - display: block; -} - -/* Datepicker -----------------------------------*/ -.ui-datepicker { - width: 17em; - padding: .2em .2em 0; -} - -.ui-datepicker .ui-datepicker-header { - position: relative; - padding: .2em 0; -} - -.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { - position: absolute; - top: 2px; - width: 1.8em; - height: 1.8em; -} - -.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { - top: 1px; -} - -.ui-datepicker .ui-datepicker-prev { - left: 2px; -} - -.ui-datepicker .ui-datepicker-next { - right: 2px; -} - -.ui-datepicker .ui-datepicker-prev-hover { - left: 1px; -} - -.ui-datepicker .ui-datepicker-next-hover { - right: 1px; -} - -.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { - display: block; - position: absolute; - left: 50%; - margin-left: -8px; - top: 50%; - margin-top: -8px; -} - -.ui-datepicker .ui-datepicker-title { - margin: 0 2.3em; - line-height: 1.8em; - text-align: center; -} - -.ui-datepicker .ui-datepicker-title select { - float: left; - font-size: 1em; - margin: 1px 0; -} - -.ui-datepicker select.ui-datepicker-month-year { - width: 100%; -} - -.ui-datepicker select.ui-datepicker-month, -.ui-datepicker select.ui-datepicker-year { - width: 49%; -} - -.ui-datepicker .ui-datepicker-title select.ui-datepicker-year { - float: right; -} - -.ui-datepicker table { - width: 100%; - font-size: .9em; - border-collapse: collapse; - margin: 0 0 .4em; -} - -.ui-datepicker th { - padding: .7em .3em; - text-align: center; - font-weight: bold; - border: 0; -} - -.ui-datepicker td { - border: 0; - padding: 1px; -} - -.ui-datepicker td span, .ui-datepicker td a { - display: block; - padding: .2em; - text-align: right; - text-decoration: none; -} - -.ui-datepicker .ui-datepicker-buttonpane { - margin: .7em 0 0 0; - padding: 0 .2em; - border-left: 0; - border-right: 0; - border-bottom: 0; -} - -.ui-datepicker .ui-datepicker-buttonpane button { - float: right; - margin: .5em .2em .4em; - cursor: pointer; - padding: .2em .6em .3em .6em; - width: auto; - overflow: visible; -} - -.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { - float: left; -} - -/* with multiple calendars */ -.ui-datepicker.ui-datepicker-multi { - width: auto; -} - -.ui-datepicker-multi .ui-datepicker-group { - float: left; -} - -.ui-datepicker-multi .ui-datepicker-group table { - width: 95%; - margin: 0 auto .4em; -} - -.ui-datepicker-multi-2 .ui-datepicker-group { - width: 50%; -} - -.ui-datepicker-multi-3 .ui-datepicker-group { - width: 33.3%; -} - -.ui-datepicker-multi-4 .ui-datepicker-group { - width: 25%; -} - -.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { - border-left-width: 0; -} - -.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { - border-left-width: 0; -} - -.ui-datepicker-multi .ui-datepicker-buttonpane { - clear: left; -} - -.ui-datepicker-row-break { - clear: both; - width: 100%; -} - -/* RTL support */ -.ui-datepicker-rtl { - direction: rtl; -} - -.ui-datepicker-rtl .ui-datepicker-prev { - right: 2px; - left: auto; -} - -.ui-datepicker-rtl .ui-datepicker-next { - left: 2px; - right: auto; -} - -.ui-datepicker-rtl .ui-datepicker-prev:hover { - right: 1px; - left: auto; -} - -.ui-datepicker-rtl .ui-datepicker-next:hover { - left: 1px; - right: auto; -} - -.ui-datepicker-rtl .ui-datepicker-buttonpane { - clear: right; -} - -.ui-datepicker-rtl .ui-datepicker-buttonpane button { - float: left; -} - -.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { - float: right; -} - -.ui-datepicker-rtl .ui-datepicker-group { - float: right; -} - -.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { - border-right-width: 0; - border-left-width: 1px; -} - -.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { - border-right-width: 0; - border-left-width: 1px; -} - -/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ -.ui-datepicker-cover { - display: none; /*sorry for IE5*/ - display /**/: block; /*sorry for IE5*/ - position: absolute; /*must have*/ - z-index: -1; /*must have*/ - filter: mask(); /*must have*/ - top: -4px; /*must have*/ - left: -4px; /*must have*/ - width: 200px; /*must have*/ - height: 200px; /*must have*/ -} - -/* Dialog -----------------------------------*/ -.ui-dialog { - position: relative; - padding: .2em; - width: 300px; -} - -.ui-dialog .ui-dialog-titlebar { - padding: .5em .3em .3em 1em; - position: relative; -} - -.ui-dialog .ui-dialog-title { - float: left; - margin: .1em 0 .2em; -} - -.ui-dialog .ui-dialog-titlebar-close { - position: absolute; - right: .3em; - top: 50%; - width: 19px; - margin: -10px 0 0 0; - padding: 1px; - height: 18px; -} - -.ui-dialog .ui-dialog-titlebar-close span { - display: block; - margin: 1px; -} - -.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { - padding: 0; -} - -.ui-dialog .ui-dialog-content { - border: 0; - padding: .5em 1em; - background: none; - overflow: auto; - zoom: 1; -} - -.ui-dialog .ui-dialog-buttonpane { - text-align: left; - border-width: 1px 0 0 0; - background-image: none; - margin: .5em 0 0 0; - padding: .3em 1em .5em .4em; -} - -.ui-dialog .ui-dialog-buttonpane button { - float: right; - margin: .5em .4em .5em 0; - cursor: pointer; - padding: .2em .6em .3em .6em; - line-height: 1.4em; - width: auto; - overflow: visible; -} - -.ui-dialog .ui-resizable-se { - width: 14px; - height: 14px; - right: 3px; - bottom: 3px; -} - -.ui-draggable .ui-dialog-titlebar { - cursor: move; -} - -/* Progressbar -----------------------------------*/ -.ui-progressbar { - height: 2em; - text-align: left; -} - -.ui-progressbar .ui-progressbar-value { - margin: -1px; - height: 100%; -} - -/* Resizable -----------------------------------*/ -.ui-resizable { - position: relative; -} - -.ui-resizable-handle { - position: absolute; - font-size: 0.1px; - z-index: 99999; - display: block; -} - -.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { - display: none; -} - -.ui-resizable-n { - cursor: n-resize; - height: 15px; - width: 100%; - top: -13px; - left: 0px; -} - -.ui-resizable-s { - cursor: s-resize; - height: 15px; - width: 100%; - bottom: -13px; - left: 0px; -} - -.ui-resizable-e { - cursor: e-resize; - width: 15px; - right: -13px; - top: 0px; - height: 100%; -} - -.ui-resizable-w { - cursor: w-resize; - width: 15px; - left: -13px; - top: 0px; - height: 100%; -} - -.ui-resizable-se { - cursor: se-resize; - width: 25px; - height: 25px; - right: -10px; - bottom: -10px; -} - -.ui-resizable-sw { - cursor: sw-resize; - width: 25px; - height: 25px; - left: -15px; - bottom: -15px; -} - -.ui-resizable-nw { - cursor: nw-resize; - width: 15px; - height: 15px; - left: -5px; - top: -5px; -} - -.ui-resizable-ne { - cursor: ne-resize; - width: 15px; - height: 15px; - right: -5px; - top: -5px; -} - -/* Slider -----------------------------------*/ -.ui-slider { - position: relative; - text-align: left; -} - -.ui-slider .ui-slider-handle { - position: absolute; - z-index: 2; - width: 1.2em; - height: 1.2em; - cursor: default; -} - -.ui-slider .ui-slider-range { - position: absolute; - z-index: 1; - font-size: .7em; - display: block; - border: 0; -} - -.ui-slider-horizontal { - height: .8em; -} - -.ui-slider-horizontal .ui-slider-handle { - top: -.3em; - margin-left: -.6em; -} - -.ui-slider-horizontal .ui-slider-range { - top: 0; - height: 100%; -} - -.ui-slider-horizontal .ui-slider-range-min { - left: 0; -} - -.ui-slider-horizontal .ui-slider-range-max { - right: 0; -} - -.ui-slider-vertical { - width: .8em; - height: 100px; -} - -.ui-slider-vertical .ui-slider-handle { - left: -.3em; - margin-left: 0; - margin-bottom: -.6em; -} - -.ui-slider-vertical .ui-slider-range { - left: 0; - width: 100%; -} - -.ui-slider-vertical .ui-slider-range-min { - bottom: 0; -} - -.ui-slider-vertical .ui-slider-range-max { - top: 0; -} - -/* Tabs -----------------------------------*/ -.ui-tabs { - padding: .2em; - zoom: 1; -} - -.ui-tabs .ui-tabs-nav { - list-style: none; - position: relative; - padding: .2em .2em 0; -} - -.ui-tabs .ui-tabs-nav li { - position: relative; - float: left; - border-bottom-width: 0 !important; - margin: 0 .2em -1px 0; - padding: 0; -} - -.ui-tabs .ui-tabs-nav li a { - float: left; - text-decoration: none; - padding: .5em 1em; -} - -.ui-tabs .ui-tabs-nav li.ui-tabs-selected { - padding-bottom: 1px; - border-bottom-width: 0; -} - -.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { - cursor: text; -} - -.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { - cursor: pointer; -} - -/* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ -.ui-tabs .ui-tabs-panel { - padding: 1em 1.4em; - display: block; - border-width: 0; - background: none; -} - -.ui-tabs .ui-tabs-hide { - display: none !important; -} - diff --git a/cms/functions/restore.php b/cms/functions/restore.php index f8709fb..ac5638f 100644 --- a/cms/functions/restore.php +++ b/cms/functions/restore.php @@ -154,7 +154,7 @@ if (isset($_SESSION['neoCMSSess']) && strstr($_SESSION['neoCMSSess'], 'neoCMSses $restdoc = fopen($url, "w"); fputs($restdoc, $backcontent); fclose($restdoc); - } else $message = "Error: You do not have permission to edit this page. Try saving your FTP info here."; + } else $message = "Error: You do not have permission to edit this page."; } diff --git a/cms/functions/save.php b/cms/functions/save.php index e3cab6f..17d4393 100644 --- a/cms/functions/save.php +++ b/cms/functions/save.php @@ -500,7 +500,7 @@ if (isset($_SESSION['neoCMSSess']) && strstr($_SESSION['neoCMSSess'], 'neoCMSses fwrite($doc, $fpost); fclose($doc); - } else $message = "Error: You do not have permission to edit this page. Try saving your FTP info here."; + } else $message = "Error: You do not have permission to edit this page."; } else $message = 'Error: neocms is unable find this page.'; diff --git a/cms/js/dash.js b/cms/js/dash.js index 75bb430..ce9899b 100644 --- a/cms/js/dash.js +++ b/cms/js/dash.js @@ -167,219 +167,13 @@ hideUserBar = function () { }) }; var v = 0; -neocmsUsers = function () { - var usersIframe; - try { - usersIframe = document.createElement('') - } catch (ex) { - usersIframe = document.createElement('iframe') - } - $(usersIframe).attr({ - id: 'neoCMSUsersFrame', - name: 'neoCMSUsersFrame', - src: '../core/getsaveusers.php', - application: 'yes' - }).css('display', 'none'); - $('body').append(usersIframe) -}; -adminUser = function (name, user, email) { - $('#neoCMSAcctFormSuperAdmin').find('h3').html(name + ' Admin').prepend($('').append($('').addClass('neoCMSAcctModify').attr({ - href: 'javascript:', - title: 'edit your login information' - }).html('modify'))).end().find('.neoCMSAcctUserLi input').val(user).end().find('.neoCMSAcctEmailLi input').val(email); - $('#neoCMSAcctFormSuperAdmin a.neoCMSAcctModify').unbind('click').bind('click', userModify) -}; -buildUser = function (name, user, email, uid) { - if (name && user && email) { - if (!$('#user' + uid).length) { - var userArea = 'Username Password Email '; - userArea = $(userArea); - $(userArea).find('h3').html(name).prepend($('').append($('').addClass('neoCMSAcctModify').attr({ - href: 'javascript:', - title: 'edit this user' - }).html('modify')).append('|').append($('').addClass('neoCMSAcctDelete').attr({ - href: 'javascript:', - title: 'delete this user' - }).html('delete'))).end().find('.neoCMSAcctUserLi input').val(user).end().find('.neoCMSAcctEmailLi input').val(email); - $(userArea).find('a.neoCMSAcctModify').bind('click', userModify).end().find('a.neoCMSAcctDelete').bind('click', function () { - userDeletePrompt(this) - }).end().insertAfter('.neoCMSDashElement:last') - } else { - $('#user' + uid).find('h3').html(name).prepend($('').append($('').addClass('neoCMSAcctModify').attr({ - href: 'javascript:', - title: 'edit this user' - }).html('modify')).append('|').append($('').addClass('neoCMSAcctDelete').attr({ - href: 'javascript:', - title: 'delete this user' - }).html('delete'))).end().find('.neoCMSAcctUserLi input').val(user).end().find('.neoCMSAcctEmailLi input').val(email).end().find('a.neoCMSAcctModify').unbind('click').bind('click', userModify).end().find('a.neoCMSAcctDelete').unbind('click').bind('click', function () { - userDeletePrompt(this) - }) - } - } -}; + removeFrames = function () { $('#neoCMSUsersFrame, #neoCMSSaveUserFrame, #neoCMSDelUserFrame, #neoCMSSaveFTPFrame, #neoCMSClearFTPFrame').remove(); $('#neoCMSTopBanner').css('background', 'none'); cancel() }; -newUser = function () { - userModifyCancel(); - $('#neoCMSNewUser').css('display', 'block').find('input:first').focus().end().find('#neoCMSAcctFormNewUser').addClass('neoCMSNewAcctEditing').end().find('#neoCMSNewUserSave').bind('click', userModifySave); - $('#neoCMSNewUserLink').unbind('click').bind('click', newUserCancel); - $('#neoCMSNewAcctPass').unbind('keyup').bind('keyup', function () { - runPassword(this) - }); - setTimeout(function () { - $('#neoCMSNewName').focus() - }, 0) -}; -newUserCancel = function () { - $('#neoCMSNewUser').css('display', 'none').find('input').val(''); - $('#pwStrengthNew').removeClass().html('n/a “Medium” or “strong” required.'); - $('#neoCMSNewUserLink').unbind('click', newUserCancel).bind('click', newUser) -}; -userModify = function () { - newUserCancel(); - if (!$('.neoCMSAcctPassConLi').length) { - $(this.parentNode.parentNode.parentNode).addClass('neoCMSAcctEditing').find('input').removeAttr('readonly').removeClass('neoCMSLocked').addClass('neoCMSUnlocked').end().find('.neoCMSAcctUserLi').append($('').addClass('error').html('Please create a username')).end().find('.neoCMSAcctPassLi').append($('').addClass('error').html('“Medium” or “strong” required.')).after($('').addClass('neoCMSAcctPassConLi').append($('').html('Confirm Password')).append($('').addClass('neoCMSUnlocked neoCMSAcctPassCon').attr({ - name: 'neoCMSAcctPassConfirm', - type: 'password' - })).append($('').addClass('error').html('Must match password'))).after($('').addClass('neoCMSAcctPassInfo').attr('id', 'pwStrength').html('n/a “Medium” or “strong” required. Leave blank if you don’t want a new password.')).end().find('.neoCMSAcctPassLi label').html('New Password ').end().find('.neoCMSAcctPassLi input').replaceWith($('').attr('id', 'neoCMSAcctPass').addClass('neoCMSUnlocked neoCMSAcctPass').attr({ - type: 'password', - name: 'neoCMSAcctPass' - }).val('')).end().find('.neoCMSAcctEmailLi').append($('').addClass('error').html('Please enter a valid email')).end().find('.neoCMSAcctMeta').append($('').addClass('neoCMSFormSave').append($('').addClass('userSave').attr({ - href: 'javascript:', - title: 'save' - }).html('save').bind('click', userModifySave)).append($('').addClass('neoCMSCancel').html('or ').append($('').attr('href', 'javascript:').html('cancel').bind('click', userModifyCancel)))) - } - $('#neoCMSAcctPass').unbind('keyup').bind('keyup', function () { - runPassword(this) - }); - $('a.neoCMSAcctModify').unbind('click', userModify).bind('click', userModifyCancel); - $('#neoCMSAcctFormSuperAdmin .neoCMSAcctUser input:first').focus() -}; -userModifySave = function () { - if (userModifyValid()) { - $('#neoCMSTopBanner').css('background', 'url(../images/loading.gif) repeat-x bottom'); - var saveUserIframe; - try { - saveUserIframe = document.createElement('') - } catch (ex) { - saveUserIframe = document.createElement('iframe') - } - $(saveUserIframe).attr({ - id: 'neoCMSSaveUserFrame', - name: 'neoCMSSaveUserFrame', - application: 'yes' - }).css('display', 'none'); - $('body').append(saveUserIframe); - $(this).parents('.neoCMSAcctForm')[0].submit(); - userModifyCancel() - } -}; -userModifyValid = function (f) { - $('.neoCMSAcctEditing li.error').removeClass('error'); - if (f) validCheck(f); else { - v = 0; - var fields = $('.neoCMSAcctEditing input, .neoCMSNewAcctEditing input').not('.neoCMSAcctUser-orig, .neoCMSAcctEmail-orig'); - $(fields).each(function () { - validCheck(this) - }); - $('.neoCMSAcctEditing input, .neoCMSNewAcctEditing input').not('.neoCMSAcctUser-orig, .neoCMSAcctEmail-orig').unbind('change').bind('change', function () { - validCheck(this) - }); - if (v == $(fields).length) return true - } -}; -validCheck = function (f) { - var emailreg = /^[a-zA-Z0-9,!#\$%&'\*\+\/=\?\^_`\{\|}~-]+(\.[a-z0-9,!#\$%&'\*\+\/=\?\^_`\{\|}~-]+)*@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/, - passreg = /^\w*(?=\w*\d)(?=\w*[a-z])(?=\w*[A-Z])\w{5,}$/, c = false; - var tval = $(f).val(), fclass = $(f).attr('class'), fpar = $(f).parent(); - if (fclass.match(/neoCMSAcctEmail/g)) { - if (emailreg.test(tval) == true) { - c = true; - fpar.removeClass('error') - } else fpar.addClass('error') - } else if (fclass.match(/neoCMSAcctPass\b/)) { - if ($(f).parents('.neoCMSAcctEditing').length) { - if ($('#pwStrength').attr('class').match(/strong|medium/) || tval == '') { - c = true; - fpar.removeClass('error') - } else fpar.addClass('error') - } else { - if ($('#pwStrengthNew').attr('class').match(/strong|medium/)) { - c = true; - fpar.removeClass('error') - } else fpar.addClass('error') - } - } else if (fclass.match(/neoCMSAcctPassCon/)) { - if ($(f).parents('.neoCMSAcctEditing').length) { - if (tval == $('.neoCMSAcctPass', '.neoCMSAcctEditing').val()) { - c = true; - fpar.removeClass('error') - } else fpar.addClass('error') - } else { - if (tval == $('.neoCMSAcctPass', '.neoCMSNewAcctEditing').val()) { - c = true; - fpar.removeClass('error') - } else fpar.addClass('error') - } - } - if (fclass.match(/neoCMSFTPServer/g)) { - if (!tval.match(/^ftp\./)) { - c = true; - fpar.removeClass('error') - } else fpar.addClass('error') - } else { - if (tval != '') { - c = true; - fpar.removeClass('error') - } else fpar.addClass('error') - } - if (c) v++ -}; -userModifyCancel = function () { - $('.neoCMSAcctEditing li.error').removeClass('error'); - $('.neoCMSAcctEditing').removeClass('neoCMSAcctEditing').find('.neoCMSAcctPassInfo').remove().end().find('.neoCMSAcctPassLi label').html('Password ').end().find('.neoCMSAcctPassLi input').replaceWith($('').addClass('neoCMSLocked').attr({ - type: 'text', - name: 'neoCMSAcctPass' - }).val('TOTALLY SECURE, REALLY')).end().find('#pwStrength').remove().end().find('input').removeClass('neoCMSUnlocked').addClass('neoCMSLocked').attr('readonly', 'true').end().find('.neoCMSAcctPassConLi').remove().end().find('.neoCMSFormSave').remove().end().find('li span').remove(); - $('#neoCMSAcctPass').unbind('keyup'); - $('a.neoCMSAcctModify').unbind('click', userModifyCancel).bind('click', userModify) -}; -userDeletePrompt = function (user) { - overlay(); - if (!$('#neoCMSPrompt').length) { - $('body').append($('').attr('id', 'neoCMSPromptWrap').load('../templates/prompt.html', function () { - $('#neoCMSPrompt h4.neoCMSPromptTitle').html('Delete User'); - $('#neoCMSPrompt p').html('Are you sure you want to delete this user? You cannot undo this action.'); - $('#neoCMSPromptBtn').addClass('neoCMSDeleteBtn').attr('title', 'delete this user').html('delete').bind('click', function () { - var uid = $(user).parents('.neoCMSDashElement').attr('id').replace('user', ''); - userDelete(uid) - }); - $('#neoCMSCancelBtn').bind('click', cancel); - showPrompt() - })) - } -}; -userDelete = function (user) { - $('.neoCMSDashElement').not('#neoCMSSuperAdmin').each(function () { - $('#user' + user).remove() - }); - var delUserIframe; - try { - delUserIframe = document.createElement('') - } catch (ex) { - delUserIframe = document.createElement('iframe') - } - $(delUserIframe).attr({ - id: 'neoCMSDelUserFrame', - name: 'neoCMSDelUserFrame', - src: '../core/getsaveusers.php?neoCMSDelUser=' + user, - application: 'yes' - }).css('display', 'none'); - $('body').append(delUserIframe) -}; + getNoLines = function (ele) { var hardlines = ele.value.split('\n'); var total = hardlines.length; @@ -395,150 +189,7 @@ String.prototype.strReverse = function () { } return newstring }; -checkPassword = function (pwd) { - var nScore = 0, nLength = 0, nAlphaUC = 0, nAlphaLC = 0, nNumber = 0, nSymbol = 0, nMidChar = 0, nAlphasOnly = 0, - nNumbersOnly = 0, nRepChar = 0, nConsecAlphaUC = 0, nConsecAlphaLC = 0, nConsecNumber = 0, nConsecSymbol = 0, - nConsecCharType = 0, nSeqAlpha = 0, nSeqNumber = 0, nSeqChar = 0, nMultLength = 4, nMultNumber = 4, - nMultSymbol = 6, nMultMidChar = 2, nMultConsecAlphaUC = 2, nMultConsecAlphaLC = 2, nMultConsecNumber = 2, - nMultSeqAlpha = 3, nMultSeqNumber = 3, nTmpAlphaUC = "", nTmpAlphaLC = "", nTmpNumber = "", nTmpSymbol = "", - sAlphas = "abcdefghijklmnopqrstuvwxyz", sNumerics = "01234567890"; - nScore = parseInt(pwd.length * nMultLength); - nLength = pwd.length; - var arrPwd = pwd.replace(/\s+/g, "").split(/\s*/), arrPwdLen = arrPwd.length; - for (var a = 0; a < arrPwdLen; a++) { - if (arrPwd[a].match(new RegExp(/[A-Z]/g))) { - if (nTmpAlphaUC !== "") { - if ((nTmpAlphaUC + 1) == a) { - nConsecAlphaUC++; - nConsecCharType++ - } - } - nTmpAlphaUC = a; - nAlphaUC++ - } else if (arrPwd[a].match(new RegExp(/[a-z]/g))) { - if (nTmpAlphaLC !== "") { - if ((nTmpAlphaLC + 1) == a) { - nConsecAlphaLC++; - nConsecCharType++ - } - } - nTmpAlphaLC = a; - nAlphaLC++ - } else if (arrPwd[a].match(new RegExp(/[0-9]/g))) { - if (a > 0 && a < (arrPwdLen - 1)) { - nMidChar++ - } - if (nTmpNumber !== "") { - if ((nTmpNumber + 1) == a) { - nConsecNumber++; - nConsecCharType++ - } - } - nTmpNumber = a; - nNumber++ - } else if (arrPwd[a].match(new RegExp(/[^a-zA-Z0-9_]/g))) { - if (a > 0 && a < (arrPwdLen - 1)) { - nMidChar++ - } - if (nTmpSymbol !== "") { - if ((nTmpSymbol + 1) == a) { - nConsecSymbol++; - nConsecCharType++ - } - } - nTmpSymbol = a; - nSymbol++ - } - for (var b = 0; b < arrPwdLen; b++) { - if (arrPwd[a].toLowerCase() == arrPwd[b].toLowerCase() && a != b) { - nRepChar++ - } - } - } - for (var s = 0; s < 23; s++) { - var sFwd = sAlphas.substring(s, parseInt(s + 3)); - var sRev = sFwd.strReverse(); - if (pwd.toLowerCase().indexOf(sFwd) != -1 || pwd.toLowerCase().indexOf(sRev) != -1) { - nSeqAlpha++; - nSeqChar++ - } - } - for (var s = 0; s < 8; s++) { - var sFwd = sNumerics.substring(s, parseInt(s + 3)); - var sRev = sFwd.strReverse(); - if (pwd.toLowerCase().indexOf(sFwd) != -1 || pwd.toLowerCase().indexOf(sRev) != -1) { - nSeqNumber++; - nSeqChar++ - } - } - if (nAlphaUC > 0 && nAlphaUC < nLength) { - nScore = parseInt(nScore + ((nLength - nAlphaUC) * 2)); - sAlphaUC = "+ " + parseInt((nLength - nAlphaUC) * 2) - } - if (nAlphaLC > 0 && nAlphaLC < nLength) { - nScore = parseInt(nScore + ((nLength - nAlphaLC) * 2)); - sAlphaLC = "+ " + parseInt((nLength - nAlphaLC) * 2) - } - if (nNumber > 0 && nNumber < nLength) { - nScore = parseInt(nScore + (nNumber * nMultNumber)); - sNumber = "+ " + parseInt(nNumber * nMultNumber) - } - if (nSymbol > 0) { - nScore = parseInt(nScore + (nSymbol * nMultSymbol)); - sSymbol = "+ " + parseInt(nSymbol * nMultSymbol) - } - if (nMidChar > 0) { - nScore = parseInt(nScore + (nMidChar * nMultMidChar)); - sMidChar = "+ " + parseInt(nMidChar * nMultMidChar) - } - if ((nAlphaLC > 0 || nAlphaUC > 0) && nSymbol === 0 && nNumber === 0) { - nScore = parseInt(nScore - nLength); - nAlphasOnly = nLength; - sAlphasOnly = "- " + nLength - } - if (nAlphaLC === 0 && nAlphaUC === 0 && nSymbol === 0 && nNumber > 0) { - nScore = parseInt(nScore - nLength); - nNumbersOnly = nLength; - sNumbersOnly = "- " + nLength - } - if (nRepChar > 0) { - nScore = parseInt(nScore - (nRepChar * nRepChar)); - sRepChar = "- " + nRepChar - } - if (nConsecAlphaUC > 0) { - nScore = parseInt(nScore - (nConsecAlphaUC * nMultConsecAlphaUC)); - sConsecAlphaUC = "- " + parseInt(nConsecAlphaUC * nMultConsecAlphaUC) - } - if (nConsecAlphaLC > 0) { - nScore = parseInt(nScore - (nConsecAlphaLC * nMultConsecAlphaLC)); - sConsecAlphaLC = "- " + parseInt(nConsecAlphaLC * nMultConsecAlphaLC) - } - if (nConsecNumber > 0) { - nScore = parseInt(nScore - (nConsecNumber * nMultConsecNumber)); - sConsecNumber = "- " + parseInt(nConsecNumber * nMultConsecNumber) - } - if (nSeqAlpha > 0) { - nScore = parseInt(nScore - (nSeqAlpha * nMultSeqAlpha)); - sSeqAlpha = "- " + parseInt(nSeqAlpha * nMultSeqAlpha) - } - if (nSeqNumber > 0) { - nScore = parseInt(nScore - (nSeqNumber * nMultSeqNumber)); - sSeqNumber = "- " + parseInt(nSeqNumber * nMultSeqNumber) - } - return nScore -}; -runPassword = function (t) { - var nScore = checkPassword(t.value), strength, strText, helper; - if (nScore < 0) nScore = 0; else if (nScore > 100) nScore = 100; - if (nScore >= 60) strength = "strong", strText = strength + " (" + nScore + "%)", helper = "Great password! Now just confirm in the next field."; else if (nScore >= 30 && nScore <= 59) strength = "medium", strText = strength + " (" + nScore + "%)", helper = "That will do! Now just confirm in the next field."; else strText = strength = "weak", strText = strength + " (" + nScore + "%)", helper = "“Medium” or “strong” required. Varied lettercase, numbers, & special characters help."; - if ($(t).val() == '') { - $('#pwStrength').removeClass().html('n/a “Medium” or “strong” required. Leave blank if you don’t want a new password.'); - if ($(t).parents('#neoCMSAcctFormNewUser').length) $('#pwStrengthNew').removeClass().html('n/a “Medium” or “strong” required.') - } else { - var pid = ($(t).parents('#neoCMSAcctFormNewUser').length) ? '#pwStrengthNew' : '#pwStrength'; - $(pid).removeClass().addClass(strength).html(strText + ' ' + helper + '') - } -}; + countContain = function (strPassword, strCheck) { var nCount = 0; for (i = 0; i < strPassword.length; i++) { @@ -546,155 +197,7 @@ countContain = function (strPassword, strCheck) { } return nCount }; -formatTweet = function (txt) { - var urls = txt.match(/http[^\s]+/gi); - if (urls) for (var i = 0; i < urls.length; i++) txt = txt.replace(urls[i], '' + urls[i] + ''); - var users = txt.match(/^@[^\s]+|\s@[^\s]+\b/gi); - if (users) { - for (var i = 0; i < users.length; i++) { - users[i] = users[i].replace(' ', ''); - users[i] = users[i].replace(':', ''); - var user = users[i].replace(/@/, ''); - txt = txt.replace(users[i], '@' + user + '') - } - } - var hashes = txt.match(/#[^\s]+/gi); - if (hashes) { - for (var i = 0; i < hashes.length; i++) { - hashes[i] = hashes[i].replace(' ', ''); - hashes[i] = hashes[i].replace(':', ''); - var hash = hashes[i].replace(/#/, ''); - txt = txt.replace(hashes[i], '#' + hash + '') - } - } - return txt -}; -twitterFeed = function () { - $.ajax({ - type: "GET", - crossDomain: true, - url: "http://twitter.com/statuses/user_timeline/neogateTechnologies.json?count=100", - dataType: "jsonp", - success: function (data) { - var ts = '', c = 0; - $(data).each(function (i) { - var txt = this.text; - if (txt.match(/#neocms/gi)) { - c++; - ts += '' + formatTweet(txt) + ''; - if (c == 5 || i == data.length - 1) { - $('#twitter_update_list').html(ts); - return false - } - } - }) - } - }) -}; -saveFTP = function () { - if (FTPvalid()) { - $('#neoCMSTopBanner').css('background', 'url(../images/loading.gif) repeat-x bottom'); - var saveFTPIframe; - try { - saveFTPIframe = document.createElement('') - } catch (ex) { - saveFTPIframe = document.createElement('iframe') - } - $(saveFTPIframe).attr({ - id: 'neoCMSSaveFTPFrame', - name: 'neoCMSSaveFTPFrame', - application: 'yes' - }).css('display', 'none'); - $('body').append(saveFTPIframe); - $('#neoCMSFTPForm')[0].submit() - } -}; -clearFTPPrompt = function (user) { - overlay(); - if (!$('#neoCMSPrompt').length) { - $('body').append($('').attr('id', 'neoCMSPromptWrap').load('../templates/prompt.html', function () { - $('#neoCMSPrompt h4.neoCMSPromptTitle').html('Clear FTP Info'); - $('#neoCMSPrompt p').html('Are you sure you want to clear your FTP info? You cannot undo this.'); - $('#neoCMSPromptBtn').addClass('neoCMSPromptBtn').attr('title', 'clear').html('clear').bind('click', function () { - clearFTP() - }); - $('#neoCMSCancelBtn').bind('click', cancel); - showPrompt() - })) - } -}; -clearFTP = function () { - $('#neoCMSTopBanner').css('background', 'url(../images/loading.gif) repeat-x bottom'); - var clearFTPIframe; - try { - clearFTPIframe = document.createElement('') - } catch (ex) { - clearFTPIframe = document.createElement('iframe') - } - $(clearFTPIframe).attr({ - id: 'neoCMSClearFTPFrame', - name: 'neoCMSClearFTPFrame', - application: 'yes', - src: '../core/ftpclear.php' - }).css('display', 'none'); - $('body').append(clearFTPIframe) -}; -clearFTPInfo = function () { - $('#neoCMSFTPForm input').val('') -}; -FTPvalid = function (f) { - $('#neoCMSFTPForm li.error').removeClass('error'); - if (f) validCheck(f); else { - v = 0; - var fields = $('#neoCMSFTPForm input'); - $(fields).each(function () { - validCheck(this) - }); - $('#neoCMSFTPForm input').unbind('change').bind('change', function () { - validCheck(this) - }); - if (v == $(fields).length) return true - } -}; -autoUpdatePrompt = function () { - overlay(); - if (!$('#neoCMSPrompt').length) { - $('body').append($('').attr('id', 'neoCMSPromptWrap').load('../templates/prompt.html', function () { - $('#neoCMSPrompt h4.neoCMSPromptTitle').html('Auto-Update neocms'); - $('#neoCMSPrompt p').addClass('simple').html('Are you sure you want to update? Your preferences, FTP info, and restore states will be preserved. You cannot undo or cancel once you start the auto-update process. It should take less than 3 minutes.'); - $('#neoCMSPromptBtn').addClass('neoCMSPromptBtn').attr('title', 'Auto-update neocms to the latest version').html('update').bind('click', autoUpdate); - $('#neoCMSCancelBtn').bind('click', cancel); - showPrompt() - })) - } -}; -autoUpdate = function () { - $('#neoCMSTopBanner').css('background', 'url(../images/loading.gif) repeat-x bottom'); - $('#neoCMSPrompt h4.neoCMSPromptTitle').html('Auto-Updating… Please Wait'); - $('#neoCMSPrompt p').html('Uploading the new files now. Please do not refresh your browser or stop loading.'); - $('#neoCMSPromptBtn,#neoCMSCancelBtn').remove(); - var updateIframe; - try { - updateIframe = document.createElement('') - } catch (ex) { - updateIframe = document.createElement('iframe') - } - $(updateIframe).attr({ - id: 'neoCMSUpdateFrame', - name: 'neoCMSUpdateFrame', - application: 'yes', - src: '../core/updatestart.php' - }).css('display', 'none'); - $('body').append(updateIframe) -}; -autoUpdateSuccess = function () { - $('#neoCMSPrompt h4.neoCMSPromptTitle').html('Auto-Update was Successful!'); - $('#neoCMSPrompt p').html('You are now updated to the latest version of neocms. Please click “done”.'); - $('#neoCMSPromptInsert').append($('').attr({ - id: 'neoCMSPromptBtn', - href: 'javascript:' - }).addClass('neoCMSPromptBtn').attr('title', 'Start using the latest neocms!').html('done').bind('click', reloadPage)) -}; + reloadPage = function () { window.location.reload(true); window.location.reload(true) diff --git a/cms/js/main.js b/cms/js/main.js index d7034dc..159e16d 100644 --- a/cms/js/main.js +++ b/cms/js/main.js @@ -10,7 +10,6 @@ $(function () { }); $(window).bind('resize', windowResize); $('#neoCMSLoginForm').bind('submit', loginSubmit); - $('#forgotPass').bind('click', forgotShow); $('#neoCMSUsername input').focus(); $('#neoCMSHome').bind('click', function () { checkURL(fpath()) @@ -18,14 +17,14 @@ $(function () { fBrowseBind() }); tempCache = function () { - $.ajax({url: "neocms-temps/editor.html", cache: true, dataType: "html"}); - $.ajax({url: "neocms-temps/image-editor.html", cache: true, dataType: "html"}); - $.ajax({url: "neocms-temps/video-editor.html", cache: true, dataType: "html"}); - $.ajax({url: "neocms-temps/html-editor.html", cache: true, dataType: "html"}); - $.ajax({url: "neocms-temps/link-editor.html", cache: true, dataType: "html"}); - $.ajax({url: "neocms-temps/table-editor.html", cache: true, dataType: "html"}); - $.ajax({url: "neocms-temps/prompt.html", cache: true, dataType: "html"}); - $.ajax({url: "neocms-temps/upload.html", cache: true, dataType: "html"}) + $.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 () { @@ -70,29 +69,6 @@ loginIncorr = function (message) { $('#neoCMSEnter p.error').html(message).css('display', 'block'); $('#neoCMSLoginIframe').remove() }; -forgotShow = function () { - $('#neoCMSLoginForm').attr({action: 'core/forgotpassword.php'}).find('p.error').css('display', 'none'); - $('#forgot').css({opacity: '0', display: 'block'}).fadeTo(300, 1.0, function () { - $('#forgotCancel').unbind('click').bind('click', forgotHide); - $('#neoCMSPassword').remove() - }) -}; -forgotHide = function () { - $('#neoCMSLoginForm').attr({action: 'core/forgotpassword.php'}).find('p.error').css('display', 'none'); - $('').attr('id', 'neoCMSPassword').html('').prepend($('').html('Password')).append($('').addClass("neoCMSInput").attr({ - name: "neoCMSPassword", - type: "password", - tabindex: "2" - })).append($('').addClass('error').html('Required')).insertAfter('#neoCMSUsername'); - $('#forgot').css('display', 'none'); - $('#neoCMSLoginForm').attr({action: 'core/login.php'}); - $('#forgot p.message').html('').css({display: 'none'}) -}; -forgotReset = function (message) { - var c = (message.match(/domain/gi)) ? '#666' : '#fff'; - $('#forgot p.message').html(message).css({color: c, display: 'block'}); - $('#neoCMSLoginIframe').remove() -}; windowResize = function () { if ($('.neoCMSIcon, .neoCMSRepIcon', ifrDoc).length) destroyIcons(); if ($('#overlay').length) $('#overlay').css({width: $(window).width(), height: $(window).height()}); diff --git a/cms/js/neocms.js b/cms/js/neocms.js deleted file mode 100644 index 8c29eb9..0000000 --- a/cms/js/neocms.js +++ /dev/null @@ -1,2041 +0,0 @@ -var undoC, neoCMSGlobalPath, neoCMSPath, neoCMSFiles, neoCMSHTMLEdit, neoCMSFilePath, neoCMSImagePath, fileTarget, - origImg, bm; -$(function () { - $(window).bind('load', neocmsStart); - neocmsGlobals(); - $('#neoCMSPageSrc').height($(window).height() - 60) -}); -neocmsStart = function () { - ifrDoc = getIfrDoc(); - $(window).unbind('load'); - $('#neoCMSTopBanner').css('background', 'url(images/loading.gif) repeat-x bottom'); - undoC = 0; - neoCMSGlobalPath = null; - neoCMSPath = null; - neoCMSFiles = null; - neoCMSHTMLEdit = null; - neoCMSFilePath = null; - neoCMSImagePath = null; - $('#neoCMSDashboard a').bind('click', function () { - if ($('#neoCMSPageEdits .edit', ifrDoc).length) { - navAwayPrompt('settings/', 'loc') - } else window.location = 'settings/' - }); - $('#neoCMSLogout a').bind('click', logoutPrompt); - neocmsSetup() -}; -neocmsSetup = function () { - if (neoCMSGlobalPath == null || neoCMSHTMLEdit == null) { - var prefsIframe; - try { - prefsIframe = document.createElement('') - } catch (ex) { - prefsIframe = document.createElement('iframe') - } - $(prefsIframe).attr({ - id: 'neoCMSPrefsFrame', - name: 'neoCMSPrefsFrame', - src: 'core/sessionConfiguration.php', - application: 'yes' - }).css('display', 'none'); - $('body').append(prefsIframe) - } else getGlobals(neoCMSGlobalPath, neoCMSHTMLEdit, neoCMSFiles, neoCMSFilePath, neoCMSImagePath) -}; -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; - $('#neoCMSPrefsFrame').load('core/getpath.php', function () { - $('#neoCMSPrefsFrame').remove() - }); - initPage(); - setTimeout(function () { - $('#neoCMSPageSrc').bind('load', initPage) - }, 100) -}; -initPage = function () { - getIfrDoc(); - cancel(); - $('#neoCMSGlobalUndo, #neoCMSGlobalRedo').remove(); - $('.neocms cufon, .neocmsRepeat cufon', ifrDoc).each(function () { - $(this, ifrDoc).replaceWith($(this, ifrDoc).find('cufontext').html()) - }); - $('.neocms embed.sIFR-flash, .neocmsRepeat embed.sIFR-flash, .neocms object.sIFR-flash, .neocmsRepeat object.sIFR-flash', ifrDoc).remove(); - $('.neocms .sIFR-replaced', ifrDoc).removeClass('sIFR-replaced'); - $('html', ifrDoc).removeClass('sIFR-hasFlash'); - $('.neocms span.sIFR-alternate, .neocmsRepeat span.sIFR-alternate', ifrDoc).each(function () { - $(this, ifrDoc).replaceWith($(this, ifrDoc).html()) - }); - linkBind(); - neocmsCSS() -}; -neocmsCSS = function () { - var ifrDocStyles = ''; - $('head', ifrDoc).append(ifrDocStyles); - changeTitle() -}; -changeTitle = function () { - var urlName = retUrl(); - urlName = urlName.split('//'); - urlName = urlName[1]; - document.title = "Editing :: " + urlName; - neocmsGlobals(); - initElements() -}; -initElements = function () { - var inlineRegExp = new RegExp("\ba\b|abbr|acronym|\bb\b|basefont|bdo|big|br|cite|code|dfn|em\b|font|\bi\b|input|kbd|label|\bq\b|\bs\b|samp|select|small|span|strike|strong|sub|textarea|tt|\bu\b|var", "i"), - unc = 0, rnc = 0, elems = $('.neocms, .neocmsRepeatArea .neocmsRepeat, .neocmsRepeatArea', ifrDoc); - if (elems.length) { - $.each(elems, function () { - if ($(this, ifrDoc).attr('class').match(/neocmsRepeat\b/g)) var type = 'neoCMSEditArea neoCMSRep', - typeId = 'neoCMSRepEdit' + rnc; else if ($(this, ifrDoc).attr('class').match(/neocmsRepeatArea/g)) var type = 'neoCMSEditArea neoCMSRepArea', - typeId = 'neoCMSEditArea' + unc; else var type = 'neoCMSEditArea', typeId = 'neoCMSEditArea' + unc; - if (!$(this, ifrDoc)[0].tagName.match(inlineRegExp) && !$(this, ifrDoc).parents('.neocms, .neocmsRepeat').length) { - $(this, ifrDoc).addClass(type).attr({neocmsid: typeId}); - if ($(this, ifrDoc).attr('class').match(/neocmsRepeat\b/)) { - if (getCurStyle($(this, ifrDoc)[0], 'position') == 'static' && $(this, ifrDoc)[0].tagName != 'TR') $(this, ifrDoc).css('position', 'relative') - } - if ($(this, ifrDoc)[0].tagName == 'TABLE' && $(this, ifrDoc).attr('class').match(/neocmsRepeatArea/)) $(this, ifrDoc).css('display', 'table') - } - if (!$(this, ifrDoc).attr('class').match(/neocmsRepeat\b/g)) unc++; else rnc++ - }) - } - $('body', ifrDoc).append($('', ifrDoc).attr({ - id: 'neoCMSPageEdits', - action: neoCMSGlobalPath + '/core/save.php', - method: 'POST', - target: 'neoCMSPubIframe', - 'accept-charset': 'UTF-8,ISO-8859-15' - }).css('display', 'none')); - createIcons(); - neocmsRepStart() -}; -createIcons = function (noanim) { - destroyIcons(); - $('#neoCMSTopBanner').css('background', 'none'); - $('.neoCMSEditArea', ifrDoc).each(function () { - var tog = ($(this, ifrDoc).attr('class').match(/neoCMSRep/g)) ? true : false, - iid = $(this, ifrDoc).attr('neocmsid').replace(/neoCMSRepEdit|neoCMSEditArea/, ''), - itype = (tog) ? 'neoCMSRepIcon' : 'neoCMSIcon', bgl = (tog) ? '-674px' : '-638px', - type = (tog) ? 'neoCMSRepEdit' : 'neoCMSEditArea', reptype = (tog) ? '.neocmsRepeat' : '.neocms', - udisp = (getCurStyle($(this, ifrDoc)[0], 'display') != 'none') ? 'block' : 'none', - uvis = getCurStyle($(this, ifrDoc)[0], 'visibility'), - padtop = getCurStyle($(this, ifrDoc)[0], 'padding-top'); - var offset = $(this, ifrDoc).offset(), oleft = (offset.left - 40 < 0) ? 0 : offset.left - 40; - oleft = (oleft > $('body', ifrDoc).width() - 40) ? $('body', ifrDoc).width() - 50 : oleft; - if (!$(this, ifrDoc).attr('class').match(/neoCMSRepArea/g) && udisp != 'none' && uvis != 'hidden') { - $('body', ifrDoc).append($('', ifrDoc).addClass(itype).attr({ - id: itype + iid, - title: 'Edit this area', - href: 'javascript:' - }).html('Update now').css({top: offset.top + parseInt(padtop), left: oleft}).bind('mousedown', function () { - change(iid, itype) - })) - } - if (!$(this, ifrDoc).attr('class').match(/neocmsRepeatArea/g)) { - $(this, ifrDoc).unbind('mouseover').bind('mouseover', function () { - if (tog) $('.neoCMSRepDelete, .neoCMSRepCopyDrag', $(this, ifrDoc)).css('display', 'block'); - $('#' + itype + iid, ifrDoc).css('background-position', bgl + ' -88px !important') - }).unbind('mouseout').bind('mouseout', function () { - if (tog) $('.neoCMSRepDelete, .neoCMSRepCopyDrag', $(this, ifrDoc)).css('display', 'none'); - $('#' + itype + iid, ifrDoc).css('background-position', bgl + ' -56px !important') - }) - } - }); - $('body', ifrDoc).unbind('mouseup').bind('mouseup', function () { - setTimeout(function () { - createIcons() - }, 400) - }) -}; -neocmsRepStart = function () { - if ($('.neocmsRepeatArea', ifrDoc).length) { - var unrac = 0; - $('.neocmsRepeatArea', ifrDoc).each(function () { - $(this, ifrDoc).addClass('neoCMSRepeatArea' + unrac); - if ($(this, ifrDoc)[0].tagName == 'TABLE') $(this, ifrDoc).removeClass('clearfix'); - unrac++ - }); - neocmsRepBind() - } -}; -neocmsRepBind = function () { - var areas = repAreas(); - var undoAreas = repAreas(true); - repCopyDragDelete(); - $('.neocmsRepeatArea', ifrDoc).sortable('destroy').sortable({ - items: $('.neoCMSRep', ifrDoc), - cancel: 'a.neoCMSRepCopyDrag, a.neoCMSRepDelete, a.neoCMSIcon', - tolerance: 'pointer', - cursorAt: 'top', - containment: 'parent', - cursor: 'move', - placeholder: 'neoCMSPlaceholder', - forcePlaceholderSize: true, - forceHelperSize: true, - opacity: 0.7 - }).unbind('mousedown').bind('mousedown', function () { - repOverlay($(this, ifrDoc), areas, undoAreas) - }).find('.neoCMSIcon').unbind('mousedown').bind('mousedown', change).end().find('*').disableSelection(); - $('.neoCMSRep', ifrDoc).draggable('destroy').draggable({ - connectToSortable: $('.ui-sortable', ifrDoc), - handle: $('a.neoCMSRepCopyDrag', ifrDoc), - helper: 'clone', - containment: 'parent', - revert: 'invalid', - cursor: 'move', - opacity: 0.7 - }).each(function () { - if ($(this, ifrDoc)[0].tagName == 'TR') $(this, ifrDoc).removeClass('clearfix'); - $(this, ifrDoc).width(getCurStyle(this, 'width')) - }); - $('.neoCMSRepDelete', ifrDoc).unbind('mousedown').bind('mousedown', function () { - repDeletePrompt($(this, ifrDoc)) - }); - if ($.browser.msie) $('.neoCMSRep', ifrDoc).each(function () { - $(this, ifrDoc)[0].style.removeAttribute('filter') - }); - $('body', ifrDoc).unbind('sortstart').bind('sortstart', function (e, ui) { - setTimeout(function () { - $('.neoCMSPlaceholder', ifrDoc).height($('.ui-sortable-helper', ifrDoc).height() + 'px').width($('.ui-sortable-helper', ifrDoc).width() + 'px').attr('class', 'neoCMSPlaceholder ' + $('.ui-sortable-helper', ifrDoc).attr('class')); - $('tr.neoCMSPlaceholder', ifrDoc).append($('', ifrDoc).attr('colspan', $('tr.ui-sortable-helper', ifrDoc).find('td').length)) - }, 0); - destroyIcons() - }) -}; -repCopyDragDelete = function () { - $('a.neoCMSRepCopyDrag, a.neoCMSRepDelete', ifrDoc).remove(); - $('.neoCMSRep', ifrDoc).each(function () { - var d = 'Delete element', - c = 'Drag from here to create a copy', - t = this; - if ($(t, ifrDoc)[0].tagName == 'TR') { - var padTop = getCurStyle($(t, ifrDoc).find('td:first')[0], 'padding-top'), rowPos = $(t, ifrDoc).position(); - $('td:first, th:first', t).prepend(d.replace('display:none;', 'display:none; top:' + Math.round(rowPos.top) + 'px !important; left:' + (Math.round(rowPos.left) + 36) + 'px !important')).prepend(c.replace('display:none;', 'display:none; top:' + Math.round(rowPos.top) + 'px !important; left:' + Math.round(rowPos.left) + 'px !important')) - } else $(t, ifrDoc).prepend(d).prepend(c) - }) -}; -repAreas = function (undo) { - var unrac = 0; - var areas = new Array(); - $('.neocmsRepeatArea', ifrDoc).each(function () { - if (undo) { - $(this, ifrDoc).find('.neoCMSEle').css('visibility', 'visible').removeClass('neoCMSEle'); - var repAreaContent = $('', ifrDoc).append($(this, ifrDoc).clone()).html() - } else { - var repAreaContent = $(this, ifrDoc).clone().find('.neoCMSPlaceholder').remove().end().find('.neoCMSRep').each(function () { - $(this, ifrDoc).replaceWith($(this, ifrDoc).find('.neocmsRepeat').clone()) - }).end().html(); - repAreaContent = repAreaContent.replace(/style=".*?"/gi, '') - } - $(this, ifrDoc).find('.neocmsRepeat').each(function () { - if (!$(this, ifrDoc).find('.neoCMSRepDelete').length) { - var repDelete = $('', ifrDoc).addClass('neoCMSRepDelete').attr({ - title: 'Delete element', - href: 'javascript:' - }).html('Delete element'), repCopy = $('', ifrDoc).addClass('neoCMSRepCopyDrag').attr({ - title: 'Drag from here to create a copy', - href: 'javascript:' - }).html('Drag from here to create a copy'); - repCopyDragDelete(this, repDelete, repCopy) - } - }); - areas[unrac] = repAreaContent; - unrac++ - }); - return areas -}; -repOverlay = function (rep, areas, undoAreas) { - var pos = (getCurStyle($(rep, ifrDoc)[0], 'position') == 'static' && $(rep, ifrDoc)[0].tagName != 'TABLE') ? 'relative' : getCurStyle($(rep, ifrDoc)[0], 'position'); - $(rep, ifrDoc).css({position: pos, width: $(rep, ifrDoc).width()}); - $('body', ifrDoc).unbind('sortstop').bind('sortstop', function (event, ui) { - var rand = Math.round(Math.random() * 10000); - if (!$('[neocmsid=neoCMSRepEdit' + rand + ']', ifrDoc).length) ui.item.attr('neocmsid', 'neoCMSRepEdit' + rand); else ui.item.attr('neocmsid', 'neoCMSRepEdit' + rand + 1); - repDone(rep, areas, undoAreas) - }) -}; -repEditDone = function (ele) { - var tinyDoc = getTinyDoc(), areas = repAreas(), undoAreas = repAreas(true), - parent = $(ele, ifrDoc).parents('.neocmsRepeatArea'), t = (ele.tagName.match(/(h[0-9]|p)/i)) ? false : true, - content = (!t && $('[neocmsid]', tinyDoc).find(ele.tagName).length) ? $('[neocmsid]', tinyDoc).parent().html() : $('[neocmsid]', tinyDoc).html(); - if (content) { - content = cleanContent(content, t); - var clone = $(ele, ifrDoc).clone(); - if ($(ele, ifrDoc)[0].tagName.match(/TR|THEAD|TBODY/)) clone.html(content); else clone[0].innerHTML = content; - $(ele, ifrDoc).replaceWith(clone) - } else $(ele, ifrDoc).html(' '); - cancel(); - repDone(parent, areas, undoAreas) -}; -repImageDone = function (ele) { - var areas = repAreas(); - var undoAreas = repAreas(true); - var parent = $(ele, ifrDoc).parents('.neocmsRepeatArea', ifrDoc); - var imgSrc = ($('#neoCMSImgStatArea img').attr('src').match(/^\.\.\//)) ? $('#neoCMSImgStatArea img').attr('src').replace(/^\.\.\//, '') : $('#neoCMSImgStatArea img').attr('src'); - var neoCMSImgClass = null; - if ($('#neoCMSImgClass').val() != '') neoCMSImgClass = $('#neoCMSImgClass').val() + ' neocmsRepeat'; else neoCMSImgClass = 'neocmsRepeat'; - $(ele, ifrDoc).addClass('neoCMSImgClass').attr({ - src: imgSrc, - alt: $('#neoCMSImgAltTxt').val(), - width: $('#neoCMSImgStatsWidth').val(), - height: $('#neoCMSImgStatsHeight').val() - }); - if ($(ele.parentNode, ifrDoc).attr('href') && $('#neoCMSImgLink').val() != $(ele.parentNode, ifrDoc).attr('href')) $(ele.parentNode, ifrDoc).attr({href: $('#neoCMSImgLink').val()}); - if ($(ele.parentNode, ifrDoc).attr('rel') && $('#neoCMSImgRel').val() != $(ele.parentNode, ifrDoc).attr('rel')) $(ele.parentNode, ifrDoc).attr({rel: $('#neoCMSImgRel').val()}); - cancel(); - repDone(parent, areas, undoAreas) -}; -repDone = function (rep, areas, undoAreas) { - $('body', ifrDoc).css('display', 'none').css('display', 'block'); - $(rep, ifrDoc).addClass('neoCMSEle'); - var editNum = $(rep, ifrDoc).attr('neocmsid').replace('neoCMSEditArea', ''); - var areaNum = $(rep, ifrDoc).attr('class').match(/neoCMSRepeatArea[0-9]+/g)[0].replace('neoCMSRepeatArea', ''); - var content = $(rep, ifrDoc).clone().find('.neoCMSPlaceholder').remove().end().find('.neoCMSRep').each(function () { - $(this, ifrDoc).replaceWith($(this, ifrDoc).removeAttr('neocmsid').removeAttr('style').removeClass('neoCMSEditArea').removeClass('neoCMSRep').removeClass('ui-draggable').find('a.neoCMSRepCopyDrag, a.neoCMSRepDelete').remove().end().clone()) - }).end().html(); - content = cleanContent(content, true); - createUndo(undoAreas[areaNum]); - if (!$('#neoCMSEditTA' + editNum, ifrDoc).length) $('', ifrDoc).addClass('edit').attr({ - name: 'edit' + editNum, - id: 'neoCMSEditTA' + editNum, - rows: '1', - cols: '1' - }).appendTo($('#neoCMSPageEdits', ifrDoc)); - if (typeof (document.textContent) != 'undefined') $('#neoCMSEditTA' + editNum, ifrDoc)[0].textContent = content; else $('#neoCMSEditTA' + editNum, ifrDoc)[0].innerText = content; - undoC++; - redoOff(); - linkBind(); - neocmsRepBind(); - $('.neoCMSEle', ifrDoc).removeClass('neoCMSEle'); - createIcons() -}; -repDeletePrompt = function (ele) { - overlay(); - if (!$('#neoCMSPrompt').length) { - $('body').append($('').attr('id', 'neoCMSPromptWrap').load('templates/prompt.html', function () { - $('#neoCMSPrompt h4.neoCMSPromptTitle').html('Delete Repeatable'); - $('#neoCMSPrompt p').html('Are you sure you want to delete this element?'); - $('#neoCMSPromptBtn').attr('title', 'delete').html('delete').bind('click', function () { - repDelete(ele) - }); - $('#neoCMSCancelBtn').bind('click', cancel); - showPrompt('nodrag') - })) - } -}; -repDelete = function (ele) { - var areas = repAreas(); - var undoAreas = repAreas(true); - var parent = $(ele, ifrDoc).parents('.neocmsRepeatArea', ifrDoc); - $(ele, ifrDoc).parents('.neoCMSRep').remove(); - repDone(parent, areas, undoAreas); - cancel() -}; -frameShim = function () { - $('#neoCMSFrameShim').css('display', 'block').height($(document).height()).width($(document).width()).unbind('mouseup').bind('mouseup', frameShimDestroy) -}; -frameShimDestroy = function () { - $('#neoCMSFrameShim').css('display', 'none') -}; -getBookmark = function (type) { - bm = tinyMCE.activeEditor.selection.getBookmark(type) -}; -setBookmark = function () { - tinyMCE.activeEditor.selection.moveToBookmark(bm) -}; -keyHandler = function () { - $(document).bind('keypress', function (e) { - switch (e.which || e.keyCode) { - case 27: - $('#neoCMSUploadIframe, #neoCMSFileFrame, #neoCMSFolderFrame').remove(); // Had a missing div here? - cancel() - } - }); - var tinyDoc = getTinyDoc(); - if (tinyDoc) { - tinyKeyEvents(tinyDoc); - $('img', tinyDoc).bind('mousedown', function () { - tinyMCE.execCommand("mceSelectNode", false, this) - }) - } - $(document).bind('keydown', function (e) { - if (e.metaKey) { - $(document).bind('keydown', function (e) { - switch (e.which || e.keyCode) { - case 37: - e.preventDefault(); - break; - case 39: - e.preventDefault(); - break - } - }) - } - switch (e.which || e.keyCode) { - case 8: - if (!$('#neoCMSPromptWrap').length) { - e.preventDefault(); - return true - } - } - }) -}; -tinyKeyEvents = function (tinyDoc) { - $(tinyDoc).unbind('keyup').unbind('keydown').bind('keydown', function (e) { - var ed = tinyMCE.activeEditor.selection.getNode(); - switch (e.which || e.keyCode) { - case 224: - case 17: - $(tinyDoc).unbind('keydown').bind('keydown', function (e) { - switch (e.which || e.keyCode) { - case 65: - if (tinyDoc.createRange) { - var rng = tinyDoc.createRange(), - s = document.getElementById('neoCMSEditContent_ifr').contentWindow.getSelection() || window.getSelection(); - if (s.rangeCount > 0) s.removeAllRanges(); - rng.selectNodeContents($('[neocmsid]', tinyDoc)[0]); - s.addRange(rng) - } else { - var rng = tinyDoc.body.createTextRange(); - rng.moveToElementText($('[neocmsid]', tinyDoc)[0]); - rng.select() - } - e.preventDefault(); - break - } - }).unbind('keyup').bind('keyup', function (e) { - switch (e.which || e.keyCode) { - case 224: - case 17: - tinyKeyEvents(tinyDoc); - break - } - }); - break; - case 27: - cancel(); - break; - case 9: - var tag = $(ed, tinyDoc).parent()[0].tagName, - tag = (tag == 'LI') ? $(ed, tinyDoc).parent().parent()[0].tagName : tag, - newed = '<' + tag + '>' + $(ed, tinyDoc).html() + '' + tag + '>'; - if (ed.tagName == 'LI') { - $(ed, tinyDoc).replaceWith(newed); - setCaret($('#caret', tinyDoc)[0], tinyDoc); - e.preventDefault() - } else if ($(ed, tinyDoc).parent()[0].tagName == 'LI') { - $(ed, tinyDoc).parent().replaceWith(newed); - setCaret($('#caret', tinyDoc)[0], tinyDoc); - e.preventDefault() - } - break; - case 16: - $(tinyDoc).unbind('keydown').bind('keydown', function (e) { - var ed = tinyMCE.activeEditor.selection.getNode(); - switch (e.which || e.keyCode) { - case 9: - if (ed.tagName.match(/LI/) && $(ed).parents('ul,ol').length > 1) { - var newed = $(ed, tinyDoc).add($(ed, tinyDoc).nextAll('li')), - edpar = $(ed, tinyDoc).parent(); - if (newed.length != $(edpar).children().length) $(newed, tinyDoc).insertAfter(edpar); else $(newed, tinyDoc).insertBefore(edpar); - if (!$(edpar).children().length) edpar.remove(); - setCaret($(ed)[0], tinyDoc); - e.preventDefault() - } - break - } - }).unbind('keyup').bind('keyup', function (e) { - switch (e.which || e.keyCode) { - case 16: - tinyKeyEvents(tinyDoc); - break - } - }); - break - } - }).focus(function () { - tinyKeyEvents(tinyDoc) - }) -}; -setCaret = function (node, doc) { - var ntxt = $(node, doc).html(); - if (doc.createRange) { - var rng = doc.createRange(), - s = document.getElementById('neoCMSEditContent_ifr').contentWindow.getSelection() || window.getSelection(); - if (s.rangeCount > 0) s.removeAllRanges(); - if (ntxt == '') rng.selectNodeContents(node); else { - rng.setStart(node, 1); - rng.setEnd(node, 1) - } - s.addRange(rng) - } else { - var rng = doc.body.createTextRange(); - if (ntxt == '') $(node, doc).empty(); - rng.moveToElementText(node); - rng.collapse(false); - rng.select() - } - $('#caret', doc).removeAttr('id') -}; -retUrl = function () { - if (frames['neoCMSPageSrc'].contentWindow) ret = frames['neoCMSPageSrc'].contentWindow.location.href; else ret = frames['neoCMSPageSrc'].location.href; - return ret -}; -getTinyDoc = function () { - if ($('#neoCMSEditContent_ifr').length) { - var tinyDoc = document.getElementById('neoCMSEditContent_ifr'); - tinyDoc = (tinyDoc.contentWindow) ? tinyDoc.contentWindow.document : tinyDoc.contentDocument - } else tinyDoc = false; - return tinyDoc -}; -saveFeedback = function (message) { - userBar(message); - $('#neoCMSPageEdits textarea, #neoCMSPubIframe', ifrDoc).remove() -}; -userBar = function (message) { - if (!$('#neoCMSUserBar').length) { - $('').addClass('neoCMSUserBar').attr('id', 'neoCMSUserBar').insertAfter('#neoCMSTopBanner').append($('').addClass('neoCMSUserBarIn').attr('id', 'neoCMSUserBarIn').append($(''))); - if (message.match(/successfully/gi)) { - $('#neoCMSUserBar').find('p').html('' + message + '').end().css('opacity', '0.4').animate({opacity: '1'}, 800); - if (message.match(/published/gi)) $('#neoCMSRestore a').attr('title', 'Restore the last published version').bind('click', restorePrompt).removeAttr('style'); - $('#neoCMSUserBarIn').prepend($('').attr('href', 'javascript:').html('Refresh This Page').bind('click', ifrReload)); - var userBarFade = setTimeout(function () { - $('#neoCMSUserBar').animate({opacity: '0'}, 300, function () { - $('#neoCMSUserBar').remove() - }) - }, 5500) - } else { - $('#neoCMSUserBar').find('p').html(message).end().hide().css({ - opacity: '1.0', - backgroundColor: '#c6242b' - }).slideDown(300); - $('#neoCMSUserBarIn').prepend($('').attr('href', 'javascript:').html('Hide This Bar').bind('click', hideUserBar)) - } - } else { - $('#neoCMSUserBar').remove(); - window.clearTimeout(userBarFade); - userBar(message) - } -}; -hideUserBar = function () { - if ($('#neoCMSUserBar').css('position') == 'relative') $('#neoCMSUserBar').animate({marginTop: '-26px'}, 300, function () { - $('#neoCMSUserBar').remove() - }); else $('#neoCMSUserBar').animate({opacity: '0'}, 200, function () { - $('#neoCMSUserBar').remove() - }) -}; -change = function (iid, type) { - if (type == 'neoCMSRepIcon') { - var ele = $('[neocmsid=neoCMSRepEdit' + iid + ']', ifrDoc)[0]; - $(ele, ifrDoc).parents('.neocmsRepeatArea').unbind('mousedown') - } else var ele = $('[neocmsid=neoCMSEditArea' + iid + ']', ifrDoc)[0]; - overlay(ele) -}; -ifrReload = function () { - $('#neoCMSPageSrc').unbind('load'); - if (frames['neoCMSPageSrc'].contentWindow) { - window.frames['neoCMSPageSrc'].contentWindow.location.reload(true); - window.frames['neoCMSPageSrc'].contentWindow.location.reload(true) - } else { - window.frames['neoCMSPageSrc'].location.reload(true); - window.frames['neoCMSPageSrc'].location.reload(true) - } - $('#neoCMSPageSrc').bind('load', initPage) -}; -editorStyles = function (tinyDoc) { - $('link, style', ifrDoc).not('[media="print"], [media="handheld"], [app="neocms"]').each(function () { - var cssHref = $(this, ifrDoc).attr('href'); - if (cssHref) { - cssHref = (cssHref.match(/^http(s*):\/\//)) ? cssHref : fpath() + cssHref; - var cssDiv = $('', ifrDoc).append($(this, ifrDoc).clone().attr('href', cssHref)); - $('head', tinyDoc).html($('head', tinyDoc).html() + $(cssDiv, ifrDoc).html()); - cssDiv = null - } else { - var cssDiv = $('', ifrDoc).append($(this, ifrDoc).clone()); - $('head', tinyDoc).html($('head', tinyDoc).html() + $(cssDiv, ifrDoc).html()); - cssDiv = null - } - }) -}; -windowOrient = function () { - if ($('li#neoCMSFullscreen a.neoCMSMinimize').length) $('#neoCMSEditWrap .mceIframeContainer').width('auto'); - var ele = $('.neoCMSEle', ifrDoc)[0]; - if (ele) { - var tinyDoc = getTinyDoc(); - setTimeout(function () { - editorSize(tinyDoc, ele) - }, 100) - } -}; -hideFlash = function () { - $('object, embed', ifrDoc).addClass('neoCMSFlash'); - if ($('#neoCMSEditContent_ifr').length) { - var tinyDoc = getTinyDoc(); - $('object, embed', tinyDoc).addClass('neoCMSFlash') - } -}; -editorSize = function (tinyDoc, ele) { - var eleMarLeft = (getCurStyle($(ele, ifrDoc)[0], 'margin-left') != 'auto') ? getCurStyle($(ele, ifrDoc)[0], 'margin-left') : 0, - eleMarRight = (getCurStyle($(ele, ifrDoc)[0], 'margin-right') != 'auto') ? getCurStyle($(ele, ifrDoc)[0], 'margin-right') : 0, - editIfrWidth = $(ele, ifrDoc).width() + parseInt(eleMarLeft) + parseInt(eleMarRight) + 44, - editIfrWidth = (editIfrWidth - (parseInt(eleMarLeft) + parseInt(eleMarRight)) == '44' && $(ele, ifrDoc).css('width') != 'auto') ? editIfrWidth + parseInt($(ele, ifrDoc).css('width')) : editIfrWidth; - if ($.browser.msie) $('#neoCMSEditContent_ifr').width(editIfrWidth + 20); else $('#neoCMSEditContent_ifr').width(editIfrWidth); - $('.mceIframeContainer').height('auto'); - var ifrBodyHeight = tinyDoc.body.scrollHeight, - windowHeight = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight; - if ((ifrBodyHeight + 63) > (windowHeight - 130)) $('td.mceIframeContainer').height(windowHeight - 130); else setTimeout(function () { - $('td.mceIframeContainer, #neoCMSEditContent_ifr', $('#neoCMSEditWrap')).height(ifrBodyHeight) - }, 0); - var wrapWidth = ''; - if ($('#neoCMSEditContent_bullist').length && $('#neoCMSEditContent_ifr')[0].offsetWidth + 10 <= 640) wrapWidth = 640; else { - if ($.browser.msie) wrapWidth = $('#neoCMSEditContent_ifr').width() + 20; else wrapWidth = $('#neoCMSEditContent_ifr').width() + 8 - } - if (wrapWidth < 300) wrapWidth = 300; - $('#neoCMSEditWrap, #neoCMSEditContent_tbl td.mceIframeContainer, #neoCMSEditContent_tbl td.mceToolbar').width(wrapWidth).css('min-width', wrapWidth); - $('#neoCMSEditTopUl').css('min-width', wrapWidth - 14); - $('#neoCMSEditWrap').animate({opacity: 1}, 'slow').find('#neoCMSEditDone a').bind('click', function () { - if ($(ele).attr('class').match(/neocmsRepeat\b/g)) repEditDone(ele); else done(ele) - }).end().find('#neoCMSEditCancel a').bind('click', cancel).end().find('a.fullscreen').unbind('click').bind('click', function () { - editorFullscreen($(this).attr('rel')) - }).removeClass('neoCMSMinimize').attr({title: 'Maximize this window'}).html('Maximize this window').end().find('#neoCMSEditHTML').unbind('click').bind('click', function () { - htmlPrompt(ele) - }).end(); - dragOn($('#neoCMSEditWrap')[0], $('.neoCMSEditTopBar')[0]); - editorPos(tinyDoc, ele, ifrBodyHeight + 63) -}; -editorPos = function (tinyDoc, ele, wrapHeight) { - var offset = $(ele, ifrDoc).offset(); - $('#neoCMSEditContent_ifr').css({float: 'none', margin: '0'}); - var sTop = (ifrDoc.documentElement.scrollTop) ? ifrDoc.documentElement.scrollTop : ifrDoc.body.scrollTop, - sLeft = (ifrDoc.documentElement.scrollLeft) ? ifrDoc.documentElement.scrollLeft : ifrDoc.body.scrollLeft; - if ((offset.top - sTop - 36) < 0) $('#neoCMSEditWrap').css('top', '0px'); else { - if (!$('#neoCMSUserBar').length) $('#neoCMSEditWrap').css('top', offset.top - sTop - 34); else $('#neoCMSEditWrap').css('top', offset.top - sTop - 14) - } - if ((offset.left - sLeft - 14) < 0) $('#neoCMSEditWrap').css('left', '0px'); else if ((offset.left + $('#neoCMSEditWrap').width()) > $('body', ifrDoc).width()) { - $('#neoCMSEditWrap').css('left', (offset.left - sLeft - $('#neoCMSEditWrap').width() + $(ele, ifrDoc).width() + 32)); - $('#neoCMSEditContent_ifr').css({float: 'right', clear: 'both'}) - } else { - $('#neoCMSEditWrap').css('left', (offset.left - sLeft - 24)); - $('#neoCMSEditContent_ifr').css('float', 'left') - } - var tHeight = offset.top - sTop + wrapHeight, tWidth = offset.left - sLeft + $('#neoCMSEditWrap').width(); - if (tHeight > $(window).height()) { - frames['neoCMSPageSrc'].scrollTo(sLeft, offset.top - 48); - sTop = (ifrDoc.documentElement.scrollTop) ? ifrDoc.documentElement.scrollTop : ifrDoc.body.scrollTop; - if ((offset.top + sTop - 48) < 0) $('#neoCMSEditWrap').css('top', '0px'); else { - if (!$('#neoCMSUserBar').length) $('#neoCMSEditWrap').css('top', offset.top - sTop - 34); else $('#neoCMSEditWrap').css('top', offset.top - sTop - 16) - } - } - if (tWidth > $(window).width()) { - frames['neoCMSPageSrc'].scrollTo(offset.left - 48, sTop); - sLeft = (ifrDoc.documentElement.scrollLeft) ? ifrDoc.documentElement.scrollLeft : ifrDoc.body.scrollLeft; - if ((offset.left + sLeft - 48) < 0) $('#neoCMSEditWrap').css('left', '0px'); else $('#neoCMSEditWrap').css('left', offset.left - sLeft - 48) - } -}; -editorCleanUp = function () { - var tinyDoc = getTinyDoc(); - fixImgs(); - $('body', tinyDoc).find('.neoCMSIcon').remove().end().find('img').each(function () { - $(this, tinyDoc).removeAttr('_mce_src') - }).end().find('a').each(function () { - if ($(this, tinyDoc).attr('href')) { - var eleAhref = $(this, tinyDoc).attr('href'); - if (eleAhref.match(window.location)) $(this, tinyDoc).attr('href', eleAhref.replace(window.location + "#", "#")); - $(this, tinyDoc).removeAttr('_mce_href') - } - }).end().find('*').each(function () { - if (getCurStyle(this, 'display') == 'none' || getCurStyle(this, 'visibility') == 'hidden') $(this, tinyDoc).css({ - display: 'block', - visibility: 'visible' - }) - }).end().bind('mouseup', function () { - var ed = tinyMCE.activeEditor.selection.getNode(); - if (ed.tagName == 'EMBED' && $(ed, tinyDoc).parent()[0].tagName == 'OBJECT') tinyMCE.execCommand('mceSelectNodeDepth', false, 1) - }) -}; -editorFullscreen = function (prompt) { - $(prompt).height($(document).height()).css({ - opacity: '1', - top: '0', - left: '0' - }).find('a.fullscreen').addClass('neoCMSMinimize').unbind('click').bind('click', function () { - if (prompt == '#neoCMSEditWrap') windowOrient(); else htmlPrompt() - }).attr('title', 'Minimize this window').html('Minimize this window'); - if (prompt == '#neoCMSEditWrap') { - $(prompt).width($(window).width()); - $('.mceIframeContainer').height($(document).height() - 84).width($(window).width()); - $('#neoCMSEditContent_ifr').css({float: 'none', margin: '0 auto'}) - } else { - $(prompt).width($(window).width() - 40).css('margin', '0'); - $('#neoCMSHtmlEditAreaTA, #neoCMSCodeWrap').height($(window).height() - 130).width($(prompt).width() - 28).focus() - } -}; -neocmsGlobals = function () { - $('#neoCMSRestore a').attr('title', 'Restore the last published version').bind('click', restorePrompt); - if (!$('#neoCMSGlobalUndo').length || undoC == 0) $('#neoCMSUndo a').css({ - opacity: '0.5', - backgroundPosition: '-62px 0', - cursor: 'default' - }).unbind('click', undo).attr('title', 'Cannot Undo at this time'); else $('#neoCMSUndo a').css('opacity', '1.0').bind('click', undo).attr('title', 'Undo').removeAttr('style'); - if (!$('#neoCMSGlobalRedo').length || !$('#neoCMSGlobalRedo .neoCMSEle' + undoC).length) $('#neoCMSRedo a').css({ - opacity: '0.5', - backgroundPosition: '-134px 0', - cursor: 'default' - }).unbind('click', redo).attr('title', 'Cannot Redo at this time'); else $('#neoCMSRedo a').css('opacity', '1.0').bind('click', redo).attr('title', 'Redo').removeAttr('style'); - if (!$('#neoCMSPageEdits textarea', ifrDoc).length || undoC == 0) { - $('#neoCMSCxl a').css('opacity', '0.5').unbind('click', cancelAllPrompt).attr('title', 'Cannot Cancel All at this time').css({ - backgroundPosition: '-206px 0', - cursor: 'default' - }); - $('#neoCMSPublish a').css('opacity', '0.5').unbind('click', publish).attr('title', 'You must make edits before publishing').css({ - backgroundPosition: '-385px 0', - cursor: 'default' - }) - } else { - $('#neoCMSCxl a').css('opacity', '1.0').bind('click', cancelAllPrompt).attr('title', 'Clear all of these changes').removeAttr('style'); - $('#neoCMSPublish a').css('opacity', '1.0').bind('click', publish).attr('title', 'Publish these changes to your site').removeAttr('style') - } -}; -changePageEdits = function (ele, eleEditNum) { - var eleEditNum = (eleEditNum) ? eleEditNum : $(ele, ifrDoc).attr('neocmsid').replace('neoCMSEditArea', ''); - if ($('#neoCMSEditTA' + eleEditNum, ifrDoc).length) { - if (ele.tagName == 'IMG') { - var eleClass = $(ele, ifrDoc).attr('class').replace(/(\s)*\bneoCMSEle[0-9]+\b(\s)*/gi, ''); - var changeContent = "src::" + $(ele, ifrDoc).attr('src') + ",alt::" + $(ele, ifrDoc).attr('alt') + ",class::" + eleClass + ",width::" + $(ele, ifrDoc).attr('width') + ",height::" + $(ele, ifrDoc).attr('height') + ",link::" + $(ele.parentNode, ifrDoc).attr('href') + ",rel::" + $(ele.parentNode, ifrDoc).attr('rel'); - if (typeof (document.textContent) != 'undefined') $('#neoCMSEditTA' + eleEditNum, ifrDoc)[0].textContent = changeContent; else $('#neoCMSEditTA' + eleEditNum, ifrDoc)[0].innerText = changeContent - } else { - var content = $(ele, ifrDoc).find('a.neoCMSRepCopyDrag, a.neoCMSRepDelete').remove().end().html(); - content = cleanContent(content, true); - if (typeof (document.textContent) != 'undefined') $('#neoCMSEditTA' + eleEditNum, ifrDoc)[0].textContent = content; else $('#neoCMSEditTA' + eleEditNum, ifrDoc)[0].innerText = content - } - } -}; -cleanContent = function (c, t) { - if (!t) { - c = c.replace(/]*>/gi, ''); - c = c.replace(/<\/p>/gi, '') - } - if ($.browser.msie) { - c = c.replace(/(\s[a-zA-Z^>\s]+=)([^\"\s\'>]+)(\s*)/gi, '$1"$2"$3'); - c = c.replace(/<\/*[^\s>]+/gi, function (w) { - return w.toLowerCase() - }); - c = c.replace(/(<(dt|dd|li)[^>]*>[^<\n\r]*)/gi, "$1$2>"); - c = c.replace(/[\s\r\n]*<\/(dt|dd|li)><\/(dt|dd|li)>/gi, "$1>") - } - c = c.replace(/(style|_mce_[^\s=]*|unselectable|contentEditable|neocmsid|jQuery[0-9]*)=\"[^\"]*\"\s*/gi, ''); - c = c.replace(/(<\/*[^>]+)\s>/gi, '$1>'); - c = c.replace(/(neoCMSEditArea|neoCMSRep|ui-draggable)\s*/gi, ''); - c = c.replace(/<(\/?)b>|]+)>/gi, '<$1strong$2>'); - c = c.replace(/<(\/?)i>|]+)>/gi, '<$1em$2>'); - c = c.replace(window.location + "#", "#"); - return c -}; -getCurStyle = function (ele, cur) { - var tinyDoc = getTinyDoc(), doc = (tinyDoc) ? tinyDoc : ifrDoc, gs, cs = $(ele, doc)[0].currentStyle; - if (cs) { - if (cur.match(/-/)) cur = cur.replace(/-([A-z])/gi, function (a, b) { - return b.toUpperCase() - }); - gs = (cs[cur]) ? cs[cur] : $(ele, doc).css(cur); - if (gs == undefined) gs = '' - } else gs = doc.defaultView.getComputedStyle(ele, null).getPropertyValue(cur); - return gs -}; -contrast = function () { - var tinyDoc = getTinyDoc(); - $('.mceIframeContainer').css('background-color', 'rgb(255,255,255)'); - $('#neoCMSEditorContrast').bind('mousewheel', function (event, delta) { - var vel = Math.round(Math.abs(delta) * 20); - var color = $('.mceIframeContainer').css('background-color'); - var rgb = color.replace(/(rgb\(\s*|\))/, ''); - rgb = rgb.split(','); - var r = parseInt(rgb[0]); - var g = parseInt(rgb[1]); - var b = parseInt(rgb[2]); - if (delta > 0) { - r += vel; - g += vel; - b += vel - } else { - r -= vel; - g -= vel; - b -= vel - } - var newcolor; - if (r > 255) newcolor = 'rgb(255,255,255)'; else if (r < 0) newcolor = 'rgb(0,0,0)'; else newcolor = 'rgb(' + r + ',' + g + ',' + b + ')'; - $(this).css('background-color', newcolor); - $('.mceIframeContainer').css('background-color', newcolor); - return false - }).css('background-color', 'rgb(255,255,255)') -}; -folderLoader = function (type) { - var folderIframe; - try { - folderIframe = document.createElement('') - } catch (ex) { - folderIframe = document.createElement('iframe') - } - $(folderIframe).attr({ - id: 'neoCMSFolderFrame', - name: 'neoCMSFolderFrame', - src: 'core/folderload.php?type=' + type, - application: 'yes' - }).css('display', 'none').appendTo('body') -}; -folderOption = function (path, type) { - if (type == 'img') $('#neoCMSImgFolder').append($('').html(path).val(path)); else $('#neoCMSFolder').append($('').html(path).val(path)) -}; -destroyFolderLoader = function () { - $('#neoCMSFolderFrame').remove(); - $('#neoCMSImgFolderDefault, #neoCMSFolderDefault').html('Please select a folder') -}; -fixImgs = function (paste) { - var tinyDoc = getTinyDoc(); - $('img', tinyDoc).each(function () { - var eleSrc = $(this, tinyDoc).attr('_mce_src') || $(this, tinyDoc).attr('src'), - eleSrc = (paste) ? eleSrc.replace(/^(\.\.\/)/, '') : eleSrc.replace(/^(\/)/, ''), - eleSrc = (eleSrc.match(/^http(s*):\/\//)) ? eleSrc : fpath() + eleSrc; - $(this, tinyDoc).attr('src', eleSrc) - }) -}; -destroyIcons = function () { - $('.neoCMSIcon, .neoCMSRepIcon', ifrDoc).remove() -}; -eleHTML = function (ele) { - var vid = $(ele, ifrDoc).clone().wrap($('', ifrDoc)), vidHTML = $(vid, ifrDoc).parent().html(), - vidHTML = cleanContent(vidHTML, true); - return vidHTML -}; -createTextArea = function (ele) { - if (!$('#neoCMSEditWrap').length) { - hideFlash(); - $(ele, ifrDoc).addClass('neoCMSEle').css('visibility', 'hidden'); - $('body').prepend($('').attr('id', 'neoCMSEditWrapTemp').load('templates/editor.html', function () { - $('#neoCMSEditWrapTemp').replaceWith($('#neoCMSEditWrapTemp').html()); - var neoCMSEditContent = $('', ifrDoc).addClass('neoCMSEditContent').attr('id', 'neoCMSEditContent').append($(ele, ifrDoc).clone().attr({ - neocmsid: $(ele, ifrDoc).attr('neocmsid'), - style: 'float: none !important; visibility: visible; position: relative !important; margin: 0 !important; top: 0 !important; left: 0 !important; *zoom: 1; overflow: hidden;' - }).addClass($(ele, ifrDoc).attr('class')).removeClass('neocms').removeClass('neoCMSEle').removeClass('neoCMSEditArea').find('.neoCMSFlash').removeClass('neoCMSFlash').end().find('a.neoCMSRepCopyDrag, a.neoCMSRepDelete').remove().end().find('*').enableSelection().end()); - var c = 0, bp = parentBP(ele, false), t = ($(ele, ifrDoc)[0].tagName.match(/(h[0-9]|p)/i)) ? false : true, - html5 = 'abbr article aside audio canvas details figcaption figure footer header hgroup mark meter nav output progress section summary time video'; - if ((!html5.match($(ele, ifrDoc)[0].tagName) && $.browser.msie) || !$.browser.msie) { - $(ele, ifrDoc).parents().not('body,html').each(function () { - var styles = 'margin: 0 !important; width: auto !important; height: auto !important; float: none !important; position: relative !important; top: 0 !important; left: 0 !important; border: none !important; -moz-box-shadow: 0 !important; -webkit-box-shadow: 0 !important; box-shadow: 0 !important;'; - if (c == 0) { - styles += ' padding: 20px !important;'; - if (bp.img) { - bp.left += 20; - bp.top += 20; - styles += ' background-position: ' + bp.left + 'px ' + bp.top + 'px !important;' - } - } else { - styles += ' padding: 0 !important;'; - if (bp.img) styles += ' background-position: ' + bp.left + 'px ' + bp.top + 'px !important;' - } - bp = parentBP(this, bp); - $(neoCMSEditContent, ifrDoc).wrapInner($(this, ifrDoc).clone().empty().addClass('clearfix').attr('style', styles).removeAttr('neocmsid')); - c++ - }) - } else neoCMSEditContent = neoCMSEditContent.innerHTML; - var neoCMSDumm = $('', ifrDoc).append(neoCMSEditContent); - $('#neoCMSEditWrap').css('opacity', '0').html($('#neoCMSEditWrap').html() + $(neoCMSDumm, ifrDoc).html()); - tinyMCEBuilder(ele, t) - })) - } -}; -parentBP = function (t, bp) { - var par = $(t, ifrDoc).parent()[0]; - if (!bp) { - bp = {top: 0, left: 0, offleft: 0, offtop: 0, img: false} - } - var off = $(t, ifrDoc).offset(), offpar = $(par, ifrDoc).offset(), - pbp = getCurStyle($(par, ifrDoc)[0], 'background-position').split(' '), l = '', t = '', loff = '', toff = ''; - loff = 0 - (off.left - offpar.left); - toff = 0 - (off.top - offpar.top); - if (!pbp[0].match(/%/) || pbp[0] == '0%') l = bp.offleft + loff; else { - var p = 0.01 * parseInt(pbp[0]); - l = Math.round(p * (loff * -1)) - } - if (pbp[1] && (!pbp[1].match(/%/) || pbp[1] == '0%')) t = bp.offtop + toff; else { - var p = 0.01 * parseInt(pbp[1]); - t = Math.round(p * (toff * -1)) - } - var bp = { - left: l, - top: t, - offleft: bp.offleft + loff, - offtop: bp.offtop + toff, - img: (par.tagName != 'BODY' && getCurStyle(par, 'background-image') != 'none') ? true : false - }; - return bp -}; -tinyMCEBuilder = function (ele, t) { - var tools = null, blocks = "p,pre,blockquote,h1,h2,h3,h4,h5,h6,dd,dt", - blockreg = new RegExp('^(' + blocks.replace(/,/gi, '|') + ')$', 'i'); - brs = (ele.tagName.match(blockreg)) ? true : false; - tinyMCE.init({ - mode: "exact", - theme: "advanced", - plugins: "deflist,file,video,images,links,paste,tables", - theme_advanced_buttons1: (!t) ? ((neoCMSFiles == 'Y') ? 'bold,italic,link,image,file' : 'bold,italic,link,image') : ((neoCMSFiles == 'Y') ? 'formatselect,bold,italic,link,image,video,file,bullist,numlist,deflist,table' : 'formatselect,bold,italic,link,image,video,bullist,numlist,deflist,table'), - theme_advanced_buttons2: "", - theme_advanced_buttons3: "", - theme_advanced_buttons4: "", - theme_advanced_blockformats: blocks, - theme_advanced_toolbar_location: "top", - theme_advanced_toolbar_align: "left", - height: 'auto', - width: 'auto', - apply_source_formatting: true, - remove_linebreaks: true, - entity_encoding: '', - cleanup: true, - cleanup_on_startup: ($.browser.msie) ? false : true, - remove_trailing_nbsp: true, - use_native_selects: true, - extended_valid_elements: "@[neocmsid|id|dir|class|style],li,dt,dd,div,abbr,article,aside,audio,canvas,datalist,details,figure,figcaption,footer,header,hgroup,mark,menu,meter,nav,output,progress,section,summary,time,video,pre,code", - invalid_elements: "script", - skin: "default", - convert_urls: false, - elements: "neoCMSEditContent", - verify_html: true, - object_resizing: false, - auto_resize: false, - paste_auto_cleanup_on_paste: true, - setup: function (ed) { - ed.onPaste.add(function (ed, e) { - setTimeout(function () { - fixImgs(true) - }, 100) - }) - }, - oninit: "tinyInit" - }); - tinyInit = function () { - var tinyDoc = getTinyDoc(); - editorStyles(tinyDoc); - if ($('body', ifrDoc).attr('class')) $('body', tinyDoc).addClass($('body', ifrDoc).attr('class')); - if ($('body', ifrDoc).attr('id')) $('body', tinyDoc).attr('id', $('body', ifrDoc).attr('id')); - if (neoCMSHTMLEdit == 'Y') { - $('').attr({ - id: 'neoCMSEditHTML', - href: 'javascript:', - title: 'View and edit the HTML' - }).html('html').prependTo('td.mceToolbar') - } - $('#neoCMSEditContent_toolbar1 a').each(function () { - $(this).find('span').html($(this).attr('id').replace('neoCMSEditContent_', '')) - }); - if ($.browser.msie) ieBind(); - contrast(); - editorCleanUp(); - keyHandler(); - setTimeout(windowOrient, 0) - } -}; -ieBind = function () { - var tinyDoc = getTinyDoc(); - $('#neoCMSEditContent_ifr').attr('allowTransparency', 'true').css({background: 'transparent'}); - $('[neocmsid]', $('body', tinyDoc)).bind('mousedown', function (e) { - getInnerEle(e) - }) -}; -getInnerEle = function (e) { - var tinyDoc = getTinyDoc(), range = tinyDoc.body.createTextRange(); - range.moveToElementText($(e.target, tinyDoc)[0]); - range.collapse(false); - range.select(); - $('[neocmsid]', tinyDoc).unbind('mousedown').bind('blur', function (e) { - $(this, tinyDoc).bind('mousedown', function (e) { - getInnerEle(e) - }) - }).find('*').unbind('mousedown').bind('blur', function (e) { - $(this, tinyDoc).bind('mousedown', function (e) { - getInnerEle(e) - }) - }) -}; -tinyEvents = function (e) { - var tinyDoc = getTinyDoc(); - if (e.type == 'paste') { - e.stopPropagation() - } -}; -createUndo = function (ele) { - if (!$('#neoCMSGlobalUndo').length) { - $('').attr('id', 'neoCMSGlobalUndo').appendTo('body'); - $('').attr('id', 'neoCMSUndoNum' + undoC).appendTo('#neoCMSGlobalUndo'); - $('#neoCMSUndoNum' + undoC).html($('', ifrDoc).append($(ele, ifrDoc).clone().addClass('neoCMSEle' + undoC)).html()) - } else { - if (!$('#neoCMSUndoNum' + undoC).length) { - $('').attr('id', 'neoCMSUndoNum' + undoC).appendTo('#neoCMSGlobalUndo'); - $('#neoCMSUndoNum' + undoC).html($('', ifrDoc).append($(ele, ifrDoc).clone().addClass('neoCMSEle' + undoC)).html()) - } else { - $('#neoCMSUndoNum' + undoC).html(''); - $('#neoCMSUndoNum' + undoC).html($('', ifrDoc).append($(ele, ifrDoc).clone().addClass('neoCMSEle' + undoC)).html()) - } - } -}; -createRedo = function (neoCMSUndoEle) { - if (!$('#neoCMSGlobalRedo').length) { - $('').attr('id', 'neoCMSGlobalRedo').appendTo('body'); - $('').attr('id', 'neoCMSRedoNum' + undoC).appendTo('#neoCMSGlobalRedo'); - $('#neoCMSRedoNum' + undoC).html($('', ifrDoc).append($(neoCMSUndoEle, ifrDoc).clone()).html()) - } else { - if (!$('#neoCMSRedoNum' + undoC).length) { - $('').attr('id', 'neoCMSRedoNum' + undoC).appendTo('#neoCMSGlobalRedo'); - $('#neoCMSRedoNum' + undoC).html($('', ifrDoc).append($(neoCMSUndoEle, ifrDoc).clone()).html()) - } else { - $('#neoCMSRedoNum' + undoC).html(''); - $('#neoCMSRedoNum' + undoC).html($('', ifrDoc).append($(neoCMSUndoEle, ifrDoc).clone()).html()) - } - } - $('#neoCMSRedo').css('opacity', '1.0').find('a').attr('title', 'Redo last action').bind('click', redo) -}; -showPrompt = function (noDrag, noAnim) { - hideFlash(); - if (!noAnim) { - $('#neoCMSPrompt:hidden').css({display: "block", opacity: "0"}).fadeTo(300, 1.0, function () { - if ($.browser.msie) $(this, ifrDoc)[0].style.removeAttribute('filter') - }) - } else $('#neoCMSPrompt:hidden').css('display', 'block'); - if ($('#neoCMSPromptCancel').length) $('#neoCMSPromptCancel').bind('click', cancel); - if (!$('#neoCMSEditWrap').length) keyHandler(); else { - $(document).unbind('keydown'); - $('#neoCMSPrompt input:first, #neoCMSPrompt textarea:first').focus(); - keyHandler() - } - if (!noDrag) dragOn($('#neoCMSPrompt')[0], $('#neoCMSPromptTitle, #neoCMSPromptTop')); - if ($('#neoCMSEditWrap').length) overlay(null) -}; -getEd = function () { - if ($('#neoCMSEditWrap').length) { - if (tinyMCE.activeEditor.selection.getNode().tagName == 'IMG' || tinyMCE.activeEditor.selection.getNode().tagName == 'EMBED' || tinyMCE.activeEditor.selection.getNode().tagName == 'OBJECT') return tinyMCE.activeEditor.selection.getNode(); else return false - } else return false -}; -imageEditBuilder = function (ele) { - if (getTinyDoc()) getBookmark('simple'); - if (!$('#neoCMSPromptWrap').length) { - $('body').append($('').attr('id', 'neoCMSPromptWrap').load('templates/image-editor.html', function () { - if (ele) { - $(ele, ifrDoc).addClass('neoCMSEle'); - $('#neoCMSImgAltTxt').val($(ele, ifrDoc).attr('alt')); - var neoCMSEleClass = $(ele, ifrDoc).attr('class').replace(/(?:\s)*\b(neocms|neoCMSEle|neoCMSEle[0-9]+|neocmsRepeat|neoCMSEditArea)\b(?:\s)*/gi, ''); - $('#neoCMSImgClass').val(neoCMSEleClass); - if (ele.parentNode.tagName == 'A') { - $('#neoCMSImgLink').val($(ele.parentNode, ifrDoc).attr('href')); - $('#neoCMSImgRel').val($(ele.parentNode, ifrDoc).attr('rel')) - } - $('#neoCMSPromptBtn').attr('title', 'Apply these changes').html('done').bind('click', function () { - if ($(ele, ifrDoc).attr('class').match(/neocmsRepeat\b/g)) repImageDone(ele); else imageDone(ele) - }); - imageStatBuilder(ele) - } else { - var ed = getEd(); - if (ed) { - $('#neoCMSImgAltTxt').val($(ed).attr('alt')); - $('#neoCMSImgClass').val($(ed).attr('class')); - if (ed.parentNode.tagName == 'A') { - $('#neoCMSImgLink').val($(ed.parentNode).attr('href')); - $('#neoCMSImgRel').val($(ed.parentNode).attr('rel')) - } - imageStatBuilder(ed) - } else { - $('#neoCMSPromptTitle').html('Insert Image'); - imageStatBuilder() - } - } - folderLoader('img'); - showPrompt() - })) - } -}; -origImgSet = function (ele) { - var ed = getEd(), ele = (ed) ? ed : (ele) ? ele : $('[neocmsid]', getTinyDoc())[0]; - var elePad = { - t: parseInt(getCurStyle(ele, 'padding-top')), - r: parseInt(getCurStyle(ele, 'padding-right')), - l: parseInt(getCurStyle(ele, 'padding-left')), - b: parseInt(getCurStyle(ele, 'padding-bottom')) - }; - origImg = {width: ele.offsetWidth - elePad.l - elePad.r, height: ele.offsetHeight - elePad.t - elePad.b} -}; -imageStatBuilder = function (ele, fileSize) { - var origSize = true; - if ($('#neoCMSImgStatArea').length) { - origSize = ($('#neoCMSOrigSize:checked').length) ? true : false; - $('#neoCMSImgStatArea').remove() - } - if (ele) { - var eleSrc = $(ele, ifrDoc).attr('src'), - eleSrc = (eleSrc.match(/^http(s*):\/\//)) ? eleSrc : fpath() + eleSrc.replace(/^(\/)/, ''), - imgName = eleSrc.split('/'), imgName = imgName[imgName.length - 1], - statArea = '' + imgName + '' + eleSrc + 'Resize image to fitwidth:height:Keep proportions'; - $('').addClass('neoCMSImgStatArea clearfix').attr('id', 'neoCMSImgStatArea').html(statArea).insertAfter('#neoCMSImgChoose'); - $('ul.neoCMSImgProperties').css('display', 'inline'); - $('#neoCMSPrompt').addClass('neoCMSImgVidSelect'); - if (fileSize) { - $('#neoCMSImgStats').prepend($('').attr('id', 'neoCMSImgSize').html('file size:').prepend($(''))); - if (fileSize.length > 3) $('#neoCMSImgSize span').html(fileSize.slice(0, fileSize.length - 3) + ' kb'); else $('#neoCMSImgSize span').html(fileSize + ' bytes') - } - var eleIns = ($('img.neoCMSEle', ifrDoc).length || getEd()) ? ele : false; - if (!$('img.neoCMSEle', ifrDoc).length) { - if ($('#neoCMSPromptBtn').html() == 'apply') $('#neoCMSPromptBtn').attr('title', 'Insert image').html('insert'); - $('#neoCMSPromptBtn').unbind('click').bind('click', function () { - imageInsert() - }) - } - $('#neoCMSApplyBtn').css('display', 'block'); - if ($(ele, ifrDoc).attr('id') != 'neoCMSUploadImgClone') origImgSet(ele); else if ($('.neoCMSEle', ifrDoc).length) origImgSet($('.neoCMSEle', ifrDoc)[0]); else origImgSet($('[neocmsid]', getTinyDoc())[0]); - if (origImg) imageOrigSize(ele); else imageOrigSize() - } else { - $('#neoCMSPrompt').removeClass('neoCMSImgVidSelect'); - $('ul.neoCMSImgProperties').css('display', 'none'); - $('#neoCMSPromptBtn').attr('title', 'Insert new image').html('apply').bind('click', imageSrc); - $('#neoCMSApplyBtn').css('display', 'none'); - imageBind() - } -}; -imageOrigSize = function (ele) { - $('#neoCMSOrigSize').unbind('click').bind('click', function () { - imageOrigSize(ele) - }); - if ($('#neoCMSOrigSize:checked').length) { - var eleHeight = origImg.height; - if ($('#neoCMSUploadImgClone', ifrDoc).length) { - var cloneWidth = $('#neoCMSUploadImgClone', ifrDoc)[0].offsetWidth, - cloneHeight = $('#neoCMSUploadImgClone', ifrDoc)[0].offsetHeight; - eleHeight = parseInt(cloneHeight) * (parseInt(origImg.width) / parseInt(cloneWidth)); - eleHeight = Math.round(eleHeight) - } - $('#neoCMSImgStatsWidth').replaceWith($('').attr({ - name: 'neoCMSImgStatsWidth', - id: 'neoCMSImgStatsWidth', - type: 'text', - disabled: 'disabled' - }).css({backgroundColor: '#bbb', color: '#666'}).val(origImg.width)); - $('#neoCMSImgStatsHeight').replaceWith($('').attr({ - name: 'neoCMSImgStatsHeight', - id: 'neoCMSImgStatsHeight', - type: 'text', - disabled: 'disabled' - }).css({backgroundColor: '#bbb', color: '#666'}).val(eleHeight)); - $('.neoCMSConstrainLabel').css('color', '#666').find('input').attr({disabled: 'disabled', checked: 'checked'}) - } else { - var hVal = $('#neoCMSImgStatsHeight').val(), wVal = $('#neoCMSImgStatsWidth').val(); - $('#neoCMSImgStatsWidth').replaceWith($('').attr({ - name: 'neoCMSImgStatsWidth', - id: 'neoCMSImgStatsWidth', - type: 'text' - })); - $('#neoCMSImgStatsHeight').replaceWith($('').attr({ - name: 'neoCMSImgStatsHeight', - id: 'neoCMSImgStatsHeight', - type: 'text' - })); - if ($('#neoCMSUploadImgClone', ifrDoc).length) { - $('#neoCMSImgStatsWidth').val($('#neoCMSUploadImgClone', ifrDoc)[0].offsetWidth); - $('#neoCMSImgStatsHeight').val($('#neoCMSUploadImgClone', ifrDoc)[0].offsetHeight) - } else { - $('#neoCMSImgStatsWidth').val(wVal); - $('#neoCMSImgStatsHeight').val(hVal) - } - $('.neoCMSConstrainLabel').css('color', '#ccc').find('input').removeAttr('disabled') - } - imageConstrain(ele); - imageBind() -}; -imageConstrain = function (ele) { - $('#neoCMSConstrain').unbind('click').bind('click', function () { - imageConstrain(ele) - }); - if ($('#neoCMSConstrain:checked').length && !$('#neoCMSOrigSize:checked').length) { - $('#neoCMSImgStatsWidth, #neoCMSImgStatsHeight').bind('keyup', function () { - var field = (this.id == 'neoCMSImgStatsWidth') ? 'neoCMSImgStatsWidth' : 'neoCMSImgStatsHeight'; - changeSize(field, ele) - }) - } else { - $('#neoCMSImgStatsWidth, #neoCMSImgStatsHeight').unbind('keyup') - } -}; -changeSize = function (f, ele) { - var ele = (ele) ? ele : $('.neoCMSEle', ifrDoc)[0], fval = $('#' + f).val(), - fWidth = $('#neoCMSImgStatsWidth').val(), fHeight = $('#neoCMSImgStatsHeight').val(); - if ($('#neoCMSUploadImgClone', ifrDoc).length) ele = $('#neoCMSUploadImgClone', ifrDoc); - var eleWidth = $(ele, ifrDoc).width(); - var eleHeight = $(ele, ifrDoc).height(); - var eleRatio = (f == 'neoCMSImgStatsHeight') ? eleWidth / eleHeight : eleHeight / eleWidth; - if ((fWidth / fHeight) != eleRatio) { - var f2 = (f == 'neoCMSImgStatsHeight') ? 'neoCMSImgStatsWidth' : 'neoCMSImgStatsHeight'; - var size = $('#' + f).val() * eleRatio; - size = Math.round(size); - $('#' + f2).val(size) - } -}; -imageBind = function () { - imageRel(); - $('#neoCMSImgLink').unbind('keyup').bind('keyup', imageRel); - fBrowseBind(); - $('#neoCMSImgUpload').unbind('change').bind('change', function () { - imageLoader(false) - }); - $('#neoCMSApplyBtn').unbind('click').bind('click', imageSrc) -}; -imageRel = function () { - if ($('#neoCMSImgLink').val() != '') $('.neoCMSImgRel').removeClass('disabled').find('input').removeAttr('disabled'); else $('.neoCMSImgRel').addClass('disabled').find('input').attr('disabled', 'disabled') -}; -imageLoader = function (over) { - if ($('#neoCMSImgUpload').val() != '') { - $('#neoCMSImgUploadAlert').remove(); - $('#neoCMSImgAddress').val('http://'); - $('#neoCMSImgStatArea').css('min-height', $('#neoCMSImgStatArea').height()).addClass('neoCMSUploadingImg').find('*').css('display', 'none'); - var imgIframe; - try { - imgIframe = document.createElement('') - } catch (ex) { - imgIframe = document.createElement('iframe') - } - $(imgIframe).attr({ - id: 'neoCMSImgUploadIframe', - name: 'neoCMSImgUploadIframe', - application: 'yes' - }).appendTo('body'); - if (over) $('#neoCMSImgLoc').attr('action', 'core/upload.php?type=img&over=true'); - $('#neoCMSImgLoc')[0].submit() - } -}; -imageOverwritePrompt = function () { - $('').addClass('neoCMSUploadAlert neoCMSPromptAlert').attr('id', 'neoCMSUploadAlert').html('This file already exists. overwrite · find · cancel').insertAfter('#neoCMSPromptTitle').css({ - backgroundColor: '#fff8dd', - color: '#333' - }).fadeTo(300, 1.0); - $('#neoCMSFileOver').bind('click', function () { - imageLoader(true) - }); - $('#neoCMSFileCancel').bind('click', function () { - imageOverwriteCancel(); - imageStatBuilder() - }); - $('#neoCMSFileFind').bind('click', function () { - imageOverwriteCancel(); - linkFiles('#neoCMSImgAddress') - }) -}; -imageOverwriteCancel = function () { - $('#neoCMSImgUpload').val(''); - $('#neoCMSUploadAlert, #neoCMSImgUploadIframe').remove(); - $('#neoCMSImgLoc').attr('action', 'core/upload.php?type=img') -}; -imageSrc = function () { - if ($('#neoCMSImgAddress').val() != '' && $('#neoCMSImgAddress').val() != 'http://') { - $('#neoCMSUploadImgClone', ifrDoc).remove(); - $('#neoCMSImgUploadAlert').remove(); - $('#neoCMSImgChoose').addClass('neoCMSImgChooseInline'); - $('#neoCMSImgUpload').val(''); - $('body', ifrDoc).append($('', ifrDoc).attr({ - src: $('#neoCMSImgAddress').val(), - id: 'neoCMSUploadImgClone' - })); - setTimeout(function () { - imageStatBuilder($('#neoCMSUploadImgClone', ifrDoc)[0]) - }, 100) - } -}; -imageInfo = function (fileSize, fileWidth, fileHeight, alertText, name, imgPath) { - setTimeout(function () { - if ($('#neoCMSPrompt').length) { - $('#neoCMSUploadImgClone', ifrDoc).remove(); - $('#neoCMSImgUploadAlert').remove(); - if (alertText.match(/successfully/gi)) { - if (name != '') { - var imgPathName = (fpath() != '/') ? fpath() + imgPath + name : imgPath + name; - $('body', ifrDoc).append($('', ifrDoc).attr({ - src: imgPathName, - id: 'neoCMSUploadImgClone', - height: fileHeight, - width: fileWidth - })); - imageStatBuilder($('#neoCMSUploadImgClone', ifrDoc)[0], fileSize) - } - $('').addClass('neoCMSImgUploadAlert neoCMSPromptAlert').attr('id', 'neoCMSImgUploadAlert').html(alertText).insertAfter('#neoCMSPromptTitle').css('background-color', '#82ac3f').fadeTo(300, 1.0) - } else { - $('#neoCMSImgStatArea').removeClass('neoCMSUploadingImg').find('*').css('display', 'block'); - $('').addClass('neoCMSImgUploadAlert neoCMSPromptAlert').attr('id', 'neoCMSImgUploadAlert').html(alertText).insertAfter('#neoCMSPromptTitle').css('background-color', '#c6242b').fadeTo(300, 1.0) - } - } - $('#neoCMSImgUpload').val(''); - $('#neoCMSUploadAlert').remove(); - $('#neoCMSImgLoc').attr('action', 'core/upload.php?type=img'); - $('#neoCMSImgUploadIframe').remove() - }, 100) -}; -imageDone = function (ele) { - var imgClassReg = new RegExp('((\s)*\bneoCMSEle\b(\s)*|(\s)*\bneoCMSEle[0-9]+\b(\s)*)', 'gi'), - eleEditNum = $(ele, ifrDoc).attr('neocmsid').replace('neoCMSEditArea', ''), - imgSrc = $('#neoCMSImgStatArea img').attr('src'), imgClass = $('#neoCMSImgClass').val(), neoCMSImgClass = null; - if ($('#neoCMSImgClass').val() != '') neoCMSImgClass = $('#neoCMSImgClass').val() + ' neocms'; else neoCMSImgClass = 'neocms'; - var content = "src::" + imgSrc + ",alt::" + $('#neoCMSImgAltTxt').val() + ",class::" + neoCMSImgClass + ",width::" + $('#neoCMSImgStatsWidth').val() + ",height::" + $('#neoCMSImgStatsHeight').val() + ",link::" + $('#neoCMSImgLink').val() + ",rel::" + $('#neoCMSImgRel').val(); - $(ele, ifrDoc).addClass('neoCMSEle' + undoC); - createUndo(ele); - var imgAttr = { - src: imgSrc, - alt: $('#neoCMSImgAltTxt').val(), - width: $('#neoCMSImgStatsWidth').val(), - height: $('#neoCMSImgStatsHeight').val() - }; - var newImg = $(ele, ifrDoc).clone().addClass(imgClass).attr(imgAttr); - if ($('#neoCMSImgLink').val() != $(ele.parentNode, ifrDoc).attr('href')) $(ele.parentNode, ifrDoc).attr({href: $('#neoCMSImgLink').val()}); - if ($('#neoCMSImgRel').val() && $('#neoCMSImgRel').val() != $(ele.parentNode, ifrDoc).attr('rel')) $(ele.parentNode, ifrDoc).attr({rel: $('#neoCMSImgRel').val()}); - $(ele, ifrDoc).replaceWith(newImg); - if (!$('#neoCMSEditTA' + eleEditNum, ifrDoc).length) { - $('#neoCMSPageEdits', ifrDoc).append($('', ifrDoc).addClass('edit').attr({ - name: 'editImg' + eleEditNum, - id: 'neoCMSEditTA' + eleEditNum, - rows: '1', - cols: '1' - })); - if (typeof (document.textContent) != 'undefined') $('#neoCMSEditTA' + eleEditNum, ifrDoc)[0].textContent = content; else $('#neoCMSEditTA' + eleEditNum, ifrDoc)[0].innerText = content - } else { - if (typeof (document.textContent) != 'undefined') $('#neoCMSEditTA' + eleEditNum, ifrDoc)[0].textContent = content; else $('#neoCMSEditTA' + undoC, ifrDoc)[0].innerText = content - } - undoC++; - redoOff(); - origImg = null; - cancel() -}; -imageInsert = function () { - var tinyDoc = getTinyDoc(), ed = getEd(), imgSrc = $('#neoCMSImgStatArea img').attr('src'), - content = ''; - if (ed) { - if ($('#neoCMSImgLink').val()) { - if ($(ed, tinyDoc).parent('a').length) { - $(ed, tinyDoc).parent('a').attr('href', $('#neoCMSImgLink').val()); - if ($('#neoCMSImgRel').val()) $(ed, tinyDoc).parent('a').attr('rel', $('#neoCMSImgRel').val()) - } else { - conlink = ''; - content = conlink + content + '' - } - } - $(ed, tinyDoc).replaceWith(content) - } else { - if (tinyDoc) setBookmark(); - if ($('#neoCMSImgLink').val()) { - conlink = ''; - content = conlink + content + '' - } - tinyMCE.execCommand('mceInsertRawHTML', true, content, {skip_undo: 1}) - } - cancel() -}; -videoPrompt = function (ele) { - if (getTinyDoc()) getBookmark('simple'); - if (!$('#neoCMSPromptWrap').length) { - $(ele, ifrDoc).addClass('neoCMSEle'); - $('body').append($('').attr('id', 'neoCMSPromptWrap').load('templates/video-editor.html', function () { - if (ele) { - changeEmbed($(ele, ifrDoc)); - $('#neoCMSPromptTitle').html('Edit Video Embed'); - $('#neoCMSPromptBtn').bind('click', function () { - vidDone(ele) - }); - vidStatBuilder(ele) - } else { - if (getEd()) { - var tinyDoc = getTinyDoc(), ed = getEd(); - if ($(ed, tinyDoc).parent()[0].tagName == 'OBJECT') ed = $(ed, tinyDoc).parent(); - changeEmbed($(ed, tinyDoc)); - $('#neoCMSPromptTitle').html('Edit Video Embed'); - vidStatBuilder(ed) - } else { - vidStatBuilder() - } - } - showPrompt() - })) - } -}; -vidStatBuilder = function (ele) { - var ele = (ele != undefined) ? ele || $('#neoCMSVidClone', ifrDoc) : false, origSize = true, constrain = true; - if ($('#neoCMSOrigSize').length) { - origSize = ($('#neoCMSOrigSize:checked').length) ? true : false; - constrain = ($('#neoCMSConstrain:checked').length) ? true : false - } - $('#neoCMSVidStatArea').remove(); - if (ele) { - var eleSrc = ($(ele, ifrDoc).find('param[name=movie]').length) ? $(ele, ifrDoc).find('param[name=movie]').attr('value') : $(ele, ifrDoc).attr('src'), - src = '', vid = '', spl = eleSrc.split('/'), - eleW = parseInt($(ele, ifrDoc).attr('width')) || parseInt($(ele, ifrDoc).width()), - eleH = parseInt($(ele, ifrDoc).attr('height')) || parseInt($(ele, ifrDoc).height()); - if (eleSrc.match(/^http(s*):\/\//)) { - vid = 'via ' + spl[2].replace(/www\./, ''); - src = spl[spl.length - 1] - } else { - vid = spl[spl.length - 1]; - src = eleSrc - } - $('#neoCMSPrompt').addClass('neoCMSImgVidSelect'); - $('').addClass('neoCMSVidStatArea clearfix').attr('id', 'neoCMSVidStatArea').insertAfter('#neoCMSVidChoose'); - $('#neoCMSVidStatArea').append('' + vid + '' + src + '' + eleHTML(ele) + 'Resize embed to fitwidth:height:Keep proportions'); - $('#neoCMSEmbedWrap').html($('#neoCMSEmbedWrap').html().replace(/width=(\"|\')*[^\"\'\s]*(\"|\')*/g, 'width="145"').replace(/height=(\"|\')*[^\"\'\s]*(\"|\')*/g, 'height="' + (eleH * (145 / eleW) + 20) + '"')); - var eleIns = ($('object.neoCMSEle, embed.neoCMSEle', ifrDoc).length || getEd()) ? ele : false; - $('#neoCMSPromptBtn').attr('title', 'Insert new video').html('insert').bind('click', function () { - vidInsert(eleIns) - }); - if (origSize) $('#neoCMSOrigSize').attr('checked', 'checked'); - if (constrain) $('#neoCMSConstrain').attr('checked', 'checked'); - setTimeout(function () { - vidOrigSize() - }, 100) - } else { - $('#neoCMSPrompt').removeClass('neoCMSImgVidSelect'); - $('#neoCMSPromptBtn').attr('title', 'Load embed').html('apply').bind('click', vidClone); - $('#neoCMSApplyBtn').css('display', 'none'); - vidBind() - } -}; -changeEmbed = function (ele) { - $('#neoCMSVidEmbed').val(eleHTML(ele)) -}; -vidOrigSize = function () { - $('#neoCMSOrigSize').bind('click', vidOrigSize); - if ($('#neoCMSOrigSize:checked').length) { - var tinyDoc = getTinyDoc(), tinyEle = (tinyDoc) ? tinyMCE.activeEditor.selection.getNode() : null, - tinyEle = (tinyEle != null && tinyEle.tagName != 'EMBED' && tinyEle.tagName != 'OBJECT') ? $(tinyEle, tinyDoc).find('object')[0] || $(tinyEle, tinyDoc).find('embed')[0] : tinyEle, - ele = tinyEle || $('.neoCMSEle', ifrDoc)[0], elePadT = parseInt(getCurStyle(ele, 'padding-top')), - elePadR = parseInt(getCurStyle(ele, 'padding-right')), elePadL = parseInt(getCurStyle(ele, 'padding-left')), - elePadB = parseInt(getCurStyle(ele, 'padding-bottom')), - eleWidth = ($(ele, ifrDoc).attr('width')) ? parseInt($(ele, ifrDoc).attr('width')) : parseInt($(ele, ifrDoc).width()), - eleHeight = ($(ele, ifrDoc).attr('height')) ? parseInt($(ele, ifrDoc).attr('height')) : parseInt($(ele, ifrDoc).height()); - if (eleWidth == '' || eleWidth == '0') eleWidth = (ele.clientWidth) ? parseInt(ele.clientWidth) : parseInt(ele.offsetWidth); - if (eleHeight == '' || eleHeight == '0') eleHeight = (ele.clientHeight) ? parseInt(ele.clientHeight) : parseInt(ele.offsetHeight); - if (elePadT != 0) eleHeight = eleHeight - elePadT; - if (elePadB != 0) eleHeight = eleHeight - elePadB; - if (elePadR != 0) eleWidth = eleWidth - elePadR; - if (elePadL != 0) eleWidth = eleWidth - elePadL; - if ($('#neoCMSVidClone', ifrDoc).length) { - var cloneWidth = $('#neoCMSVidClone', ifrDoc).attr('width') || ($('#neoCMSVidClone', ifrDoc)[0].clientWidth) ? $('#neoCMSVidClone', ifrDoc)[0].clientWidth : $('#neoCMSVidClone', ifrDoc)[0].offsetWidth; - var cloneHeight = $('#neoCMSVidClone', ifrDoc).attr('height') || ($('#neoCMSVidClone', ifrDoc)[0].clientHeight) ? $('#neoCMSVidClone', ifrDoc)[0].clientHeight : $('#neoCMSVidClone', ifrDoc)[0].offsetHeight; - eleHeight = parseInt(cloneHeight) * (eleWidth / parseInt(cloneWidth)); - eleHeight = Math.round(eleHeight) - } - $('#neoCMSVidStatsWidth').replaceWith($('').attr({ - name: 'neoCMSVidStatsWidth', - id: 'neoCMSVidStatsWidth', - type: 'text', - disabled: 'disabled' - }).css({backgroundColor: '#bbb', color: '#666'})); - $('#neoCMSVidStatsHeight').replaceWith($('').attr({ - name: 'neoCMSVidStatsHeight', - id: 'neoCMSVidStatsHeight', - type: 'text', - disabled: 'disabled' - }).css({backgroundColor: '#bbb', color: '#666'})); - $('#neoCMSVidStatsWidth').val(eleWidth); - $('#neoCMSVidStatsHeight').val(eleHeight); - $('.neoCMSConstrainLabel').css('color', '#666').find('input').attr({disabled: 'disabled', checked: 'checked'}) - } else { - var hVal = $('#neoCMSVidStatsHeight').val(), wVal = $('#neoCMSVidStatsWidth').val(); - $('#neoCMSVidStatsWidth').replaceWith($('').attr({ - name: 'neoCMSVidStatsWidth', - id: 'neoCMSVidStatsWidth', - type: 'text' - })); - $('#neoCMSVidStatsHeight').replaceWith($('').attr({ - name: 'neoCMSVidStatsHeight', - id: 'neoCMSVidStatsHeight', - type: 'text' - })); - if ($('#neoCMSVidClone', ifrDoc).length) { - $('#neoCMSVidStatsWidth').val($('#neoCMSVidClone', ifrDoc)[0].offsetWidth); - $('#neoCMSVidStatsHeight').val($('#neoCMSVidClone', ifrDoc)[0].offsetHeight) - } else { - $('#neoCMSVidStatsWidth').val(wVal); - $('#neoCMSVidStatsHeight').val(hVal) - } - $('.neoCMSConstrainLabel').css('color', '#ccc').find('input').removeAttr('disabled') - } - vidBind(); - if ($('#neoCMSVidEmbed').length) { - $('#neoCMSVidEmbed').val($('#neoCMSVidEmbed').val().replace(/width=(\"|\')[^\"\']*(\"|\')/g, 'width="' + $('#neoCMSVidStatsWidth').val().replace(/px/, '') + '"').replace(/height=(\"|\')[^\"\']*(\"|\')/g, 'height="' + $('#neoCMSVidStatsHeight').val().replace(/px/, '') + '"')) - } -}; -vidClone = function () { - if ($('#neoCMSVidEmbed').val() != '') { - $('#neoCMSVidClone', ifrDoc).remove(); - var newVid = $('#neoCMSVidEmbed').val(); - newVid = $(newVid, ifrDoc).attr('id', 'neoCMSVidClone'); - $('body', ifrDoc).append(newVid); - vidStatBuilder($('#neoCMSVidClone', ifrDoc)) - } -}; -vidConstrain = function () { - $('#neoCMSConstrain').unbind('click').bind('click', vidConstrain); - if ($('#neoCMSConstrain:checked').length && !$('#neoCMSOrigSize:checked').length) { - $('#neoCMSVidStatsWidth, #neoCMSVidStatsHeight').bind('keyup', function () { - var field = $(this).attr('id'); - changeVidSize(field) - }) - } else { - $('#neoCMSVidStatsWidth, #neoCMSVidStatsHeight').unbind('keyup').bind('keyup', function () { - $('#neoCMSVidEmbed').val($('#neoCMSVidEmbed').val().replace(/width=(\"|\')[^\"\']*(\"|\')/g, 'width="' + $('#neoCMSVidStatsWidth').val().replace(/px/, '') + '"').replace(/height=(\"|\')[^\"\']*(\"|\')/g, 'height="' + $('#neoCMSVidStatsHeight').val().replace(/px/, '') + '"')) - }) - } -}; -changeVidSize = function (f) { - var tinyDoc = getTinyDoc(), tinyEle = (tinyDoc) ? tinyMCE.activeEditor.selection.getNode() : null, - tinyEle = (tinyEle != null && tinyEle.tagName != 'EMBED' && tinyEle.tagName != 'OBJECT') ? $(tinyEle, tinyDoc).find('object')[0] || $(tinyEle, tinyDoc).find('embed')[0] : tinyEle, - ele = $(tinyEle, tinyDoc)[0] || $('.neoCMSEle', ifrDoc)[0], fval = $('#' + f).val(), - fWidth = parseInt($('#neoCMSVidStatsWidth').val()), fHeight = parseInt($('#neoCMSVidStatsHeight').val()), - doc = (tinyDoc) ? tinyDoc : ifrDoc; - if ($('#neoCMSVidClone', ifrDoc).length) { - ele = $('#neoCMSVidClone', ifrDoc); - doc = ifrDoc - } - var eleWidth = parseInt($(ele, doc).attr('width')), eleHeight = parseInt($(ele, doc).attr('height')); - if (eleWidth == '' || eleWidth == '0') eleWidth = ($(ele, doc)[0].clientWidth) ? $(ele, doc)[0].clientWidth : $(ele, doc)[0].offsetWidth; - if (eleHeight == '' || eleHeight == '0') eleHeight = ($(ele, doc)[0].clientHeight) ? $(ele, doc)[0].clientHeight : $(ele, doc)[0].offsetHeight; - var eleRatio = (f == 'neoCMSVidStatsHeight') ? eleWidth / eleHeight : eleHeight / eleWidth; - if ((fWidth / fHeight) != eleRatio) { - var f2 = (f == 'neoCMSVidStatsHeight') ? 'neoCMSVidStatsWidth' : 'neoCMSVidStatsHeight'; - var size = $('#' + f).val() * eleRatio; - size = Math.round(size); - $('#' + f2).val(size) - } -}; -vidBind = function () { - vidConstrain(); - $('#neoCMSApplyBtn').unbind('click').bind('click', vidClone); - $('#neoCMSVidStatsWidth, #neoCMSVidStatsHeight').bind('keyup', function () { - $('#neoCMSVidEmbed').val($('#neoCMSVidEmbed').val().replace(/width=(\"|\')*[^\"\'\s]*(\"|\')*/g, 'width="' + $('#neoCMSVidStatsWidth').val().replace(/px/, '') + '"').replace(/height=(\"|\')*[^\"\'\s]*(\"|\')*/g, 'height="' + $('#neoCMSVidStatsHeight').val().replace(/px/, '') + '"')) - }) -}; -vidDone = function (ele) { - var eleEditNum = $(ele, ifrDoc).attr('neocmsid').replace('neoCMSEditArea', ''), - content = $('#neoCMSVidEmbed').val(); - createUndo(ele); - content = $(content, ifrDoc).addClass('neocms'); - var constring = eleHTML(content); - content = $(content, ifrDoc).addClass('neoCMSEle neoCMSEle' + undoC); - $(ele, ifrDoc).replaceWith($(content, ifrDoc)); - if (!$('#neoCMSEditTA' + eleEditNum, ifrDoc).length) { - $('#neoCMSPageEdits', ifrDoc).append($('', ifrDoc).addClass('edit').attr({ - name: 'editVid' + eleEditNum, - id: 'neoCMSEditTA' + eleEditNum, - rows: '1', - cols: '1' - })); - if (typeof (document.textContent) != 'undefined') $('#neoCMSEditTA' + eleEditNum, ifrDoc)[0].textContent = constring; else $('#neoCMSEditTA' + eleEditNum, ifrDoc)[0].innerText = constring - } else { - if (typeof (document.textContent) != 'undefined') $('#neoCMSEditTA' + eleEditNum, ifrDoc)[0].textContent = constring; else $('#neoCMSEditTA' + undoC, ifrDoc)[0].innerText = constring - } - undoC++; - $('#neoCMSGlobalRedo').remove(); - $('#neoCMSGlobalUndo div').each(function () { - var futureId = $(this).attr('id').replace('neoCMSUndoNum', ''); - if (futureId >= undoC) { - $(this).remove(); - $('.neoCMSEle' + i, ifrDoc).removeClass('neoCMSEle' + i); - $('.neoCMSEle' + i).removeClass('neoCMSEle' + i) - } - }); - $('.neoCMSEle' + (undoC - 1), ifrDoc).removeClass('neoCMSEle' + (undoC - 1)); - $('.neoCMSEle', ifrDoc).addClass('neoCMSEle' + (undoC - 1)); - neocmsGlobals(); - cancel() -}; -vidInsert = function (ed) { - var tinyDoc = getTinyDoc(), content = $('', tinyDoc).append($('#neoCMSVidEmbed').val()); - if (ed) { - if ($(ed, tinyDoc).parent()[0].tagName == 'OBJECT') ed = $(ed, tinyDoc).parent(); - $(ed, tinyDoc).replaceWith($(content, tinyDoc).html()) - } else { - if (tinyDoc) setBookmark(); - tinyMCE.execCommand('mceInsertContent', true, $(content, tinyDoc).html(), {skip_undo: 1}) - } - fixImgs(); - cancel() -}; -uploadPrompt = function () { - if (!$('#neoCMSPrompt').length) { - $('body').append($('').attr('id', 'neoCMSPromptWrap').load('templates/upload.html', function () { - $('#neoCMSPromptBtn, #neoCMSCancelBtn').bind('click', cancel); - folderLoader('file'); - showPrompt(); - $('#neoCMSPrompt input:first').focus(); - $('#neoCMSUpload').unbind('change').bind('change', function () { - fileLoader(false) - }) - })) - } -}; -fileLoader = function (over) { - if ($('#neoCMSUpload').val() != '') { - $('#neoCMSUploadAlert, #neoCMSFileInfo').remove(); - var fileIframe; - try { - fileIframe = document.createElement('') - } catch (ex) { - fileIframe = document.createElement('iframe') - } - $(fileIframe).attr({ - id: 'neoCMSUploadIframe', - name: 'neoCMSUploadIframe', - application: 'yes' - }).css('display', 'none').appendTo('body'); - if (over) $('#neoCMSUploadForm').attr('action', 'core/upload.php?over=true'); - $('#neoCMSUploadForm')[0].submit() - } -}; -fileInfo = function (fileSize, alertText, name, path) { - setTimeout(function () { - if ($('#neoCMSPrompt').length) { - $('#neoCMSUploadAlert, #neoCMSFileInfo').remove(); - if (alertText.match(/successfully/gi)) { - if (name != '') { - var pathName = path + name; - var size = (fileSize.length > 3) ? fileSize.slice(0, fileSize.length - 3) + ' kb' : fileSize + ' bytes'; - $('').attr('id', 'neoCMSFileInfo').addClass('neoCMSFileInfo').append('last upload:' + name + 'path: /' + path + '' + 'file size:' + size + '').insertAfter('#neoCMSPromptTitle'); - $('#neoCMSUploadTxt').html('To upload another file, select the folder you want to upload to:') - } - $('').addClass('neoCMSUploadAlert neoCMSPromptAlert').attr('id', 'neoCMSUploadAlert').html(alertText).insertAfter('#neoCMSPromptTitle').css('background-color', '#82ac3f').fadeTo(300, 1.0); - $('#neoCMSUpload').val('') - } else { - $('').addClass('neoCMSUploadAlert neoCMSPromptAlert').attr('id', 'neoCMSUploadAlert').html(alertText).insertAfter('#neoCMSPromptTitle').css('background-color', '#c6242b').fadeTo(300, 1.0) - } - } - $('#neoCMSUploadForm').attr('action', 'core/upload.php'); - $('#neoCMSUploadIframe').remove() - }, 100) -}; -filePrompt = function () { - $('').addClass('neoCMSUploadAlert neoCMSPromptAlert').attr('id', 'neoCMSUploadAlert').html('This file already exists. overwrite · cancel').insertAfter('#neoCMSPromptTitle').css({ - backgroundColor: '#fff8dd', - color: '#333' - }).fadeTo(300, 1.0); - $('#neoCMSFileOver').bind('click', function () { - fileLoader(true) - }); - $('#neoCMSFileCancel').bind('click', fileCancel) -}; -fileCancel = function () { - $('#neoCMSUpload').val(''); - $('#neoCMSUploadAlert').remove(); - $('#neoCMSUploadIframe').remove() -}; -defListBuilder = function () { - getBookmark('simple'); - var tinyDoc = getTinyDoc(), ed = tinyMCE.activeEditor.selection.getNode(), defStart = '', - con = $(ed, tinyDoc).html(), defEnd = ''; - $(ed, tinyDoc).replaceWith(defStart + con + defEnd); - setCaret($('#caret', tinyDoc)[0], tinyDoc) -}; -htmlPrompt = function () { - if (!$('#neoCMSPrompt').length) { - $('body').append($('').attr('id', 'neoCMSPromptWrap').load('templates/html-editor.html', function () { - var tinyDoc = getTinyDoc(), eleHTML = $('body', tinyDoc).find('[neocmsid]').html(); - eleHTML = cleanContent(eleHTML, true); - codeEditor = new CodeMirror(CodeMirror.replace("neoCMSHtmlEditAreaTA"), { - parserfile: ["parsexml.js", "parsecss.js", "tokenizejavascript.js", "parsejavascript.js", "parsehtmlmixed.js"], - path: "js/codemirror/js/", - stylesheet: "js/codemirror/css/xmlcolors.css", - height: Math.round($(window).height() * 0.6) + 'px', - width: '780px', - tabMode: "shift", - content: eleHTML - }); - $('#neoCMSPromptBtn').bind('click', function () { - htmlInsert(codeEditor) - }); - $('#neoCMSCancelBtn').bind('click', cancel); - $('a.fullscreen').unbind('click').bind('click', function () { - editorFullscreen($(this).attr('rel')) - }).removeClass('neoCMSMinimize').attr({title: 'Maximize this window'}).html('Maximize this window'); - $('.CodeMirror-wrapping').attr('id', 'neoCMSCodeWrap'); - showPrompt() - })) - } else { - $('#neoCMSPrompt, #neoCMSPromptContent').removeAttr('style'); - $('#neoCMSCodeWrap, #neoCMSHtmlEditAreaTA').width('780px').height(Math.round($(window).height() * 0.6)); - $('#neoCMSPrompt a.fullscreen').unbind('click').bind('click', function () { - editorFullscreen($(this).attr('rel')) - }).removeClass('neoCMSMinimize').attr({title: 'Maximize this window'}).html('Maximize this window'); - showPrompt(false, true) - } -}; -htmlInsert = function (codeEditor) { - var tinyDoc = getTinyDoc(), - content = ($('#neoCMSCodeWrap').length) ? codeEditor.getCode() : $('#neoCMSHtmlEditAreaTA').val(); - $('#neoCMSEditContent')[0].innerHTML = content; - $('body', tinyDoc).find('[neocmsid]')[0].innerHTML = content; - fixImgs(); - if ($.browser.msie) ieBind(); - $('#neoCMSEditContent_parent').css('display', 'block'); - cancel() -}; -makeTable = function () { - var tinyDoc = getTinyDoc(), ed = tinyMCE.activeEditor.selection.getNode(); - if (tinyDoc) getBookmark('simple'); - if (!$('#neoCMSPromptWrap').length) { - $('body').append($('').attr('id', 'neoCMSPromptWrap').load('templates/table-editor.html', function () { - $('#neoCMSTableRows').unbind('keyup').bind('keyup', insertRows).unbind('change').bind('change', function () { - if ($('#neoCMSTableRows').val() == '' || $('#neoCMSTableRows').val() == '0' || !$('#neoCMSTableRows').val().match(/^\d+$/)) { - $('#neoCMSTableRows').val('1'); - insertRows() - } - }); - $('#neoCMSTableCols').unbind('keyup').bind('keyup', insertCols).unbind('change').bind('change', function () { - if ($('#neoCMSTableCols').val() == '' || $('#neoCMSTableCols').val() == '0' || !$('#neoCMSTableCols').val().match(/^\d+$/)) { - $('#neoCMSTableCols').val('1'); - insertCols() - } - }); - $('#neoCMSTableThead').unbind('click').bind('click', insertThead); - $('#neoCMSTableTfoot').unbind('click').bind('click', insertTfoot); - $('#neoCMSTableID').unbind('keydown').bind('keydown', tableID); - $('#neoCMSTableClass').unbind('keydown').bind('keydown', function () { - $('#neoCMSTablePrev table').attr('class', $(this).val()) - }); - $('#neoCMSPrompt #neoCMSPromptBtn').unbind('click').bind('click', function () { - insertTable(ed) - }); - showPrompt() - })) - } -}; -insertRows = function () { - var r = Math.round($('#neoCMSTableRows').val()), rows = $('#neoCMSTablePrev tbody tr'); - if (r != '' && r != '0' && r != rows.length && r.toString().match(/^\d+$/)) { - var row = rows[0]; - $('#neoCMSTablePrev tbody tr').remove(); - while (r > '0') { - row = $(row).clone(); - $('#neoCMSTablePrev tbody').append(row[0]); - r-- - } - } -}; -insertCols = function () { - var c = Math.round($('#neoCMSTableCols').val()), cols = $('#neoCMSTablePrev tbody tr:first td'); - if (c != '' && c != '0' && c != cols.length && c.toString().match(/^\d+$/)) { - $('#neoCMSTablePrev tbody td').remove(); - $('#neoCMSTablePrev tbody tr').each(function () { - var n = c; - while (n > '0') { - $(this).append($('').html(' ')); - n-- - } - }); - insertThead(); - insertTfoot() - } -}; -insertThead = function () { - var cols = $('#neoCMSTablePrev tbody tr:first td'); - $('#neoCMSTablePrev thead').remove(); - if ($('#neoCMSTableThead:checked').length) { - $('#neoCMSTablePrev table').prepend(''); - cols.each(function () { - $('#neoCMSTablePrev thead tr').append($('').html(' ')) - }) - } -}; -insertTfoot = function () { - var cols = $('#neoCMSTablePrev tbody tr:first td'); - $('#neoCMSTablePrev tfoot').remove(); - if ($('#neoCMSTableTfoot:checked').length) { - $('#neoCMSTablePrev table').append(''); - cols.each(function () { - $('#neoCMSTablePrev tfoot tr').append($('').html(' ')) - }) - } -}; -tableID = function () { - if (!$('#neoCMSTableID').val().match(/\s/gi)) $('#neoCMSTablePrev table').attr('id', $('#neoCMSTableID').val()); else $('#neoCMSTableID').val($('#neoCMSTablePrev table').attr('id')) -}; -insertTable = function (ed) { - var tinyDoc = getTinyDoc(), con = $(ed, tinyDoc).html(); - $('#neoCMSTablePrev td:first').attr('id', 'caret').append(con).html(); - $(ed, tinyDoc).replaceWith($('#neoCMSTablePrev').html()); - setCaret($('#caret', tinyDoc)[0], tinyDoc); - cancel() -}; -makeLink = function () { - var tinyDoc = getTinyDoc(); - if (tinyDoc) getBookmark('simple'); - if (tinyMCE.activeEditor.selection.getNode().nodeName == 'A') var ed = tinyMCE.activeEditor.selection.getNode(); else if (tinyMCE.activeEditor.selection.getNode().parentNode.nodeName == 'A') var ed = tinyMCE.activeEditor.selection.getNode().parentNode; - if (!$('#neoCMSPrompt').length) { - $('body').append($('').attr('id', 'neoCMSPromptWrap').load('templates/link-editor.html', function () { - if (ed) { - $('#neoCMSPromptBtn').html('done').bind('click', function () { - linkReplace(ed) - }); - $('#neoCMSPromptTitle').html('Edit Link'); - $('#neoCMSLinkID').val($(ed, tinyDoc).attr('id')); - $('#neoCMSLinkURL').val($(ed, tinyDoc).attr('href')); - $('#neoCMSLinkClass').val($(ed, tinyDoc).attr('class')); - $('#neoCMSLinkTitle').val($(ed, tinyDoc).attr('title')); - $('#neoCMSLinkRel').val($(ed, tinyDoc).attr('rel')); - $('').addClass('neoCMSLinkRemove').prependTo('#neoCMSLinkProperties').append($('').attr({ - href: 'javascript:', - title: 'Unlink this selection' - }).html('remove this link').bind('click', function () { - linkRemove(ed) - })) - } else { - $('#neoCMSPromptBtn').html('insert').bind('click', linkInsert); - $('#neoCMSPromptTitle').html('Create Link') - } - $('#neoCMSCancelBtn').bind('click', cancel); - fBrowseBind(); - showPrompt() - })) - } -}; -linkInsert = function () { - var tinyDoc = getTinyDoc(), - newlink = (!$('#neoCMSLinkURL').val().match(/^http(s*):\/\/|@/)) ? fpath() + $('#neoCMSLinkURL').val() : $('#neoCMSLinkURL').val(); - if ($('#neoCMSLinkURL').val() != '' && $('#neoCMSLinkURL').val() != 'http://') { - $('#neoCMSLinkAlert').remove(); - setBookmark(); - var orig = tinyMCE.activeEditor.selection.getContent({format: 'text'}); - var ed = tinyMCE.activeEditor.selection.getNode(); - if ($(ed, tinyDoc)[0].tagName == 'IMG') { - var edCloneDiv = $('', tinyDoc).append($(ed, tinyDoc).clone()); - orig = $(edCloneDiv).html() - } - var linkContent = '' + orig + ''; - tinyMCE.execCommand('mceInsertContent', true, linkContent, {skip_undo: 1}); - cancel() - } else $('').addClass('neoCMSLinkAlert').attr('id', 'neoCMSLinkAlert').html('You must enter a URL').prependTo('#neoCMSLinkContent').fadeTo(300, 1.0); - $('a', tinyDoc).removeAttr('_mce_href') -}; -linkReplace = function (ed) { - var tinyDoc = getTinyDoc(), - newlink = (!$('#neoCMSLinkURL').val().match(/^http(s*):\/\/|@/)) ? fpath() + $('#neoCMSLinkURL').val() : $('#neoCMSLinkURL').val(); - if ($(ed, tinyDoc)[0].tagName == 'IMG') ed = $(ed, tinyDoc).parent(); - if (newlink != '' && newlink != 'http://') { - $(ed, tinyDoc).removeAttr('class'); - if ($('#neoCMSLinkClass').val()) $(ed, tinyDoc).addClass($('#neoCMSLinkClass').val()); - if (newlink != $(ed, tinyDoc).attr('href')) $(ed, tinyDoc).attr({href: newlink, _mce_href: newlink}); - if ($('#neoCMSLinkRel').val() != $(ed, tinyDoc).attr('rel')) $(ed, tinyDoc).attr({rel: $('#neoCMSLinkRel').val()}); - if ($('#neoCMSLinkID').val() != '') $(ed, tinyDoc).attr({id: $('#neoCMSLinkID').val()}); - $(ed, tinyDoc).attr('title', $('#neoCMSLinkTitle').val()); - cancel() - } else linkRemove(); - $('a', tinyDoc).removeAttr('_mce_href') -}; -linkRemove = function (ed) { - var edhtml = $(ed).html(); - $(ed).replaceWith(edhtml); - fixImgs(); - cancel() -}; -logoutPrompt = function () { - if ($('#neoCMSPageEdits textarea.edit', ifrDoc).length) { - overlay(); - if (!$('#neoCMSPrompt').length) { - $('body').append($('').attr('id', 'neoCMSPromptWrap').load('templates/prompt.html', function () { - $('#neoCMSPrompt h4.neoCMSPromptTitle').html('Logout'); - $('#neoCMSPrompt p').html('You have unpublished changes that will be lost. Do you still wish to log out?'); - $('#neoCMSPromptBtn').attr('title', 'logout').html('logout').bind('click', logout); - $('#neoCMSCancelBtn').bind('click', cancel); - showPrompt('nodrag') - })) - } - } else logout() -}; -logout = function () { - $.ajax({ - type: "POST", url: "functions/logout.php", success: function () { - window.location = retUrl() - } - }) -}; -restorePrompt = function () { - overlay(); - if (!$('#neoCMSPrompt').length) { - $('body').append($('').attr('id', 'neoCMSPromptWrap').load('templates/prompt.html', function () { - $('#neoCMSPrompt h4.neoCMSPromptTitle').html('Restore'); - $('#neoCMSPrompt p').html('Restore will change all files associated with this page back to their last published version. This cannot be undone. Do you still wish to restore?'); - $('#neoCMSPromptBtn').attr('title', 'Restore this page to last published version').html('restore').bind('click', restoreSubmit); - $('#neoCMSCancelBtn').bind('click', cancel); - showPrompt('nodrag'); - $('body', ifrDoc).append($('', ifrDoc).attr({ - name: 'neoCMSRestoreForm', - id: 'neoCMSRestoreForm', - action: neoCMSGlobalPath + '/core/restore.php', - method: 'POST', - target: 'neoCMSRestIframe' - }).css('display', 'none')) - })) - } -}; -restoreSubmit = function () { - $('#neoCMSPromptWrap').remove(); - var restoreIframe; - try { - restoreIframe = ifrDoc.createElement('') - } catch (ex) { - restoreIframe = ifrDoc.createElement('iframe') - } - $(restoreIframe, ifrDoc).attr({id: 'neoCMSRestIframe', name: 'neoCMSRestIframe', application: 'yes'}); - $('body', ifrDoc).append(restoreIframe); - $('#neoCMSRestoreForm', ifrDoc)[0].submit() -}; -cancelAllPrompt = function () { - overlay(); - if (!$('#neoCMSPrompt').length) { - $('body').append($('').attr('id', 'neoCMSPromptWrap').load('templates/prompt.html', function () { - $('#neoCMSPrompt h4.neoCMSPromptTitle').html('Cancel All'); - $('#neoCMSPrompt p').html('Are you sure you want to clear all changes since your last publish?'); - $('#neoCMSPromptBtn').attr('title', 'Clear all changes since last publish').html('clear').bind('click', cancelAllSubmit); - $('#neoCMSCancelBtn').bind('click', cancel); - showPrompt('nodrag') - })) - } -}; -cancelAllSubmit = function () { - $('#neoCMSPromptWrap').remove(); - ifrReload() -}; -done = function (ele) { - var eleEditNum = $(ele, ifrDoc).attr('neocmsid').replace('neoCMSEditArea', ''), tinyDoc = getTinyDoc(), - t = (ele.tagName.match(/(h[0-9]|p)/i)) ? false : true, - content = (!t && $('[neocmsid]', tinyDoc).find(ele.tagName).length) ? $('[neocmsid]', tinyDoc).parent().html() : $('[neocmsid]', tinyDoc).html(); - $(ele, ifrDoc).find('.neoCMSFlash').removeClass('neoCMSFlash'); - if (content) { - content = cleanContent(content, t); - var clone = $(ele, ifrDoc).clone(); - if ($(ele, ifrDoc)[0].tagName.match(/TR|THEAD|TBODY/)) clone.html(content); else clone[0].innerHTML = content; - $(ele, ifrDoc).replaceWith(clone) - } else $(ele, ifrDoc).html(' '); - createUndo(ele); - var ncon = cleanContent($('.neoCMSEle', ifrDoc).html(), t); - if (!$('#neoCMSEditTA' + eleEditNum, ifrDoc).length) { - $('', ifrDoc).addClass('edit').attr({ - name: 'edit' + eleEditNum, - id: 'neoCMSEditTA' + eleEditNum, - rows: '1', - cols: '1' - }).appendTo($('#neoCMSPageEdits', ifrDoc)); - if (typeof (document.textContent) != 'undefined') $('#neoCMSEditTA' + eleEditNum, ifrDoc)[0].textContent = ncon; else $('#neoCMSEditTA' + eleEditNum, ifrDoc)[0].innerText = ncon - } else { - if (typeof (document.textContent) != 'undefined') $('#neoCMSEditTA' + eleEditNum, ifrDoc)[0].textContent = ncon; else $('#neoCMSEditTA' + eleEditNum, ifrDoc)[0].innerText = ncon - } - undoC++; - redoOff(); - linkBind(); - cancel() -}; -undo = function () { - destroyIcons(); - if (undoC <= 0) undoC = 0; else undoC--; - var neoCMSUndoEle = '.neoCMSEle' + undoC; - if ($(neoCMSUndoEle, ifrDoc).length) { - createRedo(neoCMSUndoEle); - if ($(neoCMSUndoEle, ifrDoc)[0].tagName != 'IMG') { - var rep = $('#neoCMSGlobalUndo #neoCMSUndoNum' + undoC + ' ' + neoCMSUndoEle).find('a.neoCMSIcon').css({opacity: '1'}).end().html(); - $(neoCMSUndoEle, ifrDoc).replaceWith($(neoCMSUndoEle, ifrDoc).clone().html(rep)) - } else { - var rep = $('#neoCMSGlobalUndo #neoCMSUndoNum' + undoC).html(); - $(neoCMSUndoEle, ifrDoc).replaceWith(rep) - } - if ($(neoCMSUndoEle, ifrDoc).hasClass('neocmsRepeatArea')) { - var content = $(neoCMSUndoEle, ifrDoc).clone().find('.neoCMSPlaceholder').remove().end() - } else var content = $(neoCMSUndoEle, ifrDoc)[0]; - var eleEditNum = $(neoCMSUndoEle, ifrDoc).parent().attr('id').replace('neoCMSEditArea', ''); - changePageEdits(content, eleEditNum) - } - neocmsGlobals(); - if ($(neoCMSUndoEle, ifrDoc).attr('class').match(/neocmsRepeatArea/g)) { - neocmsRepBind(); - $('.neoCMSRep .neoCMSIcon', ifrDoc).css({display: 'block', opacity: '1'}) - } - createIcons() -}; -redo = function () { - destroyIcons(); - var neoCMSRedoEle = '.neoCMSEle' + undoC; - if ($(neoCMSRedoEle, ifrDoc).length) { - if ($(neoCMSRedoEle, ifrDoc)[0].tagName != 'IMG') { - var rep = $('#neoCMSGlobalRedo #neoCMSRedoNum' + undoC + ' ' + neoCMSRedoEle).find('a.neoCMSIcon').css({opacity: '1'}).end().html(); - $(neoCMSRedoEle, ifrDoc).replaceWith($(neoCMSRedoEle, ifrDoc).clone().html(rep)) - } else { - var rep = $('#neoCMSGlobalRedo #neoCMSRedoNum' + undoC).html(); - $(neoCMSRedoEle, ifrDoc).replaceWith(rep) - } - if ($(neoCMSRedoEle, ifrDoc).hasClass('neocmsRepeatArea')) { - var content = $(neoCMSRedoEle, ifrDoc).clone().find('.neoCMSPlaceholder').remove().end() - } else var content = $(neoCMSRedoEle, ifrDoc)[0]; - var eleEditNum = $(neoCMSRedoEle, ifrDoc).parent().attr('id').replace('neoCMSEditArea', ''); - changePageEdits(content, eleEditNum); - undoC++ - } - neocmsGlobals(); - if ($(neoCMSRedoEle, ifrDoc).attr('class').match(/neocmsRepeatArea/g)) { - neocmsRepBind(); - $('.neoCMSRep .neoCMSIcon', ifrDoc).css({display: 'block', opacity: '1'}) - } - createIcons() -}; -redoOff = function () { - $('#neoCMSGlobalRedo').remove(); - var i = 0; - $('#neoCMSGlobalUndo div').each(function () { - var futureId = $(this).attr('id').replace('neoCMSUndoNum', ''); - if (futureId >= undoC) { - $(this).remove(); - $('.neoCMSEle' + i, ifrDoc).removeClass('neoCMSEle' + i); - $('.neoCMSEle' + i).removeClass('neoCMSEle' + i) - } - }); - $('.neoCMSEle' + (undoC - 1), ifrDoc).removeClass('neoCMSEle' + (undoC - 1)); - $('.neoCMSEle', ifrDoc).addClass('neoCMSEle' + (undoC - 1)); - neocmsGlobals() -}; -publish = function () { - if ($('#neoCMSPageEdits textarea.edit', ifrDoc).length) { - var pubIframe; - try { - pubIframe = ifrDoc.createElement('') - } catch (ex) { - pubIframe = ifrDoc.createElement('iframe') - } - $(pubIframe, ifrDoc).attr({ - id: 'neoCMSPubIframe', - name: 'neoCMSPubIframe', - application: 'yes' - }).css('display', 'none').appendTo($('body', ifrDoc)); - $('#neoCMSPageEdits', ifrDoc)[0].submit(); - $('#neoCMSGlobalUndo, #neoCMSGlobalRedo').remove(); - undoC = 0; - neocmsGlobals() - } -}; -dragOn = function (ele, hand) { - $(ele).draggable({ - handle: hand, start: function () { - $(window).unbind('resize') - } - }); - if ($('#neoCMSEditWrap').length) $('#neoCMSEditWrap').resizable({ - handles: 'all', - alsoResize: '.mceIframeContainer', - start: frameShim - }) -}; \ No newline at end of file diff --git a/cms/js/ui.js b/cms/js/ui.js index a1aefd4..133746f 100644 --- a/cms/js/ui.js +++ b/cms/js/ui.js @@ -50,9 +50,7 @@ getGlobals = function (path, html, files, filePath, exFolders, imagePath) { neoCMSFilePath = filePath; neoCMSImagePath = imagePath; neoCMSExFolders = exFolders; - $('#neoCMSPrefsFrame').load('core/getpath.php', function () { - $('#neoCMSPrefsFrame').remove() - }); + $('#neoCMSPrefsFrame').remove(); // Is this needed? initPage(); setTimeout(function () { $('#neoCMSPageSrc').bind('load', initPage) diff --git a/cms/settings/acct.php b/cms/settings/acct.php deleted file mode 100644 index 94adb4c..0000000 --- a/cms/settings/acct.php +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - neoCMS Settings :: User Info - - - - - - - - - - - - - - - - Username - Password - - - - Email - - - - Add New User Only the account owner has administrative privileges - - - - New User - - Name Please enter a name - Email Please enter a valid email - Username Please enter a username - Password “Medium” or “strong” required. - - n/a “Medium” or “strong” required. - - Confirm Password Must match password - save or cancel - - - - - - \ No newline at end of file diff --git a/cms/settings/dashcheck.php b/cms/settings/dashcheck.php deleted file mode 100644 index ce055b4..0000000 --- a/cms/settings/dashcheck.php +++ /dev/null @@ -1,37 +0,0 @@ - \ No newline at end of file diff --git a/cms/settings/dashfoot.php b/cms/settings/dashfoot.php deleted file mode 100644 index 021cd4f..0000000 --- a/cms/settings/dashfoot.php +++ /dev/null @@ -1,11 +0,0 @@ - - - - Thanks for using neoCMS™ - © Neogate Technologies - - - - - - \ No newline at end of file diff --git a/cms/settings/dashnav.php b/cms/settings/dashnav.php deleted file mode 100644 index 1db5bcf..0000000 --- a/cms/settings/dashnav.php +++ /dev/null @@ -1,29 +0,0 @@ - - - - Back to Editing - - NeoCMS - - logout· - - - - - - - - - Preferences - User Info - FTP Info - - - - - - - - - \ No newline at end of file diff --git a/cms/settings/ftpinfo.php b/cms/settings/ftpinfo.php deleted file mode 100644 index ea2dac7..0000000 --- a/cms/settings/ftpinfo.php +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - neoCMS Settings :: FTP Info - - - - - - - - - - - - - - Please Note: FTP information is not required for most installations of - neocms. If you are encountering file permission issues, save your FTP info here and try publishing/uploading - again. neocms will write your FTP information to an unreadable file on this server. - - - - Your FTP Info - - ServerPlease enter your server – no “ftp.” - - FTP UsernamePlease your FTP username - - FTP PasswordPlease enter your FTP password - - Domain RootPlease enter the path to your site - - - - saveClear all FTP - info - - - - - \ No newline at end of file diff --git a/cms/settings/index.php b/cms/settings/index.php deleted file mode 100644 index fd465e6..0000000 --- a/cms/settings/index.php +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - neoCMS Settings :: Preferences - - - - - - - - - - - - - - Your neocms file path - - - - This is where your neocms files are located. This is also the path you’ll follow to login to - your site’s neocms account to begin editing your site content. Note: - neocms discovers this based on what you name your neocms folder. - - - HTML Editing - - on off - Set this preference to “on” if you want users to be able to directly edit the HTML - markup, or “off” if you do not want users to be able to edit the HTML. - - - Exclude Folders - Enter a comma separated list of folder names or paths you do not want listed in the neocms file - browser. Do not use a “/” at the end fo the path. Ex: “wordpress, .svn, - functions/important” - - Folders - - - - File Uploads - - on off - Set this preference to “on” if you want users to be able to upload files, or “off” - if you do not want users to upload files. There is a 100MB limit on all uploads. - - - To specify a file folder, enter the relative path here. Leave it blank if you want neocms to - auto-discover folders. - Default File Path - - - - - Image Uploads - - To specify an image folder, enter the relative path here. Leave it blank if you want neocms to - auto-discover folders. - - - Default Image Path - - - save - - - - \ No newline at end of file
]*>/gi, ''); - c = c.replace(/<\/p>/gi, '') - } - if ($.browser.msie) { - c = c.replace(/(\s[a-zA-Z^>\s]+=)([^\"\s\'>]+)(\s*)/gi, '$1"$2"$3'); - c = c.replace(/<\/*[^\s>]+/gi, function (w) { - return w.toLowerCase() - }); - c = c.replace(/(<(dt|dd|li)[^>]*>[^<\n\r]*)/gi, "$1$2>"); - c = c.replace(/[\s\r\n]*<\/(dt|dd|li)><\/(dt|dd|li)>/gi, "$1>") - } - c = c.replace(/(style|_mce_[^\s=]*|unselectable|contentEditable|neocmsid|jQuery[0-9]*)=\"[^\"]*\"\s*/gi, ''); - c = c.replace(/(<\/*[^>]+)\s>/gi, '$1>'); - c = c.replace(/(neoCMSEditArea|neoCMSRep|ui-draggable)\s*/gi, ''); - c = c.replace(/<(\/?)b>|]+)>/gi, '<$1strong$2>'); - c = c.replace(/<(\/?)i>|]+)>/gi, '<$1em$2>'); - c = c.replace(window.location + "#", "#"); - return c -}; -getCurStyle = function (ele, cur) { - var tinyDoc = getTinyDoc(), doc = (tinyDoc) ? tinyDoc : ifrDoc, gs, cs = $(ele, doc)[0].currentStyle; - if (cs) { - if (cur.match(/-/)) cur = cur.replace(/-([A-z])/gi, function (a, b) { - return b.toUpperCase() - }); - gs = (cs[cur]) ? cs[cur] : $(ele, doc).css(cur); - if (gs == undefined) gs = '' - } else gs = doc.defaultView.getComputedStyle(ele, null).getPropertyValue(cur); - return gs -}; -contrast = function () { - var tinyDoc = getTinyDoc(); - $('.mceIframeContainer').css('background-color', 'rgb(255,255,255)'); - $('#neoCMSEditorContrast').bind('mousewheel', function (event, delta) { - var vel = Math.round(Math.abs(delta) * 20); - var color = $('.mceIframeContainer').css('background-color'); - var rgb = color.replace(/(rgb\(\s*|\))/, ''); - rgb = rgb.split(','); - var r = parseInt(rgb[0]); - var g = parseInt(rgb[1]); - var b = parseInt(rgb[2]); - if (delta > 0) { - r += vel; - g += vel; - b += vel - } else { - r -= vel; - g -= vel; - b -= vel - } - var newcolor; - if (r > 255) newcolor = 'rgb(255,255,255)'; else if (r < 0) newcolor = 'rgb(0,0,0)'; else newcolor = 'rgb(' + r + ',' + g + ',' + b + ')'; - $(this).css('background-color', newcolor); - $('.mceIframeContainer').css('background-color', newcolor); - return false - }).css('background-color', 'rgb(255,255,255)') -}; -folderLoader = function (type) { - var folderIframe; - try { - folderIframe = document.createElement('') - } catch (ex) { - folderIframe = document.createElement('iframe') - } - $(folderIframe).attr({ - id: 'neoCMSFolderFrame', - name: 'neoCMSFolderFrame', - src: 'core/folderload.php?type=' + type, - application: 'yes' - }).css('display', 'none').appendTo('body') -}; -folderOption = function (path, type) { - if (type == 'img') $('#neoCMSImgFolder').append($('').html(path).val(path)); else $('#neoCMSFolder').append($('').html(path).val(path)) -}; -destroyFolderLoader = function () { - $('#neoCMSFolderFrame').remove(); - $('#neoCMSImgFolderDefault, #neoCMSFolderDefault').html('Please select a folder') -}; -fixImgs = function (paste) { - var tinyDoc = getTinyDoc(); - $('img', tinyDoc).each(function () { - var eleSrc = $(this, tinyDoc).attr('_mce_src') || $(this, tinyDoc).attr('src'), - eleSrc = (paste) ? eleSrc.replace(/^(\.\.\/)/, '') : eleSrc.replace(/^(\/)/, ''), - eleSrc = (eleSrc.match(/^http(s*):\/\//)) ? eleSrc : fpath() + eleSrc; - $(this, tinyDoc).attr('src', eleSrc) - }) -}; -destroyIcons = function () { - $('.neoCMSIcon, .neoCMSRepIcon', ifrDoc).remove() -}; -eleHTML = function (ele) { - var vid = $(ele, ifrDoc).clone().wrap($('', ifrDoc)), vidHTML = $(vid, ifrDoc).parent().html(), - vidHTML = cleanContent(vidHTML, true); - return vidHTML -}; -createTextArea = function (ele) { - if (!$('#neoCMSEditWrap').length) { - hideFlash(); - $(ele, ifrDoc).addClass('neoCMSEle').css('visibility', 'hidden'); - $('body').prepend($('').attr('id', 'neoCMSEditWrapTemp').load('templates/editor.html', function () { - $('#neoCMSEditWrapTemp').replaceWith($('#neoCMSEditWrapTemp').html()); - var neoCMSEditContent = $('', ifrDoc).addClass('neoCMSEditContent').attr('id', 'neoCMSEditContent').append($(ele, ifrDoc).clone().attr({ - neocmsid: $(ele, ifrDoc).attr('neocmsid'), - style: 'float: none !important; visibility: visible; position: relative !important; margin: 0 !important; top: 0 !important; left: 0 !important; *zoom: 1; overflow: hidden;' - }).addClass($(ele, ifrDoc).attr('class')).removeClass('neocms').removeClass('neoCMSEle').removeClass('neoCMSEditArea').find('.neoCMSFlash').removeClass('neoCMSFlash').end().find('a.neoCMSRepCopyDrag, a.neoCMSRepDelete').remove().end().find('*').enableSelection().end()); - var c = 0, bp = parentBP(ele, false), t = ($(ele, ifrDoc)[0].tagName.match(/(h[0-9]|p)/i)) ? false : true, - html5 = 'abbr article aside audio canvas details figcaption figure footer header hgroup mark meter nav output progress section summary time video'; - if ((!html5.match($(ele, ifrDoc)[0].tagName) && $.browser.msie) || !$.browser.msie) { - $(ele, ifrDoc).parents().not('body,html').each(function () { - var styles = 'margin: 0 !important; width: auto !important; height: auto !important; float: none !important; position: relative !important; top: 0 !important; left: 0 !important; border: none !important; -moz-box-shadow: 0 !important; -webkit-box-shadow: 0 !important; box-shadow: 0 !important;'; - if (c == 0) { - styles += ' padding: 20px !important;'; - if (bp.img) { - bp.left += 20; - bp.top += 20; - styles += ' background-position: ' + bp.left + 'px ' + bp.top + 'px !important;' - } - } else { - styles += ' padding: 0 !important;'; - if (bp.img) styles += ' background-position: ' + bp.left + 'px ' + bp.top + 'px !important;' - } - bp = parentBP(this, bp); - $(neoCMSEditContent, ifrDoc).wrapInner($(this, ifrDoc).clone().empty().addClass('clearfix').attr('style', styles).removeAttr('neocmsid')); - c++ - }) - } else neoCMSEditContent = neoCMSEditContent.innerHTML; - var neoCMSDumm = $('', ifrDoc).append(neoCMSEditContent); - $('#neoCMSEditWrap').css('opacity', '0').html($('#neoCMSEditWrap').html() + $(neoCMSDumm, ifrDoc).html()); - tinyMCEBuilder(ele, t) - })) - } -}; -parentBP = function (t, bp) { - var par = $(t, ifrDoc).parent()[0]; - if (!bp) { - bp = {top: 0, left: 0, offleft: 0, offtop: 0, img: false} - } - var off = $(t, ifrDoc).offset(), offpar = $(par, ifrDoc).offset(), - pbp = getCurStyle($(par, ifrDoc)[0], 'background-position').split(' '), l = '', t = '', loff = '', toff = ''; - loff = 0 - (off.left - offpar.left); - toff = 0 - (off.top - offpar.top); - if (!pbp[0].match(/%/) || pbp[0] == '0%') l = bp.offleft + loff; else { - var p = 0.01 * parseInt(pbp[0]); - l = Math.round(p * (loff * -1)) - } - if (pbp[1] && (!pbp[1].match(/%/) || pbp[1] == '0%')) t = bp.offtop + toff; else { - var p = 0.01 * parseInt(pbp[1]); - t = Math.round(p * (toff * -1)) - } - var bp = { - left: l, - top: t, - offleft: bp.offleft + loff, - offtop: bp.offtop + toff, - img: (par.tagName != 'BODY' && getCurStyle(par, 'background-image') != 'none') ? true : false - }; - return bp -}; -tinyMCEBuilder = function (ele, t) { - var tools = null, blocks = "p,pre,blockquote,h1,h2,h3,h4,h5,h6,dd,dt", - blockreg = new RegExp('^(' + blocks.replace(/,/gi, '|') + ')$', 'i'); - brs = (ele.tagName.match(blockreg)) ? true : false; - tinyMCE.init({ - mode: "exact", - theme: "advanced", - plugins: "deflist,file,video,images,links,paste,tables", - theme_advanced_buttons1: (!t) ? ((neoCMSFiles == 'Y') ? 'bold,italic,link,image,file' : 'bold,italic,link,image') : ((neoCMSFiles == 'Y') ? 'formatselect,bold,italic,link,image,video,file,bullist,numlist,deflist,table' : 'formatselect,bold,italic,link,image,video,bullist,numlist,deflist,table'), - theme_advanced_buttons2: "", - theme_advanced_buttons3: "", - theme_advanced_buttons4: "", - theme_advanced_blockformats: blocks, - theme_advanced_toolbar_location: "top", - theme_advanced_toolbar_align: "left", - height: 'auto', - width: 'auto', - apply_source_formatting: true, - remove_linebreaks: true, - entity_encoding: '', - cleanup: true, - cleanup_on_startup: ($.browser.msie) ? false : true, - remove_trailing_nbsp: true, - use_native_selects: true, - extended_valid_elements: "@[neocmsid|id|dir|class|style],li,dt,dd,div,abbr,article,aside,audio,canvas,datalist,details,figure,figcaption,footer,header,hgroup,mark,menu,meter,nav,output,progress,section,summary,time,video,pre,code", - invalid_elements: "script", - skin: "default", - convert_urls: false, - elements: "neoCMSEditContent", - verify_html: true, - object_resizing: false, - auto_resize: false, - paste_auto_cleanup_on_paste: true, - setup: function (ed) { - ed.onPaste.add(function (ed, e) { - setTimeout(function () { - fixImgs(true) - }, 100) - }) - }, - oninit: "tinyInit" - }); - tinyInit = function () { - var tinyDoc = getTinyDoc(); - editorStyles(tinyDoc); - if ($('body', ifrDoc).attr('class')) $('body', tinyDoc).addClass($('body', ifrDoc).attr('class')); - if ($('body', ifrDoc).attr('id')) $('body', tinyDoc).attr('id', $('body', ifrDoc).attr('id')); - if (neoCMSHTMLEdit == 'Y') { - $('').attr({ - id: 'neoCMSEditHTML', - href: 'javascript:', - title: 'View and edit the HTML' - }).html('html').prependTo('td.mceToolbar') - } - $('#neoCMSEditContent_toolbar1 a').each(function () { - $(this).find('span').html($(this).attr('id').replace('neoCMSEditContent_', '')) - }); - if ($.browser.msie) ieBind(); - contrast(); - editorCleanUp(); - keyHandler(); - setTimeout(windowOrient, 0) - } -}; -ieBind = function () { - var tinyDoc = getTinyDoc(); - $('#neoCMSEditContent_ifr').attr('allowTransparency', 'true').css({background: 'transparent'}); - $('[neocmsid]', $('body', tinyDoc)).bind('mousedown', function (e) { - getInnerEle(e) - }) -}; -getInnerEle = function (e) { - var tinyDoc = getTinyDoc(), range = tinyDoc.body.createTextRange(); - range.moveToElementText($(e.target, tinyDoc)[0]); - range.collapse(false); - range.select(); - $('[neocmsid]', tinyDoc).unbind('mousedown').bind('blur', function (e) { - $(this, tinyDoc).bind('mousedown', function (e) { - getInnerEle(e) - }) - }).find('*').unbind('mousedown').bind('blur', function (e) { - $(this, tinyDoc).bind('mousedown', function (e) { - getInnerEle(e) - }) - }) -}; -tinyEvents = function (e) { - var tinyDoc = getTinyDoc(); - if (e.type == 'paste') { - e.stopPropagation() - } -}; -createUndo = function (ele) { - if (!$('#neoCMSGlobalUndo').length) { - $('').attr('id', 'neoCMSGlobalUndo').appendTo('body'); - $('').attr('id', 'neoCMSUndoNum' + undoC).appendTo('#neoCMSGlobalUndo'); - $('#neoCMSUndoNum' + undoC).html($('', ifrDoc).append($(ele, ifrDoc).clone().addClass('neoCMSEle' + undoC)).html()) - } else { - if (!$('#neoCMSUndoNum' + undoC).length) { - $('').attr('id', 'neoCMSUndoNum' + undoC).appendTo('#neoCMSGlobalUndo'); - $('#neoCMSUndoNum' + undoC).html($('', ifrDoc).append($(ele, ifrDoc).clone().addClass('neoCMSEle' + undoC)).html()) - } else { - $('#neoCMSUndoNum' + undoC).html(''); - $('#neoCMSUndoNum' + undoC).html($('', ifrDoc).append($(ele, ifrDoc).clone().addClass('neoCMSEle' + undoC)).html()) - } - } -}; -createRedo = function (neoCMSUndoEle) { - if (!$('#neoCMSGlobalRedo').length) { - $('').attr('id', 'neoCMSGlobalRedo').appendTo('body'); - $('').attr('id', 'neoCMSRedoNum' + undoC).appendTo('#neoCMSGlobalRedo'); - $('#neoCMSRedoNum' + undoC).html($('', ifrDoc).append($(neoCMSUndoEle, ifrDoc).clone()).html()) - } else { - if (!$('#neoCMSRedoNum' + undoC).length) { - $('').attr('id', 'neoCMSRedoNum' + undoC).appendTo('#neoCMSGlobalRedo'); - $('#neoCMSRedoNum' + undoC).html($('', ifrDoc).append($(neoCMSUndoEle, ifrDoc).clone()).html()) - } else { - $('#neoCMSRedoNum' + undoC).html(''); - $('#neoCMSRedoNum' + undoC).html($('', ifrDoc).append($(neoCMSUndoEle, ifrDoc).clone()).html()) - } - } - $('#neoCMSRedo').css('opacity', '1.0').find('a').attr('title', 'Redo last action').bind('click', redo) -}; -showPrompt = function (noDrag, noAnim) { - hideFlash(); - if (!noAnim) { - $('#neoCMSPrompt:hidden').css({display: "block", opacity: "0"}).fadeTo(300, 1.0, function () { - if ($.browser.msie) $(this, ifrDoc)[0].style.removeAttribute('filter') - }) - } else $('#neoCMSPrompt:hidden').css('display', 'block'); - if ($('#neoCMSPromptCancel').length) $('#neoCMSPromptCancel').bind('click', cancel); - if (!$('#neoCMSEditWrap').length) keyHandler(); else { - $(document).unbind('keydown'); - $('#neoCMSPrompt input:first, #neoCMSPrompt textarea:first').focus(); - keyHandler() - } - if (!noDrag) dragOn($('#neoCMSPrompt')[0], $('#neoCMSPromptTitle, #neoCMSPromptTop')); - if ($('#neoCMSEditWrap').length) overlay(null) -}; -getEd = function () { - if ($('#neoCMSEditWrap').length) { - if (tinyMCE.activeEditor.selection.getNode().tagName == 'IMG' || tinyMCE.activeEditor.selection.getNode().tagName == 'EMBED' || tinyMCE.activeEditor.selection.getNode().tagName == 'OBJECT') return tinyMCE.activeEditor.selection.getNode(); else return false - } else return false -}; -imageEditBuilder = function (ele) { - if (getTinyDoc()) getBookmark('simple'); - if (!$('#neoCMSPromptWrap').length) { - $('body').append($('').attr('id', 'neoCMSPromptWrap').load('templates/image-editor.html', function () { - if (ele) { - $(ele, ifrDoc).addClass('neoCMSEle'); - $('#neoCMSImgAltTxt').val($(ele, ifrDoc).attr('alt')); - var neoCMSEleClass = $(ele, ifrDoc).attr('class').replace(/(?:\s)*\b(neocms|neoCMSEle|neoCMSEle[0-9]+|neocmsRepeat|neoCMSEditArea)\b(?:\s)*/gi, ''); - $('#neoCMSImgClass').val(neoCMSEleClass); - if (ele.parentNode.tagName == 'A') { - $('#neoCMSImgLink').val($(ele.parentNode, ifrDoc).attr('href')); - $('#neoCMSImgRel').val($(ele.parentNode, ifrDoc).attr('rel')) - } - $('#neoCMSPromptBtn').attr('title', 'Apply these changes').html('done').bind('click', function () { - if ($(ele, ifrDoc).attr('class').match(/neocmsRepeat\b/g)) repImageDone(ele); else imageDone(ele) - }); - imageStatBuilder(ele) - } else { - var ed = getEd(); - if (ed) { - $('#neoCMSImgAltTxt').val($(ed).attr('alt')); - $('#neoCMSImgClass').val($(ed).attr('class')); - if (ed.parentNode.tagName == 'A') { - $('#neoCMSImgLink').val($(ed.parentNode).attr('href')); - $('#neoCMSImgRel').val($(ed.parentNode).attr('rel')) - } - imageStatBuilder(ed) - } else { - $('#neoCMSPromptTitle').html('Insert Image'); - imageStatBuilder() - } - } - folderLoader('img'); - showPrompt() - })) - } -}; -origImgSet = function (ele) { - var ed = getEd(), ele = (ed) ? ed : (ele) ? ele : $('[neocmsid]', getTinyDoc())[0]; - var elePad = { - t: parseInt(getCurStyle(ele, 'padding-top')), - r: parseInt(getCurStyle(ele, 'padding-right')), - l: parseInt(getCurStyle(ele, 'padding-left')), - b: parseInt(getCurStyle(ele, 'padding-bottom')) - }; - origImg = {width: ele.offsetWidth - elePad.l - elePad.r, height: ele.offsetHeight - elePad.t - elePad.b} -}; -imageStatBuilder = function (ele, fileSize) { - var origSize = true; - if ($('#neoCMSImgStatArea').length) { - origSize = ($('#neoCMSOrigSize:checked').length) ? true : false; - $('#neoCMSImgStatArea').remove() - } - if (ele) { - var eleSrc = $(ele, ifrDoc).attr('src'), - eleSrc = (eleSrc.match(/^http(s*):\/\//)) ? eleSrc : fpath() + eleSrc.replace(/^(\/)/, ''), - imgName = eleSrc.split('/'), imgName = imgName[imgName.length - 1], - statArea = '' + imgName + '' + eleSrc + 'Resize image to fitwidth:height:Keep proportions'; - $('').addClass('neoCMSImgStatArea clearfix').attr('id', 'neoCMSImgStatArea').html(statArea).insertAfter('#neoCMSImgChoose'); - $('ul.neoCMSImgProperties').css('display', 'inline'); - $('#neoCMSPrompt').addClass('neoCMSImgVidSelect'); - if (fileSize) { - $('#neoCMSImgStats').prepend($('').attr('id', 'neoCMSImgSize').html('file size:').prepend($(''))); - if (fileSize.length > 3) $('#neoCMSImgSize span').html(fileSize.slice(0, fileSize.length - 3) + ' kb'); else $('#neoCMSImgSize span').html(fileSize + ' bytes') - } - var eleIns = ($('img.neoCMSEle', ifrDoc).length || getEd()) ? ele : false; - if (!$('img.neoCMSEle', ifrDoc).length) { - if ($('#neoCMSPromptBtn').html() == 'apply') $('#neoCMSPromptBtn').attr('title', 'Insert image').html('insert'); - $('#neoCMSPromptBtn').unbind('click').bind('click', function () { - imageInsert() - }) - } - $('#neoCMSApplyBtn').css('display', 'block'); - if ($(ele, ifrDoc).attr('id') != 'neoCMSUploadImgClone') origImgSet(ele); else if ($('.neoCMSEle', ifrDoc).length) origImgSet($('.neoCMSEle', ifrDoc)[0]); else origImgSet($('[neocmsid]', getTinyDoc())[0]); - if (origImg) imageOrigSize(ele); else imageOrigSize() - } else { - $('#neoCMSPrompt').removeClass('neoCMSImgVidSelect'); - $('ul.neoCMSImgProperties').css('display', 'none'); - $('#neoCMSPromptBtn').attr('title', 'Insert new image').html('apply').bind('click', imageSrc); - $('#neoCMSApplyBtn').css('display', 'none'); - imageBind() - } -}; -imageOrigSize = function (ele) { - $('#neoCMSOrigSize').unbind('click').bind('click', function () { - imageOrigSize(ele) - }); - if ($('#neoCMSOrigSize:checked').length) { - var eleHeight = origImg.height; - if ($('#neoCMSUploadImgClone', ifrDoc).length) { - var cloneWidth = $('#neoCMSUploadImgClone', ifrDoc)[0].offsetWidth, - cloneHeight = $('#neoCMSUploadImgClone', ifrDoc)[0].offsetHeight; - eleHeight = parseInt(cloneHeight) * (parseInt(origImg.width) / parseInt(cloneWidth)); - eleHeight = Math.round(eleHeight) - } - $('#neoCMSImgStatsWidth').replaceWith($('').attr({ - name: 'neoCMSImgStatsWidth', - id: 'neoCMSImgStatsWidth', - type: 'text', - disabled: 'disabled' - }).css({backgroundColor: '#bbb', color: '#666'}).val(origImg.width)); - $('#neoCMSImgStatsHeight').replaceWith($('').attr({ - name: 'neoCMSImgStatsHeight', - id: 'neoCMSImgStatsHeight', - type: 'text', - disabled: 'disabled' - }).css({backgroundColor: '#bbb', color: '#666'}).val(eleHeight)); - $('.neoCMSConstrainLabel').css('color', '#666').find('input').attr({disabled: 'disabled', checked: 'checked'}) - } else { - var hVal = $('#neoCMSImgStatsHeight').val(), wVal = $('#neoCMSImgStatsWidth').val(); - $('#neoCMSImgStatsWidth').replaceWith($('').attr({ - name: 'neoCMSImgStatsWidth', - id: 'neoCMSImgStatsWidth', - type: 'text' - })); - $('#neoCMSImgStatsHeight').replaceWith($('').attr({ - name: 'neoCMSImgStatsHeight', - id: 'neoCMSImgStatsHeight', - type: 'text' - })); - if ($('#neoCMSUploadImgClone', ifrDoc).length) { - $('#neoCMSImgStatsWidth').val($('#neoCMSUploadImgClone', ifrDoc)[0].offsetWidth); - $('#neoCMSImgStatsHeight').val($('#neoCMSUploadImgClone', ifrDoc)[0].offsetHeight) - } else { - $('#neoCMSImgStatsWidth').val(wVal); - $('#neoCMSImgStatsHeight').val(hVal) - } - $('.neoCMSConstrainLabel').css('color', '#ccc').find('input').removeAttr('disabled') - } - imageConstrain(ele); - imageBind() -}; -imageConstrain = function (ele) { - $('#neoCMSConstrain').unbind('click').bind('click', function () { - imageConstrain(ele) - }); - if ($('#neoCMSConstrain:checked').length && !$('#neoCMSOrigSize:checked').length) { - $('#neoCMSImgStatsWidth, #neoCMSImgStatsHeight').bind('keyup', function () { - var field = (this.id == 'neoCMSImgStatsWidth') ? 'neoCMSImgStatsWidth' : 'neoCMSImgStatsHeight'; - changeSize(field, ele) - }) - } else { - $('#neoCMSImgStatsWidth, #neoCMSImgStatsHeight').unbind('keyup') - } -}; -changeSize = function (f, ele) { - var ele = (ele) ? ele : $('.neoCMSEle', ifrDoc)[0], fval = $('#' + f).val(), - fWidth = $('#neoCMSImgStatsWidth').val(), fHeight = $('#neoCMSImgStatsHeight').val(); - if ($('#neoCMSUploadImgClone', ifrDoc).length) ele = $('#neoCMSUploadImgClone', ifrDoc); - var eleWidth = $(ele, ifrDoc).width(); - var eleHeight = $(ele, ifrDoc).height(); - var eleRatio = (f == 'neoCMSImgStatsHeight') ? eleWidth / eleHeight : eleHeight / eleWidth; - if ((fWidth / fHeight) != eleRatio) { - var f2 = (f == 'neoCMSImgStatsHeight') ? 'neoCMSImgStatsWidth' : 'neoCMSImgStatsHeight'; - var size = $('#' + f).val() * eleRatio; - size = Math.round(size); - $('#' + f2).val(size) - } -}; -imageBind = function () { - imageRel(); - $('#neoCMSImgLink').unbind('keyup').bind('keyup', imageRel); - fBrowseBind(); - $('#neoCMSImgUpload').unbind('change').bind('change', function () { - imageLoader(false) - }); - $('#neoCMSApplyBtn').unbind('click').bind('click', imageSrc) -}; -imageRel = function () { - if ($('#neoCMSImgLink').val() != '') $('.neoCMSImgRel').removeClass('disabled').find('input').removeAttr('disabled'); else $('.neoCMSImgRel').addClass('disabled').find('input').attr('disabled', 'disabled') -}; -imageLoader = function (over) { - if ($('#neoCMSImgUpload').val() != '') { - $('#neoCMSImgUploadAlert').remove(); - $('#neoCMSImgAddress').val('http://'); - $('#neoCMSImgStatArea').css('min-height', $('#neoCMSImgStatArea').height()).addClass('neoCMSUploadingImg').find('*').css('display', 'none'); - var imgIframe; - try { - imgIframe = document.createElement('') - } catch (ex) { - imgIframe = document.createElement('iframe') - } - $(imgIframe).attr({ - id: 'neoCMSImgUploadIframe', - name: 'neoCMSImgUploadIframe', - application: 'yes' - }).appendTo('body'); - if (over) $('#neoCMSImgLoc').attr('action', 'core/upload.php?type=img&over=true'); - $('#neoCMSImgLoc')[0].submit() - } -}; -imageOverwritePrompt = function () { - $('').addClass('neoCMSUploadAlert neoCMSPromptAlert').attr('id', 'neoCMSUploadAlert').html('This file already exists. overwrite · find · cancel').insertAfter('#neoCMSPromptTitle').css({ - backgroundColor: '#fff8dd', - color: '#333' - }).fadeTo(300, 1.0); - $('#neoCMSFileOver').bind('click', function () { - imageLoader(true) - }); - $('#neoCMSFileCancel').bind('click', function () { - imageOverwriteCancel(); - imageStatBuilder() - }); - $('#neoCMSFileFind').bind('click', function () { - imageOverwriteCancel(); - linkFiles('#neoCMSImgAddress') - }) -}; -imageOverwriteCancel = function () { - $('#neoCMSImgUpload').val(''); - $('#neoCMSUploadAlert, #neoCMSImgUploadIframe').remove(); - $('#neoCMSImgLoc').attr('action', 'core/upload.php?type=img') -}; -imageSrc = function () { - if ($('#neoCMSImgAddress').val() != '' && $('#neoCMSImgAddress').val() != 'http://') { - $('#neoCMSUploadImgClone', ifrDoc).remove(); - $('#neoCMSImgUploadAlert').remove(); - $('#neoCMSImgChoose').addClass('neoCMSImgChooseInline'); - $('#neoCMSImgUpload').val(''); - $('body', ifrDoc).append($('', ifrDoc).attr({ - src: $('#neoCMSImgAddress').val(), - id: 'neoCMSUploadImgClone' - })); - setTimeout(function () { - imageStatBuilder($('#neoCMSUploadImgClone', ifrDoc)[0]) - }, 100) - } -}; -imageInfo = function (fileSize, fileWidth, fileHeight, alertText, name, imgPath) { - setTimeout(function () { - if ($('#neoCMSPrompt').length) { - $('#neoCMSUploadImgClone', ifrDoc).remove(); - $('#neoCMSImgUploadAlert').remove(); - if (alertText.match(/successfully/gi)) { - if (name != '') { - var imgPathName = (fpath() != '/') ? fpath() + imgPath + name : imgPath + name; - $('body', ifrDoc).append($('', ifrDoc).attr({ - src: imgPathName, - id: 'neoCMSUploadImgClone', - height: fileHeight, - width: fileWidth - })); - imageStatBuilder($('#neoCMSUploadImgClone', ifrDoc)[0], fileSize) - } - $('').addClass('neoCMSImgUploadAlert neoCMSPromptAlert').attr('id', 'neoCMSImgUploadAlert').html(alertText).insertAfter('#neoCMSPromptTitle').css('background-color', '#82ac3f').fadeTo(300, 1.0) - } else { - $('#neoCMSImgStatArea').removeClass('neoCMSUploadingImg').find('*').css('display', 'block'); - $('').addClass('neoCMSImgUploadAlert neoCMSPromptAlert').attr('id', 'neoCMSImgUploadAlert').html(alertText).insertAfter('#neoCMSPromptTitle').css('background-color', '#c6242b').fadeTo(300, 1.0) - } - } - $('#neoCMSImgUpload').val(''); - $('#neoCMSUploadAlert').remove(); - $('#neoCMSImgLoc').attr('action', 'core/upload.php?type=img'); - $('#neoCMSImgUploadIframe').remove() - }, 100) -}; -imageDone = function (ele) { - var imgClassReg = new RegExp('((\s)*\bneoCMSEle\b(\s)*|(\s)*\bneoCMSEle[0-9]+\b(\s)*)', 'gi'), - eleEditNum = $(ele, ifrDoc).attr('neocmsid').replace('neoCMSEditArea', ''), - imgSrc = $('#neoCMSImgStatArea img').attr('src'), imgClass = $('#neoCMSImgClass').val(), neoCMSImgClass = null; - if ($('#neoCMSImgClass').val() != '') neoCMSImgClass = $('#neoCMSImgClass').val() + ' neocms'; else neoCMSImgClass = 'neocms'; - var content = "src::" + imgSrc + ",alt::" + $('#neoCMSImgAltTxt').val() + ",class::" + neoCMSImgClass + ",width::" + $('#neoCMSImgStatsWidth').val() + ",height::" + $('#neoCMSImgStatsHeight').val() + ",link::" + $('#neoCMSImgLink').val() + ",rel::" + $('#neoCMSImgRel').val(); - $(ele, ifrDoc).addClass('neoCMSEle' + undoC); - createUndo(ele); - var imgAttr = { - src: imgSrc, - alt: $('#neoCMSImgAltTxt').val(), - width: $('#neoCMSImgStatsWidth').val(), - height: $('#neoCMSImgStatsHeight').val() - }; - var newImg = $(ele, ifrDoc).clone().addClass(imgClass).attr(imgAttr); - if ($('#neoCMSImgLink').val() != $(ele.parentNode, ifrDoc).attr('href')) $(ele.parentNode, ifrDoc).attr({href: $('#neoCMSImgLink').val()}); - if ($('#neoCMSImgRel').val() && $('#neoCMSImgRel').val() != $(ele.parentNode, ifrDoc).attr('rel')) $(ele.parentNode, ifrDoc).attr({rel: $('#neoCMSImgRel').val()}); - $(ele, ifrDoc).replaceWith(newImg); - if (!$('#neoCMSEditTA' + eleEditNum, ifrDoc).length) { - $('#neoCMSPageEdits', ifrDoc).append($('', ifrDoc).addClass('edit').attr({ - name: 'editImg' + eleEditNum, - id: 'neoCMSEditTA' + eleEditNum, - rows: '1', - cols: '1' - })); - if (typeof (document.textContent) != 'undefined') $('#neoCMSEditTA' + eleEditNum, ifrDoc)[0].textContent = content; else $('#neoCMSEditTA' + eleEditNum, ifrDoc)[0].innerText = content - } else { - if (typeof (document.textContent) != 'undefined') $('#neoCMSEditTA' + eleEditNum, ifrDoc)[0].textContent = content; else $('#neoCMSEditTA' + undoC, ifrDoc)[0].innerText = content - } - undoC++; - redoOff(); - origImg = null; - cancel() -}; -imageInsert = function () { - var tinyDoc = getTinyDoc(), ed = getEd(), imgSrc = $('#neoCMSImgStatArea img').attr('src'), - content = ''; - if (ed) { - if ($('#neoCMSImgLink').val()) { - if ($(ed, tinyDoc).parent('a').length) { - $(ed, tinyDoc).parent('a').attr('href', $('#neoCMSImgLink').val()); - if ($('#neoCMSImgRel').val()) $(ed, tinyDoc).parent('a').attr('rel', $('#neoCMSImgRel').val()) - } else { - conlink = ''; - content = conlink + content + '' - } - } - $(ed, tinyDoc).replaceWith(content) - } else { - if (tinyDoc) setBookmark(); - if ($('#neoCMSImgLink').val()) { - conlink = ''; - content = conlink + content + '' - } - tinyMCE.execCommand('mceInsertRawHTML', true, content, {skip_undo: 1}) - } - cancel() -}; -videoPrompt = function (ele) { - if (getTinyDoc()) getBookmark('simple'); - if (!$('#neoCMSPromptWrap').length) { - $(ele, ifrDoc).addClass('neoCMSEle'); - $('body').append($('').attr('id', 'neoCMSPromptWrap').load('templates/video-editor.html', function () { - if (ele) { - changeEmbed($(ele, ifrDoc)); - $('#neoCMSPromptTitle').html('Edit Video Embed'); - $('#neoCMSPromptBtn').bind('click', function () { - vidDone(ele) - }); - vidStatBuilder(ele) - } else { - if (getEd()) { - var tinyDoc = getTinyDoc(), ed = getEd(); - if ($(ed, tinyDoc).parent()[0].tagName == 'OBJECT') ed = $(ed, tinyDoc).parent(); - changeEmbed($(ed, tinyDoc)); - $('#neoCMSPromptTitle').html('Edit Video Embed'); - vidStatBuilder(ed) - } else { - vidStatBuilder() - } - } - showPrompt() - })) - } -}; -vidStatBuilder = function (ele) { - var ele = (ele != undefined) ? ele || $('#neoCMSVidClone', ifrDoc) : false, origSize = true, constrain = true; - if ($('#neoCMSOrigSize').length) { - origSize = ($('#neoCMSOrigSize:checked').length) ? true : false; - constrain = ($('#neoCMSConstrain:checked').length) ? true : false - } - $('#neoCMSVidStatArea').remove(); - if (ele) { - var eleSrc = ($(ele, ifrDoc).find('param[name=movie]').length) ? $(ele, ifrDoc).find('param[name=movie]').attr('value') : $(ele, ifrDoc).attr('src'), - src = '', vid = '', spl = eleSrc.split('/'), - eleW = parseInt($(ele, ifrDoc).attr('width')) || parseInt($(ele, ifrDoc).width()), - eleH = parseInt($(ele, ifrDoc).attr('height')) || parseInt($(ele, ifrDoc).height()); - if (eleSrc.match(/^http(s*):\/\//)) { - vid = 'via ' + spl[2].replace(/www\./, ''); - src = spl[spl.length - 1] - } else { - vid = spl[spl.length - 1]; - src = eleSrc - } - $('#neoCMSPrompt').addClass('neoCMSImgVidSelect'); - $('').addClass('neoCMSVidStatArea clearfix').attr('id', 'neoCMSVidStatArea').insertAfter('#neoCMSVidChoose'); - $('#neoCMSVidStatArea').append('' + vid + '' + src + '' + eleHTML(ele) + 'Resize embed to fitwidth:height:Keep proportions'); - $('#neoCMSEmbedWrap').html($('#neoCMSEmbedWrap').html().replace(/width=(\"|\')*[^\"\'\s]*(\"|\')*/g, 'width="145"').replace(/height=(\"|\')*[^\"\'\s]*(\"|\')*/g, 'height="' + (eleH * (145 / eleW) + 20) + '"')); - var eleIns = ($('object.neoCMSEle, embed.neoCMSEle', ifrDoc).length || getEd()) ? ele : false; - $('#neoCMSPromptBtn').attr('title', 'Insert new video').html('insert').bind('click', function () { - vidInsert(eleIns) - }); - if (origSize) $('#neoCMSOrigSize').attr('checked', 'checked'); - if (constrain) $('#neoCMSConstrain').attr('checked', 'checked'); - setTimeout(function () { - vidOrigSize() - }, 100) - } else { - $('#neoCMSPrompt').removeClass('neoCMSImgVidSelect'); - $('#neoCMSPromptBtn').attr('title', 'Load embed').html('apply').bind('click', vidClone); - $('#neoCMSApplyBtn').css('display', 'none'); - vidBind() - } -}; -changeEmbed = function (ele) { - $('#neoCMSVidEmbed').val(eleHTML(ele)) -}; -vidOrigSize = function () { - $('#neoCMSOrigSize').bind('click', vidOrigSize); - if ($('#neoCMSOrigSize:checked').length) { - var tinyDoc = getTinyDoc(), tinyEle = (tinyDoc) ? tinyMCE.activeEditor.selection.getNode() : null, - tinyEle = (tinyEle != null && tinyEle.tagName != 'EMBED' && tinyEle.tagName != 'OBJECT') ? $(tinyEle, tinyDoc).find('object')[0] || $(tinyEle, tinyDoc).find('embed')[0] : tinyEle, - ele = tinyEle || $('.neoCMSEle', ifrDoc)[0], elePadT = parseInt(getCurStyle(ele, 'padding-top')), - elePadR = parseInt(getCurStyle(ele, 'padding-right')), elePadL = parseInt(getCurStyle(ele, 'padding-left')), - elePadB = parseInt(getCurStyle(ele, 'padding-bottom')), - eleWidth = ($(ele, ifrDoc).attr('width')) ? parseInt($(ele, ifrDoc).attr('width')) : parseInt($(ele, ifrDoc).width()), - eleHeight = ($(ele, ifrDoc).attr('height')) ? parseInt($(ele, ifrDoc).attr('height')) : parseInt($(ele, ifrDoc).height()); - if (eleWidth == '' || eleWidth == '0') eleWidth = (ele.clientWidth) ? parseInt(ele.clientWidth) : parseInt(ele.offsetWidth); - if (eleHeight == '' || eleHeight == '0') eleHeight = (ele.clientHeight) ? parseInt(ele.clientHeight) : parseInt(ele.offsetHeight); - if (elePadT != 0) eleHeight = eleHeight - elePadT; - if (elePadB != 0) eleHeight = eleHeight - elePadB; - if (elePadR != 0) eleWidth = eleWidth - elePadR; - if (elePadL != 0) eleWidth = eleWidth - elePadL; - if ($('#neoCMSVidClone', ifrDoc).length) { - var cloneWidth = $('#neoCMSVidClone', ifrDoc).attr('width') || ($('#neoCMSVidClone', ifrDoc)[0].clientWidth) ? $('#neoCMSVidClone', ifrDoc)[0].clientWidth : $('#neoCMSVidClone', ifrDoc)[0].offsetWidth; - var cloneHeight = $('#neoCMSVidClone', ifrDoc).attr('height') || ($('#neoCMSVidClone', ifrDoc)[0].clientHeight) ? $('#neoCMSVidClone', ifrDoc)[0].clientHeight : $('#neoCMSVidClone', ifrDoc)[0].offsetHeight; - eleHeight = parseInt(cloneHeight) * (eleWidth / parseInt(cloneWidth)); - eleHeight = Math.round(eleHeight) - } - $('#neoCMSVidStatsWidth').replaceWith($('').attr({ - name: 'neoCMSVidStatsWidth', - id: 'neoCMSVidStatsWidth', - type: 'text', - disabled: 'disabled' - }).css({backgroundColor: '#bbb', color: '#666'})); - $('#neoCMSVidStatsHeight').replaceWith($('').attr({ - name: 'neoCMSVidStatsHeight', - id: 'neoCMSVidStatsHeight', - type: 'text', - disabled: 'disabled' - }).css({backgroundColor: '#bbb', color: '#666'})); - $('#neoCMSVidStatsWidth').val(eleWidth); - $('#neoCMSVidStatsHeight').val(eleHeight); - $('.neoCMSConstrainLabel').css('color', '#666').find('input').attr({disabled: 'disabled', checked: 'checked'}) - } else { - var hVal = $('#neoCMSVidStatsHeight').val(), wVal = $('#neoCMSVidStatsWidth').val(); - $('#neoCMSVidStatsWidth').replaceWith($('').attr({ - name: 'neoCMSVidStatsWidth', - id: 'neoCMSVidStatsWidth', - type: 'text' - })); - $('#neoCMSVidStatsHeight').replaceWith($('').attr({ - name: 'neoCMSVidStatsHeight', - id: 'neoCMSVidStatsHeight', - type: 'text' - })); - if ($('#neoCMSVidClone', ifrDoc).length) { - $('#neoCMSVidStatsWidth').val($('#neoCMSVidClone', ifrDoc)[0].offsetWidth); - $('#neoCMSVidStatsHeight').val($('#neoCMSVidClone', ifrDoc)[0].offsetHeight) - } else { - $('#neoCMSVidStatsWidth').val(wVal); - $('#neoCMSVidStatsHeight').val(hVal) - } - $('.neoCMSConstrainLabel').css('color', '#ccc').find('input').removeAttr('disabled') - } - vidBind(); - if ($('#neoCMSVidEmbed').length) { - $('#neoCMSVidEmbed').val($('#neoCMSVidEmbed').val().replace(/width=(\"|\')[^\"\']*(\"|\')/g, 'width="' + $('#neoCMSVidStatsWidth').val().replace(/px/, '') + '"').replace(/height=(\"|\')[^\"\']*(\"|\')/g, 'height="' + $('#neoCMSVidStatsHeight').val().replace(/px/, '') + '"')) - } -}; -vidClone = function () { - if ($('#neoCMSVidEmbed').val() != '') { - $('#neoCMSVidClone', ifrDoc).remove(); - var newVid = $('#neoCMSVidEmbed').val(); - newVid = $(newVid, ifrDoc).attr('id', 'neoCMSVidClone'); - $('body', ifrDoc).append(newVid); - vidStatBuilder($('#neoCMSVidClone', ifrDoc)) - } -}; -vidConstrain = function () { - $('#neoCMSConstrain').unbind('click').bind('click', vidConstrain); - if ($('#neoCMSConstrain:checked').length && !$('#neoCMSOrigSize:checked').length) { - $('#neoCMSVidStatsWidth, #neoCMSVidStatsHeight').bind('keyup', function () { - var field = $(this).attr('id'); - changeVidSize(field) - }) - } else { - $('#neoCMSVidStatsWidth, #neoCMSVidStatsHeight').unbind('keyup').bind('keyup', function () { - $('#neoCMSVidEmbed').val($('#neoCMSVidEmbed').val().replace(/width=(\"|\')[^\"\']*(\"|\')/g, 'width="' + $('#neoCMSVidStatsWidth').val().replace(/px/, '') + '"').replace(/height=(\"|\')[^\"\']*(\"|\')/g, 'height="' + $('#neoCMSVidStatsHeight').val().replace(/px/, '') + '"')) - }) - } -}; -changeVidSize = function (f) { - var tinyDoc = getTinyDoc(), tinyEle = (tinyDoc) ? tinyMCE.activeEditor.selection.getNode() : null, - tinyEle = (tinyEle != null && tinyEle.tagName != 'EMBED' && tinyEle.tagName != 'OBJECT') ? $(tinyEle, tinyDoc).find('object')[0] || $(tinyEle, tinyDoc).find('embed')[0] : tinyEle, - ele = $(tinyEle, tinyDoc)[0] || $('.neoCMSEle', ifrDoc)[0], fval = $('#' + f).val(), - fWidth = parseInt($('#neoCMSVidStatsWidth').val()), fHeight = parseInt($('#neoCMSVidStatsHeight').val()), - doc = (tinyDoc) ? tinyDoc : ifrDoc; - if ($('#neoCMSVidClone', ifrDoc).length) { - ele = $('#neoCMSVidClone', ifrDoc); - doc = ifrDoc - } - var eleWidth = parseInt($(ele, doc).attr('width')), eleHeight = parseInt($(ele, doc).attr('height')); - if (eleWidth == '' || eleWidth == '0') eleWidth = ($(ele, doc)[0].clientWidth) ? $(ele, doc)[0].clientWidth : $(ele, doc)[0].offsetWidth; - if (eleHeight == '' || eleHeight == '0') eleHeight = ($(ele, doc)[0].clientHeight) ? $(ele, doc)[0].clientHeight : $(ele, doc)[0].offsetHeight; - var eleRatio = (f == 'neoCMSVidStatsHeight') ? eleWidth / eleHeight : eleHeight / eleWidth; - if ((fWidth / fHeight) != eleRatio) { - var f2 = (f == 'neoCMSVidStatsHeight') ? 'neoCMSVidStatsWidth' : 'neoCMSVidStatsHeight'; - var size = $('#' + f).val() * eleRatio; - size = Math.round(size); - $('#' + f2).val(size) - } -}; -vidBind = function () { - vidConstrain(); - $('#neoCMSApplyBtn').unbind('click').bind('click', vidClone); - $('#neoCMSVidStatsWidth, #neoCMSVidStatsHeight').bind('keyup', function () { - $('#neoCMSVidEmbed').val($('#neoCMSVidEmbed').val().replace(/width=(\"|\')*[^\"\'\s]*(\"|\')*/g, 'width="' + $('#neoCMSVidStatsWidth').val().replace(/px/, '') + '"').replace(/height=(\"|\')*[^\"\'\s]*(\"|\')*/g, 'height="' + $('#neoCMSVidStatsHeight').val().replace(/px/, '') + '"')) - }) -}; -vidDone = function (ele) { - var eleEditNum = $(ele, ifrDoc).attr('neocmsid').replace('neoCMSEditArea', ''), - content = $('#neoCMSVidEmbed').val(); - createUndo(ele); - content = $(content, ifrDoc).addClass('neocms'); - var constring = eleHTML(content); - content = $(content, ifrDoc).addClass('neoCMSEle neoCMSEle' + undoC); - $(ele, ifrDoc).replaceWith($(content, ifrDoc)); - if (!$('#neoCMSEditTA' + eleEditNum, ifrDoc).length) { - $('#neoCMSPageEdits', ifrDoc).append($('', ifrDoc).addClass('edit').attr({ - name: 'editVid' + eleEditNum, - id: 'neoCMSEditTA' + eleEditNum, - rows: '1', - cols: '1' - })); - if (typeof (document.textContent) != 'undefined') $('#neoCMSEditTA' + eleEditNum, ifrDoc)[0].textContent = constring; else $('#neoCMSEditTA' + eleEditNum, ifrDoc)[0].innerText = constring - } else { - if (typeof (document.textContent) != 'undefined') $('#neoCMSEditTA' + eleEditNum, ifrDoc)[0].textContent = constring; else $('#neoCMSEditTA' + undoC, ifrDoc)[0].innerText = constring - } - undoC++; - $('#neoCMSGlobalRedo').remove(); - $('#neoCMSGlobalUndo div').each(function () { - var futureId = $(this).attr('id').replace('neoCMSUndoNum', ''); - if (futureId >= undoC) { - $(this).remove(); - $('.neoCMSEle' + i, ifrDoc).removeClass('neoCMSEle' + i); - $('.neoCMSEle' + i).removeClass('neoCMSEle' + i) - } - }); - $('.neoCMSEle' + (undoC - 1), ifrDoc).removeClass('neoCMSEle' + (undoC - 1)); - $('.neoCMSEle', ifrDoc).addClass('neoCMSEle' + (undoC - 1)); - neocmsGlobals(); - cancel() -}; -vidInsert = function (ed) { - var tinyDoc = getTinyDoc(), content = $('', tinyDoc).append($('#neoCMSVidEmbed').val()); - if (ed) { - if ($(ed, tinyDoc).parent()[0].tagName == 'OBJECT') ed = $(ed, tinyDoc).parent(); - $(ed, tinyDoc).replaceWith($(content, tinyDoc).html()) - } else { - if (tinyDoc) setBookmark(); - tinyMCE.execCommand('mceInsertContent', true, $(content, tinyDoc).html(), {skip_undo: 1}) - } - fixImgs(); - cancel() -}; -uploadPrompt = function () { - if (!$('#neoCMSPrompt').length) { - $('body').append($('').attr('id', 'neoCMSPromptWrap').load('templates/upload.html', function () { - $('#neoCMSPromptBtn, #neoCMSCancelBtn').bind('click', cancel); - folderLoader('file'); - showPrompt(); - $('#neoCMSPrompt input:first').focus(); - $('#neoCMSUpload').unbind('change').bind('change', function () { - fileLoader(false) - }) - })) - } -}; -fileLoader = function (over) { - if ($('#neoCMSUpload').val() != '') { - $('#neoCMSUploadAlert, #neoCMSFileInfo').remove(); - var fileIframe; - try { - fileIframe = document.createElement('') - } catch (ex) { - fileIframe = document.createElement('iframe') - } - $(fileIframe).attr({ - id: 'neoCMSUploadIframe', - name: 'neoCMSUploadIframe', - application: 'yes' - }).css('display', 'none').appendTo('body'); - if (over) $('#neoCMSUploadForm').attr('action', 'core/upload.php?over=true'); - $('#neoCMSUploadForm')[0].submit() - } -}; -fileInfo = function (fileSize, alertText, name, path) { - setTimeout(function () { - if ($('#neoCMSPrompt').length) { - $('#neoCMSUploadAlert, #neoCMSFileInfo').remove(); - if (alertText.match(/successfully/gi)) { - if (name != '') { - var pathName = path + name; - var size = (fileSize.length > 3) ? fileSize.slice(0, fileSize.length - 3) + ' kb' : fileSize + ' bytes'; - $('').attr('id', 'neoCMSFileInfo').addClass('neoCMSFileInfo').append('last upload:' + name + 'path: /' + path + '' + 'file size:' + size + '').insertAfter('#neoCMSPromptTitle'); - $('#neoCMSUploadTxt').html('To upload another file, select the folder you want to upload to:') - } - $('').addClass('neoCMSUploadAlert neoCMSPromptAlert').attr('id', 'neoCMSUploadAlert').html(alertText).insertAfter('#neoCMSPromptTitle').css('background-color', '#82ac3f').fadeTo(300, 1.0); - $('#neoCMSUpload').val('') - } else { - $('').addClass('neoCMSUploadAlert neoCMSPromptAlert').attr('id', 'neoCMSUploadAlert').html(alertText).insertAfter('#neoCMSPromptTitle').css('background-color', '#c6242b').fadeTo(300, 1.0) - } - } - $('#neoCMSUploadForm').attr('action', 'core/upload.php'); - $('#neoCMSUploadIframe').remove() - }, 100) -}; -filePrompt = function () { - $('').addClass('neoCMSUploadAlert neoCMSPromptAlert').attr('id', 'neoCMSUploadAlert').html('This file already exists. overwrite · cancel').insertAfter('#neoCMSPromptTitle').css({ - backgroundColor: '#fff8dd', - color: '#333' - }).fadeTo(300, 1.0); - $('#neoCMSFileOver').bind('click', function () { - fileLoader(true) - }); - $('#neoCMSFileCancel').bind('click', fileCancel) -}; -fileCancel = function () { - $('#neoCMSUpload').val(''); - $('#neoCMSUploadAlert').remove(); - $('#neoCMSUploadIframe').remove() -}; -defListBuilder = function () { - getBookmark('simple'); - var tinyDoc = getTinyDoc(), ed = tinyMCE.activeEditor.selection.getNode(), defStart = '', - con = $(ed, tinyDoc).html(), defEnd = ''; - $(ed, tinyDoc).replaceWith(defStart + con + defEnd); - setCaret($('#caret', tinyDoc)[0], tinyDoc) -}; -htmlPrompt = function () { - if (!$('#neoCMSPrompt').length) { - $('body').append($('').attr('id', 'neoCMSPromptWrap').load('templates/html-editor.html', function () { - var tinyDoc = getTinyDoc(), eleHTML = $('body', tinyDoc).find('[neocmsid]').html(); - eleHTML = cleanContent(eleHTML, true); - codeEditor = new CodeMirror(CodeMirror.replace("neoCMSHtmlEditAreaTA"), { - parserfile: ["parsexml.js", "parsecss.js", "tokenizejavascript.js", "parsejavascript.js", "parsehtmlmixed.js"], - path: "js/codemirror/js/", - stylesheet: "js/codemirror/css/xmlcolors.css", - height: Math.round($(window).height() * 0.6) + 'px', - width: '780px', - tabMode: "shift", - content: eleHTML - }); - $('#neoCMSPromptBtn').bind('click', function () { - htmlInsert(codeEditor) - }); - $('#neoCMSCancelBtn').bind('click', cancel); - $('a.fullscreen').unbind('click').bind('click', function () { - editorFullscreen($(this).attr('rel')) - }).removeClass('neoCMSMinimize').attr({title: 'Maximize this window'}).html('Maximize this window'); - $('.CodeMirror-wrapping').attr('id', 'neoCMSCodeWrap'); - showPrompt() - })) - } else { - $('#neoCMSPrompt, #neoCMSPromptContent').removeAttr('style'); - $('#neoCMSCodeWrap, #neoCMSHtmlEditAreaTA').width('780px').height(Math.round($(window).height() * 0.6)); - $('#neoCMSPrompt a.fullscreen').unbind('click').bind('click', function () { - editorFullscreen($(this).attr('rel')) - }).removeClass('neoCMSMinimize').attr({title: 'Maximize this window'}).html('Maximize this window'); - showPrompt(false, true) - } -}; -htmlInsert = function (codeEditor) { - var tinyDoc = getTinyDoc(), - content = ($('#neoCMSCodeWrap').length) ? codeEditor.getCode() : $('#neoCMSHtmlEditAreaTA').val(); - $('#neoCMSEditContent')[0].innerHTML = content; - $('body', tinyDoc).find('[neocmsid]')[0].innerHTML = content; - fixImgs(); - if ($.browser.msie) ieBind(); - $('#neoCMSEditContent_parent').css('display', 'block'); - cancel() -}; -makeTable = function () { - var tinyDoc = getTinyDoc(), ed = tinyMCE.activeEditor.selection.getNode(); - if (tinyDoc) getBookmark('simple'); - if (!$('#neoCMSPromptWrap').length) { - $('body').append($('').attr('id', 'neoCMSPromptWrap').load('templates/table-editor.html', function () { - $('#neoCMSTableRows').unbind('keyup').bind('keyup', insertRows).unbind('change').bind('change', function () { - if ($('#neoCMSTableRows').val() == '' || $('#neoCMSTableRows').val() == '0' || !$('#neoCMSTableRows').val().match(/^\d+$/)) { - $('#neoCMSTableRows').val('1'); - insertRows() - } - }); - $('#neoCMSTableCols').unbind('keyup').bind('keyup', insertCols).unbind('change').bind('change', function () { - if ($('#neoCMSTableCols').val() == '' || $('#neoCMSTableCols').val() == '0' || !$('#neoCMSTableCols').val().match(/^\d+$/)) { - $('#neoCMSTableCols').val('1'); - insertCols() - } - }); - $('#neoCMSTableThead').unbind('click').bind('click', insertThead); - $('#neoCMSTableTfoot').unbind('click').bind('click', insertTfoot); - $('#neoCMSTableID').unbind('keydown').bind('keydown', tableID); - $('#neoCMSTableClass').unbind('keydown').bind('keydown', function () { - $('#neoCMSTablePrev table').attr('class', $(this).val()) - }); - $('#neoCMSPrompt #neoCMSPromptBtn').unbind('click').bind('click', function () { - insertTable(ed) - }); - showPrompt() - })) - } -}; -insertRows = function () { - var r = Math.round($('#neoCMSTableRows').val()), rows = $('#neoCMSTablePrev tbody tr'); - if (r != '' && r != '0' && r != rows.length && r.toString().match(/^\d+$/)) { - var row = rows[0]; - $('#neoCMSTablePrev tbody tr').remove(); - while (r > '0') { - row = $(row).clone(); - $('#neoCMSTablePrev tbody').append(row[0]); - r-- - } - } -}; -insertCols = function () { - var c = Math.round($('#neoCMSTableCols').val()), cols = $('#neoCMSTablePrev tbody tr:first td'); - if (c != '' && c != '0' && c != cols.length && c.toString().match(/^\d+$/)) { - $('#neoCMSTablePrev tbody td').remove(); - $('#neoCMSTablePrev tbody tr').each(function () { - var n = c; - while (n > '0') { - $(this).append($('').html(' ')); - n-- - } - }); - insertThead(); - insertTfoot() - } -}; -insertThead = function () { - var cols = $('#neoCMSTablePrev tbody tr:first td'); - $('#neoCMSTablePrev thead').remove(); - if ($('#neoCMSTableThead:checked').length) { - $('#neoCMSTablePrev table').prepend(''); - cols.each(function () { - $('#neoCMSTablePrev thead tr').append($('').html(' ')) - }) - } -}; -insertTfoot = function () { - var cols = $('#neoCMSTablePrev tbody tr:first td'); - $('#neoCMSTablePrev tfoot').remove(); - if ($('#neoCMSTableTfoot:checked').length) { - $('#neoCMSTablePrev table').append(''); - cols.each(function () { - $('#neoCMSTablePrev tfoot tr').append($('').html(' ')) - }) - } -}; -tableID = function () { - if (!$('#neoCMSTableID').val().match(/\s/gi)) $('#neoCMSTablePrev table').attr('id', $('#neoCMSTableID').val()); else $('#neoCMSTableID').val($('#neoCMSTablePrev table').attr('id')) -}; -insertTable = function (ed) { - var tinyDoc = getTinyDoc(), con = $(ed, tinyDoc).html(); - $('#neoCMSTablePrev td:first').attr('id', 'caret').append(con).html(); - $(ed, tinyDoc).replaceWith($('#neoCMSTablePrev').html()); - setCaret($('#caret', tinyDoc)[0], tinyDoc); - cancel() -}; -makeLink = function () { - var tinyDoc = getTinyDoc(); - if (tinyDoc) getBookmark('simple'); - if (tinyMCE.activeEditor.selection.getNode().nodeName == 'A') var ed = tinyMCE.activeEditor.selection.getNode(); else if (tinyMCE.activeEditor.selection.getNode().parentNode.nodeName == 'A') var ed = tinyMCE.activeEditor.selection.getNode().parentNode; - if (!$('#neoCMSPrompt').length) { - $('body').append($('').attr('id', 'neoCMSPromptWrap').load('templates/link-editor.html', function () { - if (ed) { - $('#neoCMSPromptBtn').html('done').bind('click', function () { - linkReplace(ed) - }); - $('#neoCMSPromptTitle').html('Edit Link'); - $('#neoCMSLinkID').val($(ed, tinyDoc).attr('id')); - $('#neoCMSLinkURL').val($(ed, tinyDoc).attr('href')); - $('#neoCMSLinkClass').val($(ed, tinyDoc).attr('class')); - $('#neoCMSLinkTitle').val($(ed, tinyDoc).attr('title')); - $('#neoCMSLinkRel').val($(ed, tinyDoc).attr('rel')); - $('').addClass('neoCMSLinkRemove').prependTo('#neoCMSLinkProperties').append($('').attr({ - href: 'javascript:', - title: 'Unlink this selection' - }).html('remove this link').bind('click', function () { - linkRemove(ed) - })) - } else { - $('#neoCMSPromptBtn').html('insert').bind('click', linkInsert); - $('#neoCMSPromptTitle').html('Create Link') - } - $('#neoCMSCancelBtn').bind('click', cancel); - fBrowseBind(); - showPrompt() - })) - } -}; -linkInsert = function () { - var tinyDoc = getTinyDoc(), - newlink = (!$('#neoCMSLinkURL').val().match(/^http(s*):\/\/|@/)) ? fpath() + $('#neoCMSLinkURL').val() : $('#neoCMSLinkURL').val(); - if ($('#neoCMSLinkURL').val() != '' && $('#neoCMSLinkURL').val() != 'http://') { - $('#neoCMSLinkAlert').remove(); - setBookmark(); - var orig = tinyMCE.activeEditor.selection.getContent({format: 'text'}); - var ed = tinyMCE.activeEditor.selection.getNode(); - if ($(ed, tinyDoc)[0].tagName == 'IMG') { - var edCloneDiv = $('', tinyDoc).append($(ed, tinyDoc).clone()); - orig = $(edCloneDiv).html() - } - var linkContent = '' + orig + ''; - tinyMCE.execCommand('mceInsertContent', true, linkContent, {skip_undo: 1}); - cancel() - } else $('').addClass('neoCMSLinkAlert').attr('id', 'neoCMSLinkAlert').html('You must enter a URL').prependTo('#neoCMSLinkContent').fadeTo(300, 1.0); - $('a', tinyDoc).removeAttr('_mce_href') -}; -linkReplace = function (ed) { - var tinyDoc = getTinyDoc(), - newlink = (!$('#neoCMSLinkURL').val().match(/^http(s*):\/\/|@/)) ? fpath() + $('#neoCMSLinkURL').val() : $('#neoCMSLinkURL').val(); - if ($(ed, tinyDoc)[0].tagName == 'IMG') ed = $(ed, tinyDoc).parent(); - if (newlink != '' && newlink != 'http://') { - $(ed, tinyDoc).removeAttr('class'); - if ($('#neoCMSLinkClass').val()) $(ed, tinyDoc).addClass($('#neoCMSLinkClass').val()); - if (newlink != $(ed, tinyDoc).attr('href')) $(ed, tinyDoc).attr({href: newlink, _mce_href: newlink}); - if ($('#neoCMSLinkRel').val() != $(ed, tinyDoc).attr('rel')) $(ed, tinyDoc).attr({rel: $('#neoCMSLinkRel').val()}); - if ($('#neoCMSLinkID').val() != '') $(ed, tinyDoc).attr({id: $('#neoCMSLinkID').val()}); - $(ed, tinyDoc).attr('title', $('#neoCMSLinkTitle').val()); - cancel() - } else linkRemove(); - $('a', tinyDoc).removeAttr('_mce_href') -}; -linkRemove = function (ed) { - var edhtml = $(ed).html(); - $(ed).replaceWith(edhtml); - fixImgs(); - cancel() -}; -logoutPrompt = function () { - if ($('#neoCMSPageEdits textarea.edit', ifrDoc).length) { - overlay(); - if (!$('#neoCMSPrompt').length) { - $('body').append($('').attr('id', 'neoCMSPromptWrap').load('templates/prompt.html', function () { - $('#neoCMSPrompt h4.neoCMSPromptTitle').html('Logout'); - $('#neoCMSPrompt p').html('You have unpublished changes that will be lost. Do you still wish to log out?'); - $('#neoCMSPromptBtn').attr('title', 'logout').html('logout').bind('click', logout); - $('#neoCMSCancelBtn').bind('click', cancel); - showPrompt('nodrag') - })) - } - } else logout() -}; -logout = function () { - $.ajax({ - type: "POST", url: "functions/logout.php", success: function () { - window.location = retUrl() - } - }) -}; -restorePrompt = function () { - overlay(); - if (!$('#neoCMSPrompt').length) { - $('body').append($('').attr('id', 'neoCMSPromptWrap').load('templates/prompt.html', function () { - $('#neoCMSPrompt h4.neoCMSPromptTitle').html('Restore'); - $('#neoCMSPrompt p').html('Restore will change all files associated with this page back to their last published version. This cannot be undone. Do you still wish to restore?'); - $('#neoCMSPromptBtn').attr('title', 'Restore this page to last published version').html('restore').bind('click', restoreSubmit); - $('#neoCMSCancelBtn').bind('click', cancel); - showPrompt('nodrag'); - $('body', ifrDoc).append($('', ifrDoc).attr({ - name: 'neoCMSRestoreForm', - id: 'neoCMSRestoreForm', - action: neoCMSGlobalPath + '/core/restore.php', - method: 'POST', - target: 'neoCMSRestIframe' - }).css('display', 'none')) - })) - } -}; -restoreSubmit = function () { - $('#neoCMSPromptWrap').remove(); - var restoreIframe; - try { - restoreIframe = ifrDoc.createElement('') - } catch (ex) { - restoreIframe = ifrDoc.createElement('iframe') - } - $(restoreIframe, ifrDoc).attr({id: 'neoCMSRestIframe', name: 'neoCMSRestIframe', application: 'yes'}); - $('body', ifrDoc).append(restoreIframe); - $('#neoCMSRestoreForm', ifrDoc)[0].submit() -}; -cancelAllPrompt = function () { - overlay(); - if (!$('#neoCMSPrompt').length) { - $('body').append($('').attr('id', 'neoCMSPromptWrap').load('templates/prompt.html', function () { - $('#neoCMSPrompt h4.neoCMSPromptTitle').html('Cancel All'); - $('#neoCMSPrompt p').html('Are you sure you want to clear all changes since your last publish?'); - $('#neoCMSPromptBtn').attr('title', 'Clear all changes since last publish').html('clear').bind('click', cancelAllSubmit); - $('#neoCMSCancelBtn').bind('click', cancel); - showPrompt('nodrag') - })) - } -}; -cancelAllSubmit = function () { - $('#neoCMSPromptWrap').remove(); - ifrReload() -}; -done = function (ele) { - var eleEditNum = $(ele, ifrDoc).attr('neocmsid').replace('neoCMSEditArea', ''), tinyDoc = getTinyDoc(), - t = (ele.tagName.match(/(h[0-9]|p)/i)) ? false : true, - content = (!t && $('[neocmsid]', tinyDoc).find(ele.tagName).length) ? $('[neocmsid]', tinyDoc).parent().html() : $('[neocmsid]', tinyDoc).html(); - $(ele, ifrDoc).find('.neoCMSFlash').removeClass('neoCMSFlash'); - if (content) { - content = cleanContent(content, t); - var clone = $(ele, ifrDoc).clone(); - if ($(ele, ifrDoc)[0].tagName.match(/TR|THEAD|TBODY/)) clone.html(content); else clone[0].innerHTML = content; - $(ele, ifrDoc).replaceWith(clone) - } else $(ele, ifrDoc).html(' '); - createUndo(ele); - var ncon = cleanContent($('.neoCMSEle', ifrDoc).html(), t); - if (!$('#neoCMSEditTA' + eleEditNum, ifrDoc).length) { - $('', ifrDoc).addClass('edit').attr({ - name: 'edit' + eleEditNum, - id: 'neoCMSEditTA' + eleEditNum, - rows: '1', - cols: '1' - }).appendTo($('#neoCMSPageEdits', ifrDoc)); - if (typeof (document.textContent) != 'undefined') $('#neoCMSEditTA' + eleEditNum, ifrDoc)[0].textContent = ncon; else $('#neoCMSEditTA' + eleEditNum, ifrDoc)[0].innerText = ncon - } else { - if (typeof (document.textContent) != 'undefined') $('#neoCMSEditTA' + eleEditNum, ifrDoc)[0].textContent = ncon; else $('#neoCMSEditTA' + eleEditNum, ifrDoc)[0].innerText = ncon - } - undoC++; - redoOff(); - linkBind(); - cancel() -}; -undo = function () { - destroyIcons(); - if (undoC <= 0) undoC = 0; else undoC--; - var neoCMSUndoEle = '.neoCMSEle' + undoC; - if ($(neoCMSUndoEle, ifrDoc).length) { - createRedo(neoCMSUndoEle); - if ($(neoCMSUndoEle, ifrDoc)[0].tagName != 'IMG') { - var rep = $('#neoCMSGlobalUndo #neoCMSUndoNum' + undoC + ' ' + neoCMSUndoEle).find('a.neoCMSIcon').css({opacity: '1'}).end().html(); - $(neoCMSUndoEle, ifrDoc).replaceWith($(neoCMSUndoEle, ifrDoc).clone().html(rep)) - } else { - var rep = $('#neoCMSGlobalUndo #neoCMSUndoNum' + undoC).html(); - $(neoCMSUndoEle, ifrDoc).replaceWith(rep) - } - if ($(neoCMSUndoEle, ifrDoc).hasClass('neocmsRepeatArea')) { - var content = $(neoCMSUndoEle, ifrDoc).clone().find('.neoCMSPlaceholder').remove().end() - } else var content = $(neoCMSUndoEle, ifrDoc)[0]; - var eleEditNum = $(neoCMSUndoEle, ifrDoc).parent().attr('id').replace('neoCMSEditArea', ''); - changePageEdits(content, eleEditNum) - } - neocmsGlobals(); - if ($(neoCMSUndoEle, ifrDoc).attr('class').match(/neocmsRepeatArea/g)) { - neocmsRepBind(); - $('.neoCMSRep .neoCMSIcon', ifrDoc).css({display: 'block', opacity: '1'}) - } - createIcons() -}; -redo = function () { - destroyIcons(); - var neoCMSRedoEle = '.neoCMSEle' + undoC; - if ($(neoCMSRedoEle, ifrDoc).length) { - if ($(neoCMSRedoEle, ifrDoc)[0].tagName != 'IMG') { - var rep = $('#neoCMSGlobalRedo #neoCMSRedoNum' + undoC + ' ' + neoCMSRedoEle).find('a.neoCMSIcon').css({opacity: '1'}).end().html(); - $(neoCMSRedoEle, ifrDoc).replaceWith($(neoCMSRedoEle, ifrDoc).clone().html(rep)) - } else { - var rep = $('#neoCMSGlobalRedo #neoCMSRedoNum' + undoC).html(); - $(neoCMSRedoEle, ifrDoc).replaceWith(rep) - } - if ($(neoCMSRedoEle, ifrDoc).hasClass('neocmsRepeatArea')) { - var content = $(neoCMSRedoEle, ifrDoc).clone().find('.neoCMSPlaceholder').remove().end() - } else var content = $(neoCMSRedoEle, ifrDoc)[0]; - var eleEditNum = $(neoCMSRedoEle, ifrDoc).parent().attr('id').replace('neoCMSEditArea', ''); - changePageEdits(content, eleEditNum); - undoC++ - } - neocmsGlobals(); - if ($(neoCMSRedoEle, ifrDoc).attr('class').match(/neocmsRepeatArea/g)) { - neocmsRepBind(); - $('.neoCMSRep .neoCMSIcon', ifrDoc).css({display: 'block', opacity: '1'}) - } - createIcons() -}; -redoOff = function () { - $('#neoCMSGlobalRedo').remove(); - var i = 0; - $('#neoCMSGlobalUndo div').each(function () { - var futureId = $(this).attr('id').replace('neoCMSUndoNum', ''); - if (futureId >= undoC) { - $(this).remove(); - $('.neoCMSEle' + i, ifrDoc).removeClass('neoCMSEle' + i); - $('.neoCMSEle' + i).removeClass('neoCMSEle' + i) - } - }); - $('.neoCMSEle' + (undoC - 1), ifrDoc).removeClass('neoCMSEle' + (undoC - 1)); - $('.neoCMSEle', ifrDoc).addClass('neoCMSEle' + (undoC - 1)); - neocmsGlobals() -}; -publish = function () { - if ($('#neoCMSPageEdits textarea.edit', ifrDoc).length) { - var pubIframe; - try { - pubIframe = ifrDoc.createElement('') - } catch (ex) { - pubIframe = ifrDoc.createElement('iframe') - } - $(pubIframe, ifrDoc).attr({ - id: 'neoCMSPubIframe', - name: 'neoCMSPubIframe', - application: 'yes' - }).css('display', 'none').appendTo($('body', ifrDoc)); - $('#neoCMSPageEdits', ifrDoc)[0].submit(); - $('#neoCMSGlobalUndo, #neoCMSGlobalRedo').remove(); - undoC = 0; - neocmsGlobals() - } -}; -dragOn = function (ele, hand) { - $(ele).draggable({ - handle: hand, start: function () { - $(window).unbind('resize') - } - }); - if ($('#neoCMSEditWrap').length) $('#neoCMSEditWrap').resizable({ - handles: 'all', - alsoResize: '.mceIframeContainer', - start: frameShim - }) -}; \ No newline at end of file diff --git a/cms/js/ui.js b/cms/js/ui.js index a1aefd4..133746f 100644 --- a/cms/js/ui.js +++ b/cms/js/ui.js @@ -50,9 +50,7 @@ getGlobals = function (path, html, files, filePath, exFolders, imagePath) { neoCMSFilePath = filePath; neoCMSImagePath = imagePath; neoCMSExFolders = exFolders; - $('#neoCMSPrefsFrame').load('core/getpath.php', function () { - $('#neoCMSPrefsFrame').remove() - }); + $('#neoCMSPrefsFrame').remove(); // Is this needed? initPage(); setTimeout(function () { $('#neoCMSPageSrc').bind('load', initPage) diff --git a/cms/settings/acct.php b/cms/settings/acct.php deleted file mode 100644 index 94adb4c..0000000 --- a/cms/settings/acct.php +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - neoCMS Settings :: User Info - - - - - - - - - - - - - - - - Username - Password - - - - Email - - - - Add New User Only the account owner has administrative privileges - - - - New User - - Name Please enter a name - Email Please enter a valid email - Username Please enter a username - Password “Medium” or “strong” required. - - n/a “Medium” or “strong” required. - - Confirm Password Must match password - save or cancel - - - - - - \ No newline at end of file diff --git a/cms/settings/dashcheck.php b/cms/settings/dashcheck.php deleted file mode 100644 index ce055b4..0000000 --- a/cms/settings/dashcheck.php +++ /dev/null @@ -1,37 +0,0 @@ - \ No newline at end of file diff --git a/cms/settings/dashfoot.php b/cms/settings/dashfoot.php deleted file mode 100644 index 021cd4f..0000000 --- a/cms/settings/dashfoot.php +++ /dev/null @@ -1,11 +0,0 @@ - - - - Thanks for using neoCMS™ - © Neogate Technologies - - - - - - \ No newline at end of file diff --git a/cms/settings/dashnav.php b/cms/settings/dashnav.php deleted file mode 100644 index 1db5bcf..0000000 --- a/cms/settings/dashnav.php +++ /dev/null @@ -1,29 +0,0 @@ - - - - Back to Editing - - NeoCMS - - logout· - - - - - - - - - Preferences - User Info - FTP Info - - - - - - - - - \ No newline at end of file diff --git a/cms/settings/ftpinfo.php b/cms/settings/ftpinfo.php deleted file mode 100644 index ea2dac7..0000000 --- a/cms/settings/ftpinfo.php +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - neoCMS Settings :: FTP Info - - - - - - - - - - - - - - Please Note: FTP information is not required for most installations of - neocms. If you are encountering file permission issues, save your FTP info here and try publishing/uploading - again. neocms will write your FTP information to an unreadable file on this server. - - - - Your FTP Info - - ServerPlease enter your server – no “ftp.” - - FTP UsernamePlease your FTP username - - FTP PasswordPlease enter your FTP password - - Domain RootPlease enter the path to your site - - - - saveClear all FTP - info - - - - - \ No newline at end of file diff --git a/cms/settings/index.php b/cms/settings/index.php deleted file mode 100644 index fd465e6..0000000 --- a/cms/settings/index.php +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - neoCMS Settings :: Preferences - - - - - - - - - - - - - - Your neocms file path - - - - This is where your neocms files are located. This is also the path you’ll follow to login to - your site’s neocms account to begin editing your site content. Note: - neocms discovers this based on what you name your neocms folder. - - - HTML Editing - - on off - Set this preference to “on” if you want users to be able to directly edit the HTML - markup, or “off” if you do not want users to be able to edit the HTML. - - - Exclude Folders - Enter a comma separated list of folder names or paths you do not want listed in the neocms file - browser. Do not use a “/” at the end fo the path. Ex: “wordpress, .svn, - functions/important” - - Folders - - - - File Uploads - - on off - Set this preference to “on” if you want users to be able to upload files, or “off” - if you do not want users to upload files. There is a 100MB limit on all uploads. - - - To specify a file folder, enter the relative path here. Leave it blank if you want neocms to - auto-discover folders. - Default File Path - - - - - Image Uploads - - To specify an image folder, enter the relative path here. Leave it blank if you want neocms to - auto-discover folders. - - - Default Image Path - - - save - - - - \ No newline at end of file
last upload:
Thanks for using neoCMS™
© Neogate Technologies
Please Note: FTP information is not required for most installations of - neocms. If you are encountering file permission issues, save your FTP info here and try publishing/uploading - again. neocms will write your FTP information to an unreadable file on this server.
This is where your neocms files are located. This is also the path you’ll follow to login to - your site’s neocms account to begin editing your site content. Note: - neocms discovers this based on what you name your neocms folder.
Set this preference to “on” if you want users to be able to directly edit the HTML - markup, or “off” if you do not want users to be able to edit the HTML.
Enter a comma separated list of folder names or paths you do not want listed in the neocms file - browser. Do not use a “/” at the end fo the path. Ex: “wordpress, .svn, - functions/important”
Set this preference to “on” if you want users to be able to upload files, or “off” - if you do not want users to upload files. There is a 100MB limit on all uploads.
To specify a file folder, enter the relative path here. Leave it blank if you want neocms to - auto-discover folders.
To specify an image folder, enter the relative path here. Leave it blank if you want neocms to - auto-discover folders.