ShalvaSoft
php developer

    
ჯგუფი: Registered
წერილები: 1951
წევრი No.: 181428
რეგისტრ.: 9-February 14
|
#47354006 · 23 Mar 2016, 13:52 · · პროფილი · პირადი მიმოწერა · ჩატი
მოკლედ ვერაფრით გავაგზავნიე რა
პრასტოი textarea არის
| CODE | <textarea name="text1"></textarea> <script> $("textarea[name=text1]").wysiwyg({ class: 'some-more-classes', toolbar: 'selection'|'top'|'top-focus'|'top-selection'|'top-focus-selection'|'bottom'|'bottom-focus'|'bottom-selection'|'bottom-focus-selection', buttons: { insertimage: { title: 'Insert image', image: '\uf030', html: '<raw html>', showselection: true // on selection toolbar }, insertvideo: { title: 'Insert video', image: '\uf03d', showselection: true }, insertlink: { title: 'Insert link', image: '\uf08e' }, fontname: { title: 'Font', image: '\uf031', popup: function( $popup, $button ) { var list_fontnames = { // Name : Font 'Arial, Helvetica' : 'Arial,Helvetica', 'Verdana' : 'Verdana,Geneva', 'Georgia' : 'Georgia', 'Courier New' : 'Courier New,Courier', 'Times New Roman' : 'Times New Roman,Times' }; var $list = $('<div/>').addClass('wysiwyg-plugin-list') .attr('unselectable','on'); $.each( list_fontnames, function( name, font ) { var $link = $('<a/>').attr('href','#') .css( 'font-family', font ) .html( name ) .click(function(event) { $(element).wysiwyg('shell').fontName(font).closePopup(); // prevent link-href-# event.stopPropagation(); event.preventDefault(); return false; }); $list.append( $link ); }); $popup.append( $list ); } }, fontsize: { title: 'Size', image: '\uf034', popup: function( $popup, $button ) { // Hack: http://stackoverflow.com/questions/5868295/document-execcommand-fontsize-in-pixels/5870603#5870603 var list_fontsizes = []; for( var i=8; i <= 11; ++i ) list_fontsizes.push(i+'px'); for( var i=12; i <= 28; i+=2 ) list_fontsizes.push(i+'px'); list_fontsizes.push('36px'); list_fontsizes.push('48px'); list_fontsizes.push('72px'); var $list = $('<div/>').addClass('wysiwyg-plugin-list') .attr('unselectable','on'); $.each( list_fontsizes, function( index, size ) { var $link = $('<a/>').attr('href','#') .html( size ) .click(function(event) { $(element).wysiwyg('shell').fontSize(7).closePopup(); $(element).wysiwyg('container') .find('font[size=7]') .removeAttr("size") .css("font-size", size); // prevent link-href-# event.stopPropagation(); event.preventDefault(); return false; }); $list.append( $link ); }); $popup.append( $list ); } //showstatic: true, // wanted on the toolbar //showselection: true // wanted on selection }, header: { title: 'Header', image: '\uf1dc', popup: function( $popup, $button ) { var list_headers = { // Name : Font 'Header 1' : '<h1>', 'Header 2' : '<h2>', 'Header 3' : '<h3>', 'Header 4' : '<h4>', 'Header 5' : '<h5>', 'Header 6' : '<h6>', 'Code' : '<pre>' }; var $list = $('<div/>').addClass('wysiwyg-plugin-list') .attr('unselectable','on'); $.each( list_headers, function( name, format ) { var $link = $('<a/>').attr('href','#') .css( 'font-family', format ) .html( name ) .click(function(event) { $(element).wysiwyg('shell').format(format).closePopup(); event.stopPropagation(); event.preventDefault(); return false; }); $list.append( $link ); }); $popup.append( $list ); } }, bold: { title: 'Bold (Ctrl+B)', image: '\uf032', hotkey: 'b' }, italic: { title: 'Italic (Ctrl+I)', image: '\uf033', hotkey: 'i' }, underline: { title: 'Underline (Ctrl+U)', image: '\uf0cd', hotkey: 'u' }, strikethrough: { title: 'Strikethrough (Ctrl+S)', image: '\uf0cc', hotkey: 's' }, forecolor: { title: 'Text color', image: '\uf1fc' }, highlight: { title: 'Background color', image: '\uf043' }, alignleft: { title: 'Left', image: '\uf036', showselection: false // wanted on selection }, aligncenter: { title: 'Center', image: '\uf037', showselection: false // wanted on selection }, alignright: { title: 'Right', image: '\uf038', showselection: false // wanted on selection }, alignjustify: { title: 'Justify', image: '\uf039', showselection: false // wanted on selection }, subscript: { title: 'Subscript', image: '\uf12c', showselection: true // wanted on selection }, superscript: { title: 'Superscript', image: '\uf12b', showselection: true // wanted on selection }, indent: { title: 'Indent', image: '\uf03c', showselection: false // wanted on selection }, outdent: { title: 'Outdent', image: '\uf03b', showselection: false // wanted on selection }, orderedList: { title: 'Ordered list', image: '\uf0cb', showselection: false // wanted on selection }, unorderedList: { title: 'Unordered list', image: '\uf0ca', showselection: false }, removeformat: { title: 'Remove format', image: '\uf12d' } }, submit: { title: 'Submit', image: '\uf00c' }, selectImage: 'Click or drop image', placeholderUrl: 'www.example.com', placeholderEmbed: '<embed/>', maxImageSize: [600,200], filterImageType: function( file ) {
}, onImageUpload: function( insert_image ) { // Example client script (without upload-progressbar): var iframe_name = 'legacy-uploader-' + Math.random().toString(36).substring(2); $('<iframe>').attr('name',iframe_name) .load(function() { // <iframe> is ready - we will find the URL in the iframe-body var iframe = this; var iframedoc = iframe.contentDocument ? iframe.contentDocument : (iframe.contentWindow ? iframe.contentWindow.document : iframe.document); var iframebody = iframedoc.getElementsByTagName('body')[0]; var image_url = iframebody.innerHTML; insert_image( image_url ); $(iframe).remove(); }) .appendTo(document.body); var $input = $(this); $input.attr('name','upload-filename') .parents('form') .attr('action','/script.php') // accessing cross domain <iframes> could be difficult .attr('method','POST') .attr('enctype','multipart/form-data') .attr('target',iframe_name) .submit(); }, forceImageUpload: false, // upload images even if File-API is present videoFromUrl: function( url ) { // Contributions are welcome :-)
// youtube - http://stackoverflow.com/questions/3392993/php-regex-to-get-youtube-video-id var youtube_match = url.match( /^(?:http(?:s)?:\/\/)?(?:[a-z0-9.]+\.)?(?:youtu\.be|youtube\.com)\/(?:(?:watch)?\?(?:.*&)?v(?:i)?=|(?:embed|v|vi|user)\/)([^\?&\"'>]+)/ ); if( youtube_match && youtube_match[1].length == 11 ) return '<iframe src="//www.youtube.com/embed/' + youtube_match[1] + '" width="640" height="360" frameborder="0" allowfullscreen></iframe>';
// vimeo - http://embedresponsively.com/ var vimeo_match = url.match( /^(?:http(?:s)?:\/\/)?(?:[a-z0-9.]+\.)?vimeo\.com\/([0-9]+)$/ ); if( vimeo_match ) return '<iframe src="//player.vimeo.com/video/' + vimeo_match[1] + '" width="640" height="360" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';
// dailymotion - http://embedresponsively.com/ var dailymotion_match = url.match( /^(?:http(?:s)?:\/\/)?(?:[a-z0-9.]+\.)?dailymotion\.com\/video\/([0-9a-z]+)$/ ); if( dailymotion_match ) return '<iframe src="//www.dailymotion.com/embed/video/' + dailymotion_match[1] + '" width="640" height="360" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>'; } }); </script>
|
იქნებ მომეხმაროთ რა php-ში ცარიელი მომდის...
--------------------
ვებ პროგრამისტების საყურადღებოდ http://jobs.ge/119262/
|