This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from draftjs_exporter.dom import DOM | |
from .models import ArticleImage | |
import sys | |
from wagtail.admin.rich_text.converters.html_to_contentstate import AtomicBlockEntityElementHandler | |
from wagtail.admin.rich_text.converters.contentstate_models import Entity | |
from wagtail.images.formats import get_image_format | |
from wagtail.images.shortcuts import get_rendition_or_not_found | |
# Front-end conversion |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from wagtail.core import hooks | |
import wagtail.admin.rich_text.editors.draftail.features as draftail_features | |
from draftjs_image_handler.rich_text_images import \ | |
ContentstateImageConversionRule, \ | |
image_embedtype_handler | |
@hooks.register('register_rich_text_features', order=1) | |
def register_image_paste_feature(features): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const React = window.React; | |
const imageUpload = (data, successCallback) => | |
{ | |
// Do the upload first, then call the callback with the final image data. | |
//send 'data' to server and let view handle image as a file upload | |
//pass file data back into uploadedImageData | |
const jsonData = JSON.stringify(data); | |
//using a separate js hook to load csrftoken var from cookie |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.http import JsonResponse | |
from django.views import View | |
from .models import ArticleImage | |
import logging, json | |
logger = logging.getLogger(__name__) | |
class BasicUploadView(View): | |
def post(self, request): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
from django.core.files import File | |
from article_viewer.models import ArticlePage | |
from wagtail.images.models import Image, AbstractImage, AbstractRendition | |
from urllib import request | |
import os | |
class ArticleImage(AbstractImage): | |
# Only one ArticleImage per article can be set as Primary: it is used as the hero image |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//in PlayerController.cs | |
private void RPCUseDoor(BeardedManStudios.Forge.Networking.RpcArgs obj) | |
{ | |
InteractionTypes useType = (InteractionTypes)obj.GetNext<int>(); | |
Vector3 destination = obj.GetNext<Vector3>(); | |
TeleportTo(destination); | |
} | |
public void TeleportTo(Vector3 position) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am cerzi on github. | |
* I am cerzi (https://keybase.io/cerzi) on keybase. | |
* I have a public key ASBEogEVWW1a1Lmk27tWR9_hQ-WP9Efcq0YJezoPdeK0tgo | |
To claim this, I am signing this object: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using ModestTree; | |
namespace Zenject | |
{ | |
public class ZenAutoInjecter : MonoBehaviour | |
{ | |
[SerializeField] | |
ContainerSources _containerSource = ContainerSources.SearchHierarchy; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Each scene: | |
Find object: Dialogue_Main_Dialogue | |
Loop over each child object: | |
if S_CharacterDialogue: | |
- extract characterName, characterDialogue | |
if S_CharacterOptions | |
- extract characterName & optinoCaptions to top of container | |
- create '[CharName]: optionCaption[0]' heading | |
- Loop over each child object: |