Probleme mit der Code-Funktionalität

Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

  • Probleme mit der Code-Funktionalität

    Hallo,

    also mit dem neuen Layout sehen Quelltexte soweit toll aus. Auch das Falten vom Code hat sich meiner Meinung voll rentiert.
    Nochmals danke dafür…

    Leider habe ich aber oft Probleme beim Einstellen von Codes.
    Andere haben das scheinbar auch.

    Nach dem der Beitrag abgesandt wurde ist der Code nu noch "Brei".
    Einschübe werden nicht dargestellt und Zeilenumbrüche gehen verloren.

    Beim manuellen Einfügen, also mit ]code[ und ]/code[ verschwindet bei mir die Formatierung nach dem Absenden.
    Verwende ich den Editor vom Forum, dann legt sich wieder ein neues Editor-Layer beim Bestätigen drüber. Also das summiert sich irgendwie auf.

    Wäre toll, wenn ihr mal schauen könnten "was da abgehet"…

    Viele Grüße
  • Test.


    PHP-Quellcode: Blub

    1. if (isset($db))
    2. $conn->selectDB($db);
    3. if (isset($_POST['query']))
    4. $query = $_POST['query'];
    5. echo '<div style="padding-left: 5px">';
    6. if (isset($db)) {
    7. echo '<span style="color: rgb(135, 135, 135)">' . sprintf(__("Run a query on the %s database"), $db) . '.</span>';
    8. }
    9. if (isset($query)) {
    10. $displayQuery = $query;
    11. } else if (isset($db) && isset($table) && $conn->getAdapter() == "mysql") {
    12. $displayQuery = "SELECT * FROM `$table` LIMIT 100";
    13. } else if (isset($db) && isset($table) && $conn->getAdapter() == "sqlite") {
    14. $displayQuery = "SELECT * FROM '$table' LIMIT 100";
    15. }
    Alles anzeigen

    JavaScript-Quellcode

    1. album.getID = function() {
    2. var id;
    3. if (photo.json) id = photo.json.album;
    4. else if (album.json) id = album.json.id;
    5. else id = $('.album:hover, .album.active').attr('data-id');
    6. // Search
    7. if (!id) id = $('.album:hover, .album.active').attr('data-id');
    8. if (!id) id = $('.photo:hover, .photo.active').attr('data-album-id');
    9. if (id) return id;
    10. else return false;
    11. }
    12. album.load = function(albumID, refresh) {
    13. var startTime,
    14. params,
    15. durationTime,
    16. waitTime;
    17. password.get(albumID, function() {
    18. if (!refresh) {
    19. lychee.animate('.album, .photo', 'contentZoomOut');
    20. lychee.animate('.divider', 'fadeOut');
    21. }
    22. startTime = new Date().getTime();
    23. params = 'getAlbum&albumID=' + albumID + '&password=' + password.value;
    24. lychee.api(params, function(data) {
    25. if (data==='Warning: Album private!') {
    26. if (document.location.hash.replace('#', '').split('/')[1]!=undefined) {
    27. // Display photo only
    28. lychee.setMode('view');
    29. } else {
    30. // Album not public
    31. lychee.content.show();
    32. lychee.goto('');
    33. }
    34. return false;
    35. }
    36. if (data==='Warning: Wrong password!') {
    37. album.load(albumID, refresh);
    38. return false;
    39. }
    40. album.json = data;
    41. // Calculate delay
    42. durationTime = (new Date().getTime() - startTime);
    43. if (durationTime>300) waitTime = 0;
    44. else waitTime = 300 - durationTime;
    45. // Skip delay when refresh is true
    46. // Skip delay when opening a blank Lychee
    47. if (refresh===true) waitTime = 0;
    48. if (!visible.albums()&&!visible.photo()&&!visible.album()) waitTime = 0;
    49. setTimeout(function() {
    50. view.album.init();
    51. if (!refresh) {
    52. lychee.animate('.album, .photo', 'contentZoomIn');
    53. view.header.mode('album');
    54. }
    55. }, waitTime);
    56. });
    57. });
    58. }
    59. album.parse = function() {
    60. if (!album.json.title) album.json.title = 'Untitled';
    61. }
    62. album.add = function() {
    63. var title,
    64. params,
    65. buttons,
    66. isNumber = function(n) { return !isNaN(parseFloat(n)) && isFinite(n) };
    67. buttons = [
    68. ['Create Album', function() {
    69. title = $('.message input.text').val();
    70. if (title.length===0) title = 'Untitled';
    71. modal.close();
    72. params = 'addAlbum&title=' + escape(encodeURI(title));
    73. lychee.api(params, function(data) {
    74. // Avoid first album to be true
    75. if (data===true) data = 1;
    76. if (data!==false&&isNumber(data)) {
    77. albums.refresh();
    78. lychee.goto(data);
    79. } else {
    80. lychee.error(null, params, data);
    81. }
    82. });
    83. }],
    84. ['Cancel', function() {}]
    85. ];
    86. modal.show('New Album', "Enter a title for this album: <input class='text' type='text' maxlength='30' placeholder='Title' value='Untitled'>", buttons);
    87. }
    88. album.delete = function(albumIDs) {
    89. var params,
    90. buttons,
    91. albumTitle;
    92. if (!albumIDs) return false;
    93. if (albumIDs instanceof Array===false) albumIDs = [albumIDs];
    94. buttons = [
    95. ['', function() {
    96. params = 'deleteAlbum&albumIDs=' + albumIDs;
    97. lychee.api(params, function(data) {
    98. if (visible.albums()) {
    99. albumIDs.forEach(function(id) {
    100. albums.json.num--;
    101. view.albums.content.delete(id);
    102. delete albums.json.content[id];
    103. });
    104. } else {
    105. albums.refresh();
    106. lychee.goto('');
    107. }
    108. if (data!==true) lychee.error(null, params, data);
    109. });
    110. }],
    111. ['', function() {}]
    112. ];
    113. if (albumIDs.toString()==='0') {
    Alles anzeigen
  • Test 2

    JavaScript-Quellcode: lychee

    1. build.album = (data) ->
    2. return '' if not data?
    3. title = data.title
    4. longTitle = ''
    5. typeThumb = ''
    6. if title? and title.length > 18
    7. title = data.title.substr(0, 18) + '...'
    8. longTitle = data.title
    9. if data.thumb0.split('.').pop() is 'svg' then typeThumb = 'nonretina'
    10. html = """
    11. <div class='album' data-id='#{ data.id }' data-password='#{ data.password }'>
    12. <img src='#{ data.thumb2 }' width='200' height='200' alt='thumb' data-type='nonretina'>
    13. <img src='#{ data.thumb1 }' width='200' height='200' alt='thumb' data-type='nonretina'>
    14. <img src='#{ data.thumb0 }' width='200' height='200' alt='thumb' data-type='#{ typeThumb }'>
    15. <div class='overlay'>
    16. """
    17. if data.password and lychee.publicMode is false
    18. html += "<h1 title='#{ longTitle }'><span class='icon-lock'></span> #{ title }</h1>";
    19. else
    20. html += "<h1 title='#{ longTitle }'>#{ title }</h1>"
    21. html += """
    22. <a>#{ data.sysdate }</a>
    23. </div>
    24. """
    25. if lychee.publicMode is false
    26. if data.star is '1' then html += "<a class='badge icon-star'></a>"
    27. if data.public is '1' then html += "<a class='badge icon-share'></a>"
    28. if data.unsorted is '1' then html += "<a class='badge icon-reorder'></a>"
    29. if data.recent is '1' then html += "<a class='badge icon-time'></a>"
    30. html += "</div>"
    31. return html
    32. build.photo = (data) ->
    33. return '' if not data?
    34. title = data.title
    35. longTitle = ''
    36. if title? and title.length > 18
    37. title = data.title.substr(0, 18) + '...'
    38. longTitle = data.title
    39. html = """
    40. <div class='photo' data-album-id='#{ data.album }' data-id='#{ data.id }'>
    41. <img src='#{ data.thumbUrl }' width='200' height='200' alt='thumb'>
    42. <div class='overlay'>
    43. <h1 title='#{ longTitle }'>#{ title }</h1>
    44. """
    45. if data.cameraDate is '1'
    46. html += "<a><span class='icon-camera' title='Photo Date'></span>#{ data.sysdate }</a>"
    47. else
    48. html += "<a>#{ data.sysdate }</a>"
    49. html += "</div>"
    50. if data.star is '1' then html += "<a class='badge icon-star'></a>"
    51. if lychee.publicMode is false and data.public is '1' and album.json.public isnt '1' then html += "<a class='badge icon-share'></a>"
    52. html += "</div>"
    53. return html
    54. build.imageview = (data, size, visibleControls) ->
    55. return '' if not data?
    56. html = """
    57. <div class='arrow_wrapper previous'><a id='previous' class='icon-caret-left'></a></div>
    58. <div class='arrow_wrapper next'><a id='next' class='icon-caret-right'></a></div>
    59. """
    60. if size is 'big'
    61. if visibleControls is true
    62. html += "<div id='image' style='background-image: url(#{ data.url })'></div>"
    63. else
    64. html += "<div id='image' style='background-image: url(#{ data.url });' class='full'></div>"
    65. else if size is 'medium'
    66. if visibleControls is true
    67. html += "<div id='image' style='background-image: url(#{ data.medium })'></div>"
    68. else
    69. html += "<div id='image' style='background-image: url(#{ data.medium });' class='full'></div>"
    70. else if size is 'small'
    71. if visibleControls is true
    72. html += "<div id='image' class='small' style='background-image: url(#{ data.url }); width: #{ data.width }px; height: #{ data.height }px; margin-top: -#{ parseInt(data.height/2-20) }px; margin-left: -#{ data.width/2 }px;'></div>"
    73. else
    74. html += "<div id='image' class='small' style='background-image: url(#{ data.url }); width: #{ data.width }px; height: #{ data.height }px; margin-top: -#{ parseInt(data.height/2) }px; margin-left: -#{ data.width/2 }px;'></div>"
    75. return html
    76. build.no_content = (typ) ->
    77. html = """
    78. <div class='no_content fadeIn'>
    79. <a class='icon icon-#{ typ }'></a>
    80. """
    81. switch typ
    82. when 'search' then html += "<p>No results</p>"
    83. when 'share' then html += "<p>No public albums</p>"
    84. when 'cog' then html += "<p>No configuration</p>"
    85. html += "</div>"
    86. return html
    87. build.modal = (title, text, button, marginTop, closeButton) ->
    88. if marginTop? then custom_style = "style='margin-top: #{ marginTop }px;'"
    89. else custom_style = ''
    90. html = """
    91. <div class='message_overlay fadeIn'>
    92. <div class='message center' #{ custom_style }>
    93. <h1>#{ title }</h1>
    94. """
    95. if closeButton isnt false then html += "<a class='close icon-remove-sign'></a>"
    96. html += "<p>#{ text }</p>"
    97. $.each button, (index) ->
    98. if this[0] isnt ''
    99. if index is 0 then html += "<a class='button active'>#{ this[0] }</a>"
    100. else html += "<a class='button'>#{ this[0] }</a>"
    101. html += """
    102. </div>
    103. </div>
    104. """
    105. return html
    106. build.signInModal = ->
    107. html = """
    108. <div class='message_overlay'>
    109. <div class='message center'>
    110. <h1><a class='icon-lock'></a> Sign In</h1>
    111. <a class='close icon-remove-sign'></a>
    112. <div class='sign_in'>
    113. <input id='username' type='text' value='' placeholder='username' autocapitalize='off' autocorrect='off'>
    114. <input id='password' type='password' value='' placeholder='password'>
    115. </div>
    116. <div id='version'>Version #{ lychee.version }<span> – <a target='_blank' href='#{ lychee.updateURL }'>Update available!</a><span></div>
    117. <a onclick='lychee.login()' class='button active'>Sign in</a>
    118. </div>
    119. </div>
    120. """
    121. return html
    122. build.uploadModal = (title, files) ->
    123. html = """
    124. <div class='upload_overlay fadeIn'>
    125. <div class='upload_message center'>
    126. <h1>#{ title }</h1>
    127. <a class='close icon-remove-sign'></a>
    128. <div class='rows'>
    129. """
    130. i = 0
    131. file = null
    132. while i < files.length
    133. file = files[i]
    134. if file.name.length > 40
    135. file.name = file.name.substr(0, 17) + '...' + file.name.substr(file.name.length-20, 20)
    136. html += """
    137. <div class='row'>
    138. <a class='name'>#{ lychee.escapeHTML(file.name) }</a>
    139. """
    140. if file.supported is true then html += "<a class='status'></a>"
    141. else html += "<a class='status error'>Not supported</a>"
    142. html += """
    143. <p class='notice'></p>
    144. </div>
    145. """
    146. i++
    147. html += """
    148. </div>
    149. </div>
    150. </div>
    151. """
    152. return html
    153. build.tags = (tags, forView) ->
    154. html = ''
    155. if forView is true or lychee.publicMode is true then editTagsHTML = ''
    156. else editTagsHTML = ' ' + build.editIcon('edit_tags')
    157. if tags isnt ''
    158. tags = tags.split ','
    159. tags.forEach (tag, index, array) ->
    160. html += "<a class='tag'>#{ tag }<span class='icon-remove' data-index='#{ index }'></span></a>"
    161. html += editTagsHTML
    162. else
    163. html = "<div class='empty'>No Tags#{ editTagsHTML }</div>"
    164. return html
    Alles anzeigen

    Lorem ipsum

    Manuell:

    JavaScript-Quellcode

    1. contextMenu.add = function(e) {
    2. var items = [
    3. { type: 'item', title: 'Upload Photo', icon: 'icon-picture', fn: function() { $('#upload_files').click() } },
    4. { type: 'separator' },
    5. { type: 'item', title: 'Import from Link', icon: 'icon-link', fn: upload.start.url },
    6. { type: 'item', title: 'Import from Dropbox', icon: 'icon-folder-open', fn: upload.start.dropbox },
    7. { type: 'item', title: 'Import from Server', icon: 'icon-hdd', fn: upload.start.server },
    8. { type: 'separator' },
    9. { type: 'item', title: 'New Album', icon: 'icon-folder-close', fn: album.add }
    10. ];
    11. basicContext.show(items, e);
    12. upload.notify();
    13. }
    14. contextMenu.settings = function(e) {
    15. var items = [
    16. { type: 'item', title: 'Change Login', icon: 'icon-user', fn: settings.setLogin },
    17. { type: 'item', title: 'Change Sorting', icon: 'icon-sort', fn: settings.setSorting },
    18. { type: 'item', title: 'Set Dropbox', icon: 'icon-folder-open', fn: settings.setDropboxKey },
    19. { type: 'separator' },
    20. { type: 'item', title: 'About Lychee', icon: 'icon-info-sign', fn: function() { window.open(lychee.website) } },
    21. { type: 'item', title: 'Diagnostics', icon: 'icon-dashboard', fn: function() { window.open('plugins/check/') } },
    22. { type: 'item', title: 'Show Log', icon: 'icon-list', fn: function() { window.open('plugins/displaylog/') } },
    23. { type: 'separator' },
    24. { type: 'item', title: 'Sign Out', icon: 'icon-signout', fn: lychee.logout }
    25. ];
    26. basicContext.show(items, e);
    27. }
    28. contextMenu.album = function(albumID, e) {
    29. if (albumID==='0'||albumID==='f'||albumID==='s'||albumID==='r') return false;
    30. var items = [
    31. { type: 'item', title: 'Rename', icon: 'icon-edit', fn: function() { album.setTitle([albumID]) } },
    32. { type: 'item', title: 'Delete', icon: 'icon-trash', fn: function() { album.delete([albumID]) } }
    33. ];
    34. $('.album[data-id="' + albumID + '"]').addClass('active');
    35. basicContext.show(items, e, contextMenu.close);
    36. }
    Alles anzeigen
    * Kann Spuren von Erdnüssen enthalten.
  • Mein Test:

    Quellcode

    1. -(void)applicationDidFinishLaunching:(NSNotification *)aNotification { // … NSLog(@"a: %@", [self importFileURL]); // … NSLog(@"b %@", [self exportFileURL]); // … [NSApp terminate:self]; // … } -(NSURL*)workspaceDirectoryURL { // … NSFileManager *fileManager = [NSFileManager defaultManager]; if(fileManager == nil) { return nil; } // … NSArray *array = [fileManager URLsForDirectory:NSDownloadsDirectory inDomains:NSUserDomainMask]; if([array count] < 1) { return nil; } // … NSURL *URL = [array objectAtIndex:0]; if(URL == nil) { return nil; } // … return URL; // … } -(NSURL*)fileURLWithName:(NSString*)name { // … if([name length] < 1) { return nil; } // … NSURL *URL = [self workspaceDirectoryURL]; if(URL == nil) { return nil; } // … URL = [URL URLByAppendingPathComponent:name isDirectory:NO]; // … return URL; // … } -(NSURL*)importFileURL { // … NSURL *URL = [self fileURLWithName:@"import.txt"]; if(URL == nil) { return nil; } // … return URL; // … } -(NSURL*)exportFileURL { // … NSURL *URL = [self fileURLWithName:@"export.txt"]; if(URL == nil) { return nil; } // … return URL; // … }



    C-Quellcode

    1. -(void)applicationDidFinishLaunching:(NSNotification *)aNotification
    2. {
    3. // …
    4. NSLog(@"a: %@", [self importFileURL]);
    5. // …
    6. NSLog(@"b %@", [self exportFileURL]);
    7. // …
    8. [NSApp terminate:self];
    9. // …
    10. }
    11. -(NSURL*)workspaceDirectoryURL
    12. {
    13. // …
    14. NSFileManager *fileManager = [NSFileManager defaultManager];
    15. if(fileManager == nil)
    16. {
    17. return nil;
    18. }
    19. // …
    20. NSArray *array = [fileManager URLsForDirectory:NSDownloadsDirectory
    21. inDomains:NSUserDomainMask];
    22. if([array count] < 1)
    23. {
    24. return nil;
    25. }
    26. // …
    27. NSURL *URL = [array objectAtIndex:0];
    28. if(URL == nil)
    29. {
    30. return nil;
    31. }
    32. // …
    33. return URL;
    34. // …
    35. }
    36. -(NSURL*)fileURLWithName:(NSString*)name
    37. {
    38. // …
    39. if([name length] < 1)
    40. {
    41. return nil;
    42. }
    43. // …
    44. NSURL *URL = [self workspaceDirectoryURL];
    45. if(URL == nil)
    46. {
    47. return nil;
    48. }
    49. // …
    50. URL = [URL URLByAppendingPathComponent:name
    51. isDirectory:NO];
    52. // …
    53. return URL;
    54. // …
    55. }
    56. -(NSURL*)importFileURL
    57. {
    58. // …
    59. NSURL *URL = [self fileURLWithName:@"import.txt"];
    60. if(URL == nil)
    61. {
    62. return nil;
    63. }
    64. // …
    65. return URL;
    66. // …
    67. }
    68. -(NSURL*)exportFileURL
    69. {
    70. // …
    71. NSURL *URL = [self fileURLWithName:@"export.txt"];
    72. if(URL == nil)
    73. {
    74. return nil;
    75. }
    76. // …
    77. return URL;
    78. // …
    79. }
    Alles anzeigen
  • little_pixel schrieb:

    Hallo,

    also mit dem neuen Layout sehen Quelltexte soweit toll aus. Auch das Falten vom Code hat sich meiner Meinung voll rentiert.
    Nochmals danke dafür…
    Das freut mich.

    little_pixel schrieb:

    Leider habe ich aber oft Probleme beim Einstellen von Codes.
    Andere haben das scheinbar auch.

    Nach dem der Beitrag abgesandt wurde ist der Code nu noch "Brei".
    Einschübe werden nicht dargestellt und Zeilenumbrüche gehen verloren.

    Beim manuellen Einfügen, also mit ]code[ und ]/code[ verschwindet bei mir die Formatierung nach dem Absenden.
    Verwende ich den Editor vom Forum, dann legt sich wieder ein neues Editor-Layer beim Bestätigen drüber. Also das summiert sich irgendwie auf.

    Wäre toll, wenn ihr mal schauen könnten "was da abgehet"…
    Ich schaue es mir gerne an, aber da werde ich nöchstens einen Bug-Report absenden können.


    little_pixel schrieb:

    Es ist nicht immer reproduzierbar, aber es passiert oft…

    Viele Grüße
    Hab ein wenig herumexperimentiert. Das Problem ist, dass ich es nicht reproduzieren kann.

    Welchen Browser verwendest Du? Hast Du irgendwelche Plug-Ins aktiviert? Kannst Du die mal komplett abschalten und noch mal versuchen. Kannst Du es mal mit einem anderen Browser testen?
  • beage schrieb:

    Ganz kryptisch wird es, wenn man Text gemischt mit Code zitiert und dann auch wieder mit Text und Code antwortet.

    beage schrieb:

    little_pixel schrieb:

    Dann hast Du das Problem auch?

    Dann bin ich zum Glück nicht der Sonderfall :D

    Viele Grüße
    Jo, gestern hat es mich extrem genervt.Ich verwende FF 37.0.1
    Scheint also browserunabhängig zu sein
    Kannst Du auch die PlugIns abschalten und noch mal probieren.
  • MacounFFM schrieb:

    beage schrieb:

    Ganz kryptisch wird es, wenn man Text gemischt mit Code zitiert und dann auch wieder mit Text und Code antwortet.

    beage schrieb:

    little_pixel schrieb:

    Dann hast Du das Problem auch?

    Dann bin ich zum Glück nicht der Sonderfall :D

    Viele Grüße
    Jo, gestern hat es mich extrem genervt.Ich verwende FF 37.0.1Scheint also browserunabhängig zu sein
    Kannst Du auch die PlugIns abschalten und noch mal probieren.
    Test OHNE Plugins
    Edit: Scheint zu gehen
    Edit2: Jetzt ein Code mit rein... Jetzt spielt Firfox verrückt. Siehe Anhang. Dann Beachball und Scriptfehler.
    Dateien
    Ich bin gegen Signaturen!!!
  • Test mit Zitat

    little_pixel schrieb:

    C-Quellcode

    1. -(void)applicationDidFinishLaunching:(NSNotification *)aNotification
    2. {
    3. // …
    4. NSLog(@"a: %@", [self importFileURL]);
    5. // …
    6. NSLog(@"b %@", [self exportFileURL]);
    7. // …
    8. [NSApp terminate:self];
    9. // …
    10. }
    11. -(NSURL*)workspaceDirectoryURL
    12. {
    13. // …
    14. NSFileManager *fileManager = [NSFileManager defaultManager];
    15. if(fileManager == nil)
    16. {
    17. return nil;
    18. }
    19. // …
    20. NSArray *array = [fileManager URLsForDirectory:NSDownloadsDirectory
    21. inDomains:NSUserDomainMask];
    22. if([array count] < 1)
    23. {
    24. return nil;
    25. }
    26. // …
    27. NSURL *URL = [array objectAtIndex:0];
    28. if(URL == nil)
    29. {
    30. return nil;
    31. }
    32. // …
    33. return URL;
    34. // …
    35. }
    36. -(NSURL*)fileURLWithName:(NSString*)name
    37. {
    38. // …
    39. if([name length] < 1)
    40. {
    41. return nil;
    42. }
    43. // …
    44. NSURL *URL = [self workspaceDirectoryURL];
    45. if(URL == nil)
    46. {
    47. return nil;
    48. }
    49. // …
    50. URL = [URL URLByAppendingPathComponent:name
    51. isDirectory:NO];
    52. // …
    53. return URL;
    54. // …
    55. }
    56. -(NSURL*)importFileURL
    57. {
    58. // …
    59. NSURL *URL = [self fileURLWithName:@"import.txt"];
    60. if(URL == nil)
    61. {
    62. return nil;
    63. }
    64. // …
    65. return URL;
    66. // …
    67. }
    68. -(NSURL*)exportFileURL
    69. {
    70. // …
    71. NSURL *URL = [self fileURLWithName:@"export.txt"];
    72. if(URL == nil)
    73. {
    74. return nil;
    75. }
    76. // …
    77. return URL;
    78. // …
    79. }
    Alles anzeigen
    * Kann Spuren von Erdnüssen enthalten.
  • Safari 8.0.3

    NSObject schrieb:

    JavaScript-Quellcode: lychee

    1. build.album = (data) ->
    2. return '' if not data?
    3. title = data.title
    4. longTitle = ''
    5. typeThumb = ''
    6. if title? and title.length > 18
    7. title = data.title.substr(0, 18) + '...'
    8. longTitle = data.title
    9. if data.thumb0.split('.').pop() is 'svg' then typeThumb = 'nonretina'
    10. html = """
    11. <div class='album' data-id='#{ data.id }' data-password='#{ data.password }'>
    12. <img src='#{ data.thumb2 }' width='200' height='200' alt='thumb' data-type='nonretina'>
    13. <img src='#{ data.thumb1 }' width='200' height='200' alt='thumb' data-type='nonretina'>
    14. <img src='#{ data.thumb0 }' width='200' height='200' alt='thumb' data-type='#{ typeThumb }'>
    15. <div class='overlay'>
    16. """
    17. if data.password and lychee.publicMode is false
    18. html += "<h1 title='#{ longTitle }'><span class='icon-lock'></span> #{ title }</h1>";
    19. else
    20. html += "<h1 title='#{ longTitle }'>#{ title }</h1>"
    21. html += """
    22. <a>#{ data.sysdate }</a>
    23. </div>
    24. """
    25. if lychee.publicMode is false
    26. if data.star is '1' then html += "<a class='badge icon-star'></a>"
    27. if data.public is '1' then html += "<a class='badge icon-share'></a>"
    28. if data.unsorted is '1' then html += "<a class='badge icon-reorder'></a>"
    29. if data.recent is '1' then html += "<a class='badge icon-time'></a>"
    30. html += "</div>"
    31. return html
    32. build.photo = (data) ->
    33. return '' if not data?
    34. title = data.title
    35. longTitle = ''
    36. if title? and title.length > 18
    37. title = data.title.substr(0, 18) + '...'
    38. longTitle = data.title
    39. html = """
    40. <div class='photo' data-album-id='#{ data.album }' data-id='#{ data.id }'>
    41. <img src='#{ data.thumbUrl }' width='200' height='200' alt='thumb'>
    42. <div class='overlay'>
    43. <h1 title='#{ longTitle }'>#{ title }</h1>
    44. """
    45. if data.cameraDate is '1'
    46. html += "<a><span class='icon-camera' title='Photo Date'></span>#{ data.sysdate }</a>"
    47. else
    48. html += "<a>#{ data.sysdate }</a>"
    49. html += "</div>"
    50. if data.star is '1' then html += "<a class='badge icon-star'></a>"
    51. if lychee.publicMode is false and data.public is '1' and album.json.public isnt '1' then html += "<a class='badge icon-share'></a>"
    52. html += "</div>"
    53. return html
    Alles anzeigen

    JavaScript-Quellcode

    1. contextMenu.add = function(e) {
    2. var items = [
    3. { type: 'item', title: 'Upload Photo', icon: 'icon-picture', fn: function() { $('#upload_files').click() } },
    4. { type: 'separator' },
    5. { type: 'item', title: 'Import from Link', icon: 'icon-link', fn: upload.start.url },
    6. { type: 'item', title: 'Import from Dropbox', icon: 'icon-folder-open', fn: upload.start.dropbox },
    7. { type: 'item', title: 'Import from Server', icon: 'icon-hdd', fn: upload.start.server },
    8. { type: 'separator' },
    9. { type: 'item', title: 'New Album', icon: 'icon-folder-close', fn: album.add }
    10. ];
    11. basicContext.show(items, e);
    12. upload.notify();
    13. }
    14. contextMenu.settings = function(e) {
    15. var items = [
    16. { type: 'item', title: 'Change Login', icon: 'icon-user', fn: settings.setLogin },
    17. { type: 'item', title: 'Change Sorting', icon: 'icon-sort', fn: settings.setSorting },
    18. { type: 'item', title: 'Set Dropbox', icon: 'icon-folder-open', fn: settings.setDropboxKey },
    19. { type: 'separator' },
    20. { type: 'item', title: 'About Lychee', icon: 'icon-info-sign', fn: function() { window.open(lychee.website) } },
    21. { type: 'item', title: 'Diagnostics', icon: 'icon-dashboard', fn: function() { window.open('plugins/check/') } },
    22. { type: 'item', title: 'Show Log', icon: 'icon-list', fn: function() { window.open('plugins/displaylog/') } },
    23. { type: 'separator' },
    24. { type: 'item', title: 'Sign Out', icon: 'icon-signout', fn: lychee.logout }
    25. ];
    26. basicContext.show(items, e);
    27. }
    28. contextMenu.album = function(albumID, e) {
    29. if (albumID==='0'||albumID==='f'||albumID==='s'||albumID==='r') return false;
    30. var items = [
    31. { type: 'item', title: 'Rename', icon: 'icon-edit', fn: function() { album.setTitle([albumID]) } },
    32. { type: 'item', title: 'Delete', icon: 'icon-trash', fn: function() { album.delete([albumID]) } }
    33. ];
    34. $('.album[data-id="' + albumID + '"]').addClass('active');
    35. basicContext.show(items, e, contextMenu.close);
    36. }
    Alles anzeigen
    Code

    C-Quellcode

    1. - (void)viewWillAppear:(BOOL)animated {
    2. [super viewWillAppear:animated];
    3. LOG_FRAME(@"home view", self.view.frame);
    4. LOG_FRAME(@"collection view", self.collectionView.frame);
    5. }
    6. - (void)viewDidAppear:(BOOL)animated {
    7. [super viewDidAppear:animated];
    8. // [self.collectionView reloadData];
    9. self.collectionView.frame = self.view.bounds;
    10. }
    11. #pragma mark - User Action
    12. #pragma mark -
    13. - (void)pickerButtonTapped:(UIButton *)button {
    14. // TODO: implement
    15. DebugLog(@"%@", NSStringFromSelector(_cmd));
    16. }
    17. - (void)starButtonTapped:(UIButton *)button {
    18. // TODO: implement
    19. DebugLog(@"%@", NSStringFromSelector(_cmd));
    20. button.selected = !button.selected;
    21. }
    22. - (void)directionsButtonTapped:(UIButton *)button {
    23. DebugLog(@"%@", NSStringFromSelector(_cmd));
    24. // TODO: implement
    25. }
    26. #pragma mark - UICollectionViewDataSource
    27. #pragma mark -
    28. - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
    29. // TODO: implement
    30. return 5;
    31. }
    32. // The cell that is returned must be retrieved from a call to -dequeueReusableCellWithReuseIdentifier:forIndexPath:
    33. - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
    34. // TODO: implement
    35. UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"BusStopCell" forIndexPath:indexPath];
    36. //cell.backgroundColor = [UIColor redColor];
    37. UILabel *busStopLabel = [AppHelper labelWithTag:kTagBusStopLabel inView:cell];
    38. UILabel *routeLabel = [AppHelper labelWithTag:kTagRouteLabel inView:cell];
    39. UILabel *mainNumberLabel = [AppHelper labelWithTag:kTagMainNumberLabel inView:cell];
    40. UILabel *minutesLabel = [AppHelper labelWithTag:kTagMinutesLabel inView:cell];
    41. UIImageView *mainImageView = [AppHelper imageViewWithTag:kTagMainImageView inView:cell];
    42. UIButton *pickerButton = [AppHelper buttonWithTag:kTagPickerButton inView:cell];
    43. UIButton *starButton = [AppHelper buttonWithTag:kTagStarButton inView:cell];
    44. UIButton *directionsButton = [AppHelper buttonWithTag:kTagDirectionsbutton inView:cell];
    45. UIImage *pickerImage = [StyleKit drawImage:DrawingPicker size:CGSizeMake(50, 50)];
    46. [pickerButton setImage:pickerImage forState:UIControlStateNormal];
    47. [pickerButton setTitle:nil forState:UIControlStateNormal];
    48. [pickerButton removeTarget:nil action:NULL forControlEvents:UIControlEventAllEvents];
    49. [pickerButton addTarget:self action:@selector(pickerButtonTapped:) forControlEvents:UIControlEventTouchUpInside];
    50. UIImage *starOffImage = [StyleKit drawImage:DrawingStarOff size:CGSizeMake(50, 50)];
    51. UIImage *starOnImage = [StyleKit drawImage:DrawingStarOn size:CGSizeMake(50, 50)];
    52. [starButton setImage:starOffImage forState:UIControlStateNormal];
    53. [starButton setImage:starOnImage forState:UIControlStateSelected];
    54. [starButton setTitle:nil forState:UIControlStateNormal];
    55. [starButton removeTarget:nil action:NULL forControlEvents:UIControlEventAllEvents];
    56. [starButton addTarget:self action:@selector(starButtonTapped:) forControlEvents:UIControlEventTouchUpInside];
    57. UIImage *directionsImage = [StyleKit drawImage:DrawingDirections size:CGSizeMake(50, 50)];
    58. [directionsButton setImage:directionsImage forState:UIControlStateNormal];
    59. [directionsButton setTitle:nil forState:UIControlStateNormal];
    60. [directionsButton removeTarget:nil action:NULL forControlEvents:UIControlEventAllEvents];
    61. [directionsButton addTarget:self action:@selector(directionsButtonTapped:) forControlEvents:UIControlEventTouchUpInside];
    62. return cell;
    63. }
    64. #pragma mark - UICollectionViewDelegate
    65. #pragma mark -
    66. - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
    67. // TODO: implement
    68. NSLog(@"Selected item!");
    69. }
    70. #pragma mark - UICollectionViewDelegateFlowLayout
    71. #pragma mark -
    72. - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
    73. CGSize size = collectionView.frame.size;
    74. LOG_SIZE(@"cell", size);
    75. return collectionView.frame.size;
    76. }
    Alles anzeigen


    Text, text, text
    * Kann Spuren von Erdnüssen enthalten.
  • Firefox 37.0.1

    NSObject schrieb:

    JavaScript-Quellcode: lychee

    1. build.album = (data) ->
    2. return '' if not data?
    3. title = data.title
    4. longTitle = ''
    5. typeThumb = ''
    6. if title? and title.length > 18
    7. title = data.title.substr(0, 18) + '...'
    8. longTitle = data.title
    9. if data.thumb0.split('.').pop() is 'svg' then typeThumb = 'nonretina'
    10. html = """
    11. <div class='album' data-id='#{ data.id }' data-password='#{ data.password }'>
    12. <img src='#{ data.thumb2 }' width='200' height='200' alt='thumb' data-type='nonretina'>
    13. <img src='#{ data.thumb1 }' width='200' height='200' alt='thumb' data-type='nonretina'>
    14. <img src='#{ data.thumb0 }' width='200' height='200' alt='thumb' data-type='#{ typeThumb }'>
    15. <div class='overlay'>
    16. """
    17. if data.password and lychee.publicMode is false
    18. html += "<h1 title='#{ longTitle }'><span class='icon-lock'></span> #{ title }</h1>";
    19. else
    20. html += "<h1 title='#{ longTitle }'>#{ title }</h1>"
    21. html += """
    22. <a>#{ data.sysdate }</a>
    23. </div>
    24. """
    25. if lychee.publicMode is false
    26. if data.star is '1' then html += "<a class='badge icon-star'></a>"
    27. if data.public is '1' then html += "<a class='badge icon-share'></a>"
    28. if data.unsorted is '1' then html += "<a class='badge icon-reorder'></a>"
    29. if data.recent is '1' then html += "<a class='badge icon-time'></a>"
    30. html += "</div>"
    31. return html
    32. build.photo = (data) ->
    33. return '' if not data?
    34. title = data.title
    35. longTitle = ''
    36. if title? and title.length > 18
    37. title = data.title.substr(0, 18) + '...'
    38. longTitle = data.title
    Alles anzeigen

    JavaScript-Quellcode

    1. contextMenu.add = function(e) {
    2. var items = [
    3. { type: 'item', title: 'Upload Photo', icon: 'icon-picture', fn: function() { $('#upload_files').click() } },
    4. { type: 'separator' },
    5. { type: 'item', title: 'Import from Link', icon: 'icon-link', fn: upload.start.url },
    6. { type: 'item', title: 'Import from Dropbox', icon: 'icon-folder-open', fn: upload.start.dropbox },
    7. { type: 'item', title: 'Import from Server', icon: 'icon-hdd', fn: upload.start.server },
    8. { type: 'separator' },
    9. { type: 'item', title: 'New Album', icon: 'icon-folder-close', fn: album.add }
    10. ];
    11. basicContext.show(items, e);
    12. upload.notify();
    13. }
    14. contextMenu.settings = function(e) {
    15. var items = [
    16. { type: 'item', title: 'Change Login', icon: 'icon-user', fn: settings.setLogin },
    17. { type: 'item', title: 'Change Sorting', icon: 'icon-sort', fn: settings.setSorting },
    18. { type: 'item', title: 'Set Dropbox', icon: 'icon-folder-open', fn: settings.setDropboxKey },
    19. { type: 'separator' },
    20. { type: 'item', title: 'About Lychee', icon: 'icon-info-sign', fn: function() { window.open(lychee.website) } },
    21. { type: 'item', title: 'Diagnostics', icon: 'icon-dashboard', fn: function() { window.open('plugins/check/') } },
    22. { type: 'item', title: 'Show Log', icon: 'icon-list', fn: function() { window.open('plugins/displaylog/') } },
    23. { type: 'separator' },
    24. { type: 'item', title: 'Sign Out', icon: 'icon-signout', fn: lychee.logout }
    25. ];
    26. basicContext.show(items, e);
    27. }
    28. contextMenu.album = function(albumID, e) {
    29. if (albumID==='0'||albumID==='f'||albumID==='s'||albumID==='r') return false;
    30. var items = [
    31. { type: 'item', title: 'Rename', icon: 'icon-edit', fn: function() { album.setTitle([albumID]) } },
    32. { type: 'item', title: 'Delete', icon: 'icon-trash', fn: function() { album.delete([albumID]) } }
    33. ];
    34. $('.album[data-id="' + albumID + '"]').addClass('active');
    35. basicContext.show(items, e, contextMenu.close);
    36. }
    Alles anzeigen
    Code

    C-Quellcode

    1. - (void)viewWillAppear:(BOOL)animated {
    2. [super viewWillAppear:animated];
    3. LOG_FRAME(@"home view", self.view.frame);
    4. LOG_FRAME(@"collection view", self.collectionView.frame);
    5. }
    6. - (void)viewDidAppear:(BOOL)animated {
    7. [super viewDidAppear:animated];
    8. // [self.collectionView reloadData];
    9. self.collectionView.frame = self.view.bounds;
    10. }
    11. #pragma mark - User Action
    12. #pragma mark -
    13. - (void)pickerButtonTapped:(UIButton *)button {
    14. // TODO: implement
    15. DebugLog(@"%@", NSStringFromSelector(_cmd));
    16. }
    17. - (void)starButtonTapped:(UIButton *)button {
    18. // TODO: implement
    19. DebugLog(@"%@", NSStringFromSelector(_cmd));
    20. button.selected = !button.selected;
    21. }
    22. - (void)directionsButtonTapped:(UIButton *)button {
    23. DebugLog(@"%@", NSStringFromSelector(_cmd));
    24. // TODO: implement
    25. }
    26. #pragma mark - UICollectionViewDataSource
    27. #pragma mark -
    28. - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
    29. // TODO: implement
    30. return 5;
    31. }
    32. // The cell that is returned must be retrieved from a call to -dequeueReusableCellWithReuseIdentifier:forIndexPath:
    33. - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
    34. // TODO: implement
    35. UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"BusStopCell" forIndexPath:indexPath];
    36. //cell.backgroundColor = [UIColor redColor];
    37. [directionsButton removeTarget:nil action:NULL forControlEvents:UIControlEventAllEvents];
    38. [directionsButton addTarget:self action:@selector(directionsButtonTapped:) forControlEvents:UIControlEventTouchUpInside];
    39. return cell;
    40. }
    41. #pragma mark - UICollectionViewDelegate
    42. #pragma mark -
    43. - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
    44. // TODO: implement
    45. NSLog(@"Selected item!");
    46. }
    47. #pragma mark - UICollectionViewDelegateFlowLayout
    48. #pragma mark -
    49. - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
    50. CGSize size = collectionView.frame.size;
    51. LOG_SIZE(@"cell", size);
    52. return collectionView.frame.size;
    53. }
    Alles anzeigen

    C-Quellcode: Lorem Update

    1. #import "AppHelper.h"
    2. #import "StyleKit+Additions.h"
    3. #define kTagBusStopLabel 1
    4. #define kTagRouteLabel 2
    5. #define kTagMainImageView 3
    6. #define kTagMainNumberLabel 4
    7. #define kTagMinutesLabel 5
    8. #define kTagWeatherImageView 6
    9. #define kTagTemperatureLabel 7
    10. #define kTagPickerButton 8
    11. #define kTagStarButton 9
    12. #define kTagDirectionsbutton 10
    13. #define kTagDistanceLabel 11
    14. @interface HomeCollectionViewController () <UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout>
    15. @property (weak, nonatomic) IBOutlet UICollectionView *collectionView;
    16. @end
    17. @implementation HomeCollectionViewController
    18. #pragma mark - View Lifecycle
    19. #pragma mark -
    20. - (void)viewWillAppear:(BOOL)animated {
    21. [super viewWillAppear:animated];
    22. LOG_FRAME(@"home view", self.view.frame);
    23. LOG_FRAME(@"collection view", self.collectionView.frame);
    24. }
    25. - (void)viewDidAppear:(BOOL)animated {
    26. [super viewDidAppear:animated];
    27. // [self.collectionView reloadData];
    28. self.collectionView.frame = self.view.bounds;
    29. }
    30. #pragma mark - User Action
    31. #pragma mark -
    32. - (void)pickerButtonTapped:(UIButton *)button {
    33. // TODO: implement
    34. DebugLog(@"%@", NSStringFromSelector(_cmd));
    35. }
    36. - (void)starButtonTapped:(UIButton *)button {
    37. // TODO: implement
    38. DebugLog(@"%@", NSStringFromSelector(_cmd));
    39. button.selected = !button.selected;
    40. }
    41. - (void)directionsButtonTapped:(UIButton *)button {
    42. DebugLog(@"%@", NSStringFromSelector(_cmd));
    43. // TODO: implement
    44. }
    45. #pragma mark - UICollectionViewDataSource
    46. #pragma mark -
    47. - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
    48. // TODO: implement
    49. return 5;
    50. }
    51. // The cell that is returned must be retrieved from a call to -dequeueReusableCellWithReuseIdentifier:forIndexPath:
    52. - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
    53. // TODO: implement
    54. UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"BusStopCell" forIndexPath:indexPath];
    55. //cell.backgroundColor = [UIColor redColor];
    56. [starButton addTarget:self action:@selector(starButtonTapped:) forControlEvents:UIControlEventTouchUpInside];
    57. UIImage *directionsImage = [StyleKit drawImage:DrawingDirections size:CGSizeMake(50, 50)];
    58. [directionsButton setImage:directionsImage forState:UIControlStateNormal];
    59. [directionsButton setTitle:nil forState:UIControlStateNormal];
    60. [directionsButton removeTarget:nil action:NULL forControlEvents:UIControlEventAllEvents];
    61. [directionsButton addTarget:self action:@selector(directionsButtonTapped:) forControlEvents:UIControlEventTouchUpInside];
    62. return cell;
    63. }
    64. #pragma mark - UICollectionViewDelegate
    65. #pragma mark -
    66. - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
    67. // TODO: implement
    68. NSLog(@"Selected item!");
    69. }
    70. #pragma mark - UICollectionViewDelegateFlowLayout
    71. #pragma mark -
    72. - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
    73. CGSize size = collectionView.frame.size;
    74. LOG_SIZE(@"cell", size);
    75. return collectionView.frame.size;
    76. }
    Alles anzeigen





    Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
    * Kann Spuren von Erdnüssen enthalten.
  • beage schrieb:

    MacounFFM schrieb:

    beage schrieb:

    Ganz kryptisch wird es, wenn man Text gemischt mit Code zitiert und dann auch wieder mit Text und Code antwortet.

    beage schrieb:

    little_pixel schrieb:

    Dann hast Du das Problem auch?

    Dann bin ich zum Glück nicht der Sonderfall :D

    Viele Grüße
    Jo, gestern hat es mich extrem genervt.Ich verwende FF 37.0.1Scheint also browserunabhängig zu sein
    Kannst Du auch die PlugIns abschalten und noch mal probieren.
    Test OHNE PluginsEdit: Scheint zu gehen
    Edit2: Jetzt ein Code mit rein... Jetzt spielt Firfox verrückt. Siehe Anhang. Dann Beachball und Scriptfehler.
    Ich werde die Screenshots und Eure Berichte mal so ungefiltert weitergeben. Kann es nicht selbst reproduzieren.
  • Ich habe keine Plugins und nur Safari.

    Bei mir sieht der Editor dann auch aus, wie bei beage auf dem ersten Bild gezeigt.

    Ich habe die Vermutung, dass es daran liegt woher der Code kopiert wird.
    Bei mir aus Xcode und TextEdit.

    Während dem Schreiben ist es okay, aber nach dem Absenden, also bei der Darstellung im Forum geht es dann kaputt.

    Viele Grüße