Sha256: c846408906d139ac1a0bb0e29b1778f62b348bebc61e825a300e90dabeaf9223

Contents?: true

Size: 1.98 KB

Versions: 6

Compression:

Stored size: 1.98 KB

Contents

//= require ./vendor/jquery
//= require ./vendor/foundation
//= require ./vendor/tinymce/tinymce.min.js
//= require_directory ./vendor
//= require_directory .

jQuery(document).foundation();

jQuery(document).ready(function($) {
  $("#menu-toggle").click(function(e) {
    e.preventDefault();
    $("#wrapper").toggleClass("toggled");

    if ($("#wrapper").hasClass("toggled")) {
      $(this).find("i").removeClass("fa-angle-left");
      $(this).find("i").addClass("fa-angle-right");
    } else {
      $(this).find("i").removeClass("fa-angle-right");
      $(this).find("i").addClass("fa-angle-left");
    }
  });
  
  $(".destroy_resource").on("click", function(e) {
    e.preventDefault();
    
    $that = $(this);
    
    swal({
      title: "Are you sure?",
      text: "You will not be able to recover this after deleting...",
      type: "warning",
      showCancelButton: true,
      confirmButtonColor: "#DD6B55",
      confirmButtonText: "Yes, delete it!",
      closeOnConfirm: true
    }, function() {
      $that.parent().find("form").trigger("submit");
    });
  });
  
  tinymce.init({
    selector: ".tinymce",
    plugins: [
      "advlist autolink lists link image charmap hr anchor pagebreak",
      "searchreplace visualblocks visualchars code fullscreen",
      "insertdatetime media nonbreaking save table contextmenu directionality",
      "paste textcolor colorpicker textpattern imagetools"
    ],
    toolbar1: "undo redo | styleselect | bold italic underline | alignleft aligncenter alignright alignjustify |  forecolor backcolor",
    toolbar2: "bullist numlist outdent indent | link image gutsimages media",
    setup: function (editor) {
      editor.addButton("gutsimages", {
        text: null,
        icon: "browse",
        onclick: function () {
          editor.windowManager.open({
            title: "Browse",
            url: "<%= Guts::Engine.routes.url_helpers.media_path %>?insert=1",
            width: 700,
            height: 700
          });
        }
      });
    },
  });
});

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
guts-1.1.1 app/assets/javascripts/guts/application.js.erb
guts-1.1.0 app/assets/javascripts/guts/application.js.erb
guts-1.0.8 app/assets/javascripts/guts/application.js.erb
guts-1.0.7 app/assets/javascripts/guts/application.js.erb
guts-1.0.5 app/assets/javascripts/guts/application.js.erb
guts-1.0.3 app/assets/javascripts/guts/application.js.erb