function SetAssignContentDetails(a,b){console.log("SetAssignContentDetails: de_id: "+a);console.log("de_object: "+b+", article_multi_assign val: "+$("#article_multi_assign").val()+", related_assignment_mode val: "+$("#related_assignment_mode").val());$("#ckModal").modal("hide");var c=a.split("~^~");console.log("splitta1 0: "+c[0]+", splitta1 1: "+c[1]);var d=c[0].split("web_block_link_");console.log("id_splitta 0: "+d[0]+", id_splitta 1: "+d[1]);d=d[1].split("_");$("#page_id").val(d[0]);$("#component_id").val(d[1]); var d=d[2],e=c[1];console.log("object_id_list: "+d+", object_list_info: "+e+", page_id: "+$("#page_id").val()+", component_id: "+$("#component_id").val());if("Y"==$("#article_multi_assign").val()){var c=d.split("|"),f=e.split("|");if($("#related_parent_obj_id").val()){for(var e='
Name | Link URL | Open in new window? | Ranking | '+c[g]+" "+f[g]+' | Yes No | ';e+=" |
---|
getting your article list, please wait...
'),"related_content"!=c&&$("#article_multi_assign").val()):($("#ckAddArticle_body").html(""),$("#list_objects_block").html('getting your article list, please wait...
# | Name | Title | ||
---|---|---|---|---|
'+f+" | ";c+=''+b.content_object_id+" | ";c+=''+b.content_name+" | ";c+=""+ b.content_title+" | ";c+='Date last edited: "+ConvertEtgDateToRealDate(b.last_updated_date,!0)+'">more info | '});return c+="
Excellent, your new page "+c[2]+" ("+c[3]+".php) has been created.
Would you like to create some content blocks for this new page?
", ' ',!1),$("#added_new_page_ok").click(function(){$("#ckModal").modal("hide");BuildNewBlockToExistingPage("add_block_"+c[1])}),$("#added_new_page_cancel").click(function(){$("#ckModal").modal("hide")})):alert("Issue: "+c[1]+", "+c[2])},error:function(a){alert("Oops! Something went wrong when saving this page - our crew has been informed and will be working on a fix immediately. Sorry about that."); SetupErrorReport("SaveNewPage: Oops! Something went wrong when saving this page - our crew has been informed and will be working on a fix immediately. Sorry about that.")}})} function BuildNewBlockToExistingPage(a){a=a.split("add_block_");$.current_web_page_block={};$.current_web_page_block.component_name="";$.current_web_page_block.heading_text="";$.current_web_page_block.number_of_children=0;$.current_web_page_block.short_list_count=0;$.current_web_page_block.read_more_link_text="";$.current_web_page_block.archive_link_text="";$.current_web_page_block.rss_link_text="";$.current_web_page_block.back_to_top_text="";$.current_web_page_block.sort_sequence=2;$.current_web_page_block.component_type= "B";$.current_web_page_block.component_type_seq="100";$.current_web_page_block.link_page_default="";$.current_web_page_block.web_page_id=a[1];$.current_web_page_block.component_id=0;$.current_web_page_block.abbr_text="";$.current_web_page_block.developer_notes="";$.current_web_page_block.imageFile={};$.current_web_page_block.imageFile.file_number=0;SetupEditBlockModal()} function SpecialBlockTypeRadioListner(a){console.log("SpecialBlockTypeRadioListner: "+a);switch(a){case "F_120":case "B_12":$("#link_page_default_block").removeClass("hidden");break;case "A_110":$("#link_page_default").val(""),$("#link_page_default_block").addClass("hidden")}} function ComponentTypeDropdownListener(){var a=$("#component_type_dropdown option:selected").val().split("_"),b=a[0];console.log("ComponentTypeDropdownListener: "+a[0]+" and "+a[1]);$("#special_component_types_block").addClass("hidden");switch(b){case "A":case "B":case "C":$("#edit_component_window #block_list_settings_block").addClass("hidden");$("#link_page_default").val("");$("#link_page_default_block").addClass("hidden");break;case "K":case "E":case "D":case "F":$("#edit_component_window #block_list_settings_block").removeClass("hidden"); $("#link_page_default").val()||$("#link_page_default").val("#");$("#link_page_default_block").removeClass("hidden");break;case "SBT":$("#special_component_types_block").removeClass("hidden")}} function SetupEditBlockModal(){console.log("SetupEditBlockModal, component_id: "+$.current_web_page_block.component_id);$("#component_type_dropdown > option").each(function(){0<=this.value.indexOf("####")&&(console.log("removin"),$("#component_type_dropdown option[value='"+this.value+"']").remove())});$("#component_type_dropdown").selectpicker("refresh");$.current_web_page_block.component_id?($("#edit_component_window #intro").html("Please edit the fields and hit the Save button to update this web page block..."), $("#edit_component_modal_title").html('Edit Web Page Block: '+$("#block_title_"+$.current_web_page_block.web_page_id+"-"+$.current_web_page_block.component_id).html()+' in page '+$("#page_title_"+$.current_web_page_block.web_page_id).html()+"")):($("#edit_component_window #intro").html("Please enter the details for this new web page block and hit the Save button to have us create it for you..."),$("#edit_component_modal_title").html('Add Web Page Block to '+ $("#page_title_"+$.current_web_page_block.web_page_id).html()+""));$("#edit_component_window #modal_title").html(": "+$.current_web_page_block.component_name);$("#edit_component_window #component_name").val($.current_web_page_block.component_name);$("#edit_component_window #component_title").val($.current_web_page_block.heading_text);$("#edit_component_window #number_of_children").val($.current_web_page_block.number_of_children);$("#edit_component_window #short_list_count").val($.current_web_page_block.short_list_count); $("#edit_component_window #read_more_link_text").val($.current_web_page_block.read_more_link_text);$("#edit_component_window #archive_link_text").val($.current_web_page_block.archive_link_text);$("#edit_component_window #rss_link_text").val($.current_web_page_block.rss_link_text);$("#edit_component_window #back_to_top_text").val($.current_web_page_block.back_to_top_text);$("#edit_component_window #edit_component_sort_seq").val($.current_web_page_block.sort_sequence);$("#edit_component_window #edit_component_sort_seq").selectpicker("refresh"); $("#edit_component_window #link_page_default").val($.current_web_page_block.link_page_default);$("#edit_component_window #component_type").val($.current_web_page_block.component_type);$("#edit_component_window #component_type_seq").val($.current_web_page_block.component_type_seq);var a=$.current_web_page_block.component_type+"_"+$.current_web_page_block.component_type_seq;console.log("combined_type: "+a);if("F_120"==a||"B_12"==a||"A_110"==a)$("#component_type_dropdown").selectpicker("val","SBT"), $('input:radio[name="special_block_types"]').filter('[value="'+a+'"]').attr("checked",!0),$("#special_component_types_block").removeClass("hidden"),SpecialBlockTypeRadioListner(a);else{$("#component_type_dropdown").selectpicker("val","-1");var b=!1;$("#component_type_dropdown > option").each(function(){if(this.value==a)return b=!0,!1});if(!b){console.log("appending: "+a);var c=a,a=a+"_####";$("#component_type_dropdown").append($("",{value:a,text:"Special type: "+c}))}$("#component_type_dropdown").selectpicker("refresh"); $("#component_type_dropdown").selectpicker("val",a);$("#component_type_dropdown").selectpicker("refresh")}$("#edit_component_window #web_page_id").val($.current_web_page_block.web_page_id);$("#edit_component_window #component_id").val($.current_web_page_block.component_id);$("#edit_component_window #abbr_text").text($.current_web_page_block.abbr_text);$("#edit_component_window #developer_notes").text($.current_web_page_block.developer_notes);$("#edit_component_window #component_img_id").val($.current_web_page_block.imageFile.file_number); "0"!=$.current_web_page_block.imageFile.file_number?$("#edit_component_window #block_img_holder").html(''):$("#edit_component_window #block_img_holder").html("no image");$.current_web_page_block.imageFile.file_number?$("#edit_component_window #add_image_to_block_but_text").text("Change image"):$("#edit_component_window #add_image_to_block_but_text").text("Assign image");console.log("IMG: "+$.current_web_page_block.imageFile.file_location); console.log("IMG: "+$.current_web_page_block.imageFile.file_location);$("#editBlockOK").unbind("click");$("#editBlockOK").click(function(){SaveBlock()});"A"==$.current_web_page_block.component_type||"B"==$.current_web_page_block.component_type?$("#edit_component_window #block_list_settings_block").addClass("hidden"):$("#edit_component_window #block_list_settings_block").removeClass("hidden");$("#edit_component_window").modal()} function EditWebPageBlock(a){$.ajax({type:"POST",url:"contentkingajax.php",data:"de_action=EditWebPageBlock&de_data="+a,dataType:"json",async:!0,success:function(a){"yikes!"==a?alert("Sorry, there was a problem getting data for this block, our team has been informed and will be looking into it real quick."):($.current_web_page_block=a,SetupEditBlockModal())}})} function SaveBlock(){$("#editBlockButtonZone").addClass("hidden");$("#editBlockSaveMessageZone").removeClass("hidden");var a={};a.component_name=encodeURIComponent($("#edit_component_window #component_name").val());a.heading_text=encodeURIComponent($("#edit_component_window #component_title").val());a.number_of_children=$("#edit_component_window #number_of_children").val();a.short_list_count=$("#edit_component_window #short_list_count").val();a.read_more_link_text=encodeURIComponent($("#edit_component_window #read_more_link_text").val()); a.archive_link_text=encodeURIComponent($("#edit_component_window #archive_link_text").val());a.rss_link_text=encodeURIComponent($("#edit_component_window #rss_link_text").val());a.back_to_top_text=encodeURIComponent($("#edit_component_window #back_to_top_text").val());a.sort_sequence=$("#edit_component_window #edit_component_sort_seq").val();a.link_page_default=$("#edit_component_window #link_page_default").val();a.web_page_id=$("#edit_component_window #web_page_id").val();a.component_id=$("#edit_component_window #component_id").val(); a.abbr_text=encodeURIComponent($("#edit_component_window #abbr_text").val());a.developer_notes=encodeURIComponent($("#edit_component_window #developer_notes").val());a.component_img_id=$("#edit_component_window #component_img_id").val();var b=$("select[name=component_type_dropdown]").val();"SBT"==b&&(b=$("input:radio[name='special_block_types']:checked").val());b=b.split("_");a.component_type=b[0];a.component_type_seq=b[1];console.log("About to SaveBlock, name: "+a.component_name+", title: "+a.heading_text+ ", img: "+a.component_img_id);b="de_action=SaveBlock&de_data="+JSON.stringify(a);$.ajax({type:"POST",url:"contentkingajax.php",data:b,dataType:"json",async:!0,success:function(b){if("yikes!"==b)alert("Sorry, there was a problem saving data for this block, our team has been informed and will be looking into it real quick.");else{console.log("Return on SaveBlock, new or edit?: "+b.component_id);var d=b.web_page_id+"-"+b.component_id;if(0==$("#edit_component_window #component_id").val()){var e;e=""+ ('Please tick/untick the appropriate categories within these groups and hit the Assign selected button to save...
"+f);$("#associate_cat_block .cats_non_label").addClass("hidden"); $("#associate_cat_block .cats_label").removeClass("hidden");$("#associate_cat_block .edit_cat").addClass("hidden");$("#associate_cat_block .add_cat").addClass("hidden");$("#next_save_button_block").removeClass("hidden");$("#save_cat_edit").addClass("disabled");console.log("de: "+c);"c"==c?($("#assigned_children").val().split("|").splice(-1,1),$.each(current_category.children,function(a,b){console.log("child: "+b.category_number);$("#associate_cat_block #cat_check_"+b.category_number).attr("checked", "checked")})):(current_category.parents&&(console.log("parents: "+current_category.parents.length),$.each(current_category.parents,function(a,b){console.log("parent: "+b.category_number);$("#associate_cat_block #cat_check_"+b.category_number).attr("checked","checked")})),console.log("parents done"));$("#save_family_ticks").unbind("click");$("#cancel_family_ticks").unbind("click");$("#save_family_ticks").click(function(){var a="";$("#associate_cat_block .cat_check:checked").each(function(){console.log("ticked: "+ $(this).val());a+=$(this).val()+"|"});"c"==$(this).attr("childparent")?$("#assigned_children").val(a):$("#assigned_parents").val(a);$("#save_cat_edit").removeClass("disabled");$("#associate_cat_block").html("");$("#next_save_button_block").addClass("hidden");$("#associate_cat_button_block").removeClass("hidden")});$("#cancel_family_ticks").click(function(){$("#associate_cat_block").html("");$("#save_cat_edit").removeClass("disabled");$("#next_save_button_block").addClass("hidden");$("#associate_cat_button_block").removeClass("hidden")})} function SaveCategoryAssignmentSelections(){var a="",b="",c="",d="";$(".cat_check:checked").each(function(){a+=$(this).val()+"|";c=$(this).attr("parent");c!=d&&(d=c,b+="please wait as we make this save...
','"The world is divided into two categories: failures and unknowns." - Francis Picabi',!1,!0);console.log("SaveCatGroup!: "+$("#cat_group_edit_id").val()+", : "+$("#cat_group_edit_input").val()+", : "+$("#cat_group_img_id").val()+", : "+$("#cat_group_developer_notes").val()+ ", : "+$("#cat_group_gen_desc").val());if($("#cat_group_edit_input").val()){var a="de_action=SaveCatGroup&de_data="+$("#cat_group_edit_id").val()+"~|~"+$("#cat_group_edit_input").val()+"~|~"+$("#cat_group_img_id").val()+"~|~"+$("#cat_group_developer_notes").val()+"~|~"+$("#cat_group_gen_desc").val();$.ajax({type:"POST",url:"contentkingajax.php",data:a,dataType:"json",async:!0,success:function(a){console.log("Succes on SaveCatGroup: "+a);"OUCH"==a?(alert("Sorry, there was a problem saving this Category Group, our team has been informed and will be looking into it real quick."), SetupErrorReport("SaveCatGroup fail on method: ")):($("#ckmodal_body").html("Save successful"),console.log("SaveCatGroup success for group num "+a.category_group_code),$("#cat_group_desc_"+a.category_group_code).html(a.category_group_desc),$("#cat_group_gen_desc_"+a.category_group_code).html(a.abbr_text),$("#cat_group_dev_notes_"+a.category_group_code).html(a.developer_notes),a.imageFile?(console.log("got image: "+a.imageFile.file_location),$("#cat_group_img_"+a.category_group_code).html(''),$("#cat_group_img_id_"+a.category_group_code).html(a.imageFile.file_number),$("#remove_image_from_cat_group").removeClass("hidden")):($("#cat_group_img_"+a.category_group_code).html(""),$("#cat_group_img_id_"+a.category_group_code).html(""),$("#remove_image_from_cat_group").addClass("hidden")),$("#ckModal").modal("hide"))},error:function(a){alert("Oops! Something went wrong in saving this Category Group - our crew has been informed and will be working on a fix immediately."); SetupErrorReport("SaveCatGroup: Oops! Something went wrong in saving this Category Group - our crew has been informed and will be working on a fix immediately.")}})}else alert("Hey, hang on! You need to enter a name for this Category Group!")} function PresentCats(a){""==$("#ckCatsModalBody").html()&&BuildCategoriesModal(a);$("#ckCatsModal .panel-collapse").removeClass("in");switch(a){case "manage":$(".cats_label").addClass("hidden");$(".cats_non_label").removeClass("hidden");$("#cats_modal_mode").val("manage");$("#cats_modal_save_block").addClass("hidden");break;case "assign_to_object":$(".cat_check").prop("checked",!1),a=$("#cat_list").val().split("|"),$.each(a,function(a,c){console.log("check: "+c);$("#cat_check_"+c).prop("checked", !0)}),$(".cats_label").removeClass("hidden"),$(".cats_non_label").addClass("hidden"),$("#cats_modal_mode").val("assign"),$("#cats_modal_save_block").removeClass("hidden")}$("#ckCatsModal").modal();history.replaceState(null,null,"?mi=menu_cats")} function SaveCatDetails(a,b,c,d){$("#ckEditCat").modal("hide");ShowModal("Saving category...",'please wait as we make this save...
','"The world is divided into two categories: failures and unknowns." - Francis Picabi',!1,!0);var e=$("#assigned_children").val(),f=$("#assigned_parents").val(),g=$("#cat_img_id").val();console.log("SaveCatDetails: "+a+", "+b+", "+c+", "+e+", "+f+", "+ d);$.ajax({type:"POST",url:"contentkingajax.php",data:"de_action=SaveCatDetails&de_val="+a+"~|~"+b+"~|~"+c+"~|~"+e+"~|~"+f+"~|~"+g+"~|~"+d,dataType:"json",async:!0,success:function(d){$("#ckmodal_body").html("Save successful");console.log("AJAX return - SaveCatDetails for "+a+"..."+d.category_number);var e="";d.imageFile&&(e=''+d.imageFile.file_location+"");var g="", f=" hidden";switch($("#cats_modal_mode").val()){case "manage":g=" hidden",f=""}e='('+d.ranking_sequence+") "+c+''+e;0==a?(console.log("Appending to #cats_list_"+b+" with this: "+e),$("#cat_list_"+b).prepend('one time loading of categories, please wait...
');var b=(new Date).getTime();console.log("BuildCategoriesModal START: "+b);$.ajax({type:"POST",url:"contentkingajax.php",data:"de_action=BuildCategoriesModal",dataType:"json",async:!0,success:function(b){console.log("AJAX return - BuildCategoriesModal..."+b.length);b=b.split("~-~"); $("#ckCatsModalBody").html(b[0]);$("#cat_groups_with_children").val(b[1]);$("#cat_groups_with_parent").val(b[2]);$(".add_cat").unbind("click");$(".add_cat").click(function(){var a=this.id.split("add_cat_");EditCategory("add_cat_"+a[1]+"_undefined","",$(this).parents(".panel-body").attr("de_title"),"")});$(".edit_cat").unbind("click");$(".edit_cat").click(function(){EditCategory(this.id,$(this).parents(".cat_item").attr("cat_desc"),$(this).parents(".panel-body").attr("de_title"),"Y")});a&&PresentCats(a)}, error:function(a){alert("Oops! Something went wrong when getting comments for moderation - our crew has been informed and will be working on a fix immediately. Sorry about that.");SetupErrorReport("GetCommentsForModeration: Oops! Something went wrong when getting comments for moderation - our crew has been informed and will be working on a fix immediately. Sorry about that.")}})} function EditCategory(a,b,c,d){console.log("EditCategory: "+a+", "+b+", "+c+", "+d);ShowModal("Getting Category Details...",'please wait as we get the details of this category...
','In America, the professor talks to the mechanic. They are in the same category - Noam Chomsky',!1,!0);a=a.split("_");var e=a[2];a=a[3];d?$.ajax({type:"POST",url:"contentkingajax.php",data:"de_action=EditCategory&de_val="+ a,dataType:"json",async:!0,success:function(a){console.log("HEY success on EditCategory: "+a.category_number);current_category=a;PresentEditCategoryModal(e,c,d)}}):(current_category={category_number:0,ranking_sequence:0,category_desc:""},PresentEditCategoryModal(e,c,"N"))} function PresentEditCategoryModal(a,b,c){console.log("PresentEditCategoryModal: "+current_category.category_number+", "+current_category.category_desc+", "+a+", "+b+", "+c);var d='Add new category to '+b+"",e="Please enter the category description and hit the SAVE button...",f="";"Y"==c?(f='',d='Edit category '+current_category.category_desc+' in '+ b+"",e="Please edit the Category description and hit the UPDATE button..."):$("#delete_cat_edit").addClass("hidden");var g=!1;b=$("#cat_groups_with_children").val().split("|");for(c=0;cName | Link URL | Open in new window? | Ranking | '+d[g]+" "+f[g]+' | Yes No | ';e+=" |
---|
Your assignments have been made and that is the end of adding related content
Well done!
"),setTimeout(function(){$("#ckModal").modal("hide")}, 1E3)):(console.log("Gabb debug: "+a),a=de_related_blocks.split("|rb|")[a].split("^"),AddToBlockFromWebPages("add_to_components_"+a[0]+"-"+a[1]+"-"+a[2])):(ShowModal("Save successful","Your assignment has been made!
"),setTimeout(function(){$("#ckModal").modal("hide")},1E3))))},error:function(a){console.log("Ajax fail return SaveContentAssignment..."+JSON.stringify(a));alert("Oops! Something went wrong assigning this item - our crew has been informed and will be working on a fix immediately."); SetupErrorReport("EditComponentAssignment (SaveContentAssignment): Oops! Something went wrong assigning this item - our crew has been informed and will be working on a fix immediately.")}})}else alert("Hey, your date to needs to be after your date from!")}function AssignContentObject(a){a=a.split("assign_content_");$("#article_multi_assign").val("N");ajaxFunction("GetWebPageListForAssignment","",a[1])}function AssignContent(a){ajaxFunction("AssignContent","",a)} function AssignFile(){console.log("AssignFile, alt: "+$("#alt_text_AssignFile").val()+", file num: "+current_file.file_number+", file align: "+$("input[name='file_align']:checked").val()+", file_list_action: "+file_list_action);var a=0;"abbrev"==file_list_action?(a=1,$("#abbrev_img").html(''),$("#remove_abbrev_img").removeClass("hidden"),$("#add_abbrev_img").text("Change image")):($("#main_img").html(''),$("#remove_main_img").removeClass("hidden"), $("#add_main_img").text("Change image"));$.each($.current_content_object.content_files,function(b,c){if(c.file_sequence==a)return $.current_content_object.content_files.splice(b,1),!1});var b={},c={};"S"!=$("input[name='image_size_selection']:checked").val()?$.each(current_file.alternate_files,function(a,e){if(e.file_size_type==$("input[name='image_size_selection']:checked").val())return b.file_number=e.file_number,c.file_location=e.file_location,!1}):(b.file_number=current_file.file_number,c.file_location= current_file.file_location);b.alt_text=encodeURIComponent($("#alt_text_AssignFile").val());b.alignment_ind=$("input[name='file_align']:checked").val();b.file_sequence=a;b.content_object_id=$.current_content_object.content_object_id;c.file_name=encodeURIComponent(current_file.file_name);b.file=c;b.link_url="";b.new_window_ind="";$.current_content_object.content_files.push(b);$("#ckAssignFile").modal("hide")} function AssignFiles(){console.log("AssignFiles, file_list_action: "+file_list_action);$("#ckFileList").modal("hide");switch(file_list_action){case "abbrev":case "main":case "webblock":case "cat":case "catgroup":var a="de_action=GetFileDeets&de_data="+$("input[name=file_selection]:checked").val();$.ajax({type:"POST",url:"contentkingajax.php",data:a,dataType:"json",async:!0,success:function(a){console.log("Return of GetFileDeets for AssignFiles..."+a.file_number+" with file_list_action: "+file_list_action); current_file=a;switch(file_list_action){case "webblock":$("#block_img_holder").html('');$("#component_img_id").val(a.file_number);$("#edit_component_window #add_image_to_block_but_text").text("Change image");break;case "cat":$("#cat_img_holder").html('');$("#cat_img_id").val(a.file_number);$("#add_image_to_cat_but_text").text("Change image");break;case "catgroup":$("#cat_group_img_holder").html('');$("#cat_group_img_id").val(a.file_number); $("#add_image_to_cat_group_but_text").text("Change image");break;case "main":case "abbrev":current_file_assignment={},current_file_assignment.file=current_file,current_file_assignment.content_object_id=$.current_content_object.content_object_id,current_file_assignment.file_number=current_file.file_number,current_file_assignment.file_sequence="0",current_file_assignment.alt_text="",current_file_assignment.link_url="",current_file_assignment.new_window_ind="N",current_file_assignment.alignment_ind= "T",DisplayFileModal()}},error:function(a){alert("Oops! Something went wrong reading the files for assignment - our crew has been informed and will be working on a fix immediately. Sorry about that.");SetupErrorReport("SaveContentObject: Oops! Something went wrong reading the files for assignment - our crew has been informed and will be working on a fix immediately. Sorry about that.")}});break;default:PrepareDisplayMultiFileModal(!0)}} function PrepareDisplayMultiFileModal(a){console.log("PrepareDisplayMultiFileModal, "+$.current_content_object.content_files.length+" files");console.log("Check type of multi_files: "+typeof multi_files);"undefined"==typeof multi_files&&(multi_files=[]);var b=[];a&&$("#filetable").find('input[type="checkbox"]:checked').each(function(){var a=this.id.split("file_check_");console.log("Pushing "+a[1]);multi_files.push(a[1])});var c=10;$.each($.current_content_object.content_files,function(a,e){0!=e.file_sequence&& 1!=e.file_sequence?(multi_files.push(e.file_number),e.file_sequence>=c&&(c+=10)):b.push(e)});a="de_action=GetFileDeetsMulti&de_data="+JSON.stringify(multi_files)+"&de_index="+c+"&de_obj_id="+$.current_content_object.content_object_id;$.ajax({type:"POST",url:"contentkingajax.php",data:a,dataType:"json",async:!0,success:function(a){console.log("Return of GetFileDeetsMulti for AssignFiles, length of array..."+a.length);$.merge(b,a);$.current_content_object.content_files=b;DisplayMultiFileModal()},error:function(a){alert("Oops! Something went wrong reading the files for assignment - our crew has been informed and will be working on a fix immediately. Sorry about that."); SetupErrorReport("SaveContentObject: Oops! Something went wrong reading the files for assignment - our crew has been informed and will be working on a fix immediately. Sorry about that.")}})} function DisplayMultiFileModal(){console.log("DisplayMultiFileModal, "+$.current_content_object.content_files.length+" files");var a="",b="",b=b+'# | File name | Which size? | Sequence | Alt text | |
---|---|---|---|---|---|
'+d.file_number+" | "+d.file.file_name+" | "+e+' |
please stand by
','Great ability develops and reveals itself increasingly with every new assignment - Baltasar Gracian',!1);$("#ckAssignContent").unbind("hidden")});$("#ckAssignContent").modal("hide");for(var g=[],h=0;hWell done!
");$("#ckModal").unbind("hidden");setTimeout(function(){$("#ckModal").modal("hide")}, 1E3)}),$("#ckModal").modal("hide")):(console.log("Gabb debug: "+a),a=de_related_blocks.split("|rb|")[a].split("^"),AddToBlockFromWebPages("add_to_components_"+a[0]+"-"+a[1]+"-"+a[2])):(ShowModal("Save successful","Your assignment has been made!
"),setTimeout(function(){$("#ckModal").modal("hide")},1E3)))},error:function(a){console.log("Ajax fail return SaveBlockContent..."+a);alert("Oops! Something went wrong assigning these items - our crew has been informed and will be working on a fix immediately."); SetupErrorReport("AssignMultipleContentSave (SaveBlockContent): Oops! Something went wrong assigning these items - our crew has been informed and will be working on a fix immediately.")}})}else alert("Hey, your date to needs to be after your date from!")} function AssignRelatedContent(a,b,c,d){console.log("AssignRelatedContent: "+a+", "+b+", "+c+", "+d);de_related_blocks=$("#related_block_"+a+"_"+b).html();console.log("OK, the blocks: "+de_related_blocks);a=de_related_blocks.split("|rb|");console.log("related_content_step_count: "+related_content_step_count);c=a[related_content_step_count].split("^");related_content_count=a.length;a=c[0];b=c[1];c=c[2];console.log("So now we have de_web_page_id: "+a+", de_block_id: "+b+", de_block_type: "+c+", object_id_list: "+ d+", related_content_count: "+related_content_count);PresentObjectListForRelatedContent(a,b,c)}function AssignToChildBlock(a){console.log("AssignToChildBlock: "+a);a=a.split("_");var b=a[1].split("-");$("#related_parent_obj_id").val(b[3]);de_related_blocks="ADDINGTOCHILD";AddToBlockFromWebPages("add_to_components_"+a[1])} function BuildCatsInterface(a){$("#manage_catz_block").html(a);$("#cats_block").removeClass("hidden");$(".cat_check_line").addClass("hidden");$(".edit_cat").unbind("click");$(".edit_cat").click(function(){EditCategory(this.id,$(this).parents(".cat_item").attr("cat_desc"),$(this).parents(".panel-body").attr("de_title"),"Y")});$(".add_cat").unbind("click");$(".add_cat").click(function(){var a=this.id.split("add_cat_");EditCategory("add_cat_"+a[1]+"_undefined","",$(this).parents(".panel-body").attr("de_title"), "")})} function CheckCatForDeletion(a,b){console.log("CheckCatForDeletion: "+a);$("#associate_cat_block").html(' checking for where this category has been assigned...');$.ajax({type:"POST",url:"contentkingajax.php",data:"de_action=CheckCatForDeletion&de_id="+a,dataType:"json",async:!0,success:function(c){console.log("Success on CheckCatForDeletion: "+c);"OUCH"==c?(alert("Sorry, there was a problem checking this Category for deletion, our team has been informed and will be looking into it real quick."),SetupErrorReport("CheckCatForDeletion fail on method: ")): ($("#associate_cat_block").html('Below is a list of content that is associated with this category. Please use this to confirm you wish to delete this category as this deletion cannot be undone
'+c),$("#ckEditCat_footer").html(''),$("#save_cat_edit").unbind("click"), $("#associate_cat_edit").unbind("click"),$("#associate_cat_parent_edit").unbind("click"),$("#delete_cat_edit").unbind("click"),$("#confirm_delete_cat_edit").unbind("click"),$("#cancel_confirm_cat_edit").unbind("click"),$("#confirm_delete_cat_edit").click(function(){ConfirmCatDeletion(a,b)}),$("#cancel_confirm_cat_edit").click(function(){$("#associate_cat_block").html("")}))},error:function(a){alert("Oops! Something went wrong in checking this Category for deletion - our crew has been informed and will be working on a fix immediately."); SetupErrorReport("CheckCatForDeletion: Oops! Something went wrong in checking this Category for deletion - our crew has been informed and will be working on a fix immediately.")}})}function CheckDatePickerDates(){var a=GetTimeStampFromDatePicker("from",!0);return GetTimeStampFromDatePicker("to",!0)<=a?!1:!0}function CreateNewPageFromTemplate(a){ajaxFunction("CreateNewPageFromTemplate",a)} function CommentModerate(a,b,c){if(c){var d="Approving comment...",e='We are approving this comment, please wait.
';"R"==a&&(d="Rejecting comment..",e='We are rejecting this comment, please wait.
');ShowModal(d,e,"",!1);f=b}else{var f=b.split("_comment_")[1];$("#a_comment_"+f).unbind("click");$("#r_comment_"+f).unbind("click");$("#a_comment_"+ f).html('');$("#r_comment_"+f).html('')}$.ajax({type:"POST",url:"contentkingajax.php",data:"de_action=CommentModerate&de_id="+a+"&de_data="+f+"&is_auto="+c,dataType:"json",async:!0,success:function(b){if("OUCH!"==b.substr(0,5))b=b.split("OUCH!")[1],$("#ckModal").modal("hide"),alert(b);else if(c){history.replaceState(null,null,"?mi=menu_comments");b="Comment Approved!";var d='Great, we have approved this comment - now getting all comments for moderation, please wait.
'; "R"==a&&(b="Comment Rejcted!",d='Great, we have rejected this comment - now getting all comments for moderation, please wait.
');ShowModal(b,d,"",!1);GetCommentsForModeration()}else"A"==a?$("#comment_box_overlay_"+b).html('APPROVED!'):$("#comment_box_overlay_"+b).html('REJECTED!'),$("#comment_box_overlay_"+b).removeClass("hidden"),d=$("#comment_box_"+b).height(), $("#a_comment_"+f).addClass("hidden"),$("#r_comment_"+f).addClass("hidden"),$("#comment_box_"+b).height(d)},error:function(a){alert("Oops! Something went wrong when moderating this comment - our crew has been informed and will be working on a fix immediately. Sorry about that.");SetupErrorReport("CommentModerate: Oops! Something went wrong when moderating this comment - our crew has been informed and will be working on a fix immediately. Sorry about that.")}})} function ConfirmCatDeletion(a,b){console.log("ConfirmCatDeletion: "+a+", group_id: "+b);$.ajax({type:"POST",url:"contentkingajax.php",data:"de_action=ConfirmCatDeletion&de_id="+a,dataType:"json",async:!0,success:function(c){console.log("Success on ConfirmCatDeletion: "+c);"OUCH"==c?(alert("Sorry, there was a problem deleting this Category, our team has been informed and will be looking into it real quick."),SetupErrorReport("ConfirmCatDeletion fail on method: ")):($("#cat_item_"+b+"_"+a).remove(), $("#ckEditCat").modal("hide"),ShowModal("Deletion successful","Great, we have deleted this category for you.",'Delete the negative; accentuate the positive! - Donna Karan',!1),setTimeout(function(){$("#ckModal").modal("hide")},1E3))},error:function(a){alert("Oops! Something went wrong in deleting this Category - our crew has been informed and will be working on a fix immediately.");SetupErrorReport("ConfirmCatDeletion: Oops! Something went wrong in deleting this Category - our crew has been informed and will be working on a fix immediately.")}})} function CopyCurrentObject(){$("#content_object_id").val("0");$("#object_heading").html('New Content Object copy of '+$("#content_name").val()+"")}function CopyWebPage(a){a=a.split("copy_page_");AddNewPageModal(a[1],$("#page_title_"+a[1]).html())} function DisplayFileModal(){console.log("DisplayFileModal, file_location: "+current_file_assignment.file.file_location+", file_type: "+current_file_assignment.file.file_type);$("#modal_header_AssignFile").html('Assign file: '+current_file_assignment.file.file_name);$("#assignFileModal_preview_block").html('');current_file_assignment.file.alternate_files&& $.each(current_file_assignment.file.alternate_files,function(a,b){console.log("Alt file: "+b.file_location+", "+b.file_name)});$("#alt_text_AssignFile").val(current_file_assignment.alt_text);$("#file_num_AssignFile").val(current_file_assignment.file.file_number);$("#file_assign_abbr_link").attr("href",$("#abbr_link_"+current_file_assignment.file.file_number).attr("href"));$("#file_assign_stnd_link").attr("href",$("#stnd_link_"+current_file_assignment.file.file_number).attr("href"));$("#file_assign_big_link").attr("href", $("#big_link_"+current_file_assignment.file.file_number).attr("href"));console.log("file_size_type: "+current_file_assignment.file.file_size_type+", type: "+$.type(current_file_assignment.file.file_size_type));" "!=current_file_assignment.file.file_size_type?(console.log("got a typec"),$("[name=image_size_selection]").val([current_file_assignment.file.file_size_type])):(console.log("defaulkting to standard"),$("[name=image_size_selection]").val(["S"]));console.log("file_sequence: "+current_file_assignment.file_sequence); $("[name=file_align]").val([current_file_assignment.alignment_ind]);$("#link_url_AssignFile").val(current_file_assignment.link_url);$("#file_sequence_AssignFile").val(current_file_assignment.file_sequence);$("[name=new_window_ind]").val([current_file_assignment.new_window_ind]);switch(file_list_action){case "abbrev":$("#opening_statement_AssignFile").html("Assigning file as Abbreviated Image");$("#assignFileModal_edit_block").addClass("hidden");break;case "main":$("#opening_statement_AssignFile").html("Assigning file as Main Image"); $("#assignFileModal_edit_block").addClass("hidden");break;case "assignment_edit":$("#opening_statement_AssignFile").html("Editing file assignment"),$("#assignFileModal_edit_block").removeClass("hidden")}"img"==current_file_assignment.file.file_type?($("#image_specific_row").removeClass("hidden"),$("#altTextLabel").html('Alt text (shows on hover and for accessibility - leave blank and we will use this image\'s title: '+ current_file_assignment.file.file_title+")")):($("#image_specific_row").addClass("hidden"),$("#altTextLabel").html('Text for link (shows as the link text for this file when we list it - leave blank and we will use this file\'s title: '+current_file_assignment.file.file_title+")"));$("#ckAssignFile").on("shown.bs.modal",function(a){$("#alt_text_AssignFile").focus()});$("#ckAssignFile").modal({backdrop:"static"})} function EditComponentAssignment(a){console.log("EditComponentAssignment, off to ajax: "+a);$.ajax({type:"POST",url:"contentkingajax.php",data:"de_action=EditComponentAssignment&de_id="+a,dataType:"json",async:!0,success:function(b){if("OUCH!"==b)alert("Ouch, fail in edit, our team has been notified and we will try and solve that straight away.");else{var c=a.split("editobjectassignment_");a=c[0]+c[1];SetAssignContentDetails("web_block_link_"+a,b)}},error:function(a){alert("Oops! Something went wrong editing this item - our crew has been informed and will be working on a fix immediately."); SetupErrorReport("EditComponentAssignment: Oops! Something went wrong editing this item - our crew has been informed and will be working on a fix immediately.")}})}function EditObjectFromBlockList(a){a=a.split("edit_object_from_list_")[1];GetContentObjectDetails(a,!1)} function EditFile(a,b){var c=a.split("edit_file_");console.log("EditFile: "+c[1]);$.ajax({type:"POST",url:"contentkingajax.php",data:"de_action=GetFileDeets&de_data="+c[1],dataType:"json",async:!0,success:function(a){current_file=a;$("#file_name").val(a.file_name);$("#file_title").val(a.file_title);$("#file_desc").val(a.file_desc);$("#file_num").val(a.file_number);$("#file_location").val(a.file_location);console.log("debug1: "+a.file_location);$("#file_add_to").val(b);$("#file_preview_area").html('');console.log("debug2: "+a.file_location);image_thumb_html=a.file_location;switch(a.file_type){case "pdf":image_thumb_html="images/image_preview_pdf.png";break;case "doc":image_thumb_html="images/image_preview_doc.png";break;case "xl":image_thumb_html="images/image_preview_xl.png"}$("#file_preview_area").html(''); console.log("debug3: "+a.file_location);$("#file_deets").html("Dimensions: "+a.file_width+"W x "+a.file_height+"H, File size: "+GetHumanReadableFileSize(a.file_size)+", Date first loaded: "+ConvertEtgDateToRealDate(a.date_created)+".
");$("#file_uploaded").val("yeha");$("#file_type").val(a.file_type);console.log("debug4: "+a.file_location);var c="";a.categories&&$.each(a.categories,function(a,b){c+=b.category_desc});console.log("debug5: "+ a.file_location);$("#file_categories_block").html(c);$("#ckFileUpload_modal_title").html("Edit File: "+a.file_name);$("#ckFileUploadOK").text("Save changes");$("#ckFileUpload").modal({backdrop:"static"})},error:function(a){alert("Oops! Something went wrong when getting this file's details - our crew has been informed and will be working on a fix immediately. Sorry about that.");SetupErrorReport("GetFileDeets: Oops! Something went wrong when getting this file's details - our crew has been informed and will be working on a fix immediately. Sorry about that.")}})} function EditRelatedChildAssignment(a){console.log("EditRelatedChildAssignment: "+a);var b=a.split("_");a=b[1];var c=b[2],d=b[3],e=b[4],b=b[5];console.log("check of parent input thang: "+$("#related_parent_obj_id").val());EditComponentAssignment("editobjectassignment_"+a+"_"+c+"_"+d+"_"+e+"_"+b)} function EditWebPage(a){a=a.split("page_");$("#web_page_edit_id").val(a[1]);$("#web_page_title").val($("#page_title_"+a[1]).text());$("#web_page_rank").val($("#page_rank_"+a[1]).text());$("#ckEditPage_header").html('Edit web page '+$("#page_title_"+a[1]).text()+"");console.log("Edit page "+a[1]+" wit rank "+$("#page_rank_"+a[1]).text()+" and title "+$("#page_title_"+a[1]).text());$("#ckEditPage").modal()} function EmailHistoryClick(a){var b="Stats for [woteva]",c="Here are the statistics for [woteva]";switch(a.split("-")[0]){case "S":b="Cancel schedule for [woteva]";c="Cancel schedule for [woteva]? Are you sure?";break;case "D":b="Edit [woteva]";c="Editing [woteva]";break;case "Q":b="Stop sending for [woteva]",c="Cancel sending for [woteva]? Are you sure?"}ShowModal(b,""+c+"
","Footer here",!1)} function FilterUserList(){var a="";"Y"==$("#ckUserDateRangeChecker").val()&&(a=GetTimeStampFromDatePicker("userDateSearchFrom",!1)+"|"+GetTimeStampFromDatePicker("userDateSearchTo",!1)+"|"+$("input[name=user_date_type_selection]:checked").val());var b="";$.each($("#user_group_filter:selected"),function(){b+=$(this).val()+"_"});GetUsers($("#user_list_filter_search_term").val(),b,a)} function GenerateCatsList(a,b,c,d){$.ajax({type:"POST",url:"contentkingajax.php",data:"de_action=GenerateCatsList",dataType:"json",async:!0,success:function(e){e=e.split("~-~");localStorage.setItem("catCheckboxHtml",e[0]);localStorage.setItem("cat_groups_with_children",e[1]);localStorage.setItem("cat_groups_with_parent",e[2]);switch(a){case "AssignFamiliesSetup":AssignFamiliesSetup(b,c,d);break;case "ManageCats":BuildCatsInterface(e[0]);break;case "EditCategories":AssignCategories()}}})} function GetComponentsList(a){a=a.split("get_components_");$("#component_list_block_"+a[1]).removeClass("hidden");$("#component_list_block_"+a[1]).html(' getting the list...');history.replaceState(null,null,"?mi=menu_pages");ajaxFunction("GetComponentsList","",a[1])} function GetCKVersion(){console.log("AJAX start - GetCKVersion...");$.ajax({type:"POST",url:"contentkingajax.php",data:"de_action=GetCKVersion",dataType:"json",async:!0,success:function(a){console.log("AJAX return - GetCKVersion..."+a);$("#ckversion").html(" | "+a)}})} function GetCommentsForModeration(){$("#comments_block").removeClass("hidden");$("#manage_comments_block").html(' Getting comments for moderation, please wait...getting this content, please wait...
getting your files list, please wait...
getting your files list, please wait...
Here are your files. '+e+" You can click on a column heading to sort.
"; b+=''+$("#page_title_"+b[0]).html()+"",a,"",!0))},error:function(a){alert("Oops! Something went wrong in getting content - our crew has been informed and will be working on a fix immediately.");SetupErrorReport("GetRelatedContent: Oops! Something went wrong in getting content - our crew has been informed and will be working on a fix immediately.")}})} function GetUserDetails(a){$.ajax({type:"POST",url:"contentkingajax.php",data:"de_action=GetUserDetails&de_id="+a,dataType:"json",async:!0,success:function(b){$.current_user=b;$("#modal_header_UserDeets").html("Edit User Details: "+$.current_user.user_first_name+" "+$.current_user.user_last_name);$("#opening_statement_UserDeets").html("Please make your changes and use the buttons to save or cancel...");$("#user_edit_first_name").val($.current_user.user_first_name);$("#user_edit_last_name").val($.current_user.user_last_name); $("#user_edit_nickname").val($.current_user.nickname);$("#user_edit_email_address").val($.current_user.email_address);$("#user_edit_dudes_id").val($.current_user.user_id_number);$("#user_deets_advanced_block").addClass("hidden");$("#user_deets_adv_show").removeClass("hidden");history.replaceState(null,null,"?mi=menu_users&ui="+a);$("#validation_statement_UserDeets").html("");$("#ckUserDeets").modal()},error:function(a){alert("Oops! Something went wrong when getting this user's details - our crew has been informed and will be working on a fix immediately. Sorry about that."); SetupErrorReport("GetUserDetails: Oops! Something went wrong when getting this user's details - our crew has been informed and will be working on a fix immediately. Sorry about that.")}})} function GetUsers(a,b,c){history.replaceState(null,null,"?mi=menu_users");$("#users_block").removeClass("hidden");$("#users_list_block").html(' getting user list...');$.ajax({type:"POST",url:"contentkingajax.php",data:"de_action=GetUsers&de_id="+b+"&de_st="+a+"&de_date_info="+c,dataType:"json",async:!0,success:function(c){$("#users_list_block").html(c);$(".edit_user").click(function(){GetUserDetails(this.id)});history.replaceState(null,null,"?mi=menu_users&st="+a+ "&ug="+b)},error:function(a){alert("Oops! Something went wrong when getting the user list - our crew has been informed and will be working on a fix immediately. Sorry about that.");SetupErrorReport("GetUsers: Oops! Something went wrong when getting the user list - our crew has been informed and will be working on a fix immediately. Sorry about that.")}})}function PreviewObject(a){window.open("../preview.php?cN="+a,"_blank")} function PreviewObjectFromList(a){a=a.split("preview_object_");window.open("../preview.php?cN="+a[1],"_blank")} function RemoveComponentAssignment(a,b){console.log("RemoveComponentAssignment: "+a+", is parent?: "+$("#"+a).attr("is_parent_block")+", is_related?: "+b);$.ajax({type:"POST",url:"contentkingajax.php",data:"de_action=RemoveComponentAssignment&de_data="+a,dataType:"json",async:!0,success:function(c){"DONE"==c?(console.log("success of RemoveComponentAssignment...de_id: "+a+", is_related?: "+b),b?(c=a.split("removerelated_"),$("#related_assignment_row_"+c[1]).fadeOut(300,function(){$(this).remove()})): ($("#assignment_row_"+a).remove(),ShowModal("Assignment removed","This item has been removed from this block.
"),setTimeout(function(){$("#ckModal").modal("hide")},1E3))):alert("Ouch, fail in removal, our team has been notified and we will try and solve that straight away.")},error:function(a){$("#info_block").html("");alert("Oops! Something went wrong removing this item - our crew has been informed and will be working on a fix immediately.");SetupErrorReport("RemoveComponentAssignment: Oops! Something went wrong removing this item - our crew has been informed and will be working on a fix immediately.")}})} function SaveAssignmentsForRelatedContent(){console.log("SaveAssignmentsForRelatedContent, object_id_list: "+$("#object_id_list").val()+", de_related_blocks: "+de_related_blocks);if($("#showforeva").is(":checked")||CheckDatePickerDates()){var a=0;$("#showforeva").is(":checked")||(a=GetTimeStampFromDatePicker("to",!0));var b=GetTimeStampFromDatePicker("from",!0),c=$("#object_id_list").val().split("|"),d=$("#related_parent_obj_id").val(),e=$("#page_id").val(),f=$("#component_id").val();$("#webpage_url_"+ $("#page_id").val()).html();$("#ckAssignContent").modal("hide");ShowModal("Assigning multiple content","",'Great ability develops and reveals itself increasingly with every new assignment - Baltasar Gracian',!1);for(var g=[],h=0;hWell done!
");else{console.log("Gabb debug: "+a);var b=de_related_blocks.split("|rb|")[a].split("^");a=b[0];var c=b[1],b=b[2];console.log("So now we have de_web_page_id: "+a+", de_block_id: "+c+", de_block_type: "+b+", object_id_list: "+object_id_list);PresentObjectListForRelatedContent(a,c,b)}else ShowModal("Save successful","Your assignment has been made!
"),setTimeout(function(){$("#ckModal").modal("hide")}, 1E3)},error:function(a){console.log("Ajax fail return SaveBlockContent..."+a);alert("Oops! Something went wrong assigning these items - our crew has been informed and will be working on a fix immediately.");SetupErrorReport("AssignMultipleContentSave (SaveBlockContent): Oops! Something went wrong assigning these items - our crew has been informed and will be working on a fix immediately.")}})}else alert("Hey, your date to needs to be after your date from!")} function SaveContentObject(){ShowInfo('saving this content, please wait...
Excellent! We've saved your content for "+decodeURIComponent(a.content_name)+'! Here are some possible actions you might like to perform;
'), $("#post_save_assign").unbind("click"),$("#post_save_assign").click(function(){AssignContentObject("assign_content_"+a.content_object_id)}),$("#post_save_preview").unbind("click"),$("#post_save_preview").click(function(){PreviewObject(a.content_object_id)}),$("#post_save_edit").unbind("click"),console.log("Check of co num: "+a.content_object_id),$("#post_save_edit").click(function(){GetContentObjectDetails(a.content_object_id)})))},error:function(a){$("#info_block").html("");alert("Oops! Something went wrong saving this item - our crew has been informed and will be working on a fix immediately."); SetupErrorReport("SaveContentObject: Oops! Something went wrong saving this item - our crew has been informed and will be working on a fix immediately.")}})} function SaveUserDetails(){var a=[];$("#user_edit_first_name").val()||a.push("First name is required");$("#user_edit_last_name").val()||a.push("Last name is required");$("#user_edit_email_address").val()?validateEmail($("#user_edit_email_address").val())||a.push("An valid email address is required"):a.push("An email address is required");if(a.length){for(var b='please wait as we save this file...
', "Patience is not simply the ability to wait - it's how we behave while we're waiting - Joyce Meyer",!1,!0),a="de_action=SaveFileDetails&de_data="+JSON.stringify(current_file),$.ajax({type:"POST",url:"contentkingajax.php",data:a,dataType:"json",async:!0,success:function(a){if("YIKES"!=a)if(console.log("AJAX return - SaveFileDetails..."+a.file_number+", file_list_action: "+file_list_action),$("#ckModal").modal("hide"),"OUCH"==a)alert("Ouch, problem with Save File."); else{var c="";switch(file_list_action){case "abbrev":case "main":case "webblock":case "cat":case "catgroup":c+='please wait as we save this page...
','"The pages are still blank, but there is a miraculous feeling of the words being there, written in invisible ink and clamoring to become visible" - Vladimir Nabokov', !1,!0);var a="de_action=SaveWebPage&de_id="+$("#web_page_edit_id").val()+"&de_data="+$("#web_page_title").val()+"|"+$("#web_page_rank").val();$.ajax({type:"POST",url:"contentkingajax.php",data:a,dataType:"json",async:!0,success:function(a){console.log("AJAX return - SaveWebPageEdit..."+a);"BRILL"==a?($("#page_title_"+$("#web_page_edit_id").val()).text($("#web_page_title").val()),$("#page_rank_"+$("#web_page_edit_id").val()).text($("#web_page_rank").val()),$("#ckmodal_body").html('Saved!
'), setTimeout(function(){$("#ckModal").modal("hide")},1E3)):(console.log("Ouch: "+a),alert("Sorry, there was a problem saving this page, our team has been informed and will be looking into it real quick."))},error:function(a){$("#info_block").html("");alert("Oops! Something went wrong saving this page - our crew has been informed and will be working on a fix immediately.");SetupErrorReport("SaveWebPageEdit: Oops! Something went wrong saving this page - our crew has been informed and will be working on a fix immediately.")}})} function Setup(a){a&&$("#web_pages_block").removeClass("hidden");$.now();$.ajax({type:"POST",url:"contentkingajax.php",data:"de_action=Setup",dataType:"json",async:!0,success:function(b){console.log("AJAX return - Setup...show_results?: "+a);if("yikes!"==b)alert("Sorry, there was a problem with setup, our team has been informed and will be looking into it real quick.");else{$.now();var c=b.split("|||");b=c[0];var d=c[1],c=c[2];$("#assign_block").html(b);$("#web_page_list").html(d);$("#user_list_user_group_dropdown").html(c); $("#user_group_filter").selectpicker();$(".preview_object_button").unbind("click");$(".preview_object_button").click(function(){PreviewObject($(this).attr("obj"))})}GetObjectCatDropdown();GetSpecialObjectTypeDropdown();GetSiteImageDimensions();GetCKVersion()}})}function SetupErrorReport(a){$("#ckErrorReport").modal();$("#ckErrorMessage").val(a);$("#save_err").text("Send Error Report")} function SendCKErrorMsg(a,b,c){$("#save_err").text("sending...");console.log("About to send error report, file: "+c+", comment: "+b);$.ajax({type:"POST",url:"contentkingajax.php",data:"de_action=SendMyErrorReport&de_val="+a+"~|~"+b+"~|~"+c,dataType:"json",async:!0,success:function(a){$("#ckErrorReport").modal("hide");$("#save_err").text("SAVE");"yikes!"==a?alert("Sorry, there was a problem with sending the error message, our team has been informed and will be looking into it real quick."):alert("Report sent!"); $("#save_err").unbind("click");$("#save_err").text("SAVE")}})} function ShowContentObject(a,b){console.log("ShowContentObject, de_object: "+a.content_name+", "+a.content_object_id);var c=CKEDITOR.instances.content_text;c&&(console.log("destroying"),c.destroy(!1));if(c=CKEDITOR.instances.abbrev_text)console.log("destroying"),c.destroy(!1);$("#content_text").ckeditor({custom_config:"ckeditor_config.js",width:"100%",toolbar:"CK_PWR"});$("#abbrev_text").ckeditor({height:"100px",toolbar:"Basic"});$("#abbrev_img").removeClass("fadie");$("#main_img").removeClass("fadie"); $.current_content_object=a;$("#content_text").val($.current_content_object.content_text);$("#content_title").val($.current_content_object.content_title);$("#byline_text").val($.current_content_object.byline_text);$("#content_name").val($.current_content_object.content_name);$("#abbrev_title").val($.current_content_object.abbrev_title);$("#abbrev_text").val($.current_content_object.abbrev_text);$("#meta_tags").val($.current_content_object.meta_tags);$("#meta_description").val($.current_content_object.synopsis_text); $("#content_object_id").val($.current_content_object.content_object_id);$("#content_object_cats_block").html($.current_content_object.content_categories_table_html);$("#cat_list").val($.current_content_object.content_categories_list);$("#meta_tags").val($.current_content_object.content_metatags);console.log("content_files: "+$.current_content_object.content_files.length);console.log("object type: "+$.current_content_object.content_object_type);OutputObjectFileTable();$("#stats_desc").html("This item is not currently assigned to any page blocks"); 0==$.current_content_object.content_object_id?($("#edit_object_object_types").val("C"),$("#object_heading").html("New Content Object"),stats_desc=""):($("#edit_object_object_types").val($.current_content_object.content_object_type),$.current_content_object.stats.length&&$("#stats_desc").html("This item currently assigned to "+$.current_content_object.stats.length+' page blocks - click for details'),$("#object_heading").html("Edit Content Object"));$("#edit_object_object_types").selectpicker("refresh"); b&&$("#object_heading").html('New Content Object copy of '+$("#content_name").val()+"");$("#abbrev_img").html("");$("#abbrev_img").removeClass("removed");$.current_content_object.abbr_image.file.file_location?($("#add_abbrev_img").text("Change image"),$("#remove_abbrev_img").removeClass("hidden"),$("#abbrev_img").html(''),$("#abbrev_img_id").val($.current_content_object.abbr_image.file.file_number)): ($("#add_abbrev_img").text("Add image"),$("#remove_abbrev_img").addClass("hidden"),$("#abbrev_img_id").val(""),$("#abbrev_img").removeClass("fadie"),$("#abbrev_img").html(""));$("#main_img").html("");$("#main_img").removeClass("removed");$.current_content_object.main_image.file.file_location?($("#add_main_img").text("Change image"),$("#remove_main_img").removeClass("hidden"),$("#main_img").html(''),console.log("main: "+$.current_content_object.main_image.file.file_number+ ", align: "+$.current_content_object.main_image.alignment_ind),$("#main_img_id").val($.current_content_object.main_image.file.file_number)):($("#add_main_img").text("Add image"),$("#remove_main_img").addClass("hidden"),$("#main_img_id").val(""),$("#main_img").removeClass("fadie"),$("#main_img").html(""));$.current_content_object.comments_allowed?$("#comments_allowed").prop("checked",!0):$("#comments_allowed").prop("checked",!1);$.current_content_object.next_comment_seq?($("#comments_link_button").html(' View comments ('+ $.current_content_object.next_comment_seq+")"),$("#comments_link_block").removeClass("hidden")):$("#comments_link_block").addClass("hidden");$("#preview_object_button").attr("obj",$.current_content_object.content_object_id);$(".preview_object_button").unbind("click");$(".preview_object_button").click(function(){PreviewObject($(this).attr("obj"))});$("#stat_deets_link").unbind("click");$("#stat_deets_link").click(function(){ShowObjectStats()});$("#info_block").addClass("hidden");$("#object_block").removeClass("hidden"); $("#content_name").unbind("keyup");$("#content_title").val()||$("#content_name").val()||$("#content_name").keyup(function(){$("#content_title").val(this.value);$("#abbrev_title").val(this.value)});$("#abbrev_copy").addClass("hidden");$("#main_copy").addClass("hidden");$("#name_copy").addClass("hidden");$("#content_title").focus(function(){$("#content_name").unbind("keyup");$("#abbrev_copy").removeClass("hidden");$("#main_copy").removeClass("hidden");$("#name_copy").removeClass("hidden")});$("#assign_to_content_checkbox").attr("checked", !1);history.replaceState(null,null,"?mi=menu_gco&co="+$.current_content_object.content_object_id);$("html, body").animate({scrollTop:$("#object_block").offset().top-70},200)}function ShowInfo(a){$("#info_block").html('Page | Block | From | To | Viewed | Selected | '+$.current_content_object.stats[c].web_title+" | "+$.current_content_object.stats[c].component_name+' | '+$.current_content_object.stats[c].nice_date_from+' | '+$.current_content_object.stats[c].nice_date_to+' | '+$.current_content_object.stats[c].times_viewed+' | '+$.current_content_object.stats[c].times_selected+" | ";ShowModal("Stats for "+$.current_content_object.content_name, b+"
---|
File uploaded - excellent!
Please enter details of this file and save...
"); $("#file_location").val(b);$("#file_type").val(e);$("#file_uploaded").val("yeha")}else alert("There was an error during file upload! - "+d);return!0}function getFileName(a){$(a).val()} function UpdateObjectListOnSaveContentObject(a){$("#object_list_item_"+a.content_object_id+" td:eq(1)").html(decodeURIComponent(a.content_name));$("#object_list_item_"+a.content_object_id+" td:eq(2)").html(decodeURIComponent(a.content_title));console.log("UpdateObjectListOnSaveContentObject..."+a.content_object_id);$(".object_in_page").each(function(){$(this).html()==a.content_object_id&&$(this).parent().find(".object_name_in_page").text(decodeURIComponent(a.content_title));$(this).next(".object_name_in_page").html("gabbie!")})} function UpdateUserDateRange(){$("#ckUserDateRangeStatement").html($("#userDateSearchFrom").val()+' to '+$("#userDateSearchTo").val()+' by date '+$("input[name=user_date_type_selection]:checked").val()+"Please select the block you wish to assign this content to...
"+b);$(".web_block_link").unbind("click");$(".web_block_link").click(function(){SetAssignContentDetails(this.id)});break;case "GetComponentsList":$("#component_list_block_"+c).html(b)}},error:function(a){alert("Oops! Something went wrong, please try again...")}})}function encode(a){a=-1Standard Composite Text by The Curranator - watch this space
";c="CTA Single Item with Main Img BG";break;case "E_122":b='Standard Composite List output with the exception that the Abbreviated Image is output as a background image. This is helpful for CTA (Call to Action) type blocks where you wish to present nice graphics but with text overlays. Having the image as a background image allows for easy responsive design.
Below is an example of the output the code (this is one list item of the Composite List)
<li>
<a href="[LINK TO THE ARTICLE]" target="_self" >
<div class="backgroundImage" style="background: url([URL OF THE ABBREVIATED IMAGE]) 50% 50% / cover no-repeat;">
<div class="textblock">
<h1>[ABBREVIATED HEADING]</h1>
<h2>[BYLINE]</h2>
</div>
</div>
</a>
</li>
Below is an example of how a styled version of this code can look;
'; c="CTA List with Abbr Img BG";break;case "F_120":b='This block will output each assigned Content Object as a Bootstrap Carousel slide, using the Main Image as the slide image and displaying the Content Object\'s Main Text as the caption.
This block outputs each assigned Content Object as stand-alone Image Galley using the Royal Slider jQuery plugin, so make sure your page displaying these Image Galleries has all the appropriate files and code associated.
Example of some code
';
c="Royal Slider Image Gallery";break;case "A_110":b='This great little block type will look at the end date of the assigned Content Object and convert it - via javascript - to a nifty little countdown timer.
You will need the following files to be called in the page you intend to show this countdown timer;
Below is the code to include in your page (wrap in page load functionality);
$.each($(".ck_countdown_timer"), function(){
var s = this.id.split("_")[1].split("-");
var dt = new Date(0);
dt.setUTCSeconds($("#ckct_"+s[0]+"-"+s[1]).html());
$("#ckctd_"+s[0]+"-"+s[1]).countdown({until: dt});
});
This countdown timer is output such that you can target the various elements to style it to your heart\'s delight.
', c="Javscript Countdown Timer"}ShowModal('Special Block Type: '+c+"",b,'"The four building blocks of the universe are fire, water, gravel and vinyl" - Dave Barry',!0,!1)};