Commits

fab31 committed ca4e837 Merge

Merge

Comments (0)

Files changed (12)

 - DETECT BROWSER: http://pypi.python.org/pypi/raclette.gbs/0.2
 - ADD SCHEDULING: http://pypi.python.org/pypi/pulse/0.1.2
 - finish cleanup & start markdown cleanup
-- reset selection on view change
-- fix focus loss on messages() closing
 - Do Queue Job & use it when adding or editing an item
     - use http://pypi.python.org/pypi/pycom/0.3.0 for communication
     - use https://github.com/btimby/fulltext/ to extract content from binary files

docs/source/_static/_keep_me

Empty file added.

docs/source/apis/drink.ListPage.rst

    .. autosummary::
    
       ~ListPage.__init__
-      ~ListPage.add
-      ~ListPage.borrow
-      ~ListPage.clear
-      ~ListPage.copy
-      ~ListPage.edit
-      ~ListPage.fromkeys
-      ~ListPage.gallery
-      ~ListPage.get
-      ~ListPage.get_field
-      ~ListPage.has_key
-      ~ListPage.items
-      ~ListPage.iteritems
-      ~ListPage.iterkeys
-      ~ListPage.itervalues
-      ~ListPage.keys
-      ~ListPage.list
-      ~ListPage.match
-      ~ListPage.move
-      ~ListPage.pop
-      ~ListPage.popitem
       ~ListPage.reset_items
-      ~ListPage.rm
-      ~ListPage.serialize
-      ~ListPage.set_field
-      ~ListPage.setdefault
-      ~ListPage.struct
-      ~ListPage.update
-      ~ListPage.upload
-      ~ListPage.values
-      ~ListPage.view
-   
-   
 
    
-   
-   .. rubric:: Attributes
-
-   .. autosummary::
-   
-      ~ListPage.actions
-      ~ListPage.admin_fields
-      ~ListPage.classes
-      ~ListPage.css
-      ~ListPage.default_action
-      ~ListPage.description
-      ~ListPage.drink_name
-      ~ListPage.editable_fields
-      ~ListPage.forced_order
-      ~ListPage.hidden_class
-      ~ListPage.html
-      ~ListPage.indexable
-      ~ListPage.items_factory
-      ~ListPage.js
-      ~ListPage.mime
-      ~ListPage.min_rights
-      ~ListPage.owner_fields
-      ~ListPage.path
-      ~ListPage.quoted_id
-      ~ListPage.quoted_path
-      ~ListPage.upload_map
-   
-   

docs/source/apis/drink.Page.rst

 
    
    .. automethod:: __init__
+   .. automethod:: _edit
 
    
    .. rubric:: Methods
       ~Page.clear
       ~Page.copy
       ~Page.edit
+      ~Page._edit
       ~Page.fromkeys
       ~Page.gallery
       ~Page.get
    
    .. rubric:: Attributes
 
+   .. autoattribute:: _items_factory
+   .. autoattribute:: _loaders
+   .. autoattribute:: _actions
+   .. autoattribute:: _add_hooks
+   .. autoattribute:: _remove_hooks
+
    .. autosummary::
    
-      ~Page.actions
+      ~Page.editable_fields
       ~Page.admin_fields
+      ~Page.owner_fields
       ~Page.classes
       ~Page.css
+      ~Page.html
+      ~Page.js
+      ~Page.description
+      ~Page.hidden_class
+      ~Page.indexable
+      ~Page._items_factory
+      ~Page._add_hooks
+      ~Page._remove_hooks
+      ~Page._loaders
       ~Page.default_action
-      ~Page.description
-      ~Page.editable_fields
-      ~Page.hidden_class
-      ~Page.html
-      ~Page.indexable
-      ~Page.items_factory
-      ~Page.js
+      ~Page._actions
       ~Page.mime
       ~Page.min_rights
-      ~Page.owner_fields
       ~Page.path
       ~Page.quoted_id
       ~Page.quoted_path
       ~Page.upload_map
    
-   
+   

docs/source/apis/drink.objects.generic.WebFile.rst

 
 .. currentmodule:: drink.objects.generic
 
-.. autodata:: WebFile
+.. autoclass:: WebFile

docs/source/apis/drink.types.rst

    
    .. rubric:: Classes
 
+   .. autoclass:: _Editable
+
    .. autosummary::
    
+      _Editable
       BoolOption
       CheckboxSet
       Choice

docs/source/conf.py

 autosummary_generate = True
 autoclass_content = "both"
 autodoc_member_order = "bysource"
