admin.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334
  1. // CKEditor
  2. $(function () {
  3. if($('#js-news-content').length != 0){
  4. CKEDITOR.replace('js-news-content', {
  5. 'filebrowserBrowseUrl': '/components/admin/ckeditor/kcfinder/browse.php?type=files',
  6. 'filebrowserImageBrowseUrl': '/components/admin/ckeditor/kcfinder/browse.php?type=images',
  7. 'filebrowserFlashBrowseUrl': '/components/admin/ckeditor/kcfinder/browse.php?type=flash',
  8. 'filebrowserUploadUrl': '/components/admin/ckeditor/kcfinder/upload.php?type=files',
  9. 'filebrowserImageUploadUrl': '/components/admin/ckeditor/kcfinder/upload.php?type=images',
  10. 'filebrowserFlashUploadUrl': '/components/admin/ckeditor/kcfinder/upload.php?type=flash',
  11. 'filebrowserAudioBrowseUrl': '/components/admin/ckeditor/kcfinder/browse.php?type=files',
  12. 'filebrowserlightboxUploadUrl': '/components/admin/ckeditor/kcfinder/browse.php?type=files',
  13. 'height': 400
  14. });
  15. }
  16. });
  17. $(function() {
  18. if($('#sortable').length != 0){
  19. $( "#sortable" ).sortable({
  20. items: "tr:not(.tr-state-disabled)",
  21. update: function( event, ui ) {
  22. if( ajaxs = $(this).attr("data-ajax")){
  23. var order = $(this).sortable('serialize');
  24. console.log(order);
  25. $.post( ajaxs, order, function( data ) {
  26. if( data.status != 'ok' ){
  27. alert("Не записано!!");
  28. }
  29. },"json");
  30. }
  31. }
  32. });
  33. }
  34. });