squeezer 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/{lib/app → app}/controllers/application_controller.rb +0 -0
- data/{lib/app → app}/controllers/blogs_controller.rb +0 -0
- data/{lib/app → app}/controllers/comments_controller.rb +0 -0
- data/{lib/app → app}/controllers/pages_controller.rb +0 -0
- data/{lib/app → app}/controllers/posts_controller.rb +0 -0
- data/{lib/app → app}/controllers/roles_controller.rb +0 -0
- data/{lib/app → app}/controllers/sites_controller.rb +0 -0
- data/{lib/app → app}/controllers/users_controller.rb +0 -0
- data/{lib/app → app}/helpers/squeezer_helper.rb +0 -0
- data/{lib/app → app}/models/ability.rb +0 -0
- data/{lib/app → app}/models/blog.rb +0 -0
- data/{lib/app → app}/models/comment.rb +0 -0
- data/{lib/app → app}/models/page.rb +0 -0
- data/{lib/app → app}/models/post.rb +0 -0
- data/{lib/app → app}/models/role.rb +0 -0
- data/{lib/app → app}/models/site.rb +0 -0
- data/{lib/app → app}/models/user.rb +0 -0
- data/{lib/app → app}/views/blogs/_entry.haml +0 -0
- data/{lib/app → app}/views/blogs/_form.html.haml +0 -0
- data/{lib/app → app}/views/blogs/edit.html.haml +0 -0
- data/{lib/app → app}/views/blogs/index.html.haml +0 -0
- data/{lib/app → app}/views/blogs/new.html.haml +0 -0
- data/{lib/app → app}/views/blogs/show.html.haml +0 -0
- data/{lib/app → app}/views/comments/_form.html.haml +0 -0
- data/{lib/app → app}/views/comments/_index.html.haml +0 -0
- data/{lib/app → app}/views/comments/_post.html.haml +0 -0
- data/{lib/app → app}/views/comments/show.js.erb +0 -0
- data/{lib/app → app}/views/layouts/_footer.html.haml +0 -0
- data/{lib/app → app}/views/layouts/_login.haml +0 -0
- data/{lib/app → app}/views/layouts/_menu.html.haml +0 -0
- data/{lib/app → app}/views/layouts/_msn.haml +0 -0
- data/{lib/app → app}/views/layouts/_sidebar.html.haml +0 -0
- data/{lib/app → app}/views/layouts/application.html.erb +0 -0
- data/{lib/app → app}/views/layouts/ice/squeezer/_ice.haml +0 -0
- data/{lib/app → app}/views/layouts/ice/squeezer/ice/_ice.haml +0 -0
- data/{lib/app → app}/views/layouts/ice/squeezer/ice/squeezer/_ice.haml +0 -0
- data/{lib/app → app}/views/layouts/ice/squeezer/ice/squeezer/ice/_ice.haml +0 -0
- data/{lib/app → app}/views/layouts/ice/squeezer/ice/squeezer/ice/squeezer/_ice.haml +0 -0
- data/{lib/app → app}/views/layouts/squeezer/ice/_ice.haml +0 -0
- data/{lib/app → app}/views/layouts/squeezer/ice/squeezer/_ice.haml +0 -0
- data/{lib/app → app}/views/layouts/squeezer/ice/squeezer/ice/_ice.haml +0 -0
- data/{lib/app → app}/views/layouts/squeezer/ice/squeezer/ice/squeezer/_ice.haml +0 -0
- data/{lib/app → app}/views/layouts/squeezer/squeezer.css +0 -0
- data/{lib/app → app}/views/pages/_form.html.haml +0 -0
- data/{lib/app → app}/views/pages/edit.html.haml +0 -0
- data/{lib/app → app}/views/pages/index.html.haml +0 -0
- data/{lib/app → app}/views/pages/new.html.haml +0 -0
- data/{lib/app → app}/views/pages/show.html.haml +0 -0
- data/{lib/app → app}/views/roles/_form.html.haml +0 -0
- data/{lib/app → app}/views/roles/edit.html.haml +0 -0
- data/{lib/app → app}/views/roles/index.html.haml +0 -0
- data/{lib/app → app}/views/roles/new.html.haml +0 -0
- data/{lib/app → app}/views/roles/show.html.haml +0 -0
- data/{lib/app → app}/views/sites/_form.html.haml +0 -0
- data/{lib/app → app}/views/sites/edit.html.haml +0 -0
- data/{lib/app → app}/views/sites/index.html.haml +0 -0
- data/{lib/app → app}/views/sites/new.html.haml +0 -0
- data/{lib/app → app}/views/sites/show.html.haml +0 -0
- data/{lib/app → app}/views/users/index.haml +0 -0
- data/{lib/app → app}/views/users/roles.haml +0 -0
- data/{lib/app → app}/views/users/show.haml +0 -0
- data/lib/generators/squeezer/Gemfile +37 -0
- data/lib/generators/squeezer/README +2 -0
- data/lib/generators/squeezer/USAGE +7 -0
- data/lib/generators/squeezer/squeezer_generator.rb +114 -0
- data/lib/generators/squeezer/templates/Gemfile +37 -0
- data/lib/generators/squeezer/templates/app/controllers/application_controller.rb +25 -0
- data/lib/{blogs_controller.rb → generators/squeezer/templates/app/controllers/blogs_controller.rb} +0 -0
- data/lib/generators/squeezer/templates/app/controllers/comments_controller.rb +37 -0
- data/lib/generators/squeezer/templates/app/controllers/forums_controller.rb +42 -0
- data/lib/generators/squeezer/templates/app/controllers/pages_controller.rb +3 -0
- data/lib/generators/squeezer/templates/app/controllers/posts_controller.rb +23 -0
- data/lib/generators/squeezer/templates/app/controllers/roles_controller.rb +3 -0
- data/lib/generators/squeezer/templates/app/controllers/sites_controller.rb +70 -0
- data/lib/generators/squeezer/templates/app/controllers/topics_controller.rb +46 -0
- data/lib/generators/squeezer/templates/app/controllers/users_controller.rb +22 -0
- data/lib/generators/squeezer/templates/app/helpers/application_helper.rb +66 -0
- data/lib/generators/squeezer/templates/app/helpers/blogs_helper.rb +2 -0
- data/lib/generators/squeezer/templates/app/helpers/layout_helper.rb +71 -0
- data/lib/generators/squeezer/templates/app/helpers/pages_helper.rb +2 -0
- data/lib/generators/squeezer/templates/app/models/ability.rb +17 -0
- data/lib/generators/squeezer/templates/app/models/blog.rb +6 -0
- data/lib/generators/squeezer/templates/app/models/comment.rb +4 -0
- data/lib/generators/squeezer/templates/app/models/forum.rb +5 -0
- data/lib/generators/squeezer/templates/app/models/isntall.rb +9 -0
- data/lib/generators/squeezer/templates/app/models/page.rb +3 -0
- data/lib/generators/squeezer/templates/app/models/post.rb +12 -0
- data/lib/generators/squeezer/templates/app/models/role.rb +3 -0
- data/lib/generators/squeezer/templates/app/models/site.rb +17 -0
- data/lib/generators/squeezer/templates/app/models/topic.rb +6 -0
- data/lib/generators/squeezer/templates/app/models/user.rb +35 -0
- data/lib/generators/squeezer/templates/app/views/blogs/_entry.haml +26 -0
- data/lib/generators/squeezer/templates/app/views/blogs/_form.html.haml +15 -0
- data/lib/generators/squeezer/templates/app/views/blogs/edit.html.haml +8 -0
- data/lib/generators/squeezer/templates/app/views/blogs/index.html.haml +8 -0
- data/lib/generators/squeezer/templates/app/views/blogs/new.html.haml +5 -0
- data/lib/generators/squeezer/templates/app/views/blogs/show.html.haml +4 -0
- data/lib/generators/squeezer/templates/app/views/comments/_form.html.erb +5 -0
- data/lib/generators/squeezer/templates/app/views/comments/_form.html.haml +19 -0
- data/lib/generators/squeezer/templates/app/views/comments/_index.html.haml +26 -0
- data/lib/generators/squeezer/templates/app/views/comments/_post.html.haml +19 -0
- data/lib/generators/squeezer/templates/app/views/comments/_post2.haml +14 -0
- data/lib/generators/squeezer/templates/app/views/comments/edit.haml +7 -0
- data/lib/generators/squeezer/templates/app/views/comments/show.js.erb +1 -0
- data/lib/generators/squeezer/templates/app/views/confirmations/new.html.erb +12 -0
- data/lib/generators/squeezer/templates/app/views/devise/confirmations/new.html.erb +12 -0
- data/lib/generators/squeezer/templates/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
- data/lib/generators/squeezer/templates/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
- data/lib/generators/squeezer/templates/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
- data/lib/generators/squeezer/templates/app/views/devise/passwords/edit.html.erb +16 -0
- data/lib/generators/squeezer/templates/app/views/devise/passwords/new.html.erb +12 -0
- data/lib/generators/squeezer/templates/app/views/devise/registrations/edit.html.erb +28 -0
- data/lib/generators/squeezer/templates/app/views/devise/registrations/new.html.erb +21 -0
- data/lib/generators/squeezer/templates/app/views/devise/sessions/new.html.erb +17 -0
- data/lib/generators/squeezer/templates/app/views/devise/shared/_links.erb +19 -0
- data/lib/generators/squeezer/templates/app/views/devise/unlocks/new.html.erb +12 -0
- data/lib/generators/squeezer/templates/app/views/devise_mailer/confirmation_instructions.html.erb +5 -0
- data/lib/generators/squeezer/templates/app/views/devise_mailer/reset_password_instructions.html.erb +8 -0
- data/lib/generators/squeezer/templates/app/views/devise_mailer/unlock_instructions.html.erb +7 -0
- data/lib/generators/squeezer/templates/app/views/forums/_form.html.haml +14 -0
- data/lib/generators/squeezer/templates/app/views/forums/edit.html.haml +8 -0
- data/lib/generators/squeezer/templates/app/views/forums/index.html.haml +37 -0
- data/lib/generators/squeezer/templates/app/views/forums/new.html.haml +5 -0
- data/lib/generators/squeezer/templates/app/views/forums/show.html.haml +43 -0
- data/lib/generators/squeezer/templates/app/views/layouts/_footer.html.haml +5 -0
- data/lib/generators/squeezer/templates/app/views/layouts/_header.html.haml +10 -0
- data/lib/generators/squeezer/templates/app/views/layouts/_ice.haml +27 -0
- data/lib/generators/squeezer/templates/app/views/layouts/_latest.haml +15 -0
- data/lib/generators/squeezer/templates/app/views/layouts/_login.html.erb +9 -0
- data/lib/generators/squeezer/templates/app/views/layouts/_login.html.haml +12 -0
- data/lib/generators/squeezer/templates/app/views/layouts/_menu.html.haml +6 -0
- data/lib/generators/squeezer/templates/app/views/layouts/_msn.haml +12 -0
- data/lib/generators/squeezer/templates/app/views/layouts/_sidebar.html.haml +1 -0
- data/lib/generators/squeezer/templates/app/views/layouts/application.html.erb +14 -0
- data/lib/generators/squeezer/templates/app/views/layouts/application.html.haml +14 -0
- data/lib/generators/squeezer/templates/app/views/layouts/ice/squeezer/_ice.haml +27 -0
- data/lib/generators/squeezer/templates/app/views/pages/_form.html.haml +17 -0
- data/lib/generators/squeezer/templates/app/views/pages/edit.html.haml +8 -0
- data/lib/generators/squeezer/templates/app/views/pages/index.html.haml +22 -0
- data/lib/generators/squeezer/templates/app/views/pages/new.html.haml +5 -0
- data/lib/generators/squeezer/templates/app/views/pages/show.html.haml +12 -0
- data/lib/generators/squeezer/templates/app/views/passwords/edit.html.erb +16 -0
- data/lib/generators/squeezer/templates/app/views/passwords/new.html.erb +12 -0
- data/lib/generators/squeezer/templates/app/views/registrations/edit.html.erb +25 -0
- data/lib/generators/squeezer/templates/app/views/registrations/new.html.erb +17 -0
- data/lib/generators/squeezer/templates/app/views/roles/_form.html.haml +9 -0
- data/lib/generators/squeezer/templates/app/views/roles/edit.html.haml +7 -0
- data/lib/generators/squeezer/templates/app/views/roles/index.html.haml +19 -0
- data/lib/generators/squeezer/templates/app/views/roles/new.html.haml +5 -0
- data/lib/generators/squeezer/templates/app/views/roles/show.html.haml +13 -0
- data/lib/generators/squeezer/templates/app/views/roles/user.html.erb +14 -0
- data/lib/generators/squeezer/templates/app/views/sessions/new.html.erb +17 -0
- data/lib/generators/squeezer/templates/app/views/shared/_devise_links.erb +19 -0
- data/lib/generators/squeezer/templates/app/views/sites/_form.html.haml +42 -0
- data/lib/generators/squeezer/templates/app/views/sites/edit.html.haml +1 -0
- data/lib/generators/squeezer/templates/app/views/sites/index.html.haml +165 -0
- data/lib/generators/squeezer/templates/app/views/sites/new.html.haml +1 -0
- data/lib/generators/squeezer/templates/app/views/sites/show.html.haml +18 -0
- data/lib/generators/squeezer/templates/app/views/topics/_form.html.haml +16 -0
- data/lib/generators/squeezer/templates/app/views/topics/edit.html.erb +8 -0
- data/lib/generators/squeezer/templates/app/views/topics/index.html.haml +23 -0
- data/lib/generators/squeezer/templates/app/views/topics/new.html.erb +5 -0
- data/lib/generators/squeezer/templates/app/views/topics/show.html.haml +16 -0
- data/lib/generators/squeezer/templates/app/views/unlocks/new.html.erb +12 -0
- data/lib/generators/squeezer/templates/app/views/users/index.haml +5 -0
- data/lib/generators/squeezer/templates/app/views/users/roles.haml +14 -0
- data/lib/generators/squeezer/templates/config/devise.rb +142 -0
- data/lib/generators/squeezer/templates/db/migrate/add_username_user.rb +11 -0
- data/lib/generators/squeezer/templates/db/migrate/blogs.rb +15 -0
- data/lib/generators/squeezer/templates/db/migrate/comments.rb +15 -0
- data/lib/generators/squeezer/templates/db/migrate/create_blogs.rb +15 -0
- data/lib/generators/squeezer/templates/db/migrate/create_comments.rb +15 -0
- data/lib/generators/squeezer/templates/db/migrate/create_pages.rb +16 -0
- data/lib/generators/squeezer/templates/db/migrate/create_posts.rb +16 -0
- data/lib/generators/squeezer/templates/db/migrate/create_roles.rb +13 -0
- data/lib/generators/squeezer/templates/db/migrate/create_roles_users.rb +15 -0
- data/lib/generators/squeezer/templates/db/migrate/create_sites.rb +26 -0
- data/lib/generators/squeezer/templates/db/migrate/data.rb +7 -0
- data/lib/generators/squeezer/templates/db/migrate/page_data.rb +10 -0
- data/lib/generators/squeezer/templates/db/migrate/pages.rb +16 -0
- data/lib/generators/squeezer/templates/db/migrate/posts.rb +16 -0
- data/lib/generators/squeezer/templates/db/migrate/roles.rb +13 -0
- data/lib/generators/squeezer/templates/db/migrate/roles_users.rb +15 -0
- data/lib/generators/squeezer/templates/db/migrate/sites.rb +26 -0
- data/lib/generators/squeezer/templates/db/migrate/squeez_data.rb +7 -0
- data/lib/generators/squeezer/templates/doc/clases.png +0 -0
- data/lib/generators/squeezer/templates/ice/squeezer/ice/_ice.haml +6 -0
- data/lib/generators/squeezer/templates/ice/squeezer/ice/squeezer/_ice.haml +28 -0
- data/lib/generators/squeezer/templates/ice/squeezer/ice/squeezer/ice/_ice.haml +6 -0
- data/lib/generators/squeezer/templates/ice/squeezer/ice/squeezer/ice/squeezer/_ice.haml +7 -0
- data/lib/generators/squeezer/templates/ice/squeezer/squeezer.css +252 -0
- data/lib/generators/squeezer/templates/public/javascripts/application.js +53 -0
- data/lib/generators/squeezer/templates/public/javascripts/jquery-ui.js +11437 -0
- data/lib/generators/squeezer/templates/public/javascripts/jquery-ui.min.js +401 -0
- data/lib/generators/squeezer/templates/public/javascripts/jquery.cleditor.min.js +31 -0
- data/lib/generators/squeezer/templates/public/javascripts/jquery.js +6883 -0
- data/lib/generators/squeezer/templates/public/javascripts/jquery.layout.min-1.2.0.js +80 -0
- data/lib/generators/squeezer/templates/public/javascripts/jquery.min.js +166 -0
- data/lib/generators/squeezer/templates/public/javascripts/rails.js +146 -0
- data/lib/generators/squeezer/templates/public/stylesheets/CLEditor1_3_0/images/buttons.gif +0 -0
- data/lib/generators/squeezer/templates/public/stylesheets/CLEditor1_3_0/images/toolbar.gif +0 -0
- data/lib/generators/squeezer/templates/public/stylesheets/CLEditor1_3_0/jquery.cleditor.css +24 -0
- data/lib/generators/squeezer/templates/public/stylesheets/ice/lagota/ice/_ice.haml +6 -0
- data/lib/generators/squeezer/templates/public/stylesheets/ice/lagota/lagota.css +284 -0
- data/lib/generators/squeezer/templates/public/stylesheets/ice/squeezer/ice/_ice.haml +6 -0
- data/lib/generators/squeezer/templates/public/stylesheets/ice/squeezer/ice/squeezer/_ice.haml +27 -0
- data/lib/generators/squeezer/templates/public/stylesheets/ice/squeezer/ice/squeezer/ice/_ice.haml +6 -0
- data/lib/generators/squeezer/templates/public/stylesheets/ice/squeezer/ice/squeezer/ice/squeezer/_ice.haml +7 -0
- data/lib/generators/squeezer/templates/public/stylesheets/ice/squeezer/squeezer.css +249 -0
- data/lib/generators/squeezer/templates/public/stylesheets/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
- data/lib/generators/squeezer/templates/public/stylesheets/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
- data/lib/generators/squeezer/templates/public/stylesheets/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
- data/lib/generators/squeezer/templates/public/stylesheets/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
- data/lib/generators/squeezer/templates/public/stylesheets/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/lib/generators/squeezer/templates/public/stylesheets/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/lib/generators/squeezer/templates/public/stylesheets/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
- data/lib/generators/squeezer/templates/public/stylesheets/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- data/lib/generators/squeezer/templates/public/stylesheets/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
- data/lib/generators/squeezer/templates/public/stylesheets/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
- data/lib/generators/squeezer/templates/public/stylesheets/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
- data/lib/generators/squeezer/templates/public/stylesheets/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
- data/lib/generators/squeezer/templates/public/stylesheets/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
- data/lib/generators/squeezer/templates/public/stylesheets/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
- data/lib/generators/squeezer/templates/public/stylesheets/ui-lightness/jquery-ui-1.8.5.custom.css +572 -0
- data/lib/squeezer.rb +1 -1
- data/pkg/squeezer-0.1.3.gem +0 -0
- data/pkg/squeezer-0.1.4.gem +0 -0
- data/squeezer.gemspec +227 -65
- metadata +229 -67
- data/lib/squeezer/engine.rb +0 -0
@@ -0,0 +1,31 @@
|
|
1
|
+
/*
|
2
|
+
CLEditor WYSIWYG HTML Editor v1.3.0
|
3
|
+
http://premiumsoftware.net/cleditor
|
4
|
+
requires jQuery v1.4.2 or later
|
5
|
+
|
6
|
+
Copyright 2010, Chris Landowski, Premium Software, LLC
|
7
|
+
Dual licensed under the MIT or GPL Version 2 licenses.
|
8
|
+
*/
|
9
|
+
(function(e){function aa(a){var b=this,c=a.target,d=e.data(c,x),h=s[d],f=h.popupName,i=p[f];if(!(b.disabled||e(c).attr(n)==n)){var g={editor:b,button:c,buttonName:d,popup:i,popupName:f,command:h.command,useCSS:b.options.useCSS};if(h.buttonClick&&h.buttonClick(a,g)===false)return false;if(d=="source"){if(t(b)){delete b.range;b.$area.hide();b.$frame.show();c.title=h.title}else{b.$frame.hide();b.$area.show();c.title="Show Rich Text"}setTimeout(function(){u(b)},100)}else if(!t(b))if(f){var j=e(i);if(f==
|
10
|
+
"url"){if(d=="link"&&M(b)===""){z(b,"A selection is required when inserting a link.",c);return false}j.children(":button").unbind(q).bind(q,function(){var k=j.find(":text"),o=e.trim(k.val());o!==""&&v(b,g.command,o,null,g.button);k.val("http://");r();w(b)})}else f=="pastetext"&&j.children(":button").unbind(q).bind(q,function(){var k=j.find("textarea"),o=k.val().replace(/\n/g,"<br />");o!==""&&v(b,g.command,o,null,g.button);k.val("");r();w(b)});if(c!==e.data(i,A)){N(b,i,c);return false}return}else if(d==
|
11
|
+
"print")b.$frame[0].contentWindow.print();else if(!v(b,g.command,g.value,g.useCSS,c))return false;w(b)}}function O(a){a=e(a.target).closest("div");a.css(H,a.data(x)?"#FFF":"#FFC")}function P(a){e(a.target).closest("div").css(H,"transparent")}function ba(a){var b=a.data.popup,c=a.target;if(!(b===p.msg||e(b).hasClass(B))){var d=e.data(b,A),h=e.data(d,x),f=s[h],i=f.command,g,j=this.options.useCSS;if(h=="font")g=c.style.fontFamily.replace(/"/g,"");else if(h=="size"){if(c.tagName=="DIV")c=c.children[0];
|
12
|
+
g=c.innerHTML}else if(h=="style")g="<"+c.tagName+">";else if(h=="color")g=Q(c.style.backgroundColor);else if(h=="highlight"){g=Q(c.style.backgroundColor);if(l)i="backcolor";else j=true}b={editor:this,button:d,buttonName:h,popup:b,popupName:f.popupName,command:i,value:g,useCSS:j};if(!(f.popupClick&&f.popupClick(a,b)===false)){if(b.command&&!v(this,b.command,b.value,b.useCSS,d))return false;r();w(this)}}}function C(a){for(var b=1,c=0,d=0;d<a.length;++d){b=(b+a.charCodeAt(d))%65521;c=(c+b)%65521}return c<<
|
13
|
+
16|b}function R(a,b,c,d,h){if(p[a])return p[a];var f=e(m).hide().addClass(ca).appendTo("body");if(d)f.html(d);else if(a=="color"){b=b.colors.split(" ");b.length<10&&f.width("auto");e.each(b,function(i,g){e(m).appendTo(f).css(H,"#"+g)});c=da}else if(a=="font")e.each(b.fonts.split(","),function(i,g){e(m).appendTo(f).css("fontFamily",g).html(g)});else if(a=="size")e.each(b.sizes.split(","),function(i,g){e(m).appendTo(f).html("<font size="+g+">"+g+"</font>")});else if(a=="style")e.each(b.styles,function(i,
|
14
|
+
g){e(m).appendTo(f).html(g[1]+g[0]+g[1].replace("<","</"))});else if(a=="url"){f.html('Enter URL:<br><input type=text value="http://" size=35><br><input type=button value="Submit">');c=B}else if(a=="pastetext"){f.html("Paste your content here and click submit.<br /><textarea cols=40 rows=3></textarea><br /><input type=button value=Submit>");c=B}if(!c&&!d)c=S;f.addClass(c);l&&f.attr(I,"on").find("div,font,p,h1,h2,h3,h4,h5,h6").attr(I,"on");if(f.hasClass(S)||h===true)f.children().hover(O,P);p[a]=f[0];
|
15
|
+
return f[0]}function T(a,b){if(b){a.$area.attr(n,n);a.disabled=true}else{a.$area.removeAttr(n);delete a.disabled}try{if(l)a.doc.body.contentEditable=!b;else a.doc.designMode=!b?"on":"off"}catch(c){}u(a)}function v(a,b,c,d,h){D(a);if(!l){if(d===undefined||d===null)d=a.options.useCSS;a.doc.execCommand("styleWithCSS",0,d.toString())}d=true;var f;if(l&&b.toLowerCase()=="inserthtml")y(a).pasteHTML(c);else{try{d=a.doc.execCommand(b,0,c||null)}catch(i){f=i.description;d=false}d||("cutcopypaste".indexOf(b)>
|
16
|
+
-1?z(a,"For security reasons, your browser does not support the "+b+" command. Try using the keyboard shortcut or context menu instead.",h):z(a,f?f:"Error executing the "+b+" command.",h))}u(a);return d}function w(a){setTimeout(function(){t(a)?a.$area.focus():a.$frame[0].contentWindow.focus();u(a)},0)}function y(a){if(l)return J(a).createRange();return J(a).getRangeAt(0)}function J(a){if(l)return a.doc.selection;return a.$frame[0].contentWindow.getSelection()}function Q(a){var b=/rgba?\((\d+), (\d+), (\d+)/.exec(a),
|
17
|
+
c=a.split("");if(b)for(a=(b[1]<<16|b[2]<<8|b[3]).toString(16);a.length<6;)a="0"+a;return"#"+(a.length==6?a:c[1]+c[1]+c[2]+c[2]+c[3]+c[3])}function r(){e.each(p,function(a,b){e(b).hide().unbind(q).removeData(A)})}function U(){var a=e("link[href$='jquery.cleditor.css']").attr("href");return a.substr(0,a.length-19)+"images/"}function K(a){var b=a.$main,c=a.options;a.$frame&&a.$frame.remove();var d=a.$frame=e('<iframe frameborder="0" src="javascript:true;">').hide().appendTo(b),h=d[0].contentWindow,f=
|
18
|
+
a.doc=h.document,i=e(f);f.open();f.write(c.docType+"<html>"+(c.docCSSFile===""?"":'<head><link rel="stylesheet" type="text/css" href="'+c.docCSSFile+'" /></head>')+'<body style="'+c.bodyStyle+'"></body></html>');f.close();l&&i.click(function(){w(a)});E(a);if(l){i.bind("beforedeactivate beforeactivate selectionchange keypress",function(g){if(g.type=="beforedeactivate")a.inactive=true;else if(g.type=="beforeactivate"){!a.inactive&&a.range&&a.range.length>1&&a.range.shift();delete a.inactive}else if(!a.inactive){if(!a.range)a.range=
|
19
|
+
[];for(a.range.unshift(y(a));a.range.length>2;)a.range.pop()}});d.focus(function(){D(a)})}(e.browser.mozilla?i:e(h)).blur(function(){V(a,true)});i.click(r).bind("keyup mouseup",function(){u(a)});L?a.$area.show():d.show();e(function(){var g=a.$toolbar,j=g.children("div:last"),k=b.width();j=j.offset().top+j.outerHeight()-g.offset().top+1;g.height(j);j=(/%/.test(""+c.height)?b.height():parseInt(c.height))-j;d.width(k).height(j);a.$area.width(k).height(ea?j-2:j);T(a,a.disabled);u(a)})}function u(a){if(!L&&
|
20
|
+
e.browser.webkit&&!a.focused){a.$frame[0].contentWindow.focus();window.focus();a.focused=true}var b=a.doc;if(l)b=y(a);var c=t(a);e.each(a.$toolbar.find("."+W),function(d,h){var f=e(h),i=e.cleditor.buttons[e.data(h,x)],g=i.command,j=true;if(a.disabled)j=false;else if(i.getEnabled){j=i.getEnabled({editor:a,button:h,buttonName:i.name,popup:p[i.popupName],popupName:i.popupName,command:i.command,useCSS:a.options.useCSS});if(j===undefined)j=true}else if((c||L)&&i.name!="source"||l&&(g=="undo"||g=="redo"))j=
|
21
|
+
false;else if(g&&g!="print"){if(l&&g=="hilitecolor")g="backcolor";if(!l||g!="inserthtml")try{j=b.queryCommandEnabled(g)}catch(k){j=false}}if(j){f.removeClass(X);f.removeAttr(n)}else{f.addClass(X);f.attr(n,n)}})}function D(a){l&&a.range&&a.range[0].select()}function M(a){D(a);if(l)return y(a).text;return J(a).toString()}function z(a,b,c){var d=R("msg",a.options,fa);d.innerHTML=b;N(a,d,c)}function N(a,b,c){var d,h,f=e(b);if(c){var i=e(c);d=i.offset();h=--d.left;d=d.top+i.height()}else{i=a.$toolbar;
|
22
|
+
d=i.offset();h=Math.floor((i.width()-f.width())/2)+d.left;d=d.top+i.height()-2}r();f.css({left:h,top:d}).show();if(c){e.data(b,A,c);f.bind(q,{popup:b},e.proxy(ba,a))}setTimeout(function(){f.find(":text,textarea").eq(0).focus().select()},100)}function t(a){return a.$area.is(":visible")}function E(a,b){var c=a.$area.val(),d=a.options,h=d.updateFrame,f=e(a.doc.body);if(h){var i=C(c);if(b&&a.areaChecksum==i)return;a.areaChecksum=i}c=h?h(c):c;c=c.replace(/<(?=\/?script)/ig,"<");if(d.updateTextArea)a.frameChecksum=
|
23
|
+
C(c);if(c!=f.html()){f.html(c);e(a).triggerHandler(F)}}function V(a,b){var c=e(a.doc.body).html(),d=a.options,h=d.updateTextArea,f=a.$area;if(h){var i=C(c);if(b&&a.frameChecksum==i)return;a.frameChecksum=i}c=h?h(c):c;if(d.updateFrame)a.areaChecksum=C(c);if(c!=f.val()){f.val(c);e(a).triggerHandler(F)}}e.cleditor={defaultOptions:{width:500,height:250,controls:"bold italic underline strikethrough subscript superscript | font size style | color highlight removeformat | bullets numbering | outdent indent | alignleft center alignright justify | undo redo | rule image link unlink | cut copy paste pastetext | print source",
|
24
|
+
colors:"FFF FCC FC9 FF9 FFC 9F9 9FF CFF CCF FCF CCC F66 F96 FF6 FF3 6F9 3FF 6FF 99F F9F BBB F00 F90 FC6 FF0 3F3 6CC 3CF 66C C6C 999 C00 F60 FC3 FC0 3C0 0CC 36F 63F C3C 666 900 C60 C93 990 090 399 33F 60C 939 333 600 930 963 660 060 366 009 339 636 000 300 630 633 330 030 033 006 309 303",fonts:"Arial,Arial Black,Comic Sans MS,Courier New,Narrow,Garamond,Georgia,Impact,Sans Serif,Serif,Tahoma,Trebuchet MS,Verdana",sizes:"1,2,3,4,5,6,7",styles:[["Paragraph","<p>"],["Header 1","<h1>"],["Header 2","<h2>"],
|
25
|
+
["Header 3","<h3>"],["Header 4","<h4>"],["Header 5","<h5>"],["Header 6","<h6>"]],useCSS:false,docType:'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">',docCSSFile:"",bodyStyle:"margin:4px; font:10pt Arial,Verdana; cursor:text"},buttons:{init:"bold,,|italic,,|underline,,|strikethrough,,|subscript,,|superscript,,|font,,fontname,|size,Font Size,fontsize,|style,,formatblock,|color,Font Color,forecolor,|highlight,Text Highlight Color,hilitecolor,color|removeformat,Remove Formatting,|bullets,,insertunorderedlist|numbering,,insertorderedlist|outdent,,|indent,,|alignleft,Align Text Left,justifyleft|center,,justifycenter|alignright,Align Text Right,justifyright|justify,,justifyfull|undo,,|redo,,|rule,Insert Horizontal Rule,inserthorizontalrule|image,Insert Image,insertimage,url|link,Insert Hyperlink,createlink,url|unlink,Remove Hyperlink,|cut,,|copy,,|paste,,|pastetext,Paste as Text,inserthtml,|print,,|source,Show Source"},
|
26
|
+
imagesPath:function(){return U()}};e.fn.cleditor=function(a){var b=e([]);this.each(function(c,d){if(d.tagName=="TEXTAREA"){var h=e.data(d,Y);h||(h=new cleditor(d,a));b=b.add(h)}});return b};var H="backgroundColor",A="button",x="buttonName",F="change",Y="cleditor",q="click",n="disabled",m="<div>",I="unselectable",W="cleditorButton",X="cleditorDisabled",ca="cleditorPopup",S="cleditorList",da="cleditorColor",B="cleditorPrompt",fa="cleditorMsg",l=e.browser.msie,ea=/msie\s6/i.test(navigator.userAgent),
|
27
|
+
L=/iphone|ipad|ipod/i.test(navigator.userAgent),p={},Z,s=e.cleditor.buttons;e.each(s.init.split("|"),function(a,b){var c=b.split(","),d=c[0];s[d]={stripIndex:a,name:d,title:c[1]===""?d.charAt(0).toUpperCase()+d.substr(1):c[1],command:c[2]===""?d:c[2],popupName:c[3]===""?d:c[3]}});delete s.init;cleditor=function(a,b){var c=this;c.options=b=e.extend({},e.cleditor.defaultOptions,b);var d=c.$area=e(a).hide().data(Y,c).blur(function(){E(c,true)}),h=c.$main=e(m).addClass("cleditorMain").width(b.width).height(b.height),
|
28
|
+
f=c.$toolbar=e(m).addClass("cleditorToolbar").appendTo(h),i=e(m).addClass("cleditorGroup").appendTo(f);e.each(b.controls.split(" "),function(g,j){if(j==="")return true;if(j=="|"){e(m).addClass("cleditorDivider").appendTo(i);i=e(m).addClass("cleditorGroup").appendTo(f)}else{var k=s[j],o=e(m).data(x,k.name).addClass(W).attr("title",k.title).bind(q,e.proxy(aa,c)).appendTo(i).hover(O,P),G={};if(k.css)G=k.css;else if(k.image)G.backgroundImage="url("+U()+k.image+")";if(k.stripIndex)G.backgroundPosition=
|
29
|
+
k.stripIndex*-24;o.css(G);l&&o.attr(I,"on");k.popupName&&R(k.popupName,b,k.popupClass,k.popupContent,k.popupHover)}});h.insertBefore(d).append(d);if(!Z){e(document).click(function(g){g=e(g.target);g.add(g.parents()).is("."+B)||r()});Z=true}/auto|%/.test(""+b.width+b.height)&&e(window).resize(function(){K(c)});K(c)};var $=cleditor.prototype;e.each([["clear",function(a){a.$area.val("");E(a)}],["disable",T],["execCommand",v],["focus",w],["hidePopups",r],["sourceMode",t,true],["refresh",K],["select",
|
30
|
+
function(a){setTimeout(function(){t(a)?a.$area.select():v(a,"selectall")},0)}],["selectedHTML",function(a){D(a);a=y(a);if(l)return a.htmlText;var b=e("<layer>")[0];b.appendChild(a.cloneContents());return b.innerHTML},true],["selectedText",M,true],["showMessage",z],["updateFrame",E],["updateTextArea",V]],function(a,b){$[b[0]]=function(){for(var c=[this],d=0;d<arguments.length;d++)c.push(arguments[d]);c=b[1].apply(this,c);if(b[2])return c;return this}});$.change=function(a){var b=e(this);return a?b.bind(F,
|
31
|
+
a):b.trigger(F)}})(jQuery);
|