Permalink
Browse files

MINOR Changed paths to moved thirdparty dependencies (mostly from /js…

…party to /sapphire/thirdparty, /cms/javascript and /sapphire/javascript)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@92502 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
1 parent 9acde4e commit a11db296723e11e63807ff7ee1eb85ac8cd0037d @chillu chillu committed Nov 21, 2009
View
2 _config.php
@@ -54,7 +54,7 @@
/**
* The root directory of TinyMCE
*/
-define('MCE_ROOT', 'jsparty/tiny_mce/');
+define('MCE_ROOT', 'sapphire/thirdparty/tinymce/');
/**
* The secret key that needs to be sent along with pings to /Email_BounceHandler
View
2 core/Core.php
@@ -100,7 +100,7 @@
define('BASE_URL', rtrim(dirname(dirname($_SERVER['SCRIPT_NAME'])), DIRECTORY_SEPARATOR));
define('MODULES_DIR', 'modules');
define('MODULES_PATH', BASE_PATH . '/' . MODULES_DIR);
-define('THIRDPARTY_DIR', 'jsparty');
+define('THIRDPARTY_DIR', 'sapphire/thirdparty');
define('THIRDPARTY_PATH', BASE_PATH . '/' . THIRDPARTY_DIR);
define('THEMES_DIR', 'themes');
define('THEMES_PATH', BASE_PATH . '/' . THEMES_DIR);
View
4 core/Requirements.php
@@ -137,7 +137,7 @@ static function javascriptTemplate($file, $vars, $uniquenessID = null) {
* Register the given stylesheet file as required.
* See {@link Requirements_Backend::css()}
*
- * @param $file String Filenames should be relative to the base, eg, 'jsparty/tree/tree.css'
+ * @param $file String Filenames should be relative to the base, eg, 'sapphire/javascript/tree/tree.css'
* @param $media String Comma-separated list of media-types (e.g. "screen,projector")
* @see http://www.w3.org/TR/REC-CSS2/media.html
*/
@@ -476,7 +476,7 @@ function javascriptTemplate($file, $vars, $uniquenessID = null) {
/**
* Register the given stylesheet file as required.
*
- * @param $file String Filenames should be relative to the base, eg, 'jsparty/tree/tree.css'
+ * @param $file String Filenames should be relative to the base, eg, 'sapphire/javascript/tree/tree.css'
* @param $media String Comma-separated list of media-types (e.g. "screen,projector")
* @see http://www.w3.org/TR/REC-CSS2/media.html
*/
View
4 core/control/ContentController.php
@@ -290,8 +290,8 @@ public function SilverStripeNavigator() {
if(Director::isDev() || Permission::check('CMS_ACCESS_CMSMain')) {
Requirements::css(SAPPHIRE_DIR . '/css/SilverStripeNavigator.css');
- Requirements::javascript(THIRDPARTY_DIR . '/behaviour.js');
- // Requirements::javascript(THIRDPARTY_DIR . '/prototype.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/behaviour/behaviour.js');
+ // Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/prototype/prototype.js');
Requirements::customScript(<<<JS
Behaviour.register({
'#switchView a' : {
View
9 core/model/SiteTree.php
@@ -167,13 +167,13 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
* -openfolder.gif and -closedfolder.gif will be appended to the base name
* that you provide there.
* If you prefer, you can pass an array:
- * array("jsparty\tree\images\page", $option).
+ * array("sapphire\javascript\tree\images\page", $option).
* $option can be either "file" or "folder" to force the icon to always
* be a file or folder, regardless of whether the page has children or not
*
* @var string|array
*/
- static $icon = array("jsparty/tree/images/page", "file");
+ static $icon = array("sapphire/javascript/tree/images/page", "file");
static $extensions = array(
@@ -1496,9 +1496,8 @@ function rewriteFileURL($old, $new) {
*/
function getCMSFields() {
require_once("forms/Form.php");
- Requirements::javascript(THIRDPARTY_DIR . "/prototype.js");
- Requirements::javascript(THIRDPARTY_DIR . "/behaviour.js");
- Requirements::javascript(THIRDPARTY_DIR . "/behaviour_improvements.js");
+ Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/prototype/prototype.js");
+ Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/behaviour/behaviour.js");
Requirements::javascript(CMS_DIR . "/javascript/SitetreeAccess.js");
Requirements::add_i18n_javascript(SAPPHIRE_DIR . '/javascript/lang');
Requirements::javascript(SAPPHIRE_DIR . '/javascript/UpdateURL.js');
View
2 core/model/YamlFixture.php
@@ -1,6 +1,6 @@
<?php
-require_once 'thirdparty/spyc/Spyc.php';
+require_once 'thirdparty/spyc/spyc.php';
/**
* Uses the Spyc library to parse a YAML document (see http://yaml.org).
View
4 forms/CalendarDateField.php
@@ -16,8 +16,8 @@ static function HTMLField( $id, $name, $val ) {
}
function Field() {
- Requirements::javascript(THIRDPARTY_DIR . '/prototype.js');
- Requirements::javascript(THIRDPARTY_DIR . "/behaviour.js");
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/prototype/prototype.js');
+ Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/behaviour/behaviour.js");
Requirements::javascript(THIRDPARTY_DIR . "/calendar/calendar.js");
Requirements::javascript(THIRDPARTY_DIR . "/calendar/lang/calendar-en.js");
Requirements::javascript(THIRDPARTY_DIR . "/calendar/calendar-setup.js");
View
10 forms/ComplexTableField.php
@@ -1072,11 +1072,11 @@ function forTemplate() {
Requirements::css(SAPPHIRE_DIR . '/css/ComplexTableField_popup.css');
Requirements::css(CMS_DIR . '/css/typography.css');
Requirements::css(CMS_DIR . '/css/cms_right.css');
- Requirements::javascript(THIRDPARTY_DIR . "/prototype.js");
- Requirements::javascript(THIRDPARTY_DIR . "/behaviour.js");
- Requirements::javascript(THIRDPARTY_DIR . "/prototype_improvements.js");
- Requirements::javascript(THIRDPARTY_DIR . "/scriptaculous/scriptaculous.js");
- Requirements::javascript(THIRDPARTY_DIR . "/scriptaculous/controls.js");
+ Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/prototype/prototype.js");
+ Requirements::javascript(SAPPHIRE_dir . "/thirdparty/behaviour/behaviour.js");
+ Requirements::javascript(SAPPHIRE_DIR . "/javascript/prototype_improvements.js");
+ Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/scriptaculous/scriptaculous.js");
+ Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/scriptaculous/scriptaculous/controls.js");
Requirements::javascript(THIRDPARTY_DIR . "/layout_helpers.js");
Requirements::add_i18n_javascript(SAPPHIRE_DIR . '/javascript/lang');
Requirements::javascript(SAPPHIRE_DIR . "/javascript/ComplexTableField_popup.js");
View
6 forms/ConfirmedPasswordField.php
@@ -93,9 +93,9 @@ function __construct($name, $title = null, $value = "", $form = null, $showOnCli
}
function Field() {
- Requirements::javascript(THIRDPARTY_DIR . '/prototype.js');
- Requirements::javascript(THIRDPARTY_DIR . '/behaviour.js');
- Requirements::javascript(THIRDPARTY_DIR . '/prototype_improvements.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/prototype/prototype.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/behaviour/behaviour.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/javascript/prototype_improvements.js');
Requirements::javascript(SAPPHIRE_DIR . '/javascript/ConfirmedPasswordField.js');
$content = '';
View
10 forms/FileIFrameField.php
@@ -49,11 +49,11 @@ public function dataClass() {
* @return string
*/
public function Field() {
- Requirements::css(THIRDPARTY_DIR . '/jquery/themes/default/ui.all.css');
+ Requirements::css(SAPPHIRE_DIR . '/thirdparty/jquery-ui-themes/smoothness/ui.all.css');
Requirements::add_i18n_javascript(SAPPHIRE_DIR . '/javascript/lang');
- Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery-latest.js');
- Requirements::javascript(THIRDPARTY_DIR . '/jquery/ui/ui.core.js');
- Requirements::javascript(THIRDPARTY_DIR . '/jquery/ui/ui.dialog.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery/jquery.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-ui/ui.core.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-ui/ui.dialog.js');
if($this->form->getRecord() && $this->form->getRecord()->exists()) {
return $this->createTag (
@@ -97,7 +97,7 @@ public function iframe() {
// clear the requirements added by any parent controllers
Requirements::clear();
Requirements::add_i18n_javascript('sapphire/javascript/lang');
- Requirements::javascript('jsparty/jquery/jquery-latest.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery/jquery.js');
Requirements::javascript('sapphire/javascript/FileIFrameField.js');
Requirements::css('cms/css/typography.css');
View
5 forms/HtmlEditorConfig.php
@@ -78,14 +78,15 @@ static function get_available_configs_map() {
'safari_warning' => false,
'relative_urls' => true,
- 'verify_html' => true
+ 'verify_html' => true,
+
);
/**
* Holder list of enabled plugins
*/
protected $plugins = array(
- 'contextmenu', 'table', 'emotions', 'paste', '../../tinymce_advcode', 'spellchecker'
+ 'contextmenu', 'table', 'emotions', 'paste', '../../tinymce-advcode', 'spellchecker'
);
/**
View
10 forms/HtmlEditorField.php
@@ -200,7 +200,7 @@ function __construct($controller, $name) {
* @return Form
*/
function LinkForm() {
- Requirements::javascript(THIRDPARTY_DIR . "/behaviour.js");
+ Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/behaviour/behaviour.js");
Requirements::javascript(THIRDPARTY_DIR . "/tiny_mce_improvements.js");
$form = new Form(
@@ -253,12 +253,12 @@ function LinkForm() {
* @return Form
*/
function ImageForm() {
- Requirements::javascript(THIRDPARTY_DIR . "/behaviour.js");
+ Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/behaviour/behaviour.js");
Requirements::javascript(THIRDPARTY_DIR . "/tiny_mce_improvements.js");
Requirements::css('cms/css/TinyMCEImageEnhancement.css');
Requirements::javascript('cms/javascript/TinyMCEImageEnhancement.js');
Requirements::javascript(CMS_DIR . '/javascript/Upload.js');
- Requirements::javascript(THIRDPARTY_DIR . '/SWFUpload/SWFUpload.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/swfupload/swfupload.js');
/**
* @todo Adding folders via this screen is not enabled just yet as it is still
@@ -322,10 +322,10 @@ function ImageForm() {
}
function FlashForm() {
- Requirements::javascript(THIRDPARTY_DIR . "/behaviour.js");
+ Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/behaviour/behaviour.js");
Requirements::javascript(THIRDPARTY_DIR . "/tiny_mce_improvements.js");
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/swfupload/swfupload.js');
Requirements::javascript(CMS_DIR . '/javascript/Upload.js');
- Requirements::javascript(THIRDPARTY_DIR . '/SWFUpload/SWFUpload.js');
$form = new Form(
$this->controller,
View
4 forms/ImageFormAction.php
@@ -22,8 +22,8 @@ function __construct($action, $title = "", $image = "", $hoverImage = null, $cla
parent::__construct($action, $title, $form);
}
function Field() {
- Requirements::javascript(THIRDPARTY_DIR . '/prototype.js');
- Requirements::javascript(THIRDPARTY_DIR . '/behaviour.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/prototype/prototype.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/behaviour/behaviour.js');
Requirements::javascript(SAPPHIRE_DIR . '/javascript/ImageFormAction.js');
$classClause = '';
View
5 forms/SelectionGroup.php
@@ -79,8 +79,9 @@ function hasData() {
}
function FieldHolder() {
- Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
- Requirements::javascript(THIRDPARTY_DIR . '/jquery/plugins/livequery/jquery.livequery.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/prototype/prototype.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/behaviour/behaviour.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/javascript/prototype_improvements.js');
Requirements::javascript(SAPPHIRE_DIR . '/javascript/SelectionGroup.js');
Requirements::css(SAPPHIRE_DIR . '/css/SelectionGroup.css');
View
26 forms/TabSet.php
@@ -49,23 +49,23 @@ public function id() {
* The HTML is a standardised format, containing a &lt;ul;
*/
public function FieldHolder() {
- Requirements::javascript(THIRDPARTY_DIR . "/jquery/jquery-latest.js");
- Requirements::javascript(THIRDPARTY_DIR . "/jquery/jquery_improvements.js");
- Requirements::javascript(THIRDPARTY_DIR . '/jquery/ui/jquery-ui.js');
- Requirements::javascript(THIRDPARTY_DIR . '/jquery/ui/ui.core.js');
- Requirements::javascript(THIRDPARTY_DIR . '/jquery/ui/ui.tabs.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery/jquery.js');
+ Requirements::javascript(SAPPHIRE_DIR . "/javascript/jquery_improvements.js");
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-ui/jquery-ui.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-ui/ui.core.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-ui/ui.tabs.js');
Requirements::javascript(THIRDPARTY_DIR . '/jquery/plugins/fitheighttoparent/jquery.fitheighttoparent.js');
- Requirements::css(THIRDPARTY_DIR . '/jquery/themes/smoothness/ui.all.css');
- Requirements::css(THIRDPARTY_DIR . '/jquery/themes/smoothness/ui.tabs.css');
+ Requirements::css(SAPPHIRE_DIR . '/thirdparty/jquery-ui-themes/smoothness/ui.all.css');
+ Requirements::css(SAPPHIRE_DIR . '/thirdparty/jquery-ui-themes/smoothness/ui.tabs.css');
// concrete
- Requirements::javascript(THIRDPARTY_DIR . '/jquery/plugins/concrete/jquery.class.js');
- Requirements::javascript(THIRDPARTY_DIR . '/jquery/plugins/concrete/jquery.selector.js');
- Requirements::javascript(THIRDPARTY_DIR . '/jquery/plugins/concrete/jquery.selector.specifity.js');
- Requirements::javascript(THIRDPARTY_DIR . '/jquery/plugins/concrete/jquery.selector.matches.js');
- Requirements::javascript(THIRDPARTY_DIR . '/jquery/plugins/concrete/jquery.dat.js');
- Requirements::javascript(THIRDPARTY_DIR . '/jquery/plugins/concrete/jquery.concrete.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-concrete/jquery.class.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-concrete/jquery.selector.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-concrete/jquery.selector.specifity.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-concrete/jquery.selector.matches.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-concrete/jquery.dat.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-concrete/jquery.concrete.js');
Requirements::javascript(SAPPHIRE_DIR . '/javascript/TabSet.js');
View
8 forms/TableField.php
@@ -500,10 +500,10 @@ function getExtraData() {
* Sets the template to be rendered with
*/
function FieldHolder() {
- Requirements::javascript(THIRDPARTY_DIR . '/prototype.js');
- Requirements::javascript(THIRDPARTY_DIR . '/behaviour.js');
- Requirements::javascript(THIRDPARTY_DIR . '/prototype_improvements.js');
- Requirements::javascript(THIRDPARTY_DIR . '/scriptaculous/effects.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/prototype/prototype.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/behaviour/behaviour.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/javascript/prototype_improvements.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/scriptaculous/effects.js');
Requirements::add_i18n_javascript(SAPPHIRE_DIR . '/javascript/lang');
Requirements::javascript(SAPPHIRE_DIR . '/javascript/TableListField.js');
Requirements::javascript(SAPPHIRE_DIR . '/javascript/TableField.js');
View
8 forms/TableListField.php
@@ -284,10 +284,10 @@ function handleItem($request) {
}
function FieldHolder() {
- Requirements::javascript(THIRDPARTY_DIR . '/prototype.js');
- Requirements::javascript(THIRDPARTY_DIR . '/behaviour.js');
- Requirements::javascript(THIRDPARTY_DIR . '/prototype_improvements.js');
- Requirements::javascript(THIRDPARTY_DIR . '/scriptaculous/effects.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/prototype/prototype.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/behaviour/behaviour.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/javascript/prototype_improvements.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/scriptaculous/effects.js');
Requirements::add_i18n_javascript(SAPPHIRE_DIR . '/javascript/lang');
Requirements::javascript(SAPPHIRE_DIR . '/javascript/TableListField.js');
Requirements::css(SAPPHIRE_DIR . '/css/TableListField.css');
View
6 forms/ToggleCompositeField.php
@@ -21,9 +21,9 @@ function __construct($name, $title, $children) {
}
public function FieldHolder() {
- Requirements::javascript(THIRDPARTY_DIR . "/prototype.js");
- Requirements::javascript(THIRDPARTY_DIR . "/behaviour.js");
- Requirements::javascript(THIRDPARTY_DIR . "/prototype_improvements.js");
+ Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/prototype/prototype.js");
+ Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/behaviour/behaviour.js");
+ Requirements::javascript(SAPPHIRE_DIR . "/javascript/prototype_improvements.js");
Requirements::javascript(SAPPHIRE_DIR . "/javascript/ToggleCompositeField.js");
return $this->renderWith("ToggleCompositeField");
View
6 forms/ToggleField.php
@@ -49,9 +49,9 @@ function __construct($name, $title = "", $value = "") {
function Field() {
$content = '';
- Requirements::javascript(THIRDPARTY_DIR . "/prototype.js");
- Requirements::javascript(THIRDPARTY_DIR . "/behaviour.js");
- Requirements::javascript(THIRDPARTY_DIR . "/prototype_improvements.js");
+ Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/prototype/prototype.js");
+ Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/behaviour/behaviour.js");
+ Requirements::javascript(SAPPHIRE_DIR . "/javascript/prototype_improvements.js");
Requirements::javascript(SAPPHIRE_DIR . "/javascript/ToggleField.js");
if($this->startClosed) $this->addExtraClass('startClosed');
View
18 forms/TreeDropdownField.php
@@ -38,16 +38,6 @@ public function __construct($name, $title = null, $sourceObject = 'Group', $keyF
);
}
- Requirements::add_i18n_javascript(SAPPHIRE_DIR . '/javascript/lang');
-
- Requirements::javascript(THIRDPARTY_DIR . '/prototype.js');
- Requirements::javascript(THIRDPARTY_DIR . '/behaviour.js');
- Requirements::javascript(THIRDPARTY_DIR . '/tree/tree.js');
- Requirements::javascript(SAPPHIRE_DIR . '/javascript/TreeSelectorField.js');
-
- Requirements::css(THIRDPARTY_DIR . '/tree/tree.css');
- Requirements::css(SAPPHIRE_DIR . '/css/TreeDropdownField.css');
-
parent::__construct($name, $title);
}
@@ -77,6 +67,14 @@ public function setFilterFunction($callback) {
* @return string
*/
public function Field() {
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/prototype.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/behaviour.js');
+ Requirements::css(SAPPHIRE_DIR . '/css/TreeDropdownField.css');
+ Requirements::javascript(SAPPHIRE_DIR . "/javascript/tree/tree.js");
+ Requirements::css(SAPPHIRE_DIR . "/javascript/tree/tree.css");
+ Requirements::add_i18n_javascript(SAPPHIRE_DIR . '/javascript/lang');
+ Requirements::javascript(SAPPHIRE_DIR . "/javascript/TreeSelectorField.js");
+
if($this->Value() && $record = $this->objectForKey($this->Value())) {
$title = $record->{$this->labelField};
} else {
View
6 forms/Validator.php
@@ -172,9 +172,9 @@ function requireField($fieldName, $data) {
function includeJavascriptValidation() {
if($this->getJavascriptValidationHandler() == 'prototype') {
- Requirements::javascript(THIRDPARTY_DIR . "/prototype.js");
- Requirements::javascript(THIRDPARTY_DIR . "/behaviour.js");
- Requirements::javascript(THIRDPARTY_DIR . "/prototype_improvements.js");
+ Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/prototype/prototype.js");
+ Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/behaviour/behaviour.js");
+ Requirements::javascript(SAPPHIRE_DIR . "/javascript/prototype_improvements.js");
Requirements::add_i18n_javascript(SAPPHIRE_DIR . '/javascript/lang');
Requirements::javascript(SAPPHIRE_DIR . "/javascript/Validator.js");
View
10 security/Member.php
@@ -1320,11 +1320,11 @@ function __construct($controller, $name, $member) {
Requirements::clear();
Requirements::css(CMS_DIR . '/css/typography.css');
Requirements::css(CMS_DIR . '/css/cms_right.css');
- Requirements::javascript(THIRDPARTY_DIR . "/prototype.js");
- Requirements::javascript(THIRDPARTY_DIR . "/behaviour.js");
- Requirements::javascript(THIRDPARTY_DIR . "/prototype_improvements.js");
- Requirements::javascript(THIRDPARTY_DIR . "/scriptaculous/scriptaculous.js");
- Requirements::javascript(THIRDPARTY_DIR . "/scriptaculous/controls.js");
+ Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/prototype/prototype.js");
+ Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/behaviour/behaviour.js");
+ Requirements::javascript(SAPPHIRE_DIR . "/javascript/prototype_improvements.js");
+ Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/scriptaculous/scriptaculous.js");
+ Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/scriptaculous/controls.js");
Requirements::javascript(THIRDPARTY_DIR . "/layout_helpers.js");
Requirements::css(SAPPHIRE_DIR . "/css/Form.css");
View
38 security/Security.php
@@ -338,19 +338,19 @@ public function login() {
// with the tabstrip library otherwise
$link_base = Director::absoluteURL($this->Link("login"));
- Requirements::javascript(THIRDPARTY_DIR . "/jquery/jquery-latest.js");
- Requirements::javascript(THIRDPARTY_DIR . "/jquery/jquery_improvements.js");
- Requirements::javascript(THIRDPARTY_DIR . '/jquery/ui/jquery-ui.js');
- Requirements::javascript(THIRDPARTY_DIR . '/jquery/ui/ui.core.js');
- Requirements::javascript(THIRDPARTY_DIR . '/jquery/ui/ui.tabs.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery/jquery.js');
+ Requirements::javascript(SAPPHIRE_DIR . "/javascript/jquery_improvements.js");
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-ui/jquery-ui.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-ui/ui.core.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-ui/ui.tabs.js');
// concrete
- Requirements::javascript(THIRDPARTY_DIR . '/jquery/plugins/concrete/jquery.class.js');
- Requirements::javascript(THIRDPARTY_DIR . '/jquery/plugins/concrete/jquery.selector.js');
- Requirements::javascript(THIRDPARTY_DIR . '/jquery/plugins/concrete/jquery.selector.specifity.js');
- Requirements::javascript(THIRDPARTY_DIR . '/jquery/plugins/concrete/jquery.selector.matches.js');
- Requirements::javascript(THIRDPARTY_DIR . '/jquery/plugins/concrete/jquery.dat.js');
- Requirements::javascript(THIRDPARTY_DIR . '/jquery/plugins/concrete/jquery.concrete.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-concrete/jquery.class.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-concrete/jquery.selector.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-concrete/jquery.selector.specifity.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-concrete/jquery.selector.matches.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-concrete/jquery.dat.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-concrete/jquery.concrete.js');
Requirements::css(THIRDPARTY_DIR . '/jquery/themes/smoothness/ui.all.css');
Requirements::css(THIRDPARTY_DIR . '/jquery/themes/smoothness/ui.tabs.css');
@@ -407,11 +407,11 @@ function basicauthlogin() {
* @return string Returns the "lost password" page as HTML code.
*/
public function lostpassword() {
- Requirements::javascript(THIRDPARTY_DIR . '/prototype.js');
- Requirements::javascript(THIRDPARTY_DIR . '/behaviour.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/prototype/prototype.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/behaviour/behaviour.js');
Requirements::javascript(THIRDPARTY_DIR . '/loader.js');
- Requirements::javascript(THIRDPARTY_DIR . '/prototype_improvements.js');
- Requirements::javascript(THIRDPARTY_DIR . '/scriptaculous/effects.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/javascript/prototype_improvements.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/scriptaculous/effects.js');
$tmpPage = new Page();
$tmpPage->Title = _t('Security.LOSTPASSWORDHEADER', 'Lost Password');
@@ -466,11 +466,11 @@ public function LostPasswordForm() {
* @return string Returns the "password sent" page as HTML code.
*/
public function passwordsent($request) {
- Requirements::javascript(THIRDPARTY_DIR . '/behaviour.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/behaviour/behaviour.js');
Requirements::javascript(THIRDPARTY_DIR . '/loader.js');
- Requirements::javascript(THIRDPARTY_DIR . '/prototype.js');
- Requirements::javascript(THIRDPARTY_DIR . '/prototype_improvements.js');
- Requirements::javascript(THIRDPARTY_DIR . '/scriptaculous/effects.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/prototype/prototype.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/javascript/prototype_improvements.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/scriptaculous/effects.js');
$tmpPage = new Page();
$tmpPage->Title = _t('Security.LOSTPASSWORDHEADER');
View
2 tasks/RemoveOrphanedPagesTask.php
@@ -61,7 +61,7 @@ function init() {
}
function index() {
- Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery-latest.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery/jquery.js');
Requirements::customCSS('#OrphanIDs .middleColumn {width: auto;}');
Requirements::customCSS('#OrphanIDs label {display: inline;}');
View
455 thirdparty/greybox/greybox.js
@@ -0,0 +1,455 @@
+/****
+ Last Modified: 25/08/06 20:52:59
+
+ CAUTION: Modified Version to suit Silverstripe CMS (www.silverstripe.com).
+ Original at http://orangoo.com/labs/uploads/GreyBox_v3_46.zip
+
+ GreyBox - Smart pop-up window
+ Copyright Amir Salihefendic 2006
+ AUTHOR
+ 4mir Salihefendic (http://amix.dk) - amix@amix.dk
+ VERSION
+ 3.46
+ LICENSE
+ GPL (read more in GPL.txt)
+ SITE
+ http://orangoo.com/labs/GreyBox/
+****/
+var GB_CURRENT = null;
+var GB_ONLY_ONE = null;
+// modified 2006-01-06 by Silverstripe Ltd.
+try {
+ var theBaseHref = document.getElementsByTagName("base")[0].href;
+ var GB_IMG_DIR = theBaseHref + "sapphire/thirdparty/greybox/";
+} catch(err) {
+ var GB_IMG_DIR = "sapphire/thirdparty/greybox/";
+}
+
+function GreyBox() {
+ //Use mutator functions (since the internal stuff may change in the future)
+ this.type = "page";
+ this.overlay_click_close = true;
+
+ if(GB_IMG_DIR)
+ this.img_dir = GB_IMG_DIR;
+ else
+ this.img_dir = "greybox/";
+
+ this.overlay_color = "dark";
+
+ this.center_window = false;
+
+ this.g_window = null;
+ this.g_container = null;
+ this.iframe = null;
+ this.overlay = null;
+ this.timeout = null;
+
+ this.defaultSize();
+ this.showCloseImage(true);
+
+ this.url = "";
+ this.caption = "";
+
+ this.callback_fn = [];
+ this.reload_on_close = false;
+}
+
+////
+// Configuration functions (the functions you can call)
+//
+/**
+ Set the width and height of the GreyBox window.
+ Images and notifications are auto-set.
+ **/
+GreyBox.prototype.setDimension = function(width, height) {
+ this.height = height;
+ this.width = width;
+}
+
+GreyBox.prototype.setFullScreen = function(bool) {
+ this.full_screen = bool;
+}
+
+/**
+ Type can be: page, image
+ **/
+GreyBox.prototype.setType = function(type) {
+ this.type = type;
+}
+
+/**
+ If bool is true the window will be centered vertically also
+ **/
+GreyBox.prototype.setCenterWindow = function(bool) {
+ this.center_window = bool;
+}
+
+/**
+ Set the path where images can be found.
+ Can be relative: greybox/
+ Or absolute: http://yoursite.com/greybox/
+ **/
+GreyBox.prototype.setImageDir = function(dir) {
+ this.img_dir = dir;
+}
+
+GreyBox.prototype.showCloseImage = function(bool) {
+ this.show_close_img = bool;
+}
+
+/**
+ If bool is true the grey overlay click will close greybox.
+ **/
+GreyBox.prototype.setOverlayCloseClick = function(bool) {
+ this.overlay_click_close = bool;
+}
+
+/**
+ Overlay can either be "light" or "dark".
+ **/
+GreyBox.prototype.setOverlayColor = function(color) {
+ this.overlay_color = color;
+}
+
+/**
+ Set a function that will be called when GreyBox closes
+ **/
+GreyBox.prototype.setCallback = function(fn) {
+ if(fn)
+ this.callback_fn.push(fn);
+}
+
+
+////
+// Show hide functions
+//
+/**
+ Show the GreyBox with a caption and an url
+ **/
+GreyBox.prototype.show = function(caption, url) {
+ GB_CURRENT = this;
+
+ this.url = url;
+ this.caption = caption;
+
+ //Be sure that the old loader and dummy_holder are removed
+ AJS.map(AJS.$bytc("div", "GB_dummy"), function(elm) { AJS.removeElement(elm) });
+ AJS.map(AJS.$bytc("div", "GB_loader"), function(elm) { AJS.removeElement(elm) });
+
+ //If ie, hide select, in others hide flash
+ if(AJS.isIe())
+ AJS.map(AJS.$bytc("select"), function(elm) {elm.style.visibility = "hidden"});
+ AJS.map(AJS.$bytc("object"), function(elm) {elm.style.visibility = "hidden"});
+
+ this.initOverlayIfNeeded();
+
+ this.setOverlayDimension();
+ AJS.showElement(this.overlay);
+ this.setFullScreenOption();
+
+ this.initIfNeeded();
+
+ AJS.hideElement(this.g_window);
+
+ AJS.ACN(this.g_container, this.iframe);
+
+ if(caption == "")
+ caption = "&nbsp;";
+ this.div_caption.innerHTML = caption;
+
+ AJS.showElement(this.g_window)
+
+ this.setVerticalPosition();
+ this.setWidthNHeight();
+ this.setTopNLeft();
+
+ GB_CURRENT.startLoading();
+
+ return false;
+}
+
+GreyBox.prototype.hide = function() {
+ AJS.hideElement(this.g_window, this.overlay);
+
+ try{ AJS.removeElement(this.iframe); }
+ catch(e) {}
+
+ this.iframe = null;
+
+ if(this.type == "image") {
+ this.width = 200;
+ this.height = 200;
+ }
+
+ if(AJS.isIe())
+ AJS.map(AJS.$bytc("select"), function(elm) {elm.style.visibility = "visible"});
+ AJS.map(AJS.$bytc("object"), function(elm) {elm.style.visibility = "visible"});
+
+ var c_bs = GB_CURRENT.callback_fn;
+ if(c_bs != []) {
+ AJS.map(c_bs, function(fn) {
+ fn();
+ });
+ }
+
+ GB_CURRENT = null;
+
+ if(this.reload_on_close)
+ window.location.reload();
+}
+
+/**
+ If you only use one instance of GreyBox
+ **/
+GB_initOneIfNeeded = function() {
+ if(!GB_ONLY_ONE) {
+ GB_ONLY_ONE = new GreyBox();
+ }
+}
+
+GB_show = function(caption, url, /* optional */ height, width, callback_fn) {
+ GB_initOneIfNeeded();
+ GB_ONLY_ONE.defaultSize();
+ GB_ONLY_ONE.setFullScreen(false);
+ GB_ONLY_ONE.setType("page");
+ GB_ONLY_ONE.setCallback(callback_fn);
+ GB_ONLY_ONE.setDimension(width, height);
+ GB_ONLY_ONE.show(caption, url);
+ return false;
+}
+
+GB_showFullScreen = function(caption, url, /* optional */ callback_fn) {
+ GB_initOneIfNeeded();
+ GB_ONLY_ONE.defaultSize();
+ GB_ONLY_ONE.setType("page");
+
+ GB_ONLY_ONE.setCallback(callback_fn);
+ GB_ONLY_ONE.setFullScreen(true);
+ GB_ONLY_ONE.show(caption, url);
+ return false;
+}
+
+GB_showImage = function(caption, url) {
+ GB_initOneIfNeeded();
+ GB_ONLY_ONE.defaultSize();
+ GB_ONLY_ONE.setFullScreen(false);
+ GB_ONLY_ONE.setType("image");
+
+ GB_ONLY_ONE.show(caption, url);
+ return false;
+}
+
+GB_hide = function() {
+ GB_CURRENT.hide();
+}
+
+/**
+ Preload all the images used by GreyBox. Static function
+ **/
+GreyBox.preloadGreyBoxImages = function(img_dir) {
+ var pics = [];
+
+ if(!img_dir)
+ img_dir = GB_IMG_DIR;
+
+ var fn = function(path) {
+ var pic = new Image();
+ pic.src = GB_IMG_DIR + path;
+ pics.push(pic);
+ };
+ AJS.map(['indicator.gif', 'blank.gif', 'close.gif', 'header_bg.gif', 'overlay_light.png', 'overlay_dark.png'], AJS.$b(fn, this));
+}
+
+
+////
+// Internal functions
+//
+GreyBox.prototype.getOverlayImage = function() {
+ return "overlay_" + this.overlay_color + ".png";
+};
+
+/**
+ Init functions
+ **/
+GreyBox.prototype.initOverlayIfNeeded = function() {
+ //Create the overlay
+ this.overlay = AJS.DIV({'id': 'GB_overlay'});
+ if(AJS.isIe()) {
+ this.overlay.style.backgroundColor = "#000000";
+ this.overlay.style.backgroundColor = "transparent";
+ this.overlay.style.backgroundImage = "url("+ this.img_dir +"blank.gif)";
+ this.overlay.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.img_dir + this.getOverlayImage() + "',sizingMethod='scale')";
+ }
+ else
+ this.overlay.style.backgroundImage = "url("+ this.img_dir + this.getOverlayImage() +")";
+
+ if(this.overlay_click_close)
+ AJS.AEV(this.overlay, "click", GB_hide);
+
+ AJS.getBody().insertBefore(this.overlay, AJS.getBody().firstChild);
+};
+
+GreyBox.prototype.initIfNeeded = function() {
+ this.init();
+ this.setWidthNHeight = AJS.$b(this.setWidthNHeight, this);
+ this.setTopNLeft = AJS.$b(this.setTopNLeft, this);
+ this.setFullScreenOption = AJS.$b(this.setFullScreenOption, this);
+ this.setOverlayDimension = AJS.$b(this.setOverlayDimension, this);
+
+ GreyBox.addOnWinResize(this.setWidthNHeight, this.setTopNLeft, this.setFullScreenOption, this.setOverlayDimension);
+
+ this.g_container.style.marginBottom = "-3px";
+
+ var fn = function() {
+ this.setOverlayDimension();
+ this.setVerticalPosition();
+ this.setTopNLeft();
+ this.setWidthNHeight();
+ };
+ AJS.AEV(window, "scroll", AJS.$b(fn, this));
+
+ if(!this.iframe) {
+ var new_frame;
+ var d = {'name': 'GB_frame', 'class': 'GB_frame', 'frameBorder': 0};
+ new_frame = AJS.IFRAME(d);
+ this.iframe = new_frame;
+ AJS.hideElement(this.iframe);
+ }
+}
+
+GreyBox.prototype.init = function() {
+ //Create the window
+ this.g_window = AJS.DIV({'id': 'GB_window'});
+
+ //Create the table structure
+ var table = AJS.TABLE({'class': 'GB_t_frame', 'frameborder': 0});
+ var tbody = AJS.TBODY();
+ AJS.ACN(table, tbody);
+
+ //Midlle
+ var td_middle_m = AJS.TD({'class': 'GB_content'});
+ this.td_middle_m = td_middle_m;
+
+ AJS.ACN(tbody, AJS.TR(td_middle_m));
+
+ //Append caption and close
+ var header = AJS.TABLE({'class': 'GB_header'});
+ this.header = header;
+
+ var caption = AJS.TD({'class': 'GB_caption'});
+ this.div_caption = caption;
+
+ /*header.style.backgroundImage = "url("+ this.img_dir +"header_bg.gif)";*/
+
+ tbody_header = AJS.TBODY();
+ var close = AJS.TD({'class': 'GB_close'});
+
+ if(this.show_close_img) {
+ var img_close = AJS.IMG({'src': this.img_dir + 'close.gif'});
+ AJS.ACN(close, img_close, "Close");
+ AJS.AEV(close, "click", GB_hide);
+ }
+ AJS.ACN(tbody_header, AJS.TR(caption, close));
+
+ AJS.ACN(header, tbody_header);
+
+ AJS.ACN(td_middle_m, header);
+
+ //Container
+ this.g_container = AJS.DIV({'class': 'GB_container'});
+ AJS.ACN(td_middle_m, this.g_container);
+
+ AJS.ACN(this.g_window, table);
+
+ AJS.getBody().insertBefore(this.g_window, this.overlay.nextSibling);
+}
+
+GreyBox.prototype.startLoading = function() {
+ //Start preloading the object
+ this.iframe.src = this.img_dir + 'loader_frame.html';
+ AJS.showElement(this.iframe);
+}
+
+/**
+ Set dimension functions
+ **/
+GreyBox.prototype.setIframeWidthNHeight = function() {
+ try{
+ AJS.setWidth(this.iframe, this.width);
+ AJS.setHeight(this.iframe, this.height);
+ }
+ catch(e) {
+ }
+}
+
+GreyBox.prototype.setOverlayDimension = function() {
+ var page_size = AJS.getWindowSize();
+ if((navigator.userAgent.toLowerCase().indexOf("firefox") != -1))
+ AJS.setWidth(this.overlay, "100%");
+ else
+ AJS.setWidth(this.overlay, page_size.w);
+
+ var max_height = Math.max(AJS.getScrollTop()+page_size.h, AJS.getScrollTop()+this.height);
+ if(max_height < AJS.getScrollTop())
+ AJS.setHeight(this.overlay, max_height);
+ else
+ AJS.setHeight(this.overlay, AJS.getScrollTop()+page_size.h);
+}
+
+GreyBox.prototype.setWidthNHeight = function() {
+ //Set size
+ AJS.setWidth(this.g_window, this.width);
+ AJS.setHeight(this.g_window, this.height);
+
+ AJS.setWidth(this.g_container, this.width);
+ AJS.setHeight(this.g_container, this.height);
+
+ this.setIframeWidthNHeight();
+
+ //Set size on components
+ AJS.setWidth(this.td_middle_m, this.width+10);
+}
+
+/**
+ * Modified 2006-10-08 by Silverstripe
+ */
+GreyBox.prototype.setTopNLeft = function() {
+ var page_size = AJS.getWindowSize();
+ AJS.setLeft(this.g_window, ((page_size.w - this.width)/2)-13);
+
+ var fl = ((page_size.h - this.height) /2) - 15 + AJS.getScrollTop();
+ AJS.setTop(this.g_window, fl);
+}
+
+GreyBox.prototype.setVerticalPosition = function() {
+ var page_size = AJS.getWindowSize();
+ var st = AJS.getScrollTop();
+ if(this.g_window.offsetWidth <= page_size.h || st <= this.g_window.offsetTop) {
+ AJS.setTop(this.g_window, st);
+ }
+}
+
+GreyBox.prototype.setFullScreenOption = function() {
+ if(this.full_screen) {
+ var page_size = AJS.getWindowSize();
+
+ overlay_h = page_size.h;
+
+ this.width = Math.round(this.overlay.offsetWidth - (this.overlay.offsetWidth/100)*10);
+ this.height = Math.round(overlay_h - (overlay_h/100)*10);
+ }
+}
+
+GreyBox.prototype.defaultSize = function() {
+ this.width = 300;
+ this.height = 300;
+}
+
+////
+// Misc.
+//
+GreyBox.addOnWinResize = function(funcs) {
+ funcs = AJS.$A(funcs);
+ AJS.map(funcs, function(fn) { AJS.AEV(window, "resize", fn); });
+}

0 comments on commit a11db29

Please sign in to comment.