Commits

reorx committed cbd1aa7

certify..euri

Comments (0)

Files changed (27)

Binary file added.

 from django.contrib import admin
 from default.models import *
 
+admin.site.register(ContentNote)
+admin.site.register(ContentPart)
 admin.site.register(Knowledge)
 admin.site.register(Category)
 

Binary file modified.

Add a comment to this file

default/knowledge/.urls.py.swp

Binary file added.

Add a comment to this file

default/knowledge/.views.py.swp

Binary file added.

Add a comment to this file

default/knowledge/query/.get.py.swp

Binary file added.

Add a comment to this file

default/knowledge/query/.set.py.swp

Binary file added.

default/knowledge/query/get.py

     print 'in certify'
     certify = True
     ##
-    if Knowledge.objects.filter(title=d.title):
+    if Knowledge.objects.filter(title=d.title): # unallow title to be the same
         certify = False
     if d.parent != '':
         try: Knowledge.objects.get(title=str(d.parent))
         except: certify = False
-    if d.brother != '':
-        try: Knowledge.objects.get(title=d.brother)
-        except: certify = False
     return certify
 
 
 def knowledge_all():
     return Knowledge.objects.all()
 
+def knowledge_full(k_id):
+    k = knowledge(k_id)
+    # get content
+    k.contents_reset = []
+    cs = k.contents.all()
+    if not cs:
+        k.contents_reset = False
+    else:
+        for c in cs:
+            # pretreatment for ContentPart
+            ns = c.notes.all()
+            c.notes_reset = []
+            if not ns:
+                c.notes_reset = False
+            else:
+                for n in ns:
+                    c.notes_reset.append(n)
+            ##
+            k.contents_reset.append(c)
+    # get refer
+    if not k.refer:
+        k.refer_reset = 'no reference'
+    else:
+        class r: pass
+        r.name = k.refer_resource
+        r.brief = refer_brief(r.name)
+        r.url = refer_url(r.name,r.id)
+        k.refer = r
+    # done
+    return k
+
+
+    # get refer
+
 def knowledge_category_tree(c_id):
     def iteTree(p,m,i):
         for k in p:
     print '1'
     c = Category.objects.get(id=c_id)
     print '2'
-    roots = Knowledge.objects.filter(category=c,parents=None)
+    roots = Knowledge.objects.filter(category=c,parent=None)
     M = '<div>'
     M = iteTree(roots,M,0)
     M += '</div>'
     parent = Knowledge.objects.get(id=parent_id)
     return parent.itsChildren
 
-def tips(k_id):
-    tips = Knowledge.objects.get(id=int(k_id)).tips.all()
-    if not tips: tips = 'nothing'
-    return tips
 ## ajax ##
 def knowledge_title_search(c_id,t):
     c = category(c_id)
Add a comment to this file

default/knowledge/query/get.pyc

Binary file modified.

default/knowledge/query/set.py

 from my_PIGS.default.models import *
 
 def create_basic(d):
+    print d.a_content
+    content0 = ContentPart(
+        content=d.a_content
+    )
+    content0.save()
+    print 'c save'
+    ##
     knowledge = Knowledge(
-        category=Category.objects.get(id=int(d.category)),
+        category=Category.objects.get(id=int(d.category_id)),
         title=d.title,
         brief=d.brief,
-        content=d.content,
     )
     knowledge.save()
-    if d.parent or d.brother:
+    print 'k save'
+    ##
+    knowledge.contents.add(content0)
+    print 'add it'
+    if d.parent!='':
+        print 'h par'
         p = Knowledge.objects.filter(title=d.parent)
-        b = Knowledge.objects.filter(title=d.brother)
-        if p:
-            knowledge.parents.add(p.get())
-        if b:
-            knowledge.brothers.add(b.get())
+        knowledge.parents.add(p.get())
     return knowledge.id
 
 def change(d):
     print 'in change'
     knowledge = Knowledge.objects.get(id=int(d.id))
     print 'get k'
