PageSourceSearch

https://pic.iyingdi.com/yingdi_pc_old/prod/js/contribute/web.contribute.create.js?v=20181018

js iyingdi.com collected 2026-09-24 17:43:26 UTC 38,231 bytes, 694 lines download raw bytes

1/**
2 * @file web.contribute.create.js
3 * @author lixiaodi
4 * @desc 普通用户创作草稿内容
5 */ 
6web.contribute.create = (function(){
7    var transTime = function(time,style){
8		var style = style || '2';
9		if (/^(-)?\d{1,10}$/.test(time)) {
10			time = time * 1000;
11		} else if (/^(-)?\d{1,13}$/.test(time)) {
12			time = time * 1;
13		} else {
14			return;
15		}
16		var date=new Date(time),
17			date_year=date.getFullYear(),
18			date_month='0'+(date.getMonth()+1),
19			date_day='0'+date.getDate(),
20			date_hour=('0'+date.getHours()).substr(-2,2),
21			date_minute=('0'+date.getMinutes()).substr(-2,2),
22			date_second=('0'+date.getSeconds()).substr(-2,2);
23
24		if(style=='1'){
25		    /*2018年9月8日 08:30*/
26			return date_year+'年'+date_month.substring(date_month.length-2)+'月'+date_day.substring(date_day.length-2)+"日 "+date_hour+":"+date_minute;
27		}else if(style=='2'){
28            /*2018.09.01*/
29			return date_year+'.'+date_month.substring(date_month.length-2)+'.'+date_day.substring(date_day.length-2)+' '+date_hour+":"+date_minute;
30        }
31        else if(style==3){
32            /*03:00 分:秒*/ 
33			return date_minute+':'+date_second;
34        }
35    };
36
37    var getPage = {
38        data:{
39            editor_func_arr:['textEdit','imageEdit','videoEdit','audioEdit','deckInsert'],
40            max_size_img:10,
41            autoSaveTime:180000,
42            clazzTagData:[],
43            default_cover: 'https://wspic.iyingdi.com/yingdiWeb/images/contribute/uploadcoverImg.png',
44        },
45        html:function(){
46            var page_html = String()
47                +'<div class="contribute-create-page">'
48                    +'<div class="contribute-create-frame">'
49                        +'<div class="left-frame">'
50                            +'<div class="operate-item">'
51                                +'<button id="publish_draft" class="publish-btn">发布</button>'
52                            +'</div>'
53                            +'<div class="operate-item">'
54                                +'<button id="save_draft" class="save-btn">保存草稿</button>'
55                            +'</div>'
56                            +'<div id="must_know" class="must-know-btn">点击查看投稿须知</div>'
57                            +'<div class="auto-save-tip">'
58                                +'<div>自动保存 <span id="next_save_distance">3:00</span></div>'
59                                +'<div>上次保存时间:<br/><span id="last_save_time"></span></div>'
60                            +'</div>'
61                            +'<a class="goto-oldversion" style="display:block;margin-bottom:10px;" target="_blank" href="/web/personal/own/myCreated">前往草稿箱 >></a>'
62                            +'<a class="goto-oldversion" target="_blank" href="/web/contribute/list">前往旧版投稿平台 >></a>'
63                        +'</div>'
64                        +'<div class="right-frame">'
65                            +'<div class="muti-image-area"></div>' 
66                            +'<div id="upload_cover" class="cover-area">'
67                                +'<img id="cover_img" src="'+getPage.data.default_cover+'">'
68                            +'</div>'
69                            +'<div class="title-area">'
70                                +'<textarea id="draft_title" maxlength="35" placeholder="请输入标题(最多不超过35个字)"></textarea>'
71                            +'</div>'
72                            +'<div class="draft-content-edit"></div>'
73                        +'</div>'
74                    +'</div>'
75                +'</div>';
76            return page_html;
77        },
78        initFunc:function(){// 创建草稿初始化函数
79            var edit_data = web.editor.getEditorData();
80            web.editor.initModule($('.draft-content-edit'),edit_data,getPage.data.editor_func_arr);
81            getPage.mutiImageInit();
82
83            var end_time = (new Date().getTime()/1000) + (getPage.data.autoSaveTime/1000);
84            $('#next_save_distance').attr('data-endtime', end_time);
85            getPage.countDown();
86            getPage.autoSave();
87        },
88        modifyInitFunc:function(){// 编辑修改已有草稿初始化函数
89            var draft_id = getPage.getDraftId(), token = web.user.getUser('token');
90            $('#save_draft').addClass('hasCreated');
91            $('#save_draft').attr('data-id', draft_id);
92            $.get(web.hostMap.host_pre+'bbsplus/contribute/get',{token:token,id:draft_id},function(data){
93                if(data.success){
94                    var draft_data = data.contribute;
95                    $('#draft_title').val(draft_data.title);
96                    if(draft_data.cover&&draft_data.cover!=''){
97                        $('#cover_img').attr('src',draft_data.cover);
98                    }
99                    var edit_data = JSON.parse(draft_data.contents);
100                    web.editor.initModule($('.draft-content-edit'),edit_data,getPage.data.editor_func_arr);
101                    getPage.mutiImageInit();
102
103                    var end_time = (new Date().getTime()/1000) + (getPage.data.autoSaveTime/1000);
104                    $('#next_save_distance').attr('data-endtime', end_time);
105                    getPage.countDown();
106                    getPage.autoSave();
107                }
108            });
109        },
110        getDraftId:function(){
111            var url_arr = window.location.pathname.split('/');
112            return parseInt(url_arr[url_arr.length-1]);
113        },
114        getDraftData:function(){
115            // 获取稿件内容数据
116            var draft_data = {};
117            var title = $('#draft_title').val()||'';
118            var content = JSON.stringify(web.editor.getEditorData())||'';
119            draft_data = {
120                token: web.user.getUser('token'),
121                title:title,
122                contents:content,
123                typee:1,
124                version:parseInt(new Date().getTime()/1000)
125            };
126            var cover_img = $('#cover_img').attr('src');
127            if(cover_img!=''&&cover_img!=getPage.data.default_cover){
128                draft_data.cover = cover_img;
129            } else {
130                draft_data.cover = ''
131            }
132            return draft_data;
133        },
134        checkDraftData:function(){},
135        countDown:function(){
136            setTimeout(function(){
137                var end_time = parseInt($('#next_save_distance').attr('data-endtime'));
138                var curr_time = parseInt(Date.parse(new Date())/1000);
139                var diff_time=parseInt(end_time-curr_time);// 倒计时时间差
140                var h = Math.floor(diff_time / 3600);
141                var m = Math.floor((diff_time / 60 % 60));
142                var s = Math.floor((diff_time % 60));
143                $('#next_save_distance').html(m + ":" + s);
144                if (diff_time<=0) {
145                    $('#next_save_distance').html('3:00');
146                    var endTime = (new Date().getTime()/1000) + (getPage.data.autoSaveTime/1000);
147                    $('#next_save_distance').attr('data-endtime', endTime);
148                }
149                else{
150                    getPage.countDown();
151                }
152            }, 1000);
153        },
154        uploadCoverClick:function(){
155            var img_url = $('#cover_img').attr('src');
156            var upload_img_html = String()
157                +'<div class="upload-coverImg-show" style="width:720px;margin:0 auto">'
158                    +'<img src="'+img_url+'" style="width:100%;" id="uploadImgCrop">'
159                +'</div>'
160                '<div class="upload-cover-img" style="margin-top:15px;text-align:center;">'
161                    +'<button id="upload_cover_img" style="border:1px solid #3b68b8;border-radius:3px;width:130px;height:28px;font-size:14px;color:#3b68b8;background-color:white;cursor:pointer;">上传新图</button>'
162                +'</div>';
163
164            web.modalFrame.showUploadImgModal({
165                title:'上传/修剪封面图片',
166                radio_width:720,
167                radio_height:410,
168                show_width:720,
169                show_height:410,
170                imgUrl:img_url,
171                confirm_function:function(param){
172                    $('#cover_img').attr('src',param.imgUrl);
173                    web.modalFrame.closeUploadImgModal();
174                },
175            });
176        },
177        saveDraftClick:function(callback){
178            // 保存草稿
179            var draft_data = getPage.getDraftData();
180            if(draft_data.contents == '[]'){
181                web.utility.showBasicPrompt({
182                    style:'alert-error',
183                    content:'内容不能为空'
184                });
185                return false;
186            }
187            if($('#save_draft').hasClass('hasCreated')){
188                // 更新草稿
189                draft_data.id = parseInt($('#save_draft').attr('data-id'));
190                $.post(web.hostMap.host_pre+'bbsplus/contribute/update',draft_data,function(data){
191                    if(data.success){
192                        web.utility.showBasicPrompt({
193                            style:'alert-success',
194                            content:'保存成功!草稿可在个人中心草稿箱内查看'
195                        });
196                        $('#last_save_time').html(transTime(data.contribute.version));
197                        getPage.countDown();
198                        if(callback){
199                            callback();
200                        }
201                    }
202                });
203            }
204            else{
205                // 创建草稿
206                $.post(web.hostMap.host_pre+'bbsplus/contribute/create',draft_data,function(data){
207                    if(data.success){
208                        $('#save_draft').attr('data-id',data.contribute.id);
209                        $('#save_draft').addClass('hasCreated');
210                        web.utility.showBasicPrompt({
211                            style:'alert-success',
212                            content:'保存成功!草稿可在个人中心草稿箱内查看'
213                        });
214                        $('#last_save_time').html(transTime(data.contribute.version));
215                        getPage.countDown();
216                        if(callback){
217                            callback();
218                        }
219                    }
220                });
221            }
222        },
223        autoSave:function(){
224            // 自动保存
225            setTimeout(function(){
226                getPage.saveDraftClick();                   
227                getPage.autoSave();
228            }, getPage.data.autoSaveTime)
229        },
230        publishDraftClick:function(){
231            var draft_data = getPage.getDraftData();
232            if (draft_data.cover === '') {
233                web.utility.showBasicPrompt({
234                    style:'alert-error',
235                    content:'请上传封面'
236                });
237                return false
238            }
239            if(draft_data.contents === '[]'){
240                web.utility.showBasicPrompt({
241                    style:'alert-error',
242                    content:'内容不能为空'
243                });
244                return false;
245            }
246            if(draft_data.title === ''){
247                web.utility.showBasicPrompt({
248                    style:'alert-error',
249                    content:'标题不能为空'
250                });
251                return false;
252            }
253            // 发布
254            var publish_html = String()
255                +'<div class="publish-draft-modal">'
256                    +'<ul class="label-clazz"></ul>'
257                    +'<ul class="label-list"></ul>'
258                    +'<div class="has-chosed">'
259                        +'<div>已选标签</div>'
260                        +'<ul class="chosed-list"></ul>'
261                    +'</div>'
262                +'</div>';
263            web.modalFrame.showModal({
264                title:'选择标签或直接发布',
265                content:publish_html,
266                confirm_button_name:'发布',
267                initialize_function:function(){
268                    getPage.getLabelData(0, getPage.getLabelDataCallback);
269                },
270                confirm_function:function(){
271                    if($('.chosed-list>li').length>5){
272                        web.utility.showBasicPrompt({
273                            style:'alert-error',
274                            content:'最多可打5个标签'
275                        });
276                        return false;
277                    }                            
278                    getPage.saveDraftClick(function(){
279                        var token = web.user.getUser('token');
280                        var draft_id = parseInt($('#save_draft').attr('data-id'));
281                        if(!draft_id||draft_id==''){
282                            web.utility.showBasicPrompt({
283                                style:'alert-error',
284                                content:'请先保存稿件再发布!'
285                            });
286                            return false;
287                        }
288                        if($('ul.chosed-list>li').length==0){
289                            web.utility.showBasicPrompt({
290                                style:'alert-error',
291                                content:'请选择稿件投放标签!'
292                            });
293                            return false;
294                        }
295                        var rstagids_arr = [];
296                        $('ul.chosed-list>li').each(function(){
297                            rstagids_arr.push($(this).attr('data-tagid'));
298                        });
299                        var rstagids = rstagids_arr.join(',')||'';
300                        var post_args = {
301                            token:token,
302                            id:draft_id,
303                            rstagids:rstagids,
304                        };
305                        $.post(web.hostMap.host_pre+'bbsplus/contribute/release',post_args,function(data){
306                            if(data.success){
307                                window.location.href = '/web/bbspost/detail/'+data.post.id;
308                            }
309                        })
310                    });
311                },
312            });
313        },
314        getLabelData:function(index, callback){
315            var label_category_html = '';
316            var label_list_html = '';
317            if(!index){
318                $.get(web.hostMap.host_pre+'rstagclazz/list',{rstag:1},function(data){
319                    if(data.success){
320                        var clazz_list = data.clazzTag;
321                        getPage.data.clazzTag = data.clazzTag;
322                        for(var n in clazz_list){
323                            label_category_html += String()
324                                +'<li class="'+(n==0?'active':'')+'" data-index="'+n+'" data-clazzid="'+clazz_list[n].tagclazz.id+'">'+clazz_list[n].tagclazz.title+'</li>'
325                        }
326                        $('ul.label-clazz').html(label_category_html);
327
328                        var rstags = clazz_list[0].rstags;
329                        for(var i in rstags){
330                            var tag_item = rstags[i];
331                            label_list_html += String()
332                                +'<li data-tagid="'+tag_item.id+'">'+tag_item.tag+'</li>';
333                        }
334                        $('ul.label-list').html(label_list_html);
335                        if(callback){
336                            callback();
337                        }
338                    }
339                });
340            }
341            else{
342                var rstags = [];
343                if(getPage.data.clazzTag[index]){
344                    rstags = getPage.data.clazzTag[index].rstags;
345                }
346                for(var i in rstags){
347                    var tag_item = rstags[i];
348                    label_list_html += String()
349                        +'<li data-tagid="'+tag_item.id+'">'+tag_item.tag+'</li>';
350                }
351                $('ul.label-list').html(label_list_html);
352                if(callback){
353                    callback();
354                }
355            }
356        },
357        getLabelDataCallback:function(){
358            $('.label-clazz>li').off().on('click',function(){
359                var label_index = $(this).attr('data-index');
360                getPage.getLabelData(label_index, getPage.getLabelDataCallback);
361                $(this).addClass('active').siblings().removeClass('active');
362            });
363
364            $('.label-list>li').off().on('click',function(){ 
365                var $this = $(this);
366                if(!$this.hasClass('chosed')){
367                    $this.addClass('chosed');
368                }
369                var tagid = $this.attr('data-tagid');
370                if(!$('.chosed-list>li[data-tagid='+tagid+']').length){
371                    var chosed_html = String()
372                    +'<li data-tagid="'+tagid+'">'
373                        +'<span>'+$this.html()+'</span>&nbsp;'
374                        +'<svg viewBox="0 0 14 14" class="remove-tag" width="10" height="10" aria-hidden="true" style="fill: rgb(128, 128, 128); height: 10px; width: 10px;">'
375                            +'<title></title>'
376                            +'<g>'
377                                +'<path d="M8.486 7l5.208-5.207c.408-.408.405-1.072-.006-1.483-.413-.413-1.074-.413-1.482-.005L7 5.515 1.793.304C1.385-.103.72-.1.31.31-.103.724-.103 1.385.305 1.793L5.515 7l-5.21 5.207c-.407.408-.404 1.072.007 1.483.413.413 1.074.413 1.482.005L7 8.485l5.207 5.21c.408.407 1.072.404 1.483-.007.413-.413.413-1.074.005-1.482L8.485 7z">'
378                                +'</path>'
379                            +'</g>'
380                        +'</svg>' 
381                    +'</li>';
382                    $('.publish-draft-modal .chosed-list').append(chosed_html);
383                    $('.remove-tag').off().on('click',function(){
384                        $(this).parent('li').remove();
385                    });
386                }
387            });
388        },
389        mutiUploadImg:function(event,index,$container){
390            //上传模块
391            var upload_img=event.target.files[index],
392                file_reader;
393            var img_type = upload_img.type;
394    
395            if(!upload_img){
396                return false;
397            }
398            else{
399                var upload_img_size = event.target.files[index].size;
400                if((upload_img_size/1024/1024)<=getPage.data.max_size_img){
401                    file_reader=new FileReader();
402                    file_reader.readAsDataURL(upload_img);
403                    file_reader.onload = function(event){
404                        $container.html('<span>正在上传...</span>');
405                        $.post(web.hostMap.host_pre+'file/upload/img/common',{token:web.user.getUser('token'),base64:event.target.result},function(data){
406                            var url = data.urls[0];
407                            if(img_type.split('/')[1].toLocaleLowerCase()=='gif'){
408                                $container.html('<div class="delete-image-one">删除</div><img data-size="'+upload_img_size+'" src="'+url+'@720w_1l.gif" class="candragImg" draggable="true">');
409                            }
410                            else{
411                                $container.html('<div class="delete-image-one">删除</div><img data-size="'+upload_img_size+'" class="candragImg" draggable="true" src="'+url+'?x-oss-process=image/resize,w_720/format,jpg/watermark,image_Y29tbW9uL3dhdGVybWFyay5wbmc_eC1vc3MtcHJvY2Vzcz1pbWFnZS9yZXNpemUsUF8yMw,t_70,g_se,x_20,y_15">');
412                            }
413                            var eleDrag = null;
414                            var ifdragging = false;
415                            $container.children('.delete-image-one').off().on('click',function(e){
416                                var e  = e || event;
417                                e.preventDefault();
418                                var current_contribute_id = window.location.pathname.match(/\d+/);
419                                if(current_contribute_id){
420                                    var contentImgs_json = JSON.parse(localStorage.getItem(current_contribute_id));
421                                    var contentImgs_list = contentImgs_json.contentImgs;
422                                    var current_img_url = $(this).next('img').attr('src');
423                                    contentImgs_list.splice($.inArray(current_img_url,contentImgs_list),1);
424                                    localStorage.setItem(current_contribute_id,JSON.stringify({contentImgs:contentImgs_list}));
425                                }
426                                $(this).parent().remove();
427                            });
428                            $container.children('img').off().on({
429                                mousedown: function(ev) {
430                                    var $this = $(this);
431                                    ev.preventDefault();
432                                    ev.stopPropagation();
433                                    $this.on("mousemove.drag", function (e) {
434                                        ifdragging = true;
435                                    })
436                                    $('body').off().on('mousedown',function(e){
437                                        ifdragging = false;
438                                        $('.editor-blockFrame').unbind('mouseover');
439                                        $('.editor-contentBlock').unbind('mouseup');
440                                    });
441                                    $('body').off().on('mouseup',function(){
442                                        ifdragging = false;
443                                        $('#line_toInsert').remove();
444                                    });
445                                    $('.editor-blockFrame').off().on('mouseover',function(e){
446                                        if(ifdragging){
447                                            $('#line_toInsert').remove();
448                                            $(this).after('<div id="line_toInsert" class="line-toInsert" style="border-top:1px solid #1f7df5;"></div>');
449                                            return false;
450                                        }
451                                    });
452                                    $('.editor-contentBlock').off().on('mouseup',function(e){
453                                        if(ifdragging){
454                                            var dragImgUrl = $this.attr('src');
455                                            var size = $this.attr('data-size');
456                                            web.editor.blocks.addBlock($(this),'image',{url:dragImgUrl,caption:'',size:size});
457                                            $('#line_toInsert').remove();
458                                            $('.editor-blockFrame').unbind('mouseover');
459                                            $('.editor-contentBlock').unbind('mouseup');
460                                            return false;
461                                        }
462                                        else{
463                                            $('.editor-contentBlock').unbind('mouseup');
464                                            return false;
465                                        }
466                                    });
467                                },
468                                mouseup: function(ev){
469                                    ev.preventDefault();
470                                    ev.stopPropagation();
471                                    $('#line_toInsert').remove();
472                                    $('.editor-blockFrame').unbind('mouseover');
473                                    $('.editor-contentBlock').unbind('mouseup');
474                                    ifdragging = false;
475                                    var $this = $(this);
476                                    if($('.editor-textArea').length){
477                                        if($('.editor-contentBlock.editing').length){
478                                            var current_editor = web.editor.blocks.text.getActiveEditor(),
479                                                current_range = current_editor.getRangeElem();
480                                            var nextSiblings = current_range,content_html='';
481                                            while(nextSiblings.nextSibling){
482                                                content_html+=nextSiblings.nextSibling.outerHTML;
483                                                nextSiblings.nextSibling.className = 'editor-wait-delete-node';
484                                                nextSiblings=nextSiblings.nextSibling;
485                                            }
486                                            var $currentEditorBlock = $('.editor-contentBlock.editing');
487                                            var dragImgUrl = $this.attr('src');
488                                            var size = $this .attr('data-size')||0;
489                                            $('.editor-wait-delete-node').remove();
490                                            web.editor.blocks.addBlock($currentEditorBlock,'text',{content:content_html});
491                                            web.editor.blocks.addBlock($currentEditorBlock,'image',{url:dragImgUrl,caption:'',size:size});
492                                        }
493                                    }
494                                }
495                            });
496                        },'json');
497                    }
498                }
499                else{
500                    alert('图片大小不得超过10M!请压缩图片至10M以下');
501                    return false;
502                }
503            }
504        },
505        mutiImageInit:function(){
506            var current_scrollTop = $(window).scrollTop();
507            var tab_html=String()
508                +'<div class="editor-mutiImageUpload-modal fold '+(current_scrollTop>=60?'scrolling':'')+'">'
509                    +'<div class="editor-mutiImageUpload-modal-title">'
510                        +'<span>您上传的本地图片在这里。拖拽使用(出现蓝线)或光标放到段落后单击图片添加</span>'
511                        +'<i></i>'
512                    +'</div>'
513                    +'<div class="editor-mutiimageEditFrame">'
514                        +'<div class="editor-muti-imageContent">'
515                            +'<div class="muti-upload-imageArea">'
516                                +'<input type="file" id="muti_upload_input" class="muti-upload-input" multiple="multiple">'
517                                +'<div class="muti-upload-addImageBtn">'
518                                    +'<svg xmlns="https://www.w3.org/2000/svg" width="98" height="98" viewBox="0 0 98 98">'
519                                        +'<path stroke-width="15" stroke="#549aeb" d="M17,49h64M49,16v65"></path>'
520                                    +'</svg>'
521                                +'</div>'
522                            +'</div>'
523                        +'</div>'
524                    +'</div>'
525                +'</div>';
526            $('.contribute-create-frame .muti-image-area').html(tab_html);
527
528            $('#muti_upload_input').on('change',function(event){
529                for(var j=0;j<event.target.files.length;j++){
530                    var $uploadImg = $('<div class="muti-upload-imageShowArea" draggable="true"></div>');
531                    $(this).parent('.muti-upload-imageArea').after($uploadImg);
532                    getPage.mutiUploadImg(event,j,$uploadImg);
533                }
534                $(this).val('');
535            });
536
537            $(window).scroll(function(){
538                if($('.editor-mutiImageUpload-modal').length){
539                    if($(window).scrollTop()>=113){
540                        $('.editor-mutiImageUpload-modal').css('top',0);
541                    }
542                    else{
543                        $('.editor-mutiImageUpload-modal').css('top',113-$(window).scrollTop());
544                    }
545                }
546            });
547
548            $('.editor-mutiImageUpload-modal-title').off().on('click',function(){
549                $(this).closest('.editor-mutiImageUpload-modal').toggleClass('fold');
550            });
551        },
552        callback:function(){
553            $('#upload_cover').off().on('click',function(){
554                getPage.uploadCoverClick();
555            });
556
557            $('#save_draft').off().on('click',function(){// 保存草稿
558                getPage.saveDraftClick();
559            });
560
561            $('#publish_draft').off().on('click',function(){// 发布
562                getPage.publishDraftClick();
563            });
564
565            $('#must_know').off().on('click',function(){
566                loadDeclaration();
567            })
568        },
569    };
570
571    var loadDeclaration = function(){
572        var declarationHtml = String()
573            +'<div class="draft-declaration-modal">'
574                +'<div class="declaration-content">'
575                    +'<div>'
576                        +'<p>=============================================</p>'
577                        +'<p>请注意!!!关于在旅法师营地投稿的特别说明</p>'
578                        +'<p>=============================================</p>'
579                    +'</div>'
580                    +'<div>'
581                        +'<p>'
582                            +'感谢大家一直以来对旅法师营地的支持。经过7年的发展,旅法师营地从一个卡牌游戏的小众圈子走来,形成了一定的用户基础。我们始终追求让营地真正成为用户喜爱的资讯和社区综合站。旅法师营地投稿平台预计将于2019年1月下旬开始转化为新的社区平台。新平台将会立足于用户产生内容的同时,既保持营地在卡牌游戏领域的专业性,又能满足读者对于丰富资讯的需求、还能简化投稿作者审核流程。'
583                        +'</p>'
584                    +'</div>'
585                    +'<div>'
586                        +'<p>在新的社区中,投稿制度将会发生一定变化,因此我们在此对原本的规则进行一些补充说明:</p>'
587                        +'<p>1.在PC端和APP端点击投稿会默认将内容发表到社区中。</p>'
588                        +'<p>2.发表在社区中的帖子,对营地其他用户立即可见;</p>'
589                        +'<p>3.用户在社区中创造的内容属于作者,可以自由使用、转发和修改。但营地也可以在保留用户署名并获得作者授权的情况下使用、转发和修改;</p>'
590                        +'<p>4.如果作者不希望营地以某种特定方式使用其内容,可以通过营地意见反馈等方式联系工作人员进行修改或者删除。</p>'
591                    +'</div>'
592                    +'<div>'
593                        +'<p>在新的社区中,不再采用旧投稿规则的稿费机制,而采用新的奖励机制:</p>'
594                        +'<p>1.发表在社区中的内容,如果获得版主推荐,可以通过打赏的形式获得来自营地工作人员或是其他营地用户的营火及现金奖励;</p>'
595                        +'<p>2.发表在社区中的内容,可以通过版主推荐、编辑主动选取等方式进入编辑的待处理流程,视同原先的投稿处理机制;</p>'
596                        +'<p>3.通过编辑审核并修改的社区内容,可以被推荐到资讯流中,获得更多的曝光、关注以及额外的稿费。</p>'
597                    +'</div>'
598                    +'<div>'
599                        +'<p>与此同时我们会暂时保留旧投稿流程,用户可以点击投稿界面左侧的“进入旧版投稿平台”链接进入旧版:</p>'
600                        +'<p>1.在投稿平台中提交的稿件,在通过审核或者退回之前,对营地其他用户处于不可见状态;</p>'
601                        +'<p>2.如果编辑采纳稿件,则稿件会被营地推荐,在首页和标签推荐页展示;</p>'
602                        +'<p>3.用户可以在稿件尚未通过审核或者被退回时,自主撤回稿件,并将其发布在社区中;</p>'
603                        +'<p>4.编辑选择退稿的同时,可以将其转为帖子发布在社区中;</p>'
604                        +'<p>5.稿件一旦通过审核,除非另外约定,用户均会获得不等的稿酬。</p>'
605                    +'</div>'
606                    +'<div>'
607                        +'<p>营地现金支取流程:</p>'
608                        +'<p>1.在PC端,鼠标挪到右上角用户头像上,进入“我的营地”;</p>'
609                        +'<p>2.点击左侧“我的资产”;</p>'
610                        +'<p>3.点击“我的现金”;</p>'
611                        +'<p>
6114.点击“支取稿费”;</p>'
612                        +'<p>5.输入个人信息并支取;</p>'
613                        +'<p>6.在15-30个工作日之内,营地工作人员会在审核支取信息之后进行发放。</p>'
614                    +'</div>'
615                    +'<div>'
616                        +'<p>=============================================</p>'
617                        +'<p>版权声明</p>'
618                        +'<p>=============================================</p>'
619                    +'</div>'
620                    +'<div>'
621                        +'<p>1.凡在旅法师营地网站、APP上,或与合作公司共同发行的,包括文章、评论、图片、音频、视频或者工具等形式的内容,对于署名旅法师营地、旅法师营地员工、以及旅法师营地注册用户的部分,版权等知识产权由营地和作者共同拥有,并受中国法律保护。</p>'
622                        +'<p>2.凡以任何方式或理由对前述产品、服务、信息、材料的任何部分进行使用、复制、修改、抄录、传播或与其它产品捆绑使用、销售的单位和个体,均需获得本公司的书面许可。否则本公司将会依法追究其侵犯知识产权的法律责任。</p>'
623                        +'<p>3.营地注册用户可以在其原创内容在营地平台发表72小时后,在注明作者用户名以及来源的营地网址的情况下,将其文章发表于其他平台。</p>'
624                        +'<p>4.凡旅法师营地注明转载的作品,转载自其它媒体。我们依据互联网的共享精神,会写清楚来源、作者和转载字样。如果我们的转载内容侵犯了您的权益,请与我们联系,并提供著作权的相关材料,我们会尽快删除相关内容。</p>'
625                        +'<p>5.营地转载内容的目的在于传递更多信息,并不代表赞同其观点,也无需对其真实性负责。</p>'
626                        +'<p>6.如果本公司侵犯了您的权利,请及时与我们联系:邮箱:[email protected]。</p>'
627                    +'</div>'
628                +'</div>'
629                +'<div class="if-agree">'
630                    +'<label><input type="checkbox">我已阅读并同意以上内容</label>'
631                +'</div>'
632            +'</div>';
633        web.modalFrame.showModal({
634            title:'投稿须知',
635            content:declarationHtml,
636            click_modal_background_to_cancel:false,
637            confirm_function:function(){
638                if($('.if-agree input').is(':checked')){
639                    var token = web.user.getUser('token');
640                    $.post(web.hostMap.host_pre+'contributeremuneration/agree',{ token: token }, function (data) {
641                        if(data.success){
642                            if(localStorage){
643                                localStorage.setItem('draftDeclaration'+web.user.getUser('userid'), 'true');
644                            }
645                            web.modalFrame.closeModal();
646                        }
647                        else {
648                            web.utility.showBasicPrompt({
649                                style:'alert-error',
650                                content:data.msg
651                            });
652                        }
653                    })
654                }
655                else{
656                    web.utility.showBasicPrompt({
657                        style:'alert-error',
658                        content:'请勾选阅读并同意'
659                    });
660                    return false;
661                }
662            }
663        });
664    };
665
666    var initModule = function(arg_array, uniqueId){
667        $.gevent.publish('mainPageUpdate',{
668            page_id:uniqueId,
669            html:getPage.html(),
670            title:'编辑内容-旅法师营地',
671            callback: 'contribute.create.getPage.callback'
672        });
673        if(!arg_array||arg_array.length==0){
674            getPage.initFunc();
675        }
676        else{
677            getPage.modifyInitFunc();
678        }
679        var userKey = Number(web.user.getUser('userKey'));
680        if (!((userKey&24)>0||userKey==-1)){
681            var userid = web.user.getUser('userid');
682            if(!(localStorage&&localStorage.getItem('draftDeclaration'+userid) == 'true')){
683                loadDeclaration();
684            }
685        }
686        
687    };
688
689    return {
690        initModule:initModule,
691        getPage:getPage,
692    }
693
694}());

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.