Permalink
Browse files

remove debug-info, license in readme

  • Loading branch information...
1 parent 28a6681 commit 079e1bc17f5163502451f360c1dd0551de933b69 @eval committed Mar 12, 2010
Showing with 18 additions and 20 deletions.
  1. +8 −1 README.rdoc
  2. +1 −0 css/protoparts.css
  3. +9 −19 jquery.protoparts.js
View
@@ -4,7 +4,6 @@ Protoparts is a jQuery plugin that lets you toggle regions in your prototype, sh
The demo explains it best: http://thinkcreate.github.com/jquery_protoparts
-Pretty much only a proof of concept currently.
== Installation
@@ -53,4 +52,12 @@ Add the following snippet to your page:
The login part we just added has two states, true and false.
The states will show up in the toolbar and we'll now be able to wander through the site as a logged-in user!
+== Meta
+
+Created by Gert Goet
+
+http://github.com/thinkcreate/jquery_protoparts
+
+Released under the MIT License: http://www.opensource.org/licenses/mit-license.php
+
Enjoy!
View
@@ -13,6 +13,7 @@ color:white;
border-radius:4px 0px 0px 0px;
-moz-border-radius-topleft:4px;
-webkit-border-top-left-radius:4px;
+text-align: right;
}
body div#pp_bar .permalink {
View
@@ -1,12 +1,4 @@
(function($) {
- if (!window.console || !console.firebug){
- var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml",
- "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
-
- window.console = {};
- for (var i = 0; i < names.length; ++i)
- window.console[names[i]] = function() {}
- }
$.fn.protoparts = function(options) {
// settings = $.extend({
@@ -36,10 +28,9 @@
}
function url(active_states){
- var base_url = window.location.toString();
- if(window.location.hash != ""){
- base_url = base_url.split(window.location.hash)[0];
- }
+ var url = window.location.toString();
+ var base_url = url.split("#")[0];
+
var hash = "";
$.each(active_states, function(k,v){
hash += (k+"="+v+"&");
@@ -57,9 +48,11 @@
var is_ix = klasses.indexOf("is");
var part = klasses[is_ix-1];
var state = klasses[is_ix+1];
-
- if (_parts[part] && _parts[part].indexOf(state) == -1){
- _parts[part].push(state);
+
+ if (_parts[part]){
+ if(_parts[part].indexOf(state) == -1){
+ _parts[part].push(state);
+ }
} else {
_parts[part] = [state];
}
@@ -84,6 +77,7 @@
parts = find_parts();
+
// read active states from cookie and url
active_states = $.cookies.get('active_states') || {};
@@ -96,8 +90,6 @@
}
});
- console.log('states: '+active_states);
-
// draw bar
var selects = '';
$.each(parts, function(part, part_states){
@@ -120,7 +112,6 @@
</select>\
';
- console.log('drawing bar');
});
$('body').prepend('<div id="pp_bar">\
@@ -142,7 +133,6 @@
$("#pp_bar select").change(function(event){
select = event.target;
option = select.options[select.selectedIndex];
- console.log("part:"+select.name+", state:"+option.value);
activate_state(select.name, option.value);
})
});

0 comments on commit 079e1bc

Please sign in to comment.