├── .editorconfig ├── .gitattributes ├── README.md ├── _config.php ├── code ├── FEUtils.php ├── controllers │ ├── FrontendEditing.php │ └── SimpleTreeController.php ├── extensions │ ├── FrontendEditableExtension.php │ └── FrontendLockable.php └── pages │ ├── FrontendCreatable.php │ └── PageCreatorPage.php ├── composer.json ├── css ├── ajax-loader.gif ├── edit-controls.css ├── page-editor.css └── toolbar.png ├── images └── page.png ├── javascript ├── _manifest_exclude ├── ajax-loader.gif ├── api-based-page-editor.js ├── controller-based-page-editor.js ├── edit-controls.js ├── jquery-1.4.1.min.js ├── jquery.hotkeys.min.js ├── jquery.jgrowl.css ├── jquery.jgrowl_minimized.js ├── jquery.json.js ├── jstree-0.9.9a2 │ ├── README.txt │ ├── changelog.txt │ ├── demo │ │ ├── async_html.html │ │ ├── async_html_data.txt │ │ ├── async_json.html │ │ ├── async_json_data.json │ │ ├── async_xml_flat.html │ │ ├── async_xml_flat_data.xml │ │ ├── basic_html.html │ │ ├── basic_json.html │ │ ├── basic_xml_flat.html │ │ ├── basic_xml_flat_data.xml │ │ ├── basic_xml_nested.html │ │ ├── basic_xml_nested_data.xml │ │ ├── callbacks.html │ │ ├── checkbox.html │ │ ├── context.html │ │ ├── cookie.html │ │ ├── create.html │ │ ├── delete.html │ │ ├── drive.png │ │ ├── file.png │ │ ├── index.html │ │ ├── json_languages.html │ │ ├── keyboard.html │ │ ├── metadata.html │ │ ├── move_copy.html │ │ ├── open_close.html │ │ ├── rename.html │ │ ├── rollback.html │ │ ├── search.html │ │ ├── select.html │ │ ├── static_async_json.html │ │ ├── syntax │ │ │ ├── clipboard.swf │ │ │ ├── help.png │ │ │ ├── magnifier.png │ │ │ ├── page_white_code.png │ │ │ ├── page_white_copy.png │ │ │ ├── printer.png │ │ │ ├── shBrushJScript.js │ │ │ ├── shBrushPhp.js │ │ │ ├── shBrushXml.js │ │ │ ├── shCore.css │ │ │ ├── shCore.js │ │ │ ├── shThemeDefault.css │ │ │ ├── shThemeDjango.css │ │ │ ├── shThemeEmacs.css │ │ │ ├── shThemeFadeToGrey.css │ │ │ ├── shThemeMidnight.css │ │ │ ├── shThemeRDark.css │ │ │ └── wrapping.png │ │ ├── themeroller.html │ │ ├── themes.html │ │ ├── types.html │ │ ├── xml_flat_from_string.html │ │ ├── xml_flat_with_languages.html │ │ └── xml_nested_with_languages.html │ ├── documentation.html │ ├── documentation_plugins.html │ ├── jquery.tree.js │ ├── lib │ │ ├── jquery.cookie.js │ │ ├── jquery.hotkeys.js │ │ ├── jquery.js │ │ ├── jquery.metadata.js │ │ └── sarissa.js │ ├── plugins │ │ ├── _jquery.tree.rtl.js │ │ ├── jquery.tree.checkbox.js │ │ ├── jquery.tree.contextmenu.js │ │ ├── jquery.tree.cookie.js │ │ ├── jquery.tree.hotkeys.js │ │ ├── jquery.tree.metadata.js │ │ ├── jquery.tree.themeroller.js │ │ ├── jquery.tree.xml_flat.js │ │ └── jquery.tree.xml_nested.js │ └── themes │ │ ├── apple │ │ ├── bg.jpg │ │ ├── dot_for_ie.gif │ │ ├── icons.png │ │ ├── style.css │ │ └── throbber.gif │ │ ├── checkbox │ │ ├── dot_for_ie.gif │ │ ├── icons.png │ │ ├── style.css │ │ └── throbber.gif │ │ ├── classic │ │ ├── dot_for_ie.gif │ │ ├── icons.png │ │ ├── style.css │ │ └── throbber.gif │ │ ├── default │ │ ├── dot_for_ie.gif │ │ ├── icons.png │ │ ├── style.css │ │ └── throbber.gif │ │ └── themeroller │ │ ├── dot_for_ie.gif │ │ ├── icons.png │ │ ├── style.css │ │ └── throbber.gif ├── jstree │ ├── jquery.tree.js │ ├── lib │ │ ├── jquery.cookie.js │ │ ├── jquery.hotkeys.js │ │ ├── jquery.js │ │ ├── jquery.metadata.js │ │ └── sarissa.js │ ├── plugins │ │ ├── _jquery.tree.rtl.js │ │ ├── jquery.tree.checkbox.js │ │ ├── jquery.tree.contextmenu.js │ │ ├── jquery.tree.cookie.js │ │ ├── jquery.tree.hotkeys.js │ │ ├── jquery.tree.metadata.js │ │ ├── jquery.tree.themeroller.js │ │ ├── jquery.tree.xml_flat.js │ │ └── jquery.tree.xml_nested.js │ └── themes │ │ ├── apple │ │ ├── bg.jpg │ │ ├── dot_for_ie.gif │ │ ├── icons.png │ │ ├── style.css │ │ └── throbber.gif │ │ ├── checkbox │ │ ├── dot_for_ie.gif │ │ ├── icons.png │ │ ├── style.css │ │ └── throbber.gif │ │ ├── classic │ │ ├── dot_for_ie.gif │ │ ├── icons.png │ │ ├── style.css │ │ └── throbber.gif │ │ ├── default │ │ ├── dot_for_ie.gif │ │ ├── icons.png │ │ ├── style.css │ │ └── throbber.gif │ │ └── themeroller │ │ ├── dot_for_ie.gif │ │ ├── icons.png │ │ ├── style.css │ │ └── throbber.gif ├── nicEdit.js ├── nicEditDev.js ├── nicEditorIcons.gif ├── nicedit-class-selector.js ├── nicedit-image-selector.js ├── nicedit-mods.txt ├── nicedit-table.js ├── nicedit-url-selector.js ├── page-editor.js ├── save.png ├── table_add.png └── tick.png ├── lang └── en_US.php └── templates └── Includes └── FrontendEditingControls.ss /.editorconfig: -------------------------------------------------------------------------------- 1 | # For more information about the properties used in this file, 2 | # please see the EditorConfig documentation: 3 | # http://editorconfig.org 4 | 5 | [*] 6 | charset = utf-8 7 | end_of_line = lf 8 | indent_size = 4 9 | indent_style = space 10 | insert_final_newline = true 11 | trim_trailing_whitespace = true 12 | 13 | [{*.yml,package.json}] 14 | indent_size = 2 15 | 16 | # The indent size used in the package.json file cannot be changed: 17 | # https://github.com/npm/npm/pull/3180#issuecomment-16336516 18 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | /tests export-ignore 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # Frontend Editing Module 3 | 4 | ## Maintainer Contact 5 | 6 | Marcus Nyeholt 7 | 8 | 9 | 10 | ## Requirements 11 | 12 | SilverStripe 3.0 13 | 14 | ## Documentation 15 | 16 | SilverStripe 2.4 version still available in the ss24 branch 17 | 18 | The frontend editing module adds the ability to edit HTML based content on 19 | the frontend of your website. Developers specify in their templates the 20 | fields they want to be able to edit, add an include for buttons to help with 21 | switching between edit and standard views, and that's all there is to it. 22 | 23 | Add the following to your project's configuration.yml file 24 | 25 | ```` 26 | --- 27 | Name: frontend_config 28 | --- 29 | SiteTree: 30 | extensions: 31 | - FrontendEditableExtension 32 | 33 | ``` 34 | 35 | In the templates for the page types you would like editable, add the 36 | following in place of raw output fields - for example, instead of `$Content`, 37 | use 38 | 39 | ```` 40 | $EditableField(Content) 41 | ```` 42 | 43 | As well as single fields of the current page, you can use it on 44 | other objects contained in a control block (so long as those 45 | objects have the EditableExtension) 46 | 47 | ```` 48 | 53 | ```` 54 | 55 | Also in your template, add the following at the top. It includes some 56 | controls for initiating the editor (if you want them). You can provide 57 | your own mechanism for launching the editor, but this is simpler :) 58 | 59 | ```` 60 | <% include FrontendEditingControls %> 61 | ```` 62 | 63 | 64 | **NOTE** after adding the above, when navigating to a page in 'Live' mode, 65 | if you have edit access to the page, hovering your mouse over the bottom 66 | right corner of the screen will display controls for launching the edit 67 | mode. In "Stage" view, these controls should appear immediately. 68 | 69 | ## API 70 | 71 | **Defining new plugins for the editor** 72 | 73 | 74 | @TODO - for now, see nicedit-image-selector.js or nicedit-url-selector.js as 75 | examples. 76 | 77 | ## Troubleshooting 78 | 79 | * Appending `?stage=Stage&startEditing=true` to the current URL will 80 | open the editor immediately; if this does _not_ happen, check your JS error 81 | console! -------------------------------------------------------------------------------- /_config.php: -------------------------------------------------------------------------------- 1 | 'FrontendEditing_Controller', 9 | LOCKABLE_PREFIX.'//$Action//$ID' => 'LockableController', 10 | TREE_PREFIX.'//$Action//$ID' => 'SimpleTreeController', 11 | 12 | )); 13 | 14 | if (($FRONTEND_EDITING_MODULE = basename(dirname(__FILE__))) != 'frontend-editing') { 15 | die("The Frontend Editing module MUST be in the /frontend-editing directory, not $FRONTEND_EDITING_MODULE"); 16 | } 17 | 18 | // Add something like the following for pages that you are going to use frontend editing on 19 | // DataObject::add_extension('Page', 'FrontendEditableExtension'); 20 | // DataObject::add_extension('Page', 'FrontendLockable'); 21 | // 22 | // Then, in templates, use $EditableField() to have an html editable field 23 | // 24 | 25 | -------------------------------------------------------------------------------- /code/FEUtils.php: -------------------------------------------------------------------------------- 1 | 1) 33 | * 34 | * 35 | * 36 | * @param unknown_type $filter 37 | * @return unknown_type 38 | */ 39 | function dbQuote($filter = array(), $join = " AND ") { 40 | $QUOTE_CHAR = defined('DB::USE_ANSI_SQL') ? '"' : ''; 41 | 42 | $string = ''; 43 | $sep = ''; 44 | 45 | foreach ($filter as $field => $value) { 46 | // first break the field up into its two components 47 | $operator = ''; 48 | if (is_string($field)) { 49 | list($field, $operator) = explode(' ', trim($field)); 50 | } 51 | 52 | if (is_array($value)) { 53 | // quote each individual one into a string 54 | $ins = ''; 55 | $insep = ''; 56 | foreach ($value as $v) { 57 | $ins .= $insep . Convert::raw2sql($v); 58 | $insep = ','; 59 | } 60 | $value = '('.$ins.')'; 61 | } else if (is_null($value)) { 62 | $value = 'NULL'; 63 | } else if (is_string($field)) { 64 | $value = "'" . Convert::raw2sql($value) . "'"; 65 | } 66 | 67 | if (strpos($field, '.')) { 68 | list($tb, $fl) = explode('.', $field); 69 | $string .= $sep . $QUOTE_CHAR . $tb . $QUOTE_CHAR . '.' . $QUOTE_CHAR . $fl . $QUOTE_CHAR . " $operator " . $value; 70 | } else { 71 | if (is_numeric($field)) { 72 | $string .= $sep . $value; 73 | } else { 74 | $string .= $sep . $QUOTE_CHAR . $field . $QUOTE_CHAR . " $operator " . $value; 75 | } 76 | } 77 | 78 | $sep = $join; 79 | } 80 | 81 | return $string; 82 | } 83 | 84 | function log($message, $level=null) { 85 | if (!$level) { 86 | $level = SS_Log::NOTICE; 87 | } 88 | $message = array( 89 | 'errno' => '', 90 | 'errstr' => $message, 91 | 'errfile' => dirname(__FILE__), 92 | 'errline' => '', 93 | 'errcontext' => '' 94 | ); 95 | 96 | SS_Log::log($message, $level); 97 | } 98 | 99 | public function ajaxResponse($message, $status) { 100 | return Convert::raw2json(array( 101 | 'message' => $message, 102 | 'status' => $status, 103 | )); 104 | } 105 | } -------------------------------------------------------------------------------- /code/controllers/SimpleTreeController.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | class SimpleTreeController extends Controller { 9 | 10 | private static $allowed_actions = array( 11 | 'childnodes', 12 | ); 13 | 14 | /** 15 | * Request nodes from the server 16 | * 17 | * @param SS_HTTPRequest $request 18 | * @return JSONString 19 | */ 20 | public function childnodes($request) { 21 | $data = array(); 22 | 23 | $rootObjectType = 'SiteTree'; 24 | if ($request->param('ID')) { 25 | $rootObjectType = $request->param('ID'); 26 | } 27 | 28 | if ($request->getVar('search')) { 29 | return $this->performSearch($request->getVar('search'), $rootObjectType); 30 | } 31 | 32 | $parentId = $request->getVar('id'); 33 | if (!$parentId) { 34 | $parentId = $rootObjectType . '-0'; 35 | } 36 | 37 | $selectable = null; 38 | 39 | if ($request->param('OtherID')) { 40 | $selectable = explode(',', $request->param('OtherID')); 41 | } 42 | 43 | list($type, $id) = explode('-', $parentId); 44 | if (!$type || $id < 0) { 45 | $data = array(0 => array('data' => 'An error has occurred')); 46 | } else { 47 | $children = null; 48 | if ($id == 0) { 49 | $children = DataObject::get($rootObjectType, 'ParentID = 0'); 50 | } else { 51 | $object = DataObject::get_by_id($type, $id); 52 | $children = $this->childrenOfNode($object); 53 | } 54 | 55 | $data = array(); 56 | if ($children && count($children)) { 57 | foreach ($children as $child) { 58 | if ($child->ID < 0) { 59 | continue; 60 | } 61 | 62 | 63 | $haskids = $child->numChildren() > 0; 64 | $nodeData = array( 65 | 'title' => isset($child->MenuTitle) ? $child->MenuTitle : $child->Title, 66 | ); 67 | if ($selectable && !in_array($child->ClassName, $selectable)) { 68 | $nodeData['clickable'] = false; 69 | } 70 | 71 | $thumbs = null; 72 | if ($child->ClassName == 'Image') { 73 | $thumbs = $this->generateThumbnails($child); 74 | $nodeData['icon'] = $thumbs['x16']; 75 | } else if (!$haskids) { 76 | $nodeData['icon'] = 'frontend-editing/images/page.png'; 77 | } 78 | 79 | $nodeEntry = array( 80 | 'attributes' => array('id' => $child->ClassName . '-' . $child->ID, 'title' => Convert::raw2att($nodeData['title']), 'link' => $child->RelativeLink()), 81 | 'data' => $nodeData, 82 | 'state' => $haskids ? 'closed' : 'open' 83 | ); 84 | 85 | if ($thumbs) { 86 | $nodeEntry['thumbs'] = $thumbs; 87 | } 88 | 89 | $data[] = $nodeEntry; 90 | } 91 | } 92 | } 93 | 94 | return Convert::raw2json($data); 95 | } 96 | 97 | /** 98 | * Called to generate thumbnails before sending the image data back 99 | * 100 | * @param Image $image 101 | */ 102 | protected function generateThumbnails(Image $image) { 103 | $thumbs = array(); 104 | $thumbs['x16'] = $image->SetRatioSize(16, 16)->Link(); 105 | $thumbs['x128'] = $image->SetRatioSize(128, 128)->Link(); 106 | return $thumbs; 107 | } 108 | 109 | /** 110 | * Method to work around bug where Hierarchy.php directly refers to 111 | * ShowInMenus, which is only available on SiteTree 112 | * 113 | * @param DataObject $node 114 | * @return DataObjectSet 115 | */ 116 | protected function childrenOfNode($node) { 117 | $result = $node->stageChildren(true); 118 | if (isset($result)) { 119 | foreach ($result as $child) { 120 | if (!$child->canView()) { 121 | $result->remove($child); 122 | } 123 | } 124 | } 125 | 126 | return $result; 127 | } 128 | 129 | /** 130 | * Search for a node based on the passed in criteria. The output is a list 131 | * of nodes that should be opened from the top down 132 | * 133 | */ 134 | protected function performSearch($query, $rootObjectType = 'SiteTree') { 135 | $item = null; 136 | 137 | if (preg_match('/\[sitetree_link id=([0-9]+)\]/i', $query, $matches)) { 138 | $item = DataObject::get_by_id($rootObjectType, $matches[1]); 139 | } else if (preg_match('/^assets\//', $query)) { 140 | // search for the file based on its filepath 141 | $item = DataObject::get_one($rootObjectType, singleton('FEUtils')->dbQuote(array('Filename =' => $query))); 142 | } 143 | 144 | if ($item && $item->ID) { 145 | $items = array(); 146 | while ($item->ParentID != 0) { 147 | array_unshift($items, $rootObjectType . '-' . $item->ID); 148 | $item = $item->Parent(); 149 | } 150 | 151 | array_unshift($items, $rootObjectType . '-' . $item->ID); 152 | return implode(',', $items); 153 | } 154 | 155 | return ''; 156 | } 157 | 158 | } 159 | -------------------------------------------------------------------------------- /code/pages/FrontendCreatable.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | interface FrontendCreatable 9 | { 10 | public function getFrontendCreateFields(); 11 | } -------------------------------------------------------------------------------- /code/pages/PageCreatorPage.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | class PageCreatorPage extends Page 9 | { 10 | public static $additional_types = array(); 11 | 12 | public static $db = array( 13 | 'CreateType' => 'Varchar(32)', 14 | ); 15 | 16 | public static $has_one = array( 17 | 'CreateLocation' => 'Page', 18 | ); 19 | 20 | public static $allowed_actions = array( 21 | 'CreateForm', 22 | 'createpage', 23 | ); 24 | 25 | public function getCMSFields() { 26 | $fields = parent::getCMSFields(); 27 | 28 | $types = ClassInfo::implementorsOf('FrontendCreatable'); 29 | 30 | if (!$types) { 31 | $types = array(); 32 | } 33 | 34 | $types = array_merge($types, self::$additional_types); 35 | 36 | $types = array_combine($types, $types); 37 | 38 | $fields->addFieldToTab('Root.Content.Main', new DropdownField('CreateType', _t('FrontendEditing.CREATE_TYPE', 'Create pages of which type?'), $types)); 39 | $fields->addFieldToTab('Root.Content.Main', new TreeDropdownField('CreateLocationID', _t('FrontendEditing.CREATE_LOCATION', 'Create new pages where?'), 'Page')); 40 | 41 | return $fields; 42 | } 43 | 44 | } 45 | 46 | class PageCreatorPage_Controller extends Page_Controller 47 | { 48 | public function Form() 49 | { 50 | return $this->CreateForm(); 51 | } 52 | 53 | public function CreateForm() 54 | { 55 | $type = $this->CreateType; 56 | $fields = new FieldSet( 57 | new TextField('Title', _t('PageCreateorPage.TITLE', 'Title')) 58 | ); 59 | 60 | if ($type) { 61 | $obj = singleton($type); 62 | if ($obj && $obj instanceof FrontendCreatable) { 63 | $myFields = $obj->getFrontendCreateFields(); 64 | if ($myFields) { 65 | $fields = $myFields; 66 | } 67 | } else if ($obj instanceof Member) { 68 | $fields = $obj->getMemberFormFields(); 69 | } 70 | } else { 71 | $fields = new FieldSet( 72 | new LiteralField('InvalidType', 'Page is incorrectly configured') 73 | ); 74 | } 75 | 76 | $actions = new FieldSet( 77 | new FormAction('createpage', _t('PageCreateorPage.CREATE_PAGE', 'Create')) 78 | ); 79 | 80 | $form = new Form($this, 'CreateForm', $fields, $actions); 81 | return $form; 82 | } 83 | 84 | /** 85 | * 86 | * Action called by the form to actually create a new page object. 87 | * 88 | * @param SS_HttpRequest $request 89 | * @param Form $form 90 | */ 91 | public function createpage($request, Form $form) 92 | { 93 | // create a new object and bind the form data 94 | $pid = $this->CreateLocation()->ID; 95 | if (!$pid) { 96 | $pid = 0; 97 | } 98 | $type = $this->CreateType; 99 | $obj = new $type; 100 | $form->saveInto($obj); 101 | 102 | $obj->ParentID = $pid; 103 | 104 | Versioned::reading_stage('Stage'); 105 | 106 | $obj->write('Stage'); 107 | // redirect to the created object 108 | Director::redirect($obj->Link().'?stage=Stage'); 109 | } 110 | } -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "silverstripe-australia/frontend-editing", 3 | "description": "A module that allows HTML fields to be edited via a frontend, in-place wysiwyg interface.", 4 | "type": "silverstripe-module", 5 | "keywords": ["silverstripe", "wysiwyg", "frontend editing", "editor"], 6 | "license": "BSD-3-Clause", 7 | "authors": [ 8 | { 9 | "name": "Marcus Nyeholt", 10 | "email": "marcus@silverstripe.com.au" 11 | }, 12 | { 13 | "name": "Shea Dawson", 14 | "email": "shea@livesource.co.nz" 15 | } 16 | ], 17 | "require": { 18 | "silverstripe/framework": "~3.1" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /css/ajax-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/css/ajax-loader.gif -------------------------------------------------------------------------------- /css/edit-controls.css: -------------------------------------------------------------------------------- 1 | #EditControlsDetector {position: fixed; bottom: 0px; right: 0px; width: 50px; height: 50px; } 2 | 3 | #FrontendEditingControls { display: none; position: fixed; bottom: 50px; right: 10px; background-color: #131F11; padding: 10px; z-index: 200; color: #000; } 4 | #FrontendEditingControls { box-shadow: 4px 4px 5px #222; border-radius: 10px; } 5 | 6 | #FrontendEditingControls input, #FrontendEditingControls input[type="button"] { background-color: #eef5ff; font-size: 10px; padding: 5px; color: #000; } 7 | 8 | #FrontendEditingControls input { box-shadow: 0px 0px 2px #fffec3; border-radius: 5px; } 9 | 10 | #FrontendEditingControls #FE_SwitchOn { display: none; } 11 | #FrontendEditingControls #FE_SwitchOff { display: none; } -------------------------------------------------------------------------------- /css/page-editor.css: -------------------------------------------------------------------------------- 1 | /* For nicedit rethemeing */ 2 | div.nicEdit-panelContain { overflow : hidden; height: 50px; width : 100%; background: #0099FF url('toolbar.png') repeat-x; } 3 | div.nicEdit-panel {margin-top : 14px; margin-left: 14px; zoom: 1; overflow : hidden} 4 | 5 | #__editor-mask { color: #fff; font-size: 52px; font-weight: bold; text-align: center; padding-top: 104px; position:fixed; top: 0; left: 0; z-index:950; background:#666 url('ajax-loader.gif') no-repeat 50% 20%; display:none; width: 100%; height: 100%; opacity: 0.8} 6 | .__editorLoadStatus { color: #fff; position: fixed; left: 50px; top: 50px; z-index: 950; font-weight: bold; font-size: 34px } 7 | 8 | #__ajax-load { display: none; position: fixed; top: 5px; right: 5px; z-index: 950 } 9 | .nicEdit-pane { position: fixed; top: 50px; } 10 | #__tree-container { height: 400px; overflow: auto; } 11 | #__toolbox { display: none; z-index: 950; position: fixed; top: 0; left: 0; width: 100%; height: 50px; -moz-box-shadow: 2px 2px 5px #222; -webkit-box-shadow: 2px 2px 5px #222; } 12 | #__toolbox a { color: #0a0; font-size: small; } 13 | #__toobox-actions { height: 30px; } 14 | #__toolbox-opener { } 15 | #__toolbox-buffer { z-index: 950; display: none;height: 50px; } 16 | #__toolbox-control { cursor: pointer; height: 2px; background-color:#222 } 17 | #__toolbox-opener { font-size: x-small;cursor: pointer;background-color: #a00; color: #fff; border: 1px solid black; position: fixed; top: 0; right: 0; width: 80px; height: 20px; } 18 | #__message-box { margin-top: 20px; margin-right: 20px; padding: 5px; font-size: 12px; font-weight: bold; background-color: #131F11; width: 400px; float: right; color: #fff; display: none; } 19 | .__editable { border: 1px dashed #ccc !important; } 20 | .__editable_empty { padding-bottom: 1em !important; } 21 | .__editor-dialog {font-size: small; background-color: #fff; position: fixed; top: 100px; left: 200px; width: 400px; border: 1px solid #aaa; padding: 1em} 22 | 23 | .__editable_locked { border: 1px dashed #ff0000 } 24 | .lockInfo { font-size: 75%; text-align: right; background-color: #ccc; color: #666; margin: 0px !important; padding: 0.5em; } 25 | 26 | .nicEdit-pane form label { display: block; font-size: 10px; } 27 | .nicEdit-pane form label.inlineLabel { display: inline; } 28 | 29 | #jGrowl div.message { background: none; color: #fff; border: none; } 30 | 31 | -------------------------------------------------------------------------------- /css/toolbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/css/toolbar.png -------------------------------------------------------------------------------- /images/page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/images/page.png -------------------------------------------------------------------------------- /javascript/_manifest_exclude: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/javascript/_manifest_exclude -------------------------------------------------------------------------------- /javascript/ajax-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/javascript/ajax-loader.gif -------------------------------------------------------------------------------- /javascript/edit-controls.js: -------------------------------------------------------------------------------- 1 | (function($){ 2 | function cleanPath(cur) { 3 | cur = cur.replace(/&stage=[a-zA-Z]+/g, ''); 4 | cur = cur.replace(/\?stage=[a-zA-Z]+/g, ''); 5 | cur = cur.replace(/&startEditing=true/g, ''); 6 | return cur; 7 | } 8 | 9 | $().ready(function () { 10 | 11 | var editorTimeout = null; 12 | 13 | $('#EditControlsDetector').hover(function () { 14 | $('#FrontendEditingControls').show(); 15 | clearTimeout(editorTimeout); 16 | }, function () { 17 | editorTimeout = setTimeout(function () { $('#FrontendEditingControls').hide(); }, 5000); 18 | }); 19 | 20 | var isLive = $('#FrontendEditingControls').attr('data-islive') == 'true'; 21 | if (!isLive) { 22 | $('#FrontendEditingControls').show(); 23 | } 24 | 25 | $('#FE_ViewPublished').click(function () { 26 | var newUrl = location.protocol + '//' + location.hostname + location.pathname; 27 | var cur = cleanPath(location.search); 28 | var sep = cur.indexOf('?') > 0 ? '&' : '?'; 29 | cur = cur + sep + 'stage=Live'; 30 | 31 | cur += location.hash; 32 | 33 | location.href = newUrl + cur; 34 | }) 35 | 36 | $('#FE_EditDraft').click(function () { 37 | 38 | var newUrl = location.protocol + '//' + location.hostname + location.pathname; 39 | var cur = cleanPath(location.search); 40 | var sep = cur.indexOf('?') > 0 ? '&' : '?'; 41 | cur = cur + sep + 'stage=Stage&startEditing=true'; 42 | 43 | cur += location.hash; 44 | 45 | location.href = newUrl + cur; 46 | }) 47 | }); 48 | })(jQuery); -------------------------------------------------------------------------------- /javascript/jquery.hotkeys.min.js: -------------------------------------------------------------------------------- 1 | (function(jQuery){jQuery.fn.__bind__=jQuery.fn.bind;jQuery.fn.__unbind__=jQuery.fn.unbind;jQuery.fn.__find__=jQuery.fn.find;var hotkeys={version:'0.7.9',override:/keypress|keydown|keyup/g,triggersMap:{},specialKeys:{27:'esc',9:'tab',32:'space',13:'return',8:'backspace',145:'scroll',20:'capslock',144:'numlock',19:'pause',45:'insert',36:'home',46:'del',35:'end',33:'pageup',34:'pagedown',37:'left',38:'up',39:'right',40:'down',109:'-',112:'f1',113:'f2',114:'f3',115:'f4',116:'f5',117:'f6',118:'f7',119:'f8',120:'f9',121:'f10',122:'f11',123:'f12',191:'/'},shiftNums:{"`":"~","1":"!","2":"@","3":"#","4":"$","5":"%","6":"^","7":"&","8":"*","9":"(","0":")","-":"_","=":"+",";":":","'":"\"",",":"<",".":">","/":"?","\\":"|"},newTrigger:function(type,combi,callback){var result={};result[type]={};result[type][combi]={cb:callback,disableInInput:false};return result;}};hotkeys.specialKeys=jQuery.extend(hotkeys.specialKeys,{96:'0',97:'1',98:'2',99:'3',100:'4',101:'5',102:'6',103:'7',104:'8',105:'9',106:'*',107:'+',109:'-',110:'.',111:'/'});jQuery.fn.find=function(selector){this.query=selector;return jQuery.fn.__find__.apply(this,arguments);};jQuery.fn.unbind=function(type,combi,fn){if(jQuery.isFunction(combi)){fn=combi;combi=null;} 2 | if(combi&&typeof combi==='string'){var selectorId=((this.prevObject&&this.prevObject.query)||(this[0].id&&this[0].id)||this[0]).toString();var hkTypes=type.split(' ');for(var x=0;x div.jGrowl { 44 | position: fixed; 45 | } 46 | 47 | body > div.jGrowl.top-left { 48 | left: 0px; 49 | top: 0px; 50 | } 51 | 52 | body > div.jGrowl.top-right { 53 | right: 0px; 54 | top: 0px; 55 | } 56 | 57 | body > div.jGrowl.bottom-left { 58 | left: 0px; 59 | bottom: 0px; 60 | } 61 | 62 | body > div.jGrowl.bottom-right { 63 | right: 0px; 64 | bottom: 0px; 65 | } 66 | 67 | body > div.jGrowl.center { 68 | top: 0px; 69 | width: 50%; 70 | left: 25%; 71 | } 72 | 73 | /** Cross Browser Styling **/ 74 | div.center div.jGrowl-notification, div.center div.jGrowl-closer { 75 | margin-left: auto; 76 | margin-right: auto; 77 | } 78 | 79 | div.jGrowl div.jGrowl-notification, div.jGrowl div.jGrowl-closer { 80 | background-color: #000; 81 | opacity: .85; 82 | -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=85)"; 83 | filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=85); 84 | zoom: 1; 85 | width: 235px; 86 | padding: 10px; 87 | margin-top: 5px; 88 | margin-bottom: 5px; 89 | font-family: Tahoma, Arial, Helvetica, sans-serif; 90 | font-size: 1em; 91 | text-align: left; 92 | display: none; 93 | -moz-border-radius: 5px; 94 | -webkit-border-radius: 5px; 95 | } 96 | 97 | div.jGrowl div.jGrowl-notification { 98 | min-height: 40px; 99 | } 100 | 101 | div.jGrowl div.jGrowl-notification div.header { 102 | font-weight: bold; 103 | font-size: .85em; 104 | } 105 | 106 | div.jGrowl div.jGrowl-notification div.close { 107 | z-index: 99; 108 | float: right; 109 | font-weight: bold; 110 | font-size: 1em; 111 | cursor: pointer; 112 | } 113 | 114 | div.jGrowl div.jGrowl-closer { 115 | padding-top: 4px; 116 | padding-bottom: 4px; 117 | cursor: pointer; 118 | font-size: .9em; 119 | font-weight: bold; 120 | text-align: center; 121 | } 122 | 123 | /** Hide jGrowl when printing **/ 124 | @media print { 125 | div.jGrowl { 126 | display: none; 127 | } 128 | } -------------------------------------------------------------------------------- /javascript/jquery.json.js: -------------------------------------------------------------------------------- 1 | (function ($) { 2 | var m = { 3 | '\b': '\\b', 4 | '\t': '\\t', 5 | '\n': '\\n', 6 | '\f': '\\f', 7 | '\r': '\\r', 8 | '"' : '\\"', 9 | '\\': '\\\\' 10 | }, 11 | s = { 12 | 'array': function (x) { 13 | var a = ['['], b, f, i, l = x.length, v; 14 | for (i = 0; i < l; i += 1) { 15 | v = x[i]; 16 | f = s[typeof v]; 17 | if (f) { 18 | v = f(v); 19 | if (typeof v == 'string') { 20 | if (b) { 21 | a[a.length] = ','; 22 | } 23 | a[a.length] = v; 24 | b = true; 25 | } 26 | } 27 | } 28 | a[a.length] = ']'; 29 | return a.join(''); 30 | }, 31 | 'boolean': function (x) { 32 | return String(x); 33 | }, 34 | 'null': function (x) { 35 | return "null"; 36 | }, 37 | 'number': function (x) { 38 | return isFinite(x) ? String(x) : 'null'; 39 | }, 40 | 'object': function (x) { 41 | if (x) { 42 | if (x instanceof Array) { 43 | return s.array(x); 44 | } 45 | var a = ['{'], b, f, i, v; 46 | for (i in x) { 47 | v = x[i]; 48 | f = s[typeof v]; 49 | if (f) { 50 | v = f(v); 51 | if (typeof v == 'string') { 52 | if (b) { 53 | a[a.length] = ','; 54 | } 55 | a.push(s.string(i), ':', v); 56 | b = true; 57 | } 58 | } 59 | } 60 | a[a.length] = '}'; 61 | return a.join(''); 62 | } 63 | return 'null'; 64 | }, 65 | 'string': function (x) { 66 | if (/["\\\x00-\x1f]/.test(x)) { 67 | x = x.replace(/([\x00-\x1f\\"])/g, function(a, b) { 68 | var c = m[b]; 69 | if (c) { 70 | return c; 71 | } 72 | c = b.charCodeAt(); 73 | return '\\u00' + 74 | Math.floor(c / 16).toString(16) + 75 | (c % 16).toString(16); 76 | }); 77 | } 78 | return '"' + x + '"'; 79 | } 80 | }; 81 | 82 | $.toJSON = function(v) { 83 | var f = isNaN(v) ? s[typeof v] : s['number']; 84 | if (f) return f(v); 85 | }; 86 | 87 | $.parseJSON = function(v, safe) { 88 | if (safe === undefined) safe = $.parseJSON.safe; 89 | if (safe && !/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/.test(v)) 90 | return undefined; 91 | return eval('('+v+')'); 92 | }; 93 | 94 | $.parseJSON.safe = false; 95 | 96 | })(jQuery); 97 | -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/README.txt: -------------------------------------------------------------------------------- 1 | jsTree 0.9.9 2 | http://jstree.com/ 3 | 4 | Copyright (c) 2009 Ivan Bozhanov (vakata.com) 5 | 6 | Dual licensed under the MIT and GPL licenses: 7 | http://www.opensource.org/licenses/mit-license.php 8 | http://www.gnu.org/licenses/gpl.html 9 | 10 | Date: 2009-09-24 11 | 12 | 13 | 14 | In the root directory you will find jquery.tree.js and jquery.tree.min.js (minified version of jquery.tree.js). 15 | To be able to use the jsTree jquery tree plugin all you need to do is include jquery (http://jquery.com) and one of the above files in your page. 16 | For more - check the documentation.html and examples.html files. 17 | 18 | In the plugins/ dir you will find all of the official plugins, along with a documentation.html file - it contains the docs for all the plugins. 19 | 20 | In the lib/ dir you will find a copy of jquery.js, along with all other dependencies of the plugins. 21 | If you use a plugin - it will alert you about a missing dependency. 22 | 23 | All themes are located in the themes/ dir. Make sure to keep it relative to the jquery.tree.js file, so that your chosen theme will be included. 24 | If that is not an option for you - search the documentation.html file for "theme_path". 25 | 26 | For users upgrading from a previous version to 0.9.9: 27 | 1) jQuery.tree_reference became jQuery.tree.reference (the function is also upgraded) 28 | 2) jQuery.tree_focused became jQuery.tree.focused 29 | 3) jQuery.tree_create became jQuery.tree.create 30 | 4) The data config section is changed (all the options for the datastore are in the "data.opts" object) - check the docs for more. 31 | 5) If you use XML - you will have to include the appropriate plugin and Sarissa - again - check the options - they are a bit changed. 32 | 6) getXML and getJSON no longer exist - use the "get" function - check the documentation on how to use it. 33 | 7) If you used the checkbox callback - switch to the checkbox plugin 34 | 8) If you used the cookie option - switch to the cookie plugin - check the plugin docs for info. 35 | 9) onJSONdata became ondata callback - you get what the server returned before jsTree displays it 36 | 10) async_data becomes beforedata callback 37 | 11) Drag, clickable, deletable rules are out of the picture. Enter type definitions - all types inherit from the "default" type. 38 | You can now set valid children, max_depth, max_children, clickable, deletable, etc - any of those can also be functions, so you can dinamically check. 39 | It is all in the docs - check the "types" section. For global tree rules - check the "rules" config section. 40 | 41 | -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/demo/async_html.html: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | jsTree » Demos 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 35 | 36 | 37 | 38 | 50 | 51 | 52 |
53 |

