Git Product home page Git Product logo

porky's People

Contributors

ondics avatar philippschreiber avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

porky's Issues

Don't pollute the global namespace

Actually, you use a global settings object, which could be prevented.
Also, all the functions are made public.

You could wrap them in a porky object to keep the namespace clean.
For compatibility reasons you could export the functions to the global namespace.

Documentation 404

The documentation link under the project description leads to a 404 page. It appears that you migrated your website content to GitHub but didn't include any documentation. Please add it!

Placing data from MySQL only working one at a time

I've tried your library to improve the speed of importing data using a database source since I was using Excel and it was not fast enough considering that my project has 600+ link imported from the same Excel file. I wrote bits of code just inside a loop to test the speed of your implementation but it's even slower. The question that bothers me: Is it possible to write the code to do multiple queries to the database and to do multiple placements inside the Indesign document at the same time.

remove of uncomment commented code

move repeated code to functions with parameters

this if/else https://github.com/Schreiber-und-Freunde/porky/blob/master/app/porky/bin/porky.jsx#L200

and this https://github.com/Schreiber-und-Freunde/porky/blob/master/app/porky/bin/porky.jsx#L217

look the same, if they are equal move them to a function and use it in both places.

the same for:

https://github.com/Schreiber-und-Freunde/porky/blob/master/app/porky/bin/porky.jsx#L205

and

https://github.com/Schreiber-und-Freunde/porky/blob/master/app/porky/bin/porky.jsx#L222
they seem to only differ on the object path, so something like:

function setOrAddAttr(xmlAttrs, value) {
    if (!xmlAttrs.item(key).isValid) {
        xmlAttrs.add(key, value);
    }else{
        xmlAttrs.item(key).value = value;
    }
}

function setOrAddSyncScript(xmlAttrs, syncScript) {
    setOrAddAttr(xmlAttrs, "syncScript", syncScript);
}

function setOrAddSyncIdentifier(xmlAttrs, syncIdentifier) {
    setOrAddAttr(xmlAttrs, "syncIdentifier", syncIdentifier);
}

and call it as

setOrAddSyncScript(tagObject.associatedXMLElement.xmlAttributes, syncScript);
setOrAddSyncScript(tagObject.parentStory.associatedXMLElement.xmlAttributes, syncScript);

and

setOrAddSyncIdentifier(tagObject.associatedXMLElement.xmlAttributes, syncIdentifier);
setOrAddSyncIdentifier(tagObject.parentStory.associatedXMLElement.xmlAttributes, syncIdentifier);

unify for iteration

in some places it's like this

https://github.com/Schreiber-und-Freunde/porky/blob/master/app/porky/bin/porky.jsx#L172

and some others like this

https://github.com/Schreiber-und-Freunde/porky/blob/master/app/porky/bin/porky.jsx#L172

the preferred way is

for (var i = 0; i < items.length; i += 1) { ... }

or

var item;
for (var i = 0, len = items.length; i < len; i += 1) { 
    item = items[i];
    // do something with them
 }

where items is the array you want to iterate and item is a variable with a name that describe what item is

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.