forked from Botanical/BotanJS
Added Section, early plugin model
This commit is contained in:
@@ -58,14 +58,14 @@
|
||||
}
|
||||
};
|
||||
|
||||
PluginBundles.prototype.getSetData = function( pluginId, data )
|
||||
PluginBundles.prototype.getData = function( pluginId, data )
|
||||
{
|
||||
for( var i in this.plugins )
|
||||
{
|
||||
var p = this.plugins[i];
|
||||
if( p.id == pluginId )
|
||||
{
|
||||
p.getSetData( data );
|
||||
return p.getData( data );
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -121,6 +121,7 @@
|
||||
, title: set_field_name( Dand.wrap( "input" ), "title" )
|
||||
, content: set_field_name( Dand.wrap( "input" ), "content" )
|
||||
, tags: set_field_name( Dand.wrap( "input" ), "tags" )
|
||||
, section: set_field_name( Dand.wrap( "input" ), "section" )
|
||||
};
|
||||
|
||||
// Initialize id
|
||||
@@ -382,11 +383,10 @@
|
||||
, title: _title
|
||||
, content: _content
|
||||
, draft: 1
|
||||
, tags: plugins.getData( "tags" )
|
||||
, section: plugins.getData( "section" )
|
||||
};
|
||||
|
||||
plugins.getSetData( "tags", _data );
|
||||
plugins.getSetData( "section", _data );
|
||||
|
||||
postData( processorSet, _data, saveSuccess, serverFailed );
|
||||
}
|
||||
};
|
||||
@@ -417,7 +417,8 @@
|
||||
? ArticleModel.date_published
|
||||
: Math.floor( 0.001*( new Date().getTime() ) )
|
||||
;
|
||||
ae_p_fields.tags.value = _ae_tag.getFlags();
|
||||
ae_p_fields.tags.value = plugins.getData( "tags" );
|
||||
ae_p_fields.section.value = plugins.getData( "section" );
|
||||
|
||||
ae_preview.submit();
|
||||
};
|
||||
@@ -430,11 +431,6 @@
|
||||
_visualizer = _class;
|
||||
_visualizer.setContentDiv( ae_content );
|
||||
}
|
||||
if ( _class instanceof Flag )
|
||||
{
|
||||
_ae_tag = _class;
|
||||
ArticleModel && ArticleModel.tags && ( _ae_tag ).setFlags( ArticleModel.tags );
|
||||
}
|
||||
};
|
||||
|
||||
this.saveAndPublish = function ()
|
||||
@@ -461,7 +457,8 @@
|
||||
|
||||
_data.title = _title;
|
||||
_data.content = _content;
|
||||
_data.tags = _ae_tag.getFlags();
|
||||
_data.tags = plugins.getData( "tags" );
|
||||
_data.section = plugins.getData( "section" );
|
||||
|
||||
postData( processorSet, _data, publishSuccess.bind({ contentUpdate: true }), serverFailed );
|
||||
}
|
||||
|
@@ -153,7 +153,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
this.getSetData = function ( data )
|
||||
this.getData = function ()
|
||||
{
|
||||
// Compile flag list
|
||||
var tlist = [];
|
||||
@@ -165,7 +165,7 @@
|
||||
tlist[tlist.length] = flags[i].lastChild.nodeValue;
|
||||
}
|
||||
|
||||
data[ this.id ] = tlist.join("\n");
|
||||
return tlist.join("\n");
|
||||
}
|
||||
|
||||
this.setForView = function ( flagList )
|
||||
|
Reference in New Issue
Block a user