diff --git a/_config.php b/_config.php index 5feb389..b3d9bbc 100644 --- a/_config.php +++ b/_config.php @@ -1,23 +1 @@ \ No newline at end of file diff --git a/code/AssetManager.php b/code/AssetManager.php deleted file mode 100644 index 9c5f605..0000000 --- a/code/AssetManager.php +++ /dev/null @@ -1,40 +0,0 @@ - 'Title', - 'Filename' => 'Filename' - ); - } - - $fields = singleton($sourceClass)->getCMSFields(); - $fields->removeByName("OwnerID"); - $fields->removeByName("Parent"); - $fields->removeByName("Filename"); - $fields->removeByName("SortOrder"); - $fields->removeByName("Sort"); - $fields->push(new ReadonlyField('Filename')); - $fields->push(new SimpleTreeDropdownField('ParentID','Folder',"Folder")); - $fields->push(new HiddenField('ID','',$controller->ID)); - - parent::__construct($controller, $name, $sourceClass, null, $headings, $fields, "\"ClassName\" != 'Folder'"); - } - - function FieldHolder() - { - if(!$this->controller->ID) - return ""; - return parent::FieldHolder(); - } - - -} - -?> \ No newline at end of file diff --git a/code/AssetManagerFolder.php b/code/AssetManagerFolder.php deleted file mode 100644 index a1a461a..0000000 --- a/code/AssetManagerFolder.php +++ /dev/null @@ -1,31 +0,0 @@ -removeFieldFromTab("Root.Files","Files"); - $fields->removeFieldFromTab("Root.Files","deletemarked"); - $fields->removeByName("Upload"); - $fields->addFieldToTab("Root.Files", $a = new AssetManager($this->owner,"Files")); - $a->setUploadFolder($this->owner->Filename); - $a->setColumnWidths(array( - 'Title' => 30, - 'Filename' => 70 - )); - $folder_filter = "(\"ClassName\" != 'Folder' AND \"ParentID\" = ".$this->owner->ID.")"; - $filter = $a->sourceFilter ? "({$a->sourceFilter}) AND $folder_filter" : $folder_filter; - $a->setSourceFilter($filter); - $a->setParentClass("Folder"); - $a->setPermissions(self::$permissions); - if($this->owner->Title) - $a->setAddTitle(sprintf(_t('AssetManager.ADDFILESTO','files to "%s"'),$this->owner->Title)); - else - $a->setAddTitle(_t('AssetManager.FILES','files')); - return $fields; - } -} - -?> \ No newline at end of file diff --git a/code/DataObjectManager.php b/code/DataObjectManager.php index c877d02..ebcc168 100644 --- a/code/DataObjectManager.php +++ b/code/DataObjectManager.php @@ -1,1184 +1,96 @@ array( - 'label' => 'Edit', - 'icon' => null, - 'class' => 'popuplink editlink', - ), - 'delete' => array( - 'label' => 'Delete', - 'icon' => null, - 'class' => 'deletelink', - ) - ); + protected $grid; - static $url_handlers = array( - 'duplicate/$ID' => 'handleDuplicate' - ); - - - public $popupClass = "DataObjectManager_Popup"; - public $templatePopup = "DataObjectManager_popup"; - - public static function allow_assets_override($bool) - { - if($bool) { - DataObject::add_extension("Folder","AssetManagerFolder"); - SortableDataObject::add_sortable_class("File"); - } - else - DataObject::remove_extension("Folder","AssetManagerFolder"); - } - - public static function allow_css_override($bool) - { - self::$allow_css_override = $bool; - } - - public static function set_popup_width($width) - { - self::$popup_width = $width; - } - - public static function set_confirm_delete($bool) - { - self::$confirm_delete = $bool; - } + protected $dataClass; function __construct($controller, $name = null, $sourceClass = null, $fieldList = null, $detailFormFields = null, $sourceFilter = "", $sourceSort = null, $sourceJoin = "") { - if(!class_exists("ComplexTableField_ItemRequest")) - die(""._t('DataObjectManager.ERROR','Error').": "._t('DataObjectManager.SILVERSTRIPEVERSION','DataObjectManager requires Silverstripe version 2.3 or higher.')); - - // If no name is given, search the has_many for the first relation. - if($name === null && $sourceClass === null) { - if($has_manys = $controller->stat('has_many')) { - foreach($has_manys as $relation => $value) { - $name = $relation; - $sourceClass = $value; - break; - } - } - } - $SNG = singleton($sourceClass); - - - if($fieldList === null) { - $diff = array_diff($SNG->summaryFields(),singleton('DataObject')->summaryFields()); - if(!empty($diff)) { - $fieldList = $SNG->summaryFields(); - } - else if($db = $SNG->db()) { - $fieldList = array(); - foreach($db as $field => $type) { - if($field != "SortOrder") - $fieldList[$field] = DOMUtil::readable_class($field); - } - } - } - parent::__construct($controller, $name, $sourceClass, $fieldList, $detailFormFields, $sourceFilter, $sourceSort, $sourceJoin); - Requirements::css('dataobject_manager/css/dataobject_manager.css'); - Requirements::css('dataobject_manager/css/facebox.css'); - if(self::$allow_css_override) - Requirements::css('dataobject_manager/css/dataobjectmanager_override.css'); - Requirements::javascript(THIRDPARTY_DIR.'/jquery-livequery/jquery.livequery.js'); - Requirements::javascript('dataobject_manager/javascript/facebox.js'); - Requirements::javascript('dataobject_manager/javascript/dom_jquery_ui.js'); - Requirements::javascript('dataobject_manager/javascript/tooltip.js'); - Requirements::javascript('dataobject_manager/javascript/dataobject_manager.js'); - - $this->filter_empty_string = '-- '._t('DataObjectManager.NOFILTER','No filter').' --'; - - if($this->sourceSort) { - $parts = explode(" " , $this->sourceSort); - if(is_array($parts) && sizeof($parts) == 2) { - list($field,$dir) = $parts; - $this->sort = trim($field); - $this->sort_dir = trim($dir); - } - else { - $this->sort = $this->sourceSort; - $this->sort_dir = "ASC"; - } - } - - if(isset($_REQUEST['ctf'][$this->Name()])) { - $this->start = $_REQUEST['ctf'][$this->Name()]['start']; - $this->per_page = $_REQUEST['ctf'][$this->Name()]['per_page']; - $this->showAll = $_REQUEST['ctf'][$this->Name()]['showall']; - $this->search = $_REQUEST['ctf'][$this->Name()]['search']; - $this->filter = $_REQUEST['ctf'][$this->Name()]['filter']; - $this->sort = $_REQUEST['ctf'][$this->Name()]['sort']; - $this->sort_dir = $_REQUEST['ctf'][$this->Name()]['sort_dir']; - } - - - $this->setPageSize($this->per_page); - $this->loadSort(); - $this->loadSourceFilter(); - - $fields = $this->getRawDetailFields(singleton($this->sourceClass())); - foreach($fields as $field) { - if($field instanceof DataObjectManager && !($field->controller instanceof SiteTree)) { - $this->hasNested = true; - $this->setPopupWidth(850); - } - elseif(class_exists("KickAssetField") && $field instanceof KickAssetField) { - $this->setPopupWidth(850); - } - } - - } - - public function setClickToToggle($bool) { - $this->clickToToggle = $bool; - } - - public function setSourceFilter($filter) - { - $this->sourceFilter = $filter; - } - - public function setUseViewAll($bool) - { - $this->use_view_all = $bool; - } - - public function setPerPageMap($values) - { - $this->per_page_map = $values; - } - - public function setPluralTitle($title) - { - $this->pluralTitle = $title; - } - - public function setWideMode($bool) - { - $this->hasNested = $bool; - } - - public function PluralTitle() - { - return $this->pluralTitle ? $this->pluralTitle : $this->AddTitle()."s"; - } - - - protected function loadSort() - { - if($this->ShowAll()) - $this->setPageSize(999); - - if($this->Sortable() && (!isset($_REQUEST['ctf'][$this->Name()]['sort']) || $_REQUEST['ctf'][$this->Name()]['sort'] == "SortOrder")) { - $this->sort = "SortOrder"; - $this->sourceSort = "\"SortOrder\" ASC"; - } - elseif(isset($_REQUEST['ctf'][$this->Name()]['sort']) && !empty($_REQUEST['ctf'][$this->Name()]['sort'])) { - $this->sourceSort = "\"" . $_REQUEST['ctf'][$this->Name()]['sort'] . "\" " . $this->sort_dir; - } - elseif($sort = singleton($this->sourceClass())->stat('default_sort')) { - $this->sourceSort = $sort; - } - else { - $this->sourceSort = "Created DESC"; - } - - } - - protected function loadSourceFilter() - { - $filter_string = ""; - if(!empty($this->filter)) { - $break = strpos($this->filter, "_"); - $field = substr($this->filter, 0, $break); - $value = substr($this->filter, $break+1, strlen($this->filter) - strlen($field)); - $filter_string = $field . "='$value'"; - } - - $search_string = ""; - if(!empty($this->search)) { - $search = array(); - $SNG = singleton($this->sourceClass); - foreach(parent::Headings() as $field) { - if($SNG->hasDatabaseField($field->Name)) - $search[] = "UPPER({$this->sourceClass}.$field->Name) LIKE '%".Convert::raw2sql(strtoupper($this->search))."%'"; - } - if(!empty($search)) { - $search_string = "(".implode(" OR ", $search).")"; + $title = FormField::name_to_label($name); + parent::__construct($name, $title); + $this->grid = new GridField($name, $title, $controller->$name(), GridFieldConfig_RecordEditor::create()); + $this->dataClass = $sourceClass; + if($fieldList) { + $this->grid->getConfig()->getComponentByType('GridFieldDataColumns')->setDisplayFields($fieldList); + } + elseif(!singleton($this->dataClass)->stat('summary_fields')) { + if($db = singleton($this->dataClass)->db()) { + $list = array (); + foreach($db as $name => $type) { + $list[$name] = FormField::name_to_label($name); + } + $this->grid->setDisplayFields($list); } } - $and = (!empty($this->filter) && !empty($this->search)) ? " AND " : ""; - $source_filter = $filter_string.$and.$search_string; - if(!$this->sourceFilter) $this->sourceFilter = $source_filter; - else if($this->sourceFilter && !empty($source_filter)) $this->sourceFilter .= " AND " . $source_filter; - } - - public function handleItem($request) { - return new DataObjectManager_ItemRequest($this, $request->param('ID')); } - public function getQueryString($params = array()) - { - $start = isset($params['start'])? $params['start'] : $this->start; - $per_page = isset($params['per_page'])? $params['per_page'] : $this->per_page; - $show_all = isset($params['show_all'])? $params['show_all'] : $this->showAll; - $sort = isset($params['sort'])? $params['sort'] : $this->sort; - $sort_dir = isset($params['sort_dir'])? $params['sort_dir'] : $this->sort_dir; - $filter = isset($params['filter'])? $params['filter'] : $this->filter; - $search = isset($params['search'])? $params['search'] : $this->search; - return "ctf[{$this->Name()}][start]={$start}&ctf[{$this->Name()}][per_page]={$per_page}&ctf[{$this->Name()}][showall]={$show_all}&ctf[{$this->Name()}][sort]={$sort}&ctf[{$this->Name()}][sort_dir]={$sort_dir}&ctf[{$this->Name()}][search]={$search}&ctf[{$this->Name()}][filter]={$filter}"; - } - - public function getSetting($setting) - { - if($this->$setting) { - return $this->$setting; - } - return Object::get_static($this->class,DOMUtil::to_underscore($setting)); - } - - function FieldHolder() - { - if(!$this->controller->ID && $this->isNested) - return $this->renderWith('DataObjectManager_holder'); - return parent::FieldHolder(); - } - - public function HasSearch() { - $SNG = singleton($this->sourceClass); - foreach(parent::Headings() as $field) { - if($SNG->hasDatabaseField($field->Name)) { - return true; - } - } - return false; + public function setForm($form) { + $this->grid->setForm($form); } - - public function Headings() - { - $headings = array(); - foreach($this->fieldList as $fieldName => $fieldTitle) { - if(isset($_REQUEST['ctf'][$this->Name()]['sort_dir'])) - $dir = $_REQUEST['ctf'][$this->Name()]['sort_dir'] == "ASC" ? "DESC" : "ASC"; - else - $dir = "ASC"; - $headings[] = new ArrayData(array( - "Name" => $fieldName, - "Title" => ($this->sourceClass) ? singleton($this->sourceClass)->fieldLabel($fieldTitle) : $fieldTitle, - "IsSortable" => singleton($this->sourceClass)->hasDatabaseField($fieldName), - "SortLink" => $this->RelativeLink(array( - 'sort_dir' => $dir, - 'sort' => $fieldName - )), - "SortDirection" => $dir, - "IsSorted" => (isset($_REQUEST['ctf'][$this->Name()]['sort'])) && ($_REQUEST['ctf'][$this->Name()]['sort'] == $fieldName), - "ColumnWidthCSS" => !empty($this->column_widths) ? sprintf("style='width:%f%%;'",($this->column_widths[$fieldName] - 0.1)) : "" - )); - } - return new DataObjectSet($headings); - } - - function saveComplexTableField($data, $form, $params) { - $className = $this->sourceClass(); - $childData = new $className(); - $form->saveInto($childData); - try { - $childData->write(); - } - catch(ValidationException $e) { - $form->sessionMessage($e->getResult()->message(), 'bad'); - return Director::redirectBack(); - } - if($childData->many_many()) { - $form->saveInto($childData); - $childData->write(); - } - $form->sessionMessage(sprintf(_t('DataObjectManager.ADDEDNEW','Added new %s successfully'),$this->SingleTitle()), 'good'); - - if($form->getFileFields() || $form->getNestedDOMs()) { - $form->clearMessage(); - Director::redirect(Controller::join_links($this->BaseLink(),'item', $childData->ID, 'edit')); - - } - else Director::redirectBack(); - } - - function setSourceID($val) { - if (is_numeric($val)) { - $this->sourceID = $val; - $this->hasCustomSourceID = true; - } - } - - function sourceID() { - if ($this->hasCustomSourceID) { - return $this->sourceID; - } - - if($this->isNested) - return $this->controller->ID; - $idField = $this->form->dataFieldByName('ID'); - return ($idField && is_numeric($idField->Value())) ? $idField->Value() : (isset($_REQUEST['ctf']['ID']) ? $_REQUEST['ctf']['ID'] : null); - } - - - protected function getRawDetailFields($childData) - { - if(is_a($this->detailFormFields,"Fieldset")) - $fields = $this->detailFormFields; - else { - if(!is_string($this->detailFormFields)) $this->detailFormFields = "getCMSFields"; - $functioncall = $this->detailFormFields; - if(!$childData->hasMethod($functioncall)) $functioncall = "getCMSFields"; - - $fields = $childData->{$functioncall}($this); - } - return $fields; - } - - public function getCustomFieldsFor($childData) { - $fields = $this->getRawDetailFields($childData); - foreach($fields as $field) { - if($field->class == "CalendarDateField") - $fields->replaceField($field->Name(), new DatePickerField($field->Name(), $field->Title(), $field->attrValue())); - } - return $fields; - } - - function AddForm($childID = null) - { - $form = parent::AddForm($childID); - $actions = new FieldSet(); - $titles = array(); - if($files = $form->getFileFields()) { - foreach($files as $field) $titles[] = DOMUtil::readable_class($field->Title()); - } - if($doms = $form->getNestedDOMs()) - foreach($doms as $field) $titles[] = $field->PluralTitle(); - if(empty($titles)) - $text = _t('DataObjectManager.SAVE','Save'); - elseif(sizeof($titles) > 3) { - $first_three = array_slice($titles,0,3); - $remaining = sizeof(array_slice($titles, 4)); - $text = sprintf(_t('DataObjectManager.SAVEANDADD','Save and add %s'), implode(', ',$first_three)); - $text .= ", " . sprintf(_t('DataObjectManager.ANDOTHERCOMPONENTS','and %d other components'),$remaining); - } - else - $text = sprintf(_t('DataObjectManager.SAVEANDADD','Save and add %s'), DOMUtil::readable_list($titles)); - - $actions->push( - $saveAction = new FormAction("saveComplexTableField", $text) - ); - $saveAction->addExtraClass('save'); - $form->setActions($actions); - $form->Fields()->insertFirst(new LiteralField('open','
')); - $o = $form->Fields()->Last(); - $form->Fields()->insertAfter(new LiteralField('close','
'),$o->Name()); - - return $form; - } - - public function ClickToToggle() { - return $this->clickToToggle; - } + public function setClickToToggle($bool) { } - public function Link($action = null) - { - return Controller::join_links(parent::Link($action),'?'.$this->getQueryString()); - } - - public function BaseLink() - { - return parent::Link(); - } - - public function CurrentLink() - { - return $this->Link(); - } - - public function RelativeLink($params = array()) - { - return Controller::join_links(parent::Link(),'?'.$this->getQueryString($params)); - } - public function FirstLink() - { - return parent::FirstLink() ? $this->RelativeLink(array('start' => '0')) : false; - } - - public function PrevLink() - { - $start = ($this->start - $this->pageSize < 0) ? 0 : $this->start - $this->pageSize; - return parent::PrevLink() ? $this->RelativeLink(array('start' => $start)) : false; - } - - public function NextLink() - { - $currentStart = isset($_REQUEST['ctf'][$this->Name()]['start']) ? $_REQUEST['ctf'][$this->Name()]['start'] : 0; - $start = ($currentStart + $this->pageSize < $this->TotalCount()) ? $currentStart + $this->pageSize : $this->TotalCount() % $this->pageSize > 0; - return parent::NextLink() ? $this->RelativeLink(array('start' => $start)) : false; - } - public function LastLink() - { - $pageSize = ($this->TotalCount() % $this->pageSize > 0) ? $this->TotalCount() % $this->pageSize : $this->pageSize; - $start = $this->TotalCount() - $pageSize; - return parent::LastLink() ? $this->RelativeLink(array('start' => $start)) : false; + public function setSourceFilter($filter) { + $this->grid->getList()->where($filter); } - public function ShowAllLink() - { - return $this->RelativeLink(array('show_all' => '1')); - } - public function PaginatedLink() - { - return $this->RelativeLink(array('show_all' => '0')); - } - - public function AddLink() { - return Controller::join_links($this->BaseLink(), 'add'); - } - - public function ShowAll() - { - return $this->showAll == "1"; - } + public function setUseViewAll($bool) { } - public function Paginated() - { - return $this->showAll == "0"; - } - - public function Sortable() - { - return DataObject::has_extension($this->sourceClass(), 'SortableDataObject'); - } - public function setFilter($field, $label, $map, $default = null) - { - if(is_array($map)) { - $this->filter_map = $map; - $this->filtered_field = $field; - $this->filter_label = $label; - } - if($default) { - $this->filter = $this->filtered_field.'_'.$default; - $this->loadSourceFilter(); - } - } + public function setPerPageMap($values) { } - public function HasFilter() - { - return !empty($this->filter_map); - } - - public function FilterDropdown() - { - $map = $this->filter_empty_string ? array($this->RelativeLink(array('filter' => '')) => $this->filter_empty_string) : array(); - foreach($this->filter_map as $k => $v) { - $map[$this->RelativeLink(array('filter' => $this->filtered_field.'_'.$k))] = $v; - } - $value = !empty($this->filter) ? $this->RelativeLink(array('filter' => $this->filter)) : null; - $dropdown = new DropdownField('Filter',$this->filter_label . " ("._t('DataObjectManager.REFRESH','refresh').")", $map, $value); - return $dropdown->FieldHolder(); - } - - public function PerPageDropdown() - { - $map = array(); - foreach($this->per_page_map as $num) $map[$this->RelativeLink(array('per_page' => $num))] = $num; - if($this->use_view_all) - $map[$this->RelativeLink(array('per_page' => '9999'))] = _t('DataObjectManager.ALL','All'); - $value = !empty($this->per_page) ? $this->RelativeLink(array('per_page' => $this->per_page)) : null; - return new FieldGroup( - new LabelField('show', _t('DataObjectManager.PERPAGESHOW','Show').' ',null,true), - new DropdownField('PerPage','',$map, $value), - new LabelField('results', ' '._t('DataObjectManager.PERPAGERESULTS','results per page'),null,true) - ); - } - public function SearchValue() - { - return !empty($this->search) ? $this->search : false; - } - - public function AddTitle() - { - return $this->addTitle ? $this->addTitle : DOMUtil::readable_class($this->Title()); - } - - public function SingleTitle() - { - return $this->singleTitle ? $this->singleTitle : DOMUtil::readable_class($this->AddTitle()); - } - - public function setAddTitle($title) - { - $this->addTitle = $title; - } - - public function setSingleTitle($title) - { - $this->singleTitle = $title; + public function setPluralTitle($title) { + $this->grid->setTitle($title); } - public function getColumnWidths() - { - return $this->column_widths; - } - - public function setColumnWidths($widths) - { - if(is_array($widths)) { - $total = 0; - foreach($widths as $name => $value) $total += $value; - if($total != 100) - die('DataObjectManager::setColumnWidths():' . sprintf(_t('DataObjectManager.TOTALNOT100','Column widths must total 100 and not %s'), $total)); - else - $this->column_widths = $widths; - } - } - - public function setFilterEmptyString($str) - { - $this->filter_empty_string = $str; - } - - public function addPermission($perm) - { - if(!in_array($perm,$this->permissions)) - $this->permissions[] = $perm; - } - - public function removePermission($perm) - { - $key = array_search($perm,$this->permissions); - if($key !== false) - unset($this->permissions[$key]); - } - - public function NestedType() - { - if($this->hasNested) - return "hasNested"; - else if($this->isNested) - return "isNested"; - else - return ""; - } - - public function handleDuplicate($request) - { - return new DataObjectManager_ItemRequest($this,$request->param('ID')); - } - - public function setPopupWidth($val) - { - $this->popupWidth = $val; - } - - public function setConfirmDelete($bool) - { - $this->confirmDelete = $bool; - } - - public function PopupWidth() - { - return $this->popupWidth ? $this->popupWidth : self::$popup_width; - } - - public function ConfirmDelete() - { - return $this->getSetting('confirmDelete'); - } - - + public function setWideMode($bool) { } -} -class DataObjectManager_Item extends ComplexTableField_Item { - function __construct(DataObject $item, DataObjectManager $parent) - { - parent::__construct($item, $parent); - } - function Link() { - return Controller::join_links($this->parent->BaseLink(), 'item', $this->item->ID); - } - - function Fields() { - $fields = parent::Fields(); - $widths = $this->parent->getColumnWidths(); - if(!empty($widths)) { - foreach($fields as $field) { - $field->ColumnWidthCSS = sprintf("style='width:%f%%;'",($widths[$field->Name] - 0.1)); - } - } - return $fields; - } - - public function CanViewOrEdit() - { - return $this->parent->Can('view') || $this->parent->Can('edit'); - } - - public function ViewOrEdit() - { - if($this->CanViewOrEdit()) - return $this->parent->Can('edit') ? "edit" : "view"; - return false; - } - - public function ViewOrEdit_i18n() - { - if($res = $this->ViewOrEdit()) { - return ($res == "edit") ? _t('DataObjectManager.EDIT','Edit') : _t('DataObjectManager.VIEW','View'); - } - return null; - } - - public function EditLink() - { - return Controller::join_links($this->Link(), "edit","?".$this->parent->getQueryString()); - } - - public function DuplicateLink() - { - return Controller::join_links($this->Link(), "duplicate"); - } + public function setFilter($field, $label, $map, $default = null) { } - public function CustomActions() - { - if($this->item->hasMethod('customDOMActions')) { - return $this->item->customDOMActions(); - } - return false; - } + public function setSingleTitle($title) { } - public function PopupWidth() - { - return $this->parent->PopupWidth(); - } - - public function Actions() - { - $actions = new DataObjectSet(); - foreach($this->parent->permissions as $perm) { - $action = false; - switch($perm) { - case "edit": - case "view": - $actions->push(new DataObjectManagerAction( - $this->ViewOrEdit_i18n(), - $this->EditLink(), - "popup", - "dataobject_manager/images/page_white_{$this->ViewOrEdit()}.png", - "editlink" , - $this->parent->PopupWidth() - )); - break; - - case "delete": - $actions->push(new DataObjectManagerAction( - _t('DataObjectManager.DELETE','Delete'), - $this->DeleteLink(), - "delete", - "dataobject_manager/images/trash.gif", - null, - $this->parent->getSetting('confirmDelete') ? "confirm" : null - )); - break; - - case "duplicate": - $actions->push(new DataObjectManagerAction( - _t('DataObjectManager.DUPLICATE','Duplicate'), - $this->DuplicateLink(), - "popup", - "dataobject_manager/images/page_copy.png", - null, - 400 - )); - break; - } - } - if($custom = $this->CustomActions()) { - if($custom instanceof DataObjectSet) - $actions->merge($custom); - else - $actions->push($custom); - } - return $actions; - } -} - -class DataObjectManager_Controller extends Controller -{ - public function dosort() - { - if(!empty($_POST) && is_array($_POST) && isset($this->urlParams['ID'])) { - $className = $this->urlParams['ID']; - if(stristr($className,"-") !== false) { - list($ownerClass, $className) = explode("-",$className); - } - $many_many = ((is_numeric($this->urlParams['OtherID'])) && SortableDataObject::is_sortable_many_many($className)); - foreach($_POST as $group => $map) { - if(substr($group, 0, 7) == "record-") { - if($many_many) { - $controllerID = $this->urlParams['OtherID']; - $candidates = singleton($ownerClass)->many_many(); - if(is_array($candidates)) { - foreach($candidates as $name => $class) - if($class == $className) { - $relationName = $name; - break; - } - } - if(!isset($relationName)) return false; - list($parentClass, $componentClass, $parentField, $componentField, $table) = singleton($ownerClass)->many_many($relationName); - foreach($map as $sort => $id) - DB::query("UPDATE \"$table\" SET \"SortOrder\" = $sort WHERE \"{$className}ID\" = $id AND \"{$ownerClass}ID\" = $controllerID"); - } - else { - foreach($map as $sort => $id) { - $obj = DataObject::get_by_id($className, $id); - $obj->SortOrder = $sort; - $obj->write(); - } - } - break; - } - } - } - } - public function i18n_js() - { - return Convert::array2json(array( - 'delete_confirm' => _t('DataObjectManager.CONFIRMDELETE','Delete?') - )); - } -} + public function getColumnWidths() { } - -class DataObjectManager_Popup extends Form { - protected $sourceClass; - protected $dataObject; - public $NestedController = false; - - function __construct($controller, $name, $fields, $validator, $readonly, $dataObject) { - $this->dataObject = $dataObject; - Requirements::clear(); - Requirements::clear_combined_files(); - // added prototype.js to provide support for TreeDropdownField - Requirements::javascript(THIRDPARTY_DIR.'/prototype/prototype.js'); - Requirements::javascript(THIRDPARTY_DIR.'/jquery/jquery.js'); - Requirements::javascript(THIRDPARTY_DIR.'/jquery-livequery/jquery.livequery.js'); - Requirements::block(THIRDPARTY_DIR.'/behaviour.js'); - Requirements::block(SAPPHIRE_DIR.'/javascript/Validator.js'); - Requirements::clear(THIRDPARTY_DIR.'/behavior.js'); - Requirements::block(THIRDPARTY_DIR.'/behavior.js'); - Requirements::block(SAPPHIRE_DIR.'/javascript/ComplexTableField.js'); - Requirements::block(SAPPHIRE_DIR.'/javascript/TableListField.js'); - Requirements::block(THIRDPARTY_DIR.'/greybox/greybox.js'); - Requirements::block(THIRDPARTY_DIR.'/greybox/AmiJS.js'); - Requirements::block(THIRDPARTY_DIR.'/greybox/greybox.css'); - Requirements::block(SAPPHIRE_DIR.'/css/TableListField.css'); - Requirements::block(SAPPHIRE_DIR.'/css/ComplexTableField.css'); - Requirements::block(ASSETS_DIR.'/leftandmain.js'); - Requirements::block(ASSETS_DIR.'/base.js'); - Requirements::block(SAPPHIRE_DIR.'/javascript/lang/en_US.js'); - Requirements::css(SAPPHIRE_DIR . '/css/Form.css'); - Requirements::css(CMS_DIR . '/css/typography.css'); - Requirements::css(CMS_DIR . '/css/cms_right.css'); - Requirements::css('dataobject_manager/css/dataobject_manager.css'); - - if($this->dataObject->hasMethod('getRequirementsForPopup')) { - $this->dataObject->getRequirementsForPopup(); - } - Requirements::javascript('dataobject_manager/javascript/dataobjectmanager_popup.js'); - - - $actions = new FieldSet(); - if(!$readonly) { - $actions->push( - $saveAction = new FormAction("saveComplexTableField", _t('DataObjectManager.SAVE','Save')) - - ); - $saveAction->addExtraClass('save'); - } - - parent::__construct($controller, $name, $fields, $actions, $validator); - if ($this->validator instanceof Validator) { - $this->validator->setJavascriptValidationHandler('none'); - } - else { - $this->unsetValidator(); - } - - - if($this->getNestedDOMs()) { - Requirements::javascript(THIRDPARTY_DIR.'/jquery-livequery/jquery.livequery.js'); - Requirements::javascript('dataobject_manager/javascript/dom_jquery_ui.js'); - Requirements::javascript('dataobject_manager/javascript/tooltip.js'); - Requirements::javascript('dataobject_manager/javascript/dataobject_manager.js'); - } - $this->NestedController = $this->controller->isNested; - } - - function FieldHolder() { - return $this->renderWith('ComplexTableField_Form'); - } + public function setColumnWidths($widths) { } - public function getFileFields() - { - $file_fields = array(); - foreach($this->Fields() as $field) { - if($field instanceof FileIFrameField || $field instanceof ImageField) - $file_fields[] = $field; - } - return !empty($file_fields)? $file_fields : false; - } + public function setFilterEmptyString($str) { } - public function getNestedDOMs() - { - $dom_fields = array(); - foreach($this->Fields()->dataFields() as $field) { - if($field instanceof DataObjectManager) { - $field->isNested = true; - $dom_fields[] = $field; - } - elseif($field instanceof CompositeField) { - if($children = $field->children) { - foreach($children as $child) { - if($child instanceof DataObjectManager) { - $child->isNested = true; - $dom_fields[] = $child; - } - } - } - } - } - return !empty($dom_fields)? $dom_fields : false; - } + public function addPermission($perm) { } + public function removePermission($perm) { } + + public function setPopupWidth($val) { } -} - - - -class DataObjectManager_ItemRequest extends ComplexTableField_ItemRequest -{ - public $isNested = false; - protected $itemList; - protected $currentIndex; + public function setConfirmDelete($bool) { } - function __construct($ctf, $itemID) - { - parent::__construct($ctf, $itemID); - $this->isNested = $this->ctf->isNested; - if($this->ctf->Items()) { - $this->itemList = $this->ctf->Items()->column(); - $this->currentIndex = array_search($this->itemID,$this->itemList); - } + public function Field($properties = array()) { + return $this->FieldHolder($properties); } - function Link() - { - return Controller::join_links($this->ctf->BaseLink() , 'item', $this->itemID); - } - - function saveComplexTableField($data, $form, $request) { - $dataObject = $this->dataObj(); - $form->saveInto($dataObject); - try { - $dataObject->write(); - } - catch(ValidationException $e) { - $form->sessionMessage($e->getResult()->message(), 'bad'); - return Director::redirectBack(); - } - - // Save the many many relationship if it's available - if(isset($data['ctf']['manyManyRelation'])) { - $parentRecord = DataObject::get_by_id($data['ctf']['parentClass'], (int) $data['ctf']['sourceID']); - $relationName = $data['ctf']['manyManyRelation']; - $componentSet = $parentRecord->getManyManyComponents($relationName); - $componentSet->add($dataObject); - } - - $form->sessionMessage(sprintf(_t('DataObjectManager.SAVED','Saved %s successfully'),$this->ctf->SingleTitle()), 'good'); - Director::redirectBack(); - } - - function DetailForm($childID = null) - { - $form = parent::DetailForm($childID); - $form->Fields()->insertFirst(new LiteralField('open','
')); - $o = $form->Fields()->Last(); - $form->Fields()->insertAfter(new LiteralField('close','
'),$o->Name()); - if(!$this->ctf->Can('edit')) { - $form->makeReadonly(); - $form->setActions(null); - } - return $form; - } - - function edit() { - if(!$this->ctf->Can('view') && !$this->ctf->Can('edit')) - return false; - - $this->methodName = "edit"; + public function FieldHolder($properties = array()) { + return $this->grid->FieldHolder($properties); + } - echo $this->renderWith($this->ctf->templatePopup); - } - - public function duplicate() - { - if(!$this->ctf->Can('duplicate')) - return false; - $this->methodName = "duplicate"; - - echo $this->renderWith(array('DataObjectManager_duplicate')); - } - - public function DuplicateForm() - { - return new Form( - $this, - "DuplicateForm", - new FieldSet( - new FieldGroup( - new LabelField('copy',_t('DataObjectManager.CREATE','Create ')), - new NumericField('Count','','1'), - new LabelField('times',sprintf(_t('DataObjectManager.COPIESOFOBJECT',' copies of this %s'),$this->ctf->SingleTitle())) - ), - new CheckboxField('Relations',_t('DataObjectManager.INCLUDERELATIONS','Include related objects')) - ), - new FieldSet( - new FormAction('doDuplicate',_t('DataObjectManager.DUPLICATE','Duplicate')) - ) - ); - } - - public function doDuplicate($data,$form) - { - if($obj = $this->dataObj()) { - for($i = 0;$i < $data['Count'];$i++) { - $new = $obj->duplicate(); - if(isset($data['Relations']) && $data['Relations'] == "1") { - if($has_manys = $obj->has_many()) { - foreach($has_manys as $name => $class) { - // get the owner relation name - if($has_ones = singleton($class)->has_one()) { - if($ownerRelation = array_search($this->ctf->SourceClass(),$has_ones)) { - $ownerID = $ownerRelation."ID"; - if($related_objects = $obj->$name()) { - foreach($related_objects as $related_obj) { - $o = $related_obj->duplicate(false); - $o->$ownerID = $new->ID; - $o->write(); - } - } - } - else - die(sprintf(_t('DataObjectManager.COULDNOTFINDRELATION','Could not find owner relation for class %s'),$this->ctf->SourceClass())); - } - else - die(sprintf(_t('DataObjectManager.COULDNOTFINDRELATION','Could not find owner relation for class %s'),$this->ctf->SourceClass())); - } - } - if($many_manys = $obj->many_many()) { - foreach($many_manys as $name => $class) { - if($obj->$name()) { - $new->$name()->setByIdList($obj->$name()->column()); - } - } - $new->write(); - } - } - } - $ret = "$i " . _t('DataObjectManager.DUPLICATESCREATED','duplicate(s) created'); - if(isset($data['Relations']) && $data['Relations'] == "1") $ret .= ", " . _t('DataObjectManager.WITHRELATIONS','with relations included'); - $form->sessionMessage($ret,'good'); - } - else - $form->sessionMessage(_t('DataObjectManager.ERRORDUPLICATING','There was an error duplicating the object.'),'bad'); - Director::redirectBack(); - } - - - protected function getPrevID() - { - return $this->itemList[$this->currentIndex - 1]; - } - - protected function getNextID() - { - return $this->itemList[$this->currentIndex + 1]; - } - function NextRecordLink() - { - if(!$this->itemList || $this->currentIndex == sizeof($this->itemList)-1) return false; - return Controller::join_links($this->ctf->BaseLink() , 'item/' . $this->getNextID().'/edit',"?".$this->ctf->getQueryString()); - } - - function PrevRecordLink() - { - if(!$this->itemList || $this->currentIndex == 0) return false; - return Controller::join_links($this->ctf->BaseLink() , 'item/' . $this->getPrevID().'/edit',"?".$this->ctf->getQueryString()); - } - - - function HasPagination() - { - return $this->NextRecordLink() || $this->PrevRecordLink(); - } - - function HasDuplicate() - { - return $this->ctf->Can('duplicate'); + public function handleAction($actionName, $args, $data) { + return $this->grid->handleAction($actionName, $args, $data); } - function SingleTitle() - { - return $this->ctf->SingleTitle(); + function handleRequest(SS_HTTPRequest $request, DataModel $model) { + return $this->grid->handleRequest($request, $model); } - - function DuplicateLink() - { - return Controller::join_links($this->ctf->BaseLink(),'duplicate'.$this->itemID); - } - - function HasRelated() - { - $has_many = singleton($this->ctf->SourceClass())->has_many(); - return is_array($has_many) && !empty($has_many); - } - -} -class DataObjectManagerAction extends ViewableData -{ - static $behaviour_to_js = array ( - 'popup' => 'popup-button', - 'delete' => 'delete-link', - 'refresh' => 'refresh-button', - 'window' => 'window-link' - ); - - public $Title; - public $Behaviour; - public $ActionClass; - public $Link; - public $IconURL; - - public function __construct($title, $link, $behaviour = "popup", $icon = null, $class = null, $rel = null) { - parent::__construct(); - $this->Title = $title; - $this->Link = $link; - $this->Behaviour = self::$behaviour_to_js[$behaviour]; - $this->IconURL = $icon; - $this->ActionClass = $class; - $this->Rel = $rel; - } } -class DOMUtil -{ - public static function readable_list($array) - { - if(!is_array($array)) - return ''; - $and = _t('DataObjectManager.AND','and'); - switch(count($array)) - { - case 0: - return ''; - case 1: - // This may not be a normal numerically-indexed array. - return reset($array); - case 2: - return reset($array)." $and ".end($array); - default: - $last = array_pop($array); - return implode(', ', $array).", $and $last"; - } - } - - public static function readable_class($string) - { - return ucwords(trim(strtolower(ereg_replace('([A-Z])',' \\1',$string)))); - } - - /** - * Translates a camel case string into a string with underscores (e.g. firstName -> first_name) - * @param string $str String in camel case format - * @return string $str Translated into underscore format - */ - public static function to_underscore($str) { - $str[0] = strtolower($str[0]); - $func = create_function('$c', 'return "_" . strtolower($c[1]);'); - return preg_replace_callback('/([A-Z])/', $func, $str); - } - - /** - * Translates a string with underscores into camel case (e.g. first_name -> firstName) - * @param string $str String in underscore format - * @param bool $capitalise_first_char If true, capitalise the first char in $str - * @return string $str translated into camel caps - */ - public static function to_camel_case($str, $capitalise_first_char = false) { - if($capitalise_first_char) { - $str[0] = strtoupper($str[0]); - } - $func = create_function('$c', 'return strtoupper($c[1]);'); - return preg_replace_callback('/_([a-z])/', $func, $str); - } - -} - - diff --git a/code/DataObjectManager_nestedurls.php b/code/DataObjectManager_nestedurls.php deleted file mode 100644 index 3ec5c40..0000000 --- a/code/DataObjectManager_nestedurls.php +++ /dev/null @@ -1,505 +0,0 @@ - array( - 'label' => 'Edit', - 'icon' => null, - 'class' => 'popuplink editlink', - ), - 'delete' => array( - 'label' => 'Delete', - 'icon' => null, - 'class' => 'deletelink', - ) - ); - - public $popupClass = "DataObjectManager_Popup"; - public $templatePopup = "DataObjectManager_popup"; - - - function __construct($controller, $name, $sourceClass, $fieldList = null, $detailFormFields = null, $sourceFilter = "", $sourceSort = "", $sourceJoin = "") - { - if(!class_exists("ComplexTableField_ItemRequest")) - die(""._t('DataObjectManager.ERROR','Error').": "._t('DataObjectManager.SILVERSTRIPEVERSION','DataObjectManager requires Silverstripe version 2.3 or higher.')); - - parent::__construct($controller, $name, $sourceClass, $fieldList, $detailFormFields, $sourceFilter, $sourceSort, $sourceJoin); - Requirements::block(THIRDPARTY_DIR . "/greybox/AmiJS.js"); - Requirements::block(THIRDPARTY_DIR . "prototype.js"); - Requirements::block(THIRDPARTY_DIR . "/greybox/greybox.js"); - Requirements::block(SAPPHIRE_DIR . "/javascript/ComplexTableField.js"); - Requirements::block(SAPPHIRE_DIR . "/javascript/TableListField.js"); - - Requirements::block(THIRDPARTY_DIR . "/greybox/greybox.css"); - Requirements::block(SAPPHIRE_DIR . "/css/ComplexTableField.css"); - Requirements::css('dataobject_manager/css/dataobject_manager.css'); - Requirements::css('dataobject_manager/css/facebox.css'); - Requirements::javascript('dataobject_manager/javascript/facebox.js'); - Requirements::javascript('dataobject_manager/javascript/jquery-ui.1.5.3.js'); - Requirements::javascript('dataobject_manager/javascript/dataobject_manager.js'); - Requirements::javascript('dataobject_manager/javascript/tooltip.js'); - - $this->filter_empty_string = '-- '._t('DataObjectManager.NOFILTER','No filter').' --'; - - if(isset($_REQUEST['ctf'][$this->Name()])) { - $this->per_page = $_REQUEST['ctf'][$this->Name()]['per_page']; - $this->showAll = $_REQUEST['ctf'][$this->Name()]['showall']; - $this->search = $_REQUEST['ctf'][$this->Name()]['search']; - $this->filter = $_REQUEST['ctf'][$this->Name()]['filter']; - $this->sort = $_REQUEST['ctf'][$this->Name()]['sort']; - $this->sort_dir = $_REQUEST['ctf'][$this->Name()]['sort_dir']; - } - $this->setPageSize($this->per_page); - $this->loadSort(); - $this->loadSourceFilter(); - } - - protected function loadSort() - { - if($this->ShowAll()) - $this->setPageSize(999); - - if($this->Sortable() && (!isset($_REQUEST['ctf'][$this->Name()]['sort']) || $_REQUEST['ctf'][$this->Name()]['sort'] == "SortOrder")) { - $this->sort = "SortOrder"; - $this->sourceSort = "SortOrder ASC"; - } - elseif(isset($_REQUEST['ctf'][$this->Name()]['sort'])) - $this->sourceSort = $_REQUEST['ctf'][$this->Name()]['sort'] . " " . $this->sort_dir; - - } - - protected function loadSourceFilter() - { - $filter_string = ""; - if(!empty($this->filter)) { - $break = strpos($this->filter, "_"); - $field = substr($this->filter, 0, $break); - $value = substr($this->filter, $break+1, strlen($this->filter) - strlen($field)); - $filter_string = $field . "='$value'"; - } - - $search_string = ""; - if(!empty($this->search)) { - $search = array(); - $SNG = singleton($this->sourceClass); - foreach(parent::Headings() as $field) { - if($SNG->hasField($field->Name)) - $search[] = "UPPER($field->Name) LIKE '%".strtoupper($this->search)."%'"; - } - $search_string = "(".implode(" OR ", $search).")"; - } - $and = (!empty($this->filter) && !empty($this->search)) ? " AND " : ""; - $source_filter = $filter_string.$and.$search_string; - if(!$this->sourceFilter) $this->sourceFilter = $source_filter; - else if($this->sourceFilter && !empty($source_filter)) $this->sourceFilter .= " AND " . $source_filter; - } - - public function handleItem($request) { - return new DataObjectManager_ItemRequest($this, $request->param('ID')); - } - - protected function getQueryString($params = array()) - { - $per_page = isset($params['per_page'])? $params['per_page'] : $this->per_page; - $show_all = isset($params['show_all'])? $params['show_all'] : $this->showAll; - $sort = isset($params['sort'])? $params['sort'] : $this->sort; - $sort_dir = isset($params['sort_dir'])? $params['sort_dir'] : $this->sort_dir; - $filter = isset($params['filter'])? $params['filter'] : $this->filter; - $search = isset($params['search'])? $params['search'] : $this->search; - return "ctf[{$this->Name()}][per_page]={$per_page}&ctf[{$this->Name()}][showall]={$show_all}&ctf[{$this->Name()}][sort]={$sort}&ctf[{$this->Name()}][sort_dir]={$sort_dir}&ctf[{$this->Name()}][search]={$search}&ctf[{$this->Name()}][filter]={$filter}"; - } - - - public function Headings() - { - $headings = array(); - foreach($this->fieldList as $fieldName => $fieldTitle) { - if(isset($_REQUEST['ctf'][$this->Name()]['sort_dir'])) - $dir = $_REQUEST['ctf'][$this->Name()]['sort_dir'] == "ASC" ? "DESC" : "ASC"; - else - $dir = "ASC"; - $headings[] = new ArrayData(array( - "Name" => $fieldName, - "Title" => ($this->sourceClass) ? singleton($this->sourceClass)->fieldLabel($fieldTitle) : $fieldTitle, - "IsSortable" => singleton($this->sourceClass)->hasField($fieldName), - "SortLink" => $this->RelativeLink(array( - 'sort_dir' => $dir, - 'sort' => $fieldName - )), - "SortDirection" => $dir, - "IsSorted" => (isset($_REQUEST['ctf'][$this->Name()]['sort'])) && ($_REQUEST['ctf'][$this->Name()]['sort'] == $fieldName), - "ColumnWidthCSS" => !empty($this->column_widths) ? sprintf("style='width:%f%%;'",($this->column_widths[$fieldName] - 0.1)) : "" - )); - } - return new DataObjectSet($headings); - } - - function saveComplexTableField($data, $form, $params) { - $className = $this->sourceClass(); - $childData = new $className(); - $form->saveInto($childData); - $childData->write(); - $form->sessionMessage(sprintf(_t('DataObjectManager.ADDEDNEW','Added new %s successfully'),$this->SingleTitle()), 'good'); - - if($form->getFileField()) { - $form->clearMessage(); - Director::redirect($this->BaseLink().'/item/'.$childData->ID.'/edit'); - } - else Director::redirectBack(); - - } - - - function getCustomFieldsFor($childData) { - if(is_a($this->detailFormFields,"Fieldset")) - $fields = $this->detailFormFields; - else { - if(!is_string($this->detailFormFields)) $this->detailFormFields = "getCMSFields"; - $functioncall = $this->detailFormFields; - if(!$childData->hasMethod($functioncall)) $functioncall = "getCMSFields"; - - $fields = $childData->$functioncall(); - } - - foreach($fields as $field) { - if($field->class == "CalendarDateField") - $fields->replaceField($field->Name(), new DatePickerField($field->Name(), $field->Title(), $field->attrValue())); - } - return $fields; - } - - function AddForm($childID = null) - { - $form = parent::AddForm($childID); - $actions = new FieldSet(); - $text = ($field = $form->getFileField()) ? sprintf(_t('DataObjectManager.SAVEANDADD','Save and add %s'), $field->Title()) : _t('DataObjectManager.SAVE','Save'); - - $actions->push( - $saveAction = new FormAction("saveComplexTableField", $text) - ); - $saveAction->addExtraClass('save'); - $form->setActions($actions); - return $form; - - - } - - public function Link($action = null) - { - return parent::Link($action)."?".$this->getQueryString(); - } - - public function BaseLink($action = null) - { - return parent::Link($action); - } - - public function CurrentLink($action = null) - { - return $this->Link($action); - } - - public function RelativeLink($params = array(), $action = null) - { - return parent::Link($action)."?".$this->getQueryString($params); - } - public function FirstLink($action = null) - { - return parent::FirstLink($action) ? parent::FirstLink($action)."&".$this->getQueryString() : false; - } - - public function PrevLink($action = null) - { - return parent::PrevLink($action) ? parent::PrevLink($action)."&".$this->getQueryString() : false; - } - - public function NextLink($action = null) - { - return parent::NextLink($action) ? parent::NextLink($action)."&".$this->getQueryString() : false; - } - - public function LastLink($action = null) - { - return parent::LastLink($action) ? parent::LastLink($action)."&".$this->getQueryString() : false; - } - - public function ShowAllLink($action = null) - { - return $this->RelativeLink(array('show_all' => '1'),$action); - } - - public function PaginatedLink($action = null) - { - return $this->RelativeLink(array('show_all' => '0'),$action); - } - - public function AddLink($action = null) { - return $this->BaseLink($action) . '/add'; - } - - - - public function ShowAll() - { - return $this->showAll == "1"; - } - - public function Paginated() - { - return $this->showAll == "0"; - } - - public function Sortable() - { - return SortableDataObject::is_sortable_class($this->sourceClass()); - } - - public function setFilter($field, $label, $map) - { - if(is_array($map)) { - $this->filter_map = $map; - $this->filtered_field = $field; - $this->filter_label = $label; - } - } - - public function HasFilter() - { - return !empty($this->filter_map); - } - - public function FilterDropdown() - { - $map = $this->filter_empty_string ? array($this->RelativeLink(array('filter' => '')) => $this->filter_empty_string) : array(); - foreach($this->filter_map as $k => $v) { - $map[$this->RelativeLink(array('filter' => $this->filtered_field.'_'.$k))] = $v; - } - $value = !empty($this->filter) ? $this->RelativeLink(array('filter' => $this->filter)) : null; - $dropdown = new DropdownField('Filter',$this->filter_label . " ("._t('DataObjectManager.REFRESH','refresh').")", $map, $value); - return $dropdown->FieldHolder(); - } - - public function PerPageDropdown() - { - $map = array(); - for($i=10;$i<=50;$i+=10) $map[$this->RelativeLink(array('per_page' => $i))] = $i; - $value = !empty($this->per_page) ? $this->RelativeLink(array('per_page' => $this->per_page)) : null; - return new FieldGroup( - new LabelField('show', _t('DataObjectManager.PERPAGESHOW','Show').' '), - new DropdownField('PerPage','',$map, $value), - new LabelField('results', ' '._t('DataObjectManager.PERPAGERESULTS','results per page')) - - ); - } - public function SearchValue() - { - return !empty($this->search) ? $this->search : false; - } - - public function AddTitle() - { - return $this->addTitle ? $this->addTitle : $this->Title(); - } - - public function SingleTitle() - { - return $this->singleTitle ? $this->singleTitle : $this->AddTitle(); - } - - public function setAddTitle($title) - { - $this->addTitle = $title; - } - - public function setSingleTitle($title) - { - $this->singleTitle = $title; - } - - public function getColumnWidths() - { - return $this->column_widths; - } - - public function setColumnWidths($widths) - { - if(is_array($widths)) { - $total = 0; - foreach($widths as $name => $value) $total += $value; - if($total != 100) - die('DataObjectManager::setColumnWidths():' . sprintf(_t('DataObjectManager.TOTALNOT100','Column widths must total 100 and not %s'), $total)); - else - $this->column_widths = $widths; - } - } - - public function setFilterEmptyString($str) - { - $this->filter_empty_string = $str; - } - -} - -class DataObjectManager_Item extends ComplexTableField_Item { - function __construct(DataObject $item, DataObjectManager $parent, $start) - { - parent::__construct($item, $parent, $start); - } - - function Link($action = null) { - return $this->parent->BaseLink(Controller::join_links('item', $this->item->ID, $action)); - } - - function Fields() { - $fields = parent::Fields(); - $widths = $this->parent->getColumnWidths(); - if(!empty($widths)) { - foreach($fields as $field) { - $field->ColumnWidthCSS = sprintf("style='width:%f%%;'",($widths[$field->Name] - 0.1)); - } - } - return $fields; - } - -} - -class DataObjectManager_Controller extends Controller -{ - function dosort() - { - if(!empty($_POST) && is_array($_POST) && isset($this->urlParams['ID'])) { - $className = $this->urlParams['ID']; - foreach($_POST as $group => $map) { - if(substr($group, 0, 7) == "record-") { - foreach($map as $sort => $id) { - $obj = DataObject::get_by_id($className, $id); - $obj->SortOrder = $sort; - $obj->write(); - } - } - } - } - } - -} - - -class DataObjectManager_Popup extends Form { - protected $sourceClass; - protected $dataObject; - - function __construct($controller, $name, $fields, $validator, $readonly, $dataObject) { - $this->dataObject = $dataObject; - Requirements::clear(); - Requirements::block('/jsparty/behaviour.js'); - Requirements::block('sapphire/javascript/Validator.js'); - Requirements::block('jsparty/prototype.js'); - Requirements::block('jsparty/behavior.js'); - Requirements::block('jsparty/jquery/jquery.js'); - Requirements::clear('jsparty/behavior.js'); - - Requirements::block('sapphire/javascript/i18n.js'); - Requirements::block('assets/base.js'); - Requirements::block('sapphire/javascript/lang/en_US.js'); - Requirements::css(SAPPHIRE_DIR . '/css/Form.css'); - Requirements::css(CMS_DIR . '/css/typography.css'); - Requirements::css(CMS_DIR . '/css/cms_right.css'); - Requirements::css('dataobject_manager/css/dataobject_manager.css'); - if($this->dataObject->hasMethod('getRequirementsForPopup')) { - $this->dataObject->getRequirementsForPopup(); - } - - Requirements::javascript('dataobject_manager/javascript/jquery.1.3.js'); - - // File iframe fields force horizontal scrollbars in the popup. Not cool. - // Override the close popup method. - Requirements::customScript(" - jQuery(function() { - jQuery('iframe').css({'width':'433px'}); - }); - "); - - $actions = new FieldSet(); - if(!$readonly) { - $actions->push( - $saveAction = new FormAction("saveComplexTableField", _t('DataObjectManager.SAVE','Save')) - - ); - $saveAction->addExtraClass('save'); - } - - parent::__construct($controller, $name, $fields, $actions, $validator); - - $this->unsetValidator(); - } - - function FieldHolder() { - return $this->renderWith('ComplexTableField_Form'); - } - - public function getFileField() - { - foreach($this->Fields() as $field) { - if($field instanceof FileIFrameField || $field instanceof ImageField) - return $field; - } - - return false; - } - -} - - - -class DataObjectManager_ItemRequest extends ComplexTableField_ItemRequest -{ - function __construct($ctf, $itemID) - { - parent::__construct($ctf, $itemID); - } - - function Link($action = null) - { - return $this->ctf->BaseLink(Controller::join_links('item', $this->itemID, $action)); - } - - function saveComplexTableField($data, $form, $request) { - $form->saveInto($this->dataObj()); - $this->dataObj()->write(); - $form->sessionMessage(sprintf(_t('DataObjectManager.SAVED','Saved %s successfully'),$this->ctf->SingleTitle()), 'good'); - - Director::redirectBack(); - } - -} - - - - -*/ -?> \ No newline at end of file diff --git a/code/FileDataObjectManager.php b/code/FileDataObjectManager.php index de1c08f..8f68c56 100644 --- a/code/FileDataObjectManager.php +++ b/code/FileDataObjectManager.php @@ -2,172 +2,14 @@ class FileDataObjectManager extends DataObjectManager { - static $url_handlers = array( - 'import/$ID' => 'handleImport' - ); - - public static $upgrade_audio = true; - public static $upgrade_video = true; - public static $upgrade_image = true; - public static $upload_limit = "40"; - - public $view; - public $default_view = "grid"; - protected $allowedFileTypes; - protected $uploadOnSubmit = false; - protected $limitFileTypes; - protected $uploadLimit; - protected $allowUploadFolderSelection = true; - protected $enableUploadDebugging = false; - public $hasDataObject = true; - public $importClass = "File"; - - protected $permissions = array( - "add", - "edit", - "show", - "delete", - "upload", - "import" - ); - public $popupClass = "FileDataObjectManager_Popup"; - public $itemClass = "FileDataObjectManager_Item"; - public $template = "FileDataObjectManager"; - public $templatePopup = "DataObjectManager_popup"; - - public $gridLabelField; - public $pluralTitle; - public $browseButtonText = "Upload files"; - - public $uploadFolder = "Uploads"; - - public $uploadifyField = "MultipleFileUploadField"; - - public $copyOnImport = true; - public function __construct($controller, $name = null, $sourceClass = null, $fileFieldName = null, $fieldList = null, $detailFormFields = null, $sourceFilter = "", $sourceSort = "", $sourceJoin = "") { - if(!class_exists("SWFUploadField") && !class_exists("UploadifyField")) - die(""._t('DataObjectManager.ERROR','Error').": "._t('FileDataObjectManager.SWFUPLOADUPLOADIFY','DataObjectManager requires the Uploadify or SWFUpload modules.')); - parent::__construct($controller, $name, $sourceClass, $fieldList, $detailFormFields, $sourceFilter, $sourceSort, $sourceJoin); - // Intelligent constructor for fileFieldName - $SNG = singleton($this->sourceClass()); - if($fileFieldName === null) { - if($has_ones = $SNG->has_one()) { - foreach($has_ones as $relation => $value) { - if($value == "File" || is_subclass_of($value,"File")) { - $fileFieldName = $relation; - $fileClassName = $value; - break; - } - } - } - } - - if(isset($_REQUEST['ctf'][$this->Name()])) { - $this->view = $_REQUEST['ctf'][$this->Name()]['view']; - } - if($this->sourceClass() == "File" || is_subclass_of($this->sourceClass(), "File")) { - $this->hasDataObject = false; - $this->fileFieldName = $name; - $this->fileClassName = $this->sourceClass(); - $this->dataObjectFieldName = null; - } - else { - $this->dataObjectFieldName = $name; - $this->fileFieldName = $fileFieldName; - $this->fileClassName = $SNG->has_one($this->fileFieldName); - if(!$this->fileClassName) - die("FileDataObjectManager::__construct():"._t('FileDataObjectManager.FILERELATION','Could not determine file relationship')); - } - - $this->controllerClassName = $controller->class; - if($key = array_search($this->controllerClassName, $SNG->stat('has_one'))) - $this->controllerFieldName = $key; - else - $this->controllerFieldName = $this->controllerClassName; - $this->controllerID = $controller->ID; - // Check for allowed file types - if($types = Object::get_static($this->fileClassName,'allowed_file_types')) - $this->setAllowedFileTypes($types); + parent::__construct($controller, $name, $sourceClass, $fieldList, $detailFormFields, $souceFilter, $sourceSort, $sourceJoin); } - public function getQueryString($params = array()) - { - $view = isset($params['view'])? $params['view'] : $this->view; - return parent::getQueryString($params)."&ctf[{$this->Name()}][view]={$view}"; - } - public function setGridLabelField($fieldName) - { - $this->gridLabelField = $fieldName; - } + public function setGridLabelField($fieldName) { } - public function GridLink() - { - return $this->RelativeLink(array('view' => 'grid')); - } - - public function ListLink() - { - return $this->RelativeLink(array('view' => 'list')); - } - - public function GridView() - { - return $this->ListStyle() == "grid"; - } - - public function ListView() - { - return $this->ListStyle() == "list"; - } - - public function ListStyle() - { - return $this->view ? $this->view : $this->default_view; - } - - - public function ImportDropdown() - { - return new HTMLDropdownField('ImportFolder','',$this->getImportFolderHierarchy(0),null, null, "-- "._t('DataObjectManager.SELECTFOLDER', 'Select a folder')." --"); - } - - protected function importLinkFor($file) - { - return Controller::join_links($this->BaseLink(), "import", $file->ID); - } - - protected function getImportFolderHierarchy($parentID, $level = 0) - { - $options = array(); - if($children = DataObject::get("Folder", "\"ParentID\" = $parentID")) { - foreach($children as $child) { - $indent=""; - for($i=0;$i<$level;$i++) $indent .= "  "; - $files = DataObject::get($this->importClass, "\"ClassName\" != 'Folder' AND \"ParentID\" = $child->ID"); - $count = $files ? $files->Count() : "0"; - $options[$this->importLinkFor($child)] = $indent.$child->Title . " ($count files)"; - $options += $this->getImportFolderHierarchy($child->ID, $level+1); - } - } - return $options; - } - - protected function getUploadFolderHierarchy($parentID, $level = 0) - { - $options = array(); - if($children = DataObject::get("Folder", "\"ParentID\" = $parentID")) { - foreach($children as $child) { - $indent=""; - for($i=0;$i<$level;$i++) $indent .= "  "; - $options[$child->ID] = empty($child->Title) ? "$indent Untitled" : $indent.$child->Title; - $options += $this->getUploadFolderHierarchy($child->ID, $level+1); - } - } - return $options; - } public function setAllowedFileTypes($types = array()) @@ -180,676 +22,22 @@ public function setAllowedFileTypes($types = array()) $this->allowedFileTypes = $types; } - public function getAllowedFileTypes() - { - return $this->allowedFileTypes; - } - - public function setUploadLimit($num) - { - $this->uploadLimit = $num; - } - - public function getUploadLimit() - { - return $this->getSetting('uploadLimit'); - } - - public function setBrowseButtonText($text) - { - $this->browseButtonText = $text; - } - - public function getBrowseButtonText() - { - return $this->browseButtonText; - } - - public function ButtonAddTitle() - { - return $this->addTitle ? $this->addTitle : $this->PluralTitle(); - } - - public function allowUploadFolderSelection() - { - $this->allowUploadFolderSelection = true; - } - - public function enableUploadDebugging() - { - $this->enableUploadDebugging = true; - } - - public function setDefaultView($type) - { - $this->default_view = $type; - } - - public function uploadOnSubmit() - { - $this->uploadOnSubmit = true; - } - - public function upload() - { - if(!$this->can('add')) return; - $form = class_exists('UploadifyField') ? $this->UploadifyForm() : $this->UploadForm(); - if(is_string($form)) - return $this->customise(array( - 'String' => true, - 'NestedController' => $this->isNested, - 'DetailForm' => $this->UploadForm(), - ))->renderWith($this->templatePopup); - else { - $form = class_exists('UploadifyField') ? $this->UploadifyForm() : $this->UploadForm(); - return $this->customise(array( - 'String' => is_string($form), - 'DetailForm' => $form - ))->renderWith($this->templatePopup); - } - } - - public function UploadLink() - { - return Controller::join_links($this->BaseLink(),'upload'); - } - - protected function getUploadFields() - { - - $fields = new FieldSet( - new HeaderField($title = sprintf(_t('DataObjectManager.ADDITEM', 'Add %s'),$this->PluralTitle()), $headingLevel = 2), - new HeaderField($title = _t('DataObjectManager.UPLOADFROMPC', 'Upload from my computer'), $headingLevel = 3), - new SWFUploadField( - "UploadForm", - "Upload", - "", - array( - 'file_upload_limit' => $this->getUploadLimit(), // how many files can be uploaded - 'file_queue_limit' => $this->getUploadLimit(), // how many files can be in the queue at once - 'browse_button_text' => $this->getBrowseButtonText(), - 'upload_url' => Director::absoluteURL('FileDataObjectManager_Controller/handleswfupload'), - 'required' => 'true' - ) - ) - ); - - if($this->allowUploadFolderSelection) - $fields->insertBefore(new HTMLDropdownField('UploadFolder','',$this->getUploadFolderHierarchy(0),null, null, "-- Select a folder --"),"Upload"); - return $fields; - } - - protected function getUploadifyFields() - { - - $class = $this->uploadifyField; - $fields = new FieldSet( - new HeaderField($title = sprintf(_t('DataObjectManager.ADDITEM', 'Add %s'),$this->PluralTitle()), $headingLevel = 2), - $uploader = new $class('UploadedFiles') - ); - - if(!$this->allowUploadFolderSelection) { - $uploader->removeFolderSelection(); - } - if($this->uploadFolder) { - $uploader->setUploadFolder($this->uploadFolder); - } - $uploader->setVar('buttonText', $this->getBrowseButtonText()); - $uploader->setVar('queueSizeLimit', $this->getUploadLimit()); - if(is_subclass_of($this->fileClassName, "File")) { - if(is_subclass_of($this->fileClassName, "Image")) { - $uploader->setVar('image_class', $this->fileClassName); - } - else { - $uploader->setVar('file_class', $this->fileClassName); - } - } - - if(!empty($this->allowedFileTypes)) { - $uploader->setFileTypes($this->getAllowedFileTypes(), $this->PluralTitle() . '(' . implode(',',$this->allowedFileTypes) . ')'); - } - $uploader->uploadFolder = $this->uploadFolder; - if($this->uploadOnSubmit) { - $uploader->uploadOnSubmit(); - } - return $fields; - } - - public function UploadifyForm() { - - Validator::set_javascript_validation_handler('none'); - - $fields = $this->Can('upload') ? $this->getUploadifyFields() : new FieldSet( - new HeaderField($title = sprintf(_t('DataObjectManager.ADD', 'Add %s'),$this->PluralTitle()), $headingLevel = 2) - ); - - $className = $this->sourceClass(); - $childData = new $className(); - - $form = Object::create( - $this->popupClass, - $this, - 'UploadifyForm', - $fields, - new RequiredFields('UploadedFiles'), - false, - $childData - ); - - $uploader = $form->Fields()->fieldByName('UploadedFiles'); - $action = $this->Can('upload') ? new FieldSet(new FormAction('saveUploadifyForm', 'Continue')) : new FieldSet(); - $form->setActions($action); - return $form; - } - - public function UploadForm() - { - // Sync up the DB -// singleton('Folder')->syncChildren(); - $className = $this->sourceClass(); - $childData = new $className(); - $validator = $this->getValidatorFor($childData); - if($this->Can('upload')) { - SWFUploadConfig::addPostParams(array( - 'dataObjectClassName' => $this->sourceClass(), - 'dataObjectFieldName' => $this->dataObjectFieldName, - 'fileFieldName' => $this->fileFieldName, - 'fileClassName' => $this->fileClassName, - 'parentIDName' => $this->getParentIdName( $this->getParentClass(), $this->sourceClass() ), - 'controllerID' => $this->controllerID, - 'OverrideUploadFolder' => $this->getUploadFolder(), - 'hasDataObject' => $this->hasDataObject ? 1 : 0 - )); - - if($this->allowUploadFolderSelection) - SWFUploadConfig::addDynamicPostParam('UploadFolder',$this->popupClass.'_UploadForm_UploadFolder'); - - if($this->getAllowedFileTypes()) - SWFUploadConfig::addFileTypes($this->getAllowedFileTypes()); - - if($this->enableUploadDebugging) - SWFUploadConfig::set_var('debug','true'); - } - - $fields = $this->Can('upload') ? $this->getUploadFields() : new FieldSet( - new HeaderField($title = sprintf(_t('DataObjectManager.ADD', 'Add %s'),$this->PluralTitle()), $headingLevel = 2) - ); - - $form = Object::create( - $this->popupClass, - $this, - 'UploadForm', - $fields, - $validator, - false, - $childData - ); - $action = $this->Can('upload') ? new FieldSet(new FormAction('saveUploadForm', 'Upload')) : new FieldSet(); - $form->setActions($action); - if($this->Can('import')) { - $header = new HeaderField($title = _t('DataObjectManager.IMPORTFROMFOLDER', 'Import from an existing folder'), $headingLevel = 3); - $holder = new LiteralField("holder","
"); - if(!isset($_POST['uploaded_files'])) - return $form->forTemplate() . $header->Field() . $this->ImportDropdown()->Field() . $holder->Field(); - else - return $form; - } - return $form; - - } - - public function saveUploadForm() - { - if(isset($_POST['uploaded_files']) && is_array($_POST['uploaded_files'])) { - $form = $this->EditUploadedForm(); - return $this->customise(array( - 'String' => is_string($form), - 'DetailForm' => $form - ))->renderWith($this->templatePopup); - } - } - - public function updateDataObject(&$object) { } - - public function saveUploadifyForm($data, $form) - { - if(!isset($data['UploadedFiles']) || !is_array($data['UploadedFiles'])) { - return Director::redirectBack(); - } - - $file_class = $this->fileClassName; - $do_class = $this->sourceClass(); - $idxfield = $this->fileFieldName."ID"; - $fff = $this->fileFieldName; - $dataobject_ids = array(); - if($this->hasDataObject) { - foreach($data['UploadedFiles'] as $id) { - if($file = DataObject::get_by_id("File", (int) $id)) { - $upload_folder = $form->Fields()->fieldByName('UploadedFiles')->uploadFolder; - $folder_id = Folder::findOrMake($upload_folder)->ID; - if($this->copyOnImport && ($file->ParentID != $folder_id)) { - $new_file_path = $upload_folder.'/'.$file->Name; - copy($file->getFullPath(), BASE_PATH.'/'.ASSETS_DIR.'/'.$new_file_path); - $clone = new $file_class(); - $clone->Filename = $new_file_path; - $clone->ParentID = $folder_id; - $clone->write(); - $id = $clone->ID; - } - - $obj = new $do_class(); - $obj->$idxfield = $id; - $ownerID = $this->getParentIdName($this->getParentClass(), $this->sourceClass()); - $obj->$ownerID = $this->controllerID; - $this->updateDataObject($obj); - $obj->write(); - $obj->$fff()->write(); - $dataobject_ids[] = $obj->ID; - } - } - $_POST['uploaded_files'] = $dataobject_ids; - foreach($_POST['uploaded_files'] as $id) { - } - } - else { - foreach($data['UploadedFiles'] as $id) { - if($file = DataObject::get_by_id("File", (int) $id)) { - $ownerID = $this->getParentIdName($this->getParentClass(), $this->sourceClass()); - $file->$ownerID = $this->controllerID; - $file->write(); - } - } - } - - $form = $this->EditUploadedForm(); - return $this->customise(array( - 'String' => is_string($form), - 'DetailForm' => $form - ))->renderWith($this->templatePopup); - } - - protected function getChildDataObj() - { - $class = $this->sourceClass(); - return new $class(); - } - - public function getPreviewFieldFor($fileObject, $size = 150) - { - if($fileObject instanceof Image) { - $URL = $fileObject->getHeight() > $size ? $fileObject->SetHeight($size)->URL : $fileObject->URL - ; - return new LiteralField("icon", - "

$fileObject->Filename

" - ); - } - else { - $URL = $fileObject->Icon(); - return new LiteralField("icon", - "

$fileObject->Filename

" - ); - } - } - - protected function closePopup() - { - Requirements::clear(); - if($this->isNested) - Requirements::customScript("parent.jQuery('#iframe_".$this->id()." a').click();"); - else { - Requirements::customScript(" - var container = parent.jQuery('#".$this->id()."'); - parent.jQuery('#facebox').fadeOut(function() { - parent.jQuery('#facebox .content').removeClass().addClass('content'); - parent.jQuery('#facebox_overlay').remove(); - parent.jQuery('#facebox .loading').remove(); - parent.refresh(container, container.attr('href')); - });"); - } - return $this->customise(array( - 'String' => true, - 'DetailForm' => 'Closing...' - ))->renderWith($this->templatePopup); - } - - public function EditUploadedForm() - { - if(!$this->hasDataObject) - return $this->closePopup(); - - $childData = $this->getChildDataObj(); - $validator = $this->getValidatorFor($childData); - $fields = $this->getFieldsFor($childData); - $fields->removeByName($this->fileFieldName); - $total = isset($_POST['totalsize']) ? $_POST['totalsize'] : sizeof($_POST['uploaded_files']); - $index = isset($_POST['index']) ? $_POST['index'] + 1 : 1; - $fields->push(new HiddenField('totalsize','',$total)); - $fields->push(new HiddenField('index','',$index)); - if(isset($_POST['uploaded_files']) && is_array($_POST['uploaded_files'])) { - $remaining_files = $_POST['uploaded_files']; - $current = $remaining_files[0]; - $dataObject = DataObject::get_by_id($this->sourceClass(), $current); - $fileObject = $dataObject->obj($this->fileFieldName); - $fields->push(new HiddenField('current','',$current)); - unset($remaining_files[0]); - if(!$fields->loaded) { - foreach($remaining_files as $id) - $fields->push(new LiteralField("u-$id","")); - $first = $fields->First()->Name(); - $fields->insertBefore(new HeaderField("Header","Editing file $index of $total",2), $first); - $fields->insertBefore($this->getPreviewFieldFor($fileObject), $first); - } - } - - $form = Object::create( - $this->popupClass, - $this, - 'EditUploadedForm', - $fields, - $validator, - false, - $childData - ); - $form->setActions(new FieldSet(new FormAction("saveEditUploadedForm", $index == $total ? "Finish" : "Next"))); - if(isset($dataObject) && $dataObject) - $form->loadDataFrom($dataObject); - $fields->loaded = true; - return $form; - } - - function saveEditUploadedForm($data, $form) - { - $obj = DataObject::get_by_id($this->sourceClass(), $data['current']); - $form->saveInto($obj); - $obj->write(); - if(isset($data['uploaded_files']) && is_array($data['uploaded_files'])) { - $form = $this->EditUploadedForm(); - return $this->customise(array( - 'String' => is_string($form), - 'DetailForm' => $form - ))->renderWith($this->templatePopup); - } - else { - return $this->closePopup(); - } - } - - public function handleImport($request) - { - $this->importFolderID = $request->param('ID'); - die($this->ImportForm($this->importFolderID)->forTemplate()); - } - - protected function getImportFields() - { - return new FieldSet( - new HiddenField('dataObjectClassName','',$this->sourceClass()), - new HiddenField('fileFieldName','', $this->fileFieldName), - new HiddenField('parentIDName','', $this->getParentIdName( $this->getParentClass(), $this->sourceClass() )), - new HiddenField('controllerID','',$this->controllerID) - ); - } + public function getAllowedFileTypes() { } - protected function ImportForm($folder_id = null) - { - $folder_id = isset($_POST['folder_id']) ? $_POST['folder_id'] : $this->importFolderID;; - if($files = DataObject::get($this->importClass, "\"ClassName\" != 'Folder' AND \"ParentID\" = $folder_id")) - $fields = $this->getImportFields(); - $fields->push(new HiddenField('folder_id','',$folder_id)); - $fields->push(new LiteralField('select','
Select: all | none
')); - $fields->push(new LiteralField("ul","")); - return new Form( - $this, - "ImportForm", - $fields, - new FieldSet(new FormAction('saveImportForm','Import')) - ); - } + public function setUploadLimit($num) { } - public function saveImportForm($data, $form) - { - if(isset($data['imported_files']) && is_array($data['imported_files'])) { - $_POST['uploaded_files'] = array(); - // If the user has set a custom upload folder, cut a new copy of the file when importing - $custom_folder = $this->getUploadFolder() != "Uploads" ? Folder::findOrMake($this->getCleanUploadFolder()) : false; - foreach($data['imported_files'] as $file_id) { - $file = DataObject::get_by_id("File",$file_id); - if($custom_folder && $file->ParentID != $custom_folder->ID) { - $new_path = Director::baseFolder().'/'.$custom_folder->Filename.$file->Name; - copy($file->getFullPath(),$new_path); - $file_class = $file->ClassName; - $new_file = new $file_class(); - $new_file->setFilename($custom_folder->Filename.$file->Name); - $new_file->setName($file->Name); - $new_file->setParentID($custom_folder->ID); - $new_file->write(); - $file = $new_file; - $file_id = $new_file->ID; - } - - // If something other than File has been specified as the linked file class, - // we need to "upgrade" the imported file to the correct class. - if($this->fileClassName != "File" && $file->ClassName != $this->fileClassName) { - $file = $file->newClassInstance($this->fileClassName); - $file->write(); - } - $owner_id = $data['parentIDName']; - if($this->hasDataObject) { - $do_class = $data['dataObjectClassName']; - $idxfield = $data['fileFieldName']."ID"; - $obj = new $do_class(); - $obj->$idxfield = $file_id; - $obj->$owner_id = $data['controllerID']; - $obj->write(); - $_POST['uploaded_files'][] = $obj->ID; - } - else { - if($file = DataObject::get_by_id($this->fileClassName, $file_id)) { - $id_field = $this->controllerFieldName."ID"; - - if($file->hasField($owner_id)) { - $file->$owner_id = $this->controllerID; - $file->write(); - } - } - } - } - $form = $this->EditUploadedForm(); - return $this->customise(array( - 'String' => is_string($form), - 'DetailForm' => $form - ))->renderWith($this->templatePopup); - - } - } - public function setUploadFolder($override) - { - $this->uploadFolder = $override; - } - public function getUploadFolder() - { - return $this->uploadFolder; - } + public function getUploadLimit() { } - public function getCleanUploadFolder() - { - $path = str_replace(ASSETS_DIR."/","",$this->getUploadFolder()); - if(substr($path,-1)=="/") $path = substr($path,0, -1); - return $path; - } + public function setBrowseButtonText($text){ } -} - -class FileDataObjectManager_Controller extends Controller -{ - public function handleswfupload() - { - if(!Permission::check("CMS_ACCESS_CMSMain")) - return; + public function getBrowseButtonText() { } - if(isset($_FILES['swfupload_file']) && !empty($_FILES['swfupload_file'])) { - $do_class = $_POST['dataObjectClassName']; - $hasDataObject = $_POST['hasDataObject']; - $idxfield = $_POST['fileFieldName']."ID"; - $file_class = $_POST['fileClassName']; - $file = new $file_class(); - - if(isset($_POST['UploadFolder'])) { - $folder = DataObject::get_by_id("Folder",$_POST['UploadFolder']); - $path = str_replace(ASSETS_DIR."/","",$folder->Filename); - if(substr($path,-1)=="/") $path = substr($path,0, -1); - } - else { - $path = str_replace(ASSETS_DIR."/","",$_POST['OverrideUploadFolder']); - if(substr($path,-1)=="/") $path = substr($path,0, -1); - } - if(class_exists("Upload")) { - $u = new Upload(); - $u->loadIntoFile($_FILES['swfupload_file'], $file, $path); - } - else - $file->loadUploaded($_FILES['swfupload_file'],$path); - - if(isset($_POST['UploadFolder'])) - $file->setField("ParentID",$folder->ID); - - // Provide an "upgrade" to File subclasses - if($file->class == "File") { - $ext = strtolower($file->Extension); - if(in_array($ext, MP3::$allowed_file_types) && FileDataObjectManager::$upgrade_audio) - $file = $file->newClassInstance("MP3"); - else if(in_array($ext, array('jpg','jpeg','gif','png')) && FileDataObjectManager::$upgrade_image) - $file = $file->newClassInstance("Image"); - else if(in_array($ext, FLV::$allowed_file_types) && FileDataObjectManager::$upgrade_video) - $file = $file->newClassInstance("FLV"); - } - $file->OwnerID = Member::currentUserID(); - if($hasDataObject) { - $file->write(); - $obj = new $do_class(); - $obj->$idxfield = $file->ID; - $ownerID = $_POST['parentIDName']; - $obj->$ownerID = $_POST['controllerID']; - $obj->write(); - echo $obj->ID; - } - else { - $ownerID = $_POST['parentIDName']; - $file->$ownerID = $_POST['controllerID']; - $file->write(); - echo $file->ID; - } - } - else { - echo ' '; - } - + public function allowUploadFolderSelection() { } - } -} - -class FileDataObjectManager_Item extends DataObjectManager_Item { - function __construct(DataObject $item, ComplexTableField $parent) - { - parent::__construct($item, $parent); - } + public function enableUploadDebugging() { } - public function IsFile() - { - return $this instanceof File; - } + public function setDefaultView($type) { } - public function FileIcon() - { - if($this->parent->hasDataObject) { - $field = $this->parent->fileFieldName."ID"; - $file = DataObject::get_by_id($this->parent->fileClassName, $this->item->$field); - } - else - $file = $this->item; - - if($file && $file->ID) { - if($file instanceof Image) - $img = $file; - else { - $ext = $file->Extension; - $imgExts = array('jpg','jpeg','gif'); - if(in_array($ext, $imgExts)) { - $img = new Image_Cached($file->Filename); - $img->ID = $file->ID; //image resize functions require an id - } - } - if(isset($img)) { - if($crop = $img->CroppedImage(50,50)) { - return $crop->URL; - } - } - return $file->Icon(); - - } - else return "{$this->item->$field}"; - } - - public function FileLabel() - { - $idField = $this->parent->fileFieldName."ID"; - if($this->parent->gridLabelField) { - $field = $this->parent->gridLabelField; - return $this->$field; - } - else if(!$this->parent->hasDataObject) - $label = $this->item->Title; - else if($file = DataObject::get_by_id($this->parent->fileClassName, $this->item->$idField)) - $label = $file->Title; - else - $label = ""; - return strlen($label) > 30 ? substr($label, 0, 30)."..." : $label; - } - -} - - -class FileDataObjectManager_Popup extends DataObjectManager_Popup -{ - function __construct($controller, $name, $fields, $validator, $readonly, $dataObject) { - parent::__construct($controller, $name, $fields, $validator, $readonly, $dataObject); - - // Hack! - Requirements::block(THIRDPARTY_DIR.'/prototype.js'); - if($name == "UploadForm" && !isset($_POST['uploaded_files']) && $controller->Can('upload')) SWFUploadConfig::bootstrap(); - - Requirements::javascript('dataobject_manager/javascript/filedataobjectmanager_popup.js'); - } + public function uploadOnSubmit() { } -} +} \ No newline at end of file diff --git a/code/HasManyDataObjectManager.php b/code/HasManyDataObjectManager.php index a2dafbe..b864eb1 100644 --- a/code/HasManyDataObjectManager.php +++ b/code/HasManyDataObjectManager.php @@ -2,185 +2,18 @@ class HasManyDataObjectManager extends DataObjectManager { - public $joinField; - public $addTitle; - public $RelationType = "HasMany"; - protected $htmlListEndName = 'CheckedList'; - protected $htmlListField = 'selected'; - public $template = 'RelationDataObjectManager'; - public $itemClass = 'HasManyDataObjectManager_Item'; - protected $relationAutoSetting = false; - protected $markingPermission; - /** - * Most of the code below was copied from HasManyComplexTableField. - * Painful, but necessary, until PHP supports multiple inheritance. - */ - - function __construct($controller, $name, $sourceClass, $fieldList = null, $detailFormFields = null, $sourceFilter = "", $sourceSort = "", $sourceJoin = "") - { - parent::__construct($controller, $name, $sourceClass, $fieldList, $detailFormFields, $sourceFilter, $sourceSort, $sourceJoin); - - $this->Markable = true; - if($controllerClass = $this->controllerClass()) { - $this->joinField = $this->getParentIdName($controllerClass, $this->sourceClass); - } else { - user_error("Can't figure out the data class of $controller", E_USER_WARNING); - } - + public function FieldHolder() { + $list = Object::create( + "ListboxField", + $this->grid->getName(), + sprintf(_t('DOM.Selected','Selected %s'),$this->grid->Title()), + DataList::create($this->dataClass) + ->map('ID', 'Title') + ->toArray() + )->setMultiple(true); + $this->grid->setList(DataList::create($this->dataClass)); + return "
{$list->FieldHolder()}
{$this->grid->FieldHolder()}"; } - - /** - * Try to determine the DataObject that this field is built on top of - */ - function controllerClass() { - if($this->controller instanceof DataObject) return $this->controller->class; - elseif($this->controller instanceof ContentController) return $this->controller->data()->class; - } - - public function setMarkingPermission($perm) - { - $this->markingPermission = $perm; - } - - public function hasMarkingPermission() - { - if(is_bool($this->markingPermission)) - return $this->markingPermission; - elseif($this->markingPermission) - return Permission::check($this->markingPermission); - return true; - } - - public function setParentClass($class) - { - parent::setParentClass($class); - $this->joinField = $this->getParentIdName($class, $this->sourceClass); - } - - function getQuery($limitClause = null) { - if($this->customQuery) { - $query = $this->customQuery; - $query->select[] = "\"{$this->sourceClass}\".\"ID\" AS \"ID\""; - $query->select[] = "\"{$this->sourceClass}\".\"ClassName\" AS \"ClassName\""; - $query->select[] = "\"{$this->sourceClass}\".\"ClassName\" AS \"RecordClassName\""; - } - else { - $query = singleton($this->sourceClass)->extendedSQL($this->sourceFilter, $this->sourceSort, $limitClause, $this->sourceJoin); - - // Add more selected fields if they are from joined table. - - $SNG = singleton($this->sourceClass); - foreach($this->FieldList() as $k => $title) { - if(! $SNG->hasField($k) && ! $SNG->hasMethod('get' . $k) && ! $SNG->has_one($k)) - $query->select[] = $k; - } - } - return clone $query; - } - - function sourceItems() { - if($this->sourceItems) - return $this->sourceItems; - - $limitClause = ''; - if(isset($_REQUEST[ 'ctf' ][ $this->Name() ][ 'start' ]) && is_numeric($_REQUEST[ 'ctf' ][ $this->Name() ][ 'start' ])) - $limitClause = $_REQUEST[ 'ctf' ][ $this->Name() ][ 'start' ] . ", $this->pageSize"; - else - $limitClause = "0, $this->pageSize"; - - $dataQuery = $this->getQuery($limitClause); - $records = $dataQuery->execute(); - $items = new DataObjectSet(); - $class = $this->sourceClass; - foreach($records as $record) { - $items->push(new $class($record)); - } - - // changed to avoid using $this->unpagedSourceItems because it fails on large datasets - $this->totalCount = $this->getQuery()->unlimitedRowCount(); - - return $items; - } - - function getControllerID() { - return $this->controller->ID; - } - - public function SortableClass() - { - return $this->sourceClass(); - } - - function saveInto(DataObject $record) { - $fieldName = $this->name; - $saveDest = $record->$fieldName(); - - if(! $saveDest) - user_error("HasManyDataObjectManager::saveInto() Field '$fieldName' not found on $record->class.$record->ID", E_USER_ERROR); - - $items = array(); - - if($list = $this->value[ $this->htmlListField ]) { - if($list != 'undefined') - $items = explode(',', trim($list,",")); - } - - $saveDest->setByIDList($items); - } - - function ExtraData() { - $items = array(); - // changed to avoid having to use $this->unpagedSourceItems because it fails on large datasets - $items = $this->getSelectedIDs(); - $list = implode(',', $items); - $value = ","; - $value .= !empty($list) ? $list."," : ""; - $inputId = $this->id() . '_' . $this->htmlListEndName; - return << -HTML; - } - - /** - * Returns the list of IDs that should be checked in the list. - * @see HasManyDataObjectManager::getSelectedIDs() - * @return array - */ - function getSelectedIDs() { - $ids = array(); - $dataQuery = $this->getQuery(); - $dataQuery->where("\"{$this->joinField}\" = '{$this->controller->ID}'"); - $records = $dataQuery->execute(); - $class = $this->sourceClass; - foreach($records as $record) { - $item = new $class($record); - $ids[] = $item->ID; - } - return $ids; - } - -} - - -class HasManyDataObjectManager_Item extends DataObjectManager_Item { - - function MarkingCheckbox() { - $name = $this->parent->Name() . '[]'; - $joinVal = $this->item->{$this->parent->joinField}; - $parentID = $this->parent->getControllerID(); - $disabled = $this->parent->hasMarkingPermission() ? "" : "disabled='disabled'"; - - if($this->parent->IsReadOnly || ($joinVal > 0 && $joinVal != $parentID)) - return "item->ID}\" disabled=\"disabled\"/>"; - else if($joinVal == $parentID) - return "item->ID}\" checked=\"checked\" $disabled />"; - else - return "item->ID}\" $disabled />"; - } -} - - - -?> \ No newline at end of file +} \ No newline at end of file diff --git a/code/HasManyFileDataObjectManager.php b/code/HasManyFileDataObjectManager.php index 63df9a4..d169673 100644 --- a/code/HasManyFileDataObjectManager.php +++ b/code/HasManyFileDataObjectManager.php @@ -2,187 +2,18 @@ class HasManyFileDataObjectManager extends FileDataObjectManager { - public $joinField; - public $addTitle; - public $RelationType = "HasMany"; - protected $htmlListEndName = 'CheckedList'; - protected $htmlListField = 'selected'; - public $template = 'RelationFileDataObjectManager'; - public $itemClass = 'HasManyFileDataObjectManager_Item'; - protected $relationAutoSetting = false; - protected $markingPermission; - - /** - * Most of the code below was copied from HasManyComplexTableField. - * Painful, but necessary, until PHP supports multiple inheritance. - */ - - function __construct($controller, $name, $sourceClass, $fileFieldName = null, $fieldList = null, $detailFormFields = null, $sourceFilter = "", $sourceSort = "", $sourceJoin = "") - { - parent::__construct($controller, $name, $sourceClass, $fileFieldName, $fieldList, $detailFormFields, $sourceFilter, $sourceSort, $sourceJoin); - - $this->Markable = true; - - if($controllerClass = $this->controllerClass()) { - $this->joinField = $this->getParentIdName($controllerClass, $this->sourceClass); - } else { - user_error("Can't figure out the data class of $controller", E_USER_WARNING); - } - - } - - - /** - * Try to determine the DataObject that this field is built on top of - */ - function controllerClass() { - if($this->controller instanceof DataObject) return $this->controller->class; - elseif($this->controller instanceof ContentController) return $this->controller->data()->class; - } - - public function setMarkingPermission($perm) - { - $this->markingPermission = $perm; - } - - public function hasMarkingPermission() - { - if(is_bool($this->markingPermission)) - return $this->markingPermission; - elseif($this->markingPermission) - return Permission::check($this->markingPermission); - return true; - } - - - function getQuery($limitClause = null) { - if($this->customQuery) { - $query = $this->customQuery; - $query->select[] = "\"{$this->sourceClass}\".\"ID\" AS \"ID\""; - $query->select[] = "\"{$this->sourceClass}\".\"ClassName\" AS \"ClassName\""; - $query->select[] = "\"{$this->sourceClass}\".\"ClassName\" AS \"RecordClassName\""; - } - else { - $query = singleton($this->sourceClass)->extendedSQL($this->sourceFilter, $this->sourceSort, $limitClause, $this->sourceJoin); - - // Add more selected fields if they are from joined table. - - $SNG = singleton($this->sourceClass); - foreach($this->FieldList() as $k => $title) { - if(! $SNG->hasField($k) && ! $SNG->hasMethod('get' . $k)) - $query->select[] = $k; - } - } - return clone $query; - } - - public function setParentClass($class) - { - parent::setParentClass($class); - $this->joinField = $this->getParentIdName($class, $this->sourceClass); - } - - - function sourceItems() { - if($this->sourceItems) - return $this->sourceItems; - - $limitClause = ''; - if(isset($_REQUEST[ 'ctf' ][ $this->Name() ][ 'start' ]) && is_numeric($_REQUEST[ 'ctf' ][ $this->Name() ][ 'start' ])) - $limitClause = $_REQUEST[ 'ctf' ][ $this->Name() ][ 'start' ] . ", $this->pageSize"; - else - $limitClause = "0, $this->pageSize"; - - $dataQuery = $this->getQuery($limitClause); - $records = $dataQuery->execute(); - $items = new DataObjectSet(); - foreach($records as $record) { - if(! is_object($record)) { - $class = $this->sourceClass; - $record = new $class($record); - } - $items->push($record); - } - - $dataQuery = $this->getQuery(); - $records = $dataQuery->execute(); - $unpagedItems = new DataObjectSet(); - foreach($records as $record) { - if(! is_object($record)) - $record = new DataObject($record); - $unpagedItems->push($record); - } - $this->unpagedSourceItems = $unpagedItems; - - $this->totalCount = ($this->unpagedSourceItems) ? $this->unpagedSourceItems->TotalItems() : null; - - return $items; - } - - function getControllerID() { - return $this->controller->ID; + public function FieldHolder() { + $list = Object::create( + "ListboxField", + $this->grid->getName(), + sprintf(_t('DOM.Selected','Selected %s'),$this->grid->Title()), + DataList::create($this->dataClass) + ->map('ID', 'Title') + ->toArray() + )->setMultiple(true); + $this->grid->setList(DataList::create($this->dataClass)); + return "
{$list->FieldHolder()}
{$this->grid->FieldHolder()}"; } - - public function SortableClass() - { - return $this->sourceClass(); - } - - - function saveInto(DataObject $record) { - $fieldName = $this->name; - $saveDest = $record->$fieldName(); - - if(! $saveDest) - user_error("HasManyDataObjectManager::saveInto() Field '$fieldName' not found on $record->class.$record->ID", E_USER_ERROR); - - $items = array(); - - if($list = $this->value[ $this->htmlListField ]) { - if($list != 'undefined') - $items = explode(',', trim($list,",")); - } - - $saveDest->setByIDList($items); - } - - function ExtraData() { - $items = array(); - foreach($this->unpagedSourceItems as $item) { - if($item->{$this->joinField} == $this->controller->ID) - $items[] = $item->ID; - } - $list = implode(',', $items); - $value = ","; - $value .= !empty($list) ? $list."," : ""; - $inputId = $this->id() . '_' . $this->htmlListEndName; - return << -HTML; - } - -} - - -class HasManyFileDataObjectManager_Item extends FileDataObjectManager_Item { - - function MarkingCheckbox() { - $name = $this->parent->Name() . '[]'; - - $joinVal = $this->item->{$this->parent->joinField}; - $parentID = $this->parent->getControllerID(); - $disabled = $this->parent->hasMarkingPermission() ? "" : "disabled='disabled'"; - - if($this->parent->IsReadOnly || ($joinVal > 0 && $joinVal != $parentID)) - return "item->ID}\" disabled=\"disabled\"/>"; - else if($joinVal == $parentID) - return "item->ID}\" checked=\"checked\" $disabled />"; - else - return "item->ID}\" $disabled />"; - } -} - - -?> \ No newline at end of file +} \ No newline at end of file diff --git a/code/HasOneDataObjectManager.php b/code/HasOneDataObjectManager.php index dd9ba63..ecd4838 100644 --- a/code/HasOneDataObjectManager.php +++ b/code/HasOneDataObjectManager.php @@ -1,74 +1,19 @@ getParentIdNameRelation($parentClass, $childClass, 'has_one'); - } - - function getControllerJoinID() { - return $this->controller->{$this->joinField}; - } - - function saveInto(DataObject $record) { - $fieldName = $this->name; - $fieldNameID = $fieldName . 'ID'; - - $record->$fieldNameID = 0; - if($val = $this->value[ $this->htmlListField ]) { - if($val != 'undefined') - $record->$fieldNameID = trim($val,","); - } - - $record->write(); - } - - function setOneToOne() { - $this->isOneToOne = true; - } - - function isChildSet($childID) { - return DataObject::get($this->controllerClass(), '"' . $this->joinField . "\" = '$childID'"); - } - - function ExtraData() { - $val = $this->getControllerJoinID() ? ','.$this->getControllerJoinID().',' : ''; - $inputId = $this->id() . '_' . $this->htmlListEndName; - return << -HTML; + public function FieldHolder() { + $list = Object::create( + "DropdownField", + $this->grid->getName()."ID", + sprintf(_t('DOM.Selected','Selected %s'),$this->grid->Title()), + DataList::create($this->dataClass) + ->map('ID', 'Title') + ->toArray() + ); + $this->grid->setList(DataList::create($this->dataClass)); + return "
{$list->FieldHolder()}
{$this->grid->FieldHolder()}"; } - -} - -class HasOneDataObjectManager_Item extends DataObjectManager_Item { - - function MarkingCheckbox() { - $name = $this->parent->Name() . '[]'; - - $isOneToOne = $this->parent->isOneToOne; - $joinVal = $this->parent->getControllerJoinID(); - $childID = $this->item->ID; - $disabled = $this->parent->hasMarkingPermission() ? "" : "disabled='disabled'"; - - if($this->parent->IsReadOnly || ($isOneToOne && $joinVal != $childID && $this->parent->isChildSet($childID))) - return "item->ID}\" disabled=\"disabled\"/>"; - else if($joinVal == $childID) - return "item->ID}\" checked=\"checked\" $disabled />"; - else - return "item->ID}\" $disabled />"; - } -} - - -?> \ No newline at end of file +} \ No newline at end of file diff --git a/code/HasOneFileDataObjectManager.php b/code/HasOneFileDataObjectManager.php index 0b62258..2a6fe3c 100644 --- a/code/HasOneFileDataObjectManager.php +++ b/code/HasOneFileDataObjectManager.php @@ -1,74 +1,20 @@ getParentIdNameRelation($parentClass, $childClass, 'has_one'); - } - - function getControllerJoinID() { - return $this->controller->{$this->joinField}; - } - - function saveInto(DataObject $record) { - $fieldName = $this->name; - $fieldNameID = $fieldName . 'ID'; - - $record->$fieldNameID = 0; - if($val = $this->value[ $this->htmlListField ]) { - if($val != 'undefined') - $record->$fieldNameID = trim($val,","); - } - - $record->write(); - } - - function setOneToOne() { - $this->isOneToOne = true; - } - - function isChildSet($childID) { - return DataObject::get($this->controllerClass(), '"' . $this->joinField . "\" = '$childID'"); - } - - function ExtraData() { - $val = $this->getControllerJoinID() ? ','.$this->getControllerJoinID().',' : ''; - $inputId = $this->id() . '_' . $this->htmlListEndName; - return << -HTML; - } - - -} - -class HasOneFileDataObjectManager_Item extends FileDataObjectManager_Item { - - function MarkingCheckbox() { - $name = $this->parent->Name() . '[]'; - - $isOneToOne = $this->parent->isOneToOne; - $joinVal = $this->parent->getControllerJoinID(); - $childID = $this->item->ID; - $disabled = $this->parent->hasMarkingPermission() ? "" : "disabled='disabled'"; - - if($this->parent->IsReadOnly || ($isOneToOne && $joinVal != $childID && $this->parent->isChildSet($childID))) - return "item->ID}\" disabled=\"disabled\"/>"; - else if($joinVal == $childID) - return "item->ID}\" checked=\"checked\" $disabled />"; - else - return "item->ID}\" $disabled />"; + public function FieldHolder() { + $list = Object::create( + "DropdownField", + $this->grid->getName()."ID", + sprintf(_t('DOM.Selected','Selected %s'),$this->grid->Title()), + DataList::create($this->dataClass) + ->map('ID', 'Title') + ->toArray() + ); + $this->grid->setList(DataList::create($this->dataClass)); + return "
{$list->FieldHolder()}
{$this->grid->FieldHolder()}"; } -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/code/ImageAssetManager.php b/code/ImageAssetManager.php deleted file mode 100644 index d4ec6ec..0000000 --- a/code/ImageAssetManager.php +++ /dev/null @@ -1,29 +0,0 @@ - 'Title', - 'Filename' => 'Filename' - ); - } - - $fields = singleton($sourceClass)->getCMSFields(); - $fields->removeByName("OwnerID"); - $fields->removeByName("Parent"); - $fields->removeByName("Filename"); - $fields->removeByName("SortOrder"); - $fields->removeByName("Sort"); - $fields->push(new ReadonlyField('Filename')); - $fields->push(new SimpleTreeDropdownField('ParentID','Folder',"Folder")); - $fields->push(new HiddenField('ID','',$controller->ID)); - - parent::__construct($controller, $name, $sourceClass, null, $headings, $fields, "\"ClassName\" != 'Folder'"); - } - -} \ No newline at end of file diff --git a/code/ImageDataObjectManager.php b/code/ImageDataObjectManager.php index f4072a9..826ca0c 100644 --- a/code/ImageDataObjectManager.php +++ b/code/ImageDataObjectManager.php @@ -2,115 +2,5 @@ class ImageDataObjectManager extends FileDataObjectManager { - protected static $sliderWidth = 150; - protected static $minImageSize = 25; - protected static $maxImageSize = 300; - - public $view = "grid"; - protected $limitFileTypes = array ('jpg','jpeg','gif','png'); - public $template = "ImageDataObjectManager"; - public $itemClass = "ImageDataObjectManager_Item"; - public $popupClass = "ImageDataObjectManager_Popup"; - public $importClass = "Image"; - - public $imageSize = 100; - - public $uploadifyField = "MultipleImageUploadField"; - - public function __construct($controller, $name = null, $sourceClass = null, $fileFieldName = null, $fieldList = null, $detailFormFields = null, $sourceFilter = "", $sourceSort = "", $sourceJoin = "") - { - parent::__construct($controller, $name, $sourceClass, $fileFieldName, $fieldList, $detailFormFields, $sourceFilter, $sourceSort, $sourceJoin); - Requirements::css('dataobject_manager/css/ui/dom_jquery_ui.css'); - Requirements::javascript('dataobject_manager/javascript/imagedataobject_manager.js'); - - if(isset($_REQUEST['ctf'][$this->Name()])) { - $this->imageSize = $_REQUEST['ctf'][$this->Name()]['imagesize']; - } - $this->setAllowedFileTypes($this->limitFileTypes); - } - - function handleItem($request) { - return new ImageDataObjectManager_ItemRequest($this, $request->param('ID')); - } - - public function getQueryString($params = array()) - { - $imagesize = isset($params['imagesize'])? $params['imagesize'] : $this->imageSize; - return parent::getQueryString($params)."&ctf[{$this->Name()}][imagesize]={$imagesize}"; - } - - public function SliderPercentage() - { - return ($this->imageSize - self::$minImageSize) / ((self::$maxImageSize - self::$minImageSize) / 100); - } - - public function SliderPosition() - { - return floor(($this->SliderPercentage()/100) * self::$sliderWidth); // handle is 16px wide - } - - -} - -class ImageDataObjectManager_Item extends FileDataObjectManager_Item -{ - - function __construct(DataObject $item, ComplexTableField $parent) - { - parent::__construct($item, $parent); - } - - public function FileIcon() - { - $file = ($this->parent->hasDataObject) ? $this->obj($this->parent->fileFieldName) : $this->item; - if($file) { - if($this->parent->imageSize <= 50) $size = 50; - elseif($this->parent->imageSize <= 100) $size = 100; - elseif($this->parent->imageSize <= 200) $size = 200; - else $size = 300; - return ($file instanceof Image && $cropped = $file->CroppedImage($size, $size)) ? $cropped->URL : $file->Icon(); - } - return false; - } - - public function ImageSize() - { - return $this->parent->imageSize; - } - -} - -class ImageDataObjectManager_Popup extends FileDataObjectManager_Popup -{ - function __construct($controller, $name, $fields, $validator, $readonly, $dataObject) - { - parent::__construct($controller, $name, $fields, $validator, $readonly, $dataObject); - Requirements::css('dataobject_manager/css/imagedataobject_manager.css'); - } - -} - -class ImageDataObjectManager_ItemRequest extends DataObjectManager_ItemRequest -{ - function __construct($ctf, $itemID) - { - parent::__construct($ctf, $itemID); - } - - function DetailForm($childID = null) - { - if($this->ctf->hasDataObject) { - $fileField = $this->ctf->fileFieldName; - $imgObj = $this->dataObj()->$fileField(); - } - else - $imgObj = $this->dataObj(); - $form = parent::DetailForm($childID); - $form->Fields()->insertAfter($this->ctf->getPreviewFieldFor($imgObj, 200), 'open'); - return $form; - } - -} - -?> \ No newline at end of file +} \ No newline at end of file diff --git a/code/ManyManyDataObjectManager.php b/code/ManyManyDataObjectManager.php index b13e729..0598952 100644 --- a/code/ManyManyDataObjectManager.php +++ b/code/ManyManyDataObjectManager.php @@ -1,253 +1,18 @@ controllerClass())); - foreach($classes as $class) { - if($class != "Object") { - $singleton = singleton($class); - $manyManyRelations = $singleton->uninherited('many_many', true); - if(isset($manyManyRelations) && array_key_exists($this->name, $manyManyRelations)) { - $this->manyManyParentClass = $class; - $manyManyTable = $class . '_' . $this->name; - break; - } - - $belongsManyManyRelations = $singleton->uninherited( 'belongs_many_many', true ); - if( isset( $belongsManyManyRelations ) && array_key_exists( $this->name, $belongsManyManyRelations ) ) { - $this->manyManyParentClass = $class; - - // @modification http://open.silverstripe.org/ticket/5194 - $manyManyClass = $belongsManyManyRelations[$this->name]; - $manyManyRelations = singleton($manyManyClass)->uninherited('many_many', true); - foreach($manyManyRelations as $manyManyRelationship => $manyManyChildClass) - if ($manyManyChildClass == $class) - break; - - $manyManyTable = $manyManyClass . '_' . $manyManyRelationship; - break; - } - } - } - if(!$manyManyTable) user_error("I could not find the relation $this->name in " . $this->controllerClass() . " or any of its ancestors.",E_USER_WARNING); - $this->manyManyTable = $manyManyTable; - $tableClasses = ClassInfo::dataClassesFor($this->sourceClass); - $source = array_shift($tableClasses); - $sourceField = $this->sourceClass; - if($this->manyManyParentClass == $sourceField) - $sourceField = 'Child'; - $parentID = $this->controller->ID; - - $this->sourceJoin .= " LEFT JOIN \"$manyManyTable\" ON (\"$source\".\"ID\" = \"{$sourceField}ID\" AND \"$manyManyTable\".\"{$this->manyManyParentClass}ID\" = '$parentID')"; - - $this->joinField = 'Checked'; - if(isset($_REQUEST['ctf'][$this->Name()]['only_related'])) - $this->OnlyRelated = $_REQUEST['ctf'][$this->Name()]['only_related']; - - $this->addPermission('only_related'); - - if($this->ShowAll() && SortableDataObject::is_sortable_many_many($this->sourceClass())) - $this->OnlyRelated = '1'; - - } - - public function setParentClass($class) - { - parent::setParentClass($class); - $this->joinField = "Checked"; - } - - - protected function loadSort() { - - if($this->ShowAll()) - $this->setPageSize(999); - - $original_sort = $this->sourceSort; - if(SortableDataObject::is_sortable_many_many($this->sourceClass(), $this->manyManyParentClass)) { - list($parentClass, $componentClass, $parentField, $componentField, $table) = singleton($this->controllerClass())->many_many($this->Name()); - $sort_column = "MMSort"; - if(!isset($_REQUEST['ctf'][$this->Name()]['sort']) || $_REQUEST['ctf'][$this->Name()]['sort'] == $sort_column) { - $this->sort = $sort_column; - $this->sourceSort = "\"$sort_column\" " . SortableDataObject::$sort_dir; - $this->sourceSort .= ", \"Checked\" DESC"; - } - } elseif($this->Sortable() && (!isset($_REQUEST['ctf'][$this->Name()]['sort']) || $_REQUEST['ctf'][$this->Name()]['sort'] == "SortOrder")) { - $this->sort = "SortOrder"; - $this->sourceSort = "\"SortOrder\" " . SortableDataObject::$sort_dir; - $this->sourceSort .= ", \"Checked\" DESC"; - } elseif(isset($_REQUEST['ctf'][$this->Name()]['sort']) && !empty($_REQUEST['ctf'][$this->Name()]['sort'])) { - $this->sourceSort = "\"".$_REQUEST['ctf'][$this->Name()]['sort'] . "\" " . $this->sort_dir; - } elseif (empty($original_sort)) { - $this->sourceSort = singleton($this->sourceClass())->stat('default_sort'); - } - - if ($original_sort && $original_sort != $this->sourceSort) $this->sourceSort .= ', '.$original_sort; - } - - - public function setOnlyRelated($bool) - { - if(!isset($_REQUEST['ctf'][$this->Name()]['only_related'])) - $this->OnlyRelated = $bool; - } - - public function OnlyRelated() - { - return self::$only_related !== null ? self::$only_related : $this->OnlyRelated; - } - - public function getQueryString($params = array()) - { - $only_related = isset($params['only_related'])? $params['only_related'] : $this->OnlyRelated(); - return parent::getQueryString($params)."&ctf[{$this->Name()}][only_related]={$only_related}"; - } - - public function OnlyRelatedLink() - { - return $this->RelativeLink(array('only_related' => '1')); - } - - public function AllRecordsLink() - { - return $this->RelativeLink(array('only_related' => '0')); - } - - - function getQuery($limitClause = null) { - if($this->customQuery) { - $query = $this->customQuery; - $query->select[] = "\"{$this->sourceClass}\".\"ID\" AS \"ID\""; - $query->select[] = "\"{$this->sourceClass}\".\"ClassName\" AS \"ClassName\""; - $query->select[] = "\"{$this->sourceClass}\".\"ClassName\" AS \"RecordClassName\""; - } - else { - $query = singleton($this->sourceClass)->extendedSQL($this->sourceFilter, $this->sourceSort, $limitClause, $this->sourceJoin); - - // Add more selected fields if they are from joined table. - - $SNG = singleton($this->sourceClass); - foreach($this->FieldList() as $k => $title) { - if(! $SNG->hasField($k) && ! $SNG->hasMethod('get' . $k) && ! $SNG->has_one($k)) { - // everything we add to select must be added to groupby too... - $query->select[] = $k; - $query->groupby[] = $k; - } - } - $parent = $this->controllerClass(); - $mm = $this->manyManyTable; - $when_clause = "CASE WHEN \"$mm\".\"{$this->manyManyParentClass}ID\" IS NULL THEN '0' ELSE '1' END"; - $query->select[] = "$when_clause AS \"Checked\""; - // everything we add to select must be added to groupby too... - $query->groupby[] = $when_clause; - - if (SortableDataObject::is_sortable_many_many($this->sourceClass(), $this->manyManyParentClass)) { - $query->select[] = "COALESCE(\"$mm\".\"SortOrder\",9999999) AS \"MMSort\""; - // everything we add to select must be added to groupby too... - $query->groupby[] = "COALESCE(\"$mm\".\"SortOrder\",9999999)"; - } - - if($this->OnlyRelated()) - $query->where[] = "(\"$mm\".\"{$this->manyManyParentClass}ID\" IS NOT NULL)"; - } - return clone $query; - } - - function getParentIdName($parentClass, $childClass) { - return $this->getParentIdNameRelation($parentClass, $childClass, 'many_many'); - } - - function ExtraData() { - $items = array(); - // changed to avoid having to use $this->unpagedSourceItems because it fails on large datasets - $items = $this->getSelectedIDs(); - $list = implode(',', $items); - $value = ","; - $value .= !empty($list) ? $list."," : ""; - $inputId = $this->id() . '_' . $this->htmlListEndName; - $controllerID = $this->controller->ID; - return << - -HTML; - } - - /** - * Returns the list of IDs that should be checked in the list. - * @see HasManyDataObjectManager::getSelectedIDs() - * @return array - */ - function getSelectedIDs() { - $ids = array(); - $dataQuery = $this->getQuery(); - $dataQuery->where("(\"$this->manyManyTable\".\"{$this->manyManyParentClass}ID\" IS NOT NULL)"); - $records = $dataQuery->execute(); - $class = $this->sourceClass; - foreach($records as $record) { - $item = new $class($record); - $ids[] = $item->ID; - } - return $ids; - } - - public function Sortable() - { - return ( - $this->IsReadOnly !== true && - $this->controller->canEdit(Member::currentUser()) && - ( - SortableDataObject::is_sortable_many_many($this->sourceClass()) || - SortableDataObject::is_sortable_class($this->sourceClass()) - ) - ); - } - - public function SortableClass() - { - return $this->manyManyParentClass."-".$this->sourceClass(); - } - - -} - -class ManyManyDataObjectManager_Item extends DataObjectManager_Item { - - function MarkingCheckbox() { - $name = $this->parent->Name() . '[]'; - $disabled = $this->parent->hasMarkingPermission() ? "" : "disabled='disabled'"; - - if($this->parent->IsReadOnly) - return "item->ID}\" disabled=\"disabled\"/>"; - else if($this->item->{$this->parent->joinField}) - return "item->ID}\" checked=\"checked\" $disabled />"; - else - return "item->ID}\" $disabled />"; - } -} - - - - -?> + public function FieldHolder() { + $list = Object::create( + "ListboxField", + $this->grid->getName(), + sprintf(_t('DOM.Selected','Selected %s'),$this->grid->Title()), + DataList::create($this->dataClass) + ->map('ID', 'Title') + ->toArray() + )->setMultiple(true); + $this->grid->setList(DataList::create($this->dataClass)); + return "
{$list->FieldHolder()}
{$this->grid->FieldHolder()}"; + } + +} \ No newline at end of file diff --git a/code/ManyManyFileDataObjectManager.php b/code/ManyManyFileDataObjectManager.php index 411bc8e..1d4b388 100644 --- a/code/ManyManyFileDataObjectManager.php +++ b/code/ManyManyFileDataObjectManager.php @@ -1,235 +1,20 @@ controllerClass())); - foreach($classes as $class) { - if($class != "Object") { - $singleton = singleton($class); - $manyManyRelations = $singleton->uninherited('many_many', true); - if(isset($manyManyRelations) && array_key_exists($this->name, $manyManyRelations)) { - $this->manyManyParentClass = $class; - $manyManyTable = $class . '_' . $this->name; - break; - } - $belongsManyManyRelations = $singleton->uninherited( 'belongs_many_many', true ); - if( isset( $belongsManyManyRelations ) && array_key_exists( $this->name, $belongsManyManyRelations ) ) { - $this->manyManyParentClass = $class; - - // @modification http://open.silverstripe.org/ticket/5194 - $manyManyClass = $belongsManyManyRelations[$this->name]; - $manyManyRelations = singleton($manyManyClass)->uninherited('many_many', true); - foreach($manyManyRelations as $manyManyRelationship => $manyManyChildClass) - if ($manyManyChildClass == $class) - break; - - $manyManyTable = $manyManyClass . '_' . $manyManyRelationship; - break; - } - } - } - if(!$manyManyTable) user_error("I could not find the relation $this->name in " . $this->controllerClass() . " or any of its ancestors.",E_USER_WARNING); - $this->manyManyTable = $manyManyTable; - $tableClasses = ClassInfo::dataClassesFor($this->sourceClass); - $source = array_shift($tableClasses); - $sourceField = $this->sourceClass; - if($this->manyManyParentClass == $sourceField) - $sourceField = 'Child'; - $parentID = $this->controller->ID; - - $this->sourceJoin .= " LEFT JOIN \"$manyManyTable\" ON (\"$source\".\"ID\" = \"{$sourceField}ID\" AND \"$manyManyTable\".\"{$this->manyManyParentClass}ID\" = '$parentID')"; - - $this->joinField = 'Checked'; - if(isset($_REQUEST['ctf'][$this->Name()]['only_related'])) - $this->OnlyRelated = $_REQUEST['ctf'][$this->Name()]['only_related']; - - $this->addPermission('only_related'); - - // If drag-and-drop is enabled, we need to turn on the only related filter - if($this->ShowAll() && SortableDataObject::is_sortable_many_many($this->sourceClass())) - $this->OnlyRelated = '1'; - - } - - public function setParentClass($class) - { - parent::setParentClass($class); - $this->joinField = "Checked"; - } - - - protected function loadSort() { - - if($this->ShowAll()) - $this->setPageSize(999); - - $original_sort = $this->sourceSort; - if (SortableDataObject::is_sortable_many_many($this->sourceClass(), $this->manyManyParentClass)) { - list($parentClass, $componentClass, $parentField, $componentField, $table) = singleton($this->controllerClass())->many_many($this->Name()); - $sort_column = "$table.SortOrder"; - if (!isset($_REQUEST['ctf'][$this->Name()]['sort']) || $_REQUEST['ctf'][$this->Name()]['sort'] == $sort_column) { - $this->sort = $sort_column; - $this->sourceSort = "\"$table\".\"SortOrder\" " . SortableDataObject::$sort_dir; - } - } elseif ($this->Sortable() && (!isset($_REQUEST['ctf'][$this->Name()]['sort']) || $_REQUEST['ctf'][$this->Name()]['sort'] == "SortOrder")) { - $this->sort = "SortOrder"; - $this->sourceSort = "\"SortOrder\" " . SortableDataObject::$sort_dir; - } elseif (isset($_REQUEST['ctf'][$this->Name()]['sort'])) { - $this->sourceSort = "\"" . $_REQUEST['ctf'][$this->Name()]['sort'] . "\" " . $this->sort_dir; - } elseif(isset($_REQUEST['ctf'][$this->Name()]['sort']) && !empty($_REQUEST['ctf'][$this->Name()]['sort'])) { - $this->sourceSort = $_REQUEST['ctf'][$this->Name()]['sort'] . " " . $this->sort_dir; - } elseif (empty($original_sort)) { - $this->sourceSort = singleton($this->sourceClass())->stat('default_sort'); - } - - if ($original_sort && $original_sort != $this->sourceSort) $this->sourceSort .= ', '.$original_sort; - } - - - public function setOnlyRelated($bool) - { - if(!isset($_REQUEST['ctf'][$this->Name()]['only_related'])) - $this->OnlyRelated = $bool; - } - - public function OnlyRelated() - { - return self::$only_related !== null ? self::$only_related : $this->OnlyRelated; - } - - public function getQueryString($params = array()) - { - $only_related = isset($params['only_related'])? $params['only_related'] : $this->OnlyRelated(); - return parent::getQueryString($params)."&ctf[{$this->Name()}][only_related]={$only_related}"; - } - - public function OnlyRelatedLink() - { - return $this->RelativeLink(array('only_related' => '1')); - } - - public function AllRecordsLink() - { - return $this->RelativeLink(array('only_related' => '0')); + public function FieldHolder() { + $list = Object::create( + "ListboxField", + $this->grid->getName(), + sprintf(_t('DOM.Selected','Selected %s'),$this->grid->Title()), + DataList::create($this->dataClass) + ->map('ID', 'Title') + ->toArray() + )->setMultiple(true); + $this->grid->setList(DataList::create($this->dataClass)); + return "
{$list->FieldHolder()}
{$this->grid->FieldHolder()}"; } - - - function getQuery($limitClause = null) { - if($this->customQuery) { - $query = $this->customQuery; - $query->select[] = "\"{$this->sourceClass}\".\"ID\" AS \"ID\""; - $query->select[] = "\"{$this->sourceClass}\".\"ClassName\" AS \"ClassName\""; - $query->select[] = "\"{$this->sourceClass}\".\"ClassName\" AS \"RecordClassName\""; - } - else { - $query = singleton($this->sourceClass)->extendedSQL($this->sourceFilter, $this->sourceSort, $limitClause, $this->sourceJoin); - - // Add more selected fields if they are from joined table. - - $SNG = singleton($this->sourceClass); - foreach($this->FieldList() as $k => $title) { - if(! $SNG->hasField($k) && ! $SNG->hasMethod('get' . $k)) { - $query->select[] = $k; - // everything we add to select must be added to groupby too... - $query->groupby[] = $k; - } - } - $parent = $this->controllerClass(); - $mm = $this->manyManyTable; - $when_clause = "CASE WHEN \"$mm\".\"{$this->manyManyParentClass}ID\" IS NULL THEN '0' ELSE '1' END"; - $query->select[] = "$when_clause AS \"Checked\""; - // everything we add to select must be added to groupby too... - $query->groupby[] = $when_clause; - - if($this->OnlyRelated()) - $query->where[] = "(\"$mm\".\"{$this->manyManyParentClass}ID\" IS NOT NULL)"; - } - return clone $query; - } - - - function getParentIdName($parentClass, $childClass) { - return $this->getParentIdNameRelation($parentClass, $childClass, 'many_many'); - } - - function ExtraData() { - $items = array(); - foreach($this->unpagedSourceItems as $item) { - if($item->{$this->joinField}) - $items[] = $item->ID; - } - $list = implode(',', $items); - $value = ","; - $value .= !empty($list) ? $list."," : ""; - $inputId = $this->id() . '_' . $this->htmlListEndName; - $controllerID = $this->controller->ID; - return << - -HTML; - } - - protected function getSortableOwner() - { - if($this->sortableOwner) return $this->sortableOwner; - - // Find the class who owns the relation - $parent = null; - foreach(array_reverse(ClassInfo::ancestry($this->controllerClass())) as $class) { - if(SortableDataObject::is_sortable_many_many($this->sourceClass(), $class)) { - $this->sortableOwner = $class; - return $this->sortableOwner; - } - } - return false; - } - - public function Sortable() - { - return (SortableDataObject::is_sortable_many_many($this->sourceClass())) || (SortableDataObject::is_sortable_class($this->sourceClass())); - } - - public function SortableClass() - { - return $this->manyManyParentClass."-".$this->sourceClass(); - } -} - -class ManyManyFileDataObjectManager_Item extends FileDataObjectManager_Item { - - function MarkingCheckbox() { - $name = $this->parent->Name() . '[]'; - $disabled = $this->parent->hasMarkingPermission() ? "" : "disabled='disabled'"; - - if($this->parent->IsReadOnly) - return "item->ID}\" disabled=\"disabled\"/>"; - else if($this->item->{$this->parent->joinField}) - return "item->ID}\" checked=\"checked\" $disabled />"; - else - return "item->ID}\" $disabled />"; - } -} - - -?> \ No newline at end of file +} \ No newline at end of file diff --git a/code/SortableDataObject.php b/code/SortableDataObject.php deleted file mode 100644 index 3e3cab1..0000000 --- a/code/SortableDataObject.php +++ /dev/null @@ -1,126 +0,0 @@ - array ( - 'SortOrder' => 'Int' - ) - ); - } - - - public static function add_sortable_classes(array $classes) - { - foreach($classes as $class) - self::add_sortable_class($class); - } - - public static function add_sortable_many_many_relation($ownerClass,$componentName) - { - - list($parentClass, $componentClass, $parentField, $componentField, $table) = singleton($ownerClass)->many_many($componentName); - Object::add_static_var($ownerClass,'many_many_extraFields',array( - $componentName => array( - 'SortOrder' => 'Int' - ))); - if(!isset(self::$many_many_sortable_relations[$componentClass])) - self::$many_many_sortable_relations[$componentClass] = array(); - - self::$many_many_sortable_relations[$componentClass][$parentClass] = $table; - self::add_sortable_class($componentClass); - } - - public static function remove_sortable_class($class) - { - Object::remove_extension($class, 'SortableDataObject'); - } - - public static function is_sortable_class($classname) - { - if(in_array($classname, self::$sortable_classes)) - return true; - foreach(self::$sortable_classes as $class) { - if(is_subclass_of($classname, $class)) - return true; - } - return Object::has_extension($classname, 'SortableDataObject'); - - } - - public static function is_sortable_many_many($componentClass, $parentClass = null) - { - $map = self::$many_many_sortable_relations; - if($parentClass === null) - return isset($map[$componentClass]); - else { - if(isset($map[$componentClass])) - return isset($map[$componentClass][$parentClass]); - return false; - } - - } - - public static function get_join_tables($classname) - { - if(isset(self::$many_many_sortable_relations[$classname])) - return self::$many_many_sortable_relations[$classname]; - return false; - } - - - public function augmentSQL(SQLQuery &$query) - { - if(empty($query->select) || $query->delete || in_array("COUNT(*)",$query->select) || in_array("count(*)",$query->select)) return; - $sort_field = false; - if($join_tables = self::get_join_tables($this->owner->class)) { - foreach($query->from as $from) { - if($sort_field) break; - foreach($join_tables as $join_table) { - if(stristr($from,$join_table)) { - $sort_field = "\"$join_table\".\"SortOrder\""; - if(isset($query->select['SortOrder'])) { - $query->select['SortOrder'] = "\"{$this->owner->class}\".SortOrder AS LocalSort"; - } - break; - } - } - } - } - if(!$sort_field) $sort_field = "\"SortOrder\""; - - if(!$query->orderby || ($query->orderby == $this->owner->stat('default_sort'))) - $query->orderby = "$sort_field " . self::$sort_dir; - } - - - public function onBeforeWrite() - { - if(!$this->owner->ID) { - if($peers = DataObject::get($this->owner->class)) - $this->owner->SortOrder = $peers->Count()+1; - } - } - -} diff --git a/code/autocomplete_field/AutoCompleteField.php b/code/autocomplete_field/AutoCompleteField.php deleted file mode 100644 index b6b1d91..0000000 --- a/code/autocomplete_field/AutoCompleteField.php +++ /dev/null @@ -1,66 +0,0 @@ -process(new ArrayData(array ( - 'Results' => $results - ))); - } - - /** - * Constructor for AutoCompleteField - * @param string $name The name of the field - * @param string $title The label for the field - * @param string $url A function or a URL for the results callback - * @param string $val A default value (will be knocked out on focus) - */ - public function __construct($name, $title, $url = "autocomplete", $val = null) { - parent::__construct($name, $title, $val); - if(!stristr($url,'/')) { - // url was passed as a function name.. use the current controller - $url = Controller::curr()->Link($url); - } - $this->addExtraClass("autocomplete_input"); - $this->addExtraClass("{'url' : '$url'}"); - } - - /** - * Require the dependencies and render the field - * Note: The wrapper div is a hack. Position:relative would not work against - * an input field in most browsers. :-( - * @return string - */ - public function Field() { - Requirements::javascript(THIRDPARTY_DIR.'/jquery/jquery.js'); - Requirements::javascript(THIRDPARTY_DIR.'/jquery-metadata/jquery.metadata.js'); - Requirements::javascript(THIRDPARTY_DIR.'/jquery-livequery/jquery.livequery.js'); - - Requirements::javascript('dataobject_manager/code/autocomplete_field/javascript/autocomplete_field.js'); - Requirements::css('dataobject_manager/code/autocomplete_field/css/autocomplete_field.css'); - return '
'.parent::Field().'
'; - } -} \ No newline at end of file diff --git a/code/autocomplete_field/css/autocomplete_field.css b/code/autocomplete_field/css/autocomplete_field.css deleted file mode 100644 index 6ce7612..0000000 --- a/code/autocomplete_field/css/autocomplete_field.css +++ /dev/null @@ -1,8 +0,0 @@ -.right form input.autocomplete_input {height:16px;margin:0;width:80%;} -.right form .autocomplete_holder button {height:16px;margin-left:10px;} -.autocomplete_holder {position:relative;} -.autocomplete_results {background:#fff;display:none;position:absolute;top:48px;height:200px;overflow:auto;border:1px solid #ccc;width:250px;z-index:10;} -.autocomplete_results h5 {font-size:12px;margin:0;padding:0;} -.autocomplete_results ul {margin:0;padding:0;width:auto;float:none;} -.autocomplete_results ul li {margin:0;padding:4px;list-style:none;display:block !important;float:none;width:auto;display:block;border-bottom:1px solid #dcdcdc;} -.autocomplete_results ul li:hover {background:#efefef;} \ No newline at end of file diff --git a/code/autocomplete_field/javascript/autocomplete_field.js b/code/autocomplete_field/javascript/autocomplete_field.js deleted file mode 100644 index 3a11942..0000000 --- a/code/autocomplete_field/javascript/autocomplete_field.js +++ /dev/null @@ -1,87 +0,0 @@ -(function($) { - var request = false; - $.fn.autoComplete = function() { - return this.each(function() { - var $element = $(this); - var $container = $(this).closest('.autocomplete_holder'); - $element.initial_val = $element.val(); - $(this).attr('autocomplete','off') - .focus(function() { - $(this).toggleClass('focus'); - if($(this).val() == $element.initial_val) - $(this).val(''); - }) - .keyup(function(e) { - var $input = $(this); - var $resultsDiv = $input.siblings('.autocomplete_results'); - url = $(this).metadata().url; - if ((e.keyCode == 9) || (e.keyCode == 13) || // tab, enter - (e.keyCode == 16) || (e.keyCode == 17) || // shift, ctl - (e.keyCode >= 18 && e.keyCode <= 20) || // alt, pause/break, caps lock - (e.keyCode == 27) || // esc - (e.keyCode >= 33 && e.keyCode <= 35) || // page up, page down, end - (e.keyCode >= 36 && e.keyCode <= 38) || // home, left, up - (e.keyCode == 40) || // down - (e.keyCode >= 36 && e.keyCode <= 40) || // home, left, up, right, down - (e.keyCode >= 44 && e.keyCode <= 45) || // print screen, insert - (e.keyCode == 229) // Korean XP fires 2 keyup events, the key and 229 - ) return; - - if(request) window.clearTimeout(request); - request = window.setTimeout(function() { - if($input.val().length) { - $resultsDiv.load( - url, - {q : $input.val()}, - function(data) { - if(data.length) - $resultsDiv.show(); - else - $resultsDiv.hide(); - } - ); - } - },500) - e.stopPropagation(); - }) - .blur(function() { - $t = $(this); - setTimeout(function() { - $t.toggleClass('focus').siblings('.autocomplete_results').hide(); - }, 500); - }) - - if($container.hasClass('livedropdownfield')) { - $container.find('.livedropdown_browse').click(function() { - var $t = $(this); - var $resultsDiv = $(this).siblings('.autocomplete_results'); - $resultsDiv.load( - $t.siblings('.autocomplete_input').metadata().url, - {q : ''}, - function(data) { - if(data.length) { - $resultsDiv.show(); - } - else { - $resultsDiv.hide(); - } - } - ); - return false; - }); - } - - }); - }; -$(function() { - $('input.autocomplete_input').livequery(function() { - $(this).autoComplete(); - }); - $('.livedropdownfield .autocomplete_results a').livequery("click", function() { - $(this).closest('.livedropdownfield').find(':hidden').val(this.hash.replace('#','')); - $(this).closest('.livedropdownfield').find('.autocomplete_input').val($(this).text()).blur(); - return false; - }); - -}); -})(jQuery); \ No newline at end of file diff --git a/code/autocomplete_field/templates/Includes/AutoComplete_default.ss b/code/autocomplete_field/templates/Includes/AutoComplete_default.ss deleted file mode 100644 index 29b9b5a..0000000 --- a/code/autocomplete_field/templates/Includes/AutoComplete_default.ss +++ /dev/null @@ -1,10 +0,0 @@ -<% if Results %> - -<% end_if %> \ No newline at end of file diff --git a/code/autocomplete_field/templates/Includes/LiveDropdownField_results.ss b/code/autocomplete_field/templates/Includes/LiveDropdownField_results.ss deleted file mode 100644 index e4d3c71..0000000 --- a/code/autocomplete_field/templates/Includes/LiveDropdownField_results.ss +++ /dev/null @@ -1,9 +0,0 @@ -<% if Results %> - -<% end_if %> \ No newline at end of file diff --git a/code/date_picker_field/DatePickerField.php b/code/date_picker_field/DatePickerField.php deleted file mode 100644 index bdf555f..0000000 --- a/code/date_picker_field/DatePickerField.php +++ /dev/null @@ -1,104 +0,0 @@ -getDateFormat()) - self::set_date_format($format); - } - - static function HTMLField( $id, $name, $val ) { - return << (clear) -HTML; - } - - public static function set_date_format($format) - { - switch($format) { - case "mdy": - self::$dateFormat = "mm/dd/yy"; - break; - - case "dmy": - self::$dateFormat = "dd/mm/yy"; - break; - - default: - self::$dateFormat = "dd/mm/yy"; - break; - } - } - - public static function dmy() - { - return self::$dateFormat == "dd/mm/yy"; - } - - public static function mdy() - { - return self::$dateFormat == "mm/dd/yy"; - } - - - function setValue($val) { - if(is_string($val) && preg_match('/^([\d]{2,4})-([\d]{1,2})-([\d]{1,2})/', $val)) { - $this->value = self::mdy() ? - preg_replace('/^([\d]{2,4})-([\d]{1,2})-([\d]{1,2})/','\\2/\\3/\\1', $val) : - preg_replace('/^([\d]{2,4})-([\d]{1,2})-([\d]{1,2})/','\\3/\\2/\\1', $val); - } else { - $this->value = $val; - } - } - - function dataValue() { - if(is_array($this->value)) { - if(isset($this->value['Year']) && isset($this->value['Month']) && isset($this->value['Day'])) { - return $this->value['Year'] . '-' . $this->value['Month'] . '-' . $this->value['Day']; - } else { - user_error("Bad DateField value " . var_export($this->value,true), E_USER_WARNING); - } - } elseif(preg_match('/^([\d]{1,2})\/([\d]{1,2})\/([\d]{2,4})/', $this->value, $parts)) { - return self::mdy() ? "$parts[3]-$parts[1]-$parts[2]" : "$parts[3]-$parts[2]-$parts[1]"; - } elseif(!empty($this->value)) { - return date('Y-m-d', strtotime($this->value)); - } else { - return null; - } - } - - public function validate() {return true;} - - function Field() { - Requirements::javascript(THIRDPARTY_DIR."/jquery-livequery/jquery.livequery.js"); - Requirements::javascript(THIRDPARTY_DIR."/jquery-metadata/jquery.metadata.js"); - Requirements::javascript("dataobject_manager/javascript/dom_jquery_ui.js"); - Requirements::javascript("dataobject_manager/code/date_picker_field/datepicker_init.js"); - Requirements::css("dataobject_manager/css/ui/dom_jquery_ui.css"); - $id = $this->id(); - $val = $this->attrValue(); - $field = parent::Field(); - - $innerHTML = self::HTMLField( $id, $this->name, $val ); - - return " -
- $innerHTML -
- "; - } - -} - -class DatePickerField_Controller extends Controller -{ - function dateformat() - { - echo DatePickerField::$dateFormat; - } -} - -?> \ No newline at end of file diff --git a/code/date_picker_field/datepicker.js b/code/date_picker_field/datepicker.js deleted file mode 100644 index c6e84af..0000000 --- a/code/date_picker_field/datepicker.js +++ /dev/null @@ -1,7 +0,0 @@ -(function($) { - $(function(){ - $('a[rel=clear-btn]').click(function(){ - $(this).prev('input').val(''); - }); - }); -})(jQuery); \ No newline at end of file diff --git a/code/date_picker_field/datepicker_init.js b/code/date_picker_field/datepicker_init.js deleted file mode 100644 index 9623b34..0000000 --- a/code/date_picker_field/datepicker_init.js +++ /dev/null @@ -1,13 +0,0 @@ -var date_picker_format; -(function($) { - $(function() { - $('.datepicker input').livequery(function() { - date_picker_format = $(this).parents('div.datepicker:first').metadata().dateFormat; - $(this).datepicker({dateFormat : date_picker_format, buttonImage : '/sapphire/images/calendar-icon.gif', buttonImageOnly : true}); - }); - - $('a[rel=clear-btn]').live("click",function() { - $(this).prev('input').val(''); - }); - }); -})(jQuery) diff --git a/code/dropdown_fields/FilteredDropdownSet.php b/code/dropdown_fields/FilteredDropdownSet.php deleted file mode 100755 index 09da7dd..0000000 --- a/code/dropdown_fields/FilteredDropdownSet.php +++ /dev/null @@ -1,61 +0,0 @@ -filteredField = $filteredField; - $this->returnKey = $returnKey; - $this->returnLabel = $returnLabel; - $this->sourceClass = $sourceClass; - $name = ""; - foreach($this->children as $c) { - if($c instanceof DropdownField) { - $name .= $c->Name(); - } - } - $this->name = $name; - } - - public function hasData() {return true;} - - - public function FieldHolder() { - Requirements::javascript(THIRDPARTY_DIR.'/jquery/jquery.js'); - Requirements::javascript(THIRDPARTY_DIR.'/jquery-metadata/jquery.metadata.js'); - Requirements::javascript('dataobject_manager/code/dropdown_fields/javascript/filtered_dropdown_set.js'); - foreach($this->children as $child) { - $meta = "'updateLink': '".$this->Link('update')."'"; - if($str = $child->getEmptyString()) { - $meta .= ",'emptyString': '".$child->getEmptyString()."'"; - } - $child->addExtraClass("{".$meta."}"); - } - return parent::FieldHolder(); - } - - - public function update(SS_HTTPRequest $r) { - $ret = array(); - $filter = null; - if($filter = $r->requestVar('q')) { - $filter = "{$this->filteredField} = '".Convert::raw2sql($filter)."'"; - } - $results = DataObject::get($this->sourceClass, $filter); - if($results) { - foreach($results as $r) { - $ret[$r->{$this->returnKey}] = $r->{$this->returnLabel}; - } - } - return Convert::array2json($ret); - } - -} \ No newline at end of file diff --git a/code/dropdown_fields/HTMLDropdownField.php b/code/dropdown_fields/HTMLDropdownField.php deleted file mode 100644 index e0fd896..0000000 --- a/code/dropdown_fields/HTMLDropdownField.php +++ /dev/null @@ -1,68 +0,0 @@ - tag containing all the appropriate ')); - } - for(i in data) { - $target.append($('')); - } - $target.val(currentValue); - } - }); - }); - $('.filtereddropdownset select').change(); -}); -})(jQuery); \ No newline at end of file diff --git a/code/flv/FLV.php b/code/flv/FLV.php deleted file mode 100644 index 286e851..0000000 --- a/code/flv/FLV.php +++ /dev/null @@ -1,327 +0,0 @@ -FFMPEG is installed on your server and working properly. Code: ".self::$termination_code."" : - "FFMPEG does not appear to be installed on your server. Code: ".self::$termination_code.""; - } - - - protected static function ffmpeg($args) - { - $descriptorspec = array( - 0 => array("pipe", "r"), // stdin is a pipe that the child will read from - 1 => array("pipe", "w"), // stdout is a pipe that the child will write to - 2 => array("pipe", "w") // stderr is a file to write to - ); - - $pipes= array(); - $cmd = self::$ffmpeg_root."ffmpeg ".$args; - self::log_command($cmd); - $process = proc_open($cmd, $descriptorspec, $pipes); - - $output= ""; - - if (!is_resource($process)) return false; - - #close child's input immediately - fclose($pipes[0]); - - stream_set_blocking($pipes[1],false); - stream_set_blocking($pipes[2],false); - - $todo= array($pipes[1],$pipes[2]); - - while( true ) { - $read= array(); - if( !feof($pipes[1]) ) $read[]= $pipes[1]; - if( !feof($pipes[2]) ) $read[]= $pipes[2]; - - if (!$read) break; - - $ready= stream_select($read, $write=NULL, $ex= NULL, 2); - - if ($ready === false) { - break; #should never happen - something died - } - - foreach ($read as $r) { - $s= fread($r,1024); - $output.= $s; - } - } - - fclose($pipes[1]); - fclose($pipes[2]); - - self::$termination_code = proc_close($process); - self::log_command($output); - return $output; - - } - - private static function log_command($cmd) - { - if(self::$log_file_path) { - $log = Director::baseFolder()."/".self::$log_file_path; - $f = @fopen($log, 'a'); - $entry = "[".date('Y-m-d H:i:s')."] ".$cmd."\n"; - @fwrite($f, $entry); - @fclose($f); - } - } - - private function default_thumbnail() - { - $img = new Image_Cached(self::$default_video_icon_path); - $img->ID = $this->ID; - return $img; - } - - private function SWFLink() - { - return Director::absoluteURL('dataobject_manager/code/flv/shadowbox/libraries/mediaplayer/player.swf'); - } - - private function AllowFullScreen() - { - return $this->allow_full_screen ? "true" : "false"; - } - - private static function remove_file_extension($filename) - { - $ext = strrchr($filename, '.'); - if($ext !== false) - $filename = substr($filename, 0, -strlen($ext)); - return $filename; - } - - private static function clean_file($str) - { - $t = strtolower($str); - $t = str_replace('&','-and-',$t); - $t = str_replace('&','-and-',$t); - $t = ereg_replace('[^A-Za-z0-9]+','-',$t); - $t = ereg_replace('-+','-',$t); - return $t; - } - - public function Icon() - { - return SAPPHIRE_DIR."/images/app_icons/mov_32.gif"; - } - - public function FLVPath() - { - return self::remove_file_extension($this->Filename).".flv"; - } - - public function FLVLink() - { - return Director::absoluteURL($this->FLVPath()); - } - - private function absoluteRawVideoLink() - { - return Director::baseFolder()."/".$this->Filename; - } - - private function absoluteFLVPath() - { - return Director::baseFolder()."/".$this->FLVPath(); - } - - private function hasFLV() - { - return Director::fileExists($this->FLVPath()); - } - - public function getThumbnail() - { - if($img = DataObject::get_one("Image","\"Title\" = 'flv_thumb_{$this->ID}'")) - return Director::fileExists($img->Filename) ? $img : false; - return false; - } - - private function createFLV() - { - $args = sprintf("-i %s -ar %d -ab %d -f flv %s", - $this->absoluteRawVideoLink(), - self::$audio_sampling_rate, - self::$audio_bit_rate, - $this->absoluteFLVPath() - ); - - $output = self::ffmpeg($args); - } - - private function createThumbnail() - { - $img_title = "flv_thumb_".$this->ID; - if($existing = DataObject::get("Image","\"Title\" = '$img_title'")) { - foreach($existing as $file) $file->delete(); - } - $folder = Folder::findOrMake(self::$thumbnail_folder); - $img_filename = self::clean_file(self::remove_file_extension($this->Title)).".jpg"; - $abs_thumb = Director::baseFolder()."/".$folder->Filename.$img_filename; - $args = sprintf("-y -i %s -an -s %s -ss %d -an -r 1 -vframes 1 -y -vcodec mjpeg -f mjpeg %s", - $this->absoluteFLVPath(), - self::$default_thumbnail_width."x".self::$default_thumbnail_height, - self::$thumbnail_seconds, - $abs_thumb - ); - self::ffmpeg($args); - - $img = new Image(); - $img->setField('ParentID',$folder->ID); - $img->Filename = $folder->Filename.$img_filename; - $img->Title = $img_title; - $img->write(); - } - - public function onBeforeWrite() - { - parent::onBeforeWrite(); - if(!$this->hasFLV()) - $this->createFLV(); - if(!$this->getThumbnail()) - $this->createThumbnail(); - } - - - public function Player($width = null, $height = null) - { - if($width === null) $width = self::$video_width; - if($height === null) $height = self::$video_height; - $image = ($thumb = $this->VideoThumbnail()) ? $thumb->URL : ""; - self::$player_count++; - Requirements::javascript('dataobject_manager/code/flv/swfobject.js'); - Requirements::customScript(sprintf( - "swfobject.embedSWF('%s','player-%s','%d','%d','9.0.0','expressInstall.swf',{file : '%s',image : '%s'},{allowscriptaccess : 'true', allowfullscreen : '%s'})", - $this->SWFLink(), - self::$player_count, - $width, - $height, - $this->FLVLink(), - $image, - $this->AllowFullScreen() - ) - ); - return "
Loading...
"; - } - - - public function forTemplate() - { - return $this->Player(); - } - - public function VideoThumbnail() - { - if(self::has_ffmpeg() && !$img = $this->getThumbnail()) - $this->createThumbnail(); - $img = $this->getThumbnail(); - return $img ? $img : $this->default_thumbnail(); - - } - - /** - * SSViewer doesn't accept more than two arguments for template - * functions. Here's a hack. If an arg is, e.g. 200x400 it will - * split that into width/height for thumb for first arg, and popup - * for second arg. - * - * Examples: - * $VideoPopup(450,200) : Returns a video popup with thumbnail - * 450 width, 200 height. Popup is default dimensions - * - * $VideoPopup(450x200,800x600) : Returns a video popup with thumbnail - * 450 width, 200 height. Popup is 800 width, 600 height. - * - * $VideoPopup(450x200) : Same as first example. - * - */ - public function VideoPopup($arg1 = null, $arg2 = null) - { - $popup_width = null; - $popup_height = null; - if($arg1 !== null && stristr($arg1,"x")) - list($thumb_width,$thumb_height) = explode("x",$arg1); - else - $thumb_width = $arg1; - - if($arg2 !== null && stristr($arg2,"x")) - list($popup_width,$popup_height) = explode("x",$arg2); - else - $thumb_height = $arg2; - - if($popup_width === null) $popup_width = self::$default_popup_width; - if($popup_height === null) $popup_height = self::$default_popup_height; - - return $this->customise(array( - 'PopupWidth' => $popup_width, - 'PopupHeight' => $popup_height, - 'ThumbWidth' => $thumb_width, - 'ThumbHeight' => $thumb_height, - 'Title' => $this->Title, - 'Link' => $this->FLVLink(), - 'Thumbnail' => $this->VideoThumbnail()->CroppedImage($thumb_width, $thumb_height), - 'PlayButton' => self::$play_button_overlay - ))->renderWith(array('FLVpopup')); - - } -} - - -?> \ No newline at end of file diff --git a/code/flv/FLVpopup.ss b/code/flv/FLVpopup.ss deleted file mode 100644 index 5b56068..0000000 --- a/code/flv/FLVpopup.ss +++ /dev/null @@ -1,10 +0,0 @@ -<% require css(dataobject_manager/code/flv/shadowbox/shadowbox.css) %> -<% require javascript(sapphire/thirdparty/jquery/jquery.js) %> -<% require javascript(dataobject_manager/code/flv/shadowbox/shadowbox.js) %> -<% require javascript(dataobject_manager/code/flv/shadowbox_init.js) %> -<% require css(dataobject_manager/code/flv/css/flv.css) %> - - - <% if PlayButton %>Play<% end_if %> - $Thumbnail - \ No newline at end of file diff --git a/code/flv/css/flv.css b/code/flv/css/flv.css deleted file mode 100644 index 11185f7..0000000 --- a/code/flv/css/flv.css +++ /dev/null @@ -1,2 +0,0 @@ -.flv-popup {position:relative;display:block;} -.flv-popup span {display:block;text-indent:-9999em;height:48px;width:48px;background:transparent url(../images/play.png) no-repeat top left !important;position:absolute;top:50%;left:50%;margin:-24px 0 0 -24px;} \ No newline at end of file diff --git a/code/flv/ffmpeg_log.txt b/code/flv/ffmpeg_log.txt deleted file mode 100644 index 3052073..0000000 --- a/code/flv/ffmpeg_log.txt +++ /dev/null @@ -1,12 +0,0 @@ -[2011-08-25 15:32:25] ffmpeg -[2011-08-25 15:32:26] sh: ffmpeg: command not found - -[2011-08-25 15:32:46] ffmpeg -[2011-08-25 15:32:46] sh: ffmpeg: command not found - -[2011-08-25 15:36:23] ffmpeg -[2011-08-25 15:36:23] sh: ffmpeg: command not found - -[2011-08-25 16:59:48] ffmpeg -[2011-08-25 16:59:49] sh: ffmpeg: command not found - diff --git a/code/flv/images/default_video.gif b/code/flv/images/default_video.gif deleted file mode 100644 index 69c44e1..0000000 Binary files a/code/flv/images/default_video.gif and /dev/null differ diff --git a/code/flv/images/default_video.png b/code/flv/images/default_video.png deleted file mode 100644 index e655227..0000000 Binary files a/code/flv/images/default_video.png and /dev/null differ diff --git a/code/flv/images/play.png b/code/flv/images/play.png deleted file mode 100644 index 1a9b595..0000000 Binary files a/code/flv/images/play.png and /dev/null differ diff --git a/code/flv/player.swf b/code/flv/player.swf deleted file mode 100644 index a063c48..0000000 Binary files a/code/flv/player.swf and /dev/null differ diff --git a/code/flv/shadowbox/CHANGELOG b/code/flv/shadowbox/CHANGELOG deleted file mode 100644 index 7a031e7..0000000 --- a/code/flv/shadowbox/CHANGELOG +++ /dev/null @@ -1,25 +0,0 @@ -Shadowbox.js Changelog - -version 3.0 - -- A major rewrite/reorganization of the code -- Greatly simplified setup process by eliminating all load* methods and using - options to specify language/adapter/player(s) instead -- Separated Shadowbox skin into its own class (Shadowbox.skin) that should - simplify skin customization -- Made public many methods and properties that had previously been private and - eliminated redundant accessor methods (such as getVersion, getPlugins, etc.) -- Introduced dependence on swfobject version 2 for Flash embedding. Included - support for express install -- Added flashVersion, flashVars, and flashParams options for passing options - directly to swfobject -- Added support for loading Shadowbox onDOMReady instead of waiting for - window.onload -- Added support for Internet Explorer 8 -- Switched from PHP to Ruby's rake for build/packaging system -- Introduced Shadowbox.js License version 1.0 -- Numerous other bug fixes and overall speed improvements - -versions 1.0-2.0 - -- Was too lazy (or too disorganized) to keep a detailed log of changes :) \ No newline at end of file diff --git a/code/flv/shadowbox/LICENSE b/code/flv/shadowbox/LICENSE deleted file mode 100644 index 1538183..0000000 --- a/code/flv/shadowbox/LICENSE +++ /dev/null @@ -1,48 +0,0 @@ -Copyright 2007-2009 Michael J. I. Jackson -http://mjijackson.com -All rights reserved. - -Shadowbox.js License version 1.0 - -This license is applicable to version 3.0 of the code and greater until superseded -by a later version. - -Shadowbox.js is available for use under the terms of two separate, yet similar -licenses. The first of these may be exercised by individuals and organizations -who employ the software for non-commercial uses. This license grants the licensee -the following privileges: - - - Use - - The software, including code, images, and documentation may be used in a web - site or application that is not used for commercial purposes. - - - Modification - - The software, including code, images, and documentation may be modified by the - user to suit his purpose. - -The second type of license may be obtained for a fee from the copyright holder and -removes the non-commercial restriction from the terms of use. This commercial -license may be obtained for one developer or multiple developers in the same -organization or company. - -Under neither license is the licensee permitted to redistribute the source code, -images, or documentation contained in this project. All redistribution rights -remain with the copyright holder unless specific prior written permission is -obtained. - -Under no circumstance shall this copyright notice or list of conditions be -modified or removed from the code distribution in either source or binary form. - -This software is provided by the copyright holder and contributors "as is" and -any express or implied warranties, including, but not limited to, the implied -warranties of merchantability and fitness for a particular purpose are disclaimed. - -In no event shall the copyright holder or contributors be liable for any direct, -indirect, incidental, special, exemplary, or consequential damages (including, but -not limited to, procurement of substitute goods or services; loss of use, data, or -profits; or business interruption) however caused and on any theory of liability, -whether in contract, strict liability, or tort (including negligence or otherwise) -arising in any way out of the use of this software, even if advised of the -possibility of such damage. diff --git a/code/flv/shadowbox/README b/code/flv/shadowbox/README deleted file mode 100644 index 959f5c6..0000000 --- a/code/flv/shadowbox/README +++ /dev/null @@ -1,14 +0,0 @@ -Shadowbox is an online media viewing application that supports all of the web's -most popular media publishing formats. Shadowbox is written entirely in -JavaScript and CSS and is highly customizable. Using Shadowbox, website authors -can display a wide assortment of media in all major browsers without navigating -users away from the linking page. - -You should have received a license with this distribution explaining the terms -under which Shadowbox may be used. If you did not, you may obtain a copy of the -license at http://shadowbox-js.com/license.txt - -Author: Michael J. I. Jackson -Copyright: 2007-2009 Michael J. I. Jackson, all rights reserved. - -You can view a demonstration of Shadowbox at http://shadowbox-js.com/ diff --git a/code/flv/shadowbox/adapters/README b/code/flv/shadowbox/adapters/README deleted file mode 100644 index 5083961..0000000 --- a/code/flv/shadowbox/adapters/README +++ /dev/null @@ -1,11 +0,0 @@ -A Shadowbox "adapter" is a small helper file that makes it easy to use -Shadowbox with a given JavaScript framework. Since most JavaScript frameworks -tend to contain a basic set of very similar functions (for retrieving style -information on elements or handling events, for example) it is not necessary to -tie Shadowbox to a particular framework. Instead, the adapter can use the -underlying framework that is already loaded on the page to reuse some of the -code. - -If you do not see an adapter for your favorite framework in this directory, feel -free to create your own and implement the same interface as the others. It may -then be used the same as you would use any other. diff --git a/code/flv/shadowbox/adapters/shadowbox-base.js b/code/flv/shadowbox/adapters/shadowbox-base.js deleted file mode 100644 index bfe0573..0000000 --- a/code/flv/shadowbox/adapters/shadowbox-base.js +++ /dev/null @@ -1 +0,0 @@ -if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox adapter, Shadowbox not found"}Shadowbox.lib=function(){var b=Shadowbox.client,a=document.defaultView,d;if(b.isIE6){d=[];function c(){var h;for(var g=0,f=d.length;g<\/script>");document.getElementById("__onDOMReady").onreadystatechange=function(){if(this.readyState=="complete"){this.onreadystatechange=null;a()}}}Shadowbox.lib.addEvent(window,"load",a)})(); \ No newline at end of file diff --git a/code/flv/shadowbox/adapters/shadowbox-dojo.js b/code/flv/shadowbox/adapters/shadowbox-dojo.js deleted file mode 100644 index f264c9b..0000000 --- a/code/flv/shadowbox/adapters/shadowbox-dojo.js +++ /dev/null @@ -1 +0,0 @@ -if(typeof dojo=="undefined"){throw"Unable to load Shadowbox adapter, Dojo not found"}if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox adapter, Shadowbox not found"}Shadowbox.lib=function(){var a=[];return{getStyle:function(c,b){return dojo.style(c,b)},remove:function(b){dojo._destroyElement(b)},getTarget:function(b){return b.target},getPageXY:function(b){return[b.pageX,b.pageY]},preventDefault:function(b){b.preventDefault()},keyCode:function(b){return b.keyCode},addEvent:function(e,b,d){var c=dojo.connect(e,b,d);a.push({el:e,name:b,handle:c})},removeEvent:function(d,b,c){dojo.forEach(a,function(f,e){if(f&&f.el==d&&f.name==b){dojo.disconnect(f.handle);a[e]=null}})},append:function(d,c){if(d.insertAdjacentHTML){d.insertAdjacentHTML("BeforeEnd",c)}else{if(d.lastChild){var b=d.ownerDocument.createRange();b.setStartAfter(d.lastChild);var e=b.createContextualFragment(c);d.appendChild(e)}else{d.innerHTML=c}}}}}();dojo.addOnLoad(Shadowbox.load); \ No newline at end of file diff --git a/code/flv/shadowbox/adapters/shadowbox-ext.js b/code/flv/shadowbox/adapters/shadowbox-ext.js deleted file mode 100644 index e88063b..0000000 --- a/code/flv/shadowbox/adapters/shadowbox-ext.js +++ /dev/null @@ -1 +0,0 @@ -if(typeof Ext=="undefined"){throw"Unable to load Shadowbox adapter, Ext not found"}if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox adapter, Shadowbox not found"}Shadowbox.lib=function(){var a=Ext.lib.Event;return{getStyle:function(c,b){return Ext.get(c).getStyle(b)},remove:function(b){Ext.get(b).remove()},getTarget:function(b){return a.getTarget(b)},getPageXY:function(b){return[a.getPageX(b),a.getPageY(b)]},preventDefault:function(b){a.preventDefault(b)},keyCode:function(b){return a.getCharCode(b)},addEvent:function(d,b,c){a.addListener(d,b,c)},removeEvent:function(d,b,c){a.removeListener(d,b,c)},append:function(c,b){Ext.DomHelper.append(c,b)}}}();Ext.onReady(Shadowbox.load); \ No newline at end of file diff --git a/code/flv/shadowbox/adapters/shadowbox-jquery.js b/code/flv/shadowbox/adapters/shadowbox-jquery.js deleted file mode 100644 index a0965a4..0000000 --- a/code/flv/shadowbox/adapters/shadowbox-jquery.js +++ /dev/null @@ -1 +0,0 @@ -if(typeof jQuery=="undefined"){throw"Unable to load Shadowbox adapter, jQuery not found"}if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox adapter, Shadowbox not found"}Shadowbox.lib=function(a){return{getStyle:function(c,b){return a(c).css(b)},remove:function(b){a(b).remove()},getTarget:function(b){return b.target},getPageXY:function(b){return[b.pageX,b.pageY]},preventDefault:function(b){b.preventDefault()},keyCode:function(b){return b.keyCode},addEvent:function(d,b,c){a(d).bind(b,c)},removeEvent:function(d,b,c){a(d).unbind(b,c)},append:function(c,b){a(c).append(b)}}}(jQuery);jQuery(Shadowbox.load);(function(a){a.fn.shadowbox=function(b){return this.each(function(){var d=a(this);var e=a.extend({},b||{},a.metadata?d.metadata():a.meta?d.data():{});var c=this.className||"";e.width=parseInt((c.match(/w:(\d+)/)||[])[1])||e.width;e.height=parseInt((c.match(/h:(\d+)/)||[])[1])||e.height;Shadowbox.setup(d,e)})}})(jQuery); \ No newline at end of file diff --git a/code/flv/shadowbox/adapters/shadowbox-mootools.js b/code/flv/shadowbox/adapters/shadowbox-mootools.js deleted file mode 100644 index 58c0015..0000000 --- a/code/flv/shadowbox/adapters/shadowbox-mootools.js +++ /dev/null @@ -1 +0,0 @@ -if(typeof MooTools=="undefined"){throw"Unable to load Shadowbox adapter, MooTools not found"}if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox adapter, Shadowbox not found"}Shadowbox.lib={getStyle:function(b,a){return $(b).getStyle(a)},remove:function(a){a.parentNode.removeChild(a)},getTarget:function(a){return a.target},getPageXY:function(a){return[a.page.x,a.page.y]},preventDefault:function(a){a.preventDefault()},keyCode:function(a){return a.code},addEvent:function(c,a,b){$(c).addEvent(a,b)},removeEvent:function(c,a,b){$(c).removeEvent(a,b)},append:function(c,b){if(c.insertAdjacentHTML){c.insertAdjacentHTML("BeforeEnd",b)}else{if(c.lastChild){var a=c.ownerDocument.createRange();a.setStartAfter(c.lastChild);var d=a.createContextualFragment(b);c.appendChild(d)}else{c.innerHTML=b}}}};window.addEvent("domready",Shadowbox.load); \ No newline at end of file diff --git a/code/flv/shadowbox/adapters/shadowbox-prototype.js b/code/flv/shadowbox/adapters/shadowbox-prototype.js deleted file mode 100644 index 637dd87..0000000 --- a/code/flv/shadowbox/adapters/shadowbox-prototype.js +++ /dev/null @@ -1 +0,0 @@ -if(typeof Prototype=="undefined"){throw"Unable to load Shadowbox adapter, Prototype not found"}if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox adapter, Shadowbox not found"}Shadowbox.lib={getStyle:function(b,a){return Element.getStyle(b,a)},remove:function(a){Element.remove(a)},getTarget:function(a){return Event.element(a)},getPageXY:function(b){var a=Event.pointer(b);return[a.x,a.y]},preventDefault:function(a){Event.stop(a)},keyCode:function(a){return a.keyCode},addEvent:function(c,a,b){Event.observe(c,a,b)},removeEvent:function(c,a,b){Event.stopObserving(c,a,b)},append:function(b,a){Element.insert(b,a)}};document.observe("dom:loaded",Shadowbox.load); \ No newline at end of file diff --git a/code/flv/shadowbox/adapters/shadowbox-yui.js b/code/flv/shadowbox/adapters/shadowbox-yui.js deleted file mode 100644 index f045d76..0000000 --- a/code/flv/shadowbox/adapters/shadowbox-yui.js +++ /dev/null @@ -1 +0,0 @@ -if(typeof YAHOO=="undefined"){throw"Unable to load Shadowbox adapter, YAHOO not found"}if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox adapter, Shadowbox not found"}Shadowbox.lib=function(){var a=YAHOO.util.Event;var b=YAHOO.util.Dom;return{getStyle:function(d,c){return b.getStyle(d,c)},remove:function(c){c.parentNode.removeChild(c)},getTarget:function(c){return a.getTarget(c)},getPageXY:function(c){return[a.getPageX(c),a.getPageY(c)]},preventDefault:function(c){a.preventDefault(c)},keyCode:function(c){return c.keyCode},addEvent:function(e,c,d){a.addListener(e,c,d)},removeEvent:function(e,c,d){a.removeListener(e,c,d)},append:function(e,d){if(e.insertAdjacentHTML){e.insertAdjacentHTML("BeforeEnd",d)}else{if(e.lastChild){var c=e.ownerDocument.createRange();c.setStartAfter(e.lastChild);var f=c.createContextualFragment(d);e.appendChild(f)}else{e.innerHTML=d}}}}}();YAHOO.util.Event.onDOMReady(Shadowbox.load); \ No newline at end of file diff --git a/code/flv/shadowbox/languages/README b/code/flv/shadowbox/languages/README deleted file mode 100644 index 3573cc3..0000000 --- a/code/flv/shadowbox/languages/README +++ /dev/null @@ -1,12 +0,0 @@ -The Shadowbox language files in this directory contain translations of several -simple phrases that are useful in helping users navigate the Shadowbox interface -and obtain plugins when necessary. - -If you do not see the language you would like to use represented here, please -feel free to create your own translation. Since the English file is the original -you will probably want to base your translation on it. - -You should name the file with a suffix that corresponds to the language code -found in the GNU documentation: - -http://www.gnu.org/software/gettext/manual/gettext.html#Usual-Language-Codes diff --git a/code/flv/shadowbox/languages/shadowbox-ar.js b/code/flv/shadowbox/languages/shadowbox-ar.js deleted file mode 100644 index 65b9a3f..0000000 --- a/code/flv/shadowbox/languages/shadowbox-ar.js +++ /dev/null @@ -1 +0,0 @@ -if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox language file, Shadowbox not found."}Shadowbox.lang={code:"ar",of:"من",loading:"جار التحميل",cancel:"خروج",next:"التالى",previous:"السابق",play:"بدء",pause:"ايقاف",close:"اغلاق",errors:{single:'يجب ان تقوم بتنصيب اضافة المتصفح {1} لعرض هذا المحتوى.',shared:'يجب ان تقوم بتنصيب الاضافتين {1} و {3}للمتصفح لعرض هذا المحتوى.',either:'يجب ان قوم بتنصيب اما الاضافة التاليى {1} او {3} للمتصفح لعرض هذا المحتوى.'}}; \ No newline at end of file diff --git a/code/flv/shadowbox/languages/shadowbox-ca.js b/code/flv/shadowbox/languages/shadowbox-ca.js deleted file mode 100644 index 6b02d92..0000000 --- a/code/flv/shadowbox/languages/shadowbox-ca.js +++ /dev/null @@ -1 +0,0 @@ -if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox language file, Shadowbox not found."}Shadowbox.lang={code:"ca",of:"de",loading:"carregant",cancel:"Cancel·la",next:"Següent",previous:"Anterior",play:"Reprodueix",pause:"Pausa",close:"Tanca",errors:{single:'Heu d\'instal·lar el complement {1} al vostre navegador per veure el contingut.',shared:'Heu d\'instal·lar els complements {1} i {3} al vostre navegador per veure el contingut.',either:'Heu d\'instal·lar el complement {1} o el complement {3} al vostre navegador per veure el contingut.'}}; \ No newline at end of file diff --git a/code/flv/shadowbox/languages/shadowbox-cs.js b/code/flv/shadowbox/languages/shadowbox-cs.js deleted file mode 100644 index c1743a8..0000000 --- a/code/flv/shadowbox/languages/shadowbox-cs.js +++ /dev/null @@ -1 +0,0 @@ -if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox language file, Shadowbox not found."}Shadowbox.lang={code:"cs",of:"z(e)",loading:"nahrávám",cancel:"Zrušit",next:"Další",previous:"Předchozí",play:"Přehrát",pause:"Pauza",close:"Zavřít",errors:{single:'Pro správné zobrazení je potřeba nainstalovat tento zásuvný modul do Vašeho prohlížeče: {1}.',shared:'Pro správné zobrazení je potřeba nainstalovat oba tyto zásuvné moduly do Vašeho prohlížeče: {1} a {3}.',either:'Pro správné zobrazení je potřeba do Vašeho prohlížeče nainstalovat jeden z následujících zásuvných modulů: {1} nebo {3}.'}}; \ No newline at end of file diff --git a/code/flv/shadowbox/languages/shadowbox-de-CH.js b/code/flv/shadowbox/languages/shadowbox-de-CH.js deleted file mode 100644 index 3774b38..0000000 --- a/code/flv/shadowbox/languages/shadowbox-de-CH.js +++ /dev/null @@ -1 +0,0 @@ -if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox language file, Shadowbox not found."}Shadowbox.lang={code:"de-CH",of:"von",loading:"lade",cancel:"Abbrechen",next:"weiter",previous:"zurück",play:"Abspielen",pause:"Pause",close:"Schliessen",errors:{single:'Um den Inhalt anzeigen zu können muss die Browser-Erweiterung {1} installiert werden.',shared:'Um den Inhalt anzeigen zu können müssen die beiden Browser-Erweiterungen {1} und {3} installiert werden.',either:'Um den Inhalt anzeigen zu können muss eine der beiden Browser-Erweiterungen {1} oder {3} installiert werden.'}}; \ No newline at end of file diff --git a/code/flv/shadowbox/languages/shadowbox-de-DE.js b/code/flv/shadowbox/languages/shadowbox-de-DE.js deleted file mode 100644 index 48f8292..0000000 --- a/code/flv/shadowbox/languages/shadowbox-de-DE.js +++ /dev/null @@ -1 +0,0 @@ -if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox language file, Shadowbox not found."}Shadowbox.lang={code:"de",of:"von",loading:"ladend",cancel:"Abbrechen",next:"Nächste",previous:"Vorige",play:"Abspielen",pause:"Pause",close:"Schließen",errors:{single:'Um den Inhalt anzeigen zu können muss die Browser-Erweiterung {1} installiert werden.',shared:'Um den Inhalt anzeigen zu können müssen die beiden Browser-Erweiterungen {1} und {3} installiert werden.',either:'Um den Inhalt anzeigen zu können muss eine der beiden Browser-Erweiterungen {1} oder {3} installiert werden.'}}; \ No newline at end of file diff --git a/code/flv/shadowbox/languages/shadowbox-en.js b/code/flv/shadowbox/languages/shadowbox-en.js deleted file mode 100644 index 15d82e5..0000000 --- a/code/flv/shadowbox/languages/shadowbox-en.js +++ /dev/null @@ -1 +0,0 @@ -if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox language file, Shadowbox not found."}Shadowbox.lang={code:"en",of:"of",loading:"loading",cancel:"Cancel",next:"Next",previous:"Previous",play:"Play",pause:"Pause",close:"Close",errors:{single:'You must install the {1} browser plugin to view this content.',shared:'You must install both the {1} and {3} browser plugins to view this content.',either:'You must install either the {1} or the {3} browser plugin to view this content.'}}; \ No newline at end of file diff --git a/code/flv/shadowbox/languages/shadowbox-es.js b/code/flv/shadowbox/languages/shadowbox-es.js deleted file mode 100644 index 915ccc8..0000000 --- a/code/flv/shadowbox/languages/shadowbox-es.js +++ /dev/null @@ -1 +0,0 @@ -if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox language file, Shadowbox not found."}Shadowbox.lang={code:"es",of:"de",loading:"cargando",cancel:"Cancelar",next:"Siguiente",previous:"Anterior",play:"Reproducir",pause:"Pausa",close:"Cerrar",errors:{single:'Debes instalar el plugin {1} en el navegador para ver este contenido.',shared:'Debes instalar el {1} y el {3} en el navegador para ver este contenido.',either:'Debes instalar o bien el {1} o el {3} en el navegador para ver este contenido.'}}; \ No newline at end of file diff --git a/code/flv/shadowbox/languages/shadowbox-et.js b/code/flv/shadowbox/languages/shadowbox-et.js deleted file mode 100644 index fcbeda8..0000000 --- a/code/flv/shadowbox/languages/shadowbox-et.js +++ /dev/null @@ -1 +0,0 @@ -if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox language file, Shadowbox not found."}Shadowbox.lang={code:"et",of:"/",loading:"laen",cancel:"Katkesta",next:"Järgmine",previous:"Eelmine",play:"Start",pause:"Paus",close:"Sulge",errors:{single:'Lehekülje vaatamiseks installeerige browser\'i plugin {1}.',shared:'Lehekülje vaatamiseks installeerige plugin\'id {1} ja {3}.',either:'Lehekülje vaatamiseks installeerige kas {1} või {3} plugin.'}}; \ No newline at end of file diff --git a/code/flv/shadowbox/languages/shadowbox-fi.js b/code/flv/shadowbox/languages/shadowbox-fi.js deleted file mode 100644 index 9f0ceb7..0000000 --- a/code/flv/shadowbox/languages/shadowbox-fi.js +++ /dev/null @@ -1 +0,0 @@ -if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox language file, Shadowbox not found."}Shadowbox.lang={code:"fi",of:"/",loading:"ladataan",cancel:"Peruuta",next:"Seuraava",previous:"Edellinen",play:"Toista",pause:"Pysäytä",close:"Sulje",errors:{single:'Sinun on asennettava {1} nähdäksesi sisällön.',shared:'Sinun on asennettava {1} - ja {3} selainlaajennukset nähdäksesi sisällön.',either:'Sinun on asennetteva joko {1} tai {3} selainlaajennus nähdäksesi sisällön.'}}; \ No newline at end of file diff --git a/code/flv/shadowbox/languages/shadowbox-fr.js b/code/flv/shadowbox/languages/shadowbox-fr.js deleted file mode 100644 index c9fb477..0000000 --- a/code/flv/shadowbox/languages/shadowbox-fr.js +++ /dev/null @@ -1 +0,0 @@ -if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox language file, Shadowbox not found."}Shadowbox.lang={code:"fr",of:"sur",loading:"chargement",cancel:"Annuler",next:"Suivant",previous:"Précédent",play:"Lire",pause:"Pause",close:"Fermer",errors:{single:'Vous devez installer le plugin {1} pour afficher ce contenu.',shared:'Vous devez installer les plugins {1} et {3} pour afficher ce contenu.',either:'Vous devez installer le plugin {1} ou {3} pour afficher ce contenu.'}}; \ No newline at end of file diff --git a/code/flv/shadowbox/languages/shadowbox-gl.js b/code/flv/shadowbox/languages/shadowbox-gl.js deleted file mode 100644 index 8c6ac4f..0000000 --- a/code/flv/shadowbox/languages/shadowbox-gl.js +++ /dev/null @@ -1 +0,0 @@ -if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox language file, Shadowbox not found."}Shadowbox.lang={code:"gl",of:"de",loading:"cargando",cancel:"Cancelar",next:"Seguinte",previous:"Anterior",play:"Reproducir",pause:"Pausa",close:"Pechar",errors:{single:'É necesario instalar o plugin {1} para visualizar este contido.',shared:'É necesario instalar os plugins {1} e {3} para visualizar este contido.',either:'É necesario instalar o plugin {1} ou o plugin {3} para visualizar este contido.'}}; \ No newline at end of file diff --git a/code/flv/shadowbox/languages/shadowbox-he.js b/code/flv/shadowbox/languages/shadowbox-he.js deleted file mode 100644 index 96f0246..0000000 --- a/code/flv/shadowbox/languages/shadowbox-he.js +++ /dev/null @@ -1 +0,0 @@ -if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox language file, Shadowbox not found."}Shadowbox.lang={code:"he",of:"מתוך",loading:"טוען",cancel:"ביטול",next:"הבא",previous:"הקודם",play:"נגן",pause:"השהה",close:"סגור",errors:{single:'על גבי הדפדפן על מנת לצפות בתוכן{1} עליך להתקין את התקן ה.',shared:'על גבי הדפדפן על מנת לצפות בתוכן {1} and {3} עליך להתקין את שני ההתקנים.',either:'על מנת לצפות בתוכן {1} או {3} עליך להתקין התקן.'}}; \ No newline at end of file diff --git a/code/flv/shadowbox/languages/shadowbox-hu.js b/code/flv/shadowbox/languages/shadowbox-hu.js deleted file mode 100644 index 116c724..0000000 --- a/code/flv/shadowbox/languages/shadowbox-hu.js +++ /dev/null @@ -1 +0,0 @@ -if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox language file, Shadowbox not found."}Shadowbox.lang={code:"hu",of:"/",loading:"Betlts",cancel:"Mgse",next:"Kvetkez",previous:"Elz",play:"Lejtszs",pause:"Sznet",close:"Bezrs",errors:{single:'A tartalom megjelentshez a kvetkez bvtmny szksges: {1}.',shared:'A tartalom megjelentshez a kvetkez kt bvtmny szksges: {1}, {3}.',either:'A tartalom megjelentshez a kvetkez bvtmnyek valamelyikt teleptenie kell: {1} vagy {3}.'}}; \ No newline at end of file diff --git a/code/flv/shadowbox/languages/shadowbox-id.js b/code/flv/shadowbox/languages/shadowbox-id.js deleted file mode 100644 index 98e80a0..0000000 --- a/code/flv/shadowbox/languages/shadowbox-id.js +++ /dev/null @@ -1 +0,0 @@ -if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox language file, Shadowbox not found."}Shadowbox.lang={code:"id",of:"dari",loading:"pengisian",cancel:"Batal",next:"Berikut",previous:"Sebelum",play:"Mainkan",pause:"Hentikan",close:"Tutup",errors:{single:'Anda harus memasang plugin browser {1} untuk melihat isi ini.',shared:'Anda harus memasang kedua plugin browser {1} dan {3} untuk melihat isi ini.',either:'Anda harus memasang plugin browser {1} atau {3} untuk melihat isi ini.'}}; \ No newline at end of file diff --git a/code/flv/shadowbox/languages/shadowbox-is.js b/code/flv/shadowbox/languages/shadowbox-is.js deleted file mode 100644 index 258c422..0000000 --- a/code/flv/shadowbox/languages/shadowbox-is.js +++ /dev/null @@ -1 +0,0 @@ -if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox language file, Shadowbox not found."}Shadowbox.lang={code:"is",of:"af",loading:"hleð",cancel:"Hætta",next:"Næsta",previous:"Fyrri",play:"Spila",pause:"Pása",close:"Loka",errors:{single:'Þú verður að setja inn ... {1} vafra íforritið til að skoða þetta efni.',shared:'Þú verður að setja inn bæði {1} og {3} vafra íforritin til að skoða þetta efni.',either:'Þú verður að setja inn annað hvort {1} eða {3} vafra íforritin til að skoða þetta efni.'}}; \ No newline at end of file diff --git a/code/flv/shadowbox/languages/shadowbox-it.js b/code/flv/shadowbox/languages/shadowbox-it.js deleted file mode 100644 index 9d55830..0000000 --- a/code/flv/shadowbox/languages/shadowbox-it.js +++ /dev/null @@ -1 +0,0 @@ -if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox language file, Shadowbox not found."}Shadowbox.lang={code:"it",of:"di",loading:"in caricamento",cancel:"Annulla",next:"Avanti",previous:"Indietro",play:"Play",pause:"Pausa",close:"Chiudi",errors:{single:'È necessario installare il plugin {1} per poter vedere questo contenuto.',shared:'È necessario installare i plugin {1} e {3} per poter vedere questo contenuto.',either:'È necessario installare o il plugin {1} o {3} per poter vedere questo contenuto.'}}; \ No newline at end of file diff --git a/code/flv/shadowbox/languages/shadowbox-ja.js b/code/flv/shadowbox/languages/shadowbox-ja.js deleted file mode 100644 index 81ad0b1..0000000 --- a/code/flv/shadowbox/languages/shadowbox-ja.js +++ /dev/null @@ -1 +0,0 @@ -if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox language file, Shadowbox not found."}Shadowbox.lang={code:"ja",of:"/",loading:"読込中",cancel:"取消",next:"次",previous:"前",play:"再生",pause:"一時停止",close:"閉じる",errors:{single:'このコンテンツを表示するにはプラグイン {1} を追加する必要があります。',shared:'このコンテンツを表示するにはプラグイン {1}{3} を追加する必要があります。',either:'このコンテンツを表示するにはプラグイン {1} または {3} を追加する必要があります。'}}; \ No newline at end of file diff --git a/code/flv/shadowbox/languages/shadowbox-ko.js b/code/flv/shadowbox/languages/shadowbox-ko.js deleted file mode 100644 index 62f3189..0000000 --- a/code/flv/shadowbox/languages/shadowbox-ko.js +++ /dev/null @@ -1 +0,0 @@ -if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox language file, Shadowbox not found."}Shadowbox.lang={code:"ko",of:"중",loading:"로딩 중",cancel:"취소",next:"다음",previous:"이전",play:"재생",pause:"잠시 멈춤",close:"닫기",errors:{single:'이 내용을 보려면 {1} 브라우저 플러그인을 설치하십시오.',shared:'이 내용을 보려면 {1} 와/과 {3} 브라우저 플러그인을 설치하십시오.',either:'이 내용을 보려면 {1} 또는 {3} 브라우저 플러그인을 설치하십시오.'}}; \ No newline at end of file diff --git a/code/flv/shadowbox/languages/shadowbox-my.js b/code/flv/shadowbox/languages/shadowbox-my.js deleted file mode 100644 index 3a2d6ad..0000000 --- a/code/flv/shadowbox/languages/shadowbox-my.js +++ /dev/null @@ -1 +0,0 @@ -if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox language file, Shadowbox not found."}Shadowbox.lang={code:"my",of:"",loading:"memuat turun",cancel:"Batal",next:"Seterusnya",previous:"Sebelum",play:"Mainkan",pause:"Hentikan",close:"Tutup",errors:{single:'Anda perlu memasang {1} plugin pelayar bagi melihat kandungan ini.',shared:'Anda perlu memasang kedua-dua {1} dan {3} plugin pelayar bagi melihat kandungan ini.',either:'Anda perlu memasang samada {1} atau {3} plugin pelayar bagi melihat kandungan ini.'}}; \ No newline at end of file diff --git a/code/flv/shadowbox/languages/shadowbox-nl.js b/code/flv/shadowbox/languages/shadowbox-nl.js deleted file mode 100644 index b0dcd0e..0000000 --- a/code/flv/shadowbox/languages/shadowbox-nl.js +++ /dev/null @@ -1 +0,0 @@ -if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox language file, Shadowbox not found."}Shadowbox.lang={code:"nl",of:"van",loading:"laden",cancel:"Annuleren",next:"Volgende",previous:"Vorige",play:"Play",pause:"Pause",close:"Sluiten",errors:{single:'U moet de {1} browser plugin installeren om dit media type te kunnen bekijken.',shared:'U moet de {1} en de {3} browser plugins installeren om dit media type te kunnen bekijken.',either:'U moet de {1} of de {3} browser plugin installeren om dit media type te kunnen bekijken.'}}; \ No newline at end of file diff --git a/code/flv/shadowbox/languages/shadowbox-no.js b/code/flv/shadowbox/languages/shadowbox-no.js deleted file mode 100644 index fcdf9c1..0000000 --- a/code/flv/shadowbox/languages/shadowbox-no.js +++ /dev/null @@ -1 +0,0 @@ -if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox language file, Shadowbox not found."}Shadowbox.lang={code:"no",of:"av",loading:"laster",cancel:"Avbryt",next:"Neste",previous:"Forrige",play:"Spill",pause:"Pause",close:"Lukk",errors:{single:'Du må installere {1} for å kunne se dette innholdet.',shared:'Du må installere både {1} og {3} for å kunne se dette innholdet.',either:'Du må enten installere {1} eller {3} for å kunne se dette innholdet.'}}; \ No newline at end of file diff --git a/code/flv/shadowbox/languages/shadowbox-pl.js b/code/flv/shadowbox/languages/shadowbox-pl.js deleted file mode 100644 index cb7a92a..0000000 --- a/code/flv/shadowbox/languages/shadowbox-pl.js +++ /dev/null @@ -1 +0,0 @@ -if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox language file, Shadowbox not found."}Shadowbox.lang={code:"pl",of:"z",loading:"wczytywanie",cancel:"Anuluj",next:"Dalej",previous:"Wróć",play:"Odtwarzaj",pause:"Pauza",close:"Zamknij",errors:{single:'Musisz zainstalować plugin {1} aby zobaczyć zawartość',shared:'Musisz zainstalować pluginy {1} i {3} aby zobaczyć zawartość ',either:'Musisz zainstalować plugin {1} lub {3} aby zobaczyć zawartość'}}; \ No newline at end of file diff --git a/code/flv/shadowbox/languages/shadowbox-pt-BR.js b/code/flv/shadowbox/languages/shadowbox-pt-BR.js deleted file mode 100644 index e4ee362..0000000 --- a/code/flv/shadowbox/languages/shadowbox-pt-BR.js +++ /dev/null @@ -1 +0,0 @@ -if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox language file, Shadowbox not found."}Shadowbox.lang={code:"pt-BR",of:"de",loading:"carregando",cancel:"Cancelar",next:"Próximo",previous:"Anterior",play:"Play",pause:"Pause",close:"Fechar",errors:{single:'Você precisa instalar o plugin {1} para visualizar o conteúdo.',shared:'Você precisa instalar os plugins {1} e {3}, para visualizar o conteúdo.',either:'Você precisa instalar o plugin {1} ou o plugin {3}, para visualizar o conteúdo.'}}; \ No newline at end of file diff --git a/code/flv/shadowbox/languages/shadowbox-pt-PT.js b/code/flv/shadowbox/languages/shadowbox-pt-PT.js deleted file mode 100644 index 99a42ab..0000000 --- a/code/flv/shadowbox/languages/shadowbox-pt-PT.js +++ /dev/null @@ -1 +0,0 @@ -if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox language file, Shadowbox not found."}Shadowbox.lang={code:"pt-PT",of:"de",loading:"A Carregar...",cancel:"Cancelar",next:"Seguinte",previous:"Anterior",play:"Reproduzir",pause:"Pausa",close:"Fechar",errors:{single:'É necessário instalar o plugin {1} para visualizar este conteúdo.',shared:'É necessário instalar os plugins {1} e {3} para visualizar este conteúdo.',either:'É necessário instalar o plugin {1} ou o plugin {3} para visualizar este conteúdo.'}}; \ No newline at end of file diff --git a/code/flv/shadowbox/languages/shadowbox-ro.js b/code/flv/shadowbox/languages/shadowbox-ro.js deleted file mode 100644 index 3609cb5..0000000 --- a/code/flv/shadowbox/languages/shadowbox-ro.js +++ /dev/null @@ -1 +0,0 @@ -if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox language file, Shadowbox not found."}Shadowbox.lang={code:"ro",of:"din",loading:"se incarca",cancel:"Revocare",next:"Inainte",previous:"Inapoi",play:"Ruleaza",pause:"Pauza",close:"Inchide",errors:{single:'Pentru a vizualiza acest continut trebuie sa instalati acest plugin {1}.',shared:'Pentru a vizualiza acest continut trebuie sa instalati pluginurile {1} si {3}.',either:'Pentru a vizualiza acest continut trebuie sa instalati pluginul {1} sau {3}.'}}; \ No newline at end of file diff --git a/code/flv/shadowbox/languages/shadowbox-ru.js b/code/flv/shadowbox/languages/shadowbox-ru.js deleted file mode 100644 index 3a3a18b..0000000 --- a/code/flv/shadowbox/languages/shadowbox-ru.js +++ /dev/null @@ -1 +0,0 @@ -if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox language file, Shadowbox not found."}Shadowbox.lang={code:"ru",of:"из",loading:"загрузка",cancel:"Отмена",next:"Следующая",previous:"Предыдущая",play:"Пуск",pause:"Пауза",close:"Закрыть",errors:{single:'Вы должны установить для браузера плагин {1}, чтобы просмотривать этот контент.',shared:'Чтобы просмотреть этот контент, вы должны установить и {1}, и {3}.',either:'Вы должны установить или {1} плагин, или {3}, чтобы просмотреть этот контент.'}}; \ No newline at end of file diff --git a/code/flv/shadowbox/languages/shadowbox-sk.js b/code/flv/shadowbox/languages/shadowbox-sk.js deleted file mode 100644 index e4d9ef6..0000000 --- a/code/flv/shadowbox/languages/shadowbox-sk.js +++ /dev/null @@ -1 +0,0 @@ -if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox language file, Shadowbox not found."}Shadowbox.lang={code:"sk",of:"z",loading:"Načítava",cancel:"Zruš",next:"Ďalej",previous:"Predchádzjúci",play:"Prehraj",pause:"Zastav",close:"Zavrieť",errors:{single:'Na prezeranie obsahu je potrebné nainštalovať tento plugin {1} do prehľiadača.',shared:'Na prezeranie obsahu je potrebné nainštalovať tieto pluginy {1} a {3} do prehľiadača.',either:'Na prezeranie obsahu je potrebné nainštalovať niektorý z týchto pluginov {1} alebo {3} do prehľiadača.'}}; \ No newline at end of file diff --git a/code/flv/shadowbox/languages/shadowbox-sv.js b/code/flv/shadowbox/languages/shadowbox-sv.js deleted file mode 100644 index 4cb35a2..0000000 --- a/code/flv/shadowbox/languages/shadowbox-sv.js +++ /dev/null @@ -1 +0,0 @@ -if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox language file, Shadowbox not found."}Shadowbox.lang={code:"sv",of:"av",loading:"laddar",cancel:"Avbryt",next:"Nästa",previous:"Föregående",play:"Spela",pause:"Pausa",close:"Stäng",errors:{single:'Du måste installera insticksprogrammet {1} för att kunna visa innehållet.',shared:'Du måste installera både insticksprogram {1} och {3} för att kunna visa innehållet.',either:'Du måste installera antingen insticksprogram {1}, eller {3} för att kunna visa innehållet.'}}; \ No newline at end of file diff --git a/code/flv/shadowbox/languages/shadowbox-tr.js b/code/flv/shadowbox/languages/shadowbox-tr.js deleted file mode 100644 index 3e8306e..0000000 --- a/code/flv/shadowbox/languages/shadowbox-tr.js +++ /dev/null @@ -1 +0,0 @@ -if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox language file, Shadowbox not found."}Shadowbox.lang={code:"tr",of:"/",loading:"yükleniyor",cancel:"İptal",next:"Sonraki",previous:"Önceki",play:"Oynat",pause:"Durdur",close:"Kapat",errors:{single:'Bu içeriği görmek için {1} eklentisini kurmanız gerekiyor.',shared:'Bu içeriği görmek için {1} ve {3} eklentilerini kurmanız gerekiyor.',either:'Bu içeriği görmek için {1} veya {3} eklentilerinden birini kurmanız gerekiyor.'}}; \ No newline at end of file diff --git a/code/flv/shadowbox/languages/shadowbox-zh-CN.js b/code/flv/shadowbox/languages/shadowbox-zh-CN.js deleted file mode 100644 index dbc4bbf..0000000 --- a/code/flv/shadowbox/languages/shadowbox-zh-CN.js +++ /dev/null @@ -1 +0,0 @@ -if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox language file, Shadowbox not found."}Shadowbox.lang={code:"zh-CN",of:"的",loading:"读取中",cancel:"取消",next:"下一页",previous:"上一页",play:"执行",pause:"暂停",close:"关闭",errors:{single:'您必须安装 {1} 这个浏览外挂程式才能检视这里的内容。',shared:'您必须安装 {1}{3} 这两个浏览外挂程式才能检视这里的内容。',either:'您必须安装 {1} 或者是 the {3} 这两个其中一个浏览外挂程式才能检视这里的内容。'}}; \ No newline at end of file diff --git a/code/flv/shadowbox/languages/shadowbox-zh-TW.js b/code/flv/shadowbox/languages/shadowbox-zh-TW.js deleted file mode 100644 index f4046e4..0000000 --- a/code/flv/shadowbox/languages/shadowbox-zh-TW.js +++ /dev/null @@ -1 +0,0 @@ -if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox language file, Shadowbox not found."}Shadowbox.lang={code:"zh-TW",of:"的",loading:"讀取中",cancel:"取消",next:"下一頁",previous:"上一頁",play:"執行",pause:"暫停",close:"關閉",errors:{single:'您必須安裝 {1} 這個瀏覽外掛程式才能檢視這裡的內容。',shared:'您必須安裝 {1} 這兩個瀏覽外掛程式才能檢視這裡的內容。',either:'您必須安裝 {1} 或者是 the {3} 這兩個其中一個瀏覽外掛程式才能檢視這裡的內容。'}}; \ No newline at end of file diff --git a/code/flv/shadowbox/libraries/mediaplayer/player.swf b/code/flv/shadowbox/libraries/mediaplayer/player.swf deleted file mode 100644 index a063c48..0000000 Binary files a/code/flv/shadowbox/libraries/mediaplayer/player.swf and /dev/null differ diff --git a/code/flv/shadowbox/libraries/mediaplayer/preview.jpg b/code/flv/shadowbox/libraries/mediaplayer/preview.jpg deleted file mode 100644 index 6e9d818..0000000 Binary files a/code/flv/shadowbox/libraries/mediaplayer/preview.jpg and /dev/null differ diff --git a/code/flv/shadowbox/libraries/mediaplayer/readme.html b/code/flv/shadowbox/libraries/mediaplayer/readme.html deleted file mode 100644 index 67dfe89..0000000 --- a/code/flv/shadowbox/libraries/mediaplayer/readme.html +++ /dev/null @@ -1,77 +0,0 @@ - - - - - JW Player for Flash - - - - - - -

Example

-

Thanks for downloading! Below you see a simple embedded example of the JW Player. Copy-paste the source code and put the SWF, JS and FLV file on your site to get started.

- - - - - - - - - - - - - - - - - - - - -

Get Flash to see this player.

-
-
- - - - - - -

Licensing

-

The player is licensed under a Creative Commons License. It allows you to use, modify and redistribute the script, but only for noncommercial purposes. For corporate use, please apply for a commercial license.

- -

Quickstart

-

The easiest way to get to know the player is by using the setup wizard. Select an example, set the file or playlist you want to play and copy-paste the embed code to your site. If you want to play Youtube content in the player, you also have to copy the yt.swf file along with the player.swf.

- -

If you need any help, please visit our extensive support section, including FAQs, a string of tutorials and a very active support forum.

- -

Wiki and source code

-

The developer Wiki contains a wealth of info about the player, including:

-
    -
  1. All supported file formats (and playlists).
  2. -
  3. All supported flashvars (for customizing the player).
  4. -
  5. All supported API calls (for actionscript / javascript interaction).
  6. -
  7. All supported skinning elements (for creating your own graphics).
  8. -
  9. The roadmap with full changelogs for each version.
  10. -
-

The source code of all different versions of the player can be found here. You can click a version and download the ZIP files (the links at the bottom).

- -

Next steps

-

If you're ready to get professional about online video, check out our additional services, which take your site to the next level:

-
    -
  1. Our AdSolution is a no-nonsense video advertisement network that will increase your traffic and monetize your streams. Sign up for free.
  2. -
  3. Bits on the Run is a hassle-free video CMS that handles the encoding, streaming and tracking of your videos. Sign up for free.
  4. -
- - - \ No newline at end of file diff --git a/code/flv/shadowbox/libraries/mediaplayer/swfobject.js b/code/flv/shadowbox/libraries/mediaplayer/swfobject.js deleted file mode 100644 index e7edd42..0000000 --- a/code/flv/shadowbox/libraries/mediaplayer/swfobject.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/ - * - * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License: - * http://www.opensource.org/licenses/mit-license.php - * - */ -if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="";_19+="";var _1d=this.getParams();for(var key in _1d){_19+="";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="";}_19+="";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.majorfv.major){return true;}if(this.minorfv.minor){return true;}if(this.rev=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject; \ No newline at end of file diff --git a/code/flv/shadowbox/libraries/mediaplayer/video.flv b/code/flv/shadowbox/libraries/mediaplayer/video.flv deleted file mode 100644 index 5f87d76..0000000 Binary files a/code/flv/shadowbox/libraries/mediaplayer/video.flv and /dev/null differ diff --git a/code/flv/shadowbox/libraries/mediaplayer/yt.swf b/code/flv/shadowbox/libraries/mediaplayer/yt.swf deleted file mode 100644 index dd851ac..0000000 Binary files a/code/flv/shadowbox/libraries/mediaplayer/yt.swf and /dev/null differ diff --git a/code/flv/shadowbox/libraries/swfobject/LICENSE b/code/flv/shadowbox/libraries/swfobject/LICENSE deleted file mode 100644 index 4bf981d..0000000 --- a/code/flv/shadowbox/libraries/swfobject/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License - -Copyright (c) 2007-2008 Geoff Stearns, Michael Williams, and Bobby van der Sluis - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/code/flv/shadowbox/libraries/swfobject/expressInstall.swf b/code/flv/shadowbox/libraries/swfobject/expressInstall.swf deleted file mode 100644 index 86958bf..0000000 Binary files a/code/flv/shadowbox/libraries/swfobject/expressInstall.swf and /dev/null differ diff --git a/code/flv/shadowbox/libraries/swfobject/swfobject.js b/code/flv/shadowbox/libraries/swfobject/swfobject.js deleted file mode 100644 index 20f435f..0000000 --- a/code/flv/shadowbox/libraries/swfobject/swfobject.js +++ /dev/null @@ -1,14 +0,0 @@ -/* SWFObject v2.1 - Copyright (c) 2007-2008 Geoff Stearns, Michael Williams, and Bobby van der Sluis - This software is released under the MIT License -*/ -var swfobject=function(){var UNDEF="undefined",OBJECT="object",SHOCKWAVE_FLASH="Shockwave Flash",SHOCKWAVE_FLASH_AX="ShockwaveFlash.ShockwaveFlash",FLASH_MIME_TYPE="application/x-shockwave-flash",EXPRESS_INSTALL_ID="SWFObjectExprInst",win=window,doc=document,nav=navigator,domLoadFnArr=[],regObjArr=[],objIdArr=[],listenersArr=[],script,timer=null,storedAltContent=null,storedAltContentId=null,isDomLoaded=false,isExpressInstallActive=false;var ua=function(){var w3cdom=typeof doc.getElementById!=UNDEF&&typeof doc.getElementsByTagName!=UNDEF&&typeof doc.createElement!=UNDEF,playerVersion=[0,0,0],d=null;if(typeof nav.plugins!=UNDEF&&typeof nav.plugins[SHOCKWAVE_FLASH]==OBJECT){d=nav.plugins[SHOCKWAVE_FLASH].description;if(d&&!(typeof nav.mimeTypes!=UNDEF&&nav.mimeTypes[FLASH_MIME_TYPE]&&!nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)){d=d.replace(/^.*\s+(\S+\s+\S+$)/,"$1");playerVersion[0]=parseInt(d.replace(/^(.*)\..*$/,"$1"),10);playerVersion[1]=parseInt(d.replace(/^.*\.(.*)\s.*$/,"$1"),10);playerVersion[2]=/r/.test(d)?parseInt(d.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof win.ActiveXObject!=UNDEF){var a=null,fp6Crash=false;try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX+".7")}catch(e){try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX+".6");playerVersion=[6,0,21];a.AllowScriptAccess="always"}catch(e){if(playerVersion[0]==6){fp6Crash=true}}if(!fp6Crash){try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX)}catch(e){}}}if(!fp6Crash&&a){try{d=a.GetVariable("$version");if(d){d=d.split(" ")[1].split(",");playerVersion=[parseInt(d[0],10),parseInt(d[1],10),parseInt(d[2],10)]}}catch(e){}}}}var u=nav.userAgent.toLowerCase(),p=nav.platform.toLowerCase(),webkit=/webkit/.test(u)?parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,ie=false,windows=p?/win/.test(p):/win/.test(u),mac=p?/mac/.test(p):/mac/.test(u); -/*@cc_on - ie = true; - @if (@_win32) - windows = true; - @elif (@_mac) - mac = true; - @end - @*/ -return{w3cdom:w3cdom,pv:playerVersion,webkit:webkit,ie:ie,win:windows,mac:mac}}();var onDomLoad=function(){if(!ua.w3cdom){return}addDomLoadEvent(main);if(ua.ie&&ua.win){try{doc.write(" - - - - - - -
- - -
-
- - - - - - - - - - - - - -
- - -
-
-
- -
-
- -
- -
- -
-
-
- - diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/advimage/css/advimage.css b/code/simple_tinymce_field/javascript/tiny_mce/plugins/advimage/css/advimage.css deleted file mode 100644 index 0a6251a..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/advimage/css/advimage.css +++ /dev/null @@ -1,13 +0,0 @@ -#src_list, #over_list, #out_list {width:280px;} -.mceActionPanel {margin-top:7px;} -.alignPreview {border:1px solid #000; width:140px; height:140px; overflow:hidden; padding:5px;} -.checkbox {border:0;} -.panel_wrapper div.current {height:305px;} -#prev {margin:0; border:1px solid #000; width:428px; height:150px; overflow:auto;} -#align, #classlist {width:150px;} -#width, #height {vertical-align:middle; width:50px; text-align:center;} -#vspace, #hspace, #border {vertical-align:middle; width:30px; text-align:center;} -#class_list {width:180px;} -input {width: 280px;} -#constrain, #onmousemovecheck {width:auto;} -#id, #dir, #lang, #usemap, #longdesc {width:200px;} diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/advimage/editor_plugin.js b/code/simple_tinymce_field/javascript/tiny_mce/plugins/advimage/editor_plugin.js deleted file mode 100644 index 4c7a9c3..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/advimage/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.AdvancedImagePlugin",{init:function(a,b){a.addCommand("mceAdvImage",function(){if(a.dom.getAttrib(a.selection.getNode(),"class").indexOf("mceItem")!=-1){return}a.windowManager.open({file:b+"/image.htm",width:480+parseInt(a.getLang("advimage.delta_width",0)),height:385+parseInt(a.getLang("advimage.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("image",{title:"advimage.image_desc",cmd:"mceAdvImage"})},getInfo:function(){return{longname:"Advanced image",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advimage",tinymce.plugins.AdvancedImagePlugin)})(); \ No newline at end of file diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/advimage/editor_plugin_src.js b/code/simple_tinymce_field/javascript/tiny_mce/plugins/advimage/editor_plugin_src.js deleted file mode 100644 index f526842..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/advimage/editor_plugin_src.js +++ /dev/null @@ -1,47 +0,0 @@ -/** - * $Id: editor_plugin_src.js 677 2008-03-07 13:52:41Z spocke $ - * - * @author Moxiecode - * @copyright Copyright 2004-2008, Moxiecode Systems AB, All rights reserved. - */ - -(function() { - tinymce.create('tinymce.plugins.AdvancedImagePlugin', { - init : function(ed, url) { - // Register commands - ed.addCommand('mceAdvImage', function() { - // Internal image object like a flash placeholder - if (ed.dom.getAttrib(ed.selection.getNode(), 'class').indexOf('mceItem') != -1) - return; - - ed.windowManager.open({ - file : url + '/image.htm', - width : 480 + parseInt(ed.getLang('advimage.delta_width', 0)), - height : 385 + parseInt(ed.getLang('advimage.delta_height', 0)), - inline : 1 - }, { - plugin_url : url - }); - }); - - // Register buttons - ed.addButton('image', { - title : 'advimage.image_desc', - cmd : 'mceAdvImage' - }); - }, - - getInfo : function() { - return { - longname : 'Advanced image', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('advimage', tinymce.plugins.AdvancedImagePlugin); -})(); \ No newline at end of file diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/advimage/image.htm b/code/simple_tinymce_field/javascript/tiny_mce/plugins/advimage/image.htm deleted file mode 100644 index 5d26150..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/advimage/image.htm +++ /dev/null @@ -1,237 +0,0 @@ - - - - {#advimage_dlg.dialog_title} - - - - - - - - - -
- - -
-
-
- {#advimage_dlg.general} - - - - - - - - - - - - - - - - - - -
- - - - -
 
-
- -
- {#advimage_dlg.preview} - -
-
- -
-
- {#advimage_dlg.tab_appearance} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- {#advimage_dlg.example_img} - Lorem ipsum, Dolor sit amet, consectetuer adipiscing loreum ipsum edipiscing elit, sed diam - nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Loreum ipsum - edipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam - erat volutpat. -
-
- x - px -
  - - - - -
-
-
-
- -
-
- {#advimage_dlg.swap_image} - - - - - - - - - - - - - - - - - - - - - -
- - - - -
 
- - - - -
 
-
- -
- {#advimage_dlg.misc} - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- -
- -
- - - - -
 
-
-
-
- -
-
- -
- -
- -
-
-
- - diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/advimage/img/sample.gif b/code/simple_tinymce_field/javascript/tiny_mce/plugins/advimage/img/sample.gif deleted file mode 100644 index 53bf689..0000000 Binary files a/code/simple_tinymce_field/javascript/tiny_mce/plugins/advimage/img/sample.gif and /dev/null differ diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/advimage/js/image.js b/code/simple_tinymce_field/javascript/tiny_mce/plugins/advimage/js/image.js deleted file mode 100644 index 3477226..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/advimage/js/image.js +++ /dev/null @@ -1,443 +0,0 @@ -var ImageDialog = { - preInit : function() { - var url; - - tinyMCEPopup.requireLangPack(); - - if (url = tinyMCEPopup.getParam("external_image_list_url")) - document.write(''); - }, - - init : function(ed) { - var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, dom = ed.dom, n = ed.selection.getNode(); - - tinyMCEPopup.resizeToInnerSize(); - this.fillClassList('class_list'); - this.fillFileList('src_list', 'tinyMCEImageList'); - this.fillFileList('over_list', 'tinyMCEImageList'); - this.fillFileList('out_list', 'tinyMCEImageList'); - TinyMCE_EditableSelects.init(); - - if (n.nodeName == 'IMG') { - nl.src.value = dom.getAttrib(n, 'src'); - nl.width.value = dom.getAttrib(n, 'width'); - nl.height.value = dom.getAttrib(n, 'height'); - nl.alt.value = dom.getAttrib(n, 'alt'); - nl.title.value = dom.getAttrib(n, 'title'); - nl.vspace.value = this.getAttrib(n, 'vspace'); - nl.hspace.value = this.getAttrib(n, 'hspace'); - nl.border.value = this.getAttrib(n, 'border'); - selectByValue(f, 'align', this.getAttrib(n, 'align')); - selectByValue(f, 'class_list', dom.getAttrib(n, 'class'), true, true); - nl.style.value = dom.getAttrib(n, 'style'); - nl.id.value = dom.getAttrib(n, 'id'); - nl.dir.value = dom.getAttrib(n, 'dir'); - nl.lang.value = dom.getAttrib(n, 'lang'); - nl.usemap.value = dom.getAttrib(n, 'usemap'); - nl.longdesc.value = dom.getAttrib(n, 'longdesc'); - nl.insert.value = ed.getLang('update'); - - if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseover'))) - nl.onmouseoversrc.value = dom.getAttrib(n, 'onmouseover').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1'); - - if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseout'))) - nl.onmouseoutsrc.value = dom.getAttrib(n, 'onmouseout').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1'); - - if (ed.settings.inline_styles) { - // Move attribs to styles - if (dom.getAttrib(n, 'align')) - this.updateStyle('align'); - - if (dom.getAttrib(n, 'hspace')) - this.updateStyle('hspace'); - - if (dom.getAttrib(n, 'border')) - this.updateStyle('border'); - - if (dom.getAttrib(n, 'vspace')) - this.updateStyle('vspace'); - } - } - - // Setup browse button - document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image'); - if (isVisible('srcbrowser')) - document.getElementById('src').style.width = '260px'; - - // Setup browse button - document.getElementById('onmouseoversrccontainer').innerHTML = getBrowserHTML('overbrowser','onmouseoversrc','image','theme_advanced_image'); - if (isVisible('overbrowser')) - document.getElementById('onmouseoversrc').style.width = '260px'; - - // Setup browse button - document.getElementById('onmouseoutsrccontainer').innerHTML = getBrowserHTML('outbrowser','onmouseoutsrc','image','theme_advanced_image'); - if (isVisible('outbrowser')) - document.getElementById('onmouseoutsrc').style.width = '260px'; - - // If option enabled default contrain proportions to checked - if (ed.getParam("advimage_constrain_proportions", true)) - f.constrain.checked = true; - - // Check swap image if valid data - if (nl.onmouseoversrc.value || nl.onmouseoutsrc.value) - this.setSwapImage(true); - else - this.setSwapImage(false); - - this.changeAppearance(); - this.showPreviewImage(nl.src.value, 1); - }, - - insert : function(file, title) { - var ed = tinyMCEPopup.editor, t = this, f = document.forms[0]; - - if (f.src.value === '') { - if (ed.selection.getNode().nodeName == 'IMG') { - ed.dom.remove(ed.selection.getNode()); - ed.execCommand('mceRepaint'); - } - - tinyMCEPopup.close(); - return; - } - - if (tinyMCEPopup.getParam("accessibility_warnings", 1)) { - if (!f.alt.value) { - tinyMCEPopup.confirm(tinyMCEPopup.getLang('advimage_dlg.missing_alt'), function(s) { - if (s) - t.insertAndClose(); - }); - - return; - } - } - - t.insertAndClose(); - }, - - insertAndClose : function() { - var ed = tinyMCEPopup.editor, f = document.forms[0], nl = f.elements, v, args = {}, el; - - tinyMCEPopup.restoreSelection(); - - // Fixes crash in Safari - if (tinymce.isWebKit) - ed.getWin().focus(); - - if (!ed.settings.inline_styles) { - args = { - vspace : nl.vspace.value, - hspace : nl.hspace.value, - border : nl.border.value, - align : getSelectValue(f, 'align') - }; - } else { - // Remove deprecated values - args = { - vspace : '', - hspace : '', - border : '', - align : '' - }; - } - - tinymce.extend(args, { - src : nl.src.value, - width : nl.width.value, - height : nl.height.value, - alt : nl.alt.value, - title : nl.title.value, - 'class' : getSelectValue(f, 'class_list'), - style : nl.style.value, - id : nl.id.value, - dir : nl.dir.value, - lang : nl.lang.value, - usemap : nl.usemap.value, - longdesc : nl.longdesc.value - }); - - args.onmouseover = args.onmouseout = ''; - - if (f.onmousemovecheck.checked) { - if (nl.onmouseoversrc.value) - args.onmouseover = "this.src='" + nl.onmouseoversrc.value + "';"; - - if (nl.onmouseoutsrc.value) - args.onmouseout = "this.src='" + nl.onmouseoutsrc.value + "';"; - } - - el = ed.selection.getNode(); - - if (el && el.nodeName == 'IMG') { - ed.dom.setAttribs(el, args); - } else { - ed.execCommand('mceInsertContent', false, '', {skip_undo : 1}); - ed.dom.setAttribs('__mce_tmp', args); - ed.dom.setAttrib('__mce_tmp', 'id', ''); - ed.undoManager.add(); - } - - tinyMCEPopup.close(); - }, - - getAttrib : function(e, at) { - var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2; - - if (ed.settings.inline_styles) { - switch (at) { - case 'align': - if (v = dom.getStyle(e, 'float')) - return v; - - if (v = dom.getStyle(e, 'vertical-align')) - return v; - - break; - - case 'hspace': - v = dom.getStyle(e, 'margin-left') - v2 = dom.getStyle(e, 'margin-right'); - - if (v && v == v2) - return parseInt(v.replace(/[^0-9]/g, '')); - - break; - - case 'vspace': - v = dom.getStyle(e, 'margin-top') - v2 = dom.getStyle(e, 'margin-bottom'); - if (v && v == v2) - return parseInt(v.replace(/[^0-9]/g, '')); - - break; - - case 'border': - v = 0; - - tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) { - sv = dom.getStyle(e, 'border-' + sv + '-width'); - - // False or not the same as prev - if (!sv || (sv != v && v !== 0)) { - v = 0; - return false; - } - - if (sv) - v = sv; - }); - - if (v) - return parseInt(v.replace(/[^0-9]/g, '')); - - break; - } - } - - if (v = dom.getAttrib(e, at)) - return v; - - return ''; - }, - - setSwapImage : function(st) { - var f = document.forms[0]; - - f.onmousemovecheck.checked = st; - setBrowserDisabled('overbrowser', !st); - setBrowserDisabled('outbrowser', !st); - - if (f.over_list) - f.over_list.disabled = !st; - - if (f.out_list) - f.out_list.disabled = !st; - - f.onmouseoversrc.disabled = !st; - f.onmouseoutsrc.disabled = !st; - }, - - fillClassList : function(id) { - var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; - - if (v = tinyMCEPopup.getParam('theme_advanced_styles')) { - cl = []; - - tinymce.each(v.split(';'), function(v) { - var p = v.split('='); - - cl.push({'title' : p[0], 'class' : p[1]}); - }); - } else - cl = tinyMCEPopup.editor.dom.getClasses(); - - if (cl.length > 0) { - lst.options.length = 0; - lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); - - tinymce.each(cl, function(o) { - lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']); - }); - } else - dom.remove(dom.getParent(id, 'tr')); - }, - - fillFileList : function(id, l) { - var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; - - l = window[l]; - lst.options.length = 0; - - if (l && l.length > 0) { - lst.options[lst.options.length] = new Option('', ''); - - tinymce.each(l, function(o) { - lst.options[lst.options.length] = new Option(o[0], o[1]); - }); - } else - dom.remove(dom.getParent(id, 'tr')); - }, - - resetImageData : function() { - var f = document.forms[0]; - - f.elements.width.value = f.elements.height.value = ''; - }, - - updateImageData : function(img, st) { - var f = document.forms[0]; - - if (!st) { - f.elements.width.value = img.width; - f.elements.height.value = img.height; - } - - this.preloadImg = img; - }, - - changeAppearance : function() { - var ed = tinyMCEPopup.editor, f = document.forms[0], img = document.getElementById('alignSampleImg'); - - if (img) { - if (ed.getParam('inline_styles')) { - ed.dom.setAttrib(img, 'style', f.style.value); - } else { - img.align = f.align.value; - img.border = f.border.value; - img.hspace = f.hspace.value; - img.vspace = f.vspace.value; - } - } - }, - - changeHeight : function() { - var f = document.forms[0], tp, t = this; - - if (!f.constrain.checked || !t.preloadImg) { - return; - } - - if (f.width.value == "" || f.height.value == "") - return; - - tp = (parseInt(f.width.value) / parseInt(t.preloadImg.width)) * t.preloadImg.height; - f.height.value = tp.toFixed(0); - }, - - changeWidth : function() { - var f = document.forms[0], tp, t = this; - - if (!f.constrain.checked || !t.preloadImg) { - return; - } - - if (f.width.value == "" || f.height.value == "") - return; - - tp = (parseInt(f.height.value) / parseInt(t.preloadImg.height)) * t.preloadImg.width; - f.width.value = tp.toFixed(0); - }, - - updateStyle : function(ty) { - var dom = tinyMCEPopup.dom, st, v, f = document.forms[0], img = dom.create('img', {style : dom.get('style').value}); - - if (tinyMCEPopup.editor.settings.inline_styles) { - // Handle align - if (ty == 'align') { - dom.setStyle(img, 'float', ''); - dom.setStyle(img, 'vertical-align', ''); - - v = getSelectValue(f, 'align'); - if (v) { - if (v == 'left' || v == 'right') - dom.setStyle(img, 'float', v); - else - img.style.verticalAlign = v; - } - } - - // Handle border - if (ty == 'border') { - dom.setStyle(img, 'border', ''); - - v = f.border.value; - if (v || v == '0') { - if (v == '0') - img.style.border = '0'; - else - img.style.border = v + 'px solid black'; - } - } - - // Handle hspace - if (ty == 'hspace') { - dom.setStyle(img, 'marginLeft', ''); - dom.setStyle(img, 'marginRight', ''); - - v = f.hspace.value; - if (v) { - img.style.marginLeft = v + 'px'; - img.style.marginRight = v + 'px'; - } - } - - // Handle vspace - if (ty == 'vspace') { - dom.setStyle(img, 'marginTop', ''); - dom.setStyle(img, 'marginBottom', ''); - - v = f.vspace.value; - if (v) { - img.style.marginTop = v + 'px'; - img.style.marginBottom = v + 'px'; - } - } - - // Merge - dom.get('style').value = dom.serializeStyle(dom.parseStyle(img.style.cssText)); - } - }, - - changeMouseMove : function() { - }, - - showPreviewImage : function(u, st) { - if (!u) { - tinyMCEPopup.dom.setHTML('prev', ''); - return; - } - - if (!st && tinyMCEPopup.getParam("advimage_update_dimensions_onchange", true)) - this.resetImageData(); - - u = tinyMCEPopup.editor.documentBaseURI.toAbsolute(u); - - if (!st) - tinyMCEPopup.dom.setHTML('prev', ''); - else - tinyMCEPopup.dom.setHTML('prev', ''); - } -}; - -ImageDialog.preInit(); -tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog); diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/advimage/langs/en_dlg.js b/code/simple_tinymce_field/javascript/tiny_mce/plugins/advimage/langs/en_dlg.js deleted file mode 100644 index f493d19..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/advimage/langs/en_dlg.js +++ /dev/null @@ -1,43 +0,0 @@ -tinyMCE.addI18n('en.advimage_dlg',{ -tab_general:"General", -tab_appearance:"Appearance", -tab_advanced:"Advanced", -general:"General", -title:"Title", -preview:"Preview", -constrain_proportions:"Constrain proportions", -langdir:"Language direction", -langcode:"Language code", -long_desc:"Long description link", -style:"Style", -classes:"Classes", -ltr:"Left to right", -rtl:"Right to left", -id:"Id", -map:"Image map", -swap_image:"Swap image", -alt_image:"Alternative image", -mouseover:"for mouse over", -mouseout:"for mouse out", -misc:"Miscellaneous", -example_img:"Appearance preview image", -missing_alt:"Are you sure you want to continue without including an Image Description? Without it the image may not be accessible to some users with disabilities, or to those using a text browser, or browsing the Web with images turned off.", -dialog_title:"Insert/edit image", -src:"Image URL", -alt:"Image description", -list:"Image list", -border:"Border", -dimensions:"Dimensions", -vspace:"Vertical space", -hspace:"Horizontal space", -align:"Alignment", -align_baseline:"Baseline", -align_top:"Top", -align_middle:"Middle", -align_bottom:"Bottom", -align_texttop:"Text top", -align_textbottom:"Text bottom", -align_left:"Left", -align_right:"Right", -image_list:"Image list" -}); \ No newline at end of file diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/advlink/css/advlink.css b/code/simple_tinymce_field/javascript/tiny_mce/plugins/advlink/css/advlink.css deleted file mode 100644 index 1436431..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/advlink/css/advlink.css +++ /dev/null @@ -1,8 +0,0 @@ -.mceLinkList, .mceAnchorList, #targetlist {width:280px;} -.mceActionPanel {margin-top:7px;} -.panel_wrapper div.current {height:320px;} -#classlist, #title, #href {width:280px;} -#popupurl, #popupname {width:200px;} -#popupwidth, #popupheight, #popupleft, #popuptop {width:30px;vertical-align:middle;text-align:center;} -#id, #style, #classes, #target, #dir, #hreflang, #lang, #charset, #type, #rel, #rev, #tabindex, #accesskey {width:200px;} -#events_panel input {width:200px;} diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/advlink/editor_plugin.js b/code/simple_tinymce_field/javascript/tiny_mce/plugins/advlink/editor_plugin.js deleted file mode 100644 index 983fe5a..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/advlink/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.AdvancedLinkPlugin",{init:function(a,b){this.editor=a;a.addCommand("mceAdvLink",function(){var c=a.selection;if(c.isCollapsed()&&!a.dom.getParent(c.getNode(),"A")){return}a.windowManager.open({file:b+"/link.htm",width:480+parseInt(a.getLang("advlink.delta_width",0)),height:400+parseInt(a.getLang("advlink.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("link",{title:"advlink.link_desc",cmd:"mceAdvLink"});a.addShortcut("ctrl+k","advlink.advlink_desc","mceAdvLink");a.onNodeChange.add(function(d,c,f,e){c.setDisabled("link",e&&f.nodeName!="A");c.setActive("link",f.nodeName=="A"&&!f.name)})},getInfo:function(){return{longname:"Advanced link",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advlink",tinymce.plugins.AdvancedLinkPlugin)})(); \ No newline at end of file diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/advlink/editor_plugin_src.js b/code/simple_tinymce_field/javascript/tiny_mce/plugins/advlink/editor_plugin_src.js deleted file mode 100644 index fc5325a..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/advlink/editor_plugin_src.js +++ /dev/null @@ -1,58 +0,0 @@ -/** - * $Id: editor_plugin_src.js 539 2008-01-14 19:08:58Z spocke $ - * - * @author Moxiecode - * @copyright Copyright 2004-2008, Moxiecode Systems AB, All rights reserved. - */ - -(function() { - tinymce.create('tinymce.plugins.AdvancedLinkPlugin', { - init : function(ed, url) { - this.editor = ed; - - // Register commands - ed.addCommand('mceAdvLink', function() { - var se = ed.selection; - - // No selection and not in link - if (se.isCollapsed() && !ed.dom.getParent(se.getNode(), 'A')) - return; - - ed.windowManager.open({ - file : url + '/link.htm', - width : 480 + parseInt(ed.getLang('advlink.delta_width', 0)), - height : 400 + parseInt(ed.getLang('advlink.delta_height', 0)), - inline : 1 - }, { - plugin_url : url - }); - }); - - // Register buttons - ed.addButton('link', { - title : 'advlink.link_desc', - cmd : 'mceAdvLink' - }); - - ed.addShortcut('ctrl+k', 'advlink.advlink_desc', 'mceAdvLink'); - - ed.onNodeChange.add(function(ed, cm, n, co) { - cm.setDisabled('link', co && n.nodeName != 'A'); - cm.setActive('link', n.nodeName == 'A' && !n.name); - }); - }, - - getInfo : function() { - return { - longname : 'Advanced link', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('advlink', tinymce.plugins.AdvancedLinkPlugin); -})(); \ No newline at end of file diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/advlink/js/advlink.js b/code/simple_tinymce_field/javascript/tiny_mce/plugins/advlink/js/advlink.js deleted file mode 100644 index bb7922a..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/advlink/js/advlink.js +++ /dev/null @@ -1,528 +0,0 @@ -/* Functions for the advlink plugin popup */ - -tinyMCEPopup.requireLangPack(); - -var templates = { - "window.open" : "window.open('${url}','${target}','${options}')" -}; - -function preinit() { - var url; - - if (url = tinyMCEPopup.getParam("external_link_list_url")) - document.write(''); -} - -function changeClass() { - var f = document.forms[0]; - - f.classes.value = getSelectValue(f, 'classlist'); -} - -function init() { - tinyMCEPopup.resizeToInnerSize(); - - var formObj = document.forms[0]; - var inst = tinyMCEPopup.editor; - var elm = inst.selection.getNode(); - var action = "insert"; - var html; - - document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser','href','file','advlink'); - document.getElementById('popupurlbrowsercontainer').innerHTML = getBrowserHTML('popupurlbrowser','popupurl','file','advlink'); - document.getElementById('linklisthrefcontainer').innerHTML = getLinkListHTML('linklisthref','href'); - document.getElementById('anchorlistcontainer').innerHTML = getAnchorListHTML('anchorlist','href'); - document.getElementById('targetlistcontainer').innerHTML = getTargetListHTML('targetlist','target'); - - // Link list - html = getLinkListHTML('linklisthref','href'); - if (html == "") - document.getElementById("linklisthrefrow").style.display = 'none'; - else - document.getElementById("linklisthrefcontainer").innerHTML = html; - - // Resize some elements - if (isVisible('hrefbrowser')) - document.getElementById('href').style.width = '260px'; - - if (isVisible('popupurlbrowser')) - document.getElementById('popupurl').style.width = '180px'; - - elm = inst.dom.getParent(elm, "A"); - if (elm != null && elm.nodeName == "A") - action = "update"; - - formObj.insert.value = tinyMCEPopup.getLang(action, 'Insert', true); - - setPopupControlsDisabled(true); - - if (action == "update") { - var href = inst.dom.getAttrib(elm, 'href'); - var onclick = inst.dom.getAttrib(elm, 'onclick'); - - // Setup form data - setFormValue('href', href); - setFormValue('title', inst.dom.getAttrib(elm, 'title')); - setFormValue('id', inst.dom.getAttrib(elm, 'id')); - setFormValue('style', inst.dom.getAttrib(elm, "style")); - setFormValue('rel', inst.dom.getAttrib(elm, 'rel')); - setFormValue('rev', inst.dom.getAttrib(elm, 'rev')); - setFormValue('charset', inst.dom.getAttrib(elm, 'charset')); - setFormValue('hreflang', inst.dom.getAttrib(elm, 'hreflang')); - setFormValue('dir', inst.dom.getAttrib(elm, 'dir')); - setFormValue('lang', inst.dom.getAttrib(elm, 'lang')); - setFormValue('tabindex', inst.dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : "")); - setFormValue('accesskey', inst.dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : "")); - setFormValue('type', inst.dom.getAttrib(elm, 'type')); - setFormValue('onfocus', inst.dom.getAttrib(elm, 'onfocus')); - setFormValue('onblur', inst.dom.getAttrib(elm, 'onblur')); - setFormValue('onclick', onclick); - setFormValue('ondblclick', inst.dom.getAttrib(elm, 'ondblclick')); - setFormValue('onmousedown', inst.dom.getAttrib(elm, 'onmousedown')); - setFormValue('onmouseup', inst.dom.getAttrib(elm, 'onmouseup')); - setFormValue('onmouseover', inst.dom.getAttrib(elm, 'onmouseover')); - setFormValue('onmousemove', inst.dom.getAttrib(elm, 'onmousemove')); - setFormValue('onmouseout', inst.dom.getAttrib(elm, 'onmouseout')); - setFormValue('onkeypress', inst.dom.getAttrib(elm, 'onkeypress')); - setFormValue('onkeydown', inst.dom.getAttrib(elm, 'onkeydown')); - setFormValue('onkeyup', inst.dom.getAttrib(elm, 'onkeyup')); - setFormValue('target', inst.dom.getAttrib(elm, 'target')); - setFormValue('classes', inst.dom.getAttrib(elm, 'class')); - - // Parse onclick data - if (onclick != null && onclick.indexOf('window.open') != -1) - parseWindowOpen(onclick); - else - parseFunction(onclick); - - // Select by the values - selectByValue(formObj, 'dir', inst.dom.getAttrib(elm, 'dir')); - selectByValue(formObj, 'rel', inst.dom.getAttrib(elm, 'rel')); - selectByValue(formObj, 'rev', inst.dom.getAttrib(elm, 'rev')); - selectByValue(formObj, 'linklisthref', href); - - if (href.charAt(0) == '#') - selectByValue(formObj, 'anchorlist', href); - - addClassesToList('classlist', 'advlink_styles'); - - selectByValue(formObj, 'classlist', inst.dom.getAttrib(elm, 'class'), true); - selectByValue(formObj, 'targetlist', inst.dom.getAttrib(elm, 'target'), true); - } else - addClassesToList('classlist', 'advlink_styles'); -} - -function checkPrefix(n) { - if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_email'))) - n.value = 'mailto:' + n.value; - - if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_external'))) - n.value = 'http://' + n.value; -} - -function setFormValue(name, value) { - document.forms[0].elements[name].value = value; -} - -function parseWindowOpen(onclick) { - var formObj = document.forms[0]; - - // Preprocess center code - if (onclick.indexOf('return false;') != -1) { - formObj.popupreturn.checked = true; - onclick = onclick.replace('return false;', ''); - } else - formObj.popupreturn.checked = false; - - var onClickData = parseLink(onclick); - - if (onClickData != null) { - formObj.ispopup.checked = true; - setPopupControlsDisabled(false); - - var onClickWindowOptions = parseOptions(onClickData['options']); - var url = onClickData['url']; - - formObj.popupname.value = onClickData['target']; - formObj.popupurl.value = url; - formObj.popupwidth.value = getOption(onClickWindowOptions, 'width'); - formObj.popupheight.value = getOption(onClickWindowOptions, 'height'); - - formObj.popupleft.value = getOption(onClickWindowOptions, 'left'); - formObj.popuptop.value = getOption(onClickWindowOptions, 'top'); - - if (formObj.popupleft.value.indexOf('screen') != -1) - formObj.popupleft.value = "c"; - - if (formObj.popuptop.value.indexOf('screen') != -1) - formObj.popuptop.value = "c"; - - formObj.popuplocation.checked = getOption(onClickWindowOptions, 'location') == "yes"; - formObj.popupscrollbars.checked = getOption(onClickWindowOptions, 'scrollbars') == "yes"; - formObj.popupmenubar.checked = getOption(onClickWindowOptions, 'menubar') == "yes"; - formObj.popupresizable.checked = getOption(onClickWindowOptions, 'resizable') == "yes"; - formObj.popuptoolbar.checked = getOption(onClickWindowOptions, 'toolbar') == "yes"; - formObj.popupstatus.checked = getOption(onClickWindowOptions, 'status') == "yes"; - formObj.popupdependent.checked = getOption(onClickWindowOptions, 'dependent') == "yes"; - - buildOnClick(); - } -} - -function parseFunction(onclick) { - var formObj = document.forms[0]; - var onClickData = parseLink(onclick); - - // TODO: Add stuff here -} - -function getOption(opts, name) { - return typeof(opts[name]) == "undefined" ? "" : opts[name]; -} - -function setPopupControlsDisabled(state) { - var formObj = document.forms[0]; - - formObj.popupname.disabled = state; - formObj.popupurl.disabled = state; - formObj.popupwidth.disabled = state; - formObj.popupheight.disabled = state; - formObj.popupleft.disabled = state; - formObj.popuptop.disabled = state; - formObj.popuplocation.disabled = state; - formObj.popupscrollbars.disabled = state; - formObj.popupmenubar.disabled = state; - formObj.popupresizable.disabled = state; - formObj.popuptoolbar.disabled = state; - formObj.popupstatus.disabled = state; - formObj.popupreturn.disabled = state; - formObj.popupdependent.disabled = state; - - setBrowserDisabled('popupurlbrowser', state); -} - -function parseLink(link) { - link = link.replace(new RegExp(''', 'g'), "'"); - - var fnName = link.replace(new RegExp("\\s*([A-Za-z0-9\.]*)\\s*\\(.*", "gi"), "$1"); - - // Is function name a template function - var template = templates[fnName]; - if (template) { - // Build regexp - var variableNames = template.match(new RegExp("'?\\$\\{[A-Za-z0-9\.]*\\}'?", "gi")); - var regExp = "\\s*[A-Za-z0-9\.]*\\s*\\("; - var replaceStr = ""; - for (var i=0; i'); - for (var i=0; i'; - html += ''; - - for (i=0; i' + name + ''; - } - - html += ''; - - return html; -} - -function insertAction() { - var inst = tinyMCEPopup.editor; - var elm, elementArray, i; - - elm = inst.selection.getNode(); - checkPrefix(document.forms[0].href); - - elm = inst.dom.getParent(elm, "A"); - - // Remove element if there is no href - if (!document.forms[0].href.value) { - tinyMCEPopup.execCommand("mceBeginUndoLevel"); - i = inst.selection.getBookmark(); - inst.dom.remove(elm, 1); - inst.selection.moveToBookmark(i); - tinyMCEPopup.execCommand("mceEndUndoLevel"); - tinyMCEPopup.close(); - return; - } - - tinyMCEPopup.execCommand("mceBeginUndoLevel"); - - // Create new anchor elements - if (elm == null) { - inst.getDoc().execCommand("unlink", false, null); - tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1}); - - elementArray = tinymce.grep(inst.dom.select("a"), function(n) {return inst.dom.getAttrib(n, 'href') == '#mce_temp_url#';}); - for (i=0; i' + tinyMCELinkList[i][0] + ''; - - html += ''; - - return html; - - // tinyMCE.debug('-- image list start --', html, '-- image list end --'); -} - -function getTargetListHTML(elm_id, target_form_element) { - var targets = tinyMCEPopup.getParam('theme_advanced_link_targets', '').split(';'); - var html = ''; - - html += ''; - - return html; -} - -// While loading -preinit(); -tinyMCEPopup.onInit.add(init); diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/advlink/langs/en_dlg.js b/code/simple_tinymce_field/javascript/tiny_mce/plugins/advlink/langs/en_dlg.js deleted file mode 100644 index c71ffbd..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/advlink/langs/en_dlg.js +++ /dev/null @@ -1,52 +0,0 @@ -tinyMCE.addI18n('en.advlink_dlg',{ -title:"Insert/edit link", -url:"Link URL", -target:"Target", -titlefield:"Title", -is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?", -is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?", -list:"Link list", -general_tab:"General", -popup_tab:"Popup", -events_tab:"Events", -advanced_tab:"Advanced", -general_props:"General properties", -popup_props:"Popup properties", -event_props:"Events", -advanced_props:"Advanced properties", -popup_opts:"Options", -anchor_names:"Anchors", -target_same:"Open in this window / frame", -target_parent:"Open in parent window / frame", -target_top:"Open in top frame (replaces all frames)", -target_blank:"Open in new window", -popup:"Javascript popup", -popup_url:"Popup URL", -popup_name:"Window name", -popup_return:"Insert 'return false'", -popup_scrollbars:"Show scrollbars", -popup_statusbar:"Show status bar", -popup_toolbar:"Show toolbars", -popup_menubar:"Show menu bar", -popup_location:"Show location bar", -popup_resizable:"Make window resizable", -popup_dependent:"Dependent (Mozilla/Firefox only)", -popup_size:"Size", -popup_position:"Position (X/Y)", -id:"Id", -style:"Style", -classes:"Classes", -target_name:"Target name", -langdir:"Language direction", -target_langcode:"Target language", -langcode:"Language code", -encoding:"Target character encoding", -mime:"Target MIME type", -rel:"Relationship page to target", -rev:"Relationship target to page", -tabindex:"Tabindex", -accesskey:"Accesskey", -ltr:"Left to right", -rtl:"Right to left", -link_list:"Link list" -}); \ No newline at end of file diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/advlink/link.htm b/code/simple_tinymce_field/javascript/tiny_mce/plugins/advlink/link.htm deleted file mode 100644 index cc8b0b8..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/advlink/link.htm +++ /dev/null @@ -1,338 +0,0 @@ - - - - {#advlink_dlg.title} - - - - - - - - -
- - -
-
-
- {#advlink_dlg.general_props} - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
 
- -
-
-
- - - -
-
- {#advlink_dlg.advanced_props} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- -
-
-
-
-
- -
-
- {#advlink_dlg.event_props} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -
-
- -
- -
- -
-
-
- - diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/autoresize/editor_plugin.js b/code/simple_tinymce_field/javascript/tiny_mce/plugins/autoresize/editor_plugin.js deleted file mode 100644 index 57c8312..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/autoresize/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.AutoResizePlugin",{init:function(a,c){var d=this;function b(){var h=a.getDoc(),e=h.body,j=h.documentElement,g=tinymce.DOM,i=d.autoresize_min_height,f;f=tinymce.isIE?e.scrollHeight:j.offsetHeight;if(f>d.autoresize_min_height){i=f}g.setStyle(g.get(a.id+"_ifr"),"height",i+"px");if(d.throbbing){a.setProgressState(false);a.setProgressState(true)}}d.editor=a;d.autoresize_min_height=a.getElement().offsetHeight;a.onInit.add(function(f,e){f.setProgressState(true);d.throbbing=true;f.getBody().style.overflowY="hidden"});a.onChange.add(b);a.onSetContent.add(b);a.onPaste.add(b);a.onKeyUp.add(b);a.onPostRender.add(b);a.onLoadContent.add(function(f,e){b();setTimeout(function(){b();f.setProgressState(false);d.throbbing=false},1250)});a.addCommand("mceAutoResize",b)},getInfo:function(){return{longname:"Auto Resize",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("autoresize",tinymce.plugins.AutoResizePlugin)})(); \ No newline at end of file diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/autoresize/editor_plugin_src.js b/code/simple_tinymce_field/javascript/tiny_mce/plugins/autoresize/editor_plugin_src.js deleted file mode 100644 index 5608568..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/autoresize/editor_plugin_src.js +++ /dev/null @@ -1,111 +0,0 @@ -/** -* $Id: editor_plugin_src.js 539 2008-01-14 19:08:58Z spocke $ -* -* @author Moxiecode -* @copyright Copyright 2004-2008, Moxiecode Systems AB, All rights reserved. -*/ - -(function() { - /** - * Auto Resize - * - * This plugin automatically resizes the content area to fit its content height. - * It will retain a minimum height, which is the height of the content area when - * it's initialized. - */ - tinymce.create('tinymce.plugins.AutoResizePlugin', { - /** - * Initializes the plugin, this will be executed after the plugin has been created. - * This call is done before the editor instance has finished it's initialization so use the onInit event - * of the editor instance to intercept that event. - * - * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. - * @param {string} url Absolute URL to where the plugin is located. - */ - init : function(ed, url) { - var t = this; - - /** - * This method gets executed each time the editor needs to resize. - */ - function resize() { - var d = ed.getDoc(), b = d.body, de = d.documentElement, DOM = tinymce.DOM, resizeHeight = t.autoresize_min_height, myHeight; - - // Get height differently depending on the browser used - myHeight = tinymce.isIE ? b.scrollHeight : de.offsetHeight; - - // Don't make it smaller than the minimum height - if (myHeight > t.autoresize_min_height) - resizeHeight = myHeight; - - // Resize content element - DOM.setStyle(DOM.get(ed.id + '_ifr'), 'height', resizeHeight + 'px'); - - // if we're throbbing, we'll re-throb to match the new size - if (t.throbbing) { - ed.setProgressState(false); - ed.setProgressState(true); - } - }; - - t.editor = ed; - - // Define minimum height - t.autoresize_min_height = ed.getElement().offsetHeight; - - // Things to do when the editor is ready - ed.onInit.add(function(ed, l) { - // Show throbber until content area is resized properly - ed.setProgressState(true); - t.throbbing = true; - - // Hide scrollbars - ed.getBody().style.overflowY = "hidden"; - }); - - // Add appropriate listeners for resizing content area - ed.onChange.add(resize); - ed.onSetContent.add(resize); - ed.onPaste.add(resize); - ed.onKeyUp.add(resize); - ed.onPostRender.add(resize); - - ed.onLoadContent.add(function(ed, l) { - resize(); - - // Because the content area resizes when its content CSS loads, - // and we can't easily add a listener to its onload event, - // we'll just trigger a resize after a short loading period - setTimeout(function() { - resize(); - - // Disable throbber - ed.setProgressState(false); - t.throbbing = false; - }, 1250); - }); - - // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample'); - ed.addCommand('mceAutoResize', resize); - }, - - /** - * Returns information about the plugin as a name/value array. - * The current keys are longname, author, authorurl, infourl and version. - * - * @return {Object} Name/value array containing information about the plugin. - */ - getInfo : function() { - return { - longname : 'Auto Resize', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('autoresize', tinymce.plugins.AutoResizePlugin); -})(); \ No newline at end of file diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/autosave/editor_plugin.js b/code/simple_tinymce_field/javascript/tiny_mce/plugins/autosave/editor_plugin.js deleted file mode 100644 index 091a063..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/autosave/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.AutoSavePlugin",{init:function(a,b){var c=this;c.editor=a;window.onbeforeunload=tinymce.plugins.AutoSavePlugin._beforeUnloadHandler},getInfo:function(){return{longname:"Auto save",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave",version:tinymce.majorVersion+"."+tinymce.minorVersion}},"static":{_beforeUnloadHandler:function(){var a;tinymce.each(tinyMCE.editors,function(b){if(b.getParam("fullscreen_is_enabled")){return}if(b.isDirty()){a=b.getLang("autosave.unload_msg");return false}});return a}}});tinymce.PluginManager.add("autosave",tinymce.plugins.AutoSavePlugin)})(); \ No newline at end of file diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/autosave/editor_plugin_src.js b/code/simple_tinymce_field/javascript/tiny_mce/plugins/autosave/editor_plugin_src.js deleted file mode 100644 index 3c4325a..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/autosave/editor_plugin_src.js +++ /dev/null @@ -1,51 +0,0 @@ -/** - * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $ - * - * @author Moxiecode - * @copyright Copyright 2004-2008, Moxiecode Systems AB, All rights reserved. - */ - -(function() { - tinymce.create('tinymce.plugins.AutoSavePlugin', { - init : function(ed, url) { - var t = this; - - t.editor = ed; - - window.onbeforeunload = tinymce.plugins.AutoSavePlugin._beforeUnloadHandler; - }, - - getInfo : function() { - return { - longname : 'Auto save', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - // Private plugin internal methods - - 'static' : { - _beforeUnloadHandler : function() { - var msg; - - tinymce.each(tinyMCE.editors, function(ed) { - if (ed.getParam("fullscreen_is_enabled")) - return; - - if (ed.isDirty()) { - msg = ed.getLang("autosave.unload_msg"); - return false; - } - }); - - return msg; - } - } - }); - - // Register plugin - tinymce.PluginManager.add('autosave', tinymce.plugins.AutoSavePlugin); -})(); \ No newline at end of file diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/bbcode/editor_plugin.js b/code/simple_tinymce_field/javascript/tiny_mce/plugins/bbcode/editor_plugin.js deleted file mode 100644 index 930fdff..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/bbcode/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.BBCodePlugin",{init:function(a,b){var d=this,c=a.getParam("bbcode_dialect","punbb").toLowerCase();a.onBeforeSetContent.add(function(e,f){f.content=d["_"+c+"_bbcode2html"](f.content)});a.onPostProcess.add(function(e,f){if(f.set){f.content=d["_"+c+"_bbcode2html"](f.content)}if(f.get){f.content=d["_"+c+"_html2bbcode"](f.content)}})},getInfo:function(){return{longname:"BBCode Plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_punbb_html2bbcode:function(a){a=tinymce.trim(a);function b(c,d){a=a.replace(c,d)}b(/(.*?)<\/a>/gi,"[url=$1]$2[/url]");b(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");b(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");b(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");b(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");b(/(.*?)<\/span>/gi,"[color=$1]$2[/color]");b(/(.*?)<\/font>/gi,"[color=$1]$2[/color]");b(/(.*?)<\/span>/gi,"[size=$1]$2[/size]");b(/(.*?)<\/font>/gi,"$1");b(//gi,"[img]$1[/img]");b(/(.*?)<\/span>/gi,"[code]$1[/code]");b(/(.*?)<\/span>/gi,"[quote]$1[/quote]");b(/(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]");b(/(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]");b(/(.*?)<\/em>/gi,"[code][i]$1[/i][/code]");b(/(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]");b(/(.*?)<\/u>/gi,"[code][u]$1[/u][/code]");b(/(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]");b(/<\/(strong|b)>/gi,"[/b]");b(/<(strong|b)>/gi,"[b]");b(/<\/(em|i)>/gi,"[/i]");b(/<(em|i)>/gi,"[i]");b(/<\/u>/gi,"[/u]");b(/(.*?)<\/span>/gi,"[u]$1[/u]");b(//gi,"[u]");b(/]*>/gi,"[quote]");b(/<\/blockquote>/gi,"[/quote]");b(/
/gi,"\n");b(//gi,"\n");b(/
/gi,"\n");b(/

/gi,"");b(/<\/p>/gi,"\n");b(/ /gi," ");b(/"/gi,'"');b(/</gi,"<");b(/>/gi,">");b(/&/gi,"&");return a},_punbb_bbcode2html:function(a){a=tinymce.trim(a);function b(c,d){a=a.replace(c,d)}b(/\n/gi,"
");b(/\[b\]/gi,"");b(/\[\/b\]/gi,"");b(/\[i\]/gi,"");b(/\[\/i\]/gi,"");b(/\[u\]/gi,"");b(/\[\/u\]/gi,"");b(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'$2');b(/\[url\](.*?)\[\/url\]/gi,'$1');b(/\[img\](.*?)\[\/img\]/gi,'');b(/\[color=(.*?)\](.*?)\[\/color\]/gi,'$2');b(/\[code\](.*?)\[\/code\]/gi,'$1 ');b(/\[quote.*?\](.*?)\[\/quote\]/gi,'$1 ');return a}});tinymce.PluginManager.add("bbcode",tinymce.plugins.BBCodePlugin)})(); \ No newline at end of file diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/bbcode/editor_plugin_src.js b/code/simple_tinymce_field/javascript/tiny_mce/plugins/bbcode/editor_plugin_src.js deleted file mode 100644 index 1d7493e..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/bbcode/editor_plugin_src.js +++ /dev/null @@ -1,117 +0,0 @@ -/** - * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $ - * - * @author Moxiecode - * @copyright Copyright 2004-2008, Moxiecode Systems AB, All rights reserved. - */ - -(function() { - tinymce.create('tinymce.plugins.BBCodePlugin', { - init : function(ed, url) { - var t = this, dialect = ed.getParam('bbcode_dialect', 'punbb').toLowerCase(); - - ed.onBeforeSetContent.add(function(ed, o) { - o.content = t['_' + dialect + '_bbcode2html'](o.content); - }); - - ed.onPostProcess.add(function(ed, o) { - if (o.set) - o.content = t['_' + dialect + '_bbcode2html'](o.content); - - if (o.get) - o.content = t['_' + dialect + '_html2bbcode'](o.content); - }); - }, - - getInfo : function() { - return { - longname : 'BBCode Plugin', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - // Private methods - - // HTML -> BBCode in PunBB dialect - _punbb_html2bbcode : function(s) { - s = tinymce.trim(s); - - function rep(re, str) { - s = s.replace(re, str); - }; - - // example: to [b] - rep(/(.*?)<\/a>/gi,"[url=$1]$2[/url]"); - rep(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"); - rep(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"); - rep(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"); - rep(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"); - rep(/(.*?)<\/span>/gi,"[color=$1]$2[/color]"); - rep(/(.*?)<\/font>/gi,"[color=$1]$2[/color]"); - rep(/(.*?)<\/span>/gi,"[size=$1]$2[/size]"); - rep(/(.*?)<\/font>/gi,"$1"); - rep(//gi,"[img]$1[/img]"); - rep(/(.*?)<\/span>/gi,"[code]$1[/code]"); - rep(/(.*?)<\/span>/gi,"[quote]$1[/quote]"); - rep(/(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]"); - rep(/(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]"); - rep(/(.*?)<\/em>/gi,"[code][i]$1[/i][/code]"); - rep(/(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]"); - rep(/(.*?)<\/u>/gi,"[code][u]$1[/u][/code]"); - rep(/(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]"); - rep(/<\/(strong|b)>/gi,"[/b]"); - rep(/<(strong|b)>/gi,"[b]"); - rep(/<\/(em|i)>/gi,"[/i]"); - rep(/<(em|i)>/gi,"[i]"); - rep(/<\/u>/gi,"[/u]"); - rep(/(.*?)<\/span>/gi,"[u]$1[/u]"); - rep(//gi,"[u]"); - rep(/]*>/gi,"[quote]"); - rep(/<\/blockquote>/gi,"[/quote]"); - rep(/
/gi,"\n"); - rep(//gi,"\n"); - rep(/
/gi,"\n"); - rep(/

/gi,""); - rep(/<\/p>/gi,"\n"); - rep(/ /gi," "); - rep(/"/gi,"\""); - rep(/</gi,"<"); - rep(/>/gi,">"); - rep(/&/gi,"&"); - - return s; - }, - - // BBCode -> HTML from PunBB dialect - _punbb_bbcode2html : function(s) { - s = tinymce.trim(s); - - function rep(re, str) { - s = s.replace(re, str); - }; - - // example: [b] to - rep(/\n/gi,"
"); - rep(/\[b\]/gi,""); - rep(/\[\/b\]/gi,""); - rep(/\[i\]/gi,""); - rep(/\[\/i\]/gi,""); - rep(/\[u\]/gi,""); - rep(/\[\/u\]/gi,""); - rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"$2"); - rep(/\[url\](.*?)\[\/url\]/gi,"$1"); - rep(/\[img\](.*?)\[\/img\]/gi,""); - rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"$2"); - rep(/\[code\](.*?)\[\/code\]/gi,"$1 "); - rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"$1 "); - - return s; - } - }); - - // Register plugin - tinymce.PluginManager.add('bbcode', tinymce.plugins.BBCodePlugin); -})(); \ No newline at end of file diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/compat2x/editor_plugin.js b/code/simple_tinymce_field/javascript/tiny_mce/plugins/compat2x/editor_plugin.js deleted file mode 100644 index d921728..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/compat2x/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var c=tinymce.DOM,a=tinymce.dom.Event,d=tinymce.each,b=tinymce.is;tinymce.create("tinymce.plugins.Compat2x",{getInfo:function(){return{longname:"Compat2x",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/compat2x",version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}}});(function(){tinymce.extend(tinyMCE,{addToLang:function(f,e){d(e,function(h,g){tinyMCE.i18n[(tinyMCE.settings.language||"en")+"."+(f?f+"_":"")+g]=h})},getInstanceById:function(e){return this.get(e)}})})();(function(){var e=tinymce.EditorManager;tinyMCE.instances={};tinyMCE.plugins={};tinymce.PluginManager.onAdd.add(function(f,h,g){tinyMCE.plugins[h]=g});tinyMCE.majorVersion=tinymce.majorVersion;tinyMCE.minorVersion=tinymce.minorVersion;tinyMCE.releaseDate=tinymce.releaseDate;tinyMCE.baseURL=tinymce.baseURL;tinyMCE.isIE=tinyMCE.isMSIE=tinymce.isIE||tinymce.isOpera;tinyMCE.isMSIE5=tinymce.isIE;tinyMCE.isMSIE5_0=tinymce.isIE;tinyMCE.isMSIE7=tinymce.isIE;tinyMCE.isGecko=tinymce.isGecko;tinyMCE.isSafari=tinymce.isWebKit;tinyMCE.isOpera=tinymce.isOpera;tinyMCE.isMac=false;tinyMCE.isNS7=false;tinyMCE.isNS71=false;tinyMCE.compat=true;TinyMCE_Engine=tinyMCE;tinymce.extend(tinyMCE,{getParam:function(g,f){return this.activeEditor.getParam(g,f)},addEvent:function(i,g,h,j){tinymce.dom.Event.add(i,g,h,j||this)},getControlHTML:function(f){return e.activeEditor.controlManager.createControl(f)},loadCSS:function(f){tinymce.DOM.loadCSS(f)},importCSS:function(g,f){if(g==document){this.loadCSS(f)}else{new tinymce.dom.DOMUtils(g).loadCSS(f)}},log:function(){console.debug.apply(console,arguments)},getLang:function(h,g){var f=e.activeEditor.getLang(h.replace(/^lang_/g,""),g);if(/^[0-9\-.]+$/g.test(f)){return parseInt(f)}return f},isInstance:function(f){return f!=null&&typeof(f)=="object"&&f.execCommand},triggerNodeChange:function(){e.activeEditor.nodeChanged()},regexpReplace:function(j,f,h,i){var g;if(j==null){return j}if(typeof(i)=="undefined"){i="g"}g=new RegExp(f,i);return j.replace(g,h)},trim:function(f){return tinymce.trim(f)},xmlEncode:function(f){return tinymce.DOM.encode(f)},explode:function(f,h){var g=[];tinymce.each(f.split(h),function(i){if(i!=""){g.push(i)}});return g},switchClass:function(h,g){var f;if(/^mceButton/.test(g)){f=e.activeEditor.controlManager.get(h);if(!f){return}switch(g){case"mceButtonNormal":f.setDisabled(false);f.setActive(false);return;case"mceButtonDisabled":f.setDisabled(true);return;case"mceButtonSelected":f.setActive(true);f.setDisabled(false);return}}},addCSSClass:function(g,h,f){return tinymce.DOM.addClass(g,h,f)},hasCSSClass:function(f,g){return tinymce.DOM.hasClass(f,g)},removeCSSClass:function(f,g){return tinymce.DOM.removeClass(f,g)},getCSSClasses:function(){var f=e.activeEditor.dom.getClasses(),g=[];d(f,function(h){g.push(h["class"])});return g},setWindowArg:function(g,f){e.activeEditor.windowManager.params[g]=f},getWindowArg:function(i,g){var h=e.activeEditor.windowManager,f;f=h.getParam(i);if(f===""){return""}return f||h.getFeature(i)||g},getParentNode:function(h,g){return this._getDOM().getParent(h,g)},selectElements:function(o,k,m){var l,j=[],h,g;for(g=0,k=k.split(",");g - - - {#emotions_dlg.title} - - - - -

-
{#emotions_dlg.title}:

- - - - - - - - - - - - - - - - - - - - - - - - - - -
{#emotions_dlg.cool}{#emotions_dlg.cry}{#emotions_dlg.embarassed}{#emotions_dlg.foot_in_mouth}
{#emotions_dlg.frown}{#emotions_dlg.innocent}{#emotions_dlg.kiss}{#emotions_dlg.laughing}
{#emotions_dlg.money_mouth}{#emotions_dlg.sealed}{#emotions_dlg.smile}{#emotions_dlg.surprised}
{#emotions_dlg.tongue-out}{#emotions_dlg.undecided}{#emotions_dlg.wink}{#emotions_dlg.yell}
-
- - diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/img/smiley-cool.gif b/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/img/smiley-cool.gif deleted file mode 100644 index ba90cc3..0000000 Binary files a/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/img/smiley-cool.gif and /dev/null differ diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/img/smiley-cry.gif b/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/img/smiley-cry.gif deleted file mode 100644 index 74d897a..0000000 Binary files a/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/img/smiley-cry.gif and /dev/null differ diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/img/smiley-embarassed.gif b/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/img/smiley-embarassed.gif deleted file mode 100644 index 963a96b..0000000 Binary files a/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/img/smiley-embarassed.gif and /dev/null differ diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif b/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif deleted file mode 100644 index 16f68cc..0000000 Binary files a/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif and /dev/null differ diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/img/smiley-frown.gif b/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/img/smiley-frown.gif deleted file mode 100644 index 716f55e..0000000 Binary files a/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/img/smiley-frown.gif and /dev/null differ diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/img/smiley-innocent.gif b/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/img/smiley-innocent.gif deleted file mode 100644 index 334d49e..0000000 Binary files a/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/img/smiley-innocent.gif and /dev/null differ diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/img/smiley-kiss.gif b/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/img/smiley-kiss.gif deleted file mode 100644 index 4efd549..0000000 Binary files a/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/img/smiley-kiss.gif and /dev/null differ diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/img/smiley-laughing.gif b/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/img/smiley-laughing.gif deleted file mode 100644 index 1606c11..0000000 Binary files a/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/img/smiley-laughing.gif and /dev/null differ diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif b/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif deleted file mode 100644 index ca2451e..0000000 Binary files a/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif and /dev/null differ diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/img/smiley-sealed.gif b/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/img/smiley-sealed.gif deleted file mode 100644 index b33d3cc..0000000 Binary files a/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/img/smiley-sealed.gif and /dev/null differ diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/img/smiley-smile.gif b/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/img/smiley-smile.gif deleted file mode 100644 index e6a9e60..0000000 Binary files a/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/img/smiley-smile.gif and /dev/null differ diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/img/smiley-surprised.gif b/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/img/smiley-surprised.gif deleted file mode 100644 index cb99cdd..0000000 Binary files a/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/img/smiley-surprised.gif and /dev/null differ diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif b/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif deleted file mode 100644 index 2075dc1..0000000 Binary files a/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif and /dev/null differ diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/img/smiley-undecided.gif b/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/img/smiley-undecided.gif deleted file mode 100644 index bef7e25..0000000 Binary files a/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/img/smiley-undecided.gif and /dev/null differ diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/img/smiley-wink.gif b/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/img/smiley-wink.gif deleted file mode 100644 index 9faf1af..0000000 Binary files a/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/img/smiley-wink.gif and /dev/null differ diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/img/smiley-yell.gif b/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/img/smiley-yell.gif deleted file mode 100644 index 648e6e8..0000000 Binary files a/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/img/smiley-yell.gif and /dev/null differ diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/js/emotions.js b/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/js/emotions.js deleted file mode 100644 index c549367..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/js/emotions.js +++ /dev/null @@ -1,22 +0,0 @@ -tinyMCEPopup.requireLangPack(); - -var EmotionsDialog = { - init : function(ed) { - tinyMCEPopup.resizeToInnerSize(); - }, - - insert : function(file, title) { - var ed = tinyMCEPopup.editor, dom = ed.dom; - - tinyMCEPopup.execCommand('mceInsertContent', false, dom.createHTML('img', { - src : tinyMCEPopup.getWindowArg('plugin_url') + '/img/' + file, - alt : ed.getLang(title), - title : ed.getLang(title), - border : 0 - })); - - tinyMCEPopup.close(); - } -}; - -tinyMCEPopup.onInit.add(EmotionsDialog.init, EmotionsDialog); diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/langs/en_dlg.js b/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/langs/en_dlg.js deleted file mode 100644 index 3b57ad9..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/emotions/langs/en_dlg.js +++ /dev/null @@ -1,20 +0,0 @@ -tinyMCE.addI18n('en.emotions_dlg',{ -title:"Insert emotion", -desc:"Emotions", -cool:"Cool", -cry:"Cry", -embarassed:"Embarassed", -foot_in_mouth:"Foot in mouth", -frown:"Frown", -innocent:"Innocent", -kiss:"Kiss", -laughing:"Laughing", -money_mouth:"Money mouth", -sealed:"Sealed", -smile:"Smile", -surprised:"Surprised", -tongue_out:"Tongue out", -undecided:"Undecided", -wink:"Wink", -yell:"Yell" -}); \ No newline at end of file diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/example/dialog.htm b/code/simple_tinymce_field/javascript/tiny_mce/plugins/example/dialog.htm deleted file mode 100644 index b4c6284..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/example/dialog.htm +++ /dev/null @@ -1,27 +0,0 @@ - - - - {#example_dlg.title} - - - - - -
-

Here is a example dialog.

-

Selected text:

-

Custom arg:

- -
-
- -
- -
- -
-
-
- - - diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/example/editor_plugin.js b/code/simple_tinymce_field/javascript/tiny_mce/plugins/example/editor_plugin.js deleted file mode 100644 index ec1f81e..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/example/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.PluginManager.requireLangPack("example");tinymce.create("tinymce.plugins.ExamplePlugin",{init:function(a,b){a.addCommand("mceExample",function(){a.windowManager.open({file:b+"/dialog.htm",width:320+parseInt(a.getLang("example.delta_width",0)),height:120+parseInt(a.getLang("example.delta_height",0)),inline:1},{plugin_url:b,some_custom_arg:"custom arg"})});a.addButton("example",{title:"example.desc",cmd:"mceExample",image:b+"/img/example.gif"});a.onNodeChange.add(function(d,c,e){c.setActive("example",e.nodeName=="IMG")})},createControl:function(b,a){return null},getInfo:function(){return{longname:"Example plugin",author:"Some author",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example",version:"1.0"}}});tinymce.PluginManager.add("example",tinymce.plugins.ExamplePlugin)})(); \ No newline at end of file diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/example/editor_plugin_src.js b/code/simple_tinymce_field/javascript/tiny_mce/plugins/example/editor_plugin_src.js deleted file mode 100644 index 5050550..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/example/editor_plugin_src.js +++ /dev/null @@ -1,81 +0,0 @@ -/** - * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $ - * - * @author Moxiecode - * @copyright Copyright 2004-2008, Moxiecode Systems AB, All rights reserved. - */ - -(function() { - // Load plugin specific language pack - tinymce.PluginManager.requireLangPack('example'); - - tinymce.create('tinymce.plugins.ExamplePlugin', { - /** - * Initializes the plugin, this will be executed after the plugin has been created. - * This call is done before the editor instance has finished it's initialization so use the onInit event - * of the editor instance to intercept that event. - * - * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. - * @param {string} url Absolute URL to where the plugin is located. - */ - init : function(ed, url) { - // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample'); - ed.addCommand('mceExample', function() { - ed.windowManager.open({ - file : url + '/dialog.htm', - width : 320 + parseInt(ed.getLang('example.delta_width', 0)), - height : 120 + parseInt(ed.getLang('example.delta_height', 0)), - inline : 1 - }, { - plugin_url : url, // Plugin absolute URL - some_custom_arg : 'custom arg' // Custom argument - }); - }); - - // Register example button - ed.addButton('example', { - title : 'example.desc', - cmd : 'mceExample', - image : url + '/img/example.gif' - }); - - // Add a node change handler, selects the button in the UI when a image is selected - ed.onNodeChange.add(function(ed, cm, n) { - cm.setActive('example', n.nodeName == 'IMG'); - }); - }, - - /** - * Creates control instances based in the incomming name. This method is normally not - * needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons - * but you sometimes need to create more complex controls like listboxes, split buttons etc then this - * method can be used to create those. - * - * @param {String} n Name of the control to create. - * @param {tinymce.ControlManager} cm Control manager to use inorder to create new control. - * @return {tinymce.ui.Control} New control instance or null if no control was created. - */ - createControl : function(n, cm) { - return null; - }, - - /** - * Returns information about the plugin as a name/value array. - * The current keys are longname, author, authorurl, infourl and version. - * - * @return {Object} Name/value array containing information about the plugin. - */ - getInfo : function() { - return { - longname : 'Example plugin', - author : 'Some author', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example', - version : "1.0" - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('example', tinymce.plugins.ExamplePlugin); -})(); \ No newline at end of file diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/example/img/example.gif b/code/simple_tinymce_field/javascript/tiny_mce/plugins/example/img/example.gif deleted file mode 100644 index 1ab5da4..0000000 Binary files a/code/simple_tinymce_field/javascript/tiny_mce/plugins/example/img/example.gif and /dev/null differ diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/example/js/dialog.js b/code/simple_tinymce_field/javascript/tiny_mce/plugins/example/js/dialog.js deleted file mode 100644 index fa83411..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/example/js/dialog.js +++ /dev/null @@ -1,19 +0,0 @@ -tinyMCEPopup.requireLangPack(); - -var ExampleDialog = { - init : function() { - var f = document.forms[0]; - - // Get the selected contents as text and place it in the input - f.someval.value = tinyMCEPopup.editor.selection.getContent({format : 'text'}); - f.somearg.value = tinyMCEPopup.getWindowArg('some_custom_arg'); - }, - - insert : function() { - // Insert the contents from the input into the document - tinyMCEPopup.editor.execCommand('mceInsertContent', false, document.forms[0].someval.value); - tinyMCEPopup.close(); - } -}; - -tinyMCEPopup.onInit.add(ExampleDialog.init, ExampleDialog); diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/example/langs/en.js b/code/simple_tinymce_field/javascript/tiny_mce/plugins/example/langs/en.js deleted file mode 100644 index e0784f8..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/example/langs/en.js +++ /dev/null @@ -1,3 +0,0 @@ -tinyMCE.addI18n('en.example',{ - desc : 'This is just a template button' -}); diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/example/langs/en_dlg.js b/code/simple_tinymce_field/javascript/tiny_mce/plugins/example/langs/en_dlg.js deleted file mode 100644 index ebcf948..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/example/langs/en_dlg.js +++ /dev/null @@ -1,3 +0,0 @@ -tinyMCE.addI18n('en.example_dlg',{ - title : 'This is just a example title' -}); diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/fullpage/css/fullpage.css b/code/simple_tinymce_field/javascript/tiny_mce/plugins/fullpage/css/fullpage.css deleted file mode 100644 index 7a3334f..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/fullpage/css/fullpage.css +++ /dev/null @@ -1,182 +0,0 @@ -/* Hide the advanced tab */ -#advanced_tab { - display: none; -} - -#metatitle, #metakeywords, #metadescription, #metaauthor, #metacopyright { - width: 280px; -} - -#doctype, #docencoding { - width: 200px; -} - -#langcode { - width: 30px; -} - -#bgimage { - width: 220px; -} - -#fontface { - width: 240px; -} - -#leftmargin, #rightmargin, #topmargin, #bottommargin { - width: 50px; -} - -.panel_wrapper div.current { - height: 400px; -} - -#stylesheet, #style { - width: 240px; -} - -/* Head list classes */ - -.headlistwrapper { - width: 100%; -} - -.addbutton, .removebutton, .moveupbutton, .movedownbutton { - border-top: 1px solid; - border-left: 1px solid; - border-bottom: 1px solid; - border-right: 1px solid; - border-color: #F0F0EE; - cursor: default; - display: block; - width: 20px; - height: 20px; -} - -#doctypes { - width: 200px; -} - -.addbutton:hover, .removebutton:hover, .moveupbutton:hover, .movedownbutton:hover { - border: 1px solid #0A246A; - background-color: #B6BDD2; -} - -.addbutton { - background-image: url('../images/add.gif'); - float: left; - margin-right: 3px; -} - -.removebutton { - background-image: url('../images/remove.gif'); - float: left; -} - -.moveupbutton { - background-image: url('../images/move_up.gif'); - float: left; - margin-right: 3px; -} - -.movedownbutton { - background-image: url('../images/move_down.gif'); - float: left; -} - -.selected { - border: 1px solid #0A246A; - background-color: #B6BDD2; -} - -.toolbar { - width: 100%; -} - -#headlist { - width: 100%; - margin-top: 3px; - font-size: 11px; -} - -#info, #title_element, #meta_element, #script_element, #style_element, #base_element, #link_element, #comment_element, #unknown_element { - display: none; -} - -#addmenu { - position: absolute; - border: 1px solid gray; - display: none; - z-index: 100; - background-color: white; -} - -#addmenu a { - display: block; - width: 100%; - line-height: 20px; - text-decoration: none; - background-color: white; -} - -#addmenu a:hover { - background-color: #B6BDD2; - color: black; -} - -#addmenu span { - padding-left: 10px; - padding-right: 10px; -} - -#updateElementPanel { - display: none; -} - -#script_element .panel_wrapper div.current { - height: 108px; -} - -#style_element .panel_wrapper div.current { - height: 108px; -} - -#link_element .panel_wrapper div.current { - height: 140px; -} - -#element_script_value { - width: 100%; - height: 100px; -} - -#element_comment_value { - width: 100%; - height: 120px; -} - -#element_style_value { - width: 100%; - height: 100px; -} - -#element_title, #element_script_src, #element_meta_name, #element_meta_content, #element_base_href, #element_link_href, #element_link_title { - width: 250px; -} - -.updateElementButton { - margin-top: 3px; -} - -/* MSIE specific styles */ - -* html .addbutton, * html .removebutton, * html .moveupbutton, * html .movedownbutton { - width: 22px; - height: 22px; -} - -textarea { - height: 55px; -} - -.panel_wrapper div.current {height:420px;} \ No newline at end of file diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/fullpage/editor_plugin.js b/code/simple_tinymce_field/javascript/tiny_mce/plugins/fullpage/editor_plugin.js deleted file mode 100644 index 8e11bfc..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/fullpage/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.FullPagePlugin",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceFullPageProperties",function(){a.windowManager.open({file:b+"/fullpage.htm",width:430+parseInt(a.getLang("fullpage.delta_width",0)),height:495+parseInt(a.getLang("fullpage.delta_height",0)),inline:1},{plugin_url:b,head_html:c.head})});a.addButton("fullpage",{title:"fullpage.desc",cmd:"mceFullPageProperties"});a.onBeforeSetContent.add(c._setContent,c);a.onSetContent.add(c._setBodyAttribs,c);a.onGetContent.add(c._getContent,c)},getInfo:function(){return{longname:"Fullpage",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_setBodyAttribs:function(d,a){var l,c,e,g,b,h,j,f=this.head.match(/body(.*?)>/i);if(f&&f[1]){l=f[1].match(/\s*(\w+\s*=\s*".*?"|\w+\s*=\s*'.*?'|\w+\s*=\s*\w+|\w+)\s*/g);if(l){for(c=0,e=l.length;c",a);h.head=f.substring(0,a+1);j=f.indexOf("\n'}h.head+=d.getParam("fullpage_default_doctype",'');h.head+="\n\n\n"+d.getParam("fullpage_default_title","Untitled document")+"\n";if(g=d.getParam("fullpage_default_encoding")){h.head+='\n'}if(g=d.getParam("fullpage_default_font_family")){i+="font-family: "+g+";"}if(g=d.getParam("fullpage_default_font_size")){i+="font-size: "+g+";"}if(g=d.getParam("fullpage_default_text_color")){i+="color: "+g+";"}h.head+="\n\n";h.foot="\n\n"}},_getContent:function(a,c){var b=this;if(!c.source_view||!a.getParam("fullpage_hide_in_source_view")){c.content=tinymce.trim(b.head)+"\n"+tinymce.trim(c.content)+"\n"+tinymce.trim(b.foot)}}});tinymce.PluginManager.add("fullpage",tinymce.plugins.FullPagePlugin)})(); \ No newline at end of file diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/fullpage/editor_plugin_src.js b/code/simple_tinymce_field/javascript/tiny_mce/plugins/fullpage/editor_plugin_src.js deleted file mode 100644 index c7d5aca..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/fullpage/editor_plugin_src.js +++ /dev/null @@ -1,146 +0,0 @@ -/** - * $Id: editor_plugin_src.js 1029 2009-02-24 22:32:21Z spocke $ - * - * @author Moxiecode - * @copyright Copyright 2004-2008, Moxiecode Systems AB, All rights reserved. - */ - -(function() { - tinymce.create('tinymce.plugins.FullPagePlugin', { - init : function(ed, url) { - var t = this; - - t.editor = ed; - - // Register commands - ed.addCommand('mceFullPageProperties', function() { - ed.windowManager.open({ - file : url + '/fullpage.htm', - width : 430 + parseInt(ed.getLang('fullpage.delta_width', 0)), - height : 495 + parseInt(ed.getLang('fullpage.delta_height', 0)), - inline : 1 - }, { - plugin_url : url, - head_html : t.head - }); - }); - - // Register buttons - ed.addButton('fullpage', {title : 'fullpage.desc', cmd : 'mceFullPageProperties'}); - - ed.onBeforeSetContent.add(t._setContent, t); - ed.onSetContent.add(t._setBodyAttribs, t); - ed.onGetContent.add(t._getContent, t); - }, - - getInfo : function() { - return { - longname : 'Fullpage', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - // Private plugin internal methods - - _setBodyAttribs : function(ed, o) { - var bdattr, i, len, kv, k, v, t, attr = this.head.match(/body(.*?)>/i); - - if (attr && attr[1]) { - bdattr = attr[1].match(/\s*(\w+\s*=\s*".*?"|\w+\s*=\s*'.*?'|\w+\s*=\s*\w+|\w+)\s*/g); - - if (bdattr) { - for(i = 0, len = bdattr.length; i < len; i++) { - kv = bdattr[i].split('='); - k = kv[0].replace(/\s/,''); - v = kv[1]; - - if (v) { - v = v.replace(/^\s+/,'').replace(/\s+$/,''); - t = v.match(/^["'](.*)["']$/); - - if (t) - v = t[1]; - } else - v = k; - - ed.dom.setAttrib(ed.getBody(), 'style', v); - } - } - } - }, - - _createSerializer : function() { - return new tinymce.dom.Serializer({ - dom : this.editor.dom, - apply_source_formatting : true - }); - }, - - _setContent : function(ed, o) { - var t = this, sp, ep, c = o.content, v, st = ''; - - if (o.source_view && ed.getParam('fullpage_hide_in_source_view')) - return; - - // Parse out head, body and footer - c = c.replace(/<(\/?)BODY/gi, '<$1body'); - sp = c.indexOf('', sp); - t.head = c.substring(0, sp + 1); - - ep = c.indexOf('\n'; - - t.head += ed.getParam('fullpage_default_doctype', ''); - t.head += '\n\n\n' + ed.getParam('fullpage_default_title', 'Untitled document') + '\n'; - - if (v = ed.getParam('fullpage_default_encoding')) - t.head += '\n'; - - if (v = ed.getParam('fullpage_default_font_family')) - st += 'font-family: ' + v + ';'; - - if (v = ed.getParam('fullpage_default_font_size')) - st += 'font-size: ' + v + ';'; - - if (v = ed.getParam('fullpage_default_text_color')) - st += 'color: ' + v + ';'; - - t.head += '\n\n'; - t.foot = '\n\n'; - } - }, - - _getContent : function(ed, o) { - var t = this; - - if (!o.source_view || !ed.getParam('fullpage_hide_in_source_view')) - o.content = tinymce.trim(t.head) + '\n' + tinymce.trim(o.content) + '\n' + tinymce.trim(t.foot); - } - }); - - // Register plugin - tinymce.PluginManager.add('fullpage', tinymce.plugins.FullPagePlugin); -})(); \ No newline at end of file diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/fullpage/fullpage.htm b/code/simple_tinymce_field/javascript/tiny_mce/plugins/fullpage/fullpage.htm deleted file mode 100644 index 3ea4081..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/fullpage/fullpage.htm +++ /dev/null @@ -1,576 +0,0 @@ - - - - {#fullpage_dlg.title} - - - - - - - -
- - -
-
-
- {#fullpage_dlg.meta_props} - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
 
 
 
 
  - -
-
- -
- {#fullpage_dlg.langprops} - - - - - - - - - - - - - - - - - - - - - - -
- -
  - -
 
- -
 
-
-
- -
-
- {#fullpage_dlg.appearance_textprops} - - - - - - - - - - - - - - - - -
- -
- -
- - - - - -
 
-
-
- -
- {#fullpage_dlg.appearance_bgprops} - - - - - - - - - - -
- - - - - -
 
-
- - - - - -
 
-
-
- -
- {#fullpage_dlg.appearance_marginprops} - - - - - - - - - - - - - - -
-
- -
- {#fullpage_dlg.appearance_linkprops} - - - - - - - - - - - - - - - - - - - -
- - - - - -
-
- - - - - -
 
-
- - - - - -
 
-
  
-
- -
- {#fullpage_dlg.appearance_style} - - - - - - - - - - -
- - - - -
 
-
-
- -
- - -
- {#fullpage_dlg.head_elements} - -
-
-
- - -
-
- - -
-
-
- -
-
- -
- {#fullpage_dlg.meta_element} - - - - - - - - - - - - - - -
- - -
- -
- {#fullpage_dlg.title_element} - - - - - - -
- - -
- -
- {#fullpage_dlg.script_element} - - - -
- -
-
- - - - - - - - - - - - - - - - - -
- - - - -
 
-
- -
- -
-
- - -
- -
- {#fullpage_dlg.style_element} - - - -
- -
-
- - - - - - - - - -
-
- -
- -
-
- - -
- -
- {#fullpage_dlg.base_element} - - - - - - - - - - -
- - -
- - - -
- {#fullpage_dlg.comment_element} - - - - -
-
-
- -
-
- -
- -
- -
-
-
- - diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/fullpage/js/fullpage.js b/code/simple_tinymce_field/javascript/tiny_mce/plugins/fullpage/js/fullpage.js deleted file mode 100644 index 89059ef..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/fullpage/js/fullpage.js +++ /dev/null @@ -1,461 +0,0 @@ -tinyMCEPopup.requireLangPack(); - -var doc; - -var defaultDocTypes = - 'XHTML 1.0 Transitional=,' + - 'XHTML 1.0 Frameset=,' + - 'XHTML 1.0 Strict=,' + - 'XHTML 1.1=,' + - 'HTML 4.01 Transitional=,' + - 'HTML 4.01 Strict=,' + - 'HTML 4.01 Frameset='; - -var defaultEncodings = - 'Western european (iso-8859-1)=iso-8859-1,' + - 'Central European (iso-8859-2)=iso-8859-2,' + - 'Unicode (UTF-8)=utf-8,' + - 'Chinese traditional (Big5)=big5,' + - 'Cyrillic (iso-8859-5)=iso-8859-5,' + - 'Japanese (iso-2022-jp)=iso-2022-jp,' + - 'Greek (iso-8859-7)=iso-8859-7,' + - 'Korean (iso-2022-kr)=iso-2022-kr,' + - 'ASCII (us-ascii)=us-ascii'; - -var defaultMediaTypes = - 'all=all,' + - 'screen=screen,' + - 'print=print,' + - 'tty=tty,' + - 'tv=tv,' + - 'projection=projection,' + - 'handheld=handheld,' + - 'braille=braille,' + - 'aural=aural'; - -var defaultFontNames = 'Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings'; -var defaultFontSizes = '10px,11px,12px,13px,14px,15px,16px'; - -function init() { - var f = document.forms['fullpage'], el = f.elements, e, i, p, doctypes, encodings, mediaTypes, fonts, ed = tinyMCEPopup.editor, dom = tinyMCEPopup.dom, style; - - // Setup doctype select box - doctypes = ed.getParam("fullpage_doctypes", defaultDocTypes).split(','); - for (i=0; i 1) - addSelectValue(f, 'doctypes', p[0], p[1]); - } - - // Setup fonts select box - fonts = ed.getParam("fullpage_fonts", defaultFontNames).split(';'); - for (i=0; i 1) - addSelectValue(f, 'fontface', p[0], p[1]); - } - - // Setup fontsize select box - fonts = ed.getParam("fullpage_fontsizes", defaultFontSizes).split(','); - for (i=0; i 1) { - addSelectValue(f, 'element_style_media', p[0], p[1]); - addSelectValue(f, 'element_link_media', p[0], p[1]); - } - } - - // Setup encodings select box - encodings = ed.getParam("fullpage_encodings", defaultEncodings).split(','); - for (i=0; i 1) { - addSelectValue(f, 'docencoding', p[0], p[1]); - addSelectValue(f, 'element_script_charset', p[0], p[1]); - addSelectValue(f, 'element_link_charset', p[0], p[1]); - } - } - - document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); - document.getElementById('link_color_pickcontainer').innerHTML = getColorPickerHTML('link_color_pick','link_color'); - //document.getElementById('hover_color_pickcontainer').innerHTML = getColorPickerHTML('hover_color_pick','hover_color'); - document.getElementById('visited_color_pickcontainer').innerHTML = getColorPickerHTML('visited_color_pick','visited_color'); - document.getElementById('active_color_pickcontainer').innerHTML = getColorPickerHTML('active_color_pick','active_color'); - document.getElementById('textcolor_pickcontainer').innerHTML = getColorPickerHTML('textcolor_pick','textcolor'); - document.getElementById('stylesheet_browsercontainer').innerHTML = getBrowserHTML('stylesheetbrowser','stylesheet','file','fullpage'); - document.getElementById('link_href_pickcontainer').innerHTML = getBrowserHTML('link_href_browser','element_link_href','file','fullpage'); - document.getElementById('script_src_pickcontainer').innerHTML = getBrowserHTML('script_src_browser','element_script_src','file','fullpage'); - document.getElementById('bgimage_pickcontainer').innerHTML = getBrowserHTML('bgimage_browser','bgimage','image','fullpage'); - - // Resize some elements - if (isVisible('stylesheetbrowser')) - document.getElementById('stylesheet').style.width = '220px'; - - if (isVisible('link_href_browser')) - document.getElementById('element_link_href').style.width = '230px'; - - if (isVisible('bgimage_browser')) - document.getElementById('bgimage').style.width = '210px'; - - // Add iframe - dom.add(document.body, 'iframe', {id : 'documentIframe', src : 'javascript:""', style : {display : 'none'}}); - doc = dom.get('documentIframe').contentWindow.document; - h = tinyMCEPopup.getWindowArg('head_html'); - - // Preprocess the HTML disable scripts and urls - h = h.replace(/ - - - -
- -
- - - - - diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/iespell/editor_plugin.js b/code/simple_tinymce_field/javascript/tiny_mce/plugins/iespell/editor_plugin.js deleted file mode 100644 index e9cba10..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/iespell/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.IESpell",{init:function(a,b){var c=this,d;if(!tinymce.isIE){return}c.editor=a;a.addCommand("mceIESpell",function(){try{d=new ActiveXObject("ieSpell.ieSpellExtension");d.CheckDocumentNode(a.getDoc().documentElement)}catch(f){if(f.number==-2146827859){a.windowManager.confirm(a.getLang("iespell.download"),function(e){if(e){window.open("http://www.iespell.com/download.php","ieSpellDownload","")}})}else{a.windowManager.alert("Error Loading ieSpell: Exception "+f.number)}}});a.addButton("iespell",{title:"iespell.iespell_desc",cmd:"mceIESpell"})},getInfo:function(){return{longname:"IESpell (IE Only)",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/iespell",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("iespell",tinymce.plugins.IESpell)})(); \ No newline at end of file diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/iespell/editor_plugin_src.js b/code/simple_tinymce_field/javascript/tiny_mce/plugins/iespell/editor_plugin_src.js deleted file mode 100644 index a68f69a..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/iespell/editor_plugin_src.js +++ /dev/null @@ -1,51 +0,0 @@ -/** - * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $ - * - * @author Moxiecode - * @copyright Copyright 2004-2008, Moxiecode Systems AB, All rights reserved. - */ - -(function() { - tinymce.create('tinymce.plugins.IESpell', { - init : function(ed, url) { - var t = this, sp; - - if (!tinymce.isIE) - return; - - t.editor = ed; - - // Register commands - ed.addCommand('mceIESpell', function() { - try { - sp = new ActiveXObject("ieSpell.ieSpellExtension"); - sp.CheckDocumentNode(ed.getDoc().documentElement); - } catch (e) { - if (e.number == -2146827859) { - ed.windowManager.confirm(ed.getLang("iespell.download"), function(s) { - if (s) - window.open('http://www.iespell.com/download.php', 'ieSpellDownload', ''); - }); - } else - ed.windowManager.alert("Error Loading ieSpell: Exception " + e.number); - } - }); - - // Register buttons - ed.addButton('iespell', {title : 'iespell.iespell_desc', cmd : 'mceIESpell'}); - }, - - getInfo : function() { - return { - longname : 'IESpell (IE Only)', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/iespell', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('iespell', tinymce.plugins.IESpell); -})(); \ No newline at end of file diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/inlinepopups/editor_plugin.js b/code/simple_tinymce_field/javascript/tiny_mce/plugins/inlinepopups/editor_plugin.js deleted file mode 100644 index 07ea477..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/inlinepopups/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var d=tinymce.DOM,b=tinymce.dom.Element,a=tinymce.dom.Event,e=tinymce.each,c=tinymce.is;tinymce.create("tinymce.plugins.InlinePopups",{init:function(f,g){f.onBeforeRenderUI.add(function(){f.windowManager=new tinymce.InlineWindowManager(f);d.loadCSS(g+"/skins/"+(f.settings.inlinepopups_skin||"clearlooks2")+"/window.css")})},getInfo:function(){return{longname:"InlinePopups",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.create("tinymce.InlineWindowManager:tinymce.WindowManager",{InlineWindowManager:function(f){var g=this;g.parent(f);g.zIndex=300000;g.count=0;g.windows={}},open:function(r,j){var y=this,i,k="",q=y.editor,g=0,s=0,h,m,n,o,l,v,x;r=r||{};j=j||{};if(!r.inline){return y.parent(r,j)}if(!r.type){y.bookmark=q.selection.getBookmark(1)}i=d.uniqueId();h=d.getViewPort();r.width=parseInt(r.width||320);r.height=parseInt(r.height||240)+(tinymce.isIE?8:0);r.min_width=parseInt(r.min_width||150);r.min_height=parseInt(r.min_height||100);r.max_width=parseInt(r.max_width||2000);r.max_height=parseInt(r.max_height||2000);r.left=r.left||Math.round(Math.max(h.x,h.x+(h.w/2)-(r.width/2)));r.top=r.top||Math.round(Math.max(h.y,h.y+(h.h/2)-(r.height/2)));r.movable=r.resizable=true;j.mce_width=r.width;j.mce_height=r.height;j.mce_inline=true;j.mce_window_id=i;j.mce_auto_focus=r.auto_focus;y.features=r;y.params=j;y.onOpen.dispatch(y,r,j);if(r.type){k+=" mceModal";if(r.type){k+=" mce"+r.type.substring(0,1).toUpperCase()+r.type.substring(1)}r.resizable=false}if(r.statusbar){k+=" mceStatusbar"}if(r.resizable){k+=" mceResizable"}if(r.minimizable){k+=" mceMinimizable"}if(r.maximizable){k+=" mceMaximizable"}if(r.movable){k+=" mceMovable"}y._addAll(d.doc.body,["div",{id:i,"class":q.settings.inlinepopups_skin||"clearlooks2",style:"width:100px;height:100px"},["div",{id:i+"_wrapper","class":"mceWrapper"+k},["div",{id:i+"_top","class":"mceTop"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_title"},r.title||""]],["div",{id:i+"_middle","class":"mceMiddle"},["div",{id:i+"_left","class":"mceLeft"}],["span",{id:i+"_content"}],["div",{id:i+"_right","class":"mceRight"}]],["div",{id:i+"_bottom","class":"mceBottom"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_status"},"Content"]],["a",{"class":"mceMove",tabindex:"-1",href:"javascript:;"}],["a",{"class":"mceMin",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMax",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMed",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceClose",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{id:i+"_resize_n","class":"mceResize mceResizeN",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_s","class":"mceResize mceResizeS",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_w","class":"mceResize mceResizeW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_e","class":"mceResize mceResizeE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_nw","class":"mceResize mceResizeNW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_ne","class":"mceResize mceResizeNE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_sw","class":"mceResize mceResizeSW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_se","class":"mceResize mceResizeSE",tabindex:"-1",href:"javascript:;"}]]]);d.setStyles(i,{top:-10000,left:-10000});if(tinymce.isGecko){d.setStyle(i,"overflow","auto")}if(!r.type){g+=d.get(i+"_left").clientWidth;g+=d.get(i+"_right").clientWidth;s+=d.get(i+"_top").clientHeight;s+=d.get(i+"_bottom").clientHeight}d.setStyles(i,{top:r.top,left:r.left,width:r.width+g,height:r.height+s});x=r.url||r.file;if(x){if(tinymce.relaxedDomain){x+=(x.indexOf("?")==-1?"?":"&")+"mce_rdomain="+tinymce.relaxedDomain}x=tinymce._addVer(x)}if(!r.type){d.add(i+"_content","iframe",{id:i+"_ifr",src:'javascript:""',frameBorder:0,style:"border:0;width:10px;height:10px"});d.setStyles(i+"_ifr",{width:r.width,height:r.height});d.setAttrib(i+"_ifr","src",x)}else{d.add(i+"_wrapper","a",{id:i+"_ok","class":"mceButton mceOk",href:"javascript:;",onmousedown:"return false;"},"Ok");if(r.type=="confirm"){d.add(i+"_wrapper","a",{"class":"mceButton mceCancel",href:"javascript:;",onmousedown:"return false;"},"Cancel")}d.add(i+"_middle","div",{"class":"mceIcon"});d.setHTML(i+"_content",r.content.replace("\n","
"))}n=a.add(i,"mousedown",function(t){var u=t.target,f,p;f=y.windows[i];y.focus(i);if(u.nodeName=="A"||u.nodeName=="a"){if(u.className=="mceMax"){f.oldPos=f.element.getXY();f.oldSize=f.element.getSize();p=d.getViewPort();p.w-=2;p.h-=2;f.element.moveTo(p.x,p.y);f.element.resizeTo(p.w,p.h);d.setStyles(i+"_ifr",{width:p.w-f.deltaWidth,height:p.h-f.deltaHeight});d.addClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMed"){f.element.moveTo(f.oldPos.x,f.oldPos.y);f.element.resizeTo(f.oldSize.w,f.oldSize.h);f.iframeElement.resizeTo(f.oldSize.w-f.deltaWidth,f.oldSize.h-f.deltaHeight);d.removeClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMove"){return y._startDrag(i,t,u.className)}else{if(d.hasClass(u,"mceResize")){return y._startDrag(i,t,u.className.substring(13))}}}}}});o=a.add(i,"click",function(f){var p=f.target;y.focus(i);if(p.nodeName=="A"||p.nodeName=="a"){switch(p.className){case"mceClose":y.close(null,i);return a.cancel(f);case"mceButton mceOk":case"mceButton mceCancel":r.button_func(p.className=="mceButton mceOk");return a.cancel(f)}}});v=y.windows[i]={id:i,mousedown_func:n,click_func:o,element:new b(i,{blocker:1,container:q.getContainer()}),iframeElement:new b(i+"_ifr"),features:r,deltaWidth:g,deltaHeight:s};v.iframeElement.on("focus",function(){y.focus(i)});if(y.count==0&&y.editor.getParam("dialog_type","modal")=="modal"){d.add(d.doc.body,"div",{id:"mceModalBlocker","class":(y.editor.settings.inlinepopups_skin||"clearlooks2")+"_modalBlocker",style:{zIndex:y.zIndex-1}});d.show("mceModalBlocker")}else{d.setStyle("mceModalBlocker","z-index",y.zIndex-1)}if(tinymce.isIE6||/Firefox\/2\./.test(navigator.userAgent)||(tinymce.isIE&&!d.boxModel)){d.setStyles("mceModalBlocker",{position:"absolute",left:h.x,top:h.y,width:h.w-2,height:h.h-2})}y.focus(i);y._fixIELayout(i,1);if(d.get(i+"_ok")){d.get(i+"_ok").focus()}y.count++;return v},focus:function(h){var g=this,f;if(f=g.windows[h]){f.zIndex=this.zIndex++;f.element.setStyle("zIndex",f.zIndex);f.element.update();h=h+"_wrapper";d.removeClass(g.lastId,"mceFocus");d.addClass(h,"mceFocus");g.lastId=h}},_addAll:function(k,h){var g,l,f=this,j=tinymce.DOM;if(c(h,"string")){k.appendChild(j.doc.createTextNode(h))}else{if(h.length){k=k.appendChild(j.create(h[0],h[1]));for(g=2;gf){i=m;f=m.zIndex}});if(i){h.focus(i.id)}}},setTitle:function(f,g){var h;f=this._findId(f);if(h=d.get(f+"_title")){h.innerHTML=d.encode(g)}},alert:function(g,f,j){var i=this,h;h=i.open({title:i,type:"alert",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},confirm:function(g,f,j){var i=this,h;h=i.open({title:i,type:"confirm",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},_findId:function(f){var g=this;if(typeof(f)=="string"){return f}e(g.windows,function(h){var i=d.get(h.id+"_ifr");if(i&&f==i.contentWindow){f=h.id;return false}});return f},_fixIELayout:function(i,h){var f,g;if(!tinymce.isIE6){return}e(["n","s","w","e","nw","ne","sw","se"],function(j){var k=d.get(i+"_resize_"+j);d.setStyles(k,{width:h?k.clientWidth:"",height:h?k.clientHeight:"",cursor:d.getStyle(k,"cursor",1)});d.setStyle(i+"_bottom","bottom","-1px");k=0});if(f=this.windows[i]){f.element.hide();f.element.show();e(d.select("div,a",i),function(k,j){if(k.currentStyle.backgroundImage!="none"){g=new Image();g.src=k.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/,"$1")}});d.get(i).style.filter=""}}});tinymce.PluginManager.add("inlinepopups",tinymce.plugins.InlinePopups)})(); \ No newline at end of file diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/inlinepopups/editor_plugin_src.js b/code/simple_tinymce_field/javascript/tiny_mce/plugins/inlinepopups/editor_plugin_src.js deleted file mode 100644 index fffca5a..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/inlinepopups/editor_plugin_src.js +++ /dev/null @@ -1,632 +0,0 @@ -/** - * $Id: editor_plugin_src.js 1150 2009-06-01 11:50:46Z spocke $ - * - * @author Moxiecode - * @copyright Copyright 2004-2008, Moxiecode Systems AB, All rights reserved. - */ - -(function() { - var DOM = tinymce.DOM, Element = tinymce.dom.Element, Event = tinymce.dom.Event, each = tinymce.each, is = tinymce.is; - - tinymce.create('tinymce.plugins.InlinePopups', { - init : function(ed, url) { - // Replace window manager - ed.onBeforeRenderUI.add(function() { - ed.windowManager = new tinymce.InlineWindowManager(ed); - DOM.loadCSS(url + '/skins/' + (ed.settings.inlinepopups_skin || 'clearlooks2') + "/window.css"); - }); - }, - - getInfo : function() { - return { - longname : 'InlinePopups', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - tinymce.create('tinymce.InlineWindowManager:tinymce.WindowManager', { - InlineWindowManager : function(ed) { - var t = this; - - t.parent(ed); - t.zIndex = 300000; - t.count = 0; - t.windows = {}; - }, - - open : function(f, p) { - var t = this, id, opt = '', ed = t.editor, dw = 0, dh = 0, vp, po, mdf, clf, we, w, u; - - f = f || {}; - p = p || {}; - - // Run native windows - if (!f.inline) - return t.parent(f, p); - - // Only store selection if the type is a normal window - if (!f.type) - t.bookmark = ed.selection.getBookmark(1); - - id = DOM.uniqueId(); - vp = DOM.getViewPort(); - f.width = parseInt(f.width || 320); - f.height = parseInt(f.height || 240) + (tinymce.isIE ? 8 : 0); - f.min_width = parseInt(f.min_width || 150); - f.min_height = parseInt(f.min_height || 100); - f.max_width = parseInt(f.max_width || 2000); - f.max_height = parseInt(f.max_height || 2000); - f.left = f.left || Math.round(Math.max(vp.x, vp.x + (vp.w / 2.0) - (f.width / 2.0))); - f.top = f.top || Math.round(Math.max(vp.y, vp.y + (vp.h / 2.0) - (f.height / 2.0))); - f.movable = f.resizable = true; - p.mce_width = f.width; - p.mce_height = f.height; - p.mce_inline = true; - p.mce_window_id = id; - p.mce_auto_focus = f.auto_focus; - - // Transpose -// po = DOM.getPos(ed.getContainer()); -// f.left -= po.x; -// f.top -= po.y; - - t.features = f; - t.params = p; - t.onOpen.dispatch(t, f, p); - - if (f.type) { - opt += ' mceModal'; - - if (f.type) - opt += ' mce' + f.type.substring(0, 1).toUpperCase() + f.type.substring(1); - - f.resizable = false; - } - - if (f.statusbar) - opt += ' mceStatusbar'; - - if (f.resizable) - opt += ' mceResizable'; - - if (f.minimizable) - opt += ' mceMinimizable'; - - if (f.maximizable) - opt += ' mceMaximizable'; - - if (f.movable) - opt += ' mceMovable'; - - // Create DOM objects - t._addAll(DOM.doc.body, - ['div', {id : id, 'class' : ed.settings.inlinepopups_skin || 'clearlooks2', style : 'width:100px;height:100px'}, - ['div', {id : id + '_wrapper', 'class' : 'mceWrapper' + opt}, - ['div', {id : id + '_top', 'class' : 'mceTop'}, - ['div', {'class' : 'mceLeft'}], - ['div', {'class' : 'mceCenter'}], - ['div', {'class' : 'mceRight'}], - ['span', {id : id + '_title'}, f.title || ''] - ], - - ['div', {id : id + '_middle', 'class' : 'mceMiddle'}, - ['div', {id : id + '_left', 'class' : 'mceLeft'}], - ['span', {id : id + '_content'}], - ['div', {id : id + '_right', 'class' : 'mceRight'}] - ], - - ['div', {id : id + '_bottom', 'class' : 'mceBottom'}, - ['div', {'class' : 'mceLeft'}], - ['div', {'class' : 'mceCenter'}], - ['div', {'class' : 'mceRight'}], - ['span', {id : id + '_status'}, 'Content'] - ], - - ['a', {'class' : 'mceMove', tabindex : '-1', href : 'javascript:;'}], - ['a', {'class' : 'mceMin', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], - ['a', {'class' : 'mceMax', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], - ['a', {'class' : 'mceMed', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], - ['a', {'class' : 'mceClose', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], - ['a', {id : id + '_resize_n', 'class' : 'mceResize mceResizeN', tabindex : '-1', href : 'javascript:;'}], - ['a', {id : id + '_resize_s', 'class' : 'mceResize mceResizeS', tabindex : '-1', href : 'javascript:;'}], - ['a', {id : id + '_resize_w', 'class' : 'mceResize mceResizeW', tabindex : '-1', href : 'javascript:;'}], - ['a', {id : id + '_resize_e', 'class' : 'mceResize mceResizeE', tabindex : '-1', href : 'javascript:;'}], - ['a', {id : id + '_resize_nw', 'class' : 'mceResize mceResizeNW', tabindex : '-1', href : 'javascript:;'}], - ['a', {id : id + '_resize_ne', 'class' : 'mceResize mceResizeNE', tabindex : '-1', href : 'javascript:;'}], - ['a', {id : id + '_resize_sw', 'class' : 'mceResize mceResizeSW', tabindex : '-1', href : 'javascript:;'}], - ['a', {id : id + '_resize_se', 'class' : 'mceResize mceResizeSE', tabindex : '-1', href : 'javascript:;'}] - ] - ] - ); - - DOM.setStyles(id, {top : -10000, left : -10000}); - - // Fix gecko rendering bug, where the editors iframe messed with window contents - if (tinymce.isGecko) - DOM.setStyle(id, 'overflow', 'auto'); - - // Measure borders - if (!f.type) { - dw += DOM.get(id + '_left').clientWidth; - dw += DOM.get(id + '_right').clientWidth; - dh += DOM.get(id + '_top').clientHeight; - dh += DOM.get(id + '_bottom').clientHeight; - } - - // Resize window - DOM.setStyles(id, {top : f.top, left : f.left, width : f.width + dw, height : f.height + dh}); - - u = f.url || f.file; - if (u) { - if (tinymce.relaxedDomain) - u += (u.indexOf('?') == -1 ? '?' : '&') + 'mce_rdomain=' + tinymce.relaxedDomain; - - u = tinymce._addVer(u); - } - - if (!f.type) { - DOM.add(id + '_content', 'iframe', {id : id + '_ifr', src : 'javascript:""', frameBorder : 0, style : 'border:0;width:10px;height:10px'}); - DOM.setStyles(id + '_ifr', {width : f.width, height : f.height}); - DOM.setAttrib(id + '_ifr', 'src', u); - } else { - DOM.add(id + '_wrapper', 'a', {id : id + '_ok', 'class' : 'mceButton mceOk', href : 'javascript:;', onmousedown : 'return false;'}, 'Ok'); - - if (f.type == 'confirm') - DOM.add(id + '_wrapper', 'a', {'class' : 'mceButton mceCancel', href : 'javascript:;', onmousedown : 'return false;'}, 'Cancel'); - - DOM.add(id + '_middle', 'div', {'class' : 'mceIcon'}); - DOM.setHTML(id + '_content', f.content.replace('\n', '
')); - } - - // Register events - mdf = Event.add(id, 'mousedown', function(e) { - var n = e.target, w, vp; - - w = t.windows[id]; - t.focus(id); - - if (n.nodeName == 'A' || n.nodeName == 'a') { - if (n.className == 'mceMax') { - w.oldPos = w.element.getXY(); - w.oldSize = w.element.getSize(); - - vp = DOM.getViewPort(); - - // Reduce viewport size to avoid scrollbars - vp.w -= 2; - vp.h -= 2; - - w.element.moveTo(vp.x, vp.y); - w.element.resizeTo(vp.w, vp.h); - DOM.setStyles(id + '_ifr', {width : vp.w - w.deltaWidth, height : vp.h - w.deltaHeight}); - DOM.addClass(id + '_wrapper', 'mceMaximized'); - } else if (n.className == 'mceMed') { - // Reset to old size - w.element.moveTo(w.oldPos.x, w.oldPos.y); - w.element.resizeTo(w.oldSize.w, w.oldSize.h); - w.iframeElement.resizeTo(w.oldSize.w - w.deltaWidth, w.oldSize.h - w.deltaHeight); - - DOM.removeClass(id + '_wrapper', 'mceMaximized'); - } else if (n.className == 'mceMove') - return t._startDrag(id, e, n.className); - else if (DOM.hasClass(n, 'mceResize')) - return t._startDrag(id, e, n.className.substring(13)); - } - }); - - clf = Event.add(id, 'click', function(e) { - var n = e.target; - - t.focus(id); - - if (n.nodeName == 'A' || n.nodeName == 'a') { - switch (n.className) { - case 'mceClose': - t.close(null, id); - return Event.cancel(e); - - case 'mceButton mceOk': - case 'mceButton mceCancel': - f.button_func(n.className == 'mceButton mceOk'); - return Event.cancel(e); - } - } - }); - - // Add window - w = t.windows[id] = { - id : id, - mousedown_func : mdf, - click_func : clf, - element : new Element(id, {blocker : 1, container : ed.getContainer()}), - iframeElement : new Element(id + '_ifr'), - features : f, - deltaWidth : dw, - deltaHeight : dh - }; - - w.iframeElement.on('focus', function() { - t.focus(id); - }); - - // Setup blocker - if (t.count == 0 && t.editor.getParam('dialog_type', 'modal') == 'modal') { - DOM.add(DOM.doc.body, 'div', { - id : 'mceModalBlocker', - 'class' : (t.editor.settings.inlinepopups_skin || 'clearlooks2') + '_modalBlocker', - style : {zIndex : t.zIndex - 1} - }); - - DOM.show('mceModalBlocker'); // Reduces flicker in IE - } else - DOM.setStyle('mceModalBlocker', 'z-index', t.zIndex - 1); - - if (tinymce.isIE6 || /Firefox\/2\./.test(navigator.userAgent) || (tinymce.isIE && !DOM.boxModel)) - DOM.setStyles('mceModalBlocker', {position : 'absolute', left : vp.x, top : vp.y, width : vp.w - 2, height : vp.h - 2}); - - t.focus(id); - t._fixIELayout(id, 1); - - // Focus ok button - if (DOM.get(id + '_ok')) - DOM.get(id + '_ok').focus(); - - t.count++; - - return w; - }, - - focus : function(id) { - var t = this, w; - - if (w = t.windows[id]) { - w.zIndex = this.zIndex++; - w.element.setStyle('zIndex', w.zIndex); - w.element.update(); - - id = id + '_wrapper'; - DOM.removeClass(t.lastId, 'mceFocus'); - DOM.addClass(id, 'mceFocus'); - t.lastId = id; - } - }, - - _addAll : function(te, ne) { - var i, n, t = this, dom = tinymce.DOM; - - if (is(ne, 'string')) - te.appendChild(dom.doc.createTextNode(ne)); - else if (ne.length) { - te = te.appendChild(dom.create(ne[0], ne[1])); - - for (i=2; i ix) { - fw = w; - ix = w.zIndex; - } - }); - - if (fw) - t.focus(fw.id); - } - }, - - setTitle : function(w, ti) { - var e; - - w = this._findId(w); - - if (e = DOM.get(w + '_title')) - e.innerHTML = DOM.encode(ti); - }, - - alert : function(txt, cb, s) { - var t = this, w; - - w = t.open({ - title : t, - type : 'alert', - button_func : function(s) { - if (cb) - cb.call(s || t, s); - - t.close(null, w.id); - }, - content : DOM.encode(t.editor.getLang(txt, txt)), - inline : 1, - width : 400, - height : 130 - }); - }, - - confirm : function(txt, cb, s) { - var t = this, w; - - w = t.open({ - title : t, - type : 'confirm', - button_func : function(s) { - if (cb) - cb.call(s || t, s); - - t.close(null, w.id); - }, - content : DOM.encode(t.editor.getLang(txt, txt)), - inline : 1, - width : 400, - height : 130 - }); - }, - - // Internal functions - - _findId : function(w) { - var t = this; - - if (typeof(w) == 'string') - return w; - - each(t.windows, function(wo) { - var ifr = DOM.get(wo.id + '_ifr'); - - if (ifr && w == ifr.contentWindow) { - w = wo.id; - return false; - } - }); - - return w; - }, - - _fixIELayout : function(id, s) { - var w, img; - - if (!tinymce.isIE6) - return; - - // Fixes the bug where hover flickers and does odd things in IE6 - each(['n','s','w','e','nw','ne','sw','se'], function(v) { - var e = DOM.get(id + '_resize_' + v); - - DOM.setStyles(e, { - width : s ? e.clientWidth : '', - height : s ? e.clientHeight : '', - cursor : DOM.getStyle(e, 'cursor', 1) - }); - - DOM.setStyle(id + "_bottom", 'bottom', '-1px'); - - e = 0; - }); - - // Fixes graphics glitch - if (w = this.windows[id]) { - // Fixes rendering bug after resize - w.element.hide(); - w.element.show(); - - // Forced a repaint of the window - //DOM.get(id).style.filter = ''; - - // IE has a bug where images used in CSS won't get loaded - // sometimes when the cache in the browser is disabled - // This fix tries to solve it by loading the images using the image object - each(DOM.select('div,a', id), function(e, i) { - if (e.currentStyle.backgroundImage != 'none') { - img = new Image(); - img.src = e.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/, '$1'); - } - }); - - DOM.get(id).style.filter = ''; - } - } - }); - - // Register plugin - tinymce.PluginManager.add('inlinepopups', tinymce.plugins.InlinePopups); -})(); - diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif b/code/simple_tinymce_field/javascript/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif deleted file mode 100644 index 94abd08..0000000 Binary files a/code/simple_tinymce_field/javascript/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif and /dev/null differ diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif b/code/simple_tinymce_field/javascript/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif deleted file mode 100644 index e671094..0000000 Binary files a/code/simple_tinymce_field/javascript/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif and /dev/null differ diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif b/code/simple_tinymce_field/javascript/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif deleted file mode 100644 index 6baf64a..0000000 Binary files a/code/simple_tinymce_field/javascript/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif and /dev/null differ diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif b/code/simple_tinymce_field/javascript/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif deleted file mode 100644 index 497307a..0000000 Binary files a/code/simple_tinymce_field/javascript/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif and /dev/null differ diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif b/code/simple_tinymce_field/javascript/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif deleted file mode 100644 index c894b2e..0000000 Binary files a/code/simple_tinymce_field/javascript/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif and /dev/null differ diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif b/code/simple_tinymce_field/javascript/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif deleted file mode 100644 index c2a2ad4..0000000 Binary files a/code/simple_tinymce_field/javascript/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif and /dev/null differ diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif b/code/simple_tinymce_field/javascript/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif deleted file mode 100644 index 43a735f..0000000 Binary files a/code/simple_tinymce_field/javascript/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif and /dev/null differ diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css b/code/simple_tinymce_field/javascript/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css deleted file mode 100644 index 5e6fd7d..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css +++ /dev/null @@ -1,90 +0,0 @@ -/* Clearlooks 2 */ - -/* Reset */ -.clearlooks2, .clearlooks2 div, .clearlooks2 span, .clearlooks2 a {vertical-align:baseline; text-align:left; position:absolute; border:0; padding:0; margin:0; background:transparent; font-family:Arial,Verdana; font-size:11px; color:#000; text-decoration:none; font-weight:normal; width:auto; height:auto; overflow:hidden; display:block} - -/* General */ -.clearlooks2 {position:absolute; direction:ltr} -.clearlooks2 .mceWrapper {position:static} -.mceEventBlocker {position:fixed; left:0; top:0; background:url(img/horizontal.gif) no-repeat 0 -75px; width:100%; height:100%} -.clearlooks2 .mcePlaceHolder {border:1px solid #000; background:#888; top:0; left:0; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50)} -.clearlooks2_modalBlocker {position:fixed; left:0; top:0; width:100%; height:100%; background:#FFF; opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60); display:none} - -/* Top */ -.clearlooks2 .mceTop, .clearlooks2 .mceTop div {top:0; width:100%; height:23px} -.clearlooks2 .mceTop .mceLeft {width:6px; background:url(img/corners.gif)} -.clearlooks2 .mceTop .mceCenter {right:6px; width:100%; height:23px; background:url(img/horizontal.gif) 12px 0; clip:rect(auto auto auto 12px)} -.clearlooks2 .mceTop .mceRight {right:0; width:6px; height:23px; background:url(img/corners.gif) -12px 0} -.clearlooks2 .mceTop span {width:100%; text-align:center; vertical-align:middle; line-height:23px; font-weight:bold} -.clearlooks2 .mceFocus .mceTop .mceLeft {background:url(img/corners.gif) -6px 0} -.clearlooks2 .mceFocus .mceTop .mceCenter {background:url(img/horizontal.gif) 0 -23px} -.clearlooks2 .mceFocus .mceTop .mceRight {background:url(img/corners.gif) -18px 0} -.clearlooks2 .mceFocus .mceTop span {color:#FFF} - -/* Middle */ -.clearlooks2 .mceMiddle, .clearlooks2 .mceMiddle div {top:0} -.clearlooks2 .mceMiddle {width:100%; height:100%; clip:rect(23px auto auto auto)} -.clearlooks2 .mceMiddle .mceLeft {left:0; width:5px; height:100%; background:url(img/vertical.gif) -5px 0} -.clearlooks2 .mceMiddle span {top:23px; left:5px; width:100%; height:100%; background:#FFF} -.clearlooks2 .mceMiddle .mceRight {right:0; width:5px; height:100%; background:url(img/vertical.gif)} - -/* Bottom */ -.clearlooks2 .mceBottom, .clearlooks2 .mceBottom div {height:6px} -.clearlooks2 .mceBottom {left:0; bottom:0; width:100%} -.clearlooks2 .mceBottom div {top:0} -.clearlooks2 .mceBottom .mceLeft {left:0; width:5px; background:url(img/corners.gif) -34px -6px} -.clearlooks2 .mceBottom .mceCenter {left:5px; width:100%; background:url(img/horizontal.gif) 0 -46px} -.clearlooks2 .mceBottom .mceRight {right:0; width:5px; background: url(img/corners.gif) -34px 0} -.clearlooks2 .mceBottom span {display:none} -.clearlooks2 .mceStatusbar .mceBottom, .clearlooks2 .mceStatusbar .mceBottom div {height:23px} -.clearlooks2 .mceStatusbar .mceBottom .mceLeft {background:url(img/corners.gif) -29px 0} -.clearlooks2 .mceStatusbar .mceBottom .mceCenter {background:url(img/horizontal.gif) 0 -52px} -.clearlooks2 .mceStatusbar .mceBottom .mceRight {background:url(img/corners.gif) -24px 0} -.clearlooks2 .mceStatusbar .mceBottom span {display:block; left:7px; font-family:Arial, Verdana; font-size:11px; line-height:23px} - -/* Actions */ -.clearlooks2 a {width:29px; height:16px; top:3px;} -.clearlooks2 .mceClose {right:6px; background:url(img/buttons.gif) -87px 0} -.clearlooks2 .mceMin {display:none; right:68px; background:url(img/buttons.gif) 0 0} -.clearlooks2 .mceMed {display:none; right:37px; background:url(img/buttons.gif) -29px 0} -.clearlooks2 .mceMax {display:none; right:37px; background:url(img/buttons.gif) -58px 0} -.clearlooks2 .mceMove {display:none;width:100%;cursor:move;background:url(img/corners.gif) no-repeat -100px -100px} -.clearlooks2 .mceMovable .mceMove {display:block} -.clearlooks2 .mceFocus .mceClose {right:6px; background:url(img/buttons.gif) -87px -16px} -.clearlooks2 .mceFocus .mceMin {right:68px; background:url(img/buttons.gif) 0 -16px} -.clearlooks2 .mceFocus .mceMed {right:37px; background:url(img/buttons.gif) -29px -16px} -.clearlooks2 .mceFocus .mceMax {right:37px; background:url(img/buttons.gif) -58px -16px} -.clearlooks2 .mceFocus .mceClose:hover {right:6px; background:url(img/buttons.gif) -87px -32px} -.clearlooks2 .mceFocus .mceClose:hover {right:6px; background:url(img/buttons.gif) -87px -32px} -.clearlooks2 .mceFocus .mceMin:hover {right:68px; background:url(img/buttons.gif) 0 -32px} -.clearlooks2 .mceFocus .mceMed:hover {right:37px; background:url(img/buttons.gif) -29px -32px} -.clearlooks2 .mceFocus .mceMax:hover {right:37px; background:url(img/buttons.gif) -58px -32px} - -/* Resize */ -.clearlooks2 .mceResize {top:auto; left:auto; display:none; width:5px; height:5px; background:url(img/horizontal.gif) no-repeat 0 -75px} -.clearlooks2 .mceResizable .mceResize {display:block} -.clearlooks2 .mceResizable .mceMin, .clearlooks2 .mceMax {display:none} -.clearlooks2 .mceMinimizable .mceMin {display:block} -.clearlooks2 .mceMaximizable .mceMax {display:block} -.clearlooks2 .mceMaximized .mceMed {display:block} -.clearlooks2 .mceMaximized .mceMax {display:none} -.clearlooks2 a.mceResizeN {top:0; left:0; width:100%; cursor:n-resize} -.clearlooks2 a.mceResizeNW {top:0; left:0; cursor:nw-resize} -.clearlooks2 a.mceResizeNE {top:0; right:0; cursor:ne-resize} -.clearlooks2 a.mceResizeW {top:0; left:0; height:100%; cursor:w-resize;} -.clearlooks2 a.mceResizeE {top:0; right:0; height:100%; cursor:e-resize} -.clearlooks2 a.mceResizeS {bottom:0; left:0; width:100%; cursor:s-resize} -.clearlooks2 a.mceResizeSW {bottom:0; left:0; cursor:sw-resize} -.clearlooks2 a.mceResizeSE {bottom:0; right:0; cursor:se-resize} - -/* Alert/Confirm */ -.clearlooks2 .mceButton {font-weight:bold; bottom:10px; width:80px; height:30px; background:url(img/button.gif); line-height:30px; vertical-align:middle; text-align:center; outline:0} -.clearlooks2 .mceMiddle .mceIcon {left:15px; top:35px; width:32px; height:32px} -.clearlooks2 .mceAlert .mceMiddle span, .clearlooks2 .mceConfirm .mceMiddle span {background:transparent;left:60px; top:35px; width:320px; height:50px; font-weight:bold; overflow:auto; white-space:normal} -.clearlooks2 a:hover {font-weight:bold;} -.clearlooks2 .mceAlert .mceMiddle, .clearlooks2 .mceConfirm .mceMiddle {background:#D6D7D5} -.clearlooks2 .mceAlert .mceOk {left:50%; top:auto; margin-left: -40px} -.clearlooks2 .mceAlert .mceIcon {background:url(img/alert.gif)} -.clearlooks2 .mceConfirm .mceOk {left:50%; top:auto; margin-left: -90px} -.clearlooks2 .mceConfirm .mceCancel {left:50%; top:auto} -.clearlooks2 .mceConfirm .mceIcon {background:url(img/confirm.gif)} \ No newline at end of file diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/inlinepopups/template.htm b/code/simple_tinymce_field/javascript/tiny_mce/plugins/inlinepopups/template.htm deleted file mode 100644 index f9ec642..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/inlinepopups/template.htm +++ /dev/null @@ -1,387 +0,0 @@ - - - -Template for dialogs - - - - -
-
-
-
-
-
-
- Blured -
- -
-
- Content -
-
- -
-
-
-
- Statusbar text. -
- - - - - - - - - - - - - - -
-
- -
-
-
-
-
-
- Focused -
- -
-
- Content -
-
- -
-
-
-
- Statusbar text. -
- - - - - - - - - - - - - - -
-
- -
-
-
-
-
-
- Statusbar -
- -
-
- Content -
-
- -
-
-
-
- Statusbar text. -
- - - - - - - - - - - - - - -
-
- -
-
-
-
-
-
- Statusbar, Resizable -
- -
-
- Content -
-
- -
-
-
-
- Statusbar text. -
- - - - - - - - - - - - - - -
-
- -
-
-
-
-
-
- Resizable, Maximizable -
- -
-
- Content -
-
- -
-
-
-
- Statusbar text. -
- - - - - - - - - - - - - - -
-
- -
-
-
-
-
-
- Blurred, Maximizable, Statusbar, Resizable -
- -
-
- Content -
-
- -
-
-
-
- Statusbar text. -
- - - - - - - - - - - - - - -
-
- -
-
-
-
-
-
- Maximized, Maximizable, Minimizable -
- -
-
- Content -
-
- -
-
-
-
- Statusbar text. -
- - - - - - - - - - - - - - -
-
- -
-
-
-
-
-
- Blured -
- -
-
- Content -
-
- -
-
-
-
- Statusbar text. -
- - - - - - - - - - - - - - -
-
- -
-
-
-
-
-
- Alert -
- -
-
- - This is a very long error message. This is a very long error message. - This is a very long error message. This is a very long error message. - This is a very long error message. This is a very long error message. - This is a very long error message. This is a very long error message. - This is a very long error message. This is a very long error message. - This is a very long error message. This is a very long error message. - -
-
-
- -
-
-
-
-
- - - Ok - -
-
- -
-
-
-
-
-
- Confirm -
- -
-
- - This is a very long error message. This is a very long error message. - This is a very long error message. This is a very long error message. - This is a very long error message. This is a very long error message. - This is a very long error message. This is a very long error message. - This is a very long error message. This is a very long error message. - This is a very long error message. This is a very long error message. - -
-
-
- -
-
-
-
-
- - - Ok - Cancel - -
-
-
- - - diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/insertdatetime/editor_plugin.js b/code/simple_tinymce_field/javascript/tiny_mce/plugins/insertdatetime/editor_plugin.js deleted file mode 100644 index 938ce6b..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/insertdatetime/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.InsertDateTime",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceInsertDate",function(){var d=c._getDateTime(new Date(),a.getParam("plugin_insertdate_dateFormat",a.getLang("insertdatetime.date_fmt")));a.execCommand("mceInsertContent",false,d)});a.addCommand("mceInsertTime",function(){var d=c._getDateTime(new Date(),a.getParam("plugin_insertdate_timeFormat",a.getLang("insertdatetime.time_fmt")));a.execCommand("mceInsertContent",false,d)});a.addButton("insertdate",{title:"insertdatetime.insertdate_desc",cmd:"mceInsertDate"});a.addButton("inserttime",{title:"insertdatetime.inserttime_desc",cmd:"mceInsertTime"})},getInfo:function(){return{longname:"Insert date/time",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/insertdatetime",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_getDateTime:function(e,a){var c=this.editor;function b(g,d){g=""+g;if(g.length-1){a[c].style.zIndex=g[j];a[j].style.zIndex=g[c]}else{if(g[c]>0){a[c].style.zIndex=g[c]-1}}}else{for(f=0;fg[c]){j=f;break}}if(j>-1){a[c].style.zIndex=g[j];a[j].style.zIndex=g[c]}else{a[c].style.zIndex=g[c]+1}}b.execCommand("mceRepaint")},_getParentLayer:function(a){return this.editor.dom.getParent(a,function(b){return b.nodeType==1&&/^(absolute|relative|static)$/i.test(b.style.position)})},_insertLayer:function(){var a=this.editor,b=a.dom.getPos(a.dom.getParent(a.selection.getNode(),"*"));a.dom.add(a.getBody(),"div",{style:{position:"absolute",left:b.x,top:(b.y>20?b.y:20),width:100,height:100},"class":"mceItemVisualAid"},a.selection.getContent()||a.getLang("layer.content"))},_toggleAbsolute:function(){var a=this.editor,b=this._getParentLayer(a.selection.getNode());if(!b){b=a.dom.getParent(a.selection.getNode(),"DIV,P,IMG")}if(b){if(b.style.position.toLowerCase()=="absolute"){a.dom.setStyles(b,{position:"",left:"",top:"",width:"",height:""});a.dom.removeClass(b,"mceItemVisualAid")}else{if(b.style.left==""){b.style.left=20+"px"}if(b.style.top==""){b.style.top=20+"px"}if(b.style.width==""){b.style.width=b.width?(b.width+"px"):"100px"}if(b.style.height==""){b.style.height=b.height?(b.height+"px"):"100px"}b.style.position="absolute";a.addVisual(a.getBody())}a.execCommand("mceRepaint");a.nodeChanged()}}});tinymce.PluginManager.add("layer",tinymce.plugins.Layer)})(); \ No newline at end of file diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/layer/editor_plugin_src.js b/code/simple_tinymce_field/javascript/tiny_mce/plugins/layer/editor_plugin_src.js deleted file mode 100644 index a72f6c3..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/layer/editor_plugin_src.js +++ /dev/null @@ -1,209 +0,0 @@ -/** - * $Id: editor_plugin_src.js 652 2008-02-29 13:09:46Z spocke $ - * - * @author Moxiecode - * @copyright Copyright 2004-2008, Moxiecode Systems AB, All rights reserved. - */ - -(function() { - tinymce.create('tinymce.plugins.Layer', { - init : function(ed, url) { - var t = this; - - t.editor = ed; - - // Register commands - ed.addCommand('mceInsertLayer', t._insertLayer, t); - - ed.addCommand('mceMoveForward', function() { - t._move(1); - }); - - ed.addCommand('mceMoveBackward', function() { - t._move(-1); - }); - - ed.addCommand('mceMakeAbsolute', function() { - t._toggleAbsolute(); - }); - - // Register buttons - ed.addButton('moveforward', {title : 'layer.forward_desc', cmd : 'mceMoveForward'}); - ed.addButton('movebackward', {title : 'layer.backward_desc', cmd : 'mceMoveBackward'}); - ed.addButton('absolute', {title : 'layer.absolute_desc', cmd : 'mceMakeAbsolute'}); - ed.addButton('insertlayer', {title : 'layer.insertlayer_desc', cmd : 'mceInsertLayer'}); - - ed.onInit.add(function() { - if (tinymce.isIE) - ed.getDoc().execCommand('2D-Position', false, true); - }); - - ed.onNodeChange.add(t._nodeChange, t); - ed.onVisualAid.add(t._visualAid, t); - }, - - getInfo : function() { - return { - longname : 'Layer', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/layer', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - // Private methods - - _nodeChange : function(ed, cm, n) { - var le, p; - - le = this._getParentLayer(n); - p = ed.dom.getParent(n, 'DIV,P,IMG'); - - if (!p) { - cm.setDisabled('absolute', 1); - cm.setDisabled('moveforward', 1); - cm.setDisabled('movebackward', 1); - } else { - cm.setDisabled('absolute', 0); - cm.setDisabled('moveforward', !le); - cm.setDisabled('movebackward', !le); - cm.setActive('absolute', le && le.style.position.toLowerCase() == "absolute"); - } - }, - - // Private methods - - _visualAid : function(ed, e, s) { - var dom = ed.dom; - - tinymce.each(dom.select('div,p', e), function(e) { - if (/^(absolute|relative|static)$/i.test(e.style.position)) { - if (s) - dom.addClass(e, 'mceItemVisualAid'); - else - dom.removeClass(e, 'mceItemVisualAid'); - } - }); - }, - - _move : function(d) { - var ed = this.editor, i, z = [], le = this._getParentLayer(ed.selection.getNode()), ci = -1, fi = -1, nl; - - nl = []; - tinymce.walk(ed.getBody(), function(n) { - if (n.nodeType == 1 && /^(absolute|relative|static)$/i.test(n.style.position)) - nl.push(n); - }, 'childNodes'); - - // Find z-indexes - for (i=0; i -1) { - nl[ci].style.zIndex = z[fi]; - nl[fi].style.zIndex = z[ci]; - } else { - if (z[ci] > 0) - nl[ci].style.zIndex = z[ci] - 1; - } - } else { - // Move forward - - // Try find a higher one - for (i=0; i z[ci]) { - fi = i; - break; - } - } - - if (fi > -1) { - nl[ci].style.zIndex = z[fi]; - nl[fi].style.zIndex = z[ci]; - } else - nl[ci].style.zIndex = z[ci] + 1; - } - - ed.execCommand('mceRepaint'); - }, - - _getParentLayer : function(n) { - return this.editor.dom.getParent(n, function(n) { - return n.nodeType == 1 && /^(absolute|relative|static)$/i.test(n.style.position); - }); - }, - - _insertLayer : function() { - var ed = this.editor, p = ed.dom.getPos(ed.dom.getParent(ed.selection.getNode(), '*')); - - ed.dom.add(ed.getBody(), 'div', { - style : { - position : 'absolute', - left : p.x, - top : (p.y > 20 ? p.y : 20), - width : 100, - height : 100 - }, - 'class' : 'mceItemVisualAid' - }, ed.selection.getContent() || ed.getLang('layer.content')); - }, - - _toggleAbsolute : function() { - var ed = this.editor, le = this._getParentLayer(ed.selection.getNode()); - - if (!le) - le = ed.dom.getParent(ed.selection.getNode(), 'DIV,P,IMG'); - - if (le) { - if (le.style.position.toLowerCase() == "absolute") { - ed.dom.setStyles(le, { - position : '', - left : '', - top : '', - width : '', - height : '' - }); - - ed.dom.removeClass(le, 'mceItemVisualAid'); - } else { - if (le.style.left == "") - le.style.left = 20 + 'px'; - - if (le.style.top == "") - le.style.top = 20 + 'px'; - - if (le.style.width == "") - le.style.width = le.width ? (le.width + 'px') : '100px'; - - if (le.style.height == "") - le.style.height = le.height ? (le.height + 'px') : '100px'; - - le.style.position = "absolute"; - ed.addVisual(ed.getBody()); - } - - ed.execCommand('mceRepaint'); - ed.nodeChanged(); - } - } - }); - - // Register plugin - tinymce.PluginManager.add('layer', tinymce.plugins.Layer); -})(); \ No newline at end of file diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/media/css/content.css b/code/simple_tinymce_field/javascript/tiny_mce/plugins/media/css/content.css deleted file mode 100644 index 1bf6a75..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/media/css/content.css +++ /dev/null @@ -1,6 +0,0 @@ -.mceItemFlash, .mceItemShockWave, .mceItemQuickTime, .mceItemWindowsMedia, .mceItemRealMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc;} -.mceItemShockWave {background-image: url(../img/shockwave.gif);} -.mceItemFlash {background-image:url(../img/flash.gif);} -.mceItemQuickTime {background-image:url(../img/quicktime.gif);} -.mceItemWindowsMedia {background-image:url(../img/windowsmedia.gif);} -.mceItemRealMedia {background-image:url(../img/realmedia.gif);} diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/media/css/media.css b/code/simple_tinymce_field/javascript/tiny_mce/plugins/media/css/media.css deleted file mode 100644 index 2d08794..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/media/css/media.css +++ /dev/null @@ -1,16 +0,0 @@ -#id, #name, #hspace, #vspace, #class_name, #align { width: 100px } -#hspace, #vspace { width: 50px } -#flash_quality, #flash_align, #flash_scale, #flash_salign, #flash_wmode { width: 100px } -#flash_base, #flash_flashvars { width: 240px } -#width, #height { width: 40px } -#src, #media_type { width: 250px } -#class { width: 120px } -#prev { margin: 0; border: 1px solid black; width: 380px; height: 230px; overflow: auto } -.panel_wrapper div.current { height: 390px; overflow: auto } -#flash_options, #shockwave_options, #qt_options, #wmp_options, #rmp_options { display: none } -.mceAddSelectValue { background-color: #DDDDDD } -#qt_starttime, #qt_endtime, #qt_fov, #qt_href, #qt_moveid, #qt_moviename, #qt_node, #qt_pan, #qt_qtsrc, #qt_qtsrcchokespeed, #qt_target, #qt_tilt, #qt_urlsubstituten, #qt_volume { width: 70px } -#wmp_balance, #wmp_baseurl, #wmp_captioningid, #wmp_currentmarker, #wmp_currentposition, #wmp_defaultframe, #wmp_playcount, #wmp_rate, #wmp_uimode, #wmp_volume { width: 70px } -#rmp_console, #rmp_numloop, #rmp_controls, #rmp_scriptcallbacks { width: 70px } -#shockwave_swvolume, #shockwave_swframe, #shockwave_swurl, #shockwave_swstretchvalign, #shockwave_swstretchhalign, #shockwave_swstretchstyle { width: 90px } -#qt_qtsrc { width: 200px } diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/media/editor_plugin.js b/code/simple_tinymce_field/javascript/tiny_mce/plugins/media/editor_plugin.js deleted file mode 100644 index 951d1e4..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/media/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.MediaPlugin",{init:function(b,c){var e=this;e.editor=b;e.url=c;function f(g){return/^(mceItemFlash|mceItemShockWave|mceItemWindowsMedia|mceItemQuickTime|mceItemRealMedia)$/.test(g.className)}b.onPreInit.add(function(){b.serializer.addRules("param[name|value|_mce_value]")});b.addCommand("mceMedia",function(){b.windowManager.open({file:c+"/media.htm",width:430+parseInt(b.getLang("media.delta_width",0)),height:470+parseInt(b.getLang("media.delta_height",0)),inline:1},{plugin_url:c})});b.addButton("media",{title:"media.desc",cmd:"mceMedia"});b.onNodeChange.add(function(h,g,i){g.setActive("media",i.nodeName=="IMG"&&f(i))});b.onInit.add(function(){var g={mceItemFlash:"flash",mceItemShockWave:"shockwave",mceItemWindowsMedia:"windowsmedia",mceItemQuickTime:"quicktime",mceItemRealMedia:"realmedia"};b.selection.onSetContent.add(function(){e._spansToImgs(b.getBody())});b.selection.onBeforeSetContent.add(e._objectsToSpans,e);if(b.settings.content_css!==false){b.dom.loadCSS(c+"/css/content.css")}if(b.theme.onResolveName){b.theme.onResolveName.add(function(h,i){if(i.name=="img"){a(g,function(l,j){if(b.dom.hasClass(i.node,j)){i.name=l;i.title=b.dom.getAttrib(i.node,"title");return false}})}})}if(b&&b.plugins.contextmenu){b.plugins.contextmenu.onContextMenu.add(function(i,h,j){if(j.nodeName=="IMG"&&/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(j.className)){h.add({title:"media.edit",icon:"media",cmd:"mceMedia"})}})}});b.onBeforeSetContent.add(e._objectsToSpans,e);b.onSetContent.add(function(){e._spansToImgs(b.getBody())});b.onPreProcess.add(function(g,i){var h=g.dom;if(i.set){e._spansToImgs(i.node);a(h.select("IMG",i.node),function(k){var j;if(f(k)){j=e._parse(k.title);h.setAttrib(k,"width",h.getAttrib(k,"width",j.width||100));h.setAttrib(k,"height",h.getAttrib(k,"height",j.height||100))}})}if(i.get){a(h.select("IMG",i.node),function(m){var l,j,k;if(g.getParam("media_use_script")){if(f(m)){m.className=m.className.replace(/mceItem/g,"mceTemp")}return}switch(m.className){case"mceItemFlash":l="d27cdb6e-ae6d-11cf-96b8-444553540000";j="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0";k="application/x-shockwave-flash";break;case"mceItemShockWave":l="166b1bca-3f9c-11cf-8075-444553540000";j="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0";k="application/x-director";break;case"mceItemWindowsMedia":l=g.getParam("media_wmp6_compatible")?"05589fa1-c356-11ce-bf01-00aa0055595a":"6bf52a52-394a-11d3-b153-00c04f79faa6";j="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701";k="application/x-mplayer2";break;case"mceItemQuickTime":l="02bf25d5-8c17-4b23-bc80-d3488abddc6b";j="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0";k="video/quicktime";break;case"mceItemRealMedia":l="cfcdaa03-8be4-11cf-b84b-0020afbbccfa";j="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0";k="audio/x-pn-realaudio-plugin";break}if(l){h.replace(e._buildObj({classid:l,codebase:j,type:k},m),m)}})}});b.onPostProcess.add(function(g,h){h.content=h.content.replace(/_mce_value=/g,"value=")});function d(g,h){h=new RegExp(h+'="([^"]+)"',"g").exec(g);return h?b.dom.decode(h[1]):""}b.onPostProcess.add(function(g,h){if(g.getParam("media_use_script")){h.content=h.content.replace(/]+>/g,function(j){var i=d(j,"class");if(/^(mceTempFlash|mceTempShockWave|mceTempWindowsMedia|mceTempQuickTime|mceTempRealMedia)$/.test(i)){at=e._parse(d(j,"title"));at.width=d(j,"width");at.height=d(j,"height");j=''; - } - - return im; - }); - } - }); - }, - - getInfo : function() { - return { - longname : 'Media', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - // Private methods - _objectsToSpans : function(ed, o) { - var t = this, h = o.content; - - h = h.replace(/]*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi, function(a, b, c) { - var o = t._parse(c); - - return '' - }); - - h = h.replace(/]*)>/gi, ''); - h = h.replace(/]*)\/?>/gi, ''); - h = h.replace(/]*)>/gi, ''); - h = h.replace(/<\/(object)([^>]*)>/gi, ''); - h = h.replace(/<\/embed>/gi, ''); - h = h.replace(/]*)>/gi, function(a, b) {return ''}); - h = h.replace(/\/ class=\"mceItemParam\"><\/span>/gi, 'class="mceItemParam">'); - - o.content = h; - }, - - _buildObj : function(o, n) { - var ob, ed = this.editor, dom = ed.dom, p = this._parse(n.title), stc; - - stc = ed.getParam('media_strict', true) && o.type == 'application/x-shockwave-flash'; - - p.width = o.width = dom.getAttrib(n, 'width') || 100; - p.height = o.height = dom.getAttrib(n, 'height') || 100; - - if (p.src) - p.src = ed.convertURL(p.src, 'src', n); - - if (stc) { - ob = dom.create('span', { - id : p.id, - mce_name : 'object', - type : 'application/x-shockwave-flash', - data : p.src, - style : dom.getAttrib(n, 'style'), - width : o.width, - height : o.height - }); - } else { - ob = dom.create('span', { - id : p.id, - mce_name : 'object', - classid : "clsid:" + o.classid, - style : dom.getAttrib(n, 'style'), - codebase : o.codebase, - width : o.width, - height : o.height - }); - } - - each (p, function(v, k) { - if (!/^(width|height|codebase|classid|id|_cx|_cy)$/.test(k)) { - // Use url instead of src in IE for Windows media - if (o.type == 'application/x-mplayer2' && k == 'src' && !p.url) - k = 'url'; - - if (v) - dom.add(ob, 'span', {mce_name : 'param', name : k, '_mce_value' : v}); - } - }); - - if (!stc) - dom.add(ob, 'span', tinymce.extend({mce_name : 'embed', type : o.type, style : dom.getAttrib(n, 'style')}, p)); - - return ob; - }, - - _spansToImgs : function(p) { - var t = this, dom = t.editor.dom, im, ci; - - each(dom.select('span', p), function(n) { - // Convert object into image - if (dom.getAttrib(n, 'class') == 'mceItemObject') { - ci = dom.getAttrib(n, "classid").toLowerCase().replace(/\s+/g, ''); - - switch (ci) { - case 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000': - dom.replace(t._createImg('mceItemFlash', n), n); - break; - - case 'clsid:166b1bca-3f9c-11cf-8075-444553540000': - dom.replace(t._createImg('mceItemShockWave', n), n); - break; - - case 'clsid:6bf52a52-394a-11d3-b153-00c04f79faa6': - case 'clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95': - case 'clsid:05589fa1-c356-11ce-bf01-00aa0055595a': - dom.replace(t._createImg('mceItemWindowsMedia', n), n); - break; - - case 'clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b': - dom.replace(t._createImg('mceItemQuickTime', n), n); - break; - - case 'clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa': - dom.replace(t._createImg('mceItemRealMedia', n), n); - break; - - default: - dom.replace(t._createImg('mceItemFlash', n), n); - } - - return; - } - - // Convert embed into image - if (dom.getAttrib(n, 'class') == 'mceItemEmbed') { - switch (dom.getAttrib(n, 'type')) { - case 'application/x-shockwave-flash': - dom.replace(t._createImg('mceItemFlash', n), n); - break; - - case 'application/x-director': - dom.replace(t._createImg('mceItemShockWave', n), n); - break; - - case 'application/x-mplayer2': - dom.replace(t._createImg('mceItemWindowsMedia', n), n); - break; - - case 'video/quicktime': - dom.replace(t._createImg('mceItemQuickTime', n), n); - break; - - case 'audio/x-pn-realaudio-plugin': - dom.replace(t._createImg('mceItemRealMedia', n), n); - break; - - default: - dom.replace(t._createImg('mceItemFlash', n), n); - } - } - }); - }, - - _createImg : function(cl, n) { - var im, dom = this.editor.dom, pa = {}, ti = '', args; - - args = ['id', 'name', 'width', 'height', 'bgcolor', 'align', 'flashvars', 'src', 'wmode', 'allowfullscreen', 'quality']; - - // Create image - im = dom.create('img', { - src : this.url + '/img/trans.gif', - width : dom.getAttrib(n, 'width') || 100, - height : dom.getAttrib(n, 'height') || 100, - style : dom.getAttrib(n, 'style'), - 'class' : cl - }); - - // Setup base parameters - each(args, function(na) { - var v = dom.getAttrib(n, na); - - if (v) - pa[na] = v; - }); - - // Add optional parameters - each(dom.select('span', n), function(n) { - if (dom.hasClass(n, 'mceItemParam')) - pa[dom.getAttrib(n, 'name')] = dom.getAttrib(n, '_mce_value'); - }); - - // Use src not movie - if (pa.movie) { - pa.src = pa.movie; - delete pa.movie; - } - - // Merge with embed args - n = dom.select('.mceItemEmbed', n)[0]; - if (n) { - each(args, function(na) { - var v = dom.getAttrib(n, na); - - if (v && !pa[na]) - pa[na] = v; - }); - } - - delete pa.width; - delete pa.height; - - im.title = this._serialize(pa); - - return im; - }, - - _parse : function(s) { - return tinymce.util.JSON.parse('{' + s + '}'); - }, - - _serialize : function(o) { - return tinymce.util.JSON.serialize(o).replace(/[{}]/g, ''); - } - }); - - // Register plugin - tinymce.PluginManager.add('media', tinymce.plugins.MediaPlugin); -})(); \ No newline at end of file diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/media/img/flash.gif b/code/simple_tinymce_field/javascript/tiny_mce/plugins/media/img/flash.gif deleted file mode 100644 index cb192e6..0000000 Binary files a/code/simple_tinymce_field/javascript/tiny_mce/plugins/media/img/flash.gif and /dev/null differ diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/media/img/flv_player.swf b/code/simple_tinymce_field/javascript/tiny_mce/plugins/media/img/flv_player.swf deleted file mode 100644 index 042c2ab..0000000 Binary files a/code/simple_tinymce_field/javascript/tiny_mce/plugins/media/img/flv_player.swf and /dev/null differ diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/media/img/quicktime.gif b/code/simple_tinymce_field/javascript/tiny_mce/plugins/media/img/quicktime.gif deleted file mode 100644 index 3b04991..0000000 Binary files a/code/simple_tinymce_field/javascript/tiny_mce/plugins/media/img/quicktime.gif and /dev/null differ diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/media/img/realmedia.gif b/code/simple_tinymce_field/javascript/tiny_mce/plugins/media/img/realmedia.gif deleted file mode 100644 index fdfe0b9..0000000 Binary files a/code/simple_tinymce_field/javascript/tiny_mce/plugins/media/img/realmedia.gif and /dev/null differ diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/media/img/shockwave.gif b/code/simple_tinymce_field/javascript/tiny_mce/plugins/media/img/shockwave.gif deleted file mode 100644 index 5f235df..0000000 Binary files a/code/simple_tinymce_field/javascript/tiny_mce/plugins/media/img/shockwave.gif and /dev/null differ diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/media/img/trans.gif b/code/simple_tinymce_field/javascript/tiny_mce/plugins/media/img/trans.gif deleted file mode 100644 index 3884865..0000000 Binary files a/code/simple_tinymce_field/javascript/tiny_mce/plugins/media/img/trans.gif and /dev/null differ diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/media/img/windowsmedia.gif b/code/simple_tinymce_field/javascript/tiny_mce/plugins/media/img/windowsmedia.gif deleted file mode 100644 index ab50f2d..0000000 Binary files a/code/simple_tinymce_field/javascript/tiny_mce/plugins/media/img/windowsmedia.gif and /dev/null differ diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/media/js/embed.js b/code/simple_tinymce_field/javascript/tiny_mce/plugins/media/js/embed.js deleted file mode 100644 index f8dc810..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/media/js/embed.js +++ /dev/null @@ -1,73 +0,0 @@ -/** - * This script contains embed functions for common plugins. This scripts are complety free to use for any purpose. - */ - -function writeFlash(p) { - writeEmbed( - 'D27CDB6E-AE6D-11cf-96B8-444553540000', - 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', - 'application/x-shockwave-flash', - p - ); -} - -function writeShockWave(p) { - writeEmbed( - '166B1BCA-3F9C-11CF-8075-444553540000', - 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0', - 'application/x-director', - p - ); -} - -function writeQuickTime(p) { - writeEmbed( - '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B', - 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0', - 'video/quicktime', - p - ); -} - -function writeRealMedia(p) { - writeEmbed( - 'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA', - 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', - 'audio/x-pn-realaudio-plugin', - p - ); -} - -function writeWindowsMedia(p) { - p.url = p.src; - writeEmbed( - '6BF52A52-394A-11D3-B153-00C04F79FAA6', - 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701', - 'application/x-mplayer2', - p - ); -} - -function writeEmbed(cls, cb, mt, p) { - var h = '', n; - - h += ''; - - h += ''); - -function init() { - var pl = "", f, val; - var type = "flash", fe, i; - - ed = tinyMCEPopup.editor; - - tinyMCEPopup.resizeToInnerSize(); - f = document.forms[0] - - fe = ed.selection.getNode(); - if (/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(ed.dom.getAttrib(fe, 'class'))) { - pl = fe.title; - - switch (ed.dom.getAttrib(fe, 'class')) { - case 'mceItemFlash': - type = 'flash'; - break; - - case 'mceItemFlashVideo': - type = 'flv'; - break; - - case 'mceItemShockWave': - type = 'shockwave'; - break; - - case 'mceItemWindowsMedia': - type = 'wmp'; - break; - - case 'mceItemQuickTime': - type = 'qt'; - break; - - case 'mceItemRealMedia': - type = 'rmp'; - break; - } - - document.forms[0].insert.value = ed.getLang('update', 'Insert', true); - } - - document.getElementById('filebrowsercontainer').innerHTML = getBrowserHTML('filebrowser','src','media','media'); - document.getElementById('qtsrcfilebrowsercontainer').innerHTML = getBrowserHTML('qtsrcfilebrowser','qt_qtsrc','media','media'); - document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); - - var html = getMediaListHTML('medialist','src','media','media'); - if (html == "") - document.getElementById("linklistrow").style.display = 'none'; - else - document.getElementById("linklistcontainer").innerHTML = html; - - // Resize some elements - if (isVisible('filebrowser')) - document.getElementById('src').style.width = '230px'; - - // Setup form - if (pl != "") { - pl = tinyMCEPopup.editor.plugins.media._parse(pl); - - switch (type) { - case "flash": - setBool(pl, 'flash', 'play'); - setBool(pl, 'flash', 'loop'); - setBool(pl, 'flash', 'menu'); - setBool(pl, 'flash', 'swliveconnect'); - setStr(pl, 'flash', 'quality'); - setStr(pl, 'flash', 'scale'); - setStr(pl, 'flash', 'salign'); - setStr(pl, 'flash', 'wmode'); - setStr(pl, 'flash', 'base'); - setStr(pl, 'flash', 'flashvars'); - break; - - case "qt": - setBool(pl, 'qt', 'loop'); - setBool(pl, 'qt', 'autoplay'); - setBool(pl, 'qt', 'cache'); - setBool(pl, 'qt', 'controller'); - setBool(pl, 'qt', 'correction'); - setBool(pl, 'qt', 'enablejavascript'); - setBool(pl, 'qt', 'kioskmode'); - setBool(pl, 'qt', 'autohref'); - setBool(pl, 'qt', 'playeveryframe'); - setBool(pl, 'qt', 'tarsetcache'); - setStr(pl, 'qt', 'scale'); - setStr(pl, 'qt', 'starttime'); - setStr(pl, 'qt', 'endtime'); - setStr(pl, 'qt', 'tarset'); - setStr(pl, 'qt', 'qtsrcchokespeed'); - setStr(pl, 'qt', 'volume'); - setStr(pl, 'qt', 'qtsrc'); - break; - - case "shockwave": - setBool(pl, 'shockwave', 'sound'); - setBool(pl, 'shockwave', 'progress'); - setBool(pl, 'shockwave', 'autostart'); - setBool(pl, 'shockwave', 'swliveconnect'); - setStr(pl, 'shockwave', 'swvolume'); - setStr(pl, 'shockwave', 'swstretchstyle'); - setStr(pl, 'shockwave', 'swstretchhalign'); - setStr(pl, 'shockwave', 'swstretchvalign'); - break; - - case "wmp": - setBool(pl, 'wmp', 'autostart'); - setBool(pl, 'wmp', 'enabled'); - setBool(pl, 'wmp', 'enablecontextmenu'); - setBool(pl, 'wmp', 'fullscreen'); - setBool(pl, 'wmp', 'invokeurls'); - setBool(pl, 'wmp', 'mute'); - setBool(pl, 'wmp', 'stretchtofit'); - setBool(pl, 'wmp', 'windowlessvideo'); - setStr(pl, 'wmp', 'balance'); - setStr(pl, 'wmp', 'baseurl'); - setStr(pl, 'wmp', 'captioningid'); - setStr(pl, 'wmp', 'currentmarker'); - setStr(pl, 'wmp', 'currentposition'); - setStr(pl, 'wmp', 'defaultframe'); - setStr(pl, 'wmp', 'playcount'); - setStr(pl, 'wmp', 'rate'); - setStr(pl, 'wmp', 'uimode'); - setStr(pl, 'wmp', 'volume'); - break; - - case "rmp": - setBool(pl, 'rmp', 'autostart'); - setBool(pl, 'rmp', 'loop'); - setBool(pl, 'rmp', 'autogotourl'); - setBool(pl, 'rmp', 'center'); - setBool(pl, 'rmp', 'imagestatus'); - setBool(pl, 'rmp', 'maintainaspect'); - setBool(pl, 'rmp', 'nojava'); - setBool(pl, 'rmp', 'prefetch'); - setBool(pl, 'rmp', 'shuffle'); - setStr(pl, 'rmp', 'console'); - setStr(pl, 'rmp', 'controls'); - setStr(pl, 'rmp', 'numloop'); - setStr(pl, 'rmp', 'scriptcallbacks'); - break; - } - - setStr(pl, null, 'src'); - setStr(pl, null, 'id'); - setStr(pl, null, 'name'); - setStr(pl, null, 'vspace'); - setStr(pl, null, 'hspace'); - setStr(pl, null, 'bgcolor'); - setStr(pl, null, 'align'); - setStr(pl, null, 'width'); - setStr(pl, null, 'height'); - - if ((val = ed.dom.getAttrib(fe, "width")) != "") - pl.width = f.width.value = val; - - if ((val = ed.dom.getAttrib(fe, "height")) != "") - pl.height = f.height.value = val; - - oldWidth = pl.width ? parseInt(pl.width) : 0; - oldHeight = pl.height ? parseInt(pl.height) : 0; - } else - oldWidth = oldHeight = 0; - - selectByValue(f, 'media_type', type); - changedType(type); - updateColor('bgcolor_pick', 'bgcolor'); - - TinyMCE_EditableSelects.init(); - generatePreview(); -} - -function insertMedia() { - var fe, f = document.forms[0], h; - - tinyMCEPopup.restoreSelection(); - - if (!AutoValidator.validate(f)) { - tinyMCEPopup.alert(ed.getLang('invalid_data')); - return false; - } - - f.width.value = f.width.value == "" ? 100 : f.width.value; - f.height.value = f.height.value == "" ? 100 : f.height.value; - - fe = ed.selection.getNode(); - if (fe != null && /mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(ed.dom.getAttrib(fe, 'class'))) { - switch (f.media_type.options[f.media_type.selectedIndex].value) { - case "flash": - fe.className = "mceItemFlash"; - break; - - case "flv": - fe.className = "mceItemFlashVideo"; - break; - - case "shockwave": - fe.className = "mceItemShockWave"; - break; - - case "qt": - fe.className = "mceItemQuickTime"; - break; - - case "wmp": - fe.className = "mceItemWindowsMedia"; - break; - - case "rmp": - fe.className = "mceItemRealMedia"; - break; - } - - if (fe.width != f.width.value || fe.height != f.height.value) - ed.execCommand('mceRepaint'); - - fe.title = serializeParameters(); - fe.width = f.width.value; - fe.height = f.height.value; - fe.style.width = f.width.value + (f.width.value.indexOf('%') == -1 ? 'px' : ''); - fe.style.height = f.height.value + (f.height.value.indexOf('%') == -1 ? 'px' : ''); - fe.align = f.align.options[f.align.selectedIndex].value; - } else { - h = ' 0) { - var html = ""; - - html += ''; - - return html; - } - - return ""; -} - -function getType(v) { - var fo, i, c, el, x, f = document.forms[0]; - - fo = ed.getParam("media_types", "flash=swf;flv=flv;shockwave=dcr;qt=mov,qt,mpg,mp3,mp4,mpeg;shockwave=dcr;wmp=avi,wmv,wm,asf,asx,wmx,wvx;rmp=rm,ra,ram").split(';'); - - // YouTube - if (v.match(/watch\?v=(.+)(.*)/)) { - f.width.value = '425'; - f.height.value = '350'; - f.src.value = 'http://www.youtube.com/v/' + v.match(/v=(.*)(.*)/)[0].split('=')[1]; - return 'flash'; - } - - // Google video - if (v.indexOf('http://video.google.com/videoplay?docid=') == 0) { - f.width.value = '425'; - f.height.value = '326'; - f.src.value = 'http://video.google.com/googleplayer.swf?docId=' + v.substring('http://video.google.com/videoplay?docid='.length) + '&hl=en'; - return 'flash'; - } - - for (i=0; i 0 ? s.substring(0, s.length - 1) : s; - - return s; -} - -function setBool(pl, p, n) { - if (typeof(pl[n]) == "undefined") - return; - - document.forms[0].elements[p + "_" + n].checked = pl[n] != 'false'; -} - -function setStr(pl, p, n) { - var f = document.forms[0], e = f.elements[(p != null ? p + "_" : '') + n]; - - if (typeof(pl[n]) == "undefined") - return; - - if (e.type == "text") - e.value = pl[n]; - else - selectByValue(f, (p != null ? p + "_" : '') + n, pl[n]); -} - -function getBool(p, n, d, tv, fv) { - var v = document.forms[0].elements[p + "_" + n].checked; - - tv = typeof(tv) == 'undefined' ? 'true' : "'" + jsEncode(tv) + "'"; - fv = typeof(fv) == 'undefined' ? 'false' : "'" + jsEncode(fv) + "'"; - - return (v == d) ? '' : n + (v ? ':' + tv + ',' : ":\'" + fv + "\',"); -} - -function getStr(p, n, d) { - var e = document.forms[0].elements[(p != null ? p + "_" : "") + n]; - var v = e.type == "text" ? e.value : e.options[e.selectedIndex].value; - - if (n == 'src') - v = tinyMCEPopup.editor.convertURL(v, 'src', null); - - return ((n == d || v == '') ? '' : n + ":'" + jsEncode(v) + "',"); -} - -function getInt(p, n, d) { - var e = document.forms[0].elements[(p != null ? p + "_" : "") + n]; - var v = e.type == "text" ? e.value : e.options[e.selectedIndex].value; - - return ((n == d || v == '') ? '' : n + ":" + v.replace(/[^0-9]+/g, '') + ","); -} - -function jsEncode(s) { - s = s.replace(new RegExp('\\\\', 'g'), '\\\\'); - s = s.replace(new RegExp('"', 'g'), '\\"'); - s = s.replace(new RegExp("'", 'g'), "\\'"); - - return s; -} - -function generatePreview(c) { - var f = document.forms[0], p = document.getElementById('prev'), h = '', cls, pl, n, type, codebase, wp, hp, nw, nh; - - p.innerHTML = ''; - - nw = parseInt(f.width.value); - nh = parseInt(f.height.value); - - if (f.width.value != "" && f.height.value != "") { - if (f.constrain.checked) { - if (c == 'width' && oldWidth != 0) { - wp = nw / oldWidth; - nh = Math.round(wp * nh); - f.height.value = nh; - } else if (c == 'height' && oldHeight != 0) { - hp = nh / oldHeight; - nw = Math.round(hp * nw); - f.width.value = nw; - } - } - } - - if (f.width.value != "") - oldWidth = nw; - - if (f.height.value != "") - oldHeight = nh; - - // After constrain - pl = serializeParameters(); - - switch (f.media_type.options[f.media_type.selectedIndex].value) { - case "flash": - cls = 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'; - codebase = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0'; - type = 'application/x-shockwave-flash'; - break; - - case "shockwave": - cls = 'clsid:166B1BCA-3F9C-11CF-8075-444553540000'; - codebase = 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0'; - type = 'application/x-director'; - break; - - case "qt": - cls = 'clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B'; - codebase = 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0'; - type = 'video/quicktime'; - break; - - case "wmp": - cls = ed.getParam('media_wmp6_compatible') ? 'clsid:05589FA1-C356-11CE-BF01-00AA0055595A' : 'clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6'; - codebase = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'; - type = 'application/x-mplayer2'; - break; - - case "rmp": - cls = 'clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA'; - codebase = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'; - type = 'audio/x-pn-realaudio-plugin'; - break; - } - - if (pl == '') { - p.innerHTML = ''; - return; - } - - pl = tinyMCEPopup.editor.plugins.media._parse(pl); - - if (!pl.src) { - p.innerHTML = ''; - return; - } - - pl.src = tinyMCEPopup.editor.documentBaseURI.toAbsolute(pl.src); - pl.width = !pl.width ? 100 : pl.width; - pl.height = !pl.height ? 100 : pl.height; - pl.id = !pl.id ? 'obj' : pl.id; - pl.name = !pl.name ? 'eobj' : pl.name; - pl.align = !pl.align ? '' : pl.align; - - // Avoid annoying warning about insecure items - if (!tinymce.isIE || document.location.protocol != 'https:') { - h += ''; - - for (n in pl) { - h += ''; - - // Add extra url parameter if it's an absolute URL - if (n == 'src' && pl[n].indexOf('://') != -1) - h += ''; - } - } - - h += ' - - - {#media_dlg.title} - - - - - - - - - -
- - -
-
-
- {#media_dlg.general} - - - - - - - - - - - - - - - - - - -
- -
- - - - - -
 
-
- - - - - - -
x   
-
-
- -
- {#media_dlg.preview} - -
-
- -
-
- {#media_dlg.advanced} - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - -
 
-
-
- -
- {#media_dlg.flash_options} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- - - -
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - - - - - - - -
-
- -
- {#media_dlg.flv_options} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
-
- -
- {#media_dlg.qt_options} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
-  
- - - - - -
 
-
-
- -
- {#media_dlg.wmp_options} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
-
- -
- {#media_dlg.rmp_options} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
-   -
-
- -
- {#media_dlg.shockwave_options} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
-
-
-
- -
-
- -
- -
- -
-
-
- - diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/nonbreaking/editor_plugin.js b/code/simple_tinymce_field/javascript/tiny_mce/plugins/nonbreaking/editor_plugin.js deleted file mode 100644 index f2dbbff..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/nonbreaking/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.Nonbreaking",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceNonBreaking",function(){a.execCommand("mceInsertContent",false,(a.plugins.visualchars&&a.plugins.visualchars.state)?'·':" ")});a.addButton("nonbreaking",{title:"nonbreaking.nonbreaking_desc",cmd:"mceNonBreaking"});if(a.getParam("nonbreaking_force_tab")){a.onKeyDown.add(function(d,f){if(tinymce.isIE&&f.keyCode==9){d.execCommand("mceNonBreaking");d.execCommand("mceNonBreaking");d.execCommand("mceNonBreaking");tinymce.dom.Event.cancel(f)}})}},getInfo:function(){return{longname:"Nonbreaking space",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("nonbreaking",tinymce.plugins.Nonbreaking)})(); \ No newline at end of file diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/nonbreaking/editor_plugin_src.js b/code/simple_tinymce_field/javascript/tiny_mce/plugins/nonbreaking/editor_plugin_src.js deleted file mode 100644 index b723756..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/nonbreaking/editor_plugin_src.js +++ /dev/null @@ -1,50 +0,0 @@ -/** - * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $ - * - * @author Moxiecode - * @copyright Copyright 2004-2008, Moxiecode Systems AB, All rights reserved. - */ - -(function() { - tinymce.create('tinymce.plugins.Nonbreaking', { - init : function(ed, url) { - var t = this; - - t.editor = ed; - - // Register commands - ed.addCommand('mceNonBreaking', function() { - ed.execCommand('mceInsertContent', false, (ed.plugins.visualchars && ed.plugins.visualchars.state) ? '·' : ' '); - }); - - // Register buttons - ed.addButton('nonbreaking', {title : 'nonbreaking.nonbreaking_desc', cmd : 'mceNonBreaking'}); - - if (ed.getParam('nonbreaking_force_tab')) { - ed.onKeyDown.add(function(ed, e) { - if (tinymce.isIE && e.keyCode == 9) { - ed.execCommand('mceNonBreaking'); - ed.execCommand('mceNonBreaking'); - ed.execCommand('mceNonBreaking'); - tinymce.dom.Event.cancel(e); - } - }); - } - }, - - getInfo : function() { - return { - longname : 'Nonbreaking space', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - - // Private methods - }); - - // Register plugin - tinymce.PluginManager.add('nonbreaking', tinymce.plugins.Nonbreaking); -})(); \ No newline at end of file diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/noneditable/editor_plugin.js b/code/simple_tinymce_field/javascript/tiny_mce/plugins/noneditable/editor_plugin.js deleted file mode 100644 index 9945cd8..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/noneditable/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var a=tinymce.dom.Event;tinymce.create("tinymce.plugins.NonEditablePlugin",{init:function(d,e){var f=this,c,b;f.editor=d;c=d.getParam("noneditable_editable_class","mceEditable");b=d.getParam("noneditable_noneditable_class","mceNonEditable");d.onNodeChange.addToTop(function(h,g,k){var j,i;j=h.dom.getParent(h.selection.getStart(),function(l){return h.dom.hasClass(l,b)});i=h.dom.getParent(h.selection.getEnd(),function(l){return h.dom.hasClass(l,b)});if(j||i){f._setDisabled(1);return false}else{f._setDisabled(0)}})},getInfo:function(){return{longname:"Non editable elements",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/noneditable",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_block:function(c,d){var b=d.keyCode;if((b>32&&b<41)||(b>111&&b<124)){return}return a.cancel(d)},_setDisabled:function(d){var c=this,b=c.editor;tinymce.each(b.controlManager.controls,function(e){e.setDisabled(d)});if(d!==c.disabled){if(d){b.onKeyDown.addToTop(c._block);b.onKeyPress.addToTop(c._block);b.onKeyUp.addToTop(c._block);b.onPaste.addToTop(c._block)}else{b.onKeyDown.remove(c._block);b.onKeyPress.remove(c._block);b.onKeyUp.remove(c._block);b.onPaste.remove(c._block)}c.disabled=d}}});tinymce.PluginManager.add("noneditable",tinymce.plugins.NonEditablePlugin)})(); \ No newline at end of file diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/noneditable/editor_plugin_src.js b/code/simple_tinymce_field/javascript/tiny_mce/plugins/noneditable/editor_plugin_src.js deleted file mode 100644 index 77db577..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/noneditable/editor_plugin_src.js +++ /dev/null @@ -1,87 +0,0 @@ -/** - * $Id: editor_plugin_src.js 743 2008-03-23 17:47:33Z spocke $ - * - * @author Moxiecode - * @copyright Copyright 2004-2008, Moxiecode Systems AB, All rights reserved. - */ - -(function() { - var Event = tinymce.dom.Event; - - tinymce.create('tinymce.plugins.NonEditablePlugin', { - init : function(ed, url) { - var t = this, editClass, nonEditClass; - - t.editor = ed; - editClass = ed.getParam("noneditable_editable_class", "mceEditable"); - nonEditClass = ed.getParam("noneditable_noneditable_class", "mceNonEditable"); - - ed.onNodeChange.addToTop(function(ed, cm, n) { - var sc, ec; - - // Block if start or end is inside a non editable element - sc = ed.dom.getParent(ed.selection.getStart(), function(n) { - return ed.dom.hasClass(n, nonEditClass); - }); - - ec = ed.dom.getParent(ed.selection.getEnd(), function(n) { - return ed.dom.hasClass(n, nonEditClass); - }); - - // Block or unblock - if (sc || ec) { - t._setDisabled(1); - return false; - } else - t._setDisabled(0); - }); - }, - - getInfo : function() { - return { - longname : 'Non editable elements', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/noneditable', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - _block : function(ed, e) { - var k = e.keyCode; - - // Don't block arrow keys, pg up/down, and F1-F12 - if ((k > 32 && k < 41) || (k > 111 && k < 124)) - return; - - return Event.cancel(e); - }, - - _setDisabled : function(s) { - var t = this, ed = t.editor; - - tinymce.each(ed.controlManager.controls, function(c) { - c.setDisabled(s); - }); - - if (s !== t.disabled) { - if (s) { - ed.onKeyDown.addToTop(t._block); - ed.onKeyPress.addToTop(t._block); - ed.onKeyUp.addToTop(t._block); - ed.onPaste.addToTop(t._block); - } else { - ed.onKeyDown.remove(t._block); - ed.onKeyPress.remove(t._block); - ed.onKeyUp.remove(t._block); - ed.onPaste.remove(t._block); - } - - t.disabled = s; - } - } - }); - - // Register plugin - tinymce.PluginManager.add('noneditable', tinymce.plugins.NonEditablePlugin); -})(); \ No newline at end of file diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/pagebreak/css/content.css b/code/simple_tinymce_field/javascript/tiny_mce/plugins/pagebreak/css/content.css deleted file mode 100644 index c949d58..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/pagebreak/css/content.css +++ /dev/null @@ -1 +0,0 @@ -.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../img/pagebreak.gif) no-repeat center top;} diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/pagebreak/editor_plugin.js b/code/simple_tinymce_field/javascript/tiny_mce/plugins/pagebreak/editor_plugin.js deleted file mode 100644 index a212f69..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/pagebreak/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.PageBreakPlugin",{init:function(b,d){var f='',a="mcePageBreak",c=b.getParam("pagebreak_separator",""),e;e=new RegExp(c.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(g){return"\\"+g}),"g");b.addCommand("mcePageBreak",function(){b.execCommand("mceInsertContent",0,f)});b.addButton("pagebreak",{title:"pagebreak.desc",cmd:a});b.onInit.add(function(){if(b.settings.content_css!==false){b.dom.loadCSS(d+"/css/content.css")}if(b.theme.onResolveName){b.theme.onResolveName.add(function(g,h){if(h.node.nodeName=="IMG"&&b.dom.hasClass(h.node,a)){h.name="pagebreak"}})}});b.onClick.add(function(g,h){h=h.target;if(h.nodeName==="IMG"&&g.dom.hasClass(h,a)){g.selection.select(h)}});b.onNodeChange.add(function(h,g,i){g.setActive("pagebreak",i.nodeName==="IMG"&&h.dom.hasClass(i,a))});b.onBeforeSetContent.add(function(g,h){h.content=h.content.replace(e,f)});b.onPostProcess.add(function(g,h){if(h.get){h.content=h.content.replace(/]+>/g,function(i){if(i.indexOf('class="mcePageBreak')!==-1){i=c}return i})}})},getInfo:function(){return{longname:"PageBreak",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/pagebreak",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("pagebreak",tinymce.plugins.PageBreakPlugin)})(); \ No newline at end of file diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/pagebreak/editor_plugin_src.js b/code/simple_tinymce_field/javascript/tiny_mce/plugins/pagebreak/editor_plugin_src.js deleted file mode 100644 index 16f5748..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/pagebreak/editor_plugin_src.js +++ /dev/null @@ -1,74 +0,0 @@ -/** - * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $ - * - * @author Moxiecode - * @copyright Copyright 2004-2008, Moxiecode Systems AB, All rights reserved. - */ - -(function() { - tinymce.create('tinymce.plugins.PageBreakPlugin', { - init : function(ed, url) { - var pb = '', cls = 'mcePageBreak', sep = ed.getParam('pagebreak_separator', ''), pbRE; - - pbRE = new RegExp(sep.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g, function(a) {return '\\' + a;}), 'g'); - - // Register commands - ed.addCommand('mcePageBreak', function() { - ed.execCommand('mceInsertContent', 0, pb); - }); - - // Register buttons - ed.addButton('pagebreak', {title : 'pagebreak.desc', cmd : cls}); - - ed.onInit.add(function() { - if (ed.settings.content_css !== false) - ed.dom.loadCSS(url + "/css/content.css"); - - if (ed.theme.onResolveName) { - ed.theme.onResolveName.add(function(th, o) { - if (o.node.nodeName == 'IMG' && ed.dom.hasClass(o.node, cls)) - o.name = 'pagebreak'; - }); - } - }); - - ed.onClick.add(function(ed, e) { - e = e.target; - - if (e.nodeName === 'IMG' && ed.dom.hasClass(e, cls)) - ed.selection.select(e); - }); - - ed.onNodeChange.add(function(ed, cm, n) { - cm.setActive('pagebreak', n.nodeName === 'IMG' && ed.dom.hasClass(n, cls)); - }); - - ed.onBeforeSetContent.add(function(ed, o) { - o.content = o.content.replace(pbRE, pb); - }); - - ed.onPostProcess.add(function(ed, o) { - if (o.get) - o.content = o.content.replace(/]+>/g, function(im) { - if (im.indexOf('class="mcePageBreak') !== -1) - im = sep; - - return im; - }); - }); - }, - - getInfo : function() { - return { - longname : 'PageBreak', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/pagebreak', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('pagebreak', tinymce.plugins.PageBreakPlugin); -})(); \ No newline at end of file diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/pagebreak/img/pagebreak.gif b/code/simple_tinymce_field/javascript/tiny_mce/plugins/pagebreak/img/pagebreak.gif deleted file mode 100644 index acdf408..0000000 Binary files a/code/simple_tinymce_field/javascript/tiny_mce/plugins/pagebreak/img/pagebreak.gif and /dev/null differ diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/pagebreak/img/trans.gif b/code/simple_tinymce_field/javascript/tiny_mce/plugins/pagebreak/img/trans.gif deleted file mode 100644 index 3884865..0000000 Binary files a/code/simple_tinymce_field/javascript/tiny_mce/plugins/pagebreak/img/trans.gif and /dev/null differ diff --git a/code/simple_tinymce_field/javascript/tiny_mce/plugins/paste/editor_plugin.js b/code/simple_tinymce_field/javascript/tiny_mce/plugins/paste/editor_plugin.js deleted file mode 100644 index 20e680d..0000000 --- a/code/simple_tinymce_field/javascript/tiny_mce/plugins/paste/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.PastePlugin",{init:function(c,d){var e=this,b;e.editor=c;e.url=d;e.onPreProcess=new tinymce.util.Dispatcher(e);e.onPostProcess=new tinymce.util.Dispatcher(e);e.onPreProcess.add(e._preProcess);e.onPostProcess.add(e._postProcess);e.onPreProcess.add(function(h,i){c.execCallback("paste_preprocess",h,i)});e.onPostProcess.add(function(h,i){c.execCallback("paste_postprocess",h,i)});function g(i){var h=c.dom;e.onPreProcess.dispatch(e,i);i.node=h.create("div",0,i.content);e.onPostProcess.dispatch(e,i);i.content=c.serializer.serialize(i.node,{getInner:1});if(/<(p|h[1-6]|ul|ol)/.test(i.content)){e._insertBlockContent(c,h,i.content)}else{e._insert(i.content)}}c.addCommand("mceInsertClipboardContent",function(h,i){g(i)});function f(l){var p,k,i,j=c.selection,o=c.dom,h=c.getBody(),m;if(o.get("_mcePaste")){return}p=o.add(h,"div",{id:"_mcePaste"}," ");if(h!=c.getDoc().body){m=o.getPos(c.selection.getStart(),h).y}else{m=h.scrollTop}o.setStyles(p,{position:"absolute",left:-10000,top:m,width:1,height:1,overflow:"hidden"});if(tinymce.isIE){i=o.doc.body.createTextRange();i.moveToElementText(p);i.execCommand("Paste");o.remove(p);g({content:p.innerHTML});return tinymce.dom.Event.cancel(l)}else{k=c.selection.getRng();p=p.firstChild;i=c.getDoc().createRange();i.setStart(p,0);i.setEnd(p,1);j.setRng(i);window.setTimeout(function(){var r=o.get("_mcePaste"),q;r.id="_mceRemoved";o.remove(r);r=o.get("_mcePaste")||r;q=(o.select("> span.Apple-style-span div",r)[0]||o.select("> span.Apple-style-span",r)[0]||r).innerHTML;o.remove(r);if(k){j.setRng(k)}g({content:q})},0)}}if(c.getParam("paste_auto_cleanup_on_paste",true)){if(tinymce.isOpera||/Firefox\/2/.test(navigator.userAgent)){c.onKeyDown.add(function(h,i){if(((tinymce.isMac?i.metaKey:i.ctrlKey)&&i.keyCode==86)||(i.shiftKey&&i.keyCode==45)){f(i)}})}else{c.onPaste.addToTop(function(h,i){return f(i)})}}if(c.getParam("paste_block_drop")){c.onInit.add(function(){c.dom.bind(c.getBody(),["dragend","dragover","draggesture","dragdrop","drop","drag"],function(h){h.preventDefault();h.stopPropagation();return false})})}e._legacySupport()},getInfo:function(){return{longname:"Paste text/word",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_preProcess:function(d,g){var b=this.editor,c=g.content,f,e;function f(h){a(h,function(i){if(i.constructor==RegExp){c=c.replace(i,"")}else{c=c.replace(i[0],i[1])}})}f([/^\s*( )+/g,/( |]*>)+\s*$/g]);if(/(class=\"?Mso|style=\"[^\"]*\bmso\-|w:WordDocument)/.test(c)||g.wordContent){g.wordContent=true;if(b.getParam("paste_convert_middot_lists",true)){f([[//gi,"$&__MCE_ITEM__"],[/(]+:\s*symbol[^>]+>)/gi,"$1__MCE_ITEM__"],[/(]+mso-list:[^>]+>)/gi,"$1__MCE_ITEM__"]])}f([//gi,/<\/?(img|font|meta|link|style|div|v:\w+)[^>]*>/gi,/<\\?\?xml[^>]*>/gi,/<\/?o:[^>]*>/gi,/ (id|name|language|type|on\w+|v:\w+)=\"([^\"]*)\"/gi,/ (id|name|language|type|on\w+|v:\w+)=(\w+)/gi,[/<(\/?)s>/gi,"<$1strike>"],/]+>[\s\S]*?<\/script>/gi,[/ /g,"\u00a0"]]);if(!b.getParam("paste_retain_style_properties")){f([/<\/?(span)[^>]*>/gi])}}e=b.getParam("paste_strip_class_attributes","all");if(e!="none"){if(e=="all"){f([/ class=\"([^\"]*)\"/gi,/ class=(\w+)/gi])}else{f([/ class=\"(mso[^\"]*)\"/gi,/ class=(mso\w+)/gi])}}if(b.getParam("paste_remove_spans")){f([/<\/?(span)[^>]*>/gi])}g.content=c},_postProcess:function(e,g){var d=this,c=d.editor,f=c.dom,b;if(g.wordContent){a(f.select("a",g.node),function(h){if(!h.href||h.href.indexOf("#_Toc")!=-1){f.remove(h,1)}});if(d.editor.getParam("paste_convert_middot_lists",true)){d._convertLists(e,g)}b=c.getParam("paste_retain_style_properties");if(tinymce.is(b,"string")){b=tinymce.explode(b)}a(f.select("*",g.node),function(l){var m={},j=0,k,n,h;if(b){for(k=0;k0){f.setStyles(l,m)}else{if(l.nodeName=="SPAN"&&!l.className){f.remove(l,true)}}})}if(c.getParam("paste_remove_styles")||(c.getParam("paste_remove_styles_if_webkit")&&tinymce.isWebKit)){a(f.select("*[style]",g.node),function(h){h.removeAttribute("style");h.removeAttribute("mce_style")})}else{if(tinymce.isWebKit){a(f.select("*",g.node),function(h){h.removeAttribute("mce_style")})}}},_convertLists:function(e,c){var g=e.editor.dom,f,j,b=-1,d,k=[],i,h;a(g.select("p",c.node),function(r){var n,s="",q,o,l,m;for(n=r.firstChild;n&&n.nodeType==3;n=n.nextSibling){s+=n.nodeValue}s=r.innerHTML.replace(/<\/?\w+[^>]*>/gi,"").replace(/ /g,"\u00a0");if(/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o]\s*\u00a0*/.test(s)){q="ul"}if(/^__MCE_ITEM__\s*\w+\.\s*\u00a0{2,}/.test(s)){q="ol"}if(q){d=parseFloat(r.style.marginLeft||0);if(d>b){k.push(d)}if(!f||q!=i){f=g.create(q);g.insertAfter(f,r)}else{if(d>b){f=j.appendChild(g.create(q))}else{if(d]*>/gi,"");if(q=="ul"&&/^[\u2022\u00b7\u00a7\u00d8o]/.test(p)){g.remove(t)}else{if(/^[\s\S]*\w+\.( |\u00a0)*\s*/.test(p)){g.remove(t)}}});o=r.innerHTML;if(q=="ul"){o=r.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^[\u2022\u00b7\u00a7\u00d8o]\s*( |\u00a0)+\s*/,"")}else{o=r.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^\s*\w+\.( |\u00a0)+\s*/,"")}j=f.appendChild(g.create("li",0,o));g.remove(r);b=d;i=q}else{f=b=0}});h=c.node.innerHTML;if(h.indexOf("__MCE_ITEM__")!=-1){c.node.innerHTML=h.replace(/__MCE_ITEM__/g,"")}},_insertBlockContent:function(h,e,i){var c,g,d=h.selection,m,j,b,k,f;function l(p){var o;if(tinymce.isIE){o=h.getDoc().body.createTextRange();o.moveToElementText(p);o.collapse(false);o.select()}else{d.select(p,1);d.collapse(false)}}this._insert(' ',1);g=e.get("_marker");c=e.getParent(g,"p,h1,h2,h3,h4,h5,h6,ul,ol");if(c){g=e.split(c,g);a(e.create("div",0,i).childNodes,function(o){m=g.parentNode.insertBefore(o.cloneNode(true),g)});l(m)}else{e.setOuterHTML(g,i);d.select(h.getBody(),1);d.collapse(0)}e.remove("_marker");j=d.getStart();b=e.getViewPort(h.getWin());k=h.dom.getPos(j).y;f=j.clientHeight;if(kb.y+b.h){h.getDoc().body.scrollTop=k