-autodoc_default_flags = ('members', 'undoc-members', 'show-inheritance', 'inherited')
+autodoc_default_flags = ('members', 'undoc-members', 'show-inheritance') #, 'inherited')
 

docs/source/developpers.rst

    finder.ObjectBrowser
    filesystem.Filesystem
    sonic.SonicHome
+

drink/static/base.js

         var view = view;
 		var loader = me.d.loaders[view];
 
-		if (!!me.cur_action)
+		if (!!me.cur_action && me.cur_action !== action_to_take) {
 	        $('#main_body , #footers').fadeOut();
-
+	        ui.focus.clear();
+        }
 		if ( obj || action_to_take !== me.cur_action)
 			setTimeout(function() {
 			    if(!!!view)
 					if(debug) console.log('Loader: '+loader, me.d.loaders);
 					if (!!loader) {
 						eval(loader);
-						var _delayed = function() {
-						      dom_initialize($('#main_body'));
-  						}
-						setTimeout(_delayed, 500);
 					} else {
 						if(debug) console.log('No hook!')
 					}
+					setTimeout(function() {dom_initialize($('#main_body'));}, 500);
 			    })
 		        .error(function(data, code) {
 		        	if(debug) console.log(data, code);

drink/static/main.js

     add_entry: function() {
     	var k = drink.d.classes;
          if ( k.length < 1 ) {
-            w = $('<div title="Ooops!">Nothing can be added here, sorry</div>').dialog({closeOnEscape:true});
+         	ui.failure_dialog('Ooops!', 'Nothing can be added here, sorry'); 
             setTimeout(function(){w.fadeOut(function(){w.dialog('close');});}, 2000);
             return;
         }
                 'name': new_obj.find('input.obj_name').val()
             };
             $.post(base_path+'add', item).success(function(data) { if(validate(data)) {drink.add_item(data, true);} } );
+        	new_obj.remove();
         };
 
         new_obj.find('input.obj_name').keyup(check_fn);
 
-        new_obj.dialog({
-            closeOnEscape: true,
-            modal: true,
-            buttons: [ {text: 'OK', click: validate_fn} ]
-        });
+		ui.dialog(new_obj, [ {text: 'OK', click: validate_fn} ] );
 
         if (k.length == 1) {
             new_obj.find(".obj_class").val(k[0]).attr('disabled', true);
         });
     },
     dialog: function(body, buttons, style) {
-        var d = $(body);
+        if (!!body.bind) 
+        	var d = body;
+    	else
+    		var d = $(body);
+
         d.dialog({
             modal: true,
-            closeOnEscape: true,
+            closeOnEscape: false,
             buttons: buttons,
             width: '50%'
         });
+        d.keyup( function(e) {
+        	if(e.which == 27) {
+        		d.dialog('close');
+        		d.remove();
+        	}
+        })
         if (style == 'big') {
             d.css('width', '100%');
             d.css('padding', '0');
 function dom_initialize(dom) {
     // hides some things by default
     dom.find('.starts_hidden').slideUp(0);
-	console.log('init', dom);
 	if (dom.attr('id') === 'main_body' && drink.cur_action === "view" && !!! dom.parent().data('annotator')) {
 		annotator = $('#main_body').parent().annotator();
 		annotator.annotator('addPlugin', 'Tags');
     'Text', 'TextArea', 'GroupListArea', 'GroupCheckBoxes',
     'CheckboxSet', 'BoolOption',
     'Mime', 'Choice', 'Link',
-    'Date',
-    'Id', 'Int', 'Password', 'File']
+    'Date', 'Duration', 'EasyPermissions',
+    'Id', 'Float', 'Int', 'Password', 'File']
 
 import os
 import drink
 from time import mktime, strptime
 
 class _Editable(object):
+    """ Abstract class for any editable type """
 
     form_attr = None
 
         <span class="button" id="apply_permissions_recursively" onclick="apply_perms(this)">Save and Apply permissions on children</span>
         </div>
 
-        <span class="button" id="show_hide_permissions" onclick="var o=$('#show_hide_permissions'); var g=$('.x_permissions_grp'); if(g.css('display') == 'none') {o.html('Hide detailed permissions')} else {o.html('Show detailed permissions')}; g.slideToggle('slow');">
+        <span class="button" id="show_hide_permissions" onclick="var o=$('#show_hide_permissions'); var g=$('.x_permissions_grp'); if(g.css('display') === 'none') {o.html('Hide detailed permissions');  g.fadeIn('slow');} else { g.hide(); o.html('Show detailed permissions')};">
         Show detailed permissions</span>
 
         """%dict(id=drink.request.identity.id)

drink_defaults/database/zeo.conf

File contents unchanged.