| 33 | 33 | float: left; |
|---|---|---|
| 34 | 34 | } |
| 35 | ||
| 35 | ||
| 36 | 36 | #TreeActions button.disabled { |
| 37 | 37 | color: #aaa; |
| ... | ... | |
| 86 | 86 | color: #666; |
| 87 | 87 | } |
| 88 | ||
| 88 | ||
| 89 | 89 | input.disabled:hover { |
| 90 | 90 | background-image: url(../images/textures/ToolBar.png); |
| 91 | 91 | } |
| 92 | ||
| 92 | ||
| 93 | 93 | input.action.loading, input.action.loading:hover { |
| 94 | 94 | padding-left: 22px; |
| ... | ... | |
| 255 | 255 | #top #Logo a { |
| 256 | 256 | margin: 0; |
| 257 | display: block; |
|
| 257 | display: block; | |
| 258 | 258 | font-size: 14px; |
| 259 | 259 | text-decoration: none; |
| 260 | height: 26px; |
|
| 260 | height: 26px; | |
| 261 | 261 | line-height: 22px; |
| 262 | position: absolute; |
|
| 263 | top: 5px; |
|
| 262 | position: absolute; | |
| 263 | top: 5px; | |
| 264 | 264 | right: 8px; |
| 265 | 265 | padding-right: 34px; |
| ... | ... | |
| 270 | 270 | padding-bottom: 0; |
| 271 | 271 | } |
| 272 | ||
| 272 | ||
| 273 | 273 | #bottom { |
| 274 | 274 | width: 100%; |
| ... | ... | |
| 348 | 348 | overflow-x: hidden; |
| 349 | 349 | } |
| 350 | ||
| 350 | ||
| 351 | 351 | #sitetree_holder #TreeTools { |
| 352 | 352 | float: left; |
| ... | ... | |
| 434 | 434 | margin: 0; |
| 435 | 435 | } |
| 436 | #TreeTools #action_publish_selected, |
|
| 436 | #TreeTools #action_publish_selected, | |
| 437 | 437 | #TreeTools #action_publish_selected { |
| 438 | 438 | padding: 2px 1px; |
| ... | ... | |
| 446 | 446 | display: none; |
| 447 | 447 | } |
| 448 | ||
| 449 | div.spacer, |
|
| 448 | ||
| 449 | div.spacer, | |
| 450 | 450 | li.spacer { |
| 451 | 451 | float: none; |
| ... | ... | |
| 566 | 566 | width: 190px; |
| 567 | 567 | height: 120px; |
| 568 | overflow-y: auto; |
|
| 568 | overflow-y: auto; | |
| 569 | 569 | margin-right: 0 !important; |
| 570 | 570 | } |
| ... | ... | |
| 620 | 620 | } |
| 621 | 621 | #Form_EditorToolbarImageForm fieldset label.left, |
| 622 | #Form_EditorToolbarFlashForm fieldset label.left, |
|
| 622 | #Form_EditorToolbarFlashForm fieldset label.left, | |
| 623 | 623 | #Form_EditorToolbarLinkForm fieldset label.left { |
| 624 | 624 | float:left; |
| ... | ... | |
| 648 | 648 | #Form_EditorToolbarLinkForm .buttonRefresh { |
| 649 | 649 | display:block; |
| 650 | border:1px solid #F0F0EE; |
|
| 650 | border:1px solid #F0F0EE; | |
| 651 | 651 | width:20px; height:20px; |
| 652 | 652 | float: left; |
| 653 | 653 | } |
| 654 | 654 | #Form_EditorToolbarLinkForm a.buttonRefreshHover { |
| 655 | border: 1px solid #0A246A; |
|
| 655 | border: 1px solid #0A246A; | |
| 656 | 656 | background-color:#B2BBD0; |
| 657 | 657 | } |
| ... | ... | |
| 670 | 670 | width: 160px; |
| 671 | 671 | } |
| 672 | ||
| 672 | ||
| 673 | 673 | #Form_EditorToolbarImageForm_Width, |
| 674 | 674 | #Form_EditorToolbarImageForm_Height, |
| 675 | #Form_EditorToolbarFlashForm_Width, | |
| 676 | #Form_EditorToolbarFlashForm_Height { | |
| 675 | #Form_EditorToolbarFlashForm_Width { | |
| 677 | 676 | outline: 3px solid #E9E9E9; |
| 678 | 677 | } |
| ... | ... | |
| 712 | 711 | border-color: #FF9300; |
| 713 | 712 | } |
| 714 | ||
| 713 | ||
| 715 | 714 | .message.warning { |
| 716 | 715 | background-color: #FFD2A6; |
| ... | ... | |
| 721 | 720 | border-color: #FF0000; |
| 722 | 721 | } |
| 722 | ||
| 723 | ||
| 724 | ||
| 725 | ||
| 726 | #Form_EditorToolbarYoutubeForm p { | |
| 727 | margin-left:5px; | |
| 728 | } | |
| 729 | #right form#Form_EditorToolbarYoutubeForm { | |
| 730 | background: #eee; | |
| 731 | border-bottom: 1px solid #ccc; | |
| 732 | display: none; | |
| 733 | margin: 1px 0 0 0; | |
| 734 | padding: 5px; | |
| 735 | /* | |
| 736 | * HACK IE (all versions): container needs to be higher stacking order | |
| 737 | * than any DOM-elemnt under it. | |
| 738 | * @see http://www.aplus.co.yu/lab/z-pos/ | |
| 739 | */ | |
| 740 | /*overflow: hidden;*/ | |
| 741 | z-index: 1001; | |
| 742 | } | |
| 743 | #contentPanel input#Form_EditorToolbarYoutubeForm_Width { | |
| 744 | width: 30px; | |
| 745 | } | |
| 746 | ||
| 747 | #contentPanel input#Form_EditorToolbarYoutubeForm_Height { | |
| 748 | width: 30px; | |
| 749 | } | |
| 750 | ||
| 751 | ||
| 752 | #Form_EditorToolbarYoutubeForm fieldset label.left { | |
| 753 | float:left; | |
| 754 | margin-left:0px; | |
| 755 | color: #666; | |
| 756 | line-height: 1.2; | |
| 757 | font-size: 11px; | |
| 758 | width: 190px; | |
| 759 | } | |
| 760 | ||
| 761 | ||
| 762 | ||
| 763 | #Form_EditorToolbarYoutubeForm fieldset li div.middleColumn { | |
| 764 | float: none; | |
| 765 | } | |
| 766 | ||
| 767 | ||
| 768 | #Form_EditorToolbarYoutubeForm fieldset div.fieldgroupField { | |
| 769 | display: inline; | |
| 770 | } | |
| 771 | ||
| 772 | #Form_EditorToolbarVimeoForm p { | |
| 773 | margin-left:5px; | |
| 774 | } | |
| 775 | #right form#Form_EditorToolbarVimeoForm { | |
| 776 | background: #eee; | |
| 777 | border-bottom: 1px solid #ccc; | |
| 778 | display: none; | |
| 779 | margin: 1px 0 0 0; | |
| 780 | padding: 5px; | |
| 781 | /* | |
| 782 | * HACK IE (all versions): container needs to be higher stacking order | |
| 783 | * than any DOM-elemnt under it. | |
| 784 | * @see http://www.aplus.co.yu/lab/z-pos/ | |
| 785 | */ | |
| 786 | /*overflow: hidden;*/ | |
| 787 | z-index: 1001; | |
| 788 | } | |
| 789 | #contentPanel input#Form_EditorToolbarVimeoForm_Width { | |
| 790 | width: 30px; | |
| 791 | } | |
| 792 | ||
| 793 | #contentPanel input#Form_EditorToolbarVimeoForm_Height { | |
| 794 | width: 30px; | |
| 795 | } | |
| 796 | ||
| 797 | ||
| 798 | #Form_EditorToolbarVimeoForm fieldset label.left { | |
| 799 | float:left; | |
| 800 | margin-left:0px; | |
| 801 | color: #666; | |
| 802 | line-height: 1.2; | |
| 803 | font-size: 11px; | |
| 804 | width: 190px; | |
| 805 | } | |
| 806 | ||
| 807 | ||
| 808 | ||
| 809 | #Form_EditorToolbarVimeoForm fieldset li div.middleColumn { | |
| 810 | float: none; | |
| 811 | } | |
| 812 | ||
| 813 | ||
| 814 | #Form_EditorToolbarVimeoForm fieldset div.fieldgroupField { | |
| 815 | display: inline; | |
| 816 | } |
| 2 | 2 | insertlink: 'Link einfÌgen', |
|---|---|---|
| 3 | 3 | insertimage: 'Bild einfÌgen', |
| 4 | insertflash: 'Flash Objekt einfÌgen' | |
| 4 | insertflash: 'Flash Objekt einfÌgen', | |
| 5 | insertyoutube: 'YouTube einfÌgen', | |
| 6 | insertvimeo: 'Vimeo einfÌgen' | |
| 5 | 7 | }); |
| 2 | 2 | insertlink: 'Insert Link', |
|---|---|---|
| 3 | 3 | insertimage: 'Insert Image', |
| 4 | insertflash: 'Insert Flash Object' | |
| 4 | insertflash: 'Insert Flash Object', | |
| 5 | insertyoutube: 'Insert YouTube', | |
| 6 | insertvimeo: 'Insert Vimeo' | |
| 5 | 7 | }); |
| 9 | 9 | * |
|---|---|---|
| 10 | 10 | * @returns Name/value array containing information about the plugin. |
| 11 | * @type Array |
|
| 11 | * @type Array | |
| 12 | 12 | */ |
| 13 | 13 | getInfo : function() { |
| ... | ... | |
| 28 | 28 | 'sslink' : 'Form_EditorToolbarLinkForm', |
| 29 | 29 | 'ssimage' : 'Form_EditorToolbarImageForm', |
| 30 | 'ssflash' : 'Form_EditorToolbarFlashForm' | |
| 30 | 'ssflash' : 'Form_EditorToolbarFlashForm', | |
| 31 | 'ssyoutube' : 'Form_EditorToolbarYoutubeForm', | |
| 32 | 'ssvimeo' : 'Form_EditorToolbarVimeoForm' | |
| 31 | 33 | }; |
| 32 | 34 | |
| 33 | ed.addButton('sslink', {title : ed.getLang('tinymce_ssbuttons.insertlink'), cmd : 'sslink', 'class' : 'mce_link'}); | |
| 34 | ed.addButton('ssimage', {title : ed.getLang('tinymce_ssbuttons.insertimage'), cmd : 'ssimage', 'class' : 'mce_image'}); | |
| 35 | ed.addButton('ssflash', {title : ed.getLang('tinymce_ssbuttons.insertflash'), cmd : 'ssflash', 'class' : 'mce_flash', 'image': url + '/img/flash.gif'}); | |
| 35 | ed.addButton('sslink', {title : ed.getLang('tinymce_ssbuttons.insertlink'), cmd : 'sslink', 'class' : 'mce_link'}); | |
| 36 | ed.addButton('ssimage', {title : ed.getLang('tinymce_ssbuttons.insertimage'), cmd : 'ssimage', 'class' : 'mce_image'}); | |
| 37 | ed.addButton('ssflash', {title : ed.getLang('tinymce_ssbuttons.insertflash'), cmd : 'ssflash', 'class' : 'mce_flash', 'image': url + '/img/flash.gif'}); | |
| 38 | ed.addButton('ssyoutube', {title : ed.getLang('tinymce_ssbuttons.insertyoutube'), cmd : 'ssyoutube', 'class' : 'mce_youtube', 'image': url + '/img/youtube.png'}); | |
| 39 | ed.addButton('ssvimeo', {title : ed.getLang('tinymce_ssbuttons.insertvimeo'), cmd : 'ssvimeo', 'class' : 'mce_vimeo', 'image': url + '/img/vimeo.png'}); | |
| 36 | 40 | |
| 37 | 41 | /** |
| ... | ... | |
| 41 | 45 | function showSidePanel(showCommand, hideCommands) { |
| 42 | 46 | ed.ss_focus_bookmark = ed.selection.getBookmark(); |
| 43 | hideCommands.each(function(command) { |
|
| 47 | hideCommands.each(function(command) { | |
| 44 | 48 | ed.controlManager.setActive(command,false); |
| 45 | Element.hide(forms[command]); |
|
| 49 | Element.hide(forms[command]); | |
| 46 | 50 | }); |
| 47 | 51 | |
| ... | ... | |
| 64 | 68 | |
| 65 | 69 | ed.addCommand("ssclosesidepanel", function(ed) { |
| 66 | showSidePanel('', [ 'sslink', 'ssimage', 'ssflash' |
|
| 70 | showSidePanel('', [ 'sslink', 'ssimage', 'ssflash', 'ssyoutube', 'ssvimeo' ]); | |
| 67 | 71 | }); |
| 68 | 72 | |
| 69 | 73 | ed.addCommand("sslink", function(ed) { |
| 70 | showSidePanel('sslink', [ 'ssimage', 'ssflash' |
|
| 74 | showSidePanel('sslink', [ 'ssimage', 'ssflash', 'ssyoutube', 'ssvimeo' ]); | |
| 71 | 75 | }); |
| 72 | 76 | |
| 73 | 77 | ed.addCommand("ssimage", function(ed) { |
| 74 | showSidePanel('ssimage', [ 'sslink', 'ssflash' |
|
| 78 | showSidePanel('ssimage', [ 'sslink', 'ssflash', 'ssyoutube', 'ssvimeo' ]); | |
| 75 | 79 | }); |
| 76 | 80 | |
| 77 | 81 | ed.addCommand("ssflash", function(ed) { |
| 78 | showSidePanel('ssflash', [ 'ssimage', 'sslink' ]); | |
| 82 | showSidePanel('ssflash', [ 'ssimage', 'sslink', 'ssyoutube', 'ssvimeo' ]); | |
| 83 | }); | |
| 84 | ||
| 85 | ed.addCommand("ssyoutube", function(ed) { | |
| 86 | showSidePanel('ssyoutube', [ 'ssimage', 'sslink', 'ssflash', 'ssvimeo' ]); | |
| 87 | }); | |
| 88 | ||
| 89 | ed.addCommand("ssvimeo", function(ed) { | |
| 90 | showSidePanel('ssvimeo', [ 'ssimage', 'sslink', 'ssflash', 'ssyoutube' ]); | |
| 79 | 91 | }); |
| 80 | 92 | |
| ... | ... | |
| 89 | 101 | $('Form_EditorToolbarLinkForm').updateSelection(ed); |
| 90 | 102 | }); |
| 91 | ||
| 103 | ||
| 92 | 104 | // resize image containers when the image is resized. |
| 93 | 105 | if(!tinymce.isOpera && !tinymce.isWebKit) ed.onMouseUp.add(function(ed, o) { |
| 11 | 11 | <body class="stillLoading $CSSClasses"> |
|---|---|---|
| 12 | 12 | <div id="Loading" style="background: #FFF url($LoadingImage) 50% 50% no-repeat; position: absolute;z-index: 100000;height: 100%;width: 100%;margin: 0;padding: 0;z-index: 100000;position: absolute;"><% _t('LOADING','Loading...',PR_HIGH) %><noscript><h1><% _t('REQUIREJS','The CMS requires that you have JavaScript enabled.',PR_HIGH) %></h1></noscript></div> |
| 13 | ||
| 13 | ||
| 14 | 14 | <div id="top"> |
| 15 | 15 | $CMSTopMenu |
| 16 | 16 | </div> |
| 17 | ||
| 17 | ||
| 18 | 18 | <div id="left" style="float:left"> |
| 19 | 19 | $Left |
| 20 | 20 | </div> |
| 21 | ||
| 21 | ||
| 22 | 22 | <div id="separator" style="float:left"> |
| 23 | 23 | |
| 24 | 24 | </div> |
| 25 | ||
| 25 | ||
| 26 | 26 | <div class="right" id="right"> |
| 27 | 27 | $Right |
| ... | ... | |
| 33 | 33 | $LinkForm |
| 34 | 34 | $FlashForm |
| 35 | $YoutubeForm | |
| 36 | $VimeoForm | |
| 35 | 37 | <% end_control %> |
| 36 | 38 | </div> |
| 37 | ||
| 39 | ||
| 38 | 40 | <div id="bottom"> |
| 39 | 41 | <div class="holder"> |
| 40 | 42 | <div id="logInStatus"> |
| 41 | 43 | <a href="$ApplicationLink" title="<% _t('SSWEB','Silverstripe Website') %>">$ApplicationName</a> - |
| 42 | <abbr style="border-style: none" title="<% _t('APPVERSIONTEXT1',"This is the") %> $ApplicationName <% _t('APPVERSIONTEXT2',"version that you are currently running, technically it's the CVS branch") %>">$CMSVersion</abbr> |
|
| 44 | <abbr style="border-style: none" title="<% _t('APPVERSIONTEXT1',"This is the") %> $ApplicationName <% _t('APPVERSIONTEXT2',"version that you are currently running, technically it's the CVS branch") %>">$CMSVersion</abbr> | |
| 43 | 45 | <% control CurrentMember %> |
| 44 | 46 | <% _t('LOGGEDINAS','Logged in as') %> <strong><% if FirstName && Surname %>$FirstName $Surname<% else_if FirstName %>$FirstName<% else %>$Email<% end_if %></strong> | <a href="{$BaseHref}admin/myprofile" id="EditMemberProfile"><% _t('EDITPROFILE','Profile') %></a> | <a href="Security/logout" id="LogoutLink"><% _t('LOGOUT','Log out') %></a> |
| 3 | 3 | /** |
|---|---|---|
| 4 | 4 | * Extended URL rules for the CMS module |
| 5 | * |
|
| 5 | * | |
| 6 | 6 | * @package cms |
| 7 | 7 | */ |
| ... | ... | |
| 10 | 10 | 'admin/help//$Action/$ID' => 'CMSHelp', |
| 11 | 11 | 'admin/bulkload//$Action/$ID/$OtherID' => 'BulkLoaderAdmin', |
| 12 | 'admin/cms//$Action/$ID/$OtherID' => 'CMSMain', |
|
| 12 | 'admin/cms//$Action/$ID/$OtherID' => 'CMSMain', | |
| 13 | 13 | 'PageComment//$Action/$ID' => 'PageComment_Controller', |
| 14 | 14 | 'dev/buildcache/$Action' => 'RebuildStaticCacheTask', |
| ... | ... | |
| 37 | 37 | HtmlEditorConfig::get('cms')->enablePlugins('media', 'fullscreen'); |
| 38 | 38 | HtmlEditorConfig::get('cms')->enablePlugins(array('ssbuttons' => '../../../cms/javascript/tinymce_ssbuttons/editor_plugin_src.js')); |
| 39 | ||
| 39 | ||
| 40 | 40 | HtmlEditorConfig::get('cms')->insertButtonsBefore('formatselect', 'styleselect'); |
| 41 | HtmlEditorConfig::get('cms')->insertButtonsBefore('advcode', 'ssimage', 'ssflash', 'ss |
|
| 41 | HtmlEditorConfig::get('cms')->insertButtonsBefore('advcode', 'ssimage', 'ssflash', 'ssyoutube', 'ssvimeo', 'sslink', 'unlink', 'anchor', 'separator' ); | |
| 42 | 42 | HtmlEditorConfig::get('cms')->insertButtonsAfter ('advcode', 'fullscreen', 'separator'); |
| 43 | ||
| 43 | ||
| 44 | 44 | HtmlEditorConfig::get('cms')->removeButtons('tablecontrols'); |
| 45 | 45 | HtmlEditorConfig::get('cms')->addButtonsToLine(3, 'tablecontrols'); |
| 8 | 8 | */ |
|---|---|---|
| 9 | 9 | class HtmlEditorField extends TextareaField { |
| 10 | ||
| 10 | ||
| 11 | 11 | /** |
| 12 | 12 | * Includes the JavaScript neccesary for this field to work using the {@link Requirements} system. |
| ... | ... | |
| 16 | 16 | Requirements::customScript(HtmlEditorConfig::get_active()->generateJS(), 'htmlEditorConfig'); |
| 17 | 17 | } |
| 18 | ||
| 18 | ||
| 19 | 19 | /** |
| 20 | 20 | * @see TextareaField::__construct() |
| ... | ... | |
| 22 | 22 | public function __construct($name, $title = null, $rows = 30, $cols = 20, $value = '', $form = null) { |
| 23 | 23 | parent::__construct($name, $title, $rows, $cols, $value, $form); |
| 24 | ||
| 24 | ||
| 25 | 25 | $this->addExtraClass('htmleditor'); |
| 26 | ||
| 26 | ||
| 27 | 27 | self::include_js(); |
| 28 | 28 | } |
| 29 | ||
| 29 | ||
| 30 | 30 | /** |
| 31 | 31 | * @return string |
| ... | ... | |
| 34 | 34 | // mark up broken links |
| 35 | 35 | $value = new SS_HTMLValue($this->value); |
| 36 | ||
| 36 | ||
| 37 | 37 | if($links = $value->getElementsByTagName('a')) foreach($links as $link) { |
| 38 | 38 | $matches = array(); |
| 39 | ||
| 39 | ||
| 40 | 40 | if(preg_match('/\[sitetree_link id=([0-9]+)\]/i', $link->getAttribute('href'), $matches)) { |
| 41 | 41 | if(!DataObject::get_by_id('SiteTree', $matches[1])) { |
| ... | ... | |
| 45 | 45 | } |
| 46 | 46 | } |
| 47 | ||
| 47 | ||
| 48 | 48 | return $this->createTag ( |
| 49 | 49 | 'textarea', |
| ... | ... | |
| 60 | 60 | ); |
| 61 | 61 | } |
| 62 | ||
| 62 | ||
| 63 | 63 | public function saveInto($record) { |
| 64 | 64 | if($record->escapeTypeForField($this->name) != 'xml') { |
| ... | ... | |
| 67 | 67 | ); |
| 68 | 68 | } |
| 69 | ||
| 69 | ||
| 70 | 70 | $linkedPages = array(); |
| 71 | 71 | $linkedFiles = array(); |
| 72 | ||
| 72 | ||
| 73 | 73 | $htmlValue = new SS_HTMLValue($this->value); |
| 74 | ||
| 74 | ||
| 75 | 75 | // Populate link tracking for internal links & links to asset files. |
| 76 | 76 | if($links = $htmlValue->getElementsByTagName('a')) foreach($links as $link) { |
| 77 | 77 | $href = Director::makeRelative($link->getAttribute('href')); |
| 78 | ||
| 78 | ||
| 79 | 79 | if($href) { |
| 80 | 80 | if(preg_match('/\[sitetree_link id=([0-9]+)\]/i', $href, $matches)) { |
| 81 | 81 | $ID = $matches[1]; |
| 82 | ||
| 82 | ||
| 83 | 83 | // clear out any broken link classes |
| 84 | 84 | if($class = $link->getAttribute('class')) { |
| 85 | 85 | $link->setAttribute('class', preg_replace('/(^ss-broken|ss-broken$| ss-broken )/', null, $class)); |
| 86 | 86 | } |
| 87 | ||
| 87 | ||
| 88 | 88 | $linkedPages[] = $ID; |
| 89 | 89 | if(!DataObject::get_by_id('SiteTree', $ID)) $record->HasBrokenLink = true; |
| ... | ... | |
| 101 | 101 | } |
| 102 | 102 | } |
| 103 | ||
| 103 | ||
| 104 | 104 | // Resample images, add default attributes and add to assets tracking. |
| 105 | 105 | if($images = $htmlValue->getElementsByTagName('img')) foreach($images as $img) { |
| ... | ... | |
| 110 | 110 | $record->HasBrokenFile = true; |
| 111 | 111 | } |
| 112 | ||
| 112 | ||
| 113 | 113 | continue; |
| 114 | 114 | } |
| 115 | ||
| 115 | ||
| 116 | 116 | // Resample the images if the width & height have changed. |
| 117 | 117 | $width = $img->getAttribute('width'); |
| 118 | 118 | $height = $img->getAttribute('height'); |
| 119 | ||
| 119 | ||
| 120 | 120 | if($image){ |
| 121 | 121 | if($width && $height && ($width != $image->getWidth() || $height != $image->getHeight())) { |
| ... | ... | |
| 126 | 126 | } |
| 127 | 127 | } |
| 128 | ||
| 128 | ||
| 129 | 129 | // Add default empty title & alt attributes. |
| 130 | 130 | if(!$img->getAttribute('alt')) $img->setAttribute('alt', ''); |
| 131 | 131 | if(!$img->getAttribute('title')) $img->setAttribute('title', ''); |
| 132 | ||
| 132 | ||
| 133 | 133 | //If the src attribute is not set, then we won't add this to the list: |
| 134 | 134 | if($img->getAttribute('src')){ |
| ... | ... | |
| 137 | 137 | } |
| 138 | 138 | } |
| 139 | ||
| 139 | ||
| 140 | 140 | // Save file & link tracking data. |
| 141 | 141 | if($record->ID && $record->many_many('LinkTracking') && $tracker = $record->LinkTracking()) { |
| ... | ... | |
| 149 | 149 | } |
| 150 | 150 | } |
| 151 | ||
| 151 | ||
| 152 | 152 | if($record->ID && $record->many_many('ImageTracking') && $tracker = $record->ImageTracking()) { |
| 153 | 153 | $filter = sprintf('"FieldName" = \'%s\' AND "SiteTreeID" = %d', $this->name, $record->ID); |
| ... | ... | |
| 159 | 159 | } |
| 160 | 160 | } |
| 161 | ||
| 161 | ||
| 162 | 162 | $record->{$this->name} = $htmlValue->getContent(); |
| 163 | 163 | } |
| ... | ... | |
| 172 | 172 | return $field; |
| 173 | 173 | } |
| 174 | ||
| 174 | ||
| 175 | 175 | } |
| 176 | 176 | |
| ... | ... | |
| 198 | 198 | class HtmlEditorField_Toolbar extends RequestHandler { |
| 199 | 199 | protected $controller, $name; |
| 200 | ||
| 200 | ||
| 201 | 201 | function __construct($controller, $name) { |
| 202 | 202 | parent::__construct(); |
| 203 | 203 | Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/behaviour/behaviour.js"); |
| 204 | 204 | Requirements::javascript(SAPPHIRE_DIR . "/javascript/tiny_mce_improvements.js"); |
| 205 | ||
| 205 | ||
| 206 | 206 | Requirements::javascript(SAPPHIRE_DIR ."/thirdparty/jquery-form/jquery.form.js"); |
| 207 | 207 | Requirements::javascript(SAPPHIRE_DIR ."/javascript/HtmlEditorField.js"); |
| 208 | ||
| 208 | ||
| 209 | 209 | $this->controller = $controller; |
| 210 | 210 | $this->name = $name; |
| ... | ... | |
| 213 | 213 | /** |
| 214 | 214 | * Searches the SiteTree for display in the dropdown |
| 215 | * |
|
| 215 | * | |
| 216 | 216 | * @return callback |
| 217 | */ |
|
| 217 | */ | |
| 218 | 218 | function siteTreeSearchCallback($sourceObject, $labelField, $search) { |
| 219 | 219 | return DataObject::get($sourceObject, "\"MenuTitle\" LIKE '%$search%' OR \"Title\" LIKE '%$search%'"); |
| 220 | 220 | } |
| 221 | ||
| 221 | ||
| 222 | 222 | /** |
| 223 | 223 | * Return a {@link Form} instance allowing a user to |
| 224 | 224 | * add links in the TinyMCE content editor. |
| 225 | * |
|
| 225 | * | |
| 226 | 226 | * @return Form |
| 227 | 227 | */ |
| ... | ... | |
| 230 | 230 | // mimic the SiteTree::getMenuTitle(), which is bypassed when the search is performed |
| 231 | 231 | $siteTree->setSearchFunction(array($this, 'siteTreeSearchCallback')); |
| 232 | ||
| 232 | ||
| 233 | 233 | $form = new Form( |
| 234 | 234 | $this->controller, |
| 235 | "{$this->name}/LinkForm", |
|
| 235 | "{$this->name}/LinkForm", | |
| 236 | 236 | new FieldSet( |
| 237 | 237 | new LiteralField('Heading', '<h2><img src="cms/images/closeicon.gif" alt="' . _t('HtmlEditorField.CLOSE', 'close').'" title="' . _t('HtmlEditorField.CLOSE', 'close') . '" />' . _t('HtmlEditorField.LINK', 'Link') . '</h2>'), |
| 238 | 238 | new OptionsetField( |
| 239 | 239 | 'LinkType', |
| 240 | _t('HtmlEditorField.LINKTO', 'Link to'), |
|
| 240 | _t('HtmlEditorField.LINKTO', 'Link to'), | |
| 241 | 241 | array( |
| 242 | 242 | 'internal' => _t('HtmlEditorField.LINKINTERNAL', 'Page on the site'), |
| ... | ... | |
| 244 | 244 | 'anchor' => _t('HtmlEditorField.LINKANCHOR', 'Anchor on this page'), |
| 245 | 245 | 'email' => _t('HtmlEditorField.LINKEMAIL', 'Email address'), |
| 246 | 'file' => _t('HtmlEditorField.LINKFILE', 'Download a file'), |
|
| 246 | 'file' => _t('HtmlEditorField.LINKFILE', 'Download a file'), | |
| 247 | 247 | ) |
| 248 | 248 | ), |
| ... | ... | |
| 262 | 262 | ) |
| 263 | 263 | ); |
| 264 | ||
| 264 | ||
| 265 | 265 | $form->loadDataFrom($this); |
| 266 | ||
| 266 | ||
| 267 | 267 | $this->extend('updateLinkForm', $form); |
| 268 | ||
| 268 | ||
| 269 | 269 | return $form; |
| 270 | 270 | } |
| ... | ... | |
| 273 | 273 | * Return a {@link Form} instance allowing a user to |
| 274 | 274 | * add images to the TinyMCE content editor. |
| 275 | * |
|
| 275 | * | |
| 276 | 276 | * @return Form |
| 277 | 277 | */ |
| ... | ... | |
| 306 | 306 | ) |
| 307 | 307 | ); |
| 308 | ||
| 308 | ||
| 309 | 309 | $actions = new FieldSet( |
| 310 | 310 | new FormAction('insertimage', _t('HtmlEditorField.BUTTONINSERTIMAGE', 'Insert image')) |
| 311 | 311 | ); |
| 312 | ||
| 312 | ||
| 313 | 313 | $form = new Form( |
| 314 | 314 | $this->controller, |
| ... | ... | |
| 317 | 317 | $actions |
| 318 | 318 | ); |
| 319 | ||
| 319 | ||
| 320 | 320 | $form->disableSecurityToken(); |
| 321 | 321 | $form->loadDataFrom($this); |
| 322 | ||
| 323 | // Allow other people to extend the fields being added to the imageform |
|
| 322 | ||
| 323 | // Allow other people to extend the fields being added to the imageform | |
| 324 | 324 | $this->extend('updateImageForm', $form); |
| 325 | ||
| 325 | ||
| 326 | 326 | return $form; |
| 327 | 327 | } |
| ... | ... | |
| 330 | 330 | $form = new Form( |
| 331 | 331 | $this->controller, |
| 332 | "{$this->name}/FlashForm", |
|
| 332 | "{$this->name}/FlashForm", | |
| 333 | 333 | new FieldSet( |
| 334 | 334 | new LiteralField('Heading', '<h2><img src="cms/images/closeicon.gif" alt="'._t('HtmlEditorField.CLOSE', 'close').'" title="'._t('HtmlEditorField.CLOSE', 'close').'" />'._t('HtmlEditorField.FLASH', 'Flash').'</h2>'), |
| ... | ... | |
| 349 | 349 | $form->loadDataFrom($this); |
| 350 | 350 | $form->disableSecurityToken(); |
| 351 | ||
| 351 | ||
| 352 | 352 | $this->extend('updateFlashForm', $form); |
| 353 | ||
| 353 | ||
| 354 | 354 | return $form; |
| 355 | 355 | } |
| 356 | ||
| 357 | function YoutubeForm() { | |
| 358 | $form = new Form( | |
| 359 | $this->controller, | |
| 360 | "{$this->name}/YoutubeForm", | |
| 361 | new FieldSet( | |
| 362 | new LiteralField('Heading', '<h2><img src="cms/images/closeicon.gif" alt="'._t('HtmlEditorField.CLOSE', 'close').'" title="'._t('HtmlEditorField.CLOSE', 'close').'" />'._t('HtmlEditorField.YOUTUBE', 'YouTube').'</h2>'), | |
| 363 | new TextField('YouTubeVideoCode', _t('HtmlEditorField.YOUTUBEVIDEOCODE', 'YouTube Video Code')), | |
| 364 | new CheckboxField('IncludeRelated', 'Include related videos', false), | |
| 365 | new CheckboxField('EnablePrivacyMode', 'Enable privacy-enabled mode', false), | |
| 366 | new FieldGroup(_t('HtmlEditorField.IMAGEDIMENSIONS', "Dimensions"), | |
| 367 | new TextField("Width", _t('HtmlEditorField.IMAGEWIDTHPX', "Width"), 640), | |
| 368 | new TextField("Height", "x " . _t('HtmlEditorField.IMAGEHEIGHTPX', "Height"), 385) | |
| 369 | ) | |
| 370 | ), | |
| 371 | new FieldSet( | |
| 372 | new FormAction("insertyoutube", _t('HtmlEditorField.BUTTONINSERTYOUTUBE', 'Insert YouTube')) | |
| 373 | ) | |
| 374 | ); | |
| 375 | ||
| 376 | $form->disableSecurityToken(); | |
| 377 | $form->loadDataFrom($this); | |
| 378 | $form->disableSecurityToken(); | |
| 379 | ||
| 380 | $this->extend('updateYoutubeForm', $form); | |
| 381 | ||
| 382 | return $form; | |
| 383 | } | |
| 384 | ||
| 385 | function VimeoForm() { | |
| 386 | $form = new Form( | |
| 387 | $this->controller, | |
| 388 | "{$this->name}/VimeoForm", | |
| 389 | new FieldSet( | |
| 390 | new LiteralField('Heading', '<h2><img src="cms/images/closeicon.gif" alt="'._t('HtmlEditorField.CLOSE', 'close').'" title="'._t('HtmlEditorField.CLOSE', 'close').'" />'._t('HtmlEditorField.VIMEO', 'Vimeo').'</h2>'), | |
| 391 | new TextField('VimeoVideoCode', _t('HtmlEditorField.VIMEOVIDEOCODE', 'Vimeo Video Code')), | |
| 392 | new CheckboxField('IntroPortrait', 'Show intro portrait', false), | |
| 393 | new CheckboxField('IntroTitle', 'Show intro title', false), | |
| 394 | new CheckboxField('IntroByline', 'Show intro byline', false), | |
| 395 | new CheckboxField('Autoplay', 'Autoplay the video', false), | |
| 396 | new CheckboxField('Loop', 'Loop the video', false), | |
| 397 | new FieldGroup(_t('HtmlEditorField.IMAGEDIMENSIONS', "Dimensions"), | |
| 398 | new TextField("Width", _t('HtmlEditorField.IMAGEWIDTHPX', "Width"), 640), | |
| 399 | new TextField("Height", "x " . _t('HtmlEditorField.IMAGEHEIGHTPX', "Height"), 385) | |
| 400 | ) | |
| 401 | ), | |
| 402 | new FieldSet( | |
| 403 | new FormAction("insertvimeo", _t('HtmlEditorField.BUTTONINSERTVIMEO', 'Insert Vimeo')) | |
| 404 | ) | |
| 405 | ); | |
| 406 | ||
| 407 | $form->disableSecurityToken(); | |
| 408 | $form->loadDataFrom($this); | |
| 409 | $form->disableSecurityToken(); | |
| 410 | ||
| 411 | $this->extend('updateVimeoForm', $form); | |
| 412 | ||
| 413 | return $form; | |
| 414 | } | |
| 356 | 415 | } |
| 357 | 416 |
| 31 | 31 | } |
|---|---|---|
| 32 | 32 | }, |
| 33 | ||
| 33 | ||
| 34 | 34 | destroy: function() { |
| 35 | 35 | this.ToolbarForm = null; |
| 36 | 36 | this.onsubmit = null; |
| 37 | ||
| 37 | ||
| 38 | 38 | var i,item; |
| 39 | 39 | for(i=0;item=this.elements.LinkType[i];i++) { |
| ... | ... | |
| 42 | 42 | } |
| 43 | 43 | }, |
| 44 | ||
| 44 | ||
| 45 | 45 | linkTypeChanged: function(setDefaults) { |
| 46 | 46 | var linkType = Form.Element.getValue(this.elements.LinkType); |
| ... | ... | |
| 57 | 57 | } |
| 58 | 58 | } |
| 59 | ||
| 59 | ||
| 60 | 60 | if (jQuery('#Form_EditorToolbarLinkForm_AnchorSelector')) { |
| 61 | 61 | if ( linkType=='anchor' ) { |
| ... | ... | |
| 70 | 70 | |
| 71 | 71 | addAnchorSelector: function() { |
| 72 | (function($) { |
|
| 72 | (function($) { | |
| 73 | 73 | if (!$('#Form_EditorToolbarLinkForm_AnchorSelector').length) { |
| 74 | 74 | // this function collects the anchors in the currently active editor and regenerates the dropdown |
| ... | ... | |
| 126 | 126 | }); |
| 127 | 127 | } |
| 128 | })(jQuery); |
|
| 129 | }, |
|
| 130 | ||
| 128 | })(jQuery); | |
| 129 | }, | |
| 130 | ||
| 131 | 131 | toggle: function(ed) { |
| 132 | 132 | this.addAnchorSelector(); |
| ... | ... | |
| 134 | 134 | this.respondToNodeChange(ed); |
| 135 | 135 | }, |
| 136 | ||
| 136 | ||
| 137 | 137 | open: function(ed) { |
| 138 | 138 | this.ToolbarForm.open(); |
| 139 | ||
| 139 | ||
| 140 | 140 | this.originalSelection = null; |
| 141 | 141 | var mceInst = tinyMCE.activeEditor; |
| 142 | 142 | }, |
| 143 | ||
| 143 | ||
| 144 | 144 | updateSelection: function(ed) { |
| 145 | 145 | if(ed.selection.getRng()) { |
| ... | ... | |
| 147 | 147 | } |
| 148 | 148 | }, |
| 149 | ||
| 149 | ||
| 150 | 150 | respondToNodeChange: function(ed) { |
| 151 | 151 | if(ed == null) ed = tinyMCE.activeEditor; |
| 152 | ||
| 152 | ||
| 153 | 153 | if(this.style.display == 'block') { |
| 154 | 154 | var i,data = this.getCurrentLink(ed); |
| 155 | ||
| 155 | ||
| 156 | 156 | if(data) { |
| 157 | 157 | for(i in data) { |
| ... | ... | |
| 160 | 160 | } |
| 161 | 161 | } |
| 162 | ||
| 162 | ||
| 163 | 163 | // If we haven't selected an existing link, then just make sure we default to "internal" for the link |
| 164 | 164 | // type. |
| ... | ... | |
| 169 | 169 | } |
| 170 | 170 | }, |
| 171 | ||
| 171 | ||
| 172 | 172 | handleaction_insert: function() { |
| 173 | 173 | var href; |
| 174 | 174 | var target = null; |
| 175 | ||
| 175 | ||
| 176 | 176 | switch(Form.Element.getValue(this.elements.LinkType)) { |
| 177 | 177 | case 'internal': |
| ... | ... | |
| 184 | 184 | |
| 185 | 185 | case 'anchor': |
| 186 | href = '#' + this.elements.Anchor.value; |
|
| 186 | href = '#' + this.elements.Anchor.value; | |
| 187 | 187 | if($('Form_EditorToolbarLinkForm_TargetBlank')) { |
| 188 | 188 | if($('Form_EditorToolbarLinkForm_TargetBlank').checked) target = '_blank'; |
| 189 | 189 | } |
| 190 | 190 | break; |
| 191 | ||
| 191 | ||
| 192 | 192 | case 'file': |
| 193 | 193 | href = this.elements.file.value; |
| 194 | 194 | target = '_blank'; |
| 195 | 195 | break; |
| 196 | ||
| 196 | ||
| 197 | 197 | case 'email': |
| 198 | href = 'mailto:' + this.elements.email.value; |
|
| 198 | href = 'mailto:' + this.elements.email.value; | |
| 199 | 199 | break; |
| 200 | 200 | |
| ... | ... | |
| 215 | 215 | tinyMCE.activeEditor.selection.setRng(this.originalSelection); |
| 216 | 216 | } |
| 217 | ||
| 217 | ||
| 218 | 218 | var attributes = { |
| 219 | href : href, |
|
| 220 | target : target, |
|
| 219 | href : href, | |
| 220 | target : target, | |
| 221 | 221 | title : this.elements.Description.value, |
| 222 | 222 | innerHTML : this.elements.LinkText.value ? this.elements.LinkText.value : "Your Link" |
| ... | ... | |
| 226 | 226 | this.ssInsertLink(tinyMCE.activeEditor, attributes, this); |
| 227 | 227 | }, |
| 228 | ||
| 228 | ||
| 229 | 229 | /** |
| 230 | 230 | * Insert a link into the given editor. |
| ... | ... | |
| 248 | 248 | } catch(er) {} |
| 249 | 249 | }; |
| 250 | ||
| 250 | ||
| 251 | 251 | function replace() { |
| 252 | 252 | tinymce.each(ed.dom.select('a'), function(e) { |
| ... | ... | |
| 272 | 272 | ed.dom.remove(e, 1); |
| 273 | 273 | } |
| 274 | ||
| 274 | ||
| 275 | 275 | this.respondToNodeChange(ed); |
| 276 | 276 | }, |
| 277 | ||
| 277 | ||
| 278 | 278 | handleaction_remove: function() { |
| 279 | 279 | tinyMCE.activeEditor.execCommand('unlink', false); |
| 280 | 280 | }, |
| 281 | ||
| 281 | ||
| 282 | 282 | /** |
| 283 | 283 | * Return information about the currently selected link, suitable for population of the link |
| ... | ... | |
| 286 | 286 | getCurrentLink: function(ed) { |
| 287 | 287 | if(ed == null) ed = tinyMCE.activeEditor; |
| 288 | ||
| 288 | ||
| 289 | 289 | var selectedText = ""; |
| 290 | 290 | selectedText = ed.selection.getContent({format : 'text'}); |
| ... | ... | |
| 298 | 298 | |
| 299 | 299 | var href = "", target = "", title = "", onclick = "", action = "insert", style_class = ""; |
| 300 | ||
| 300 | ||
| 301 | 301 | // We use a separate field for linkDataSource from tinyMCE.linkElement. |
| 302 | 302 | // If we have selected beyond the range of an <a> element, then use use that <a> element to get the link data source, |
| ... | ... | |
| 323 | 323 | } |
| 324 | 324 | } |
| 325 | ||
| 325 | ||
| 326 | 326 | // Is anchor not a link |
| 327 | 327 | if (linkDataSource != null && tinymce.DOM.getAttrib(linkDataSource, 'href') == "") |
| ... | ... | |
| 353 | 353 | action = "update"; |
| 354 | 354 | } |
| 355 | ||
| 355 | ||
| 356 | 356 | // Turn into relative |
| 357 | 357 | if(href.match(new RegExp('^' + tinyMCE.settings['document_base_url'] + '(.*)$'))) { |
| 358 | 358 | href = RegExp.$1; |
| 359 | 359 | } |
| 360 | ||
| 360 | ||
| 361 | 361 | var linkText = ed.selection.getContent({format : 'html'}).replace(/<\/?a[^>]*>/ig,''); |
| 362 | ||
| 362 | ||
| 363 | 363 | // Get rid of TinyMCE's temporary URLs |
| 364 | 364 | if(href.match(/^javascript:\s*mctmp/)) href = ''; |
| 365 | ||
| 365 | ||
| 366 | 366 | if(href.match(/^mailto:(.*)$/)) { |
| 367 | 367 | return { |
| ... | ... | |
| 409 | 409 | } |
| 410 | 410 | } |
| 411 | } |
|
| 412 | ||
| 411 | } | |
| 412 | ||
| 413 | 413 | } |
| 414 | 414 | |
| ... | ... | |
| 424 | 424 | this.parentForm = null; |
| 425 | 425 | this.onclick = null; |
| 426 | ||
| 426 | ||
| 427 | 427 | }, |
| 428 | 428 | onclick: function() { |
| ... | ... | |
| 454 | 454 | toggle: function(ed) { |
| 455 | 455 | this.ToolbarForm.toggle(ed); |
| 456 | ||
| 456 | ||
| 457 | 457 | this.resetFields(); |
| 458 | 458 | }, |
| ... | ... | |
| 495 | 495 | } |
| 496 | 496 | } |
| 497 | ||
| 497 | ||
| 498 | 498 | // Proportionate updating of heights |
| 499 | 499 | if(updatedFieldName == 'Width') { |
| ... | ... | |
| 501 | 501 | imgElement.removeAttribute('height'); |
| 502 | 502 | this.elements.Height.value = imgElement.height; |
| 503 | ||
| 503 | ||
| 504 | 504 | } else if(updatedFieldName == 'Height') { |
| 505 | 505 | imgElement.height = this.elements.Height.value; |
| ... | ... | |
| 538 | 538 | } |
| 539 | 539 | }, |
| 540 | ||
| 540 | ||
| 541 | 541 | selectImage: function(image) { |
| 542 | 542 | if(this.selectedImage) { |
| ... | ... | |
| 547 | 547 | this.selectedImage.setAttribute("class", "selectedImage"); |
| 548 | 548 | this.selectedImage.className = "selectedImage"; |
| 549 | ||
| 549 | ||
| 550 | 550 | try { |
| 551 | 551 | var imgTag = image.getElementsByTagName('img')[0]; |
| ... | ... | |
| 555 | 555 | } |
| 556 | 556 | }, |
| 557 | ||
| 557 | ||
| 558 | 558 | handleaction_insertimage: function() { |
| 559 | 559 | if(this.selectedImage) { |
| ... | ... | |
| 561 | 561 | } |
| 562 | 562 | }, |
| 563 | ||
| 563 | ||
| 564 | 564 | handleaction_editimage: function() { |
| 565 | 565 | if(this.selectedImage) { |
| ... | ... | |
| 572 | 572 | ImageThumbnail.prototype = { |
| 573 | 573 | destroy: function() { |
| 574 | this.onclick = null; |
|
| 575 | }, |
|
| 576 | ||
| 574 | this.onclick = null; | |
| 575 | }, | |
| 576 | ||
| 577 | 577 | onclick: function(e) { |
| 578 | 578 | $('Form_EditorToolbarImageForm').selectImage(this); |
| 579 | 579 | return false; |
| 580 | 580 | }, |
| 581 | ||
| 581 | ||
| 582 | 582 | edit: function() { |
| 583 | 583 | var windowWidth = Element.getDimensions(window.top.document.body).width; |
| ... | ... | |
| 615 | 615 | return; |
| 616 | 616 | }, |
| 617 | ||
| 617 | ||
| 618 | 618 | insert: function() { |
| 619 | 619 | var formObj = $('Form_EditorToolbarImageForm'); |
| ... | ... | |
| 624 | 624 | var relativeHref = this.href.substr(baseURL.length); |
| 625 | 625 | var captionText = formObj.elements.CaptionText.value; |
| 626 | ||
| 626 | ||
| 627 | 627 | if(!tinyMCE.selectedInstance) tinyMCE.selectedInstance = tinyMCE.activeEditor; |
| 628 | 628 | if(tinyMCE.selectedInstance.contentWindow.focus) tinyMCE.selectedInstance.contentWindow.focus(); |
| 629 | ||
| 629 | ||
| 630 | 630 | this.ssInsertImage(tinyMCE.activeEditor, { |
| 631 | 631 | 'src' : relativeHref, |
| ... | ... | |
| 636 | 636 | 'class' : cssClass |
| 637 | 637 | }, captionText); |
| 638 | ||
| 638 | ||
| 639 | 639 | return false; |
| 640 | 640 | }, |
| 641 | ||
| 641 | ||
| 642 | 642 | /** |
| 643 | 643 | * Insert an image with the given attributes |
| ... | ... | |
| 646 | 646 | el = ed.selection.getNode(); |
| 647 | 647 | var html; |
| 648 | ||
| 648 | ||
| 649 | 649 | if(captionText) { |
| 650 | 650 | html = '<div style="width: ' + attributes.width + 'px;" class="captionImage ' + attributes['class'] + '">'; |
| ... | ... | |
| 655 | 655 | html = '<img id="__mce_tmp" />'; |
| 656 | 656 | } |
| 657 | ||
| 657 | ||
| 658 | 658 | if(el && el.nodeName == 'IMG') { |
| 659 | 659 | ed.dom.setAttribs(el, attributes); |
| ... | ... | |
| 669 | 669 | skip_undo : 1 |
| 670 | 670 | }); |
| 671 | ||
| 671 | ||
| 672 | 672 | ed.dom.setAttribs('__mce_tmp', attributes); |
| 673 | 673 | ed.dom.setAttrib('__mce_tmp', 'id', ''); |
| ... | ... | |
| 675 | 675 | } |
| 676 | 676 | } |
| 677 | ||
| 677 | ||
| 678 | 678 | } |
| 679 | 679 | |
| ... | ... | |
| 713 | 713 | } |
| 714 | 714 | } |
| 715 | ||
| 715 | ||
| 716 | 716 | // Trick the folder dropdown into registering a change, so the image thumbnails are reloaded |
| 717 | 717 | folderID = $('Form_EditorToolbarImageForm_FolderID').value; |
| ... | ... | |
| 753 | 753 | } |
| 754 | 754 | |
| 755 | YoutubeForm = Class.extend('ToolbarForm'); | |
| 756 | YoutubeForm.prototype = { | |
| 757 | initialize: function() { | |
| 758 | }, | |
| 759 | destroy: function() { | |
| 760 | this.ToolbarForm = null; | |
| 761 | this.onsubmit = null; | |
| 762 | ||
| 763 | }, | |
| 764 | update_params: function(event) { | |
| 765 | if(tinyMCE.imgElement) { | |
| 766 | } | |
| 767 | }, | |
| 768 | respondToNodeChange: function() { | |
| 769 | if(tinyMCE.imgElement) { | |
| 770 | } else { | |
| 771 | } | |
| 772 | }, | |
| 773 | selectYoutube: function(youtube) { | |
| 774 | if(this.selectedYoutube) { | |
| 775 | this.selectedYoutube.setAttribute("class", ""); | |
| 776 | } | |
| 777 | this.selectedYoutube = youtube; | |
| 778 | this.selectedYoutube.setAttribute("class", "selectedYoutube"); | |
| 779 | }, | |
| 780 | handleaction_insertyoutube: function() { | |
| 781 | ||
| 782 | var formObj = $('Form_EditorToolbarYoutubeForm'); | |
| 783 | var youtubeCode = formObj.elements.YouTubeVideoCode.value; | |
| 784 | var includeRelated = formObj.elements.IncludeRelated.checked; | |
| 785 | var enablePrivacyMode = formObj.elements.EnablePrivacyMode.checked; | |
| 786 | var width = formObj.elements.Width.value; | |
| 787 | var height = formObj.elements.Height.value; | |
| 788 | ||
| 789 | var youtubeDomain = enablePrivacyMode?'www.youtube-nocookie.com':'www.youtube.com'; | |
| 790 | youtubeURL = 'http://' + youtubeDomain + '/v/' + youtubeCode + '?fs=1&hl=en_US'; | |
| 791 | if (!includeRelated) youtubeURL += '&rel=0'; | |
| 792 | ||
| 793 | ||
| 794 | if(!tinyMCE.selectedInstance) tinyMCE.selectedInstance = tinyMCE.activeEditor; | |
| 795 | if(tinyMCE.selectedInstance.contentWindow.focus) tinyMCE.selectedInstance.contentWindow.focus(); | |
| 796 | ||
| 797 | var html = ''; | |
| 798 | ||
| 799 | html += '<object width="'+ width +'" height="' + height + '">'; | |
| 800 | html += '<param name="movie" value="' + youtubeURL + '"></param>'; | |
| 801 | html += '<param name="allowFullScreen" value="true"></param>'; | |
| 802 | html += '<param name="allowscriptaccess" value="always"></param>'; | |
| 803 | html += '<embed src="' + youtubeURL + '" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="'+ width +'" height="' + height + '"></embed>'; | |
| 804 | html += '</object>'; | |
| 805 | ||
| 806 | tinyMCE.selectedInstance.execCommand("mceInsertContent", false, html); | |
| 807 | tinyMCE.selectedInstance.execCommand('mceRepaint'); | |
| 808 | ||
| 809 | ||
| 810 | return false; | |
| 811 | ||
| 812 | } | |
| 813 | } | |
| 814 | ||
| 815 | VimeoForm = Class.extend('ToolbarForm'); | |
| 816 | VimeoForm.prototype = { | |
| 817 | initialize: function() { | |
| 818 | }, | |
| 819 | destroy: function() { | |
| 820 | this.ToolbarForm = null; | |
| 821 | this.onsubmit = null; | |
| 822 | ||
| 823 | }, | |
| 824 | update_params: function(event) { | |
| 825 | if(tinyMCE.imgElement) { | |
| 826 | } | |
| 827 | }, | |
| 828 | respondToNodeChange: function() { | |
| 829 | if(tinyMCE.imgElement) { | |
| 830 | } else { | |
| 831 | } | |
| 832 | }, | |
| 833 | selectVimeo: function(vimeo) { | |
| 834 | if(this.selectedVimeo) { | |
| 835 | this.selectedVimeo.setAttribute("class", ""); | |
| 836 | } | |
| 837 | this.selectedVimeo = vimeo; | |
| 838 | this.selectedVimeo.setAttribute("class", "selectedVimeo"); | |
| 839 | }, | |
| 840 | handleaction_insertvimeo: function() { | |
| 841 | var formObj = $('Form_EditorToolbarVimeoForm'); | |
| 842 | var vimeoCode = formObj.elements.VimeoVideoCode.value; | |
| 843 | var introPortrait = formObj.elements.IntroPortrait.checked?'1':'0'; | |
| 844 | var introTitle = formObj.elements.IntroTitle.checked?'1':'0'; | |
| 845 | var introByline = formObj.elements.IntroByline.checked?'1':'0'; | |
| 846 | var autoplay = formObj.elements.Autoplay.checked?'1':'0'; | |
| 847 | var loop = formObj.elements.Loop.checked?'1':'0'; | |
| 848 | var width = formObj.elements.Width.value; | |
| 849 | var height = formObj.elements.Height.value; | |
| 850 | var vimeoURL = 'http://vimeo.com/moogaloop.swf?clip_id='+ vimeoCode +'&server=vimeo.com&show_title=' + introTitle + '&show_byline=' + introByline + '&show_portrait=' + introPortrait + '&color=&fullscreen=1&autoplay=' + autoplay + '&loop=' + loop; | |
| 851 | ||
| 852 | if(!tinyMCE.selectedInstance) tinyMCE.selectedInstance = tinyMCE.activeEditor; | |
| 853 | if(tinyMCE.selectedInstance.contentWindow.focus) tinyMCE.selectedInstance.contentWindow.focus(); | |
| 854 | ||
| 855 | var html = ''; | |
| 856 | ||
| 857 | html += '<object width="'+ width +'" height="' + height + '">'; | |
| 858 | html += '<param name="movie" value="' + vimeoURL + '"></param>'; | |
| 859 | html += '<param name="allowFullScreen" value="true"></param>'; | |
| 860 | html += '<param name="allowscriptaccess" value="always"></param>'; | |
| 861 | html += '<embed src="' + vimeoURL + '" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="'+ width +'" height="' + height + '"></embed>'; | |
| 862 | html += '</object>'; | |
| 863 | ||
| 864 | tinyMCE.selectedInstance.execCommand("mceInsertContent", false, html); | |
| 865 | tinyMCE.selectedInstance.execCommand('mceRepaint'); | |
| 866 | ||
| 867 | ||
| 868 | return false; | |
| 869 | ||
| 870 | } | |
| 871 | } | |
| 872 | ||
| 755 | 873 | FlashThumbnail = Class.create(); |
| 756 | 874 | FlashThumbnail.prototype = { |
| 757 | 875 | destroy: function() { |
| 758 | this.onclick = null; |
|
| 759 | }, |
|
| 760 | ||
| 876 | this.onclick = null; | |
| 877 | }, | |
| 878 | ||
| 761 | 879 | onclick: function(e) { |
| 762 | 880 | $('Form_EditorToolbarFlashForm').selectFlash(this); |
| 763 | 881 | return false; |
| 764 | 882 | }, |
| 765 | ||
| 883 | ||
| 766 | 884 | insert: function() { |
| 767 | 885 | var formObj = $('Form_EditorToolbarFlashForm'); |
| ... | ... | |
| 771 | 889 | var width = formObj.elements.Width.value; |
| 772 | 890 | var height = formObj.elements.Height.value; |
| 773 | ||
| 891 | ||
| 774 | 892 | if(!tinyMCE.selectedInstance) tinyMCE.selectedInstance = tinyMCE.activeEditor; |
| 775 | 893 | if(tinyMCE.selectedInstance.contentWindow.focus) tinyMCE.selectedInstance.contentWindow.focus(); |
| ... | ... | |
| 777 | 895 | if (width == "") width = 100; |
| 778 | 896 | if (height == "") height = 100; |
| 779 | ||
| 897 | ||
| 780 | 898 | html = ''; |
| 781 | 899 | html += '<object width="' + width +'" height="' + height +'" type="application/x-shockwave-flash" data="'+ relativeHref +'">'; |
| 782 | 900 | html += '<param value="'+ relativeHref +'" name="movie">'; |
| 783 | 901 | html += '</object>'; |
| 784 | ||
| 902 | ||
| 785 | 903 | tinyMCE.selectedInstance.execCommand("mceInsertContent", false, html); |
| 786 | 904 | tinyMCE.selectedInstance.execCommand('mceRepaint'); |
| 787 | // ed.execCommand('mceInsertContent', false, html, {skip_undo : 1}); |
|
| 905 | // ed.execCommand('mceInsertContent', false, html, {skip_undo : 1}); | |
| 788 | 906 | return false; |
| 789 | 907 | } |
| ... | ... | |
| 800 | 918 | FlashThumbnail.applyTo('#Form_EditorToolbarFlashForm div.thumbnailstrip a'); |
| 801 | 919 | SideFormAction.applyTo('#Form_EditorToolbarFlashForm .Actions input'); |
| 920 | ||
| 921 | YoutubeForm.applyTo('#Form_EditorToolbarYoutubeForm'); | |
| 922 | SideFormAction.applyTo('#Form_EditorToolbarYoutubeForm .Actions input'); | |
| 923 | ||
| 924 | VimeoForm.applyTo('#Form_EditorToolbarVimeoForm'); | |
| 925 | SideFormAction.applyTo('#Form_EditorToolbarVimeoForm .Actions input'); | |
| 802 | 926 | |
| 803 | 927 | /** |
| ... | ... | |
| 834 | 958 | this.aspectRatio = this.height / this.width; |
| 835 | 959 | } |
| 836 | ||
| 960 | ||
| 837 | 961 | this.originalWidth = this.width; |
| 838 | 962 | this.originalHeight = this.height; |
| ... | ... | |
| 844 | 968 | return f; |
| 845 | 969 | }, |
| 846 | ||
| 970 | ||
| 847 | 971 | resizeTo: function(width, height) { |
| 848 | 972 | var newWidth = parseInt(height); |
| ... | ... | |
| 850 | 974 | if(isNaN(newWidth)) newWidth = this.width; |
| 851 | 975 | if(isNaN(newHeight)) newHeight = this.height; |
| 852 | ||
| 976 | ||
| 853 | 977 | // Constrain to width of the window |
| 854 | 978 | if((this.offsetLeft + this.offsetWidth + 20) > this.ownerDoc().offsetWidth) |
| 855 | 979 | newWidth += (this.ownerDoc().offsetWidth - this.offsetLeft - this.offsetWidth - 20); |
| 856 | ||
| 980 | ||
| 857 | 981 | if(this.aspectRatio) { |
| 858 | 982 | // Figure out which dimension we have altered more |
| 859 | var heightChange = this.originalHeight / this.height; |
|
| 983 | var heightChange = this.originalHeight / this.height; | |
| 860 | 984 | if(heightChange < 1) heightChange = 1/heightChange; |
| 861 | ||
| 985 | ||
| 862 | 986 | var widthChange = this.originalWidth / this.width; |
| 863 | 987 | if(widthChange < 1) widthChange = 1/widthChange; |
| 864 | ||
| 988 | ||
| 865 | 989 | // Scale by the more constant dimension (so if you edit the height, change width to suit) |
| 866 | 990 | if(widthChange > heightChange) |
| ... | ... | |
| 873 | 997 | this.style.height = newHeight + 'px'; |
| 874 | 998 | this.width = newWidth; |
| 875 | this.height = newHeight; |
|
| 876 | ||
| 999 | this.height = newHeight; | |
| 1000 | ||
| 877 | 1001 | // Auto-size special image holders |
| 878 | 1002 | if(this.parentNode.parentNode.className.match(/(^|\b)specialImage($|\b)/)) { |
| ... | ... | |
| 916 | 1040 | // replace indented text with a <blockquote> |
| 917 | 1041 | value = value.replace(/<p [^>]*margin-left[^>]*>([^\n|\n\015|\015\n]*)<\/p>/ig,"<blockquote><p>$1</p></blockquote>"); |
| 918 | ||
| 1042 | ||
| 919 | 1043 | // replace VML pixel image references with image tags - experimental |
| 920 | 1044 | value = value.replace(/<[a-z0-9]+:imagedata[^>]+src="?([^> "]+)"?[^>]*>/ig,"<img src=\"$1\">"); |
| 921 | ||
| 1045 | ||
| 922 | 1046 | // Word comments |
| 923 | value = value.replace(new RegExp('<(!--)([^>]*)(--)>', 'g'), ""); |
|
| 924 | ||
| 925 | // kill class=mso??? and on mouse* tags |
|
| 926 | value = value.replace(/([ \f\r\t\n\'\"])class=mso[a-z0-9]+[^ >]+/ig, "$1"); |
|
| 927 | value = value.replace(/([ \f\r\t\n\'\"]class=")mso[a-z0-9]+[^ ">]+ /ig, "$1"); |
|
| 928 | value = value.replace(/([ \f\r\t\n\'\"])class="mso[a-z0-9]+[^">]+"/ig, "$1"); |
|
| 1047 | value = value.replace(new RegExp('<(!--)([^>]*)(--)>', 'g'), ""); | |
| 1048 | ||
| 1049 | // kill class=mso??? and on mouse* tags | |
| 1050 | value = value.replace(/([ \f\r\t\n\'\"])class=mso[a-z0-9]+[^ >]+/ig, "$1"); | |
| 1051 | value = value.replace(/([ \f\r\t\n\'\"]class=")mso[a-z0-9]+[^ ">]+ /ig, "$1"); | |
| 1052 | value = value.replace(/([ \f\r\t\n\'\"])class="mso[a-z0-9]+[^">]+"/ig, "$1"); | |
| 929 | 1053 | value = value.replace(/([ \f\r\t\n\'\"])on[a-z]+=[^ >]+/ig, "$1"); |
| 930 | value = value.replace(/ >/ig, ">"); |
|
| 931 | ||
| 1054 | value = value.replace(/ >/ig, ">"); | |
| 1055 | ||
| 932 | 1056 | // remove everything that's in a closing tag |
| 933 | value = value.replace(/<(\/[A-Za-z0-9]+)[ \f\r\t\n]+[^>]*>/ig,"<$1>"); |
|
| 1057 | value = value.replace(/<(\/[A-Za-z0-9]+)[ \f\r\t\n]+[^>]*>/ig,"<$1>"); | |
| 934 | 1058 | } |
| 935 | 1059 | |
| ... | ... | |
| 954 | 1078 | } |
| 955 | 1079 | } |
| 956 | ||
| 1080 | ||
| 957 | 1081 | } |
| 958 | 1082 | return value; |
| 332 | 332 | $lang['en_US']['HtmlEditorField']['ANCHORVALUE'] = 'Anchor'; |
|---|---|---|
| 333 | 333 | $lang['en_US']['HtmlEditorField']['BUTTONINSERTFLASH'] = 'Insert Flash'; |
| 334 | $lang['en_US']['HtmlEditorField']['BUTTONINSERTYOUTUBE'] = 'Insert YouTube'; | |
| 335 | $lang['en_US']['HtmlEditorField']['BUTTONINSERTVIMEO'] = 'Insert Vimeo'; | |
| 334 | 336 | $lang['en_US']['HtmlEditorField']['BUTTONINSERTIMAGE'] = 'Insert image'; |
| 335 | 337 | $lang['en_US']['HtmlEditorField']['BUTTONINSERTLINK'] = 'Insert link'; |
| ... | ... | |
| 345 | 347 | $lang['en_US']['HtmlEditorField']['FILE'] = 'File'; |
| 346 | 348 | $lang['en_US']['HtmlEditorField']['FLASH'] = 'Flash'; |
| 349 | $lang['en_US']['HtmlEditorField']['YOUTUBE'] = 'YouTube'; | |
| 350 | $lang['en_US']['HtmlEditorField']['VIMEO'] = 'Vimeo'; | |
| 351 | $lang['en_US']['HtmlEditorField']['YOUTUBEVIDEOCODE'] = 'YouTube Video Code'; | |
| 352 | $lang['en_US']['HtmlEditorField']['VIMEOVIDEOCODE'] = 'Vimeo Video Code'; | |
| 347 | 353 | $lang['en_US']['HtmlEditorField']['FOLDER'] = 'Folder'; |
| 348 | 354 | $lang['en_US']['HtmlEditorField']['IMAGE'] = 'Image'; |
| ... | ... | |
| 710 | 716 | $lang['en_US']['Security']['PASSWORDSENTTEXT'] = 'Thank you! A reset link has been sent to \'%s\', provided an account exists for this email address.'; |
| 711 | 717 | $lang['en_US']['SecurityAdmin']['GROUPNAME'] = 'Group name'; |
| 712 | $lang['en_US']['SecurityAdmin']['IPADDRESSESHELP'] = '<p>You can restrict this group to a particular |
|
| 718 | $lang['en_US']['SecurityAdmin']['IPADDRESSESHELP'] = '<p>You can restrict this group to a particular | |
| 713 | 719 | IP address range (one range per line). <br />Ranges can be in any of the following forms: <br /> |
| 714 | 720 | 203.96.152.12<br /> |
| ... | ... | |
| 813 | 819 | $lang['en_US']['SiteTree']['METATITLE'] = 'Title'; |
| 814 | 820 | $lang['en_US']['SiteTree']['MODIFIEDONDRAFT'] = 'Modified on draft site'; |
| 815 | $lang['en_US']['SiteTree']['NOTEUSEASHOMEPAGE'] = 'Use this page as the \'home page\' for the following domains: |
|
| 821 | $lang['en_US']['SiteTree']['NOTEUSEASHOMEPAGE'] = 'Use this page as the \'home page\' for the following domains: | |
| 816 | 822 | (separate multiple domains with commas)'; |
| 817 | 823 | $lang['en_US']['SiteTree']['PAGELOCATION'] = 'Page location'; |