Sha256: 37c1b47ce69c608f48804fd73c7d8c81ea13f265b231f968a19b9a5fb8bdd6fc

Contents?: true

Size: 1.63 KB

Versions: 4

Compression:

Stored size: 1.63 KB

Contents

// This is a manifest file that'll be compiled into including all the files listed below.
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
// be included in the compiled file accessible from http://example.com/assets/application.js
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
//= require jquery
//= require jquery_ujs
//= require fileuploader
//= require rich/uploader

var rich_current_style = "";
function selectStyle(name) {
	rich_current_style = name;
	$('#styles li').removeClass('selected');
	$('#style-'+name).addClass('selected');
}


(function($) {
  $.QueryString = (function(a) {
    if (a == "") return {};
    var b = {};
    for (var i = 0; i < a.length; ++i)
    {
      var p=a[i].split('=');
      if (p.length != 2) continue;
      b[p[0]] = decodeURIComponent(p[1].replace(/\+/g, " "));
    }
    return b;
  })(window.location.search.substr(1).split('&'))
})(jQuery);

$(function() {
	
	// click an image to insert it in the editor
	$('#images li img').live('click', function(e){
		//var url = $(this).data('url');
//		var url = $(this).attr('src');
		var url = $(this).data('uris')[rich_current_style];
		var id = $(this).data('rich-image-id');
		
		window.opener.CKEDITOR.tools.callFunction($.QueryString["CKEditorFuncNum"], url, id);
		window.setTimeout(function(){
			window.close();
		},500);
	});
	
	$('#styles li').click(function(e){
		selectStyle($(this).data('rich-style'));
	});
	
	// preselect the default style
	selectStyle($('#styles').data('default-style'));
	
	// fancy uploading
	new rich.Uploader();
	
});


Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rich-0.0.4 app/assets/javascripts/rich/application.js
rich-0.0.3 app/assets/javascripts/rich/application.js
rich-0.0.2 app/assets/javascripts/rich/application.js
rich-0.0.1 app/assets/javascripts/rich/application.js