-    # change #
-    knowledge.category=Category.objects.get(id=int(d.category))
+    # change # # ( no refer yet )
     knowledge.title=d.title
     knowledge.brief=d.brief
     knowledge.content=d.content
+    ##
     knowledge.parents.clear()
     if d.parent!='':
-        print 'p cl ed'
-        print d.parent
         p = Knowledge.objects.filter(title=d.parent)
-        if p:
-            knowledge.parents.add(p.get())
-    if d.brother!='':
-        knowledge.brothers.clear()
-        b = Knowledge.objects.filter(title=d.brother)
-        if b:
-            knowledge.brothers.add(b.get())
+        knowledge.parents.add(p.get())
     knowledge.save()
     return knowledge.id
 
Add a comment to this file

default/knowledge/query/set.pyc

Binary file modified.

default/knowledge/urls.py

 
 urlpatterns = patterns('',
     (r'^$', index),
-    (r'^infoarea_knowledgelist/', infoarea_knowledgelist),
-    (r'^infoarea_category/', infoarea_category),
+    #page request
+    (r'^view_k_list/', view_k_list),
+    (r'^view_category/', infoarea_category),
     (r'^content_knowledge/', content_knowledge),
     #editor
     (r'^editor_contentpart/', editor_contentpart),
     (r'^change/', create_or_change),
     (r'^delete/', delete),
     #ajax
+    (r'^ajax_certify/', ajax_certify),
     (r'^ajax_parent/', ajax_parent),
     #tip
     (r'^add_tip/', add_tip),
Add a comment to this file

default/knowledge/urls.pyc

Binary file modified.

default/knowledge/views.py

 from django.template.loader import get_template
 #from django.contrib.auth.decorators import permission_required
 
-from my_PIGS.default.models import TimeInfo,Category,Knowledge,Tip,Quickwrite
+from my_PIGS.default.models import *
 
 # query #
 from query import get as get_k
         k.brother_reset = ''
     return k
 
-# knowledge #
-def create_or_change(request):
-    print 'in cc'
+def getData(request):
     class d: pass
-    d.id =request.POST.get('id')
-    d.category = request.POST.get('category')
+    d.id =request.POST.get('id') # exist is to change
+    d.category_id = request.POST.get('category_id')
     d.title = request.POST.get('title')
     d.brief = request.POST.get('brief')
-    d.content = request.POST.get('content')
+    d.a_content = request.POST.get('a_content') # to ContentPart
+    ##
     d.parent = request.POST.get('parent')
-    d.brother = request.POST.get('brother')
-    case = (d.category!='' and d.title!='' and d.brief!='' and d.content!='')
+    d.refer = request.POST.get('refer') # exist is to clear relationship
     ####
-    certify = get_k.certify(d)
-    ####
-    if d.id!='': #change
-        print 'change'
-        print d.parent
-        k_id = set_k.change(d)
-    else: #create
-        if case:
-            print 'create'
-            k_id = set_k.create_basic(d)
-        else:
-            k_id = 'crash'
-    return HttpResponse(k_id)
+    return d
 
-def delete(request):
-    k_id = request.GET.get('knowledge_id')
-    return HttpResponse(set_k.delete(k_id))
-# main #
+# index #
 def index(request):
     category_list = get_k.category_all()
     return render_to_response('knowledge/base.html',{
         context_instance=RequestContext(request)
     )
 
-def infoarea_knowledgelist(request):
+# knowledge #
+def create_or_change(request):
+    print 'in cc'
+    d = getData(request)
+    #certify = get_k.certify(d)
+    ####
+    if d.id!='': #change
+        print 'change'
+        print d.parent
+        k_id = set_k.change(d)
+    else: #create
+        print 'create'
+        k_id = set_k.create_basic(d)
+    return HttpResponse(k_id)
+
+def add_content(request):
+    print '...'
+
+def edit_content(request):
+    print '...'
+
+def delete_content(request):
+    print '...'
+
+def delete(request):
+    k_id = request.GET.get('knowledge_id')
+    return HttpResponse(set_k.delete(k_id))
+
+# page request #
+def view_k_list(request):
     c_id= int(request.GET.get('category'))
     t = 'knowledge/infoarea_knowledgelist.html'
     c = {
 
 def content_knowledge(request):
     k_id = int(request.GET.get('knowledge'))
-    knowledge = get_k.knowledge(k_id)
-    knowledge.tips_reset = get_k.tips(k_id)
+    knowledge = get_k.knowledge_full(k_id)
     t = 'knowledge/content_knowledge.html'
     c = {
-        'knowledge' : knowledge,
+        'k' : knowledge,
     }
     return (ajax_response(t,c))
 
         html += ('<div class="search_result">'+k.title+'</div>')
     return  HttpResponse(html)
 
+def ajax_certify(request):
+    d = getData(request)
+    status = get_k.certify(d)
+    return HttpResponse(status)
+
 def add_tip(request):
     k_id = request.GET.get('knowledge_id')
     c = request.GET.get('content')
Add a comment to this file

default/knowledge/views.pyc

Binary file modified.

default/models.py

     class Meta:
         abstract = True
 
-#Category in Knowledge
 class Category(models.Model):
     name = models.CharField(max_length=20, null=True)
     description = models.TextField(null=True)
 
     class Meta:
         verbose_name = u'Category'
-        verbose_name_plural = u'Cs'
+        verbose_name_plural = u'Categorys'
 
-#global
-class Tip(TimeInfo):
+class ContentNote(TimeInfo):
     content = models.TextField(null=False)
-    #linktoTable = models.CharField(max_length=50, null=False)
-    #linktoId = models.IntegerField(max_length=20, null=False)
 
     def __unicode__(self):
-        return self.id
+        return u'%s' %(self.id)
+
+class ContentPart(TimeInfo):
+    content = models.TextField(null=False)
+    notes = models.ManyToManyField(ContentNote, related_name='inContent', null=True, blank=True)
+
+    def __unicode__(self):
+        return u'%s' %(self.id)
 
     class Meta:
-        verbose_name = u'Tip'
-        verbose_name_plural = u'Tips'
-        #permissions = (
-            #('can_arrange', 'can arrange'),
-        #)
+        verbose_name = u'ContentPart'
+        verbose_name_plural = u'Contents'
 
+class Refer(models.Model):
+    resource_name = models.CharField(max_length=50, null=True, blank=True)
+    resource_id = models.IntegerField()
+
+    def __unicode__(self):
+        return u'%s' %(self.id)
+
+    class Meta:
+        verbose_name = u'Refer'
+        verbose_name_plural = u'Refers'
 ##########
 ## main ##
 ##########
     category = models.ForeignKey(Category, null=False)
     title = models.CharField(max_length=50, null=False)
     brief = models.TextField(null=False)
-    content = models.TextField(null=False)
-
-    parents = models.ManyToManyField('self', related_name='itsChildren', symmetrical=False, null=True, blank=True)
-    brothers = models.ManyToManyField('self', related_name='itsBrothers', null=True, blank=True)
-    tips = models.ManyToManyField(Tip, related_name='inKnowledge', null=True, blank=True)
+    contents = models.ManyToManyField(ContentPart, related_name='inKnowledge',null=True, blank=True)
+    # extend #
+    refer = models.ForeignKey(Refer, null=True, blank=True)
+    parent = models.ManyToManyField('self', related_name='itsChildren', symmetrical=False, null=True, blank=True)
+    ## of no use
+    #content = models.TextField(null=False)
+    #brothers = models.ManyToManyField('self', related_name='itsBrothers', null=True, blank=True)
+    #tips = models.ManyToManyField(Tip, related_name='inKnowledge', null=True, blank=True)
 
     def __unicode__(self):
         return (self.category.name + ':' + str(self.id))
 
     class Meta:
-        verbose_name = u'Knowledge of Infomation'
-        verbose_name_plural = u'KIs'
+        verbose_name = u'Knowledge'
+        verbose_name_plural = u'Knowledges'
         #permissions = (
             #('can_arrange', 'can arrange'),
         #)

Binary file modified.

static/knowledge/css/base.css

     position: absolute;
     left: 0px;right: 0px;top: 0px;bottom: 0px;
 }
-#infoInList {
+#View_area {
     position: absolute;
     left: 0px;right: 0px; top: 31px /*#OperateArea->height*/; bottom: 0px;
 }
-#InfoArea {
+#View {
     position: absolute;
     left: 0px;right: 0px;top: 5px;bottom: 10px;
     background: #fff;

static/knowledge/css/editor.css

     left: 0px;right: 0px;top: 30px;bottom: 0px;
 }
 /* Wrap */