Async HTML demo

54 |

This time all nodes are loaded from an external file. Notice that when you open the closed node nothing happens.

55 | 66 |
67 | 68 |

By setting async : true we are telling jsTree to request its data from the server everytime a closed node is opened (unless of course it is already loaded). If you want to modify the data sent to the server with each request take a look at the beforedata callback.

69 | 81 |
82 |
-------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/demo/async_html_data.txt: -------------------------------------------------------------------------------- 1 |
  •  Node 1
  • 2 |
  •  Node 2
  • -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/demo/async_json.html: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | jsTree » Demos 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 35 | 36 | 37 | 38 | 50 | 51 | 52 |
    53 |

    Async JSON demo

    54 |

    Same as with the HTML datastore you can load data from a file.

    55 | 67 |
    68 | 69 |

    But you can also use the async option. If you want to modify the data sent to the server with each request take a look at the beforedata callback.

    70 | 84 |
    85 | 86 |
    -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/demo/async_json_data.json: -------------------------------------------------------------------------------- 1 | [ 2 | { data : "A node", children : [ { data : "Only child" } ], state : "open" }, 3 | { data : "Some other node" } 4 | ] -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/demo/async_xml_flat.html: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | jsTree » Demos 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 36 | 37 | 38 | 39 | 51 | 52 | 53 |
    54 |

    Async XMl flat with languages

    55 | 56 |

    This examples shows how to use async XML flat, keep in mind when using async the parent_id attribute of the returned top nodes on each request should be omitted or set to 0.

    57 | 71 |
    72 |

    73 | 74 | 75 |

    76 |
    -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/demo/async_xml_flat_data.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/demo/basic_html.html: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | jsTree » Demos 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 35 | 36 | 37 | 38 | 50 | 51 | 52 |
    53 |

    Basic HTML demo

    54 |

    In this simple example nothing is configured - the default tree options are used. Keep in mind that all the nodes in this example are draggable, renameable, etc (they follow the default config, which you can overwrite). In order to disable this have a look at the types configuration and types demo.

    55 | 60 | 72 |
    -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/demo/basic_xml_flat.html: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | jsTree » Demos 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 36 | 37 | 38 | 39 | 51 | 52 | 53 |
    54 |

    Basic XML flat

    55 | 56 |

    This example loads the tree from a XML flat file.

    57 | 69 |
    70 |
    -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/demo/basic_xml_flat_data.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/demo/basic_xml_nested.html: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | jsTree » Demos 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 36 | 37 | 38 | 39 | 51 | 52 | 53 |
    54 |

    Basic XML nested

    55 | 56 |

    This example loads the tree from a XML nested file.

    57 | 69 |
    70 |
    -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/demo/basic_xml_nested_data.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/demo/callbacks.html: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | jsTree » Demos 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 35 | 36 | 37 | 38 | 50 | 51 | 52 |
    53 |

    Callbacks demo

    54 |

    Please read the documentation on callbacks to see all the available callbacks and what parameters you get with each one.

    55 | 78 | 79 | 91 |
    Log:
    92 | 93 |
    -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/demo/cookie.html: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | jsTree » Demos 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 35 | 36 | 37 | 38 | 50 | 51 | 52 |
    53 |

    Cookie demo

    54 |

    You can see that initially there is no node selected, and the root node is closed. Select a node and/or open the root node and reload the page.

    55 | 64 | 76 | 77 |
    -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/demo/delete.html: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | jsTree » Demos 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 35 | 36 | 37 | 38 | 50 | 51 | 52 |
    53 |

    Deleting nodes demo

    54 |

    You may also want to read the documentation on remove and type deletable setting. When deleting the beforedelete and ondelete callbacks are triggered.

    55 | 60 |

    61 | 62 | 63 |

    64 | 76 | 77 | 78 |
    -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/demo/drive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/javascript/jstree-0.9.9a2/demo/drive.png -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/demo/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/javascript/jstree-0.9.9a2/demo/file.png -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/demo/index.html: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | jsTree » Demos 8 | 9 | 10 | -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/demo/json_languages.html: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | jsTree » Demos 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 36 | 37 | 38 | 39 | 51 | 52 | 53 |
    54 |

    JSON with languages

    55 | 56 |

    Here is the demo of the long and short JSON format for multilanguage trees. You need to set the languages option. In the buttons code, you can see how to get an instance - either by using reference and focused.

    57 | 94 |
    95 |

    96 | 97 | 98 |

    99 |
    -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/demo/keyboard.html: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | jsTree » Demos 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 35 | 36 | 37 | 38 | 50 | 51 | 52 |
    53 |

    Hotkeys demo

    54 |

    Try pressing up/down/left/right/del. The buttons below enable/disable the hotkeys (useful if you have another component on the page that may use keyboard navigation). You can attach the enable command to the onfocus event if you will - that way if the user clicks anywhere inside the tree container shortcuts will start working.

    55 | 73 | 85 |

    86 | 87 | 88 |

    89 | 90 |
    -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/demo/metadata.html: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | jsTree » Demos 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 35 | 36 | 37 | 38 | 50 | 51 | 52 |
    53 |

    Metadata plugin demo

    54 |

    You can set any of the type rules (except for icon which has a separate syntax for every datastore). The data passed is a string - in every datastore you have the option to pass arguments.

    55 | 67 | 68 | 80 | 81 |
    -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/demo/rename.html: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | jsTree » Demos 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 35 | 36 | 37 | 38 | 50 | 51 | 52 |
    53 |

    Renaming nodes demo

    54 |

    You may also want to read the documentation on rename and type renameable setting. When renaming the beforerename and onrename callbacks are triggered.

    55 | 66 |

    67 | 68 | 69 |

    70 | 82 | 83 | 84 |
    -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/demo/rollback.html: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | jsTree » Demos 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 35 | 36 | 37 | 38 | 50 | 51 | 52 |
    53 |

    Rollback demo

    54 |

    All the callbacks that are fired after tree is modified in some way offer you a rollback object that you can use with the rollback function.

    55 | 73 | 74 | 86 |

    87 | 88 | 89 |

    90 | 91 |
    -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/demo/search.html: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | jsTree » Demos 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 35 | 36 | 37 | 38 | 50 | 51 | 52 |
    53 |

    Search demo

    54 |

    If you decide to go with async - when searching a request to the server is made with the query string. The expected return value would be the ID of the nodes that need to be opened, so that the matching node is loaded. Also take a look at the search function second parameter for case-insensitive searching.

    55 | 58 | 70 | 71 | 83 |

    84 | 85 | 86 |

    87 | 88 |
    -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/demo/select.html: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | jsTree » Demos 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 35 | 36 | 37 | 38 | 50 | 51 | 52 |
    53 |

    Selecting nodes demo

    54 |

    You may also want to read the documentation on select_branch, deselect_branch and type clickable setting. To initially select some nodes when the tree loads - take a look at the selected config option. When selecting/deselecting the beforechange, onchange, onselect and ondeselect callbacks are triggered.

    55 | 60 |

    61 | 62 | 63 |

    64 | 76 | 77 | 78 |
    -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/demo/static_async_json.html: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | jsTree » Demos 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 35 | 36 | 37 | 38 | 50 | 51 | 52 |
    53 |

    Static & Async mixing JSON demo

    54 | 55 |

    This is a simple example - you could enhance it not to pollute the global namespace.

    56 | 86 |
    87 | 88 |
    -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/demo/syntax/clipboard.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/javascript/jstree-0.9.9a2/demo/syntax/clipboard.swf -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/demo/syntax/help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/javascript/jstree-0.9.9a2/demo/syntax/help.png -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/demo/syntax/magnifier.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/javascript/jstree-0.9.9a2/demo/syntax/magnifier.png -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/demo/syntax/page_white_code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/javascript/jstree-0.9.9a2/demo/syntax/page_white_code.png -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/demo/syntax/page_white_copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/javascript/jstree-0.9.9a2/demo/syntax/page_white_copy.png -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/demo/syntax/printer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/javascript/jstree-0.9.9a2/demo/syntax/printer.png -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/demo/syntax/shBrushJScript.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/ 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate 7 | * 8 | * @version 9 | * 2.0.320 (May 03 2009) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2009 Alex Gorbatchev. 13 | * 14 | * @license 15 | * This file is part of SyntaxHighlighter. 16 | * 17 | * SyntaxHighlighter is free software: you can redistribute it and/or modify 18 | * it under the terms of the GNU Lesser General Public License as published by 19 | * the Free Software Foundation, either version 3 of the License, or 20 | * (at your option) any later version. 21 | * 22 | * SyntaxHighlighter is distributed in the hope that it will be useful, 23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 25 | * GNU General Public License for more details. 26 | * 27 | * You should have received a copy of the GNU General Public License 28 | * along with SyntaxHighlighter. If not, see . 29 | */ 30 | SyntaxHighlighter.brushes.JScript = function() 31 | { 32 | var keywords = 'break case catch continue ' + 33 | 'default delete do else false ' + 34 | 'for function if in instanceof ' + 35 | 'new null return super switch ' + 36 | 'this throw true try typeof var while with' 37 | ; 38 | 39 | this.regexList = [ 40 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments 41 | { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments 42 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings 43 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings 44 | { regex: /\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion 45 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keywords 46 | ]; 47 | 48 | this.forHtmlScript(SyntaxHighlighter.regexLib.scriptScriptTags); 49 | }; 50 | 51 | SyntaxHighlighter.brushes.JScript.prototype = new SyntaxHighlighter.Highlighter(); 52 | SyntaxHighlighter.brushes.JScript.aliases = ['js', 'jscript', 'javascript']; 53 | -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/demo/syntax/shBrushXml.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/ 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate 7 | * 8 | * @version 9 | * 2.0.320 (May 03 2009) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2009 Alex Gorbatchev. 13 | * 14 | * @license 15 | * This file is part of SyntaxHighlighter. 16 | * 17 | * SyntaxHighlighter is free software: you can redistribute it and/or modify 18 | * it under the terms of the GNU Lesser General Public License as published by 19 | * the Free Software Foundation, either version 3 of the License, or 20 | * (at your option) any later version. 21 | * 22 | * SyntaxHighlighter is distributed in the hope that it will be useful, 23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 25 | * GNU General Public License for more details. 26 | * 27 | * You should have received a copy of the GNU General Public License 28 | * along with SyntaxHighlighter. If not, see . 29 | */ 30 | SyntaxHighlighter.brushes.Xml = function() 31 | { 32 | function process(match, regexInfo) 33 | { 34 | var constructor = SyntaxHighlighter.Match, 35 | code = match[0], 36 | tag = new XRegExp('(<|<)[\\s\\/\\?]*(?[:\\w-\\.]+)', 'xg').exec(code), 37 | result = [] 38 | ; 39 | 40 | if (match.attributes != null) 41 | { 42 | var attributes, 43 | regex = new XRegExp('(? [\\w:\\-\\.]+)' + 44 | '\\s*=\\s*' + 45 | '(? ".*?"|\'.*?\'|\\w+)', 46 | 'xg'); 47 | 48 | while ((attributes = regex.exec(code)) != null) 49 | { 50 | result.push(new constructor(attributes.name, match.index + attributes.index, 'color1')); 51 | result.push(new constructor(attributes.value, match.index + attributes.index + attributes[0].indexOf(attributes.value), 'string')); 52 | } 53 | } 54 | 55 | if (tag != null) 56 | result.push( 57 | new constructor(tag.name, match.index + tag[0].indexOf(tag.name), 'keyword') 58 | ); 59 | 60 | return result; 61 | } 62 | 63 | this.regexList = [ 64 | { regex: new XRegExp('(\\<|<)\\!\\[[\\w\\s]*?\\[(.|\\s)*?\\]\\](\\>|>)', 'gm'), css: 'color2' }, // 65 | { regex: new XRegExp('(\\<|<)!--\\s*.*?\\s*--(\\>|>)', 'gm'), css: 'comments' }, // 66 | { regex: new XRegExp('(<|<)[\\s\\/\\?]*(\\w+)(?.*?)[\\s\\/\\?]*(>|>)', 'sg'), func: process } 67 | ]; 68 | }; 69 | 70 | SyntaxHighlighter.brushes.Xml.prototype = new SyntaxHighlighter.Highlighter(); 71 | SyntaxHighlighter.brushes.Xml.aliases = ['xml', 'xhtml', 'xslt', 'html', 'xhtml']; 72 | -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/demo/syntax/wrapping.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/javascript/jstree-0.9.9a2/demo/syntax/wrapping.png -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/demo/themeroller.html: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | jsTree » Demos 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 35 | 36 | 37 | 38 | 50 | 51 | 52 |
    53 |

    Themeroller plugin demo

    54 | 55 | 68 | 69 | 81 | 82 | 86 | 87 |
    -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/demo/xml_flat_from_string.html: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | jsTree » Demos 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 36 | 37 | 38 | 39 | 51 | 52 | 53 |
    54 |

    XML flat from string

    55 | 56 |

    This example loads the tree from a XML flat string.

    57 | 69 |
    70 |
    -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/demo/xml_flat_with_languages.html: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | jsTree » Demos 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 |
    27 | 28 | 35 |
    36 | 37 |
    38 | 39 |
    -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/demo/xml_nested_with_languages.html: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | jsTree » Demos 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 |
    27 | 28 | 35 |
    36 | 37 |
    38 | 39 |
    -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/lib/jquery.cookie.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Cookie plugin 3 | * 4 | * Copyright (c) 2006 Klaus Hartl (stilbuero.de) 5 | * Dual licensed under the MIT and GPL licenses: 6 | * http://www.opensource.org/licenses/mit-license.php 7 | * http://www.gnu.org/licenses/gpl.html 8 | * 9 | */ 10 | 11 | /** 12 | * Create a cookie with the given name and value and other optional parameters. 13 | * 14 | * @example $.cookie('the_cookie', 'the_value'); 15 | * @desc Set the value of a cookie. 16 | * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true }); 17 | * @desc Create a cookie with all available options. 18 | * @example $.cookie('the_cookie', 'the_value'); 19 | * @desc Create a session cookie. 20 | * @example $.cookie('the_cookie', null); 21 | * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain 22 | * used when the cookie was set. 23 | * 24 | * @param String name The name of the cookie. 25 | * @param String value The value of the cookie. 26 | * @param Object options An object literal containing key/value pairs to provide optional cookie attributes. 27 | * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object. 28 | * If a negative value is specified (e.g. a date in the past), the cookie will be deleted. 29 | * If set to null or omitted, the cookie will be a session cookie and will not be retained 30 | * when the the browser exits. 31 | * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie). 32 | * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie). 33 | * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will 34 | * require a secure protocol (like HTTPS). 35 | * @type undefined 36 | * 37 | * @name $.cookie 38 | * @cat Plugins/Cookie 39 | * @author Klaus Hartl/klaus.hartl@stilbuero.de 40 | */ 41 | 42 | /** 43 | * Get the value of a cookie with the given name. 44 | * 45 | * @example $.cookie('the_cookie'); 46 | * @desc Get the value of a cookie. 47 | * 48 | * @param String name The name of the cookie. 49 | * @return The value of the cookie. 50 | * @type String 51 | * 52 | * @name $.cookie 53 | * @cat Plugins/Cookie 54 | * @author Klaus Hartl/klaus.hartl@stilbuero.de 55 | */ 56 | jQuery.cookie = function(name, value, options) { 57 | if (typeof value != 'undefined') { // name and value given, set cookie 58 | options = options || {}; 59 | if (value === null) { 60 | value = ''; 61 | options.expires = -1; 62 | } 63 | var expires = ''; 64 | if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) { 65 | var date; 66 | if (typeof options.expires == 'number') { 67 | date = new Date(); 68 | date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000)); 69 | } else { 70 | date = options.expires; 71 | } 72 | expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE 73 | } 74 | // CAUTION: Needed to parenthesize options.path and options.domain 75 | // in the following expressions, otherwise they evaluate to undefined 76 | // in the packed version for some reason... 77 | var path = options.path ? '; path=' + (options.path) : ''; 78 | var domain = options.domain ? '; domain=' + (options.domain) : ''; 79 | var secure = options.secure ? '; secure' : ''; 80 | document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join(''); 81 | } else { // only name given, get cookie 82 | var cookieValue = null; 83 | if (document.cookie && document.cookie != '') { 84 | var cookies = document.cookie.split(';'); 85 | for (var i = 0; i < cookies.length; i++) { 86 | var cookie = jQuery.trim(cookies[i]); 87 | // Does this cookie string begin with the name we want? 88 | if (cookie.substring(0, name.length + 1) == (name + '=')) { 89 | cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); 90 | break; 91 | } 92 | } 93 | } 94 | return cookieValue; 95 | } 96 | }; -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/lib/jquery.metadata.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Metadata - jQuery plugin for parsing metadata from elements 3 | * 4 | * Copyright (c) 2006 John Resig, Yehuda Katz, J�örn Zaefferer, Paul McLanahan 5 | * 6 | * Dual licensed under the MIT and GPL licenses: 7 | * http://www.opensource.org/licenses/mit-license.php 8 | * http://www.gnu.org/licenses/gpl.html 9 | * 10 | * Revision: $Id: jquery.metadata.js 4187 2007-12-16 17:15:27Z joern.zaefferer $ 11 | * 12 | */ 13 | 14 | /** 15 | * Sets the type of metadata to use. Metadata is encoded in JSON, and each property 16 | * in the JSON will become a property of the element itself. 17 | * 18 | * There are three supported types of metadata storage: 19 | * 20 | * attr: Inside an attribute. The name parameter indicates *which* attribute. 21 | * 22 | * class: Inside the class attribute, wrapped in curly braces: { } 23 | * 24 | * elem: Inside a child element (e.g. a script tag). The 25 | * name parameter indicates *which* element. 26 | * 27 | * The metadata for an element is loaded the first time the element is accessed via jQuery. 28 | * 29 | * As a result, you can define the metadata type, use $(expr) to load the metadata into the elements 30 | * matched by expr, then redefine the metadata type and run another $(expr) for other elements. 31 | * 32 | * @name $.metadata.setType 33 | * 34 | * @example

    This is a p

    35 | * @before $.metadata.setType("class") 36 | * @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label" 37 | * @desc Reads metadata from the class attribute 38 | * 39 | * @example

    This is a p

    40 | * @before $.metadata.setType("attr", "data") 41 | * @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label" 42 | * @desc Reads metadata from a "data" attribute 43 | * 44 | * @example

    This is a p

    45 | * @before $.metadata.setType("elem", "script") 46 | * @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label" 47 | * @desc Reads metadata from a nested script element 48 | * 49 | * @param String type The encoding type 50 | * @param String name The name of the attribute to be used to get metadata (optional) 51 | * @cat Plugins/Metadata 52 | * @descr Sets the type of encoding to be used when loading metadata for the first time 53 | * @type undefined 54 | * @see metadata() 55 | */ 56 | 57 | (function($) { 58 | 59 | $.extend({ 60 | metadata : { 61 | defaults : { 62 | type: 'class', 63 | name: 'metadata', 64 | cre: /({.*})/, 65 | single: 'metadata' 66 | }, 67 | setType: function( type, name ){ 68 | this.defaults.type = type; 69 | this.defaults.name = name; 70 | }, 71 | get: function( elem, opts ){ 72 | var settings = $.extend({},this.defaults,opts); 73 | // check for empty string in single property 74 | if ( !settings.single.length ) settings.single = 'metadata'; 75 | 76 | var data = $.data(elem, settings.single); 77 | // returned cached data if it already exists 78 | if ( data ) return data; 79 | 80 | data = "{}"; 81 | 82 | if ( settings.type == "class" ) { 83 | var m = settings.cre.exec( elem.className ); 84 | if ( m ) 85 | data = m[1]; 86 | } else if ( settings.type == "elem" ) { 87 | if( !elem.getElementsByTagName ) 88 | return undefined; 89 | var e = elem.getElementsByTagName(settings.name); 90 | if ( e.length ) 91 | data = $.trim(e[0].innerHTML); 92 | } else if ( elem.getAttribute != undefined ) { 93 | var attr = elem.getAttribute( settings.name ); 94 | if ( attr ) 95 | data = attr; 96 | } 97 | 98 | if ( data.indexOf( '{' ) <0 ) 99 | data = "{" + data + "}"; 100 | 101 | data = eval("(" + data + ")"); 102 | 103 | $.data( elem, settings.single, data ); 104 | return data; 105 | } 106 | } 107 | }); 108 | 109 | /** 110 | * Returns the metadata object for the first member of the jQuery object. 111 | * 112 | * @name metadata 113 | * @descr Returns element's metadata object 114 | * @param Object opts An object contianing settings to override the defaults 115 | * @type jQuery 116 | * @cat Plugins/Metadata 117 | */ 118 | $.fn.metadata = function( opts ){ 119 | return $.metadata.get( this[0], opts ); 120 | }; 121 | 122 | })(jQuery); -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/plugins/_jquery.tree.rtl.js: -------------------------------------------------------------------------------- 1 | (function ($) { 2 | $.extend($.tree.plugins, { 3 | "rtl" : { 4 | defaults : { 5 | attribute : "data" 6 | }, 7 | callbacks : { 8 | onload : function() { 9 | this.container.css("direction","rtl").children("ul:eq(0)").removeClass("ltr").addClass("rtl"); 10 | }, 11 | oninit : function() { 12 | if(!$.tree.plugins.rtl.css) { 13 | var css = '.tree .rtl li.last { float:right; } #jstree-dragged .rtl { margin:0; padding:0; } #jstree-marker.marker_rtl { width:40px; background-position:right center; } /* RTL modification */ .tree .rtl, .tree .rtl ul { margin:0 10px 0 0; } .tree .rtl li { padding:0 10px 0 0; } .tree .rtl li a, .tree .rtl li span { padding:1px 4px 1px 4px; } .tree > .rtl > li { display:table; } .tree .rtl ins { margin:0 0px 0 4px; }'; 14 | if(/msie/.test(u) && !/opera/.test(u)) { 15 | if(parseInt(v) == 6) css += '#jstree-dragged .rtl { width:20px; } .tree .rtl li.last { margin-top: expression( (this.previousSibling && /open/.test(this.previousSibling.className) ) ? "-2px" : "0"); } .marker_rtl { width:40px; background-position:right center; } '; 16 | if(parseInt(v) == 7) css += '.tree .rtl li.last { float:none; } #jstree-dragged .rtl { width:200px; }'; 17 | } 18 | if(/mozilla/.test(u) && !/(compatible|webkit)/.test(u) && v.indexOf("1.8") == 0) css += '.tree .rtl li a { display:inline; float:right; }'; 19 | $.tree.plugins.rtl.css = this.add_sheet({ str : css }); 20 | } 21 | } 22 | } 23 | } 24 | }); 25 | })(jQuery); 26 | 27 | // in mousemove: 28 | // tmp.drag_help.css({ "left" : (event.pageX - (tmp.origin_tree.settings.ui.rtl ? tmp.w : -5 ) ), "top" : (event.pageY + 15) }); 29 | // if(cnt.children("ul:eq(0)").hasClass("rtl")) goTo.x += et.width() - 28; 30 | // if(cnt.children("ul:eq(0)").hasClass("rtl")) { tree_component.drag_drop.marker.attr("class","marker_rtl"); } 31 | // if(cnt.children("ul:eq(0)").hasClass("rtl")) goTo.x += 36; 32 | // tree_component.drag_drop.marker.css({ "left" : et_off.left + ( cnt.children("ul:eq(0)").hasClass("rtl") ? (cnt.width() - 10) : 10 ) , "top" : et_off.top + 15 }).show(); -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/plugins/jquery.tree.checkbox.js: -------------------------------------------------------------------------------- 1 | (function ($) { 2 | $.extend($.tree.plugins, { 3 | "checkbox" : { 4 | defaults : { 5 | three_state : true 6 | }, 7 | get_checked : function (t) { 8 | if(!t) t = $.tree.focused(); 9 | return t.container.find("a.checked").parent(); 10 | }, 11 | get_undeterminded : function (t) { 12 | if(!t) t = $.tree.focused(); 13 | return t.container.find("a.undetermined").parent(); 14 | }, 15 | get_unchecked : function (t) { 16 | if(!t) t = $.tree.focused(); 17 | return t.container.find("a:not(.checked, .undetermined)").parent(); 18 | }, 19 | 20 | check : function (n) { 21 | if(!n) return false; 22 | var t = $.tree.reference(n); 23 | n = t.get_node(n); 24 | if(n.children("a").hasClass("checked")) return true; 25 | 26 | var opts = $.extend(true, {}, $.tree.plugins.checkbox.defaults, t.settings.plugins.checkbox); 27 | if(opts.three_state) { 28 | n.find("li").andSelf().children("a").removeClass("unchecked undetermined").addClass("checked"); 29 | n.parents("li").each(function () { 30 | if($(this).children("ul").find("a:not(.checked):eq(0)").size() > 0) { 31 | $(this).parents("li").andSelf().children("a").removeClass("unchecked checked").addClass("undetermined"); 32 | return false; 33 | } 34 | else $(this).children("a").removeClass("unchecked undetermined").addClass("checked"); 35 | }); 36 | } 37 | else n.children("a").removeClass("unchecked").addClass("checked"); 38 | return true; 39 | }, 40 | uncheck : function (n) { 41 | if(!n) return false; 42 | var t = $.tree.reference(n); 43 | n = t.get_node(n); 44 | if(n.children("a").hasClass("unchecked")) return true; 45 | 46 | var opts = $.extend(true, {}, $.tree.plugins.checkbox.defaults, t.settings.plugins.checkbox); 47 | if(opts.three_state) { 48 | n.find("li").andSelf().children("a").removeClass("checked undetermined").addClass("unchecked"); 49 | n.parents("li").each(function () { 50 | if($(this).find("a.checked, a.undetermined").size() - 1 > 0) { 51 | $(this).parents("li").andSelf().children("a").removeClass("unchecked checked").addClass("undetermined"); 52 | return false; 53 | } 54 | else $(this).children("a").removeClass("checked undetermined").addClass("unchecked"); 55 | }); 56 | } 57 | else n.children("a").removeClass("checked").addClass("unchecked"); 58 | return true; 59 | }, 60 | toggle : function (n) { 61 | if(!n) return false; 62 | var t = $.tree.reference(n); 63 | n = t.get_node(n); 64 | if(n.children("a").hasClass("checked")) $.tree.plugins.checkbox.uncheck(n); 65 | else $.tree.plugins.checkbox.check(n); 66 | }, 67 | 68 | callbacks : { 69 | onchange : function(n, t) { 70 | $.tree.plugins.checkbox.toggle(n); 71 | } 72 | } 73 | } 74 | }); 75 | })(jQuery); -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/plugins/jquery.tree.cookie.js: -------------------------------------------------------------------------------- 1 | (function ($) { 2 | if(typeof $.cookie == "undefined") throw "jsTree cookie: jQuery cookie plugin not included."; 3 | 4 | $.extend($.tree.plugins, { 5 | "cookie" : { 6 | defaults : { 7 | prefix : "", // a prefix that will be used for all cookies for this tree 8 | options : { 9 | expires: false, 10 | path: false, 11 | domain: false, 12 | secure: false 13 | }, 14 | types : { 15 | selected : true, // should we set the selected cookie 16 | open : true // should we set the open cookie 17 | }, 18 | keep_selected : false, // should we merge with the selected option or overwrite it 19 | keep_opened : false // should we merge with the opened option or overwrite it 20 | }, 21 | set_cookie : function (type) { 22 | var opts = $.extend(true, {}, $.tree.plugins.cookie.defaults, this.settings.plugins.cookie); 23 | if(opts.types[type] !== true) return false; 24 | switch(type) { 25 | case "selected": 26 | if(this.settings.rules.multiple != false && this.selected_arr.length > 1) { 27 | var val = Array(); 28 | $.each(this.selected_arr, function () { 29 | if(this.attr("id")) { val.push(this.attr("id")); } 30 | }); 31 | val = val.join(","); 32 | } 33 | else var val = this.selected ? this.selected.attr("id") : false; 34 | $.cookie(opts.prefix + 'selected', val, opts.options); 35 | break; 36 | case "open": 37 | var str = ""; 38 | this.container.find("li.open").each(function (i) { if(this.id) { str += this.id + ","; } }); 39 | $.cookie(opts.prefix + 'open', str.replace(/,$/ig,""), opts.options); 40 | break; 41 | } 42 | }, 43 | callbacks : { 44 | oninit : function (t) { 45 | var opts = $.extend(true, {}, $.tree.plugins.cookie.defaults, this.settings.plugins.cookie); 46 | var tmp = false; 47 | tmp = $.cookie(opts.prefix + 'open'); 48 | if(tmp) { 49 | tmp = tmp.split(","); 50 | if(opts.keep_opened) this.settings.opened = $.unique($.merge(tmp, this.settings.opened)); 51 | else this.settings.opened = tmp; 52 | } 53 | tmp = $.cookie(opts.prefix + 'selected'); 54 | if(tmp) { 55 | tmp = tmp.split(","); 56 | if(opts.keep_selected) this.settings.selected = $.unique($.merge(tmp, this.settings.opened)); 57 | else this.settings.selected = tmp; 58 | } 59 | }, 60 | onchange : function() { $.tree.plugins.cookie.set_cookie.apply(this, ["selected"]); }, 61 | onopen : function() { $.tree.plugins.cookie.set_cookie.apply(this, ["open"]); }, 62 | onclose : function() { $.tree.plugins.cookie.set_cookie.apply(this, ["open"]); }, 63 | ondelete : function() { $.tree.plugins.cookie.set_cookie.apply(this, ["open"]); }, 64 | oncopy : function() { $.tree.plugins.cookie.set_cookie.apply(this, ["open"]); }, 65 | oncreate : function() { $.tree.plugins.cookie.set_cookie.apply(this, ["open"]); }, 66 | onmoved : function() { $.tree.plugins.cookie.set_cookie.apply(this, ["open"]); } 67 | } 68 | } 69 | }); 70 | })(jQuery); -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/plugins/jquery.tree.hotkeys.js: -------------------------------------------------------------------------------- 1 | (function ($) { 2 | if(typeof window.hotkeys == "undefined") throw "jsTree hotkeys: jQuery hotkeys plugin not included."; 3 | 4 | $.extend($.tree.plugins, { 5 | "hotkeys" : { 6 | bound : [], 7 | disabled : false, 8 | defaults : { 9 | hover_mode : false, 10 | functions : { 11 | "up" : function () { $.tree.plugins.hotkeys.get_prev.apply(this); return false; }, 12 | "down" : function () { $.tree.plugins.hotkeys.get_next.apply(this); return false; }, 13 | "left" : function () { $.tree.plugins.hotkeys.get_left.apply(this); return false; }, 14 | "right" : function () { $.tree.plugins.hotkeys.get_right.apply(this); return false; }, 15 | "f2" : function () { if(this.selected) this.rename(); return false; }, 16 | "del" : function () { if(this.selected) this.remove(); return false; }, 17 | "ctrl+c": function () { if(this.selected) this.copy(); return false; }, 18 | "ctrl+x": function () { if(this.selected) this.cut(); return false; }, 19 | "ctrl+v": function () { if(this.selected) this.paste(); return false; } 20 | } 21 | }, 22 | exec : function(key) { 23 | if($.tree.plugins.hotkeys.disabled) return false; 24 | 25 | var t = $.tree.focused(); 26 | if(typeof t.settings.plugins.hotkeys == "undefined") return; 27 | var opts = $.extend(true, {}, $.tree.plugins.hotkeys.defaults, t.settings.plugins.hotkeys); 28 | if(typeof opts.functions[key] == "function") return opts.functions[key].apply(t); 29 | }, 30 | get_next : function() { 31 | var opts = $.extend(true, {}, $.tree.plugins.hotkeys.defaults, this.settings.plugins.hotkeys); 32 | var obj = this.hovered || this.selected; 33 | return opts.hover_mode ? this.hover_branch(this.next(obj)) : this.select_branch(this.next(obj)); 34 | }, 35 | get_prev : function() { 36 | var opts = $.extend(true, {}, $.tree.plugins.hotkeys.defaults, this.settings.plugins.hotkeys); 37 | var obj = this.hovered || this.selected; 38 | return opts.hover_mode ? this.hover_branch(this.prev(obj)) : this.select_branch(this.prev(obj)); 39 | }, 40 | get_left : function() { 41 | var opts = $.extend(true, {}, $.tree.plugins.hotkeys.defaults, this.settings.plugins.hotkeys); 42 | var obj = this.hovered || this.selected; 43 | if(obj) { 44 | if(obj.hasClass("open")) this.close_branch(obj); 45 | else { 46 | return opts.hover_mode ? this.hover_branch(this.parent(obj)) : this.select_branch(this.parent(obj)); 47 | } 48 | } 49 | }, 50 | get_right : function() { 51 | var opts = $.extend(true, {}, $.tree.plugins.hotkeys.defaults, this.settings.plugins.hotkeys); 52 | var obj = this.hovered || this.selected; 53 | if(obj) { 54 | if(obj.hasClass("closed")) this.open_branch(obj); 55 | else { 56 | return opts.hover_mode ? this.hover_branch(obj.find("li:eq(0)")) : this.select_branch(obj.find("li:eq(0)")); 57 | } 58 | } 59 | }, 60 | 61 | callbacks : { 62 | oninit : function (t) { 63 | var opts = $.extend(true, {}, $.tree.plugins.hotkeys.defaults, this.settings.plugins.hotkeys); 64 | for(var i in opts.functions) { 65 | if(opts.functions.hasOwnProperty(i) && $.inArray(i, $.tree.plugins.hotkeys.bound) == -1) { 66 | (function (k) { 67 | $(document).bind("keydown", { combi : k, disableInInput: true }, function (event) { 68 | return $.tree.plugins.hotkeys.exec(k); 69 | }); 70 | })(i); 71 | $.tree.plugins.hotkeys.bound.push(i); 72 | } 73 | } 74 | } 75 | } 76 | } 77 | }); 78 | })(jQuery); -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/plugins/jquery.tree.metadata.js: -------------------------------------------------------------------------------- 1 | (function ($) { 2 | if(typeof $.metadata == "undefined") throw "jsTree metadata: jQuery metadata plugin not included."; 3 | 4 | $.extend($.tree.plugins, { 5 | "metadata" : { 6 | defaults : { 7 | attribute : "data" 8 | }, 9 | callbacks : { 10 | check : function(rule, obj, value, tree) { 11 | var opts = $.extend(true, {}, $.tree.plugins.metadata.defaults, this.settings.plugins.metadata); 12 | if(typeof $(obj).metadata({ type : "attr", name : opts.attribute })[rule] != "undefined") return $(obj).metadata()[rule]; 13 | } 14 | } 15 | } 16 | }); 17 | })(jQuery); -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/plugins/jquery.tree.themeroller.js: -------------------------------------------------------------------------------- 1 | (function ($) { 2 | $.extend($.tree.plugins, { 3 | "themeroller" : { 4 | defaults : { 5 | 6 | }, 7 | callbacks : { 8 | oninit : function (t) { 9 | if(this.settings.ui.theme_name != "themeroller") return; 10 | var opts = $.extend(true, {}, $.tree.plugins.themeroller.defaults, this.settings.plugins.themeroller); 11 | this.container.addClass("ui-widget ui-widget-content"); 12 | $("#" + this.container.attr("id") + " li a").live("mouseover", function () { $(this).addClass("ui-state-hover"); }); 13 | $("#" + this.container.attr("id") + " li a").live("mouseout", function () { $(this).removeClass("ui-state-hover"); }); 14 | }, 15 | onparse : function (s, t) { 16 | if(this.settings.ui.theme_name != "themeroller") return; 17 | var opts = $.extend(true, {}, $.tree.plugins.themeroller.defaults, this.settings.plugins.themeroller); 18 | return $(s).find("a").not(".ui-state-default").addClass("ui-state-default").children("ins").addClass("ui-icon").end().end().end(); 19 | }, 20 | onselect : function(n, t) { 21 | if(this.settings.ui.theme_name != "themeroller") return; 22 | var opts = $.extend(true, {}, $.tree.plugins.themeroller.defaults, this.settings.plugins.themeroller); 23 | $(n).children("a").addClass("ui-state-active"); 24 | }, 25 | ondeselect : function(n, t) { 26 | if(this.settings.ui.theme_name != "themeroller") return; 27 | var opts = $.extend(true, {}, $.tree.plugins.themeroller.defaults, this.settings.plugins.themeroller); 28 | $(n).children("a").removeClass("ui-state-active"); 29 | } 30 | } 31 | } 32 | }); 33 | })(jQuery); -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/themes/apple/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/javascript/jstree-0.9.9a2/themes/apple/bg.jpg -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/themes/apple/dot_for_ie.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/javascript/jstree-0.9.9a2/themes/apple/dot_for_ie.gif -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/themes/apple/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/javascript/jstree-0.9.9a2/themes/apple/icons.png -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/themes/apple/style.css: -------------------------------------------------------------------------------- 1 | /* BACKGROUND */ 2 | .tree-apple .ltr, .tree-apple .rtl { background:url("bg.jpg") left top repeat; min-width:100%; _width:100%; margin-left:0; margin-right:0; display:table; } 3 | .tree-apple .ltr > li.leaf, .tree-apple .rtl > li.leaf { background-image:none; } 4 | 5 | /* LOCKED */ 6 | .tree-apple .locked li a { color:gray; } 7 | /* DOTS */ 8 | .tree-apple ul { background-position:6px 1px; background-repeat:repeat-y; background-image:url(data:image/gif;base64,R0lGODlhAgACAIAAAB4dGf///yH5BAEAAAEALAAAAAACAAIAAAICRF4AOw==); _background-image:url("dot_for_ie.gif"); *background-image:url("dot_for_ie.gif"); } 9 | .tree-apple li { background-position:-64px -16px; background-repeat:no-repeat; background-image:url("icons.png"); } 10 | /* NO DOTS */ 11 | .tree-apple .no_dots, .tree-apple .no_dots ul { background:transparent; } 12 | .tree-apple .no_dots li.leaf { background-image:none; background-color:transparent; } 13 | /* OPEN or CLOSED */ 14 | .tree-apple li.open { background:url("icons.png") -32px -48px no-repeat; } 15 | .tree-apple li.closed, #jstree-dragged.tree-apple li li.open { background:url("icons.png") -48px -32px no-repeat; } 16 | #jstree-marker { background-image:url("icons.png"); } 17 | /* DEFAULT, HOVER, CLICKED, LOADING STATES */ 18 | .tree-apple li a, .tree-apple li span { border-radius:3px; -moz-border-radius:3px; -webkit-border-radius:3px; } 19 | .tree-apple li a:hover, .tree-apple li a.hover, .tree-apple li span { background: #e7f4f9; border:1px solid #d8f0fa; padding:0px 3px 0px 3px; } 20 | .tree-apple li a.clicked, .tree-apple li a.clicked:hover, .tree-apple li span.clicked { background: #beebff; border:1px solid #99defd; padding:0px 3px 0px 3px; } 21 | /* ICONS */ 22 | .tree-apple ins { background-image:url("icons.png"); background-position:0 0; background-repeat:no-repeat; } 23 | .tree-apple ul li a.loading ins { background-image:url("throbber.gif") !important; background-position:0 0 !important; } /* UL is added to make selector stronger */ 24 | .tree-apple li a ins.forbidden { background-position:-16px -16px; } 25 | .tree-apple .locked li a ins { background-position:0 -48px; } 26 | .tree-apple li span ins { background-position:-16px 0; } 27 | #jstree-dragged.tree-apple ins { background:url("icons.png") -16px -32px no-repeat; } 28 | #jstree-dragged.tree-apple ins.forbidden { background:url("icons.png") -16px -16px no-repeat; } 29 | 30 | /* CONTEXT MENU */ 31 | .tree-apple-context a ins { background-image:url("icons.png"); background-repeat:no-repeat; background-position:-64px -64px; } 32 | .tree-apple-context a ins.create { background-position:0 -16px; } 33 | .tree-apple-context a ins.rename { background-position:-16px 0px; } 34 | .tree-apple-context a ins.remove { background-position:0 -32px; } -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/themes/apple/throbber.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/javascript/jstree-0.9.9a2/themes/apple/throbber.gif -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/themes/checkbox/dot_for_ie.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/javascript/jstree-0.9.9a2/themes/checkbox/dot_for_ie.gif -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/themes/checkbox/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/javascript/jstree-0.9.9a2/themes/checkbox/icons.png -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/themes/checkbox/style.css: -------------------------------------------------------------------------------- 1 | /* LOCKED */ 2 | .tree-checkbox .locked li a { color:gray; } 3 | /* DOTS */ 4 | .tree-checkbox ul { background-position:6px 1px; background-repeat:repeat-y; background-image:url(data:image/gif;base64,R0lGODlhAgACAIAAAB4dGf///yH5BAEAAAEALAAAAAACAAIAAAICRF4AOw==); _background-image:url("dot_for_ie.gif"); *background-image:url("dot_for_ie.gif"); } 5 | .tree-checkbox li { background-position:-64px -16px; background-repeat:no-repeat; background-image:url("icons.png"); } 6 | /* NO DOTS */ 7 | .tree-checkbox .no_dots, .tree-checkbox .no_dots ul { background:transparent; } 8 | .tree-checkbox .no_dots li.leaf { background-image:none; background-color:transparent; } 9 | /* OPEN or CLOSED */ 10 | .tree-checkbox li.open { background:url("icons.png") -32px -48px no-repeat; } 11 | .tree-checkbox li.closed, #jstree-dragged.tree-checkbox li li.open { background:url("icons.png") -48px -32px no-repeat; } 12 | #jstree-marker { background-image:url("icons.png"); } 13 | /* DEFAULT, HOVER, CLICKED, LOADING STATES */ 14 | .tree-checkbox li a, .tree-checkbox li span { border-radius:3px; -moz-border-radius:3px; -webkit-border-radius:3px; } 15 | /* 16 | .tree-checkbox li a:hover, .tree-checkbox li a.hover, .tree-checkbox li span { background: #e7f4f9; border:1px solid #d8f0fa; padding:0px 3px 0px 3px; } 17 | .tree-checkbox li a.clicked, .tree-checkbox li a.clicked:hover, .tree-checkbox li span.clicked { background: #beebff; border:1px solid #99defd; padding:0px 3px 0px 3px; } 18 | */ 19 | /* ICONS */ 20 | .tree-checkbox ins { background-image:url("icons.png"); background-position:0 0; background-repeat:no-repeat; } 21 | .tree-checkbox ul li a.loading ins { background-image:url("throbber.gif") !important; background-position:0 0 !important; } /* UL is added to make selector stronger */ 22 | .tree-checkbox li a ins.forbidden { background-position:-16px -48px; } 23 | 24 | .tree-checkbox li a.undetermined ins { background-position:0px -16px; } 25 | .tree-checkbox li a.checked ins { background-position:0px -32px; } 26 | 27 | .tree-checkbox li a:hover ins { background-position:-16px 0px; } 28 | .tree-checkbox li a.undetermined:hover ins { background-position:-16px -16px; } 29 | .tree-checkbox li a.checked:hover ins { background-position:-16px -32px; } 30 | 31 | #jstree-dragged.tree-checkbox ins { background:url("icons.png") 0 -48px no-repeat; } 32 | #jstree-dragged.tree-checkbox ins.forbidden { background:url("icons.png") -16px -48px no-repeat; } 33 | 34 | /* CONTEXT MENU */ 35 | .tree-checkbox-context a ins { background-image:url("icons.png"); background-repeat:no-repeat; background-position:-64px -64px; } 36 | .tree-checkbox-context a ins.create { background-position:0 -16px; } 37 | .tree-checkbox-context a ins.rename { background-position:-16px 0px; } 38 | .tree-checkbox-context a ins.remove { background-position:0 -32px; } -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/themes/checkbox/throbber.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/javascript/jstree-0.9.9a2/themes/checkbox/throbber.gif -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/themes/classic/dot_for_ie.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/javascript/jstree-0.9.9a2/themes/classic/dot_for_ie.gif -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/themes/classic/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/javascript/jstree-0.9.9a2/themes/classic/icons.png -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/themes/classic/style.css: -------------------------------------------------------------------------------- 1 | /* LOCKED */ 2 | .tree-classic .locked li a { color:gray; } 3 | /* DOTS */ 4 | .tree-classic ul { background-position:6px 1px; background-repeat:repeat-y; background-image:url(data:image/gif;base64,R0lGODlhAgACAIAAAB4dGf///yH5BAEAAAEALAAAAAACAAIAAAICRF4AOw==); _background-image:url("dot_for_ie.gif"); *background-image:url("dot_for_ie.gif"); } 5 | .tree-classic li { background-position:-64px -16px; background-repeat:no-repeat; background-image:url("icons.png"); } 6 | /* NO DOTS */ 7 | .tree-classic .no_dots, .tree-classic .no_dots ul { background:transparent; } 8 | .tree-classic .no_dots li.leaf { background-image:none; background-color:transparent; } 9 | /* OPEN or CLOSED */ 10 | .tree-classic li.open { background:url("icons.png") -32px -48px no-repeat; } 11 | .tree-classic li.closed, #jstree-dragged.tree-classic li li.open { background:url("icons.png") -48px -32px no-repeat; } 12 | #jstree-marker { background-image:url("icons.png"); } 13 | /* DEFAULT, HOVER, CLICKED, LOADING STATES */ 14 | .tree-classic li a:hover, .tree-classic li a.hover, .tree-classic li span { /*background: #e7f4f9; border:1px solid #d8f0fa; padding:0px 3px 0px 3px;*/ } 15 | .tree-classic li a.clicked, .tree-classic li a.clicked:hover, .tree-classic li span.clicked { background: navy; border:1px solid navy; color:white; padding:0px 3px 0px 3px; } 16 | /* ICONS */ 17 | .tree-classic ins { background-image:url("icons.png"); background-position:0 0; background-repeat:no-repeat; } 18 | .tree-classic ul li a.loading ins { background-image:url("throbber.gif") !important; background-position:0 0 !important; } /* UL is added to make selector stronger */ 19 | .tree-classic li.closed a ins, .tree-classic li.leaf a ins { background-position:0 0px; } /* UL is added to make selector stronger */ 20 | .tree-classic ul li a.loading ins { background-image:url("throbber.gif"); background-position:0 0; } /* UL is added to make selector stronger */ 21 | .tree-classic li a ins.forbidden { background-position:-16px -16px; } 22 | .tree-classic .locked li a ins { background-position:0 -48px; } 23 | .tree-classic li span ins { background-position:-16px 0; } 24 | #jstree-dragged.tree-classic ins { background:url("icons.png") -16px -32px no-repeat; } 25 | #jstree-dragged.tree-classic ins.forbidden { background:url("icons.png") -16px -16px no-repeat; } 26 | 27 | /* CONTEXT MENU */ 28 | .tree-classic-context a ins { background-image:url("icons.png"); background-repeat:no-repeat; background-position:-64px -64px; } 29 | .tree-classic-context a ins.create { background-position:0 -16px; } 30 | .tree-classic-context a ins.rename { background-position:-16px 0px; } 31 | .tree-classic-context a ins.remove { background-position:-32px -16px; } -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/themes/classic/throbber.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/javascript/jstree-0.9.9a2/themes/classic/throbber.gif -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/themes/default/dot_for_ie.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/javascript/jstree-0.9.9a2/themes/default/dot_for_ie.gif -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/themes/default/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/javascript/jstree-0.9.9a2/themes/default/icons.png -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/themes/default/style.css: -------------------------------------------------------------------------------- 1 | /* LOCKED */ 2 | .tree-default .locked li a { color:gray; } 3 | /* DOTS */ 4 | .tree-default ul { background-position:6px 1px; background-repeat:repeat-y; background-image:url(data:image/gif;base64,R0lGODlhAgACAIAAAB4dGf///yH5BAEAAAEALAAAAAACAAIAAAICRF4AOw==); _background-image:url("dot_for_ie.gif"); *background-image:url("dot_for_ie.gif"); } 5 | .tree-default li { background-position:-64px -16px; background-repeat:no-repeat; background-image:url("icons.png"); } 6 | /* NO DOTS */ 7 | .tree-default .no_dots, .tree-default .no_dots ul { background:transparent; } 8 | .tree-default .no_dots li.leaf { background-image:none; background-color:transparent; } 9 | /* OPEN or CLOSED */ 10 | .tree-default li.open { background:url("icons.png") -32px -48px no-repeat; } 11 | .tree-default li.closed, #jstree-dragged.tree-default li li.open { background:url("icons.png") -48px -32px no-repeat; } 12 | #jstree-marker { background-image:url("icons.png"); } 13 | /* DEFAULT, HOVER, CLICKED, LOADING STATES */ 14 | .tree-default li a, .tree-default li span { border-radius:3px; -moz-border-radius:3px; -webkit-border-radius:3px; } 15 | .tree-default li a:hover, .tree-default li a.hover, .tree-default li span { background: #e7f4f9; border:1px solid #d8f0fa; padding:0px 3px 0px 3px; } 16 | .tree-default li a.clicked, .tree-default li a.clicked:hover, .tree-default li span.clicked { background: #beebff; border:1px solid #99defd; padding:0px 3px 0px 3px; } 17 | /* ICONS */ 18 | .tree-default ins { background-image:url("icons.png"); background-position:0 0; background-repeat:no-repeat; } 19 | .tree-default ul li a.loading ins { background-image:url("throbber.gif") !important; background-position:0 0 !important; } /* UL is added to make selector stronger */ 20 | .tree-default li a ins.forbidden { background-position:-16px -16px; } 21 | .tree-default .locked li a ins { background-position:0 -48px; } 22 | .tree-default li span ins { background-position:-16px 0; } 23 | #jstree-dragged.tree-default ins { background:url("icons.png") -16px -32px no-repeat; } 24 | #jstree-dragged.tree-default ins.forbidden { background:url("icons.png") -16px -16px no-repeat; } 25 | 26 | /* CONTEXT MENU */ 27 | .tree-default-context a ins { background-image:url("icons.png"); background-repeat:no-repeat; background-position:-64px -64px; } 28 | .tree-default-context a ins.create { background-position:0 -16px; } 29 | .tree-default-context a ins.rename { background-position:-16px 0px; } 30 | .tree-default-context a ins.remove { background-position:0 -32px; } -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/themes/default/throbber.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/javascript/jstree-0.9.9a2/themes/default/throbber.gif -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/themes/themeroller/dot_for_ie.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/javascript/jstree-0.9.9a2/themes/themeroller/dot_for_ie.gif -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/themes/themeroller/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/javascript/jstree-0.9.9a2/themes/themeroller/icons.png -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/themes/themeroller/style.css: -------------------------------------------------------------------------------- 1 | /* LOCKED */ 2 | .tree-themeroller .locked li a { color:gray; } 3 | /* DOTS */ 4 | .tree-themeroller ul { background-position:6px 1px; background-repeat:repeat-y; background-image:url(data:image/gif;base64,R0lGODlhAgACAIAAAB4dGf///yH5BAEAAAEALAAAAAACAAIAAAICRF4AOw==); _background-image:url("dot_for_ie.gif"); *background-image:url("dot_for_ie.gif"); } 5 | .tree-themeroller li { background-position:-64px -16px; background-repeat:no-repeat; background-image:url("icons.png"); } 6 | /* NO DOTS */ 7 | .tree-themeroller .no_dots, .tree-themeroller .no_dots ul { background:transparent; } 8 | .tree-themeroller .no_dots li.leaf { background-image:none; background-color:transparent; } 9 | /* OPEN or CLOSED */ 10 | .tree-themeroller li.open { background:url("icons.png") -32px -48px no-repeat; } 11 | .tree-themeroller li.closed, #jstree-dragged.tree-themeroller li li.open { background:url("icons.png") -48px -32px no-repeat; } 12 | #jstree-marker { background-image:url("icons.png"); } 13 | 14 | .tree-themeroller li, .tree-themeroller li a, .tree-themeroller li a ins { line-height:16px !important; } 15 | .tree-themeroller li a .ui-icon { overflow:visible; } 16 | 17 | /* DEFAULT, HOVER, CLICKED, LOADING STATES 18 | .tree-themeroller li a, .tree-themeroller li span { border-radius:3px; -moz-border-radius:3px; -webkit-border-radius:3px; } 19 | .tree-themeroller li a:hover, .tree-themeroller li a.hover, .tree-themeroller li span { background: #e7f4f9; border:1px solid #d8f0fa; padding:0px 3px 0px 3px; } 20 | .tree-themeroller li a.clicked, .tree-themeroller li a.clicked:hover, .tree-themeroller li span.clicked { background: #beebff; border:1px solid #99defd; padding:0px 3px 0px 3px; } 21 | */ 22 | /* ICONS */ 23 | .tree-themeroller ul li a.loading ins { background-image:url("throbber.gif") !important; background-position:0 0 !important; } /* UL is added to make selector stronger */ 24 | /* 25 | .tree-themeroller ins { background-image:url("icons.png"); background-position:0 0; background-repeat:no-repeat; } 26 | .tree-themeroller li a ins.forbidden { background-position:-16px -16px; } 27 | .tree-themeroller .locked li a ins { background-position:0 -48px; } 28 | .tree-themeroller li span ins { background-position:-16px 0; } 29 | */ 30 | 31 | #jstree-dragged.tree-themeroller ins { background:url("icons.png") -16px -32px no-repeat; } 32 | #jstree-dragged.tree-themeroller ins.forbidden { background:url("icons.png") -16px -16px no-repeat; } 33 | 34 | /* CONTEXT MENU 35 | .tree-themeroller-context a ins { background-image:url("icons.png"); background-repeat:no-repeat; background-position:-64px -64px; } 36 | .tree-themeroller-context a ins.create { background-position:0 -16px; } 37 | .tree-themeroller-context a ins.rename { background-position:-16px 0px; } 38 | .tree-themeroller-context a ins.remove { background-position:0 -32px; } 39 | */ -------------------------------------------------------------------------------- /javascript/jstree-0.9.9a2/themes/themeroller/throbber.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/javascript/jstree-0.9.9a2/themes/themeroller/throbber.gif -------------------------------------------------------------------------------- /javascript/jstree/lib/jquery.cookie.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Cookie plugin 3 | * 4 | * Copyright (c) 2006 Klaus Hartl (stilbuero.de) 5 | * Dual licensed under the MIT and GPL licenses: 6 | * http://www.opensource.org/licenses/mit-license.php 7 | * http://www.gnu.org/licenses/gpl.html 8 | * 9 | */ 10 | 11 | /** 12 | * Create a cookie with the given name and value and other optional parameters. 13 | * 14 | * @example $.cookie('the_cookie', 'the_value'); 15 | * @desc Set the value of a cookie. 16 | * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true }); 17 | * @desc Create a cookie with all available options. 18 | * @example $.cookie('the_cookie', 'the_value'); 19 | * @desc Create a session cookie. 20 | * @example $.cookie('the_cookie', null); 21 | * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain 22 | * used when the cookie was set. 23 | * 24 | * @param String name The name of the cookie. 25 | * @param String value The value of the cookie. 26 | * @param Object options An object literal containing key/value pairs to provide optional cookie attributes. 27 | * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object. 28 | * If a negative value is specified (e.g. a date in the past), the cookie will be deleted. 29 | * If set to null or omitted, the cookie will be a session cookie and will not be retained 30 | * when the the browser exits. 31 | * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie). 32 | * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie). 33 | * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will 34 | * require a secure protocol (like HTTPS). 35 | * @type undefined 36 | * 37 | * @name $.cookie 38 | * @cat Plugins/Cookie 39 | * @author Klaus Hartl/klaus.hartl@stilbuero.de 40 | */ 41 | 42 | /** 43 | * Get the value of a cookie with the given name. 44 | * 45 | * @example $.cookie('the_cookie'); 46 | * @desc Get the value of a cookie. 47 | * 48 | * @param String name The name of the cookie. 49 | * @return The value of the cookie. 50 | * @type String 51 | * 52 | * @name $.cookie 53 | * @cat Plugins/Cookie 54 | * @author Klaus Hartl/klaus.hartl@stilbuero.de 55 | */ 56 | jQuery.cookie = function(name, value, options) { 57 | if (typeof value != 'undefined') { // name and value given, set cookie 58 | options = options || {}; 59 | if (value === null) { 60 | value = ''; 61 | options.expires = -1; 62 | } 63 | var expires = ''; 64 | if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) { 65 | var date; 66 | if (typeof options.expires == 'number') { 67 | date = new Date(); 68 | date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000)); 69 | } else { 70 | date = options.expires; 71 | } 72 | expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE 73 | } 74 | // CAUTION: Needed to parenthesize options.path and options.domain 75 | // in the following expressions, otherwise they evaluate to undefined 76 | // in the packed version for some reason... 77 | var path = options.path ? '; path=' + (options.path) : ''; 78 | var domain = options.domain ? '; domain=' + (options.domain) : ''; 79 | var secure = options.secure ? '; secure' : ''; 80 | document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join(''); 81 | } else { // only name given, get cookie 82 | var cookieValue = null; 83 | if (document.cookie && document.cookie != '') { 84 | var cookies = document.cookie.split(';'); 85 | for (var i = 0; i < cookies.length; i++) { 86 | var cookie = jQuery.trim(cookies[i]); 87 | // Does this cookie string begin with the name we want? 88 | if (cookie.substring(0, name.length + 1) == (name + '=')) { 89 | cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); 90 | break; 91 | } 92 | } 93 | } 94 | return cookieValue; 95 | } 96 | }; -------------------------------------------------------------------------------- /javascript/jstree/lib/jquery.metadata.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Metadata - jQuery plugin for parsing metadata from elements 3 | * 4 | * Copyright (c) 2006 John Resig, Yehuda Katz, J�örn Zaefferer, Paul McLanahan 5 | * 6 | * Dual licensed under the MIT and GPL licenses: 7 | * http://www.opensource.org/licenses/mit-license.php 8 | * http://www.gnu.org/licenses/gpl.html 9 | * 10 | * Revision: $Id: jquery.metadata.js 4187 2007-12-16 17:15:27Z joern.zaefferer $ 11 | * 12 | */ 13 | 14 | /** 15 | * Sets the type of metadata to use. Metadata is encoded in JSON, and each property 16 | * in the JSON will become a property of the element itself. 17 | * 18 | * There are three supported types of metadata storage: 19 | * 20 | * attr: Inside an attribute. The name parameter indicates *which* attribute. 21 | * 22 | * class: Inside the class attribute, wrapped in curly braces: { } 23 | * 24 | * elem: Inside a child element (e.g. a script tag). The 25 | * name parameter indicates *which* element. 26 | * 27 | * The metadata for an element is loaded the first time the element is accessed via jQuery. 28 | * 29 | * As a result, you can define the metadata type, use $(expr) to load the metadata into the elements 30 | * matched by expr, then redefine the metadata type and run another $(expr) for other elements. 31 | * 32 | * @name $.metadata.setType 33 | * 34 | * @example

    This is a p

    35 | * @before $.metadata.setType("class") 36 | * @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label" 37 | * @desc Reads metadata from the class attribute 38 | * 39 | * @example

    This is a p

    40 | * @before $.metadata.setType("attr", "data") 41 | * @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label" 42 | * @desc Reads metadata from a "data" attribute 43 | * 44 | * @example

    This is a p

    45 | * @before $.metadata.setType("elem", "script") 46 | * @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label" 47 | * @desc Reads metadata from a nested script element 48 | * 49 | * @param String type The encoding type 50 | * @param String name The name of the attribute to be used to get metadata (optional) 51 | * @cat Plugins/Metadata 52 | * @descr Sets the type of encoding to be used when loading metadata for the first time 53 | * @type undefined 54 | * @see metadata() 55 | */ 56 | 57 | (function($) { 58 | 59 | $.extend({ 60 | metadata : { 61 | defaults : { 62 | type: 'class', 63 | name: 'metadata', 64 | cre: /({.*})/, 65 | single: 'metadata' 66 | }, 67 | setType: function( type, name ){ 68 | this.defaults.type = type; 69 | this.defaults.name = name; 70 | }, 71 | get: function( elem, opts ){ 72 | var settings = $.extend({},this.defaults,opts); 73 | // check for empty string in single property 74 | if ( !settings.single.length ) settings.single = 'metadata'; 75 | 76 | var data = $.data(elem, settings.single); 77 | // returned cached data if it already exists 78 | if ( data ) return data; 79 | 80 | data = "{}"; 81 | 82 | if ( settings.type == "class" ) { 83 | var m = settings.cre.exec( elem.className ); 84 | if ( m ) 85 | data = m[1]; 86 | } else if ( settings.type == "elem" ) { 87 | if( !elem.getElementsByTagName ) 88 | return undefined; 89 | var e = elem.getElementsByTagName(settings.name); 90 | if ( e.length ) 91 | data = $.trim(e[0].innerHTML); 92 | } else if ( elem.getAttribute != undefined ) { 93 | var attr = elem.getAttribute( settings.name ); 94 | if ( attr ) 95 | data = attr; 96 | } 97 | 98 | if ( data.indexOf( '{' ) <0 ) 99 | data = "{" + data + "}"; 100 | 101 | data = eval("(" + data + ")"); 102 | 103 | $.data( elem, settings.single, data ); 104 | return data; 105 | } 106 | } 107 | }); 108 | 109 | /** 110 | * Returns the metadata object for the first member of the jQuery object. 111 | * 112 | * @name metadata 113 | * @descr Returns element's metadata object 114 | * @param Object opts An object contianing settings to override the defaults 115 | * @type jQuery 116 | * @cat Plugins/Metadata 117 | */ 118 | $.fn.metadata = function( opts ){ 119 | return $.metadata.get( this[0], opts ); 120 | }; 121 | 122 | })(jQuery); -------------------------------------------------------------------------------- /javascript/jstree/plugins/_jquery.tree.rtl.js: -------------------------------------------------------------------------------- 1 | (function ($) { 2 | $.extend($.tree.plugins, { 3 | "rtl" : { 4 | defaults : { 5 | attribute : "data" 6 | }, 7 | callbacks : { 8 | onload : function() { 9 | this.container.css("direction","rtl").children("ul:eq(0)").removeClass("ltr").addClass("rtl"); 10 | }, 11 | oninit : function() { 12 | if(!$.tree.plugins.rtl.css) { 13 | var css = '.tree .rtl li.last { float:right; } #jstree-dragged .rtl { margin:0; padding:0; } #jstree-marker.marker_rtl { width:40px; background-position:right center; } /* RTL modification */ .tree .rtl, .tree .rtl ul { margin:0 10px 0 0; } .tree .rtl li { padding:0 10px 0 0; } .tree .rtl li a, .tree .rtl li span { padding:1px 4px 1px 4px; } .tree > .rtl > li { display:table; } .tree .rtl ins { margin:0 0px 0 4px; }'; 14 | if(/msie/.test(u) && !/opera/.test(u)) { 15 | if(parseInt(v) == 6) css += '#jstree-dragged .rtl { width:20px; } .tree .rtl li.last { margin-top: expression( (this.previousSibling && /open/.test(this.previousSibling.className) ) ? "-2px" : "0"); } .marker_rtl { width:40px; background-position:right center; } '; 16 | if(parseInt(v) == 7) css += '.tree .rtl li.last { float:none; } #jstree-dragged .rtl { width:200px; }'; 17 | } 18 | if(/mozilla/.test(u) && !/(compatible|webkit)/.test(u) && v.indexOf("1.8") == 0) css += '.tree .rtl li a { display:inline; float:right; }'; 19 | $.tree.plugins.rtl.css = this.add_sheet({ str : css }); 20 | } 21 | } 22 | } 23 | } 24 | }); 25 | })(jQuery); 26 | 27 | // in mousemove: 28 | // tmp.drag_help.css({ "left" : (event.pageX - (tmp.origin_tree.settings.ui.rtl ? tmp.w : -5 ) ), "top" : (event.pageY + 15) }); 29 | // if(cnt.children("ul:eq(0)").hasClass("rtl")) goTo.x += et.width() - 28; 30 | // if(cnt.children("ul:eq(0)").hasClass("rtl")) { tree_component.drag_drop.marker.attr("class","marker_rtl"); } 31 | // if(cnt.children("ul:eq(0)").hasClass("rtl")) goTo.x += 36; 32 | // tree_component.drag_drop.marker.css({ "left" : et_off.left + ( cnt.children("ul:eq(0)").hasClass("rtl") ? (cnt.width() - 10) : 10 ) , "top" : et_off.top + 15 }).show(); -------------------------------------------------------------------------------- /javascript/jstree/plugins/jquery.tree.checkbox.js: -------------------------------------------------------------------------------- 1 | (function ($) { 2 | $.extend($.tree.plugins, { 3 | "checkbox" : { 4 | defaults : { 5 | three_state : true 6 | }, 7 | get_checked : function (t) { 8 | if(!t) t = $.tree.focused(); 9 | return t.container.find("a.checked").parent(); 10 | }, 11 | get_undeterminded : function (t) { 12 | if(!t) t = $.tree.focused(); 13 | return t.container.find("a.undetermined").parent(); 14 | }, 15 | get_unchecked : function (t) { 16 | if(!t) t = $.tree.focused(); 17 | return t.container.find("a:not(.checked, .undetermined)").parent(); 18 | }, 19 | 20 | check : function (n) { 21 | if(!n) return false; 22 | var t = $.tree.reference(n); 23 | n = t.get_node(n); 24 | if(n.children("a").hasClass("checked")) return true; 25 | 26 | var opts = $.extend(true, {}, $.tree.plugins.checkbox.defaults, t.settings.plugins.checkbox); 27 | if(opts.three_state) { 28 | n.find("li").andSelf().children("a").removeClass("unchecked undetermined").addClass("checked"); 29 | n.parents("li").each(function () { 30 | if($(this).children("ul").find("a:not(.checked):eq(0)").size() > 0) { 31 | $(this).parents("li").andSelf().children("a").removeClass("unchecked checked").addClass("undetermined"); 32 | return false; 33 | } 34 | else $(this).children("a").removeClass("unchecked undetermined").addClass("checked"); 35 | }); 36 | } 37 | else n.children("a").removeClass("unchecked").addClass("checked"); 38 | return true; 39 | }, 40 | uncheck : function (n) { 41 | if(!n) return false; 42 | var t = $.tree.reference(n); 43 | n = t.get_node(n); 44 | if(n.children("a").hasClass("unchecked")) return true; 45 | 46 | var opts = $.extend(true, {}, $.tree.plugins.checkbox.defaults, t.settings.plugins.checkbox); 47 | if(opts.three_state) { 48 | n.find("li").andSelf().children("a").removeClass("checked undetermined").addClass("unchecked"); 49 | n.parents("li").each(function () { 50 | if($(this).find("a.checked, a.undetermined").size() - 1 > 0) { 51 | $(this).parents("li").andSelf().children("a").removeClass("unchecked checked").addClass("undetermined"); 52 | return false; 53 | } 54 | else $(this).children("a").removeClass("checked undetermined").addClass("unchecked"); 55 | }); 56 | } 57 | else n.children("a").removeClass("checked").addClass("unchecked"); 58 | return true; 59 | }, 60 | toggle : function (n) { 61 | if(!n) return false; 62 | var t = $.tree.reference(n); 63 | n = t.get_node(n); 64 | if(n.children("a").hasClass("checked")) $.tree.plugins.checkbox.uncheck(n); 65 | else $.tree.plugins.checkbox.check(n); 66 | }, 67 | 68 | callbacks : { 69 | onchange : function(n, t) { 70 | $.tree.plugins.checkbox.toggle(n); 71 | } 72 | } 73 | } 74 | }); 75 | })(jQuery); -------------------------------------------------------------------------------- /javascript/jstree/plugins/jquery.tree.cookie.js: -------------------------------------------------------------------------------- 1 | (function ($) { 2 | if(typeof $.cookie == "undefined") throw "jsTree cookie: jQuery cookie plugin not included."; 3 | 4 | $.extend($.tree.plugins, { 5 | "cookie" : { 6 | defaults : { 7 | prefix : "", // a prefix that will be used for all cookies for this tree 8 | options : { 9 | expires: false, 10 | path: false, 11 | domain: false, 12 | secure: false 13 | }, 14 | types : { 15 | selected : true, // should we set the selected cookie 16 | open : true // should we set the open cookie 17 | }, 18 | keep_selected : false, // should we merge with the selected option or overwrite it 19 | keep_opened : false // should we merge with the opened option or overwrite it 20 | }, 21 | set_cookie : function (type) { 22 | var opts = $.extend(true, {}, $.tree.plugins.cookie.defaults, this.settings.plugins.cookie); 23 | if(opts.types[type] !== true) return false; 24 | switch(type) { 25 | case "selected": 26 | if(this.settings.rules.multiple != false && this.selected_arr.length > 1) { 27 | var val = Array(); 28 | $.each(this.selected_arr, function () { 29 | if(this.attr("id")) { val.push(this.attr("id")); } 30 | }); 31 | val = val.join(","); 32 | } 33 | else var val = this.selected ? this.selected.attr("id") : false; 34 | $.cookie(opts.prefix + 'selected', val, opts.options); 35 | break; 36 | case "open": 37 | var str = ""; 38 | this.container.find("li.open").each(function (i) { if(this.id) { str += this.id + ","; } }); 39 | $.cookie(opts.prefix + 'open', str.replace(/,$/ig,""), opts.options); 40 | break; 41 | } 42 | }, 43 | callbacks : { 44 | oninit : function (t) { 45 | var opts = $.extend(true, {}, $.tree.plugins.cookie.defaults, this.settings.plugins.cookie); 46 | var tmp = false; 47 | tmp = $.cookie(opts.prefix + 'open'); 48 | if(tmp) { 49 | tmp = tmp.split(","); 50 | if(opts.keep_opened) this.settings.opened = $.unique($.merge(tmp, this.settings.opened)); 51 | else this.settings.opened = tmp; 52 | } 53 | tmp = $.cookie(opts.prefix + 'selected'); 54 | if(tmp) { 55 | tmp = tmp.split(","); 56 | if(opts.keep_selected) this.settings.selected = $.unique($.merge(tmp, this.settings.opened)); 57 | else this.settings.selected = tmp; 58 | } 59 | }, 60 | onchange : function() { $.tree.plugins.cookie.set_cookie.apply(this, ["selected"]); }, 61 | onopen : function() { $.tree.plugins.cookie.set_cookie.apply(this, ["open"]); }, 62 | onclose : function() { $.tree.plugins.cookie.set_cookie.apply(this, ["open"]); }, 63 | ondelete : function() { $.tree.plugins.cookie.set_cookie.apply(this, ["open"]); }, 64 | oncopy : function() { $.tree.plugins.cookie.set_cookie.apply(this, ["open"]); }, 65 | oncreate : function() { $.tree.plugins.cookie.set_cookie.apply(this, ["open"]); }, 66 | onmoved : function() { $.tree.plugins.cookie.set_cookie.apply(this, ["open"]); } 67 | } 68 | } 69 | }); 70 | })(jQuery); -------------------------------------------------------------------------------- /javascript/jstree/plugins/jquery.tree.hotkeys.js: -------------------------------------------------------------------------------- 1 | (function ($) { 2 | if(typeof window.hotkeys == "undefined") throw "jsTree hotkeys: jQuery hotkeys plugin not included."; 3 | 4 | $.extend($.tree.plugins, { 5 | "hotkeys" : { 6 | bound : [], 7 | disabled : false, 8 | defaults : { 9 | hover_mode : false, 10 | functions : { 11 | "up" : function () { $.tree.plugins.hotkeys.get_prev.apply(this); return false; }, 12 | "down" : function () { $.tree.plugins.hotkeys.get_next.apply(this); return false; }, 13 | "left" : function () { $.tree.plugins.hotkeys.get_left.apply(this); return false; }, 14 | "right" : function () { $.tree.plugins.hotkeys.get_right.apply(this); return false; }, 15 | "f2" : function () { if(this.selected) this.rename(); return false; }, 16 | "del" : function () { if(this.selected) this.remove(); return false; }, 17 | "ctrl+c": function () { if(this.selected) this.copy(); return false; }, 18 | "ctrl+x": function () { if(this.selected) this.cut(); return false; }, 19 | "ctrl+v": function () { if(this.selected) this.paste(); return false; } 20 | } 21 | }, 22 | exec : function(key) { 23 | if($.tree.plugins.hotkeys.disabled) return false; 24 | 25 | var t = $.tree.focused(); 26 | if(typeof t.settings.plugins.hotkeys == "undefined") return; 27 | var opts = $.extend(true, {}, $.tree.plugins.hotkeys.defaults, t.settings.plugins.hotkeys); 28 | if(typeof opts.functions[key] == "function") return opts.functions[key].apply(t); 29 | }, 30 | get_next : function() { 31 | var opts = $.extend(true, {}, $.tree.plugins.hotkeys.defaults, this.settings.plugins.hotkeys); 32 | var obj = this.hovered || this.selected; 33 | return opts.hover_mode ? this.hover_branch(this.next(obj)) : this.select_branch(this.next(obj)); 34 | }, 35 | get_prev : function() { 36 | var opts = $.extend(true, {}, $.tree.plugins.hotkeys.defaults, this.settings.plugins.hotkeys); 37 | var obj = this.hovered || this.selected; 38 | return opts.hover_mode ? this.hover_branch(this.prev(obj)) : this.select_branch(this.prev(obj)); 39 | }, 40 | get_left : function() { 41 | var opts = $.extend(true, {}, $.tree.plugins.hotkeys.defaults, this.settings.plugins.hotkeys); 42 | var obj = this.hovered || this.selected; 43 | if(obj) { 44 | if(obj.hasClass("open")) this.close_branch(obj); 45 | else { 46 | return opts.hover_mode ? this.hover_branch(this.parent(obj)) : this.select_branch(this.parent(obj)); 47 | } 48 | } 49 | }, 50 | get_right : function() { 51 | var opts = $.extend(true, {}, $.tree.plugins.hotkeys.defaults, this.settings.plugins.hotkeys); 52 | var obj = this.hovered || this.selected; 53 | if(obj) { 54 | if(obj.hasClass("closed")) this.open_branch(obj); 55 | else { 56 | return opts.hover_mode ? this.hover_branch(obj.find("li:eq(0)")) : this.select_branch(obj.find("li:eq(0)")); 57 | } 58 | } 59 | }, 60 | 61 | callbacks : { 62 | oninit : function (t) { 63 | var opts = $.extend(true, {}, $.tree.plugins.hotkeys.defaults, this.settings.plugins.hotkeys); 64 | for(var i in opts.functions) { 65 | if(opts.functions.hasOwnProperty(i) && $.inArray(i, $.tree.plugins.hotkeys.bound) == -1) { 66 | (function (k) { 67 | $(document).bind("keydown", { combi : k, disableInInput: true }, function (event) { 68 | return $.tree.plugins.hotkeys.exec(k); 69 | }); 70 | })(i); 71 | $.tree.plugins.hotkeys.bound.push(i); 72 | } 73 | } 74 | } 75 | } 76 | } 77 | }); 78 | })(jQuery); -------------------------------------------------------------------------------- /javascript/jstree/plugins/jquery.tree.metadata.js: -------------------------------------------------------------------------------- 1 | (function ($) { 2 | if(typeof $.metadata == "undefined") throw "jsTree metadata: jQuery metadata plugin not included."; 3 | 4 | $.extend($.tree.plugins, { 5 | "metadata" : { 6 | defaults : { 7 | attribute : "data" 8 | }, 9 | callbacks : { 10 | check : function(rule, obj, value, tree) { 11 | var opts = $.extend(true, {}, $.tree.plugins.metadata.defaults, this.settings.plugins.metadata); 12 | if(typeof $(obj).metadata({ type : "attr", name : opts.attribute })[rule] != "undefined") return $(obj).metadata()[rule]; 13 | } 14 | } 15 | } 16 | }); 17 | })(jQuery); -------------------------------------------------------------------------------- /javascript/jstree/plugins/jquery.tree.themeroller.js: -------------------------------------------------------------------------------- 1 | (function ($) { 2 | $.extend($.tree.plugins, { 3 | "themeroller" : { 4 | defaults : { 5 | 6 | }, 7 | callbacks : { 8 | oninit : function (t) { 9 | if(this.settings.ui.theme_name != "themeroller") return; 10 | var opts = $.extend(true, {}, $.tree.plugins.themeroller.defaults, this.settings.plugins.themeroller); 11 | this.container.addClass("ui-widget ui-widget-content"); 12 | $("#" + this.container.attr("id") + " li a").live("mouseover", function () { $(this).addClass("ui-state-hover"); }); 13 | $("#" + this.container.attr("id") + " li a").live("mouseout", function () { $(this).removeClass("ui-state-hover"); }); 14 | }, 15 | onparse : function (s, t) { 16 | if(this.settings.ui.theme_name != "themeroller") return; 17 | var opts = $.extend(true, {}, $.tree.plugins.themeroller.defaults, this.settings.plugins.themeroller); 18 | return $(s).find("a").not(".ui-state-default").addClass("ui-state-default").children("ins").addClass("ui-icon").end().end().end(); 19 | }, 20 | onselect : function(n, t) { 21 | if(this.settings.ui.theme_name != "themeroller") return; 22 | var opts = $.extend(true, {}, $.tree.plugins.themeroller.defaults, this.settings.plugins.themeroller); 23 | $(n).children("a").addClass("ui-state-active"); 24 | }, 25 | ondeselect : function(n, t) { 26 | if(this.settings.ui.theme_name != "themeroller") return; 27 | var opts = $.extend(true, {}, $.tree.plugins.themeroller.defaults, this.settings.plugins.themeroller); 28 | $(n).children("a").removeClass("ui-state-active"); 29 | } 30 | } 31 | } 32 | }); 33 | })(jQuery); -------------------------------------------------------------------------------- /javascript/jstree/themes/apple/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/javascript/jstree/themes/apple/bg.jpg -------------------------------------------------------------------------------- /javascript/jstree/themes/apple/dot_for_ie.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/javascript/jstree/themes/apple/dot_for_ie.gif -------------------------------------------------------------------------------- /javascript/jstree/themes/apple/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/javascript/jstree/themes/apple/icons.png -------------------------------------------------------------------------------- /javascript/jstree/themes/apple/style.css: -------------------------------------------------------------------------------- 1 | /* BACKGROUND */ 2 | .tree-apple .ltr, .tree-apple .rtl { background:url("bg.jpg") left top repeat; min-width:100%; _width:100%; margin-left:0; margin-right:0; display:table; } 3 | .tree-apple .ltr > li.leaf, .tree-apple .rtl > li.leaf { background-image:none; } 4 | 5 | /* LOCKED */ 6 | .tree-apple .locked li a { color:gray; } 7 | /* DOTS */ 8 | .tree-apple ul { background-position:6px 1px; background-repeat:repeat-y; background-image:url(data:image/gif;base64,R0lGODlhAgACAIAAAB4dGf///yH5BAEAAAEALAAAAAACAAIAAAICRF4AOw==); _background-image:url("dot_for_ie.gif"); *background-image:url("dot_for_ie.gif"); } 9 | .tree-apple li { background-position:-64px -16px; background-repeat:no-repeat; background-image:url("icons.png"); } 10 | /* NO DOTS */ 11 | .tree-apple .no_dots, .tree-apple .no_dots ul { background:transparent; } 12 | .tree-apple .no_dots li.leaf { background-image:none; background-color:transparent; } 13 | /* OPEN or CLOSED */ 14 | .tree-apple li.open { background:url("icons.png") -32px -48px no-repeat; } 15 | .tree-apple li.closed, #jstree-dragged.tree-apple li li.open { background:url("icons.png") -48px -32px no-repeat; } 16 | #jstree-marker { background-image:url("icons.png"); } 17 | /* DEFAULT, HOVER, CLICKED, LOADING STATES */ 18 | .tree-apple li a, .tree-apple li span { border-radius:3px; -moz-border-radius:3px; -webkit-border-radius:3px; } 19 | .tree-apple li a:hover, .tree-apple li a.hover, .tree-apple li span { background: #e7f4f9; border:1px solid #d8f0fa; padding:0px 3px 0px 3px; } 20 | .tree-apple li a.clicked, .tree-apple li a.clicked:hover, .tree-apple li span.clicked { background: #beebff; border:1px solid #99defd; padding:0px 3px 0px 3px; } 21 | /* ICONS */ 22 | .tree-apple ins { background-image:url("icons.png"); background-position:0 0; background-repeat:no-repeat; } 23 | .tree-apple ul li a.loading ins { background-image:url("throbber.gif") !important; background-position:0 0 !important; } /* UL is added to make selector stronger */ 24 | .tree-apple li a ins.forbidden { background-position:-16px -16px; } 25 | .tree-apple .locked li a ins { background-position:0 -48px; } 26 | .tree-apple li span ins { background-position:-16px 0; } 27 | #jstree-dragged.tree-apple ins { background:url("icons.png") -16px -32px no-repeat; } 28 | #jstree-dragged.tree-apple ins.forbidden { background:url("icons.png") -16px -16px no-repeat; } 29 | 30 | /* CONTEXT MENU */ 31 | .tree-apple-context a ins { background-image:url("icons.png"); background-repeat:no-repeat; background-position:-64px -64px; } 32 | .tree-apple-context a ins.create { background-position:0 -16px; } 33 | .tree-apple-context a ins.rename { background-position:-16px 0px; } 34 | .tree-apple-context a ins.remove { background-position:0 -32px; } -------------------------------------------------------------------------------- /javascript/jstree/themes/apple/throbber.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/javascript/jstree/themes/apple/throbber.gif -------------------------------------------------------------------------------- /javascript/jstree/themes/checkbox/dot_for_ie.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/javascript/jstree/themes/checkbox/dot_for_ie.gif -------------------------------------------------------------------------------- /javascript/jstree/themes/checkbox/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/javascript/jstree/themes/checkbox/icons.png -------------------------------------------------------------------------------- /javascript/jstree/themes/checkbox/style.css: -------------------------------------------------------------------------------- 1 | /* LOCKED */ 2 | .tree-checkbox .locked li a { color:gray; } 3 | /* DOTS */ 4 | .tree-checkbox ul { background-position:6px 1px; background-repeat:repeat-y; background-image:url(data:image/gif;base64,R0lGODlhAgACAIAAAB4dGf///yH5BAEAAAEALAAAAAACAAIAAAICRF4AOw==); _background-image:url("dot_for_ie.gif"); *background-image:url("dot_for_ie.gif"); } 5 | .tree-checkbox li { background-position:-64px -16px; background-repeat:no-repeat; background-image:url("icons.png"); } 6 | /* NO DOTS */ 7 | .tree-checkbox .no_dots, .tree-checkbox .no_dots ul { background:transparent; } 8 | .tree-checkbox .no_dots li.leaf { background-image:none; background-color:transparent; } 9 | /* OPEN or CLOSED */ 10 | .tree-checkbox li.open { background:url("icons.png") -32px -48px no-repeat; } 11 | .tree-checkbox li.closed, #jstree-dragged.tree-checkbox li li.open { background:url("icons.png") -48px -32px no-repeat; } 12 | #jstree-marker { background-image:url("icons.png"); } 13 | /* DEFAULT, HOVER, CLICKED, LOADING STATES */ 14 | .tree-checkbox li a, .tree-checkbox li span { border-radius:3px; -moz-border-radius:3px; -webkit-border-radius:3px; } 15 | /* 16 | .tree-checkbox li a:hover, .tree-checkbox li a.hover, .tree-checkbox li span { background: #e7f4f9; border:1px solid #d8f0fa; padding:0px 3px 0px 3px; } 17 | .tree-checkbox li a.clicked, .tree-checkbox li a.clicked:hover, .tree-checkbox li span.clicked { background: #beebff; border:1px solid #99defd; padding:0px 3px 0px 3px; } 18 | */ 19 | /* ICONS */ 20 | .tree-checkbox ins { background-image:url("icons.png"); background-position:0 0; background-repeat:no-repeat; } 21 | .tree-checkbox ul li a.loading ins { background-image:url("throbber.gif") !important; background-position:0 0 !important; } /* UL is added to make selector stronger */ 22 | .tree-checkbox li a ins.forbidden { background-position:-16px -48px; } 23 | 24 | .tree-checkbox li a.undetermined ins { background-position:0px -16px; } 25 | .tree-checkbox li a.checked ins { background-position:0px -32px; } 26 | 27 | .tree-checkbox li a:hover ins { background-position:-16px 0px; } 28 | .tree-checkbox li a.undetermined:hover ins { background-position:-16px -16px; } 29 | .tree-checkbox li a.checked:hover ins { background-position:-16px -32px; } 30 | 31 | #jstree-dragged.tree-checkbox ins { background:url("icons.png") 0 -48px no-repeat; } 32 | #jstree-dragged.tree-checkbox ins.forbidden { background:url("icons.png") -16px -48px no-repeat; } 33 | 34 | /* CONTEXT MENU */ 35 | .tree-checkbox-context a ins { background-image:url("icons.png"); background-repeat:no-repeat; background-position:-64px -64px; } 36 | .tree-checkbox-context a ins.create { background-position:0 -16px; } 37 | .tree-checkbox-context a ins.rename { background-position:-16px 0px; } 38 | .tree-checkbox-context a ins.remove { background-position:0 -32px; } -------------------------------------------------------------------------------- /javascript/jstree/themes/checkbox/throbber.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/javascript/jstree/themes/checkbox/throbber.gif -------------------------------------------------------------------------------- /javascript/jstree/themes/classic/dot_for_ie.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/javascript/jstree/themes/classic/dot_for_ie.gif -------------------------------------------------------------------------------- /javascript/jstree/themes/classic/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/javascript/jstree/themes/classic/icons.png -------------------------------------------------------------------------------- /javascript/jstree/themes/classic/style.css: -------------------------------------------------------------------------------- 1 | /* LOCKED */ 2 | .tree-classic .locked li a { color:gray; } 3 | /* DOTS */ 4 | .tree-classic ul { background-position:6px 1px; background-repeat:repeat-y; background-image:url(data:image/gif;base64,R0lGODlhAgACAIAAAB4dGf///yH5BAEAAAEALAAAAAACAAIAAAICRF4AOw==); _background-image:url("dot_for_ie.gif"); *background-image:url("dot_for_ie.gif"); } 5 | .tree-classic li { background-position:-64px -16px; background-repeat:no-repeat; background-image:url("icons.png"); } 6 | /* NO DOTS */ 7 | .tree-classic .no_dots, .tree-classic .no_dots ul { background:transparent; } 8 | .tree-classic .no_dots li.leaf { background-image:none; background-color:transparent; } 9 | /* OPEN or CLOSED */ 10 | .tree-classic li.open { background:url("icons.png") -32px -48px no-repeat; } 11 | .tree-classic li.closed, #jstree-dragged.tree-classic li li.open { background:url("icons.png") -48px -32px no-repeat; } 12 | #jstree-marker { background-image:url("icons.png"); } 13 | /* DEFAULT, HOVER, CLICKED, LOADING STATES */ 14 | .tree-classic li a:hover, .tree-classic li a.hover, .tree-classic li span { /*background: #e7f4f9; border:1px solid #d8f0fa; padding:0px 3px 0px 3px;*/ } 15 | .tree-classic li a.clicked, .tree-classic li a.clicked:hover, .tree-classic li span.clicked { background: navy; border:1px solid navy; color:white; padding:0px 3px 0px 3px; } 16 | /* ICONS */ 17 | .tree-classic ins { background-image:url("icons.png"); background-position:0 0; background-repeat:no-repeat; } 18 | .tree-classic ul li a.loading ins { background-image:url("throbber.gif") !important; background-position:0 0 !important; } /* UL is added to make selector stronger */ 19 | .tree-classic li.closed a ins, .tree-classic li.leaf a ins { background-position:0 0px; } /* UL is added to make selector stronger */ 20 | .tree-classic ul li a.loading ins { background-image:url("throbber.gif"); background-position:0 0; } /* UL is added to make selector stronger */ 21 | .tree-classic li a ins.forbidden { background-position:-16px -16px; } 22 | .tree-classic .locked li a ins { background-position:0 -48px; } 23 | .tree-classic li span ins { background-position:-16px 0; } 24 | #jstree-dragged.tree-classic ins { background:url("icons.png") -16px -32px no-repeat; } 25 | #jstree-dragged.tree-classic ins.forbidden { background:url("icons.png") -16px -16px no-repeat; } 26 | 27 | /* CONTEXT MENU */ 28 | .tree-classic-context a ins { background-image:url("icons.png"); background-repeat:no-repeat; background-position:-64px -64px; } 29 | .tree-classic-context a ins.create { background-position:0 -16px; } 30 | .tree-classic-context a ins.rename { background-position:-16px 0px; } 31 | .tree-classic-context a ins.remove { background-position:-32px -16px; } -------------------------------------------------------------------------------- /javascript/jstree/themes/classic/throbber.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/javascript/jstree/themes/classic/throbber.gif -------------------------------------------------------------------------------- /javascript/jstree/themes/default/dot_for_ie.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/javascript/jstree/themes/default/dot_for_ie.gif -------------------------------------------------------------------------------- /javascript/jstree/themes/default/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/javascript/jstree/themes/default/icons.png -------------------------------------------------------------------------------- /javascript/jstree/themes/default/style.css: -------------------------------------------------------------------------------- 1 | /* LOCKED */ 2 | .tree-default .locked li a { color:gray; } 3 | /* DOTS */ 4 | .tree-default ul { background-position:6px 1px; background-repeat:repeat-y; background-image:url(data:image/gif;base64,R0lGODlhAgACAIAAAB4dGf///yH5BAEAAAEALAAAAAACAAIAAAICRF4AOw==); _background-image:url("dot_for_ie.gif"); *background-image:url("dot_for_ie.gif"); } 5 | .tree-default li { background-position:-64px -16px; background-repeat:no-repeat; background-image:url("icons.png"); } 6 | /* NO DOTS */ 7 | .tree-default .no_dots, .tree-default .no_dots ul { background:transparent; } 8 | .tree-default .no_dots li.leaf { background-image:none; background-color:transparent; } 9 | /* OPEN or CLOSED */ 10 | .tree-default li.open { background:url("icons.png") -32px -48px no-repeat; } 11 | .tree-default li.closed, #jstree-dragged.tree-default li li.open { background:url("icons.png") -48px -32px no-repeat; } 12 | #jstree-marker { background-image:url("icons.png"); } 13 | /* DEFAULT, HOVER, CLICKED, LOADING STATES */ 14 | .tree-default li a, .tree-default li span { border-radius:3px; -moz-border-radius:3px; -webkit-border-radius:3px; } 15 | .tree-default li a:hover, .tree-default li a.hover, .tree-default li span { background: #e7f4f9; border:1px solid #d8f0fa; padding:0px 3px 0px 3px; } 16 | .tree-default li a.clicked, .tree-default li a.clicked:hover, .tree-default li span.clicked { background: #beebff; border:1px solid #99defd; padding:0px 3px 0px 3px; } 17 | /* ICONS */ 18 | .tree-default ins { background-image:url("icons.png"); background-position:0 0; background-repeat:no-repeat; } 19 | .tree-default ul li a.loading ins { background-image:url("throbber.gif") !important; background-position:0 0 !important; } /* UL is added to make selector stronger */ 20 | .tree-default li a ins.forbidden { background-position:-16px -16px; } 21 | .tree-default .locked li a ins { background-position:0 -48px; } 22 | .tree-default li span ins { background-position:-16px 0; } 23 | #jstree-dragged.tree-default ins { background:url("icons.png") -16px -32px no-repeat; } 24 | #jstree-dragged.tree-default ins.forbidden { background:url("icons.png") -16px -16px no-repeat; } 25 | 26 | /* CONTEXT MENU */ 27 | .tree-default-context a ins { background-image:url("icons.png"); background-repeat:no-repeat; background-position:-64px -64px; } 28 | .tree-default-context a ins.create { background-position:0 -16px; } 29 | .tree-default-context a ins.rename { background-position:-16px 0px; } 30 | .tree-default-context a ins.remove { background-position:0 -32px; } -------------------------------------------------------------------------------- /javascript/jstree/themes/default/throbber.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/javascript/jstree/themes/default/throbber.gif -------------------------------------------------------------------------------- /javascript/jstree/themes/themeroller/dot_for_ie.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/javascript/jstree/themes/themeroller/dot_for_ie.gif -------------------------------------------------------------------------------- /javascript/jstree/themes/themeroller/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/javascript/jstree/themes/themeroller/icons.png -------------------------------------------------------------------------------- /javascript/jstree/themes/themeroller/style.css: -------------------------------------------------------------------------------- 1 | /* LOCKED */ 2 | .tree-themeroller .locked li a { color:gray; } 3 | /* DOTS */ 4 | .tree-themeroller ul { background-position:6px 1px; background-repeat:repeat-y; background-image:url(data:image/gif;base64,R0lGODlhAgACAIAAAB4dGf///yH5BAEAAAEALAAAAAACAAIAAAICRF4AOw==); _background-image:url("dot_for_ie.gif"); *background-image:url("dot_for_ie.gif"); } 5 | .tree-themeroller li { background-position:-64px -16px; background-repeat:no-repeat; background-image:url("icons.png"); } 6 | /* NO DOTS */ 7 | .tree-themeroller .no_dots, .tree-themeroller .no_dots ul { background:transparent; } 8 | .tree-themeroller .no_dots li.leaf { background-image:none; background-color:transparent; } 9 | /* OPEN or CLOSED */ 10 | .tree-themeroller li.open { background:url("icons.png") -32px -48px no-repeat; } 11 | .tree-themeroller li.closed, #jstree-dragged.tree-themeroller li li.open { background:url("icons.png") -48px -32px no-repeat; } 12 | #jstree-marker { background-image:url("icons.png"); } 13 | 14 | .tree-themeroller li, .tree-themeroller li a, .tree-themeroller li a ins { line-height:16px !important; } 15 | .tree-themeroller li a .ui-icon { overflow:visible; } 16 | 17 | /* DEFAULT, HOVER, CLICKED, LOADING STATES 18 | .tree-themeroller li a, .tree-themeroller li span { border-radius:3px; -moz-border-radius:3px; -webkit-border-radius:3px; } 19 | .tree-themeroller li a:hover, .tree-themeroller li a.hover, .tree-themeroller li span { background: #e7f4f9; border:1px solid #d8f0fa; padding:0px 3px 0px 3px; } 20 | .tree-themeroller li a.clicked, .tree-themeroller li a.clicked:hover, .tree-themeroller li span.clicked { background: #beebff; border:1px solid #99defd; padding:0px 3px 0px 3px; } 21 | */ 22 | /* ICONS */ 23 | .tree-themeroller ul li a.loading ins { background-image:url("throbber.gif") !important; background-position:0 0 !important; } /* UL is added to make selector stronger */ 24 | /* 25 | .tree-themeroller ins { background-image:url("icons.png"); background-position:0 0; background-repeat:no-repeat; } 26 | .tree-themeroller li a ins.forbidden { background-position:-16px -16px; } 27 | .tree-themeroller .locked li a ins { background-position:0 -48px; } 28 | .tree-themeroller li span ins { background-position:-16px 0; } 29 | */ 30 | 31 | #jstree-dragged.tree-themeroller ins { background:url("icons.png") -16px -32px no-repeat; } 32 | #jstree-dragged.tree-themeroller ins.forbidden { background:url("icons.png") -16px -16px no-repeat; } 33 | 34 | /* CONTEXT MENU 35 | .tree-themeroller-context a ins { background-image:url("icons.png"); background-repeat:no-repeat; background-position:-64px -64px; } 36 | .tree-themeroller-context a ins.create { background-position:0 -16px; } 37 | .tree-themeroller-context a ins.rename { background-position:-16px 0px; } 38 | .tree-themeroller-context a ins.remove { background-position:0 -32px; } 39 | */ -------------------------------------------------------------------------------- /javascript/jstree/themes/themeroller/throbber.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/javascript/jstree/themes/themeroller/throbber.gif -------------------------------------------------------------------------------- /javascript/nicEditorIcons.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/javascript/nicEditorIcons.gif -------------------------------------------------------------------------------- /javascript/nicedit-class-selector.js: -------------------------------------------------------------------------------- 1 | 2 | (function ($) { 3 | SSFrontendEditor.Instance.registerPlugin({ 4 | addButtonsTo: function (buttons) { 5 | buttons.splice(buttons.indexOf('bold'), 0, 'applyclass'); 6 | }, 7 | load: function (editors) { 8 | var classSelectorOptions = { 9 | buttons : { 10 | 'applyclass' : {name : 'Add Class', type : 'SSFrontendEditor.classSelectorButton', command: 'formatBlock'} 11 | } 12 | }; 13 | 14 | SSFrontendEditor.classSelectorButton = nicEditorSelect.extend({ 15 | init : function() { 16 | 17 | this.setDisplay('Style...'); 18 | var styles = this.getStyles() 19 | for(var itm in styles) { 20 | var className = itm.substr(1, itm.length); 21 | this.add(className, styles[itm]); 22 | } 23 | }, 24 | 25 | getStyles: function () { 26 | if(!document.styleSheets) return false; // return false if browser sucks 27 | var rules = {} 28 | for (var i=0; i < document.styleSheets.length; i++) { 29 | var x = 0; 30 | var styleSheet = document.styleSheets[i]; 31 | if (styleSheet) { 32 | // otherwise get them individually 33 | do { 34 | try { 35 | var cssRule = styleSheet.cssRules ? styleSheet.cssRules[x] : styleSheet.rules[x]; 36 | if(cssRule && cssRule.selectorText && cssRule.selectorText.indexOf('.wysiwyg-') == 0) { 37 | var className = cssRule.selectorText.replace(/.wysiwyg-/, ''); 38 | rules['.' + className] = className; 39 | } 40 | } catch (someErrorWeIgnore) { 41 | cssRule = null; 42 | } 43 | 44 | x++; 45 | } while (cssRule); 46 | } 47 | } 48 | return rules; 49 | }, 50 | 51 | enable : function(t) { 52 | this.isDisabled = false; 53 | this.close(); 54 | this.contain.setStyle({opacity : 1}); 55 | 56 | this.selectedElem = this.ne.selectedInstance.selElm(); 57 | }, 58 | 59 | update : function(cls) { 60 | 61 | var curRange = this.ne.selectedInstance.getRng(); 62 | if (window.getSelection) { 63 | var selectionContent = curRange.extractContents(); 64 | if (selectionContent.childNodes && selectionContent.childNodes.length > 0) { 65 | for (var i = selectionContent.childNodes.length - 1; i >= 0; i--) { 66 | var tn = selectionContent.childNodes[i]; 67 | if (tn.nodeType == 3) { 68 | curRange.insertNode($('').addClass(cls).text(tn.nodeValue).get(0)); 69 | } else { 70 | curRange.insertNode($(tn).addClass(cls).clone().get(0)); 71 | } 72 | } 73 | } else { 74 | var seld = this.ne.selectedInstance.selElm(); 75 | if (seld.nodeType == 3) { 76 | seld = seld.parentNode; 77 | } 78 | $(seld).addClass(cls); 79 | } 80 | } else { 81 | var childNodes = $('
    ').append(curRange.htmlText).get(0).childNodes; 82 | var pc = $('
    '); 83 | if (childNodes && childNodes.length) { 84 | for (var i = 0; i < childNodes.length; i++) { 85 | var tn = childNodes[i]; 86 | if (tn.nodeType == 3) { 87 | var newSpan = $('').addClass(cls).text(tn.nodeValue); 88 | pc.append(newSpan); 89 | } else { 90 | var newSpan = $(tn).clone().addClass(cls); 91 | pc.append(newSpan); 92 | } 93 | } 94 | var newText = pc.html(); 95 | curRange.pasteHTML(newText); 96 | } else { 97 | var seld = this.ne.selectedInstance.selElm(); 98 | if (seld) { 99 | if (seld.nodeType == 3) { 100 | seld = seld.parentNode; 101 | } 102 | $(seld).addClass(cls); 103 | } 104 | } 105 | } 106 | 107 | this.close(); 108 | } 109 | }); 110 | 111 | editors.registerPlugin(nicPlugin,classSelectorOptions); 112 | } 113 | }) 114 | 115 | })(jQuery); 116 | -------------------------------------------------------------------------------- /javascript/nicedit-mods.txt: -------------------------------------------------------------------------------- 1 | 2 | * Remove the hardcoded styles -------------------------------------------------------------------------------- /javascript/save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/javascript/save.png -------------------------------------------------------------------------------- /javascript/table_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/javascript/table_add.png -------------------------------------------------------------------------------- /javascript/tick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nyeholt/silverstripe-frontend-editing/30608c588da3612d3986210bca60eaa60f3d7c87/javascript/tick.png -------------------------------------------------------------------------------- /lang/en_US.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /templates/Includes/FrontendEditingControls.ss: -------------------------------------------------------------------------------- 1 | <% if $CurrentMember && $can(PERM_FRONTEND_EDIT) %> 2 | 3 | <% if LiveSite %> 4 |
    5 | 6 |
    7 | <% end_if %> 8 | 9 |
    10 | 11 | <% if FrontendEditAllowed(0) %> 12 | <% if LiveSite %> 13 | 14 | <% else %> 15 | 16 | <% end_if %> 17 | <% end_if %> 18 | 19 | 20 | 21 | 22 |
    23 | <% end_if %> --------------------------------------------------------------------------------