-#InputTitle_wrap, #InputBrief_wrap, #InputParent_wrap, #InputBrother_wrap
+#InputTitle_wrap, #InputBrief_wrap, #InputParent_wrap, #InputRefer_wrap
 {
     width: 199px;float:left;
     border-bottom: 1px solid #000;
 {
     height: 40px
 }
-#InputParent_wrap,#InputBrother_wrap {
-}
 #Tips_wrap {
     float: left;
     position: relative;
 .briefStandout{ height: 100px; }
 .parentLite { height: 40px; }
 .parentStandout { height: 200px; }
-.brotherLite { height: 40px; }
-.brotherStandout { height: 200px; }
+.referLite { height: 40px; }
 /**/
 #InputContent {
     font-size: 13px; color: #a83;
 }
 #InputParent {
 }
-#InputBrother {
-}
-#InputParent_ajax,#InputBrother_ajax {
+#InputParent_ajax {
     position: absolute;
     left:10px;top: 30px;
     width: 120px;

static/knowledge/js/base.js

 var AREA = {};
 var KNOWLEDGE = {};
 var INPUT = {};
+var OTHER = {};
 AREA.ifKMshow = 'false';
 // document //
 // calling fuction //
     loading_on();
 }
 // main operate //
-function InfoArea_Category(id) {
+function View_Category(id) {
     if (Boolean(id)) {
         KNOWLEDGE.category_id = id;
     } else {
     }
     $.ajax({
         type: 'GET',
-        url: '/knowledge/infoarea_category/?category='+id,
+        url: '/knowledge/view_category/?category='+id,
         success: function(html) {
-            AREA.info.html(html); // show info
+            AREA.view.html(html); // show info
             if(AREA.operate_category.css('display')=='none'){ AREA.operate_category.show('500'); } //change operate area
         }
     });
 }
-function InfoArea_KnowledgeList() {
+function View_KnowledgeList() {
     id = KNOWLEDGE.category_id;
-    var url = '/knowledge/infoarea_knowledgelist/?category='+id;
-    var DOM = '#InfoArea';
+    var url = '/knowledge/view_k_list/?category='+id;
+    var DOM = '#View';
         $.ajax({
             type: 'GET',
             url: url,
     var DOM = '#Content_Main';
     ajax_get(url,DOM);
 }
+function Extend_Blank() {
+    $('#contentExtend').html('');
+}
 function Content_AddPage(mode) {
     var url = '/knowledge/editor_contentpart/'
     var DOM1 = '#Content_Main';
         // Knowledge
         KNOWLEDGE.id = '';
         //_Area
-        AREA.info = $('#InfoArea');
+        AREA.view = $('#View');
         AREA.operate_category = $('#operate_category');
         AREA.k_menu_status = 0;
     // css relay //

static/knowledge/js/pigs.editor.js

 function Get() {
     var d = {};
     d.id=KNOWLEDGE.id;
-    d.category = KNOWLEDGE.category_id;
+    d.category_id = KNOWLEDGE.category_id;
     d.title = $('#InputTitle').val();
     d.brief = $('#InputBrief').val();
-    d.content = $('#InputContent').val();
+    //
+    d.a_content = $('#InputContent').val();
     d.parent = $('#InputParent').val();
-    d.brother = $('#InputBrother').val();
+    //d.refer = '';
     return d;
 }
     // sql //
     }
 }
 
-function Create() {
+function CC() {
     var d = Get();
-    loading_on('submiting');
-    $.ajax({
-        type: 'POST',
-        url: '/knowledge/create/',
-        data: 'category='+d.category+'&title='+d.title+'&brief='+d.brief+'&content='+d.content+'&parent='+d.parent+'&brother'+d.brother+'&id=',
-        success: function(id){
-            if (id=='false') {
-                loading_on('typing error');
-            } else {
-                afterCreate(id);
-            }
-        }
-    });
-}
-function Change() {
-    var d = Get();
-    loading_on('changing');
+    loading_on('CCing');
     $.ajax({
         type: 'POST',
         url: '/knowledge/change/',
-        data: 'category='+d.category+'&title='+d.title+'&brief='+d.brief+'&content='+d.content+'&parent='+d.parent+'&brother'+d.brother+'&id='+d.id,
+        data: 'category_id='+d.category_id
+              +'&title='+d.title
+              +'&brief='+d.brief
+              +'&a_content='+d.a_content
+              +'&parent='+d.parent
+              +'&id='+d.id,
         success: function(id){
-            if (id=='false') {
-                loading_on('typing error');
+            if (OTHER.submit_button == 'create') {
+                afterCreate(id);
             } else {
                 afterChange(id);
             }
 
 /* handler */
 function afterCreate(id) {
-    loading_on(id);
     KNOWLEDGE.id = id;
     KNOWLEDGE.ifcreated = 'true';
-    InfoArea_KnowledgeList();
-    $('#Submit')
-        .unbind()
-        .html('save?').css({'text-decoration':'line-through'});
-    $('#Tips_wrap')
-        .show();
+    ////
+    loading_on(id+' created');
+    View_KnowledgeList();
+    Content_Knowledge(id);
+    Extend_Blank();
 }
 function afterChange(id) {
     loading_on(id);
     InfoArea_KnowledgeList(); //in base.js, in level, it's global function
     $('#Submit').html('Saved').unbind();
 }
+function toCertify() {
+    $('#Submit').html('Certify~')
+                .click(function(){
+                    certify_onblur();
+                });
+}
 function toSave() {
     $('#Submit')
         .html('save?')
         .css({'text-decoration':'none'})
         .unbind()
         .click(function(){
-            Change();
-        })
+            CC();
+        });
+    OTHER.submit_button = 'save';
 }
 function toCreate() {
     $('#Submit')
-        .html('Create')
+        .html('Create?')
         .css({'text-decoration':'none'})
         .unbind()
         .click(function(){
-            Create();
-        })
+            CC();
+        });
+    OTHER.submit_button = 'create';
 }
 
 /* certify */
-function certifyMain() {
-    var t = $('#InputTitle').val();
-    var b = $('#InputBrief').val();
-    var c = $('#InputContent').val();
-    loading_on(t+'/'+b+'/');
+function certify_onkeyup() {
+    var d = Get();
     if (KNOWLEDGE.ifcreated == 'false')
     {
-        if (t!='' && b!='' && c!='') { toCreate(); }
+        if (d.title!='' && d.brief!='' && d.a_content!='') { toCertify();AREA.sb = 'create'; }
         else
         {
             $('#Submit')
     }
     else
     {
-        if (t!='' && b!='' && c!='') { toSave(); }
+        if (d.title!='' && d.brief!='' && d.a_content!='') { toCertify();AREA.sb = 'save' }
         else
         {
             $('#Submit')
         };
     }
 }
+function certify_onblur() {
+    var d = Get();
+    $.ajax({
+        type: 'POST',
+        url: '/knowledge/ajax_certify/',
+        data: '&title='+d.title
+              +'&brief='+d.brief
+              +'&a_content='+d.a_content
+              +'&parent='+d.parent,
+        success: function(status){
+            if (status=='True') {
+                if (AREA.sb = 'create') {
+                    toCreate();
+                } else {
+                    toSave();
+                }
+            } else {
+                loading_on('mistake');
+            }
+        }
+    });
+}
 function certifyParentBrother() {
     var t = $('#InputTitle').val();
     var b = $('#InputBrief').val();
     }
 }
     // click-dilation //
+$('#InputTitle').bind({
+    blur: function(){
+    },
+});
 $('#InputBrief').bind({
     focus: function(){
         extendUI('briefB');
         extendUI('N');
     },
 });
-$('#InputBrother').bind({
-    focus: function(){
-        extendUI('bB');
-    },
-    blur: function(){
-        $(this).parent().children().eq(1).css({'display':'none'});
-        extendUI('N');
-    },
-});
     // tip //
 $('#TipsAddButton').click(function(){
     var clear = $(this).parent().find('.clearfix');

templates/knowledge/base.html

                 <a href="#knowledge" class="NavButton">K</a>
                 <div class="NavTags" style="z-index:1;">
                     {% for category in category_list %}
-                        <a href="#{{ category.name }}" id="" class="Tag Button_RB" onclick="InfoArea_Category({{ category.id }})">{{ category.name }}</a>
+                        <a href="#{{ category.name }}" id="" class="Tag Button_RB" onclick="View_Category({{ category.id }})">{{ category.name }}</a>
                     {% endfor %}
                     <a id="Manage_category" href="#" class="Tag Button_RB">M</a>
                 </div>
     <div id="Control">
         <div id="operateInList">
             <div id="operate_category" class="operateInList" style="display: none">
-                <a id="entrylist_show" class="OperateButton Button_RS" onclick="InfoArea_KnowledgeList()">Tree</a>
-                <a href="#" id="" class="OperateButton Button_RS" onclick="InfoArea_Category();">Profile</a>
+                <a id="entrylist_show" class="OperateButton Button_RS" onclick="View_KnowledgeList()">Tree</a>
+                <a href="#" id="" class="OperateButton Button_RS" onclick="View_Category();">Profile</a>
                 <a href="#" id="page_entry_add" class="OperateButton Button_RS" onclick="Content_AddPage('multiple');">Add</a>
                 <!--
                 <a href="#" id="" class="OperateButton Button_RS" onclick="">Organize</a>
                 -->
             </div>
         </div>
-        <div id="infoInList">
-            <div id="InfoArea">
+        <div id="View_area">
+            <div id="View">
             </div>
         </div>
     </div>

templates/knowledge/content_knowledge.html

 {% load markup %}
 
 <div>
-    <h2>content</h2>
-    {{ knowledge.content|markdown }}
-    <h2>tips</h2>
-    {% ifnotequal knowledge.tips_reset 'nothing' %}
-        {% for tip in knowledge.tips_reset %}
-            {{ tip.content }}
+    <div>
+    {{ k.title }}
+    </div>
+    <div>
+    {{ k.dtime }}
+    </div>
+    {{ k.brief }}
+    <div>
+    {% if k.contents_reset %}
+        {% for c in k.contents_reset %}
+            {{ c.content }}
+            {% if c.notes_reset %}
+                {% for n in c.notes_reset %}
+                    {{ n.content }}
+                {% endfor %}
+            {% else %}
+                nothing add?
+            {% endif %}
         {% endfor %}
     {% else %}
-        no tips..
-    {% endifnotequal %}
+        nothing create?
+    {% endif %}
+    </div>
+
 </div>
 
 <!--

templates/knowledge/edit_page.html

-<div id="Content_inner" >
-
-    <label for="">category:{{ k.category_reset }}</label>
-    <br />
-    <div class="InputContainer">
-        <input id="InputTitle" class="InputArea_size0 inputs input_basic" type="text" placeholder="Title" value="{{ k.title }}" />
-        <input id="InputBrief" class="InputArea_size1 inputs input_basic" type="text" placeholder="Brief" value="{{ k.brief }}"/>
-            <div id="InputContent_wrap">
-                <textarea id="InputContent" class="inputs input_basic" name="" rows="10" cols="50" placeholder="Content">{{ k.content }}</textarea>
-            </div>
-            <div class="clearfix"></div>
-            <div id="InputParent_wrap">
-                <input id="InputParent" class="InputArea_size0 inputs input_ajax" type="text" placeholder="Parent" value="{{ k.parent_reset }}" />
-                <div id="InputParent_ajax" style="display: none;"></div>
-            </div>
-            <div id="InputBrother_wrap">
-                <input id="InputBrother" class="InputArea_size0 inputs input_ajax" type="text" placeholder="Brother" value="{{ k.brother_reset }}" />
-                <div id="InputBrother_ajax" style="display: none;"></div>
-            </div>
-            <div id="Submit_wrap">
-                <a id="Submit" href="#submit" class="ButtonSubmit"></a>
-            </div>
-            <div class="clearfix"></div>
-    </div>
-    <!--*****************-->
-    <div id="Tips_wrap" >
-        <a id="TipsAddButton" class="ButtonAddTips" href="#" >add a tip</a>
-        <div style="height: 180px;width: 1px;float: left;"></div>
-        {% for tip in k.tips_reset %}
-            <div class="tip">
-                <textarea class="InputTip InputArea_size2" name="" rows="6" cols="10">
-                    {{ tip.content }}
-                </textarea>
-            </div>
-        {% endfor %}
-        <div class="clearfix"></div>
-    </div>
-</div>
-
-<div id="tip_model" class="tip" style="display: none;">
-    <textarea class="InputTip InputArea_size2" name="" rows="6" cols="10"></textarea>
-</div>
-
-<!--*****************-->
-<script src="/static/js_lib/mark-it-up.js" type="text/javascript"></script>
-<script src="/static/js_lib/mark-it-up.settings.js" type="text/javascript"></script>
-<script src="/static/knowledge/js/pigs.editor.js" type="text/javascript"></script>
-<script type="text/javascript">
-/***edit.init.js***/
-$('#Submit').html('save?').css({'text-decoration':'none'});
-$('#InputParent').bind({
-    keyup: function(){
-        var inputArea = $(this);
-        var showArea = $(this).parent().children().eq(1);
-        searchParent(inputArea,showArea,KNOWLEDGE.id);
-    },
-    blur: function(){
-        $(this).parent().children().eq(1).css({'display':'none'});
-    },
-});
-$('.input_basic').bind({
-    'keyup change': function(){
-        certify_save();
-    },
-});
-$('.input_ajax').bind({
-    'change': function() {
-        certify_save();
-    },
-});
-</script>

templates/knowledge/editor_extendpart.html

     <div id="InputParent_ajax" style="display: none;"></div>
 </div>
 
-<div id="InputBrother_wrap" class="brotherLite">
-    <input id="InputBrother" class="input_ajax" type="text" placeholder="Brother" value="{{ k.brother_reset.title }}" />
-    <div id="InputBrother_ajax" style="display: none;"></div>
+<div id="InputRefer_wrap" class="referLite">
 </div>
 
 <div id="Tips_wrap" style="display: none;">
 
 $('.input_basic').bind({
     'keyup change': function(){
-        certifyMain();
+        certify_onkeyup();
     },
 });
 $('.input_ajax').bind({
     'change': function() {
-        certifyMain();
+        certify_onkeyup();
     },
 });
 </script>

templates/knowledge/infoarea_knowledgelist.html

 {{ html|safe }}
 <script type="text/javascript">
-    $('#InfoArea')
+    $('#View')
         .find('.knowledge')
             .each(function(){
                 var l = Number($(this).attr('level'));
                 })
             });
 
-    $('#InfoArea')
+    $('#View')
         .find('.k_MenuButton')
             .each(function(){
                 $(this).bind({
                 });
             });
 
-    $('#InfoArea')
+    $('#View')
         .find('.k_ToggleButton')
             .each(function(){
                 $(this).data('toggle','expand');

templates/knowledge/simple_add_page.html

-<div>
-        <div class="EntryContentEdit">
-
-            <label for="">category:{{ category.name }}</label>
-            <div class="InputBgWrap" style="display:none">
-                <div id="InputCategory" class="InputArea_size0" contenteditable="false"></div>
-            </div>
-            <br />
-            <label for="">title</label>
-            <div class="InputBgWrap">
-                <div id="InputTitle" class="InputArea_size1" contenteditable="true" lineLimit="5" textLimit="3"></div>
-            </div>
-            <label for="">brief</label>
-            <div class="InputBgWrap">
-                <div id="InputBrief" class="InputArea_size2" contenteditable="true" lineLimit="5" textLimit="3"></div>
-            </div>
-            <label for="">content</label>
-            <div class="InputBgWrap">
-                <div id="InputContent" class="InputArea_size3" contenteditable="true" lineLimit="5" textLimit="3"></div>
-            </div>
-            {% ifequal ifneed_b 1 %}
-            <label for="">Brother(s)</label>
-                <div class="InputBgWrap2">
-                    <a id="x" href="#" class="x">relate brother</a>
-                </div>
-            {% endifequal %}
-            <label for="">Tips</label>
-            <div class="InputBgWrap2">
-                <a id="x" href="" class="x">add a tip</a>
-            </div>
-            <!--*****************-->
-            <a id="Submit_Entry" href="#submit_entry" class="ButtonSubmit">Submit</a>
-
-        </div>
-
-<script type="text/javascript">
-    // charge to show brother-adding-area //
-    // keypress event of edit frame //
-    var keyCount = 0;
-    var textCount = 1;
-    $('#InputCategory').keydown(function(){
-            textCount = $(this).text().length;
-            keyCount = keyCount+1;
-            var textLimit = Number($(this).attr('textLimit'));
-            var charge = textCount%textLimit;
-
-            loading_on();
-            if ( charge == 0) {
-                $('#loading').html('should c l');
-            } else {
-                $('#loading').html('textCount:'+textCount+' % textLimit:'+textLimit);
-            }
-    });
-    // submit button //
-    $('#Submit_Entry').bind({
-        click: function() {
-            loading_on('submiting');
-            var d = {};
-            d.category = KNOWLEDGE.category_id
-            d.title = $('#InputTitle').html();
-            d.brief = $('#InputBrief').html();
-            d.content = $('#InputContent').html();
-            d.parent = KNOWLEDGE.parent_id;
-            d.brother = KNOWLEDGE.brother_id;
-            d.tips = ''//KNOWLEDGE.tips_ids;
-            alert(
-                     'category='+d.category
-                    +'&title='+d.title
-                    +'&brief='+d.brief
-                    +'&content='+d.content
-                    +'&parent='+d.parent
-                    +'&brother='+d.brother
-                    +'&tips='+d.tips
-                    );
-            $.ajax({
-                type: 'POST',
-                url: '/knowledge/add_knowledge/',
-                data: 
-                     'category='+d.category
-                    +'&title='+d.title
-                    +'&brief='+d.brief
-                    +'&content='+d.content
-                    +'&parent='+d.parent
-                    +'&brother='+d.brother
-                    +'&tips='+d.tips
-                    ,
-                success: function(status){
-                    loading_on(status);
-                    InfoArea_KnowledgeList();
-                }
-            });
-        },
-    });
-</script>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.